Jump to content
Sign in to follow this  
xsdmx

Set Group to stay in their current positions

Recommended Posts

Hey all, I put together a spawn list thanks to the "hidden" 3D editor, but the group always leaves their positions to regroup. Here's my sqf:

activateAddons [
];

activateAddons [];
initAmbientLife;

_this = createCenter west;
_this setFriend [east, 0];
_center_0 = _this;

_group_0 = createGroup _center_0;

_unit_1 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_SL", [7115.1094, 2731.1929, 4.3791971], [], 0, "CAN_COLLIDE"];
 _unit_1 = _this;
 _this setDir 53.204597;
 _this setUnitRank "LIEUTENANT";
 _this setUnitAbility 0.60000002;
 if (true) then {_group_0 selectLeader _this;};
};

_unit_4 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7130.8154, 2729.5913, -9.5367432e-006], [], 0, "CAN_COLLIDE"];
 _unit_4 = _this;
 _this setDir 47.592533;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_6 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7130.6802, 2731.0544, -3.8146973e-006], [], 0, "CAN_COLLIDE"];
 _unit_6 = _this;
 _this setDir 47.944878;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_7 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_Medic", [7126.21, 2733.0496, 5.7220459e-006], [], 0, "CAN_COLLIDE"];
 _unit_7 = _this;
 _this setDir 17.882479;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_11 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_GL", [7126.8838, 2731.9563, 1.4305115e-006], [], 0, "CAN_COLLIDE"];
 _unit_11 = _this;
 _this setDir 22.584547;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_12 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7130.3555, 2738.0134, -2.3841858e-006], [], 0, "CAN_COLLIDE"];
 _unit_12 = _this;
 _this setDir 25.143665;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_15 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7136.3901, 2736.5959, 1.6689301e-005], [], 0, "CAN_COLLIDE"];
 _unit_15 = _this;
 _this setDir 25.703291;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_17 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7135.7231, 2737.7673, 1.001358e-005], [], 0, "CAN_COLLIDE"];
 _unit_17 = _this;
 _this setDir 2.9694259;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_20 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7136.4409, 2741.9661, 5.7220459e-006], [], 0, "CAN_COLLIDE"];
 _unit_20 = _this;
 _this setDir -6.0564637;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_24 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7126.3965, 2744.6147, 1.0490417e-005], [], 0, "CAN_COLLIDE"];
 _unit_24 = _this;
 _this setDir 14.598916;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_25 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7125.6934, 2746.0403, 3.8146973e-006], [], 0, "CAN_COLLIDE"];
 _unit_25 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_29 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7127.0625, 2743.3381, 4.0054321e-005], [], 0, "CAN_COLLIDE"];
 _unit_29 = _this;
 _this setDir 33.068695;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_32 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7125.5913, 2752.3901, -1.9073486e-006], [], 0, "CAN_COLLIDE"];
 _unit_32 = _this;
 _this setDir 25.143665;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_35 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7095.7852, 2735.7734, 12.292376], [], 0, "CAN_COLLIDE"];
 _unit_35 = _this;
 _this setDir 27.532089;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_37 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7103.7163, 2724.1492, 8.2464514], [], 0, "CAN_COLLIDE"];
 _unit_37 = _this;
 _this setDir 25.694971;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_40 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7103.2959, 2748.105, 8.3786211], [], 0, "CAN_COLLIDE"];
 _unit_40 = _this;
 _this setDir 25.694971;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_52 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7103.5171, 2746.9246, 3.9723809], [], 0, "CAN_COLLIDE"];
 _unit_52 = _this;
 _this setDir 25.694971;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_56 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_GL", [7090.564, 2742.3528, 12.303], [], 0, "CAN_COLLIDE"];
 _unit_56 = _this;
 _this setDir 22.584547;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_57 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_Medic", [7089.8901, 2743.446, 12.298054], [], 0, "CAN_COLLIDE"];
 _unit_57 = _this;
 _this setDir 17.882479;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_60 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AA", [7093.5996, 2749.4988, 12.198939], [], 0, "CAN_COLLIDE"];
 _unit_60 = _this;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_64 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7109.1738, 2737.2605, 7.844347], [], 0, "CAN_COLLIDE"];
 _unit_64 = _this;
 _this setDir 14.598916;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_65 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7109.2031, 2738.9431, 7.8443403], [], 0, "CAN_COLLIDE"];
 _unit_65 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_66 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7110.6333, 2736.241, 7.8443766], [], 0, "CAN_COLLIDE"];
 _unit_66 = _this;
 _this setDir 33.068695;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_72 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7092.5918, 2762.4524, 8.3594885], [], 0, "CAN_COLLIDE"];
 _unit_72 = _this;
 _this setDir 49.502251;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_73 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7097.8247, 2758.6704, 8.3139362], [], 0, "CAN_COLLIDE"];
 _unit_73 = _this;
 _this setDir 28.385981;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_79 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7097.3223, 2758.2393, 4.3158779], [], 0, "CAN_COLLIDE"];
 _unit_79 = _this;
 _this setDir 14.598916;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_80 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7096.6191, 2759.6648, 4.3094158], [], 0, "CAN_COLLIDE"];
 _unit_80 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_81 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7103.0947, 2749.0547, 4.318944], [], 0, "CAN_COLLIDE"];
 _unit_81 = _this;
 _this setDir 33.068695;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_88 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7098.9785, 2757.3953, 2.1457672e-005], [], 0, "CAN_COLLIDE"];
 _unit_88 = _this;
 _this setDir 38.240978;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_89 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7093.6978, 2763.6934, -1.0967255e-005], [], 0, "CAN_COLLIDE"];
 _unit_89 = _this;
 _this setDir 46.858162;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_90 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_GL", [7108.2803, 2743.0078, 4.0191503], [], 0, "CAN_COLLIDE"];
 _unit_90 = _this;
 _this setDir 22.584547;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_95 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7112.0552, 2738.6956, 0.42212349], [], 0, "CAN_COLLIDE"];
 _unit_95 = _this;
 _this setDir 14.598916;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
 if (true) then {selectPlayer _this;};
 if (true) then {setPlayable _this;};
};

_unit_96 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7111.3521, 2740.1211, 0.42211682], [], 0, "CAN_COLLIDE"];
 _unit_96 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_97 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7112.7212, 2737.4189, 0.42215306], [], 0, "CAN_COLLIDE"];
 _unit_97 = _this;
 _this setDir 33.068695;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_103 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7110.6089, 2737.1411, 3.9576108], [], 0, "CAN_COLLIDE"];
 _unit_103 = _this;
 _this setDir 25.703291;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_104 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7109.9839, 2738.3574, 3.9576042], [], 0, "CAN_COLLIDE"];
 _unit_104 = _this;
 _this setDir 2.9694259;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_109 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7102.9766, 2740.7217, 7.921771], [], 0, "CAN_COLLIDE"];
 _unit_109 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_110 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_GL", [7102.248, 2738.5493, 7.9217691], [], 0, "CAN_COLLIDE"];
 _unit_110 = _this;
 _this setDir 22.584547;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_117 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_HAT", [7097.1206, 2724.2974, 4.3591537], [], 0, "CAN_COLLIDE"];
 _unit_117 = _this;
 _this setDir -169.80249;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_118 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7098.23, 2723.3809, 4.3591242], [], 0, "CAN_COLLIDE"];
 _unit_118 = _this;
 _this setDir -188.27228;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_119 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7099.4302, 2722.3398, 4.3591175], [], 0, "CAN_COLLIDE"];
 _unit_119 = _this;
 _this setDir -185.50067;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_124 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7078.5981, 2752.0771, 7.9181628], [], 0, "CAN_COLLIDE"];
 _unit_124 = _this;
 _this setDir -95.417885;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_128 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7092.1948, 2758.0466, 11.999557], [], 0, "CAN_COLLIDE"];
 _unit_128 = _this;
 _this setDir 25.703291;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_129 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7091.5278, 2759.218, 11.994253], [], 0, "CAN_COLLIDE"];
 _unit_129 = _this;
 _this setDir 2.9694259;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_vehicle_5 = objNull;
if (true) then
{
 _this = createVehicle ["Land_fort_bagfence_long", [7106.1133, 2750.0386, 0.20156373], [], 0, "CAN_COLLIDE"];
 _vehicle_5 = _this;
 _this setDir 55.240501;
};

_vehicle_7 = objNull;
if (true) then
{
 _this = createVehicle ["Land_fort_bagfence_long", [7102.9067, 2754.405, 0.21485238], [], 0, "CAN_COLLIDE"];
 _vehicle_7 = _this;
 _this setDir 55.240501;
};

_unit_135 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_GL", [7105.585, 2749.0886, 3.8146973e-005], [], 0, "CAN_COLLIDE"];
 _unit_135 = _this;
 _this setDir 22.584547;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_136 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_Medic", [7104.9111, 2750.1819, 4.2438507e-005], [], 0, "CAN_COLLIDE"];
 _unit_136 = _this;
 _this setDir 17.882479;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_141 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier_AR", [7098.0039, 2750.6528, 7.9591846], [], 0, "CAN_COLLIDE"];
 _unit_141 = _this;
 _this setDir 14.598916;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_142 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_Soldier", [7097.3008, 2752.0784, 7.959178], [], 0, "CAN_COLLIDE"];
 _unit_142 = _this;
 _this setDir 17.370535;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

_unit_146 = objNull;
if (true) then
{
 _this = _group_0 createUnit ["USMC_SoldierS_Sniper", [7130.7813, 2720.3892, 24.133472], [], 0, "CAN_COLLIDE"];
 _unit_146 = _this;
 _this setDir 76.626152;
 _this setUnitAbility 0.60000002;
 if (false) then {_group_0 selectLeader _this;};
};

processInitCommands;

Share this post


Link to post
Share on other sites

You can try [dostop this] or [this disableAI "move"].

Biki: DisableAI

I don't think you have to disable targeting like that article says but if disabling move doesn't work then you know your next step.

Share this post


Link to post
Share on other sites

Set at formation "none" on every unit. Then write in the initline of the leader:

{_x setUnitPos "MIDDLE"; _x disableAI "MOVE"; _x enableAttack FALSE} forEach units NameOfLeader;

Place the units where you want and see how they hold theyr positions.

If you want the units move back to formation:

{_x setUnitPos "Auto"; _x enableAI "MOVE"; _x enableAttack TRUE} forEach units NameOfLeader;

Is that what you want? ^^

Share this post


Link to post
Share on other sites
Set at formation "none" on every unit. Then write in the initline of the leader:

{_x setUnitPos "MIDDLE"; _x disableAI "MOVE"; _x enableAttack FALSE} forEach units NameOfLeader;

Seems a little extreme. He just want's them not to return to formation, not to ignore everything going on around them.

Share this post


Link to post
Share on other sites

It's only an example. So he can do it without _x enableAttack FALSE :rolleyes:

Share this post


Link to post
Share on other sites

That, and the disableAI "MOVE" makes him totally unable to engage enemies unless they are right in front of him.

Share this post


Link to post
Share on other sites

I know this! But he want to stay the group in their current positions. For what a situation this is used i dont know. I see no another way.

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  

×