I started to make mods quite a while ago, however they were mostly value changing for personal use. I made a new race, some new spells and turned a daedric mace into a magic rod. None of these things were especially complicated and they didn't involve any scripts. Recently I started working with scripts in the school, so I decided to try it in the Creation Kit.
The problem is pretty simple, I want to make an enchantment that scales with the players level in a skill, namely two handed. The first problem that I found is that there are no scripts that directly change the magnitude of an effect in proportion to something. After some research I found out that it was not possible to change it in a direct way like this. I've thought about using the "SetEnchantment" script (added in SKSE) in combination with using 101 different enchantments from 0-100 in magnitude. The script would (theoretically) consist of a "if" statement and loads of "elsif", one for each level of the skill and one for each enchantment. The script is probably wrong (it has to be, considering that i started with papyrus yesterday) but I hope someone gets the idea.
iftwohanded == 0{Weaponproperty.SetEnchantment ScalingEnchLvL0}elseif twohanded == 1{WeaponProperty.SetEnchantment ScalingEnchLvL1}
etc. etc. until lvl 100
Is using a clumsy script like this possible for an efficient mod or do I have to use a quest script to detect when the level changes and thus get the enchantment change when the skill changes.
I would appreciate any tips on how to solve the problem, the best would be a complete solution with an explanation on why it is best to do it that way.