calculatePath: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Fix syntax and add Example 2) |
||
Line 16: | Line 16: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| calculatePath [startCoordinates, endCoordinates | | calculatePath [typeName, behaviour, startCoordinates, endCoordinates] |Syntax= | ||
|p1= | |p1= typeName: [[String]] - Vehicle type to simulate. One of ("helicopter", "plane", "man", "car', "wheeled_APC", "tank", "boat") |Parameter 1= | ||
|p2= | |p2= behavior: [[String]] - AI behaviour. one of ("CARELESS", "SAFE", "AWARE", "COMBAT" and "STEALTH") |Parameter 2= | ||
|p3= | |p3= startCoordinates: [[Array]] - Start position in [x,y,z] |Parameter 3= | ||
|p4= | |p4= endCoordinates: [[Array]] - End position in [x,y,z] |Parameter 4= | ||
| [[Object]] - Agent to add the PathCalculated eventhandler to. |Return Value= | | [[Object]] - Agent to add the PathCalculated eventhandler to. |Return Value= | ||
Line 30: | Line 30: | ||
|x1= <code>calculatePath ["car","safe",[2150.67,5778.19,0],[2184.11,5802.28,0]]</code> |Example 1= | |x1= <code>calculatePath ["car","safe",[2150.67,5778.19,0],[2184.11,5802.28,0]]</code> |Example 1= | ||
|x2= Draws the path from South West to North East of Agia Marina:<code>(calculatepath ["man","safe",[2832.9,5927.79,0],[3107.46,6036.61,0]]) addEventHandler ["PathCalculated",{ | |||
{ | |||
_mrk = createMarker ["marker" + str _forEachIndex, _x]; | |||
_mrk setMarkerType "mil_dot"; | |||
_mrk setMarkerText str _forEachIndex; | |||
} forEach (_this#1); | |||
}]</code> |Example 2= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 07:49, 20 April 2019
Description
- Description:
- Spawns an agent that will execute a AI path calculation and fire the PathCalculated eventhandler.
- Multiplayer:
- -
- Groups:
- Uncategorised
Syntax
- Syntax:
- calculatePath [typeName, behaviour, startCoordinates, endCoordinates]
- Parameters:
- typeName: String - Vehicle type to simulate. One of ("helicopter", "plane", "man", "car', "wheeled_APC", "tank", "boat")
- behavior: String - AI behaviour. one of ("CARELESS", "SAFE", "AWARE", "COMBAT" and "STEALTH")
- startCoordinates: Array - Start position in [x,y,z]
- endCoordinates: Array - End position in [x,y,z]
- Return Value:
- Object - Agent to add the PathCalculated eventhandler to.
Examples
- Example 1:
calculatePath ["car","safe",[2150.67,5778.19,0],[2184.11,5802.28,0]]
- Example 2:
- Draws the path from South West to North East of Agia Marina:
(calculatepath ["man","safe",[2832.9,5927.79,0],[3107.46,6036.61,0]]) addEventHandler ["PathCalculated",{ { _mrk = createMarker ["marker" + str _forEachIndex, _x]; _mrk setMarkerType "mil_dot"; _mrk setMarkerText str _forEachIndex; } forEach (_this#1); }]
Additional Information
- See also:
- setDriveOnPath
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
[[Category:Introduced with arma3dev version 1.93]][[ Category: arma3dev: New Scripting Commands | CALCULATEPATH]][[ Category: arma3dev: Scripting Commands | CALCULATEPATH]]