Check Object and Trigger
by Austin Whitlatch · in Technical Issues · 02/11/2008 (8:35 am) · 2 replies
I do have a question for you guys, I'm new with Torque and have had it for a few weeks. I'm trying to make a CTF type game. I have created a chest object that mounts as a weapon but can't fire and I am trying to take it back to a trigger to score points. What I'm having issues with is how to make a check in the trigger function to see if I have a Chest. Thank you guys :)
About the author
Torque Owner Lee Latham
Default Studio Name
I just had to figure that out quite recently while implementing CTF in my game! I'll be releasing it within the week and torquescript source will be included. I've modified it a bit...you have to get your flag, somehow, through a giant basketball hoop :-). Either jetpack, flying car, or plane is fine.
However, there are almost certainly cleaner CTF implementations on this site if you search for them. There's at least two that I know of.
BTW at first I was doing that to check if the player had the flag, but in the end I found it muuuuch simpler to assign a dynamic variable to the client that I would change depending on the status of the player. Like:
%obj.carrier = 1;
if he picked up the red flag. I used 1 for the red flag, 2 for the blue, empty for no flag. I don't remember why I eventually found it awkward to check for the mounted image....but I did :-) Oh wait, yes I do, it's because I use vehicles in my FPS, so it added a layer of complexity to determining if a flag was mounted or not. So that may not apply.