Jump to content

Recommended Posts

Hi everyone, 

 

I am only just starting to get into making addons, and have just completed my first - a simple dialog that simulates arty by creating explosions based on a 10-digit-grid entry into a dialog. It is basic, but it works in the editor. Now I am trying to pack it up as an addon for private use amongst mates (so not binarised or signed), but I think I am tripping up with the activation of the mod, which I believe is done in the config.cpp file.

 

This is what I have currently:

Spoiler

class CfgPatches

{

    class easyArty

    {

        units[] = {};

        weapons[] = {};

        requiredVersion = 0.1;

        requiredAddons[] = {};

    };

};

 

class Extended_PreInit_EventHandlers

{

    Reggaeman_init = "call compile preprocessFileLineNumbers '\easyArty\easyArtyInit.sqf'";

};

 

#include "dialog\defines.hpp"

#include "dialog\dialog.hpp"

 

Now I have loaded the mod, and fired up a new session in the editor. The dialog is meant to appear on keyDown (hash key). However this does not happen. However if I go into the debug and enter 'call compile preprocessFileLineNumbers '\easyArty\easyArtyInit.sqf', the mod triggers, and the dialog appears on keydown hash. So I can assume that the mod itself is working ok, and it is an issue with the initialisation (in the .cpp).

 

This is my first mod attempt, so apologies if this is all basic, or if I am missing something very obvious. I have tried for some time to figure this out on my own, but am now calling in help..

 

Any assistance on this would be very gratefully received!

 

 

Cheers

Alex

Share this post


Link to post
Share on other sites

do you have cba activated? Extended_PreInit_EventHandlers are only available with cba

Share this post


Link to post
Share on other sites

yes, CBA is loaded..

 

But I would happily activate this in a simpler way, without a CBA dependency ..

 

Perhaps the question is, if I were to remove any dependency on CBA, how could I initialise the script that activates the keypress EH (easyArtyInit.sqf)?

 

Edited by reggaeman007jah
added a better question

Share this post


Link to post
Share on other sites
 class Extended_PreInit_EventHandlers 

{

 class Reggaeman_init
	{
		init = "call compile preprocessFileLineNumbers '\easyArty\easyArtyInit.sqf'";
	};

}; 

 

Share this post


Link to post
Share on other sites
48 minutes ago, reggaeman007jah said:

requiredAddons[] = {};

You require CBA, but you are telling the game that you don't require CBA. You are lying to the game and it get's confused.

 

49 minutes ago, reggaeman007jah said:

Reggaeman_init =

That's not how XEH eventhandlers work.

https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#extended_preinit_eventhandlers

You need a subclass.

 

7 minutes ago, reggaeman007jah said:

But I would happily activate this in a simpler way, without a CBA dependency ..

use CfgFunctions with a preInit flag

Share this post


Link to post
Share on other sites

ok, so this is what I have now:

 

Spoiler

class CfgPatches

{

    class easyArty

    {

        units[] = {};

        weapons[] = {};

        requiredVersion = 0.1;

        requiredAddons[] = {};

        projectName = "easyArty";

        author = "Reggs";

    };

};

 

class CfgFunctions

{

    class easyArty

    {

        preInit = 1;

        Reggaeman_init = "call compile preprocessFileLineNumbers 'easyArty\easyArtyInit.sqf'";

    };

}

 

#include "dialog\defines.hpp"

#include "dialog\dialog.hpp"

 

I know this is wrong (i.e. this does not trigger anything). Am I getting the CfgFunctions wrong here?

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

×