HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Gate Problems

01-20-2009, 11:22 PM#1
Valdez
Ok, I use triggers to open/close gates in my new map and the problem I have is when the gate is destroyed via enemy attackers u can just open and close it again and just reset it.

Is there a way to check when its been destroyed (If a gate is opened it is counted as dead, so checking if its dead doesn't work).

Thanks in advance!
01-21-2009, 12:51 AM#2
Archmage Owenalacaster
Make a trigger with an event to detect when the gate destructable dies and have the trigger set a boolean value to indicate its death. When your open gate trigger runs, set the value of the boolean to indicate it is still alive. When your close gate trigger runs, check for the value of the boolean.
01-21-2009, 08:59 AM#3
Valdez
Quote:
Originally Posted by Archmage Owenalacaster
Make a trigger with an event to detect when the gate destructable dies and have the trigger set a boolean value to indicate its death. When your open gate trigger runs, set the value of the boolean to indicate it is still alive. When your close gate trigger runs, check for the value of the boolean.

Well your post isn't exactly clear so I'm going to attempt to reinerate what you said and you can correct me if wrong.

Step1: My gate is killed thus setting a boolean variable (lets say "Gate Dead") = to true.

Step2: The open gate command sets "Gate Dead" to false.

Step3: Close gate trigger checks "Gate Dead," If true it doesn't close and if false it does close.

Now assuming I got what u said correctly, my gate open trigger would just reset the boolean to default and I would be back to square one with my gates still reseting. But actually you did lead me to a possible solution and having the open command check the boolean before it executes.. I will test this theory and edit with results. If it works properly I will give you some rep, if not, feel free to try again (you might still get some rep though).

Edit: Ok, I've tested and I have indeed come to a solution. I did basically what I said above but I also made the open trigger reset the variable to say its alive still (opening gates technically in gui triggers counts as the unit dying) so by doing that it counted it as still alive on a technical bases. I also had the close trigger to check if its still alive just to cover all my bases :P

Thanks for giving the alternative perspective that I needed for my solution. Rep for a valiant attempt :P
01-21-2009, 02:50 PM#4
Archmage Owenalacaster
Heh, sorry. What you did is what I meant. I imagine my expression may have lost something to sleep deprivation.