It works property, but only and the last question connected to that script is on my tongue. Problably I lack of typical knowledge here, I mean command:
Trick is that when group is destroyed, in Urban Patrol Script you are able to respawn that group once again, and again and again etc. But group will always consist of number of troops defined in script above. So, when we roll for 5 troops in the squad, group will always respawn with 5 and only 5 people.
My plan is to wait the script until whole _banditgroup bites the dust, then the group will be destroyed via deletegroup command (btw, if ALL units in group are dead, isn't the group being deleted on its own, without deletegroup?).
Anyway, when group is eliminated, I will launch the script once again so _banditgroup will be created again, and their number will be rolled again and again and again...
Problem is similar to this one I had here:
http://www.ofpec.com/forum/index.php?topic=35060.0But this time I can't afford even 1 trigger, because I need to save as much memory as I can (AFAIK, triggers are more demanding than scripts), so I need to hold the script via WaitUntil command till number of troops in _banditgroup will be exactly 0 or less (well...).
Here is my script at this stage:
//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: SaS TrooP
//////////////////////////////////////////////////////////////////
if (isNil { BIS_fnc_init }) then { waitUntil { !isNil { BIS_fnc_init } } };
private ["_squad","_member1","_member2","_member3","_member4","_member5","_banditgroup","_soldier1","_soldier2","_soldier3","_soldier4","_soldier5"];
_squad =
[
"GUE_Soldier_AR",
"GUE_Soldier_CO",
"GUE_Soldier_Crew",
"GUE_Soldier_GL",
"GUE_Soldier_Sniper",
"GUE_Soldier_MG",
"GUE_Soldier_Medic",
"GUE_Soldier_Pilot",
"GUE_Soldier_3",
"GUE_Soldier_2",
"GUE_Soldier_1",
"GUE_Soldier_AT",
"GUE_Soldier_AA",
"GUE_Soldier_Sab",
"GUE_Soldier_Scout",
"GUE_Commander"
];
_member1 = _squad call BIS_fnc_selectRandom;
_member2 = _squad call BIS_fnc_selectRandom;
_member3 = _squad call BIS_fnc_selectRandom;
_member4 = _squad call BIS_fnc_selectRandom;
_member5 = _squad call BIS_fnc_selectRandom;
_member6 = _squad call BIS_fnc_selectRandom;
_member7 = _squad call BIS_fnc_selectRandom;
_banditgroup = creategroup resistance;
_soldier1= _member1 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf'; nul=[this,'kurwamac'] execVM 'scripts\upsmon.sqf';", 0.5, "SERGEANT"];
_soldier2 = _member2 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.5, "corporal"];
if (random 100 > 50) then {_soldier3 = _member3 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.6, "corporal"]};
if (random 100 > 50) then {_soldier4 = _member4 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.5, "corporal"]};
if (random 100 > 50) then {_soldier5 = _member5 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.5, "corporal"]};
if (random 100 > 50) then {_soldier6 = _member6 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.5, "corporal"]};
if (random 100 > 50) then {_soldier7 = _member7 createUnit [getMarkerPos "logic_bandit_group1", _banditgroup,"arming = [this] execVM 'random_arm_hl.sqf';", 0.5, "corporal"]};
hint "works";
sleep 3;
waitUntil {
(not alive _member1) and (not alive _member2) and (not alive _member3) and (not alive _member4) and (not alive _member5) and (not alive _member6) and (not alive _member7);
};
hint "dead, rspwn";
deletegroup _banditgroup;
hint "clear, srspwn in 10 sec";
sleep 10;
test = player execVM "random_squad.sqf";
Notice that:
waitUntil {
(not alive _member1) and (not alive _member2) and (not alive _member3) and (not alive _member4) and (not alive _member5) and (not alive _member6) and (not alive _member7);
};
Is not working. I guess you cant operate with alive command on variables, just on var names. I also guess creating varnames for this lads is not really important.
Can you just tell me if there is better way to define this condition?
I tried to operate varous ways with line:
{alive _x} count units thisList < 60
In ways like:
{alive _x} count units _banditgroup == 0;
count units _banditgroup == 0;
Without success.