Customizing and adding new hand items to DI-Guy
Custom folder structure
DI-Guy has a mechanism for updating the base data and adding new data configurations without needing to modify the data installation directly. This helps to keep any changes separate from the data install itself, making it easier to reinstall data or move up to newer versions of our products without losing any custom configurations.
This ‘custom’ folder can be created as a new folder at the top level of your DI-Guy installation, or in the DI-Guy subfolder in your SharedData installation:
Example 1: C:\MAK\diguy13.8\custom
Example 2: C:\MAK\SharedData\19\latest\ModelData\Lifeforms\DIGuy\custom
Any subfolders you create in the custom folder should mirror the folder structure of the data install itself. During runtime, DI-Guy will prioritize using data from the custom folder if configurations with the same name and/or filename are present in the custom folder. In this way, configurations for existing appearances, hand items, etc. can be overridden with custom versions without making changes to the data install itself.
The custom folder will also use its own internal geometry and texture caches for optimized geometry/textures instead of using the main data cache folders for customized data.
Any config files present in the custom folder that start with autoload_ will be automatically loaded by DI-Guy on startup so the configurations can be used. Any other files will only be picked up if there’s already a file with that name in the main data install - in this case, the version from the custom folder will be picked up by DI-Guy during loading instead of the one from the data install.
Files necessary for adding a new hand item
A new hand item is defined by both a hand_item_appearance configuration entry and a shape_set entry. Both of these entries can be included in a single config file, and it is recommended to do so as both are vital parts of the hand item. This brings us to the first file:
custom/config/autoload_new_hand_item.cfg:
shape_set custom_rifle
object_type = weapon
pbr_ready = 1
filename = golden_gun.fbx
shape_attachment_data = WeaponNode rifle_joint
hand_item_appearance custom_rifle
DIS_Septet_category = 32
type = rifle
default_items
item = custom_rifle
item = small_flash
parameters
weapon_supplemental_data = M4A1Carbine
The most important part of the configuration here is to point the filename for the shapeset to the geometry you want to use for the hand item and make sure the geometry node name is correct in the shape_attachment_data entry. The geometry node (named WeaponNode in the example above) is the node in your geometry file that contains the geometry for the weapon - this can be anything, however it’s important that the name of the node in the geometry file match the name given in the shape_attachment_data entry so that diguy can attach the geometry correctly.
The hand_item_appearance entry sets up the newly configured geometry as an equippable hand item and gives it a weapon type and some additional supplemental data (for now, just pointing to the existing m9 config). The main configuration of note here is the item = custom_rifle entry in the default_items section - this tells the hand item to use the shapeset we configured first, and it’s important that the item name given here matches the shapeset name.
custom/config/autoload_new_hand_item_list.cfg:
hand_items_list
class_type custom_hand_items
character_types
character_type = HumanMale
character_type = soldier_17
hand_items
hand_item = custom_rifle
In the first file, we configured the shapeset and hand item itself, however we still need to make the new hand item available to the character types we want to use it with. In this file, we set up a new class_type (a collection of hand items), include our new hand item, and make the class_type available to the character types we want to be able to use the new hand item.
While we’re only adding one hand item here, if you are adding multiple hand items, you can simply include multiple hand_item entries in the hand_items section, each pointing to a new hand_item.
Note: Support for setting up additional hand item classes as described above was added in DI-Guy 13.8 - in earlier versions, the hand_item_appearances.cfg file must be fully overridden by copying the version of the file from data into your custom/config/diguy folder and making the changes there. Versions of DI-Guy prior to 13.8 also had a bug preventing multiple class_types from being applied to the same character, so the new hand_item line should be added directly to an existing class_type group instead of using a new class_type to organize newly added hand items.
custom/config/autoload_weapon_supplemental_data.cfg:
weapon_supplemental_data custom_rifle
lhand_offset_1 = 0.45 0.08 0.06
rifle:munition_type = m4
rifle:rounds_per_tracer = 5
This file provides the left hand grip point for the weapon as well as the munition type. This may not be necessary depending on how much you’re changing the weapon from existing configurations. You could just as easily leave out this file and point the weapon_supplemental_data config line in the hand_item_appearance entry to an existing supplemental data entry (eg. M4A1Carbine) if your new hand item is similar enough.