Data Modding Basics – Arma Reforger
No edit summary |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 105: | Line 105: | ||
'''.layer''' | '''.layer''' | ||
| World Layer | | World Layer | ||
| {{Icon| | | {{Icon|unchecked}} | ||
| {{Icon|unchecked}} | | {{Icon|unchecked}} | ||
| {{Icon|unchecked}} | | {{Icon|unchecked}} | ||
Line 134: | Line 134: | ||
| Animation graph | | Animation graph | ||
| {{Icon|checked}} | | {{Icon|checked}} | ||
| {{Icon| | |{{Icon|checked}} | ||
| {{Icon|unchecked}} | | {{Icon|unchecked}} | ||
|- | |- | ||
Line 365: | Line 365: | ||
=== Using "Inherit in..." function === | === Using "Inherit in..." function === | ||
Inheriting from the config files or layouts can be performed via "'''Inherit in...'''" function. After clicking with '''Right Mouse Button''' on appropriate file and then selecting Inherit in function, a new pop up window will appear asking for a new file name. Once name is confirmed, a new file will be created in '''working addon''' with same folder structure as original file. As expected, all of the attributes will be '''inherited from parent file'''. | Inheriting from the prefabs, config files or layouts can be performed via "'''Inherit in...'''" function. After clicking with '''Right Mouse Button''' on appropriate file and then selecting Inherit in function, a new pop up window will appear asking for a new file name. Once name is confirmed, a new file will be created in '''working addon''' with same folder structure as original file. As expected, all of the attributes will be '''inherited from parent file'''. | ||
[[Image:armareforger-data-modding-inheriting.png|center]] | [[Image:armareforger-data-modding-inheriting.png|center]] | ||
{{Clear}} | {{Clear}} | ||
=== Using "Transfer to..." function === | |||
Transfer to function is a functionality for moving data & merging partially overridden files (like prefabs or configs) from current working addon to parent addon. Parent addon need to be unpacked in order to have this functionality working. | |||
{{Feature|important|Warning - currently this functionality is hardcoded to ArmaReforger addon which makes it unusable for modders.}} | |||
{{Clear}} | {{Clear}} | ||
Line 383: | Line 382: | ||
Replacing assets means that i.e. AK-74 model can be with a simple gray box and all prefabs which are referencing that AK-74 are going to use that new gray box from now. Such replacement can be performed with sounds, models, textures, animations, particle effects, world files or behavior trees. | Replacing assets means that i.e. AK-74 model can be with a simple gray box and all prefabs which are referencing that AK-74 are going to use that new gray box from now. Such replacement can be performed with sounds, models, textures, animations, particle effects, world files or behavior trees. | ||
[[Image:armareforger-data-modding-resource-variant.png|left]] In '''Particle Editor''' replacement can be performed quite | [[Image:armareforger-data-modding-resource-variant.png|left]] In '''Particle Editor''' replacement can be performed quite easily by using "'''Create variant for "..." addon..'''." function. This action creates new '''ptc''' file with same '''GUID''' and '''content''' as '''original file'''. | ||
{{Clear}} | {{Clear}} | ||
Line 398: | Line 397: | ||
{{Clear}} | {{Clear}} | ||
== Replacing script == | == Replacing script == | ||
Scripts can be replace each other simply when they are in same relative location with same name. | |||
For instance, to replace [enfusion://ResourceManager/~ArmaReforger:scripts/Game/UserActions/PickupAction.c PickupAction.c] located in base '''ArmaReforger''' data, you would need to create a new script in your addon in same location and with exact name.<syntaxhighlight lang="c#"> | |||
MyAddon\scripts\Game\UserActions\PickupAction.c | |||
</syntaxhighlight> | |||
If multiple addons are trying to replace same file, then the last one in the loading chain will be used. | |||
{{GameCategory|armaR|Modding|Tutorials|Assets}} | {{GameCategory|armaR|Modding|Tutorials|Assets}} |
Latest revision as of 14:09, 16 August 2024
Content Moddability Overview
Can Be Replaced
This means that certain resource can be fully replaced. Usually such resources are created manually by creating same asset with same GUID
Can Be Modified
Certain elements of the resource can be modified while rest of them is kept
Can Be Inherited From
A new resource can inherit from an existing file:
Moddability table
Extension | File Type | Can be replaced | Can be modified | Can be inherited from |
---|---|---|---|---|
.et |
Prefab | [1] | ||
.conf |
Config | [1] | ||
.xob |
Model | |||
.emat |
Material Definition | [1] | ||
.edds |
Enfusion DDS Texture | |||
.c |
Enforce Script Source | [2] | [3] | |
.layout |
Layout Definition | [1] | ||
.ptc | Particle System Definition | [1] | ||
.ent |
World Scene | |||
.layer |
World Layer | |||
.bt |
Behavior tree | [4] | ||
.anm |
Animation file | |||
.agf |
Animation graph file | |||
.agr |
Animation graph | |||
.aw |
Animation Workspace | |||
.asi |
Animation Set Template | |||
.pap |
Procedural Animation | |||
.siga |
Procedural Animation Signal | |||
.st |
String Table | |||
.acp |
Audio component | |||
.sig |
Signal (Audio) | |||
.wav |
Supported audio file format |
Footnotes
- ↑ 1.0 1.1 1.2 1.3 1.4 Following assets are always overridden and cannot be fully replaced
- ↑ Script files are fully replaced if script in other addon (filesystem) has same path as the one which is supposed to be replaced. For example AIAutotest.c located in $ArmaReforger:scripts\Game\AI\ will be replaced by variant from Addon1 if it is placed in same location and same name in Addon1 file system - $Addon1:scripts\Game\AI\ AIAutotest.c
- ↑ Usage of modded keyword is required + few other restrictions apply like method in class must not be private in order to allow overloading it
- ↑ Behavior trees attempts to override each other, instead of replace
Data manipulation
Basics
In principle, any file with meta file and unique GUID - global unique identifier - can be be overridden or replaced . This means however, that files without meta file have to be modified in different way (scripts ) or cannot be replaced at all.
That means that for instance models, textures, layout, prefabs, configs or animations can be replaced using this method.
Creating overrides, duplicates or inherited files can be performed from context menu which is available in Resource Browser. This menu is visible after clicking with Right Mouse Button on selected asset. Availability of the actions depends on the type of the assets, so for instance models (XOBs) have only Navigate to ... options.
Overriding assets
Using "Override in..." function
"Override to..." function can be used to modify (override) existing assets like configs, layouyts or prefabs.
Once you have file in addon which is overriding some data, you can quickly navigate
Scripts
In Enfusion it's possible to modify already existing scripts by using some of special keyword
- modded - keyword used to modify existing scripting class
- override - keyword to override methods in modded classes
- super - allows you to invoke content of overridden method
Modded keyword
Override keyword
Super keyword
Using "Duplicate to..." function
In Resource Browser you can quickly create new, duplicated file in project you are currently working on. This file is exact copy of original file and will be used from that point when any part of the game will try use asset with this GUID. Any changes that you are going to do to that file are going to be applied applied to that copy are not going to be propagated to it.
Inheriting
Using "Inherit in..." function
Inheriting from the prefabs, config files or layouts can be performed via "Inherit in..." function. After clicking with Right Mouse Button on appropriate file and then selecting Inherit in function, a new pop up window will appear asking for a new file name. Once name is confirmed, a new file will be created in working addon with same folder structure as original file. As expected, all of the attributes will be inherited from parent file.
Using "Transfer to..." function
Transfer to function is a functionality for moving data & merging partially overridden files (like prefabs or configs) from current working addon to parent addon. Parent addon need to be unpacked in order to have this functionality working.
Replacing assets
Replacing assets means that i.e. AK-74 model can be with a simple gray box and all prefabs which are referencing that AK-74 are going to use that new gray box from now. Such replacement can be performed with sounds, models, textures, animations, particle effects, world files or behavior trees.
In Particle Editor replacement can be performed quite easily by using "Create variant for "..." addon..." function. This action creates new ptc file with same GUID and content as original file.
In all other cases, replacing files is slightly more complicated and requires operations outside of Workbench.
Getting file GUID
First step towards creating such replacement would be obtaining GUID - this can be done via Copy Resource GUID(s) action, available in context menu after clicking on file with Right Mouse Button.
Once GUID is obtained, it can be manually typed into meta file of some newly created model. After that action is completed, restart of the Workbench might be necessary.
Replacing script
Scripts can be replace each other simply when they are in same relative location with same name.
For instance, to replace PickupAction.c located in base ArmaReforger data, you would need to create a new script in your addon in same location and with exact name.
MyAddon\scripts\Game\UserActions\PickupAction.c
If multiple addons are trying to replace same file, then the last one in the loading chain will be used.