sagittarius22 Posted February 10, 2012 Author Share Posted February 10, 2012 (edited) Yes, the script is attached to a quest. Edited February 10, 2012 by sagittarius22 Link to comment Share on other sites More sharing options...
kromey Posted February 10, 2012 Share Posted February 10, 2012 Your "Event OnInit()" is what needs to invoke your RegisterForUpdate(). Then, the "meat" of your script needs to go inside an "Event OnUpdate()" block. So it should be something like this: Event OnInit() RegisterForUpdate(0.5) EndEvent Event OnUpdate() ; Everything you want to do goes here EndEvent Disclaimer: I'm offering this snippet without the benefit of having any Papyrus compiler or tools of any kind in front of me, but I'm as near as I can tell this is what you need to be doing. Don't take this code as gospel, though -- if there are errors, well, fix them. :) Link to comment Share on other sites More sharing options...
Korodic Posted February 10, 2012 Share Posted February 10, 2012 Your "Event OnInit()" is what needs to invoke your RegisterForUpdate(). Then, the "meat" of your script needs to go inside an "Event OnUpdate()" block. So it should be something like this: Event OnInit() RegisterForUpdate(0.5) EndEvent Event OnUpdate() ; Everything you want to do goes here EndEvent Disclaimer: I'm offering this snippet without the benefit of having any Papyrus compiler or tools of any kind in front of me, but I'm as near as I can tell this is what you need to be doing. Don't take this code as gospel, though -- if there are errors, well, fix them. :) exactly why I gave him the link :P Link to comment Share on other sites More sharing options...
kromey Posted February 10, 2012 Share Posted February 10, 2012 Your "Event OnInit()" is what needs to invoke your RegisterForUpdate(). Then, the "meat" of your script needs to go inside an "Event OnUpdate()" block. So it should be something like this: Event OnInit() RegisterForUpdate(0.5) EndEvent Event OnUpdate() ; Everything you want to do goes here EndEvent Disclaimer: I'm offering this snippet without the benefit of having any Papyrus compiler or tools of any kind in front of me, but I'm as near as I can tell this is what you need to be doing. Don't take this code as gospel, though -- if there are errors, well, fix them. :) exactly why I gave him the link :PIn my defense, I was already typing my post before you had posted the link. ;) Link to comment Share on other sites More sharing options...
sagittarius22 Posted February 10, 2012 Author Share Posted February 10, 2012 (edited) New script, but still doesn't work :( I appreciate your help guys!Scriptname SAGPlayerInChargenMyScript extends Quest Quest Property InChargen Auto Spell Property Rested Auto SPell Property WellRested Auto Spell Property MarriageRested Auto Event OnInit() registerForUpdate(0.5) EndEvent Event OnUpdate() if Game.GetPlayer().HasSpell(Rested) || Game.GetPlayer().HasSpell(WellRested) || Game.GetPlayer().HasSpell(MarriageRested) Debug.MessageBox("Its okay") else Debug.MessageBox("Not Okay") Endif EndEvent Edited February 10, 2012 by sagittarius22 Link to comment Share on other sites More sharing options...
philip141091 Posted February 10, 2012 Share Posted February 10, 2012 is the quest ticked as Available from start (or something similar, cant remember the exact wording)? Link to comment Share on other sites More sharing options...
sagittarius22 Posted February 10, 2012 Author Share Posted February 10, 2012 Yes... Link to comment Share on other sites More sharing options...
Korodic Posted February 10, 2012 Share Posted February 10, 2012 In my defense, I was already typing my post before you had posted the link. ;)no defense needed. I liked your explanation enough to note it down. :P sag's script is useful to determine if the player has just slept (and got the bonus). Which is probably a useful script in certain situations. I need to make a script that grabs the player before they sleep. as for sag, you're just going to have to spend the time playing with different functions. Idk what else to suggest, and there is like 40 some functions O.o Link to comment Share on other sites More sharing options...
kromey Posted February 10, 2012 Share Posted February 10, 2012 (edited) Of course, if you want to detect if the player has just slept, why not RegisterForSleep() and then use the event OnSleepStop()? That method has the added benefit of firing immediately when the player stops sleeping (not up to half a second later), as well as optionally letting you determine the difference between sleep ending and sleep being interrupted. The event OnSleepStart() can let you grab the player as they start to sleep... (Why didn't I mention this sooner? Well, I forgot -- still new to Papyrus myself. :confused: ) Edited February 10, 2012 by kromey Link to comment Share on other sites More sharing options...
Recommended Posts