Extended Eventhandlers

Version 37 (killswitch, 07/26/2011 12:27)

1 7 killswitch
{{>toc}}
2 4 killswitch
3 4 killswitch
h1. Extended Event Handlers (XEH) by Solus and Killswitch
4 4 killswitch
5 36 killswitch
Version:  3.07
6 36 killswitch
Released: 2011-07-08
7 4 killswitch
8 4 killswitch
9 4 killswitch
Creator:      Solus
10 37 killswitch
Maintainer:   Killswitch, Sickboy
11 37 killswitch
Contributors: Spooner
12 4 killswitch
13 4 killswitch
14 4 killswitch
h1. Introduction
15 4 killswitch
16 4 killswitch
This addon allows a virtually infinite amount of event handlers to be used together from different addons. The event handlers are executed for the matching class and all inheriting classes. The event handler init line also contains the extended event handler class to look for, so you can have a custom inheritance for custom units.
17 4 killswitch
18 4 killswitch
Normally event handlers can only be added in configs, and trying to add a new event handler caused all previous event handlers to be overwritten. This addon allows that limitation to be overcome. This is mostly useful for having addons that can add different functionality, for example in OFP addons that had their own event handlers wouldn't inherit default event handlers, such as a custom unit with EHs being used with ECP or FFUR wouldn't have the ECP or FFUR effects.
19 4 killswitch
20 4 killswitch
21 4 killswitch
h2. "Other" extended event handlers by Killswitch
22 4 killswitch
23 4 killswitch
This adds support for using extended event handlers for all Arma event types
24 4 killswitch
25 4 killswitch
26 4 killswitch
h2. Extended fired event handler
27 4 killswitch
28 4 killswitch
This allows a virtually infinite amount of fired event handlers to be used together from different addons.
29 4 killswitch
30 4 killswitch
The extended fired event handler has several different parts:
31 4 killswitch
32 4 killswitch
First the extended init EH is run for all units to add together and compile all of the inherited fired event handlers and use setVariable to attach those to the unit.
33 4 killswitch
34 4 killswitch
The extended fired event handler is added to the base class called Extended_EventHandlers so that all the CfgVehicles class EventHandlers
35 4 killswitch
inherit it. When a unit fires and sets off the event handler the shot is immediately captured in the same game state cycle. Then the compiled
36 4 killswitch
extended fired events are called by using getVariable to retrieve them from the unit.
37 4 killswitch
38 4 killswitch
The fired event handler init line contains the extended event handler class to look for, so you can have a custom inheritance for custom units. The event handlers are executed for the matching class and all inheriting classes.
39 4 killswitch
40 4 killswitch
It allows more fired events to be used together, for example a script that makes shots affected by wind and a tracer script could be used together.
41 4 killswitch
42 4 killswitch
43 4 killswitch
44 4 killswitch
h1. Examples
45 4 killswitch
46 4 killswitch
There are two example Extended Init addons included to demonstrate how to assign new event handlers and the event handler inheritance. The example pbos should not be installed except for testing.
47 4 killswitch
48 4 killswitch
There is an example addon included to demonstrate how to assign new fired event handlers and the event handler inheritance. The example also has a quickly called function that is able to capture information on the shot in the same game state cycle before the shot is updated and moves away from it's starting position and changes it's status. The example pbo should not be installed except for testing.
49 4 killswitch
50 4 killswitch
The addon "SightAdjustment_AutoInit.pbo" is an addon that makes gmJamez' "GMJ_SightAdjustment" addon compatible with XEH.
51 4 killswitch
52 4 killswitch
Note to addon makers: Before XEH 1.1, you had to make sure to add a ";" at the end of your extended init line to separate it from other extended inits. This is no longer necessary - the Extended Init EH will separate them automatically, so ending without one won't cause a problem.
53 4 killswitch
54 4 killswitch
h1. New features
55 4 killswitch
56 4 killswitch
h2. New in 1.3: Limiting certain event handler to a specific vehicle class
57 4 killswitch
58 4 killswitch
The example addon "SLX_Advanced_Init_Example" shows how to create an XEH init EH that will only be used on units that are of the class SoldierWB,
59 4 killswitch
ie the West "Rifleman". Units that inherit from "SoldierWB", eg the Grenadier, won't run the init EH. 
60 4 killswitch
61 4 killswitch
One can do the same thing for the other XEH event types. For example, to add a "GetIn" event handler that works only on the the vehicle XYZ_BRDM2, but not on the XYZ_BRDM2_ATGM variant you would do something like this:
62 4 killswitch
63 4 killswitch
<pre>
64 4 killswitch
...
65 4 killswitch
class Extended_GetIn_Eventhandlers
66 4 killswitch
{
67 4 killswitch
    class XYZ_BRDM2
68 4 killswitch
    {
69 4 killswitch
        class XYZ_BRDM2_GetIn
70 4 killswitch
        {
71 4 killswitch
            scope = 0;
72 4 killswitch
            getin = "[] exec '\xyz_brdm2\getin.sqf'";
73 4 killswitch
        };
74 4 killswitch
    };
75 4 killswitch
};
76 4 killswitch
77 4 killswitch
78 4 killswitch
class Vehicles
79 4 killswitch
{
80 4 killswitch
    ...
81 4 killswitch
    class XYZ_BRDM2: BRDM2
82 4 killswitch
    {
83 4 killswitch
        ...
84 4 killswitch
    };
85 4 killswitch
    class XYZ_BRDM2_ATGM: XYZ_BRDM2
86 4 killswitch
    {
87 4 killswitch
        ...
88 4 killswitch
    };
89 4 killswitch
};
90 4 killswitch
</pre>
91 4 killswitch
Note that within that innermost XEH class, you have to put a string value with the same name as the desired event handler. In the above example it was "getin". For the "fired" event handler, you would use
92 4 killswitch
<pre>
93 4 killswitch
...
94 4 killswitch
class Extended_Fired_Eventhandlers
95 4 killswitch
{
96 4 killswitch
    class SoldierEB
97 4 killswitch
    {
98 4 killswitch
        class XYZ_SoldierEB_fired
99 4 killswitch
        {
100 4 killswitch
            scope=0;
101 4 killswitch
            // We wish to make a SoldierEB-specific *Fired* EH, so the
102 4 killswitch
            // property name should be "fired"
103 4 killswitch
            //
104 4 killswitch
            fired = "_this call XYZ_SoldierEB_fired";
105 4 killswitch
        };
106 4 killswitch
    };
107 4 killswitch
};
108 4 killswitch
...
109 4 killswitch
</pre>
110 4 killswitch
111 4 killswitch
h2. New in 1.5: Excluding certain descendant vehicle types
112 4 killswitch
113 4 killswitch
With XEH 1.5, you can exclude one or more subtypes of a vehicle from getting a certain XEH event handler. To do this, you add a directive,
114 4 killswitch
exclude, in an inner, "composite" XEH class (introduced in 1.3).
115 4 killswitch
116 4 killswitch
Here's an example of how to exclude the west pilot class from running the basic Man class XEH init event handler. Instead, there's a special
117 4 killswitch
init for the pilot ("SoldierWPilot"). Note that all subclasses of "SoldierWPilot" will be excluded from using the basic class Man XEH init too.
118 4 killswitch
<pre>
119 4 killswitch
/*
120 4 killswitch
 *   Init XEH exclusion example 1
121 4 killswitch
 */
122 4 killswitch
class CfgPatches
123 4 killswitch
{
124 4 killswitch
   class xeh_exclusion_example1
125 4 killswitch
   {
126 4 killswitch
       units[]={};
127 4 killswitch
       weapons[]={};
128 4 killswitch
       requiredVersion=0.1;
129 4 killswitch
       requiredAddons[]={"Extended_Eventhandlers"};
130 4 killswitch
   };
131 4 killswitch
};
132 4 killswitch
133 4 killswitch
class Extended_Init_Eventhandlers
134 4 killswitch
{
135 4 killswitch
    class Man
136 4 killswitch
    {
137 4 killswitch
        // To use the exclude directive, we'll have to make this an
138 4 killswitch
        // "inner" (composite) XEH init EH class
139 4 killswitch
        class XEH_Exclusion1_Man
140 4 killswitch
        {
141 4 killswitch
            exclude="SoldierWPilot";
142 4 killswitch
            init = "[] execVM '\xeh_exclusion_example1\init_man.sqf'";
143 4 killswitch
        };
144 4 killswitch
    };
145 4 killswitch
146 4 killswitch
    class SoldierWPilot
147 4 killswitch
    {
148 4 killswitch
        xeh_init = "[] execVM '\xeh_exclusion_example1\init_west_pilot.sqf'";
149 4 killswitch
    };
150 4 killswitch
};
151 4 killswitch
</pre>
152 4 killswitch
153 4 killswitch
In the second example, we'll exclude both the standard west and east pilots and add unique init EH:S to them and the BIS Camel pilot. To do so, use the exclude[] directive in array form:
154 4 killswitch
<pre>
155 4 killswitch
/*
156 4 killswitch
 *   Init XEH exclusion example 2
157 4 killswitch
 */
158 4 killswitch
class CfgPatches
159 4 killswitch
{
160 4 killswitch
   class xeh_exclusion_example2
161 4 killswitch
   {
162 4 killswitch
       units[]={};
163 4 killswitch
       weapons[]={};
164 4 killswitch
       requiredVersion=0.1;
165 4 killswitch
       requiredAddons[]={"Extended_Eventhandlers"};
166 4 killswitch
   };
167 4 killswitch
};
168 4 killswitch
169 4 killswitch
class Extended_Init_Eventhandlers
170 4 killswitch
{
171 4 killswitch
    class Man
172 4 killswitch
    {
173 4 killswitch
        // To use the exclude directive, we'll have to make this an
174 4 killswitch
        // "inner" (composite) XEH init EH class
175 4 killswitch
        class XEH_Exclusion2_Man
176 4 killswitch
        {
177 4 killswitch
            exclude[] = {"SoldierWPilot", "SoldierEPilot"};
178 4 killswitch
            init = "[] execVM '\xeh_exclusion_example2\init_man.sqf'";
179 4 killswitch
        };
180 4 killswitch
    };
181 4 killswitch
182 4 killswitch
    // All descendants of SoldierEPilot will use this XEH init EH
183 4 killswitch
    class SoldierEPilot
184 4 killswitch
    {
185 4 killswitch
        xeh_init = "[] execVM '\xeh_exclusion_example2\init_east_pilot.sqf'";
186 4 killswitch
    };
187 4 killswitch
188 4 killswitch
    // Using scope=0, only SoldierWPilot will get this particular XEH init
189 4 killswitch
    class SoldierWPilot
190 4 killswitch
    {
191 23 killswitch
        class XEH_OnlyWPilot
192 23 killswitch
        {
193 23 killswitch
            scope = 0;
194 23 killswitch
            init = "[] execVM '\xeh_exclusion_example2\init_west_pilot.sqf'";
195 23 killswitch
        };
196 4 killswitch
    };
197 4 killswitch
198 4 killswitch
    // Here, we add an event handler for the BIS Camel Pilot (which is a
199 4 killswitch
    // descendant of "SoldierWPilot". It won't run "init_west_pilot.sqf" though
200 4 killswitch
    // since we used "scope=0" above.
201 4 killswitch
    class BISCamelPilot
202 4 killswitch
    {
203 4 killswitch
        xeh_init="[] execVM'\xeh_exclusion_example2\init_west_camel_pilot.sqf'";
204 4 killswitch
    };
205 4 killswitch
};
206 4 killswitch
</pre>
207 4 killswitch
You can do the same thing with the other XEH event types (fired, hit and so on).
208 4 killswitch
209 4 killswitch
210 4 killswitch
h2. New in 1.8: making XEH init event handlers run when a unit respawns
211 4 killswitch
212 4 killswitch
Normally, when a player respawns into a new unit (object), the init event handler is not executed again. However, with XEH 1.8, you can make an XEH init event handler be rerun when the new unit spawns. To do so, declare your init EH as a "composite EH class" (described above). Then, add a property to it called "onRespawn" and set it to true (the number 1). 
213 4 killswitch
214 4 killswitch
Here's an example that shows how to do it:
215 4 killswitch
<pre>
216 4 killswitch
#define false 0
217 4 killswitch
#define true  1
218 4 killswitch
219 4 killswitch
class Extended_Init_Eventhandlers
220 4 killswitch
{
221 4 killswitch
    class Man
222 4 killswitch
    {
223 4 killswitch
        class SLX_XEH_RespawnInitMan
224 4 killswitch
        {
225 4 killswitch
            onRespawn = true;                    // Run this even after respawn
226 4 killswitch
            init      = "_this call My_Respawn_InitEH";
227 4 killswitch
        };
228 4 killswitch
    };
229 4 killswitch
};
230 4 killswitch
</pre>
231 4 killswitch
The example above will cause all classes that are descendants of class "Man" to have the function "My_Respawn_InitEH" called both when the unit is created and after a player has respawned into a new unit.
232 4 killswitch
233 4 killswitch
Note that unless you have "onRespawn=true" like above, XEH will use the default ArmA behaviour which is to NOT run the init EH when a unit respawns.
234 4 killswitch
235 4 killswitch
IMPORTANT: This feature will only work on the player's unit - AI units that respawn won't have their XEH init EH:s re-executed. (If someone can figure out a trick to identify playable units in a MP mission, this limitation could be removed)
236 4 killswitch
237 4 killswitch
h2. New in 1.9: version stringtable and "pre-init EH" code
238 4 killswitch
239 4 killswitch
You can get a string with the version of Extended_Eventhandlers using the "localize" command. Here's an example function which will return the
240 4 killswitch
version as a decimal number or "0" if XEH isn't installed:
241 4 killswitch
<pre>
242 4 killswitch
/*
243 4 killswitch
    Return the version of Extended_Eventhandlers, or 0 if the addon
244 4 killswitch
    isn't installed.
245 4 killswitch
*/
246 4 killswitch
_fXEHversion = {
247 4 killswitch
    private ["_str", "_cfg", "_ver"];
248 4 killswitch
    _cfg=(configFile/"CfgPatches"/"Extended_Eventhandlers"/"SLX_XEH2_Version");
249 4 killswitch
    _ver=0;
250 4 killswitch
251 4 killswitch
    _str=localize "STR_SLX_XEH_VERSION";
252 4 killswitch
    if !(_str == "") then {
253 4 killswitch
        _ver=call compile _str;
254 4 killswitch
    } else {
255 4 killswitch
        // XEH version 1.8 and earlier lacks the stringtable version
256 4 killswitch
        if (isNumber _cfg) then {
257 4 killswitch
            _ver=getNumber _cfg;
258 4 killswitch
        };
259 4 killswitch
    };
260 4 killswitch
    _ver
261 4 killswitch
};
262 4 killswitch
</pre>
263 4 killswitch
Another addition is a way to put code that you want to run only once in a new class, Extended_PreInit_EventHandlers. Anything in that class will
264 4 killswitch
be called early and before any of the normal extended init event handlers have run. 
265 4 killswitch
266 4 killswitch
Here's an example: let's say there's an addon with the following XEH init:
267 4 killswitch
<pre>
268 4 killswitch
// Addon: SLX_MyAddon (old)
269 4 killswitch
class Extended_Init_EventHandlers
270 4 killswitch
{
271 4 killswitch
    class Man
272 4 killswitch
    {
273 4 killswitch
        SLX_Man_init="_this call compile preprocessFile'\SLX_MyAddon\init.sqf'";
274 4 killswitch
    };
275 4 killswitch
};
276 4 killswitch
</pre>
277 4 killswitch
278 4 killswitch
Using the "pre-init" system, that can be rewritten as:
279 4 killswitch
<pre>
280 4 killswitch
// Addon: SLX_MyAddon (new)
281 4 killswitch
class Extended_PreInit_EventHandlers
282 4 killswitch
{
283 4 killswitch
    // The name "SLX_MyAddon_init" needs to be unique
284 4 killswitch
    SLX_MyAddon_init="SLX_fInit=compile preprocessFile'\SLX_MyAddon\init.sqf'";
285 4 killswitch
};
286 4 killswitch
class Extended_Init_EventHandlers
287 4 killswitch
{
288 4 killswitch
    class Man
289 4 killswitch
    {
290 4 killswitch
        // Call the function we loaded in the PreInit class
291 4 killswitch
        SLX_Man_init="_this call SLX_fInit";
292 4 killswitch
    };
293 4 killswitch
};
294 4 killswitch
</pre>
295 4 killswitch
Warning: if you write your addon using this new "pre-init" system, keep in mind that it won't work with XEH versions older than 1.9.
296 4 killswitch
297 4 killswitch
298 4 killswitch
h2. New in 1.91: PostInit and InitPost
299 4 killswitch
300 4 killswitch
Two new event handler types can be used to execute things at a later stage, when all XEH init EH:s have run *and* all mission.sqm init lines have been processed by ArmA. It happens just before the mission's "init.sqf" is executed.
301 4 killswitch
302 4 killswitch
The PostInit handler mirrors the pre-init event handler introduced in 1.9 and will make a code snippet run *once* per mission. Example:
303 4 killswitch
<pre>
304 4 killswitch
class Extended_PostInit_EventHandlers
305 4 killswitch
{
306 4 killswitch
    // Run "late_init.sqf" just before the mission's init.sqf and after
307 4 killswitch
    // all other init EH:s and mission editor init lines have been processed
308 4 killswitch
    SLX_MyAddon_postinit="[] execVM 'SLX_MyAddon\late_init.sqf";
309 4 killswitch
};
310 4 killswitch
</pre>
311 4 killswitch
The other event handler, InitPost type mimics the mission editor init lines in that it will be run once on *every* unit and vehicle in the mission. You write the InitPost EH just like you would the normal XEH init, fired etc handlers. That means you have to wrap the handler in the desired vehicle/unit class for which you want the InitPost EH applied. As an example, you could use this to set a per-unit variable that's needed for your addon. It needs to be done for all units that are derived from the CAManBase class. Here's how it would look:
312 4 killswitch
<pre>
313 4 killswitch
class Extended_InitPost_EventHandlers
314 4 killswitch
{
315 4 killswitch
    class CAManBase
316 4 killswitch
    {
317 4 killswitch
        // Make sure everyone is happy when the mission starts
318 4 killswitch
        SLX_MyAddon_init="_this setVariable ['slx_myaddon_ishappy', true]";
319 4 killswitch
    };
320 4 killswitch
};
321 4 killswitch
</pre>
322 4 killswitch
323 5 killswitch
h2. New in 2.00: Support for ArmA II, serverInit and clientInit entries
324 4 killswitch
325 1 Sickboy
XEH is now useable in ArmA II and adds support for a new ArmA II event - the "firedNear" event.
326 4 killswitch
327 13 killswitch
h3. Running init EHs on just the client or just the server
328 13 killswitch
329 1 Sickboy
Furthermore, one can limit a certain init EH to just clients or just servers by placing it in a @serverInit@ or @clientInit@ entry within one of the Init EH classes (ie within @Extended_PreInit_EventHandlers@, @Extended_Init_EventHandlers@ or @Extended_PostInit_EventHandlers@)
330 1 Sickboy
331 13 killswitch
Example:
332 13 killswitch
<pre>
333 13 killswitch
class Extended_PreInit_EventHandlers
334 13 killswitch
{
335 13 killswitch
    // This one will be run once on ALL machines
336 13 killswitch
    SLX_MyAddon_PreInit="SLX_myFunc=compile preprocessFile '\myaddon\myfunc.sqf'"
337 13 killswitch
338 13 killswitch
    /*  In order to have client- or server-only pre-init snippets, stick them into a class within
339 13 killswitch
     *  Extended_PreInit_EventHandlers. The class itself can be called anything, but try to
340 13 killswitch
     *  think of a unique name. 
341 13 killswitch
     */
342 13 killswitch
    class SLX_MyAddon_PreInits
343 13 killswitch
    {
344 13 killswitch
        // Like the normal preinit above, this one runs on all machines
345 13 killswitch
        init = "...code here...";
346 13 killswitch
347 13 killswitch
        // This code will be executed once and only on the server
348 13 killswitch
        serverInit = "...server-only code goes here...";
349 13 killswitch
350 13 killswitch
        // This snippet runs once and only on client machines
351 13 killswitch
        clientInit = "...client-only code here...";
352 13 killswitch
    };
353 13 killswitch
};
354 1 Sickboy
</pre>
355 1 Sickboy
356 14 killswitch
h2. New in 2.04: mission and campaign XEH event handlers.
357 14 killswitch
358 14 killswitch
XEH is no longer limited to just addons - mission makers can create extended event handlers that appear in specific missions or a campaign by adding
359 14 killswitch
an extended event handler class in the mission or campaign 'description.ext' file. As an example, if you put the following code in a mission description.ext
360 14 killswitch
and place a USMC rifleman in the mission editor, the player will _sideChat_ information on the fired event every time you fire the rifle:
361 14 killswitch
<pre>
362 15 killswitch
class Extended_Fired_Eventhandlers
363 14 killswitch
{
364 14 killswitch
    class USMC_Soldier
365 14 killswitch
    {
366 14 killswitch
        kls_test_fired="(_this select 0)sideChat str(_this)";
367 14 killswitch
    };
368 14 killswitch
};</pre>
369 1 Sickboy
370 27 killswitch
h2. New in 3.02: OO-like event handler overridance in child classes.
371 27 killswitch
372 27 killswitch
Consider CfgVehicle classes A and B where B is a descendant of A:
373 27 killswitch
<pre>
374 27 killswitch
class CfgVehicles
375 27 killswitch
{
376 27 killswitch
    ...
377 27 killswitch
    class A
378 27 killswitch
    {
379 27 killswitch
        ...
380 27 killswitch
    };
381 27 killswitch
382 27 killswitch
    class B: A
383 27 killswitch
    {
384 27 killswitch
        ...
385 27 killswitch
    };
386 27 killswitch
};
387 27 killswitch
</pre>
388 27 killswitch
Now, imagine the following extended init event handler definitions exist for both A and B:
389 27 killswitch
<pre>
390 27 killswitch
class Extended_Init_EventHandlers
391 27 killswitch
{
392 27 killswitch
    class A
393 27 killswitch
    {
394 27 killswitch
        ab_myinit = "A=true";
395 27 killswitch
    };
396 27 killswitch
397 27 killswitch
    class B
398 27 killswitch
    {
399 27 killswitch
        ab_myinit = "B=true"; // Same name as in class A, so we'll replace that one
400 27 killswitch
    };
401 27 killswitch
};
402 27 killswitch
</pre>
403 28 killswitch
Note how both handler entries are named "ab_myinit". In previous versions of Extended Eventhandlers, both code snippets would be executed for instances of class B in a mission - both the variables A and B would be set. (Internally, when XEH processed the Init event handlers for B, it would first execute _ab_myinit_ from class A and then the one from class B.)
404 27 killswitch
405 28 killswitch
In order to have XEH behave more consistent with the object-oriented way of thinking, the _ab_myinit_ definition in class B will override (replace) the one made in class A. Should the addon author want both of them to be executed for class B, he or she should name the second one something different from the one present in A.
406 27 killswitch
407 30 Sickboy
408 31 Sickboy
h2. New in 3.03: Extended_FiredBIS_Eventhandlers and support for addons that do not support XEH
409 31 Sickboy
410 30 Sickboy
As of 3.03, a mechanism was added that allows non-XEH Compatible classes to work with eXtended EventHandlers regardless.
411 30 Sickboy
There are two limitations;
412 30 Sickboy
* It stops working if some script executes removeAllEventHandlers _unit;
413 30 Sickboy
* It only works if
414 30 Sickboy
** a) At least one XEH compatible class is available in the mission
415 30 Sickboy
** or b) If the SLX_XEH_Logic module has been placed in the mission
416 30 Sickboy
417 30 Sickboy
Also, due to the new Fired Eventhandler parameters introduced in ArmA 2 patch 1.08, and OA patch 1.55, a new Fired Eventhandler XEH class was added.
418 30 Sickboy
Named: Extended_FiredBIS_Eventhandlers.
419 30 Sickboy
The fired Eventhandlers in this class are 100% native and equal to that of the official FiredEventhandler (in config, or by script command; addEventhandler).
420 30 Sickboy
421 30 Sickboy
The difference is:
422 30 Sickboy
Extended_Fired_Eventhandlers has: [unit, weapon, muzzle, mode, ammo, *projectile, magazine*]
423 30 Sickboy
Extended_FiredBIS_Eventhandlers has: [unit, weapon, muzzle, mode, ammo, *magazine, projectile*]
424 30 Sickboy
425 32 Sickboy
The addition of FiredBIS is required to keep XEH Fired eventhandler (backward)compatibility in tact;
426 32 Sickboy
XEH used _this select 5 as projectile entry since ArmA 1.
427 32 Sickboy
428 1 Sickboy
429 1 Sickboy
h1. XEH Change log
430 36 killswitch
431 36 killswitch
3.07 (July 8, 2011)
432 36 killswitch
Added:   XEH support for the PMC DLC units. (#16684)
433 36 killswitch
Changed: Improved XEH initialization for man-based units in both single- and multiplayer.
434 36 killswitch
Changed: Improved XEH delayed initialization for man-based units in MP.
435 36 killswitch
Changed: Improved XEH crew man init.
436 36 killswitch
Changed: Improved XEH initialization behaviour on servers and in singleplayer.
437 36 killswitch
Changed: XEH system inits should be first in line.
438 36 killswitch
Fixed:   XEH initialized twice for crew units when JIPing.
439 36 killswitch
Fixed:   Double initPlayable call.
440 36 killswitch
Fixed:   PostInit not waiting for player object in single player, and player not being first unit on map.
441 36 killswitch
Fixed:   __getVariable array__ usage is not allowed due to casual ArmA 2 support. (#17470)
442 36 killswitch
Fixed:   PostInit didn't initialize when player is not a man, but animal. (#19667)
443 36 killswitch
444 36 killswitch
3.06 (Dec 20, 2010)
445 36 killswitch
Added:   A mechanism for disabling XEH's debug message logging: If a @CfgPatches@ class with the name "@Disable_XEH_Logging@" exists, @XEH_DisableLogging@ is set to true and logging stops. (#15637)
446 36 killswitch
Changed: CBA LoadingScreen Disabled. New solution for credits soon.
447 36 killswitch
Changed: Improved XEH SupportMonitor implementation; speeds up script processing at initialization.
448 36 killswitch
Changed: Improved XEH InitOthers for all non man-based objects.
449 36 killswitch
Changed: Improved XEH PostInit/SupportMonitor initialization by detecting null-objects and aborting processing on them.
450 36 killswitch
Fixed:   Event handler excludes bleed through to other classes.
451 36 killswitch
Fixed:   Possible loop on non XEH supported units.
452 36 killswitch
Fixed:   Eventhandler duplication on respawn of non-XEH compatible unit.
453 36 killswitch
Fixed:   Unneeded SupportMonitor check on crew units.
454 36 killswitch
Fixed:   @SLX_XEH_DISABLED@ wasn't respected by SupportMonitor.
455 36 killswitch
456 36 killswitch
3.05 (Nov 26, 2010)
457 36 killswitch
Added: Support for excluding class from XEH via a @SLX_XEH_DISABLED@ property set for that class.
458 36 killswitch
Fixed: XEH Exclude classes were not reset each iteration, making exclude settings active for all classes following a class with exclude settings, and effectively therefore missing certain eventhandlers.
459 36 killswitch
Fixed: XEH didn't exclude server/client eventhandlers if exclusion was specified. It only excluded the normal eventhandlers.
460 36 killswitch
461 36 killswitch
3.04 (Nov 23, 2010)
462 36 killswitch
Added:   RPT Warning when XEH is initializing late, probably indicating there are no XEH-compatible units in the mission at start. Remedy; place SLX_XEH_Logic module.
463 36 killswitch
Changed: Do not add empty code strings, and warn if in debug mode.
464 36 killswitch
Changed: Respawn handlers.
465 36 killswitch
Changed: No loading screen for main menu intro.
466 36 killswitch
Fixed:   XEH's broken on AAV and AH6X_EP1. (#15143)
467 36 killswitch
Fixed:   JIP players were considered respawning and therefore didn't have the correct EH initializations. (#15328)
468 25 killswitch
469 34 Sickboy
3.03 (Nov 09, 2010)
470 34 Sickboy
Added: Support for the new BIS Fired Eventhandler parameters, which can be accessed
471 34 Sickboy
       from the new Extended_FiredBIS_Eventhandlers class.
472 35 Sickboy
Fixed: OnRespawn handling.
473 34 Sickboy
474 26 killswitch
3.02 (Jul 23, 2010)
475 1 Sickboy
Fixed: High command missions would give the player control over all groups
476 1 Sickboy
       in the mission instead of just his assigned HC hiearchy.
477 26 killswitch
Fixed: event handler definitions now behave in an OO way in that you can
478 26 killswitch
       override a specific handler from a (CfgVehicle wise) "parent" class.
479 26 killswitch
       (Eg if CfgVehicles/B is a child of CfgVehicles/A and there exists XEH handlers
480 26 killswitch
       for both A and B with the same name (code string entry or class entry
481 26 killswitch
       name) the one in B will override (replace) the one in A. (#12108)
482 24 killswitch
483 22 killswitch
3.01 (Jul 07, 2010)
484 22 killswitch
Fixed: the old "game crashes when resuming a saved game" issue with class Static
485 22 killswitch
       that was fixed way back in v1.7 had reappeared.
486 20 killswitch
487 20 killswitch
3.00 (Jul 05, 2010)
488 20 killswitch
New: Extended Eventhandlers is now compatible with, and targeted for
489 20 killswitch
     a merged A2+Arrowhead installation, aka a "Combined Operations" installation.
490 20 killswitch
     Compatibility with pure Arrowhead installations is achieved with the
491 20 killswitch
     extra "CBA_OA" bridge addons.
492 20 killswitch
493 21 killswitch
2.07 (Jul 05, 2010)
494 21 killswitch
Last (barring any issues) ArmA II-only release of XEH (for CBA 0.4.2)
495 21 killswitch
Fixed: XEH now lists a minimal set of addons it requires, instead of what was
496 21 killswitch
       probably a close to maximal set of dependencies.
497 18 kju
498 19 killswitch
2.06 (Mar 09, 2010)
499 17 killswitch
Changed: pre-init handlers are now called in a more controlled fashion.
500 17 killswitch
Fixed: The BIS flag pole inits were inherited causing redundant setFlagTexture calls.
501 17 killswitch
Fixed: several small fix and tweaks.
502 16 killswitch
503 16 killswitch
2.05 (Jan 22, 2010)
504 16 killswitch
Fixed: XEH init event handlers would run twice on respawn on dedicated 1.05 servers (#7432)
505 16 killswitch
Fixed: XEH init EH's set to run on respawn will now work on unnamed, playable units. (#8080)
506 14 killswitch
507 14 killswitch
2.04 (Nov 10, 2009)
508 14 killswitch
Added: per-mission and per-campaign extended event handlers can be added
509 14 killswitch
       through the (mission or campaign) 'description.ext' file. (#2915)
510 11 killswitch
511 11 killswitch
2.03 (Aug 07, 2009)
512 11 killswitch
Fixed: Steam ArmA2: Addon 'Extended_EventHandlers' requires addon 'CA_Editor'. (#2987)
513 11 killswitch
Fixed: XEH disables pop-up targets. (#2935)
514 11 killswitch
Fixed: XEH init event handlers are re-run after respawn by default. (#3396)
515 12 killswitch
Added: The respawn monitor is able to make use of the @playableUnits@ command to track all playable units, not just the player. (#2647)
516 10 killswitch
517 10 killswitch
2.02 (Jul 13, 2009)
518 10 killswitch
Added: support for AnimStateChanged event handlers. (#2808)
519 8 killswitch
520 8 killswitch
2.01 (Jul 08, 2009)
521 9 killswitch
Fixed: performance drop issue. (#2663)
522 8 killswitch
Fixed: keep the stock BIS event handlers for the A10, Su34, camp fires,
523 8 killswitch
       burning barrels, cruise missile, flag poles, popup targets,
524 8 killswitch
       certain buildings, graves. (#2674)
525 8 killswitch
Fixed: restore the default EH:s for Team Razor units. (#2665)
526 4 killswitch
527 6 killswitch
2.00 (Jun 25, 2009)
528 1 Sickboy
New:   XEH ported to ArmA II with the help of Sickboy.
529 1 Sickboy
Added: support for the new "firedNear" event
530 5 killswitch
Added: @serverInit@ and @clientInit@ can be used along with
531 5 killswitch
       or instead of the normal @init@ snippet to limit initialisation
532 5 killswitch
       to certain types of machines.
533 5 killswitch
534 4 killswitch
535 4 killswitch
1.93 (Feb 16, 2009)
536 4 killswitch
Fixed: empty vehicles created after the mission started did not get their
537 4 killswitch
       InitPost handlers called.
538 4 killswitch
539 4 killswitch
1.92 (Feb 09, 2009)
540 4 killswitch
Changed: Some optimizations made (eg use pre-compiled XEH init functions).
541 4 killswitch
542 4 killswitch
1.91 (Dec 20, 2008) (Unofficial, for use with the ACE mod)
543 4 killswitch
Added: New "post-init" feature that can be used to have a script run once
544 4 killswitch
       at the end of mission initialisation, after all init EH:s and mission
545 4 killswitch
       init lines have executed, but before the mission's init.{sqs,sqf}
546 4 killswitch
       is processed.
547 4 killswitch
Added: There's also a per-unit, "InitPost" XEH framework which lets you run
548 4 killswitch
       scripts at the end of mission init. Unlike the PostInit event handlers
549 4 killswitch
       described above, these snippets run once for every unit in the mission.
550 4 killswitch
       (The name of this framework may change in the future to avoid confusion
551 4 killswitch
       with "PostInit")
552 4 killswitch
553 4 killswitch
1.9  (Sep 21, 2008)
554 4 killswitch
Fixed: before, vehicle crews would not have their XEH init EH:s run until just
555 4 killswitch
       after the mission started. Now they are run before mission start.
556 4 killswitch
Added: A stringtable with the version of XEH in STR_SLX_XEH_VERSION and
557 4 killswitch
       STR_SLX_XEH2_VERSION for use with the "localize" command.
558 4 killswitch
Added: a way to have run-once, "pre-init" code run using the new
559 4 killswitch
       Extended_PreInit_EventHandlers class.
560 4 killswitch
561 4 killswitch
1.8  (Sep 7, 2008)
562 4 killswitch
Fixed: game logics inside vehicles would cause a performance drop due to a
563 4 killswitch
       infinite recursion in the code that handles initialisation of
564 4 killswitch
       vehicle crews. Thanks to UNN for the bug report!
565 4 killswitch
Added: you can make XEH init event handlers execute when players respawn by
566 4 killswitch
       using an inner XEH class and the "onRespawn" boolean property.
567 4 killswitch
568 4 killswitch
1.7  (Mar 16, 2008)
569 4 killswitch
Fixed: Removed XEH from class Static, which stops ArmA from crashing to desktop
570 4 killswitch
       when resuming saved games.
571 4 killswitch
572 4 killswitch
1.6  (Mar 15, 2008)
573 4 killswitch
Fixed: The "exclude" property will apply to the specified class(es) and all
574 4 killswitch
       subclasses thereof.
575 4 killswitch
576 4 killswitch
1.5  (Mar 15, 2008)
577 4 killswitch
Added: Composite ("inner") XEH classes can have an extra property, "exclude"
578 4 killswitch
       which is either a string or an array of strings with the class name(s)
579 4 killswitch
       of vehicles that should *not* get a particular XEH event handler.
580 4 killswitch
581 4 killswitch
1.4  (Mar 15, 2008)
582 4 killswitch
Added: "Static" class vehicles can now have XEH event handlers.
583 4 killswitch
Added: A respawn monitor that restores non-init XEH event handlers after
584 4 killswitch
       the player respawns. Many thanks to Sickboy, LoyalGuard, ViperMaul for
585 4 killswitch
       the initial research and suggestions!
586 4 killswitch
587 4 killswitch
1.3  (Feb 9, 2008)
588 4 killswitch
Added: The ability to use "nested" XEH classes with a "scope" feature
589 4 killswitch
       to limit certain event handlers to objects of specific classes.
590 4 killswitch
591 4 killswitch
1.2  (Jan 29, 2008)
592 4 killswitch
Fixed: SightAdjustment_AutoInit.
593 4 killswitch
Fixed: Extended Dammaged EventHandler.
594 4 killswitch
595 4 killswitch
1.1  (Jan 26, 2008)
596 4 killswitch
Fixed: XEH can now handle extended event handlers that are missing a trailing
597 4 killswitch
       semicolon.
598 4 killswitch
Fixed: the example addons now require the Extended_Eventhandlers addon instead
599 4 killswitch
       of the two older ones. Also, the debug sideChats are now guaranteed to
600 4 killswitch
       be seen when previewing a mission with the example addons loaded.
601 4 killswitch
Fixed: XEH init EH:s are now actually being called on units inside vehicles.
602 4 killswitch
603 4 killswitch
1.0 Initial Release (Dec 31, 2007)
604 4 killswitch
Combined Extended Init, Fired, and Other event handlers. Thanks to Killswitch
605 4 killswitch
for combining them and adding the other extended event handlers!
606 4 killswitch
Added signature and bikey.
607 4 killswitch
608 4 killswitch
609 4 killswitch
h2. Init EH Change log:
610 4 killswitch
611 4 killswitch
1.26
612 4 killswitch
Fixed signature files, bikey, and .pbos.
613 4 killswitch
614 4 killswitch
1.25
615 4 killswitch
Fixed signature files and added bikey.
616 4 killswitch
617 4 killswitch
1.2
618 4 killswitch
Added signature file.
619 4 killswitch
Fixed a bug that caused crashes on some missions. Thanks to LCD344!
620 4 killswitch
Changed ExecVM to Call Compile. Thanks to UNN!
621 4 killswitch
622 4 killswitch
1.1
623 4 killswitch
Fixed people in vehicles having no inits.
624 4 killswitch
Included SightAdjustment example "bridge" addon that allows the GMJ_SightAdjustment
625 4 killswitch
addon to be used with other extended init event handler addons.
626 4 killswitch
627 4 killswitch
1.0 Initial Release
628 4 killswitch
629 4 killswitch
630 4 killswitch
h2. Fired EH Change log
631 4 killswitch
632 4 killswitch
1.0 @ 12-09-07 Initial release
633 4 killswitch
634 4 killswitch
635 4 killswitch
636 4 killswitch
h1. References
637 4 killswitch
638 4 killswitch
XEH for ArmA II is part of the Community Base Addons project:
639 4 killswitch
640 4 killswitch
    http://dev-heaven.net/projects/show/cca
641 4 killswitch
642 4 killswitch
643 4 killswitch
The old XEH, for Armed Assault (ArmA) is hosted here:
644 4 killswitch
645 4 killswitch
    http://dev-heaven.net/projects/show/xeh
646 4 killswitch
647 4 killswitch
648 4 killswitch
BI forums: http://forums.bistudio.com/
649 4 killswitch
650 4 killswitch
gmJamez Sight adjustment addon thread: http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=60ba6482bbaa47a50e83f8ae5674bdd8;act=ST;f=70;t=65706