Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ExtendedIdentity.c
Go to the documentation of this file.
3{
4 [Attribute("-1", desc: "Leave -1 to auto assign.", params: "-1 inf 1")]
5 protected int m_iAge;
6
7 [Attribute("-1", desc: "Day character is born or entity is created. Leave -1 to auto assign.", params: "-1 31 1")]
8 protected int m_iDayOfCreation;
9
10 [Attribute("-1", desc: "Month character is born or entity is created. Leave -1 to auto assign.", params: "-1 12 1")]
11 protected int m_iMonthOfCreation;
12
13 [Attribute(desc: "Original faction of entity. Leave empty to auto assign (Uses AIGroup or FactionAffiliationComponent to get faction). This is used to get random place of creation/birth within the faction.")]
14 protected string m_sFactionOfOriginKey;
15
16 [Attribute(desc: "Birth or creation place. Leave empty to auto assign.")]
18
19 protected int m_iFactionOfOriginIndex = -1;
20 protected int m_iPlaceOfOriginIndex = -1;
21
22 //------------------------------------------------------------------------------------------------
26 void SetAge(int age)
27 {
28 m_iAge = age;
29 }
30
31 //------------------------------------------------------------------------------------------------
34 int GetAge()
35 {
36 return m_iAge;
37 }
38
39 //------------------------------------------------------------------------------------------------
43 void SetDayOfCreation(int day)
44 {
45 m_iDayOfCreation = day;
46 }
47
48 //------------------------------------------------------------------------------------------------
52 {
53 return m_iDayOfCreation;
54 }
55
56 //------------------------------------------------------------------------------------------------
60 void SetMonthOfCreation(int month)
61 {
62 m_iMonthOfCreation = month;
63 }
64
65 //------------------------------------------------------------------------------------------------
69 {
70 return m_iMonthOfCreation;
71 }
72
73 //------------------------------------------------------------------------------------------------
78 void SetFactionOfOrigin(string factionKey)
79 {
80 m_sFactionOfOriginKey = factionKey.Trim();
81
82 FactionManager factionManager = GetGame().GetFactionManager();
83 if (!factionManager)
84 return;
85
86 Faction faction = factionManager.GetFactionByKey(m_sFactionOfOriginKey);
87 if (!faction)
88 return;
89
90 m_iFactionOfOriginIndex = factionManager.GetFactionIndex(faction);
91 }
92
93 //------------------------------------------------------------------------------------------------
98 void SetFactionOfOrigin(int factionIndex)
99 {
100 m_iFactionOfOriginIndex = factionIndex;
101
102 FactionManager factionManager = GetGame().GetFactionManager();
103 if (!factionManager)
104 return;
105
106 Faction faction = factionManager.GetFactionByIndex(m_iFactionOfOriginIndex);
107 if (!faction)
108 return;
109
110 m_sFactionOfOriginKey = faction.GetFactionKey();
111 }
112
113 //------------------------------------------------------------------------------------------------
125
126 //------------------------------------------------------------------------------------------------
138
139 //------------------------------------------------------------------------------------------------
145 void SetPlaceOfOrigin(SCR_UIInfo place, bool isOverwrite)
146 {
147 m_PlaceOfOrigin = place;
148
149 if (isOverwrite)
151 }
152
153 //------------------------------------------------------------------------------------------------
159 {
161
162 if (index < 0)
163 return;
164
165 int factionOfOrigin = GetFactionOfOriginIndex();
166 if (factionOfOrigin < 0)
167 return;
168
169 FactionManager factionManager = GetGame().GetFactionManager();
170 if (!factionManager)
171 return;
172
173 SCR_Faction scrFaction = SCR_Faction.Cast(factionManager.GetFactionByIndex(factionOfOrigin));
174 if (!scrFaction)
175 return;
176
178 if (!territory)
179 return;
180
182 if (!uinfo)
183 return;
184
185 SetPlaceOfOrigin(uinfo, false);
186 }
187
188 //------------------------------------------------------------------------------------------------
195
196 //------------------------------------------------------------------------------------------------
200 {
202 }
203}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SetPlaceOfOriginIndex(int index)
void SetFactionOfOrigin(string factionKey)
void SetMonthOfCreation(int month)
void SetFactionOfOrigin(int factionIndex)
void SetPlaceOfOrigin(SCR_UIInfo place, bool isOverwrite)
SCR_FactionHomeTerritoryConfig GetFactionHomeTerritoryConfig()
static bool IsEmptyOrWhiteSpace(string input)
SCR_FieldOfViewSettings Attribute