![]() |
getAreaPlayers()
Since there's a getAreaNpcs() function, why is there not a getAreaPlayers()? It would be very useful to have this, and if there's one for NPC's, why not players? Doesn't seem like it'd be hard to implement, either.
|
I wouldn't mind seeing this, would make things a bit easier.
|
This would eliminate a lot of unneeded checks and calculations and loops that are used for things like hit detection, when you only need to for players in a specific block, and not worry about ALL of the players in the level.
|
On a related note; something like triggerarea() to trigger every player/npc in a specified area would be just as, if not more, useful. This has been requested more than once before, and seems like such an obvious addition.
|
The problem is that accessing players[] is much faster than level.players[] and you would probably expect findareaplayers() to work regardless if your current position. It could be possible to add a findareaplayers() which only accesses the players around you.
|
Quote:
|
I really don't understand Stefan's post at all.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Of course we can just use getNearestPlayers() and check if the player is within a box but it's always faster for that to be done in the engine, and things like hit detection can use any speed boost they can get.
|
Quote:
getnearestplayers(float, float) Deprecated. Use findnearestplayers() instead. I honestly don't know. getnearestplayers may return the indexes of players that was compatible with the old GS1 methods of players[x]. Of course, they could be exactly the same thing but just two function names. |
Quote:
|
I'd love to see a radius parameter added to findNearestPlayers
Quote:
|
| All times are GMT +2. The time now is 09:11 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.