spawning in one of several locations in a list

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
TrooperWally
Posts: 45
Joined: Fri Oct 11, 2013 11:15 am

spawning in one of several locations in a list

Post by TrooperWally »

So I gather that I can make a unit spawn in one of several locations by linking it to multiple markers. Now, what about making three units (or groups of units) spawn at three random locations from a list of five locations? Googled for this and can't find it. The workaround is to play with the probability of presence slider and just have troops in all five places but that introduces variability into the total number of units spawned. I think LaKroy investigated this for his recent artillery mission but mentioned on the playthrough that advanced scripting was required to achieve this result. Any suggestions or advice would be warmly received.

EsotericReverie
Posts: 84
Joined: Thu Sep 05, 2013 8:30 am

Re: spawning in one of several locations in a list

Post by EsotericReverie »

Something like this on group leader init, maybe? And put all members "In formation"?

Code: Select all

locations = [marker1, marker2,...];
location = locations select random (count locations);
this setPos getMarkerPos location;

Post Reply