Jump to content

Fragments friendly explosives | Disabling explosives kill narratives


Drakous79

Recommended Posts

Fragments friendly explosives

Someone mentioned in the past, that explosives shouldn't do more damage to alien weapons than their own self-destruction capability. There's a way how to disable fragment loss, when using explosives.

http://i.imgur.com/7uxux.jpg

XComGame.upk, class XGUnit


function OnDeath(class<DamageType> DamageType, XGUnit kDamageDealer)
{
...
    // End:0x45f
    if(DamageType == class'XComDamageType_Explosion')
    {
        m_bWasKilledByExplosion = true;
    }
...
}
SF: 07 5F 04 72 00 4D B4 00 00 20 7A 4A 00 00 16 14 2D 01 6D AF 00 00 27
RW: 07 5F 04 72 00 4D B4 00 00 20 7A 4A 00 00 16 14 2D 01 6D AF 00 00 28

// Thanks to DamarStiehl here's updated hex for XCOM Enemy Within, changelist 394142
SF: BE C7 00 00 20 73 52 00 00 16 16 14 2D 01 0E C3 00 00 27
RW: BE C7 00 00 20 73 52 00 00 16 16 14 2D 01 0E C3 00 00 28

Change 27 to 28, true to false. This tiny change also disables explosives kill narratives.


Disabling explosives kill narratives with fragments loss still effective

It is a matter of jumping over certain conditionals.

Vahlen talking about using explosives during a mission is in XComGame.upk, class XGUnit, function OnKill().

// End:0x4b4
if(kVictim.IsAlien_CheckByCharType() && !XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CharacterHasProperty(GetCharacter().m_kChar.iType, 4))
{
    // End:0x48e
    if(kVictim.m_bWasKilledByExplosion)
    {
        PRES().UINarrative(xcomnarrativemoment'FirstExplosivesKill', kVictim);
    }
    // End:0x4b4
    else
    {
        m_kFirstKillTarget = kVictim;
        SetTimer(4.0, false, 'FirstKillNarrative');
    }
}
SF: 07 8E 04 19 00 5B B4 00 00 0A 00 6D AF 00 00 00 2D 01 6D AF 00 00 19 1B 84 5A 00 00 00 00 00 00 16
RW: 06 8E 04 19 00 5B B4 00 00 0A 00 6D AF 00 00 00 2D 01 6D AF 00 00 19 1B 84 5A 00 00 00 00 00 00 16

Change the first 07 to 06.

Vahlen about grenades in labs - XComStrategyGame.upk, class XGResearchUI, function UpdateView().

// End:0x4bd
if(LABS().m_bNagExplosives && -- LABS().m_iExplosiveNags > 0)
{
    LABS().m_bNagExplosives = false;
    // End:0x4bd
    if(Narrative(xcomnarrativemoment'NagExplosives'))
    {
        return;
    }
}
SF: 07 BD 04 1B 71 1F 00 00 00 00 00 00 20 AC 48 00 00 4A 16 04 0B
RW: 06 BD 04 1B 71 1F 00 00 00 00 00 00 20 AC 48 00 00 4A 16 04 0B

Change the first 07 to 06.

 

Edit: Updated Fragments friendly explosives hex for XCOM Enemy Within

Edited by Drakous79
Link to comment
Share on other sites

Someone mentioned in the past, that explosives shouldn't do more damage to alien weapons than their own self-destruction capability. There's a way how to disable fragment loss, when using explosives.

I think it was me. Yeah, that mechanic made no sense, was just an artificial nerf to discourage explosive tactics. Thanks, nice find!

 

Now, wondering (could check myself later), I guess there isn't a check nearby that could be used to have grenades spoil corpses instead (because that's the kind of thing they might do)?

 

 

This is cool. Can it be wrapped into a ToolBoks mod?
What more wrapping does it need? This seems to already be enough for one.
Link to comment
Share on other sites

Happy you guys like it :)

 

This is cool. Can it be wrapped into a ToolBoks mod?

It can, when there's more time. Christmas preparations :) You can do it yourself, just check sample custom mod in ToolBoks and drop in those 2 hexes.

 

Now, wondering (could check myself later), I guess there isn't a check nearby that could be used to have grenades spoil corpses instead (because that's the kind of thing they might do)?

Agreed. But it wouldn't be easy. See CheckForDamagedItems() within XGUnit and CollectArtifactsFromDeadAliens() within XGSummaryUI. One generates fragments and another the rest. I wish we could script.

Edited by Drakous79
Link to comment
Share on other sites

  • Recently Browsing   0 members

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