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]].
  
&nbsp;
+
== Syntax ==
  
== <br />Syntax ==
+
program.control();
  
<blockquote><code>program.control();</code></blockquote>
+
== Remarks ==
  
== <br />Description ==
+
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.
  
Prevents the player from moving ego (object 0) around with the arrow keys. After this command has been executed, ego can only be moved by using the various object movement commands that are available such as <code>[[move.obj]]</code>. If ego is already moving, it continues in it’s current direction.
+
If [[ego]] is in motion when the '''program.control''' command is executed, ego will continue moving in its current direction.
  
The player can be given control of ego again by using the <code>[[player.control]]</code> command.
+
The '''[[player.control]]''' command will restore normal player control over ego.
  
== <br />Sources ==
+
== Possible Errors ==
  
[[AGI Studio Help File]]
+
None.
  
== <br />See also ==
+
== Example ==
  
* <code>[[player.control]]</code>
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
program.control();  [ now player cannot control ego
 +
...
 +
player.control();  [ player control is restored
 +
</syntaxhighlight>
  
&nbsp;
+
== Technical Information ==
  
[[Category:References]]
+
{| border="1" cellpadding="2"
[[Category:Logic]]
+
| 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)

See Also

System Commands
player.control