Jump to content
Sign in to follow this  
Bahger

Spawn & deploy by probability with one unit out of three guaranteed to appear

Recommended Posts

I'd like to enhance replayability in a mission by placing identical OPFOR reinforcement convoys in three locations, giving each specific orders (waypoints, etc.) but here's the tricky bit: I want only one of the three groups to spawn and deploy, i.e. for there to be a 33% chance for any one of these three groups to appear and once one does, the others do not. Over the next playthrough, another of the three groups might spawn and deploy, but never more than one per playthrough with an even chance of any one of them being "selected". Can anyone guide me here? Many thanks.

Share this post


Link to post
Share on other sites

1. If the Convoys are the same, and you only want one; just use ONE Convoy and Group them to Markers (empty)

for a Random Spawn at Just ONE LOCATION. Start 1 Convoy + 2 Markers = 3 possible starting spots.

2. Then to get them to move to a SPECIFIC Spot, use Convoy1 doMove getPos Object1;

Object1 can be player, object, etc. For Marker use Convoy1 doMove getMarkerPos "MarkerName";

Name your Convoy Convoy1. You can also use Random patrols with a BIS function.

[group this, getPos this, 3000] call bis_fnc_taskPatrol;

Change the number for max patrol leg length. Change getPos this for patrol epicenter; or just leave as-is.

Share this post


Link to post
Share on other sites

Since you are assigning specific orders and waypoints, you can (for example) write a script for each varation and then use a randomized number to make a selection.

switch (1 + floor random 3) do {
case (1) : {[] execVM 'convoyvariation1.sqf'};
case (2) : {[] execVM 'convoyvariation2.sqf'};
case (3) : {[] execVM 'convoyvariation3.sqf'};
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×