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.
  
&nbsp;
+
== Syntax ==
  
== <br />Syntax ==
+
get.dir([[screen object|obj]] oA, [[variable|var]] vDIR);
  
<blockquote><code>get.dir(oA,vDIR);</code></blockquote>
+
== Remarks ==
  
== <br />Description ==
+
[[Variable]] '''vDIR''' is assigned the direction of [[screen object]] '''oA'''. The value will be between 0 and 8:
  
vDIR is set to the direction object oA is currently traveling in. The value will be between 0 and 8:
+
<blockquote>[[File:MovingObjects.png]]</blockquote>
  
<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.
  
== <br />Sources ==
+
== Example ==
  
[[AGI Studio Help File]]
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
get.dir(o12, v50);
 +
[ v50 now equals the direction of o12
 +
</syntaxhighlight>
  
== <br />See also ==
+
== Technical Information ==
  
* <code>[[set.dir]]</code>
+
{| border="1" cellpadding="2"
* [[Moving Objects]]
+
| 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)
 +
|}
  
&nbsp;
+
== See Also ==
  
[[Category:Object Commands]]
+
'''[[set.dir]]'''<br />
[[Category:View Commands]]
+
[[Category:Commands]]<br />
[[Category:References]]
 
[[Category:Logic]]
 

Latest revision as of 20:08, 1 April 2019

The get.dir command stores a screen object's direction in a variable.

Syntax

get.dir(obj oA, var vDIR);

Remarks

Variable vDIR is assigned the direction of screen object oA. The value will be between 0 and 8:

MovingObjects.png

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)

See Also

set.dir