Talk:GetMagicEffectCode

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

The article says that you can just edit the magic effects with a formID of 00000000 so that GetMagicEffectCode does not stop the script when you use it on them. This is half true, yes when you edit those 'empty' magic effects, GetMagicEffectCode can be used without worrying about stopping the script.

Lets take DUMY effetc as an example since Supreme Magicka uses that as the Poison Damage. A modder wants to get the code of the DUMY effect but since it has a formID of 00000000 by default it would stop the script if it was called without any precausions. So the modder makes a small change to the DUMY effect and tells the users to load it before Supreme Magicka. Now he can use GetMagicEffectCode on the DUMY effect and compare that to effects gotten from GetNthEffectItemCode to see if a magic item has the Poison Damage effect. But here's the catch, what GetMagicEffectCode DUMY returns in the script of the modder is different from what GetNthEffectItemCode returns when it's used on a Poison Damage effect from a magic item ingame.

Now there is a trick you can use. You make a spell in the cs with the DUMY effect. Even though it's empty at the time of creation, you can still add the effect. Now, ingame you check if the user is also loading Supreme Magicka (and thus DUMY effect isn't empty anymore) and use GetNthEffectItemCode on the spell you've created before to get the DUMY effect code. Since it happens ingame, it'll work. --Kyoma 04:46, 23 May 2008 (EDT)