Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
bot_stancerandomizer.c
Go to the documentation of this file.
1
class
BotStanceRandomizer
extends
BotStateBase
2
{
3
ref
HumanMovementState
m_State
=
new
HumanMovementState
();
4
5
float
m_dtAccumulator
= 0.0;
6
7
void
BotStanceRandomizer
(
Bot
bot = NULL,
BotStateBase
parent = NULL)
8
{
9
}
10
11
override
void
OnEntry
(
BotEventBase
e)
12
{
13
m_dtAccumulator
= 0.0;
14
15
super.OnEntry(e);
16
}
17
18
override
void
OnExit
(
BotEventBase
e)
19
{
20
m_dtAccumulator
= 0.0;
21
22
super.OnExit(e);
23
}
24
25
override
void
OnUpdate
(
float
dt)
26
{
27
super.OnUpdate(dt);
28
29
m_dtAccumulator
+= dt;
30
31
GetPlayerOwner
().GetMovementState(
m_State
);
32
33
HumanCommandMove
cm =
GetPlayerOwner
().GetCommand_Move();
34
if
(cm && !cm.
IsChangingStance
())
35
{
36
if
(
m_State
.m_iStanceIdx ==
DayZPlayerConstants
.STANCEIDX_PRONE)
37
{
38
cm.
ForceStance
(
DayZPlayerConstants
.STANCEIDX_ERECT);
39
}
40
else
41
{
42
cm.
ForceStance
(
DayZPlayerConstants
.STANCEIDX_PRONE);
43
}
44
}
45
}
46
};
BotEventBase
represents event that triggers transition from state to state
Definition
botevents.c:5
Bot
Definition
bot.c:19
BotStateBase
represent weapon state base
Definition
bot_hunt.c:16
BotStateBase::m_State
ref HumanMovementState m_State
Definition
bot_stancerandomizer.c:3
BotStateBase::BotStanceRandomizer
void BotStanceRandomizer(Bot bot=NULL, BotStateBase parent=NULL)
Definition
bot_stancerandomizer.c:7
BotStateBase::BotStateBase
void BotStateBase(Bot bot=NULL, BotStateBase parent=NULL)
nested state machine (or null)
Definition
botstates.c:17
BotStateBase::GetPlayerOwner
PlayerBase GetPlayerOwner()
Definition
botstates.c:19
BotStateBase::m_dtAccumulator
float m_dtAccumulator
Definition
bot_hunt.c:18
BotStateBase::OnExit
override void OnExit(BotEventBase e)
Definition
bot_stancerandomizer.c:18
BotStateBase::OnEntry
override void OnEntry(BotEventBase e)
Definition
bot_stancerandomizer.c:11
BotStateBase::OnUpdate
override void OnUpdate(float dt)
Definition
bot_stancerandomizer.c:25
HumanCommandMove
Definition
human.c:434
HumanCommandMove::ForceStance
proto native void ForceStance(int pStanceIdx)
pStanceIds is one of STANCEIDX_ERECT,STANCEIDX_CROUCH,STANCEIDX_PRONE,STANCEIDX_RAISEDERECT,...
HumanCommandMove::IsChangingStance
proto native bool IsChangingStance()
returns true if character is changing stance
HumanMovementState
Definition
human.c:1154
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Games
Dayz
scripts
4_world
systems
bot
bot_stancerandomizer.c
Generated by
1.17.0