Jump to content
Sign in to follow this  
Wachtmeester

streetlight

Recommended Posts

Hi all,

Is it possible to make custom streetlights that are lit during night, just as the original BIS ones without scripting?

You know, the BIS lights go on and of according to the time of the day, I wan't that for my own lights, is that possible or do you have to script custom lights?

And those someone have an config example for streetlights?

Thanks in advance

Share this post


Link to post
Share on other sites

It is perfectly possible to make your own streetlights and to have them come on and go off just like the BIS ones.

However, Streetlights don't work properly when placed via the Mission Editor.....the light source appears half way up the post instead of at the top.

I don't think they were ever meant to work from the editor.

I think they are specifically for use in wrp files, where they work very well.

Here is an example for a streetlight I have...actually this config has several different lights in it but I cut the rest out to save space and just left the one example.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class PLK_DimmerLamps

{

units[]={PLK_WhiteLampWood};

requiredVersion=1.75;

};

};

class CfgModels

{

class Default

{

sections[] = {};

sectionsInherit="";

};

class StreetLamp: Default {};

class StreetLampWood: StreetLamp {};

class PLK_lampadrevo2: StreetLampWood {};

};

class CfgNonAIVehicles

{

access=1;

class StreetLamp {};

class StreetLampWood: StreetLamp {};

class PLK_WhiteLampWood: StreetLampWood

{

scope=2;

model="\PLK_DimmerLamps\PLK_lampadrevo2";

destrType=destructtree;

simulation="StreetLamp";

colorDiffuse[]={1.0, 1.0, 1.0, 0.0};

colorAmbient[]={0.35, 0.35, 0.35, 0.0};

brightness=0.15;

armorBulb=1;

};

};

Hope it helps a bit

Planck

Share this post


Link to post
Share on other sites

Thanx, got it to work. I found out that you have to 'script' them in your island config, and then it works just fine.

(the lamps were placed in wrptool btw).

Could you give some light tounge_o.gif on the values for colordiffuse and colorambient?

Share this post


Link to post
Share on other sites

What sort of colours were you wanting?

As you probably know the first value in the colour array is the red component......followed by the green component.......then the blue component.......and lastly the alpha component.

Without an alpha component you will only ever have white lights.

The values for all range from 0.0 to 1.0.

Two examples here white and orange.......like modern streetlights

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

White

------

colorDiffuse[]={1.0, 1.0, 1.0, 0.0};

colorAmbient[]={0.35, 0.35, 0.35, 0.0};

brightness=0.15;

Orange

-------

colorDiffuse[]={0.7, 0.3, 0.0, 0.0};

colorAmbient[]={0.6, 0.2, 0.0, 0.0};

brightness=0.15;

I think colorAmbient is the amount of the light that lights up other objects and the surrounding area.

With this set to 0, you could be next to the light and not have any colour cast on your vehicle....not very realistic.

The trick is to play about with the values till you are happy with the results.

Planck

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  

×