setFormDir: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| ofp |Game name=
|game1= ofp
|version1= 1.00


|1.00|Game version=
|game2= ofpe
|version2= 1.00


|arg= local |Multiplayer Arguments=
|game3= arma1
|version3= 1.00


|eff= global |Multiplayer Effects=
|game4= arma2
|version4= 1.00


|gr1= Groups |GROUP1=
|game5= arma2oa
____________________________________________________________________________________________
|version5= 1.50


| 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=
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00


| group '''setFormDir''' heading |SYNTAX=
|game7= arma3
|version7= 0.50


|p1= group: [[Object]] or [[Group]] |PARAMETER1=
|arg= local


|p2= heading: [[Number]] |PARAMETER2=
|eff= global


| [[Nothing]] |RETURNVALUE=
|gr1= Groups
____________________________________________________________________________________________
 
|x1= <code>_group1 [[setFormDir]] 180;</code> |EXAMPLE1=
|x2= <code>_unit1 [[setFormDir]] [[random]] 360;</code> |EXAMPLE2=


|x3= <code>//center the main turret
|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]].
([[group]] BIS_Crew1) [[setFormDir]] ([[getDir]] BIS_Armor);</code> |EXAMPLE3=
____________________________________________________________________________________________


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


}}
|p1= group: [[Object]] or [[Group]]
 
|p2= heading: [[Number]]
 
|r1= [[Nothing]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>_group1 setFormDir 180;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x2= <sqf>_unit1 setFormDir random 360;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|x3= <sqf>
[[Category:Scripting Commands|SETFORMDIR]]
//center the main turret
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
(group BIS_Crew1) setFormDir (getDir BIS_Armor);
[[Category:Scripting Commands OFP 1.96|SETFORMDIR]]
</sqf>
[[Category:Scripting Commands OFP 1.46|SETFORMDIR]]
 
{{GameCategory|arma1|Scripting Commands}}
|seealso= [[setDir]] [[setVectorDir]] [[setVectorDirAndUp]] [[resetSubgroupDirection]] [[formation]] [[formationLeader]] [[formationMembers]] [[formationTask]] [[formationDirection]] [[formationPosition]]
{{GameCategory|arma2|Scripting Commands}}
}}
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dd class="notedate">Posted on November 22, 2014 - 20:03 (UTC)</dd>
 
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<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">
<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:
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:
<code>_unit [[setFormDir]] 45;
<sqf>
_unit [[setDir]] 45;
_unit setFormDir 45;
[[hint]] [[str]] [[direction]] _unit; //45</code>  
_unit setDir 45;
hint str direction _unit; //45
</sqf>  


</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<!-- DISCONTINUE Notes -->

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