brightness scripts?

Post » Thu Dec 15, 2016 2:06 am

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?
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Thu Dec 15, 2016 9:53 am

No, but you could move or enable/disable/replace the light source.
For examples you could study mods like illuminated windows, windows glow expansion...
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Thu Dec 15, 2016 9:44 am

enable/disable you say? And that window mod you mentioned should have the code for day/night on and off cycle?
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Wed Dec 14, 2016 9:39 pm

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
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Thu Dec 15, 2016 9:31 am

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 :)
User avatar
Cheryl Rice
 
Posts: 3412
Joined: Sat Aug 11, 2007 7:44 am


Return to III - Morrowind