Jump to content
Sign in to follow this  
OzeRick

Random Spawn Generator script

Recommended Posts

Hi all

I thort that I would share this script that I have made.

I know that it may not be up to the high standards of some of the scripts on here :0

but if it helps some on with there missions all the better.

The reason that I made the script was that I could not find what I was after and I found it a good learning process.

Any how here it is have fun with it.

// /////////////////////////////////////////////////////////////////////////////

// / Random spawn Generator

// This SQF Function created using Script Edit v0.7 on 2010-01-18 17:35:20Z

//

// OzeRick

// RandomSpawnGen.sqf

// version 1.0.

//

// this script allows you to spawn any side and number of unit in a random area around a central point

// to use

//1.} place a Functions Module onto map

//2.) place a game logic/Objects/Game logic on map and name it i.e. t1

//3.) You can place the below in the logic or a trigger its up to you

//

// parameters

//nul = [position,area,Number,Distance,Side,] execvm"RandomSpawnGen.sqf";

//nul = [t1,500,20,150,east] execvm "RandomSpawnGen.sqf";

//

// you can change _units = ........

// to

// ["MOL_Officer","MOL_Rifleman","MOL_Medic","MOL_Soldeir_AA","MOL_Soldier_AT","MOL_Soldier_MG"];

// or any other units that you like

// ////////////////////////////////////////////////////////////////////////////////////////////////

_pos = _this select 0;

_area = _this select 1;

_Num = _this select 2;

_dist = _this select 3;

_side = _this select 4;;

_skill = [0.6,1];

_a = "SkeetDisk";// obj to use as spawn place.

for [{_i = 0},{_i < _Num},{_i = _i + 1}] do

{

_newpos = GetPos _pos;

_posX = _newpos select 0;

_posY = _newpos select 1;

if ( isNil "ob_u" ) then { ob_u = 0 };

ob_u = ob_u+ 1;

_mar = format["ob%1", ob_u ];

_mar = _a createVehicle[(_posX + random _area)-_area/2, (_posY + random _area)-_area/2,0];

_units = 2 + Random 10;// for a random number of unit's in each group

_grp = [(getpos _mar),_side,_units, [], [], _skill] call bis_fnc_spawngroup;

[_grp, ( getPos _mar), _dist] call BIS_fnc_taskPatrol;

sleep 0.8;

};

Edited by OzeRick

Share this post


Link to post
Share on other sites

Hey oze.

i was wondering if i can use this in I44

if so please pm me and tell me how :P

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  

×