Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScriptedCharacterInputContext.c
Go to the documentation of this file.
2{
3 int m_iLoiteringType = -1;
4 bool m_bLoiteringShouldHolsterWeapon;
5 bool m_bLoiteringShouldAlignCharacter;
6 bool m_bLoiteringRootMotion;
7 bool m_bLoiteringDisablePlayerInput;
8 vector m_mLoiteringPosition[4];
9 IEntity m_loiterEntity;
10 RplId m_loiterEntityRplId = RplId.Invalid();
11 ref SCR_LoiterCustomAnimData m_CustomAnimData;
12
13 //------------------------------------------------------------------------
14
15 IEntity GetLoiterEntity()
16 {
17 if (m_loiterEntity)
18 return m_loiterEntity;
19
20 return SCR_EntityHelper.RplIdToEntity(m_loiterEntityRplId);
21 }
22
23 //------------------------------------------------------------------------
24 void SetLoiteringEntity(IEntity ent)
25 {
26 m_loiterEntity = ent;
27 m_loiterEntityRplId = SCR_EntityHelper.EntityToRplId(m_loiterEntity);
28 }
29
30 //------------------------------------------------------------------------
31 void SetLoiteringEntityId(RplId id)
32 {
33 m_loiterEntityRplId = id;
34 m_loiterEntity = SCR_EntityHelper.RplIdToEntity(id);
35 }
36
37 //------------------------------------------------------------------------
38 void OnRplLoad(ScriptBitReader r)
39 {
40 r.ReadInt(m_iLoiteringType);
41 r.ReadBool(m_bLoiteringShouldHolsterWeapon);
42 r.ReadBool(m_bLoiteringShouldAlignCharacter);
43 r.ReadBool(m_bLoiteringRootMotion);
44 r.ReadBool(m_bLoiteringDisablePlayerInput);
45
47 r.ReadVector(position);
48
50 r.ReadVector(angles);
51
53 Math3D.AnglesToMatrix(angles, rotation);
54 m_mLoiteringPosition[3] = position;
55 m_mLoiteringPosition[0] = rotation[0];
56 m_mLoiteringPosition[1] = rotation[1];
57 m_mLoiteringPosition[2] = rotation[2];
58
59 RplId rplId;
60 r.ReadRplId(rplId);
61
62 SetLoiteringEntityId(rplId);
63
64 bool hasCustomData;
65 r.ReadBool(hasCustomData);
66 if (hasCustomData)
67 {
68 m_CustomAnimData = new SCR_LoiterCustomAnimData();
69 m_CustomAnimData.OnRplLoad(r);
70 }
71 else
72 {
73 m_CustomAnimData = SCR_LoiterCustomAnimData.Default;
74 }
75 }
76 //------------------------------------------------------------------------
77
78 void OnRplSave(ScriptBitWriter w)
79 {
80 w.WriteInt(m_iLoiteringType);
81 w.WriteBool(m_bLoiteringShouldHolsterWeapon);
82 w.WriteBool(m_bLoiteringShouldAlignCharacter);
83 w.WriteBool(m_bLoiteringRootMotion);
84 w.WriteBool(m_bLoiteringDisablePlayerInput);
85 w.WriteVector(m_mLoiteringPosition[3]);
86 w.WriteVector(Math3D.MatrixToAngles(m_mLoiteringPosition));
87 w.WriteRplId(SCR_EntityHelper.EntityToRplId(m_loiterEntity));
88
89 if (m_CustomAnimData && !m_CustomAnimData.IsDefault())
90 {
91 w.WriteBool(true);
92 m_CustomAnimData.OnRplSave(w);
93 }
94 else
95 {
96 w.WriteBool(false);
97 }
98
99 }
100}
AddonBuildInfoTool id
ref array< string > angles
vector position
Replication item identifier.
Definition RplId.c:14
static IEntity RplIdToEntity(RplId id)
static RplId EntityToRplId(IEntity ent)
RespawnSystemComponentClass GameComponentClass vector vector rotation