Changing the time of day

Post » Tue Aug 06, 2013 11:52 am

Hello, I am new to the forum and I am currently working on a new mod that allows the player to travel using ships in Skyrim.

I am wanting to advance the current hour of day so that it simulates the passing of time for the travel by ship.

My current script which I have intended to advance the time 6 hours.

GlobalVariable Property GameHour  autoInt Property newhour auto  float myhour = GameHour.Getvalue()newhour == ((myhour) +6)GameHour.Setvalue(newhour)
The result I get from this script is causing the time to always change to 12:00 am
I would appreciate any help.
Thanks
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Tue Aug 06, 2013 3:36 pm

It's likely because of the double equal sign ("=="). That's used for testing equality, not for assigning a value to a variable. Instead try

float myhour = GameHour.Getvalue()newhour = ((myhour) +6)GameHour.Setvalue(newhour)
Or perhaps more simply:

float myhour = GameHour.Mod(6.0)
User avatar
louise tagg
 
Posts: 3394
Joined: Sun Aug 06, 2006 8:32 am

Post » Tue Aug 06, 2013 10:16 am

Thanks, so much! You're awesome! :D

This code worked:

float myhour = GameHour.Mod(6.0)
User avatar
Joe Alvarado
 
Posts: 3467
Joined: Sat Nov 24, 2007 11:13 pm


Return to V - Skyrim