Skip to content

Scumm scripts

Alban Bedel edited this page Apr 5, 2015 · 1 revision

SCUMM uses a number of scripts that the engine calls to do some special things. They allow overriding default behaviours, etc.

Verb Script

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.

Walk Script

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.

Talk Script

Similar to the walk script but for talking animations.

Set via: setActorTalkScript(actor)

Arguments: script(actor, frame)

Entry and Exit Script

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.

Sentence Script

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)

Inventory Script

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.

Cutscene Script

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.

GUI Entry/Exit Script

These scripts are run before entering the menu and after leaving it.

Set via: VAR_GUI_ENTRY_SCRIPT, VAR_GUI_EXIT_SCRIPT

Arguments: script()

Camera Script

This script is called when the camera has been moved.

Set via: VAR_CAMERA_SCRIPT

Arguments: script()