trepleen Posted March 23, 2015 Posted March 23, 2015 I'm creating a super, super basic way to keep track of when a companion has bathed. I found this very useful: http://www.creationkit.com/RegisterForSingleUpdateGameTime_-_Form Function SomeFunction() ;after 24 in game hours fire the onupdategametime event RegisterForSingleUpdateGameTime(24) endFunction Event OnUpdateGameTime() ; because of how we registered, this event occurs every 30 minutes of game time ;note: this event triggers one time and then unregisters ;notify player than 24 in game hours have passed debug.messagebox("24 in game hours have passed") ;do what you want here endEvent
Guest Posted March 23, 2015 Posted March 23, 2015 If you want EVERY tot amount of game hours then you should do something like: Function InitFunction() RegisterForSingleUpdateGameTime(24.0) ;after 24 in game hours fire the onupdategametime event endFunction Event OnUpdateGameTime() ; because of how we registered, this event occurs every 30 minutes of REAL time (24 hours game time) ;notify player than 24 in game hours have passed debug.messagebox("24 in game hours have passed") ;do what you want here ;note: this event triggers one time and then unregisters, so you have to register it again. RegisterForSingleUpdateGameTime(24.0) endEventBut better to check if you have still to do the job, or your script will run forever also if you uninstall the mod. Boolean Property doTheJob Auto Function InitFunction() doTheJob = True RegisterForSingleUpdateGameTime(24.0) ;after 24 in game hours fire the onupdategametime event endFunction Function stopFunction() doTheJob = False UnregisterForUpdateGameTime() endFunction Event OnUpdateGameTime() ; because of how we registered, this event occurs every 30 minutes of REAL time (24 hours game time) ;notify player than 24 in game hours have passed debug.messagebox("24 in game hours have passed") ;do what you want here if (doTheJob) ;note: this event triggers one time and then unregisters, so you have to register it again. RegisterForSingleUpdateGameTime(24.0) endIf endEvent
mimichacha Posted March 23, 2015 Posted March 23, 2015 Mark. I'm planning a mod, this post might come in handy.
Kinky Posted March 23, 2015 Posted March 23, 2015 Its nice that you are making scripting tutorials. By the way is there a tutorial about how to setup everything so you can start scripting?
trepleen Posted March 24, 2015 Author Posted March 24, 2015 Its nice that you are making scripting tutorials. By the way is there a tutorial about how to setup everything so you can start scripting? I made this tutorial a long time ago. http://www.loverslab.com/topic/35451-sexlab-creation-kit-tutorial-for-beginners-make-actor-play-animations/ That should get you setup where you can start pasting script fragments to dialogue options. CPU, I appreciate that, good code!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.