Jump to content

Returning the time of day and game days passed in a script.


TheElderInfinity

Recommended Posts

In the Creation Kit wiki, the statement

 

float timeOfDay = TimeOfDayGlobalProperty.GetValue()

 

is said to return the time of day when inserted into a function, on the page http://www.creationkit.com/GetValue_-_GlobalVariable

 

Unfortunately, it seems that I'm either using it wrong, or someone at Bethesda done goofed, since the compiler keeps telling me that "variable TimeOfDayGlobalProperty is undefined" in spite of what the wiki says.

 

I'm also interested in creating a property or variable that returns the number of days that have passed since the start of the game...Any insight on that?

 

 

 

Any help would be greatly appreciated!

 

 

TheElderInfinity

Link to comment
Share on other sites

I believe it is necessary to instantiate a global variable first at the top of your script (if you haven't done so). The wiki uses your line of code as example of a greater piece of code where the "TimeOfDayGlobalProperty" is a defined datatype. I haven't tried any scripting yet, but looking at a standard script I think you may need this at the top of your script:

 

GlobalVariable Property TimeOfDayGlobalProperty auto

 

Let me know if that works. :sweat:

Link to comment
Share on other sites

Excellent. It worked for the TimeOfDayGlobalProperty, though not the GameDaysPassed, of course, that might be because GameDaysPassed isn't the right global. Or not. Just checked in SkyEdit and it is. Edited by TheElderInfinity
Link to comment
Share on other sites

  • Recently Browsing   0 members

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