Arma Reforger Script API
|
Component used to activate the sandbox resources functionality on an entity. More...
Public Member Functions | |
ScriptInvoker | TEMP_GetOnInteractorReplicated () |
HOTFIX: Until replication issues are resolved. | |
void | TEMP_OnInteractorReplicated () |
HOTFIX: Until replication issues are resolved. | |
bool | IsResourceTypeEnabled (EResourceType resourceType=EResourceType.SUPPLIES) |
int | GetDisabledResourceTypes (inout notnull array< EResourceType > disabledResourceTypes) |
bool | CanResourceTypeEnabledBeChanged (EResourceType resourceType=EResourceType.SUPPLIES) |
void | SetResourceTypeEnabled (bool enable, EResourceType resourceType=EResourceType.SUPPLIES) |
Set Resource Type enabled or disabled. | |
ScriptInvokerBase< SCR_Resources_OnResourceEnabledChanged > | GetOnResourceTypeEnabledChanged () |
int | GetGridContainersBoundsMins () |
int | GetGridContainersBoundsMaxs () |
void | GetGridContainersBounds (out int mins, out int maxs) |
void | GetGridContainersBoundingBox (out vector mins, out vector maxs) |
void | GetGridContainersWorldBoundingBox (out vector mins, out vector maxs) |
bool | IsDynamic () |
RplComponent | GetReplicationComponent () |
FactionAffiliationComponent | GetFactionAffiliationComponent () |
SCR_ResourceEncapsulator | GetEncapsulator (EResourceType resourceType) |
bool | GetEncapsulator (EResourceType resourceType, out SCR_ResourceEncapsulator encapsulator) |
array< SCR_ResourceEncapsulator > | GetEncapsulators () |
SCR_ResourceContainer | GetContainer (EResourceType resourceType) |
bool | GetContainer (EResourceType resourceType, out SCR_ResourceContainer container) |
array< SCR_ResourceContainer > | GetContainers () |
SCR_ResourceConsumer | GetConsumer (EResourceGeneratorID identifier, EResourceType resourceType) |
bool | GetConsumer (EResourceGeneratorID identifier, EResourceType resourceType, inout SCR_ResourceConsumer consumer) |
array< SCR_ResourceConsumer > | GetConsumers () |
SCR_ResourceGenerator | GetGenerator (EResourceGeneratorID identifier, EResourceType resourceType) |
bool | GetGenerator (EResourceGeneratorID identifier, EResourceType resourceType, out SCR_ResourceGenerator generator) |
array< SCR_ResourceGenerator > | GetGenerators () |
int | GetGridUpdateId () |
vector | GetLastPosition () |
bool | HasParent () |
Color | GetDebugColor () |
bool | IsGridUpdateIdGreaterThan (int gridUpdateId) |
bool | IsDebugVisualizationEnabled () |
bool | IsVisible () |
bool | IsOwnerActive () |
void | SetGridUpdateId (int gridUpdateId) |
void | SetIsVisible (bool state) |
void | SetGridContainersBoundsMins (int mins) |
void | SetGridContainersBoundsMaxs (int maxs) |
void | SetGridContainersBounds (int mins, int maxs) |
void | UpdateLastPosition () |
Updates the serial number for the current processing call of the resource grid onto this component. | |
void | FlagForProcessing () |
void | UnflagForProcessing () |
void | DeleteConsumers () |
void | DeleteGenerators () |
void | DeleteQueryInteractors () |
void | Initialize (notnull IEntity owner) |
void | Replicate () |
void | ReplicateEx () |
Utility method used to replicate the component state. | |
override void | _WB_AfterWorldUpdate (IEntity owner, float timeSlice) |
Called after updating world in Workbench. | |
override bool | _WB_OnKeyChanged (IEntity owner, BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent) |
Any property value has been changed. You can use editor API here and do some additional edit actions which will be part of the same "key changed" action. | |
void | OnVisibilityChanged () |
void | OnVehiclePhysicsActive (IEntity owner, bool activeState) |
Static Public Member Functions | |
static SCR_ResourceComponent | FindResourceComponent (IEntity entity, bool ignoreChildIfHasStorage=false) |
Use this function to obtain the Resource component instead of IEntity.FindComponent(SCR_ResourceComponent) | |
Static Public Attributes | |
const float | UPDATE_DISTANCE_TRESHOLD = 2.5 |
const float | UPDATE_DISTANCE_TRESHOLD_SQUARE = UPDATE_DISTANCE_TRESHOLD * UPDATE_DISTANCE_TRESHOLD |
Protected Member Functions | |
void | OnResourceTypeEnabledChanged () |
bool | GetNextEncapsulatorCandidate (inout int position, inout int higherLimitPosition, inout SCR_ResourceEncapsulator encapsulator, EResourceType resourceType) |
bool | GetNextContainerCandidate (inout int position, inout int higherLimitPosition, inout SCR_ResourceContainer container, EResourceType resourceType) |
bool | GetNextConsumerCandidate (inout int position, inout int higherLimitPosition, inout SCR_ResourceConsumer consumer, EResourceGeneratorID identifier, EResourceType resourceType) |
bool | GetNextGeneratorCandidate (inout int position, inout int higherLimitPosition, inout SCR_ResourceGenerator generator, EResourceGeneratorID identifier, EResourceType resourceType) |
bool | ShouldConsumersBeReplicated () |
bool | ShouldGeneratorsBeReplicated () |
override void | OnPostInit (IEntity owner) |
Initialises the component, the consumer and/or the container. | |
override void | OnChildAdded (IEntity parent, IEntity child) |
Called on parent entity when child entity is added into hierarchy. | |
override void | EOnInit (IEntity owner) |
Event after entity is allocated and initialized. | |
void | DebugDraw () |
Processes and presents the debugging visualization for the consumer and/or container. | |
override void | OnAddedToParent (IEntity child, IEntity parent) |
void | OnAddedToParentEx (IEntity child, IEntity parent) |
override void | OnRemovedFromParent (IEntity child, IEntity parent) |
override void | OnDelete (IEntity owner) |
Protected Attributes | |
bool | m_bIsDynamic |
bool | m_bIsNetDirty |
int | m_iGridUpdateId = int.MIN |
int | m_iGridContainersBoundsMins = 0xFFFFFFFF |
int | m_iGridContainersBoundsMaxs = 0xFFFFFFFF |
vector | m_vGridContainersBoundingVolumeMins |
vector | m_vGridContainersBoundingVolumeMaxs |
bool | m_bIsFlaggedForProcessing |
ref array< ref SCR_ResourceEncapsulator > | m_aEncapsulators |
Refer to SCR_ResourceEncapsulator for documentation. | |
ref array< ref SCR_ResourceConsumer > | m_aConsumers |
Refer to SCR_ResourceConsumer for documentation. | |
ref array< ref SCR_ResourceGenerator > | m_aGenerators |
Refer to SCR_ResourceGenerator for documentation. | |
ref array< EResourceType > | m_aDisabledResourceTypes |
ref array< EResourceType > | m_aDisallowChangingEnableResource |
ref ScriptInvoker | m_TEMP_OnInteractorReplicated |
HOTFIX: Until replication issues are resolved. | |
ref ScriptInvokerBase< SCR_Resources_OnResourceEnabledChanged > | m_OnResourceTypeEnabledChanged |
bool | m_bEnableDebugVisualization |
Setting for enabling the debugging visualization of the container and/or consumer. | |
EResourceDebugVisualizationFlags | m_eDebugVisualizationFlags |
Flags for enabling the debugging visualization. | |
ref Color | m_DebugColor |
Setting for the base color for the debugging visualization of the container and/or consumer. | |
bool | m_bIsVisible = true |
ref array< ref SCR_ResourceContainer > | m_aContainerInstances = {} |
Defined/Configured through SCR_ResourceComponentClass::m_Container. | |
RplComponent | m_ReplicationComponent |
Replication component attached to the owner entity. | |
FactionAffiliationComponent | m_FactionAffiliationComponent |
vector | m_LastPosition = vector.Zero |
bool | m_bHasParent |
bool | m_bIsOwnerActive |
bool | m_bIsInitialized |
bool | m_bIsAddedToParentBuffered |
Static Protected Attributes | |
const float | UPDATE_PERIOD = 10.0 / 60.0 |
Component used to activate the sandbox resources functionality on an entity.
This component can enable the functionality for both sandbox container and sandbox consumer in an individual manner. The sandbox resources functionality does not require a manager so just the presence of containers being registered into a consumer's queue is enough for it to perform its functionality. The replication component is a requirement for the component to work properly.
override void SCR_ResourceComponent._WB_AfterWorldUpdate | ( | IEntity | owner, |
float | timeSlice | ||
) |
Called after updating world in Workbench.
The entity must be visible in frustum, selected or named. Used for performing the debug visualization on Workbench Editor's viewport.
[in] | owner | Entity that owns this component. |
[in] | timeSlice | Difference of the previous call of this method and the time of the current call. |
override bool SCR_ResourceComponent._WB_OnKeyChanged | ( | IEntity | owner, |
BaseContainer | src, | ||
string | key, | ||
BaseContainerList | ownerContainers, | ||
IEntity | parent | ||
) |
Any property value has been changed. You can use editor API here and do some additional edit actions which will be part of the same "key changed" action.
bool SCR_ResourceComponent.CanResourceTypeEnabledBeChanged | ( | EResourceType | resourceType = EResourceType::SUPPLIES | ) |
[in] | resourceType | Type to check |
|
protected |
Processes and presents the debugging visualization for the consumer and/or container.
Generic/Shared visualization should be processed explicitely here and consumer specific visualiation should be processed through SCR_ResourceConsumer::DebugDraw(), similarly for the container with SCR_ResourceContainer::DebugDraw(). A white arrow is drawn explicitely from here with the intent of providing a visual cue of the extents of the highest range, that is the storage range of the container or the resource range of the consumer. Whatever is the highest is the height that will be selected for this arrow.
TODO: Cache the height value and only change it on a event basis.
Processes and presents the debugging visualization for the encapsulator.
Draws the arrow for the visual cue regarding the maximum range.
void SCR_ResourceComponent.DeleteConsumers | ( | ) |
void SCR_ResourceComponent.DeleteGenerators | ( | ) |
void SCR_ResourceComponent.DeleteQueryInteractors | ( | ) |
|
protected |
Event after entity is allocated and initialized.
owner | The owner entity |
|
static |
Use this function to obtain the Resource component instead of IEntity.FindComponent(SCR_ResourceComponent)
[in] | entity | Entity to get Resource component from. Will loop through children in entity is a vehicle and no resource component was found on the entity |
[in] | ignoreChildIfHasStorage | If looping through children and this is true than it will not return the ResourceComponent if that child has an inventory storage |
void SCR_ResourceComponent.FlagForProcessing | ( | ) |
SCR_ResourceConsumer SCR_ResourceComponent.GetConsumer | ( | EResourceGeneratorID | identifier, |
EResourceType | resourceType | ||
) |
[in] | identifier | |
[in] | resourceType |
bool SCR_ResourceComponent.GetConsumer | ( | EResourceGeneratorID | identifier, |
EResourceType | resourceType, | ||
inout SCR_ResourceConsumer | consumer | ||
) |
[in] | identifier | |
[in] | resourceType | |
[in,out] | consumer | The first consumer instance of a specified resource type, or null if none. |
array< SCR_ResourceConsumer > SCR_ResourceComponent.GetConsumers | ( | ) |
SCR_ResourceContainer SCR_ResourceComponent.GetContainer | ( | EResourceType | resourceType | ) |
[in] | resourceType |
bool SCR_ResourceComponent.GetContainer | ( | EResourceType | resourceType, |
out SCR_ResourceContainer | container | ||
) |
[in] | resourceType | |
[out] | container |
array< SCR_ResourceContainer > SCR_ResourceComponent.GetContainers | ( | ) |
Color SCR_ResourceComponent.GetDebugColor | ( | ) |
int SCR_ResourceComponent.GetDisabledResourceTypes | ( | inout notnull array< EResourceType > | disabledResourceTypes | ) |
[in] | disabledResourceTypes | List of disabled resources |
SCR_ResourceEncapsulator SCR_ResourceComponent.GetEncapsulator | ( | EResourceType | resourceType | ) |
[in] | resourceType |
bool SCR_ResourceComponent.GetEncapsulator | ( | EResourceType | resourceType, |
out SCR_ResourceEncapsulator | encapsulator | ||
) |
[in] | resourceType | |
[out] | encapsulator | The first encapsulator instance of a specified resource type, or null if none. |
array< SCR_ResourceEncapsulator > SCR_ResourceComponent.GetEncapsulators | ( | ) |
FactionAffiliationComponent SCR_ResourceComponent.GetFactionAffiliationComponent | ( | ) |
SCR_ResourceGenerator SCR_ResourceComponent.GetGenerator | ( | EResourceGeneratorID | identifier, |
EResourceType | resourceType | ||
) |
[in] | identifier | |
[in] | resourceType |
bool SCR_ResourceComponent.GetGenerator | ( | EResourceGeneratorID | identifier, |
EResourceType | resourceType, | ||
out SCR_ResourceGenerator | generator | ||
) |
[in] | identifier | |
[in] | resourceType | |
[out] | generator | The first generator instance of a specified resource type, or null if none. |
array< SCR_ResourceGenerator > SCR_ResourceComponent.GetGenerators | ( | ) |
void SCR_ResourceComponent.GetGridContainersBoundingBox | ( | out vector | mins, |
out vector | maxs | ||
) |
[out] | mins | |
[out] | maxs |
void SCR_ResourceComponent.GetGridContainersBounds | ( | out int | mins, |
out int | maxs | ||
) |
[out] | mins | |
[out] | maxs |
int SCR_ResourceComponent.GetGridContainersBoundsMaxs | ( | ) |
int SCR_ResourceComponent.GetGridContainersBoundsMins | ( | ) |
void SCR_ResourceComponent.GetGridContainersWorldBoundingBox | ( | out vector | mins, |
out vector | maxs | ||
) |
[out] | mins | |
[out] | maxs |
int SCR_ResourceComponent.GetGridUpdateId | ( | ) |
vector SCR_ResourceComponent.GetLastPosition | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
ScriptInvokerBase< SCR_Resources_OnResourceEnabledChanged > SCR_ResourceComponent.GetOnResourceTypeEnabledChanged | ( | ) |
RplComponent SCR_ResourceComponent.GetReplicationComponent | ( | ) |
bool SCR_ResourceComponent.HasParent | ( | ) |
void SCR_ResourceComponent.Initialize | ( | notnull IEntity | owner | ) |
[in] | owner |
bool SCR_ResourceComponent.IsDebugVisualizationEnabled | ( | ) |
bool SCR_ResourceComponent.IsDynamic | ( | ) |
bool SCR_ResourceComponent.IsGridUpdateIdGreaterThan | ( | int | gridUpdateId | ) |
[in] | gridUpdateId |
bool SCR_ResourceComponent.IsOwnerActive | ( | ) |
bool SCR_ResourceComponent.IsResourceTypeEnabled | ( | EResourceType | resourceType = EResourceType::SUPPLIES | ) |
[in] | resourceType | Type to check |
bool SCR_ResourceComponent.IsVisible | ( | ) |
|
protected |
|
protected |
|
protected |
Called on parent entity when child entity is added into hierarchy.
[in] | parent | |
[in] | child |
|
protected |
|
protected |
Initialises the component, the consumer and/or the container.
Event called after init when all components are initialised.
[in] | owner | Entity that owns this component. |
|
protected |
|
protected |
void SCR_ResourceComponent.OnVehiclePhysicsActive | ( | IEntity | owner, |
bool | activeState | ||
) |
[in] | owner | |
[in] | activeState |
void SCR_ResourceComponent.OnVisibilityChanged | ( | ) |
void SCR_ResourceComponent.Replicate | ( | ) |
void SCR_ResourceComponent.ReplicateEx | ( | ) |
Utility method used to replicate the component state.
Warning: This is important for the SCR_ResourceConsumer and SCR_ResourceContainer classes as it is used to cause the component to replicate, so do not add extra functionality here unless it is necessary for the replication functionality of both the SCR_ResourceConsumer and SCR_ResourceContainer classes.
void SCR_ResourceComponent.SetGridContainersBounds | ( | int | mins, |
int | maxs | ||
) |
[in] | mins | |
[in] | maxs |
void SCR_ResourceComponent.SetGridContainersBoundsMaxs | ( | int | maxs | ) |
[in] | maxs |
void SCR_ResourceComponent.SetGridContainersBoundsMins | ( | int | mins | ) |
[in] | mins |
void SCR_ResourceComponent.SetGridUpdateId | ( | int | gridUpdateId | ) |
[in] | gridUpdateId |
void SCR_ResourceComponent.SetIsVisible | ( | bool | state | ) |
[in] | state |
void SCR_ResourceComponent.SetResourceTypeEnabled | ( | bool | enable, |
EResourceType | resourceType = EResourceType::SUPPLIES |
||
) |
Set Resource Type enabled or disabled.
[in] | enable | Set true to enable resource type, set false to disable |
[in] | resourceType | Resource type to enable/disable |
|
protected |
|
protected |
ScriptInvoker SCR_ResourceComponent.TEMP_GetOnInteractorReplicated | ( | ) |
HOTFIX: Until replication issues are resolved.
void SCR_ResourceComponent.TEMP_OnInteractorReplicated | ( | ) |
HOTFIX: Until replication issues are resolved.
void SCR_ResourceComponent.UnflagForProcessing | ( | ) |
void SCR_ResourceComponent.UpdateLastPosition | ( | ) |
Updates the serial number for the current processing call of the resource grid onto this component.
|
protected |
Refer to SCR_ResourceConsumer for documentation.
|
protected |
Defined/Configured through SCR_ResourceComponentClass::m_Container.
Refer to SCR_ResourceContainer for documentation.
|
protected |
|
protected |
|
protected |
Refer to SCR_ResourceEncapsulator for documentation.
|
protected |
Refer to SCR_ResourceGenerator for documentation.
|
protected |
Setting for enabling the debugging visualization of the container and/or consumer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Setting for the base color for the debugging visualization of the container and/or consumer.
|
protected |
Flags for enabling the debugging visualization.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Replication component attached to the owner entity.
|
protected |
HOTFIX: Until replication issues are resolved.
|
protected |
|
protected |
|
static |
|
static |
|
staticprotected |