Actions > General > If-Then-Else > If > Units in Region Matching Condition, Then> Issue Order > Order Targeting Point
That should work.
In essence, your unit enters the region, if the units in the region match the conditions you set (ie: total number 5, excluding dead, missiles, etc) then issue order to attack targeting region Loc 2. You might also want to add an action "Wait for Condition" to continue checking the condition every 0.05 secs or whatever, so that the trigger doesn't just run once.
I only want the units from a specific player to have that order. Got something like this now but i am clueless what to do.
Unit - Any Unit Enters (Entire map)
(Any units in regLoc[1] owned by player (Player 4 from (Allies of player 4)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == (Unit group((Triggering unit)))
I dunno what kind of map you're doing so it's a little hard, but I'll try.
To make things easier on yourself, make player groups and unit groups. In all my maps I have a few triggers that start on Map Initialization which just run background stuff, like creating groups. Make a trigger like that... Event > Map Initialization, Event > Add Player to Player Group. You have to create the variables for this first. So if you have 8 User players, create 8 groups and 8 actions, name them P1,P2,P3,P4, etc... choose Player Group as the variable type and leave it "empty".
What you may also want to do is create a Unit Group, or several... so that when a unit is created, it's immediately added to the Unit Group. Create variables for Unit Groups the same way as for player groups. Name them whatever you want. ie: P1 Marine Group
So, now you can say:
Event >
Unit - (Unit (Number of Living units in "Unit Group") from "Unit Group") Enters (Entire map)
Conditions >
(Owner of (Unit (Number of Living units in Unit Group) from Unit Group)) == x number of units
Actions >
Issue Order > Order Targeting Point
I can't write your map for you, but that should give you a good idea of how to work the trigger/conditions... mess around with it.
Np, it shouldn't be that complicated of a trigger... just if you're going to have it send groups, and only if the groups equal a certain size, you have a few more things to do. You're on the right track though, use the Unit Enters Region event, Wait for Condition (under actions), check Condition - if units owned by player (or units in unit group) living == x number, Then send them to attack x location.
One of the best ways I learned was by looking over the Campaign maps and seeing how the Blizzard devs set up their games.
Hello I have difficulties with the following problem
I want to make a trigger where it checks that a unit enters a specific region, what would be the event condidtions for that?
Like, a unit enters a region if region = Loc1 then order unit to attack Loc 2
Also is there a way to count the amount of units in a region belonging to a specific player?
thanks.
@CreedLord: Go
I think what you're looking for is: (easy answer)
Event > Unit > Unit Enters/Leaves Region
Actions > General > If-Then-Else > If > Units in Region Matching Condition, Then> Issue Order > Order Targeting Point
That should work.
In essence, your unit enters the region, if the units in the region match the conditions you set (ie: total number 5, excluding dead, missiles, etc) then issue order to attack targeting region Loc 2. You might also want to add an action "Wait for Condition" to continue checking the condition every 0.05 secs or whatever, so that the trigger doesn't just run once.
So what would be the conditions exactly?
I only want the units from a specific player to have that order. Got something like this now but i am clueless what to do.
Unit - Any Unit Enters (Entire map)
(Any units in regLoc[1] owned by player (Player 4 from (Allies of player 4)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == (Unit group((Triggering unit)))
@CreedLord: Go
I dunno what kind of map you're doing so it's a little hard, but I'll try.
To make things easier on yourself, make player groups and unit groups. In all my maps I have a few triggers that start on Map Initialization which just run background stuff, like creating groups. Make a trigger like that... Event > Map Initialization, Event > Add Player to Player Group. You have to create the variables for this first. So if you have 8 User players, create 8 groups and 8 actions, name them P1,P2,P3,P4, etc... choose Player Group as the variable type and leave it "empty".
What you may also want to do is create a Unit Group, or several... so that when a unit is created, it's immediately added to the Unit Group. Create variables for Unit Groups the same way as for player groups. Name them whatever you want. ie: P1 Marine Group
So, now you can say:
Event > Unit - (Unit (Number of Living units in "Unit Group") from "Unit Group") Enters (Entire map)
Conditions > (Owner of (Unit (Number of Living units in Unit Group) from Unit Group)) == x number of units
Actions > Issue Order > Order Targeting Point
I can't write your map for you, but that should give you a good idea of how to work the trigger/conditions... mess around with it.
Hm k thx, I am trying to write an art of defence maps where the attackers sends units to specific regions.
Ill try thx for your assistance, its the only problem i have atm.
@CreedLord: Go
Np, it shouldn't be that complicated of a trigger... just if you're going to have it send groups, and only if the groups equal a certain size, you have a few more things to do. You're on the right track though, use the Unit Enters Region event, Wait for Condition (under actions), check Condition - if units owned by player (or units in unit group) living == x number, Then send them to attack x location.
One of the best ways I learned was by looking over the Campaign maps and seeing how the Blizzard devs set up their games.
Hmm good idea where are the campaign maps located at exactly? :p
Thx for all your help, ill credit you.