This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.
So I just tested this in multiplayer. ...It seems that the light doesn't actually ever change. The clock is still there and works fine, but the light levels don't change. Is this intentional, or some kind of bug?
 
Most lua doesnt like multiplayer, just like GreenEyes' HEAT meter, Metal Anyone's Ability Notification, Sonic RPG's Level Stats, the timescales' watch abilities and even Jasper's Star Meter. It's just how lua in srb2 works these days.
 
Yeah, but with GreenEyes' heat meter thing, its mostly just a graphical glitch. Idk about the others, but I would assume none of them have a CORE PART of the addon disabled like that. And I'm really just confused at why its the lighting changes that get disabled... I've seen lighting changes elsewhere (mostly in maps, mind) and THEY didn't break in multiplayer... I dunno if it can even be fixed, but it IS something to look into.
 
Hm, something must be wrong with your server, because I tested it several time (3-4 hours today) on three servers, and it worked perfectly.
Did you rehost ? It might be an occasional bug.
 
Nah, my script is already prevented from these.
Were you hosting a dedicated server ? The current version can't handle them (it'll probably be fixed tommorow anyway).
If not, maybe you added it during the game and didn't reset the map or change it (it's already fixed but not released yet).
If it's none of these reasons, it could just be an occasional bug, in this case just reload your server.
 
Ah, and anyway, it's true that even perfectly coded Lua scripts can be buggy in multiplayer because of the bad way srb2 synchronize the game, but in this case, the script would still act normally for the host.

---------- Post added at 10:40 PM ---------- Previous post was at 10:38 PM ----------

Ho, ok. When such cases happend, whatever script it is, you should start changing the map or rehosting to be sure the script is really broken.
Well anyway, tomorrow all of these bugs I mentionned will be fixed.
 
Ah you're right, the clock HUD won't won't work in matches. I didn't notice that because I already tested match before adding this HUD, then thought it was ok. However on your picture the bug happends line 108, and I can't figure out why. Is that the last release ?

---------- Post added at 10:57 PM ---------- Previous post was at 10:56 PM ----------

No, seconds can't be displayed, because generally the time happends faster than reality and seconds would looks like milliseconds. I'll still look for it.
 
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!
e515b23a08.png

Not even talking of ATZ.
52efd9f1ba.png
Try stepping outside at midnight and see what happens :P
 
Why don't you just change the nightlight variable ?
You could just do "nightlight 160" or "nightlight 192" it's not a big deal.
I think 128 is just good for most of the levels. Plus I like the idea that you have to sleep because of the darkness.

---------- Post added at 11:25 PM ---------- Previous post was at 11:14 PM ----------

I updated it:
-Now the script will be effective immediately after being added, even in mid-map.
-The script can handle every gametypes, and another minor bug may be possibly fixed.
-I added a beta energy bar to the advanced version. Active it with "energy on".
 
I think the energy should be based on the Lua timer (aka how many seconds/minutes have passed) rather than the in-game tics, if possible. Granted, it is just a beta so maybe you were already planning it, I don't know.
 
@LJ: The nightlight limit is 160. If I change it any far, it changes into daytime.
 
Yes the sky is based on the current light level, not the time. For now you can do nothing except changing the daysky variable to 21.
I thought it would be more logical to have a blue sky when the level is bright, however it almost depends on the level itself: in GFZ, a brightness of 128 is just perfect for a night light. I'll see later for that, because I'm not sure how I should change it. Do you think the sky should be set according to the current time instead of the brightness level ?

LunarDestroyer, what do you mean with "Lua time" ?
Technically, the only way you have to handle time with srb2 is to base your script on the number of elapsed tics since level has started.
Also, yes, the energy bar is actually a beta, not for technical reasons, sinse it seems to be already working correctly, but for gameplay reasons. I need other player's opinion to adapt my timing system to it.
 
Last edited:
I'd say just change PLAYPAL, but then that's going to alter the HUD, too.

It's not currently possible to switch between level palette sets mid-level. But since Lua is involved you can temporarily change which palette of the set is used using P_FlashPal(player, palettenum, time).
 
What I meant by "Lua time" is that when the function to make the minutes go up happens, you could make the energy go down a bit, instead of basing it on the in-game tics. Or heck, you could easily make an entirely different timer function (I could show you how that works, it's pretty simple) to do the job.
 
What I meant by "Lua time" is that when the function to make the minutes go up happens, you could make the energy go down a bit, instead of basing it on the in-game tics. Or heck, you could easily make an entirely different timer function (I could show you how that works, it's pretty simple) to do the job.

As I told you earlier, making tic-based calculations is the only way to handle time with srb2, as the OS library has been removed from BLUA. Also, there isn't a function to make the minutes go up, I had to convert tics to minute, same for seconds and hours.

---------- Post added at 07:45 PM ---------- Previous post was at 07:42 PM ----------

Ho wait, are you talking about this ?

"maxenergy" (server / admin only): Maximum amount of energy , in tics.

This is a beta, of course, that's why I just did a variable based on tics. And keep in mind that, whatever I want to do with my script, I will ALWAYS have to base the time-related functions to the in-game tics.
 
Last edited:
You don't quite understand what I'm saying. I'm saying to base it off the clock IN THE SCRIPT. The clock that the script is all about. Since you HAVE to have a function to turn seconds into minutes when they hit 60, you could modify the energy bar there. I know that you couldn't base it off the OS clock.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top