Jump to content
DOA

Can anyone identify this light.

Recommended Posts

Hi Everyone, I have spent the entire day trying to turn off the lights in the broadcasting station on Green Mountain on Chernarus. I'm using the Light.sqf. I believe all I need is the class name of this particular building light to get the sqf to turn it off. 
I simply can't find the class name of the building lights. I will post the sqf I am using so you can see the array of lamps that light.sqf has already. If anyone knows this lights class name or how I may find it I would be most grateful. Thanks All...David ARMAstrong.

 

 // off: 0 = [0.95] execVM "lights.sqf";
// on: 0 = [0] execVM "lights.sqf";

_types = [
"Lamps_base_F",
"PowerLines_base_F",
"PowerLines_Small_base_F",
"Land_fs_roof_F",
"Land_FuelStation_01_roof_F",
"Land_FuelStation_02_roof_F",
"Land_FuelStation_01_roof_malevil_F",
"Land_LampDecor_F",
"Land_LampSolar_F",
"Land_LampHalogen_F",
"Land_LampHarbour_F",
"Land_LampStreet_small_F",
"Land_LampStreet_F",
"Land_PowerPoleWooden_F",
"Land_PowerPoleWooden_L_F",
"Land_PowerPoleWooden_small_F",
"Land_LampAirport_F", 
"Land_LampShabby_F"
];
_onoff = _this select 0;

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
    // powercoverage is a marker I placed.
_lamps = getMarkerPos "LIGHTSOURCE" nearObjects [_types select _i, 500];
sleep 1;
{_x setDamage _onoff} forEach _lamps;
};

needClassname.jpg

Share this post


Link to post
Share on other sites

In buildings like this, your lights can be found in "reflectors" class of the object.

If you want to switch off/on the lights on maps such as Chernarus >>> just play with this "switch lights" module.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks mate I will try that ASAP, how can I find the classname of the ojbect, i assume you mean the building has these reflectors like other vehicles. And thanks for pointing me at the right classnames. I sort of recognize your profile pic. I know you have helped me before. Thank you so much. I just subscribed to your modules in the workshop and I will now be up all night. LOL I gave you all awards in workshop and anyone who uses these should too. 

  • Like 1

Share this post


Link to post
Share on other sites

Yes. I don't know by heart the house classes. 🙂  You can try to target it and grab the class in console with typeOf cursorObject (watch lines). Then yes, the sub-class reflectors can help you from config viewer. Once you get these reflectors, you can grab them by nearestObjects command, then getAllHitPointsDamage for them, ... then setHitIndex 1 or 0 on them for off/on. I spent a lot of time on all types of lights/lamps/runway lights... the reason why the code of this module is... not evident.

 

Share this post


Link to post
Share on other sites

pierremgi,  thanks so much for your help and all the excellent stuff in your workshop. Must haves for mission editors. 
I was able to find the classname of the light I was looking for with the help of Grumpy Old Man, another guru on these forums. I had heard of being able to simply shoot an object and it return the class_name. Grumpy Old Man gave me the code, which I will put in this thread in case anyone else needs it.

Here is how I used it. 
I placed a player unit in front of the guard shack with the light on it at the tower on Green Mountain.
I created a repeatable trigger, activated with a radio signal, with the code below in the init field. 
I started the mission, issued the radio command to execute the code and then shot the light I needed the classname of. 
The classname was returned on screen as a hint. Perfect. "glass_8_hide" was the classname of the light that I needed. 
Thank you both for assisting me. It is much appreciated by an amateur mission editor and the group that runs my missions. Well done. 

cursortarget addEventHandler ["HitPart",{ 
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; 
hint str _selection 
}];

 

  • Like 2

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

×