Jump to content

Fixing the Memorial Wall Bleed Out Bug(s)


sqparadox

Recommended Posts

As some of you may have noticed, any soldiers still bleeding out when the tactical game ends have missing info on the memorial wall
The problem lies in SquadTacticalToStrategyTransfer() in XComGameStateContext_StrategyGameRule, specifically lines 490-494:
490    // Bleeding out soldiers die if not rescued
491    if(UnitState.bBleedingOut)
492    {
493         UnitState.SetCurrentStat(eStat_HP, 0);
494    }

This kills any remaining bleeding out unit's but fails to call OnUnitBledOut() from XComGameState_Unit. OnUnitBledOut() calls OnUnitDied(), also in XComGameState_Unit, which records the the op name into m_strKIAOp and the op date into m_KIADate.

Thus m_strKIAOp and m_KIADate remain uninitialized and empty when called from XComGameState_Analytics and there is nothing to display when PopulateStatsData() is called from UIBarMemorial_Details.
This is a minor bug with no effect on gameplay so I figured it's a low priorIty bug. Firaxis has there hands full as it is and I'm not on to wait around when I can do something about it. I was able to fix the symptoms of the bug by hooking a UI listener to the mission summary screen. Any unit's it finds bleeding out have the op name and date recorded into that unit's variables. If the unit is bleeding out but survives (is carried out, for example) and then dies on a later mission its variables should be overwritten with new data when OnUnitDied() is called. I also record the CauseOfDeath (for bleeding out it shows up as friendly fire from that unit by default, I duplicated that behaviour).
It's up on nexus and the workshop but, there is another bug I can't for the life of me track down:
Any unit that dies from having bled out (whether the timer runs down, they are left behind, killed by an explosion, etc) shows Time on Avenger as 0 Days on the Memorial Wall. This includes soldiers that have had all the proper functions called; all other data fills in. I think the problem is likely in XComGameState_Analytics and/or UIBarMemorial_Details, but this one really baffles me. Maybe it occurs with other death types as well but I have only found it on soldiers who bled out.
As an aside I took a shot at fixing the bug in-line in SquadTacticalToStrategyTransfer(), not because I thought I could release it, but just for the practice. However, cause of death is passed into every function that calls OnUnitDied() or OnUnitBledOut(), but SquadTacticalToStrategyTransfer() takes no incoming arguments. With nothing to pass into OnUnitBledOut() I was forced to try to fetch or create the data for the incoming arguments. This is my first foray into UnrealScript so needless to say, I'll be very interested to see how Firaxis fixes this on there end.
Edited by sqparadox
Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...