Version 10 (modified by jpawlick, 13 years ago) (diff) |
---|
This query asks the agent to tell you what the nearest object within a specific distance at a specific angle is. The rangefinder sensor originates at 30 units up from the quagent's server-tracked origin. This means that the ground should be 54 units away (I think - maybe wise to a double check me on this).
Mode-4, mode-5, mode-6, and mode-7 rangefinders use a non-square box such that the ground should be 0 units away when the quagent is standing on it.
A mode 4, 5, 6, or 7 rangefinder will be stopped by an obstacle that a mode 0, 1, 2, or 3 rangefinder may pass over.
Parameters:
- 1: integer type, selecting the type of rangefinder to use.
- 0 = an infinitely narrow beam that is only stopped by permanent surfaces that will stop the player (usually just walls, floors, ceilings, and moving platforms, never other quagents or rockets or powerups).
- 1 = an infinitely narrow beam that is blocked by anything that would block player movement (like mode-0, but plus other things like quagents).
- 2 = an infinitely narrow beam that is blocked by anything that would block a shot (often equivalent to mode 1, but on some levels (like suspended), there are walls/floors that can be shot through but not walked through).
- 3 = an infinitely narrow beam that is blocked by anything in the environment (like mode-1, but plus powerups or other things that can be walked through).
- 4 = a wide beam the size of a quagent that is blocked if any part of it is blocked by something that would block a mode-0 rangefinder.
- 5 = a wide beam the size of a quagent that is blocked if any part of it is blocked by something that would block a mode-1 rangefinder.
- 6 = a wide beam the size of a quagent that is blocked if any part of it is blocked by something that would block a mode-2 rangefinder.
- 7 = a wide beam the size of a quagent that is blocked if any part of it is blocked by something that would block a mode-3 rangefinder.
- 2: integer distance, the maximum distance of the rangefinder. There is no particular penalty to supplying very large distances that we can find - the maximum distance we've seen this call used with in Quake is 8120, the range of the rail gun.
- 3: float theta, the number of degrees left of facing to shoot the rangefinder at.
- 4: float phi, the number of degrees down from facing to shoot the rangefinder at.
Responds:
- X Y where X is the range at which the object was detected (the distance if nothing was found) and Y is either the entity id, -2 if the entity id is normally invalid (a wall or something), and -1 if nothing is in the distance.
Reports:
- done when the task completes.
- popped if popped by po.
- forgotten if deleted by fa or fm.
- replaced if replaced by a command scheduled with 'r'.
Example:
- User sends: "n rf 512 1 6000 90 45"
- Bot replies "rs rf 512 65.2 -2"
- Bot replies "cp rf 512 done"
For picture examples of exactly how different modes of rangefinder work, please see rb.
Attachments (1)
-
rangefinderblockdemo.png
(10.3 KB) -
added by jpawlick 13 years ago.
Rangefinder example.
Download all attachments as: .zip