Jump to content
VentZer0

[Release] different colorcorrections for day- and nighttime

Recommended Posts

Hello

I wrote this little script for my server which has some colorcorrection effects which are nice during the day, but at night not so much.

during the day it will look like this :

oMC3NIvl.jpg
during the night :

Y0lWhbil.jpg

how it should look at night :
j9BQLnzl.jpg



so I wrote this script :
graphics.sqf

// ventzer0 (c) 2013, leave the credit in!
// _sunrise & _sunset determine start and end of the effect based on time
private ["_sunrise", "_sunset","_loop"];
"filmGrain" ppEffectEnable true;
_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_daytime = daytime;
//time at which nighttime effect should kick in
_sunset = 18.5;
//time at which daytime effect should kick in
_sunrise = 7.0;
_loop = 0;
sleep 1;
while { _loop != 6} do {
  //night
  while { ( _daytime > _sunset ) and ( _daytime > _sunrise ) } do {
    _hndl ppEffectAdjust[1,1,0,[0,0.04,0,-0.01],[0,0,0,1.58],[-0.11,-0.11,-0.11,0]];
    _hndl ppEffectCommit 0;
    "filmGrain" ppEffectAdjust [0.01, 1, 1, 0.1, 1, true];
    "filmGrain" ppEffectCommit 0;
    sleep 1200;
    //check all x seconds
  };
  sleep 1;
  while { ( _daytime < _sunset ) and ( _daytime < _sunrise ) } do {
    _hndl ppEffectAdjust[1,1,0,[0,0.04,0,-0.01],[0,0,0,1.58],[-0.11,-0.11,-0.11,0]];
    _hndl ppEffectCommit 0;
    "filmGrain" ppEffectAdjust [0.01, 1, 1, 0.1, 1, true];
    "filmGrain" ppEffectCommit 0;

    sleep 1200;
    //check all x seconds
  };
  sleep 1;
  // day
  while { ( _daytime > _sunrise ) and ( _daytime < _sunset ) } do {
    _hndl ppEffectAdjust[1,1,0,[0,-0.12,0.05,0.03],[0,0,0,1.23],[-0.11,-0.11,-0.11,0]];
    _hndl ppEffectCommit 0;
    "filmGrain" ppEffectAdjust [0.0225, 1, 1, 0.1, 1, true];
    "filmGrain" ppEffectCommit 0;
    sleep 1200;
    //check all x seconds
  };
  sleep 1;
  _loop = _loop + 1;
};

put this code in a file called graphics.sqf and place it somewhere into your missionfile

to execute the script put this:

execVM "pathto\graphics.sqf";

after the

if (!isdedicated) {...};

part in your init.sqf

 

something like this:

if (!isDedicated) then {
       [... ect ... a lot of code which is not important for this]
};
execVM "pathto\graphics.sqf"; // different colorcorrection for day and night
[... etc ... left out the rest because not important]

I hope someone finds this useful :)

Share this post


Link to post
Share on other sites

thanks for this i played abit with a other CC script but it was nice in day time but in night it looked ugly.

so i got it installed dont see much off a diffrence tho i think the grass was a bit greener and i found this error in the RPT

 

11:36:01 Error in expression <ise ) and ( _daytime < _sunset ) } do {
_hndl ppEffectAdjust[1,1,0,[0,-0.12,0.05>
11:36:01   Error position: <_hndl ppEffectAdjust[1,1,0,[0,-0.12,0.05>
11:36:01   Error Undefined variable in expression: _hndl
11:36:01 File mpmissions\__cur_mp.Chernarus\addons\graphics.sqf, line 37

Share this post


Link to post
Share on other sites

After a server restart connect and then reconnect to it, the script doesnt get the time right if youre the first person on the server after a restart (always shows 12:30 for me, after a simple visit to the lobby its ok), you can change the colorcorrection effect itself of course, just adjust the variables 

ppEffectAdjust[1,1,0,[0,-0.12,0.05,0.03],[0,0,0,1.23],[-0.11,-0.11,-0.11,0]]

you could take them from wasteland, or theres a nice effect mission for arma 2 that lets you choose all that stuff and see how it looks: this one http://www.armaholic.com/page.php?id=10163

 

I get those errors too, but it works nevertheless. pulled the code for the ppeffects right off the BIS wiki, dont know why its showing that error though.

Share this post


Link to post
Share on other sites

After a server restart connect and then reconnect to it, the script doesnt get the time right if youre the first person on the server after a restart (always shows 12:30 for me, after a simple visit to the lobby its ok), you can change the colorcorrection effect itself of course, just adjust the variables 

ppEffectAdjust[1,1,0,[0,-0.12,0.05,0.03],[0,0,0,1.23],[-0.11,-0.11,-0.11,0]]

you could take them from wasteland, or theres a nice effect mission for arma 2 that lets you choose all that stuff and see how it looks: this one http://www.armaholic.com/page.php?id=10163

 

I get those errors too, but it works nevertheless. pulled the code for the ppeffects right off the BIS wiki, dont know why its showing that error though.

im almost done with work so im gonna test it out, i have noticed that this has changed automaticly

i put it in the init file like this

 

execVM ....... when i reopend the init file again it was like this [] execVM does that even matter ? (sorry solved lookded at the wrong line)

 

anyway thanks for sharing your stuff 

 

what do you mean with the time? do you mean like if its night and a server restart comes that it will be day 12:30 if so that isnt the case here.

problem is for some guys its a bit purple greenish for me it looks good at night just grayish better then stock

Share this post


Link to post
Share on other sites

i have it just as 'execVM' no [] infront of it, also putting it only on the client side in the !isdecidated block doesnt work, when i tested that i got stuck on loading ^^

sure thing its nice to know that my script serves purpose :)

ok this is how it works:

you join the server, the script runs and checks what time it is on your server (INGAME time) and depending on what time it is, the effect it switches on is different ...

nighttime colorcorrection is just a very pale purple, while the daytime is pretty heavy purple. see the difference in the pictures, the extreme purple looking is the effect from the daytime applied at nighttime. you cant see shit if its like that ^^

the thing I noticed when testing this on my server is, the script does not gets the time checking right for the very first person to join the server after a restart, it always thought it was 12:30 ... when you went back to the lobby and joined back in again, everything was fine and the correct time was returned when the script checked for it.

the script checks every 1200seconds what time it is, so if your server has a sunrise or sunset period during normal gameplay, you will actually see the colors change at some point, which you can define.

oh and btw you can customize the effect it has, if you dont like purple play around with the variables "ppEffectAdjust[1,1,0,[0,-0.12,0.05,0.03],[0,0,0,1.23],[-0.11,-0.11,-0.11,0]]" theres MUCH you can do with these numbers. for example the weird colors in the blowout effect in namalsk is done by adjusting these variables. you could even have the server looking like every body got predator view :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By Aslan247
      Hey Guys, 
      I'm running an Arma 2 Dayz Overwatch server with GTX, problem I'm having is that the server gets dark really quick. I'm wanting to have bright sunny days but it's always very overcast and within one hour of restarting it's already getting towards dusk. 
      I have Infistar installed and I have checked my Hive.ext.ini and can't seem to locate why there would be a problem. My server restarts every 3 hours 3 6 9 12 etc. GMT/UTC. 
      Can anyone be so kind as to tell me what I must do please?
      Thanks. 
       
       
       
    • By Alkeriece
      i just started up a server for friends but the server seems to be locked on day and as much as i've looked i cant find the string that lets me enable day/night cycling.
      if anyone wouldn't mind sharing the location of this that would be awesome.
    • By TheodoreCHill
      Hello

      The DayZ Epoch sky is very bland. Playing regular Arma 2, I noticed that the sky had a natural constellation which could be used for navigation. Is it possible to re-texture the sky so that we have the default Arma sky without using extensions?

      Thank you.

       
    • By killerkiwi
      hi guys ans girls im at it again making a shooting range that give you coins for points it working but need work. say if one of your players uses it battle eye kicks them
      but works fine for admins im adding sonuds to it
      this is some of the code of it but be about a week or two till its done
       
      _vehicle_78 = objNull;
      if (true) then
      {
        _this = createVehicle ["WarfareBunkerSign", [11475.7, 11385.6, 0.00119019], [], 0, "CAN_COLLIDE"];
        _vehicle_787 = _this;
        _this setDir 111.418;
        _this setVehicleInit "this setObjectTexture [0, ""1000m.jpg""]";
        _hit 1000,["_sethit100m"];
        _this setPos [11475.7, 11385.6, 0.00119019];
      };
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...