setWaypointPosition: Difference between revisions
Jump to navigation
Jump to search
m (Replaced <code> with <sqf>) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 22: | Line 22: | ||
|descr= Attempts to move given waypoint to a random position inside a circle with the given center and radius. | |descr= 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 {{hl|"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 {{hl|"CAN_COLLIDE"}} attribute, use a negative radius (see {{Link|#Example 2}}). | |||
The waypoint will be placed similar to {{hl|"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 {{hl|"CAN_COLLIDE"}} attribute, use negative radius | |||
{{ | |||
|s1= waypoint [[setWaypointPosition]] [center, radius] | |s1= waypoint [[setWaypointPosition]] [center, radius] | ||
|p1= waypoint: [[Array]] - format [[Waypoint]] | |p1= waypoint: [[Array]] - format [[Waypoint]] | ||
|p2= | |||
|p2= center: [[Object]] or [[Array]] format [[Position#PositionAGL|PositionAGL]] or [[Array]] format [[Position#PositionASL|PositionASL]] if ''radius'' is negative | |||
| | |||
|p3= radius: [[Number]] - random placement radius in meters. Set it to -1 and convert center to [[Position#PositionASL|PositionASL]] for the exact center placement | |||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf>[_grp, 2] setWaypointPosition [position player, 0];</sqf> | |x1= <sqf>[_grp, 2] setWaypointPosition [position player, 0];</sqf> | ||
|x2= Exact placement | |||
|x2= Exact placement using a negative ''radius'' and [[Position#PositionASL|PositionASL]]: | |||
<sqf>_wp setWaypointPosition [getPosASL player, -1];</sqf> | <sqf>_wp setWaypointPosition [getPosASL player, -1];</sqf> | ||
Line 42: | Line 42: | ||
}} | }} | ||
{{Note | |||
|user= Killzone_Kid | |||
|timestamp= 20181114225200 | |||
|text= If you want AI to understand height of the waypoint, for example set waypoint at the top of Military Cargo Tower, use {{Link|#Example 2}} with position in ASL format and -1 radius. | |||
}} | |||
Latest revision as of 18:09, 15 August 2022
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 a negative radius (see Example 2).
- Groups:
- Waypoints
Syntax
- Syntax:
- waypoint setWaypointPosition [center, radius]
- Parameters:
- waypoint: Array - format Waypoint
- center: Object or Array format PositionAGL or Array format PositionASL if 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:
- Example 2:
- Exact placement using a negative radius and PositionASL:
Additional Information
- See also:
- waypointPosition setWPPos waypoints deleteWaypoint copyWaypoints setCurrentWaypoint setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription setWaypointFormation setWaypointHousePosition setWaypointScript setWaypointSpeed setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible waypointAttachVehicle waypointAttachedVehicle setWaypointLoiterRadius waypointLoiterRadius addWaypoint setWaypointLoiterType waypointSpeed
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
- Posted on Nov 14, 2018 - 22:52 (UTC)
- If you want AI to understand height of the waypoint, for example set waypoint at the top of Military Cargo Tower, use Example 2 with position in ASL format and -1 radius.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Waypoints