Reyhard/Sandbox/Character Gear Creation/Headgear/Prefab Configuration – User

From Bohemia Interactive Community
Jump to navigation Jump to search
Previous part - Asset Preparation
💬
Overview

This chapter covers following topics:

  • Helmet prefab creation & configuration
  • Adding headgear to arsenal
  • Testing & diagnosing issues with helmets

Prefab Setup

Creating Prefab

First step in this process will be inheriting Headgear_Base.et or duplicate one of existing helmets like Helmet_PASGT_01.et. When inheriting from Headgear_Base.et, few more steps will be required but those are listed later. Because of that, it might be faster & simpler to duplicate some prefab.

Also, don't forget to properly organize your prefab - it is quite useful to have base prefab with _base suffix, since its clear in such setup which file was used as parent for sub sequential child prefabs, which change slightly materials or mesh.

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]

Tweaking BaseLoadoutClothComponent

BaseLoadoutClothComponent content

Once you have new prefab for your helmet, open it in for example Prefab Edit Mode and start with tweaking things located in BaseLoadoutClothComponent

  • Enable PhysicsOnWearEnabled & AnimateCollidersOnWear properties
  • Assign item model to ItemModel in BaseLoadoutClothComponent & to property Object in MeshOjbect component
  • Assign worn model to WornModel
  • Change SoundInt parameter to 120
    • This parameter is responsible for additional sounds that are being played certain type of headgear is worn. For instance if you wear harness, you can hear some extra metal rattle when moving through the landscape. See Character SoundInfo Signals Reference page for more info

If you inherited from Headgear_Base.et prefab, then you would also need to tweak following things:

  • Change AreaType parameter in BaseLoadoutClothComponent to LoadoutHeadCoverArea
    • This will tell the game that this item should be assigned to head gear slot in inventory menu
  • Tweaking drop item sound in SCR_SoundDataComponent from Items_Drop_Clothes.acp to Items_Drop_Helmet.acp
    • Changes the sound which is being played when item is placed on the ground
  • Tweak position of default action context in ActionsManagerComponent
Default action context position after tweak in ActionsManagerComponent
Tip: You can find details how to create variants of headgear with different material on following page.

Inventory Configuration

InventoryItemComponent content

Configuration of inventory is quite similar compared to weapon, therefor it is suggested to take a look at Weapon Creation page for details regarding how each of those params are working. Below is list of things which were adjusted in InventoryItemComponent on base Sample Helmet prefab:

  • Item Display Name
    • Name - controls in game display name
    • Description - description of the item visible in in-game inventory menu
  • Item Phys Attributes
    • Weight was changed to 3.5 [kg] to be more or less in line with real life helmet
    • Size Setup Strategy was changed to Manual
    • Item Dimensions were changed to X:27, Y:25, Z:20 to more or less correspond to its actual dimensions
    • Item Volume was set to 2500
  • PeviewRenderAttributes in Custom Attributes section:
    • Camera Orbit Angles& FOV values are basically copy paste from Helmet_PASGT_01.et and only Camera Distance To Item was adjusted so that whole helmet fits the preview image in the inventory

Vanilla helmets are using 2x1 slots and once those tweaks are completed, it should look like that in game:

Sample Helmet in inventory menu

Adding to Arsenal

Process of adding headgear to the crates is very similar to the one described on Weapon Creation page. There are few differences though - notable different labels are used. So in short, if you intend to add helmet to i.e. existing US arsenal box, then perform following steps:

  • Override in your addon US_InventoryItems.conf
  • Open overriden file and locate Clothing section inside of it
  • Add new entry to Entities list by clicking on + button on the right side
  • Assign your prefab to Entity Prefab field
  • Add new SCR_ArsenalItem (Arsenal Data) entry to Entity Data List array by clicking on + button on the right side
  • Change Item Type in Arsenal Data to HEADWEAR

If everything went fine, you should end up with something like on the picture below

armareforger-new-headgear-arsenal-crate.png

Testing & Diags

Diag

Physics -> Show bodies

Physics -> Show layer -> Fire

Physics -> Show simulation state