Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "CALL"

From Creatures Wiki
Jump to navigation Jump to search
m
m
 
Line 1: Line 1:
'''CALL''' is a [[Docking Station]]-only [[CAOS]] command.  It is used in the [[Empathic Vendor]] and mini empathic vendor in the push and pull script to randomise what is vended when a creature uses it, and used in the large DS teleporter in the [[Workshop]] to randomise the location when a creature uses it.
+
'''CALL''' is a [[Docking Station]]-only [[CAOS]] command.  It is used in the [[Empathic Vendor]] and mini empathic vendor in the push and pull script to randomise what is vended when a creature uses it, and it is used in the large DS teleporter in the [[Workshop]] to randomise the location when a creature uses it.
  
 
Syntax: ''CALL (command) EVENT_NO (integer) PARAM_1 (anything) PARAM_2 (anything)''
 
Syntax: ''CALL (command) EVENT_NO (integer) PARAM_1 (anything) PARAM_2 (anything)''
  
Calls a [[subroutine]] script on the [[OWNR|owner]] with the specified [[event number]]. When that script finishes the current script is resumed. No [[variable]]s are shared between the two scripts so any return values must go through [[Object Variables|OVs]]. The called script starts in the same [[INST]] state as the calling script, however, it may use [[SLOW]] or INST to override this initial state. In addition, when the script returns to the calling script, the INST state is reset to what it was before the CALL command, so CALL preserves INSTness in the calling script. So if the caller script is in an INST then the called script will inherit that, any change in the called script to cancel this (such as [[OVER]], [[WAIT]], SLOW etc) will only affect the called script... when execution returns to the caller script it will still be in whatever state it was in before.
+
Calls a [[subroutine]] script on the [[OWNR|owner]] with the specified [[script number|event number]]. When that script finishes, the current script is resumed. No [[variable]]s are shared between the two scripts, so any return values must go through [[Object Variables|OVs]]. The called script starts in the same [[INST]] state as the calling script; however, it may use [[SLOW]] or INST to override this initial state. In addition, when the script returns to the calling script, the INST state is reset to what it was before the CALL command, so CALL preserves INSTness in the calling script. So if the caller script is in an INST, then the called script will inherit that; any change in the called script to cancel this (such as [[OVER]], [[WAIT]], SLOW etc) will only affect the called script... when execution returns to the caller script, it will still be in whatever state it was in before.
  
 
==See also==
 
==See also==

Latest revision as of 06:53, 23 July 2022

CALL is a Docking Station-only CAOS command. It is used in the Empathic Vendor and mini empathic vendor in the push and pull script to randomise what is vended when a creature uses it, and it is used in the large DS teleporter in the Workshop to randomise the location when a creature uses it.

Syntax: CALL (command) EVENT_NO (integer) PARAM_1 (anything) PARAM_2 (anything)

Calls a subroutine script on the owner with the specified event number. When that script finishes, the current script is resumed. No variables are shared between the two scripts, so any return values must go through OVs. The called script starts in the same INST state as the calling script; however, it may use SLOW or INST to override this initial state. In addition, when the script returns to the calling script, the INST state is reset to what it was before the CALL command, so CALL preserves INSTness in the calling script. So if the caller script is in an INST, then the called script will inherit that; any change in the called script to cancel this (such as OVER, WAIT, SLOW etc) will only affect the called script... when execution returns to the caller script, it will still be in whatever state it was in before.

See also[edit]