Jump to content
kaleb c0d3

Help with Module attributes

Recommended Posts

Sup again. I'm migrating a bunch of loose functions to mods, so my group can use them when editing missions (they know little to no scripting).

So far, i was able to create modules and place them into the editor. But now i'm struggling with a module attribute. In this particular case, I need an "activation script" attribute, just like the triggers. I saw that theres a class named "EditCodeMulti5" that fits perfecly, but when tried to edit the placed module properties, i'v got an error: no entry 'bin\config.bin/Cfg3DEN/Attributes'

My config is this:

class CfgVehicles
{
	class Logic;
	class Module_F: Logic
	{
		class AttributesBase
		{
			class Default;
			class Edit; 
			class EditCodeMulti5; // <-- added this
			class Combo;
			class Checkbox;
			class CheckboxNumber;
			class ModuleDescription;
			class Units;
		};
		
		class ModuleDescription
		{
			class Anything;
		};
	};

	class GLKP_ModuleKeyPad: Module_F
	{
		author = "Kaleb";
		scope = 2;
		displayName = $STR_GL_KeyPadPanel;
		icon = "\GL_KeyPad\images\gl_keypad.paa";
		category = "GL_Category";
		function = "GLKP_fnc_initKeyPad";
		functionPriority = 110;
		isGlobal = 1;
		isTriggerActivated = 0;
		//isDisposable = 1;
		is3DEN = 0;

		class Attributes: AttributesBase
		{
			class EnterCodeCallback: EditCodeMulti5 // <-- module attribute
			{
				property = "gl_enterCodeCallback";
				displayName = $STR_GLKP_EnterCodeCallback;
				tooltip = $STR_GLKP_EnterCodeCallback_Tooltip;
				typeName = "STRING";
				validate = "expression";
				defaultValue = """true""";
			};
		};
	};
};

The error produces after placing the module into the editor, when double clicking on it to edit it's attributes:  no entry 'bin\config.bin/Cfg3DEN/Attributes'
If I change the attribute EnterCodeCallback to inherit from a "base" control, let's say Edit , it doesn't show any errors and allows me to edit the attribute.

 

Any help is appreciated. Thanks in advance.

Share this post


Link to post
Share on other sites

By reverse engineering other vanilla modules, I made it work now... but I'm not %100 sure how. I have my suspicions by reading the Bohemia wiki that modules has their own set of "common" attributes, and if you want something more fancy, you have to mess with Cfg3DEN. Long story short, this is the fixed thing.

class CfgVehicles
{
	class Logic;
	class Module_F: Logic
	{
		class AttributesBase
		{
			class Default;
			class Edit; 
			// removed the EditCodeMulti5 class
			class Combo;
			class Checkbox;
			class CheckboxNumber;
			class ModuleDescription;
			class Units;
		};
		
		class ModuleDescription
		{
			class Anything;
		};
	};

	class GLKP_ModuleKeyPad: Module_F
	{
		author = "Kaleb";
		scope = 2;
		displayName = $STR_GL_KeyPadPanel;
		icon = "\GL_KeyPad\images\gl_keypad.paa";
		category = "GL_Category";
		function = "GLKP_fnc_initKeyPad";
		functionPriority = 110;
		isGlobal = 1;
		isTriggerActivated = 0;
		//isDisposable = 1;
		is3DEN = 0;

		class Attributes: AttributesBase
		{
			class EnterCodeCallback // <--- fixed this entire block
			{
				control = "EditCodeMulti5";
				property = "gl_enterCodeCallback";
				displayName = $STR_GLKP_EnterCodeCallback;
				tooltip = $STR_GLKP_EnterCodeCallback_Tooltip;
				typeName = "STRING"; 
				validate = "none";		
				defaultValue = """true""";
				expression = "_this setVariable ['gl_enterCodeCallback', _value, true];";
			};
		};
	};
};

I hope it helps.

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

×