-
Notifications
You must be signed in to change notification settings - Fork 20
Scumm scripts
SCUMM uses a number of scripts that the engine calls to do some special things. They allow overriding default behaviours, etc.
This script handles user input via the mouse and keyboard.
Set via:
VAR_VERB_SCRIPT
Arguments:
script(area, cmd, btn)
Area indicates the input type: 1 is on the verbs, 2 on the room image and 4 is keyboard input. For area 1 (verb), cmd is the clicked verb or 0. For area 2 (the room), btn indicates if button 1 or 2 was clicked. For area 4 (the keyboard), cmd is the keycode.
This script is used to implement custom behaviour for an actor's walking animation.
Set via:
setActorWalkScript(actor)
Arguments:
script(actor, cmd, dir)
Actor is obviously the actor walking. cmd indicates what's happening: 1 = start walking, 2 = change direction, 3 = stop walking. dir is the direction in which the actor should walk.
Similar to the walk script but for talking animations.
Set via:
setActorTalkScript(actor)
Arguments:
script(actor, frame)
The "pre" scripts are called before the room specific entry/exit scripts, and the "post" scripts are called after.
Set via:
VAR_PRE_ENTRY_SCRIPT, VAR_POST_ENTRY_SCRIPT,
VAR_PRE_EXIT_SCRIPT, VAR_POST_EXIT_SCRIPT
Arguments:
script()
In the exit scripts, VAR_NEW_ROOM can be used to find out which room will be loaded afterwards.
This script is called for each new sentence queued by doSentence. If doSentence is called several times with the same arguments, only the first call is taken into account. If objectA == objectB, the sentence is ignored.
Set via:
VAR_SENTENCE_SCRIPT
Arguments:
script(verb, objectA, objectB)
This script is called when the inventory needs to change. That is, when an object's name or owner changes, and when the camera starts following a new actor.
Set via:
VAR_INVENTORY_SCRIPT
Arguments:
script(obj)
If the owner of an object has changed, then this object is passed as the argument. When the followed actor or an object name has changed, 0 is passed as the argument.
These scripts are called before/after a cutscene.
Set via:
VAR_CUTSCENE_START_SCRIPT, VAR_CUTSCENE_END_SCRIPT
Arguments:
script()
The start script receives all arguments passed to the cutscene block. The end script only gets the first one.
These scripts are run before entering the menu and after leaving it.
Set via:
VAR_GUI_ENTRY_SCRIPT, VAR_GUI_EXIT_SCRIPT
Arguments:
script()
This script is called when the camera has been moved.
Set via:
VAR_CAMERA_SCRIPT
Arguments:
script()