Night/Day Cycles

:facehoof: I need to understand GScript moar. Night Day Cycles seem easy, a weapon is added to the player and it sleeps and changes the lights. OR IS IT A CLIENT/SERVER THING? liek how do i make it so eet only does stuff on the OverWorld?

What’s one of the levels in your overworld?

nd_overworld-g06.nw

if (startswith(nd_overwold-,#L)) {

[QUOTE=Spooon;65596]if (startswith(nd_overwold-,#L)) {[/QUOTE]

thank you!

Merged doublepost_______________

Im pretty sure this won’t work too well Dx

if (playerenters) {
toweapons -nd_nightday;
}
if (startswith(nd_overwold-,#L)) {
seteffect 0,0,0,0.55;
sleep 0.5;
seteffect 0,0,0,0.56;
sleep 0.5;
seteffect 0,0,0,0.57;
sleep 0.5;
seteffect 0,0,0,0.58;
sleep 0.5;
seteffect 0,0,0,0.59;
sleep 0.5;
seteffect 0,0,0,0.60;
sleep 0.5;
seteffect 0,0,0,0.61;
sleep 0.5;
seteffect 0,0,0,0.62;
sleep 0.5;
seteffect 0,0,0,0.63;
sleep 0.5;
seteffect 0,0,0,0.64;
sleep 0.5;
seteffect 0,0,0,0.65;
sleep 0.5;
seteffect 0,0,0,0.64;
sleep 0.5;
seteffect 0,0,0,0.63;
sleep 0.5;
seteffect 0,0,0,0.62;
sleep 0.5;
seteffect 0,0,0,0.61;
sleep 0.5;
seteffect 0,0,0,0.60;
}

So thank my post.

Oh god, use a loop man…

if (startswith(nd_overwold-,#L)) {
  for (i=.55;i<.65;i+=.01) {
     seteffect 0,0,0,i;
     sleep 0.5;
  }
}

Should work. I haven’t had my morning beer yet.

that will change the effect, but it does not depend on time. you could use some modular division on gtime or something to calculate the right effect.

timevar

[QUOTE=kalzor;65611]timevar[/QUOTE]
Good luck, Benjiro.

timeout = 1;
this.tvar = timevar+5760;
this.time = {int((((this.tvar%17280)/720)%12)),((this.tvar%17280)/12)%60};
if (int(this.time[1]) < 10) message #v(this.time[0]):0#v(int(this.time[1]));
else message #v(this.time[0]):#v(int(this.time[1]));

Ripped the time stuff from Beholder’s clock scripts.

I hate day-night systems, they’re just a perpetually off color tileset. Would be less annoying if it just changed between normal and dark with some screen announcement of some sort. Then you could change what the NPCs are up to and what monsters are out?

I love your idea. I could see this going very nicely on Noddess. In the day-time it’s a happy land but when night falls the monsters come out and cause trouble! Monsters could be scared of light, so if they are near light effects/fire/lanterns they will run away. This would be awesome!

I was considering doing something like that once.

[QUOTE=benjiro;65661]I love your idea. I could see this going very nicely on Noddess. In the day-time it’s a happy land but when night falls the monsters come out and cause trouble! Monsters could be scared of light, so if they are near light effects/fire/lanterns they will run away. This would be awesome![/QUOTE]

Sounds like minecraft to me…

[QUOTE=tricxta;65716]Sounds like minecraft to me…[/QUOTE]

That’s what I thought too, LOL!

sounds like most games

[QUOTE=hosler;65720]sounds like most games[/QUOTE]

Exactly.

Usually when I do day/night I create an array with color indices for each hour(the most important is, of course, the alpha for “darkness”, but I also provide subtle shades of other colors, for example some blue and red for a slightly purple night, and I give the mornings some orange tint), then I make the script buffer between them with some simple formulas.