Findnearactor: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
findnearactor <[[actor]]> <distance> <[[gamevar]]>
findnearactor <[[actor]]> <distance> <[[gamevar]]>


Gets the actor ID of the closest <[[actor]]> within <distance> into a <[[gamevar]]>.  The input for <[[actor]]> may be its tile number (example: 2000) or its defined name (example: PIGCOP).  The <distance> will be determined on the x and y plane only; for finding actors on the x, y, and z axes use [[findnearactor3d]] instead.
Gets the actor ID of the closest <[[actor]]> within <distance> into a <[[gamevar]]>.  If not actor within range is found, the gamevar is set to -1.  The input for <[[actor]]> may be its tile number (example: 2000) or its defined name (example: PIGCOP).  The <distance> will be determined on the x and y plane only; for finding actors on the x, y, and z axes use [[findnearactor3d]] instead.


By getting the actor ID of a nearby actor, the current actor can use [[getactor]] to determine the properties of the target actor or [[getangle]] to face the target actor.
By getting the actor ID of a nearby actor, the current actor can use [[getactor]] to determine the properties of the target actor or [[getangle]] to face the target actor.

Revision as of 11:44, 1 March 2005

findnearactor <actor> <distance> <gamevar>

Gets the actor ID of the closest <actor> within <distance> into a <gamevar>. If not actor within range is found, the gamevar is set to -1. The input for <actor> may be its tile number (example: 2000) or its defined name (example: PIGCOP). The <distance> will be determined on the x and y plane only; for finding actors on the x, y, and z axes use findnearactor3d instead.

By getting the actor ID of a nearby actor, the current actor can use getactor to determine the properties of the target actor or getangle to face the target actor.