op2_sdk:dayandnight

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.

  • Day/Night cycles over time
  • Day only for the duration of the scenario
  • Day/Night cycle is set at a specific time of day for the duration of the scenario

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.

TethysGame

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

GameMap

static void __fastcall SetInitialLightLevel(int lightPosition);

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.

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

From TethysGame
static int __fastcall UsesDayNight();

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

  • op2_sdk/dayandnight.txt
  • Last modified: 2016/10/12 21:32
  • by 127.0.0.1