Table of Contents

Day and Night Cycles

Reviewed For: SDK 2.1

Scenario Day and Night Cycles can be manipulated through the SDK. Day and Night settings should be set in the InitProc() function and have three different basic settings.

Setting Day only will remove advantage of disabling unit lights for stealth.

If you wish to indicate little time is passing during the scenario, consider setting to Day only or prevent Day/Night from cycling over time.

Useful Functions

TethysGame

static void __fastcall SetDaylightEverywhere(int bOn);
static void __fastcall SetDaylightMoves(int bOn);

GameMap

static void __fastcall SetInitialLightLevel(int lightPosition);

Effects of Day/Night on the Blight

The blight moves significantly slower during night conditions. During a multiplayer scenario, allowing the players to turn off day/night will allow the blight to expand much more rapidly than leaving a day/night cycle on. Consider disabling allowing the players to turn off day/night in multiplayer scenarios with the blight.

Checking for Day/Night for Multiplayer

For multiplayer games, use the function UsesDayNight to check if players desire day/night cycles.

From TethysGame
static int __fastcall UsesDayNight();

Sample Code

For a multiplayer scenario, setting day/night based on user input.

int InitProc()
{
    TethysGame::SetDaylightEverywhere(0);
    TethysGame::SetDaylightMoves(1);
 
    if (TethysGame::UsesDayNight() == 0)
    {
        TethysGame::SetDaylightEverywhere(1);
    }
}

- Go Back to Programming a Scenario
- Go Back to Outpost 2 Mapmaking
- Go Back to Outpost 2 Main page
- Go Back to Wiki Home Page