Here we go again...

Hello my friends, how can I do to check if the player is near an enemy?
P_LookForEnemies does exactly this. It will search for the closest nearby enemy and return its correspondant object userdata table. If no enemies are near the assigned player, the function returns nil.

If I had to guess, this is used for stuff like the Homing Thok ability, Fang's popgun ability, or the Attraction shield's ability.

STRUCTURE:
P_LookForEnemies(player, nonenemies, bullet)
ARGUMENTS:
player represents the player that should search the enemies.
nonenemies is a boolean (true/false). If true, the player will instead search for nearby object that are NOT enemies.
bullet is a boolean (true/false). If true, the player will also search for nearby projectiles.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top