Welcome to the Creatures Wiki! Log in and join the community.
Difference between revisions of "OBST"
Jump to navigation
Jump to search
ScoobyGambit (talk | contribs) (Created page with "OBST is a CAOS command to do with motion - specifically, obstacles. OBST checks what is likely to be in an agent's way as it moves. ==Usage== Syntax: ''OBST (float) directio...") |
ScoobyGambit (talk | contribs) (→Usage) |
||
Line 4: | Line 4: | ||
Syntax: ''OBST (float) direction (int)'' | Syntax: ''OBST (float) direction (int)'' | ||
− | Gives the distance from the agent to the nearest [[WALL|wall]] that it might collide with in the specified direction. Directions that can be checked are LEFT, RGHT, _UP_, or DOWN. If the distance to the collision is greater than the agent's [[RNGE]] then a very large number is returned. | + | Gives the distance from the agent to the nearest [[WALL|wall]] that it might collide with in the specified direction. Directions that can be checked are [[LEFT]], [[RGHT]], [[UP|_UP_]], or [[DOWN]]. If the distance to the collision is greater than the agent's [[RNGE]] then a very large number is returned. |
==Examples== | ==Examples== |
Latest revision as of 01:53, 24 April 2019
OBST is a CAOS command to do with motion - specifically, obstacles. OBST checks what is likely to be in an agent's way as it moves.
Usage[edit]
Syntax: OBST (float) direction (int)
Gives the distance from the agent to the nearest wall that it might collide with in the specified direction. Directions that can be checked are LEFT, RGHT, _UP_, or DOWN. If the distance to the collision is greater than the agent's RNGE then a very large number is returned.
Examples[edit]
From the basic lift script:
loop setv vely 3 untl obst down < 10 wait 4 setv vely 0 setv ov01 0 dpas 0 0 0