Difference between revisions of "Program.control"
From AGI Wiki
Jump to navigationJump to search (Created page with "program.control == <br />Syntax == <blockquote><code>program.control();</code></blockquote> == <br />Description == Prevents the player from moving ego (object 0) ...") |
|||
Line 1: | Line 1: | ||
− | program.control | + | The '''program.control''' command changes the [[ego]] [[screen object]] control mode to program control instead of [[player.control|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 | + | The '''[[player.control]]''' command will restore normal player control over ego. |
− | == | + | == Possible Errors == |
− | + | None. | |
− | == | + | == Example == |
− | + | <div class="CodeBlockHeader">Code:</div> | |
+ | <syntaxhighlight lang="agi"> | ||
+ | program.control(); [ now player cannot control ego | ||
+ | ... | ||
+ | player.control(); [ player control is restored | ||
+ | </syntaxhighlight> | ||
− | + | == Technical Information == | |
− | [[ | + | {| border="1" cellpadding="2" |
− | [[Category: | + | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' |
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 131 (0x83 hex) | ||
+ | |} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | [[System Commands]]<br /> | ||
+ | '''[[player.control]]'''<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 21:20, 18 April 2019
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) |