Difference between revisions of "Animate.obj"
(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 | + | 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. |
− | == | + | <code>animate.obj(object);</code> |
+ | |||
+ | == Parameters == | ||
− | : | + | * <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>) |
− | == | + | == Possible errors == |
− | + | * 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) | |
− | + | == Examples == | |
− | + | The following example activates object 3 and assigned VIEW.035 to it: | |
− | == | + | <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> | ||
+ | |||
+ | | ||
+ | == 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. | ||
| | ||
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. | ||
+ | |||
+ | | ||
[[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 onlyo0-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
througho15
are valid; if you specifyo16
, then this error will occur)
Examples
The following example activates object 3 and assigned VIEW.035 to it:
<syntaxhighlight lang="agi"> animate.obj(o3); load.view(35); set.view(o3, 35); </syntaxhighlight>
<syntaxhighlight lang="agi"> //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); </syntaxhighlight>
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.