This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.
I guess it was a misunderstanding, but I still can't understand why you absolutely want the energy bar to be changed at each new minute... Unless you were just giving me an example ? If you mean that the bar isn't precise enough for the player, I can just agree with you.

And no, there is no function to turn seconds into minutes when they hit 60.
 
Huh. How do you get the seconds-minutes-hours thing to work then...? Well, either way, I'm just saying that the tic system isn't quite easy to modify (apparently the bar gets bigger when the number goes down...?) And making an artificial Lua timer would make things easier. Something like this at the end of the script:

player.energytimer = $1 + 1

if player.energytimer == (probably make the command modify this...?)
then (insert the thing to modify the energy here)

And somewhere else you would have:
if player.energytimer == nil
then player.energytimer = 0


But that's just one suggestion.
 
I got it now, but I have no problem with the current system anyway. It isn't that complex to handle.

Ah and about the function that increases the minutes counter, it doesn't exist for the whole reason that the script doesn't have 3 variables called hours, minutes and seconds, but just a unique time variable, that stores the number of tics that have gone since midnight has passed. Then I just have to exploit it correctly to make the game seems to be 24-based.
 
Last edited:
Well, mainly I suggested it because it would make the console command easier to handle for people (possibly like me) who are like "huuuurrr how do i tics". But hey, whatever works, I suppose. Though you should set a lower limit for the console command. I set it to 1 once... The game just froze.
 
This is a beta, of course, that's why I just did a variable based on tics.
All that is already planned, don't worry. Don't worry either about the script itself, it's extremely easy to make a command that will set the energy basing on minutes rather than tics (watch the changetime command).
 
I already made a such script, but not in time.lua. Maybe I could add that as a optional feature though. Btw, a new version is coming, that'll support dedicated servers.
 
The script has been updated ! Changes:

  • Fixed a bug that would make late joiners having the lightning system broken until map is reloaded or changed.
  • Added an allowsleep variable that can disable the sleep and wakeup commands, so you can avoid problems if they are causing resynch. It doesn't affect Single Player.
  • Thanks to 2.1.11, the day sky is now the one used normally in the level. You can still change it by setting the daysky to another value than zero.
  • The maxenergy variable is now expressed in minutes rather than tics, so you can easily choose how many time players can wait before sleeping.
  • Added a timehelp command that lists all commands and variables available.
  • Also, there is no more an "advanced" version and a "light" version of the script, there is a unique download instead.
 
Last edited:
Glad that you like it ^^
May I ask why you like this variable ? Because it can avoid resynch or for another reason ?
 
May I ask why you like this variable? Because it can avoid resynch or for another reason?

Precisely because it avoids resynch when the server can not be stable with Lua.
Also after a while you may no longer want to continue using the Lua, but neither wants to reboot the server.
 
Aaaaw, looks like my script crashes the game when you add it in a netgame >.<
The only way you can use it seems to use a launcher :/

=> Updated it, though I'm not sure it fixed the bug.
 
Last edited:
Might happend in a later release...
Note that you can still fix that by adding the map name to the list at the second line of the script if you have a wad editor. This is what I'm going to do for the next version, because I forgot adding it to the list.
 
Updated !

The script has been updated ! Changes:

  • Added a random weather change system.
  • Added randomweather and randomweatherfactor variables to handle the new weather system (read the description).
  • Added three exceptions lists for levels where rain, snow or storms aren't meant to happend. These lists are similar to the one used for the brightness level, and you can change them the same way than it.
  • Added Desolate Twilight Zone to the unaffected levels list.
 
Last edited:
Updated !

The script has been updated ! Changes:

  • Changed the night sky number to 8.
  • Deeply modified the way datas synchronization was handled during netgames. Now the script can actually handle dedicated servers very well.
  • If you add this file during a netgame, you now have to reload the level or switch to another map for the script to work. Note that it should have fixed the crash on file adding.
 
Updated !

The script has been updated !
Now it will automatically detects the srb2hub so it can avoid some strange lightning behavior, like the cinema screen that was getting dark on night and the living quarters corridor that was definitely dark when entering the map during the night.
 
I'm glad to see this is still being updated, I should get back to try using it some time.
 
Hey this seems pretty neat. Too bad the main application of it would most likely be in RP servers..
 
Status
Not open for further replies.

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

Back
Top