Jump to content
Sign in to follow this  
igneous01

RUIS - Random Unit Invasion Script

Recommended Posts

I think the demo comes with radio triggers, activations in them. One funny thing about the demo is that there is no functions module on the map, so it no work without cba or no functions module. That one threw me for a loop.

Yeah, that's been a source of confusion for most people for a long time. That requirement is buried somewhere in the middle of this thread, unfortunately.

lol I just found the trigger in the demo lol I looked at it the whole time lol that went over my head so many times looking at it.

Ah, cool. I just checked the mission.sqm and noticed that the OPFOR AI is named "dude", not "RUguy", so I thought maybe that was what was throwing you off. The script call uses that name too, of course.

Share this post


Link to post
Share on other sites

thanks guys for the help(: does this work for ARMA3 did anyone port it over. I am going to wait for the real ARMA3 to come out. I still have more things to do with ARMA2 LOL

Share this post


Link to post
Share on other sites

I can't see why it wouldn't, though you'd obviously have to redefine all of the units. I'll have a go at it this week.

Share this post


Link to post
Share on other sites

Hey, I still can't get this script to work with unsung units, if anyone has an ideas it would be great.

Share this post


Link to post
Share on other sites

Does anyone know if this script can be changed to respawn the Invasion Unit ONLY when all the units are killed and not using the spawntime within the script. Can this be done within the script. I am using this script for a mission type I am working on (warefare meets domination). I have the spawntime currently set for 60 minutes which is good when the mission is in active use but if the mission is still running on the server and nobody is playing the mission it starts getting bogged down with a significant FPS drop to the point of unplayable. I have attempted to get the respawn to work when the spawn units are killed and not based on the spawntime. Any input would be greatly appreciated. AVIBIRD here is the code

// RUIS script (Random Unit Invasion Script) v1.2

// changed attak waypoint to function as array - allows for spawned group to randomly select a position to move to

// example: nul = [RUguy, [spawn1, spawn2, spawn3], attackwp, spawntimer, Scripttime] execVM "RUIS.sqf"

// unit - this unit will be checked for what side and faction to spawn

// [spawn1, ...] - gamelogics for units to spawn on

// attackwp - an array of positions spawned units will move to (chosen randomly per group)

// spawntimer - amount of time to wait until the spawning of a new unit

// scripttime - the amount of waves this script will run (1 wave = 1 iteration of script spawning stuff)

if (isServer || isDedicated) then {

private ["_spawntime", "_logicS", "_logicE", "_temptime", "_scripttime", "_unit", "_perc", "_faction", "_side", "_MaxInf", "_MaxV", "_MaxLA", "_MaxArm", "_MaxAir", "_PInf", "_PV", "_PLA", "_PArm", "_PAir", "_EmptyGroups"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_spawntime = _this select 3;

_scripttime = _this select 4; // this sets the amount of waves the script will do

_faction = faction _unit;

_side = side _unit;

_EmptyGroups = 0;

// EDIT THESE VARIABLES TO CUSTOMIZE RUIS

_MaxInf = 12; // Maximum amount of infantry that can be spawned in a single wave

_MaxV = 5; // Max amount of vehicles to spawn

_MaxLA = 5; // Max amount of light armored in a single wave

_MaxArm = 4; // Max amount of armor

_MaxAir = 2; // Max amount of air

_PInf = 100; // Percentage chance of Infantry being spawned (100% = everytime, 0% = never)

_PV = 90; // Percentage chance of vehicles spawning

_PLA = 80; // Percentage chance of Light vehicles being spawned

_PArm = 70; // Percentage chance of Armor being spawned

_PAir = 60; // Percentage chance of Air being spawned

// DO NOT EDIT PAST THIS

// check what side was chosen, and assimilate proper values

// blacklisted: "RU_SniperTeam", "USMC_SniperTeam", "USMC_FRTeam", "USMC_FRTeam_Razor"

// A2 Russian faction

if (_faction == "RU") then {

_unit setVariable ["infantry", ["RU_InfSquad", "RU_InfSection_MG", "RU_InfSection_AT", "RU_InfSection_AA", "RU_InfSection"], true];

_unit setVariable ["vehicle", ["RU_MotInfSection_Recon", "RU_MotInfSection_Patrol"], true];

_unit setVariable ["lightarmor", ["RU_MechInfSquad_1", "RU_MechInfSquad_2"], true];

_unit setVariable ["armor", ["RU_TankPlatoon"], true];

_unit setVariable ["air", ["RU_Mi24VSquadron", "RU_Mi24PSquadron"], true];

};

// A2 USMC faction

if (_faction == "USMC") then {

_unit setVariable ["infantry", ["USMC_InfSquad", "USMC_FireTeam", "USMC_FireTeam_MG", "USMC_FireTeam_AT", "USMC_FireTeam_Support", "USMC_HeavyATTeam"], true];

_unit setVariable ["vehicle", ["USMC_MotInfSection", "USMC_MotInfSection_AT"], true];

_unit setVariable ["lightarmor", ["USMC_MechInfSquad", "USMC_MechReconSection"], true];

_unit setVariable ["armor", ["USMC_TankPlatoon"], true];

_unit setVariable ["air", ["USMC_AH1ZSquadron", "USMC_UH1YSquadron", "USMC_MV22Squadron", "USMC_F35Squadron", "USMC_AV8BFighterSquadron", "USMC_AV8BBomberSquadron"], true];

};

// OA US Army faction

if (_faction == "BIS_US") then {

_unit setVariable ["infantry", ["US_RifleSquad", "US_WeaponsSquad", "US_Team", "US_TeamMG", "US_TeamAT", "US_TeamSupport", "US_HeavyATTeam", "US_SniperTeam", "US_DeltaForceTeam"], true];

_unit setVariable ["vehicle", ["US_MotorizedSection", "US_MotorizedSectionAT", "US_DeltaPatrolATV", "US_DeltaPatrolHMMWV"], true];

_unit setVariable ["lightarmor", ["US_MechanizedInfantrySquadICVM2", "US_MechanizedInfantrySquadICVMK19", "US_MechanizedReconSection"], true];

_unit setVariable ["armor", ["US_MGSPlatoon", "US_M1A2Platoon", "US_M1A1Platoon", "US_M1A2Section"], true];

_unit setVariable ["air", ["US_A10Flight", "US_AH64DFlight", "US_AH6JFlight", "US_AH6XFlight", "US_MH6JFlight", "US_UH60MFlight"], true];

};

// OA Takistani Army faction

if (_faction == "BIS_TK") then {

_unit setVariable ["infantry", ["TK_InfantrySquad", "TK_InfantrySection", "TK_InfantrySectionAT", "TK_InfantrySectionAA", "TK_InfantrySectionMG", "TK_SniperTeam", "TK_SpecialPurposeSquad"], true];

_unit setVariable ["vehicle", ["TK_MotorizedInfanterySquad", "TK_MotorizedReconSection", "TK_MotorizedPatrol"], true];

_unit setVariable ["lightarmor", ["TK_MechanizedInfantrySquadBMP2", "TK_MechanizedInfantrySquadBTR60", "TK_MechanizedSpecialSquad", "TK_MechanizedReconSection", "TK_MechanizedReconSectionAT"], true];

_unit setVariable ["armor", ["TK_T72Platoon", "TK_T55Platoon", "TK_T34Platoon"], true];

_unit setVariable ["air", ["TK_Mi24_DFlight", "TK_Mi_17Flight", "TK_Su25Flight", "TK_UH1HFlight"], true];

};

// OA Takistani Insurgents faction

if (_faction == "BIS_TK_INS") then {

_unit setVariable ["infantry", ["TK_INS_Group", "TK_INS_Patrol", "TK_INS_AATeam", "TK_INS_ATTeam"], true];

_unit setVariable ["vehicle", ["TK_INS_Technicals", "TK_INS_MotorizedGroup"], true];

_unit setVariable ["lightarmor", [], true];

_unit setVariable ["armor", ["TK_INS_MotorizedPatrolBTR40"], true];

_unit setVariable ["air", [], true];

};

// TO INCLUDE A FACTION,

// Custom Insert faction

if (_faction == "YourFactionHere") then {

_unit setVariable ["infantry", ["Your Infantry Classname Here"], true];

_unit setVariable ["lightarmor", ["Your Vehicle Classname here"], true];

_unit setVariable ["armor", ["Your armor classname here"], true];

_unit setVariable ["air", ["Your air classname here"], true];

};

// Functions for spawn

if (isnil "DZ_Spawn_INF") then {

DZ_Spawn_INF = {

private ["_unit", "_loc", "_wp", "_spawned", "_logicS", "_logicE", "_unitarray", "_side", "_faction", "_MaxInf", "_locA"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_side = _this select 3;

_faction = _this select 4;

_MaxInf = _this select 5;

// spawn infantry a random of 5 times

for "_i" from 1 to (ceil(random _MaxInf)) + 5 do

{

_unitarray = (_unit getVariable "infantry") select floor(random(count (_unit getVariable "infantry")));

_loc = _logicS select floor(random(count _logicS));

// spawn random units

_spawned = [getPos _loc, _side, (configFile >> "CfgGroups" >> (str _side) >> _faction >> "Infantry" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;

// move units to waypoint

_locA = _logicE select floor (random(count _logicE));

_wp = _spawned addWaypoint [position _locA, 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "NORMAL";

[_spawned, 0] setWaypointBehaviour "AWARE";

sleep (random 20);

};

};

};

if (isnil "DZ_Spawn_V") then {

DZ_Spawn_V = {

private ["_unit", "_loc", "_wp", "_spawned", "_logicS", "_logicE", "_unitarray", "_side", "_faction", "_MaxV", "_locA"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_side = _this select 3;

_faction = _this select 4;

_MaxV = _this select 5;

// spawn vehicle random times

for "_i" from 1 to (ceil(random _MaxV)) do

{

_unitarray = (_unit getVariable "vehicle") select floor(random(count (_unit getVariable "vehicle")));

_loc = _logicS select floor(random(count _logicS));

// spawn random units

_spawned = [getPos _loc, _side, (configFile >> "CfgGroups" >> (str _side) >> _faction >> "Motorized" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;

// move units to waypoint

_locA = _logicE select floor (random(count _logicE));

_wp = _spawned addWaypoint [position _locA, 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "NORMAL";

[_spawned, 0] setWaypointBehaviour "AWARE";

sleep (random 20);

};

};

};

if (isnil "DZ_Spawn_LA") then {

DZ_Spawn_LA = {

private ["_unit", "_loc", "_wp", "_spawned", "_logicS", "_logicE", "_unitarray", "_side", "_faction", "_MaxLA", "_locA"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_side = _this select 3;

_faction = _this select 4;

_MaxLA = _this select 5;

// spawn light armor random times

for "_i" from 1 to (ceil(random _MaxLA)) do

{

_unitarray = (_unit getVariable "lightarmor") select floor(random(count (_unit getVariable "lightarmor")));

_loc = _logicS select floor(random(count _logicS));

// spawn random units

_spawned = [getPos _loc, _side, (configFile >> "CfgGroups" >> (str _side) >> _faction >> "Mechanized" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;

// move units to waypoint

_locA = _logicE select floor (random(count _logicE));

_wp = _spawned addWaypoint [position _locA, 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "NORMAL";

[_spawned, 0] setWaypointBehaviour "AWARE";

sleep (random 20);

};

};

};

if (isnil "DZ_Spawn_ARM") then {

DZ_Spawn_ARM = {

private ["_unit", "_loc", "_wp", "_spawned", "_logicS", "_logicE", "_unitarray", "_side", "_faction", "_MaxArm", "_locA"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_side = _this select 3;

_faction = _this select 4;

_MaxArm = _this select 5;

// spawn vehicle a random of 3 times

for "_i" from 1 to (ceil(random _MaxArm)) do

{

_unitarray = (_unit getVariable "armor") select floor(random(count (_unit getVariable "armor")));

_loc = _logicS select floor(random(count _logicS));

// spawn random units

_spawned = [getPos _loc, _side, (configFile >> "CfgGroups" >> (str _side) >> _faction >> "Armored" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;

// move units to waypoint

_locA = _logicE select floor (random(count _logicE));

_wp = _spawned addWaypoint [position _locA, 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "NORMAL";

[_spawned, 0] setWaypointBehaviour "AWARE";

sleep (random 20);

};

};

};

if (isnil "DZ_Spawn_AIR") then {

DZ_Spawn_AIR = {

private ["_unit", "_loc", "_wp", "_spawned", "_logicS", "_logicE", "_unitarray", "_side", "_faction", "_MaxAir", "_locA"];

_unit = _this select 0;

_logicS = _this select 1;

_logicE = _this select 2;

_side = _this select 3;

_faction = _this select 4;

_MaxAir = _this select 5;

// spawn vehicle a random of 3 times

for "_i" from 1 to (ceil(random _MaxAir)) do

{

_unitarray = (_unit getVariable "air") select floor(random(count (_unit getVariable "air")));

_loc = _logicS select floor(random(count _logicS));

// spawn random units

_spawned = [getPos _loc, _side, (configFile >> "CfgGroups" >> (str _side) >> _faction >> "Air" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;

// move units to waypoint

_locA = _logicE select floor (random(count _logicE));

_wp = _spawned addWaypoint [position _locA, 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "NORMAL";

[_spawned, 0] setWaypointBehaviour "AWARE";

sleep (random 20);

};

};

};

//player sidechat "getting into loop";

while {_scripttime > 0} do {

_perc = round(random 100);

_scripttime = _scripttime - 1;

_temptime = _spawntime;

//player sidechat format ["percentage: %1", _perc];

if (_perc <= _PInf) then {

_infspawn = [_unit, _logicS, _logicE, _side, _faction, _MaxInf] spawn DZ_Spawn_INF;

};

_perc = round(random 100);

if (_perc <= _PV) then {

_vehspawn = [_unit, _logicS, _logicE, _side, _faction, _MaxV] spawn DZ_SPAWN_V;

};

// check if an index in the array exists

if (count (_unit getVariable "lightarmor") > 0) then {

_perc = round(random 100);

//player sidechat format ["percentage: %1", _perc];

if (_perc <= _PLA) then {

_laspawn = [_unit, _logicS, _logicE, _side, _faction, _MaxLA] spawn DZ_Spawn_LA;

};

};

_perc = round(random 100);

//player sidechat format ["percentage: %1", _perc];

if (_perc <= _PArm) then {

_armspawn = [_unit, _logicS, _logicE, _side, _faction, _MaxArm] spawn DZ_Spawn_ARM;

};

sleep 1;

// check if an index in the array exists

if (count (_unit getVariable "air") > 0) then {

_perc = round(random 100);

//player sidechat format ["percentage: %1", _perc];

if (_perc <= _PAir) then {

_airspawn = [_unit, _logicS, _logicE, _side, _faction, _MaxAir] spawn DZ_Spawn_AIR;

};

};

waitUntil {sleep 1; _temptime = _temptime - 1; _temptime < 1};

{if (({alive _x} count units _x) == 0) then {deleteGroup _x}} foreach allGroups;

{deleteVehicle _x} forEach allDead;

};

};

Edited by AVIBIRD 1
Blue code part maybe what needs to be changed

Share this post


Link to post
Share on other sites

Does anyone have any input if this script can be changed to respawn units only after all the units from the unitarray are killed and not on the scripttime! Avibird.

Share this post


Link to post
Share on other sites
Does anyone have any input if this script can be changed to respawn units only after all the units from the unitarray are killed and not on the scripttime! Avibird.

A couple of thoughts AVIBIRD 1. This may answer a couple of questions asked prior to your question also.

The groups in this script are HARD CODED. It does not read from the config. Meaning, if you use any addons which add groups in their config, it cannot(at present time w/o editing...see section of script with these lines // TO INCLUDE A FACTION, // Custom Insert faction) use them. I don't see BAF or ACR units either.

If you want something which reads the config, and will select random groups, I suggest something like cB Random Group by Wolffy.au. I use a modified version(no ACE check etc... ) This can be use in conjunction with any respawn script, like AI respawn group and move to WP script, with a bit of modification.

Wolffy.au also has cB Task Patrol/Random Group. I use a "homebrew" which includes the use of taskAttack, taskPatrol, taskDefend etc...

No offense to the author of this script, as it may be exactly as he wanted, and many may really like it. I just prefer those which read from the config so I can add any addon, and use those groups also.

The request you are asking for, is more in line with Norrin's AI respawn script I mentioned earlier. Those units are not respawned until dead. If you want them to "invade" your position, just set their waypoint to such...

Oh, forgot another one I really like which may be more of what you're looking for. Editor based AI script by trigger by Murklor & ArmAIIholic

Edited by panther42

Share this post


Link to post
Share on other sites

@ Panther I have used all the scripts above. I really like the dynamic element of the script not knowing which groups and how many will get respawn during the mission. I also changed the SAD waypoints to GUARD waypoints with multiple attack locations throughout the map. So what happens with the units in the script they support other units all over the map at random times but will also attempt to send units during firefights. The result is you never know how many units or what kind will show up at your current firefight location during a mission. If the scripttime can not be switched to killed units to set the respawn function then maybe I need to revisit the other scripts above. The main issue is if the game is running for a few days and ever 1-2 hrs a new Unit Invasion of units respawns and no players are in the game to kill them. The mission will start to lag due to all the units sitting around in the mission. Thank you for looking into this for me. Avibird

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

All right my friend. I will take a closer look. Shouldn't be too hard.

So, do you want to wait until all groups spawned are eliminated, or by group, before they respawn?

Share this post


Link to post
Share on other sites

I think it would be easier to get the script to work when ALL the groups are eliminated but if you could find a way to have each group type ie infantry,vehicles,lightarmor,armor and air to respawn after that whole group is killed and still have the functionally of random type and amount for that group that would be great. I think if I lol YOU can get the issue with the AIvcl_respawn script to work I will use that for the air units and this one of everything else in the current mission I am working on. Avibird.

---------- Post added at 11:45 PM ---------- Previous post was at 11:06 PM ----------

@ panther

cB Task Patrol/Random Group.sqf and crB_aerialPatrol.sqf are very good scripts however I could never find out how to get Operation Arrowhead factions to spawn or BAF/ACR only ARMA2 factions. I know how to set single faction or multiple factions but only for ARMA2 factions. Maybe the script was only made for ARMA2 and not OA? do you know. Avibird

lol I was so wrong about that statement (: I have not play around with that script for a while the problem was I could not get just one single faction to spawn with the script. It was all east or nothing would work.

Wow after about an hour of test playing lol the light finally turned on, The code change was not in the SQF were I was looking and testing but in the game logic on the map!!!

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

after re installing the entire game thinking *something must be nerfed* + trying countless times I am unable to locate why this script was causing grief on my end.they spawn great into the editor but all seem to meet up at their destinations without noticing enemys on either side at the airfield. all troops are looking at each other for about 4-5 mins east/west standing approx 4-5 meters apart doing nothing at all then all at once for some strange reason *take notice* & start shooting.this script needs work.

<edit>

I tried using the latest beta build & it seemed to fix the issues somewhat, after a 10 minutes of immediate fighting & working ai enemy recognition, the code begins to break again. not sure what fluke is causing it.

but it seems to only work with a couple of waves/spawning.

Edited by MadM0nkey
re evaluation = no doubleposts

Share this post


Link to post
Share on other sites

@madm0nkey I have had that issue before but only after multiple waves have spawned . I have never seen that with the first few waves of units. I have waves that spawn in every hour on a domination type mission always felt it was due to to many units in the mission after a few hrs if the units were not killed. Have you seen this with the first few waves of units. PS I only have opfor units spawn from the script.

Share this post


Link to post
Share on other sites
@madm0nkey I have had that issue before but only after multiple waves have spawned . I have never seen that with the first few waves of units. I have waves that spawn in every hour on a domination type mission always felt it was due to to many units in the mission after a few hrs if the units were not killed. Have you seen this with the first few waves of units. PS I only have opfor units spawn from the script.

k well it's not the first time I was wrong and posted before I found/fixed the issues.

your script is clever and almost at a good working state, I just didn't notice what was causing the issue before.

to fix your demo so others don't get the same effect & think it's just broken:

1)you need to change the enemy RU soldier on the utes map to control playable

I ran across this info on post #11 here: http://www.armaholic.com/forums.php?m=posts&id=137752

and apparently this helps solve the enemy's not noticing each-other issue I was having.

2) players need to make sure in their game options that the enemy skill is at least 80 or greater.

3) your Custom Insert faction in the demo mission is not commented out with //

// TO INCLUDE A FACTION,

// Custom Insert faction

// if (_faction == "YourFactionHere") then {

// _unit setVariable ["infantry", ["Your Infantry Classname Here"], true];

// _unit setVariable ["lightarmor", ["Your Vehicle Classname here"], true];

// _unit setVariable ["armor", ["Your armor classname here"], true];

// _unit setVariable ["air", ["Your air classname here"], true];

// };

now that I upgraded to beta build, and made those 2 above changes it works like a charm!

btw, if anyone wants it here is the A2 Insurgent faction to paste into RUIS.sqf

just change the trigger & the RU soldier name to INS and it should work.

// A2 Insurgents faction

if (_faction == "INS") then {

_unit setVariable ["infantry", ["INS_InfSquad", "INS_InfSquad_Weapons", "INS_InfSection_AT", "INS_InfSection_AA", "INS_SniperTeam", "INS_MilitiaSquad"], true];

_unit setVariable ["vehicle", ["INS_MotInfSquad", "INS_MotInfSection"], true];

_unit setVariable ["lightarmor", ["INS_MechInfSquad", "INS_MechInfSection", "INS_MechInfSection_AT"], true];

_unit setVariable ["armor", ["INS_TankSection"], true];

_unit setVariable ["air", ["INS_Mi8Squadron"], true];

};

cheers & thanks for the script.

Edited by MadM0nkey
typos everywhere

Share this post


Link to post
Share on other sites

@MadM0nkey lol and think you but this is not my script(: I am some poor dude who likes it and wants to use it in a mission I am working on. I will try your fix and let you know who it works. I am trying to edit the script to respawn the units after the units are killed and not with the timer. Panther42 is the scripter that may help me with that. If you know how please let me know(:

Share this post


Link to post
Share on other sites

Is it possible to let civilians spawn this way? I tried the following:

// Custom Insert faction

if (_faction == "CIV") then {

_unit setVariable ["infantry", ["CIV_CROWD"], true];

};

than placed a Civ unit and called the script the same way as always. Noone spawns though:(

any suggestions?

Share this post


Link to post
Share on other sites

hi wesley, you can use only predefined factions and group classes

for factions at BI Wiki here: http://community.bistudio.com/wiki/faction

group classnames here: http://community.bistudio.com/wiki/CfgGroups

as far as creating your own Custom Civilian Groups you may need to do some custom rework on the the script


_skill = [0.2, 0.8];
_side = civilian;
_units = ["Citizen2", "Citizen1", "Citizen3", "Citizen4", "Doctor", "Profiteer2", "Rocker1", "SchoolTeacher", "Damsel1", "Farmwife4"];

_ccg = [_skill, _side, _units, [], [], _skill]; 
{[_x] joinsilent (group _ccg)} forEach (units group this);

// Custom Insert faction
 if (_faction == "CIV") then {
 _unit setVariable ["infantry", ["_ccg"], true];
  };

Edited by MadM0nkey
hope that's correct

Share this post


Link to post
Share on other sites

Edit - seems to not to work on some custom maps.. Seems there's much potential in this script if it can be expanded to include artillery and High commander etc.

Edited by Pulstar

Share this post


Link to post
Share on other sites

Hiya, I am looking to get this script working, but I'm having serious issues. I cannot get the map to load into the editor to load the functions module, and I'm having a devil of a time getting CBA to load correctly, even after completely starting with a clean Arma 2 OA install plus newest beta. I've read the whole thread, and I'm pretty good at copy/paste, but not a scripter in any shape of the form.

Can anyone post a working version of this with the functions included? I'd really appreciate it, as this is exactly what I and my friends want to play in this mod. Thanks.

Share this post


Link to post
Share on other sites

How can I remove OA flares from spawned planes/choppers...?

I know this removes flares when put in the init field

this removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];//fixed
this removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];//rotor

but how can I remove it from spawned planes (cfgGroups) -I've triede a forEach loop with no further luck

_unitarray = (_unit getVariable "air") select floor(random(count (_unit getVariable "air")));
_loc = _logicS select floor(random(count _logicS));
// spawn random units
_spawned = [getPos _loc, EAST, (configFile >> "CfgGroups" >> _side >> _faction >> "Air" >> _unitarray),[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{
_x removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];//fixed
_x removeMagazinesTurret ["120Rnd_CMFlareMagazine",[-1]];//rotor
} foreach _spawned;

-any idears..? :)

Share this post


Link to post
Share on other sites

Hello.

I change the values for % chance of enemies spawning and the amount in RUIS.sqf to suit my needs.

_MaxInf = 5; // Maximum amount of infantry that can be spawned in a single wave

_MaxV = 2; // Max amount of vehicles to spawn

_MaxLA = 2; // Max amount of light armored in a single wave

_MaxArm = 1; // Max amount of armor

_MaxAir = 1; // Max amount of air

_PInf = 100; // Percentage chance of Infantry being spawned (100% = everytime, 0% = never)

_PV = 50; // Percentage chance of vehicles spawning

_PLA = 50; // Percentage chance of Light vehicles being spawned

_PArm = 5; // Percentage chance of Armor being spawned

_PAir = 5; // Percentage chance of Air being spawned

Then use a trigger to call upon it in editor with:

nul = [RUS, [sp1], [attackwp], 300, 4] execVM "RUIS.sqf"

The enemies spawn just fine, but not with the values I want. It spawns 10-15 guys. And not at all every 300 seconds or in 4 waves. I haven´t tampered with the script other then the above part. Any help would be welcome.

Thank you.

Edited by Ægishjálmuur

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  

×