Jump to content
Sign in to follow this  
CptBBQ

Street lamps in Zargabad

Recommended Posts

Hi all!

I recently played some night missions in Zargabad and I noticed there were only a hand full of working street lamps in the city. I was wondering if there was a way to switchLight "ON" all the other lamps but I didn´t get very far.

By now I´m starting to doubt that there is an easy way to do this, but maybe someone here has an idea. Or perhaps there´s some kind of addon for this purpose?

Anyway, thanks in advance.

Cheers,

CptBBQ

Share this post


Link to post
Share on other sites

Thanks, that looked promising but it didn´t work :(

I´d guess the street lamps in Zargabad have different class names than the ones on Chernarus..

Any suggestions?

Share this post


Link to post
Share on other sites

switchLight command to find new lamps.

If you want turn street lamp off in ArmA2, the syntax is:

ID959522=position player nearestObject 959522

ID959522 switchLight "off"

untested.

Edit:

"Land_PowLines_Conc2L_EP1"

"Land_Lamp_Street1_EP1"

"Land_Lamp_Street2_EP1"

"Land_Lamp_Small_EP1"

"Land_Lampa_Ind_EP1"

this is the Zargabad runway lights: "Land_NavigLight", but they will not turn off with the switchLight command.

Above is all of the lamps in zargabad and is not included in kylanias script, probably because they are new in OA...

tested with flying LB around at night after turning off lights, no more lights on other than runway lights.

edit2:

code used to turn off lights in 5000 meter around player:

lamps = [];
{
lampList = getpos player nearObjects [_x, 5000];
lamps = lamps + lampList;
} foreach ["Land_PowLines_Conc2L_EP1","Land_Lamp_Street1_EP1","Land_Lamp_Street2_EP1","Land_Lamp_Small_EP1","Land_Lampa_Ind_EP1"];
{_x switchLight "off"} foreach lamps;

some lamps when "turned off" will not cast light, but their bulb will be lighted, note this is only visual, it will not cast any actual light.

maybe someone clever can find out what to use with the setHit command to "destroy the bulb", because shooting it will kill this bulb light so only need to damage the "right part" for it to go completely dark.

if i used setdammage 0 on the lamp itself, it fell to the ground, so thats not a desired result.

how to find out the bulb to setHit on it would be nice.

Edited by Demonized

Share this post


Link to post
Share on other sites

Thanks Demonized. Unfortunately, these class names also affect only some of the lamps. E.g. the lamps along the main road going east to west just south from the mosque (see screen-shot below) cannot be addressed that way. At night some of them are lit and some aren´t. Maybe they are already damaged at game start, but I can´t even figure out their class name to test it.

I tried "typeOf cursorTarget", "typeOf nearestObject" and such but I got no results.

Any help is appreciated.

screen-shot:

256zs3n.jpg

Share this post


Link to post
Share on other sites

They have no config (hence no class). Furthermore the p3d name is lamp_street2_off_ep1.

I'm afraid you won't be able to turn these on without a workaround (such as your own light source).

Share this post


Link to post
Share on other sites

I'm afraid there will be problem with light sources in scene. Number of light sources is limited by engine. If you turn on all lamps, some of them will be still turned off because there will be too many light sources.

Share this post


Link to post
Share on other sites

for switching off, it works on all, with the limitation of my above comment, (bulb light visual only on some, and the landingstrip lights).

And as DarkDruid said there is limits on how many lights can be "on" at same time.

Workaround:

for that would be to have lower viewdistance and turn on/off lights around player while they were moving.

_range at top is distance from player that lights are on, more than this and they are turned off.

_null = [] spawn {

_range = 500;
_lamps = [];
_onArr = [];
{
_lampList = getMarkerPos "center" nearObjects [_x, 5000];
_lamps = _lamps + _lampList;
} foreach ["Land_PowLines_Conc2L_EP1","Land_Lamp_Street1_EP1","Land_Lamp_Street2_EP1","Land_Lamp_Small_EP1","Land_Lampa_Ind_EP1"];
{_x switchLight "off"} foreach _lamps;

while {alive player} do {
{
	if ((getDammage _x) < 1) then {
		if (((vehicle player) distance _x) <= _range) then {
			if (!(_x in _onArr)) then {
				_x switchLight "on";
				_onArr = _onArr + [_x];
			};
		} else {
			_x switchLight "off";
			_onArr = _onArr - [_x];
		};
	};
} foreach _lamps;
sleep 5;
};

};

i did see that "Land_Lamp_Street2_EP1" was one of the lights that had a bulb visual light after turned off.

@DarkDruid, how many lightsources can be on at same time? and is the runway lights at the airport counted into this amount?

in my tests with above script i used hint wich listed all "on" lights and even with ca 20 in list, there were still some near me that was not "on"...

Share this post


Link to post
Share on other sites

Thanks for all the insights, guys. Too bad there´s a limit on light sources.

I´d also like to know where that limit might be.

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  

×