Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScenarioFrameworkInventoryLoader.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/ScenarioFramework", description: "")]
3 {
4 }
5 
6 class SCR_InvCallBackCheck : SCR_InvCallBack
7 {
8  string m_sNameMaster = "";
9  string m_sNameItem = "";
10 
11  //------------------------------------------------------------------------------------------------
12  override void OnFailed()
13  {
14  PrintFormat("ScenarioFramework: The item %1 could not be inserted into %2! Check name of the entity and be sure the entity has a space in the inventory", m_sNameItem, m_sNameMaster, LogLevel.ERROR);
15  }
16 
17  //------------------------------------------------------------------------------------------------
18  override void OnComplete()
19  {
20  //PrintFormat("ScenarioFramework: The item %1 has been correctly inserted into %2 inventory", m_sNameItem, m_sNameMaster);
21  }
22 }
23 
25 {
26  [Attribute(defvalue: "", desc: "Name of the entity whose inventory to be filled with")];
27  protected string m_sIDMaster;
28 
29  //------------------------------------------------------------------------------------------------
30  override void Init(SCR_ScenarioFrameworkArea area = null, SCR_ScenarioFrameworkEActivationType activation = SCR_ScenarioFrameworkEActivationType.SAME_AS_PARENT)
31  {
32  //m_bMutuallyExclusiveSpawn = false; // ignore this setting otherwise it won't work properly
33  if (m_eActivationType != activation)
34  return;
35 
37  {
38  //If just one condition is false, we don't continue and interrupt the init
39  if (!activationCondition.Init(GetOwner()))
40  {
42  return;
43  }
44  }
45 
46  super.Init(area, activation);
47 
48  IEntity master = GetGame().GetWorld().FindEntityByName(m_sIDMaster);
49  if (!master)
50  return;
51 
53  if (!inventoryComponent)
54  return;
55 
56  IEntity item;
57  SCR_InvCallBackCheck pInvCallback = new SCR_InvCallBackCheck();
58  pInvCallback.m_sNameMaster = m_sIDMaster;
60  {
61  item = object.GetSpawnedEntity();
62  if (!item || item == master)
63  continue;
64 
65  pInvCallback.m_sNameItem = item.GetName();
66  //InventoryStorageManagerComponent inventoryComponent.InsertItem(item, null, null, pInvCallback);
67  inventoryComponent.TryInsertItem(item, EStoragePurpose.PURPOSE_ANY, pInvCallback);
68  }
69  }
70 }
SCR_ScenarioFrameworkActivationConditionBase
Definition: SCR_ScenarioFrameworkSlotBase.c:677
m_eActivationType
protected SCR_ScenarioFrameworkEActivationType m_eActivationType
Definition: SCR_ScenarioFrameworkLayerBase.c:43
SCR_InvCallBack
Definition: SCR_InventoryMenuUI.c:56
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_ScenarioFrameworkLayerTaskClass
Definition: SCR_ScenarioFrameworkLayerTask.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
OnComplete
override void OnComplete()
Definition: SCR_ScenarioFrameworkInventoryLoader.c:18
InvokeAllChildrenSpawned
void InvokeAllChildrenSpawned()
Definition: SCR_ScenarioFrameworkLayerBase.c:460
SCR_ScenarioFrameworkInventoryLoader
Definition: SCR_ScenarioFrameworkInventoryLoader.c:24
OnFailed
override void OnFailed()
Definition: SCR_ScenarioFrameworkInventoryLoader.c:12
m_sNameMaster
SCR_ScenarioFrameworkInventoryLoaderClass m_sNameMaster
m_sNameItem
string m_sNameItem
Definition: SCR_ScenarioFrameworkInventoryLoader.c:9
InventoryStorageManagerComponent
Definition: InventoryStorageManagerComponent.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ScenarioFrameworkArea
Definition: SCR_ScenarioFrameworkArea.c:24
m_aChildren
protected ref array< SCR_ScenarioFrameworkLayerBase > m_aChildren
Definition: SCR_ScenarioFrameworkLayerBase.c:57
SCR_ScenarioFrameworkInventoryLoaderClass
Definition: SCR_ScenarioFrameworkInventoryLoader.c:2
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
EStoragePurpose
EStoragePurpose
Definition: EStoragePurpose.c:12
SCR_ScenarioFrameworkLayerBase
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_ScenarioFrameworkLayerBase.c:875
m_aActivationConditions
protected ref array< ref SCR_ScenarioFrameworkActivationConditionBase > m_aActivationConditions
Definition: SCR_ScenarioFrameworkLayerBase.c:46
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180