Detecting players and vehicles
by Very Interactive Person · in Torque Game Engine · 07/22/2003 (3:22 pm) · 3 replies
I need to detect if there are players or vehicles in a certain area. I really have no clue how to do this. A simple trigger doesn't do the job when there's more then one player or vehicle there. Actually I just want to know if there's no one (no players, and no vehicles) in the area.
Any ideas? Possible to do with triggers? I'd like a script only solution, but perhaps engine changes will make this easier.
Any ideas? Possible to do with triggers? I'd like a script only solution, but perhaps engine changes will make this easier.
#2
07/22/2003 (4:58 pm)
We have a snipit that detects specific objects over at our TGE-Snipits-Database in Category Misc., maybe this can help you.
#3
07/23/2003 (3:01 am)
Thanks, both of you... I should be able to figure this out now.
Torque Owner Richard O
Something along the lines of the below will find all players within a certain radius:
InitContainerRadiusSearch(%position, %radius, $TypeMasks::PlayerObjectType); while ((%targetObject = containerSearchNext()) != 0) { // Found a player including yourself }Rich