Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_CompartmentAccessComponent Interface Reference
Inheritance diagram for SCR_CompartmentAccessComponent:
CompartmentAccessComponent GameComponent

Public Member Functions

ScriptInvoker GetOnCompartmentEntered (bool createNew=true)
 
ScriptInvoker GetOnCompartmentLeft (bool createNew=true)
 
OnPlayerEnterCompartment GetOnPlayerCompartmentEnter (bool createNew=true)
 
OnPlayerExitCompartment GetOnPlayerCompartmentExit (bool createNew=true)
 
override void OnCompartmentEntered (IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
 
override void OnCompartmentLeft (IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
 
void OnLifeStateChanged (ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
 
BaseCompartmentSlot FindFreeAndAccessibleCompartment (IEntity vehicle, ECompartmentType compartmentType, BaseCompartmentSlot customSlot=null)
 Find a compartment that is marked as accessible and not occupied by anyone.
 
bool MoveInVehicle (IEntity vehicle, ECompartmentType compartmentType, bool performWhenPaused=false, BaseCompartmentSlot customSlot=null)
 Move in vehicle to specified slot type.
 
bool MoveInVehicleAny (IEntity vehicle)
 Move in vehicle to any available slot.
 
void AskOwnerToGetOutFromVehicle (EGetOutType type, int doorInfoIndex, ECloseDoorAfterActions closeDoor, bool performWhenPaused, bool ejectOnTheSpot=false)
 Method used to ask the owner to leave the compartment.
 
IEntity GetVehicle ()
 Get vehicle this entity is in.
 
IEntity GetVehicle (out int compartmentID)
 
void ~SCR_CompartmentAccessComponent ()
 
- Public Member Functions inherited from CompartmentAccessComponent
proto external IEntity GetVehicleCompartmentManagerOwner ()
 
proto external BaseCompartmentSlot GetCompartment ()
 Returns the compartent we're in.
 
proto external BaseCompartmentSlot FindFreeCompartment (IEntity targetEntity, ECompartmentType compartmentType, bool useReserved=true)
 Returns the first free compartment of a given type on.
 
proto external BaseCompartmentSlot FindCompartmentReservedBy (IEntity targetEntity, IEntity reservedBy)
 
proto external bool IsInCompartment ()
 Returns true if we're inside a compartment.
 
proto external bool IsInCompartmentADS ()
 Returns true if we're inside a compartment with enabled ADS.
 
proto external bool IsTargetVehicleAccessible (IEntity targetEntity)
 Returns true if.
 
proto external bool GetInVehicle (IEntity vehicle, BaseCompartmentSlot compartment, bool forceTeleport, int doorInfoIndex, ECloseDoorAfterActions closeDoor, bool performWhenPaused)
 If force teleport, doorInfoIndex is ignored. closeDoor is still respected.
 
proto external bool GetOutVehicle (EGetOutType type, int doorInfoIndex, ECloseDoorAfterActions closeDoor, bool performWhenPaused)
 If force teleport, doorInfoIndex is used for the teleport position and closeDoor is ignored.
 
proto external bool GetOutVehicle_NoDoor (vector targetTransform[4], bool sendIntoRagdoll, bool performWhenPaused)
 Uses teleport - character is teleported to targetTransform, and door state will not be changed.
 
proto external void KickFromVehicle (int doorInfoIndex)
 Kick another character out.
 
proto external bool OpenDoor (IEntity vehicle, ECharacterDoorAnimType doorAnimType, int doorInfoIndex)
 Open door only.
 
proto external bool IsDoorFromAnotherVehicle (IEntity vehicle, int doorIndex)
 Checks if the door at doorIndex belongs to another vehicle.
 
proto external bool AreDoorsFromDifferentVehicle (IEntity vehicle, int doorIndex)
 Checks if the door at doorIndex belongs to another vehicle.
 
proto external bool CloseDoor (IEntity vehicle, ECharacterDoorAnimType doorAnimType, int doorInfoIndex)
 Close door only.
 
proto external void InterruptVehicleActionQueue (bool interruptCurrentAction, bool forced, bool replicate)
 Interrupt the get in/get out process.
 
proto external bool TurnOut (bool turnOut)
 Turn out/in from/to compartment if it has the option for it.
 
proto external bool CanGetInVehicle (IEntity targetEntity)
 Returns true if.
 
proto external IEntity GetOwner ()
 Returns the entity owning the component.
 
proto external bool CanGetInVehicleViaDoor (IEntity targetEntity, BaseCompartmentManagerComponent compartmentManagerCompartment, int doorInfoIndex)
 Returns true if.
 
proto external bool CanAccessDoor (IEntity targetEntity, BaseCompartmentManagerComponent compartmentManagerCompartment, int doorInfoIndex)
 Returns true if.
 
proto external bool IsGettingIn ()
 Returns true while getting in.
 
proto external bool IsGettingOut ()
 Returns true while getting out.
 
proto external bool CanGetOutVehicle ()
 Returns true if compartment can be gotten out of.
 
proto external bool CanGetOutVehicleViaDoor (int doorIndex)
 Returns true if compartment can be gotten out of via the door with index.
 
proto external bool IsSwitchingSeatsAnim ()
 Returns true if character is in the switching animation.
 
proto external bool FindSuitableTeleportLocation (vector TR[4])
 
proto external bool CanJumpOutVehicle ()
 Returns true if current compartment can be jumped from.
 
proto external bool IsVehicleFlipped (float dotThreshold)
 
proto external bool CompareSeatOutVectorAndGravity (float dotThreshold)
 
proto external void SetActivePilotCompartment (BaseCompartmentSlot pilotCompartment)
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 

Static Public Member Functions

static ECompartmentType GetCompartmentType (notnull BaseCompartmentSlot compartment)
 Get type of a compartment.
 
- Static Public Member Functions inherited from CompartmentAccessComponent
static proto IEntity GetVehicleIn (IEntity entity)
 Returns the vehicle entity is in (root entity of whole hierarchy)
 

Protected Member Functions

void MoveInVehicleOwner (RplId slotEntityID, int slotID, bool performWhenPaused)
 
void GetOutOwner (EGetOutType type, int doorInfoIndex, ECloseDoorAfterActions closeDoor, bool performWhenPaused, bool ejectOnTheSpot)
 Replicated method executed by the owner of the character in order to get out of the vehicle.
 

Protected Attributes

ref OnPlayerEnterCompartment m_OnPlayerEnterCompartment
 
ref OnPlayerExitCompartment m_OnPlayerExitCompartment
 

Static Protected Attributes

const int WAIT_FOR_VEHICLE_MAX_TRIES = 10
 
static int s_iWaitForVehicleTries = 0
 

Constructor & Destructor Documentation

◆ ~SCR_CompartmentAccessComponent()

void SCR_CompartmentAccessComponent.~SCR_CompartmentAccessComponent ( )

Member Function Documentation

◆ AskOwnerToGetOutFromVehicle()

void SCR_CompartmentAccessComponent.AskOwnerToGetOutFromVehicle ( EGetOutType type,
int doorInfoIndex,
ECloseDoorAfterActions closeDoor,
bool performWhenPaused,
bool ejectOnTheSpot = false )

Method used to ask the owner to leave the compartment.

Parameters
[in]typehow player should get out of the vehicle
[in]doorInfoIndexthrough which door player will try to get out
[in]closeDoorshould player close the door when he leaves the vehicle
[in]performWhenPaused
[in]ejectOnTheSpotif character should be ejected on the position where he currently is

◆ FindFreeAndAccessibleCompartment()

BaseCompartmentSlot SCR_CompartmentAccessComponent.FindFreeAndAccessibleCompartment ( IEntity vehicle,
ECompartmentType compartmentType,
BaseCompartmentSlot customSlot = null )

Find a compartment that is marked as accessible and not occupied by anyone.

Parameters
vehicleTarget vehicle
compartmentTypeType of compartment
Returns
Compartment, null if none was found

◆ GetCompartmentType()

static ECompartmentType SCR_CompartmentAccessComponent.GetCompartmentType ( notnull BaseCompartmentSlot compartment)
static

Get type of a compartment.

Parameters
compartmentQueried compartment
Returns
Compartment type, or -1 if invalid

◆ GetOnCompartmentEntered()

ScriptInvoker SCR_CompartmentAccessComponent.GetOnCompartmentEntered ( bool createNew = true)

◆ GetOnCompartmentLeft()

ScriptInvoker SCR_CompartmentAccessComponent.GetOnCompartmentLeft ( bool createNew = true)

◆ GetOnPlayerCompartmentEnter()

OnPlayerEnterCompartment SCR_CompartmentAccessComponent.GetOnPlayerCompartmentEnter ( bool createNew = true)

◆ GetOnPlayerCompartmentExit()

OnPlayerExitCompartment SCR_CompartmentAccessComponent.GetOnPlayerCompartmentExit ( bool createNew = true)

◆ GetOutOwner()

void SCR_CompartmentAccessComponent.GetOutOwner ( EGetOutType type,
int doorInfoIndex,
ECloseDoorAfterActions closeDoor,
bool performWhenPaused,
bool ejectOnTheSpot )
protected

Replicated method executed by the owner of the character in order to get out of the vehicle.

Parameters
[in]typehow player should get out of the vehicle
[in]doorInfoIndexthrough which door player will try to get out
[in]closeDoorshould player close the door when he leaves the vehicle
[in]performWhenPaused
[in]ejectOnTheSpotif character should be ejected on the position where he currently is

◆ GetVehicle() [1/2]

IEntity SCR_CompartmentAccessComponent.GetVehicle ( )

Get vehicle this entity is in.

Works even when the entity is not directly in the vehicle, but in one of its child entities (e.g., turrets) Use this function when you specifically need pointer to the vehicle. If you want to simply check if a character is in a vehicle, use IsInCompartment()!

Returns
Vehicle, null when not in any compartment

◆ GetVehicle() [2/2]

IEntity SCR_CompartmentAccessComponent.GetVehicle ( out int compartmentID)

◆ MoveInVehicle()

bool SCR_CompartmentAccessComponent.MoveInVehicle ( IEntity vehicle,
ECompartmentType compartmentType,
bool performWhenPaused = false,
BaseCompartmentSlot customSlot = null )

Move in vehicle to specified slot type.

When executed on server while the character is owned by a client, this function will send the request there.

Parameters
vehicleTarget vehicle
compartmentTypeType of compartment
Returns
True if the request was successful

◆ MoveInVehicleAny()

bool SCR_CompartmentAccessComponent.MoveInVehicleAny ( IEntity vehicle)

Move in vehicle to any available slot.

When executed on server while the character is owned by a client, this function will send the request there.

Parameters
vehicleTarget vehicle
Returns
True if the request was successful

◆ MoveInVehicleOwner()

void SCR_CompartmentAccessComponent.MoveInVehicleOwner ( RplId slotEntityID,
int slotID,
bool performWhenPaused )
protected

◆ OnCompartmentEntered()

override void SCR_CompartmentAccessComponent.OnCompartmentEntered ( IEntity targetEntity,
BaseCompartmentManagerComponent manager,
int mgrID,
int slotID,
bool move )

◆ OnCompartmentLeft()

override void SCR_CompartmentAccessComponent.OnCompartmentLeft ( IEntity targetEntity,
BaseCompartmentManagerComponent manager,
int mgrID,
int slotID,
bool move )

◆ OnLifeStateChanged()

void SCR_CompartmentAccessComponent.OnLifeStateChanged ( ECharacterLifeState previousLifeState,
ECharacterLifeState newLifeState )

Member Data Documentation

◆ m_OnPlayerEnterCompartment

ref OnPlayerEnterCompartment SCR_CompartmentAccessComponent.m_OnPlayerEnterCompartment
protected

◆ m_OnPlayerExitCompartment

ref OnPlayerExitCompartment SCR_CompartmentAccessComponent.m_OnPlayerExitCompartment
protected

◆ s_iWaitForVehicleTries

int SCR_CompartmentAccessComponent.s_iWaitForVehicleTries = 0
staticprotected

◆ WAIT_FOR_VEHICLE_MAX_TRIES

const int SCR_CompartmentAccessComponent.WAIT_FOR_VEHICLE_MAX_TRIES = 10
staticprotected

The documentation for this interface was generated from the following file: