Show debug msg outside of specific hours.

Post » Fri May 10, 2013 4:59 am

Player has to wait for an actor between the hours of 4 and 6am. Only then does the actor appear - that's all scripted and works. I thought I'd add a simple debug.notification that will display outside of these hours to tell the player to return later. Script compiles but there must be a logic error I can't spot because I get no message and yes I set game hour and setstage the quest before testing. Help appreciated.

Quest Property MyQuest AutoInt Property PreReqStage AutoGlobalVariable Property GameHour AutoActor Property PlayerRef AutoEvent OnTriggerEnter(ObjectReference akActionRef)        If akActionRef == PlayerRef                Float fTime = GameHour.GetValue()If MyQuest.GetStage() == PreReqStage                If fTime < 4.0 && fTime > 6.0 ;show messagedebug.notification("Return between the hours of four and six in the morning.") Else        EndIfEndifEndifEndEvent
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Thu May 09, 2013 5:24 pm

There is a "Light Switch" script in CK with this function:

float Function GetCurrentHourOfDay() global{Returns the current time of day in hours since midnight}     float Time = Utility.GetCurrentGameTime()    Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit    Time *= 24 ; Convert from fraction of a day to number of hours    Return Time EndFunction

The complete script is here: http://www.creationkit.com/Light_Switch

Use that function to calculate the ingame hour.

User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am


Return to V - Skyrim