Jump to content
Sign in to follow this  
muttly

Making objectives spawn in random locations

Recommended Posts

Hi ive tried searching looking about but could nt find any thing.

Basically instead of putting my evidence/target ect down before a mission so i know where its goin to be how do i make it spawn in say 1 of 3 locations so adds bit randomness to the mission and i have look about abit.

Hope that makes sence:o

Share this post


Link to post
Share on other sites

Hi there,

You can do the following:

Lets say you have a Suitcase and you want it to spawn in random positions.

On the suitcase init line you execute a script:

nul = this execVM "suitcaseSpawn.sqf";

suitcaseSpawn.sqf

if (!isServer) exitWith {};  //Runs on server only

private ["_obj", "_pos"];
_obj = _this;
_pos = floor (random 2);

switch (_pos) do
{
case 0 : { _obj setPos (getPos POSITION1) };
case 1 : { _obj setPos (getPos POSITION2) };
case 2 : { _obj setPos (getPos POSITION3) };
};

Share this post


Link to post
Share on other sites

Group the objects with markers and when the mission starts it'll appear at one of the marker locations, or it's placed location, randomly.

Or do something like in this post where a group of objects will be moved to to any one of a preset group of locations. There's an example mission in that link that shows it at work.

Or what Neo said. :)

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  

×