Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Tutorial_CombatEngineering_LoadSupplies_1.c
Go to the documentation of this file.
1[EntityEditorProps(insertable: false)]
5
6//------------------------------------------------------------------------------------------------
8{
10 //------------------------------------------------------------------------------------------------
11 override protected void Setup()
12 {
13 RegisterWaypoint("ARLEVILLE_SUPPLIES", "", "UNLOAD").SetOffsetVector("0 1.5 0");
14
15 PlayNarrativeCharacterStage("COMBATENGINEERING_Instructor_D", 2);
16
18 }
19
20 //------------------------------------------------------------------------------------------------
21 protected void SetupSupplyConsumer()
22 {
23 IEntity supplyTruck = GetGame().GetWorld().FindEntityByName("BUILDING_VEHICLE");
24
25 if (!supplyTruck)
26 return;
27
28 SlotManagerComponent slotManager = SlotManagerComponent.Cast(supplyTruck.FindComponent(SlotManagerComponent));
29
30 if (!slotManager)
31 return;
32
33 EntitySlotInfo slotInfo = slotManager.GetSlotByName("EngineerBox");
34 if (!slotInfo)
35 return;
36
37 IEntity cargo = slotInfo.GetAttachedEntity();
38 if (!cargo)
39 return;
40
41 SCR_ResourceComponent resourceComp = SCR_ResourceComponent.FindResourceComponent(cargo);
42 if (!resourceComp)
43 return;
44
45 m_SupplyContainer = resourceComp.GetContainer(EResourceType.SUPPLIES);
46 }
47
48 //------------------------------------------------------------------------------------------------
49 override protected bool GetIsFinished()
50 {
52 return false;
53
54 return m_SupplyContainer.GetResourceValue() == m_SupplyContainer.GetMaxResourceValue();
55 }
56};
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Adds ability to attach an object to a slot.
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
proto external Managed FindComponent(typename typeName)
SCR_Waypoint RegisterWaypoint(string entityName, string title=string.Empty, string icon="MISC")
void PlayNarrativeCharacterStage(string characterName, int stage)
void SetOffsetVector(vector offset)