deleteWaypoint: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma1 | | arma1 | ||
|1.00 | |1.00 | ||
|arg= global | |arg= global | ||
|eff= global | |eff= global | ||
|gr1= Waypoints | |gr1= Waypoints | ||
| Removes the specified waypoint. | | Removes the specified waypoint. | ||
{{Informative | | {{Informative | | ||
* When a waypoint is deleted, all other [[group]] [[waypoints]] are immediately re-indexed. See '''[[#Examples|Example 2]]''' for a deletion of all group's waypoints. | * When a waypoint is deleted, all other [[group]] [[waypoints]] are immediately re-indexed. See '''[[#Examples|Example 2]]''' for a deletion of all group's waypoints. | ||
* Deleting a group's [[currentWaypoint|current waypoint]] will ''not'' stop the group on its tracks.}} | * Deleting a group's [[currentWaypoint|current waypoint]] will ''not'' stop the group on its tracks.}} | ||
| [[deleteWaypoint]] [group, index] | | [[deleteWaypoint]] [group, index] | ||
|p1= [group, index]: [[Array]] | |p1= [group, index]: [[Array]] | ||
|p2= group: [[Group]] | |p2= group: [[Group]] | ||
|p3= index: [[Number]] | |p3= index: [[Number]] | ||
| [[Nothing]] | | [[Nothing]] | ||
|x1= <code>[[deleteWaypoint]] [_grp, 2];</code> | |x1= <code>[[deleteWaypoint]] [_grp, 2];</code> | ||
|x2= Because waypoints get immediately re-indexed when one gets deleted, delete them from last to first: | |x2= Because waypoints get immediately re-indexed when one gets deleted, delete them from last to first: | ||
Line 33: | Line 33: | ||
{ | { | ||
[[deleteWaypoint]] [_group, _i]; | [[deleteWaypoint]] [_group, _i]; | ||
};</code> | };</code> | ||
| [[waypoints]], [[copyWaypoints]], [[setCurrentWaypoint]], [[setWaypointBehaviour]], [[setWaypointCombatMode]], [[setWaypointCompletionRadius]], [[setWaypointDescription]], [[setWaypointFormation]], [[setWaypointHousePosition]], [[setWaypointPosition]], [[setWaypointScript]], [[setWaypointSpeed]], [[setWaypointStatements]], [[setWaypointTimeout]], [[setWaypointType]], [[setWaypointVisible]], [[waypointAttachVehicle]], [[waypointAttachedVehicle]], [[setWaypointLoiterRadius]], [[waypointLoiterRadius]], [[addWaypoint]], [[setWaypointLoiterType]], [[waypointSpeed]] | | [[waypoints]], [[copyWaypoints]], [[setCurrentWaypoint]], [[setWaypointBehaviour]], [[setWaypointCombatMode]], [[setWaypointCompletionRadius]], [[setWaypointDescription]], [[setWaypointFormation]], [[setWaypointHousePosition]], [[setWaypointPosition]], [[setWaypointScript]], [[setWaypointSpeed]], [[setWaypointStatements]], [[setWaypointTimeout]], [[setWaypointType]], [[setWaypointVisible]], [[waypointAttachVehicle]], [[waypointAttachedVehicle]], [[setWaypointLoiterRadius]], [[waypointLoiterRadius]], [[addWaypoint]], [[setWaypointLoiterType]], [[waypointSpeed]] | ||
}} | }} | ||
Revision as of 00:30, 18 January 2021
Description
- Description:
- Removes the specified waypoint.
- Groups:
- Waypoints
Syntax
- Syntax:
- deleteWaypoint [group, index]
- Parameters:
- [group, index]: Array
- group: Group
- index: Number
- Return Value:
- Nothing
Examples
- Example 1:
deleteWaypoint [_grp, 2];
- Example 2:
- Because waypoints get immediately re-indexed when one gets deleted, delete them from last to first:
private _group = group _unit; for "_i" from count waypoints _group - 1 to 0 step -1 do { deleteWaypoint [_group, _i]; };
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 some waypoints, it is not enough to use deleteWaypoint. To achieve the wanted effect, you should rather use setWPPos to the unit's current position (thereby stopping the unit), and (after a small delay) use deleteWaypoint to remove the next 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];
Bottom Section
- Posted on November 17, 2019 - 16:52 (UTC)
- Mr H.
-
To have the unit stop on the spot you need to set its current waypoint where it is and add a little delay, as stated above by Saintolaf so:
group _unit spawn { [_this, (currentWaypoint _this)] setWaypointPosition [getPosASL ((units _this) select 0), -1]; sleep 0.1; for "_i" from count waypoints _this - 1 to 0 step -1 do { deleteWaypoint [_this, _i]; }; };
Will stop the group where it is and delete its waypoints.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Command Group: Waypoints
- Scripting Commands: Global Effect
- Operation Flashpoint: Elite: Scripting Commands
- Arma 2: Scripting Commands
- Arma 3: Scripting Commands
- Take On Helicopters: Scripting Commands