gigantibyte Posted August 19, 2012 Share Posted August 19, 2012 The quest I made works at adding my mod spell to the player, but does it every time a game is loaded. Even games loaded past the point the mod was added. Can someone post a proper method? Link to comment Share on other sites More sharing options...
Mujuro Posted August 19, 2012 Share Posted August 19, 2012 There are at least a few different ways to add a spell to the player on mod load, below is probably the quickest (not necessarily the cleanest) way:Check the box for starting the quest game enabledSet up your stages, e.g., 0 and 10, based on what actions you want to take; if you're just adding a spell for example, you can get away with just 2 stagesSet up a script to your entry stage 0 to give the spell to the player (sounds like you've already done this part); also in this stage, do a SetStage(10) once the spell is addedFor stage 10, do a Stop() So your stage 0 script would look something like this: If(Game.GetPlayer().AddSpell(SpellToAdd01, true)) MsgToDisplay.Show() endIf SetStage(10) Your stage 10 script would look something like this: Stop() Link to comment Share on other sites More sharing options...
gigantibyte Posted August 19, 2012 Author Share Posted August 19, 2012 I created a stage 0, but I can't attach a script without a log entry. So I made an empty log entry and attached the script I made in the kmyQuest window. However, when I click ok and go back, the kmyQuest window resets to 'NONE'. Is this script is ok? Scriptname MyQuestScript0 extends Quest Spell Property MySpell Auto EVENT OnInit() if !Game.GetPlayer().HasSpell(MySpell) Game.GetPlayer().AddSpell(MySpell) endif SetStage(99) EndEvent I didn't have a message to display, so I hope this works as good. Also, if stage 99 does not exist, I'm assuming the quest will be advanced to the last stage? Link to comment Share on other sites More sharing options...
Mujuro Posted August 20, 2012 Share Posted August 20, 2012 Just create an empty log entry. Also, you do NOT need to do this as an event, much less using OnInit(). Just drop the sample excepts I put into each of the empty stage entries for 0 and 99 respectively. Link to comment Share on other sites More sharing options...
gigantibyte Posted August 20, 2012 Author Share Posted August 20, 2012 (edited) Just create an empty log entry. Also, you do NOT need to do this as an event, much less using OnInit(). Just drop the sample excepts I put into each of the empty stage entries for 0 and 99 respectively. Do you mean in the Papyrus Fragment window? I don't need the property line? Edit: Pasting your script into the Papyrus Fragment window results in compile errors saying my spell and 'MsgToDisplay' is undefined. Edited August 20, 2012 by gigantibyte Link to comment Share on other sites More sharing options...
Mujuro Posted August 20, 2012 Share Posted August 20, 2012 Pasting your script into the Papyrus Fragment window results in compile errors saying my spell and 'MsgToDisplay' is undefined.If you don't want to show a separate message to the player on the spell add, just comment out or delete that line. Link to comment Share on other sites More sharing options...
gigantibyte Posted August 20, 2012 Author Share Posted August 20, 2012 Pasting your script into the Papyrus Fragment window results in compile errors saying my spell and 'MsgToDisplay' is undefined.If you don't want to show a separate message to the player on the spell add, just comment out or delete that line. Still get compile errors. But part of my main problem in getting this to work, was the fact I wasn't testing on a saved game where the mod had not been installed. You are right that there are "a few different ways" ways of adding a spell to the player on mod activation. I'm too much of a novice to understand the arguments being made for the "best" way, I just want something that works and doesn't adversely mess up the player's game. My goal was achieved by going back with the OnInit() event on the advice I got here. Thank you for replying. It's not always easy finding help. Link to comment Share on other sites More sharing options...
Mujuro Posted August 20, 2012 Share Posted August 20, 2012 I'd recommend following the procedure set forth above but do so in a NEW quest. If you're binding the scripts to an existing quest that has already run in your existing save, that may be why it's not working. Regarding the compile errors, what's the content of the line(s) the compiler barfs at? Regarding OnInit(), you CAN use that approach, but I tend to avoid using it more from personal preference, and the spell add in this case will trigger without using OnInit(). Link to comment Share on other sites More sharing options...
Recommended Posts