Page 1 of 1

brightness scripts?

PostPosted: Thu Dec 15, 2016 2:06 am
by Charlotte Henderson
Is it possible to have the lightbulb thingies from the light tab have a script to change the brightness from say 0 to 50? If so can it be changed to happen depending the time of day? How would that script go?

brightness scripts?

PostPosted: Thu Dec 15, 2016 9:53 am
by Jade MacSpade
No, but you could move or enable/disable/replace the light source.
For examples you could study mods like illuminated windows, windows glow expansion...

brightness scripts?

PostPosted: Thu Dec 15, 2016 9:44 am
by Melanie Steinberg
enable/disable you say? And that window mod you mentioned should have the code for day/night on and off cycle?

brightness scripts?

PostPosted: Wed Dec 14, 2016 9:39 pm
by Darren
some examples, optimized for speed
begin ab01SetNightTimeScript

; 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

local scripts meant to be attached to each object to enable/disable depending on NightTime
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

brightness scripts?

PostPosted: Thu Dec 15, 2016 9:31 am
by Cheryl Rice
Ok so the top script checks if its night time or not And the bottom one says what happens when the top turn out to be false/true? Ok Im going to be free thursday and apply this to my light fixture.

Thanks a lot :)