deleteWaypoint: Difference between revisions
Jump to navigation
Jump to search
m (duplicated) |
No edit summary |
||
Line 77: | Line 77: | ||
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Command_Group:_Waypoints|{{uc:{{PAGENAME}}}}]] | [[Category:Command_Group:_Waypoints|{{uc:{{PAGENAME}}}}]] | ||
Another way to delete all exist waypoints...<br/> | |||
deleteWaypoint [_mygroup, 0]; //will delete only the first Waypoint, then waypoint 1==0, waypoint 2==1 etc.<br/> | |||
<br/> | |||
deleteWaypoint [_mygroup, 1]; //will delete only the third Waypoint, then waypoint 0==0, waypoint 2==1 etc.<br/> | |||
<br/> | |||
To delete all waypoints easy, delete the waypoints from last to the first, like:<br/> | |||
<br/> | |||
deleteWaypoint [_mygroup, 4]; <br/> | |||
deleteWaypoint [_mygroup, 3]; <br/> | |||
deleteWaypoint [_mygroup, 2];<br/> | |||
deleteWaypoint [_mygroup, 1];<br/> | |||
deleteWaypoint [_mygroup, 0];<br/> | |||
<br/> | |||
Returns, no Waypoints left, Unit move straight to last position order.<br/> | |||
Works fine in EditorMode, Multiplayer not tested!<br/> | |||
Arma III v1.44<br/> | |||
--[[User:Lightwolf|Lightwolf]] ([[User talk:Lightwolf|talk]]) 23:33, 12 May 2015 (CEST) |
Revision as of 22:33, 12 May 2015
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:
- waypointscopyWaypointssetCurrentWaypointsetWaypointBehavioursetWaypointCombatModesetWaypointCompletionRadiussetWaypointDescriptionsetWaypointFormationsetWaypointHousePositionsetWaypointPositionsetWaypointScriptsetWaypointSpeedsetWaypointStatementssetWaypointTimeoutsetWaypointTypesetWaypointVisiblewaypointAttachVehiclewaypointAttachedVehiclesetWaypointLoiterRadiuswaypointLoiterRadiusaddWaypointsetWaypointLoiterTypewaypointSpeed
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
Another way to delete all exist waypoints...
deleteWaypoint [_mygroup, 0]; //will delete only the first Waypoint, then waypoint 1==0, waypoint 2==1 etc.
deleteWaypoint [_mygroup, 1]; //will delete only the third Waypoint, then waypoint 0==0, waypoint 2==1 etc.
To delete all waypoints easy, delete the waypoints from last to the first, like:
deleteWaypoint [_mygroup, 4];
deleteWaypoint [_mygroup, 3];
deleteWaypoint [_mygroup, 2];
deleteWaypoint [_mygroup, 1];
deleteWaypoint [_mygroup, 0];
Returns, no Waypoints left, Unit move straight to last position order.
Works fine in EditorMode, Multiplayer not tested!
Arma III v1.44
--Lightwolf (talk) 23:33, 12 May 2015 (CEST)
Categories:
- Scripting Commands
- Introduced with Arma version 1.00
- Arma: New Scripting Commands
- Arma: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands: Global Effect
- Scripting Commands OFP Elite
- Scripting Commands ArmA
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters
- Command Group: Waypoints