Player::taskHeliMission: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Needs more research.<br><br>Default value of p13 is -1.0 or 0xBF800000.<br>Default value of p14 is 0.<br><br>Modified examples from 'fm_mission_controller.ysc', line ~203551:<br>Player::TASK_HELI_MISSION(ped, vehicle, 0, 0, posX, posY, posZ, 4, 1.0, -1.0, -1.0, 10, 10, 5.0, 0);<br>Player::TASK_HELI_MISSION(ped, vehicle, 0, 0, posX, posY, posZ, 4, 1.0, -1.0, -1.0, 0, ?, 5.0, 4096);<br><br>int mode seams to set mission type 4 = coords target, 23 = ped target.<br>int 14 set to 32 = ped will land at destination.<br><br>My findings:<br>mode 4 or 7 forces heli to snap to the heading set<br>8 makes the heli flee from the player.<br>9 circles around ped with angle set<br>10, 11 normal + imitate ped heading<br>20 makes the heli land when he's near the player. It won't resume chasing.<br>21 emulates an helicopter crash<br>23 makes the heli circle erratically around ped<br><br>I change p2 to 'vehicleToFollow' as it seems to work like the task natives to set targets. In the heli_taxi script where as the merryweather heli takes you to your waypoint it has no need to follow a vehicle or a ped, so of course both have 0 set.
 
==Syntax==
 
<syntaxhighlight lang="javascript">player.taskHeliMission(vehicle, p2, pedToFollow, posX, posY, posZ, mode, speed, radius, angle, p11, height, p13, p14);</syntaxhighlight>
{{ClientsideJsFunction}}
 
__NOTOC__
 
{{JSContainer|
 
 
== Mission Types ==
<pre>
* MISSION_NONE = 0,               // 0
* MISSION_CRUISE,                 // 1
* MISSION_RAM,                   // 2
* MISSION_BLOCK,                 // 3
* MISSION_GOTO,                   // 4
* MISSION_STOP,                   // 5
* MISSION_ATTACK,                 // 6
* MISSION_FOLLOW,                 // 7
* MISSION_FLEE,                   // 8
* MISSION_CIRCLE,                 // 9
* MISSION_ESCORT_LEFT,           // 10
* MISSION_ESCORT_RIGHT,           // 11
* MISSION_ESCORT_REAR,           // 12
* MISSION_ESCORT_FRONT,           // 13
* MISSION_GOTO_RACING,           // 14
* MISSION_FOLLOW_RECORDING,       // 15
* MISSION_POLICE_BEHAVIOUR,       // 16
* MISSION_PARK_PERPENDICULAR,     // 17
* MISSION_PARK_PARALLEL,         // 18
* MISSION_LAND,                   // 19
* MISSION_LAND_AND_WAIT,         // 20
* MISSION_CRASH,                 // 21
* MISSION_PULL_OVER,               // 22
* MISSION_PROTECT // 23
</pre>
 
== Flags ==
<pre>
NONE = 0
AttainRequestedOrientation = 1
DontModifyOrientation = 2
DontModifyPitch = 4
DontModifyThrottle = 8
DontModifyRoll = 16
LandOnArrival = 32
DontDoAvoidance = 64
StartEngineImmediately = 128
ForceHeightMapAvoidance = 256
HEIGHTMAPONLYAVOIDANCE = 320
DontClampProbesToDestination = 512
EnableTimeslicingWhenPossible = 1024
CircleOppositeDirection = 2048
MaintainHeightAboveTerrain = 4096
IgnoreHiddenEntitiesDuringLand = 8192
DisableAllHeightMapAvoidance = 16384
</pre>
=== Required Arguments ===
=== Required Arguments ===
*'''vehicle:''' Vehicle handle or object
*'''vehicle:''' Vehicle handle
*'''p2:''' unknown (to be checked)
*'''pedToFollow:''' Ped handle to follow
*'''pedToFollow:''' Ped handle or object
*'''posX:''' {{RageType|float}}
*'''posX:''' float
*'''posY:''' {{RageType|float}}
*'''posY:''' float
*'''posZ:''' {{RageType|float}}
*'''posZ:''' float
*'''mission:''' {{RageType|int}}
*'''mode:''' int
*'''cruisespeed:''' {{RageType|float}}
*'''speed:''' float
*'''radius:''' {{RageType|float}}
*'''radius:''' float
*'''heliOrientation:''' {{RageType|float}}
*'''angle:''' float
*'''flightHeight:''' {{RageType|int}}
*'''p11:''' int
*'''minHeightAboveGround:''' {{RageType|int}}
*'''height:''' int
*'''slowDownDistance:''' {{RageType|float}}
*'''p13:''' float
*'''flag:''' {{RageType|int}}
*'''p14:''' int
 
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
== Syntax ==
<pre>
entity.taskHeliMission(vehicle, targetPed, posX, posY, posZ, mission, cruisespeed, radius, heliOrientation, flightHeight, minHeightAboveGround, slowDownDistance, flag);
</pre>
==Example==
==Example==
<syntaxhighlight lang="javascript">
<pre>
// todo
// Makes the helicopter pilot land on destination (X: 2113.1481, Y: 4799.7558, Z: 41.1516)
</syntaxhighlight>
heliPed.taskHeliMission(heli.handle, 0, 0, 2113.1481, 4799.7558, 41.1516, 20, 1.0, 5, -1.0, 10, 0, 5.0, 32);
</pre>
 
}}
 
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 18:47, 4 March 2024


Client-Side
Function

 JavaScript




JavaScript Syntax


Mission Types

* MISSION_NONE = 0,               // 0
* MISSION_CRUISE,                 // 1
* MISSION_RAM,                    // 2
* MISSION_BLOCK,                  // 3
* MISSION_GOTO,                   // 4
* MISSION_STOP,                   // 5
* MISSION_ATTACK,                 // 6
* MISSION_FOLLOW,                 // 7
* MISSION_FLEE,                   // 8
* MISSION_CIRCLE,                 // 9
* MISSION_ESCORT_LEFT,            // 10
* MISSION_ESCORT_RIGHT,           // 11
* MISSION_ESCORT_REAR,            // 12
* MISSION_ESCORT_FRONT,           // 13
* MISSION_GOTO_RACING,            // 14
* MISSION_FOLLOW_RECORDING,       // 15
* MISSION_POLICE_BEHAVIOUR,       // 16
* MISSION_PARK_PERPENDICULAR,     // 17
* MISSION_PARK_PARALLEL,          // 18
* MISSION_LAND,                   // 19
* MISSION_LAND_AND_WAIT,          // 20
* MISSION_CRASH,                  // 21
* MISSION_PULL_OVER,               // 22
* MISSION_PROTECT					// 23

Flags

NONE = 0
AttainRequestedOrientation = 1
DontModifyOrientation = 2
DontModifyPitch = 4
DontModifyThrottle = 8
DontModifyRoll = 16
LandOnArrival = 32
DontDoAvoidance = 64
StartEngineImmediately = 128
ForceHeightMapAvoidance = 256
HEIGHTMAPONLYAVOIDANCE = 320
DontClampProbesToDestination = 512
EnableTimeslicingWhenPossible = 1024
CircleOppositeDirection = 2048
MaintainHeightAboveTerrain = 4096
IgnoreHiddenEntitiesDuringLand = 8192
DisableAllHeightMapAvoidance = 16384

Required Arguments

  • vehicle: Vehicle handle
  • pedToFollow: Ped handle to follow
  • posX: float
  • posY: float
  • posZ: float
  • mission: int
  • cruisespeed: float
  • radius: float
  • heliOrientation: float
  • flightHeight: int
  • minHeightAboveGround: int
  • slowDownDistance: float
  • flag: int

Return value

  • Undefined

Syntax

entity.taskHeliMission(vehicle, targetPed, posX, posY, posZ, mission, cruisespeed, radius, heliOrientation, flightHeight, minHeightAboveGround, slowDownDistance, flag);

Example

// Makes the helicopter pilot land on destination (X: 2113.1481, Y: 4799.7558, Z: 41.1516)
heliPed.taskHeliMission(heli.handle, 0, 0, 2113.1481, 4799.7558, 41.1516, 20, 1.0, 5, -1.0, 10, 0, 5.0, 32);



See also