Garry's Mod

Garry's Mod

Atmos Time Display
53 Comments
TheFreeman193  [author] 24 Nov, 2019 @ 5:57pm 
Erik It's fairly simple mathematically. Use math.floor() to get the hours, subtract hours from total and multiply by 60 to get minutes (you'll need to floor this value too). If you want to get seconds, it's the same; subtract floored minutes from total minutes and multiply by 60 etc.
flipflop 24 Nov, 2019 @ 6:46am 
Thank you! I did it server-side and it works.
Now i just need to multiply the decimals by 60 for it to display minutes instead of %.

Something like AtmosGlobal:GetTime() * 60 but only for decimals.
As in your example 14.5 I take the 0.5 * 60 to get 30 minutes.
Idk if this is possible but i can't think of any other way right now.
TheFreeman193  [author] 23 Nov, 2019 @ 2:55pm 
Erik If you are implementing this server-side, it is possible to call AtmosGlobal:GetTime() which returns the current time between 0 and 24 as a float (e.g. for 2:30pm it would return 14.5). This method comes from Atmos itself. You could then take this number and format it correctly for the message broadcast. Alternatively, if you are doing this client-side, you can access the already-formatted time that this addon generates, accessible as a property using ATMOSHUD.LastTime . The advantage of the latter is that the formatting will be whatever each client has set. The former is probably better though, since you wouldn't be relying on each client running my addon; it would work as long as Atmos was running on the server. Hope this helps.
flipflop 22 Nov, 2019 @ 2:34pm 
On my server, whenever someone dies, I've made it so that a message comes up in the chat for admins that says "this person died."

Do you think theres any way of adding time of death?
By somehow taking the current time this addon displays and adding it to the message?
TheFreeman193  [author] 25 Oct, 2019 @ 11:44am 
≽<∈⍩ This error occurs when Atmos is not installed or is disabled. Download Atmos here if you haven't got it already.
flipflop 22 Oct, 2019 @ 6:50pm 
I get false when i type in: lua_run print(timer.Exists'atmos_dnc_hudUpd')
flipflop 22 Oct, 2019 @ 6:48pm 
How would this be fixed?
Atmos not found! Stopping. The script can be reloaded once Atmos is running.Failed to load .nav file: Cannot access!
[ExG]ティーモ提莫醬 27 Feb, 2019 @ 4:24am 
ok,thanks
TheFreeman193  [author] 24 Feb, 2019 @ 2:47pm 
[ExG]提҈莫醬 At present, the best way to do this is to send console commands to each client in your serverside Lua environment, whether it be once when they first spawn or to update the displays dynamically. Please bear in mind however, that sending these commands can override player's personal preferences and that people run a variety of different resolutions and aspect ratios). Also note that any dynamic layout changes require a panel rebuild to display properly (see command for this in the description). In the future I may add functionality for server settings that would automatically synchronise clients' displays without altering each player's personal settings, such that they revert when in single-player or on AtmosHUD-unconfigured servers.
[ExG]ティーモ提莫醬 22 Feb, 2019 @ 8:07pm 
How do I make it so that the settings I set through console take effect for all players?
lavie is best daughteru 18 Aug, 2018 @ 6:13am 
Anyways thanks for making this.
lavie is best daughteru 18 Aug, 2018 @ 6:12am 
Does this work correctly? Does it show the right time?
TheFreeman193  [author] 15 Aug, 2018 @ 10:31am 
[SGN] 0xymoron ♥ Lua My code is using a slightly outdated method of broadcasting the time to clients, however the addon is still entirely functional as I understand it. I am currently too busy with work to push an update but there is one in the pipeline.
0xymoron 13 Aug, 2018 @ 10:58pm 
I've released an addon similar to this that works with the current version of Atmos, feel free to check it out here https://sp.zhabite.com/sharedfiles/filedetails/?id=1478645919

Author, feel free to reference my code to update yours.
Mp18 21 Feb, 2017 @ 10:22am 
k (∩ ͡° ͜ʖ ͡° )⊃━☆ magity shmagity i summon a screnshotity!
TheFreeman193  [author] 21 Feb, 2017 @ 8:39am 
Spycrab GλMER ($_$) I'll add a few the next time I've an opportunity.
Mp18 20 Feb, 2017 @ 10:23am 
I mean screenshots
TheFreeman193  [author] 20 Feb, 2017 @ 8:32am 
Spycrab GλMER ($_$) By screens, I assume you are referring to entities you can spawn and place in the map. This is something I might consider when I have more time available; thanks for the suggestion.
Mp18 19 Feb, 2017 @ 2:56am 
Add screens
TheFreeman193  [author] 27 Jan, 2016 @ 9:08am 
8Z The default for this addon is designed to integrate with the sandbox HUD, but if you change the position cvars (see above), they will be retained when you restart the game.
8Z 24 Jan, 2016 @ 10:02pm 
can you default the time pos to be top left corner?
TheFreeman193  [author] 23 Nov, 2015 @ 2:55am 
{:D K}NukeSkaarjRaptor The Α & Ω This suggests Atmos itself isn't installed or enabled. Check you have downloaded the original addon and that it is set up correctly.
KNAVE 21 Nov, 2015 @ 8:25pm 
I only see 6:30 + i don't think that time is moving (its not changing day and night not even rain)
TheFreeman193  [author] 28 Jul, 2015 @ 12:55pm 
bawiedrich If you put this into your server console:

lua_run print(timer.Exists'atmos_dnc_hudUpd')

Do you get true back?
BulletBarry 28 Jul, 2015 @ 11:20am 
it was my server so it should be installed, as for if it is enabled.. I don't know, when I load into Garrys mod and start a map, what should be the first steps in ensuring it starts working?
TheFreeman193  [author] 28 Jul, 2015 @ 4:07am 
bawiedrich First things to check:
-Is Atmos installed on both client & server, and enabled?
-Is the Atmos DNC operational and not paused?
-Does changing atmoshud_enabled have any effect?

If you can't figure it out, get back to me and I'll go through debugging it with you.
BulletBarry 27 Jul, 2015 @ 12:56pm 
Did not work for me, it displays 00:00 and no matter what I punched into console it stayed that way, how can I resolve this?
Switch 21 Jul, 2015 @ 8:48am 
Very good addon. I added it to my server and it gives it a bit of realism.
Blue Is Epic 21 Jun, 2015 @ 5:00pm 
Ok thx for clearing that up :3
TheFreeman193  [author] 21 Jun, 2015 @ 3:24pm 
Nickadamis The addon is working as far as I can tell. Bear in mind that this needs to be installed on the server you're connected to as the Atmos time can only be accessed serverside. If it isn't working in SP, check Atmos is installed, enabled on the workshop and with the atmos_enabled convar set to 1. If this is the case and you're still having problems, try putting atmoshud_enabled 1 followed by atmoshud_rebuild into your console. There may be an issue with your setup if none of the above are working.
Blue Is Epic 18 Jun, 2015 @ 6:29pm 
ITS CRAP IT DOSNT EVEN WORK
Nephrite Harmony 10 May, 2015 @ 11:10am 
Oh, alright
TheFreeman193  [author] 10 May, 2015 @ 10:53am 
Vector I'm afraid not; this addon simply takes the global float value and formats it. You can modify the atmos time settings with the atmos_dnc_* cvars in the console.
Nephrite Harmony 9 May, 2015 @ 1:26pm 
I may sound ignorant, but can it manipulate the time of day?
Twitchyb1t 25 Apr, 2015 @ 1:18pm 
found some good setting for atmos hud for DarkRP

atmoshud_anchorbottom 0
atmoshud_anchorright 0
atmoshud_posx 10
atmoshud_posy 10

with both atmoshud anchors set to 0 play around with y higher value moves it lower.
set x higher to move it left and then it will probhably move left from right side of screen on a larger number like 50 or 100 i think lol i dont know :D
Twitchyb1t 20 Apr, 2015 @ 12:48pm 
thanks only 1 problem is the hud doesnt want to move on the co-ordinates maybe you could have it be a option in the spawnmenu
TheFreeman193  [author] 20 Apr, 2015 @ 11:44am 
Twitchyb1t There will be a new functionality, allowing the server to set a default value that clients can use, in the next update. For now, you can do this in Lua by simply looping through each player and calling the appropriate console command. You can enforce this by default using the PlayerInitialSpawn hook.

hook.Add("PlayerInitialSpawn", "ForceAtmosHUDPos",function()
for _, ply in pairs(player.GetAll()) do
ply:ConCommand("atmoshud_posx <val>")
ply:ConCommand("atmoshud_posy <val>")
end
end)


This can be applied for any of the commands listed in the description above.
Twitchyb1t 17 Apr, 2015 @ 9:02am 
so how do you make it so the admin can change the position of the timer
TheFreeman193  [author] 8 Apr, 2015 @ 6:59am 
The Ebolacaust Since this addon is designed to be customised by clients, you'll need to do this manually by looping through each client and modifying their convar with Player:ConCommand [wiki.garrysmod.com].
TikTok induced ED 27 Mar, 2015 @ 9:58am 
How do I make it so that the settings I set through console take effect for all players?
the.3null.4player.6.13.3.10. 7 Mar, 2015 @ 5:38am 
Thanks for the help.
TheFreeman193  [author] 6 Mar, 2015 @ 4:02pm 
the.3null.4player.6.13.3.10. They are in pixels, yes. If you wanted to modify this based on screen size, you could always use Lua to modify the cvar with an offset based on ScrW() and ScrH().
the.3null.4player.6.13.3.10. 6 Mar, 2015 @ 12:51pm 
Oh i understand now. I thought it was in relation to the clocks position on the screen e.g. if i set both anchorright and anchorbottom to false. (0,0) or the origin would be the top left corner of the screen. but you cleared that up for me.
Thank you.

Sorry to keep asking questions but is posx and posy measured in pixels or something relative to the screen size?
TheFreeman193  [author] 5 Mar, 2015 @ 10:03am 
the.3null.4player.6.13.3.10. The anchor point of a graphical element is the point from which its position is defined. In most cases, this is the top-left corner, but it can be useful to change the anchor for objects that can change in size. anchorright and anchorbottom allow you to determine which corner the anchor position is located in. For top-left, just set these both to 0.
the.3null.4player.6.13.3.10. 4 Mar, 2015 @ 9:49pm 
I cant figure out how do the anchors work?
Perhaps you could tell me what they do.
Solo 12 Dec, 2014 @ 1:43pm 
Atmos? Isn't that the toxic gas from Doctor Who?
SASSKSS 1 Dec, 2014 @ 11:48am 
Thanks
Darian Stephens 18 Nov, 2014 @ 5:25pm 
Byotiful.
TheFreeman193  [author] 18 Nov, 2014 @ 12:38pm 
Darian Stephens That is the intention, yes.
Darian Stephens 18 Nov, 2014 @ 12:11pm 
Yay!
Also, will there be 'PM' or 'AM' respectively when using the twelve-hour mode?