What's the best and quickest method for finding everything within x-radius, 360 degrees around a target thing?
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
victim = FirstThingInView(player, 180, 10, 0x404); while(victim != -1) { if( HasLOS(player, victim) && (victim != player) && (VectorDist(GetThingPos(player), GetThingPos(potential)) <= 1) && !(GetThingFlags(victim) & 0x200) && !(GetActorFlags(victim) & 0x100) && !((jkGetFlags(victim) & 0x20) && !IsInvActivated(player, 23)) ) { // Do Stuff To Victim Or Record Victim For Later Use } victim = NextThingInView(); } SetThingLook(player, VectorScale(GetThingLVec(player), -1)); victim = FirstThingInView(player, 180, 10, 0x404); while(victim != -1) { if( HasLOS(player, victim) && (victim != player) && (VectorDist(GetThingPos(player), GetThingPos(potential)) <= 1) && !(GetThingFlags(victim) & 0x200) && !(GetActorFlags(victim) & 0x100) && !((jkGetFlags(victim) & 0x20) && !IsInvActivated(player, 23)) ) { // Do Stuff To Victim Or Record Victim For Later Use } victim = NextThingInView(); } SetThingLook(player, VectorScale(GetThingLVec(player), -1));
for(x=0; x<GetSectorCount(); x=x+1) { for(y=FirstThingInSector(x), z=0; z<GetSectorThingCount(x); y=NextThingInSector(y), z=z+1) { if((GetThingType(y) == DesiredType) && (y != player) && (HasLOS(player, y) && (VectorDist(GetThingPos(player), GetThingPos(y)) <= 1)) { // Do Stuff To y Or Record y For Later Use } } }