Page MenuHomeFeedback Tracker

Light objects on the Map do not respond to switchLight "on", "off ", "auto ".
Closed, ResolvedPublic

Description

Unable to script (switchLight "on", "off" or "auto") for Light Objects on the map. Also Damaged Light Objects remain dimly lit.

Objects tested: "Halogen lamp" lamphalogen_f and streetlamp_f.
Location: First 3 Lights @ Stratis Airport Entrance

setDamage function works as it should with the same code

! AS OF 05/26/13 UPDATE, ONCE AGAIN STATIC OBJECTS ON THE MAP HAVE NEW ID# ASSIGNED !

Details

Legacy ID
3846937238
Severity
Major
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce

Location: First 3 Lights @ Stratis Airport Entrance
1) Set Mission's Time of Day to Night
2) Place Game Logic on the map and name it "lightSwitch"
3) Call this script with a Trigger.
Optional) uncomment sleep and setDamage line below to test if it affects the Lights
NOTE - If you have not updated your Alpha build yet, use _lights with old ID#.

ID# of the Lamps Before the 04/15/13 Update
_lights = [143222, 143087, 143169];

ID# of the Lamps as of 04/15/13 Update
_lights = [45831, 45696, 45778];

// ID# of the Lamps as of 05/26/13 Update
_lights = [52807, 52748, 51896];

for [{_i=0}, {_i < count _lights}, {_i=_i+1}] do
{
_light = (_lights select _i);
_lampPost = (getPos lightSwitch nearestObject _light);
_lampPost switchLight "off";

//sleep 5;
//_lampPost setDamage 1;

};

Additional Information

If you want to have similar effect to switchLights "OFF". ! UNTIL IT GETS FIXED !
It will look a bit strange, lamps will switch off and disappear into thin air, but it looks way better than just setting the setDamage to the lights.

Use the above script with (_lampPost hideObject true;) instead of (_lampPost switchLight "off";) first and (_lampPost setDamage 1;)second without any sleep commands.

! Using setDamage only turns the lights off but shows damage animation !

Event Timeline

Lt_Lyko edited Steps To Reproduce. (Show Details)Apr 5 2013, 2:56 PM
Lt_Lyko edited Additional Information. (Show Details)
Lt_Lyko set Category to Scripting.
Lt_Lyko set Reproducibility to Always.
Lt_Lyko set Severity to Major.
Lt_Lyko set Resolution to No Bug.
Lt_Lyko set Legacy ID to 3846937238.May 7 2016, 1:26 PM

Same seems to be also true for other Light Objects on the map.

lightIsOn also appears not to work for related street lamp objects and near(est)Objects related searches do not appear to return results for class "StreetLamp".

Has any update been seen since the changes in the lighting seen in the latest stable build?

Thanks for update below LT.
Will hope for resolution in the near future and LG's electrical grid!!!

Hey KevsnoTrev

Negative on your question,

I'm updating the report every time new update comes out.

Just a thought, the work around may have an alternative option now the lights can be shot out.

Does the light have to be set to full damage for the light to go out?

I was thinking exactly the same and had it tested right after the release of the update.
Unfortunately light sources will stop working only after fully damaging the Lamp; setting setDamage to 0.9 makes no difference. :-(

You can now use the setHit command to destroy/restore just the "bulbs" by using it in conjunction with light_n_hitpoint where "n" is the number of the respective light on the pole (some like halogen and decor have multiple lights). Until switchLight is re-enabled, I will use this method for my electrical grid simulation.

Hey Loyalguard

Thanks for another workaround.
I'm sure they'll get to it as soon as they can.

BTW - Can't wait for "ArmA3 Electrical Grids" ;-)

Sincerely
Lt Lyko

Why is this being ignored?

And another issue being ignored since early Alpha.

cyckuan added a subscriber: cyckuan.May 7 2016, 1:26 PM

If you are using the hideObject workaround, bear in mind the locality of this command is "Effect Local", meaning you may have to execute it within BIS_fnc_MP for global effect (or publicVariableServer and hideObjectGlobal, the latter command only works when called on the server). Not pretty.

I'm going to go ahead and resolve it as no bug. It seems that it only works with specific class that is not present in Arma 3 anywhere as an object

if (count allMissionObjects "StreetLamp" == 0) then {
hint "Objects compatible with 'switchLight' are not found.";
} else {
hint "'switchLight' compatible objects are found!";
};

A developer could have clarified this long time ago (the ticket is more than a year old) to save the hassle to everyone.

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.