dayZ Street Lights

axeman

OpenDayZ Rockstar!
>> dayZ Streetlights <<
dayz_street_lights_axeman.jpg


------------------------------------------------------------------------------------
INSTALLATION

First off is the file that holds all of the positions of each street light. There are two ways to apply this: You can package this file into the dayz_server.pbo or you can add it to your mission (MPMission folder).

I recommend the first as it reduces the size of mission file that the player is required to download. The latter is the easiest option.. Am covering the easy option, ask in the support thread about packaging this file..

Download fnc_returnLampWS.sqf, the file that supports the map you want to have street lights on :
Create a folder called lights in your mission folder (<path to arma installation>\MPMission\<mission name>\lights). You may already have this if you use House Lights or Illuminant Tower Lights..

Copy fnc_returnLampWS.sqf into the lights folder.

Download and copy to the lights folder: street_lights.sqf

Add to your mission init.sqf:
Code:
if (isServer) then {
axe_server_lampObjs =    compile preprocessFileLineNumbers "lights\fnc_returnLampWS.sqf";
    "axeLampObjects" addPublicVariableEventHandler {_id = (_this select 1) spawn axe_server_lampObjs};
};
 
if (!isDedicated) then {
//StreetLights
[] execVM "lights\street_lights.sqf";
};
------------------------------------------------------------------------------------


That will get your street lights running. I have reduced the amount of street lights that are lit, although all locations are available, as it causes visual issues within the Arma engine. Basically it only supports so many lights, the more that are lit the smaller the radius becomes that you can see lights in..

Even to the point where over a 40-50% chance of lights coming on( (in this script) causes the lighthouse beam to vanish in Epoch and lights to appear and disappear as you move around.. To test this try lining up 8 or 10 vehicles in a car park, switch their headlights on, then walk around..


------------------------------------------------------------------------------------
Battleye: (script restriction #20 )
Add
Code:
!"#lightpoint createVehicle _location;"
to the line starting with
Code:
5 createVehicle
Should be line number 22.
------------------------------------------------------------------------------------

That's It ! (Go load it up) The rest is info.

Essentially the server holds a 6x6 grid array, of Chernarus, including all the locations of streetlamps on the server (there are some not included i.e. the telegraph poles with the lamp on top - these can be added).

Once the survivor enters the cell the script calls the server for the cell worldspaces and the client lights them up for just that cell.. New clients do not need to recreate the 'vehicle', that the #lightpoint' is made with, but do light up an existing one.. Was working on reducing this as other clients will see existing lights but will still set the brightness etc. (you may see a light blink)..

Additions: I really wanted to incorporate Personal Generators into this and merge it with mydayZ House Lights script amongst other ideas I have been toying with on my servers. Such as light failures, only working in some areas randomly, thunder storms knocking out lights, flickering lighting to add to the atmosfear etc. This is almost complete..

dayz_street_lights_the_freezer.jpg


There is a separate piece of code (Not Included) that runs once on the server to create the 'map' of all the streetlights. Basically, the streetlamps are, what I call, map items. They can only be seen by the server and even then can not be accessed using the normal nearestObjects until they have been parsed from all the other stuff on the map..

I did try sending the surrounding worldspaces, to the survivor, in real time from the server. Over a 50m radius was causing yellow chains (due to the amount of items) with me on my localhost server / gaming pc (is quite powerful). Which is why I went down the 'mapping / grid' route..

It took the program around 6 hours to parse 1321 'lampa' items from 3,031,789 chernarus 'map items', on my local test server, to build the streetlight position array (in the downloadable sqf). I can run this against other maps and easily apply the coords to them.

I have been playing with this concept and picking it up every other weekend and tweaking and changing, trying different methods, determined to beat it. I would have preferred to have released this when I was ready ! Am happy this will work ok, just not got the chance to test it on a big LAN server.

:D

The fnc_returnLampWS.sqf can be packaged into the server files as the communication between that and the main street_lights.sqf is done with public variables, more importantly public server variables and public client variables (to reduce network traffic). This also has the advantage of reducing the download size of your mission file.. (This is how I have tested it)

Here it is, hope you get it going and am quietly confident that it will run sweet :D

Gameplay: From a gameplay point of view, it really adds to the playability at night. I have changed my server times so is 6 hours over dusk. Industrial areas and train stations are now easy to navigate in the dark, there are pointers when starting on the coast (the motorways / highways being lit). Yet you still get plenty of dark and scary moments, the lit areas add to the suspense as, when un-tooled up, you end up running back into the dark being chased by zombies.. There is no reason to not add a bit of lighting, with full moon nights (Set your date to static in the hiveext.ini) it is a winning combination..

dayz_taviana_street_lights.jpg


Zombies in the day is fun, at night it is scary again...

>>OTHER DAYZ LIGHTING SCRIPTS: <<

 
Back
Top