wiki:rf

Version 4 (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 type, selecting the type of rangefinder to use. A "solid" as used below means a wall, floor, ceiling, etc.
    • 0 = an infinitely narrow beam that passes through entities such as other quagents but is stopped by solids.
    • 1 = an infinitely narrow beam that is blocked by entities and solids.
    • 2 = a wide beam the size of a quagent that is blocked if any part of it is blocked by solids, but passes through entities.
    • 3 = a wide beam the size of a quagent that is blocked if any part of it is blocked by solids or entities.
  • 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:

  • done when the task completes.
  • popped if popped by po.
  • forgotten if deleted by fa.

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)

Download all attachments as: .zip