Difference between revisions of "GetMagicEffectCode"
imported>DragoonWraith (ME) |
imported>JRoush m |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 9: | Line 9: | ||
== Notes == |
== Notes == |
||
* The 'effect:chars' are actually the ''editor IDs'' of the magic effects. Thus, this command is really expecting an editor ID, just like most other commands. This means that it will also accept a ref var containing the magic effect: |
|||
* When used on Magic Effects without FormIDs (for Vanilla Oblivion, those effects are DISE, DUMY, and RSWD; FormID = 00000000) the script will never run in-game. You can give these Magic Effects FormIDs by modifying them (but there may be issues when other mods modify them as well). |
|||
Set myrefvar to FIDG |
|||
Set mylongvar to (GetMagicEffectCode myrefvar) |
|||
* When used on Magic Effects without FormIDs the script will not compile correctly (although it does not produce any error messages). With Oblivion.esm loaded, the effects DISE, DUMY, and RSWD do not have formIDs. Without Oblivion.esm loaded, ''no magic effects'' have formIDs. Modifying the effect to give it a formID will not fix the problem. To avoid this, use magic effect codes directly or use the [[MagicEffectCodeFromChars]] function: |
|||
Set mylongvar to 1195657542 ;; literal effect code for FIDG - will always work |
|||
Set mylongvar to MagicEffectCodeFromChars "FIDG" ;; FIDG is a string instead of an editorID |
|||
[[Category:Functions]] |
[[Category:Functions]] |
||
| Line 16: | Line 24: | ||
[[Category:Magic Functions (OBSE)]] |
[[Category:Magic Functions (OBSE)]] |
||
[[Category:Magic Functions - Magic Effect (OBSE)]] |
[[Category:Magic Functions - Magic Effect (OBSE)]] |
||
[[Category:Record Variable Functions]] |
|||
[[Category:Record Variable Functions (OBSE)]] |
|||
Latest revision as of 18:51, 4 October 2010
A command for Oblivion Script Extender
Syntax:
(magicEffectCode:long) GetMagicEffectCode effect:chars
(magicEffectCode:long) GetMECode effect:chars
Returns the magic effect code of the effect.
NotesEdit
- The 'effect:chars' are actually the editor IDs of the magic effects. Thus, this command is really expecting an editor ID, just like most other commands. This means that it will also accept a ref var containing the magic effect:
Set myrefvar to FIDG Set mylongvar to (GetMagicEffectCode myrefvar)
- When used on Magic Effects without FormIDs the script will not compile correctly (although it does not produce any error messages). With Oblivion.esm loaded, the effects DISE, DUMY, and RSWD do not have formIDs. Without Oblivion.esm loaded, no magic effects have formIDs. Modifying the effect to give it a formID will not fix the problem. To avoid this, use magic effect codes directly or use the MagicEffectCodeFromChars function:
Set mylongvar to 1195657542 ;; literal effect code for FIDG - will always work Set mylongvar to MagicEffectCodeFromChars "FIDG" ;; FIDG is a string instead of an editorID