Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Tolwyn on May 03, 2009, 12:02:40 pm

Title: Request: SEXP to change ambient lighting
Post by: Tolwyn on May 03, 2009, 12:02:40 pm
I'd like to request a new feature: a SEXP to change ambient lighting (or star count) during a mission.

Right now it is already possible to set ambient lightning (level/color) in FRED. Default value is RGB=120, 120, 120, I believe. So a system with red nebulas and blue sun, would have rather red ambient lighting while the direct light is still the blue one from the sun. Now, missions which include jumping from one system to another are a problem. It is possible to change background bitmaps, suns and skyboxes, but not lighting (or star count for that matter).

It would greatly enchance visual quality if such a SEXP would be added. ;) Otherwise we would have to use basic white ambient light for all star systems (since otherwise jumping to a different system doesn't work).
Title: Re: Request: SEXP to change ambient lighting
Post by: karajorma on May 03, 2009, 02:59:42 pm
I've not looked at the code but the only problem I see with this one is if the light levels are processes in some way at the start of the mission and then the game uses the processed version.

Otherwise we're looking at 10 minutes work. I have to test another feature in multiplayer tomorrow anyway so I'll kill two birds and take a look at this one at the same time.
Title: Re: Request: SEXP to change ambient lighting
Post by: Tolwyn on May 03, 2009, 03:54:12 pm
Thanks. Much appreciated. ;)
Title: Re: Request: SEXP to change ambient lighting
Post by: KeldorKatarn on May 03, 2009, 04:47:30 pm
I've not looked at the code but the only problem I see with this one is if the light levels are processes in some way at the start of the mission and then the game uses the processed version.

I doubt that's the case.. I mean you can add and remove suns during a mission. So you change the specular ligth color and light sources. I see no real reason why then you shouldn't be able to change ambient color as well. I haven't looked at the code yet but I'm pretty sure that shouldn't be a problem.

If you do this you might also want to add a SEXP to change the star count. Saga doesn't use this but I'm sure other mods might appreciate the ability to change that also during a mission.
Title: Re: Request: SEXP to change ambient lighting
Post by: karajorma on May 03, 2009, 06:08:59 pm
I doubt it's the case either. But it's the only way I could see the SEXP being a problem.
Title: Re: Request: SEXP to change ambient lighting
Post by: karajorma on May 08, 2009, 01:37:57 pm
Turned out in the end that it was indeed calculated at mission start and never touched again. That probably doubled the time it took me to make it work (although that was still only 20 minutes) :D

I've just posted a build which supports this in recent builds (http://www.hard-light.net/forums/index.php/topic,62830.new.html#new) but WCS might have another reason for checking it out. :D
Title: Re: Request: SEXP to change ambient lighting
Post by: Tolwyn on May 09, 2009, 10:27:20 am
Sweet. I feel like a sack full full of potatoes at the moment, but I will try it out tomorrow. ;)