Jump to content

Michael LeMay

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Everything posted by Michael LeMay

  1. I can't get my custom module to work, followed the guide but the function is not working and neither is the display that's supposed to come up when placed by Zeus. Config file: class CfgPatches { class NAK_Main { units[] = {"NAK_ExecuteCode"}; requiredVersion = 1.0; requiredAddons[] = {"A3_UI_F","A3_UI_F_Curator","A3_Functions_F","A3_Functions_F_Curator","A3_Modules_F","A3_Modules_F_Curator","A3_Modules_F_Bootcamp_Misc"}; }; }; class CfgFactionClasses { class NO_CATEGORY; class NAK: NO_CATEGORY { displayName = "NAK"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class AttributesBase { class Default; class Edit; class ModuleDescription; class Units; }; class ModuleDescription { class AnyPlayer; class AnyBrain; class EmptyDetector; }; }; class NAK_ExecuteCode: Module_F { scope = 2; scopeCurator = 2; displayName = "Execute Code"; category = "NAK"; vehicleClass = "Modules"; function = "NAK_fnc_ExecuteCode"; functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; isDisposable = 0; is3Den = 0; curatorInfoType = "RscDisplayAttributeExecuteCode"; class Attributes: AttributesBase { class Units: Units { property = "NAK_ExecuteCode_Units"; }; class SqfCode: Edit { property = "NAK_ExecuteCode_SqfCode"; displayName = "Execute Code"; tooltip = "Only use to load Zeus mission from clipboard, any other use will result in a suspension of Zeus privileges."; typeName = "STRING"; defaultValue = ""; }; class ModuleDescription: ModuleDescription{}; }; class ModuleDescription: ModuleDescription { description[] = { "This module can execute code."; }; sync[] = {}; }; }; }; class CfgFunctions { class NAK { class NAK { file = "\NAK_ExecuteCode\functions"; class ExecuteCode{}; }; }; }; Here is the function file: _logic = param [0,objNull,[objNull]]; _units = param [1,[],[[]]]; _activated = param [2,true,[true]]; if (_activated) then { _executeCode = _logic getVariable ["SqfCode", -1]; hint str format ["%1 is what you put."]; }; hint "It Works!"; true
  2. I'm trying to create a custom module, but when I place it nothing happens. I also don't know what I'm supposed to put for curatorInfoType, here's my config.cpp: class CfgPatches { class NAK_Modules { units[] = {"NAK_spawnUnit"}; requiredVersion = 1.0; requiredAddons[] = {"A3_UI_F","A3_UI_F_Curator","A3_Functions_F","A3_Functions_F_Curator","A3_Modules_F","A3_Modules_F_Curator","A3_Modules_F_Bootcamp_Misc"}; weapons[] = {}; }; }; class CfgFactionClasses { class NO_CATEGORY; class NAK: NO_CATEGORY { displayName = "NAK"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class AttributesBase { class Default; class Edit; // Default edit box (i.e., text input field) class Combo; // Default combo box (i.e., drop-down menu) class Checkbox; // Default checkbox (returned value is Boolean) class CheckboxNumber; // Default checkbox (returned value is Number) class ModuleDescription; // Module description class Units; // Selection of units on which the module is applied }; // Description base classes, for more information see below class ModuleDescription { class AnyPlayer; class AnyBrain; class EmptyDetector; }; }; class NAK_spawnUnit: Module_F { // Standard object definitions scope = 2; // Editor visibility; 2 will show it in the menu, 1 will hide it. scopeCurator = 2; displayName = "Spawn Unit"; // Name displayed in the menu category = "NAK"; icon = "NAK_spawnUnit\media\naksquad.paa"; vehicleClass = "Modules"; side = 7; // Name of function triggered once conditions are met function = "NAK_fnc_spawnUnit"; // Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined functionPriority = 1; // 0 for server only execution, 1 for global execution, 2 for persistent global execution isGlobal = 1; // 1 for module waiting until all synced triggers are activated isTriggerActivated = 1; // 1 if modules is to be disabled once it is activated (i.e., repeated trigger activation won't work) isDisposable = 0; // 1 to run init function in Eden Editor as well is3DEN = 0; // Menu displayed when the module is placed or double-clicked on by Zeus curatorInfoType = "RscDisplayAttributeModuleNuke"; // Module attributes, uses https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Entity_Specific class Attributes: AttributesBase { // Arguments shared by specific module type (have to be mentioned in order to be present) class Units: Units { property = "NAK_spawnUnit_Units"; }; // Module specific arguments class UnitType: Edit { property = "NAK_spawnUnit_UnitType"; displayName = "Unit Type"; tooltip = "Put unit class here"; defaultValue = "B_Soldier_F"; }; class ModuleDescription: ModuleDescription{}; // Module description should be shown last }; // Module description. Must inherit from base class, otherwise pre-defined entities won't be available class ModuleDescription: ModuleDescription { description[] = { "Use this module to spawn a unit." }; // Short description, will be formatted as structured text sync[] = {}; // Array of synced entities (can contain base classes) }; }; }; class CfgFunctions { class NAK { class NAK { file = "\NAK_spawnUnit\functions"; class spawnUnit{}; }; }; }; And here's my function: // Argument 0 is module logic. _logic = param [0,objNull,[objNull]]; // Argument 1 is list of affected units (affected by value selected in the 'class Units' argument)) _units = param [1,[],[[]]]; // True when the module was activated, false when it is deactivated (i.e., synced triggers are no longer active) _activated = param [2,true,[true]]; // Module specific behavior. Function can extract arguments from logic and use them. if (_activated) then { // Attribute values are saved in module's object space under their class names hint "Hello"; }; hint "Hello"; // Module function is executed by spawn command, so returned value is not necessary, but it is good practice. true For now, I'm just trying to get it to hint Hello. Sorry if this is in the wrong forum. Here's my file structure: NAK_Modules (folder) @NAK_Modules (folder) addons (folder) NAK_spawnUnit (folder) config.cpp (file) functions (folder) media (folder) fn_spawn.sqf (file) naksquad.paa (file)
  3. Michael LeMay

    Can't get custom module to show.

    I got it, thank you so much, I was pulling my hair out on this one. My file structure wasn't correct.
  4. I'm trying to learn how to create a custom module, I've followed several guides, including the official one, I even copy and pasted everything from the official guide and followed it step by step, nothing is working. config.cpp (I've also tried to name it mod.cpp): class CfgPatches { class myTag_addonName { units[] = {"myTag_ModuleNuke"}; requiredVersion = 1.0; requiredAddons[] = {"A3_Modules_F"}; }; }; class CfgFactionClasses { class NO_CATEGORY; class myTag_explosions: NO_CATEGORY { displayName = "Explosions"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class AttributesBase { class Default; class Edit; // Default edit box (i.e., text input field) class Combo; // Default combo box (i.e., drop-down menu) class Checkbox; // Default checkbox (returned value is Boolean) class CheckboxNumber; // Default checkbox (returned value is Number) class ModuleDescription; // Module description class Units; // Selection of units on which the module is applied }; // Description base classes, for more information see below class ModuleDescription { class AnyBrain; }; }; class myTag_ModuleNuke: Module_F { // Standard object definitions scope = 2; // Editor visibility; 2 will show it in the menu, 1 will hide it. displayName = "Nuclear Explosion"; // Name displayed in the menu icon = "\myTag_addonName\data\iconNuke_ca.paa"; // Map icon. Delete this entry to use the default icon category = "Effects"; // Name of function triggered once conditions are met function = "myTag_fnc_moduleNuke"; // Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined functionPriority = 1; // 0 for server only execution, 1 for global execution, 2 for persistent global execution isGlobal = 1; // 1 for module waiting until all synced triggers are activated isTriggerActivated = 1; // 1 if modules is to be disabled once it is activated (i.e., repeated trigger activation won't work) isDisposable = 1; // 1 to run init function in Eden Editor as well is3DEN = 1; // Menu displayed when the module is placed or double-clicked on by Zeus curatorInfoType = "RscDisplayAttributeModuleNuke"; // Module attributes, uses https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Entity_Specific class Attributes: AttributesBase { // Arguments shared by specific module type (have to be mentioned in order to be present) class Units: Units { property = "myTag_ModuleNuke_Units"; }; // Module specific arguments class Yield: Combo { // Unique property, use "<moduleClass>_<attributeClass>" format to make sure the name is unique in the world property = "myTag_ModuleNuke_Yield"; displayName = "Nuclear weapon yield"; // Argument label tooltip = "How strong will the explosion be"; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = "50"; // Default attribute value. WARNING: This is an expression, and its returned value will be used (50 in this case) class Values { class 50Mt {name = "50 megatons"; value = 50;}; // Listbox item class 100Mt {name = "100 megatons"; value = 100;}; }; }; class Name: Edit { displayName = "Name"; tooltip = "Name of the nuclear device"; // Default text filled in the input box // Because it is an expression, to return a String one must have a string within a string defaultValue = """Tsar Bomba"""; }; class ModuleDescription: ModuleDescription{}; // Module description should be shown last }; // Module description. Must inherit from base class, otherwise pre-defined entities won't be available class ModuleDescription: ModuleDescription { description = "Short module description"; // Short description, will be formatted as structured text sync[] = {"LocationArea_F"}; // Array of synced entities (can contain base classes) class LocationArea_F { description[] = { // Multi-line descriptions are supported "First line", "Second line" }; position = 1; // Position is taken into effect direction = 1; // Direction is taken into effect optional = 1; // Synced entity is optional duplicate = 1; // Multiple entities of this type can be synced synced[] = {"BLUFORunit","AnyBrain"}; // Pre-define entities like "AnyBrain" can be used. See the list below }; class BLUFORunit { description = "Short description"; displayName = "Any BLUFOR unit"; // Custom name icon = "iconMan"; // Custom icon (can be file path or CfgVehicleIcons entry) side = 1; // Custom side (will determine icon color) }; }; }; }; class CfgFunctions { class myTag { class Effects { file = "\myTag_addonName\functions"; class moduleNuke{}; }; }; }; addons\functions.sqf: _mode = param [0,"",[""]]; _input = param [1,[],[[]]]; switch _mode do { // Default object init case "init": { _logic = _input param [0,objNull,[objNull]]; // Module logic _isActivated = _input param [1,true,[true]]; // True when the module was activated, false when it is deactivated _isCuratorPlaced = _input param [2,false,[true]]; // True if the module was placed by Zeus // ... code here... }; // When some attributes were changed (including position and rotation) case "attributesChanged3DEN": { _logic = _input param [0,objNull,[objNull]]; // ... code here... }; // When added to the world (e.g., after undoing and redoing creation) case "registeredToWorld3DEN": { _logic = _input param [0,objNull,[objNull]]; // ... code here... }; // When removed from the world (i.e., by deletion or undoing creation) case "unregisteredFromWorld3DEN": { _logic = _input param [0,objNull,[objNull]]; // ... code here... }; // When connection to object changes (i.e., new one is added or existing one removed) case "connectionChanged3DEN": { _logic = _input param [0,objNull,[objNull]]; // ... code here... }; // When object is being dragged case "dragged3DEN": { _logic = _input param [0,objNull,[objNull]]; // ...code here... }; }; true As you can see, it's basically exactly like the tutorial here: https://community.bistudio.com/wiki/Modules All I'm trying to do right now is get it to show up, I'll worry about functionality later, but it's not even appearing in the list of modules in the Eden Editor.
  5. Michael LeMay

    Can't get custom module to show.

    It's not in there, maybe my file structure is off? My structure is: Main Folder: myTag_addonName Inside that: addons folder and the config.cpp file Inside the addons folder I got the functions.pbo file.
×