Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
aibehaviour.c
Go to the documentation of this file.
1 
7 /*
8 class AIMessage: Managed
9 
10 {
11  Param m_Parameters;
12  int m_CrcMessage;
13  Param GetParameters();
14  int GetTypeNameCRC();
15 }
16 
17 class AIMessageTest : AIMessage
18 {
19  int GetTypeNameCRC() {return testCRC;}
20  //static int testCRC = 5;
21 }
22 
23 */
24 
25 
27 {
28  private void AIBehaviourHLData() {}
29  private void ~AIBehaviourHLData() {}
30 
31  //void ParseConfig(ParamEntryPar param, AIWorld* world, AIAgentTemplate* agentTemplate) {};
32  void OnParseConfig();
33 
34  //Can be use only inside OnParseConfig function
35  proto native void ParseBehaviourSlot(string name);
36  proto native void ParseAlertLevel(string name);
37  proto native float ReadParamValue(string paramName, float defValue);
38 
39 }
40 
41 
42 class AIBehaviourHL
43 {
44  private void AIBehaviourHL() {}
45  private void ~AIBehaviourHL() {}
46 
47  proto native AIBehaviourHLData GetTemplateData();
48 
49  void OnInit(){};
50  //private void AIBehaviourHL_script() {};
51  //private void ~AIBehaviourHL_script() {};
52 
53  void Simulate (float timeDelta)
54  {
55  //time = time + timeDelta;
56  //Print("A2");
57  }
58 
59 
60  //void OnNoise(AINoiseInfo noise, EntityAI source){}
61  void OnDamage(float damage, EntityAI source){}
62 
64  void OnAnimationEvent(int nameCrc){}
65  //void OnMessage(AIMessage message){}
66  //void OnBehaviourSwitched(AIBehaviour* behaviour){}
67  proto native void SetNextBehaviour(int BehaviourCrc);
68  proto native void SwitchToNextBehaviour();
69 
70  static proto void RegAIBehaviour(string behname,typename behClass, typename behClassData);
71 };
72 
73 
75 {
76  //AIBehaviourHLDataZombie2 data;
77  //int state;
78  //float time;
79  AIBehaviourHLDataZombie2 GetData()
80  {
82  }
83 
84  private void AIBehaviourHLZombie2() {}
85  private void ~AIBehaviourHLZombie2() {}
86 
87  override void OnInit()
88  {
89  SetNextBehaviour(0x7b9a4ee9);
91  //Print("OnInit");
92  //data = GetData();
93  //float a = data.m_fDamageToCrawl;
94  //Print(a);
95  }
96 
97  override void Simulate (float timeDelta)
98  {
99  //time = time + timeDelta;
100  //Print("B2");
101  }
102 
103  void ShowDebugInfo()
104  {
105  //Print(time);
106  };
107 
108  //void OnMessage(AIMessage message)
109  //{
110  //int ID = message.GetTypeNameCRC();
111  //Print(ID);
112 
113  //}
114 };
115 
117 {
118  float m_fDamageToCrawl;
119  float m_fCrawlProbability;
120 
121  private void AIBehaviourHLDataZombie2() {}
122  private void ~AIBehaviourHLDataZombie2() {}
123 
124  override void OnParseConfig()
125  {
126  Print("zombie data parse config start");
127 
128  ParseBehaviourSlot("Calm");
129  ParseBehaviourSlot("Attracted");
130  ParseBehaviourSlot("Disturbed");
131  ParseBehaviourSlot("Alerted");
132 
133  ParseAlertLevel("Calm");
134  ParseAlertLevel("Disturbed");
135  ParseAlertLevel("Attracted");
136  ParseAlertLevel("Alerted");
137 
138  m_fDamageToCrawl = ReadParamValue("damageToCrawl",0.01);
139  m_fCrawlProbability = ReadParamValue("crawlProbability",0.01);
140 
141  Print("zombie data parse config end");
142  }
143 };
144 
145 //NewNPC(model,behname,....)
146 
147 
OnDamageInflicted
void OnDamageInflicted()
Definition: aibehaviour.c:63
AIBehaviourHL
AIBehaviourHLZombie2 AIBehaviourHL
Definition: aibehaviour.c:44
Simulate
void Simulate(float timeDelta)
Definition: aibehaviour.c:53
~AIBehaviourHL
private void ~AIBehaviourHL()
Definition: aibehaviour.c:45
Print
proto void Print(void var)
Prints content of variable to console/log.
AIBehaviourHLDataZombie2
Definition: aibehaviour.c:116
ParseBehaviourSlot
proto native void ParseBehaviourSlot(string name)
SetNextBehaviour
proto native void SetNextBehaviour(int BehaviourCrc)
OnAnimationEvent
void OnAnimationEvent(int nameCrc)
Definition: aibehaviour.c:64
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ParseAlertLevel
proto native void ParseAlertLevel(string name)
AIBehaviourHLData
Definition: aibehaviour.c:26
OnInit
void OnInit()
Definition: aibehaviour.c:49
AIBehaviourHLZombie2
Definition: aibehaviour.c:74
ReadParamValue
proto native float ReadParamValue(string paramName, float defValue)
OnDamage
void OnDamage(float damage, EntityAI source)
Definition: aibehaviour.c:61
SwitchToNextBehaviour
proto native void SwitchToNextBehaviour()
EntityAI
Definition: building.c:5
GetTemplateData
proto native AIBehaviourHLData GetTemplateData()