Scumm 6 functionsAn almost complete list of the bultin functions in scumm. A couple are still missing as they are not yet usable in ScummC for some reason. Nearly all need a better description. I renamed many functions compared to the name found in ScummVM and other references in order to bring a little more consistence in the naming schema and make some name more descriptive. Any comments or suggestion is more than welcome.
Table of contents:- 1. Scripts
- 2. Interface
- cursorOn(), cursorOff()
- userPutOn(), userPutOff()
- softCursorOn(), softCursorOff(), softUserPutOn(), softUserPutOff()
- setCursorImage( obj, room )
- setCursorHotspot( x, y )
- setCursorTransparency( color )
- initCharset( chset )
- setCharsetColors( [ colors ] )
- panCameraTo( x )
- setCameraAt( x )
- cameraFollowActor( actor )
- grabCursor( x, y, w, h )
- clearCharsetMask()
- 3. Room
- startRoom( room )
- startRoomWithEgo( obj, room, x, y )
- setBoxFlags( [ boxes ], flags )
- createBoxMatrix()
- int getSpecialBox( x, y )
- int isInBox( x, y, box )
- int getBoxFlags( box )
- setBoxSet( set )
- setRoomColor( r ,g ,b ,color )
- setShakeOn(), setShakeOff()
- setRoomIntensity( scale, start, end )
- setRoomRGBIntensity( rScale, gScale, bScale, start, end )
- setRoomShadow( rScale, gScale, bScale, start, end )
- roomPalManipulate( resID, start, end, time )
- setRoomCycleDelay( cycle, delay )
- setRoomPalette( palette )
- setRoomScroll( minx, maxx )
- setScreen( top, bottom )
- screenEffect( effect )
- setPseudoRooms( room, [ pseudos ] )
- fadeOut( effect ), fadeIn( effect )
- setShadowPalette( startColor, endColor, rScale, gScale, bScale )
- shiftShadowPalette( startColor, endColor, rScale, gScale, bScale, start, end )
- int getRoomObjects( room )
- saveLoadThing( a, b )
- 4. Objects
- startObject( flags, obj, verb, [ args ] )
- startObject2( obj, verb, [ args ] )
- drawObject( obj, state )
- drawObjectAt( obj, x, y )
- int isObjectOfClass( obj, [ classes ] )
- setObjectClass( obj, [ classes ] )
- int getObjectState( obj ), setObjectState( obj, state )
- int getObjectOwner( obj ), setObjectOwner( obj, owner )
- pickupObject( obj, room )
- int getObjectX( obj ), int getObjectY( obj )
- int getObjectDir( obj )
- setObjectName( obj, name )
- int getObjectAt( x, y )
- int getObjectVerbEntrypoint( obj, verb )
- int getRoomObjectX( obj ), int getRoomObjectY( obj )
- int getRoomObjectWidth( obj ), int getRoomObjectHeight( obj )
- enqueueObject( obj, x, y, w, h, scaleX, scaleY, image )
- stampObject( obj, x, y, state )
- int getObjectNewDir( obj )
- loadFlObject( obj, room )
- 5. Actor
- setCurrentActor( actor )
- initActor()
- initActorQuick()
- setActorName( name )
- walkActorToObj( actor, object, distance )
- walkActorTo( actor, x, y )
- putActorAt( actor, x, y, room )
- putActorAtObject( actor, obj, room )
- actorFace( actor, obj )
- setActorStanding()
- setActorDirection( dir )
- actorTurnToDirection( dir )
- setActorIgnoreTurnsOn(), setActorIgnoreTurnsOff()
- actorFreeze(), actorUnfreeze()
- setActorWalkSpeed( x, y )
- int isActorMoving( actor )
- setActorIgnoreBoxes()
- setActorFollowBoxes()
- int getActorElevation( actor ), setActorElevation( ev )
- int getActorCostume( actor ), setActorCostume( cost )
- animateActor( actor, anim )
- setActorAnimSpeed( speed )
- setActorWalkFrame( frame )
- setActorTalkFrame( start, stop )
- setActorStandFrame( frame )
- setActorInitFrame( frame )
- setActorDefaultFrames()
- int getActorAnimVar( actor, var ), setActorAnimVar( actor, var )
- int getActorAnimCounter1( actor )
- setActorSounds( [ sounds ] )
- int getActorRoom( actor )
- int getActorWalkBox( actor )
- setActorPalette( pal, b )
- setActorTalkColor( color )
- int getActorWidth( actor ), setActorWidth( width )
- setActorScale( a )
- actorNeverZClip()
- setActorZClip( clip )
- setActorShadowMode( mode )
- setActorTalkPos( x, y )
- int getActorLayer( actor ), setActorLayer( layer )
- setActorWalkScript( script )
- setActorTalkScript( script )
- int getActorAt( x, y )
- int getActorXScale( actor )
- int isActorInBox( actor, box )
- actorSay( actor, string ), egoSay( string )
- int getActorFrame( actor )
- setActorScale( unk, x )
- setActorShadowMode( actor, modeA, modeB )
- stopTalking()
- 6. Inventory
- 7. Verb
- doSentence( verb, objA, dummy, objB)
- int getVerbAt( x, y )
- setCurrentVerb( verb )
- setVerbImage( obj )
- setVerbName( name )
- setVerbColor( color )
- setVerbHiColor( color )
- setVerbXY( x, y )
- setVerbOn(), setVerbOff()
- killVerb()
- initVerb()
- setVerbDimColor( color )
- verbDim()
- setVerbKey( key )
- verbCenter()
- setVerbNameString( array )
- setVerbObject( obj, room )
- setVerbBackColor( color )
- redrawVerb()
- saveVerbs( fromVerb, toVerb, slot ), restoreVerbs( fromVerb, toVerb, slot)
- deleteVerbs( fromVerb, toVerb, slot )
- int getVerbX( verb ), int getVerbY( verb )
- 8. Music and sound
- 9. Ressources
- loadScript( script ), loadSound( sound ), loadCostume( cost ), loadRoom( room ), loadCharset( chset)
- nukeScript( script ), nukeSound( sound ), nukeCostume( cost ), nukeRoom( room ), nukeCharset( chset )
- lockScript( script ), lockSound( sound ), lockCostume( cost ), lockRoom( room )
- unlockScript( script ), unlockSound( sound ), unlockCostume( cost ), unlockRoom( room )
- nukeFlObjects( unk, first, last )
- 10. Game
- 11. Print
- 12. Utils
- int getRandomNumber( max )
- int getRandomNumberRange( min, max )
- drawBox( x1, y1, x2, y2, color )
- int isAnyOf( val, [ list ] )
- int abs( val )
- int getDistObjObj( objA, objB )
- int getDistObjPt( obj, x, y )
- int getDistPtPt( x1, y1, x2, y2 )
- int getPixel( x, y )
- int getColor( r, g, b )
- int getKeyState( key )
- swapColors( colorA, colorB )
- copyColor( src, dst )
- int pickOneOf( idx, [ list ] )
- int pickOneOfDefault( idx, [ list ], default )
- getDateTime()
- shuffle( array, min, max )
1. Scripts
startScript( flags, script, [ args ] )OP Code: 0x5E The 2 first bits of flags are used: bit 0 mean freeze resistant, and bit 1 recursive. Freeze resistant mean that the script won't be freezed by "normal" freezeUnfreeze() calls. If recursive is not set, then any running instance of the script is stopped before the script is started.
startScript0( script, [ args ] )OP Code: 0x5F Same as calling startScript with flags set to 0.
startScript2( script, [ args ] )OP Code: 0xBF Same as calling startScript with flags set to 2.
freezeUnfreeze( a )OP Code: 0x6A Unfreeze all frozen thread if a == 0. If a < 0x80 it freeze all freezable threads. If a >= 0x80 it freeze all threads including the unfreezable. Freezing is a nestable operation, a thread which is frozen twice must be thawed twice before it becomes runnable again.
breakScript()OP Code: 0x6C Break out of the current script letting other scripts execute.
breakXTimes( X )OP Code: 0xCA Break a script X times.
stopObjectScript( obj )OP Code: 0x77 Stop an object script.
stopScript( script )OP Code: 0x7C Stop a script.
int isScriptRunning( script )OP Code: 0x8B Check if a script is running.
waitForActor( actor )OP Code: 0xA9A8 Break the current script until the actor stop moving.
waitForMessage()OP Code: 0xA9A9 Break the script as long a message is displayed (check VAR_HAVE_MSG).
waitForCamera()OP Code: 0xA9AA Break the current script until the camera finished moving.
waitForSentence()OP Code: 0xA9AB Break the current script until the sentence script is finished.
waitForAnimation( actor )OP Code: 0xA9E2 Break the current script until the actor animation is finished ??
waitForTurn( actor )OP Code: 0x9AE8 Break the current script until the actor finished turning. WARNING: ScummVM have a dirty hack bcs of some problems in the dig. See scumm/script_v6.cpp for more details. If the actor have an id such that actor % 45 == 0 the hack will kick in and the current actor will be used instead.
delay( ticks ), delaySeconds( sec ), delayMinutes( min )OP Code: 0xB0, 0xB1, 0xB2 Break the current script for some times. A tick is 1/60th of a second.
stopSentence()OP Code: 0xB3 Stop the sentence script.
killAllScriptsExceptCurrent()OP Code: 0xC9 [ 0x09 ] Stop all script except the current one.
jumpToScript( flags, script, [ args ] )OP Code: 0xD5 Stop all running script, then start a new one. flags are the same as for startScript.
int isRoomScriptRunning( obj )OP Code: 0xD8 Check if the verb script from an object owned by the room is running. This opcode is not supported by the LEC interpreter.
2. Interface
cursorOn(), cursorOff()OP Code: 0x6B90, 0x6B91 Enable/Disable the mouse cursor.
userPutOn(), userPutOff()OP Code: 0x6B92, 0x6B93 Enable/Disable user input.
softCursorOn(), softCursorOff(), softUserPutOn(), softUserPutOff()OP Code: 0x6B94-0x6B97 These are a bit different, they use ++ and -- instead of setting to 0 or 1. Dunno what they are good for.
setCursorImage( obj, room )OP Code: 0x6B99 Use the given object as cursor.
setCursorHotspot( x, y )OP Code: 0x6B9A Set the cursor hotspot coordinate.
setCursorTransparency( color )OP Code: 0x6BD6 Set the transparent color for the cursor.
initCharset( chset )OP Code: 0x6B9C Set the charset used for text.
setCharsetColors( [ colors ] )OP Code: 0x6B9D Set the colormap used for the charset, it need 16 entries.
panCameraTo( x )OP Code: 0x78 Pan the camera to show column x.
setCameraAt( x )OP Code: 0x7A Set camera to show column x.
cameraFollowActor( actor )OP Code: 0x79 Make the camera automatically follow the given actor.
grabCursor( x, y, w, h )OP Code: 0xC9 [ 0x04 ] Set the cursor from a part of the view.
clearCharsetMask()OP Code: 0xC9 [ 0x6E ]
3. Room
startRoom( room )OP Code: 0x7B Start the given room. WARNING: In scummvm this function is named loadRoom. However it is clashing with the ressource functions. So I renamed this one startRoom which anyway better reflect what it do.
startRoomWithEgo( obj, room, x, y )OP Code: 0x85 Load a room then walk the actor to the given object ?? If x is not -1 walk to x, y ?? WARNING: In scummvm this function is named loadRoomWithEgo, I renamed it to match the startRoom() function.
setBoxFlags( [ boxes ], flags )OP Code: 0x99 Set the given flags for on the box listed. The flags are the same as those stored in the BOXD structure. For reference:
- 0x08 : X flip
- 0x10 : Y flip
- 0x20 : Ignore scale / Player only
- 0x40 : Locked
- 0x80 : Invisible
To disable/enable a box blocking/allowing actors to go throuh it you want to set the Invisible flag. When this is done createBoxMatrix() must be called for the changes to take effect.
createBoxMatrix()OP Code: 0x9A Recreate the room box matrix of the current room. The box matrix store the paht between the box, in other word how to get from bax A to box B.
int getSpecialBox( x, y )OP Code: 0xC8 [ 0x73 ]
int isInBox( x, y, box )OP Code: 0xC8 [ 0x74 ] Check if a point is inside a box.
int getBoxFlags( box )OP Code: 0xC8 [ 0xD7 ] Get the flags of a box.
setBoxSet( set )OP Code: 0xE4 Switch the room to an alternative box set. This mean room can have several box set, that's new to me as in 0.6.1 that op code did nothing.
setRoomColor( r ,g ,b ,color )OP Code: 0x9CAF Set a palette entry.
setShakeOn(), setShakeOff()OP Code: 0x9CB0,0x9CB1 Start, stop the good old shaking effect.
setRoomIntensity( scale, start, end )OP Code: 0x9CB3 Equivalent to setRoomRGBIntensity(scale,scale,scale,start,end). This will generaly be used to darken the image and such kind of effect.
setRoomRGBIntensity( rScale, gScale, bScale, start, end )OP Code: 0x9CB6 Modify the rgb intensity of the palette elements from start to end. The scaling is as follow: newRed = red * rScale / 0xFF.
setRoomShadow( rScale, gScale, bScale, start, end )OP Code: 0x9CB7 Setup the shadow palette. Entries are defined with: r = ((palR/4)*rScale)/256 where palR is the red value of the color in the current palette.
roomPalManipulate( resID, start, end, time )OP Code: 0x9CBA Do some tricks with palette, dunno what. It seems resID must a palette.
setRoomCycleDelay( cycle, delay )OP Code: 0x9CBB Set the delay betwen palette rotation steps.
setRoomPalette( palette )OP Code: 0x9CD5 Set the current room palette.
setRoomScroll( minx, maxx )OP Code: 0x9CAC Set the area that will be visible. Internaly it just set VAR_CAMERA_MIN_X and VAR_CAMERA_MAX_X but it also clamp their value screenWidth/2 and roomWidth-(screenWidth/2).
setScreen( top, bottom )OP Code: 0x9CAE Setup the room image size and position. The height (bottom-top) MUST match the height of the room image otherwise the rendering go havoc.
screenEffect( effect )OP Code: 0x9CB5 Set the effect that will be used on the next room switching. The effect parameter store in fact 2 effect a closing and an openning one. The higest byte define the closing effect and the lowest byte define the opening effect. So for ex. scrennEffect(0x8082) would first do the dissolve then the scroll.
- 0x01: box closing effect with the image
- 0x02: new image slide from the top left
- 0x03: new image slide from the bottom right
- 0x04: old image slide to the top left
- 0x05: box opening with the image
- 0x06: new image slide from the left and a bit above
- 0x80: disolve
- 0x81: black screen
- 0x82: scroll from the left
- 0x83: scroll from the right
- 0x84: scrool from the top
- 0x85: scrool from the bottom
- 0x86: fine dissolve
- 0x87: columns dissolve
setPseudoRooms( room, [ pseudos ] )OP Code: 0xA1 Set the listed pseudo room to point to room. pseudo rooms must be greater or equal to 0x80.
fadeOut( effect ), fadeIn( effect )OP Code: 0xC9 [ 0x05 ], 0xC9 [ 0x06 ] Perform a fade-in or fade-out affect like on room transition.
setShadowPalette( startColor, endColor, rScale, gScale, bScale )OP Code: 0xC9 [ 0x6C ]
shiftShadowPalette( startColor, endColor, rScale, gScale, bScale, start, end )OP Code: 0xC9 [ 0x70 ]
int getRoomObjects( room )OP Code: 0xDD Return an array with all object in the room. ScummVM have a warning if room is not the current room. Dunno why. This OP code is not supported by the LEC interpreter for dott.
saveLoadThing( a, b )OP Code: 0x9CB3 Really dunno what that do.
4. ObjectsNote that objects and actors share the same address space. Actors have address es up to 0xE (0xF is used to represent the room). This mean that some of the following functions are also usable with actors.
startObject( flags, obj, verb, [ args ] )OP Code: 0x60 Execute the code attached to an abject verb. Flags are the same as for scripts: bit 0 freeze resistant, bit 1 recursive.
startObject2( obj, verb, [ args ] )OP Code: 0xBE Same as calling startObject with flags set to 2.
drawObject( obj, state )OP Code: 0x61 Force a redraw. If state is 0 it's set to 1, probably to be sure it really draw something.
drawObjectAt( obj, x, y )OP Code: 0x62 Same as drawObject but at a given position.
int isObjectOfClass( obj, [ classes ] )OP Code: 0x6D Check if an object match the given class combination. If the class number is ored with 0x80 then the object must belong to the class, otherwise it musn't belong to it. For ex isObjectOfClass(obj,[ Openable + 128, Pickable ]) will return 1 if the object is Openable and not Pickable. Note that we use + here because the LEC interpreter doesn't support bitwise or. As classes number only range up to 32 using + is ok anyway.
setObjectClass( obj, [ classes ] )OP Code: 0x6E Set the classes an object belong to. As for isObjectOfClass() the higest bit of the classes indicate if the object belong to the class or not. 0 have a special effect it reset the class of the object at the same index (inside the room). That must be checked against the LEC interpreter.
int getObjectState( obj ), setObjectState( obj, state )OP Code: 0x6F, 0x70 Get/Set the state of an object.
int getObjectOwner( obj ), setObjectOwner( obj, owner )OP Code: 0x72, 0x71 Get/Set the owner of an object. Owner should be an actor, but can be 0.
pickupObject( obj, room )OP Code: 0x84 Make VAR_EGO the owner of the object, set the object as untouchable, turn it into state 1 and run the inventory script. It's generaly just what is needed to pick an object from the room.
int getObjectX( obj ), int getObjectY( obj )OP Code: 0x8D, 0x8E Get the object/actor X or Y coordinate.
int getObjectDir( obj )OP Code: 0x8F Get the direction of an object, that is in which direction actors standing in front of it should look.
setObjectName( obj, name )OP Code: 0x97 Change the name of an object.
int getObjectAt( x, y )OP Code: 0xA0 Find the object at the given position.
int getObjectVerbEntrypoint( obj, verb )OP Code: 0xA3 Return the offset at which the code for the given verb is found. Mostly useful to find out if an object implement a verb or not.
int getRoomObjectX( obj ), int getRoomObjectY( obj )OP Code: 0xC8 [ 0xCF ], 0xC8 [ 0D0 ] Get the position of an object in the current room.
int getRoomObjectWidth( obj ), int getRoomObjectHeight( obj )OP Code: 0xC8 [ 0xD1 ], 0xC8 [ 0D2 ] Get the size of an object in the current room.
enqueueObject( obj, x, y, w, h, scaleX, scaleY, image )OP Code: 0xC9 [ 0x77 ]
stampObject( obj, x, y, state )OP Code: 0xCD Dunno really what this function is about. It basically just set the object state, optionaly setting the object position to x*8,y*8 if x != -1.
int getObjectNewDir( obj )OP Code: 0xED Get the object direction in a "new" format ??
loadFlObject( obj, room )OP Code: 0x9B77 Create an FlObject effectively loading an object from another room in the current one.
5. Actor
setCurrentActor( actor )OP Code: 0x9DC5 Set an actor as the current one.
initActor()OP Code: 0x9D53 Reset the actor and play it's init anim ??
initActorQuick()OP Code: 0x9DD9 Like actorInit() but it directly go to anim 2 (the walk anim by default).
setActorName( name )OP Code: 0x9D58 Set the name of the current actor.
walkActorToObj( actor, object, distance )OP Code: 0x7D Make an actor walk to an object. It will go at distance pixel away from the object, where distance is only horizontal.
walkActorTo( actor, x, y )OP Code: 0x7E Make an actor walk to the given position.
putActorAt( actor, x, y, room )OP Code: 0x7F Give an actor a new position. If room == 0xFF, it use the room where the actor currently is.
putActorAtObject( actor, obj, room )OP Code: 0x80 Put an actor next to an object, eventually in another room ??
actorFace( actor, obj )OP Code: 0x81 Make the actor face the given object or actor.
setActorStanding()OP Code: 0x9DE5 Stop the current actor and make it stand.
setActorDirection( dir )OP Code: 0x9DE6 Set the direction of the current actor.
actorTurnToDirection( dir )OP Code: 0x9DE7 Make the actor turn to the given direction. The direction is in degree (0 is north, 90 east, 180 south and 270 west). This doesn't seems to be supported by the LEC interpreter.
setActorIgnoreTurnsOn(), setActorIgnoreTurnsOff()OP Code: 0x9DD7, 0x9DD8 Probably change the way the current actor is turning on himself.
actorFreeze(), actorUnfreeze()OP Code: 0x9DE9, 0x9DEA Freeze, unfreeze the current actor.
setActorWalkSpeed( x, y )OP Code: 0x9D4D Set the walking spped of the current actor. The higher the value the slowver it is.
int isActorMoving( actor )OP Code: 0x8A Check if the actor is moving ??
setActorIgnoreBoxes()OP Code: 0x9D5F Allow the current actor to go anywhere ??
setActorFollowBoxes()OP Code: 0x9D60 Force the actor to stay in the boxes.
int getActorElevation( actor ), setActorElevation( ev )OP Code: 0xA2, 0x9D54 Get the elevation of the given actor. Set the elevation of the current actor.
int getActorCostume( actor ), setActorCostume( cost )OP Code: 0x91, 0x9D4C Get the costume weared by an actor. Set the costume of the current actor.
animateActor( actor, anim )OP Code: 0x82 Make the actor play the given anim.
setActorAnimSpeed( speed )OP Code: 0x9D61 Set the current actor animation speed.
setActorWalkFrame( frame )OP Code: 0x9D4F Change the frame used for the walk anim of the current actor. Default to 2.
setActorTalkFrame( start, stop )OP Code: 0x9D50 Change the frames used for starting, stoping a talking sequence. Default to 4 and 5.
setActorStandFrame( frame )OP Code: 0x9D51 Set the anim used when the current actor is standing. Default to 3 .
setActorInitFrame( frame )OP Code: 0x9D59 Set the anim used when initing the current actor. Default to 1.
setActorDefaultFrames()OP Code: 0x9D55 Reset the current actor anims to the defaults.
int getActorAnimVar( actor, var ), setActorAnimVar( actor, var )OP Code: 0xD2, 0x9DC6 Get/Set the value of an actor animation variable.
int getActorAnimCounter1( actor )OP Code: 0xAB Get the actor's first anim counter. Dunno what that is.
setActorSounds( [ sounds ] )OP Code: 0x9D4E Set the sounds used by the costume of the current actor.
int getActorRoom( actor )OP Code: 0x8C Get the room in which the actor is ??
int getActorWalkBox( actor )OP Code: 0x90 Is the actor following walke boxes ??
setActorPalette( pal, b )OP Code: 0x9D56 Set the palette of the current actor ??
setActorTalkColor( color )OP Code: 0x9D57 Set the color to be used for text said by the current actor.
int getActorWidth( actor ), setActorWidth( width )OP Code: 0xA8, 0x9D5B Get the actor width. Set the current actor width. Dunno really what's that for.
setActorScale( a )OP Code: 0x9D5C Set the current actor scaling factor.
actorNeverZClip()OP Code: 0x9D5D Disable z clipping on the current actor.
setActorZClip( clip )OP Code: 0x9DE1 Enable / disable z clipping of the current actor.
setActorShadowMode( mode )OP Code: 0x9D62 Set the current actor shadow mode. Dunne what's that is.
setActorTalkPos( x, y )OP Code: 0x9D63 Set the offset to use to place the text of the current actor.
int getActorLayer( actor ), setActorLayer( layer )OP Code: 0xEC, 0x9DE3 Get the layer of an actor, set the layer of the current actor.
setActorWalkScript( script )OP Code: 0x9DE4 Set the walk script for the current actor.
setActorTalkScript( script )OP Code: 0x9DEB Set the talk script for the current actor.
int getActorAt( x, y )OP Code: 0x9F Get the actor at the given position.
int getActorXScale( actor )OP Code: 0xAA Get the X scale factor of the actor.
int isActorInBox( actor, box )OP Code: 0xAF Check if an actor is inside a box.
actorSay( actor, string ), egoSay( string )OP Code: 0xBA Make the actor (or ego) say something. egoSay(s) is equivalent to actorSay(VAR_EGO,s).
int getActorFrame( actor )OP Code: 0xC8 [ 0xD4 ] Get the current frame of an actor.
setActorScale( unk, x )OP Code: 0xC9 [ 0x6B ] Set the actor scaling.
setActorShadowMode( actor, modeA, modeB )OP Code: 0xC9 [ 0x6F ]
stopTalking()OP Code: 0xD1 End all talkings ??
6. Inventory
int findInventory( owner, idx )OP Code: 0x92 Find the object idx (first, second, etc) in the owner inventory.
int getInventoryCount( owner )OP Code: 0x93 Get the number of object owned by owner.
7. Verb
doSentence( verb, objA, dummy, objB)OP Code: 0x83 Prepare a sentence. The sentence script is then called with verb, objA and objB as argument. objB might be 0.
int getVerbAt( x, y )OP Code: 0x94 Find the verb at the given coordinate.
setCurrentVerb( verb )OP Code: 0x9EC4 Set the current verb.
setVerbImage( obj )OP Code: 0x9E7C Set the object image to be used with the current verb. The object must be in the ressource room. To use object from other rooms use verbSetObject().
setVerbName( name )OP Code: 0x9E7D Set the name of the current verb.
setVerbColor( color )OP Code: 0x9E7E Set the color of the current verb.
setVerbHiColor( color )OP Code: 0x9E7F Set the highlight color of the current verb.
setVerbXY( x, y )OP Code: 0x9E80 Set the position of the current verb.
setVerbOn(), setVerbOff()OP Code: 0x9E81, 0x9E82 Enable, disable the current verb.
killVerb()OP Code: 0x9E83 Destroy the current verb.
initVerb()OP Code: 0x9E84 Initialize the current verb.
setVerbDimColor( color )OP Code: 0x9E85 Set the dimmed color for the current verb.
verbDim()OP Code: 0x9E86 Set the current verb as dimmed.
setVerbKey( key )OP Code: 0x9E87 Set the key binded to the current verb ??
verbCenter()OP Code: 0x9E88 Set the current verb as centered.
setVerbNameString( array )OP Code: 0x9E89 Set the current verb name's from an array. This function need the array address as argument.
setVerbObject( obj, room )OP Code: 0x9E8B Set the current verb image using an object from any room.
setVerbBackColor( color )OP Code: 0x9E8C Set the background color for the current verb.
redrawVerb()OP Code: 0x9EFF Redraw the current verb.
saveVerbs( fromVerb, toVerb, slot ), restoreVerbs( fromVerb, toVerb, slot)OP Code: 0xA58D Save/restore the verbs fromVerb to toVerb in to/from the given slot ??
deleteVerbs( fromVerb, toVerb, slot )OP Code: 0xA58E Destroy a verb save ??
int getVerbX( verb ), int getVerbY( verb )OP Code: 0xC8 [ 0xD5 ], 0xC8 [ 0xD6 ] Get the position of a verb.
8. Music and sound
stopMusic()OP Code: 0x69 Stop all sounds ??
startSound( sound )OP Code: 0x74 Play the given sound ??
stopSound( sound )OP Code: 0x75 Stop the sound (or is the argument something else ?)
startMusic( sound )OP Code: 0x76 Same as start sound ??
int isSoundRunning( sound )OP Code: 0x98 Check if the given sound is running ??
saveSound( sound )OP Code: 0xC9 [ 0x7C ]
soundKludge( [ cmds ] )OP Code: 0xAC The main gateway to imuse. This should be abstracted.
9. Ressources
loadScript( script ), loadSound( sound ), loadCostume( cost ), loadRoom( room ), loadCharset( chset)OP Code: 0x9B64-0x9B67, 0x9B75 Ensure that a ressource is loaded.
nukeScript( script ), nukeSound( sound ), nukeCostume( cost ), nukeRoom( room ), nukeCharset( chset )OP Code: 0x9B68-09B6B, 0x9B76 Free a ressource.
lockScript( script ), lockSound( sound ), lockCostume( cost ), lockRoom( room )OP Code: 0x9B6C-0x9B6F Lock a ressource in memory. So it's still avaible even after leaving the room.
unlockScript( script ), unlockSound( sound ), unlockCostume( cost ), unlockRoom( room )OP Code: 0x9B70-0x9B73 Unlock a ressource.
nukeFlObjects( unk, first, last )OP Code: 0xC9 [ 0x68 ] Destroy the FlObjects with address between first and last.
10. Game
restartGame()OP Code: 0xAE9E Restart the game without any confirmation.
pauseGame()OP Code: 0xAE9F Set the game in paused mode.
shutdown()OP Code: 0xAEA0 Quit the game without any confirmation.
11. PrintThe print function are avaible in 6 versions:
- print: 0xB4XX
- cursorPrint: 0xB5XX
- dbgPrint: 0xB6XX
- sysPrint: 0xB7XX
- actorPrint: 0xB8XX
- egoPrint: 0xB9XX
All functions are identical in each varient except actorPrintBegin which take the actor as argument (all other *PrintBegin don't take any argument. Taking printAt as example the other varient are: cursorPrintAt, dbgPrintAt, sysPrintAt, actorPrintAt and egoPrintAt.
printAt( x, y )OP Code: 0xXX41 Set the position where a string should be printed.
printColor( color )OP Code: 0xXX42 Set the color in which the string will be printed.
printClipped( right )OP Code: 0xXX43 Set some clipping ???
printLeft()OP Code: 0xXX47 Set the string to be left aligned ??
printCenter()OP Code: 0xXX45 Set the string to be centered ??
printOverhead()OP Code: 0xXX48 Set the string to be displayed above an actor ??
printMumble()OP Code: 0xXX4A The actor saying it will mumble ??
print( string )OP Code: 0xXX4B Print a string.
printBegin(), printEnd()OP Code: 0xXXFE, 0xXXFF Start/End a print context.
12. Utils
int getRandomNumber( max )OP Code: 0x87 Return a random number betwen 0 and max. VAR_RANDOM_NR is also set with the returned value.
int getRandomNumberRange( min, max )OP Code: 0x88 Return a random number betwen min and max. Also set VAR_RANDOM_NR.
drawBox( x1, y1, x2, y2, color )OP Code: 0xA6 Draw a box, surprised ?
int isAnyOf( val, [ list ] )OP Code: 0xAD Check if val exist in the list.
int abs( val )OP Code: 0xC4 Return the basolute value of val.
int getDistObjObj( objA, objB )OP Code: 0xC5 Get the distance between two objects.
int getDistObjPt( obj, x, y )OP Code: 0xC6 Get the distance between an object and a point.
int getDistPtPt( x1, y1, x2, y2 )OP Code: 0xC7 Get the distance between two points.
int getPixel( x, y )OP Code: 0xC8 [ 0x71 ] Get the value of a pixel from the screen, probably only available in S&M
int getColor( r, g, b )OP Code: 0xC8 [ 0xCE ] Get the best matching palette entry for the given RGB value.
int getKeyState( key )OP Code: 0xC8 [ 0xD3 ] Get the state of a key.
swapColors( colorA, colorB )OP Code: 0xC9 [ 0x78 ] Swap two colors in the palette.
copyColor( src, dst )OP Code: 0xC9 [ 0x7B ] Overwrite a color from the palette with another.
int pickOneOf( idx, [ list ] )OP Code: 0xCB Pick element idx in the list. The engine will spit an error if idx is out of range, dunno if that lead to a shutdown, but probably.
int pickOneOfDefault( idx, [ list ], default )OP Code: 0xCC Like pickOneOf but it return default if idx is out of range.
getDateTime()OP Code: 0xD0 Get the current date and time. The result is set in the folowing variables: VAR_TIMEDATE_YEAR, VAR_TIMEDATE_MONTH, VAR_TIMEDATE_DAY, VAR_TIMEDATE_HOUR and VAR_TIMEDATE_MINUTE.
shuffle( array, min, max )OP Code: 0xD4 Shuffle the array element between index min and max.
|