setFormDir: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| ofp |Game name=
| ofp |Game name=
Line 11: Line 10:


|gr1= Groups |GROUP1=
|gr1= Groups |GROUP1=
____________________________________________________________________________________________


| Sets group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overridden by movement direction. If the new direction is noticeably different from the old direction (approx +/- 15 degrees), units will change positions changing [[formationDirection]]. |DESCRIPTION=
| Sets group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overridden by movement direction. If the new direction is noticeably different from the old direction (approx +/- 15 degrees), units will change positions changing [[formationDirection]]. |DESCRIPTION=
____________________________________________________________________________________________


| group '''setFormDir''' heading |SYNTAX=
| group '''setFormDir''' heading |SYNTAX=
Line 23: Line 20:


| [[Nothing]] |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
   
   
|x1= <code>_group1 [[setFormDir]] 180;</code> |EXAMPLE1=
|x1= <code>_group1 [[setFormDir]] 180;</code> |EXAMPLE1=
Line 30: Line 26:
|x3= <code>//center the main turret
|x3= <code>//center the main turret
([[group]] BIS_Crew1) [[setFormDir]] ([[getDir]] BIS_Armor);</code> |EXAMPLE3=
([[group]] BIS_Crew1) [[setFormDir]] ([[getDir]] BIS_Armor);</code> |EXAMPLE3=
____________________________________________________________________________________________


| [[setDir]], [[setVectorDir]], [[setVectorDirAndUp]], [[resetSubgroupDirection]], [[formation]], [[formationLeader]], [[formationMembers]], [[formationTask]], [[formationDirection]], [[formationPosition]] |SEEALSO=
| [[setDir]], [[setVectorDir]], [[setVectorDirAndUp]], [[resetSubgroupDirection]], [[formation]], [[formationLeader]], [[formationMembers]], [[formationTask]], [[formationDirection]], [[formationPosition]] |SEEALSO=

Revision as of 02:30, 17 January 2021

Hover & click on the images for description

Description

Description:
Sets group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overridden by movement direction. If the new direction is noticeably different from the old direction (approx +/- 15 degrees), units will change positions changing formationDirection.
Groups:
Groups

Syntax

Syntax:
group setFormDir heading
Parameters:
group: Object or Group
heading: Number
Return Value:
Nothing

Examples

Example 1:
_group1 setFormDir 180;
Example 2:
_unit1 setFormDir random 360;
Example 3:
//center the main turret (group BIS_Crew1) setFormDir (getDir BIS_Armor);

Additional Information

See also:
setDirsetVectorDirsetVectorDirAndUpresetSubgroupDirectionformationformationLeaderformationMembersformationTaskformationDirectionformationPosition

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on November 22, 2014 - 20:03 (UTC)
Killzone Kid
When applied to AI, setFormDir will set unit formation direction, which in turn will force unit to change direction to match formation direction, however unit will stop turning as soon as unit direction is +/- 30 degrees of the formation direction. To precisely match formation direction, additional setDir is required: _unit setFormDir 45; _unit setDir 45; hint str direction _unit; //45