setWaypointPosition: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Killzone Kid (talk | contribs) (exact placement requires positionASL, wouldn't be Arma, would it?) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | Attempts to move given waypoint to a random position inside a circle with the given center and radius. The waypoint will be placed similar to "NONE" attribute in [[setVehiclePosition]], even if the radius is 0, which means it could still be off center. In order to force waypoint to the exact position, similar to "CAN_COLLIDE" attribute, use negative radius, like -1 for example. You will probably will laugh at this, but be warned: | ||
{{ Warning | When using negative radius, the center position supplied must be [[PositionASL]] }}|= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 14: | Line 15: | ||
|p1= waypoint: [[Array]] - format [[Waypoint]] |= Parameter 1 | |p1= waypoint: [[Array]] - format [[Waypoint]] |= Parameter 1 | ||
|p2= [center, radius]: [[Array]] |= Parameter 2 | |p2= [center, radius]: [[Array]] |= Parameter 2 | ||
|p3= center: [[Array]] - format [[Position]] |= Parameter 3 | |p3= center: [[Array]] - format [[Position]] (or [[PositionASL]] if the radius is negative) |= Parameter 3 | ||
|p4= radius: [[Number]] meters |= Parameter 4 | |p4= radius: [[Number]] - random placement radius in meters. Set it to -1 and convert center to [[PositionASL]] for the exact center placement. |= Parameter 4 | ||
| [[Nothing]] |= Return value | | [[Nothing]] |= Return value | ||
Line 21: | Line 22: | ||
|x1= <code>[_grp, 2] [[setWaypointPosition]] <nowiki>[</nowiki>[[position]] [[player]], 0];</code> |= Example 1 | |x1= <code>[_grp, 2] [[setWaypointPosition]] <nowiki>[</nowiki>[[position]] [[player]], 0];</code> |= Example 1 | ||
|x2= <code>[_grp, 2] [[setWaypointPosition]] <nowiki>[</nowiki>[[ | |x2= Exact placement (see description): <code>[_grp, 2] [[setWaypointPosition]] <nowiki>[</nowiki>[[getPositionASL]] [[player]], -1];</code> |= Example 2 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 22:13, 14 November 2018
Description
- Description:
- Attempts to move given waypoint to a random position inside a circle with the given center and radius. The waypoint will be placed similar to "NONE" attribute in setVehiclePosition, even if the radius is 0, which means it could still be off center. In order to force waypoint to the exact position, similar to "CAN_COLLIDE" attribute, use negative radius, like -1 for example. You will probably will laugh at this, but be warned:
- Groups:
- Uncategorised
Syntax
- Syntax:
- waypoint setWaypointPosition [center, radius]
- Parameters:
- waypoint: Array - format Waypoint
- [center, radius]: Array
- center: Array - format Position (or PositionASL if the radius is negative)
- radius: Number - random placement radius in meters. Set it to -1 and convert center to PositionASL for the exact center placement.
- Return Value:
- Nothing
Examples
- Example 1:
[_grp, 2] setWaypointPosition [position player, 0];
- Example 2:
- Exact placement (see description):
[_grp, 2] setWaypointPosition [getPositionASL player, -1];
Additional Information
- See also:
- waypointsdeleteWaypointcopyWaypointssetCurrentWaypointsetWaypointBehavioursetWaypointCombatModesetWaypointCompletionRadiussetWaypointDescriptionsetWaypointFormationsetWaypointHousePositionsetWaypointScriptsetWaypointSpeedsetWaypointStatementssetWaypointTimeoutsetWaypointTypesetWaypointVisiblewaypointAttachVehiclewaypointAttachedVehiclesetWaypointLoiterRadiuswaypointLoiterRadiusaddWaypointsetWaypointLoiterTypewaypointSpeed
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