Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
bot_tests.c
Go to the documentation of this file.
1
class
BotTestSwapWithCorpse
:
BotStateBase
2
{
3
};
4
5
class
BotTestSwapInternal
:
BotStateBase
6
{
7
EntityAI
m_Entity1
;
8
EntityAI
m_Entity2
;
9
10
void
BotTestSwapInternal
(
Bot
bot = NULL,
BotStateBase
parent = NULL)
11
{ }
12
13
override
void
OnEntry
(
BotEventBase
e)
14
{
15
super.OnEntry(e);
16
GameInventory
ownerInventory =
m_Owner
.GetInventory();
17
EntityAI
j = ownerInventory.
CreateAttachment
(
"Jeans_Blue"
);
18
m_Entity1
= j.GetInventory().CreateEntityInCargo(
"Rag"
);
19
EntityAI
s = ownerInventory.
CreateInInventory
(
"TacticalShirt_Grey"
);
20
m_Entity2
= s.GetInventory().CreateEntityInCargo(
"Roadflare"
);
21
}
22
23
override
void
OnUpdate
(
float
dt)
24
{
25
super.OnUpdate(dt);
26
27
if
(
m_Entity1
&&
m_Entity2
)
28
{
29
if
(
m_Owner
.GetInventory().CanSwapEntitiesEx(
m_Entity1
,
m_Entity2
))
30
{
31
botDebugPrint
(
"[bot] + "
+
m_Owner
+
" -> swap item="
+
m_Entity1
+
" bot="
+
m_Owner
);
32
m_Owner
.PredictiveSwapEntities(
m_Entity1
,
m_Entity2
);
33
}
34
else
if
(
m_Owner
.GetInventory().CanSwapEntitiesEx(
m_Entity2
,
m_Entity1
))
35
{
36
botDebugPrint
(
"[bot] + "
+
m_Owner
+
" <- swap item="
+
m_Entity2
+
" bot="
+
m_Owner
);
37
m_Owner
.PredictiveSwapEntities(
m_Entity2
,
m_Entity1
);
38
}
39
}
40
}
41
};
42
43
44
class
BotTestSwapInternalC2H
:
BotStateBase
45
{
46
EntityAI
m_Entity1
;
47
EntityAI
m_Entity2
;
48
49
void
BotTestSwapInternalC2H
(
Bot
bot = NULL,
BotStateBase
parent = NULL)
50
{ }
51
52
override
void
OnEntry
(
BotEventBase
e)
53
{
54
super.OnEntry(e);
55
EntityAI
j =
m_Owner
.GetInventory().CreateAttachment(
"Jeans_Blue"
);
56
m_Entity1
= j.GetInventory().CreateEntityInCargo(
"Rag"
);
57
EntityAI
s =
m_Owner
.GetInventory().CreateInInventory(
"TacticalShirt_Grey"
);
58
m_Entity2
= s.GetInventory().CreateEntityInCargo(
"Roadflare"
);
59
m_Owner
.PredictiveTakeEntityToHands(
m_Entity2
);
60
}
61
62
override
void
OnUpdate
(
float
dt)
63
{
64
super.OnUpdate(dt);
65
66
if
(
m_Entity1
&&
m_Entity2
)
67
{
68
if
(
m_Owner
.GetInventory().CanSwapEntitiesEx(
m_Entity1
,
m_Entity2
))
69
{
70
botDebugPrint
(
"[bot] + "
+
m_Owner
+
" -> swap item="
+
m_Entity1
+
" bot="
+
m_Owner
);
71
m_Owner
.PredictiveSwapEntities(
m_Entity1
,
m_Entity2
);
72
}
73
else
if
(
m_Owner
.GetInventory().CanSwapEntitiesEx(
m_Entity2
,
m_Entity1
))
74
{
75
botDebugPrint
(
"[bot] + "
+
m_Owner
+
" <- swap item="
+
m_Entity2
+
" bot="
+
m_Owner
);
76
m_Owner
.PredictiveSwapEntities(
m_Entity2
,
m_Entity1
);
77
}
78
}
79
}
80
};
81
82
83
class
BotTestSwapG2H
:
BotStateBase
84
{
85
EntityAI
m_Entity1
;
86
EntityAI
m_Entity2
;
87
88
void
BotTestSwapG2H
(
Bot
bot = NULL,
BotStateBase
parent = NULL)
89
{ }
90
91
override
void
OnEntry
(
BotEventBase
e)
92
{
93
super.OnEntry(e);
94
EntityAI
j =
m_Owner
.GetInventory().CreateAttachment(
"Jeans_Blue"
);
95
m_Entity1
= j.GetInventory().CreateEntityInCargo(
"Rag"
);
96
EntityAI
s =
m_Owner
.GetInventory().CreateInInventory(
"TacticalShirt_Grey"
);
97
m_Entity2
= s.GetInventory().CreateEntityInCargo(
"Roadflare"
);
98
m_Owner
.PredictiveDropEntity(
m_Entity2
);
99
}
100
101
override
void
OnUpdate
(
float
dt)
102
{
103
super.OnUpdate(dt);
104
105
/*if (m_Entity1 && m_Entity2)
106
{
107
if (m_Owner.GetInventory().CanSwapEntities(m_Entity1, m_Entity2))
108
{
109
botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
110
m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
111
}
112
else if (m_Owner.GetInventory().CanSwapEntities(m_Entity2, m_Entity1))
113
{
114
botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
115
m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
116
}
117
}*/
118
}
119
};
120
botDebugPrint
void botDebugPrint(string s)
Definition
bot.c:122
BotEventBase
represents event that triggers transition from state to state
Definition
botevents.c:5
Bot
Definition
bot.c:19
BotStateBase::BotStateBase
void BotStateBase(Bot bot=NULL, BotStateBase parent=NULL)
nested state machine (or null)
Definition
botstates.c:17
BotStateBase::m_Owner
PlayerBase m_Owner
Definition
botstates.c:12
BotTestSwapG2H::m_Entity1
EntityAI m_Entity1
Definition
bot_tests.c:85
BotTestSwapG2H::BotTestSwapG2H
void BotTestSwapG2H(Bot bot=NULL, BotStateBase parent=NULL)
Definition
bot_tests.c:88
BotTestSwapG2H::OnEntry
override void OnEntry(BotEventBase e)
Definition
bot_tests.c:91
BotTestSwapG2H::OnUpdate
override void OnUpdate(float dt)
Definition
bot_tests.c:101
BotTestSwapG2H::m_Entity2
EntityAI m_Entity2
Definition
bot_tests.c:86
BotTestSwapInternalC2H::m_Entity1
EntityAI m_Entity1
Definition
bot_tests.c:46
BotTestSwapInternalC2H::OnEntry
override void OnEntry(BotEventBase e)
Definition
bot_tests.c:52
BotTestSwapInternalC2H::OnUpdate
override void OnUpdate(float dt)
Definition
bot_tests.c:62
BotTestSwapInternalC2H::BotTestSwapInternalC2H
void BotTestSwapInternalC2H(Bot bot=NULL, BotStateBase parent=NULL)
Definition
bot_tests.c:49
BotTestSwapInternalC2H::m_Entity2
EntityAI m_Entity2
Definition
bot_tests.c:47
BotTestSwapInternal::m_Entity1
EntityAI m_Entity1
Definition
bot_tests.c:7
BotTestSwapInternal::BotTestSwapInternal
void BotTestSwapInternal(Bot bot=NULL, BotStateBase parent=NULL)
Definition
bot_tests.c:10
BotTestSwapInternal::OnEntry
override void OnEntry(BotEventBase e)
Definition
bot_tests.c:13
BotTestSwapInternal::OnUpdate
override void OnUpdate(float dt)
Definition
bot_tests.c:23
BotTestSwapInternal::m_Entity2
EntityAI m_Entity2
Definition
bot_tests.c:8
BotTestSwapWithCorpse
Definition
bot_tests.c:2
EntityAI
Definition
inventoryitem.c:2
GameInventory
script counterpart to engine's class Inventory
Definition
inventory.c:81
GameInventory::CreateInInventory
EntityAI CreateInInventory(string type)
Definition
inventory.c:876
GameInventory::CreateAttachment
proto native EntityAI CreateAttachment(string typeName)
Games
Dayz
scripts
4_world
systems
bot
bot_tests.c
Generated by
1.17.0