<aside> ⚡ script "core_getPlayersInRadius" (int radius, int flags, int pointer, int unused)

</aside>

Usage


This script is a more robust version of [core_checkDistance](<https://mm8bdm.notion.site/core_checkDistance-c80818500c6c43e59e7c42aa5215f2d1>), providing the number of players within a given radius of the calling actor, as well as providing flags to tweak behavior.

Parameters

<aside> 🚨 Note that as of V6B, PRF_CLOSESTPOINTER has improper and unexpected behavior, tending to prefer players with a lower player number or players which are more perpendicular to the calling actor. This behavior will be cleaned up in a later version!

</aside>

Return Value

Returns the number of players whose origin is within the specified radius.

Example


Below is a minimized example of Rush Jet showing how the PRF_CLOSESTPOINTER flag can be used in practice.

Look:
	RUSH III 1 A_JumpIf(CallACS("core_getPlayersInRadius", 80, PRF_CLOSESTPOINTER, AAPTR_TRACER) > 0, "Melee")
	RUSH I 0 A_CountDown
	Goto Look
Melee:
	RUSH G 0 A_GiveInventory("RushJetActivate", 1, AAPTR_TRACER)
	stop

Below is an example of how PRF_CUBE and PRF_CHECKCOLLISION are used, in this case to disallow Concrete Shot from spawning inside players and blocking them.

Spawn:
	CONC D 0
	CONC D 0 A_JumpIf(CallACS("core_getPlayersInRadius", 20, PRF_CUBE|PRF_CHECKCOLLISION) > 0, "Death")
	CONC D 1
	CONC E 0 A_ChangeFlag(TOUCHY, false)
	CONC E 0 A_ChangeFlag(MISSILE, false)
	CONC E 0 A_ChangeFlag(SOLID, true)
	CONC EF 64
	Goto Death
Death:
	CONC B 0 A_NoBlocking
	CONC FG 3
	stop

See Also


core_checkDistance