Kanhef said:
Timeslip - sorry, but I don't think that script will fix it. The 'gain foo' perks don't actually modify primary stats (same thing with perks that give bonuses to skills). It looks like the level-up routine doesn't check for Gain Intelligence perk, which is why you don't get more skill points.
You're right. Silly me for assuming it would modify the extra stat and not actually checking first...
For the purposes of fixing this bug it doesn't matter, because the extra stat is allowed to be negative. (My script did work, with some modifications to get all the function names right. I've tested it since posting.) The problem will be that anywhere else that makes a direct check for the gain intelligence perk will end up giving double bonuses.
The best thing to do would be to remove all of the hard coded checks for the gain xxx perks, and then modify them to increase your base stat by one. That would ensure that they all give exactly the right bonuses, but would be tedious and could introduce more bugs if any checks got missed.
Are there any other problems with the gain xxx perks not giving the bonuses they should? If not, I think I'll just go with the original request and stick a check for the gain intelligence perk into the level up code. If there are other problems, removing all the checks might be more efficient.
Edit: After a quick look for all the checks for the gain xxx perks, the only ones I could find were in calculating the current stat, which basically just adds the base and extra stats together, and then clamps the result into the allowed range. In that case, the perks should just have an identical effect to increasing the extra stat anyway...
Edit2: Pretty sure the perks aren't checked for anywhere else. I think the script idea would be best tbh. Removing those checks and modifying the perks to increase the base stat would give the same effect, but would break save games, and just adding a check for gain intelligence perk on level ups would leave anything else that depends on base stats rather than the current stat broken.