![]() |
dsekai
World engine for retrocomputers.
|
Details on scripting interactions with MOBILE actors.
Details on scripting interactions with MOBILE actors.
Interactions allow scripted mobiles to respond to player behavior. An interaction occurs when a player faces a scripted mobile and presses the OK button. This causes the script that mobile, or "actor", is running to jump to an interaction callback defined by the INTERACT (SCRIPT_CB_TABLE_1) instruction in that mobile's script.
The index of the interaction callback that will be called is determined by the MOBILE_ICOUNT_MASK portion of MOBILE::flags, and may be from 0 through 9. This allows a mobile to "say" one thing on first interaction and then different things on subsequent interactions.
Interactions are automatically disabled when an interaction occurs. They can be re-enabled by calling the DISABLE (SCRIPT_CB_TABLE_23) instructions with the arg 0. This is typically done before calling RETURN (SCRIPT_CB_TABLE_7) to return to the main subroutine.