Author Topic: Script for lights  (Read 1303 times)

Lougian

  • Modder Acolyte
  • ***
  • Posts: 53
  • Karma: +7/-0
    • View Profile
Script for lights
« on: July 30, 2015, 05:33:33 AM »
Hello,

I don't know if this is the right place to post this, but I didn't know where to ask this.
Can anyone who know how to make script do one for me ? I have put some lights to the exterior of my house, but I would like them to be on only during night, because it looks weird during day.
Here's how my house look during day :



As you can see, it doesn't look very good, so if someone can do a script for this, I would be very happy ! :)
Thanks in advance and sorry if this is not the right place.

Moritius

  • Community Secretary
  • ****
  • Posts: 168
  • Karma: +13/-0
  • I'm watching you...
    • View Profile
Re: Script for lights
« Reply #1 on: July 30, 2015, 06:18:54 AM »
You mean those window-looking things, right? Create another non lighting as activator and attach those scripts:

Code: [Select]
begin script_name_no_lighting

;attach this script to activator

short disable_state

if ( GameHour >= 6 ) ;atm I'm not sure when day begins
if ( GameHour < 21 )
if ( disable_state == 0 )
Enable
set disable_state to 1
endif
endif
endif

if ( GameHour >= 21 )
if ( GameHour < 6 )
if ( disable_state == 1 )
Disable
set disable_state to 0
endif
endif
endif

end


Code: [Select]
begin script_name_lighting

;attach this script to light

short disable_state

if ( GameHour >= 6 )
if ( GameHour < 21 )
if ( disable_state == 0 )
Disable
set disable_state to 1
endif
endif
endif

if ( GameHour >= 21 )
if ( GameHour < 6 )
if ( disable_state == 1 )
Enable
set disable_state to 0
endif
endif
endif

end


Not tested but should work. I'm not 100% sure because I don't write this type script for eons :D.
"Grammar, the difference between knowing your shit and knowing you're shit"

Lougian

  • Modder Acolyte
  • ***
  • Posts: 53
  • Karma: +7/-0
    • View Profile
Re: Script for lights
« Reply #2 on: August 01, 2015, 11:23:55 AM »
Thanks a lot, I will test it as soon as I can and will tell you if it works. :)