Amineri Posted February 8, 2016 Share Posted February 8, 2016 Since this seems to be a popular request, I did a little bit of digging and in the UIArmory_WeaponUpgrade.uc, the number of upgrade slots is always pulled from the weapon template info -- it's not cached in a game state. local XComGameState_Item Weapon; NumUpgradeSlots = X2WeaponTemplate(Weapon.GetMyTemplate()).NumUpgradeSlots; This is the difference between whether changing the template will have an effect on an existing save/campaign or not. If the value can be customized per item/character/etc, then the value will be stored in the game state and saved/loaded from there, so changing the template will have no effect. The side-effect of always pulling from the template (as in this case), is that's in not possible to directly customize individual weapons to have a different number of upgrade slots than another weapon of the same type. So you can't "upgrade the number of upgrade slots". Link to comment Share on other sites More sharing options...
cwingnam Posted February 8, 2016 Share Posted February 8, 2016 Since this seems to be a popular request, I did a little bit of digging and in the UIArmory_WeaponUpgrade.uc, the number of upgrade slots is always pulled from the weapon template info -- it's not cached in a game state. local XComGameState_Item Weapon; NumUpgradeSlots = X2WeaponTemplate(Weapon.GetMyTemplate()).NumUpgradeSlots; This is the difference between whether changing the template will have an effect on an existing save/campaign or not. If the value can be customized per item/character/etc, then the value will be stored in the game state and saved/loaded from there, so changing the template will have no effect. The side-effect of always pulling from the template (as in this case), is that's in not possible to directly customize individual weapons to have a different number of upgrade slots than another weapon of the same type. So you can't "upgrade the number of upgrade slots". So you can't have different number of upgrade slots for each 'instantiated' weapon then. Unless you made some heavy modding in the game state files Link to comment Share on other sites More sharing options...
Shrikey Posted February 8, 2016 Share Posted February 8, 2016 i managed to get the slot expansion to work yesterday myself, but it's been years since i did OOP (being a sysadmin by trade, i code functionally rather than object orientated) and i could not find a way to get this working without overriding the whole class, meaning terrible comparability, i could not get the function-specific overrides to work properly on a side note, the UI goes all kind of buggy if you go past 4 upgrade slots, it's probably fixable however it's pretty obvious that the interface itself was never really intended to support more than 4 slots, you can make some pretty wicked looking guns that way though. :) Link to comment Share on other sites More sharing options...
Amineri Posted February 8, 2016 Share Posted February 8, 2016 i managed to get the slot expansion to work yesterday myself, but it's been years since i did OOP (being a sysadmin by trade, i code functionally rather than object orientated) and i could not find a way to get this working without overriding the whole class, meaning terrible comparability, i could not get the function-specific overrides to work properly on a side note, the UI goes all kind of buggy if you go past 4 upgrade slots, it's probably fixable however it's pretty obvious that the interface itself was never really intended to support more than 4 slots, you can make some pretty wicked looking guns that way though. :smile: Also, there's currently only 7 categories of upgrades, and two of them are "mutually exclusive" (scope and laser sight) because the models overlap. So really you could only fit 6 upgrades -- until more upgrade types get added, anyhow. Link to comment Share on other sites More sharing options...
chickenboy10 Posted February 13, 2016 Share Posted February 13, 2016 Thanks Amineri, was working on a mod and struggling with updating item templates on loading a save game.Hopefully using your method i should be able to get it working. Link to comment Share on other sites More sharing options...
Recommended Posts