Nolanoth Posted December 12, 2013 Author Share Posted December 12, 2013 It's been days and so far I haven't been able to change anything. I open XComGame.upk with UE Explorer, scroll down, find XGAbility_Targeted > Functions > CalcDamage: The line is right there: else { // End:0x385 if((GetType()) != 53) { m_iActualDamage = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcOverallDamage(m_kWeapon.GameplayType(), m_kUnit.m_aCurrentStats[12], m_bCritical, m_bReflected); } } } } And each time I make some change to it I fail. I have no idea what to do. I have exported the binary code: 7D FE FF FF 00 00 00 00 BA 8A 00 00 BD 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 07 00 1C 05 00 00 5B 3A 88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 But it's worthless when you have no idea where -> m_iActualDamage = XComGameReplicationInfo... begins and where it ends. What's worse how do I even type in your code as a binary one? Anyway it would only change basic weapon damage right? No PSI ability or anything else? Link to comment Share on other sites More sharing options...
Amineri Posted December 12, 2013 Share Posted December 12, 2013 (edited) I agree, that function is a beast. Those functions that retrieve values through the GRI (Game Replication Info) structures are always amazingly complicated. Currently there are two options. UE Explorer has both the Token View (which will help isolate the particular line) and the Buffer View (which shows the entire function but shows more detail about particular pieces). UE Explorer 1.2.5 also has some more details in the token view which might help (but I haven't explored that version yet). The new tool that XMTS and I are working on will soon be able to provide some hints as well. My current beta build was able to replace the various hex references for that line with their names: MODFILEVERSION=3 UPKFILE=XComGame.upk GUID= B1 1A D8 E4 48 29 FC 43 8E C0 7A B0 A3 3E 34 9F // EW release FUNCTION=ApplyActionCost@XGAbilityTree // Increase max pod size Mod // Author: Amineri [BEFORE_HEX] [code] //m_iActualDamage = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcOverallDamage(m_kWeapon.GameplayType(), m_kUnit.m_aCurrentStats[12], m_bCritical, m_bReflected) 0F 01 DC D2 00 00 19 19 2E 2D 32 00 00 19 12 20 36 FE FF FF 0A 00 9E F9 FF FF 00 1C DE FB FF FF 16 09 00 5C F9 FF FF 00 01 5C F9 FF FF 09 00 1F 32 00 00 00 01 1F 32 00 00 60 00 19 84 00 00 00 1B CB 10 00 00 00 00 00 00 38 3A 19 01 AE D2 00 00 0A 00 CC B9 00 00 00 1B 8B 36 00 00 00 00 00 00 16 1A 2C 0C 19 01 27 89 00 00 09 00 38 3A 00 00 00 01 38 3A 00 00 2D 01 EB D2 00 00 2D 01 EA D2 00 00 16 //m_iActualDamage = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcOverallDamage(m_kWeapon.GameplayType(), m_kUnit.m_aCurrentStats[12], m_bCritical, m_bReflected) 0F 01 {|m_iActualDamage@XGAbility_Targeted|} 19 19 2E {|XComGameReplicationInfo|} 19 12 20 {|Core:Engine@Engine|} 0A 00 {|Core:ReturnValue@GetCurrentWorldInfo@Engine@Engine|} 00 1C {|Core:GetCurrentWorldInfo@Engine@Engine|} 16 09 00 {|Core:GRI@WorldInfo@Engine|} 00 01 {|Core:GRI@WorldInfo@Engine|} 09 00 {|m_kGameCore@XComGameReplicationInfo|} 00 01 {|m_kGameCore@XComGameReplicationInfo|} 60 00 {|ReturnValue@CalcOverallDamage@XGTacticalGameCore|} 00 1B <|CalcOverallDamage|> 00 00 00 00 38 3A 19 01 {|m_kWeapon@XGAbility_Targeted|} 0A 00 {|ReturnValue@GameplayType@XGItem|} 00 1B <|GameplayType|> 00 00 00 00 16 1A 2C 0C 19 01 {|m_kUnit@XGAbility|} 09 00 {|m_aCurrentStats@XGUnitNativeBase|} 00 01 {|m_aCurrentStats@XGUnitNativeBase|} 2D 01 {|m_bCritical@XGAbility_Targeted|} 2D 01 {|m_bReflected@XGAbility_Targeted|} 16 [/CODE] [/BEFORE_HEX] Note that this is for Enemy Within release, not patch 1. Before I update to patch 1 (and EU patch 6) I need to make a backup of my release/patch 5 folder which I haven't yet gotten around to :tongue:. Some of the reference names start with NAME: and some don't. This distinguishes Import References (those with NAME:) from Export references (those without). Import references are stored as negative values. Hence {|Core:Engine@Engine|} is 36 FE FF FF. The part before the : is the external package file. So Core:Engine@Engine refers to the Engine class in the Core.upk package. Edited December 13, 2013 by Amineri Link to comment Share on other sites More sharing options...
Recommended Posts