#Spellforge (Noita-like Spellcrafting)
1 messages · Page 4 of 1
The engine casts 'nothing'
Spellforge casts the spell through SFP
its a bit convoluted but it was basically a choice to reduce complexity and increase compatibility
if you look at OSSC it has its own spell casting system instead
does its own rolls
are you using the vanilla tooltip or magic window extender's
its entirely through vanilla
Making a dynamic tooltip system just for spellforge was way beyond what I wanted to bother with
try intercepting the tooltip event and rebuilding it to look like morrowind's then add logic for those custom ids to swap between pts and percentage

all that just so resistance shows % instead of Pts
or I can pester the OpenMW devs to add in the functionality to choose?
Because like I said, any custom spell effect will have this issue
not just spellforge
like if you wanted to make a spell that gave you 25% crit chance bonus
it would still show as 25pt
in the tooltip
hm
MagicEffect::MagnitudeDisplayType MagicEffect::getMagnitudeDisplayType() const
{
int index = refIdToIndex(mId);
if (mData.mFlags & NoMagnitude)
return MDT_None;
if (index == 84)
return MDT_TimesInt;
if (index == 59 || (index >= 64 && index <= 66))
return MDT_Feet;
if (index == 118 || index == 119)
return MDT_Level;
if ((index >= 28 && index <= 36) || (index >= 90 && index <= 99) || index == 40 || index == 47 || index == 57
|| index == 68)
return MDT_Percentage;
return MDT_Points;```
```For this magic effect:
1. Convert its effect ID into a built-in vanilla effect index.
2. If it has no magnitude, show no unit.
3. If it is Fortify Maximum Magicka, show "x INT".
4. If it is a distance-style effect, show "feet".
5. If it is a level-style effect, show "level".
6. If it is a weakness/resist/percent-style effect, show "%".
7. Otherwise, show "points".```
index >= 28 && index <= 36
Weakness effects:
- Weakness to Fire
- Weakness to Frost
- Weakness to Shock
- Weakness to Magicka
- Weakness to Common Disease
- Weakness to Blight Disease
- Weakness to Corprus Disease
- Weakness to Poison
- Weakness to Normal Weapons
index >= 90 && index <= 99
Resist effects:
- Resist Fire
- Resist Frost
- Resist Shock
- Resist Magicka
- Resist Common Disease
- Resist Blight Disease
- Resist Corprus Disease
- Resist Poison
- Resist Normal Weapons
- Resist Paralysis
index == 40
Chameleon
index == 47
Blind
index == 57
Dispel
index == 68
Reflect
only those exact spells show as % in the tooltip
I'm tempted to poke s3ctor and see what he thinks

@neon light
#1495918381176590386 message
am I just being stupid and missing something? Or is the machine spirit correct 👻
(Warning: distilled by the machine spirit 👻 )
The spell hover path does this:
- Reads the hovered spell record.
- Copies each effect’s
mEffectID,magnitude,duration,range, etc. into tooltip params. - Lets the generic spell-effect widget format the text.
Source: tooltips.cpp
Then the formatter asks the magic effect record for getMagnitudeDisplayType(). If that returns MDT_Percentage, it appends spercent; otherwise for normal magnitudes it appends spoint/spoints.
Source: widget.cpp
The critical bit is here: getMagnitudeDisplayType() is hardcoded by the built-in magic effect index. Weakness effects are percentage because their vanilla effect indexes are in the percentage ranges. Unknown/custom effect IDs fall through to MDT_Points.
Source: loadmgef.cpp
meanwhile, in the lab:
https://streamable.com/j2g32l