Jump to content
Sign in to follow this  
Raining6

Help with CBA3 simple "Hello World!" mod

Recommended Posts

I have followed this guide on making the most simple mod possible - displaying "Hellow world!" in Arma 3. 

 

 https://www.reddit.com/r/armadev/comments/hzcnb3/tutorial_creating_a_simple_mod_following_the_cba/

 

Firstly, the guide is 3 years old and I wonder if it is still relevant. 

Second, there is an important typo in the guide in the "XEH_preStart/preInit/postInit" section - the author confuses all three.

Third, when following the "Building the addon" section my Pbo project 3.57 throws errors  like:

Spoiler

 

Quote

Author:
Spooner
------------------------------------------- */
#ifdef DEBUG_MODE_FULL

#define LOG(MESSAGE) LOG_SYS('LOG',MESSAGE)
#define LOG_1(MESSAGE,ARG1) LOG(FORMAT_1(MESSAGE,ARG1))
#define LOG_2(MESSAGE,ARG1,ARG2) LOG(FORMAT_2(MESSAGE,ARG1,ARG2))
#define LOG_3(MESSAGE,ARG1,ARG2,ARG3) LOG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
#define LOG_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) LOG(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
#define LOG_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) LOG(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
#define LOG_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) LOG(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
#define LOG_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) LOG(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
#define LOG_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) LOG(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))

#else

#define LOG(MESSAGE) /* disabled */

***warning***:Argument 'MESSAGE' is not used in macro LOG
warnings are errors

 

 

 

 

Any help would be appreciated!

Share this post


Link to post
Share on other sites

Here is a solution:

Create a file structure "a Hello World mod\addons\HW_hello_world" in some folder -Desktop or My Documents, etc. Inside the "HW_hello_world" folder, create 3 files - with the following code inside each one:

$PBOPREFIX$.txt 

prefix=HW_hello_world;

config.cpp

class CfgPatches
{
class HW_hello_world
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.0;
	requiredAddons[] = {"Extended_EventHandlers"};

};
};

class Extended_PostInit_EventHandlers
{
 HW_hello_world_Post_Init = "HW_hello_world_Post_Init_Var = [] execVM ""\HW_hello_world\YourScript.sqf""";
};

YourScript.sqf

hint "Hiiiiiiiiiiiiiiiiiiiiiiii World!";

 

Download PboManager https://github.com/winseros/pboman3 and install it. Select the "HW_hello_world" folder, right click it, select PBO Manager, select "pack as HW_hello_world.pbo". The mod is done. 

Download and install CBA A3 from the Arma 3 Workshop.

Run Arma 3, click Mods, activate CBA A3. Click Select Local Mods, navigate to your "a Hello World mod" folder and select it. Run any mission in the game/editor and you will see the "Hiiiiiiiiiiiiiiiiiiiiiiii world!" greeting. 

Adjust the mod to your liking with other scripts and objects.

Sit back and marvel at the possibilities.

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  

×