Jump to content
Sign in to follow this  
breeze

lighting issues

Recommended Posts

I am trying to achieve good lighting within a mission

I have a map night time setting and tried to light it up with buildings on fire by particle effects and while it looks good it does not give off any ambient light.

I tried to hide camp fires irt works but then the grass starts to look fake and shitty

So I tried to use street lamps I shut them off with the

Sitch light.sqs and they shut off fine

Then I try to relight them using

[this, "OFF"] exec "switchlight.sqs"; light = "#lightpoint" createVehicleLocal position this; light setLightBrightness 0.075; light setLightAmbient[0.0, 0.0, 0.0]; light setLightColor[1.0, 1.0, 1.0]; light lightAttachObject [this, [0,0,12]]

They do not go back on with this command and change briteness

Where this would enable me to change brightness.

My main objective is to use lights but make them different brightnesses and if possible blink intermittently to look as though they arent working to full capacity.

any help is useful please.

Share this post


Link to post
Share on other sites

Your code example isn't clear. What code is in "switchlight.sqs"? There's no relation between the first statement and it's successive ones. Your code example first turns the light emitting object off, then adds a new light source to it. It shouldn't be doing both.

Check the following ref links: I think they work for light emitting objects (eg: lamp-post, head-lights, camp fire):

switchLight

LIGHTON action

However the code you've shown also deals with a light source. I don't know if you can mix the two.

If you want to deal with light sources, I would imagine you need something like this: (not tested)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// create light source

_Light1 = [] execVM "AddLightSource.sqf";

...

// turn light source off

nul = [_Light1] execVM "TurnOffLightSource.sqf";

AddLightSource.sqf (same as you've got)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = _this select 0;

_light = "#lightpoint" createVehicleLocal position _obj;

_light setLightBrightness 0.075;

_light setLightAmbient[0.0, 0.0, 0.0];

_light setLightColor[1.0, 1.0, 1.0];

_light lightAttachObject [_obj, [0,0,12]];

_light; // return new light source

TurnOffLightSource.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_light = _this select 0;

_light setLightBrightness 0.0;

_light setLightAmbient[0.0, 0.0, 0.0];

Share this post


Link to post
Share on other sites

The lights in the editor update default to on but I want to change their brightness and maybe make them flicker.

I want to make it more natural.

So I ASSUMED I know bad word. that I needed to turn off the light first then turn it back on with less brightness?

Also I wanted to do this in The INIT lines and not a script because I want them to all be different

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×