Advertisement

Author Topic: [SOLVED] Extended EH: PostInit  (Read 1511 times)

0 Members and 1 Guest are viewing this topic.

Offline Deadfast

  • Members
  • *
[SOLVED] Extended EH: PostInit
« 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
« Last Edit: 17 Mar 2009, 19:55:38 by Deadfast »

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Re: Extended EH: PostInit
« Reply #1 on: 17 Mar 2009, 19:10:11 »
post some code so we can comment & correct.
or read the readme for the examples given.
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)

Offline Deadfast

  • Members
  • *
Re: Extended EH: PostInit
« Reply #2 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'";
};
};

Offline i0n0s

  • Former Staff
  • ****
Re: Extended EH: PostInit
« Reply #3 on: 17 Mar 2009, 19:36:00 »
class DFS_precompile <- Should this really be here?
At least the PreInit-Handler don't need it.

Offline Deadfast

  • Members
  • *
Re: Extended EH: PostInit
« Reply #4 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 ;)
« Last Edit: 17 Mar 2009, 19:55:19 by Deadfast »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: [SOLVED] Extended EH: PostInit
« Reply #5 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'";
};
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)