Scheme-functions are triggered by events. The name/identifer
of a function tells the enginee what event it corresponds to.
A function named kitchen::sink::LOOKAT, will be
executed when the player looks at the hotspot sink
in the room kitchen.
The events available are:
A command is a piece of code that tells the enginee
something. Commands are built up by two parts,
a function-name and arguments.
(function-name argument argument ...)
add-item, begin, hide-hotspot, hide-object, remove-item, run-script, set-character-property, set-music, set-room, show-hotspot, show-object, speak
(add-item character item)
This will give the character with identifier character the item identified by item.
(begin cmd1 cmd2 ... cmdn)
This will execute the commands cmd1,cmd2 e.t.c. in a sequence.
(hide-hotspot full-id)
This will deactivate the hotspot identified by full-id, i.e. "kitchen.sink" means the hotspot sink in the room kitchen.
(hide-object full-id)
This will hide the object identified by full-id, i.e. "kitchen.sink" means the object sink in the room kitchen.
(remove-item character item)
The character with identifier character will loose the item identified by item. If the character doesn't have the item nothing happens.
(run-script script-id)
This will execute the script identified by script-id.
(set-character-property id property value)
(set-music file-name)
Plays a song, file-name could be for instance "muppets.mp3". To stop the music use (set-music "").
(set-room id)
Changes which room is shown in the game. id is the identifier of the room.
(show-hotspot full-id)
This will activate the hotspot identified by full-id, i.e. "kitchen.sink" means the hotspot sink in the room kitchen.
(show-object full-id)
This will show the object identified by full-id, i.e. "kitchen.sink" means the object sink in the room kitchen.
(speak character speach)
This will make the character with identifier character speak the words of speach for a while.
Making a character say something:
(define (harbor::sailor::TALKTO)
(speak "player" "hello there old man!"))
Switching rooms: (obsolete)
(begin
(set-character-property "player" "room" "kitchen")
(set-character-property "player" "position" "32,90")
(set-room "kitchen"))