====== 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. ===== 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 [[op2_sdk:programming_scenario_dlls|Programming a Scenario]]//\\ - //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Mapmaking]]//\\ - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\ - //Go Back to [[http://wiki.outpost2.net/doku.php?id=start|Wiki Home Page]]//