Nolanoth Posted December 9, 2013 Share Posted December 9, 2013 So recently I've been tinkering with the DefaultGameCore.ini to increase the ballistic weapon damage and accuracy when having Reaper Rounds equipped. I started altering the code and Weapons=( strName="", iType=eItem_ReaperRounds, ABILITIES[0]=eAbility_NONE, ABILITIES[1]=eAbility_NONE, ABILITIES[2]=eAbility_NONE, ABILITIES[3]=eAbility_NONE, ABILITIES[4]=eAbility_NONE, ABILITIES[5]=eAbility_NONE, Properties[0]=eWP_Backpack, Properties[1]=eWP_AnyClass, Properties[2]=eWP_None, Properties[3]=eWP_None, Properties[4]=eWP_None, Properties[5]=eWP_None, iDamage=3, iEnvironmentDamage=0, iRange=0, iReactionRange=-1, iReactionAngle=240, iRadius=0, iCritical=0, iOffenseBonus=10, iSuppression=0, iSize=eItemSize_Small, iHPBonus=0, iWillBonus=0 ) ^|This is what I came up with. I was really happy to see that iOffenseBonus=10 works like a charm, but adding an additional 3 pints of damage (iDamage=3) fails. Am I doing something wrong? I really want to make these much more useful since I've already set laser weapon damage to 7-8 and increased HP on all enemies. I simply want to have a better weapon that causes 3+3 damage to all enemies and has 20% more crit vs organic opponents. Link to comment Share on other sites More sharing options...
Ulfius Posted December 9, 2013 Share Posted December 9, 2013 I tried the same thing myself, I think because it's a backpack item and not a weapon it doesn't refer to the damage stat. Also the doubled range penalty function isnt from defaultgamecore.ini so i'm thinking wherever that function is located would be the place to start modding its attributes. I've no idea about where it could be found however. Link to comment Share on other sites More sharing options...
Amineri Posted December 9, 2013 Share Posted December 9, 2013 Yes, unfortunately the damage stat doesn't apply to "weapon" items that are using an XGAbility_Targeted-type ability. For LongWar I ended up completely rewriting the damage code. The initial goal was to make damage randomization scale with the base weapon damage (e.g. base damage 5 = +/-1 while base damage 9 = +/-2). Doing so required a complete replacement of a native function CalcOverallDamageModFromPerks. With this in hand I was able to create the bonus damage items in Long War, but they were hard-coded in. Unfortunately the way damage is calculated doesn't make it particularly easy to implement the above (at least I'm not seeing it). Damage for Targeted attacks happens in XGAbility_Targeted.CalcDamage, in particular the lines: m_iActualDamage = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcOverallDamage(m_kWeapon.GameplayType(), m_kUnit.m_aCurrentStats[12], m_bCritical, m_bReflected); } } } } m_iActualDamage = CalcOverallDamageModFromPerk(float(m_iActualDamage)); compute weapon damage and the follow-up aforementioned native function that modified based on perks. Link to comment Share on other sites More sharing options...
Nolanoth Posted December 10, 2013 Author Share Posted December 10, 2013 So it's possible or impossible to implement? So far I've only opened the UPK files with a hex editor. So I'm guessing I'd have to use something else right now to make those chnages? Link to comment Share on other sites More sharing options...
Amineri Posted December 10, 2013 Share Posted December 10, 2013 It's possible to implement, but not going to be as simple as a number-value hex edit. For a basic item that would grant +X damage (to all weapons, regardless of type), I'd estimate re-writing parts of 1 or 2 functions. Link to comment Share on other sites More sharing options...
Nolanoth Posted December 10, 2013 Author Share Posted December 10, 2013 (edited) But just the weapons right? This excludes PSI abilities? Because that's fine with me I'm thinking of simply making it a +4 or +3 damage item at the moment. You can not equip reaper rounds with a none standard ballistic weapon. So if it increases general firearm damage by 4 then I'm totally ok with that. I'll only have to remove the Pistol III foundry upgrade (it made little sense anyway). So how do I make the change? Will I need some kind of special tools? Edited December 10, 2013 by Nolanoth Link to comment Share on other sites More sharing options...
Amineri Posted December 10, 2013 Share Posted December 10, 2013 The only tools you should need are UE Explorer, HxD (or hex editor of your choice), Notepad++ (or text editor of your choice), and a bit of knowledge. Details on how to write hex should be findable on the wiki. Basically they change you want to make is to the line : m_iActualDamage = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcOverallDamage(m_kWeapon.GameplayType(), m_kUnit.m_aCurrentStats[12], m_bCritical, m_bReflected); In particular the m_kUnit.m_aCurrentStats[12] variable is the "bonus damage". In vanilla this is only used by aliens to adjust damage based on difficulty. Essentially you want to replace it with something like : m_kUnit.m_aCurrentStats[12] + (m_kUnit.GetInventory().HasItemOfType(eItem_ReaperRounds) ? 3 : 0) This would add 3 damage if the unit is equipped with the Reaper Rounds item. The main trick in this is of course constructing the hex bytecode, finding the space to fit it in (or using wghost81's new tool to create more space), then updating all of the jump offsets. It's pretty laborious right now, which is why XCOM isn't considered very mod-friendly. Link to comment Share on other sites More sharing options...
Nolanoth Posted December 10, 2013 Author Share Posted December 10, 2013 Ahhhhhhh crap! I have no idea how would I do that. It would probably all become one gigantic mess. I've tried hex editing before all by myself and I failed miserably at it. I'd probably find the line in unreal explorer, but making it look the way you described it could take days even weeks. What about editing tools like http://en.wikipedia.org/wiki/Unreal_X-Editor Unreal X-Editor? Link to comment Share on other sites More sharing options...
Amineri Posted December 10, 2013 Share Posted December 10, 2013 I looked at Unreal X-Editor, but it is a replacement IDE for developing unrealscript, not performing hex-surgery on packaged, compiled files. It would be useful if Firaxis had released their source code, but somehow I don't see that happening ;) Link to comment Share on other sites More sharing options...
Nolanoth Posted December 10, 2013 Author Share Posted December 10, 2013 Well I guess the only other options would be either: 1) Simple - Make the guns cause critical hits all the time and just change their description. Which is possible right? Just by setting iCritical=200 or some other absurd value I think. 2) Hard - Add new Reaper weapons. Which is not as easy... isn't it? Link to comment Share on other sites More sharing options...
Recommended Posts