10 [
Attribute(
"0.25",
desc:
"The chance of the identity documentation in the characters inventory being valuable meaning the player can hand them in for a bonus",
params:
"0 1")]
32 super.RandomizeIdentity(combinedBioIndex);
36 Print(
"'SCR_ExtendedCharacterIdentityComponent' could not find 'SCR_ExtendedCharacterIdentity' it is either missing or does not use (or inherent from) SCR_ExtendedCharacterIdentity class! Identity is not set for character!",
LogLevel.ERROR);
58 super.OverwriteExtendedIdentity(newExtendedIdentity);
63 if (!newCharacterExtendedIdentity || !characterExtendedIdentity)
83 CharacterIdentityComponent characterIdentityComponent = CharacterIdentityComponent.Cast(owner.
FindComponent(CharacterIdentityComponent));
84 if (!characterIdentityComponent)
87 Identity identity = characterIdentityComponent.GetIdentity();
92 identity.SetName(overwriteName);
95 identity.SetAlias(overwriteAlias);
98 identity.SetSurname(overwriteSurname);
144 if (!generateValuableIntel)
159 FactionAffiliationComponent affiliationComp = FactionAffiliationComponent.Cast(owner.
FindComponent(FactionAffiliationComponent));
160 if (!affiliationComp)
164 return GetGame().GetFactionManager().GetFactionIndex(affiliationComp.GetAffiliatedFaction());
173 if (!characterIdentity)
176 BaseGameMode gameMode =
GetGame().GetGameMode();
188 int day, month, year, hour, minute, seconds;
190 timeManager.GetDate(year, month, day);
191 timeManager.GetHoursMinutesSeconds(hour, minute, seconds);
193 int totalDeathDateMinutes =
SCR_DateTimeHelper.ConvertDateIntoMinutes(year, month, day, hour, minute);
204 if (!characterIdentity)
208 if (totalDeathDateMinutes <= 0)
212 int deathYear, deathMonth, deathDay, deathHour, deathMinute;
213 SCR_DateTimeHelper.ConvertMinutesIntoDate(totalDeathDateMinutes, deathYear, deathMonth, deathDay, deathHour, deathMinute);
215 characterIdentity.
SetDeathDateAndTime(deathDay, deathMonth, deathYear, deathHour, deathMinute);
223 super.AssignBio(identityBio);
229 if (!advanceCharacterOverwrite)
237 string overwriteName, overwriteAlias, overwriteSurname;
239 if (advanceCharacterOverwrite.
GetOverwriteNames(overwriteName, overwriteAlias, overwriteSurname))
250 if (!gamemode || !gamemode.
IsMaster())
258 if (FactionOfOrigin <= -1)
265 AIControlComponent aiControlComp = AIControlComponent.Cast(owner.
FindComponent(AIControlComponent));
269 AIAgent aIAgent = aiControlComp.GetAIAgent();
287 FactionManager factionManager =
GetGame().GetFactionManager();
294 if (placeOfBirthConfig)
303 if (placeOfBirthConfig)
306 if (aiGroup.GetLeaderAgent() == null || aiGroup.GetLeaderAgent() == aIAgent)
308 if (placeOfBirthConfig)
317 IEntity leaderEntity = aiGroup.GetLeaderEntity();
326 if (!leaderExtendedIdentityComponent)
332 SCR_ExtendedIdentity leaderExtendedIdentity = leaderExtendedIdentityComponent.GetExtendedIdentity();
333 if (!leaderExtendedIdentity)
348 float randomPercentage =
m_Randomizer.RandIntInclusive(0, 100);
367 FactionManager factionManager =
GetGame().GetFactionManager();
375 if (!placeOfBirthConfig)
418 if (!identityManager)
428 super.DelayedInit(owner);
440 if (!controllerComponent)
457 if (!controllerComponent)
467 super.RplSave(writer);
470 if (!charExtendedIdentity)
473 int deathYear, deathMonth, deathDay, deathHour, deathMinute;
474 charExtendedIdentity.
GetDeathDateAndTime(deathDay, deathMonth, deathYear, deathHour, deathMinute);
476 int totalDeathDateMinutes;
480 totalDeathDateMinutes = 0;
483 totalDeathDateMinutes =
SCR_DateTimeHelper.ConvertDateIntoMinutes(deathYear, deathMonth, deathDay, deathHour, deathMinute);
485 writer.WriteInt(totalDeathDateMinutes);
486 writer.WriteInt(charExtendedIdentity.GetPlaceOfOriginIndex());
494 super.RplLoad(reader);
499 int totalDeathDateMinutes, placeOfOrginIndex;
500 reader.ReadInt(totalDeathDateMinutes);
501 reader.ReadInt(placeOfOrginIndex);
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameMode GetGameMode()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
ref OnLifeStateChangedInvoker m_OnLifeStateChanged
override void AssignBio(SCR_IdentityBio identityBio)
SCR_EIdentityGender GetGender()
float m_fChanceOfIdentityDocumentBeingValuable
bool m_bIdentityItemAdded
void SetCharacterPlaceOfOriginBroadcast(int index)
override void OnDelete(IEntity owner)
override void RandomizePlaceOfOrigin()
void OnCharacterDeath()
Called by SCR_CharacterIdentityManagerComponent when character dies (Server Only).
SCR_EIdentityGender m_eGender
void OnCharacterDeathBroadCast(int totalDeathDateMinutes)
override void DelayedInit(IEntity owner)
void OverwriteCharacterName(string overwriteName, string overwriteAlias, string overwriteSurname)
override void OverwriteExtendedIdentity(SCR_ExtendedIdentity newExtendedIdentity)
void SetPlayerID(int playerId)
Set this character player ID. Handled in the preparing of this character by the SCR_IdentityManagerCo...
int OnIdentityItemAdded_S(SCR_IdentityInventoryItemComponent item, bool generateValuableIntel)
override bool RplLoad(ScriptBitReader reader)
void OnCharacterLifeStateChanged(ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
override void RandomizeIdentity(int combinedBioIndex)
override bool RplSave(ScriptBitWriter writer)
void SetPlaceOfOriginIndex(int index)
bool WasIdentityItemAddedOnce_S()
bool GetDeathDateAndTime(out int deathDay, out int deathMonth, out int deathYear, out int deathHour, out int deathMinute)
void SetBloodType(SCR_EBloodType bloodType)
SCR_EBloodType GetBloodType()
void SetDeathDateAndTime(int deathDay, int deathMonth, int deathYear, int deathHour, int deathMinute)
ref SCR_ExtendedIdentity m_ExtendedIdentity
bool m_bDelayedInitCalled
ref SCR_IdentityBio m_IdentityBio
ref RandomGenerator m_Randomizer
int GetFactionOfOriginIndex()
int GetPlaceOfOriginIndex()
float GetSharedPlaceOfBirthWeight()
int GetRandomHomeTerritoryIndex(RandomGenerator randomizer=null, bool useWeightedRandom=true)
SCR_FactionHomeTerritoryConfig GetFactionHomeTerritoryConfig()
bool GetOverwriteNames(out string name, out string alias, out string surname)
void OnCharacterBecomeUnconscious(IEntity character)
static SCR_IdentityManagerComponent GetInstance()
int GetRandomBloodTypeIndex(RandomGenerator randomizer=null, bool useWeightedRandom=true)
static bool IsEmptyOrWhiteSpace(string input)
proto external GenericEntity GetOwner()
Get owner entity.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.