Program.control

From AGI Wiki
Revision as of 21:20, 18 April 2019 by Andrew Korson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The program.control command changes the ego screen object control mode to program control instead of player control.

Syntax

program.control();

Remarks

When operating in program control mode, player input will not control ego. Instead, ego motion can be controlled just like any other screen object. Using the move.obj, move.obj.v or wander command on ego will also switch ego to program control mode automatically.

If ego is in motion when the program.control command is executed, ego will continue moving in its current direction.

The player.control command will restore normal player control over ego.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> program.control(); [ now player cannot control ego ... player.control(); [ player control is restored </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 131 (0x83 hex)

See Also

System Commands
player.control