Author Topic: Changing the sun's light with RP Time  (Read 1310 times)

Hi, i was wondering how i could modify the RP Time script to change the mission light when it is after 8PM for more realisim.

Help would be apreciated, thanks. (I will only use this on my own server)

You could change the sun's light every so often, but it'd lag a bit each time it changed and I don't think you can make maps much darker then they are.

You could change the sun's light every so often, but it'd lag a bit each time it changed and I don't think you can make maps much darker then they are.
I was on a server by plornt that did it, but i think it completely remade the sky and sun.

I was on a server by plornt that did it, but i think it completely remade the sky and sun.

Yes, Plornt has it, and I have his. I used one of his functions and re-created it. Its very simple actually. I cannot tell you how to mod RP Time, but I can tell you a few things.

1: The skybox cannot change. Actually, it can. But I wouldn't suggest it. I have seen scripts change it. It can crash some people, as it sometimes crashes me.

2: Since changing the skybox is very hard, you would have to use Destruct. Destruct is all black, so you won't notice the non-changing skybox. Also, interiors will NOT change. They will stay bright, and their shadows will not disappear... even at night, they will have shadows. This is because they need to be relighted. This can be done, BUT it will normally cause a 15 second lag spike. Also, a very bad idea.

I remember doing Funky Skybox... good times...

Would either of you mind sharing the method you used?

With my attempt nothing would actually render differently then before but the values where changed in Mission Editor, after pressing apply in mission editor it worked, but I wanted to "Apply" it via script.

Yes, Plornt has it, and I have his. I used one of his functions and re-created it. Its very simple actually. I cannot tell you how to mod RP Time, but I can tell you a few things.

1: The skybox cannot change. Actually, it can. But I wouldn't suggest it. I have seen scripts change it. It can crash some people, as it sometimes crashes me.

2: Since changing the skybox is very hard, you would have to use Destruct. Destruct is all black, so you won't notice the non-changing skybox. Also, interiors will NOT change. They will stay bright, and their shadows will not disappear... even at night, they will have shadows. This is because they need to be relighted. This can be done, BUT it will normally cause a 15 second lag spike. Also, a very bad idea.
I'd normaly be using slate.
« Last Edit: May 03, 2010, 06:15:19 AM by chrisbot6 »

Code: [Select]
Sky.delete();
new Sky(Sky)
{
position = "336 136 0";
rotation = "1 0 0 0";
scale = "1 1 1";
materialList = "base/data/skies/Sky_Spooky1/resource.dml";
cloudHeightPer[0] = "0.349971";
cloudHeightPer[1] = "0.3";
cloudHeightPer[2] = "0.199973";
cloudSpeed1 = "0.0005";
cloudSpeed2 = "0.001";
cloudSpeed3 = "0.0003";
visibleDistance = "600";
fogDistance = "500";
fogColor = $SkyR SPC $SkyG SPC $SkyB SPC $A;
fogStorm1 = "0";
fogStorm2 = "0";
fogStorm3 = "0";
fogVolume1 = "0 0 0";
fogVolume2 = "0 0 0";
fogVolume3 = "0 0 0";
fogVolumeColor1 = "128.000000 128.000000 128.000000 -222768174765569860000000000000000000000.000000";
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
fogVolumeColor3 = "128.000000 128.000000 128.000000 -170698929442160050000000000000000000000.000000";
windVelocity = "1 1 0";
windEffectPrecipitation = "1";
SkySolidColor = $SkyR SPC $SkyG SPC $SkyB SPC $A;
useSkyTextures = "0";
renderBottomTexture = "1";
noRenderBans = "1";
locked = "true";
};


Is there any other way around it? Deleting the sky causes people to crash sometimes.

Can anyone post a script to change it to night and day in a way that relights bricks. I don't mind lag, for it'd only switch like every 15 minutes or even less.

Thank you, I have successfully created a lag-less Day/Night system.

Thank you, I have successfully created a lag-less Day/Night system.
And i seem to be getting nowhere.

My script:
Code: [Select]
if $RP::pref::timeHour = 16
 {
 goToNight();
 }

 if $RP::pref::timeHour = 6
  {
  goToDay();
  }
 
function goToNight()
{
Sky.delete();
new Sky(Sky)
{
position = "336 136 0";
rotation = "1 0 0 0";
scale = "1 1 1";
materialList = "base/data/skies/Sky_Spooky1/resource.dml";
cloudHeightPer[0] = "0.349971";
cloudHeightPer[1] = "0.3";
cloudHeightPer[2] = "0.199973";
cloudSpeed1 = "0.0005";
cloudSpeed2 = "0.001";
cloudSpeed3 = "0.0003";
visibleDistance = "600";
fogDistance = "500";
fogColor = $SkyR SPC $SkyG SPC $SkyB SPC $A;
fogStorm1 = "0";
fogStorm2 = "0";
fogStorm3 = "0";
fogVolume1 = "0 0 0";
fogVolume2 = "0 0 0";
fogVolume3 = "0 0 0";
fogVolumeColor1 = "128.000000 128.000000 128.000000 -222768174765569860000000000000000000000.000000";
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
fogVolumeColor3 = "128.000000 128.000000 128.000000 -170698929442160050000000000000000000000.000000";
windVelocity = "1 1 0";
windEffectPrecipitation = "1";
SkySolidColor = $SkyR SPC $SkyG SPC $SkyB SPC $A;
useSkyTextures = "0";
renderBottomTexture = "1";
noRenderBans = "1";
locked = "true";
};
 }
 
 function goToDay()
   {
  Sky.delete();
new Sky(Sky)
{
      position = "336 136 0";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      materialList = "base/data/skies/Sky_Blue2/resource.dml";
      cloudHeightPer[0] = "0.349971";
      cloudHeightPer[1] = "0.3";
      cloudHeightPer[2] = "0.199973";
      cloudSpeed1 = "0.0005";
      cloudSpeed2 = "0.001";
      cloudSpeed3 = "0.0003";
      visibleDistance = "900";
      fogDistance = "500";
      fogColor = "0.950000 0.950000 1.000000 1.000000";
      fogStorm1 = "0";
      fogStorm2 = "0";
      fogStorm3 = "0";
      fogVolume1 = "0 0 0";
      fogVolume2 = "0 0 0";
      fogVolume3 = "0 0 0";
      fogVolumeColor1 = "128.000000 128.000000 128.000000 -222768174765569860000000000000000000000.000000";
      fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
      fogVolumeColor3 = "128.000000 128.000000 128.000000 -170698929442160050000000000000000000000.000000";
      windVelocity = "0 0 0";
      windEffectPrecipitation = "1";
      SkySolidColor = "0.600000 0.600000 0.600000 1.000000";
      useSkyTextures = "1";
      renderBottomTexture = "0";
      noRenderBans = "0";
      locked = "true";
};
 }
« Last Edit: May 04, 2010, 02:22:15 PM by chrisbot6 »

lolololol
I didn't just spoon-feed you the script

lolololol
I didn't just spoon-feed you the script
You made me notice something that I had wrong.  :cookieMonster: