Difference between revisions of "AGI Command Reference - Object Motion Control Commands"
Line 27: | Line 27: | ||
| | ||
+ | The following commands can be given to the object included in the interpreter control list with animate_obj: | ||
+ | == <br />set.horizon(n); == | ||
+ | |||
+ | <blockquote>Set the horizon to y = n.</blockquote> | ||
+ | |||
+ | == ignore.horizon(n); == | ||
+ | |||
+ | <blockquote>Object n moves regardless of the horizon position.</blockquote> | ||
+ | |||
+ | == observe.horizon(n); == | ||
+ | |||
+ | <blockquote>Object n cannot move above the horizon.</blockquote> | ||
+ | |||
+ | == block(x1, y1, x2, y2); == | ||
+ | |||
+ | <blockquote> | ||
+ | Sets a rectangular area (block). | ||
+ | |||
+ | {| | ||
+ | |<pre> | ||
+ | (x1, y1) | ||
+ | ------------------ | ||
+ | | | | ||
+ | | | | ||
+ | | | | ||
+ | ------------------ | ||
+ | (x2, y2) | ||
+ | </pre> | ||
+ | |}</blockquote> | ||
+ | |||
+ | == unblock(); == | ||
+ | |||
+ | <blockquote>Cancels previously set block.</blockquote> | ||
+ | |||
+ | == ignore.blocks(n); == | ||
+ | |||
+ | <blockquote>Object n moves ignoring conditional barriers (pixels with priority 1) and a block set with a block command.</blockquote> | ||
+ | |||
+ | == observe.blocks(n); == | ||
+ | |||
+ | <blockquote>Object n may not cross conditional barriers or leave the block.</blockquote> | ||
+ | |||
+ | == ignore.objs(n); == | ||
+ | |||
+ | <blockquote>Object n moves regardless of positions of other objects.</blockquote> | ||
+ | |||
+ | == observe.objs(n); == | ||
+ | |||
+ | <blockquote>Object n treats other objects as obstacles.</blockquote> | ||
+ | |||
+ | == player.control(); == | ||
+ | |||
+ | <blockquote>The player is allowed to control EGO (object number 0) using the keyboard or the joystick.</blockquote> | ||
+ | |||
+ | == program.control(); == | ||
+ | |||
+ | <blockquote>The player is not allowed to control object 0 (EGO).</blockquote> | ||
+ | |||
+ | == stop.motion(n); == | ||
+ | |||
+ | <blockquote>Motion of object n is stopped. If n = 0, program_control is automatically executed.</blockquote> | ||
+ | |||
+ | == start.motion(n); == | ||
+ | |||
+ | <blockquote>Motion of object n is started. If n = 0 (EGO), player_control automatically executed.</blockquote> | ||
+ | |||
+ | == step.size(n, m); == | ||
+ | |||
+ | <blockquote>Var(n) determines the number of pixels the object n moves each step.</blockquote> | ||
+ | |||
+ | == step.time(n, m); == | ||
+ | |||
+ | <blockquote>Var(n) determines the speed of object n motion: delay in the interpreter cycles between consecutive steps. If Var(m) = 1, step occurs on every cycle.</blockquote> | ||
+ | |||
+ | == move.obj(n, x, y, s, m); move.obj.v(n, x, y, s, m); == | ||
+ | |||
+ | <blockquote>Object n is told to move to the point x,y (or Var(x), Var(y)) by s pixels every step. When the destination is reached, Flag(m) is set to 1. If n = 0 (EGO), program_control is executed automatically.</blockquote> | ||
+ | |||
+ | == follow.ego(n, s, m); == | ||
+ | |||
+ | <blockquote>Object n is told to chase object 0 (EGO) by s pixels every step. When EGO's and the object's coordinates become equal, Flag(m) is set to 1.</blockquote> | ||
+ | |||
+ | == wander(n); == | ||
+ | |||
+ | <blockquote>Object n randomly changes the direction of its motion (wanders). If n = 0 (EGO), program_control is issued automatically.</blockquote> | ||
+ | |||
+ | == normal.motion(n); == | ||
+ | |||
+ | <blockquote>Special object motion mode is canceled. The object continues to move in the direction it was moving in at the time the command was issued.</blockquote> | ||
+ | |||
+ | == set.dir(n, m); == | ||
+ | |||
+ | <blockquote> | ||
+ | Object n is told to move in the direction Var(m) | ||
+ | |||
+ | {| | ||
+ | |<pre> | ||
+ | 1 | ||
+ | 8 | 2 | ||
+ | \ | / | ||
+ | \ | / | ||
+ | 7 ------------- 3 0 - stop | ||
+ | / | \ | ||
+ | / | \ | ||
+ | 6 | 4 | ||
+ | 5 | ||
+ | </pre> | ||
+ | |}</blockquote> | ||
+ | |||
+ | == get.dir(n, m); == | ||
+ | |||
+ | <blockquote>Direction of object n motion is stored in Var(m).</blockquote> | ||
+ | |||
+ | == object.on.water(n); == | ||
+ | |||
+ | <blockquote>Object n is allowed to be only in the area where its base line is completely on pixels with priority 3 (water surface).</blockquote> | ||
+ | |||
+ | == object.on.land(n); == | ||
+ | |||
+ | <blockquote>Object n is not allowed to touch pixels of water surface (priority 3).</blockquote> | ||
+ | |||
+ | == object.on.anything(n); == | ||
+ | |||
+ | <blockquote>Motion restrictions previously set on the object n with commands object_on_water or object_on_land are cancelled.</blockquote> | ||
+ | |||
+ | == reposition(n, dx, dy); == | ||
+ | |||
+ | <blockquote>Object n jumps from its current location into the location with coordinates x + Var(dx), y + Var(dy).<br /> | ||
+ | <br /> | ||
+ | '''Notes:'''<br /> | ||
+ | Shouldn't there be reposition and reposition.v?<br /> | ||
+ | There should be, but they don't exist.</blockquote> | ||
+ | |||
+ | == reposition.to(n, x, y); reposition.to.v(n, x, y); == | ||
+ | |||
+ | <blockquote>Similar to the preceding command, but the object is moved to the point x, y (Var(x),Var(y)).</blockquote> | ||
+ | |||
+ | == stop.update(n); == | ||
+ | |||
+ | <blockquote>Object n is removed from the list of objects updated by the interpreter on each step. The object stays on the screen unchanged.</blockquote> | ||
+ | |||
+ | == start.update(n); == | ||
+ | |||
+ | <blockquote>Object n is redrawn on each interpreter step.</blockquote> | ||
+ | |||
+ | == force.update(n); == | ||
+ | |||
+ | <blockquote>Object n is redrawn immediately, without waiting for the end of the interpreter cycle.</blockquote> | ||
+ | |||
+ | == distance(n, m, d); == | ||
+ | |||
+ | <blockquote>If both objects n and m are on the screen, then<br /> | ||
+ | Var(d) = ABS(x(n) - x(m)) + ABS(y(n) - y(m)), otherwise<br /> | ||
+ | Var(d) = 255.</blockquote> | ||
| |
Revision as of 17:47, 22 December 2013
Tutorials Table of Contents
AGI Command Reference Index
The following commands can be given to the object included in the interpreter control list with animate_obj:
set.horizon(n);
Set the horizon to y = n.
ignore.horizon(n);
Object n moves regardless of the horizon position.
observe.horizon(n);
Object n cannot move above the horizon.
block(x1, y1, x2, y2);
Sets a rectangular area (block).
(x1, y1) ------------------ | | | | | | ------------------ (x2, y2)
unblock();
Cancels previously set block.
ignore.blocks(n);
Object n moves ignoring conditional barriers (pixels with priority 1) and a block set with a block command.
observe.blocks(n);
Object n may not cross conditional barriers or leave the block.
ignore.objs(n);
Object n moves regardless of positions of other objects.
observe.objs(n);
Object n treats other objects as obstacles.
player.control();
The player is allowed to control EGO (object number 0) using the keyboard or the joystick.
program.control();
The player is not allowed to control object 0 (EGO).
stop.motion(n);
Motion of object n is stopped. If n = 0, program_control is automatically executed.
start.motion(n);
Motion of object n is started. If n = 0 (EGO), player_control automatically executed.
step.size(n, m);
Var(n) determines the number of pixels the object n moves each step.
step.time(n, m);
Var(n) determines the speed of object n motion: delay in the interpreter cycles between consecutive steps. If Var(m) = 1, step occurs on every cycle.
move.obj(n, x, y, s, m); move.obj.v(n, x, y, s, m);
Object n is told to move to the point x,y (or Var(x), Var(y)) by s pixels every step. When the destination is reached, Flag(m) is set to 1. If n = 0 (EGO), program_control is executed automatically.
follow.ego(n, s, m);
Object n is told to chase object 0 (EGO) by s pixels every step. When EGO's and the object's coordinates become equal, Flag(m) is set to 1.
wander(n);
Object n randomly changes the direction of its motion (wanders). If n = 0 (EGO), program_control is issued automatically.
normal.motion(n);
Special object motion mode is canceled. The object continues to move in the direction it was moving in at the time the command was issued.
set.dir(n, m);
Object n is told to move in the direction Var(m)
1 8 | 2 \ | / \ | / 7 ------------- 3 0 - stop / | \ / | \ 6 | 4 5
get.dir(n, m);
Direction of object n motion is stored in Var(m).
object.on.water(n);
Object n is allowed to be only in the area where its base line is completely on pixels with priority 3 (water surface).
object.on.land(n);
Object n is not allowed to touch pixels of water surface (priority 3).
object.on.anything(n);
Motion restrictions previously set on the object n with commands object_on_water or object_on_land are cancelled.
reposition(n, dx, dy);
Object n jumps from its current location into the location with coordinates x + Var(dx), y + Var(dy).
Notes:
Shouldn't there be reposition and reposition.v?
There should be, but they don't exist.
reposition.to(n, x, y); reposition.to.v(n, x, y);
Similar to the preceding command, but the object is moved to the point x, y (Var(x),Var(y)).
stop.update(n);
Object n is removed from the list of objects updated by the interpreter on each step. The object stays on the screen unchanged.
start.update(n);
Object n is redrawn on each interpreter step.
force.update(n);
Object n is redrawn immediately, without waiting for the end of the interpreter cycle.
distance(n, m, d);
If both objects n and m are on the screen, then
Var(d) = ABS(x(n) - x(m)) + ABS(y(n) - y(m)), otherwise
Var(d) = 255.
Tutorials Table of Contents
AGI Command Reference Index
< Previous: Object Description CommandsNext: Inventory Item Management Commands >