Jump to content
Coladebote

Help on "setFormation"

Recommended Posts

// GUARDS //

_markerstr = createMarker ["GUARDS_A1",[677.594,14214.7]];
_markerstr setMarkerShape "ICON";
_height = 0;
_pos = getMarkerPos "GUARDS_A1";
_GUARDS_A1 = [ [_pos select 0, _pos select 1, _height], EAST, ["LIB_SOV_p_officer","LIB_SOV_mgunner","LIB_SOV_smgunner","LIB_SOV_LAT_Soldier"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;

{
_x allowFleeing 0.5;
_x forceSpeed -1; 
_x enableAI "TARGET";
_x enableAI "AUTOTARGET";
_x setFormDir 0;
_x setDir 0;
_x setUnitPos "AUTO";
_x setFormation "LINE";
_x setBehaviour "SAFE";
_x setCombatMode "RED";
}
forEach units _GUARDS_A1;
{
_x setSkill 1;
_x setSkill ["aimingAccuracy", 0.2];
_x setSkill ["spotTime", 0.9];
_x setSkill ["spotDistance", 0.9];
}
forEach units _GUARDS_A1;

 

Hello guys:
This little script works perfectly, both locally and on the server. However, the units do not appear in the "LINE" position, which is the instruction set by "setFormation".

I have tried replacing "LINE" with "WEDGE" and the units do not change position. Attached, in the link, an example image. It seems that "setFormation" does not respond.

 

Link:

https://drive.google.com/open?id=1_zx8cXKgOoHP2KU6q_mMd5SlJ7vkdfXO

 

I am doing something wrong?
Thanks.

 

 

Share this post


Link to post
Share on other sites

"SAFE"  or  "CARELESS" behavior ignores set formation and forces a group to fall into some loose column formation.

 

Cheers

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

{

_x allowFleeing 0.5;

_x forceSpeed -1;                               // useless

_x enableAI "TARGET";                     // useless

_x enableAI "AUTOTARGET";           // useless

_x setFormDir 0;                                // useless

_x setDir 0;                                         // useless

_x setUnitPos "AUTO";                      // useless

_x setFormation "LINE";

_x setBehaviour "SAFE";                   // don't

_x setCombatMode "RED";               // apply to group

} forEach units _GUARDS_A1;

  • Like 1

Share this post


Link to post
Share on other sites

Hi:
Applying your corrections, the scritp is as follows:

 

// GUARDS //

_markerstr = createMarker ["GUARDS_A1",[677.594,14214.7]];
_markerstr setMarkerShape "ICON";
_height = 0;
_pos = getMarkerPos "GUARDS_A1";
_GUARDS_A1 = [ [_pos select 0, _pos select 1, _height], EAST, ["LIB_SOV_p_officer","LIB_SOV_mgunner","LIB_SOV_smgunner","LIB_SOV_LAT_Soldier"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
_GUARDS_A1 setCombatMode "RED";
{
_x allowFleeing 0.5; 
_x setFormation "LINE";
_x setBehaviour "AWARE";
}
forEach units _GUARDS_A1;
{
_x setSkill 1;
_x setSkill ["aimingAccuracy", 0.2];
_x setSkill ["spotTime", 0.9];
_x setSkill ["spotDistance", 0.9];
}
forEach units _GUARDS_A1;

With this script, the units are dispersed at the point, but they do not form "setFormation" LINE "as ordered. In any case, the result is better than with the previous one, script.

 

ANOTHER QUESTIONS:
If I use «CARELESS», the units are placed in «DOWN» position, so I use «AWARE»

 

I use "forceSpeed -1;" so that the units act with freedom of movement and "forceSpeed 0;" so that they do not move from the point they guard. If "forceSpeed" is deleted, how do the units stop at the point? Can «disableAI" PATH ";» be used?

 

If "setFormDir 0;" and "setDir 0;" is deleted, how do you indicate the direction in which they have to be formed?

I understand that I must do it from here, where the O (North) appears: «[], [], [], [], [], 0] call BIS_fnc_spawnGroup;»

 

ONE LAST TOPIC:
What is the difference between:
«ForEach units _GUARDS_A2;»
«ForEach units [_GUARDS_A2];»
«ForEach units (_GUARDS_A2);»

 

I apologize, but if I don't ask, I don't learn.


Thanks.

Share this post


Link to post
Share on other sites

 

22 minutes ago, Coladebote said:

«ForEach units _GUARDS_A2;»
«ForEach units [_GUARDS_A2];»
«ForEach units (_GUARDS_A2);»

First and last will work, middle not.

 

forEach takes each element inside the given array. You are using the units command, which need a group on the right side and returns an array. The brackets in the third line are not needed. But in the second line the units command gets an array with one element being the group. That is not allowed.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, Katalam:

I've asked, because I've tried all three modes in the script and I haven't appreciated differences.

Thanks.

Share this post


Link to post
Share on other sites
On 1/2/2020 at 2:13 PM, Grumpy Old Man said:

"SAFE"  or  "CARELESS" behavior ignores set formation and forces a group to fall into some loose column formation.

This information should be on Biki too! 🙂 S2

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

×