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

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
== Creating Prefab ==
== Creating Prefab ==


First step in this process will be [[Arma Reforger:Data Modding Basics#Using .22Inherit in....22 function|inheriting]] '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Headgear_Base.et|Headgear_Base.et}}'''  or [[Arma Reforger:Data Modding Basics#Using .22Duplicate to....22 function|duplicate one of existing helmets]] like '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/HeadGear/Helmet_PASGT_01/Helmet_PASGT_01.et|Helmet_PASGT_01.et}}'''.  When inheriting from '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Headgear_Base.et|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.{{Feature|informative|In this article, [[Arma_Reforger:Resource_Manager:_Options#Register_.22enfusion:.2F.2F.22_protocol|'''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]}}
First step in this process will be [[Arma Reforger:Data Modding Basics#Using .22Inherit in....22 function|inheriting]] '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Headgear_Base.et|Headgear_Base.et}}'''  or [[Arma Reforger:Data Modding Basics#Using .22Duplicate to....22 function|duplicate one of existing helmets]] like '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/HeadGear/Helmet_PASGT_01/Helmet_PASGT_01.et|Helmet_PASGT_01.et}}'''.  When inheriting from '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Headgear_Base.et|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.{{Feature|informative|In this article, [[Arma_Reforger:Resource_Manager:_Options#Register_.22enfusion:.2F.2F.22_protocol|'''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 ===
=== Tweaking BaseLoadoutClothComponent ===
[[File:armareforger-new-headgear-base-loadout-cloth-component.png|thumb|595x595px|'''BaseLoadoutClothComponent''' content]]
Once you have new prefab for your helmet, open it in for example '''[[Arma Reforger:Prefabs Basics#Prefab edit mode|Prefab Edit Mode]]''' and start with tweaking things located in '''BaseLoadoutClothComponent'''
Once you have new prefab for your helmet, open it in for example '''[[Arma Reforger:Prefabs Basics#Prefab edit mode|Prefab Edit Mode]]''' and start with tweaking things located in '''BaseLoadoutClothComponent'''


Line 21: Line 24:
** 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 [[Arma Reforger:Character SoundInfo Signals Reference|Character SoundInfo Signals Reference]] page for more info
** 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 [[Arma Reforger:Character SoundInfo Signals Reference|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
If you [[Arma Reforger:Data Modding Basics#Using .22Inherit in....22 function|inherited]] from '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/Core/Headgear_Base.et|Headgear_Base.et}}''' prefab, then you would also need to tweak following things:


* Change '''AreaType''' parameter in '''BaseLoadoutClothComponent''' to '''LoadoutHeadCoverArea'''
* 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
** This will tell the game that this item should be assigned to head gear slot in inventory menu
* Tweaking drop item sound ('''SCR_SoundDataComponent''') to '''{{Link|enfusion://ResourceManager/~ArmaReforger:Sounds/Items/_SharedData/Drop/Items_Drop_Helmet.acp|Items_Drop_Helmet.acp}}'''
* Tweaking drop item sound '''in SCR_SoundDataComponent''' from '''{{Link|enfusion://ResourceManager/~ArmaReforger:Sounds/Items/_SharedData/Drop/Items_Drop_Clothes.acp|Items_Drop_Clothes.acp}}''' to '''{{Link|enfusion://ResourceManager/~ArmaReforger:Sounds/Items/_SharedData/Drop/Items_Drop_Helmet.acp|Items_Drop_Helmet.acp}}'''  
** Changes the sound which is being played when item is placed on the ground
** Changes the sound which is being played when item is placed on the ground
* Tweaking position of default action context
* Tweak position of default action context in '''ActionsManagerComponent'''
[[File:armareforger-new-headgear-default-action-context.png|none|thumb|369x369px|Default action context position after tweak in '''ActionsManagerComponent''']]
{{Messagebox|'''Tip''': You can find details how to create variants of headgear with different material on [[Arma_Reforger:Faction_Creation#Retexturing_existing_equipment|following page]].|✩|#88cc88}}
{{Messagebox|'''Tip''': You can find details how to create variants of headgear with different material on [[Arma_Reforger:Faction_Creation#Retexturing_existing_equipment|following page]].|✩|#88cc88}}
== Inventory Configuration ==
== Inventory Configuration ==
[[File:armareforger-new-headgear-inventory-configuration.png|thumb|655x655px|'''InventoryItemComponent''' content]]


Configuration of inventory is quite similar compared to weapon, therefor it is suggested to take a look at [[Arma Reforger:Weapon Creation/Prefab Configuration#Inventory Configuration|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:'''


Configuring inventory properties
* '''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 '''{{Link|enfusion://ResourceManager/~ArmaReforger:Prefabs/Characters/HeadGear/Helmet_PASGT_01/Helmet_PASGT_01.et|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:
[[File:armareforger-new-headgear-preview-image.png|none|frame|'''Sample Helmet''' in inventory menu]]


* Name
== Adding to Arsenal ==
* Size
Process of adding headgear to the crates is very similar to the one described on '''[[Arma Reforger:Weapon Creation/Prefab Configuration#Crate Filling|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:
* Preview image


== Adding to Arsenal ==
* [[Arma Reforger:Data Modding Basics#Using .22Override in....22 function|Override in]] your addon '''{{Link|enfusion://ResourceManager/~ArmaReforger:Configs/EntityCatalog/US/US_InventoryItems.conf|US_InventoryItems.conf}}'''
https://community.bistudio.com/wiki/Arma_Reforger:Weapon_Creation/Prefab_Configuration#Crate_Filling
* 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
 
[[File:armareforger-new-headgear-arsenal-crate.png]]


== Testing & Diags ==
== Testing & Diags ==

Revision as of 16:04, 8 August 2023

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