I recently wanted to create a group of units based on probability; so 50% of the time spawn a group of units at a certain position.
To do this create the group, set the probability of presence of the leader to your desired probability and then for each member of the group set a condition of presence that requires the leader to be present. So,
(alive group_leader);
Job done!
Edit - Added screenshots for clarity:
You can have as many units as you want, in this example I have a player (blue), a group leader (purple civillian in front), and 4 dependent civilians behind. Ordinarily you would have all these units grouped using the group tool (F2) so they work as a team but it is not required.
Units |
Group leader config |
(alive group_leader);making sure that group_leader is the name of the leader that you configured earlier.
Dependent unit config |
Hello please help me, I've been trying to get this to work for about 2 hours this Is simply not working, the leader unit is spawning randomly but the dependant unit with (alive P1); in this condition of presence will never appear. I found somebody else with this problem but with no solution. if you have this working I must be doing something wrong.
ReplyDeleteHi,
ReplyDeleteI definatly had this working before although that was back at the end of beta.
I assume the dependant unit spawns properly if you set it's condition of presence to true?
The other thing I can think of its to make sure that P1 really is the name of the leader unit not the dependant unit.
I should be able to test this later this afternoon so will let you know what I find.