Module Framework – Arma 3
Jump to navigation
Jump to search
No edit summary |
SilentSpike (talk | contribs) m (removed assumptions) |
||
Line 100: | Line 100: | ||
{{codecomment|// Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined}} | {{codecomment|// Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined}} | ||
functionPriority = 1; | functionPriority = 1; | ||
{{codecomment|// 0 for server only execution, 1 for | {{codecomment|// 0 for server only execution, 1 for execution on all clients, 2 for persistent execution}} | ||
isGlobal = 1; | isGlobal = 1; | ||
{{codecomment|// 1 for module waiting until all synced triggers are activated}} | {{codecomment|// 1 for module waiting until all synced triggers are activated}} |
Revision as of 20:14, 5 September 2015
Arma 3 introduces a module framework, which lets designer to simplify the configuration and chose how the module function will be executed (e.g., globally and for every player who joins later).
How to Create a Module
When creating a new module, follow these steps:
- Create a module addon.
- Make a folder named myTag_addonName a create a config.cpp file in it.
- Inside, declare a CfgPatches class with your addon and its modules (in the units array). Without this, the game wouldn't recognize the addon.
- Make sure the addon and all objects start with your tag, e.g. myTag
- Select a module category
- Modules are placed into basic categories which makes finding a desired module easier for an user. Use can use on of the existing categories:
- Create config for module logic
- All in-game objects (soldiers, vehicles, buildings, logics, modules, ...) are defined in CfgVehicles class.
- All modules must inherit from Module_F parent class, either directly or through some additional sub-parent. While modules inherting from some other class will be still displayed in the Modules menu (F7), they won't be using the module framework and all benefits tied to it.
- Pre-defined sync preview entities are:
- Anything - Any object - persons, vehicles, static objects, etc.
- AnyPerson - Any person. Not vehicles or static objects.
- AnyVehicle - Any vehicle. No persons or static objects.
- AnyStaticObject - Any static object. Not persons or vehicles.
- AnyBrain - Any AI or player. Not empty objects
- AnyAI - Any AI unit. Not players or empty objects
- AnyPlayer - Any player. Not AI units or empty objects
- EmptyDetector - Any trigger
- Configure a module function
- Place class CfgFunctions to config.cpp. See Functions Library (Arma 3) for more info about functions configuration.
- Write the module function
- Create the functions folder within the addon folder and place *.sqf or *.fsm files there.
- Example: \myTag_addonName\functions\fn_moduleNuke.sqf
- Create a module icon
- Right click on the image on left and Save Image As' to get the default module icon.
- Create a simple icon presenting the module in the circle. Avoid using too much detail, as the icon may downsized in the game.
- Save the image to \myTag_addonName\data\iconNuke_ca.paa
class | displayName |
---|---|
Effects | Effects |
Events | Events |
Modes | Gameplay Modes |
GroupModifiers | Group Modifiers |
Intel | Intel |
NO_CATEGORY | Misc |
Multiplayer | Multiplayer |
ObjectModifiers | Object Modifiers |
Sites | Sites |
StrategicMap | Strategic |
Supports | Supports |
Alternatively, you can create your own one:
class CfgFactionClasses { class NO_CATEGORY; class myTag_explosions: NO_CATEGORY { displayName = "Explosions"; }; };
If you cannot or don't want to create a custom image, avoid using icon entry in the module config. The default icon will then be inherited from Module_F base class.