Daylight
Moderators: Haplo, Lead Developers
Daylight
Just a short script to turn daylight on and off. Add this to a light source and put it near a window for a day/night effect. Or change the Gamehour numbers and put it on a candle or fireplace for the reverse effect.
begin Daylight
if ( Menumode == 1 )
Return
endif
short DayTimer
if ( DayTimer <= 100 )
set DayTimer to ( DayTimer + 1 )
return
endif
set DayTimer to 0
disable
if ( Gamehour >= 6 )
enable
endif
if ( Gamehour >= 19 )
disable
endif
end Daylight
begin Daylight
if ( Menumode == 1 )
Return
endif
short DayTimer
if ( DayTimer <= 100 )
set DayTimer to ( DayTimer + 1 )
return
endif
set DayTimer to 0
disable
if ( Gamehour >= 6 )
enable
endif
if ( Gamehour >= 19 )
disable
endif
end Daylight
-
- Member
- Posts: 21
- Joined: Thu Dec 18, 2003 2:28 pm
- Location: Netherlands
- Contact:
can I just...
Can I just add this script to a light object, and it will work immediately? I'm no scripting expert so I just want to know for sure, I don't want to fok things up...
Olle
Olle
[img]http://forums.slipknotcpd.com/uploads/avvysmll.JPG[/img]
Ever wondered what's it like to die? Take my life, you'll soon find out, I'm dyin' all the time, all the way, every f*ckin' day...
Ever wondered what's it like to die? Take my life, you'll soon find out, I'm dyin' all the time, all the way, every f*ckin' day...
Right. This script is completely straightforward. What actually happens is the script disables the light and checks for the time of day. If it is day it enables the light and if it is night it disables the light;. It has a little timer so that it only checks every few minutes. If you use it with a sound, it should check whether the sound is already on or off to avoid too much repetition.
Last edited by Greybeard on Fri Dec 26, 2003 2:37 pm, edited 1 time in total.
- Kothloth
- Developer Emeritus
- Posts: 886
- Joined: Thu Aug 21, 2003 11:33 am
- Location: Beppu, Japan
- Contact:
Btw, before these scripts are really put to use in our interiors, we should decide if it should be general or not. It would just mess up if some interiors have this and some does not. Though I'd rather see this as a bolt-on, since it was something Bethsoft never made for Vvardenfell. Also, I believe that if we use those kind of scripts, they should be added for the interiors once all are finished, to ensure all interiors use the right method when it comes to this.
-
- Member
- Posts: 21
- Joined: Thu Dec 18, 2003 2:28 pm
- Location: Netherlands
- Contact:
aha...
well...
Thank you for the script...
And may I use the script in my own mod (of course I'll praise you to the heavens in the readme file...)?
Olle
Thank you for the script...
And may I use the script in my own mod (of course I'll praise you to the heavens in the readme file...)?
Olle
[img]http://forums.slipknotcpd.com/uploads/avvysmll.JPG[/img]
Ever wondered what's it like to die? Take my life, you'll soon find out, I'm dyin' all the time, all the way, every f*ckin' day...
Ever wondered what's it like to die? Take my life, you'll soon find out, I'm dyin' all the time, all the way, every f*ckin' day...
Don't interiors with sunlight defined in them already do this?
"Everyone is in favor of free speech. Hardly a day passes without its being extolled, but some people's idea of it is that they are free to say what they like, but if anyone else says anything back, that is an outrage."
-- Winston Churchill
-- Winston Churchill