bencebence Posted August 4, 2011 Author Share Posted August 4, 2011 (edited) Thank you very much. I've modified the script a you told me. I'll test it tomorrow, but I'm sure it'll work. Kudos for both of you ;)Also one more question:I've downloaded the OBSE plugin, soundcomannds. It works, but I have a problem with it. I've added some cell-specific music, like this:scn MyCellMusic Begin GameMode if player.getincell mycellname playmusicfile "Data\Music\MyFolder\MyTrack.mp3 endif endI've set this as a quest script and made a quest. The music "plays" ingame. But not as I wanted. It loops its first about 5 seconds, and nothing else. But if I go into menumode, it plays perfectly. What could be the problem? 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 5 seconds you say? Sounds like what fQuestDelayTime will make your quest wait before starting this script again, which again doesn't have a do-once condition and will start this song over and over each execution. @fore: Yeah, maybe, but I forgot about the MenuMode restriction to 1012. After all I'm using restrictions such as this in my quest scripts as well, because else my scripts would already start during the title menu! This one goes to you. :thumbsup: Link to comment Share on other sites More sharing options...
bencebence Posted August 5, 2011 Author Share Posted August 5, 2011 (edited) I didn't say exactly 5 sec, I didn't count ;DIt just seems to be repeating itself at the begining part. :S I've tried almost everything, even converted to 8 bit version XDStill nothing.But this isn't so important, I can live without the custom music :P EDIT: Also I've just tested the script, and still nothing happens when I sleep in my bed there... I chose to sleep till 10 o'clock, and I slept till 10 o'clock. Nothing happened from 7 to 8 o'clock... :S Edited August 5, 2011 by bencebence Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 5, 2011 Share Posted August 5, 2011 (edited) Well, it doesn't matter how long exactly it takes for the script to be executed again, 5 seconds or whatever. The thing is the script "is" executed again on a regular basis, and each time this happens the "playmusicfile" is called again, making it start over, which is just what you're experiencing. You switching into MenuMode makes the GameMode block of this script no longer being executed, thus the music can play to its end fine. Just put another variable for a do-once condition into there so "playmusicfile" doesn't get called every X seconds over and over.Let's see... scn MyCellMusic short doonce Begin GameMode if player.getincell mycellname if doonce == 0 playmusicfile "Data\Music\MyFolder\MyTrack.mp3" set doonce to 1 endif else set doonce to 0 endif end This way the music will only be started "once" when you enter the cell and every time "again" when you "return" to the cell.That should do. Now what exactly still doesn't work with your other script?Did you put in some debug messages telling you which exact condition is never met?I need to figure out what exactly happens while sleeping, which scripts are still executing at all during this phase and how the player can be woken up at a certain point of time when sleeping.Time to read up some documentations again. edit: Weird, WakeUpPC is not even documented online it appears, nor is it part of the OBSE doc. Glad I got a complete offline reference of all Vanilla scripting functions and every Vanilla script they're used in. If it does exist, then it should be in there. edit2: Well, that much for missing links: http://cs.elderscrolls.com/constwiki/index.php/WakeUpPCSo it does exist and is meant to do exactly that. It's used in 4 Vanilla scripts and it does work in MenuMode, so this is the mode you're in while sleeping. The Dream World Amulet uses this to teleport you into the Dream World and wake you up when you're wearing it. Now let's see if perhaps the restriction to MenuMode 1012 was out of order here. Maybe it's a different mode while actually sleeping than while selecting the timespan?There must be some cause for why it's not working for you along those lines. It does work in a Vanilla script the same way after all. edit3: Hmm, ok, MenuMode 1012 is fine here, as there are scripts using this together with "IsTimePassing" or "IsPCSleeping" to distinguish between actual sleeping/waiting or just having the timespan selection window open. Now to check what GameHour does while sleeping. There is no Vanilla script so far using the time of day as a condition to wake you up, so I don't know if GameHour even increments while sleeping. edit4: Well, in Hackdirt Moslinn's Inn on the bed there's a script which checks for GameHour "while" IsPCSleeping == 1. So GameHour has to advance while sleeping.Now I really need the current state of the script and the results of the debug outputs checking which condition is met and which isn't. Or I will have to implement the whole concept myself to do the debugging next. Edited August 5, 2011 by DrakeTheDragon Link to comment Share on other sites More sharing options...
WarRatsG Posted August 5, 2011 Share Posted August 5, 2011 edit3: Hmm, ok, MenuMode 1012 is fine here, as there are scripts using this together with "IsTimePassing" or "IsPCSleeping" to distinguish between actual sleeping/waiting or just having the timespan selection window open. Now to check what GameHour does while sleeping. There is no Vanilla script so far using the time of day as a condition to wake you up, so I don't know if GameHour even increments while sleeping. To find out you could use a seperate script first, just for debug purposes. Short DoOnce Begin MenuMode 1012 If IsPCSleeping If DoOnce == 0 Set Time to GameHour Print $time Set DoOnce to 1 endif If DoOnce == 1 If Time != GameHour Print $Time endif endif EndIf End That would tell you if GameHour Advances. FYI "Print" just puts whatever you are printing into the console. If you have SteamLine you may need to use PageUp or PageDown to hunt for your magic var. Link to comment Share on other sites More sharing options...
bencebence Posted August 5, 2011 Author Share Posted August 5, 2011 (edited) Sorry, I wasn't at home.I know that (from yesterday testing) that the first if (getincell) always show up during sleep. I'll try the time one too after lunch. Thanks for your help :D EDIT: Made the script, and after I stopped sleeping it shows this number: 3,96081 Edited August 5, 2011 by bencebence Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 5, 2011 Share Posted August 5, 2011 It only shows this once, not a couple times in a row?Maybe this quest script would be better suited to test the matter, although the fact it is done so in this Hackdirt script I mentioned should already be answer enough: float fQuestDelayTime Begin MenuMode 1012 set fQuestDelayTime to 0.01 ;a really short update frequency, not only every 5 or 15 seconds as is default if IsPCSleeping > 0 print $GameHour ;hope this works, if not, use 'set time to GameHour' and 'print $time' instead endif End Now go sleep a couple hours, maybe even a whole day. It should give you a "list" of increasing time values in your console after this. No rushing, and no need to apologize. It's not us waiting for your feedback, but you waiting for our's, after all. Link to comment Share on other sites More sharing options...
fg109 Posted August 5, 2011 Share Posted August 5, 2011 @bencebence I think the problem was you put "WakeUpPC" before setting the awaken variable. I just tested this and it worked: scriptname testquestscript float fquestdelaytime short awaken string_var debug Begin GameMode if (fquestdelaytime != 0.1) let fquestdelaytime := 0.1 endif if (awaken) let awaken := 0 Message "Everything works correctly." endif End Begin MenuMode 1012 if (IsPCSleeping) let debug := "Sleeping" if (Player.GetInCell ICWaterfrontShackForSale) let debug += " at Waterfront" if (GameHour >= 7) && (GameHour <= 8) let debug += " between 7 and 8 am." PrintC "%B%z%b" debug let awaken := 1 WakeUpPC else let debug := sv_Construct "%z at %.2f." debug GameHour PrintC "%B%z%b" debug endif endif endif End Link to comment Share on other sites More sharing options...
bencebence Posted August 5, 2011 Author Share Posted August 5, 2011 Alright, now it shows lots of numbers, from 0.4946 to 23.4946 each number like this, (1.4946, 2.4946 and so on) each one multiple times. (one number fills the whole console) Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted August 5, 2011 Share Posted August 5, 2011 Exactly what I expected. So that's our proof GameHour "does" change while sleeping and the checking condition should work. And yes, I forgot that "WakeUpPC" could indeed act as a "return", breaking execution of the script at this point, making the "set aweken to 1" never execute.How I could miss something as obvious as this is beyond me. But making the WakeUpPC happen as the last thing inside this condition will at least fix this now. If it's still not working then, post your current script again, so we can have another look. Link to comment Share on other sites More sharing options...
Recommended Posts