I used the following trigger to try and determine which units on the map. It does not work. The player who select the Imperial forces attribute should end up with all of the units in the Imperial forces player group and so on. Can anyone look over my trigger and tell me whats wrong?
Unitownership2
Events TriggerAddEventMapInit()
Local Variables
Conditions
Actions
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0001")
then
UnitSetOwner((UnitGroupUnit(Imperial Forces, (UnitGroupCount(Imperial Forces, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0004")
then
UnitSetOwner((UnitGroupUnit(COE Dragon, (UnitGroupCount(COE Dragon, c_unitCountAll)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0007")
then
UnitSetOwner((UnitGroupUnit(COE Alphan COE Alphan, (UnitGroupCount(COE Alphan COE Alphan, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0008")
then
UnitSetOwner((UnitGroupUnit(COE Google, (UnitGroupCount(COE Google, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0005")
then
UnitSetOwner((UnitGroupUnit(COE Hammer, (UnitGroupCount(COE Hammer, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0006")
then
UnitSetOwner((UnitGroupUnit(COE Tau Ceti, (UnitGroupCount(COE Tau Ceti, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0003")
then
UnitSetOwner((UnitGroupUnit(Remnant, (UnitGroupCount(Remnant, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
IfThenElse()
if
Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0002")
then
UnitSetOwner((UnitGroupUnit(Zyntorni, (UnitGroupCount(Zyntorni, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true)
else
I'm also having a similar problem. I can't figure out how to allow people to change their faction from the lobby. You can select your team in the lobby but right now it doesn't do anything because my trigger's pretty much useless.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I used the following trigger to try and determine which units on the map. It does not work. The player who select the Imperial forces attribute should end up with all of the units in the Imperial forces player group and so on. Can anyone look over my trigger and tell me whats wrong?
Unitownership2
Events TriggerAddEventMapInit() Local Variables Conditions Actions IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0001") then UnitSetOwner((UnitGroupUnit(Imperial Forces, (UnitGroupCount(Imperial Forces, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0004") then UnitSetOwner((UnitGroupUnit(COE Dragon, (UnitGroupCount(COE Dragon, c_unitCountAll)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0007") then UnitSetOwner((UnitGroupUnit(COE Alphan COE Alphan, (UnitGroupCount(COE Alphan COE Alphan, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0008") then UnitSetOwner((UnitGroupUnit(COE Google, (UnitGroupCount(COE Google, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0005") then UnitSetOwner((UnitGroupUnit(COE Hammer, (UnitGroupCount(COE Hammer, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0006") then UnitSetOwner((UnitGroupUnit(COE Tau Ceti, (UnitGroupCount(COE Tau Ceti, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0003") then UnitSetOwner((UnitGroupUnit(Remnant, (UnitGroupCount(Remnant, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else IfThenElse() if Comparison((GameAttributePlayerValue("1", 2)), ==, "1|0002") then UnitSetOwner((UnitGroupUnit(Zyntorni, (UnitGroupCount(Zyntorni, c_unitCountAlive)))), (PlayerGetPropertyInt(2, c_playerPropMinerals)), true) else
I'm also having a similar problem. I can't figure out how to allow people to change their faction from the lobby. You can select your team in the lobby but right now it doesn't do anything because my trigger's pretty much useless.