antstubell Posted October 27, 2012 Share Posted October 27, 2012 What am I doing wrong here? Spell property Spell2Add autoif Whodid == Game.GetPlayer()Addspell(Spell2Add)endif Won't compile. Thanks. Link to comment Share on other sites More sharing options...
JanusForbeare Posted October 27, 2012 Share Posted October 27, 2012 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 More sharing options...
antstubell Posted October 27, 2012 Author Share Posted October 27, 2012 (edited) 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 October 27, 2012 by antstubell Link to comment Share on other sites More sharing options...
JanusForbeare Posted October 27, 2012 Share Posted October 27, 2012 (edited) 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 October 27, 2012 by JanusForbeare Link to comment Share on other sites More sharing options...
acidzebra Posted October 27, 2012 Share Posted October 27, 2012 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 Notepad++ SetupSublime Text SetupEmacs SetupUltraEdit Setup Link to comment Share on other sites More sharing options...
antstubell Posted October 27, 2012 Author Share Posted October 27, 2012 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 Notepad++ SetupSublime Text SetupEmacs SetupUltraEdit SetupI'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 More sharing options...
JanusForbeare Posted October 27, 2012 Share Posted October 27, 2012 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 More sharing options...
antstubell Posted October 27, 2012 Author Share Posted October 27, 2012 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 More sharing options...
JanusForbeare Posted October 27, 2012 Share Posted October 27, 2012 My pleasure, glad it's working! Link to comment Share on other sites More sharing options...
Recommended Posts