Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SCR_BaseContainerTools Interface Reference

Static Public Member Functions

static Managed CreateInstanceFromPrefab (ResourceName prefab, bool printError=false)
 Get Managed Instance from prefab.
 
static string GetContainerClassName (ResourceName prefab)
 Get class name of the prefab.
 
static string GetContainerClassName (Resource prefabResource)
 Get class name of prefab resource.
 
static IEntitySource FindEntitySource (Resource prefabResource)
 Get entity source from prefab resource.
 
static IEntityComponentSource FindComponentSource (Resource prefabResource, string componentClassName)
 Get component source of given class from prefab resource.
 
static IEntityComponentSource FindComponentSource (Resource prefabResource, TypeName componentClass)
 Get component source inherited from given class from prefab resource.
 
static IEntityComponentSource FindComponentSource (IEntitySource prefabEntity, string componentClassName)
 Get component source of given class from entity source.
 
static IEntityComponentSource FindComponentSource (IEntitySource prefabEntity, TypeName componentClass)
 Get component source inherited from given class from entity source.
 
static int FindComponentSources (Resource prefabResource, notnull array< string > componentClassNames, notnull out array< ref array< IEntityComponentSource > > componentSources)
 Get component sources of given classes from prefab resource.
 
static int FindComponentSources (IEntitySource prefabEntity, notnull array< string > componentClassNames, notnull out array< ref array< IEntityComponentSource > > componentSources)
 Get component sources of given classes from entity source.
 
static int FindComponentSourcesOfClass (IEntitySource prefabEntity, TypeName componentClass, bool GetChildComponentsOfComponents, notnull out array< IEntityComponentSource > componentSources)
 Get all component sources of given class from entity source.
 
static int GetComponentSourceChildren (notnull IEntityComponentSource componentSource, notnull out array< IEntityComponentSource > componentSources)
 Get all component sources children from given component source.
 
static BaseContainer GetPrefabContainer (BaseContainer container)
 Get first container in hierarchy that comes from a prefab.
 
static ResourceName GetPrefabResourceName (BaseContainer container)
 Get resource name of the first container in hierarchy that comes from a prefab.
 
static array< string > GetPrefabSetValueNames (notnull BaseContainer baseContainer)
 Get a Prefab's modifications from its parent.
 
static BaseContainer GetTopMostAncestor (notnull BaseContainer baseContainer)
 Get the topmost BaseContainer parent If it is the topmost, returns the provided baseContainer.
 
static bool IsKindOf (notnull BaseContainer container, ResourceName resourceName)
 Says if the provided container is of type or inherits from a resourcename.
 
static bool IsKindOf (ResourceName checkedResourceName, ResourceName supposedAncestor)
 Says if the provided resourcename is of type or inherits from another resourcename.
 
static vector GetWorldCoords (IEntitySource entitySource, vector coords)
 Get world coordinates of position local to given entity source.
 
static vector GetLocalCoords (IEntitySource entitySource, vector coords)
 Get coordinates local to given entity source.
 
static string GetArrayValue (notnull array< int > values)
 Convert integer array to string in format acceptable by WorldEditorAPI.SetVariableValue.
 

Detailed Description

See also
BaseContainerTools
SCR_ConfigHelper

Member Function Documentation

◆ CreateInstanceFromPrefab()

static Managed SCR_BaseContainerTools.CreateInstanceFromPrefab ( ResourceName  prefab,
bool  printError = false 
)
static

Get Managed Instance from prefab.

Parameters
[in]prefabPrefab ResourceName
[in]printErrorIf true will print an error if it fails
Returns
Managed entity or null on error

◆ FindComponentSource() [1/4]

static IEntityComponentSource SCR_BaseContainerTools.FindComponentSource ( IEntitySource  prefabEntity,
string  componentClassName 
)
static

Get component source of given class from entity source.

Parameters
[in]prefabEntityEntity source
[in]componentClassNameClass name of desired component
Returns
Component source or null if not found

◆ FindComponentSource() [2/4]

static IEntityComponentSource SCR_BaseContainerTools.FindComponentSource ( IEntitySource  prefabEntity,
TypeName  componentClass 
)
static

Get component source inherited from given class from entity source.

Parameters
[in]prefabEntityEntity source
[in]componentClassClass of desired component
Returns
Component source or null if not found

◆ FindComponentSource() [3/4]

static IEntityComponentSource SCR_BaseContainerTools.FindComponentSource ( Resource  prefabResource,
string  componentClassName 
)
static

Get component source of given class from prefab resource.

Parameters
[in]prefabResourceLoaded entity prefab, use Resource.Load(prefab) to retrieve it from ResourceName
[in]componentClassNameClass name of desired component
Returns
Component source or null if not found or on error

◆ FindComponentSource() [4/4]

static IEntityComponentSource SCR_BaseContainerTools.FindComponentSource ( Resource  prefabResource,
TypeName  componentClass 
)
static

Get component source inherited from given class from prefab resource.

Parameters
[in]prefabResourceLoaded entity prefab, use Resource.Load(prefab) to retrieve it from ResourceName
[in]componentClassNameClass of desired component
Returns
Component source

◆ FindComponentSources() [1/2]

static int SCR_BaseContainerTools.FindComponentSources ( IEntitySource  prefabEntity,
notnull array< string >  componentClassNames,
notnull out array< ref array< IEntityComponentSource > >  componentSources 
)
static

Get component sources of given classes from entity source.

Parameters
[in]prefabEntityEntity source
[in]componentClassNamesClass names of desired components
[out]Arrayto be filled with component sources (in the same order as componentClassNames)
Returns
Number of components

◆ FindComponentSources() [2/2]

static int SCR_BaseContainerTools.FindComponentSources ( Resource  prefabResource,
notnull array< string >  componentClassNames,
notnull out array< ref array< IEntityComponentSource > >  componentSources 
)
static

Get component sources of given classes from prefab resource.

Parameters
[in]prefabResourceLoaded entity prefab, use Resource.Load(prefab) to retrieve it from ResourceName
[in]componentClassNamesClass names of desired components
[out]Arrayto be filled with component sources (in the same order as componentClassNames)
Returns
Number of components

◆ FindComponentSourcesOfClass()

static int SCR_BaseContainerTools.FindComponentSourcesOfClass ( IEntitySource  prefabEntity,
TypeName  componentClass,
bool  GetChildComponentsOfComponents,
notnull out array< IEntityComponentSource >  componentSources 
)
static

Get all component sources of given class from entity source.

Parameters
[in]prefabEntityEntity source
[in]componentClassClass names of desired components
[in]GetChildComponentsOfComponentsif true it will itterate over all children of the component (not entity) and get the components from it. Will search two layers deep
[out]componentSourcesArray filled with the found IEntityComponentSource of given class
Returns
Number of components found

◆ FindEntitySource()

static IEntitySource SCR_BaseContainerTools.FindEntitySource ( Resource  prefabResource)
static

Get entity source from prefab resource.

Parameters
[in]prefabResourceLoaded entity prefab, use Resource.Load(prefab) to retrieve it from ResourceName
Returns
Entity source or null if not found or on error

◆ GetArrayValue()

static string SCR_BaseContainerTools.GetArrayValue ( notnull array< int >  values)
static

Convert integer array to string in format acceptable by WorldEditorAPI.SetVariableValue.

Parameters
[in]valuesInput array
Returns
Array converted to string

◆ GetComponentSourceChildren()

static int SCR_BaseContainerTools.GetComponentSourceChildren ( notnull IEntityComponentSource  componentSource,
notnull out array< IEntityComponentSource >  componentSources 
)
static

Get all component sources children from given component source.

Parameters
[in]componentSourceComponent source
[out]componentSourcesArray filled with the found IEntityComponentSource
Returns
Number of components found

◆ GetContainerClassName() [1/2]

static string SCR_BaseContainerTools.GetContainerClassName ( Resource  prefabResource)
static

Get class name of prefab resource.

Use to check if prefab class is matching requirements before you spawn it.

Parameters
[in]prefabPrefab resource
Returns
Class name

◆ GetContainerClassName() [2/2]

static string SCR_BaseContainerTools.GetContainerClassName ( ResourceName  prefab)
static

Get class name of the prefab.

Use to check if prefab class is matching requirements before you spawn it.

Parameters
[in]prefabPrefab path
Returns
Class name

◆ GetLocalCoords()

static vector SCR_BaseContainerTools.GetLocalCoords ( IEntitySource  entitySource,
vector  coords 
)
static

Get coordinates local to given entity source.

Parameters
[in]entitySourceEntity source
[in]coordsWorld coordinates
Returns
Local coordinates

◆ GetPrefabContainer()

static BaseContainer SCR_BaseContainerTools.GetPrefabContainer ( BaseContainer  container)
static

Get first container in hierarchy that comes from a prefab.

Parameters
[in]containerEvaluated container
Returns
Container (or the input container when there is no prefab in the hierarchy)

◆ GetPrefabResourceName()

static ResourceName SCR_BaseContainerTools.GetPrefabResourceName ( BaseContainer  container)
static

Get resource name of the first container in hierarchy that comes from a prefab.

Parameters
[in]containerEvaluated container
Returns
Prefab resource name (or empty string when no prefab was found in the hierarchy)

◆ GetPrefabSetValueNames()

static array< string > SCR_BaseContainerTools.GetPrefabSetValueNames ( notnull BaseContainer  baseContainer)
static

Get a Prefab's modifications from its parent.

Parameters
[in]sourcePrefab
Returns
Prefab-set variable names without parent Prefab values

◆ GetTopMostAncestor()

static BaseContainer SCR_BaseContainerTools.GetTopMostAncestor ( notnull BaseContainer  baseContainer)
static

Get the topmost BaseContainer parent If it is the topmost, returns the provided baseContainer.

Parameters
[in]baseContainer
Returns
topmost ancestor (e.g tree base)

◆ GetWorldCoords()

static vector SCR_BaseContainerTools.GetWorldCoords ( IEntitySource  entitySource,
vector  coords 
)
static

Get world coordinates of position local to given entity source.

Parameters
[in]entitySourceEntity source
[in]coordsLocal coordinates
Returns
World coordinates

◆ IsKindOf() [1/2]

static bool SCR_BaseContainerTools.IsKindOf ( notnull BaseContainer  container,
ResourceName  resourceName 
)
static

Says if the provided container is of type or inherits from a resourcename.

Parameters
[in]containerthe container to check
[in]resourceNamethe supposed ancestor
Returns
true if the provided container has resourceName in its ancestry, false if not or if the provided resourceName is empty

◆ IsKindOf() [2/2]

static bool SCR_BaseContainerTools.IsKindOf ( ResourceName  checkedResourceName,
ResourceName  supposedAncestor 
)
static

Says if the provided resourcename is of type or inherits from another resourcename.

Parameters
[in]checkedResourceNamethe Prefab to check
[in]supposedAncestorthe supposed ancestor
Returns
true if the provided container has resourceName in its ancestry, false if not or if the provided resourceName is empty

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