Killswitch

Member
 
Group: Members
Posts: 581
Joined: Mar. 2003 |
 |
Posted: Feb. 09 2009,20:29 |
 |
Hot on the heels of the recent A.C.E mod 1.02 release comes a new Extended Eventhandlers addon - version 1.92
Extended_Eventhandlers192.zip
This is the same version as the one XEH in ACE 1.02 and introduces a few new advanced features that have been cooking in the cauldrons of the deep dungeons of A.C.E. for some time. Please see the enclosed "readme" file for details of the new twins - PostInit and InitPost (*).
Credit for these two new features should go to Sickboy and the ACE team. Neat stuff, guys!
Here's an excerpt from the readme and changelog:
| Quote | New in 1.91: PostInit and InitPost ================================== 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.
The PostInit handler mirrors the pre-init event handler introduced in 1.9 and will make a code snippet run *once* per mission. Example:
class Extended_PostInit_EventHandlers { // Run "late_init.sqf" just before the mission's init.sqf and after // all other init EH:s and mission editor init lines have been processed SLX_MyAddon_postinit="[] execVM 'SLX_MyAddon\late_init.sqf"; };
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:
class Extended_InitPost_EventHandlers { class CAManBase { // Make sure everyone is happy when the mission starts SLX_MyAddon_init="_this setVariable ['slx_myaddon_ishappy', true]"; }; };
XEH Change log ============ 1.92 (Feb 09, 2009) Changed: Some optimizations made (eg use pre-compiled XEH init functions).
1.91 (Dec 20, 2008) (Unofficial, for use with the ACE mod) Added: New "post-init" feature that can be used to have a script run once at the end of mission initialisation, after all init EH:s and mission init lines have executed, but before the mission's init.{sqs,sqf} is processed. Added: There's also a per-unit, "InitPost" XEH framework which lets you run scripts at the end of mission init. Unlike the PostInit event handlers described above, these snippets run once for every unit in the mission. (The name of this framework may change in the future to avoid confusion with "PostInit") | (*) Yes, I know... which one is which?
Edited by Killswitch on Feb. 09 2009,20:33
-------------- "The confidence of ignorance will always overcome indecision of knowledge."
|