2023/01/22

VFX research

So how to take existing VFX in the game, tweak them, and use them !

The experiment made today is to take e.g. splinter_buff existing effect (the one played when inhaling a MaxDOC, a.k.a FirstAidWhiff), remove the inhaling SFX and see if it's possible.

And it does:

  • WolvenKit Asset browser : e.g. base\characters\entities\player\player_wa_fpp.ent
  • components :
    • fx_status_effect : e.g. dizzy, drunk, stunned, etc
    • fx_player : e.g. swimming, johnny sickness, eyes closing, locomotion, etc + splinter_buff !

WolvenKit splinter_buff effect

then:

  • WolvenKit :
    • open splinter_buff.effect in project
      • rename it e.g. splinter_addicted.effect
      • move it e.g. fx\camera\splinter_addicted\splinter_addicted.effect
    • open base\characters\entities\player\player_wa_fpp.ent in project
      • add a new entry under components.fx_player.effectDescs

      • fill the previously created file info and effectName desired in RED you can then call it with e.g.

          Redscript
        GameObjectEffectHelper.StartEffectEvent(this, n"splinter_addicted");
        

        even create e.g. a YAML tweak

          YAML
        BaseStatusEffect.SplinterAddicted:
          $base: BaseStatusEffect.FirstAidWhiffV0
          packages: []
          VFX:
            - $type: StatusEffectFX_Record
              name: splinter_addicted
              shouldReapply: true
        

        then call it with e.g.

          Redscript
        GameInstance
          .GetStatusEffectSystem(this.GetGame())
          .ApplyStatusEffect(this.GetEntityID(), t"BaseStatusEffect.SplinterAddicted", this.GetRecordID(), this.GetEntityID());
        

tweaks loading order

psiberx — 09/11/2022 3:08 PM yeah, the only things that can be already present are cet early mods and other yaml mods the load order for all tools:

  • base tweakdb (original or redmodded)
  • cet mods using onTweak (afaik rarely used)
  • yaml tweaks (alphabetical order)
  • redscript tweaks
  • cet mods using onInit (most existing mods)

also the best method is to not touch e.g. base\characters\entities\player\player_wa_fpp.ent at all since other mod(s) could override it, but instead use keanu's trick which can be found in "Immersive Glasses":

  Lua
local effects = GetPlayer():FindComponentByName("fx_player").effectDescs
CName.new(effectName);
local custom = entEffectDesc.new();
custom.effectName = "splinter_addicted";
custom.effect = "base\\fx\\camera\\splinter_buff\\splinter_addicted_fx.effect";
GetPlayer():FindComponentByName("fx_player").effectDescs = effects

and indeed it works to have a BaseStatusEffect.SplinterAddicted defined in YAML tweaks (e.g. tweaks/Addicted/healer.yml) whose splinter_addicted effect is defined in CET (e.g. mods/Addicted/init.lua).

Thanks to :

  • psiberx
  • Hróbjartur Fóðarsson
  • Sürr
  • Simarilius

on Discord server channel.