doMove: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(52 intermediate revisions by 5 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


| Order the given unit(s) to move to the given position (without radio messages). After reaching his destination, the unit will immediately return to formation (if in a group); or order his group to form around his new position (if a group leader). Use [[doStop]] to stop units returning to formation. |DESCRIPTION=
|game5= arma2oa
____________________________________________________________________________________________
|version5= 1.50


| unit(s) '''doMove''' position |SYNTAX=
|game6= tkoh
|version6= 1.00


|p1= unit(s): [[Object]] or [[Array]] |PARAMETER1=
|game7= arma3
|version7= 0.50


|p2= position: [[Array]] - format [[Position]]|PARAMETER2=
|arg= local


| [[Nothing]] |RETURNVALUE=
|eff= global
____________________________________________________________________________________________
 
|x1= <code>_soldier1 [[doMove]] ([[position]] _officer);</code> |EXAMPLE1=
|x2= <code>this [[doMove]] ([[getMarkerPos]] "Marker1");</code> |EXAMPLE2=
____________________________________________________________________________________________


| [[commandMove]], [[setDestination]], [[moveTo]], [[move]], [[addWaypoint]] |SEEALSO=
|gr1= Unit Control


|descr= Order the given unit(s) to move to the given position (without radio messages). Upon reaching its destination, if it is the group leader it will order the group to form around it's new position. If it is not the leader, it will immediately be ordered to return to formation by the group leader and begin moving back to the group. Use [[doStop]] to stop units returning to formation. [[moveToCompleted]] will return true when a unit issued this command reaches its destination.
|s1= unit(s) [[doMove]] position
|p1= unit(s): [[Object]] or [[Array]]
|p2= position: [[Array]] format [[Position]]
|r1= [[Nothing]]
|x1= <sqf>_soldier1 doMove (position _officer);</sqf>
|x2= <sqf>this doMove (getMarkerPos "Marker1");</sqf>
|seealso= [[commandMove]] [[setDestination]] [[moveTo]] [[move]] [[addWaypoint]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">


<!-- Note Section BEGIN -->
<dt><dt>
 
<dd class="notedate">Posted on 2008-02-09</dd>
<dd class="notedate">Posted on February 9, 2008
<dt class="note">[[User:Kronzky|Kronzky]]</dt>
<dt class="note">'''[[User:Kronzky|Kronzky]]'''
<dd class="note">
<dd class="note">
If doMove is to be used in conjunction with waypoint behavior commands (e.g. [[setSpeedMode]]), then those have to be issued ''after'' the move command to have an effect. Otherwise the move will be done with the default settings.
If doMove is to be used in conjunction with waypoint behavior commands (e.g. [[setSpeedMode]]), then those have to be issued ''after'' the move command to have an effect. Otherwise the move will be done with the default settings.


 
<dt><dt>
<dd class="notedate">Posted on February 3, 2009
<dd class="notedate">Posted on 2009-02-03</dd>
<dt class="note">'''[[User:General_Barron|General Barron]]'''
<dt class="note">[[User:General_Barron|General Barron]]</dt>
<dd class="note">
<dd class="note">
If a unit is part of a group, and is not the leader, the unit will fall back into formation soon after the domove is completed. This does not happen for units that are in a group alone (because they are their own leader).
If a unit is part of a group, and is not the leader, the unit will fall back into formation soon after the domove is completed. This does not happen for units that are in a group alone (because they are their own leader).
There is no single command to get a unit to move to a position and stay there. The best way to do this is to issue a domove, then wait for the unit to reach his destination, then disable his movement AI. VBS2 users can use the [[fn_vbs_doMoveEx_(VBS2)|fn_vbs_doMoveEx]] function.
There is no single command to get a unit to move to a position and stay there. The best way to do this is to issue a domove, then wait for the unit to reach his destination, then disable his movement AI.  
<!-- Note Section END -->


</dl>


</dl>
{{Note
|user= DreadedEntity
|timestamp= 20220402152226
|text= The above note is only true of units which group leader is not the player. Player-squad will remain in position until given another order (A3 v2.08.149102)
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
|user= DreadedEntity
|timestamp= 20220402203558
|text= If you need your script to halt until the unit has reached it's destination, [[waitUntil]] and [[moveToCompleted]] will come in handy:
<sqf>
_unit doMove _pos;
waitUntil {moveToCompleted _unit};
</sqf>
This also works with [[commandMove]]
}}


[[Category:Scripting Commands|DOMOVE]]
{{Note
[[Category:Scripting Commands OFP 1.99|DOMOVE]]
|user= Waffle SS.
[[Category:Scripting Commands OFP 1.96|DOMOVE]]
|timestamp= 20220725062519
[[Category:Scripting Commands OFP 1.46|DOMOVE]]
|text= Seems to use PositionATL, which may be important if the destination is above a building's 1st floor.
[[Category:Scripting Commands ArmA|DOMOVE]]
}}
[[Category:Command_Group:_Unit_Control|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:34, 3 September 2024

Hover & click on the images for description

Description

Description:
Order the given unit(s) to move to the given position (without radio messages). Upon reaching its destination, if it is the group leader it will order the group to form around it's new position. If it is not the leader, it will immediately be ordered to return to formation by the group leader and begin moving back to the group. Use doStop to stop units returning to formation. moveToCompleted will return true when a unit issued this command reaches its destination.
Groups:
Unit Control

Syntax

Syntax:
unit(s) doMove position
Parameters:
unit(s): Object or Array
position: Array format Position
Return Value:
Nothing

Examples

Example 1:
_soldier1 doMove (position _officer);
Example 2:
this doMove (getMarkerPos "Marker1");

Additional Information

See also:
commandMove setDestination moveTo move addWaypoint

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 2008-02-09
Kronzky
If doMove is to be used in conjunction with waypoint behavior commands (e.g. setSpeedMode), then those have to be issued after the move command to have an effect. Otherwise the move will be done with the default settings.
Posted on 2009-02-03
General Barron
If a unit is part of a group, and is not the leader, the unit will fall back into formation soon after the domove is completed. This does not happen for units that are in a group alone (because they are their own leader). There is no single command to get a unit to move to a position and stay there. The best way to do this is to issue a domove, then wait for the unit to reach his destination, then disable his movement AI.
DreadedEntity - c
Posted on Apr 02, 2022 - 15:22 (UTC)
The above note is only true of units which group leader is not the player. Player-squad will remain in position until given another order (A3 v2.08.149102)
DreadedEntity - c
Posted on Apr 02, 2022 - 20:35 (UTC)
If you need your script to halt until the unit has reached it's destination, waitUntil and moveToCompleted will come in handy:
_unit doMove _pos; waitUntil {moveToCompleted _unit};
This also works with commandMove
Waffle SS. - c
Posted on Jul 25, 2022 - 06:25 (UTC)
Seems to use PositionATL, which may be important if the destination is above a building's 1st floor.