Amineri Posted March 12, 2013 Share Posted March 12, 2013 (edited) Found the bug -- apparently (and very strangely) Arc Throwers have WeaponProperty eWP_Explosive. The only reason I can think that this would be true is that an earlier version of the game had stun grenades, and much of the stun grenade code was repurposed for the Arc Thrower. Interestingly, there is NO weapon property for stunning. So odd. The fix was to change the conditional test: if(WeaponHasProperty(iWeapon, 9)){return iDamage;}toif(iWeapon == 8 ){return iDamage;}Weapon property 9 is eWP_Explosive ... the Weapon ID for Arc Thrower is 8. Simply changed the explosive property test to directly check if the weapon is an Arc Thrower. Need to verify that this works with the improved Arc Thrower, however. Edited March 12, 2013 by Amineri Link to comment Share on other sites More sharing options...
anUser Posted March 12, 2013 Share Posted March 12, 2013 Great! I doubt this will further affect arc thrower unless it's tweaked to do some (un-randomized) damage, but I'll keep an eye on it. Link to comment Share on other sites More sharing options...
Amineri Posted March 12, 2013 Share Posted March 12, 2013 (edited) I was suspecting that maybe the Arc Thower Foundry upgrade was represented by a 2nd weapon, which would totally mess this up, but it _appears_ to not be so. However, there are so many mysteries surrounding why the eWP_Explosive check even affected Arc Throwers that it's hard to say for sure. Also, I'll update the explosive damage randomization hex code in my original post with the 1.0.1 version. Edit: Or I'll just do it here ^_^ Update: No changes to hex code -- just updating version number and patch # to reflect that I verified this works with Patch 5, March 2013 MOD_NAME=Randomize Explosive DamageAUTHOR=amineriUPK_FILE=XComGame.upkDESCRIPTION=Allows Grenade and Rocket Damage to be randomized like any other type Version: 1.0.2 Works with XCOM Enemy Unknown version: Patch 5 ( Wednesday, February 20, 2013 12:47 PM - Changelist: 356266 ) [FIND]{ Default check for explosive damage type - DO NOT EDIT THIS LINE }07 9F 00 1B 8C 71 00 00 00 00 00 00 00 F3 76 00 00 2C 09 16 04 00 EE 76 00 00 [REPLACE]{ change call to test if weapon is ArcThrower }07 9F 00 9A 00 F3 76 00 00 2C 08 16 04 00 EE 76 00 00 0B 0B 0B 0B 0B 0B 0B 0B Edited March 15, 2013 by Amineri Link to comment Share on other sites More sharing options...
Yzaxtol Posted March 14, 2013 Share Posted March 14, 2013 (edited) This is the .ini code for the ArcThrower, it definitely doesn't have Ewp_Explosive Weapons=iType=eItem_ArcThrower,ABILITIES[0]=eAbility_ShotStun,ABILITIES[1]=eAbility_NONE,ABILITIES[2]=eAbility_NONE,ABILITIES[3]=eAbility_NONE,ABILITIES[4]=eAbility_NONE,ABILITIES[5]=eAbility_NONE,Properties[0]=eWP_Pistol,Properties[1]=eWP_Secondary,Properties[2]=eWP_CantReact,Properties[3]=eWP_None,Properties[4]=eWP_None,Properties[5]=eWP_None,iDamage=0,iEnvironmentDamage=0,iRange=27,iReactionRange=-1,iReactionAngle=200,iRadius=0,iCritical=0,iOffenseBonus=0,iSuppression=0,iSize=eItemSize_Small,iHPBonus=0,iWillBonus=-10) edit: this is the Pistol variant so I don't know if the original ArcThrower still has Explosive. Edited March 14, 2013 by Yzaxtol Link to comment Share on other sites More sharing options...
Amineri Posted March 14, 2013 Share Posted March 14, 2013 I'm totally stumped by why the original mod caused stunning to fail, and why the 1.0.1 version fixes it. I even forced the function to return various damage values when stunning (tried 0, 1, and 8) but the stunning still worked. The only thing I can think of now is some sort of bug internal to the native code that is crossing the wires between the integer RAND and float RAND processes ... Stuns uses float RAND for some reason, while all the other damage RANDs are integer. Probably will end up remaining a mystery forever ~_~ But the randomized explosive damage appears to be working now *fingers crossed* Link to comment Share on other sites More sharing options...
Recommended Posts