DayZ 1.24
Loading...
Searching...
No Matches
Bot_TimedWait.c
Go to the documentation of this file.
1
3
4class BotTimedWait extends BotStateBase
5{
6 protected float m_dtAccumulator = 0.0;
7 protected float m_Timeout = 3.0;
8 protected bool m_Periodic = true;
9
10 void BotTimedWait(Bot bot = NULL, BotStateBase parent = NULL, float timeout = 3.0)
11 {
12 m_Timeout = timeout;
13 }
14
15 override void OnEntry(BotEventBase e)
16 {
17 m_dtAccumulator = 0.0;
18
19 super.OnEntry(e);
20 }
21
22 override void OnExit(BotEventBase e)
23 {
24 m_dtAccumulator = 0.0;
25
26 super.OnExit(e);
27 }
28
29 override void OnUpdate(float dt)
30 {
31 super.OnUpdate(dt);
32
34
35 float rescanTime = m_Timeout;
37 {
38 OnTimeout();
39
40 if (m_Periodic)
41 m_dtAccumulator = 0.0;
42 else
43 m_dtAccumulator = -1.0;
44 }
45 }
46
47 void OnTimeout()
48 {
49 botDebugSpam("[bot] + " + m_Owner + " BotTimedWait::OnTimeout");
50 m_Bot.ProcessEvent(new BotEventWaitTimeout(m_Owner));
51 }
52};
53
void botDebugSpam(string s)
Definition Bot.c:191
override void OnTimeout()
enum ProcessDirectDamageFlags m_Owner
class WeaponFireWithEject extends WeaponFire m_dtAccumulator
represents event that triggers transition from state to state
Definition BotEvents.c:5
Definition Bot.c:19
represent weapon state base
Definition Bot_Hunt.c:16
void BotTimedWait(Bot bot=NULL, BotStateBase parent=NULL, float timeout=3.0)
override void OnUpdate(float dt)
override void OnEntry(BotEventBase e)
override void OnExit(BotEventBase e)