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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top