BattletechModders / CBTBehaviorsEnhanced

Applies Classic BattleTech behaviors to the HBS BattleTech Game
MIT License
5 stars 6 forks source link

Unsteady statistics are not initialized by effects #111

Closed IceRaptor closed 2 years ago

IceRaptor commented 2 years ago

For those folks familiar with statistic effects - do the stats need to be initialized by code, before they can be used? In CBTBE I have a trio of statistics that I want to use to signal a ternary state. If missing, I assume I should use the default value. If present, I look for either a true or false value. I thought I'd achieve this by not initializing the statistics in a Mech.InitEffectStats() patch like I normally would, and allow the effects to create the statistic instead.

However, BTA isn't seeing these effects proc at all. I've poked through StatOp and StatisticEffect and I'm not seeing a 'add if missing' flow. I suspect I've misunderstood how this would work, and it seems like HBS expects the statistics to always be initialized in code before they are referenced by an effect.

Can anybody else confirm this understanding (i.e. you cannot create a statistic via a Set operation in an effect), or share how they achieved this type of flow?

IceRaptor commented 2 years ago

Need to fix the following stats:

    public const string PhysicalWeaponUnsteadyAttackerOnHit = "CBTBE_Physical_Weapon_Unsteady_Attacker_On_Hit"; // bool - if true, attacker will be unsteady on a hit
    public const string PhysicalWeaponUnsteadyAttackerOnMiss = "CBTBE_Physical_Weapon_Unsteady_Attacker_On_Miss"; // bool - if true, attacker will be unsteady on a miss
    public const string PhysicalWeaponUnsteadyTargetOnHit = "CBTBE_Physical_Weapon_Unsteady_Target_On_Hit"; // bool - if true, target will be made unsteady by a hit
IceRaptor commented 2 years ago

Fixed in 0.8.14