for fortify health, magicka and fatigue
https://www.patreon.com/posts/128356718
#Fortify Fix
1 messages · Page 1 of 1 (latest)
here's a snippet from the part of vflex that calculates dynamic stats, in case you're interested
I'm way to tired to rip it into a standalone right now, but wanted to share it in case it serves as inspiration >.>
the actual formulas are not important, the part where it makes fortify affect max instead of current stats is what matters
when using it things like Fortify Health constant effect items are actually usable
you'll still lose the stats upon unequipping, but taking the belt as an example, so long as you have it equipped your max HP goes up by 20 along your current, meaning you can actually benefit from it by healing instead of having to do convoluted unequip/reequip cycles
similarly for Magicka you could fortify your MP with items or spells and then recover back to the fortified value via potions or resting
oh and for this kinda thing to work you have to force it every frame
getting the engine to stop doing horrible things to your current values whenever your attributes got fortified took me a lot of trial and error
how did you save the changes you did in your save file?
i dont wanna use onload and onsave because they get lost when the mod was uninstalled at some point
and the playersection is cross-save
it recalculates it whenever anything changes
I used on save and on load but that's...
1: something I wanna get rid of, or recombombulate along proper versioning
2: not necessary for the dynamic stat changes if they were to live as a standalone
I'm 99% sure you can get away with probing all the stats via engine calls and a neat temporary table, and just ignore saving completely
so long as you don't forget what your stats were the previous frame or two, it should be ok
well a user could use the mod, buff himself some max health, save and uninstall the mod
you do need some degree of memory to force your way past engine shenanigans, but again not a semi-permanent table
the semi permanent table is there cause vflex is a character leveling mod
oh that
then the max health change would be persistent and couldnt be reverted even if the mod is reinstalled some day
not an issue in my books?
doing that seems well within "bad saving practices"
you generally wouldn't wanna save in such conditions if you're uninstalling that kinda mod.. just in general
i mean i could show 4 warnings when the feature is enabled i guess
you do have a point tho, it's not 100% safe from user error
fun fact: you can also exploit fortify int + fortify magicka for infinite current magicka
if my memory doesn't fail me, that can be done on vanilla but not on vflex
how?
in other words that prevents the exploit
it's to do with how the game scales your current values proportional to your max
or the other way around? it's a mess
by overcapping your MP with fortify and then increasing your max via int, then undoing it in a specific order, you can increase the amount you've overcapped by
it can be repeated for exponential growth
and if you have access to xINT (mantle of woe lol) it's exponentially worse xD
I remember that bug cause I spent hours trying to solve it before having an epiphany and realising it was not my mod but vanilla behaviour
I then proceeded to spend more hours till I beat it into submission
hmm
my point is at some point one has to accept that vanilla is about as safe as many a mod
is this mwse?
you can do horrible things to your stats given a bit of luck and/or clever thinking, and in my opinion it's just how Morrowind do, mods or not
OpenMW
yeah idk if people wanna abuse to get infinite mana and go such lengths, i dont feel like i need to fix that
yup
i mean that vflex mod
took me more hours than I'd like to admit to realise that
where/what is that even?
ah i see
it's on another thread
started it a while ago, went on to make and upload SUS and GRM, and now that I'm finally getting back to it I ran into your mod and thought hey maybe they could get some use out of my code
idk how ncgd works but we aggree that a mod should only add and subtract its own values right? 😄
wrote the thing 2 months ago and I already hate reading through it 
you mean as in not screwing with other mods?
yea
yeah i can relate
ye aside from addons that should be a nono
so many self-created functions and tables, can't really make sense of it
i wonder if my mods are so hard to read to others as every other mod i've seen
I'll try to sanitise it a bit so it's more human readable
probably?
code is a lot more personal than it seems at 1st sight
just trying to figure out how to save the values
Nice!
Did you manage to actually stop the engine from killing you?
I gave up on that due to that 1 issue
why would the engine kill me?
its kinda behaving right now 😄
maybe the fatigue calculation could be sassy
or magicka
but health?
nah
if your HP drops below 0 by vanilla mechanics, you're ded
engine doesn't really care what you do to your stats, it does it's thing before your code happens and if HP goes below 0 during that there's no coming back.. or well, there wasn't last time I checked
now I'm curious as to how you're managing it
yeah thats why my mod is removing the magic effects instead of waiting for the game to do it
oh that's smart
when dispelling spells or when the duration is <0.2s
why didn't I think of that lmao
clean solution, as clean as it gets
but i just noticed how the game is sassy with the max fatigue, maybe i'll just disable that feature for that
probably still works fine for the current value
be wary of dealing with max anything on vanilla dynamic math
yeah but i think health is not affected
again, exponential growth or your stats getting vortexed into oblivion
and lets be honest, health is the most important one
you can fortify the other values with attributes
Yup, HP is easy cause the engine only updates max values on levelup
speaking of, do check a levelup or two just in case
it can discombombulate your current values
I ran into it, and ended up fixing it by just tackling MP which was the worst
whatever works for MP works for everything else
nvm
xD
lol yeah
thanks for the warning, i'm probably not gonna attempt that
fortify fatigue and magicka for increasing the base value is kinda pointless anyway
you're welcome!
if you ever do, hit me up, I can probably spend 30 minutes to save you 4 hours
except for enchantments and spells, but overall yeah not nearly as important
nah you can usually just enchant strength and intelligence
if you dont use the hardcore mode mod
going back to hortatorbelt, it's mildly ironic that a main quest item was done so dirty
it's a sad 20 points even when it works, and on vanilla it's just a scam xD
yup
oh another thing the dynamic thingy I posted does is dynamically update your HP realtime
another way to do it would be monitoring active restore effects and apply them yourself
it's NCGD's HP formula on steroids, kinda
but then i'd need to rewrite my hud mod and make a new magicka regeneration mod
not the featurecreep 
that thing is the reason vflex isn't up and probably won't be for a good couple months to come
avoid it like the plage
lol
openmw 0.50 will probably feature spell de-hardcoding very early
but.... who knows if that will actually fix anything xD
unless they do dynamic stat dehardcoding, then no >.>
the issues are right in the stat calculation code itself
it's not the magic effects, it's the stat changes that get the math drunk
still, dehardcoded spells are a godsend for a lot of mods
looks at 160 custom spells for custom stat effects
could probably delete that with 8 for loops and dynamic spells
i already made magicka cost reduction for my mbsp mod
so theres already a lot possible
i made a fork
hmmm
managed to nail down the exact frame where the spell starts casting to 1-3 frames
so its possible to apply the refund before casting
xD
yeah
I used that for SUS
animation keys for knowing when the player is not casting
albeit SUS does it after the cast key
- stagger/silence check, and when the "use" key switches from false to true
that sounds like a lit of checking ._.
yeah its hacky
otherwise hook the skill exp event and apply the code of your spell then
so idk, not sure if i'm gonna be impressed by the spell dehardcoding 😄
I used that one function
listen for spellcast, then do thing
the rest happens on the skill use handler yes
huh didn't realise that one was spell specific 👀
aah
I was missing this yes
it was present, just in the habitual obscured way of cursed greyness mastertables
why do I do that to my code 
same here
pretty sure I'll move away from putting all my data on it's own file
that function would make more sense if SPELL_ANIMATION_KEYS was declared right above it
maybe the crazy use of functions is good for large projects, possible with multiple devs
ah okay
it's good when you start getting lorge
idk didnt see your entire code
personally whenever I get past 500 lines something has to give
I know I know, baby steps
is that a lot or a little?
either when i'm using something in multiple places or when the name is really self-explainatory
yeah idk maybe i'm doing it wrong
but i personally can't be bothered to read other people's code if its split up like that
tbf call me convinced
reading through that abomination was pain
and I remember what it does
so imagine if I didn't
dbg("fortify "..remStat.." ran out, +"..remMagnitude.." "..remStat)
dynamic[remStat](self).current = math.max(1+remMagnitude,math.min(
dynamic[remStat](self).base +remMagnitude,
dynamic[remStat](self).current + remMagnitude * math.min(1, remDuration / 60 * playerSection:get("percentagePerMinute") / 100)
))
Actor.activeSpells(self):remove(remId)
bonuses[remStat] = bonuses[remStat] - remMagnitude
else
dbg("fortify "..remStat.." ran out, +"..remMagnitude.." "..remStat)
dynamic[remStat](self).current = math.max(1+remMagnitude,math.min(
dynamic[remStat](self).base + bonuses[remStat],
dynamic[remStat](self).current + remMagnitude * math.min(1, remDuration / 60 * playerSection:get("percentagePerMinute") / 100)
))
Actor.activeSpells(self):remove(remId)
bonuses[remStat] = bonuses[remStat] - remMagnitude
end```
there's one line different
but before i get a headache and turn this into a function and make it un-readable i'll just have most the code there twice
i can probably simplify some lines later
well that's not too bad
from a completely newb pov, abstracting there seems a 50/50 at best
but i'll never make a "setstat(stat, min, min2)" function xD
ye its one line within a math.min thats different
not worth a seperate function
here's an example of what I'd consider ok use of functions
and 3 lines that i have dublicate (due to development forth and backs)
are you sure this is openmw?
yes
holy shit
it's on the nexus, you can run it on 0.49
Skill Uses Scaled
that's the scaler for all 3 armor skills
why mui.getsetting() instead of playerSection:get()
there's a bunch of others for ~20 of the 27 skills
because that mod runs a lot of storage sections
I'm not sure it's actually necessary, I ended up doing that from following the examples and adding a bunch of settings groups
it has a lot of settings
technically you just need one for each settings section plus one global and one player
then I need like 8 of them
abstracting meant future me doesn't really need to care about the specific names
i think you can just get a reference to a table in one of your sections
I can have all the sections and treat them like a single monolith via getsetting
not sure if its saved without saving explicitely
I think it wasn't? I ended up having it save kinda janky
with each settings section i meant the global settings and the player settings
it's global and saves on you saving the game
as in, so long as you save on any save it's set for all saves
I'll be honest, settings are not my forte
sections still confuzzle me
relatable

There's an example of magicka being deleted vvia fortify int and max MP on vanilla
1: raise INT
2: raise MP, overcapping
3: INT wears off, proportional scaling eats off a good chunk of the fortified MP
4: fortify MP wears off, deducting it's original amount despite a portion of it having been deleted in step 3
reversing the order of Fortify MP and Fortify INT results in the inverse
yeah but its probably just something that really affects you if you actively exploit it
as INT amplifies the fortify effect
yup, just wanted to show you how it looks in practice
once you get how it works, it's arguably on the level of daisychaining potions, if done correctly
you could replicate it with 2 enchanted amulets, or with spells and a few restore potions
i guess im gonna share that with my atronach sign friend
so he doesnt have to abuse his summoned creatures to regenerate magicka anymore
it doesn't look that impressive on that character, but remember, it's exponential :D
oh yeah it works with drain strats ._.
as it turns out, draining your INT down and then fortifying is a lot more effective
it multiplies the cap when int bounces back proportional to the current/max ratio
so 50/10 > 180/130
but i dont think i wanna apply it to fatigue and magicka
damn
now i see why you needed me xD
but if we're being real, is there any setup where a player might accidentally repeatedly run into this situation?
if he/she makes a spell with fortify int and fortify magicka?
or the other way around?
On vflex it doesn't happen, at least not ever in favour of the player
most comboes just return to base, and the ones that don't only vortex current MP into the void
and if I remember right, vortex is limited to reducing INT to 0 or having both fort/drain INT and Fort/drain MP on the same spell
basically yes
that's how I ran into it during testing
made a generic "fortify all kinds of magicka" testing spell, and hell broke loose
imo if you can get it so the effects work fine when triggered on separate spells, then it's good enough
adding a flavourful warning saying "don't put them in the same spell" is a lot better than "don't be affected by both at the same time"
the proverbial bug surface is a lot smaller if it's restricted to both on one spell
actually you could put fortify int 100 twice on the same spell
which is the only thing you'd actually do if int is more effective than fortify magicka
I think that should cause no issues though? so long as no overcap is involved, stuff doesn't go wild
I mean, good chance your MP will get voided if current < max, but that's not game breaking
it's just a bit annoying
yup
huh
i just tested it and it reduced my max int from 300 to 252
nvm i had increased my magicka via console before
the game really does what it wants xD
welcome to the rodeo!

I'll do a Nova Drift run, then come back for my own round
I'll be making the level UI box today
wish me luck, I'll need it ._.
good luck 😄
ended up with a fat warning not to uninstall the mod with the setting enabled...
found out that reloadlua triggers the onSave event
not doing fatigue and magicka though
Nice!
And yep onSave and onLoad are all funny with reloadlua
probably a plus when bughunting honestly
ideally you'd want reloadlua to be as close to restarting the game as humanly possible
@hard haven Just an idea... Since I "discovered" that Fortify Health works completely different as a Spell Ability here: #1427867749870473287 message
You think Fortify Health used as an Spell Ability might solve the issue if you could get around writing a script that could handle the effect dynamically?
I just tested it with NCG running as well and it is not having any conflict. As NCG respect stat buffs that comes as an ability.
I've tinkered a bit with how I would prefer the sleep buff/debuffs to be. I think I like this combo I've come up with. Just sharing it here for anyone to criticize:
- All the Drain Attribute effects are completely negated by casting Restore Attribute or visiting a Temple Shrine/Cult Altar (Drain/Damage Attribute is only applied once).
- So I replaced Drain Agility with a Blind effect, which does mostly the same thing insofar as combat goes.
- Also added Sound to give a matching debuff for Magic classes. The sound effect is a problem however. So might have to skip this unless getting a sound effect replacer.
- Since I use NCG Fortify Endurance is not doing anything to give a little HP boost.
- Replaced Fortify Attributes with Fortify Health & Fortify Max Magicka
(Fortify Health actually fortifies Maximum Health as an Ability lmao)
-
Replaced Drain Fatigue with a negative Restore Fatigue.
-
Regarding Drain Personality... I don't know a replacement. I thought about if setting a negative Charm on yourself would somehow give negative disposition to NPCs around you... but I doubt that works
Numbers I'm just testing with now (completely guesstimated but I think they are reasonable):
- Fortify Health 12 pts
- Fortify Max Magicka 0.4x
Rested
- Fortify Health 6 pts
- Fortify Max Magicka 0.2x
Awake
- Fortify Health 3 pts
- Fortify Max Magicka 0.1x
Drowsy
- Restore Fatigue -1 pts
Tired
- Restore Fatigue -2 pts
- Sound 5 pts
- Blind 5 pts
Exhausted
- Restore Fatigue -3 pts
- Sound 10 pts
- Blind 10 pts```
Linked by @​lingenveneth from #Sun's Dusk: Needs & Survival
·
I'll test if Fortify Fatigue works the same way...