DIFF

class Transport

Transport › Pawn › EntityAI › Entity › ObjectTyped › Object › IEntity › Managed

Base class depends on build flags: PawnFEATURE_NETWORK_RECONCILIATION · EntityAI!FEATURE_NETWORK_RECONCILIATION

Constructors 2

void ~Transport()
References CleanupEffects()

Members 25

private static ref VehicleFlippedContext m_FlippedContext

Shared context across all vehicles for flipping

Referenced by GetFlipContext()
ref TIntArray m_SingleUseActions
ref TIntArray m_ContinuousActions
ref TIntArray m_InteractActions
protected bool m_EngineDestroyed
Referenced by CarScript.EEKilled()
protected bool m_EngineZoneReceivedHit
protected vector m_fuelPos
protected ref set<int> m_UnconsciousCrewMemberIndices
Referenced by Transport()
protected ref set<int> m_DeadCrewMemberIndices
Referenced by Transport()
protected float m_dmgContactCoef = 0.023
protected ref VehicleContactData m_ContactData

Methods 114

override void EEDelete(EntityAI parent)
References CleanupEffects()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Referenced by BoatScript.EEHitBy()
override int GetMeleeTargetType()
protected override event typename GetOwnerStateType()
protected override event typename GetMoveType()
proto native void Synchronize()

Synchronizes car's state in case the simulation is not running.

proto native bool HasCrew()

Returns true if at least one member of crew is present.

proto native int CrewPositionIndex(int componentIdx)

Returns crew member index based on action component index. -1 is returned when no crew position corresponds to given component index.

proto void CrewEntry(int posIdx, out vector pos, out vector dir)

Reads entry point and direction into vehicle on given position in model space.

Referenced by IsAreaAtDoorFree()
proto void CrewEntryWS(int posIdx, out vector pos, out vector dir)

Reads entry point and direction into vehicle on given position in world space.

proto void CrewTransform(int posIdx, out vector mat[4])

Returns crew transformation indside vehicle in model space

proto void CrewTransformWS(int posIdx, out vector mat[4])

Returns crew transformation indside vehicle in world space

proto native void CrewGetIn(Human player, int posIdx)

Performs transfer of player from world into vehicle on given position.

proto native Human CrewGetOut(int posIdx)

Performs transfer of player from vehicle into world from given position.

proto native void CrewDeath(int posIdx)

Handles death of player in vehicle and awakes its physics if needed

void OnDriverEnter(Human player)

Is called when the crew member enters the driver seat

in player
The player that entered the driver seat
void OnDriverExit(Human player)

Is called when the crew member leaves the driver seat

in player
The player that left the driver seat
proto native void LightOn()

Signals for LightIsOn to return true

proto native void LightOff()

Signals for LightIsOn to return false

proto native void LightToggle()

Calls LightOn/LightOff depending on current light state

bool OnBeforeLightOn()

Is called by native every time the game wants to turn on the light

Returns: true if the light can turn on, false otherwise.

void OnUpdateLight()

Is called by native every time the game wants to update the light

References UpdateLights()
proto void ApplyForce(vector force)

Applies constant force on the physics body (at origin).

proto void ApplyTorque(vector force)

Applies constant torque on the physics body.

proto void ApplyForceAt(vector pos, vector force)

Applies constant force on the physics body at a position (world space coordinates).

proto void ApplyCentralImpulse(vector centralImpulse)

Applies impulse on the physics body (at origin).

proto void ApplyTorqueImpulse(vector torqueImpulse)

Applies impulse torque on the physics body.

proto void ApplyImpulseAt(vector pos, vector force)

Applies impulse on the physics body at a position (world space coordinates).

proto native int Random()

Random number in range of <0,0xffffffff> - !!! use this only during deterministic simulation (EOnSimulate/EOnPostSimulate)

Returns: int value in range of <0,0xffffffff>

proto native float RandomRange(int pRange)

Random number in range of <0,pRange-1> - !!! use this only during deterministic simulation (EOnSimulate/EOnPostSimulate)

pRange
upper bounds of random number

Returns: int value in range of <0,pRange-1>

proto native float Random01()

Random number in range of <0,1> - !!! use this only during deterministic simulation (EOnSimulate/EOnPostSimulate)

Returns: float value in range of <0,1>

Referenced by RandomFloat()
float RandomFloat(float min, float max)

Random number in range of <min,max> - !!! use this only during deterministic simulation (EOnSimulate/EOnPostSimulate)

Returns: float value in range of <min,max>

References Random01()
void OnContact(string zoneName, vector localPos, IEntity other, Contact data)

Is called every time when vehicle collides with other object.

in zoneName
configured vehicle's zone that was hit
in localPos
position where the vehicle was hit in vehicle's space
in other
object with which the vehicle is colliding
in data
contact properties
void OnInput(float dt)

Called after every input simulation step.

Note that the player character and other systems can always change the internal state. It is highly recommended to store state of custom inputs elsewhere and call Setters here.

in dt
delta time since last called in seconds
void OnUpdate(float dt)

Is called every game frame on client, fixed rate on server

in dt
delta time since last called in seconds
void UpdateLights(int new_gear = -1)
Referenced by OnUpdateLight()
override bool IsTransport()
override bool IsDetectableByVicinityCone()
override bool IsIgnoredByConstruction()
override bool IsHealthVisible()
override bool ShowZonesHealth()
override int GetHideIconMask()
override bool CanPutIntoHands(EntityAI parent)
protected void CheckVitalItemCallback(bool isVital, int slotId, Object caller = null, string callbackMethodName = "", Param params = null)
protected void PartsHealthCheck()
int GetFluidCapacityScript(ETransportFluid fluidType)

fluids

float GetFluidFractionScript(ETransportFluid fluidType)
void FillScript(ETransportFluid fluidType, float amount)
void UpdateBattery(IEntity battery)
string GetVehicleType()
string GetActionCompNameFuel()
float GetWeightCoef()

artificial value that helps to distinguish between different weight categories (mainly for particles)

protected EffectSound CreateSoundForAnimationSource(string animSource)
protected bool DetectFlipped(VehicleFlippedContext ctx)

Override based on vehicle implementation (Car, Boat, modded, etc.)

Referenced by IsActionFlipped(), and IsFlipped()
bool IsFlipped()

Don't override, may change to native for caching 'DetectFlipped' in the future based on active-ness (i.e. only updated when vehicle changes active state)

bool IsActionFlipped(Man player)

Don't override, may change to native for caching 'DetectFlipped' in the future based on active-ness (i.e. only updated when vehicle changes active state)

bool IsAnyCrewPresent()
References CrewMember(), and CrewSize()
bool IsAnyCrewPresent(TIntArray positionIndices)
References array.Copy(), CrewMember(), CrewSize()
Show 2 more, array.Insert(), and new TIntArray()
void MarkCrewMemberUnconscious(int crewMemberIndex)
void MarkCrewMemberDead(int crewMemberIndex)
int GetAnimInstance()
References Error()
bool HasDirectionalInOutAction()
int GetSeatAnimationTypeDirectional(int posIdx, int directionIndex)
References Error()
int Get3rdPersonCameraType()
References Error()
bool CrewCanEject(int posIdx)

Called from native

bool CrewShouldEject(int posIdx)

Called from native

bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance = 1.0)
bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
int GetSeatIndexFromDoor(string pDoorSelection)
void SetEngineZoneReceivedHit(bool pState)

Ignore any player that is currently in this vehicle

bool IsMoving()
References Error()
string GetElectricitySourceDeviceType()
Managed GetVehicleHornComponent()

component helpers

bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7)
bool IsAreaAtDoorFreeDiag(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
bool IsAreaAtDoorFreeDiag(int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7)
protected void SynchCrashLightSound(bool play)
protected void SynchCrashHeavySound(bool play)
protected void PlayCrashLightSound()
protected void PlayCrashHeavySound()
void PlaySound(string soundset, EffectSound sound, out bool soundbool)
References PlaySoundEx()
Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7)
References ARGB(), Debug.DrawBox(), IsAreaAtDoorFree()
Show 1 more, Shape.SetMatrix()