DayZ 1.24
Loading...
Searching...
No Matches
Bot_Tests.c
Go to the documentation of this file.
4
6{
9
11 { }
12
13 override void OnEntry(BotEventBase e)
14 {
15 super.OnEntry(e);
16 EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
17 m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
18 EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
19 m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
20 }
21
22 override void OnUpdate(float dt)
23 {
24 super.OnUpdate(dt);
25
26 if (m_Entity1 && m_Entity2)
27 {
28 if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity1, m_Entity2))
29 {
30 botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
31 m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
32 }
33 else if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity2, m_Entity1))
34 {
35 botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
36 m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
37 }
38 }
39 }
40};
41
42
44{
47
50
51 override void OnEntry(BotEventBase e)
52 {
53 super.OnEntry(e);
54 EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
55 m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
56 EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
57 m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
58 m_Owner.PredictiveTakeEntityToHands(m_Entity2);
59 }
60
61 override void OnUpdate(float dt)
62 {
63 super.OnUpdate(dt);
64
65 if (m_Entity1 && m_Entity2)
66 {
67 if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity1, m_Entity2))
68 {
69 botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
70 m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
71 }
72 else if (m_Owner.GetInventory().CanSwapEntitiesEx(m_Entity2, m_Entity1))
73 {
74 botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
75 m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
76 }
77 }
78 }
79};
80
81
83{
86
88 { }
89
90 override void OnEntry(BotEventBase e)
91 {
92 super.OnEntry(e);
93 EntityAI j = m_Owner.GetInventory().CreateAttachment("Jeans_Blue");
94 m_Entity1 = j.GetInventory().CreateEntityInCargo("Rag");
95 EntityAI s = m_Owner.GetInventory().CreateInInventory("TacticalShirt_Grey");
96 m_Entity2 = s.GetInventory().CreateEntityInCargo("Roadflare");
97 m_Owner.PredictiveDropEntity(m_Entity2);
98 }
99
100 override void OnUpdate(float dt)
101 {
102 super.OnUpdate(dt);
103
104 /*if (m_Entity1 && m_Entity2)
105 {
106 if (m_Owner.GetInventory().CanSwapEntities(m_Entity1, m_Entity2))
107 {
108 botDebugPrint("[bot] + " + m_Owner + " -> swap item=" + m_Entity1 + " bot=" + m_Owner);
109 m_Owner.PredictiveSwapEntities(m_Entity1, m_Entity2);
110 }
111 else if (m_Owner.GetInventory().CanSwapEntities(m_Entity2, m_Entity1))
112 {
113 botDebugPrint("[bot] + " + m_Owner + " <- swap item=" + m_Entity2 + " bot=" + m_Owner);
114 m_Owner.PredictiveSwapEntities(m_Entity2, m_Entity1);
115 }
116 }*/
117 }
118};
119
void botDebugPrint(string s)
Definition Bot.c:182
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
PlayerBase m_Owner
Definition BotStates.c:12
override void OnUpdate(float dt)
Definition Bot_Tests.c:100
void BotTestSwapG2H(Bot bot=NULL, BotStateBase parent=NULL)
Definition Bot_Tests.c:87
EntityAI m_Entity1
Definition Bot_Tests.c:84
override void OnEntry(BotEventBase e)
Definition Bot_Tests.c:90
EntityAI m_Entity2
Definition Bot_Tests.c:85
override void OnUpdate(float dt)
Definition Bot_Tests.c:61
void BotTestSwapInternalC2H(Bot bot=NULL, BotStateBase parent=NULL)
Definition Bot_Tests.c:48
override void OnEntry(BotEventBase e)
Definition Bot_Tests.c:51
EntityAI m_Entity2
Definition Bot_Tests.c:8
override void OnEntry(BotEventBase e)
Definition Bot_Tests.c:13
void BotTestSwapInternal(Bot bot=NULL, BotStateBase parent=NULL)
Definition Bot_Tests.c:10
EntityAI m_Entity1
Definition Bot_Tests.c:7
override void OnUpdate(float dt)
Definition Bot_Tests.c:22