Jump to content
Sign in to follow this  
philcommando

Lighted house

Recommended Posts

In the past, the only way to have lights with buildings is to trick the engine by configuring a building as vehicle class to make use of the default lights

However, such lights are limited as it is conical in light shape and does not illuminate much of the surroundings.

One way now would be:-

1. In the config190, there is a fire object, called the class fire.

2. Make a new class - yourfire - by inheriting it from the class fire, eg:-

class myfire: fire

3. The reason for doing so is because:-

a. There is no avaliable model of the fire unless one breaks

into the main config - not necessary to do so

b. By inheriting the class, u will be able to configure the brightness or the dimness of the fire.

4. Once u have it configured, make use of smokedribs attaching script to place it on anywhere u want on the building thru an useraction in your building config.

5. To create the useraction, u will only need to make a pos switch in your memory LOD - single vertex.

6. In the config, under the class useraction, add in a new class:-

Class useraction

{

  class turnlightson

 {

 displayName="Partytime";

 positon= pos switch1;

 radius=10;

 condition="alive this";

 statement=[this,1] exec {\myaddon\lightz.sqs};

  };

};

7. the script to make it happen:-

--------------------

_player = _this select 0

_x = (getPos _player) select 0

_y = (getPos _player) select 1

_z = (getPos _player) select 2

_posFlare = [_x+ 30, _y + 12, _z + 45]

_type = "MyFire"

ceilinglight = _type CamCreate _posFlare; ceilinglight inflame true

Exit

------------------------------------------

8. So when u get near the switch, u will be able to turn on the lights in the building ingame.

9. conversely, to off the lights will be another memory lod and useraction class.

10. You can also have it self lighted - make use of the init eventhandler in the config.

PS:- the bis fire is actually coal fire, but thru the config inheritance, u will be able to set it up to the fire u want.

Ingame u can see the model - a small plate - but if u wisely create a box on the ceiling of your building, u will be able to hide the fire model inside with no loss in lumination.

I know it may sound advance, but if u have done modelling and config before, once u understand the principles of it, and some trial and error, it will be a cinch.

However, do not attempt to make the light move, as it would be possible with smokedribs script, because it is graphically intensive and cpu will experience the mother of lags. Nor should u have too many lights in one small spot or set the brightness to overbearance.

All the best. smile_o.gif

Share this post


Link to post
Share on other sites
Guest

Only a couple of problems with that I think.

1. Since it isn't HOUSE class (or named in the Geo LOD), there can't be the usual sorts of animations?

2. The sound of the fire will still be there?

3. Work in MP?

Other than that it's good. smile_o.gif

Share this post


Link to post
Share on other sites

1. It is a house class. No problem with animations actually..u can have animation in all classes, depends only on how u configure it.

2. The beauty of inherited class is that u can control your addon's features including the sound.

3. As to work in MP, i have no idea for i dont usually go into MP, however, what i do know is that since ofp1.91, the init can be used on MP servers, furthermore its only how one workaround the script to get it working of servers.

Share this post


Link to post
Share on other sites
Quote[/b] ]

10. You can also have it self lighted - make use of the init eventhandler in the config.

Of course, the "init" eventhandler doesn't work for wrp placed objects, so, this is only useful for editor placed objects.

Or did I misunderstand you.

Planck

Share this post


Link to post
Share on other sites

Sorry planck, i have no luck in placing any custom objects in wrp edit, therefore i am not sure if it will work for wrp concepts. This has proven to work on custom objects place thru editor, eg, my Midway non-moving carrier addon.

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  

×