Jump to content
Sign in to follow this  
Solus

Extended eventhandlers

Recommended Posts

Cheers. Very useful indeed!

Share this post


Link to post
Share on other sites

A new Extended Eventhandlers is ready - version 1.93: Extended_Eventhandlers193.zip

This one is the same as the one in the A.C.E. mod 1.03 patch and fixes the problem with "InitPost" event handlers not being executed on vehicles that are created after the mission starts. (See Create plane with script - all weapons show)

Changelog excerpt:

Quote[/b] ]XEH Change log

============

1.93 (Feb 16, 2009)

Fixed: empty vehicles created after the mission started did not get their

        InitPost handlers called...

Share this post


Link to post
Share on other sites

Can anyone explain me how to override previously defined event handler?

For example I have:

class Extended_InitPost_EventHandlers
{
class Tank
{
  TANK_INIT = "code";
};
};

And I want to completely override this code in another addon. Is there a way to do it properly?

Edited by MessiahUA

Share this post


Link to post
Share on other sites

I think this will do:

requiredAddons[] = { "CATracked","Extended_EventHandlers" };

TANK_INIT ="_this exec ""\Extended_EventHandlers\init.sqf"";";

Edited by hamis

Share this post


Link to post
Share on other sites

So I guess, that if I want to add my code, I need to add it after this exec?

TANK_INIT ="_this exec '\Extended_EventHandlers\init.sqf'; mycode...";

Am I right?

Share this post


Link to post
Share on other sites

Well,i'm not expert in scripts but i hope this helps.It is from ch m1a1 replacement config,and there is nothing about xeh except required addons:

class CH_M1A1_Replacement
{
 Units[] = {"M1Abrams"};
 weapons[] = {};
 requiredVersion = 1.14;
 requiredAddons[] = {"CAData","CACharacters","CAWeapons","CASounds","CATracked","Extended_EventHandlers"};
};
};
class Extended_Init_EventHandlers
{
class M1Abrams
{
 init = "CH_Stuff = [_this select 0, ""random""] execVM ""\ch_m1a1_replacement_cfg\scripts\m1a1\stuff.sqf"";CH_Panc = [_this select 0, ""unhide"", ""unhide"", ""hide""] execVM ""\ch_m1a1_replacement_cfg\scripts\m1a1\panc.sqf"";";
 textures = "CH_Textures = [_this select 0, ""NATO""] execVM ""\ch_m1a1_replacement_cfg\scripts\m1a1\textures.sqf"";";
 markings = "CH_Markings = [_this select 0, ""random"", ""random"", ""random"", ""random"", ""empty"", ""empty"", ""00"", ""00""] execVM ""\ch_m1a1_replacement_cfg\scripts\m1a1\markings.sqf"";";
};
};
class Extended_Fired_EventHandlers
{
class M1Abrams
{
 fired = "if (_this select 1 == ""M256"") then {CH_Recoil = [_this select 0] execVM ""\ch_m1a1_replacement_cfg\scripts\maingunrecoil.sqf""};";
};
};

Share this post


Link to post
Share on other sites

This example is just a plain use of XEH. It just adds events handlers and that's it.

Share this post


Link to post
Share on other sites
Can anyone explain me how to override previously defined event handler?

For example I have:

class Extended_InitPost_EventHandlers
{
class Tank
{
  TANK_INIT = "code";
};
};

And I want to completely override this code in another addon. Is there a way to do it properly?

If the above config snippet is found in "MyAddonA", you can override it with the following in MyAddonB:

class CfgPatches
{
   class MyAddonB
   {
       // The usual bits as units[], weapons[], requiredVersion should be here
       requiredAddons[]={"Extended_EventHandlers", "MyAddonA"};
   };
}

class Extended_InitPost_EventHandlers
{
   class Tank
   {
       TANK_INIT="newcode";  // Same name (TANK_INIT) as in MyAddonA
   };
};

Share this post


Link to post
Share on other sites

Ok, thanks for answer, i'll give it a try once more, but AFAIR it didn't work for me before (it executed two eventhandlers).

Share this post


Link to post
Share on other sites

Can someone please help me remove or move triggers that i have set up in RTE, I've put them down in the wrong place and seem unable to do anything about it. sorry to ask a newbie question...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×