you said everything already works until a building gets destroyed. now this is our event where we start. now create an action called StartLink. StartLink adds all buildings into a global unitgroup variable and then calls a new action called UnitLink which takes a unit as parameter. You call this action with the command center. within unitlink you check if the unit is in the global unitgroup, if no do nothing, if yes remove the unit from the unigroup, add power behaviour and call unitlink with all units close to the unit, thats it.
with triggers you can constantly start at the CC, get all next buildings, power them (add behaviour, remove from unit group of all buildings of player) then get all buildings next to these buildungs and so on, when the alogrithm is finished, unpower al remaining buildings in the unit group.
each time a unit is destroyed you have to run this algo.
if you ask for a data only solution, i cannot think of one for now.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
@dragozal: Go
you said everything already works until a building gets destroyed. now this is our event where we start. now create an action called StartLink. StartLink adds all buildings into a global unitgroup variable and then calls a new action called UnitLink which takes a unit as parameter. You call this action with the command center. within unitlink you check if the unit is in the global unitgroup, if no do nothing, if yes remove the unit from the unigroup, add power behaviour and call unitlink with all units close to the unit, thats it.
Event -> StartLink -> UnitLink (CC) -> UnitLink (a), UnitLink (b) ...
with triggers you can constantly start at the CC, get all next buildings, power them (add behaviour, remove from unit group of all buildings of player) then get all buildings next to these buildungs and so on, when the alogrithm is finished, unpower al remaining buildings in the unit group.
each time a unit is destroyed you have to run this algo. if you ask for a data only solution, i cannot think of one for now.