Jump to content

Papyrus script help plz!


Osheanity

Recommended Posts

I'm creating a mod and I want it to start at a certain time of day (hour), I've searched the creation kit wiki for the correct script fragment but I can't find it.

I want the script to go in the quest stage papyrus fragment section I know how to start the quest I just need that line of code.

If ??????
SetStage (5) 
SetObjectiveDisplayed (5)

EndIf

Thanks for your help! :biggrin:

Link to comment
Share on other sites

You have to calculate out the hour from the current game time (number of days passed in game). Fortunately, I have that already in my clock hot key mod. The below *should* work for your needs. Not tested.

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
Int Hour = (Time as Int)
If Hour == X
  SetStage(5)
SetObjectiveDisplayed(15)

EndIf

Replace X with the numerical value that you want the time of day to be as expressed in hours 0 thru 24. It will be valid at any point within that hour, so you may wish to have some other check in place such as stage value so that the fragment does not run prematurely or try to run a second time.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...