setFormDir: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(79 intermediate revisions by 14 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|S]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97|S]]
[[Category:Scripting Commands OFP 1.46|S]]
[[Category:Scripting Commands ArmA|S]]


|game1= ofp
|version1= 1.00


<h2 style="color:#000066">'''''group'' setFormDir ''heading'''''</h2>
|game2= ofpe
|version2= 1.00


|game3= arma1
|version3= 1.00


'''Operand types:'''
|game4= arma2
|version4= 1.00


'''group:''' [[Object or Group]]
|game5= arma2oa
|version5= 1.50


'''heading:''' [[Number]]
|game6= tkoh
|version6= 1.00


'''Type of returned value:'''
|game7= arma3
|version7= 0.50


[[Nothing]]
|arg= local


'''Description:'''
|eff= global


Set '''group''' formation '''heading'''.
|gr1= Groups


Accepted heading range is 0 to 360.
|descr= 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]].


Formation is facing this direction unless enemy is seen.
|s1= group [[setFormDir]] heading


When group is moving, this value is overriden by movement direction.
|p1= group: [[Object]] or [[Group]]


|p2= heading: [[Number]]


'''Example:'''
|r1= [[Nothing]]


group1 '''setFormDir''' 180
|x1= <sqf>_group1 setFormDir 180;</sqf>
 
|x2= <sqf>_unit1 setFormDir random 360;</sqf>
 
|x3= <sqf>
//center the main turret
(group BIS_Crew1) setFormDir (getDir BIS_Armor);
</sqf>
 
|seealso= [[setDir]] [[setVectorDir]] [[setVectorDirAndUp]] [[resetSubgroupDirection]] [[formation]] [[formationLeader]] [[formationMembers]] [[formationTask]] [[formationDirection]] [[formationPosition]]
}}
 
<dl class="command_description">
 
<dt></dt>
<dd class="notedate">Posted on 2014-11-22 - 20:03 (UTC)</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="note">
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:
<sqf>
_unit setFormDir 45;
_unit setDir 45;
hint str direction _unit; //45
</sqf>
 
</dd>
 
</dl>

Latest revision as of 19:42, 3 September 2024

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:
setDir setVectorDir setVectorDirAndUp resetSubgroupDirection formation formationLeader formationMembers formationTask formationDirection formationPosition

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
Posted on 2014-11-22 - 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