I'm trying to make it so when a mule controlled by a human player moves into a region it gives that player control of all units and buildings in a different region i think im getting close but its not working this is what I have.
Events
-Triggering unit enters region x
Local Variables
Conditions
Actions
-Unit - change ownership of unit attached to region z to player 1
-Unit - kill triggering unit
Well firstly, if you only want to do it if it is a mule, you probably want to add that condition (If Unit Type of triggering Unit == Unit Type of "Mule"). Next you probably need to loop through the units in the region, because I am not sure about the behavior of "unit attached to region". There is a "For each unit in region" loop or something, and you could loop through it, changing the ownership. You probably also need to get the player owning the triggering unit though, if you want to make sure you are giving control to that player.
You seem to be pretty new to triggers, so I decided to write what the above guy said as a trigger :)
SetOwner
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
(Unit type of (Triggering unit)) == MULE
(Controller of player (Owner of (Triggering unit))) == User
Actions
Unit Group - Pick each unit in (Any units in Region 002 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Change ownership of (Picked unit) to player (Owner of (Triggering unit)) and Change Color
Unit - Kill (Triggering unit)
I assume you want to kill the mule (this is the last line in the trigger)
You seem to be pretty new to triggers, so I decided to write what the above guy said as a trigger :)
SetOwner
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
(Unit type of (Triggering unit)) == MULE
(Controller of player (Owner of (Triggering unit))) == User
Actions
Unit Group - Pick each unit in (Any units in Region 002 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Change ownership of (Picked unit) to player (Owner of (Triggering unit)) and Change Color
Unit - Kill (Triggering unit)
I assume you want to kill the mule (this is the last line in the trigger)
i cant seem to find those conditions i tried to manually type them and it changes to
You add a comparison condition. Thats what you have got now. Then, if you look at the buttom of the screen, there is a text (Owner of (Triggering unit)) == 1 where some of the words are marked. Press the first ( to select the left side of the comparison, and find the Unit Type Of Unit field. That should make the left side. For the right side, you can click the red Value 2 in the buttom of the screen, and find MULE.
well the original guy didnt reply back but i sure as hell will after about no joke 6-7 hours going over trigger after trigger combinations i finally found this explination and it did exactly what i wanted for my situation(althought slightly different basically the same) YOU ROCK BRO! ty so much!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to make it so when a mule controlled by a human player moves into a region it gives that player control of all units and buildings in a different region i think im getting close but its not working this is what I have.
Events -Triggering unit enters region x
Local Variables
Conditions
Actions -Unit - change ownership of unit attached to region z to player 1 -Unit - kill triggering unit
@SovietUranus: Go
Well firstly, if you only want to do it if it is a mule, you probably want to add that condition (If Unit Type of triggering Unit == Unit Type of "Mule"). Next you probably need to loop through the units in the region, because I am not sure about the behavior of "unit attached to region". There is a "For each unit in region" loop or something, and you could loop through it, changing the ownership. You probably also need to get the player owning the triggering unit though, if you want to make sure you are giving control to that player.
You seem to be pretty new to triggers, so I decided to write what the above guy said as a trigger :)
SetOwner
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
(Unit type of (Triggering unit)) == MULE
(Controller of player (Owner of (Triggering unit))) == User
Actions
Unit Group - Pick each unit in (Any units in Region 002 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Change ownership of (Picked unit) to player (Owner of (Triggering unit)) and Change Color
Unit - Kill (Triggering unit)
I assume you want to kill the mule (this is the last line in the trigger)
i cant seem to find those conditions i tried to manually type them and it changes to
(Owner of (Triggering unit)) == 1
You add a comparison condition. Thats what you have got now. Then, if you look at the buttom of the screen, there is a text (Owner of (Triggering unit)) == 1 where some of the words are marked. Press the first ( to select the left side of the comparison, and find the Unit Type Of Unit field. That should make the left side. For the right side, you can click the red Value 2 in the buttom of the screen, and find MULE.
well the original guy didnt reply back but i sure as hell will after about no joke 6-7 hours going over trigger after trigger combinations i finally found this explination and it did exactly what i wanted for my situation(althought slightly different basically the same) YOU ROCK BRO! ty so much!