Scripting: Config Object – Arma Reforger
Lou Montana (talk | contribs) (Page creation) |
Lou Montana (talk | contribs) (Add purpose/space warning) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
== Config Base Container Class == | == Config Base Container Class == | ||
A BaseContainerProps | A {{hl|BaseContainerProps}} decorator tells the Workbench that this class serves as a blueprint for the Config Editor. | ||
=== BaseContainerProps === | === BaseContainerProps === | ||
The usage of a {{hl|BaseContainerProps}} | The usage of a {{hl|BaseContainerProps}} decorator is required for the class to be visible and editable in the Config Editor - see the examples below. | ||
The minimum required | The minimum required decorator is <enforce inline>[BaseContainerProps(configRoot: true)]</enforce> for the base object Config to be visible in the Config creation process. | ||
A class inheriting a decorated | A class inheriting from a decorated class must be decorated as well in order to be usable. | ||
It accepts the following parameters: | It accepts the following parameters: | ||
| Line 84: | Line 84: | ||
=== Attribute === | === Attribute === | ||
The usage of an {{hl|Attribute}} member variable | The usage of an {{hl|Attribute}} member variable decorator is required for the value to be visible and editable in the Config Editor - see the examples below. | ||
The minimum required | The minimum required decorator is <enforce inline>[Attribute()]</enforce>. | ||
A variable's display name is deduced as follows: | A variable's display name is deduced as follows: | ||
| Line 101: | Line 101: | ||
ParamEnumArray enums = null, | ParamEnumArray enums = null, | ||
string category = "", | string category = "", | ||
int precision = 3) | int precision = 3, | ||
typename enumType = void | |||
bool prefabbed = false) | |||
</enforce> | </enforce> | ||
| Line 377: | Line 379: | ||
* Curve: "rangeX rangeY offsetX offsetY" (e.g "50.0 80.0 10.0 20.0" for curve axes to go X:10..60 (10 + 50) and Y:20..100 (20 + 80)) | * Curve: "rangeX rangeY offsetX offsetY" (e.g "50.0 80.0 10.0 20.0" for curve axes to go X:10..60 (10 + 50) and Y:20..100 (20 + 80)) | ||
* Vector: "minValue maxValue step purpose=purposeType space=spaceType anglesVar=anglesVariableName coordsVar=coordsVariableName" (e.g {{hl|"0 100 5"}} for a 0..100 range with steps of 5) for each vector value.<br><!-- | * Vector: "minValue maxValue step purpose=purposeType space=spaceType anglesVar=anglesVariableName coordsVar=coordsVariableName" (e.g {{hl|"0 100 5"}} for a 0..100 range with steps of 5) for each vector value.<br><!-- | ||
-->{{hl|purpose}} and {{hl|space}} are optional; using them makes {{hl|step}} optional and allows to set the vector value in World Editor using the transformation gizmo. | -->{{hl|purpose}} and {{hl|space}} are optional; using them makes {{hl|step}} optional and allows to set the vector value in World Editor using the transformation gizmo.<br>{{Feature|warning|{{hl|minValue}} and {{hl|maxValue}} are '''mandatory''' in order to define {{hl|purpose}} and {{hl|space}} (e.g {{hl|1= params: "inf inf purpose=coords space=entity"}}).}} | ||
** {{hl|purpose}} possible values: | ** {{hl|purpose}} possible values: | ||
*** {{hl|coords}} - the vector property represents coordinates | *** {{hl|coords}} - the vector property represents coordinates | ||
| Line 419: | Line 421: | ||
<!-- | 3 --> | <!-- | 3 --> | ||
| The wanted floating point precision. Restricts a floating point field to a certain amount of decimals. | | The wanted floating point precision. Restricts a floating point field to a certain amount of decimals. | ||
|- | |||
| enumType | |||
| enum typename | |||
<!-- | void --> | |||
| The enum typename to use for the enum ComboBox/Flags UI; prefer this to <enforce inline>ParamEnumArray.FromEnum()</enforce>. | |||
|- | |||
| prefabbed | |||
| bool | |||
<!-- | false --> | |||
| Internal use. | |||
|} | |} | ||
{{GameCategory|armaR|Modding|Guidelines | {{GameCategory|armaR|Modding|Scripting|Guidelines}} | ||
Latest revision as of 20:55, 10 March 2026
Config Base Container Class
A BaseContainerProps decorator tells the Workbench that this class serves as a blueprint for the Config Editor.
BaseContainerProps
The usage of a BaseContainerProps decorator is required for the class to be visible and editable in the Config Editor - see the examples below.
The minimum required decorator is [BaseContainerProps(configRoot: true)] for the base object Config to be visible in the Config creation process.
A class inheriting from a decorated class must be decorated as well in order to be usable.
It accepts the following parameters:
A class name display is defined as follow:
- if the class uses a name instead of a GUID (see NC_MUST_HAVE_NAME), the name is displayed - otherwise, the classname is
- the class can use a custom name with the usage of an additional decorator such as BaseContainerCustomTitle or one of its children
| Parameter | Type | Description |
|---|---|---|
| category | string | The class's category - only useful in World Editor plugins definition. |
| description | string | The class's description - only useful in World Editor plugins definition. |
| color | string | The class's colour in RGBA format (Red Green Blue Alpha) in a 0..255 range - only useful in World Editor plugins definition. |
| visible | bool | The class's visibility - only useful in World Editor plugins definition. |
| insertable | bool | |
| configRoot | bool | Define if the class is selectable when creating a new Config. |
| icon | string | The class's icon - only useful in World Editor plugins definition. |
| namingConvention | enum | See the NamingConvention enum.
Possible values:
|
Attribute
The usage of an Attribute member variable decorator is required for the value to be visible and editable in the Config Editor - see the examples below.
The minimum required decorator is [Attribute()].
A variable's display name is deduced as follows:
m_iMyVariable is split by removing m_ (conventional name prefix for a member variable), i (optional, additional prefix for variable type - see Values - Types) and splitting the remaining part using the capital letters: here My Variable.
It accepts the following parameters:
| Parameter | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| defvalue | string | The default value. It is always a string, even in the case of a boolean ("0", "1", not "false"/"true"), a number ("5678", "12.34") or a vector ("0 0 0"). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uiwidget | string | The Widget type to be used. It can be forced to whatever wanted. Note that not all widgets fit all variable types. See the UIWidgets class.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| desc | string | The variable's description; this provides a tooltip when hovering the variable name and does not replace it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params | string |
Used to define UI-specific settings, e.g a numerical range.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enums | ParamsEnumArray | An array of ParamEnum. Used to define ComboBox's items. It can be defined as follows:
{ ParamEnum("Text 1", "Value 1", "Description"), ParamEnum("Text 2", "Value 2") } The description is optional and is to fill a combobox's entry tooltip. As many as needed ParamEnum entries can exist. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| category | string | The variable's category - only useful in World Editor plugins to categorise properties. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| precision | int | The wanted floating point precision. Restricts a floating point field to a certain amount of decimals. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enumType | enum typename | The enum typename to use for the enum ComboBox/Flags UI; prefer this to ParamEnumArray.FromEnum(). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prefabbed | bool | Internal use. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||