Difference between revisions of "Animate.obj"

From AGI Wiki
Jump to navigationJump to search
(Created page with "The '''animate.obj''' command activates a screen object. == Syntax == : animate.obj(obj oA); == Remarks == If the object number exceeds the Screen obj...")
 
Line 1: Line 1:
The '''animate.obj''' command activates a screen object.
+
The '''animate.obj''' command tells the interpreter to activate the specified object. An object must be activated in the current room before it can be used.
  
== Syntax ==
+
<code>animate.obj(object);</code>
 +
 
 +
== Parameters ==
  
: animate.obj([[Screen objects|obj]] oA);
+
* <code>object</code>: an object, <code>o0-o255;</code> this object will be activated for use ('''note:''' the [[AGI Studio Template Game]] supports only <code>o0-o15</code>)  
  
== Remarks ==
+
== Possible errors ==
  
If the object number exceeds the [[Screen objects#Maximum screen objects|max screen object]] count, AGI will generate an error.
+
* if you specify an [[Animated Object|object]] that is outside the range specified in the [[OBJECT file]], the game will crash with a [[bad object number error]] (note: in the AGI Studio Template Game, the maximum number of objects is 16, meaning that <code>o0</code> through <code>o15</code> are valid; if you specify <code>o16</code>, then this error will occur)
  
Screen objects must be activated with the '''animate.obj''' command before it can be used in any other commands. Attempting to run commands on an uninitialize screen object will generate a runtime error.
+
== Examples ==
  
If you call the '''animate.obj''' command on an object that is already activated, the command is ignored.
+
The following example activates object 3 and assigned VIEW.035 to it:
  
== Example ==
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
animate.obj(o3);
 +
load.view(35);
 +
set.view(o3, 35);
 +
</syntaxhighlight>
  
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
Line 25: Line 32:
 
draw(o2);
 
draw(o2);
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
&nbsp;
 +
== Syntax ==
 +
 +
: animate.obj([[Screen objects|obj]] oA);
 +
 +
== Remarks ==
 +
 +
If the object number exceeds the [[Screen objects#Maximum screen objects|max screen object]] count, AGI will generate an error.
 +
 +
Screen objects must be activated with the '''animate.obj''' command before it can be used in any other commands. Attempting to run commands on an uninitialized screen object will generate a runtime error.
 +
 +
If you call the '''animate.obj''' command on an object that is already activated, the command is ignored.
  
 
&nbsp;
 
&nbsp;
Line 36: Line 56:
 
| 33 (0x21 hex)
 
| 33 (0x21 hex)
 
|}
 
|}
 +
 +
== See also ==
 +
 +
* [[unanimate.all]]
 +
* [[Object|Objects]]
 +
 +
== Sources ==
 +
 +
Some of the text in this article comes from the [[AGI Studio]] help file.
 +
 +
&nbsp;
  
 
[[Category:Logic Commands]]
 
[[Category:Logic Commands]]
 
[[Category:Object and View Commands]]
 
[[Category:Object and View Commands]]

Revision as of 03:41, 13 December 2013

The animate.obj command tells the interpreter to activate the specified object. An object must be activated in the current room before it can be used.

animate.obj(object);

Parameters

  • object: an object, o0-o255; this object will be activated for use (note: the AGI Studio Template Game supports only o0-o15)

Possible errors

  • if you specify an object that is outside the range specified in the OBJECT file, the game will crash with a bad object number error (note: in the AGI Studio Template Game, the maximum number of objects is 16, meaning that o0 through o15 are valid; if you specify o16, then this error will occur)

Examples

The following example activates object 3 and assigned VIEW.035 to it:

Code:
animate.obj(o3);
load.view(35);
set.view(o3, 35);
Code:
//basic steps needed to create
//and display a screen object
animate.obj(o2);
load.view(4);
set.view(o2,4);
position(o2,80,120);
draw(o2);

 

Syntax

animate.obj(obj oA);

Remarks

If the object number exceeds the max screen object count, AGI will generate an error.

Screen objects must be activated with the animate.obj command before it can be used in any other commands. Attempting to run commands on an uninitialized screen object will generate a runtime error.

If you call the animate.obj command on an object that is already activated, the command is ignored.

 

Technical Information

Required interpreter version Available in all AGI versions
Bytecode value 33 (0x21 hex)

See also

Sources

Some of the text in this article comes from the AGI Studio help file.