Garry's Mod

Garry's Mod

Atmos Time Display
53 kommentarer
TheFreeman193  [ophavsmand] 24. nov. 2019 kl. 17:57 
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 kl. 6:46 
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  [ophavsmand] 23. nov. 2019 kl. 14:55 
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 kl. 14:34 
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  [ophavsmand] 25. okt. 2019 kl. 11:44 
≽<∈⍩ This error occurs when Atmos is not installed or is disabled. Download Atmos here if you haven't got it already.
flipflop 22. okt. 2019 kl. 18:50 
I get false when i type in: lua_run print(timer.Exists'atmos_dnc_hudUpd')
flipflop 22. okt. 2019 kl. 18:48 
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 kl. 4:24 
ok,thanks
TheFreeman193  [ophavsmand] 24. feb. 2019 kl. 14:47 
[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 kl. 20:07 
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 kl. 6:13 
Anyways thanks for making this.
lavie is best daughteru 18. aug. 2018 kl. 6:12 
Does this work correctly? Does it show the right time?
TheFreeman193  [ophavsmand] 15. aug. 2018 kl. 10:31 
[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 kl. 22:58 
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 kl. 10:22 
k (∩ ͡° ͜ʖ ͡° )⊃━☆ magity shmagity i summon a screnshotity!
TheFreeman193  [ophavsmand] 21. feb. 2017 kl. 8:39 
Spycrab GλMER ($_$) I'll add a few the next time I've an opportunity.
Mp18 20. feb. 2017 kl. 10:23 
I mean screenshots
TheFreeman193  [ophavsmand] 20. feb. 2017 kl. 8:32 
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 kl. 2:56 
Add screens
TheFreeman193  [ophavsmand] 27. jan. 2016 kl. 9:08 
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 kl. 22:02 
can you default the time pos to be top left corner?
TheFreeman193  [ophavsmand] 23. nov. 2015 kl. 2:55 
{: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 kl. 20:25 
I only see 6:30 + i don't think that time is moving (its not changing day and night not even rain)
TheFreeman193  [ophavsmand] 28. juli 2015 kl. 12:55 
bawiedrich If you put this into your server console:

lua_run print(timer.Exists'atmos_dnc_hudUpd')

Do you get true back?
BulletBarry 28. juli 2015 kl. 11:20 
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  [ophavsmand] 28. juli 2015 kl. 4:07 
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. juli 2015 kl. 12:56 
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. juli 2015 kl. 8:48 
Very good addon. I added it to my server and it gives it a bit of realism.
Blue Is Epic 21. juni 2015 kl. 17:00 
Ok thx for clearing that up :3
TheFreeman193  [ophavsmand] 21. juni 2015 kl. 15:24 
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. juni 2015 kl. 18:29 
ITS CRAP IT DOSNT EVEN WORK
Nephrite Harmony 10. maj 2015 kl. 11:10 
Oh, alright
TheFreeman193  [ophavsmand] 10. maj 2015 kl. 10:53 
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. maj 2015 kl. 13:26 
I may sound ignorant, but can it manipulate the time of day?
Twitchyb1t 25. apr. 2015 kl. 13:18 
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 kl. 12:48 
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  [ophavsmand] 20. apr. 2015 kl. 11:44 
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 kl. 9:02 
so how do you make it so the admin can change the position of the timer
TheFreeman193  [ophavsmand] 8. apr. 2015 kl. 6:59 
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 kl. 9:58 
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 kl. 5:38 
Thanks for the help.
TheFreeman193  [ophavsmand] 6. mar. 2015 kl. 16:02 
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 kl. 12:51 
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  [ophavsmand] 5. mar. 2015 kl. 10:03 
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 kl. 21:49 
I cant figure out how do the anchors work?
Perhaps you could tell me what they do.
Solo 12. dec. 2014 kl. 13:43 
Atmos? Isn't that the toxic gas from Doctor Who?
SASSKSS 1. dec. 2014 kl. 11:48 
Thanks
Darian Stephens 18. nov. 2014 kl. 17:25 
Byotiful.
TheFreeman193  [ophavsmand] 18. nov. 2014 kl. 12:38 
Darian Stephens That is the intention, yes.
Darian Stephens 18. nov. 2014 kl. 12:11 
Yay!
Also, will there be 'PM' or 'AM' respectively when using the twelve-hour mode?