# Set Day Length
Grammar — Set day length to length game seconds
Flags —Native
|Action
Sets the amount of game time it will take to cycle through 24 hours of time of day.
# Arguments
fixed
— Length
Returns — void
native void GameTimeOfDaySetLength(fixed inSecs);
# Related
Category: Environment / Lighting
- Game Day/Night State Change —
void
— TriggerAddEventGameTimeEvent - Set Lighting —
void
— GameSetLighting - Set Lighting For Player —
void
— PlayerSetLighting - Set Time Of Day —
void
— GameTimeOfDaySet - Set Time Of Day (Seconds) —
void
— GameTimeOfDayValueSet - Set Time Of Day (Hours, Minutes, Seconds) —
void
— GameTimeOfDayTimeValueSet - Set Time of Day Lighting —
void
— GameSetToDLighting - Set Time of Day Lighting For Player —
void
— PlayerSetToDLighting - Set Day Length —
void
— GameTimeOfDaySetLength - Pause/Unpause Time Of Day —
void
— GameTimeOfDayPause - Triggering Day/Night State —
int
<preset::DayNightEventType> — EventGameTimeEvent - Current Time Of Day —
string
<timeofday> — GameTimeOfDayGet - Current Time Of Day (Seconds) —
int
— GameTimeOfDayValueGet - Current Day/Night State —
int
<preset::DayNightEventType> — GameTimeOfDayCurrentTimeEvent - Day Length —
fixed
— GameTimeOfDayGetLength - Time Of Day Is Paused —
bool
— GameTimeOfDayIsPaused
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson01.sc2map/MapScript.galaxy:6248
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
auto68A85F2C_g = UnitGroup(null, gv_p1_USER, null, UnitFilter(0, 0, 0, 0), 0);
auto68A85F2C_u = UnitGroupCount(auto68A85F2C_g, c_unitCountAll);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thanson02.sc2map/MapScript.galaxy:682
GameTimeOfDaySet("12:00:00");
GameTimeOfDayPause(true);
GameTimeOfDaySetLength((gv_dAY_DURATION + gv_nIGHT_DURATION));
return true;
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/thorner01.sc2map/MapScript.galaxy:5826
UnitClearSelection(gv_pLAYER_01_USER);
PlayerSetState(gv_pLAYER_01_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
GameSetBackground(c_backgroundFixed, "BelShirSkyBox", 100.0);
AITimePause(true);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/traynor03.sc2map/MapScript.galaxy:731
GameTimeOfDaySet("18:00:00");
GameTimeOfDayPause(true);
GameTimeOfDaySetLength(140.0);
VisRevealerCreate(gv_pLAYER01_USER, RegionCircle(UnitGetPosition(UnitFromId(258)), 6.0));
VisRevealerCreate(gv_pLAYER01_USER, RegionFromId(15));
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/ttosh01.sc2map/MapScript.galaxy:5041
libNtve_gf_GlobalCinematicSetting(true);
PlayerSetState(gv_p01_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
TimerPause(gv_lavaTimer, true);
UnitClearSelection(gv_p01_USER);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/ttosh03a.sc2map/MapScript.galaxy:5233
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
UnitPauseAll(true);
AITimePause(true);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/ttychus02.sc2map/MapScript.galaxy:5660
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
GameSetBackground(c_backgroundFixed, "XilSkybox", 100.0);
libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(UnitGroupUnit(UnitGroup("XelNagaTemple", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1)), c_animNameDefault, "Stand D End", c_animFlagPlayForever, c_animTimeDefault);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson01.sc2map — MapScript.galaxy:6248
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
auto68A85F2C_g = UnitGroup(null, gv_p1_USER, null, UnitFilter(0, 0, 0, 0), 0);
auto68A85F2C_u = UnitGroupCount(auto68A85F2C_g, c_unitCountAll);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson02.sc2map — MapScript.galaxy:682
GameTimeOfDaySet("12:00:00");
GameTimeOfDayPause(true);
GameTimeOfDaySetLength((gv_dAY_DURATION + gv_nIGHT_DURATION));
return true;
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner01.sc2map — MapScript.galaxy:5826
UnitClearSelection(gv_pLAYER_01_USER);
PlayerSetState(gv_pLAYER_01_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
GameSetBackground(c_backgroundFixed, "BelShirSkyBox", 100.0);
AITimePause(true);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/traynor03.sc2map — MapScript.galaxy:731
GameTimeOfDaySet("18:00:00");
GameTimeOfDayPause(true);
GameTimeOfDaySetLength(140.0);
VisRevealerCreate(gv_pLAYER01_USER, RegionCircle(UnitGetPosition(UnitFromId(258)), 6.0));
VisRevealerCreate(gv_pLAYER01_USER, RegionFromId(15));
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh01.sc2map — MapScript.galaxy:5041
libNtve_gf_GlobalCinematicSetting(true);
PlayerSetState(gv_p01_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
TimerPause(gv_lavaTimer, true);
UnitClearSelection(gv_p01_USER);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh03a.sc2map — MapScript.galaxy:5233
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
UnitPauseAll(true);
AITimePause(true);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttychus02.sc2map — MapScript.galaxy:5660
UnitClearSelection(gv_p1_USER);
PlayerSetState(gv_p1_USER, c_playerStateXPGain, false);
GameTimeOfDaySetLength(0.0);
GameSetBackground(c_backgroundFixed, "XilSkybox", 100.0);
libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(UnitGroupUnit(UnitGroup("XelNagaTemple", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1)), c_animNameDefault, "Stand D End", c_animFlagPlayForever, c_animTimeDefault);
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:987
GameTimeOfDayPause(false);
GameTimeOfDaySetLength(480.0);
return true;
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:1061
GameTimeOfDaySet("00");
GameTimeOfDaySetLength(libGAwX_gv_dayLenth);
DialogControlHookupStandard(c_triggerControlTypePortrait, "UIContainer/ConsoleUIContainer/GameTODIndicator");
libGAwX_gv_c_PortraitTimeOfDayFrame = DialogControlLastCreated();