I'm trying to write a trigger that kills a certain percentage of a players units(structures in this case). The percentage is set from an integer variable. I want the structures that are chosen to be killed be random, but add up to the percentage. I also need to be able to protect(not kill) the players units
Example, player owns 6 buildings and 2 units. The current percentage is set at 33%. This trigger is called and 2 of the players buildings explode.
The trigger editor is actually pretty easy, but I'm running into some problems with this one. Thanks!
Add all the structures to a Unit Group.
Save how many buildings you want to kill in an Integer.
Create a for loop that runs from 1 to (number of buildings to kill Integer).
In for loop, kill a random Unit from Unit Group you created earlier.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to write a trigger that kills a certain percentage of a players units(structures in this case). The percentage is set from an integer variable. I want the structures that are chosen to be killed be random, but add up to the percentage. I also need to be able to protect(not kill) the players units
Example, player owns 6 buildings and 2 units. The current percentage is set at 33%. This trigger is called and 2 of the players buildings explode.
The trigger editor is actually pretty easy, but I'm running into some problems with this one. Thanks!
Add all the structures to a Unit Group. Save how many buildings you want to kill in an Integer. Create a for loop that runs from 1 to (number of buildings to kill Integer). In for loop, kill a random Unit from Unit Group you created earlier.