reggaeman007jah 31 Posted March 22, 2019 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
Mr H. 402 Posted March 22, 2019 do you have cba activated? Extended_PreInit_EventHandlers are only available with cba Share this post Link to post Share on other sites
reggaeman007jah 31 Posted March 22, 2019 (edited) 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 March 22, 2019 by reggaeman007jah added a better question Share this post Link to post Share on other sites
Mr H. 402 Posted March 22, 2019 class Extended_PreInit_EventHandlers { class Reggaeman_init { init = "call compile preprocessFileLineNumbers '\easyArty\easyArtyInit.sqf'"; }; }; Share this post Link to post Share on other sites
Dedmen 2714 Posted March 22, 2019 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
reggaeman007jah 31 Posted March 22, 2019 Thank you both for your help, I will take this on board ... Share this post Link to post Share on other sites
reggaeman007jah 31 Posted March 22, 2019 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
Dedmen 2714 Posted March 22, 2019 6 hours ago, reggaeman007jah said: Am I getting the CfgFunctions wrong here? Yes. Again https://community.bistudio.com/wiki/Arma_3_Functions_Library#Adding_a_Function Share this post Link to post Share on other sites
reggaeman007jah 31 Posted March 22, 2019 apologies, thank you Share this post Link to post Share on other sites