I tried to do something as simple as "if any unit owned by Player 1 enters Region 001, kill all units in Region 002 owned by Player 2".
Not working.
The usual function Units in Region Matching Condition is not available, the only function that is available is one that requires a specific index of a specific group.
Is there any pattern behind why certain function are available or not?
This is what I have and it simply fails
Not just that I cannot specify the owning player, it also destroy the first unit that enters region 001 and does nothing to any unit in region 002.
And events aren't supposed to be raised only once, or?
Note that you have 'Unit - Kill [Triggering Unit]' where you should have picked unit. Also there is function within player groups that is Convert Player to PLayer Group that you can use to specify a certain player, or if that doesn't work for you, you can add an if statement in your actions for the unit group that checks who owns certain units.
Triggering unit is the unit that entered the region and has nothing to do with a unit group loop.
In the group loop, replace triggering unit by "Picked Unit" (That's the current unit of the loop, so each unit in the group one time is the picked unit).
If you want only units by player 2 being killed, just replace the "Any Player" by 2.
To check the entering unit's owner add a condition "Owner of unit" with triggering unit.
I want to ask a related (in some way :) ) question. How can I create a condition "all units owned by player X are dead"? There is a condition like "number of units of type <alive> in <group>", but I can't find any way to get the number of units owned by player to convert this into group...
Thanks, now it kills the right units.
But There is no available function for getting the player of the entering unit.
I realized I could just use a condition for checking the triggering unit's owner.
Actually works now.
@Downsizer, this is what I use for victory/defeat conditions, it ends the game in victory if all enemies have no units left and defeat if the player has no units left:
Yeah, that was also my problem many times. I assumed there must be an easy, simple function for everything but often there is none and you just use a more complex function with more parameters of which several are unspecified values like "any" and "whole map".
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I tried to do something as simple as "if any unit owned by Player 1 enters Region 001, kill all units in Region 002 owned by Player 2". Not working. The usual function Units in Region Matching Condition is not available, the only function that is available is one that requires a specific index of a specific group. Is there any pattern behind why certain function are available or not?
This is what I have and it simply fails
Not just that I cannot specify the owning player, it also destroy the first unit that enters region 001 and does nothing to any unit in region 002. And events aren't supposed to be raised only once, or?
@Lakshun: Go
Note that you have 'Unit - Kill [Triggering Unit]' where you should have picked unit. Also there is function within player groups that is Convert Player to PLayer Group that you can use to specify a certain player, or if that doesn't work for you, you can add an if statement in your actions for the unit group that checks who owns certain units.
Triggering unit is the unit that entered the region and has nothing to do with a unit group loop.
In the group loop, replace triggering unit by "Picked Unit" (That's the current unit of the loop, so each unit in the group one time is the picked unit).
If you want only units by player 2 being killed, just replace the "Any Player" by 2.
To check the entering unit's owner add a condition "Owner of unit" with triggering unit.
I want to ask a related (in some way :) ) question. How can I create a condition "all units owned by player X are dead"? There is a condition like "number of units of type <alive> in <group>", but I can't find any way to get the number of units owned by player to convert this into group...
Thanks, now it kills the right units. But There is no available function for getting the player of the entering unit. I realized I could just use a condition for checking the triggering unit's owner.
Actually works now. @Downsizer, this is what I use for victory/defeat conditions, it ends the game in victory if all enemies have no units left and defeat if the player has no units left:
@Lakshun: Go
Thank you. I didn't try "Units in region matching condition". I thought it must be something less charged...
Yeah, that was also my problem many times. I assumed there must be an easy, simple function for everything but often there is none and you just use a more complex function with more parameters of which several are unspecified values like "any" and "whole map".