Jump to content
Sign in to follow this  
ADuke

Create # in group based on vehicle

Recommended Posts

Hi,

Having a little trouble with a script here.

The script works like this...

1. A vehicle is loaded out with a group of enemies

2. The vehicle is given waypoints to a destination, the group of enemies disembarks and goes into combat.

3. When the group of enemy infantry are all dead, a new vehicle and a new group are created and they follow the same waypoints, this continues infinitely until the mission ends.

Here is the tricky part, and the part I am having the most trouble with.

The vehicle that is created is a random type taken from a vehicle pool that I have created like this..

_randomvehicle1 = "V3S_Open_TK_EP1";		
_randomvehicle2 = "V3S_TK_EP1";			
_randomvehicle3 = "UralOpen_CA";		
_randomvehicle4 = "Ural_IRAN";			
_randomvehicle5 = "Ural_MOL";			
_randomvehicle6 = "ad_taki_uralOpen";		
_randomvehicle7 = "ad_V3S_TK_INS";		
_randomvehicle8 = "ad_V3S_TK__OPEN_INS";
_newvehiclerandom = 
[
_randomvehicle1,
_randomvehicle2,
_randomvehicle3,
_randomvehicle4,
_randomvehicle5,
_randomvehicle6,
_randomvehicle7,
_randomvehicle8
] call BIS_fnc_selectRandom;
_newVehiclespawn = [_vehiclepos, _vehicledir, _newvehiclerandom, EAST] call bis_fnc_spawnvehicle;

This part works GREAT and I would not change a thing.

I then want the # of soldiers in the new group to be based off of what type of vehicle was created, and therein lies the problem, I tried something like this....

if(_newVehicletype == "V3S_Open_TK_EP1") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "V3S_TK_EP1") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "ad_V3S_TK_INS") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "ad_V3S_TK__OPEN_INS") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "UralOpen_CA") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "Ural_IRAN") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "Ural_MOL") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "ad_taki_uralOpen") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

_newInfantryGroup = [_unitpos, EAST, [_cargopool],[],[],[],[],[],_unitdir] call BIS_fnc_spawnGroup;

But that did not seem to work..

Can anyone think of a viable solution?

Here is the entire script, it is very long....

_unit = _this select 0;

_unitgroup = group _unit;

_unitpos = getPos _unit;

_unitdir = getDir _unit;

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

_infantrywppos = waypointPosition [_unitgroup,1];

_infantrywptype = waypointType [_unitgroup,1];

_infantrywpspeed = waypointSpeed [_unitgroup,1];

_infantrywpbehaviour = waypointBehaviour [_unitgroup,1];

_infantrywpstatements = waypointStatements [_unitgroup,1];

_infantrywptimeout = waypointTimeout [_unitgroup,1];

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

_vehicle = _this select 1;

_vehiclepos = getPos _vehicle;

_vehicledir = getDir _vehicle;

_vehiclegroup = group driver _vehicle;

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

_TL1 = "TK_INS_Soldier_TL_EP1";

_TL2 = "TK_INS_Soldier_2_EP1";

_TL3 = "TK_INS_Soldier_EP1";

_TL4 = "TK_INS_Soldier_3_EP1";

_TL5 = "TK_INS_Soldier_4_EP1";

_TL6 = "TK_INS_Warlord_EP1";

_TL7 = "TK_Soldier_EP1";

_TL8 = "TK_Soldier_B_EP1";

_TL9 = "TK_Soldier_Engineer_EP1";

_TL10 = "TK_Soldier_SL_EP1";

_TL11 = "TK_Soldier_Officer_EP1";

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

_TL =

[

_TL1,

_TL2,

_TL3,

_TL4,

_TL5,

_TL6,

_TL7,

_TL8,

_TL9,

_TL10,

_TL11

] call BIS_fnc_selectRandom;

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

_rifleman1 = "mas_tak_conv_sl_d";

_rifleman2 = "mas_tak_conv_slk_d";

_rifleman3 = "mas_tak_conv_sl_n";

_rifleman4 = "mas_tak_conv_slk_n";

_rifleman5 = "mas_tak_sf_tl_n";

_rifleman6 = "mas_tak_sf_sl_n";

_rifleman7 = "mas_tak_sf_dem_n";

_rifleman8 = "mas_tak_conv_lgh_v";

_rifleman9 = "mas_tak_conv_slk_v";

_rifleman10 = "mas_tak_sf_sl_m";

_rifleman11 = "mas_tak_conv_slk_m";

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

_rifleman =

[

_rifleman1,

_rifleman2,

_rifleman3,

_rifleman4,

_rifleman5,

_rifleman6,

_rifleman7,

_rifleman8,

_rifleman9,

_rifleman10,

_rifleman11

] call BIS_fnc_selectRandom;

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

_mgunner1 = "TK_INS_Soldier_AR_EP1";

_mgunner2 = "TK_INS_Soldier_MG_EP1";

_mgunner3 = "TK_Soldier_MG_EP1";

_mgunner4 = "TK_Soldier_AR_EP1";

_mgunner5 = "TK_Special_Forces_MG_EP1";

_mgunner6 = "mas_tak_sf_mg_d";

_mgunner7 = "ETerrorist10";

_mgunner8 = "ETerrorist9";

_mgunner9 = "ETaliban10";

_mgunner10 = "ETaliban9";

_mgunner11 = "mas_tak_conv_ar_z";

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

_mgunner =

[

_mgunner1,

_mgunner2,

_mgunner3,

_mgunner4,

_mgunner5,

_mgunner6,

_mgunner7,

_mgunner8,

_mgunner9,

_mgunner10,

_mgunner11

] call BIS_fnc_selectRandom;

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

_glauncher1 = "TK_INS_Soldier_TL_EP1";

_glauncher2 = "TK_Soldier_GL_EP1";

_glauncher3 = "TK_Special_Forces_EP1";

_glauncher4 = "mas_tak_sf_sl_d";

_glauncher5 = "ETerrorist5";

_glauncher6 = "ETaliban4";

_glauncher7 = "EGangsta_merc7";

_glauncher8 = "mas_tak_conv_gl_d";

_glauncher9 = "mas_tak_conv_gl_n";

_glauncher10 = "mas_tak_sf_sl_n";

_glauncher11 = "mas_tak_conv_gl_v";

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

_glauncher =

[

_glauncher1,

_glauncher2,

_glauncher3,

_glauncher4,

_glauncher5,

_glauncher6,

_glauncher7,

_glauncher8,

_glauncher9,

_glauncher10,

_glauncher11

] call BIS_fnc_selectRandom;

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

_ATlauncher1 = "TK_INS_Soldier_AT_EP1";

_ATlauncher2 = "TK_INS_Soldier_AT_EP1";

_ATlauncher3 = "TK_Soldier_LAT_EP1";

_ATlauncher4 = "TK_Soldier_AT_EP1";

_ATlauncher5 = "TK_Soldier_HAT_EP1";

_ATlauncher6 = "mas_tak_conv_at_d";

_ATlauncher7 = "ETerrorist6";

_ATlauncher8 = "ETaliban5";

_ATlauncher9 = "mas_tak_sf_at_d";

_ATlauncher10 = "mas_tak_conv_at_n";

_ATlauncher11 = "mas_tak_sf_at_n";

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

_ATlauncher =

[

_ATlauncher1,

_ATlauncher2,

_ATlauncher3,

_ATlauncher4,

_ATlauncher5,

_ATlauncher6,

_ATlauncher7,

_ATlauncher8,

_ATlauncher9,

_ATlauncher10,

_ATlauncher11

] call BIS_fnc_selectRandom;

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

_AAlauncher1 = "TK_INS_Soldier_AA_EP1";

_AAlauncher2 = "TK_INS_Soldier_AA_EP1";

_AAlauncher3 = "TK_Soldier_AA_EP1";

_AAlauncher4 = "mas_tak_conv_aa_d";

_AAlauncher5 = "ETerrorist7";

_AAlauncher6 = "ETaliban6";

_AAlauncher7 = "mas_tak_conv_aa_n";

_AAlauncher8 = "mas_tak_conv_aa_v";

_AAlauncher9 = "TK_INS_Soldier_AA_EP1";

_AAlauncher10 = "TK_INS_Soldier_AA_EP1";

_AAlauncher11 = "TK_INS_Soldier_AA_EP1";

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

_AAlauncher =

[

_AAlauncher1,

_AAlauncher2,

_AAlauncher3,

_AAlauncher4,

_AAlauncher5,

_AAlauncher6,

_AAlauncher7,

_AAlauncher8,

_AAlauncher9,

_AAlauncher10,

_AAlauncher11

] call BIS_fnc_selectRandom;

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

_Medic1 = "TK_INS_Bonesetter_EP1";

_Medic2 = "TK_INS_Bonesetter_EP1";

_Medic3 = "TK_Soldier_Medic_EP1";

_Medic4 = "IRAN_MAN_Medic";

_Medic5 = "ETerrorist12";

_Medic6 = "ETaliban12";

_Medic7 = "EGangsta_merc10";

_Medic8 = "mas_tak_sf_med_d";

_Medic9 = "mas_tak_conv_med_d";

_Medic10 = "mas_tak_conv_med_n";

_Medic11 = "mas_tak_sf_med_n";

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

_Medic =

[

_Medic1,

_Medic2,

_Medic3,

_Medic4,

_Medic5,

_Medic6,

_Medic7,

_Medic8,

_Medic9,

_Medic10,

_Medic11

] call BIS_fnc_selectRandom;

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

_Sniper1 = "TK_INS_Soldier_Sniper_EP1";

_Sniper2 = "TK_INS_Soldier_Sniper_EP1";

_Sniper3 = "TK_Soldier_Sniper_EP1";

_Sniper4 = "TK_Soldier_SniperH_EP1";

_Sniper5 = "TK_Soldier_Sniper_Night_EP1";

_Sniper6 = "mas_tak_sf_snp_d";

_Sniper7 = "ETerrorist11";

_Sniper8 = "ETaliban11";

_Sniper9 = "EGangsta_merc9";

_Sniper10 = "mas_tak_conv_mark_d";

_Sniper11 = "mas_tak_sf_snpgh_d";

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

_Sniper =

[

_Sniper1,

_Sniper2,

_Sniper3,

_Sniper4,

_Sniper5,

_Sniper6,

_Sniper7,

_Sniper8,

_Sniper9,

_Sniper10,

_Sniper11

] call BIS_fnc_selectRandom;

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

_vehiclewppos1 = waypointPosition [_vehiclegroup,1];

_vehiclewptype1 = waypointType [_vehiclegroup,1];

_vehiclewpspeed1 = waypointSpeed [_vehiclegroup,1];

_vehiclewpbehaviour1 = waypointBehaviour [_vehiclegroup,1];

_vehiclewpstatements1 = waypointStatements [_vehiclegroup,1];

_vehiclewptimeout1 = waypointTimeout [_vehiclegroup,1];

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

_vehiclewppos2 = waypointPosition [_vehiclegroup,2];

_vehiclewptype2 = waypointType [_vehiclegroup,2];

_vehiclewpspeed2 = waypointSpeed [_vehiclegroup,2];

_vehiclewpbehaviour2 = waypointBehaviour [_vehiclegroup,2];

_vehiclewpstatements2 = waypointStatements [_vehiclegroup,2];

_vehiclewptimeout2 = waypointTimeout [_vehiclegroup,2];

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

_vehiclewppos3 = waypointPosition [_vehiclegroup,3];

_vehiclewptype3 = waypointType [_vehiclegroup,3];

_vehiclewpspeed3 = waypointSpeed [_vehiclegroup,3];

_vehiclewpbehaviour3 = waypointBehaviour [_vehiclegroup,3];

_vehiclewpstatements3 = waypointStatements [_vehiclegroup,3];

_vehiclewptimeout3 = waypointTimeout [_vehiclegroup,3];

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

_vehiclewppos4 = waypointPosition [_vehiclegroup,4];

_vehiclewptype4 = waypointType [_vehiclegroup,4];

_vehiclewpspeed4 = waypointSpeed [_vehiclegroup,4];

_vehiclewpbehaviour4 = waypointBehaviour [_vehiclegroup,4];

_vehiclewpstatements4 = waypointStatements [_vehiclegroup,4];

_vehiclewptimeout4 = waypointTimeout [_vehiclegroup,4];

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

_vehiclewppos5 = waypointPosition [_vehiclegroup,5];

_vehiclewptype5 = waypointType [_vehiclegroup,5];

_vehiclewpspeed5 = waypointSpeed [_vehiclegroup,5];

_vehiclewpbehaviour5 = waypointBehaviour [_vehiclegroup,5];

_vehiclewpstatements5 = waypointStatements [_vehiclegroup,5];

_vehiclewptimeout5 = waypointTimeout [_vehiclegroup,5];

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

_vehiclewppos6 = waypointPosition [_vehiclegroup,6];

_vehiclewptype6 = waypointType [_vehiclegroup,6];

_vehiclewpspeed6 = waypointSpeed [_vehiclegroup,6];

_vehiclewpbehaviour6 = waypointBehaviour [_vehiclegroup,6];

_vehiclewpstatements6 = waypointStatements [_vehiclegroup,6];

_vehiclewptimeout6 = waypointTimeout [_vehiclegroup,6];

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

_vehiclewppos7 = waypointPosition [_vehiclegroup,7];

_vehiclewptype7 = waypointType [_vehiclegroup,7];

_vehiclewpspeed7 = waypointSpeed [_vehiclegroup,7];

_vehiclewpbehaviour7 = waypointBehaviour [_vehiclegroup,7];

_vehiclewpstatements7 = waypointStatements [_vehiclegroup,7];

_vehiclewptimeout7 = waypointTimeout [_vehiclegroup,7];

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

_vehiclewppos8 = waypointPosition [_vehiclegroup,8];

_vehiclewptype8 = waypointType [_vehiclegroup,8];

_vehiclewpspeed8 = waypointSpeed [_vehiclegroup,8];

_vehiclewpbehaviour8 = waypointBehaviour [_vehiclegroup,8];

_vehiclewpstatements8 = waypointStatements [_vehiclegroup,8];

_vehiclewptimeout8 = waypointTimeout [_vehiclegroup,8];

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

_randomvehicle1 = "V3S_Open_TK_EP1"; //transportSoldier = 13

_randomvehicle2 = "V3S_TK_EP1"; //transportSoldier = 13

_randomvehicle3 = "UralOpen_CA"; //transportSoldier = 14;

_randomvehicle4 = "Ural_IRAN"; //transportSoldier = 14;

_randomvehicle5 = "Ural_MOL"; //transportSoldier = 14;

_randomvehicle6 = "ad_taki_uralOpen"; //transportSoldier = 14;

_randomvehicle7 = "ad_V3S_TK_INS"; //transportSoldier = 13;

_randomvehicle8 = "ad_V3S_TK__OPEN_INS"; //transportSoldier = 13;

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

waituntil {!isnil "bis_fnc_init"};

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

_newvehiclerandom =

[

_randomvehicle1,

_randomvehicle2,

_randomvehicle3,

_randomvehicle4,

_randomvehicle5,

_randomvehicle6,

_randomvehicle7,

_randomvehicle8

] call BIS_fnc_selectRandom;

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

waituntil {!isnil "bis_fnc_init"};

waitUntil {{alive _x} count (units _unitgroup) == 0};

hint "OPFOR respawn";

sleep 1;

_newVehiclespawn = [_vehiclepos, _vehicledir, _newvehiclerandom, EAST] call bis_fnc_spawnvehicle;

_newVehicle = _newVehiclespawn select 0;

_newVehicleGroup = _newVehiclespawn select 2;

_newVehicletype = typeof _newVehicle;

sleep 1;

if(_newVehicletype == "V3S_Open_TK_EP1") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "V3S_TK_EP1") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "ad_V3S_TK_INS") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "ad_V3S_TK__OPEN_INS") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher};

if(_newVehicletype == "UralOpen_CA") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "Ural_IRAN") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "Ural_MOL") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

if(_newVehicletype == "ad_taki_uralOpen") then {_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAlauncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_rifleman};

sleep 1;

_newInfantryGroup = [_unitpos, EAST, [_cargopool],[],[],[],[],[],_unitdir] call BIS_fnc_spawnGroup;

_Infantryleader = leader _newInfantryGroup;

sleep 1;

{_x assignAsCargo _newVehicle} forEach units _newInfantryGroup;

{_x moveinCargo _newVehicle} forEach units _newInfantryGroup;

sleep 1;

_vehiclewp1 = _newVehicleGroup addWaypoint [_vehiclewppos1,0];

[_newVehicleGroup, 1] setWaypointType _vehiclewptype1;

[_newVehicleGroup, 1] setWaypointSpeed _vehiclewpspeed1;

[_newVehicleGroup, 1] setWaypointBehaviour _vehiclewpbehaviour1;

[_newVehicleGroup, 1] setWaypointStatements _vehiclewpstatements1;

[_newVehicleGroup, 1] setWaypointTimeout _vehiclewptimeout1;

[_newVehicleGroup, 1] showWaypoint "NEVER";

_vehiclewp2 = _newVehicleGroup addWaypoint [_vehiclewppos2,0];

[_newVehicleGroup, 2] setWaypointType _vehiclewptype2;

[_newVehicleGroup, 2] setWaypointSpeed _vehiclewpspeed2;

[_newVehicleGroup, 2] setWaypointBehaviour _vehiclewpbehaviour2;

[_newVehicleGroup, 2] setWaypointStatements _vehiclewpstatements2;

[_newVehicleGroup, 2] setWaypointTimeout _vehiclewptimeout2;

[_newVehicleGroup, 2] showWaypoint "NEVER";

_vehiclewp3 = _newVehicleGroup addWaypoint [_vehiclewppos3,0];

[_newVehicleGroup, 3] setWaypointType _vehiclewptype3;

[_newVehicleGroup, 3] setWaypointSpeed _vehiclewpspeed3;

[_newVehicleGroup, 3] setWaypointBehaviour _vehiclewpbehaviour3;

[_newVehicleGroup, 3] setWaypointStatements _vehiclewpstatements3;

[_newVehicleGroup, 3] setWaypointTimeout _vehiclewptimeout3;

[_newVehicleGroup, 3] showWaypoint "NEVER";

_vehiclewp4 = _newVehicleGroup addWaypoint [_vehiclewppos4,0];

[_newVehicleGroup, 4] setWaypointType _vehiclewptype4;

[_newVehicleGroup, 4] setWaypointSpeed _vehiclewpspeed4;

[_newVehicleGroup, 4] setWaypointBehaviour _vehiclewpbehaviour4;

[_newVehicleGroup, 4] setWaypointStatements _vehiclewpstatements4;

[_newVehicleGroup, 4] setWaypointTimeout _vehiclewptimeout4;

[_newVehicleGroup, 4] showWaypoint "NEVER";

_vehiclewp5 = _newVehicleGroup addWaypoint [_vehiclewppos5,0];

[_newVehicleGroup, 5] setWaypointType _vehiclewptype5;

[_newVehicleGroup, 5] setWaypointSpeed _vehiclewpspeed5;

[_newVehicleGroup, 5] setWaypointBehaviour _vehiclewpbehaviour5;

[_newVehicleGroup, 5] setWaypointStatements _vehiclewpstatements5;

[_newVehicleGroup, 5] setWaypointTimeout _vehiclewptimeout5;

[_newVehicleGroup, 5] showWaypoint "NEVER";

_vehiclewp6 = _newVehicleGroup addWaypoint [_vehiclewppos6,0];

[_newVehicleGroup, 6] setWaypointType _vehiclewptype6;

[_newVehicleGroup, 6] setWaypointSpeed _vehiclewpspeed6;

[_newVehicleGroup, 6] setWaypointBehaviour _vehiclewpbehaviour6;

[_newVehicleGroup, 6] setWaypointStatements _vehiclewpstatements6;

[_newVehicleGroup, 6] setWaypointTimeout _vehiclewptimeout6;

[_newVehicleGroup, 6] showWaypoint "NEVER";

_vehiclewp7 = _newVehicleGroup addWaypoint [_vehiclewppos7,0];

[_newVehicleGroup, 7] setWaypointType _vehiclewptype7;

[_newVehicleGroup, 7] setWaypointSpeed _vehiclewpspeed7;

[_newVehicleGroup, 7] setWaypointBehaviour _vehiclewpbehaviour7;

[_newVehicleGroup, 7] setWaypointStatements _vehiclewpstatements7;

[_newVehicleGroup, 7] setWaypointTimeout _vehiclewptimeout7;

[_newVehicleGroup, 7] showWaypoint "NEVER";

_vehiclewp8 = _newVehicleGroup addWaypoint [_vehiclewppos8,0];

[_newVehicleGroup, 8] setWaypointType _vehiclewptype8;

[_newVehicleGroup, 8] setWaypointSpeed _vehiclewpspeed8;

[_newVehicleGroup, 8] setWaypointBehaviour _vehiclewpbehaviour8;

[_newVehicleGroup, 8] setWaypointStatements _vehiclewpstatements8;

[_newVehicleGroup, 8] setWaypointTimeout _vehiclewptimeout8;

[_newVehicleGroup, 8] showWaypoint "NEVER";

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

_infantrywp1 = _newInfantryGroup addWaypoint [_infantrywppos,0];

[_newInfantryGroup, 1] setWaypointType _infantrywptype;

[_newInfantryGroup, 1] setWaypointSpeed _infantrywpspeed;

[_newInfantryGroup, 1] setWaypointBehaviour _infantrywpbehaviour;

[_newInfantryGroup, 1] setWaypointStatements _infantrywpstatements;

[_newInfantryGroup, 1] setWaypointTimeout _infantrywptimeout;

[_newInfantryGroup, 1] showWaypoint "NEVER";

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

if ((count (crew _newVehicle) == 0) or (!alive (driver _newVehicle))) then

{

_newVehicle setDamage 1;

};

null = [_Infantryleader,_newVehicle] execVM "scripts\OPFrespawn1.sqf";

null = [_newVehicle] execVM "scripts\destroy.sqf";

Just to reiterate, everything works perfectly except for the part where I check the type of vehicle that was created.

-AD

Crap!! should have posted in mission editing.

Edited by ADuke

Share this post


Link to post
Share on other sites

if ((typeof _newVehicletype) == "V3S_Open_TK_EP1") then {.....

But for such things i would prefer a switch do insted of countless if then's:

switch (typeOf _newVehicleType) do {
case "V3S_Open_TK_EP1": {
	_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAl auncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_gla uncher,_ATlauncher;
};
case "V3S_TK_EP1": {
	_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAl auncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_gla uncher,_ATlauncher;
};
case "ad_V3S_TK_INS": {
	_cargopool = _TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAl auncher,_Medic,_Sniper,_TL,_rifleman,_mgunner,_gla uncher,_ATlauncher;
};
};

Just wrote 3 cases just so you can get the idea.

Besides this, personally i would get rid off these _randomVehicleX lines and write the classnames directly into the _newvehiclerandom array. Your way doesn't hurt but it's just unnecessary.

:EDITH:

Maybe this is helpful for you: http://community.bistudio.com/wiki/Control_Structures

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  

×