Step.time

From AGI Wiki
Jump to: navigation, search

The step.time command sets the delay time between steps (movements) of an object.

Syntax

step.time(obj oA, 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 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

Code:
#define injured f82
if(isset(injured))
  {
  step.time(ego, 2); [ ego moves slower when injured
  }

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 80 (0x50 hex)

See Also

cycle.time
step.size