deleteWaypoint: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
m (see also & note formate)
Line 24: Line 24:
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <pre>deleteWaypoint [_grp, 2]</pre> |= Example 1
|x1= <code>[[deleteWaypoint]] [_grp, 2]</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[waypoints]], [[copyWaypoints]], [[setCurrentWaypoint]], [[setWaypointBehaviour]], [[setWaypointCombatMode]], [[setWaypointCompletionRadius]], [[setWaypointDescription]], [[setWaypointFormation]], [[setWaypointHousePosition]], [[setWaypointPosition]], [[setWaypointScript]], [[setWaypointSpeed]], [[setWaypointStatements]], [[setWaypointTimeout]], [[setWaypointType]], [[setWaypointVisible]], [[waypointAttachVehicle]], [[waypointAttachedVehicle]], [[setWaypointLoiterRadius]], [[waypointLoiterRadius]], [[addWaypoint]], [[setWaypointLoiterType]] |= See also
| [[waypoints]], [[copyWaypoints]], [[setCurrentWaypoint]], [[setWaypointBehaviour]], [[setWaypointCombatMode]], [[setWaypointCompletionRadius]], [[setWaypointDescription]], [[setWaypointFormation]], [[setWaypointHousePosition]], [[setWaypointPosition]], [[setWaypointScript]], [[setWaypointSpeed]], [[setWaypointStatements]], [[setWaypointTimeout]], [[setWaypointType]], [[setWaypointVisible]], [[waypointAttachVehicle]], [[waypointAttachedVehicle]], [[setWaypointLoiterRadius]], [[waypointLoiterRadius]], [[addWaypoint]], [[setWaypointLoiterType]], [[waypointSpeed]], [[setWaypointSpeed]] |= See also


}}
}}
Line 38: Line 38:
<dd class="note">
<dd class="note">
In order to change the behavior of a unit currently following a string of waypoints, it is not enough to use deleteWaypoint. The path of the unit is calculated by the waypoints present at start, and the unit will continue according to the original waypoints even if you delete them by using this command.
In order to change the behavior of a unit currently following a string of waypoints, it is not enough to use deleteWaypoint. The path of the unit is calculated by the waypoints present at start, and the unit will continue according to the original waypoints even if you delete them by using this command.
To achieve the wanted effect, you should rather use setWPPos to the units current position (thereby stopping the unit), and (after a small delay) use deleteWaypoint to remove the waypoints.
To achieve the wanted effect, you should rather use setWPPos to the units current position (thereby stopping the unit), and (after a small delay) use [[deleteWaypoint]] to remove the [[waypoints]].


<dd class="notedate">Posted on 15 Nov, 2008 - 13:37
<dd class="notedate">Posted on 15 Nov, 2008 - 13:37
Line 44: Line 44:
<dd class="note">
<dd class="note">
Another (more foolproof) method to avoid the problem of non-deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. A new group will start without any preset waypoints so you can start setting new WPs all over again.
Another (more foolproof) method to avoid the problem of non-deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. A new group will start without any preset waypoints so you can start setting new WPs all over again.
Example:
Old group is "_combatGroup", new group is "_combatGroup2"
Old group is "_combatGroup", new group is "_combatGroup2"
<code>_combatGroup2 = createGroup EAST;
<code>_combatGroup2 = [[createGroup]] EAST;
{[_x] joinSilent _combatGroup2} forEach (units _combatGroup);
{[_x] [[joinSilent]] _combatGroup2} [[forEach]] ([[units]] _combatGroup);
_combatGroup2 addWaypoint [getPos player, 25];</code>
_combatGroup2 [[addWaypoint]] [ [[getPos]] [[player]], 25];</code>




Line 56: Line 55:
When you want to remove all waypoints, do '''NOT''' iterate over ''waypoints _group'' while trying to delete them (an array is by reference!). Instead use an approach like this:
When you want to remove all waypoints, do '''NOT''' iterate over ''waypoints _group'' while trying to delete them (an array is by reference!). Instead use an approach like this:
<code>
<code>
  while {(count (waypoints _group)) > 0} do
  [[while]] {([[count]] ([[waypoints]] _group)) > 0} [[do]]
  {
  {
   deleteWaypoint ((waypoints _group) select 0);
   [[deleteWaypoint]] (([[waypoints]] _group) [[select]] 0);
  };</code>
  };</code>


Line 65: Line 64:
<dd class="note">
<dd class="note">
You can also remove all waypoints with
You can also remove all waypoints with
<code>deleteWaypoint [_group, all];</code>
<code>[[deleteWaypoint]] [_group, all];</code>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 08:26, 3 August 2014

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Removes the specified waypoint.
Groups:
Uncategorised

Syntax

Syntax:
deleteWaypoint [group, index]
Parameters:
[group, index]: Array
group: Group
index: Number
Return Value:
Nothing

Examples

Example 1:
deleteWaypoint [_grp, 2]

Additional Information

See also:
waypointscopyWaypointssetCurrentWaypointsetWaypointBehavioursetWaypointCombatModesetWaypointCompletionRadiussetWaypointDescriptionsetWaypointFormationsetWaypointHousePositionsetWaypointPositionsetWaypointScriptsetWaypointSpeedsetWaypointStatementssetWaypointTimeoutsetWaypointTypesetWaypointVisiblewaypointAttachVehiclewaypointAttachedVehiclesetWaypointLoiterRadiuswaypointLoiterRadiusaddWaypointsetWaypointLoiterTypewaypointSpeedsetWaypointSpeed

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

Posted on 1 Feb, 2008 - 07:48
Saintolaf
In order to change the behavior of a unit currently following a string of waypoints, it is not enough to use deleteWaypoint. The path of the unit is calculated by the waypoints present at start, and the unit will continue according to the original waypoints even if you delete them by using this command. To achieve the wanted effect, you should rather use setWPPos to the units current position (thereby stopping the unit), and (after a small delay) use deleteWaypoint to remove the waypoints.
Posted on 15 Nov, 2008 - 13:37
VictorFarbau
Another (more foolproof) method to avoid the problem of non-deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. A new group will start without any preset waypoints so you can start setting new WPs all over again. Old group is "_combatGroup", new group is "_combatGroup2" _combatGroup2 = createGroup EAST; {[_x] joinSilent _combatGroup2} forEach (units _combatGroup); _combatGroup2 addWaypoint [ getPos player, 25];
Posted on January 04, 2011
kju
When you want to remove all waypoints, do NOT iterate over waypoints _group while trying to delete them (an array is by reference!). Instead use an approach like this: while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); };
Posted on 13 Mar, 2012 - 10:51
ArmAriffic
You can also remove all waypoints with deleteWaypoint [_group, all];

Bottom Section