Jump to content

Magic effect reverse engineering


Stealth21

Recommended Posts

Is it somehow possible to edit/rewrite the code of the magic effects? Is that code unaccessible? Where are they - among the game engine's .dlls / .exe ?

 

I saw only one mod - SupremeMagicka.esp where there is in it somehow added a new magic effects, and moreover all the original spell/new spell from 3rd side mods which are using telekinesis magic effect are accompanied with the appropriate to telekinesis script effect. Thought, I doubt that in case of that mod the code itself of the standard telekinesis magic effect was rewritten, rather it is accompanied with a 3rd side script.

Link to comment
Share on other sites

I did install a mega mod that also remakes all effects and some got so damn annoying too. I installed it for the quests, not to be a pain in my eyes. If I can recall the name. I think I wrote about it somewhere and also linked to it.

 

It had LAME included but peek at Lame, see how they made it. Be careful though, as your effects will never be the same again so install it with a mod manager

Link to comment
Share on other sites

Looks like LAME is some way based on / inspirited with SupremeMagicka.

But either of these mods changes the magic effect's visuals/icons/sounds(maybe)/power(in total)/cost...

...and I would like to edit the code itself of the existed standard magic effect.

For a grotesque example analogy:

when casting any spell which uses restore health REAT magic effect - there is a weather change to be snowing;

when casting any spell which uses frost resist RSFR magic effect - Dagoth Ur is falling to the caster;

when casting any spell which uses light LGHT magic effect - a nearby tree becomes a mudcrab.

- and in each case there were no any health restoration, frost shield or light casted as we used to see and perceive them.

 

As for a goal of it, I would like to rewrite (or better to edit) the logic code of STRP magic effect.

Edited by Stealth21
Link to comment
Share on other sites

Yes, thanks for the answers, guys.
And yes indeed, Oblivion Magic Extender aka OBME was the answer for me - with this plugin it IS possible to change the hardcoded script of magic effects to the script and write it as one likes. However, people are reporting about incompatibilities with this plugin, and my case is not an exception unfortunately. I am currently playing so have saves and using SupremeMagicka mod. Thought, OBME has no incompatibilities with SupremeMagicka mod itself, but with it's optional but not exceptional dependence plugin - CustomSpellIcons. The game just crashes to load whenever a new game or a save. In the OBME's description there is even a note that OBME is incompatible with Custom Spell Icons v3.1. This is because both attempt to patch the same game code. So even thought I can load my current save without CustomSpellIcons.dll , it ruins the icons of the SupremeMagicka mod spells, making them all of the scripted spell default icon.

Some plugins which are created using OBME can theoretically be fully functional without OBME presence, for example, if to not use a script functions provided by OBME. But in my case when I am going to change the magic effect's hardcoded script and choose that it will be a script from now, that plugin have to be loaded with OBME presence for it's full functional. And since the custom mods based on OBME will have incompatibilities with other mods because of OBME's .dlls presence, the result is that I have to give up in that I was going to implement. If only there would a spell icon setter alternative created for the SupremeMagicka exist...

 

But it IS possible to rewrite Soul Trap functional. The steps would be simple:

- change STRP magic effect's effect handler to "Scripted"

- write a custom script.

 

The icon/visuals/magnitude/spell_cost/spell's_dispel_behavior will be the same as original STRP have. The logic in the script of the soul trapping behavior could be like this:

- target ref spell is casted to is obtainable with GetSelf

- caster ref of the spell is obtainable using While<->Loop among the all of the casted to the target magic effects and check whenever it is a STRP magic effect code (by the way it is 1347572819) checking with the function GetNthActiveEffectCode, so we will surely find that ref whenever the spell casting method - projectile/touch ; enchanted to arrow/staff/melee_weapon (not sure about ranged weapon like bows, need testings)

- if target is already dead, do nothing (return). Do next (ScriptEffectUpdate) only if the target is alive

- whenever target IsCreature (GetCreatureSoulLevel) or actor (else), the logic will be going to the way of soulgems for the white souls or black souls

 

And a big code of caster's soul gems iterating after the target OnDeath

- the logic should search (ForEach<->loop iteration) for the appropriate to the gotten SoulLevel soul gems in filling priority dependence of maximum soulgem capacity. Also, GetOwner of the best suitable soulgem founded. I see the suitable soulgems filling in case of white souls of course in this priority way (BaseObjects) - Azura's star -> perfectly fittable vanilla soulgem -> perfectly fittable stolen vanilla soulgem -> perfectly fittable custom mod soulgem -> perfectly fittable stolen custom mod soulgem -> not perfactly fittable vanilla soulgem -> not perfactly fittable stolen vanilla soulgem -> not perfectly fittable custom mod soulgem -> not perfectly fittable stolen custom mod soulgem. If there was not found a suitable soulgem, show message from the sSoulGemTooSmall setting's string. Obviously, continue if founded

- to process Azura's star, select it's ref and SetCurrentSoulLevel to SoulLevel obtained

- to process other soul gems, select it's ref , GetBaseObject of it, GetOwner of it and GetRefCount of it. (not sure about that the stolen soul gems could be stacking into the stacks...)

 

* if the owner is the player and to fill the vanilla soul gem - RemoveMeIR the founded soulgem which player owns, AddItemNS the already filled appropriately base object soul gem; if the founded soulgems ref quantity was > 1 then CreateTempRef from the base object of that empty soul gem, SetRefCount to the quantity of pastly founded soulgems quantity minus one, CopyIR to the caster;

 

** if the owner is not the player and to fill the vanilla soul gem - RemoveMeIR the founded soulgem which own by not the player; if the founded ref quantity was > 1 CreateTempRef from the base object of that empty soul gem, SetRefCount to the quantity of pastly founded soulgems quantity minus one, SetOwner to the owner of the pastly founded soulgems, CopyIR to the caster; another CreateTempRef from the already filled appropriately base object soul gem, SetRefCount 1, SetOwner to the owner of the pastly founded soulgems, CopyIR to the caster;

 

*** if the owner is the player and to fill the custom mod soul gem - RemoveMeIR the founded custom mod soulgem which player owns; if the founded ref quantity was > 1 CreateTempRef from the base object of that empty soul gem, SetRefCount to the quantity of pastly founded soulgems quantity minus one, CopyIR to the caster; another CreateTempRef from the base object empty soul gem, SetRefCount 1, SetCurrentSoulLevel to SoulLevel obtained, CopyIR to the caster;

 

**** if the owner is not the player and to fill the custom mod soul gem - RemoveMeIR the founded custom mod soulgem which own by not the player; if the founded ref quantity was > 1 CreateTempRef from the base object of that empty soul gem, SetRefCount to the quantity of pastly founded soulgems quantity minus one, SetOwner to the owner of the pastly founded soulgems, CopyIR to the caster; another CreateTempRef from the base object empty soul gem, SetRefCount 1, SetOwner to the owner of the pastly founded soulgems, SetCurrentSoulLevel to SoulLevel obtained, CopyIR to the caster;

 

In the end, PlaySound ITMSoulTrap, show message from the sSoulCaptured setting's string.

Edited by Stealth21
Link to comment
Share on other sites

If this incompatibility is a deal breaker for you, you might want to check Custom Spell Icons Updated.

Tried that - not all of the icons on their places. Also there is a bug persists, there is a note about it in that mod description and some people reporting about that they met the situation where that bug triggers. Looks like that mod is just a try of making the custom spell icons mod be compatible with OBME, but it actually is compatible partially.

Maybe there is an alternative to OBME exists?..) A bit limited but have less incompatibilities with other .dlls?

Link to comment
Share on other sites

  • 2 weeks later...

In the end, PlaySound ITMSoulTrap, show message from the sSoulCaptured setting's string.

I supposed that if STRP handler is changed then "Souls trapped:" counted value in the statistics is not triggered to be raised. Do someone knows the way to raise it in code, it's variable maybe? It is not the global so I can not find where such variables are stored...

 

Also, a side question. When enchanting at the altar, when the item is choosed, the soulgem is choosed, the effect is choosed and I am choosing the same effect - that message:

That effect has already been added. Edit the effect instead

- do someone knows the way it can be translated in other way than HEX-editing Oblivion.exe ? I would like to avoid the HEX-editing way because that OBSE is binded to Oblivion.exe's checksum. Note that even with the translated setting "fEffectAlreadyAdded" that message actually stays untranslated in the game. I wonder what for is that variable then...

Edited by Stealth21
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...