Jump to content

Detecting dawn?


Recommended Posts

Although I am an experienced developer, I'm still at the 'use other mods as starting points' stage with VS. How would I access ephemeris data to detect if it's dawn yet? Is there a day/night flag somewhere or a sun position value I can access through the API? Since the day/night cycle varies with latitude, I assume this would be a local value to my current position.

TIA

Link to comment
Share on other sites

22 hours ago, idiomcritter said:

discord any better on response?

Discord came through! I now have a prototype mod to wake at dawn. A bit hacky but it seems to work for single player. Need multiplayer on servers too though..

Edited by Malnaur
  • Like 1
Link to comment
Share on other sites

Hello, maybe this class can help you https://github.com/anegostudios/vsapi/blob/9bf26b71970ff2168d6f8534cf6ee4a914087511/Common/API/IGameCalendar.cs#L49 and where its implemented and used here https://github.com/anegostudios/vsapi/blob/9bf26b71970ff2168d6f8534cf6ee4a914087511/Client/API/IClientWorldAccessor.cs#L79 so you load it like here:

IClientWorldAccessor clientWorld = (IClientWorldAccessor)Api.World;

Good luck!

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.