Difference between revisions of "Step.time"
(Created page with "step.time == <br />Syntax == <blockquote><code>step.time(oA,vB);</code></blockquote> == <br />Description == . == <br />Sources == AGI Studio Help File == <...") |
|||
Line 1: | Line 1: | ||
− | step.time | + | The '''step.time''' command sets the delay time between steps (movements) of an object. |
− | + | == Syntax == | |
− | + | step.time([[screen object|obj]] oA, [[variable|var]] vB); | |
− | + | == Remarks == | |
− | + | The [[step time]] property of [[screen object]] '''oA''' is set to the value of [[variable]] '''vB'''. | |
− | . | + | The step time property determines the number of [[interpreter cycle]]s between each step, or change in position. For example, if step time is 1, then the object takes a step every cycle; if step time is 2, it takes a step on every other cycle, and so on. |
− | + | Don't confuse step time with [[step size]] or [[cycle time]]. Step size determines how far an object moves during each step. Cycle time determines how often the object's cel changes, and can be set independent of | |
+ | step time. | ||
− | + | == Possible Errors == | |
− | + | Setting the step time to zero will cause the object to take a step in every cycle, but due to a bug in AGI, it also causes the object to ignore [[block|blocks]] and disables the [[auto loop]] feature. | |
− | + | AGI does not check that object number '''oA''' is a valid [[screen object]]. If it is not, this command will overwrite other data on the [[memory heap]], which may cause unexpected results, including possibly [[crashing AGI]]. | |
− | |||
− | |||
− | + | == Example == | |
− | [ | + | <div class="CodeBlockHeader">Code:</div> |
− | [[ | + | <syntaxhighlight lang="agi"> |
− | [[ | + | #define injured f82 |
− | [[Category: | + | if(isset(injured)) |
+ | { | ||
+ | step.time(ego, 2); [ ego moves slower when injured | ||
+ | } | ||
+ | </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:''' | ||
+ | | 80 (0x50 hex) | ||
+ | |} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | '''[[cycle.time]]'''<br /> | ||
+ | '''[[step.size]]'''<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 19:46, 23 April 2019
The step.time command sets the delay time between steps (movements) of an object.
Syntax
Remarks
The step time property of screen object oA is set to the value of variable vB.
The step time property determines the number of interpreter cycles between each step, or change in position. For example, if step time is 1, then the object takes a step every cycle; if step time is 2, it takes a step on every other cycle, and so on.
Don't confuse step time with step size or cycle time. Step size determines how far an object moves during each step. Cycle time determines how often the object's cel changes, and can be set independent of step time.
Possible Errors
Setting the step time to zero will cause the object to take a step in every cycle, but due to a bug in AGI, it also causes the object to ignore blocks and disables the auto loop feature.
AGI does not check that object number oA is a valid screen object. If it is not, this command will overwrite other data on the memory heap, which may cause unexpected results, including possibly crashing AGI.
Example
<syntaxhighlight lang="agi">
- define injured f82
if(isset(injured))
{ step.time(ego, 2); [ ego moves slower when injured }
</syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 80 (0x50 hex) |