Difference between revisions of "Modules"
Jump to navigation
Jump to search
m |
m (various asthetic changes) |
||
Line 2: | Line 2: | ||
== Introduction == | == Introduction == | ||
This page can be considered a hub when it comes to '''modules'''. Here you'll find everything you need to know when it comes to creating modules, available modules in {{arma3}} and existing module documentation. | This page can be considered a hub when it comes to '''modules'''. Here you'll find everything you need to know when it comes to creating modules, available modules in {{arma3}} and existing module documentation. | ||
+ | |||
+ | |||
== Creating a Module == | == Creating a Module == | ||
{{arma3}} introduces a module framework which aims to simplify the configuration of modules and the way their functions are executed (Globally,[[JIP]]) | {{arma3}} introduces a module framework which aims to simplify the configuration of modules and the way their functions are executed (Globally,[[JIP]]) | ||
− | === Create a Module Addon === | + | |
+ | === 1. Create a Module Addon === | ||
* Make a folder named ''<span style="color:indigo">myTag</span>_addonName'' a create a ''config.cpp'' file in it. | * Make a folder named ''<span style="color:indigo">myTag</span>_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. | * 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. <span style="color:indigo">myTag</span> | * Make sure the addon and all objects start with your tag, e.g. <span style="color:indigo">myTag</span> | ||
+ | '''Example''' | ||
class CfgPatches | class CfgPatches | ||
{ | { | ||
Line 19: | Line 23: | ||
}; | }; | ||
− | === 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 | + | === 2. Module Category === |
− | {| class=" | + | * Modules are placed into basic categories which makes finding a desired module easier for an user. Use can use on of the existing categories ''(See table to the right)'' or create your own category ''(See example below)'' |
+ | {| class="wikitable" style="float: right; margin: 0 0 0 2.2em; max-width: 50%;" | ||
! class | ! class | ||
! displayName | ! displayName | ||
Line 58: | Line 63: | ||
| Supports | | Supports | ||
|} | |} | ||
− | + | '''Example'''<br> | |
class CfgFactionClasses | class CfgFactionClasses | ||
{ | { | ||
Line 68: | Line 73: | ||
}; | }; | ||
− | === Creating the Module Config === | + | |
+ | === 3. Creating the Module Config === | ||
* All in-game objects (soldiers, vehicles, buildings, logics, modules, ...) are defined in ''CfgVehicles'' class. | * 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. | * '''All modules must inherit from Module_F''' parent class, either directly or through some additional sub-parent. | ||
Line 182: | Line 188: | ||
};</spoiler> | };</spoiler> | ||
− | [[File:A3 modules info.jpg| | + | [[File:A3 modules info.jpg|230px|thumb|[[2D Editor]]: The description is available after clicking on "Show Info" button when editing the module]] |
− | [[File:A3 3den ModuleDescription.jpg|thumb| | + | [[File:A3 3den ModuleDescription.jpg|thumb|230px|[[Eden Editor]]: The description is available after opening the modules' attributes window]] |
* Pre-defined sync preview entities can be: | * Pre-defined sync preview entities can be: | ||
Line 218: | Line 224: | ||
|} | |} | ||
− | === Configuring the Module Function === | + | |
+ | === 4. Configuring the Module Function === | ||
* Place '' class CfgFunctions'' to ''config.cpp''. See [[Functions Library (Arma 3)]] for more info about functions configuration. | * Place '' class CfgFunctions'' to ''config.cpp''. See [[Functions Library (Arma 3)]] for more info about functions configuration. | ||
'''Example'''<br> | '''Example'''<br> | ||
Line 234: | Line 241: | ||
};</spoiler> | };</spoiler> | ||
− | === Writing the Module Function === | + | |
+ | === 5. Writing the Module Function === | ||
* Create the ''functions'' folder within the addon folder and place *.sqf or *.fsm files there. | * Create the ''functions'' folder within the addon folder and place *.sqf or *.fsm files there. | ||
* Example: ''\<span style="color:indigo">myTag</span>_addonName\functions\fn_<span style="color:green">module</span><span style="color:orangered;">Nuke</span>.sqf'' | * Example: ''\<span style="color:indigo">myTag</span>_addonName\functions\fn_<span style="color:green">module</span><span style="color:orangered;">Nuke</span>.sqf'' | ||
Line 297: | Line 305: | ||
}; | }; | ||
true</spoiler> | true</spoiler> | ||
+ | |||
== Module Properties == | == Module Properties == | ||
Line 323: | Line 332: | ||
| Changes the object's starting position to a random point within a circle of this radius, in metres. This can be used to add some randomness to your mission. For grouped units, the placement radius is only used by the group leader, and group members with a [[#Special|''Special'']] setting of ''None'' (or ''In Cargo'' for a group without suitable vehicle). | | Changes the object's starting position to a random point within a circle of this radius, in metres. This can be used to add some randomness to your mission. For grouped units, the placement radius is only used by the group leader, and group members with a [[#Special|''Special'']] setting of ''None'' (or ''In Cargo'' for a group without suitable vehicle). | ||
|} | |} | ||
+ | |||
== Arma 3 Modules (List) == | == Arma 3 Modules (List) == | ||
Line 1,007: | Line 1,017: | ||
_export = _export + "|}"; | _export = _export + "|}"; | ||
copyToClipboard _export;</syntaxhighlight></spoiler> | copyToClipboard _export;</syntaxhighlight></spoiler> | ||
+ | |||
== Module Documentation == | == Module Documentation == |
Revision as of 22:03, 17 June 2018
Introduction
This page can be considered a hub when it comes to modules. Here you'll find everything you need to know when it comes to creating modules, available modules in Arma 3 and existing module documentation.
Creating a Module
Arma 3 introduces a module framework which aims to simplify the configuration of modules and the way their functions are executed (Globally,JIP)
1. 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
Example
class CfgPatches { class myTag_addonName { units[] = {"myTag_ModuleNuke"}; requiredVersion = 1.0; requiredAddons[] = {"A3_Modules_F"}; }; };
2. 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 (See table to the right) or create your own category (See example below)
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 |
Example
class CfgFactionClasses { class NO_CATEGORY; class myTag_explosions: NO_CATEGORY { displayName = "Explosions"; }; };
3. Creating the Module Config
- 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.
- Modules functions are by default not executed when in Eden Editor workspace. It can be enabled using is3DEN property, but that will also change format of function params.
Example
Show text

2D Editor: The description is available after clicking on "Show Info" button when editing the module

Eden Editor: The description is available after opening the modules' attributes window
- Pre-defined sync preview entities can be:
Class | Descripton |
---|---|
Anything | Any object - persons, vehicles, static objects, etc. |
AnyPerson | Any person. Not vehicles or static objects. |
AnyVehicle | Any vehicle. No persons or static objects. |
GroupModifiers | Group Modifiers |
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 |
4. Configuring the Module Function
- Place class CfgFunctions to config.cpp. See Functions Library (Arma 3) for more info about functions configuration.
Example
Show text
5. Writing 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
- Input parameters differ based on value of is3DEN property.
Default Example (is3DEN = 0)
Show text
Example Eden Editor (is3DEN = 1)
Show text
Module Properties
Property Name | Description |
---|---|
Name | The name of a module can be used to refer to the object in script code. Like all variable names, the name must not contain any spaces or reserved characters. You should try to make it something meaningful and avoid conflicts. Note that if a variable exists with an identical name, no warning will be given and the name will refer to the variable first, rather than the named unit. If you copy and paste a named entity, the duplicate will be automatically have an underscore and number appended to it's name to avoid conflicts. |
Initialization | Any script code placed in this box will be executed as the mission begins. Script code is extremely powerful and useful - it allows you to create many effects and change aspects of the mission that would not be possible using only the graphical interface of the mission editor. For example, to make a soldier begin the mission unarmed, add "removeAllWeapons this" (without the quotation marks) to it's initialization string. Any expressions in the initialization field must return nothing, or an error message will prevent the unit dialogue from closing. |
Description | The description property is not used by modules. However, it's used by some functions and it changes the tooltip in Eden Editor when hovering over the module icon. |
Probability of Presence | Defines how likely it is that the entity will exist each time the mission is played. This can be used to add a bit of randomness to missions. Moving the slider all the way to the right means the object will always be there, all the way to the left means the unit will never appear. Note the Condition of Presence must also return true if the entity is to appear in the mission. |
Condition of Presence | This is a script code condition which must return true in order for the object to appear in the mission. By default this reads "true" which means the object will appear as defined by it's Probability of Presence. For an example, if you wanted a unit to appear only if the mission is being played in Veteran mode, place "!cadetMode" (without quotation marks) in it's Condition of Presence box. A unit with a Condition of Presence that returns false will not exist in the mission, irrespective of its Probability of Presence. |
Placement Radius | Changes the object's starting position to a random point within a circle of this radius, in metres. This can be used to add some randomness to your mission. For grouped units, the placement radius is only used by the group leader, and group members with a Special setting of None (or In Cargo for a group without suitable vehicle). |
Arma 3 Modules (List)
Module List
Show text
Export Function
Show text
Module Documentation
Here you'll find link to modules which have been documented on this wiki.
Arma 2
Arma 3
- Arma 3 Module: Sector
- Arma 3 Module: Animals
- Arma 3 Module: Combat Get In
- Arma 3 Module: Cover Map
- Arma 3 Module: Game Master