Version 3 (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 detects everything a normal shot in Quake would - so non-colliding entities (such as those "light beams" graphical effects) cannot be detected by this method. 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 - probably wise to always shoot an rf straight down to figure that out before making assumptions about it).
Parameters:
- 1 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.
- 1 float theta, the number of degrees left of facing to shoot the rangefinder at.
- 1 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:
Example:
- User sends: "n rf 512 6000 90 45"
- Bot replies "rs rf 512 65.2 -2"
- Bot replies "cp rf 512 done"
Attachments (1)
-
rangefinderblockdemo.png
(10.3 KB) -
added by jpawlick 13 years ago.
Rangefinder example.
Download all attachments as: .zip