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.

      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