Jump to content

Code for LoseItemsOnDeath


Yzaxtol

Recommended Posts

Does anyone know where this code is in the UPK, it's an Impossible+ Second Wave option which I would like to enable by default for my mod. And obviously re-balance the price of building the items to show that they can be lost.

 

I haven't got the foggiest idea on how to go about it, alot of people talk about following the code and stuff, but I have no idea :(

Link to comment
Share on other sites

The function call:

 

(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.IsOptionEnabled(4)))

 

checks to (I believe) see if "Red Fog" Second Wave option is enabled. I'm not sure what the "lose item" one is, but you might search on that string (minus the 4 part) across all files and see if anything interesting pops up

 

FYI, to search all files in Notepad++ is CTRL-SHIFT-F ... sooo useful

Link to comment
Share on other sites

This list from XComGame.upk, Class XGGameData

 

enum EGameplayOption
{
eGO_RandomDamage,0
eGO_RandomFunding,1
eGO_RandomRookieStats,2
eGO_RandomStatProgression,3
eGO_WoundsAffectStats,4
eGO_CritOnFlank,5
eGO_InterrogateForPsi,6
eGO_Marathon,7
eGO_PanicAffectsFunding,8
eGO_VariableAbductionRewards,9
eGO_EscalatingSatelliteCosts,10
eGO_UltraRarePsionics,11
eGO_DecliningFunding,12
eGO_DegradingElerium,13
eGO_LoseGearOnDeath,14
eGO_MorePower,15
eGO_MAX
};

 

(I added the numbers): It looks like it's option 14

Link to comment
Share on other sites

XcomStrategyGame XGFacility_Barracks

 

{

// End:0x457 Loop:False

if(kSoldier.m_bMIA || (IsOptionEnabled(14)))

{

STORAGE().RemoveLoadout(kSoldier);

}

// End:0x480

else

{

STORAGE().ReleaseLoadout(kSoldier);

}

}

 

Now I think i can force it to RemoveLoadout always by copying Storage().RemoveLoadout(kSoldier) code and place it in the else section.

Edited by Yzaxtol
Link to comment
Share on other sites

Might need to be careful ... you'll get to the second statement if the soldier isn't MIA, also. I think the result of copying RemoveLoadout to the "else" will be to ALWAYS lose your gear regardless of whether the soldier is MIA or not.

 

I think what you want to do is to change the conditional to be simply ... if(kSoldier.m_bMIA)

 

That said, an option that always removes Alien Grenades (making them consumable) would be fun.

Edited by Amineri
Link to comment
Share on other sites

Yay I managed it. Now I don't think it's actually a good diea.

 

 

Remove loadout off ALL dead guys

 

1B B3 22 00 00 00 00 00 00 00 3D 28 00 00 16 06 80 04 19 1B 23 27 00 00 00 00 00 00 16 13 00 00 00 00 00 00 1B 9D 22

 

To

 

1B B3 22 00 00 00 00 00 00 00 3D 28 00 00 16 06 80 04 19 1B 23 27 00 00 00 00 00 00 16 13 00 00 00 00 00 00 1B B3 22

Edited by Yzaxtol
Link to comment
Share on other sites

  • Recently Browsing   0 members

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