Jump to content
HeroesandvillainsOS

Illumination disappears when simulation is disabled (camping lantern)

Recommended Posts

In RC 1.60, I'm noticing items such as the camping lantern don't illuminate if you disable simulation. This pretty much means you can raise the object (example: like placing it on a table you can't snap the object to).

I'll have to look through other lit objects to see how universal this is.

I don't recall this being the case in 1.58. Perhaps I'm wrong on that?

Share this post


Link to post
Share on other sites

It's a rather old behavior, not depending on the last version. I discovered this in 2014, scripting a mission. I added some #lightpoint if I remember.

  • Like 1

Share this post


Link to post
Share on other sites
On 2016-06-05 at 6:40 PM, pierremgi said:

It's a rather old behavior, not depending on the last version. I discovered this in 2014, scripting a mission. I added some #lightpoint if I remember.

How would one go about doing this? I tried "_this = "#lightpoint" createVehicleLocal pos;" in the lantern's init and it doesn't do anything as far as I can tell.

 

Btw does anyone know if a ticket has been submitted on the feedback tracker about this?

Share this post


Link to post
Share on other sites
On 9/14/2017 at 7:07 PM, Drift_91 said:

How would one go about doing this? I tried "_this = "#lightpoint" createVehicleLocal pos;" in the lantern's init and it doesn't do anything as far as I can tell.

 

You aren't defining the variable pos. You also aren't defining the #lightpoint's params.

 

Name the lantern ("lantern1" for this example) then try this:

light1 = "#lightpoint" createVehicleLocal position lantern1;  
light1 setLightBrightness 0.25;  
light1 setLightColor [1.0,1.0,0.5];  
light1 setLightAmbient [1.0,1.0,0.5];  

It might make more sense to do this via script, however, then execute from the desired target object(s).

//_nul = [this,_brightness,[_rC,_gC,_bC],[_rA,_gA,_bA],[_lpX,_lpY,_lpZ]] execVM "createLightPoint.sqf";
//example:
//_nul = [this,0.25,[1,1,0.5],[1,1,0.5],[0,0,0]] execVM "createLightPoint.sqf";

params ["_emitter","_brightness","_color","_ambient","_lightPoint"];

_this select 2 params ["_rC","_gC","_bC"];
_this select 3 params ["_rA","_gA","_bA"];
_this select 4 params ["_lpX","_lpY","_lpZ"];

_lightpoint = "#lightpoint" createVehicleLocal position _emitter;
_lightpoint setLightBrightness _brightness;
_lightpoint setLightColor [_rC,_gC,_bC];
_lightpoint setLightAmbient [_rA,_gA,_bA];
_lightpoint lightAttachObject [_emitter, [_lpX,_lpY,_lpZ]];

[Code fixed, see @Drift_91's post below]

 

uE83L7S.jpg

 

As for the enableSimulation issue, it makes sense to me that light would not be simulated when the associated emitter has simulation disabled.

Edited by Harzach
Code fixed as per OP's latest reply
  • Like 2

Share this post


Link to post
Share on other sites

Also, I have been hard-pressed to find surfaces that the camping lantern will NOT snap to, so perhaps the topic's original premise is no longer valid.

Share this post


Link to post
Share on other sites
7 hours ago, Harzach said:

Also, I have been hard-pressed to find surfaces that the camping lantern will NOT snap to, so perhaps the topic's original premise is no longer valid.

There's quite a few belonging to mods. But regarding vanilla you're probably right.

 

For me the issue is explosions throwing the lantern around, not just falling through a table. Oddly enough the following doesn't disable the light output.

[] spawn {sleep 5; arsenalLantern_1 enableSimulation false};

The "sleep 5" is actually a benefit in my situation because the snap point is too high, and simulation is disabled after it's plopped down onto the top of the NATO Cargo Net I'm using as an arsenal.

 

I have to say though, your #lightpoint actually looks a lot nicer with the colour of the light. I might use your script instead if I'm ever looking for a more aesthetic light.

Share this post


Link to post
Share on other sites
Quote

There's quite a few belonging to mods. But regarding vanilla you're probably right.

 

Ah, of course. Though I think that it was not the case even with vanilla objects back when this topic was created. I may be wrong.

 

Quote

 

For me the issue is explosions throwing the lantern around, not just falling through a table. Oddly enough the following doesn't disable the light output.


[] spawn {sleep 5; arsenalLantern_1 enableSimulation false};

The "sleep 5" is actually a benefit in my situation because the snap point is too high, and simulation is disabled after it's plopped down onto the top of the NATO Cargo Net I'm using as an arsenal.

 

 

I always preferred attaching objects for this reason, using an invisible helipad as an anchor object. I don't like my nice compositions getting messed up!

 

Quote

I have to say though, your #lightpoint actually looks a lot nicer with the colour of the light. I might use your script instead if I'm ever looking for a more aesthetic light.

 

Thanks! I used to have a chart of RGB values that yielded fairly realistic artificial light effects (sodium, LED, etc). I'll see if I can find it. It's fun to play around with the params, though.

Share this post


Link to post
Share on other sites
On 2017-09-15 at 11:29 AM, Harzach said:

 


//_nul = [this,_brightness,[_rC,_gC,_bC],[_rA,_gA,_bA],[_lpX,_lpY,_lpZ]] execVM "createLightPoint.sqf";
//example:
//_nul = [this,0.25,[1,1,0.5],[1,1,0.5],[0,0,0]] execVM "createLightPoint.sqf";

params ["_emitter","_brightness",["_rC","_gC","_bC"],["_rA","_gA","_bA"],["_lpX","_lpY","_lpZ"]];

_lightpoint = "#lightpoint" createVehicleLocal position _emitter;
_lightpoint setLightBrightness _brightness;
_lightpoint setLightColor [_rC,_gC,_bC];
_lightpoint setLightAmbient [_rA,_gA,_bA];
_lightpoint lightAttachObject [_emitter, [_lpX,_lpY,_lpZ]];

 

So I tried this out just now for the first time. Previously I'd used the other code directly in the object's init. Seems you can't directly use arrays within the params array, as arrays already serve another purpose. Instead of simply removing the brackets around the arrays, which would render the execVM that calls the script hard to read and tedious to modify, I used the following solution which was an example on the wiki page for params:
 

params ["_emitter","_brightness","_color","_ambient","_lightPoint"];

_this select 2 params ["_rC","_gC","_bC"];
_this select 3 params ["_rA","_gA","_bA"];
_this select 4 params ["_lpX","_lpY","_lpZ"];


_lightpoint = "#lightpoint" createVehicleLocal position _emitter;
_lightpoint setLightBrightness _brightness;
_lightpoint setLightColor [_rC,_gC,_bC];
_lightpoint setLightAmbient [_rA,_gA,_bA];
_lightpoint lightAttachObject [_emitter, [_lpX,_lpY,_lpZ]];

 

Hopefully this helps anyone who needs this in the future. Also, since my last post I've learned to use the config viewer and I found the correct parameters for the camping lantern:

_nul = [this,1,[0.6,0.8,1],[0.006,0.008,0.01],[0,0,0]] execVM "createLightPoint.sqf";

 

  • Like 1

Share this post


Link to post
Share on other sites

Weird, I could swear it worked before, but clearly it does not. I'll amend my post to prevent any confusion. Thanks for the update!

Share this post


Link to post
Share on other sites

 ..and on second visit, nominal ambient RGB values make so much more sense.

  • Like 1

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

×