Jump to content
Sign in to follow this  
deadlyhabit

Problem placing soldiers in buildings

Recommended Posts

So I have a script that in theory should be working, but I'm having a few issues.

First sometimes the units aren't spawning into building positions.

Second sometimes by the time I get to the location the units are already dead.

Third for some reason even though I have independents set to be friendly to OPFOR, they're not attacking my unit.

I'm using invisible helipads for the Hostage1, Hostage2 etc positioning.

Any advice or help would be greatly appreciated.

/////////////////////////////////////////////////////////
// Randomize placement of a group within 7 spots
// random.sqf
/////////////////////////////////////////////////////////

if (! isServer) exitwith {}; // NOTE: in multiplayer, only server should create random numbers.

// Create Group for units to be spawned into; must have group created BEFORE spawning units in.
_SideHQ = createCenter resistance;
_SideHQ1 = createCenter civilian;
groupAlpha = createGroup resistance;
groupHostage = createGroup civilian;

// Pick Location ///////////////////////////////////////////////////////////////////////
_posHostage = [Hostage1, Hostage2, Hostage3, Hostage4, Hostage5, Hostage6, Hostage7] call BIS_fnc_selectRandom;
_extraction = getMarkerPos "Extraction";
_house = nearestBuilding _posHostage;
_position = 0;
HostageString = format ["%1",_posHostage];

//Generate Hostage
H1 = groupHostage createUnit ["Rocker1", (_house buildingPos _position), [], 0, "NONE"];
removeAllWeapons H1;
nul = [H1] execVM "Hostage_male.sqf";


//Generate Soldiers

G1 = groupAlpha createUnit ["GUE_Soldier_3", (_house buildingPos (_position+1)), [], 0, "NONE"];
G1 setdir 360;
G1 setSkill 1;

G2 = groupAlpha createUnit ["GUE_Soldier_AR", (_house buildingPos (_position+2)), [], 0, "NONE"];
G2 setdir 360;
G2 setSkill 1;

G3 = groupAlpha createUnit ["GUE_Soldier_MG", (_house buildingPos (_position+3)), [], 0, "NONE"];
G3 setdir 360;
G3 setSkill 1;

G4 = groupAlpha createUnit ["GUE_Soldier_MG", (_house buildingPos (_position+4)), [], 0, "NONE"];
G4 setdir 360;  
G4 setSkill 1;

G5 = groupAlpha createUnit ["GUE_Soldier_Medic", (_house buildingPos (_position+5)), [], 0, "NONE"];
G5 setdir 360;  
G5 setSkill 1;

//Triggers

//Victory
_trgVic = createTrigger ["EmptyDetector" , getMarkerPos "Extraction"];
_trgVic setTriggerArea [50, 50, 0, false];
_trgVic setTriggerType "END1";
_trgVic setTriggerActivation ["ANY", "PRESENT", false];
_trgVic setTriggerTimeout [10, 10, 10, false ];
_trgVic setTriggerStatements ["H1 in thislist", "", ""];

//Loss
_trgLoss = createTrigger["EmptyDetector", getPos H1];
_trgLoss setTriggerArea [0, 0, 0, false];
_trgLoss setTriggerType "LOOSE";
_trgLoss setTriggerActivation ["ANY", "PRESENT", false];
_trgLoss setTriggerTimeout [10, 10, 10, false ];
_trgLoss setTriggerStatements ["!(alive H1)", "", ""];

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  

×