Game Master: Editable Entities Configuration – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search

Step-by-step guide to how to create a prefab variant recognized by in-game editor; either manually, or using automated process.

To make an entity editable in in-game editor, several components have to be added to it and the entity needs to be replicated. Because this affects performance, we don't want to add such functionality on all prefabs - having every tree or rock configure this way would be a big it.

Instead, we'll create inherited prefab of each entity which we want editable. Doing this manually would be too time-consuming, so there are automated Workbench plugins which can take care of that.

Creating Placeable Prefabs

Existing Prefab

Prefabs which exist even without their use in the editor, e.g., soldiers, vehicles, props, houses, etc.

Select

In Resource Browser, select prefab files (*.et) of entities you want to process.

Check editable entity types to see which prefabs should be marked as editable.

Tip: Both Resource Manager and World Editor browsers are supported, but not Resource Manager 2.

Create

Usage of In-game Editor plugins

With files selected, activate Plugins > In-game Editor > Create/Update Selected Editable Prefabs

Tip: You can also press Ctrl+Shift+U to perform this action.

After the operation is done, please check the log, it will list all processed prefabs. They can end up with one of the following states:

  • Created / Updated - successful processed
  • Failed - unable to generate the prefab, most commonly due to presence of child entity with RplComponent
  • Non-editable - some child entities which don't have editable prefab variant were detected. Please revise them and consider if some of them could be made editable as well.

If prefab creation succeeded, new files will be made in PrefabsEditable/Auto as well as UI/Textures/EditorPreviews/Auto folders.

Maintain

Editable prefabs needs to be regenerated every time the source prefab changes. This can be achieved by several ways:

  • Activate Plugins > In-game Editor > Update All Editable Prefabs
    • This will update all auto-generated editable prefabs.
    • It will also handle renamed / moved / deleted source prefabs (enable Only File Changes attribute to perform this operation only).
  • Select an editable or a source prefab and activate Plugins > In-game Editor > Create/Update Selected Editable Prefabs

Custom Prefab

Prefabs created specifically for the editor, e.g., slots, comments, etc.

Configure

When setting-up the entity in World Editor, add following component prefabs to make it editable:

Tip: You can also add the components a new, without relying on prefabs. Do so only if you understand what they do and how to configure them.
In this article, Enfusion links are used. With those links it is possible to open specific resource just by simply clicking on that link. Enfusion links has to be manually activated in Workbench options (Workbench -> Options -> Workbench -> Register "enfusion://" protocol) before it can be used]

Choose Directory

Before turning the entity into prefab, select a directory where to create it.

All prefabs must be placed in PrefabsEditable folder in data root.

Inside, pick a folder which suits the entity the best. Do not create anything in Auto folder manually, it would get removed during the next auto-generation process!

Create Prefab

Create a new prefab by dragging the entity from World Editor into desired directory.

When asked for file name, include E_ prefix, e.g., E_MyEntity.et.

The prefix helps to distinguish editable prefabs from non-editable ones.

Registering Placeable Prefabs

Editable entities must be registered in order to appear in content browser.

Create Registry Config

In Configs/Editor/PlaceableEntities, create a config of type SCR_PlaceableEntitiesRegistry.

Set Source Directory to folder where editable entity prefabs are placed. To make versioning easier, use more specialized registries (e.g., Vehicles, Props, etc.) rather than a few ones.

Add the Registry to Edit Mode

Open Prefabs/Editor/Edit/EditorModeEdit.et in prefab editing mode (e.g, RMB > Edit Prefab), select SCR_PlacingEditorComponent and drag the registry config to Registries array.

Before editing EditorModeEdit.et, it might be necessary to create override in your addon! See Arma_Reforger:Asset_Browser_Mod_Integration#Using_Override_in_functionality page for more details.

Register Entities

In Resource Manager, activate Plugins > In-game Editor > Register Placeable Entities...

Choose the registry config and confirm. The plugin will register every editable entity prefab flagged as PLACEABLE inside the folder.

Repeat this step every time some prefabs in the folder are added, removed or renamed.


Tip: All editable entities which use component prefab [Default_SCR_EditableEntityComponent.ct] are already flagged as PLACEABLE.