Gates and armies

Hacklefellar

New Member
Reaction score
1
hi everyone.
i want to make a map that features a gate that opens and closes. but i can't seem to get it to work because i thought it would be easy and all i had to do is make it so that when a unit enters the region the gate opens, when it leaves, gate closes. now i hadn't thought of when you send an army through, the first one to leave the region slams the gate:banghead: on the rest and i don't know how to make it so that it first checks if there are no units in the region before it closes the gate, cuz i've only started using the trigger tool 2 hours ago haha!

sorry if i'm bothering anybody with silly noob questions but i really want this map to work:(
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
Make the trigger so that if a unit is in the region then it will remain open and make a region behind the gate that is the same with a condition that states no units are in the other region. If I get Warcraft back on soon I'll make an example for you (got a new computer and don't have enough room for my hard drive and my external enclosure isn't working right...

sorry if i'm bothering anybody with silly noob questions but i really want this map to work

Why would anyone care? Even if it was answered a million times, I don't think a million and one is going to push anyone over the edge. Everyone has to start somewhere and generally that's not at the top. Unless you're like me and ignore the fact that despite having no idea what you're doing, you skip the basics and just try and do what you want (which a lot of times is really hard).

Alternately you could make it stay open for a set amount of time and have the counter reset every time a new unit enters the region, which might be easiest.
 

Hacklefellar

New Member
Reaction score
1
thats kinda the problem. i don't know how to make it check if there aren't any other units in another region:( i tried that but the amount of menus you have to go through is confusing. you choose the comparison (the only thing you can use conditions for) the n u fill in the variables and they sometimes require another 3 menu's each of all wich i don't know what they mean and do. :S simply put, can u explain how i can make it check if there are units in a area?
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
Umm... god I really can't think right now, sorry dude. You would have to look at the different events, I can't think of the specific one. I'll see if I can find my disks and install the game tonight and make you an example of it so you can base it off of, unless someone beats me to it as often happens. To make the check you would have to use a condition.

But what would be easiest might be to set it off for like five seconds before it closes every time a unit enters the region, although I just feel like it might leak with a ton of units massing it. You would basically have to make the event Unit Enters Region x, action Open Gate for x Seconds.
 

themean

Active Member
Reaction score
7
Im not sure what you need becaus my english is poor, but if i understand you
need to use varible from group type and and personal trigger for unit
if unit is close to gate add him to group if hi is away remove him
and second trigger if group is empty close gate if not open
somthing that
I hope I helped :thup:
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
Using unit groups would make it a lot more complex than it needs to be and I'm not sure if he knows how to do it. And I think if you were constantly adding and removing units from groups it would leak because the engine won't keep up, whereas if it stays open for a few seconds even if it does skip it won't make much of a difference because it will have some time for delay.
 

Hacklefellar

New Member
Reaction score
1
i did it with timers. works fine now thanks! :D as an added bonus, i learnt how to use them in the first place hahaha xD
it isn't so hard:)
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
Yeah, I think that will work best because it will have a little bit of protection in case it does leak, so that it will just catch on another unit probably. Test it a bit though, because if you're throwing hundreds of units at it at once, it's going to be repeating a lot and might overload the system and crash or lag. I've never made anything that worked like that, so I'm not sure.
 

Xonora

New Member
Reaction score
3
Ok, try this.

Event
Unit leaves (your region)

Condition


Action

If, then multiple functions, else. (something like that)
Conditions (interger comparison) - Number of units in (your region) = 0 is true

Then - Close gate

Else - Do nothing
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
Well I was thinking something more like

Event
Unit Enters Region

Condition

Action
Open Gate
Wait x Seconds
Close Gate

Which I think is what he did. Just because it wouldn't be too complex since it's a pretty basic function he needs, but also even if it did leak a lot, it would reset every time it picked up on another unit entering the region.

Now that I think about it though, that will create a lot of timers possibly, so maybe if the condition is set so that it only is enacted if the gate is closed or something that might be better, or if the gate will be closing soon, to avoid overload.
 

Xonora

New Member
Reaction score
3
but ur way he has to set amt of units to acoomodate the time before the gate closes.
 

Hacklefellar

New Member
Reaction score
1
yea but you only have 100 food so there won't be alot of units going through haha also if i make gate = closed a condition, the first unit would open the gate, and then the rest has to follow within a set amount of time or they have to leave and re-enter the region to open the gate again :\ so that won't work so well.
 

Rainther

I guess I should write something of value here...
Reaction score
61
Lazy ass solution: Make a trigger check every 0.1 second or something and open if not already open if there's at least one unit there and close if not closed if there aren't any.
 

Hacklefellar

New Member
Reaction score
1
i tried out xonora's way that is actually exactly what i was trying to do. thanks! to all of you for helping me out! :D
 

HydraRancher

Truth begins in lies
Reaction score
197
Xonora's Leaks.

Trigger:
  • Trigger
    • Events
      • Unit - A unit leaves your region <gen>
    • Conditions
    • Actions
      • Set Unit_Group = Units in your region <gen>
      • If all (Conditions) are true then do (Actions) else do (Actions)
        • If - (Conditions)
          • Number of units in Unit_Group is equal to 0
        • Then - (Actions)
          • ----------Close---------
        • Else - (Actions)
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
808
yea but you only have 100 food so there won't be alot of units going through haha also if i make gate = closed a condition, the first unit would open the gate, and then the rest has to follow within a set amount of time or they have to leave and re-enter the region to open the gate again :\ so that won't work so well.

You can increase or disable the food limit.
 

Xonora

New Member
Reaction score
3
Xonora's Leaks.

Trigger:
  • Trigger
    • Events
      • Unit - A unit leaves your region <gen>
    • Conditions
    • Actions
      • Set Unit_Group = Units in your region <gen>
      • If all (Conditions) are true then do (Actions) else do (Actions)
        • If - (Conditions)
          • Number of units in Unit_Group is equal to 0
        • Then - (Actions)
          • ----------Close---------
        • Else - (Actions)

yea, but u can easily unleak it. I just posted a theory lol
 

Hacklefellar

New Member
Reaction score
1
I have made 2 triggers now

one that says event: Unit enters region action: Open Door

the other says Event: Unit Leaves region Action: If ((number of units in (myregion <gen>)) Equal to 0) then do (destructible: close gate <thegate>) else do nothing.

where does it leak?

*i'm pretty new to this by the way xD*
 

Rainther

I guess I should write something of value here...
Reaction score
61
The Unit Group, I believe. You'd use Clear Unit Group or what it's called when you're done.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • 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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top