bencebence Posted August 4, 2011 Author Share Posted August 4, 2011 Edited once again:scn WakeUpPlayerQuestScript float time short aweken begin GameMode set time to GameHour if player.getincell aaaLillyhallCastlePrivateQuarters if time == 7 WAkeUpPC set aweken to 1 endif endif if aweken == 1 bedroomservant01.moveto player bedroomservant01.StartConversation player, WakeUpSir endif endShall this work? (Didn't test it yet.) Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 4, 2011 Share Posted August 4, 2011 Hmm, maybe let's redesign this a little. While the player is sleeping only MenuMode blocks will get executed.So put the check for time and cell into the MenuMode block together with WakeUpPC and set this "aweken" variable accordingly. WakeUpPC now should throw you out of MenuMode back into GameMode, as it's waking you up and putting you back into the game.So put the "if aweken == 1" part into the GameMode block and set "aweken" back to "0" at the end of it, so it additionally acts as a do-once condition for us here, preventing the "moveto" and "StartConversation" stuff to be called over and over each 15 seconds (or what's default for fQuestDelayTime). If this still does nothing, some debug outputs are definitely in order here, to figure out which part of the script never gets reached and why. Link to comment Share on other sites More sharing options...
bencebence Posted August 4, 2011 Author Share Posted August 4, 2011 I put some MessageBox-es in it. The one that start when I get in the cell works. But the one that'd only work if it's seven o'clock doesn't... What can be the problem?Here is the script again.scn WakeUpPlayerQuestScript float time short aweken begin MenuMode set time to GameHour if player.getincell aaaLillyhallCastlePrivateQuarters if time == 7 WAkeUpPC set aweken to 1 endif endif end Begin GameMode if aweken == 1 bedroomservant01.moveto player bedroomservant01.StartConversation player, WakeUpSir set Aweken to 0 endif end Link to comment Share on other sites More sharing options...
GreatLucifer Posted August 4, 2011 Share Posted August 4, 2011 I suggest you try to put the (/a) script (with MenuMode ofcourse) in a questscript. Questscripts should still run when the player sleeps. Link to comment Share on other sites More sharing options...
bencebence Posted August 4, 2011 Author Share Posted August 4, 2011 (edited) The whole script is a quest script :S And also it's included in a quest. Edited August 4, 2011 by bencebence Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 4, 2011 Share Posted August 4, 2011 (edited) Just read up GameHour again, and it is a "float", meaning a condition like "time == 7" is highly unlikely to ever be the case. Your initial condition with the range was the better way to go here.Imagine how unlikely it is to be exactly "7.000000" while every decimal digit could be anything at any time the script reaches this check again. And this number is already a rounded example to begin with. There are far more fractions than this. Ref: http://cs.elderscrolls.com/constwiki/index.php/Special_variablesThis "GameHour is 2.5" output example there made me suspicious. It's only rounded that nicely due to the "%.2f" format specifier. The internal value of this is likely much more fractured. Maybe even down to seconds as fractions of hours? Or even milliseconds? "==" will likely never work, ever, considering this. Edited August 4, 2011 by DrakeTheDragon Link to comment Share on other sites More sharing options...
fore Posted August 4, 2011 Share Posted August 4, 2011 Your problem is your time varible. Time and Gamehour are floats, so they will most likely never be EXACTLY equal to 7. Gamehour includes fractions of an hour. So you would have to check if time is ">=7" after it was "<7" the last time. EDIT: ok, someone was faster than me :thumbsup: Link to comment Share on other sites More sharing options...
bencebence Posted August 4, 2011 Author Share Posted August 4, 2011 scn WakeUpPlayerQuestScript float time short aweken begin MenuMode set time to GameHour if player.getincell aaaLillyhallCastlePrivateQuarters if time >= 7 && time <= 8 WAkeUpPC set aweken to 1 endif endif end Begin GameMode if aweken == 1 bedroomservant01.moveto player bedroomservant01.StartConversation player, WakeUpSir set Aweken to 0 endif endSo something like this would work? Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 4, 2011 Share Posted August 4, 2011 Pretty sure. I see no apparent cause for it not to work now at least. P.S.: Sorry, fore, was just in the flow of regularly answering here. It was the first time I was not ninja'd myself for a change, I swear! Link to comment Share on other sites More sharing options...
fore Posted August 4, 2011 Share Posted August 4, 2011 So something like this would work? No. At least not when the player does another menumode operation during this time (like inventory) You should restrict this to the "sleepwait" menumode ("begin MenuMode 1012") EDIT: you did it again, drake ... :D Link to comment Share on other sites More sharing options...
Recommended Posts