DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Bot_Tests.c
См. документацию.
4
6{
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
45{
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
84{
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
void botDebugPrint(string s)
Определения Bot.c:122
represents event that triggers transition from state to state
Определения BotEvents.c:5
Определения Bot.c:19
PlayerBase m_Owner
Определения BotStates.c:12
void BotStateBase(Bot bot=NULL, BotStateBase parent=NULL)
nested state machine (or null)
Определения BotStates.c:17
override void OnUpdate(float dt)
Определения Bot_Tests.c:101
void BotTestSwapG2H(Bot bot=NULL, BotStateBase parent=NULL)
Определения Bot_Tests.c:88
EntityAI m_Entity1
Определения Bot_Tests.c:85
override void OnEntry(BotEventBase e)
Определения Bot_Tests.c:91
EntityAI m_Entity2
Определения Bot_Tests.c:86
EntityAI m_Entity2
Определения Bot_Tests.c:8
override void OnEntry(BotEventBase e)
Определения Bot_Tests.c:13
void BotTestSwapInternal(Bot bot=NULL, BotStateBase parent=NULL)
Определения Bot_Tests.c:10
EntityAI m_Entity1
Определения Bot_Tests.c:7
override void OnUpdate(float dt)
Определения Bot_Tests.c:23
EntityAI m_Entity2
Определения Bot_Tests.c:47
override void OnUpdate(float dt)
Определения Bot_Tests.c:62
EntityAI m_Entity1
Определения Bot_Tests.c:46
void BotTestSwapInternalC2H(Bot bot=NULL, BotStateBase parent=NULL)
Определения Bot_Tests.c:49
override void OnEntry(BotEventBase e)
Определения Bot_Tests.c:52
Определения Bot_Tests.c:2
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
proto native EntityAI CreateAttachment(string typeName)
Create Entity of specified type as attachment of entity.
script counterpart to engine's class Inventory