So far, the modding patch allows us to add new weapons, with completely new 3d models and textures. In my opinion, what’s missing to make custom weapons truly unique though is support for adding custom visual effects. “Why bother”, you might ask. “There’re no tools to create new effects anyway!”
While that’s true, you can add new textures and basically reskin effects. So, by copying existing EFCT files and changing their names along with a few image name strings inside them, it’s actually possible to make “new” VFX. At this point, the only thing in our way is a lack of modding patch support for the necessary table files. This post should lay out how we could overcome this last hurdle.
How do VFX get loaded now?
Well, there are two kinds of visual effects. Some are preloaded at all times whereas others only get streamed for missions and cutscenes. The latter seem to be a little more complicated to modify/add as their respective EFCT files are spread across multiple packfiles with a common ASM located in the otherwise empty effects.vpp_pc. However, for the purpose of adding new VFX for weapons and possibly clothing items, we’re actually only interested in adding new preloaded effects. The EFCT files for those are all stored in preload_effects.vpp_pc and loaded via vfx_preload_containers.asm_pc in the same packfile.
All EFCT files then get their own entry in vfx.xtbl, but there’s more data to an effect than what’s inside those files. Some additional information is included in the effect’s entry in effects.xtbl, together with a name reference to the entry in vfx.xtbl. For some visual effects, this is all the information the game needs, so there are multiple references to effects.xtbl entries across weapon and customization item tables.
Yet, depending on the characteristics of the effect, there may be further data required. Hence there’re at least two more files that need to be parsed to make sets of all new VFX for weapons: explosions.xtbl and weapon_tracers.xtbl. Both reference entries of effects.xtbl and add another layer of effect-specific information on top of them. The entries in explosions.xtbl and weapon_tracers.xtbl are then referenced in weapons.xtbl.
How did DLC handle new VFX?
For DLC they added new effects exactly like I’d want it to work for the modding patch. There’s at least one DLC equivalent of every file I suggest you make compatible with the new format:
dlc1_vfx.xtbl, dlc1_effects.xtbl, dlc1_explosions.xtbl and dlc4_weapon_tracers.xtbl are basically new format versions of vfx.xtbl, effects.xtbl, explosions.xtbl and weapon_tracers.xtbl, so I assume there’s already working code for those files that could be ported to work with any packfile you put in the game’s root directory or the workshop folder.
In short:
The game should parse vfx.xtbl files and, if there are any, look for vfx_preload_containers.asm_pc and vfx_containers.asm_pc in the same packfiles (similar to how items3d.xtbl and DLC VFX work). Also it should parse effects.xtbl, explosions.xtbl and weapon_tracers.xtbl the same way it does for DLC.
While that’s true, you can add new textures and basically reskin effects. So, by copying existing EFCT files and changing their names along with a few image name strings inside them, it’s actually possible to make “new” VFX. At this point, the only thing in our way is a lack of modding patch support for the necessary table files. This post should lay out how we could overcome this last hurdle.
How do VFX get loaded now?
Well, there are two kinds of visual effects. Some are preloaded at all times whereas others only get streamed for missions and cutscenes. The latter seem to be a little more complicated to modify/add as their respective EFCT files are spread across multiple packfiles with a common ASM located in the otherwise empty effects.vpp_pc. However, for the purpose of adding new VFX for weapons and possibly clothing items, we’re actually only interested in adding new preloaded effects. The EFCT files for those are all stored in preload_effects.vpp_pc and loaded via vfx_preload_containers.asm_pc in the same packfile.
All EFCT files then get their own entry in vfx.xtbl, but there’s more data to an effect than what’s inside those files. Some additional information is included in the effect’s entry in effects.xtbl, together with a name reference to the entry in vfx.xtbl. For some visual effects, this is all the information the game needs, so there are multiple references to effects.xtbl entries across weapon and customization item tables.
Yet, depending on the characteristics of the effect, there may be further data required. Hence there’re at least two more files that need to be parsed to make sets of all new VFX for weapons: explosions.xtbl and weapon_tracers.xtbl. Both reference entries of effects.xtbl and add another layer of effect-specific information on top of them. The entries in explosions.xtbl and weapon_tracers.xtbl are then referenced in weapons.xtbl.
How did DLC handle new VFX?
For DLC they added new effects exactly like I’d want it to work for the modding patch. There’s at least one DLC equivalent of every file I suggest you make compatible with the new format:
dlc1_vfx.xtbl, dlc1_effects.xtbl, dlc1_explosions.xtbl and dlc4_weapon_tracers.xtbl are basically new format versions of vfx.xtbl, effects.xtbl, explosions.xtbl and weapon_tracers.xtbl, so I assume there’s already working code for those files that could be ported to work with any packfile you put in the game’s root directory or the workshop folder.
In short:
The game should parse vfx.xtbl files and, if there are any, look for vfx_preload_containers.asm_pc and vfx_containers.asm_pc in the same packfiles (similar to how items3d.xtbl and DLC VFX work). Also it should parse effects.xtbl, explosions.xtbl and weapon_tracers.xtbl the same way it does for DLC.