deleteWaypoint: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 31: Line 31:


To acchieve 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 acchieve 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.
----
[VictorFarbau]
The above method didn't work well for me. Another method to avoid the problem of non deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. The new group will have now preset waypoints and you can set new WPs there.
Example:
Old group is "_combatgroup", new group is "_combatgroup2"
============================================================
_combatGroup2 = creategroup EAST;
{[_x] joinSilent _combatGroup2} foreach (units _combatgroup);
=============================================================
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 01:39, 15 November 2008

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

Description

Description:
Removes the waypoint.
Groups:
Uncategorised

Syntax

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

Examples

Example 1:
deleteWaypoint [_grp, 2]

Additional Information

See also:
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

Notes

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 acchieve 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.

[VictorFarbau]

The above method didn't work well for me. Another method to avoid the problem of non deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. The new group will have now preset waypoints and you can set new WPs there.

Example: Old group is "_combatgroup", new group is "_combatgroup2"

================================================

_combatGroup2 = creategroup EAST; {[_x] joinSilent _combatGroup2} foreach (units _combatgroup);

=================================================

Bottom Section