raargharg Posted November 26, 2014 Share Posted November 26, 2014 I'm trying to get Precision Shot / Disable Shot to be usable to other classes (specifically, Mecs). For reference I am using Long War As far as I can tell, this is handled by some code I can't access. So I'm trying to find a workaround. It's simple enough to alter weapons in the .ini to have both the eWP_Mec and eWP_Sniper property. Unfortunately you can only use Precision Shot if the first property is eWP_Sniper, with the result being that the weapon now has Sniper aim falloff. I would like to try adding a function into the XComGame.upk, possibly into RollForHit (XGTacticalGameCore) or AdjustToHit, that adds additional aim if the weapon contains the eWP_Mec property in such a way that it brings aim falloff back to standard Mec Weapons (it doesn't have to be exact, but it needs to be higher as you close in and should be pretty close for balance purposes). Basically it will check for the eWP_Mec property, then checks the distance between the shooter and target, and adds a modifier as a function of that distance. I think this is possible. I'm really new to messing with UE code so it'll take me a while to figure out how to call for it and figure out the syntax, but I have no idea how the actual aim is calculated. Is distance bonus/penalty additive (flat aim value) or multiplicative (+20% of your aim at x distance...)? Is this feasible? And is there a resource that can break down each weapons aim progression as a function of distance for me (so I know what values to add)? Link to comment Share on other sites More sharing options...
raargharg Posted November 26, 2014 Author Share Posted November 26, 2014 (edited) I think I should be able to put it after the check for >199 hit chance and before the check for cheat mode: If it's additive, it should be simple to use two functions - one to remove the Sniper aim progression (making aim progression 0) and another to add Mec Weapon aim progression. if(WorldInfo.NetMode == NM_Standalone) { // End:0x6C if(m_kUnit.m_aCurrentStats[1] > 199) { return 100; }// not really code, need to learn syntax. Should be able to search for WeaponProperty in the .upk and figure out how to call for it thereif(weapon has property eWP_Mec - something like if m_kWeapon.HasProperty(20)){ iAdjustment += (function of m_fDistanceToTarget)} Apparently I would need up update the displayed values, so I'm looking over Amineri's Squadsight Aim Penalty mod to see if I can figure that one out. Edit: I am seeing GetHitChance in XGAbility_Targeted. Would I be able to apply this there? Would that automatically update the displayed hit chances (which "cheating" apparently doesn't)? Edited November 26, 2014 by raargharg Link to comment Share on other sites More sharing options...
Recommended Posts