begin ab01SetNightTimeScriptlocal scripts meant to be attached to each object to enable/disable depending on NightTime
; global autostart script, it allows local scripts to make fewer checks on a global short NightTime variabkle instead of checking multiple times the global float GameHour variable
if ( NightTime ) ; NightTime is a global short variable
if ( GameHour > 20 ) ; GameHour is a global float variable set by the engine e.g. 13.25 = 13:15
return
endif
if ( GameHour < 7 )
return
endif
set NightTime to 0
return
endif
if ( GameHour > 20 )
set NightTime to 1
return
endif
if ( GameHour < 7 )
set NightTime to 1
endif
begin max_win_dis_01
DontSaveObject ; skip saving object to avoid cluttering save as object state is checked real-time each frame
if ( NightTime )
if ( GetDisabled )
return
endif
disable ; disable interior illuminated window at night
return
endif
if ( GetDisabled )
enable ; enable at day
endif
end
begin max_win_dis_02
DontSaveObject
if ( NightTime )
if ( GetDisabled )
enable ; enable exterior illuminated window at night
endif
return
endif
if ( GetDisabled )
return
endif
disable ; disable at day
end