Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
bot_timedwait.c
Go to the documentation of this file.
1
2
class
BotEventWaitTimeout
:
BotEventBase
{ };
3
4
class
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
33
m_dtAccumulator
+= dt;
34
35
float
rescanTime =
m_Timeout
;
36
if
(
m_dtAccumulator
>= rescanTime)
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
botDebugSpam
void botDebugSpam(string s)
Definition
bot.c:131
OnTimeout
override void OnTimeout()
Definition
bot_testspamuseractions.c:132
BotEventBase
represents event that triggers transition from state to state
Definition
botevents.c:5
BotEventBase::BotEventBase
void BotEventBase(PlayerBase p=NULL, EntityAI e=NULL)
Definition
botevents.c:9
BotEventWaitTimeout
Definition
bot_timedwait.c:2
Bot
Definition
bot.c:19
BotStateBase
represent weapon state base
Definition
bot_hunt.c:16
BotStateBase::m_Timeout
float m_Timeout
Definition
bot_timedwait.c:7
BotStateBase::m_Periodic
bool m_Periodic
Definition
bot_timedwait.c:8
BotStateBase::BotStateBase
void BotStateBase(Bot bot=NULL, BotStateBase parent=NULL)
nested state machine (or null)
Definition
botstates.c:17
BotStateBase::m_dtAccumulator
float m_dtAccumulator
Definition
bot_hunt.c:18
BotStateBase::BotTimedWait
void BotTimedWait(Bot bot=NULL, BotStateBase parent=NULL, float timeout=3.0)
Definition
bot_timedwait.c:10
BotStateBase::OnExit
override void OnExit(BotEventBase e)
Definition
bot_timedwait.c:22
BotStateBase::m_Owner
PlayerBase m_Owner
Definition
botstates.c:12
BotStateBase::OnEntry
override void OnEntry(BotEventBase e)
Definition
bot_timedwait.c:15
BotStateBase::OnUpdate
override void OnUpdate(float dt)
Definition
bot_timedwait.c:29
BotStateBase::m_Bot
Bot m_Bot
man that this state belongs to
Definition
botstates.c:13
BotStateBase::OnTimeout
void OnTimeout()
Definition
bot_timedwait.c:47
m_dtAccumulator
class WeaponFireWithEject extends WeaponFire m_dtAccumulator
Games
Dayz
scripts
4_world
systems
bot
bot_timedwait.c
Generated by
1.17.0