Arma Reforger Script API
|
Public Member Functions | |
bool | BlockSuppliesIfOccupied () |
TODO: HOT FIX - Will block supply actions if one or more compartments are occupied as well as blocking player get in actions if there are supplies. | |
void | GetCompartmentsOfType (inout array< BaseCompartmentSlot > outCompartments, ECompartmentType compartmentType) |
Get compartments of specific type. | |
void | GetCompartmentsOfTypes (inout array< BaseCompartmentSlot > outCompartments, notnull array< ECompartmentType > compartmentTypes) |
void | GetFreeCompartmentsOfType (inout array< BaseCompartmentSlot > outCompartments, ECompartmentType compartmentType, bool checkHasValidOccupantPrefab=false) |
Get all free compartment slots of the given type. | |
BaseCompartmentSlot | GetFirstFreeCompartmentOfType (ECompartmentType compartmentType, bool checkHasValidOccupantPrefab=false) |
Get first free compartment slots of the given type. | |
BaseCompartmentSlot | GetFirstFreeCompartmentOfType (TypeName compartmentClass, bool checkHasValidOccupantPrefab=false) |
Get first free compartment slots of the given class. | |
bool | HasFreeCompartmentOfTypes (notnull array< ECompartmentType > compartmentTypes) |
Go over all compartments of given type and checks if at least one compartment is free. | |
int | GetOccupantCount () |
void | GetOccupants (inout array< IEntity > occupants) |
Get occupants of all managed compartments. | |
void | GetOccupantsOfType (inout array< IEntity > occupants, ECompartmentType compartmentType) |
Get occupants of all managed compartments of specified type. | |
void | DamageOccupants (float damage, EDamageType damageType, notnull Instigator instigator, bool damageWhileGetIn=false, bool damageWhileGetOut=false) |
Damage random hitzones depending on amount of damage to be applied. | |
void | KillOccupants (notnull Instigator instigator, bool eject=false, bool gettingIn=false, bool gettingOut=false) |
Kill all the occupants and eject them if requested. | |
void | EjectRandomOccupants (float ejectionChance=-1, bool ejectUnconscious=false) |
Kill all the occupants and eject them if requested. | |
void | SetCompartmentsAccessibleForAI (bool accessible) |
Set AI compartment access for all compartments. | |
ScriptInvoker | GetOnDoneSpawningDefaultOccupants () |
Get event called when spawning of occupants is done. | |
void | SetAllCompartmentsAccessibleOfTypes (notnull array< ECompartmentType > compartmentTypes, bool setAccessible) |
Lock/Unlock all compartment slots of given types for AI. | |
bool | CanOccupy (array< ECompartmentType > compartmentTypes, bool checkHasDefaultOccupantsData=true, FactionKey friendlyFaction=string.Empty, bool checkOccupyingFaction=true, bool checkForFreeCompartments=true) |
Check if can spawn characters in the vehicle. | |
bool | SpawnDefaultOccupants (notnull array< ECompartmentType > compartmentTypes) |
Spawns default characters as defined in BaseComparmentSlots inside the vehicle of given compartment types (Server only) Places all spawned characters in the same group Note that it can only spawn the same compartment type once and will fail if you try to do it twice. | |
void | CancelSpawningCharacters () |
Cancel spawning if in progress. | |
bool | IsSpawningDefaultOccupants () |
bool | IsOccupiedByFriendlies (FactionKey vehicleFactionKey, bool allFriendly, bool trueIfEmpty=true) |
Checks if vehicle is occupied by characters that are friendly towards the given faction. | |
bool | AnyCompartmentsOccupiedOrLocked () |
bool | HasDefaultOccupantsDataForTypes (array< ECompartmentType > compartmentTypes) |
Check if there is at least one default occupant prefab set for the given compartment types. | |
void | ~SCR_BaseCompartmentManagerComponent () |
Public Member Functions inherited from BaseCompartmentManagerComponent | |
proto external bool | AreDoorOpen (int doorIndex) |
proto external bool | AreDoorFake (int doorIndex) |
proto external IEntity | GetDoorUser (int doorIndex) |
proto external IEntity | IsGetInAndOutBlockedByDoorUser (int doorIndex) |
proto external IEntity | GetOwner () |
proto external BaseCompartmentSlot | FindCompartment (int compartmentID, int mgrId=-1) |
Searches for compartment by ID of slot and compartment manager. | |
proto external int | GetCompartments (out notnull array< BaseCompartmentSlot > outCompartments) |
Returns a list and count of all compartments. | |
proto external BaseCompartmentDoor | GetDoor (int doorIndex) |
proto external CompartmentDoorReference | GetDoorReference (int referenceDoorIndex) |
Get door referencing this door index. | |
proto external CompartmentDoorInfo | GetDoorInfo (int doorIndex) |
Public Member Functions inherited from GameComponent | |
bool | OnTicksOnRemoteProxy () |
Static Public Attributes | |
static const ref array< ECompartmentType > | CREW_COMPARTMENT_TYPES = {ECompartmentType.PILOT, ECompartmentType.TURRET} |
static const ref array< ECompartmentType > | PASSENGER_COMPARTMENT_TYPES = {ECompartmentType.CARGO} |
Protected Member Functions | |
bool | InitiateSpawnDefaultOccupants (notnull array< ECompartmentType > compartmentTypes) |
void | SpawnDefaultOccupantEachFrame () |
void | FinishedSpawningDefaultOccupants (bool wasCanceled) |
Protected Attributes | |
bool | m_bBlockSuppliesIfOccupied |
ref array< BaseCompartmentSlot > | m_aCompartmentsToSpawnDefaultOccupant |
ref array< IEntity > | m_aSpawnedDefaultOccupants |
AIGroup | m_SpawnedOccupantsAIGroup |
bool | m_bIsSpawningDefaultOccupants |
ref ScriptInvoker | Event_OnDoneSpawningDefaultOccupants |
ref array< ref array< ECompartmentType > > | m_aDefaultOccupantsCompartmentTypesToSpawn = {} |
void SCR_BaseCompartmentManagerComponent.~SCR_BaseCompartmentManagerComponent | ( | ) |
bool SCR_BaseCompartmentManagerComponent.AnyCompartmentsOccupiedOrLocked | ( | ) |
bool SCR_BaseCompartmentManagerComponent.BlockSuppliesIfOccupied | ( | ) |
TODO: HOT FIX - Will block supply actions if one or more compartments are occupied as well as blocking player get in actions if there are supplies.
This is a hotfix until proper solution as it simply disables some player actions on the surface rather than with proper logic and does not effect AI
void SCR_BaseCompartmentManagerComponent.CancelSpawningCharacters | ( | ) |
Cancel spawning if in progress.
bool SCR_BaseCompartmentManagerComponent.CanOccupy | ( | array< ECompartmentType > | compartmentTypes, |
bool | checkHasDefaultOccupantsData = true , |
||
FactionKey | friendlyFaction = string::Empty , |
||
bool | checkOccupyingFaction = true , |
||
bool | checkForFreeCompartments = true |
||
) |
Check if can spawn characters in the vehicle.
compartmentTypes | Given compartment types that need to be checked if can be filled. |
checkHasDefaultOccupantsData | |
friendlyFaction | |
checkOccupyingFaction | If true function will check if the faction of the vehicle is null (empty) or the same/friendly to the static faction as given in the editableUIInfo. Function will return false if faction is hostile or neutral |
checkForFreeCompartments | If true will check if there are compartments free for the given compartments types. Function will return false if there are no free compartments of given type |
checkOccupyingFaction | |
checkForFreeCompartments |
void SCR_BaseCompartmentManagerComponent.DamageOccupants | ( | float | damage, |
EDamageType | damageType, | ||
notnull Instigator | instigator, | ||
bool | damageWhileGetIn = false , |
||
bool | damageWhileGetOut = false |
||
) |
Damage random hitzones depending on amount of damage to be applied.
Must be called on authority.
damage | |
damageType | |
instigator | |
gettingIn | |
gettingOut |
void SCR_BaseCompartmentManagerComponent.EjectRandomOccupants | ( | float | ejectionChance = -1 , |
bool | ejectUnconscious = false |
||
) |
Kill all the occupants and eject them if requested.
Must be called on authority.
forceEject | Chance the passengers get ejected. -1 Will use the same value that is configured on the compartment. 1 will force eject. Inbetween is custom chance. |
|
protected |
void SCR_BaseCompartmentManagerComponent.GetCompartmentsOfType | ( | inout array< BaseCompartmentSlot > | outCompartments, |
ECompartmentType | compartmentType | ||
) |
Get compartments of specific type.
[in,out] | outCompartments | |
compartmentType |
void SCR_BaseCompartmentManagerComponent.GetCompartmentsOfTypes | ( | inout array< BaseCompartmentSlot > | outCompartments, |
notnull array< ECompartmentType > | compartmentTypes | ||
) |
[in,out] | outCompartments | |
compartmentTypes |
BaseCompartmentSlot SCR_BaseCompartmentManagerComponent.GetFirstFreeCompartmentOfType | ( | ECompartmentType | compartmentType, |
bool | checkHasValidOccupantPrefab = false |
||
) |
Get first free compartment slots of the given type.
compartmentType | The compartment type to check |
checkHasValidOccupantPrefab | if true checks if compartment has valid default occupant prefab |
BaseCompartmentSlot SCR_BaseCompartmentManagerComponent.GetFirstFreeCompartmentOfType | ( | TypeName | compartmentClass, |
bool | checkHasValidOccupantPrefab = false |
||
) |
Get first free compartment slots of the given class.
compartmentClass | The compartment clas to check |
checkHasValidOccupantPrefab | if true checks if compartment has valid default occupant prefab |
void SCR_BaseCompartmentManagerComponent.GetFreeCompartmentsOfType | ( | inout array< BaseCompartmentSlot > | outCompartments, |
ECompartmentType | compartmentType, | ||
bool | checkHasValidOccupantPrefab = false |
||
) |
Get all free compartment slots of the given type.
[in,out] | outCompartments | array of all free compartments of type |
compartmentType | The compartment type to check | |
checkHasValidOccupantPrefab | if true checks if compartment has valid default occupant prefab |
int SCR_BaseCompartmentManagerComponent.GetOccupantCount | ( | ) |
void SCR_BaseCompartmentManagerComponent.GetOccupants | ( | inout array< IEntity > | occupants | ) |
Get occupants of all managed compartments.
[in,out] | occupants |
void SCR_BaseCompartmentManagerComponent.GetOccupantsOfType | ( | inout array< IEntity > | occupants, |
ECompartmentType | compartmentType | ||
) |
Get occupants of all managed compartments of specified type.
[out] | occupants | |
compartmentType |
ScriptInvoker SCR_BaseCompartmentManagerComponent.GetOnDoneSpawningDefaultOccupants | ( | ) |
Get event called when spawning of occupants is done.
Gives an array of IEntity (Spawned characters) and bool if spawning was canceled or not
bool SCR_BaseCompartmentManagerComponent.HasDefaultOccupantsDataForTypes | ( | array< ECompartmentType > | compartmentTypes | ) |
Check if there is at least one default occupant prefab set for the given compartment types.
compartmentTypes | Given compartment types that need to be filled with characters |
bool SCR_BaseCompartmentManagerComponent.HasFreeCompartmentOfTypes | ( | notnull array< ECompartmentType > | compartmentTypes | ) |
Go over all compartments of given type and checks if at least one compartment is free.
compartmentTypes |
|
protected |
bool SCR_BaseCompartmentManagerComponent.IsOccupiedByFriendlies | ( | FactionKey | vehicleFactionKey, |
bool | allFriendly, | ||
bool | trueIfEmpty = true |
||
) |
Checks if vehicle is occupied by characters that are friendly towards the given faction.
vehicleFactionKey | the vehicle's faction |
allFriendly | If true will find all occupants and check if all of them are friendly. If false it will only check the first character it finds, mixed factions might not return a valid value. |
trueIfEmpty | If this is true then the function will return true if the vehicle is empty. Else it will return false |
bool SCR_BaseCompartmentManagerComponent.IsSpawningDefaultOccupants | ( | ) |
void SCR_BaseCompartmentManagerComponent.KillOccupants | ( | notnull Instigator | instigator, |
bool | eject = false , |
||
bool | gettingIn = false , |
||
bool | gettingOut = false |
||
) |
Kill all the occupants and eject them if requested.
Must be called on authority.
instigator | |
eject | |
gettingIn | |
gettingOut |
void SCR_BaseCompartmentManagerComponent.SetAllCompartmentsAccessibleOfTypes | ( | notnull array< ECompartmentType > | compartmentTypes, |
bool | setAccessible | ||
) |
Lock/Unlock all compartment slots of given types for AI.
compartmentTypes | Types to lock |
setAccessible | If true sets locked else set unlocked |
void SCR_BaseCompartmentManagerComponent.SetCompartmentsAccessibleForAI | ( | bool | accessible | ) |
Set AI compartment access for all compartments.
accessible |
|
protected |
bool SCR_BaseCompartmentManagerComponent.SpawnDefaultOccupants | ( | notnull array< ECompartmentType > | compartmentTypes | ) |
Spawns default characters as defined in BaseComparmentSlots inside the vehicle of given compartment types (Server only) Places all spawned characters in the same group Note that it can only spawn the same compartment type once and will fail if you try to do it twice.
If the system is already spawning default characters and you call it again for other department types it will send them to a queue and execute them after the current compartment types are filled.
compartmentTypes | Given compartment types that need to be filled with characters |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |