ive been messing around with the editor and i am impressed by the amount of thing you can do with it.
Yet, very simple thing like Regions are giving me hard time.
What i want to do is a region that , when containing a unit from a certain player or his ally, give the ownership of a specific unit in the map, to the player inside the region. When no unit from the player or his ally are present in the region, it transfert back to neutral and stops moving.
You might want to look at "Unit Enters Region" and "Unit Leaves Region". For the enter, just check if the unit is already owned by the player, if not, change ownership, then add a condition for the leave that checks if the amount of units owned by the player of the leaving unit is equal to 0, if it is, change the owner to neutral. Changing owners can be done very simply by using the action "Change Owner" :)
EDIT:
To check the amount of units in a region, you can use:
(Number of Living units in (Any units in Anywhere owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
It's under Unit Group - Number Of Units In Unit Group.
Please have a look at the attached map and triggers image.
(it's pretty simple :) )
Edit: also, using "Unit Enters Region" and "Unit Leaves Region" would not register that every unit was killed in the region and you wouldn't lose control of the unit.
Hi
ive been messing around with the editor and i am impressed by the amount of thing you can do with it. Yet, very simple thing like Regions are giving me hard time.
What i want to do is a region that , when containing a unit from a certain player or his ally, give the ownership of a specific unit in the map, to the player inside the region. When no unit from the player or his ally are present in the region, it transfert back to neutral and stops moving.
anyone could help me on this simple task ? :/
thank you
You might want to look at "Unit Enters Region" and "Unit Leaves Region". For the enter, just check if the unit is already owned by the player, if not, change ownership, then add a condition for the leave that checks if the amount of units owned by the player of the leaving unit is equal to 0, if it is, change the owner to neutral. Changing owners can be done very simply by using the action "Change Owner" :)
EDIT: To check the amount of units in a region, you can use:
(Number of Living units in (Any units in Anywhere owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
It's under Unit Group - Number Of Units In Unit Group.
Actually usign the "Rescue Unit Group" function works alot better because the nu can define amount of units, types, owning player and more
Please have a look at the attached map and triggers image.
(it's pretty simple :) )
Edit: also, using "Unit Enters Region" and "Unit Leaves Region" would not register that every unit was killed in the region and you wouldn't lose control of the unit.