Daylight

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
User avatar
Greybeard
Member
Posts: 431
Joined: Thu Aug 21, 2003 11:07 am
Location: Shanarra
Contact:

Daylight

Post by Greybeard »

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
Mindbasher
Member
Posts: 21
Joined: Thu Dec 18, 2003 2:28 pm
Location: Netherlands
Contact:

can I just...

Post by Mindbasher »

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
[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...
User avatar
Greybeard
Member
Posts: 431
Joined: Thu Aug 21, 2003 11:07 am
Location: Shanarra
Contact:

Post by Greybeard »

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.
User avatar
Kothloth
Developer Emeritus
Posts: 886
Joined: Thu Aug 21, 2003 11:33 am
Location: Beppu, Japan
Contact:

Post by Kothloth »

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.
User avatar
Greybeard
Member
Posts: 431
Joined: Thu Aug 21, 2003 11:07 am
Location: Shanarra
Contact:

Post by Greybeard »

Guess I should've mentioned it: if you use a script on an existing object, please rename it. Otherwise everywhere in the world, that object will have the same behavior. And we definitely would not want that.
Mindbasher
Member
Posts: 21
Joined: Thu Dec 18, 2003 2:28 pm
Location: Netherlands
Contact:

aha...

Post by Mindbasher »

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
[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...
User avatar
Greybeard
Member
Posts: 431
Joined: Thu Aug 21, 2003 11:07 am
Location: Shanarra
Contact:

Post by Greybeard »

Use it; modify it; by looking at it a bit, you should be able to write your own. And save the praise for the One who lives in the heavens. We're all here to help each other.
User avatar
Veet
Developer Emeritus
Posts: 328
Joined: Thu Aug 21, 2003 10:54 am
Location: Oregon

Post by Veet »

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
Eraser
Developer Emeritus
Posts: 1377
Joined: Thu Aug 21, 2003 10:53 am
Location: New York

Post by Eraser »

if they do, it only makes the entire cell brighter not just around the windows.
"There is no dark side of the moon really. Matter of fact, it's all dark."
User avatar
Sniper4
Developer Emeritus
Posts: 1015
Joined: Wed Nov 12, 2003 2:48 am
Location: US

Post by Sniper4 »

lol, and the difference in light seems completely unnoticeable. At least to me it is.
Anonymous

Post by Anonymous »

Would there be any lag in using this script for all the windows in a city or town?
User avatar
Greybeard
Member
Posts: 431
Joined: Thu Aug 21, 2003 11:07 am
Location: Shanarra
Contact:

Post by Greybeard »

No, because it would run only if the Player enters a particular interior cell. For a demonstration, try building #18 in Bal Oyra. You should see quite a difference (like night and day :] ) as the time passes.
User avatar
Rishanor
Member
Posts: 22
Joined: Thu Aug 21, 2003 11:23 am
Location: The Netherlands
Contact:

Post by Rishanor »

I believe there was someone on the official forums that added 5 light-sources to every window to simulate daylight shining through. Through those 5 points, he could simulate twilight etc as well, although I don't believe he included weather effect (more twilight-effect when raining).
Locked