OFPEC Forum

Addons & Mods Depot => ArmA - Configs & Scripting => Topic started by: Deadfast on 17 Mar 2009, 14:38:09

Title: [SOLVED] Extended EH: PostInit
Post by: Deadfast on 17 Mar 2009, 14:38:09
Hello all,
I have a question regarding the Extended EventHandlers PostInit function.


I'd like to pre-compile a few scripts so they can be easily called later on (from Extended_Fired_EventHandlers).


Sadly no matter what I try I can't get it to work (got the newest XEH 1.93 BTW).

I even tried to execute a script looping a hint from there but it never gets executed.


Thanks,
Deadfast
Title: Re: Extended EH: PostInit
Post by: ViperMaul on 17 Mar 2009, 19:10:11
post some code so we can comment & correct.
or read the readme for the examples given.
Title: Re: Extended EH: PostInit
Post by: Deadfast on 17 Mar 2009, 19:25:38
I did read the readme but it didn't help me.

Here's my last attempt:
Code: [Select]
class CfgPatches
{
class DFS_precompile
{
units[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"Extended_EventHandlers"};
};
};

class Extended_PostInit_EventHandlers
{
class DFS_precompile
{
DFS_init = "[] execVM '\DFS_test\DFS_test_precompile.sqf'";
};
};
Title: Re: Extended EH: PostInit
Post by: i0n0s on 17 Mar 2009, 19:36:00
class DFS_precompile <- Should this really be here?
At least the PreInit-Handler don't need it.
Title: Re: Extended EH: PostInit
Post by: Deadfast on 17 Mar 2009, 19:52:47
Oh my god...

Turned out I had an old version of the XEH which was overriding the new one... ::)


Thanks for your time, guys!


BTW, turns out i0n0s was also right - that class was broken too ;)
Title: Re: [SOLVED] Extended EH: PostInit
Post by: Spooner on 19 Mar 2009, 00:15:03
One of the advantages of compiling code at PreInit (assuming you call rather than execVM it) is that the functions created are available directly in object vehicle init! Incidentally, if you execVM/spawnfrom PreInit it is exactly the same as if you call from PostInit (since that is actually what PostInit is).

Code: [Select]
class Extended_PreInit_EventHandlers
{
DFS_init = "[] call compile preprocessFileLineNumbers '\DFS_test\DFS_test_precompile.sqf'";
};