Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TransportWaypoint.c
Go to the documentation of this file.
4
6{
7 [Attribute("", UIWidgets.EditBox, "How long AI should wait for vehicle to pick them up before moving out on foot")]
8 float m_WaitForBoardingTime;
9
10 [Attribute("", UIWidgets.EditBox, "Name of character which AI will wait for as driver")]
11 string m_sDriverCharacterName;
12
13 private IEntity m_pDriverEntity = null;
14
15 float GetWaitForBoardingTime()
16 {
17 return m_WaitForBoardingTime;
18 }
19
20 void SetWaitForBoardingTime(float newTime)
21 {
22 m_WaitForBoardingTime = newTime;
23 }
24
25 void SetDriver(IEntity driver)
26 {
27 m_pDriverEntity = driver;
28 }
29
30 IEntity GetDriver()
31 {
32 if (m_pDriverEntity)
33 {
34 return m_pDriverEntity;
35 };
36
37 return GetGame().GetWorld().FindEntityByName(m_sDriverCharacterName);
38 }
39
41 {
42 ChimeraCharacter char = ChimeraCharacter.Cast(GetDriver());
43 if (char)
44 {
45 CompartmentAccessComponent comp = char.GetCompartmentAccessComponent();
46 if (comp)
47 {
48 if (comp.IsInCompartment())
49 {
50 BaseCompartmentSlot slot = comp.GetCompartment();
51 if (slot)
52 {
53 auto testDriverSlot = PilotCompartmentSlot.Cast(slot);
54 if (testDriverSlot)
55 return slot.GetOwner();
56 }
57 }
58 }
59 }
60 return null;
61 }
62
63};
ArmaReforgerScripted GetGame()
Definition game.c:1398
proto external BaseWorld GetWorld()
void SCR_AIWaypoint(IEntitySource src, IEntity parent)
SCR_FieldOfViewSettings Attribute