Gates dying when closed?

Derek0

New Member
Reaction score
1
Ok, i'm working on yet another version of helms deep, but this one is good. I wanted to find a good solution to the gates so I made these three triggers. One to open it, one to close it, and one to turn off the first two when it dies.

The open trigger stores the gates health in a variable, sets another variable to true to log that the gate is open, then opens the gate.
The close trigger closes the gate, sets the gate's life to the life in the variable, then sets the other variable to false to log that the gate is closed.
The third trigger goes when the gate dies, and only happens if the logged variable is set to false. This one disables the other two, so that once it's dead, it cannot be re-opened.

The reasion I need a variable to log whether it's open or closed is because when a gate is opened, it's heal is set to 0 (no idea why), so the game thinks it's dead. This variable will tell it whether it's dead or open.

The problem i'm having is that when the gate is closed, it will die instantly. Not only that, but it doesn't happen all the time. It actually happens very rarely, what seems to be at random, it will die when the close trigger goes. Most of the time it works fine. I am starting to think it's Battle.net's lag, because i've only seen it happen on the hall gate, which is usually only opened or closed while there's many, many units moving and attacking at once. The question is, how do I fix this?

Here are my triggers:
Code:
Open Great Hall Gate
    Events
        Player - Player 2 (Blue) types a chat message containing -open hall as An exact match
        Player - Player 4 (Purple) types a chat message containing -open hall as An exact match
        Player - Player 7 (Green) types a chat message containing -open hall as An exact match
        Player - Player 6 (Orange) types a chat message containing -open hall as An exact match
        Player - Player 11 (Dark Green) types a chat message containing -open hall as An exact match
    Conditions
    Actions
        Set HallGateHP = (Current life of Iron Gate (Horizontal) 1053 <gen>)
        Set HallGateOpen = True
        Destructible - Open Iron Gate (Horizontal) 1053 <gen>
Code:
Close Great Hall Gate
    Events
        Player - Player 2 (Blue) types a chat message containing -close hall as An exact match
        Player - Player 4 (Purple) types a chat message containing -close hall as An exact match
        Player - Player 7 (Green) types a chat message containing -close hall as An exact match
        Player - Player 6 (Orange) types a chat message containing -close hall as An exact match
        Player - Player 11 (Dark Green) types a chat message containing -close hall as An exact match
    Conditions
    Actions
        Destructible - Close Iron Gate (Horizontal) 1053 <gen>
        Destructible - Set life of Iron Gate (Horizontal) 1053 <gen> to HallGateHP
        Set HallGateOpen = False
Code:
Kill Hall
    Events
        Destructible - Iron Gate (Horizontal) 1053 <gen> dies
    Conditions
        HallGateOpen Equal to False
    Actions
        Trigger - Turn off Close Great Hall Gate <gen>
        Trigger - Turn off Open Great Hall Gate <gen>

Please help, this is ruining the game for many people, because their last line of defence, this gate, is dying randomly.

Thanks in advance
Derek0
 

Tinki3

Special Member
Reaction score
418
I see :)eek: ) nothing wrong with your triggers. I must say however, that I made a map, (half made it) and flagged it, becuase I had MAJOR gate problems. They destroyed/removed/did random things to themselves.

Sorry for the random post, just telling you I had the same problem half a year ago.
 

Derek0

New Member
Reaction score
1
Yeah, Blizard made their gates a little wierd and hard to control. I wish it would save the health when opened, but Blizzard decided to do it another way. They decided to, instead of make the gates unselectable or invunerable when opened, they changed it so it had 0 health, and could not be attacked. Because of this, and I hate the way it ended up, the game thinks the gates are dead when they are open. What's more, the Destructable Dies event is activated when the gate is opened, so it really makes them hard to work with.

I think the real problem may be in the variables. I think that somthing happens and it stores 0 in the variable, so when it's closed again, the health is set to 0 through the variable and dies. Does the set variable lag on battle.net? Like, would it somehow wait until after the gate has opened to store the variable, maybe through a lag? Then it would store 0 in the variable, because the gate is open.
If not, the variable is 0 by default, but the gates start out as closed, and it sometimes happens on the 5th or 6th time the gate is closed. Could it somehow revert to the default?
 
L

Lordbevan

Guest
I am proud to say that the Lotr community has solved this problem many times over.

Open:
Code:
OpenMinasTirith
    Events
        Player - Player 1 (Red) types a chat message containing -open as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Demonic Gate (Vertical) 0000 <gen> is alive) Equal to True
            Then - Actions
                Trigger - Turn off (This trigger)
                Wait 5.00 seconds
                Cinematic - Ping minimap for (Player group((Triggering player))) at (Position of Demonic Gate (Vertical) 0000 <gen>) for 5.00 seconds
                Set GateLife = (Current life of Demonic Gate (Vertical) 0000 <gen>)
                Destructible - Open Demonic Gate (Vertical) 0000 <gen>
                Trigger - Turn on CloseMinasTirith <gen>
            Else - Actions
                Set GateLife = 0.00
                Custom script: call DestroyTrigger( GetTriggeringTrigger() )

Close: Initially turned off
Code:
CloseMinasTirith
    Events
        Player - Player 1 (Red) types a chat message containing -close as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                0.00 Not equal to GateLife
            Then - Actions
                Trigger - Turn off (This trigger)
                Wait 5.00 seconds
                Cinematic - Ping minimap for (Player group((Triggering player))) at (Position of Demonic Gate (Vertical) 0000 <gen>) for 5.00 seconds
                Destructible - Close Demonic Gate (Vertical) 0000 <gen>
                Destructible - Set life of Demonic Gate (Vertical) 0000 <gen> to GateLife
                Trigger - Turn on OpenMinasTirith <gen>
            Else - Actions
                Custom script: call DestroyTrigger( GetTriggeringTrigger() )

BTW, if u like Lotr maps, go to http://ringwars.x187.com. Sorry if i cant advertise.
 

Derek0

New Member
Reaction score
1
Oooooooooooooooh I get it now. Looking at your trigger I realize the problem. Someone would type -open hall, so the variable would store the hall's health, and the hall would open, then if someone types -open hall again, it would store the life in the variable again, which is now 0 because it's open, so when closed, it would give it 0 health and break it.

Just one question: What is that DestroyTrigger JASS Function? It looks like it gets rid of that trigger if the gate is dead, but why can't I just use the Trigger - Turn off function?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> What is that DestroyTrigger JASS Function?

It does what it says, it destroys the trigger.
The poor thing will never run again. It won't even exist anymore...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top