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:(
 
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.
 
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?
 
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.
 
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:
 
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.
 
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:)
 
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.
 
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
 
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.
 
but ur way he has to set amt of units to acoomodate the time before the gate closes.
 
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.
 
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.
 
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
 
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 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'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
 
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*
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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