class DayZAIHitComponentHelpersSource
Methods 3
static void RegisterHitComponent(array<ref DayZAIHitComponent> pHitComponents, string pName, float pWeight)Register Hit Component for AI targeting
Register Hit Component for AI targeting to array defined on entity's Type (DayZPlayerType, DayZInfectedType, etc.) Uses component name from damage system (zone) and its weight.
- in
pHitComponents arraythat keeps registered compoenents- in
pName componentname (zone in Damage System)- in
pWeight weightof the component (probability)
References new DayZAIHitComponent(), array.Insert(), DayZAIHitComponent.m_Name
Show 1 more
, DayZAIHitComponent.m_WeightReferenced by Animal_BosTaurus.RegisterHitComponentsForAI(), Animal_CanisLupus.RegisterHitComponentsForAI(), Animal_CapraHircus.RegisterHitComponentsForAI()
Show 13 more
, Animal_CapreolusCapreolus.RegisterHitComponentsForAI(), Animal_CervusElaphus.RegisterHitComponentsForAI(), Animal_GallusGallusDomesticus.RegisterHitComponentsForAI(), Animal_LepusEuropaeus.RegisterHitComponentsForAI(), Animal_OvisAries.RegisterHitComponentsForAI(), Animal_RangiferTarandus.RegisterHitComponentsForAI(), Animal_SusDomesticus.RegisterHitComponentsForAI(), Animal_SusScrofa.RegisterHitComponentsForAI(), Animal_UrsusArctos.RegisterHitComponentsForAI(), Animal_VulpesVulpes.RegisterHitComponentsForAI(), DayZAnimal.RegisterHitComponentsForAI(), DayZInfectedType.RegisterHitComponentsForAI(), and DayZPlayerType.RegisterHitComponentsForAI()static bool SelectMostProbableHitComponent(array<ref DayZAIHitComponent> pHitComponents, out string pHitComponent)Computes hit component probability based on weights
- in
pHitComponents arraythat keeps registered compoenents- out
pHitComponent selectedcomponent name (can be passed to Damage System)
Returns: true if found, false otherwise
References array.Count(), array.Get(), Math.RandomInt()
Show 3 more
, SumOfWeights(), DayZAIHitComponent.m_Name, and DayZAIHitComponent.m_Weightstatic int SumOfWeights(array<ref DayZAIHitComponent> pHitComponents)Calculates the sum of all entries in DayZAIHitComponent array
- in
pHitComponents arraythat keeps registered compoenents
Returns: Sum of weights of all entries in array
Referenced by SelectMostProbableHitComponent()