SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Reply
 
Thread Tools
Time Details »»
Time
Version: v2.5, by LJ Sonik LJ Sonik is offline
Developer Last Online: Jun 2019

Category: Version: SRB2 Rating: (4 votes - 4.00 average)
Released: 06-24-2014 Last Update: Never Installs: 9
Scripts Re-Useable Content

Click image for larger version

Name:	srb20026.jpg
Views:	1471
Size:	78.7 KB
ID:	5200 Click image for larger version

Name:	srb20027.jpg
Views:	1129
Size:	4.5 KB
ID:	5207 Click image for larger version

Name:	srb20029.jpg
Views:	1070
Size:	124.3 KB
ID:	5209

This is a 24 hours-based timing system with progressive night and day.
It also provides random weather changes, which include rain, snow and storms. Warning, dedicated servers are NOT supported!

You have a digital clock in the bottom-right corner of the screen that can be shown/hidden by turning the clock variable on/off.

If you can't play because of the darkness, you can skip the night by using the sleep command in the console, so the time will pass faster until you use the wakeup command. You have to set allowsleep on to sleep in a netgame.
You can neither move or see while sleeping, so make sure ennemies won't reach you. The clock is still visible, so you can know when this is morning.
Note that you can also sleep during daytime, and that in netgames the time will only speed up if every player (aside from spectators or dead players) is sleeping.

Console commands:
  • "sleep": Start sleeping. In netgame it needs allowsleep on.
  • "wakeup": Stop sleeping. In netgame it needs allowsleep on.
  • "time <hours> [minutes] [seconds]" (server/admin only): Setup the time. If minutes or seconds aren't specified, they default to 0. In addition, you can just type "day", "night", "morning" or "evening" in place of hours, minutes and seconds.
  • "displaytime": Displays the current time in the console.
  • "weather <weather> [duration]": Sets the weather, regardless of the randomweather variable. weather must be one of the followings: "sun", "sunny", "rain", "snow", "storm", "thunder" or "storm no strikes". duration is optional and is the number of hours (in-game time) before the weather changes automatically. If duration is set to "infinite", the weather will never change until the map is changed or you use the command again.
  • "timehelp": Lists all commands and variables available in this script.

Console variables:
  • "lightchange" (server/admin only): Actives or desactives the brightness changing. "Auto" will active or desactive it depending on the level.
  • "clock": Shows/hides the clock HUD.
  • "timefactor" (server/admin only): How many times faster is the time compared to reality? (default is 60, which means 1 second = 1 minute IRL).
  • "nighttimefactor" (server/admin only): How many times faster the time passes while sleeping. (default is 16)
  • "allowsleep" (server/admin only): Allows players to sleep in a netgame.
  • "daylight" (server/admin only): The brightness level during the day. 255 means it'll keep the same lightning as day, 0 means it'll be fully dark. (default is 255)
  • "nightlight" (server/admin only): The brightness level during the night. 255 means it'll keep the same lightning as day, 0 means it'll be fully dark. (default is 128)
  • "daysky" (server/admin only): The sky number used during the day. 0 will keep the normal sky of the level. (default is 0)
  • "nightsky" (server/admin only): The sky number used during the night. (default is 8)
  • "morningsky" (server/admin only): The sky number used during the morning.
  • "eveningsky" (server/admin only): The sky number used during the evening.
  • "randomweather" (server/admin only): Actives or desactives the weather changing. You can also specify one of the following values to disable some types of weather:
-"Rain" will only enable rain and storms.
-"Snow" will only enable snow.
-"Thunder" will only enable thunders with no rain.
-"NoThunder" will disable thunders.
-"NoRain" will disable rain.
-"RainNoThunder" will only enable rain with no thunders.

  • "randomweatherfactor" (server/admin only): The frequency of weather changes, in percents. Lowering it will make the weather more stable, raising it will make the weather changing more often. 100% is the default frequency.
  • "energy" (server/admin only): active or desactive the energy system.
  • "maxenergy" (server/admin only): Maximum amount of energy, in minutes.
Credits:
Thanks to speed2411 for the morning and evening skies!

Download Now

File Type: rar Time.rar (9.7 KB, 893 views)

Supporters / CoAuthors

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 06-24-2014   #2
fickleheart
ms reflec beat stan
 
fickleheart's Avatar
Default

This is really neat! It'd be nice to see more skies used for a smoother transition (there are a few evening skies available, and there might be a morning sky somewhere in the game) but otherwise it's a really cool visual thing.
__________________
OK Google, define "hubris".
fickleheart is offline   Reply With Quote
Old 06-24-2014   #3
BlasterGuy
A.K.A. TheSonicMaster580
 
BlasterGuy's Avatar
Default

But for certain levels (especially ERZ and ERCZ), there is no need for the time command, so can you please fix alot of stuff for this LUA. This LUA is pretty nice though.
BlasterGuy is offline   Reply With Quote
Old 06-24-2014   #4
LJ Sonik
Developer
Default

You're right about the sky change, I wanted to do it first, but I couldn't find a correct transition sky, unless I use the one with mountain. I thought that would looks odd to see mountains appearing at twilight, then I released a first version without it.

About disabling the lightning effects, you'll have to handle that manually because the script can't detect if the level is artificially lighted. I might eventually add some commands to disable this system and make a reject table indicating the non-affected maps.
LJ Sonik is offline   Reply With Quote
Old 06-24-2014   #5
Senku Niola
Drifting Golden Swordsman
 
Senku Niola's Avatar
Default



I broke it.
Senku Niola is offline   Reply With Quote
Old 06-24-2014   #6
QuikSilver-TH
Q.T.D.
 
QuikSilver-TH's Avatar
Default

I think it's awesome for Roleplaying and stuff like that.
QuikSilver-TH is offline   Reply With Quote
Old 06-24-2014   #7
LunarDestroyer
 
LunarDestroyer's Avatar
Default

This is a really cool script! While playing around with it, I thought of another option that could be toggled on and off: Some kind of "tiredness" or "stamina" bar, which would decrease the longer you stayed awake, and increase while asleep. The lower the bar got, the lower your stats would be. Perhaps a boost to stats when near the top of the bar, as well? Anyhow, when the bar would deplete, you would be forced into sleep mode right on the spot. It would give more reason to sleep other than: "Oh its kinda dark", at least. Anyhow, that's just my suggestion, feel free to debunk it if you want.
LunarDestroyer is offline   Reply With Quote
Old 06-24-2014   #8
LJ Sonik
Developer
Default

I thought about that while making the script, but I think it would be a better choice to release a such thing as a separate script (or wad), because it would have an impact on the gameplay, while the original script is meant just to change the apparence of a regular game.

Wait a bit please, I am editing the script according to your comments.

Last edited by LJ Sonik; 06-24-2014 at 09:13 PM.
LJ Sonik is offline   Reply With Quote
Old 06-24-2014   #9
LunarDestroyer
 
LunarDestroyer's Avatar
Default

Quote:
Originally Posted by LJ Sonik View Post
I thought about that while making the script, but I think it would be a better choice to release a such thing as a separate script (or wad), because it would have an impact on the gameplay, while the original script is meant just to change the apparence of a regular game.
It would probably be best to include it as an optional thing, with it defaulting to off. So people who don't want to bother with it can keep it off, while people who like the idea can have it on. But hey, if you want to keep the script from modifying gameplay too much, then that's fine.
LunarDestroyer is offline   Reply With Quote
Old 06-24-2014   #10
LJ Sonik
Developer
Default

In fact I am going to make several modified versions of this script, all based on the current features but adding something. I started a little modification of it, where monsters are spawning during the night. It works but is still a beta for now.

---------- Post added 06-25-2014 at 12:55 AM ---------- Previous post was 06-24-2014 at 11:28 PM ----------

I modified the script a bit. Changes:
- I added a daylight variable.
- I added an exception list at the second line of the script. Every map number here won't be affected by the script unless you set enablelightchange on.
- I fixed the clock that was getting mad with ridiculously big time factor.
LJ Sonik is offline   Reply With Quote
Old 06-25-2014   #11
Agustin1216
あなたは私の日本のユーザ名が好きですか ?
 
Agustin1216's Avatar
Default

I know you wanted night to be dark, but this is getting annoying. You can't see anything 5 foot in front of you in zones like AGZ!

Not even talking of ATZ.
__________________
Goes by Skychan or Hareimu on the IRC, depending on my activity on there.
Agustin1216 is offline   Reply With Quote
Old 06-25-2014   #12
LunarDestroyer
 
LunarDestroyer's Avatar
Default

You COULD just change the nighttime darkness with the nightlight command. Or, yknow, just sleep untill day.
LunarDestroyer is offline   Reply With Quote
Old 06-25-2014   #13
Agustin1216
あなたは私の日本のユーザ名が好きですか ?
 
Agustin1216's Avatar
Default

Yeah, but what if I wanted to play AGZ at nighttime, only wanting to play like a Starlight Palace? But... Nope, it's really darker. No reason to make THAT darker. I'd even showed the lua at the IRC and the guys were thinking the same. And, RVZ looks really weird when at night.
Anyway, I like the lua, but just make the nighttime a little more... visible to play, and this will be perfect.
__________________
Goes by Skychan or Hareimu on the IRC, depending on my activity on there.
Agustin1216 is offline   Reply With Quote
Old 06-25-2014   #14
speed2411
*Speed-Roid*
 
speed2411's Avatar
Default

Wow man. This is really cool. Could I use this for one of my mods?
__________________
Listen. I'm *Speed-Roid* Not you. Me! So I really don't want you using my name.

Spoiler:
Clearly, I controlled your mind to make you open this spoiler box. You cant resist my power!! I shall control your mind. ^_^
speed2411 is offline   Reply With Quote
Old 06-25-2014   #15
SSNTails
What part of 'RETIRED' don't you understand?
 
SSNTails's Avatar
Default



What Roly Poly Putt did was multiply all colors by 0.37, 0.37, 0.5 (r, g, b). Maybe rather than altering sector lights, you should create a bunch of colormaps of varying darkness and cycle through them.

I'd say just change PLAYPAL, but then that's going to alter the HUD, too.
__________________
Roly Poly Putt & TraceRace - for Android, iOS, & PC - http://www.spaddlewit.com
Follow me on twitter: http://www.twitter.com/SSNTails
SSNTails is offline   Reply With Quote
Old 06-25-2014   #16
LunarDestroyer
 
LunarDestroyer's Avatar
Default

Quote:
Originally Posted by Agustin1216 View Post
Yeah, but what if I wanted to play AGZ at nighttime, only wanting to play like a Starlight Palace? But... Nope, it's really darker. No reason to make THAT darker. I'd even showed the lua at the IRC and the guys were thinking the same. And, RVZ looks really weird when at night.
Anyway, I like the lua, but just make the nighttime a little more... visible to play, and this will be perfect.
You seemed to miss the first part of my reply. You can change the night time light levels with the console command "NIGHTLIGHT". You should have no problem with the darkness at night because there is a command made SPECIFICALLY to modify that.
LunarDestroyer is offline   Reply With Quote
Old 06-25-2014   #17
LJ Sonik
Developer
Default

I updated the script, now it includes morning and evening skies, although I couldn't find really adapted skies...

Quote:
Originally Posted by SSNTails View Post
What Roly Poly Putt did was multiply all colors by 0.37, 0.37, 0.5 (r, g, b). Maybe rather than altering sector lights, you should create a bunch of colormaps of varying darkness and cycle through them.
I'd say just change PLAYPAL, but then that's going to alter the HUD, too.
You're true, I didn't even thought of this way. Even though that will affect the HUD, I'll still try making a custom version of it using various colormaps.
Just to say it, if you are saying that because you think it can make the game laggy, keep in mind that the script won't update the sectors light levels at each tic, but only when the light level multiplier is changed. I could eventually update the brightness only for changes higher than 8, since the software mode doesn't count lower changes.

Quote:
Originally Posted by speed2411 View Post
Wow man. This is really cool. Could I use this for one of my mods?
You can even modify it to adapt it to your needs without asking permission, just report that in your credits. Same for everyone else.

Quote:
Originally Posted by Agustin1216 View Post
And, RVZ looks really weird when at night.
That's the reason why I added this level to the non-affected levels list.

Last edited by LJ Sonik; 06-25-2014 at 06:13 PM.
LJ Sonik is offline   Reply With Quote
Old 06-25-2014   #18
speed2411
*Speed-Roid*
 
speed2411's Avatar
Default Something nice I did.

Lj Sonik. Considering you don't have a 'proper' morning and afternoon sky, I took the liberty in editing your lua script with a custom texture. Tell me what you think.
__________________
Listen. I'm *Speed-Roid* Not you. Me! So I really don't want you using my name.

Spoiler:
Clearly, I controlled your mind to make you open this spoiler box. You cant resist my power!! I shall control your mind. ^_^
speed2411 is offline   Reply With Quote
Old 06-25-2014   #19
LJ Sonik
Developer
Default

I think "thank you !".
I won't release it as the main version for the whole reason that I want this to be a simple Lua script, but I'll propose it as an "advanced" version of it.

---------- Post added at 01:15 AM ---------- Previous post was at 12:47 AM ----------

Done ! If you need me to modify some parts of the script to fit it with your mod, feel free to ask me !
LJ Sonik is offline   Reply With Quote
Old 06-25-2014   #20
speed2411
*Speed-Roid*
 
speed2411's Avatar
Default

Quote:
Originally Posted by LJ Sonik View Post
I think "thank you !".
I won't release it as the main version for the whole reason that I want this to be a simple Lua script, but I'll propose it as an "advanced" version of it.


Done ! If you need me to modify some parts of the script to fit it with your mod, feel free to ask me !
No problem man. That's what I'm here for. Also thanks. :P
__________________
Listen. I'm *Speed-Roid* Not you. Me! So I really don't want you using my name.

Spoiler:
Clearly, I controlled your mind to make you open this spoiler box. You cant resist my power!! I shall control your mind. ^_^
speed2411 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:47 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.