Page 1 of 1

How to do random unit spawns?

Posted: Wed Aug 02, 2017 1:17 am
by best75
How do I use the triggers to do random unit spawns.

Re: How to do random unit spawns?

Posted: Wed Aug 02, 2017 3:09 am
by bru888
Here's an example. Click each image.

A Random Trigger is used to randomly choose one of six possibilities to be subsequently activated by triggers Carriers 1 through Carriers 6. Notice only the Random Trigger is active from the start:
Screenshot 1.jpg
Screenshot 1.jpg (107.77 KiB) Viewed 1689 times
When it is randomly chosen, one of the Carriers triggers will place three Japanese carriers in three spots selected by Target Hex. Only three carriers end up on the map, but there are six sets of three possible locations each, for a total of 18:
Screenshot 2.jpg
Screenshot 2.jpg (101.72 KiB) Viewed 1689 times
Answered indirectly is this possible question: Can the unit types themselves be randomized, not just their placement? Sure, but each one has to be planned and built into a trigger. Nothing is actually randomized other than the random selection of a series of alternative "sub-triggers," if you will. It all has to be programmed in detail.

Re: How to do random unit spawns?

Posted: Wed Aug 02, 2017 10:30 am
by best75
I am understanding the random trigger and how to do random placements now. Thanks for the answer

Re: How to do random unit spawns?

Posted: Wed Aug 02, 2017 2:07 pm
by bru888
My pleasure. One follow-up thought; this number is important:
2017-08-02_03.jpg
2017-08-02_03.jpg (15.44 KiB) Viewed 1673 times
Here, it is set to randomly choose only one of the Carriers sub-triggers. Say, however, that I actually wanted to place six carriers on the map randomly, instead of just three. Then I would set this number to "2" and it would activate two sub-triggers, three carriers each, equals six.