Jump to content

Global variables, or local variables?


Abramul

Recommended Posts

I'm making a mod that will allow the player to add and remove spells covering al effects they've learned, even if they've since removed any spells with those effects from their spellbook. The question I have is this: I'm planning on having the trigger be a book. Would it cause problems if the variables are stored in the script attached to the book?

 

Two other questions:

Is there a better way than spamming GetSpell to check if the player has an effect available?

Is adding or removing a large number of spells in one go a bad idea?

Link to comment
Share on other sites

Storing variables in an item is okay as long as the item is unique. It will cause problems otherwise. It is probably not a good idea to remove a large amount of spells in one script. I have never actually tried using spells in morrowind scripts. There is also a scrip effect that removes all spells that have a certain effect. It's called RemoveEffects. To use it, you have to know the spell effects ID. When you know this, you just have to say something like:

 

begin removeshieldeffect

 

if ( onactivate == 1 )

~removeeffect, sEffectShield

endif

 

end removeshieldeffect

 

This would remove all spells with the Shield effect from the character when activated.

Link to comment
Share on other sites

RemoveEffects "Removes all spells currently affecting the calling actor that include the given effect". Don't see how that's useful to me.

 

Anyway, thanks for the help regarding local variables. I have a prototype (covers Mark, Recall, and the Interventions) of this mod ready, now to see in what way it's broken.

 

EDIT 1: The Morrowind script editor is too forgiving! Allowing syntax that the game can't handle is downright mean.

Link to comment
Share on other sites

Sorry, some words got flipped around when I was reading. However, if there were any of those effects on the actor at the activation, it could still remove a large number of spells.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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