Jump to content
Sign in to follow this  
mr.g-c

Extended Eventhandlers Syntax Problem

Recommended Posts

Hi, i currently try to make the old Lowfly made Editor-upgrade XEH ready, since it uses a sh*tload of inits.

There are no error messages but also non of the scripts is loading...

I give you a short example of how it looks currently (don't want to post all 150+ inits)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Extended_Init_EventHandlers

{

class AAMOW006

{

ARPG_Init_AAMOW006="_Path = ""EditorUpdate_v102\scripts\""; bplyTW=FALSE; Transporter = objnull; [(_this select 0),_Path,localize ""STR_AAMOW006"",""AAMOW006"",-0.00,60] exec format[""%1TransportWeapon\WeaponTransportPlayer.sqs"",_Path]";

};

class AAMOW007

{

ARPG_Init_AAMOW007="_Path = ""EditorUpdate_v102\scripts\"";[(_this select 0),[""Truck"",""StrykerBase"",""Ural"",""BRDM2"",""Tank""],20,12,20,40,_Path] exec format[""%1TransportWeapon\Transport.sqs"",_Path]";

};

class AAMOW008

{

ARPG_Init_AAMOW008="_Path = ""EditorUpdate_v102\scripts\"";[(_this select 0),[""Truck"",""StrykerBase"",""Ural"",""BRDM2"",""Tank""],20,12,20,40,_Path] exec format[""%1TransportWeapon\Transport.sqs"",_Path]";

};

class AAMOW009

{

ARPG_Init_AAMOW009="_Path = ""EditorUpdate_v102\scripts\"";[(_this select 0),[""Truck"",""StrykerBase"",""Ural"",""BRDM2"",""Tank""],20,12,20,40,_Path] exec format[""%1TransportWeapon\Transport.sqs"",_Path]";

};

class AAMOW010

{

ARPG_Init_AAMOW010="_Path = ""EditorUpdate_v102\scripts\"";[(_this select 0),[""Truck"",""StrykerBase"",""Ural"",""BRDM2"",""Tank""],20,12,20,40,_Path] exec format[""%1TransportWeapon\Transport.sqs"",_Path]";

};

class AAFU036

{

ARPG_Init_AAFU036="EDPath = ""EditorUpdate_v102\scripts\WeaponDlg\"";_id1 = (_this select 0) AddAction [localize ""STR_ED_DIALOGWEAPONOPEN"", format[""%1BaseWeapons\openWeaponDialog.sqs"",EDPath]]; [(_this select 0),""MuniMarker"",""Dot"",""STR_ED_MAG_BOX_MARKER"",""ColorBlack"",[0.2,0.2]] exec format [""%1SetMagazineBoxMarker.sqs"",EDPath];";

};

class AAFU037

{

ARPG_Init_AAFU037="EDPath = ""EditorUpdate_v102\scripts\WeaponDlg\"";_id1 = (_this select 0) AddAction [localize ""STR_ED_DIALOGWEAPONOPEN"", format[""%1FlareWeapons\openWeaponDialog.sqs"",EDPath]];[(_this select 0),""MuniMarker"",""Dot"",""STR_ED_MAG_BOX_MARKER"",""ColorBlack"",[0.2,0.2]] exec format [""%1SetMagazineBoxMarker.sqs"",EDPath];";

};

class AAFU038

{

ARPG_Init_AAFU038="EDPath = ""EditorUpdate_v102\scripts\WeaponDlg\"";_id1 = (_this select 0) AddAction [localize ""STR_ED_DIALOGWEAPONOPEN"", format[""%1SmokeWeapons\openWeaponDialog.sqs"",EDPath]];[(_this select 0),""MuniMarker"",""Dot"",""STR_ED_MAG_BOX_MARKER"",""ColorBlack"",[0.2,0.2]] exec format [""%1SetMagazineBoxMarker.sqs"",EDPath];";

};

class AAFU039

{

ARPG_Init_AAFU039="EDPath = ""EditorUpdate_v102\scripts\WeaponDlg\"";_id1 = (_this select 0) AddAction [localize ""STR_ED_DIALOGWEAPONOPEN"", format[""%1AllWeapons\openWeaponDialog.sqs"",EDPath]];[(_this select 0),""MuniMarker"",""Dot"",""STR_ED_MAG_BOX_MARKER"",""ColorBlack"",[0.2,0.2]] exec format [""%1SetMagazineBoxMarker.sqs"",EDPath];";

};

};

The way i name the inits always worked in all other addons i made XEH ready - but somehow not here.

Share this post


Link to post
Share on other sites

Bump....

Anyone a idea?

Having tried it for some long hours yesterady but can't get it to work....

Share this post


Link to post
Share on other sites

Do you really need XEH for objects?

Also the script call looks scary.

Complete waste of GV.

Also replace each of "format [..., _path with" the real path just written into the local var.

Share this post


Link to post
Share on other sites

Hi, its about the make the Editorupgrade 1.02 by Lowfly XEH ready.

I use many many other addons with init-eventhandlers and i thought that XEH is best used in such situations, or not?

Modemmaik and me are trying it now since days but we couldn't manage it so far.... the scripts get simply not loaded at all - but there is also no error message.

The Script calls are 100% non-altered and works like that by default in normal "class eventhandlers" inside the specific cfgvehicle-classes.

Share this post


Link to post
Share on other sites

No luck so far.... i remeoved now any inits but the scripts are simply not getting loaded as it seems...

What is wrong with this:

Quote[/b] ]class AAStreetObjectLamp

{

init="[_this select 0, ""Auto""] exec ""EditorUpdate_v102\scripts\switchlight.sqs"" ";

};

class AAWallObjectLamp

{

Init="[_this select 0, ""Auto""] exec ""EditorUpdate_v102\scripts\switchlight.sqs"" ";

};

Share this post


Link to post
Share on other sites

The init event has to be declared within the EventHandler class in the config:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class AAWallObjectLamp : AAStreetObject

       {

       simulation="fire";

       effects="AALampLigth";

       icon="\EditorUpdate_v102\icons\lightpole.paa";

       class EventHandlers

               {

               init = "[(_this select 0),""Auto""] exec ""EditorUpdate_v102\scripts\switchlight.sqs""";

               };

       };

Share this post


Link to post
Share on other sites

Hi, but not if i want to make it XEH-ready, no?

They must be inside the "class Extended_init_eventhandlers" to working... at least i did it dozend times in other addons i made XEH ready and it was EVERYTIME working.

Share this post


Link to post
Share on other sites
Quote[/b] ]Hi, but not if i want to make it XEH-ready, no?

That example was for the standard init event. For the Extended Init EventHandlers you would need both:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Extended_Init_EventHandlers

       {

       class AAWallObjectLamp

               {

               AAWallObjectLamp_Init="[(_this select 0),""Auto""] exec ""EditorUpdate_v102\scripts\switchlight.sqs""";

               };

       };

class cfgVehicles

       {

       class Static;

       class AAStreetObject: Static

               {                

               scope=protected;

               access=ReadAndCreate;

               vehicleClass="StreetObjects";

               cost=0;

               mapSize=1;

               destrType=destructno;

               model="\ca\rocks\clutter_stone_small";

               icon="\ca\data\data\Unknown_object.paa";

               accuracy=0.3;        // accuracy needed to recognize type of this target

               ladders[]={};

               };

       class AAWallObjectLamp : AAStreetObject

               {              

               simulation="fire";

               effects="AALampLigth";

               icon="\EditorUpdate_v102\icons\lightpole.paa";

               class EventHandlers

                       {

                       init = "[_This Select 0,""Extended_Init_EventHandlers""] call compile preprocessFile ""\Extended_EventHandlers\Init.sqf""";

                       };

               };

       };

Share this post


Link to post
Share on other sites

Extended Eventhandlers do not work for static objects except for mounted weapons. Best to stick to the old way for them. It's not like you would want them to execute other scripts.

Share this post


Link to post
Share on other sites
Quote[/b] ]Extended Eventhandlers do not work for static objects

It works for me in Single Player, just tested it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class MyHouse

               {

               units[] = {"MyHouse"};

               weapons[] = {""};

               requiredVersion = 1.08;

               requiredAddons[] = {};

               };

       };

class Extended_Init_EventHandlers

      {

      class MyHouse

              {

              MyHouse="MYVAR=999";

              };

      class MyHouse1

              {

              MyHouse="MYVAR1=999";

              };

      };

class cfgVehicles

       {

       class House;

       class MyHouse : House

               {

               scope=2;

               displayName="My House";

               model = "\ca\buildings\Misc\KBud";

               animated = 1;

               class EventHandlers

                       {

                       init = "[_This Select 0,""Extended_Init_EventHandlers""] call compile preprocessFile ""\Extended_EventHandlers\Init.sqf""";

                       };

               };

       class MyHouse1 : MyHouse

               {

               displayName="My House 1";

               class EventHandlers

                       {

                       init = "[_This Select 0,""Extended_Init_EventHandlers""] call compile preprocessFile ""\Extended_EventHandlers\Init.sqf""";

                       };

               };

       };

I do remember hitting some problems with init events, JIP and static objects. But that was over a year ago so I don't know if it's still a problem?

Share this post


Link to post
Share on other sites
Quote[/b] ]Extended Eventhandlers do not work for static objects

It works for me in Single Player, just tested it...

That's because you're adding the XEH init to static objects. It's not there originally like it is with the other unit classes.

It may be intentional. Since adding eventhandlers to all the thousands of static objects is not very useful. Scripts are so uncommon for them that the normal eventhandler system seems like enough.

I doubt XEH was made with static objects in mind, but I guess that wouldn't cause issues.

Share this post


Link to post
Share on other sites
Quote[/b] ]Extended Eventhandlers do not work for static objects

Let's read through this post again.

Share this post


Link to post
Share on other sites

Thanks UNN, you just helped me and didn't even know it!! WooHoo!

To original poster: Been working on this on/off for a couple weeks, EventHandlers worked but when I tried to incorporate xeh, wasnt working at all wasn't reading scripts, or error'd out. Totally redid as UNN explained above with both XEH and standard EH, just like his example, works flawlessly...

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  

×