setFormDir: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(comment)
No edit summary
Line 59: Line 59:
[[hint]] [[str]] [[direction]] _unit; //45</code>  
[[hint]] [[str]] [[direction]] _unit; //45</code>  


</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 8, 2014 - 04:51 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
To add to Killzone Kid's note, that only applies to groups consisting of a single unit. This is [http://feedback.arma3.com/view.php?id=21792#c84966 intended behavior]. See my comment below the linked post for a single-unit workaround.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 06:51, 8 December 2014

Hover & click on the images for description

Description

Description:
Set 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 overriden by movement direction.
Groups:
Uncategorised

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); (group BIS_Crew2) setFormDir (getDir BIS_Armor);

Additional Information

See also:
setDir

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
Posted on December 8, 2014 - 04:51 (UTC)
DreadedEntity
To add to Killzone Kid's note, that only applies to groups consisting of a single unit. This is intended behavior. See my comment below the linked post for a single-unit workaround.