Editing CheckProximity

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{ACSFunction|description=Counts the actors of type ''classname'' close to a tagged thing, returning TRUE if they're more (or less, depending on ''flags'') than a given ''limit''. It can also have the side effects (if ''flags'' set this way) to change a monster's target, among other things.
'''ACS function'''
|usage=''boolean'' '''CheckProximity'''(''int tid'', ''str classname'', ''fixed distance''[, ''limit''[, ''flags'']])
 
|parameters=
''boolean'' '''CheckProximity'''(''int tid'', ''str classname'', ''fixed distance''[, ''limit''[, ''flags'']])
 
Counts the actors of type ''classname'' close to a tagged thing, returning TRUE if they're more (or less, depending on ''flags'') than a given ''limit''. It can also have the side effects (if ''flags'' set this way) to change a monster's target, among other things.
 
==Parameters==
*''tid'': [[TID]] of thing to check proximity of actors against. Only works for one tagged thing.
*''tid'': [[TID]] of thing to check proximity of actors against. Only works for one tagged thing.
*''classname'': class of actors to look for near the tagged thing. Supports both [[EDF]] names and ZDoom compatibility names.
*''classname'': class of actors to look for near the tagged thing. Supports both [[EDF]] names and ZDoom compatibility names.
Line 7: Line 11:
*''limit'': number of actors to compare against. Without any specific flags, this function will return true if number is >= ''limit''. Default: 1
*''limit'': number of actors to compare against. Without any specific flags, this function will return true if number is >= ''limit''. Default: 1
*''flags'': various flags. Default: none. NOTE: anything available in "zdefs.acs" but not mentioned here is unimplemented. The flags are:
*''flags'': various flags. Default: none. NOTE: anything available in "zdefs.acs" but not mentioned here is unimplemented. The flags are:
:*'''CPXF_ANCESTOR''' or 1: count actor if ''classname'' belongs to one of its thingtype ancestors (using the '''inherits''' or colon syntax in the [[EDF]] thingtype).
:*'''CPXF_LESSOREQUAL''' or 2: function returns true if number of nearby actors is <= ''limit'.
:*'''CPXF_LESSOREQUAL''' or 2: function returns true if number of nearby actors is <= ''limit''.
:*'''CPXF_NOZ''' or 4: do not calculate altitude difference between actors and tagged thing. By default, Z contributes to the distance.
:*'''CPXF_NOZ''' or 4: do not calculate altitude difference between actors and tagged thing. By default, Z contributes to the distance.
:*'''CPXF_COUNTDEAD''' or 8: also count dead actors. By default they're skipped.
:*'''CPXF_COUNTDEAD''' or 8: also count dead actors. By default they're skipped.
Line 18: Line 21:
:*'''CPXF_CLOSEST''' or 1024: if setting target or tracer, pick the closest actor found in ''distance'' range.
:*'''CPXF_CLOSEST''' or 1024: if setting target or tracer, pick the closest actor found in ''distance'' range.
:*'''CPXF_CHECKSIGHT''' or 4096: only pick actors to which a line of sight from tagged thing exists.
:*'''CPXF_CHECKSIGHT''' or 4096: only pick actors to which a line of sight from tagged thing exists.
Returns TRUE if the conditions have been met.
 
|seealso=
[[Category:ACS]]
*[[CheckSight]]
|id=<code>-98:CheckProximity(3, 6)</code>}}
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: