Difference between revisions of "Get.dir"
From AGI Wiki
Jump to navigationJump to search (Created page with "get.dir == <br />Syntax == <blockquote><code>get.dir(oA,vDIR);</code></blockquote> == <br />Description == vDIR is set to the direction object oA is currently trav...") |
|||
Line 1: | Line 1: | ||
− | get.dir | + | The '''get.dir''' command stores a [[screen object|screen object's]] direction in a variable. |
− | + | == Syntax == | |
− | + | get.dir([[screen object|obj]] oA, [[variable|var]] vDIR); | |
− | + | == Remarks == | |
− | + | [[Variable]] '''vDIR''' is assigned the direction of [[screen object]] '''oA'''. The value will be between 0 and 8: | |
− | + | <blockquote>[[File:MovingObjects.png]]</blockquote> | |
− | + | == Possible Errors == | |
+ | |||
+ | AGI does not check that object number '''oA''' is a valid [[screen object]]. If it is not, the returned value will be meaningless. | ||
− | == | + | == Example == |
− | [ | + | <div class="CodeBlockHeader">Code:</div> |
+ | <syntaxhighlight lang="agi"> | ||
+ | get.dir(o12, v50); | ||
+ | [ v50 now equals the direction of o12 | ||
+ | </syntaxhighlight> | ||
− | == | + | == Technical Information == |
− | + | {| border="1" cellpadding="2" | |
− | + | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' | |
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 87 (0x57 hex) | ||
+ | |} | ||
− | + | == See Also == | |
− | [[ | + | '''[[set.dir]]'''<br /> |
− | [[Category: | + | [[Category:Commands]]<br /> |
− | |||
− |
Latest revision as of 20:08, 1 April 2019
The get.dir command stores a screen object's direction in a variable.
Syntax
Remarks
Variable vDIR is assigned the direction of screen object oA. The value will be between 0 and 8:
Possible Errors
AGI does not check that object number oA is a valid screen object. If it is not, the returned value will be meaningless.
Example
Code:
<syntaxhighlight lang="agi"> get.dir(o12, v50); [ v50 now equals the direction of o12 </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 87 (0x57 hex) |