Difference between revisions of "StartHelicopterBhv"

From Nomad DB
m (fixed "previoulsly"... seriuously?)
Line 1: Line 1:
Starts the specified behavior on a helicopter. Possible usage scenarios are letting the helicopter fly a specific path or follow a specific entity.
+
Starts the specified behavior on a helicopter to either follow a path, fly to an [[Entity|entity]] or chase a [[Pawn|pawn]].
  
 
== Syntax ==
 
== Syntax ==
Line 5: Line 5:
 
StartHelicopterBhv(helicopterEntity, pathOrPos, target, config)
 
StartHelicopterBhv(helicopterEntity, pathOrPos, target, config)
 
</syntaxhighlight>
 
</syntaxhighlight>
* '''helicopterEntity''' (string): The [[EntityId|ID]] of the helicopter the behavior should be started on
+
* '''helicopterEntity''' (string): The [[EntityId|ID]] of the target helicopter the behavior should be started on
* '''pathOrPos''' (string): The [[EntityId|ID]] of the path to use or the entity to reach
+
* '''pathOrPos''' (string): The [[EntityId|ID]] of the path to follow or the entity to reach
* '''target''' (string): The [[EntityId|ID]] of the entity the helicopter should follow
+
* '''target''' (string): The [[EntityId|ID]] of the pawn to follow (if a chase behavior was specified)
* '''config''' (string): Helicopter behavior ID that should be used, taken from HelicopterBhvSetup.lib
+
* '''config''' (string): The behavior to use on the helicopter (corresponds to an item in the '''HelicopterBhvSetup''' library)
  
 
== Example ==
 
== Example ==
Make a previoulsly spawned helicopter follow the player around.
+
Make a previously spawned helicopter follow the player around.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
StartHelicopterBhv(helicopterEntityId, GetInvalidEntityId(), GetLocalPlayerEntityId(), "HelicopterBhvSetup.1978142222")
 
StartHelicopterBhv(helicopterEntityId, GetInvalidEntityId(), GetLocalPlayerEntityId(), "HelicopterBhvSetup.1978142222")
-- To stop the heli following you around
+
</syntaxhighlight>
 +
 
 +
Stop the helicopter from following the player.
 +
<syntaxhighlight lang="lua">
 
StopHelicopterBhv(helicopterEntityId)
 
StopHelicopterBhv(helicopterEntityId)
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 16:49, 15 April 2020

Starts the specified behavior on a helicopter to either follow a path, fly to an entity or chase a pawn.

Syntax

StartHelicopterBhv(helicopterEntity, pathOrPos, target, config)
  • helicopterEntity (string): The ID of the target helicopter the behavior should be started on
  • pathOrPos (string): The ID of the path to follow or the entity to reach
  • target (string): The ID of the pawn to follow (if a chase behavior was specified)
  • config (string): The behavior to use on the helicopter (corresponds to an item in the HelicopterBhvSetup library)

Example

Make a previously spawned helicopter follow the player around.

StartHelicopterBhv(helicopterEntityId, GetInvalidEntityId(), GetLocalPlayerEntityId(), "HelicopterBhvSetup.1978142222")

Stop the helicopter from following the player.

StopHelicopterBhv(helicopterEntityId)

Related Pages