Using OnUpdateGameTime wo player interaction

Post » Fri May 09, 2014 12:39 pm

To put it more clearly. For a while now I've wanted "things" to update in-game without the player having to cause an event. Example - I have a horse and cart, from 8am to 8pm I want the cart to be seen full of boxes, sacks, clutter, etc but after 8pm I want the cart to be seen as empty (the dockers have gone to the tavern for a drink, work is over). I have attached the cart load to a xmarker parent. Now in the past I have enabled/disabled objects, markers, things by the player causing an event, OnTriggerEnter, OnActivate, etc...enable/disable - relevant objects/markers. This is fine but requires the player to do something. I want that, in my example, that it doesn't matter where the player is or what the player is doing the cart load will update, enable/disable by itself. I wrote this script, haven't compiled it yet because I can see the flaw in it - what is the cause/reason for update?

ObjectReference Property Marker1 Autofloat Function GetCurrentHourOfDay()float Time = Utility.GetCurrentGameTime()Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bitTime *= 24 ; Convert from fraction of a day to number of hoursReturn TimeEndFunction	Event OnUpdateGameTime()   float curHour = GetCurrentHourOfDay()   if (curHour > 8.0 || curHour < 20.0)  ; day          Marker1.Enable()                else  ; nightMarker1.Disable()          endif     endifEndEvent

Logically the script seems sound but how will it update? It has to repeat itself continuously in order to enable/disable the cart load without the player doing anything.

Thanks for looking.

User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm

Return to V - Skyrim