Page MenuHomeFeedback Tracker

[BUG] setLightDayLight seems not to be taking effect.
Closed, ResolvedPublic

Description

setLightDayLight seems not to be taking effect when set to true, light doesn't work at day time.

Details

Severity
Minor
Resolution
Won't Fix
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
21H2
Category
Scripting
Steps To Reproduce

I was doing this on Altis if that matters.
put in the Init of "Land_PortableLight_single_F":

_light_emitter_0 = "#lightreflector" createVehicleLocal getpos this;
_light_emitter_0 setLightColor [1,1,1];
_light_emitter_0 setLightAmbient [1,1,1];
_light_emitter_0 setLightIntensity 17000;
_light_emitter_0 setLightUseFlare false;
_light_emitter_0 setLightDayLight true;
_light_emitter_0 setLightAttenuation [15, 4, 5, 0];

_pos1 = this modelToWorldVisual (this selectionPosition "light_1_pos");
_pos2 = this modelToWorldVisual (this selectionPosition "light_1_dir");

_light_emitter_0 lightAttachObject [this, (this selectionPosition "light_1_pos")];
_light_emitter_0 setdir ( _pos1 getdir _pos2);
Additional Information

Game version: 2.08.149102

Event Timeline

Troalinism edited Additional Information. (Show Details)
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedThu, Jun 16, 11:14 PM

But it works during day, just checked. Try VR and use "#lightreflector" instead as it gives more directional light so you can see boundaries better in daylight. Set it false and it is gone. Set it true and it is back. Dont know what you expect. BTW portable light when placed is on. Use https://community.bistudio.com/wiki/switchLight to turn it on off

BIS_fnc_KK changed the task status from New to Need More Info.Thu, Jun 16, 11:16 PM

But it works during day, just checked. Try VR and use "#lightreflector" instead as it gives more directional light so you can see boundaries better in daylight. Set it false and it is gone. Set it true and it is back. Dont know what you expect. BTW portable light when placed is on. Use https://community.bistudio.com/wiki/switchLight to turn it on off

Alright thats correct, but I found out why I was thinking it was turned off,
It seems like light underwater gets affected by daytime cycle, even in complete darkness in deep water, why is that?
like even when I used a really high intensity (17000) it still barely looks as bright as it is in night, but that doesn't make any sense because we are in complete darkness so it shouldn't get affects by day light on the surface?

Is there a workaround for this in case there is no reason?

a video to show what I mean: https://youtu.be/ApJCJiBisEs

Here is the code I used for the light source:

_light_emitter_0 = "#lightreflector" createVehicleLocal getpos this;
_light_emitter_0 setLightColor [1,1,1];
_light_emitter_0 setLightAmbient [1,1,1];
_light_emitter_0 setLightIntensity 17000;
_light_emitter_0 setLightUseFlare false;
_light_emitter_0 setLightDayLight true;
_light_emitter_0 setLightAttenuation [15, 4, 5, 0];

_pos1 = this modelToWorldVisual (this selectionPosition "light_1_pos");
_pos2 = this modelToWorldVisual (this selectionPosition "light_1_dir");

_light_emitter_0 lightAttachObject [this, (this selectionPosition "light_1_pos")];
_light_emitter_0 setdir ( _pos1 getdir _pos2);

Here is the code for the GUI that I used in case you want to check it:

player addAction ["Change time",{

	with uiNamespace do {
		TimeDisplay = (findDisplay 46) createDisplay 'RscDisplayEmpty';  
	
		_ColorFrame = TimeDisplay ctrlCreate ["RscText", 1001];  
		_ColorFrame ctrlSetPosition [0.432011 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.128767 * safezoneW, 0.099 * safezoneH];
		_ColorFrame ctrlSetBackgroundColor [0,0,0,0.87];  
		_ColorFrame ctrlEnable false;  
		_ColorFrame ctrlCommit 0;  

		_RscFrame_1800 = TimeDisplay ctrlCreate ["RscFrame", 1800];
		_RscFrame_1800 ctrlSetPosition [0.432011 * safezoneW + safezoneX, 0.445 * safezoneH + safezoneY, 0.128767 * safezoneW, 0.099 * safezoneH];
		_RscFrame_1800 ctrlCommit 0;

		_RscText_1000 = TimeDisplay ctrlCreate ["RscText", 1000];
		_RscText_1000 ctrlSetText "Input hour:";
		_RscText_1000 ctrlSetPosition [0.440252 * safezoneW + safezoneX, 0.456 * safezoneH + safezoneY, 0.0463563 * safezoneW, 0.022 * safezoneH];
		_RscText_1000 ctrlCommit 0;

		TextBox = TimeDisplay ctrlCreate ["RscEdit", 1400];
		TextBox ctrlSetPosition [0.440252 * safezoneW + safezoneX, 0.489 * safezoneH + safezoneY, 0.051507 * safezoneW, 0.044 * safezoneH];
		TextBox ctrlCommit 0;


		_applyButton = TimeDisplay ctrlCreate ["RscButtonMenu", 2400];
		_applyButton ctrlSetText "Apply";
		_applyButton ctrlSetPosition [0.5 * safezoneW + safezoneX, 0.5 * safezoneH + safezoneY, 0.0463563 * safezoneW, 0.033 * safezoneH];
		_applyButton ctrlAddEventHandler ["ButtonClick",{
			_TextBox = uiNamespace getVariable 'TextBox';
			_Hour = parseNumber (ctrlText _TextBox);
			date params ["_year", "_month", "_day", "", ""];
			setDate [_year, _month, _day, _Hour, 0];
		}];
		_applyButton ctrlCommit 0;

	};

}];

I’m sure there is a bug somewhere how the light is calculated in relation to global light, but that is another matter and unlikely to change as this could affect a lot of missions. The command in question has very simple implementation this is why I couldn’t find anything wrong with it. -BIS_fnc_KK.

So this can't be fixed due to it breaking the game framework, I understand, thanks for the response.

Please close this ticket.

BIS_fnc_KK closed this task as Resolved.Sun, Jun 19, 11:13 PM
BIS_fnc_KK changed Resolution from Open to Won't Fix.