Weapon Suppressor Creation – Arma Reforger
Prerequisites
- Basic understanding of Enfusion Engine and Arma Reforger modding.
- Access to a 3D modeling tool that can export FBX files.
- Familiarity with scripting in Enforce Script .
- A mod tag or identifier (e.g.,
SampleMod_NewWeapon
) for naming conventions. - Required tools and software:
- Enfusion Workbench .
- Enfusion Blender Tools (EBT) (optional but recommended for Blender users).
Structure Preparation
While sticking to official structure is not mandatory and there are no engine restrictions asset wise about it, it is recommended to follow guidelines listed here - Data (file) structure - to ensure that all automation plugins are parsing your assets correctly and make it later easy to navigate.
Therefore, your first task will be preparing following file structure
Preparing the Suppressor Asset
Model Orientation
Ensuring proper model orientation is crucial for correct attachment and in-game behavior. According to the Arma Reforger: FBX Import guidelines:
- Blender and 3ds Max Users :
- The model should point along the positive Y-axis .
- Maya Users :
- The model should point along the positive Z-axis .
If importing a model from another source (e.g., Arma 3), you may need to rotate it by 90 degrees to align correctly.
Object Naming
Follow these naming conventions to ensure proper import and functioning:
- Level of Detail (LOD) Suffixes :
- Use
_LOD0
,_LOD1
, etc., to indicate different LODs. - Example:
Suppressor_LOD0
,Suppressor_LOD1
.
- Use
Proper naming ensures that the engine correctly interprets your model's components during the import process. For a full list of naming conventions and detailed explanations, refer to the Arma Reforger: FBX Import - Naming Conventions page.
Adding Snap Points
Snap points are essential for correctly attaching the suppressor to weapons. For suppressor, it will be necessary to only add one empty object - snap_weapon. This can be achieved in those few steps:
- Create an Empty Object :
- In Blender, add an Empty object of type Plain Axes .
- Place it at the point where the suppressor will attach to the weapon.
- Name the Empty Object :
- Set the name to
snap_weapon
.
- Set the name to
- Align the Empty Object :
- Ensure the empty object's orientation matches the weapon's attachment point.
- The forward direction (front) should align along:
- Positive Y-axis in Blender/3ds Max.
- Positive Z-axis in Maya.
- Check Orientation :
- Verify that the
snap_weapon
aligns accurately with the suppressor's model.
- Verify that the
For detailed guidance, see Weapon Slots and Bones .
Collision Mesh
Creating an efficient collision mesh optimizes performance and ensures accurate physical interactions.
Choosing Collider Shape
Select the appropriate collider shape based on your suppressor's geometry. The collision mesh doesn't have to be a specific type; you can choose from various collider shapes depending on what best fits your suppressor:
- Common Collider Types :
- Box Collider
- Convex Collider
- Cylinder Collider
- Sphere Collider
- Capsule Collider
- TriMesh Collider
- Naming Colliders :
- Name your colliders with appropriate prefixes to indicate their type.
- While specific prefixes like
UBX_
,UCX_
, etc., are typically used, focus on selecting the collider that best suits your model's shape.
Simplifying the Collider
- Keep It Simple : Use the simplest shape that accurately represents the suppressor.
- Performance Consideration : Simplified colliders reduce computational overhead.
- Avoid Complex Meshes : Complex collision meshes can negatively impact performance.
Assigning Layer Preset and Game Material
Assign appropriate properties to your collider:
- Layer Preset :
ItemFireView
- This layer preset is appropriate for weapon attachments and ensures correct interactions in the game.
- Game Material :
weapon_metal.gamemat
- This material provides appropriate physical properties and sound effects for metal weapon components.
How to Assign
- In Your 3D Software :
- Blender with EBT (Optional) :
- Use the EBT Object Tools to assign properties directly in Blender.
- Navigate to Object Properties > EBT Object Properties .
- Set Layer Preset and Game Material . Reference: Enfusion Blender Tools: Object Tools .
- Other 3D Software :
- Add custom properties or user-defined attributes to colliders.
- Refer to Setting Layer Preset on Colliders (Usage Parameter) .
- Blender with EBT (Optional) :
- In Enfusion Workbench Import Settings :
- If not set in the 3D software, you can assign them during import.
- In the Import Settings , select your collider.
- Set Usage to
ItemFireView
. - Assign Game Material to
weapon_metal.gamemat
. Reference: FBX Import - Setting Layer Preset on Colliders .
- Set Usage to
Exporting the Model
Export your model to the FBX format suitable for Enfusion.
- Using Enfusion Blender Toolkit (EBT) FBX Exporter (Optional):
- Simplifies export and ensures compatibility.
- Automatically registers FBX in Workbench and enables "Export Scene Hierarchy".
- Without EBT :
- Manually register Import & Register file
- Manually enable "Export Scene Hierarchy" in export settings.
- Ensure export settings align with Enfusion requirements.
Creating the Attachment Script Class
Define the attachment type by creating a script class, ensuring compatibility with weapons.
Setting Up Your Script Directory
Organize scripts within your mod:
Naming Conventions
- Script File :
SampleMod_NewWeapon_Attachments_muzzle.c
. - Class Names :
- Attachment Config Class:
AttachmentMuzzle65_39Class
. - Attachment Class:
AttachmentMuzzle65_39
.
- Attachment Config Class:
Creating the Script File
- Create the File :
- In
Muzzles/
, createSampleMod_NewWeapon_Attachments_muzzle.c
.
- In
- Define the Classes :
Recompiling Scripts
After creating the script, recompile the game scripts:
- In Script Editor :
- Use Compile and Reload Scripts (
⇧ Shift + F7
).
- Use Compile and Reload Scripts (
- In World Editor :
- Use Reload Game Scripts (
Ctrl + R
).
- Use Reload Game Scripts (
Texturing the Suppressor
Apply textures to give your suppressor the desired appearance.
Creating Enfusion Materials
- After Import :
- Enfusion Materials (
.emat
files) are created in theData
folder. - Named based on material names in your 3D software.
- Use
MatPBRMaterial
shader by default.
- Enfusion Materials (
Assigning Textures
- Prepare Textures :
- Use a tool like Substance Painter to create PBR textures.
- Export Preset :
- Use the BCR+NMO preset from GitHub:
- Substance Export Profiles .
- Import Textures into the Game :
- Place exported textures (e.g.,
Suppressor_BCR.tiff
,Suppressor_NMO.tiff
) in your mod'sData
directory.
- Place exported textures (e.g.,
- Assign Textures to Materials :
- In Enfusion Workbench, open the
.emat
files. - Assign textures to corresponding fields:
- BCR Map : Assign
_BCR
texture. - NMO Map : Assign
_NMO
texture. Refer to Textures in Arma Reforger for details.
- BCR Map : Assign
- In Enfusion Workbench, open the
- Verify Material Settings :
- Adjust properties like Metallic , Roughness , and Specular as needed.
Testing the Textures
- Preview the Model :
- Use Enfusion Workbench to ensure textures appear correctly.
- Check for Issues :
- Look for texture stretching, UV mapping errors, or material issues.
- Adjust as Necessary :
- Make corrections in your 3D software or texture editor if needed.
Creating the Suppressor Prefab
Inherit from Base Suppressor Prefab
Create a new prefab by inheriting from the base suppressor:
- Base Prefab :
Prefabs/Weapons/Core/Suppressor_base.et
.
- Create New Prefab :
- Inherit from
Suppressor_base.et
. - Name it appropriately, e.g.,
YourSuppressor_base.et
.
- Inherit from
Edit the Suppressor Prefab
Configure components within your new prefab.
Configure MeshObject
- Assign your suppressor's mesh to the
MeshObject
component.
Configure InventoryItemComponent
- Item Display Name :
- Set the name displayed in the inventory.
- Storage Properties :
- Adjust weight, size, and physical attributes.
- Preview Render Attributes :
- Configure inventory preview visibility.
Configure WeaponAttachmentAttributes
In Custom Attributes of InventoryItemComponent
:
- WeaponAttachmentAttributes is already inherited from the base prefab.
- Set Attachment Type :
- Assign
AttachmentMuzzle65_39
. - This parameter controls where the suppressor can be attached.
- Assign
Configure SCR_WeaponAttachmentSuppressor Component
- Attachment Type :
- Ensure it's set to
AttachmentMuzzle65_39
.
- Ensure it's set to
- Adjust Properties :
- Muzzle Speed Coefficient :
- Modify as needed (suppressors can affect velocity).
- Muzzle Dispersion Factor :
- Adjust for accuracy changes.
- Extra Obstruction Length :
- Adjust this value to reflect the added length of the suppressor.
- Note : This will increase Weapon Obstruction values defined in the weapon's
WeaponComponent
. It affects how the suppressor impacts the weapon's handling, particularly in confined spaces.
- Recoil Coefficients :
- Adjust recoil when suppressor is attached.
- Muzzle Speed Coefficient :
Configure SCR_MuzzleEffectComponent
- Particle Effect :
- Assign appropriate muzzle flash or smoke effects.
- Effect Position :
- Create
EntitySlotInfo
(e.g., "position"). - Adjust Offset to match suppressor's end.
- Create
- Reset On Fire :
- Disable if not needed.
Configure Attachment Obstruction (Optional)
The SCR_WeaponAttachmentObstructionAttributes is already inherited from the parent suppressor prefab, so you do not need to add it manually. If you wish to configure obstruction attributes:
- Navigate to SCR_WeaponAttachmentObstructionAttributes :
- In the prefab's Custom Attributes , locate SCR_WeaponAttachmentObstructionAttributes .
- Adjust Parameters as Needed :
- Obstructed Attachment Types :
- List attachment types that cannot be mounted at the same time as this one.
- Required Attachment Types :
- List attachment types that must be present for this one to be attachable.
- Example description: "Types of attachments required for this one to be attachable e.g., M9 Bayonet requires A2 flash hider for mounting."
- Obstructed Attachment Types :
Adjust ActionsManagerComponent (Optional)
- Adjust Action Positions :
- Modify Offset to align actions with the suppressor.
Localization
- Localize Asset :
- Create localization entries for proper in-game display.
Integrating the Suppressor with a Weapon
Configure the Weapon's Muzzle Component
Open the weapon prefab to which the suppressor will attach.
Add AttachmentSlotComponent
- Add Child Component :
- Attach
AttachmentSlotComponent
to the weapon'sMuzzleComponent
.
- Attach
- Configure :
- Pivot ID :
- Set to weapon's muzzle slot (e.g.,
slot_barrel_muzzle
).
- Set to weapon's muzzle slot (e.g.,
- Child Pivot ID :
- Set to
snap_weapon
.
- Set to
- Attachment Type :
- Assign
AttachmentMuzzle65_39
.
- Assign
- Show in Inspection :
- Enable this option.
- Pivot ID :
Add SCR_WeaponStatsManagerComponent
- Add Component :
- Attach
SCR_WeaponStatsManagerComponent
to manage weapon stats.
- Attach
- Configuration :
- No additional setup unless customizing stats.
Update WeaponSoundComponent
- Add Suppressed Sounds :
- Update
WeaponSoundComponent
with suppressed firing sounds.
- Update
Testing Your Suppressor
Thorough testing ensures functionality aligns with expectations.
- Attachment Verification :
- Attach and detach the suppressor.
- Alignment Check :
- Confirm correct alignment with the weapon's muzzle.
- Functionality Test :
- Fire the weapon with the suppressor.
- Check muzzle effects, sounds, recoil, and accuracy.
- Attachment Obstruction Test :
- Verify incompatible attachments cannot be mounted simultaneously.
- Required Attachments Test :
- Ensure required attachments are necessary for mounting.
- Inventory Inspection :
- Confirm the suppressor's name and preview display correctly.