From SRB2 Wiki
Jump to: navigation, search

A_CheckRange is an action that calls a state depending on the absolute horizontal distance between the actor and its target or tracer; the two Objects must be in range of each other for the action to call a state. The lower 16 bits of Var1 determines the maximum horizontal distance, measured in fracunits, between the two Objects to allow the state to be called with – i.e. if the distance between the actor and its target is less than or equal to the lower 16 bits of Var1, the state is called. Var1 can also be interpreted to be the "radius" of a circular area around the actor in which to check for its target – i.e. if the target is within the actor's searching area, the state is called. The upper 16 bits of Var1 determines whether the actor's target (0) or tracer (1) is used. Var2 determines the state to call when this action is successful; see List of states for a full list. If the chosen Object does not exist, this action will do nothing.

This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.

  Actions – Checking [view]