Suggestion General Allow us to select a blood particle system on hit

Users who are viewing this thread

Jance

Recruit
WBWF&SNWVC
Here's the code that currently determines which particle system is used on hit (in mission.cs):


C#:
private void DecideAgentHitParticles(
      Blow blow,
      Agent victim,
      ref AttackCollisionData collisionData,
      ref HitParticleResultData hprd)
    {
      if (victim == null || blow.InflictedDamage <= 0 && (double) victim.Health > 0.0)
        return;
      if (!blow.WeaponRecord.HasWeapon() || blow.WeaponRecord.WeaponFlags.HasAnyFlag<WeaponFlags>(WeaponFlags.NoBlood) || collisionData.IsAlternativeAttack)
      {
        hprd.StartHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_sweat_sword_enter");
        hprd.ContinueHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_sweat_sword_enter");
        hprd.EndHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_sweat_sword_enter");
      }
      else
      {
        hprd.StartHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_blood_sword_enter");
        hprd.ContinueHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_blood_sword_inside");
        hprd.EndHitParticleIndex = ParticleSystemManager.GetRuntimeIdByName("psys_game_blood_sword_exit");
      }
    }

It's not very modder friendly (especially since HitParticleResultData is Internal). Ideally, it would be nice to override which particle system is used at the agent level or maybe even in xml. The use cases would be having black blood for uruk-hai, a fiery effect for a balrog, etc. Might also be useful for a gore mod 🤷‍♂️
 

Jance

Recruit
WBWF&SNWVC
For anyone wondering about this, HitParticleResultData was made public as of 1.6.1 (thanks!)
 

Dejan

Community Manager
WBNWVCM&B
Just a note here as well that the following change has been implemented with v163 in response to this request:
  • Damage Particles are now moddable. A new GameModel named DamageParticleModel has been added. By creating and using a new model class inherited from DamageParticleModel and overriding needed functions modders can choose damage particles very precisely according to collision properties.
 

Jance

Recruit
WBWF&SNWVC
Just a note here as well that the following change has been implemented with v163 in response to this request:
  • Damage Particles are now moddable. A new GameModel named DamageParticleModel has been added. By creating and using a new model class inherited from DamageParticleModel and overriding needed functions modders can choose damage particles very precisely according to collision properties.
Even better, much appreciated!
 
Top Bottom