I'm trying to make a trigger for a king of the hill style map, where when a unit is in a region a timer is created, and when that timer expires the hill is captured. However I'm having trouble with triggers that pause/stop the timer 1:when units leave the hill before it is captured, and 2:when units from the enemy team contest the hill.I'm currently using the "unit enters/leaves region" event, which causes a new timer to start every single time a unit enters the region.
I've been trying to use conditions to prevent new timers from being created, and instead pause and unpause the current one. But it's a little too complicated for a noob like me, so I'm wondering if there's an event I can use that basically says "player has units in region".
I feel like such an event would be way easier to work with. If not, can anyone give me some advice to make this trigger? I'm sorry if this whole paragraph was a little hard to understand, I still don't fully understand most of the trigger systems myself so they're hard for me to explain :/
Theres a few ways you could go about this, My editor is not up to date...so I cant open it to give you a pic... im sure nother user will stop by and do that if needed, ... im sure theres another way to do it then the wayim about to tell you... but without my editor I cant think of the action.. but using what you have set up, you can do this (im going to pretend you only have 1 hill, if more, just make an array,]
Make a var called inHill = false;
then in you "enter/leaves" event if unit enters, and Inhill = false THEN you can set the timer to start, and then set inhill = true (as someone is in hill) now when something leaves the hill, check to make sure there are still people left (for exmaple if he brings two people, and only 1 leaves, need to check for that) if noones left, set inHill = false again and stop timer =D
Like I said, I KNOW theres a better way, as I answered this exact question for aother user some months ago (and the search feature is horrible and cant find it)
now when something leaves the hill, check to make sure there are still people left (for exmaple if he brings two people, and only 1 leaves, need to check for that)
now when something leaves the hill, check to make sure there are still people left (for exmaple if he brings two people, and only 1 leaves, need to check for that)
That's exactly my problem lol. How can I do that?
aww well thats easy =D
once again I wish I could link the exact fact
condition: number of unites in unit group (unites in location YOUR HILL owned by player (Triggering player) >= 1
then that means there are still people left behind
now you may need another var making sure its the right player, but you should get the idea from that
What you posted works... BUT its not needed[and a little messy] BUT you can do it that way.
dont need tables for this, just vars/arrays. to make it global (use from trigger to trigger) on the left side of the screen (where it shows each trigger) make your vars there (instead of inside the trigger) those become global vars/arrays that you can use anywhere.
ah ha, yeah that thread works. and i postedwhat I was talking about in it.
" (Number of Living units in (Marine units in (Entire map) owned by player Player # matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 2"
entire map would be your zone, and player # woudl be the player leaving/started the time.
Rollback Post to RevisionRollBack
Random Information
Tutorials - Map Development - Galaxy wiki
|Issues? PM me|
I'm trying to make a trigger for a king of the hill style map, where when a unit is in a region a timer is created, and when that timer expires the hill is captured. However I'm having trouble with triggers that pause/stop the timer 1:when units leave the hill before it is captured, and 2:when units from the enemy team contest the hill.I'm currently using the "unit enters/leaves region" event, which causes a new timer to start every single time a unit enters the region.
I've been trying to use conditions to prevent new timers from being created, and instead pause and unpause the current one. But it's a little too complicated for a noob like me, so I'm wondering if there's an event I can use that basically says "player has units in region".
I feel like such an event would be way easier to work with. If not, can anyone give me some advice to make this trigger? I'm sorry if this whole paragraph was a little hard to understand, I still don't fully understand most of the trigger systems myself so they're hard for me to explain :/
Theres a few ways you could go about this, My editor is not up to date...so I cant open it to give you a pic... im sure nother user will stop by and do that if needed, ... im sure theres another way to do it then the wayim about to tell you... but without my editor I cant think of the action.. but using what you have set up, you can do this (im going to pretend you only have 1 hill, if more, just make an array,]
Make a var called inHill = false;
then in you "enter/leaves" event if unit enters, and Inhill = false THEN you can set the timer to start, and then set inhill = true (as someone is in hill) now when something leaves the hill, check to make sure there are still people left (for exmaple if he brings two people, and only 1 leaves, need to check for that) if noones left, set inHill = false again and stop timer =D
Like I said, I KNOW theres a better way, as I answered this exact question for aother user some months ago (and the search feature is horrible and cant find it)
now when something leaves the hill, check to make sure there are still people left (for exmaple if he brings two people, and only 1 leaves, need to check for that)
That's exactly my problem lol. How can I do that?
aww well thats easy =D
once again I wish I could link the exact fact
condition: number of unites in unit group (unites in location YOUR HILL owned by player (Triggering player) >= 1
then that means there are still people left behind
now you may need another var making sure its the right player, but you should get the idea from that
Are there variables that I can use from trigger to trigger? I'm thinking if I can create a trigger like this:
Event: Unit enters region
Action: Modify variable "hill count" +1
...then use the "hill count" variable in other triggers, I can get this hill working.
Off topic question: what's the difference between the local and global data tables?
BTW, is this the link you're looking for: http://forums.sc2mapster.com/development/triggers/20130-king-of-the-hill/#p9
no, the one im thinking of i posted in.
What you posted works... BUT its not needed[and a little messy] BUT you can do it that way.
dont need tables for this, just vars/arrays. to make it global (use from trigger to trigger) on the left side of the screen (where it shows each trigger) make your vars there (instead of inside the trigger) those become global vars/arrays that you can use anywhere.
I think I found your previous post on this topic: http://forums.sc2mapster.com/development/map-development/6813-really-stupid-trig-question-2-units-in-region-kill/
Google>sc2mapster forum search :)
Thanks for the help! I'll come back and update this thread when I get the trigger working.
ah ha, yeah that thread works. and i postedwhat I was talking about in it.
" (Number of Living units in (Marine units in (Entire map) owned by player Player # matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 2"
entire map would be your zone, and player # woudl be the player leaving/started the time.
@dubo863: Go
is this sort of what you're looking for? I pretty much have the hill system down so if you want I can send you a copy of the triggers for it.