Jump to content
Sign in to follow this  
frosties

Convoy with random routes

Recommended Posts

Is there any way to insert a convoy, and have them follow a random path?

So that the players have to search for them rather then know where they are?

The random bit make the mission re-playable in my eyes :) :j:

Share this post


Link to post
Share on other sites

edit this

//massa - advanced ambush mission
_user = _this select 0;
_var = _this select 1;
_usergroup = (group player);
_allobj = [];
_pos = [0,0,0];
_obj1 = [];
_currentobj = [];
_guardmis=grpNull;

_txtcommon = localize "STR_M04t0_5";
_txtfailhead = localize "STR_M04t2_6";//failed
_txtpasshead = localize "STR_M04t1_9";//complete
_txtpassbody = format["+%1 %2",_var,_txtcommon];

_MissionBriefingLong = localize "STR_M04t17_1";
_MissionBriefingHUD = localize "STR_M04t15_0";
_MissionBriefingShort = localize "STR_M04t16_0";
_txtfailbody = localize "STR_M04t18_0";

_deleteass =
{
BIS_EVO_Onmission=false;
sleep 12.0;
player removeSimpleTask _obj1;
_handle = [_guardmis] execVM "data\scripts\delete.sqf";
sleep 90.0;
deleteVehicle _heli;
deleteVehicle _heli1;
deleteVehicle _heli2;
deleteVehicle _heli3;
deleteVehicle _heli4;
deleteVehicle _heli5;
deleteVehicle _heli6;
};

_Fail = 
{
_obj1 settaskstate "Failed";
["#FF0000",_txtfailhead,_txtfailbody] call BIS_EVO_Message;
[] call _deleteass;
};

[West,"HQ"] SideChat localize "STR_M04t64";

if(_var == 10) then
{	
_allobj = ["mrnd1","mrnd3","mrnd6","mrnd7","mrnd11","mrnd17","mrnd9"];
};
if(_var == 20) then
{
_allobj = ["mrnd2","mrnd5","mrnd8","mrnd16","mrnd18","mrnd21","mrnd20"];
};
if(_var == 30) then
{
_allobj = ["mrnd4","mrnd9","mrnd12","mrnd13","mrnd14","mrnd10"];
};

_max = count _allobj;
_r = round random (_max - 1);
_rand =  _allobj select _r;
_pos = getMarkerPos _rand;

_obj1 = player createSimpleTask ["obj1"];
_obj1 setSimpleTaskDescription [_MissionBriefingLong,_MissionBriefingShort,_MissionBriefingHUD];
_obj1 setSimpleTaskDestination _pos;
_obj1 settaskstate "Created";
player setCurrentTask _obj1;

[2400] execVM "data\scripts\timer.sqf";
_mapview = [_pos,2] execVM "data\scripts\mismap.sqf";
sleep 5;
[West,"HQ"] SideChat localize "str_som_ambush_briefing_1";

waitUntil {player distance _pos < 1500 or not BIS_EVO_Onmission};	
//if (_usergroup != (group _user) or not BIS_EVO_Onmission) exitwith {[] call _Fail};
if (not BIS_EVO_Onmission) exitwith {[] call _Fail};

_guardmis = createGroup (east);

_pos2 = [(_pos select 0),(_pos select 1) - 15,(_pos select 2)];
_pos3 = [(_pos select 0),(_pos select 1) - 30,(_pos select 2)];
_pos4 = [(_pos select 0),(_pos select 1) - 45,(_pos select 2)];
_pos5 = [(_pos select 0),(_pos select 1) - 60,(_pos select 2)];
_pos6 = [(_pos select 0),(_pos select 1) - 75,(_pos select 2)];
_pos7 = [(_pos select 0),(_pos select 1) - 90,(_pos select 2)];

_allvecA = EGG_EVO_mevlight; //escorts
_allvecB = EGG_EVO_mevconvoyb; //trucks
_allvecC = EGG_EVO_mevconvoya; //fuel truck

if(_var == 30) then
{
_allvecA = EGG_EVO_mevmed;
};

_maxA = count _allvecA;
_maxB = count _allvecB;
_maxC = count _allvecC;

_heli = createVehicle [(_allvecA select round random (_maxA - 1)), _pos, [], 0, "NONE"];[_heli] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli1 = createVehicle [(_allvecB select round random (_maxC - 1)), _pos2, [], 0, "NONE"];[_heli1] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli1] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli2 = createVehicle [(_allvecB select round random (_maxB - 1)), _pos3, [], 0, "NONE"];[_heli2] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli2] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli3 = createVehicle [(_allvecB select round random (_maxB - 1)), _pos4, [], 0, "NONE"];[_heli3] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli3] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli4 = createVehicle [(_allvecB select round random (_maxB - 1)), _pos5, [], 0, "NONE"];[_heli4] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli4] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli5 = createVehicle [(_allvecC select round random (_maxC - 1)), _pos6, [], 0, "NONE"];[_heli5] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli5] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli6 = createVehicle [(_allvecA select round random (_maxA - 1)), _pos7, [], 0, "NONE"];[_heli6] call BIS_EVO_Lock;Sleep BIS_EVO_GlobalSleep;
_spawne = [_heli6] spawn {[_this select 0] call BIS_EVO_idelSVEC};

_heli addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli1 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli2 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli3 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli4 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli5 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];
_heli6 addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}];

_allunits = EGG_EVO_meguardg;
_max = count _allunits;

_allunitsA = EGG_EVO_meofficer;
_maxA = count _allunitsA;

//truck 1 - 6 men
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsDriver _heli1;_unit moveInDriver _heli1;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli1;_unit moveInCargo _heli1;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli1;_unit moveInCargo _heli1;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli1;_unit moveInCargo _heli1;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli1;_unit moveInCargo _heli1;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos2, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli1;_unit moveInCargo _heli1;
Sleep 0.2;

//truck 2 - 6 men
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsDriver _heli2;_unit moveInDriver _heli2;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli2;_unit moveInCargo _heli2;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli2;_unit moveInCargo _heli2;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli2;_unit moveInCargo _heli2;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli2;_unit moveInCargo _heli2;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos3, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli2;_unit moveInCargo _heli2;
Sleep 0.2;

//truck 3 - 6 men
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsDriver _heli3;_unit moveInDriver _heli3;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli3;_unit moveInCargo _heli3;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli3;_unit moveInCargo _heli3;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli3;_unit moveInCargo _heli3;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli3;_unit moveInCargo _heli3;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos4, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli3;_unit moveInCargo _heli3;
Sleep 0.2;

//truck 4 - 6 men
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsDriver _heli4;_unit moveInDriver _heli4;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli4;_unit moveInCargo _heli4;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli4;_unit moveInCargo _heli4;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli4;_unit moveInCargo _heli4;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli4;_unit moveInCargo _heli4;
Sleep 0.2;
_unit = _guardmis createUnit [(_allunits select round random (_max - 1)), _pos5, [], 0, "NONE"];[_unit] join _guardmis;_unit assignAsCargo _heli4;_unit moveInCargo _heli4;
Sleep 0.2;

//2 escorts heli & heli6 at pos and pos7, driver, cargo and gunner, 2 officers in front car

(_allunitsA select round random (_maxA - 1)) createUnit [_pos, _guardmis];Sleep BIS_EVO_GlobalSleep;
(_allunitsA select round random (_maxA - 1)) createUnit [_pos, _guardmis];Sleep BIS_EVO_GlobalSleep;

(_allunits select round random (_max - 1)) createUnit [_pos, _guardmis];Sleep BIS_EVO_GlobalSleep;
(_allunits select round random (_max - 1)) createUnit [_pos7, _guardmis];Sleep BIS_EVO_GlobalSleep;
(_allunits select round random (_max - 1)) createUnit [_pos7, _guardmis];Sleep BIS_EVO_GlobalSleep;
(_allunits select round random (_max - 1)) createUnit [_pos7, _guardmis];Sleep BIS_EVO_GlobalSleep;
(EGG_EVO_mecrew select 0) createUnit [_pos6, _guardmis];Sleep BIS_EVO_GlobalSleep;
(EGG_EVO_mecrew select 0) createUnit [_pos6, _guardmis];Sleep BIS_EVO_GlobalSleep;

(units _guardmis select 24) assignAsDriver _heli;
(units _guardmis select 24) moveInDriver _heli;
(units _guardmis select 25) assignAsCargo _heli;
(units _guardmis select 25) moveInCargo _heli;
(units _guardmis select 26) assignAsGunner _heli;
(units _guardmis select 26) moveInGunner _heli;

(units _guardmis select 27) assignAsDriver _heli6;
(units _guardmis select 27) moveInDriver _heli6;
(units _guardmis select 28) assignAsDriver _heli6;
(units _guardmis select 28) moveInDriver _heli6;
(units _guardmis select 29) assignAsCargo _heli6;
(units _guardmis select 29) moveInCargo _heli6;

//1 fuel truck heli5 pos6 2 crew

(units _guardmis select 30) assignAsDriver _heli5;
(units _guardmis select 30) moveInDriver _heli5;
(units _guardmis select 31) assignAsCargo _heli5;
(units _guardmis select 31) moveInCargo _heli5;

_guardmis setFormation "COLUMN";
_guardmis setSpeedMode "LIMITED";
_guardmis setBehaviour "SAFE";
{_x addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}]} forEach (units _guardmis);
_recy = [_user,_guardmis] execVM "data\scripts\grecycle.sqf";

_allobj = ["mobj1","mobj2","mobj3","mobj4","mobj5","mobj6","mobj7","mobj8","mobj9","mobj10"];
_currentobj = [];
_max = count _allobj;

_rand =  _allobj select (round random (_max - 1));
_pos = getMarkerPos _rand;
_wp = _guardmis addWaypoint [_pos, 10];
[_guardmis, 1] setWaypointType "GETOUT";

_pos = position (leader _guardmis);

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
sleep 1.001;
_obj1 setSimpleTaskDestination  position (leader _guardmis);
//	if ((count units _guardmis) == 0 or _usergroup != (group _user) or not BIS_EVO_Onmission) then {_loop=1;};
if ((count units _guardmis) == 0 or not BIS_EVO_Onmission) then {_loop=1;};
};

//if (_usergroup != (group _user) or not BIS_EVO_Onmission) exitwith {[] call _Fail};
if (not BIS_EVO_Onmission) exitwith {[] call _Fail};

{if(isplayer _x) then {_x doFollow leader _x}} foreach units (group player);

["#FF0000",_txtpasshead,_txtpassbody] call BIS_EVO_Message;

[West,"HQ"] SideChat localize "STR_M04t65";playSound "Goodjob";
sleep 5;
[West,"HQ"] SideChat localize "str_m07r04";

BIS_EVO_punit = _usergroup;
BIS_EVO_prew  = _var;
publicVariable "BIS_EVO_prew";
publicVariable "BIS_EVO_punit";
_obj1 settaskstate "Succeeded";

sleep 1.0;
[] call _deleteass;

to make it loop forever and take off the location markers

take out the script references too

lastly, add in markers mrnd 1-31 and mobj1-11 to your mission at interesting places to start and end your convoy. you can randomise morethan this but they won't be on roads

the arrays for the enemies are set up in the init file so you can modify them easily

//EGG_EVO_eastveh1 = ["Mi24_D_TK_EP1","Mi17_TK_EP1","UH1H_TK_EP1"];
//EGG_EVO_eastveh2 = ["An2_TK_EP1","L39_TK_EP1","Su25_TK_EP1"];
//mod choppers
EGG_EVO_eastveh3 = ["CMA_Mi28_N_RUS","KA50"];
//mod planes
EGG_EVO_eastveh4 = ["RKTSU33B1","RKTSU33MR","RKTSU33AA","RKTSU33AG","IkaR_F14_AIM_54_ir","IkaR_F14_AGM_65_ir","IkaR_F14_GBU_12_ir"];
//EGG_EVO_eastveh4 = ["GLT_Su34_TAK_Bomber","GLT_Su34_TAK_Fighter"];
//unarmed
EGG_EVO_eastveh5 = ["UAZ_INS","UralOpen_INS","Ural_INS","UralRepair_INS","UralReammo_INS","UralRefuel_INS","GAZ_Vodnik_MedEvac","Kamaz","KamazOpen","KamazRepair","KamazReammo","KamazRefuel","BMP2_Ambul_INS"];
//EGG_EVO_eastveh5 = ["TT650_TK_EP1","SUV_TK_EP1","UAZ_Unarmed_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","Old_bike_TK_INS_EP1","M113Ambul_TK_EP1","UralSupply_TK_EP1","UralSalvage_TK_EP1","UralReammo_TK_EP1","UralRefuel_TK_EP1","UralRepair_TK_EP1"];
//light armed
EGG_EVO_eastveh6 = ["UAZ_MG_INS","UAZ_AGS30_INS","UAZ_AGS30_RU","UAZ_SPG9_INS","Offroad_DSHKM_INS","Pickup_PK_INS","BRDM2_INS","BRDM2_ATGM_INS","BMP2_HQ_INS","GAZ_Vodnik_HMG","GAZ_Vodnik","Ural_ZU23_INS","GRAD_INS","BTR90_HQ"];
//EGG_EVO_eastveh6 = ["LandRover_MG_TK_EP1","LandRover_SPG9_TK_EP1","UAZ_AGS30_TK_EP1","UAZ_MG_TK_EP1","Ural_ZU23_TK_EP1","LandRover_MG_TK_INS_EP1","LandRover_SPG9_TK_INS_EP1","BMP2_HQ_TK_EP1","GRAD_TK_EP1"];
//heavy armed
EGG_EVO_eastveh7 = ["BMP2_INS","T72_INS","BMP3","BTR90","T90"];
//EGG_EVO_eastveh7 = ["BMP2_TK_EP1","BRDM2_TK_EP1","BRDM2_ATGM_TK_EP1","BTR60_TK_EP1","M113_TK_EP1","T34_TK_EP1","T55_TK_EP1","T72_TK_EP1","BTR40_TK_INS_EP1","BTR40_MG_TK_INS_EP1"];
//unarmed mod
EGG_EVO_eastveh8 = ["AFR_Pinz"];
//EGG_EVO_eastveh8 = ["uns_nvatruck_open","uns_nvatruck_refuel","uns_nvatruck_reammo"];
//light armed mod
EGG_EVO_eastveh9 = ["Mech_BTR70M","Mech_BTR70"];
//heavy armed mod
EGG_EVO_eastveh10 = ["ibr_T55","vil_bmp1","vil_bmp1p","vil_bmp2d","vil_2s1_easy_arty","vil_2s1","vil_t55","vil_t55m_pol","vil_t62m","vil_t64","vil_t64bv","vil_t72M_nsv","vil_t80b","vil_t80bv_c2","vil_t80U_C","sa_bmd2","sa_bmd2_rus1","sa_bmd2_rus2","sa_bmd2_rus3","sa_bmd2_rus4","sa_bmd2_des","sa_bmd2_ua","sa_bmd2_peace","sa_bmd2k","sa_bmd2k_rus1","sa_bmd2k_rus2","sa_bmd2k_rus3","sa_bmd2k_rus4","sa_bmdk_des","sa_bmd2k_peace"];
//AA
EGG_EVO_eastveh11 = ["ZSU_INS","2S6M_Tunguska"];
//EGG_EVO_eastveh11 = ["ZU23_TK_INS_EP1","Ural_ZU23_TK_EP1","ZSU_TK_EP1","ZU23_TK_EP1"];
//AA mod
EGG_EVO_eastveh12 = ["3LB_SA6"];
//statics
EGG_EVO_eastveh13 = ["INS_WarfareBMGNest_PK","DSHKM_Ins","DSHkM_Mini_TriPod","KORD","AGS_RU","AGS_Ins","2b14_82mm_INS","SPG9_Ins","D30_Ins","D30_RU","Metis","ZU23_Ins","Igla_AA_pod_East"];
//EGG_EVO_eastveh13 = ["Igla_AA_pod_TK_EP1","AGS_TK_EP1","D30_TK_EP1","KORD_high_TK_EP1","KORD_TK_EP1","Metis_TK_EP1","2b14_82mm_TK_EP1","AGS_TK_INS_EP1","D30_TK_INS_EP1","DSHKM_TK_INS_EP1","DSHkM_Mini_TriPod_TK_INS_EP1","2b14_82mm_TK_INS_EP1","SPG9_TK_INS_EP1"];
//EGG_EVO_eastveh14 = ["BTR40_MG_TK_INS_EP1","BRDM2_TK_GUE_EP1","BTR40_TK_GUE_EP1","BTR60_TK_EP1","M113_TK_EP1","BMP2_INS","UAZ_MG_INS","sa_bmd2k_rus1","sa_bmd2_des","uns_pt76","uns_t55","vil_bmp1p","vil_bmp1","vil_2s1","vil_t62m","vil_t64bv"];
EGG_EVO_eastveh15 = ["UralOpen_INS","Ural_INS","Kamaz","KamazOpen"];

EGG_EVO_mepilot = ["RU_Soldier_Pilot","Ins_Soldier_Pilot"];
EGG_EVO_meofficer = ["RU_Soldier_Officer","RU_Commander","RUS_Commander","RUS_Soldier_TL","Ins_Commander","Ins_Soldier_CO","Ins_Bardak","Ins_Lopotev"];
EGG_EVO_mecrew = ["RU_Soldier_Crew","Ins_Soldier_Crew"];
EGG_EVO_meguard = ["Ins_Commander","Ins_Soldier_CO","Ins_Bardak","Ins_Lopotev","RU_Soldier_AR","Ins_Soldier_AR"];
EGG_EVO_meguardb = EGG_EVO_east4;
EGG_EVO_meguardc = EGG_EVO_east1;
EGG_EVO_meguardd = EGG_EVO_east2;
EGG_EVO_meguarde = EGG_EVO_east5;
EGG_EVO_meguardf = EGG_EVO_east1;
EGG_EVO_meguardg = EGG_EVO_east3;
EGG_EVO_mevlight = ["UAZ_MG_INS","Offroad_DSHKM_INS","Pickup_PK_INS","BRDM2_INS"];
EGG_EVO_mevlighta = ["BRDM2_ATGM_INS","UAZ_AGS30_INS","UAZ_AGS30_RU","UAZ_SPG9_INS","BMP2_HQ_INS","GAZ_Vodnik_HMG","GAZ_Vodnik"];
EGG_EVO_mevmed = ["Ural_ZU23_INS","GRAD_INS","BTR90_HQ","BMP2_INS"];
EGG_EVO_mevmeda = ["BMP2_INS","BMP3","BTR90"];
EGG_EVO_mevheavya = ["T72_INS","BMP3","ZSU_INS"];
EGG_EVO_mevheavyb = ["T90","2S6M_Tunguska","Mi24_P","Mi17_rockets_RU"];
EGG_EVO_mevconvoya = ["UralRepair_INS","UralReammo_INS","UralRefuel_INS","KamazRepair","KamazReammo","KamazRefuel"];
EGG_EVO_mevconvoyb = ["UralOpen_INS","Ural_INS","Kamaz","KamazOpen"];

Edited by eggbeast

Share this post


Link to post
Share on other sites

.... well that sounds awesome!

How do i put it in my mission? copy everything to a Sqf file?

How do i make it loop forever (with a delay in between each spawn) And not spawning until the first group is dead?

Share this post


Link to post
Share on other sites

it needs some work, this is a rip from a script i wrote in my version of the evolution mission. you will needto take out what you want and do some figuring, as on its own it won't work cos it calls a lot of functions not included here...

just gives you an idea of how to go about it

to loop you do this:

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do

{

//script goes here

};

Share this post


Link to post
Share on other sites

looks very complicated.... must be an easier way to just spawn a couple of vehicles one would think :) But i will look over it and see if i can get it to work, not too good on scripting yet, Working on my first mission.

Share this post


Link to post
Share on other sites

Try copying and pasting the code below into one of the vehicles initialisation area in the editor. Add a marker named cc which will mark the centre point of the area the convoy will patrol. Alter the value of _PatrolD to set the patrol areas diameter

Deletethe line (leader _grp) setSpeedMode "LIMITED"; if you wanted the vehicles to travel at full speed.

You could add a marker named tt if you wanted to check the scripts destinations while tesing.

This could also be easily coverted into and sqf file for neatness, this was just my quick and dirty solution for a similar effect. Hope it helps.

nul1 = [this] spawn  {
_car = _this select 0;
_grp = group _car;
_grp setFormation "COLUMN";
_centre1 = getmarkerpos "cc"; 
_PatrolD = 20000;
_destfound = 0;
private ["_drop","_dest","_Point"];
while {alive (leader _grp)} do
{
_destfound = 0;
while {_destfound == 0} do
{
	_drop = [( _centre1 select 0) + (random _PatrolD/2) - _PatrolD/4,( _centre1 select 1) + (random _PatrolD/2) - _PatrolD/4,0];
	_dest = _drop nearroads 50;
	if (count _dest > 0) then  
	{
		_destfound = 1;
		_Point = getpos (_dest select 0);
		(leader _grp) move _Point;
		(leader _grp) setbehaviour "SAFE";
		(leader _grp) setSpeedMode "LIMITED";
		"tt" setmarkerpos _Point;
	};
	sleep 1;
};
while { (leader _grp distance _Point) > 20} do
{	
	sleep 60;
	(leader _grp) move _Point;
};
};};


Edited by blakeace

Share this post


Link to post
Share on other sites

@blakeace:

Your script works like a carhm regarding patrolling vehicles.

However i would like a convoy to start in a random location, but have the same end goal each time, just take different routes each time so we have to search for them.

And on a sidenote: Is it possible to force the convoy to just use the roads?

Last time we played the mission they went all over the map....

Share this post


Link to post
Share on other sites

Hello,

There are probably neater ways of doing this, but here's a simple way of doing it.

If you place the unit/vehicle you want at one of the locations you want it to spawn, then place ie. 2 empty markers (invisible when you play) you can then group the unit/vehicle with that marker and it will spawn at either of the three locations.

Now if you give this vehicle a waypoint to the destination, (just one,) it should drive there.

My experience is that the fewer waypoints I use the more often it will stick to the road, this may be just coincidental though. It also helps to set the unit to "safe" or "careless".

Hope this helps.

Kind Regards

Melvin

Share this post


Link to post
Share on other sites

Hello,

yes that is what my convoy is doing right now, spawning in 3 different locations, and have one waypoint, the downside is that it goes straight for the waypoint instead of choosing roads?

EDIT:

when i read your post again i noticed you wrote something about careless.. after changing the waypoint to Careless they started using the roads..

Thanks

Edited by Frosties

Share this post


Link to post
Share on other sites

Hello,

I guess I misunderstood the setting a little then. The AI will most likely take the shortest route, and if your spawning points are along the same axis (or big parts of it) I guess it's natural that he will drive the same path.

However (without me having tried it,) I guess it could be possible to place some invisible markers/helipads on the path of some possible routes and make a script that either moves existing waypoints, or creates new ones (given that your vehicle have none) randomly from the selection of invisible "locations", and then the 2nd waypoint is either your destination or a different "branch" of the route to it.

If you decide to move waypoints I guess "SetWaypointPosition" is the way to go. (http://community.bistudio.com/wiki/setWaypointPosition)

Sorry if this just is a wall-of-text that is so basic that you've already tested it and didn't give the results you wanted.

Kind Regards

Melvin

Edited by MelvinNor
Spelling and stuff

Share this post


Link to post
Share on other sites

An idea I had, minus actual scripting...

What if you have a trigger over each marker (each potential 'starting position' of the convoy), checking for its presence. Then, you could move waypoints into a path from that specific marker to the destination. This allows a set route that is randomly selected. You could do this as many times as you like, too.

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  

×