Jump to content
Brickky

Lights.sqf not working

Recommended Posts

I'm trying to work with the lights.sqf file for a multiplayer mission, and whilst it was working before in single player, for some reason now in both single player and multiplayer it won't work. it says "Undefined Variable in expression '_this'." tried doing ' 0 = [0] execVM "lights.sqf" ' with it in the 'init.sqf' file but to no avail.
 

_onoff = [_this, 0, 0.95, [0]] call BIS_fnc_param;
_distance = [_this, 1, 1000, [0]] call BIS_fnc_param;
_marker = [_this, 2, getMarkerPos "lightsmarker", ["",[],objNull]] call BIS_fnc_param;

_types = ["Lamps_Base_F", "PowerLines_base_F","Land_LampDecor_F","Land_LampHalogen_F","Land_LampHarbour_F","Land_LampShabby_F","Land_NavigLight","Land_runway_edgelight","Land_PowerPoleWooden_L_F"];

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   _lamps = _marker nearObjects [_types select _i, _distance];
   sleep 0.1;
   {_x setDamage _onoff} forEach _lamps;
};

 

Share this post


Link to post
Share on other sites
23 minutes ago, Brickky said:

the lights.sqf

 

From where?

Share this post


Link to post
Share on other sites
17 minutes ago, Harzach said:

 

From where?

As in where did I get the sqf file? If so, then from an scripting discord for arma. 

Share this post


Link to post
Share on other sites
22 minutes ago, Brickky said:

discord

 

What a disaster.

 

Anyway:

 

Quote

Basic usage:

Make a marker named "lightsmarker" and make a trigger with 0 = [] execVM "lights.sqf"; in the On Act. Simple as that. Will cut all lights 1000m around "lightsmarker".

Use 0 = [0] execVM "lights.sqf"; to turn lights back on.

Advanced usage:

_this select 0 (optional): Damage, 0 for ON, 0.95 for OFF - Default 0.95

_this select 1 (optional): Distance - default 1000

_this select 2 (optional): Position - position objectName for object, getMarkerPos "markerName" for marker - Default getMarkerPos "lightsmarker"

Examples:

0 = [0.95, 100, position generator] execVM "lights.sqf"; - cut the lights 100m around object named "generator"

0 = [0, 500, position lightswitch] execVM "lights.sqf"; - restore the lights 500m around object named "lightswitch"

0 = [0.95, 1000, getMarkerPos "townMarker"] execVM "lights.sqf"; - cut lights 1000m around marker named "townmarker"

0 = [0, 250, getMarkerPos "powerplant"] execVM "lights.sqf"; - restore lights 250m around marker named "powerplant"

 

  • 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

×