DayZ 1.24
Loading...
Searching...
No Matches
EnDebug.c
Go to the documentation of this file.
27proto void DumpStack();
28
50proto void DumpStackString(out string stack);
51
53proto void DebugBreak(bool condition = true, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL);
54
57
59proto void DPrint(string var);
60
62{
63 INFO,
64 WARNING,
65 ERROR,
66}
67
83proto void ErrorEx(string err, ErrorExSeverity severity = ErrorExSeverity.ERROR);
84proto void ErrorExString(string err, out string str, ErrorExSeverity severity = ErrorExSeverity.ERROR);
85
87proto native void Error2(string title, string err);
88
90void Error(string err)
91{
92 Error2("", err);
93}
94
96proto void Print(void var);
97
99proto void PrintToRPT(void var);
100
108proto void PrintFormat(string fmt, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL);
109
110//------------------------------------------
116{
117 BBOX, //< Just box
118 LINE, //< One or more lines
119 SPHERE, //< Sphere represented by triangle mesh
120 CYLINDER, //< Cylinder represented by triangle mesh
121 DIAMOND, //< Eight faced pyramid. Defined by bound-box, where middle part is equal to horizontal extents of box and top/bottom apogees lies on top/bottom side of box.
122 PYRAMID //< Four sided pyramid. Defined by bound-box, where base is equal to bottom side of box.
124
126{
127 NOZBUFFER, //< Do not compare z-buffer when render
128 NOZWRITE, //< Do not update z-buffer when render
129 WIREFRAME, //< Render just wire-frame outline. No solid faces
130 TRANSP, //< Is translucent
131 DOUBLESIDE, //< Double-sided (do not cull back-faces)
132 ONCE, //< Rendered just once and then it's automatically destroyed. Do not keep pointer to these!!
133 NOOUTLINE, //< Render just solid faces. No wire-frame outline.
134 BACKFACE, //< Render just back faces
135 NOCULL, //< Do not cull shapes by view frustum
136 VISIBLE, //< Make it visible. Set by default
137 ADDITIVE //< Additive blending (works with ShapeFlags.TRANSP)
139
141{
142 FIRSTCONTACT, //<In many cases only collided=true/false is enough
143 NEARESTCONTACT //<We want only one, the nearest contact
144 ONLYSTATIC //<Only static objects
145 ONLYDYNAMIC //<Only dynamic objects
146 ONLYWATER //<Only water components (legacy support for "walk on geometry")
147 ALLOBJECTS //<Valid when CF_FIRST_CONTACT, we get first contact for each object
148}
149
153class Shape
154{
156 proto private void ~Shape();
157
158 proto native void GetMatrix(out vector mat[4]);
159 proto native void SetMatrix(vector mat[4]);
160 proto native void SetDirection(vector direction);
161 proto native void SetPosition(vector position);
162 proto native void SetColor(int color);
163 proto native void SetFlags(ShapeFlags flags);
164 proto native void Destroy();
165
166 proto static native Shape Create(ShapeType type, int color, ShapeFlags flags, vector p1, vector p2);
167 proto static native Shape CreateLines(int color, ShapeFlags flags, vector p[], int num);
168 proto static native Shape CreateTris(int color, ShapeFlags flags, vector p[], int num);
169 proto static native Shape CreateSphere(int color, ShapeFlags flags, vector origin, float radius);
170 proto static native Shape CreateFrustum(float horizontalAngle, float verticalAngle, float length, int color, ShapeFlags flags);
171 proto static native Shape CreateCylinder(int color, ShapeFlags flags, vector origin, float radius, float length);
172
173 static Shape CreateArrow(vector from, vector to, float size, int color, ShapeFlags flags)
174 {
175 vector dir = to - from;
176 dir.Normalize();
177 vector dir1 = dir * size;
178 size = size * 0.5;
179
180 vector dir2 = dir.Perpend() * size;
181
182 vector pts[5];
183 pts[0] = from;
184 pts[1] = to;
185 pts[2] = to - dir1 - dir2;
186 pts[3] = to - dir1 + dir2;
187 pts[4] = to;
188
189 return CreateLines(color, flags, pts, 5);
190 }
191
192 static Shape CreateBridgeArrow(vector from, vector to, float size, int color, ShapeFlags flags)
193 {
194 vector dir = to - from;
195 dir.Normalize();
196
197 vector dir1 = Vector(0, 0, -size);
198 size = size * 0.5;
199
200 vector dir2 = dir.Perpend() * size;
201
202 vector pts[7];
203 pts[0] = from;
204 pts[1] = from + "0 0 1";
205 pts[2] = to + "0 0 1";
206 pts[3] = to;
207 pts[4] = to - dir1 - dir2;
208 pts[5] = to - dir1 + dir2;
209 pts[6] = to;
210
211 return CreateLines(color, flags, pts, 7);
212 }
213
214 static void CreateMatrix(vector mat[4])
215 {
216 vector org = mat[3];
217 int flags = ShapeFlags.NOZWRITE | ShapeFlags.DOUBLESIDE | ShapeFlags.TRANSP | ShapeFlags.ONCE;
218 Create(ShapeType.LINE, 0xffff0000, flags, org, mat[0] * 0.5 + org);
219 Create(ShapeType.LINE, 0xff00ff00, flags, org, mat[1] * 0.5 + org);
220 Create(ShapeType.LINE, 0xff0000ff, flags, org, mat[2] * 0.5 + org);
221 }
222};
223
225
226
227//------------------------------------------
233{
235 static proto bool IsInitialized();
236
238 static proto void InitScriptDiags();
240 static proto void ClearScriptDiags();
241
248 static proto void RegisterMenu(int id, string name, int parent);
249
259 static proto void RegisterItem(int id, string shortcut, string name, int parent, string values, func callback = null);
260
272 static proto void RegisterBool(int id, string shortcut, string name, int parent, bool reverse = false, func callback = null);
273
283 static proto void RegisterRange(int id, string shortcut, string name, int parent, string valuenames, func callback = null);
284
286 static proto void Unregister(int id);
287
289 static proto bool IsRegistered(int id);
290
309 static proto bool BindCallback(int id, func callback);
311 static proto void UnbindCallback(int id);
312
314 static proto bool GetBool(int id, bool reverse = false);
316 static proto int GetValue(int id);
318 static proto void SetValue(int id, int value);
319
321 static proto float GetRangeValue(int id);
323 static proto void SetRangeValue(int id, float value);
324
326 static proto int GetEngineValue(int id);
328 static proto void SetEngineValue(int id, int value);
329
331 static proto float GetEngineRangeValue(int id);
333 static proto void SetEngineRangeValue(int id, float value);
334
336 static proto bool MenuExists(string name);
338
340
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto float Normalize()
Normalizes vector. Returns length.
vector Perpend()
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector ...
Definition EnConvert.c:209
proto native void Error2(string title, string err)
Messagebox with error message.
ErrorExSeverity
Definition EnDebug.c:62
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
proto void DumpStack()
Prints current call stack (stack trace)
proto void Print(void var)
Prints content of variable to console/log.
proto void DebugBreak(bool condition=true, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Triggers breakpoint in C++ in run time(when app is running in debug enviroment)
proto void DumpStackString(out string stack)
Prints current call stack (stack trace) to given output.
proto void DPrint(string var)
Prints content of variable to console/log. Should be used for critical messages so it will appear in ...
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
void CompileBreak()
Triggers breakpoint in C++ in compile time(when app is running in debug enviroment)
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Prints formated text to console/log.
proto void ErrorExString(string err, out string str, ErrorExSeverity severity=ErrorExSeverity.ERROR)
static proto native Shape Create(ShapeType type, int color, ShapeFlags flags, vector p1, vector p2)
static proto native Shape CreateCylinder(int color, ShapeFlags flags, vector origin, float radius, float length)
enum ShapeType ErrorEx
static Shape CreateArrow(vector from, vector to, float size, int color, ShapeFlags flags)
Definition EnDebug.c:173
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition Effect.c:420
CollisionFlags
Definition EnDebug.c:141
proto native void SetDirection(vector direction)
ShapeType
Definition EnDebug.c:116
static proto native Shape CreateFrustum(float horizontalAngle, float verticalAngle, float length, int color, ShapeFlags flags)
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
Definition Effect.c:207
proto native void SetColor(int color)
proto native void SetMatrix(vector mat[4])
static proto native Shape CreateSphere(int color, ShapeFlags flags, vector origin, float radius)
static proto native Shape CreateLines(int color, ShapeFlags flags, vector p[], int num)
proto native void SetFlags(ShapeFlags flags)
proto native void GetMatrix(out vector mat[4])
static proto native Shape CreateTris(int color, ShapeFlags flags, vector p[], int num)
static Shape CreateBridgeArrow(vector from, vector to, float size, int color, ShapeFlags flags)
Definition EnDebug.c:192
ShapeFlags
Definition EnDebug.c:126
static void CreateMatrix(vector mat[4])
Definition EnDebug.c:214
@ SPHERE
Definition EnDebug.c:119
@ PYRAMID
Definition EnDebug.c:122
@ DIAMOND
Definition EnDebug.c:121
@ LINE
Definition EnDebug.c:118
@ BBOX
Definition EnDebug.c:117
@ CYLINDER
Definition EnDebug.c:120
@ NOZWRITE
Definition EnDebug.c:128
@ NOOUTLINE
Definition EnDebug.c:133
@ DOUBLESIDE
Definition EnDebug.c:131
@ WIREFRAME
Definition EnDebug.c:129
@ BACKFACE
Definition EnDebug.c:134
@ NOCULL
Definition EnDebug.c:135
@ VISIBLE
Definition EnDebug.c:136
@ ADDITIVE
Definition EnDebug.c:137
@ TRANSP
Definition EnDebug.c:130
@ NOZBUFFER
Definition EnDebug.c:127
@ ONCE
Definition EnDebug.c:132
static proto bool IsInitialized()
Checks if DiagMenu is initialized.
static proto void ClearScriptDiags()
To be used when scripted diags should not be present.
static proto void RegisterBool(int id, string shortcut, string name, int parent, bool reverse=false, func callback=null)
Register a new bool item.
WARNING
Definition EnDebug.c:1
static proto void SetRangeValue(int id, float value)
Set range value at the given script id.
static proto void InitScriptDiags()
To be used before registering scripted diags.
static proto void SetValue(int id, int value)
Set value at the given script id.
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto int GetEngineValue(int id)
Get value at the given engine id.
static proto void RegisterRange(int id, string shortcut, string name, int parent, string valuenames, func callback=null)
Register a new range item.
static proto bool IsRegistered(int id)
Check if the item at given id has been registered.
static proto void RegisterItem(int id, string shortcut, string name, int parent, string values, func callback=null)
Register a new item.
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
static proto void UnbindCallback(int id)
Unbind the callback from the given id.
static proto bool MenuExists(string name)
Check if a menu with supplied name already exists.
ERROR
Definition EnDebug.c:2
static proto void RegisterMenu(int id, string name, int parent)
Register a new menu.
static proto bool BindCallback(int id, func callback)
Bind a callback to the given id.
INFO
Definition EnDebug.c:0
static proto void SetEngineRangeValue(int id, float value)
Set range value at the given engine id.
static proto int GetValue(int id)
Get value as int from the given script id.
static proto void Unregister(int id)
Unregister the item at given id.
static proto float GetRangeValue(int id)
Get range value at the given script id.
FIRSTCONTACT
Definition EnDebug.c:0
NEARESTCONTACT ONLYSTATIC ONLYDYNAMIC ONLYWATER ALLOBJECTS
Definition EnDebug.c:6
static proto void SetEngineValue(int id, int value)
Set value at the given engine id.
static proto float GetEngineRangeValue(int id)
Get range value at the given engine id.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.