Jump to content
Sign in to follow this  

Recommended Posts

Copy and past the Script to a Notepad. Save as Whatever.sqf.

Save that to the same folder of your mission,

Open Editor, click save, name it, and move the script to that folder, normaly found in your documents somw here.

Call the script using "Null = ExecVM "Whatever.sqf"" with a trigger of your liking.

PS: works good.

Share this post


Link to post
Share on other sites
It's actually defined as an animation of the house model - the animations are named "Lights_1" to "Lights_5".

Here's a little code I stole from BIS to turn the lights on in a specific house:

for "_i" from 1 to 5 do {

			_house animate [format ["Lights_%1",_i],1];
};

Here, _house has to be the house you want to light up. I used the following code to light up all houses within a certain radius - but be warned that this is computationally very expensive and probably not practical in a real mission:

_objHouse = nearestObjects [player, ["House"], 3000];

{
for "_i" from 1 to 5 do {

				_x animate [format ["Lights_%1",_i],1];
};
} forEach _objHouse;

Where do you put this? In the Function Module? In an SQF File? In a Unit? Pls help me

---------- Post added at 11:23 ---------- Previous post was at 11:21 ----------

It's actually defined as an animation of the house model - the animations are named "Lights_1" to "Lights_5".

Here's a little code I stole from BIS to turn the lights on in a specific house:

for "_i" from 1 to 5 do {

			_house animate [format ["Lights_%1",_i],1];
};

Here, _house has to be the house you want to light up. I used the following code to light up all houses within a certain radius - but be warned that this is computationally very expensive and probably not practical in a real mission:

_objHouse = nearestObjects [player, ["House"], 3000];

{
for "_i" from 1 to 5 do {

				_x animate [format ["Lights_%1",_i],1];
};
} forEach _objHouse;

Where do you put this? In the Function Module? In an SQF File? In a Unit? Pls help me

Share this post


Link to post
Share on other sites

Actually, this works splendid with a few mods:

1. Make a generic script as so:

_l = _this select 0;
_d = _this select 1;

_objHouse = nearestObjects [_l, ["House"], _d];

{
   for "_i" from 1 to 5 do {
       _x animate [format ["Lights_%1",_i],1];
   };
} forEach _objHouse;

2. Place a game logic in the center of the area you want to light up

3. In the init of the logic, just place

 ogc = [this,100] execVM "og_works\cosy.sqf";

The radius is adjusted in meters as you call the script, in this case 100 meters.

As always, remember to doublecheck paths and filenames, this example is ripped out of my mission.

Share this post


Link to post
Share on other sites

If it helps anybody at all - I've begun to use the TPW Houselights script in missions - it doesn't drag too much in missions, as explained it might in the readme, but I guess if the lights are that important you could use the @addon version. It isn't possible to attach light sources to particular houses or points in houses, but I've found the effects are excellent and enough 'empty' buildings will have some light.

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  

×