Hello I couldn't help but notice your 'planned mod features' box mentions you'd like to have weapon skill perks affect recoil values and that you'd like suggestions on how it could be done. I recently uploaded a mod that makes power armor remove recoil, sway, and (optionally) accuracy decrease from firing (crosshair widening) when the player is in power armor. I used scripts to attach or remove objectmods to weapons when they where equipped, on condition that the player was in power armor and the weapon was a gun. I also uploaded the script I used as a modder's resource if you'd like to take a look. I've attached a txt file to this post containing an annotated and clean version of the script I used. I'll admit that I was new to modding and scripting before I did this so it may be a bit sub-optimal. But I spent a lot of time getting over weird 'features' and proofing it against stuff that could go wrong. The mod is called Power Armor Gun Handling and Heavy Heavy Weapons I made a
I was thinking about making a mod to make perks affect aim models of guns myself a while ago, using scripts to apply objectmods. The thing is you can only affect aim model values with ADD, MUL+ADD, and SET operators which limits you. The mod I made uses SET to set recoil min and max values to 0, set aimstability so high scopes can't reduce it below 1, hence removing sway, and setting aim cone increase per shot to 0. But if you wanted to make perks affect recoil values you may have to limit the power of objectmods you can craft at the bench or very carefully calculate exact values. For example: You make a stock objectmod made at a bench that reduces recoil by 50% by using the MUL+ADD operator with a float value of -0.5 on aimmodelrecoilmindegreespershot or aimmodelmaxdegreespershot But then the player has rank 5 of rifleman that reduces recoil by 50% by using the MUL+ADD operator with a float value of -0.5 on aimmodelrecoilmindegreespershot or aimmodelmaxdegreespershot The end result is a weapon that has 0 recoil, and you can actually make the weapon recoil downwards if you go below 0. The problem is some guns can have -75% reduction and some only 25% reduction. If you want to use ADD or SET operators you may have to very carefully calculate exact values which would be a ridiculous hassle and maybe make a different set of rules for each individual gun. So I'd suggest you set yourself a rule for bench-crafted objectmods such as stocks or muzzle brakes to never make recoil values go below 0.5. I.e. stock and muzzle do MUL+ADD -0.25 each. The way I planned to make a mod wherein perks affect aim model values was to have each perk give a hidden actorvalue, which is already done for some perks in the vanilla game. So rank 1 gives the perk actor value of 1 and rank 5 gives the actor value of 5 etc. You could then have a script listening for the onequip event which checks if it was a pistol, rifle, heavy, or automatic equipped then checks for the perk-added actorvalues. Once the actor value is found it could apply an objectmod specific to that perk. For example if rank 3 is detected it attaches an objectmod that applies MUL+ADD -0.3 on the weapon's recoil values etc. Then you could also add a consistency checker. Each objectmod also gives the player a hidden actor value. The script could check if the perk actor value equals the objectmod actor value. If it does then nothing is to be done. If not, then the weapon needs to be updated and modded to have the objectmod appropriate for the perk rank. I'm pretty sure NPCs don't use recoil or stability values in their accuracy calculation so it should be safe from a player dropping it to an NPC to give them a modded gun. It shouldn't conflict with ammo-switching or under-barrel attachment switching as they probably use hotkeys to attach an objectmod and the player will do that after the OnEquip script has finished apply the perk-appropriate objectmod. Sorry for the text wall, hope this helps. Edit: butchered links soz