DayZ 1.24
Loading...
Searching...
No Matches
ActionContinuousBase.c
Go to the documentation of this file.
2{
3 bool m_inLoop = false;
4 bool m_callLoopEnd = false;
5
31
32
33 override void OnAnimationEvent(int pEventID)
34 {
36 {
38#ifdef DEVELOPER
39 //Print("ActionInteractBase.c | OnAnimationEvent | OnAnimationEvent called");
40#endif
41
43 Debug.ActionLog("Time stamp: " + m_ActionData.m_Player.GetSimulationTimeStamp() + " / " + pEventID, this.ToString(), "n/a", "OnAnimationEvent", m_ActionData.m_Player.ToString());
44
46 {
47 m_inLoop = true;
48 //ActionContinuousBase.Cast(action).OnStartLoop( m_ActionData );
49 }
50 else if (!m_Interrupted && pEventID == UA_IN_END)
51 {
52
53 m_inLoop = false;
54 //ActionContinuousBase.Cast(action).OnCompleteLoop( m_ActionData );
55 }
56 else if (!m_Interrupted && pEventID == UA_ANIM_EVENT)
57 {
58 action.OnAnimationEvent(m_ActionData);
59 //action.OnCompleteLoop( m_ActionData );
60 }
61 }
62 else
63 {
64 //Debug.LogError("Call OnAnimationEvent ")
65 }
66 }
67
84
85 override void EndActionComponent()
86 {
87 // TODO for second type animation SetCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
89 SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
90 else if (m_ActionData.m_State == UA_CANCEL)
91 {
93 if (action.HasAlternativeInterrupt())
94 SetCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
95 else
96 SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
97 m_Canceled = true;
98 return;
99 //Cancel();
100 }
101 else
102 {
103 m_Canceled = true;
104 SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
105 return;
106 }
108 }
109
116};
117
119{
120 PluginAdminLog m_AdminLog;
121
123 {
125 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EAT;
126
127 if (GetGame() && GetGame().IsServer())
128 m_AdminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
129 }
130
132 {
134 if (Class.CastTo(callback, action_data.m_Callback))
135 {
136 if (callback.GetState() != callback.STATE_LOOP_END && callback.GetState() != callback.STATE_LOOP_END2)
137 callback.UserEndsAction();
138 }
139 }
140
142 {
143 return false;
144 }
145
146 override typename GetInputType()
147 {
149 }
150
151 override int GetActionCategory()
152 {
153 return AC_CONTINUOUS;
154 }
155
157 {
159 Debug.ActionLog("Time stamp: " + action_data.m_Player.GetSimulationTimeStamp(), this.ToString(), "n/a", "OnStartAnimationLoop", action_data.m_Player.ToString());
160
161 if (GetGame().IsServer())
163 else
165 action_data.m_WasExecuted = false;
166 }
167
169 {
171 Debug.ActionLog("Time stamp: " + action_data.m_Player.GetSimulationTimeStamp(), this.ToString(), "n/a", "OnEndAnimationLoop", action_data.m_Player.ToString());
172 if (GetGame().IsServer())
174 else
176 action_data.m_WasExecuted = false;
177 }
178
180 {
182 Debug.ActionLog("Time stamp: " + action_data.m_Player.GetSimulationTimeStamp(), this.ToString(), "n/a", "OnFinishProgress", action_data.m_Player.ToString());
183 if (GetGame().IsServer())
184 {
186
187 if (m_AdminLog)
188 m_AdminLog.OnContinouousAction(action_data);
189 }
190 else
192 action_data.m_WasExecuted = false;
193 }
194
195
196 protected void OnStartAnimationLoopServer(ActionData action_data) //method called on start main animation loop (after in animation part )
197 {
198 action_data.m_WasActionStarted = true;
199 }
200
201 protected void OnStartAnimationLoopClient(ActionData action_data) //method called on start main animation loop (after in animation part )
202 {
203 action_data.m_WasActionStarted = true;
204 }
205
206 protected void OnEndAnimationLoopServer(ActionData action_data) //method called on finish main animation loop (before out animation part )
207 {
208 }
209 protected void OnEndAnimationLoopClient(ActionData action_data) //method called on finish main animation loop (before out animation part )
210 {
211 }
212
214 {
215 }
216
218 {
219 }
220};
const int AC_CONTINUOUS
Definition _constants.c:3
void ContinuousDefaultActionInput(PlayerBase player)
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
PluginBase GetPlugin(typename plugin_type)
void CreateActionComponent()
void SetCommand(int command_uid)
SoundOnVehicle m_SoundObject
ActionData m_ActionData
override void EndActionComponent()
override void OnAnimationEvent(int pEventID)
override void InitActionComponent()
void OnEndAnimationLoop(ActionData action_data)
void OnFinishProgressClient(ActionData action_data)
void OnEndAnimationLoopClient(ActionData action_data)
void OnStartAnimationLoopServer(ActionData action_data)
override void OnEndInput(ActionData action_data)
void OnFinishProgress(ActionData action_data)
void OnStartAnimationLoop(ActionData action_data)
void OnFinishProgressServer(ActionData action_data)
void OnStartAnimationLoopClient(ActionData action_data)
void OnEndAnimationLoopServer(ActionData action_data)
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionBase m_Action
Definition ActionBase.c:27
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:143
static bool IsActionLogEnable()
Definition Debug.c:719
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int UA_IN_START
Definition constants.c:449
const int UA_FINISHED
Definition constants.c:436
const int UA_INITIALIZE
Definition constants.c:444
const int UA_ANIM_EVENT
Definition constants.c:443
const int UA_IN_END
Definition constants.c:450
const int UA_PROCESSING
Definition constants.c:434
const int UA_CANCEL
Definition constants.c:437
proto native void EnableCancelCondition(bool pEnable)
static const int STATE_LOOP_LOOP
Definition human.c:352
proto native int GetState()
returns one of STATE_...
static const int STATE_LOOP_LOOP2
Definition human.c:355
proto native bool DefaultCancelCondition()
system implemented cancel condition (now raise or sprint cancels action)