Freedom Reborn Archive

Freedom Force Forums => Mods => Topic started by: bearded on December 31, 2007, 04:43:34 PM

Title: ffx day and night
Post by: bearded on December 31, 2007, 04:43:34 PM
is this the proper code?
FFX_Sun(50,50,0.5,0.9,(0.5,0.8,1))
if so, which of those numbers is the light factor?  i'm wanting to have a script that progresses the day during the mission.  brighter and brighter, then darker, and so on.
Title: Re: ffx day and night
Post by: Conduit on December 31, 2007, 08:49:33 PM
My stutter package (http://freedomreborn.net/archive/index.php?topic=42119.0) includes a function named Mission_Sunlight_Shift that gradually changes the sunlight values over a set period of time.  You can use that to make it gradually get brighter, then use regTimer to trigger a function that makes it gradually darker, and so on.
Title: Re: ffx day and night
Post by: bearded on January 01, 2008, 04:32:28 AM
wonderfull!
now i just have to work my head around it.
would this let nocturnal attribute work properly when it is dark?  or is nocturnale more of a check when the mission begins only?
Title: Re: ffx day and night
Post by: Conduit on January 01, 2008, 09:07:32 AM
From looking at FFX, it appears that Nocturnal does update itself every second, so it should still work.  As does Solar Powered.
Title: Re: ffx day and night
Post by: HumanTon on January 01, 2008, 09:18:16 AM
To answer the question about what the numbers mean, the four values are:

1) rotation:   Sun rotation angle from north in degrees: +ve is east (-45)
2) tilt:      Sun tilt from horizontal in degrees: +ve is down (45)
3) brightness:   Intensity of sunlight (0=none to 1=full)
4) ambient:   Intensity of ambient light (0=none to 1=full)
5) color:      3-Tuple,  red, green, blue values (all are 0 to 1)

The light factors are 3) and 4). Item 3) controls the intensity of the directional light from the sun, while 4) controls the ambient "light from nowhere." So to set up a dark cave you'd set 3) to zero, but then set 4) to some value high enough to let you see what the heck is going on.