7 [
Attribute(defvalue:
"1",
desc:
"If true then callsigns will be assigned at random rather then trying to keep callsigns close")]
8 protected bool m_bIsAssignedRandomly;
11 protected ref array<ref SCR_CallsignInfo> m_aCompanyNames;
13 [
Attribute(defvalue:
"4",
desc:
"Index of overflow companies. Starting with the given index, these companies will only be assigned if all company indexes above are taken")]
14 protected int m_iCompanyOverflowIndex;
17 protected ref array<ref SCR_CallsignInfo> m_aPlatoonNames;
20 protected ref array<ref SCR_CallsignInfo> m_aSquadNames;
22 [
Attribute(
desc:
"Used to show callsigns of groups. %1 = Company, %2 = Platoon, %3 = Squad")]
25 [
Attribute(
desc:
"Used when showing callsign of character that has no specific role. %1 = Company, %2 = Platoon, %3 = Squad, %4 = CharacterNumber")]
28 [
Attribute(
desc:
"If character has a specific role this formating will be used instead. %1 = Company, %2 = Platoon, %3 = Squad, %4 = CharacterRole")]
31 [
Attribute(
desc:
"A character can have one role at the time and a group can only have one of each role. Note that roles are assigned in order, so make sure important roles (Such as leader) are on top of the list.")]
32 protected ref array<ref SCR_BaseRoleCallsign> m_aCharacterRoleCallsigns;
38 string GetCallsignFormat(
bool includeCharacter,
int characterRole = -1)
40 if (!includeCharacter)
41 return m_sCallsignGroupFormat;
42 else if (characterRole < 0)
43 return m_sCallsignCharacterFormat;
45 return m_sCallsignCharacterWithRoleFormat;
52 bool GetIsAssignedRandomly()
54 return m_bIsAssignedRandomly;
61 void GetCompanyArray(notnull array<ref SCR_CallsignInfo> companyArray)
66 companyArray.Insert(info);
73 void GetPlatoonArray(notnull array<ref SCR_CallsignInfo> platoonArray)
78 platoonArray.Insert(info);
85 void GetSquadArray(notnull array<ref SCR_CallsignInfo> squadArray)
90 squadArray.Insert(info);
98 string GetCompanyCallsignName(
int index)
100 if (index < 0 || index >= m_aCompanyNames.Count())
101 return index.ToString();
103 return m_aCompanyNames[
index].GetCallsign();
110 int GetCompanyOverflowIndex()
112 return m_iCompanyOverflowIndex;
120 string GetPlatoonCallsignName(
int index)
122 if (index < 0 || index >= m_aPlatoonNames.Count())
123 return index.ToString();
125 return m_aPlatoonNames[
index].GetCallsign();
133 string GetSquadCallsignName(
int index)
135 if (index < 0 || index >= m_aSquadNames.Count())
136 return index.ToString();
138 return m_aSquadNames[
index].GetCallsign();
146 string GetCharacterRoleCallsignName(
int index)
148 if (!m_aCharacterRoleCallsigns.IsEmpty())
152 if (callsign.GetRoleIndex() ==
index)
153 return callsign.GetRoleName();
157 Print(
string.Format(
"Given Role index: '%1' does not exist in role data!",
index.ToString()), LogLevel.ERROR);
158 return index.ToString();
167 bool GetRandomCallsign(out
int company, out
int platoon, out
int squad)
173 if (!m_aCompanyNames || m_aCompanyNames.Count() == 0 || !m_aPlatoonNames || m_aPlatoonNames.Count() == 0 || !m_aSquadNames || m_aSquadNames.Count() == 0)
178 company = Math.RandomInt(0, m_aCompanyNames.Count());
179 platoon = Math.RandomInt(0, m_aPlatoonNames.Count());
180 squad = Math.RandomInt(0, m_aSquadNames.Count());
196 bool GetCharacterRoleCallsign(IEntity character,
int playerID,
SCR_AIGroup group, inout
int roleCallsignIndex, out
bool isUnique)
200 if (roleCallsign.IsValidRole(character, playerID, group, roleCallsignIndex, isUnique))