Jump to content

What's wrong with this Addspell script?


antstubell

Recommended Posts

Most obvious error is that "Whodid" is not Papyrus syntax.

 

What triggers the addspell effect? Does it happen when the player reads a book? Kills a boss? Eats a sweetroll? Without knowing what you're attaching the script to, and what action triggers the addspell function, it's not possible to give you a precise answer.

Link to comment
Share on other sites

Most obvious error is that "Whodid" is not Papyrus syntax.

 

What triggers the addspell effect? Does it happen when the player reads a book? Kills a boss? Eats a sweetroll? Without knowing what you're attaching the script to, and what action triggers the addspell function, it's not possible to give you a precise answer.

When player takes a MISC object

Edited by antstubell
Link to comment
Share on other sites

Try this:

 

spell property spell2add auto
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
      if (akNewContainer == Game.GetPlayer()) && ((Game.Getplayer().HasSpell(Spell2Add)) == 0)
               (Game.Getplayer()).addspell(spell2add)
      endif
endevent

 

EDIT: Oh, by the way, this gets attached to the object being picked up.

Edited by JanusForbeare
Link to comment
Share on other sites

Antstubell, I highly recommend setting up notepad++ or another text editor with papyrus syntax - it will help you a lot in deciphering and writing code.

 

External Text Editors

I've been meaning to do that for some time but as soon as I get into CK I just forget about it and use the compiler there. I'll make a note to do it.

The script works perfectly and its a script I've used many times before, don't know why I didn't think of it. When spell is added I get a notification, if I remember correctly (I've been modding for so long haven't played the game in ages) doesn't a big message saying you've learnt blah, blah appear?

Link to comment
Share on other sites

When spell is added I get a notification, if I remember correctly (I've been modding for so long haven't played the game in ages) doesn't a big message saying you've learnt blah, blah appear?

 

I'm pretty sure that only happens for Word Walls (though, like you, I mod more than play). I think that a notification for a new spell is standard procedure.

Link to comment
Share on other sites

When spell is added I get a notification, if I remember correctly (I've been modding for so long haven't played the game in ages) doesn't a big message saying you've learnt blah, blah appear?

 

I'm pretty sure that only happens for Word Walls (though, like you, I mod more than play). I think that a notification for a new spell is standard procedure.

Ok then, would be nice if a sound effect played too like the drum beat when a quest is added just in case player is not looking. Thanks for your help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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