MimiTheAlchemist Posted June 12, 2014 Share Posted June 12, 2014 I have recently released a mod that allows the player to pay court wizardsto fill soul gems. It works great, but now I want to add a feature in whichyou can customize the days you want to wait until you can come back and pick them up. So, i have two questions. 1. How do you make dialog show up after a number of days have passed? I plan on using a global (waittime) for the chosen amount of days the user of my mod wants to wait. 2. Will this cause any problems when the player asks another court wizard to fill their soul gems? I'd really appreciate any help on this subject since timing dialog issomething I have never tried before. Link to comment Share on other sites More sharing options...
lofgren Posted June 12, 2014 Share Posted June 12, 2014 There is a global called GameDaysPassed. You can capture the current day in a global variable that is stored in the quest add the number of days you want the player to wait, then compare it to GameDaysPassed using the conditional function GetGlobalValue or by script. If the value is greater than GameDaysPassed then the dialogue option will appear. If it is less, then the dialogue option will not. Link to comment Share on other sites More sharing options...
icecreamassassin Posted June 12, 2014 Share Posted June 12, 2014 Another way to do it if you are using repeatable quest stages as a handler, you can have the stage for "starting the work" have a Utility.WaitGameHours(#) line followed by a setstage to the next quest stage for the " work done" which is handy because you can have the quest status pop up as a reminder that the work is done. This is also a little less confusing than having to poll and set the current gamedayspassed into int values and globals and then having to compare them. Another nice thing if you do want to customize the amount if time in game, you could have several pairs of start work/end work stages for various wait times and basically trigger them with dialog options Link to comment Share on other sites More sharing options...
icecreamassassin Posted June 12, 2014 Share Posted June 12, 2014 One thing to keep in mind is you can't use WaitGameHours in the dialog itself, you should use it on the quest stage fragment, otherwise the npc locks you in dialog for that set amount of time Link to comment Share on other sites More sharing options...
lofgren Posted June 12, 2014 Share Posted June 12, 2014 That is absolutely NOT a good way to do it. waitgamehours pauses the script and doesn't let it continue processing. If you want to do it using quest stages you should use registerforupdategametime(). Still I recommend the global as it uses the least script resources. To customize it you would just change the float value that you add to game time. You could also use the globalvariable to add a quest goal for the player that says "Pick up your soul gems on (XYZ day)." Link to comment Share on other sites More sharing options...
MimiTheAlchemist Posted June 12, 2014 Author Share Posted June 12, 2014 Thank you for all of your help. It's hard trying to do something youhaven't done before on a mod with little help from online tutorials. Link to comment Share on other sites More sharing options...
lofgren Posted June 12, 2014 Share Posted June 12, 2014 There are two sample scripts on th CSwiki using the RegisterforGameTimeUpdate method. Link to comment Share on other sites More sharing options...
icecreamassassin Posted June 13, 2014 Share Posted June 13, 2014 On 6/12/2014 at 4:39 PM, lofgren said: That is absolutely NOT a good way to do it. waitgamehours pauses the script and doesn't let it continue processing. If you want to do it using quest stages you should use registerforupdategametime(). Still I recommend the global as it uses the least script resources. To customize it you would just change the float value that you add to game time. You could also use the globalvariable to add a quest goal for the player that says "Pick up your soul gems on (XYZ day)."Well it really depends on what exactly you are trying to accomplish. I use it for several functions and I see no considerable slow down due to script load, and this is coming from within a cell that has over 200 display activators, so I wouldn't discount someone's viable suggestion on the grounds that there may be other better ways of doing it. I was merely suggesting a way that I have accomplished similar tasks Link to comment Share on other sites More sharing options...
lofgren Posted June 13, 2014 Share Posted June 13, 2014 You should avoid utility.wait and utility.waitgamehours for any appreciable amount of time. This kind of thing is exactly what registerforupdategametime is designed for. It's not just about script resources, it also means that the script cannot continue processing. The purpose of these functions is to prevent your script from doing anything for a short period of time, which is slightly but meaningfully different from telling your script to do something specific in two day's time. It's the difference between telling your troops, "Don't do anything until I give the word" vs. "If I'm not back in two days, come rescue me." It's not that the function has no use, it's just that you don't want your script idling for two days anymore than you want to leave your car idling for two days. Link to comment Share on other sites More sharing options...
Recommended Posts