Jump to content
Sign in to follow this  
Weedburner

Spawn Defense Positions (Example)

Recommended Posts

Hello

Perhaps you can use this for your Missions too.

A Trigger which will add 1. An Ingame existing Composition and 2.A Group of soldiers which will defend this Composition and mann the Static Guns of the Composition.

Example:

This Camp camp_ru2.jpg

will be created and a group of Soldiers which will defend it.

On Map needed:

Marker where Camp Spawns (here "Camp1")

Object where Group Spawns (use an invisible Helipad,here named "rupos")

Functionmanager Module (dont work without dont forget it ;) )

Scripts needed:

GroupSpawn.sqf

_grp = [(getpos rupos), east, 12] call bis_fnc_spawngroup;

[_grp, getMarkerPos "camp1"] call BIS_fnc_taskDefend;

CreateComposition.sqf

/*

Original Script

objectMapper.sqf Author: Joris-Jan van 't Land

Edited by armatec

Description:

Takes an array of data about a dynamic object template and creates the objects.

Parameter(s):

_this select 0: compositions name - "fuelDepot_us"

_this select 1: Direction in degrees - Number

_this select 2: Location to start

Exsample:

["MediumTentCamp_napa", 0, getpos player] execVM "Createcomposition.sqf";

*/

_script = _this select 0;

_azi = _this select 1;

_pos = _this select 2;

_objs = [];

_objs = call (compile (preprocessFileLineNumbers format ["\CA\modules\DynO\data\scripts\compositions\%1.sqf",_script]));

private ["_posX", "_posY"];

_posX = _pos select 0;

_posY = _pos select 1;

_newObjs = [];

private ["_multiplyMatrixFunc"];

_multiplyMatrixFunc =

{

private ["_array1", "_array2", "_result"];

_array1 = _this select 0;

_array2 = _this select 1;

_result =

[

(((_array1 select 0) select 0) * (_array2 select 0)) + (((_array1 select 0) select 1) * (_array2 select 1)),

(((_array1 select 1) select 0) * (_array2 select 0)) + (((_array1 select 1) select 1) * (_array2 select 1))

];

_result

};

for "_i" from 0 to ((count _objs) - 1) do

{

private ["_obj", "_type", "_relPos", "_azimuth", "_fuel", "_damage", "_newObj"];

_obj = _objs select _i;

_type = _obj select 0;

_relPos = _obj select 1;

_azimuth = _obj select 2;

if ((count _obj) > 3) then {_fuel = _obj select 3;};

if ((count _obj) > 4) then {_damage = _obj select 4;};

private ["_rotMatrix", "_newRelPos", "_newPos"];

_rotMatrix =[[cos _azi, sin _azi],[-(sin _azi), cos _azi]];

_newRelPos = [_rotMatrix, _relPos] call _multiplyMatrixFunc;

private ["_z"];

if ((count _relPos) > 2) then {_z = _relPos select 2} else {_z = 0};

_newPos = [_posX + (_newRelPos select 0), _posY + (_newRelPos select 1), _z];

_newObj = _type createVehiclelocal _newPos;

_newObj setDir (_azi + _azimuth);

_newObj setPos _newPos;

if (!isNil "_fuel") then {_newObj setFuel _fuel};

if (!isNil "_damage") then {_newObj setDamage _damage};

_newObjs = _newObjs + [_newObj];

};

Trigger which makes the Camp

Activate with whatever you want for example player distance rupos < 300

At Activation:

nul = ["camp_ru2", 0, getMarkerPos "camp1"] execVM "Createcomposition.sqf";nul=execVM "spawngroup.sqf"

This will spawn 12 Russian Soldiers which will Defend the Russian Camp including use of Static Guns.

Important: I forgot to say that the Functionmanager only will spawn the Russian Soldiers when at least 1 other russian soldier already exist.So you must have at least 1 unit of the side you want to spawn

EDIT:

Operation Arrowhead also has nice Compositions.

You can find them when unpacking modules_e.To Spawn them you must change the Path in the CreateComposition.sqf from Modules to Modules_e

Try out checkpoint1_us,a real good made Street Controll Point

Edited by Weedburner

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  

×