Scripts / Clock via script?

Author
Message
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 12th Jan 2018 18:22
Is there a way to show a simple clock via script?
All the ones ive seen or have run from an always active entity, i just wondered if i could run one from my survival inventory so it shows when its open?
or is this not possible?
Thanks
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jan 2018 18:55
do you mean real time for the user or is this for an in game time of day thing?
for real time you can use
os.time()
or
os.date()
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 12th Jan 2018 19:19
Yeah did read on os.time m8 tbh i was looking for a space filler in the inventory script so game time, compass etc etc but those two look like you have to run them from a seperate entity and want to keep it all in the one script if i can to aid simplicity for setup as i already have a shed load of collecting scripts etc etc.
So i was basically looking for something game orientated to fill a space. if i dont find anything i'll maybe try the os.time and date see how it looks
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 12th Jan 2018 20:43 Edited at: 12th Jan 2018 21:25
I have an in game one. However its not exactly on miliseconds since it runs on the gtimer it is more so per frame. However you can make the time slower so its more like realtime or faster so its more like Skyrim and Fallout where as every 20 minutes is 60 minutes.

I haven't been able to get the system clock to work with the os.time and etc. Noticed it on an old LUA manual (unrelated to GG).
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Bolt Action Gaming
GameGuru Tool Maker
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 12th Jan 2018 20:48
Honkeyboy I think you have my weather kit, it has a built in clock you can enable or use.

I forget the exact function just do a ctrl-f for clock.

It does 12 hour conversion and all that, synced to the weather states.

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jan 2018 21:22 Edited at: 12th Jan 2018 21:27
why would you need to run it from a separate entity? all you're doing is counting
just add the counting part of the code somewhere in your inventory menu's main(e) and then add the code to show it once the menu is opened.

a basic 24h clock looks like this.

then you just prompt it like
Text(50,10,3,hours..":"..mins..":"..secs)

if you want AM/PM

and change the prompt to
Text(50,10,3,thours..":"..mins..":"..secs.." (period)")
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 12th Jan 2018 22:43 Edited at: 12th Jan 2018 23:06
Now G you know timers scramble my mainframe rofl think i get that tho will have a go tomorrow. The onlly clocks i have had to study have been those on an entity and when i tried to add them to the main script they monkey'd up the system :/ anyways cheers guys will have a play.
P.s i managed to fill the space with meds! do'h silly me must have had a beer brain freeze
@ BAG yeah m8 have yours, thing is i get so sucked in with creating what I'm doing when i venture out of it i get abit lost especially with the scripting side man its soooo easy to lose like 8 hours :/
P.s just tried the code and it didnt display grr stamps his feet told you !!! lol
heres the inventory script : lol you'll love this still working on the last bits so they just have prompts so i know what they do

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Jan 2018 21:23
Summat like this?



Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 15th Jan 2018 22:16 Edited at: 15th Jan 2018 22:19
Tbh m8 was going to put it where the recipies was as when i thought about it you wouldnt have a book out in the wild. well i wouldnt have though so lol been editing alot tonight will post the updated menu script in the main post if you could bang a game timer you survived the night type thing there it'd bee cool cheers p.s i did add a .png it just looked very poor :/
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Jan 2018 22:20
If I was out in the wild I'd certainly have a bunch of books!
Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 15th Jan 2018 22:27 Edited at: 15th Jan 2018 22:46
rofl ok got that in but how would you size it? lol broke it 3 times already rofl and that i suppose would depend on whether your in a post apoc zombie infested place...there again at least you would have something to hit them with
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Jan 2018 22:52
Try this, the '5' is the size btw.

Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 15th Jan 2018 23:26 Edited at: 15th Jan 2018 23:39
Thanks sorry was updating the survival script post (lots of new models yeah taht works thats pretty blooming cool too messing with the colours

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-29 06:51:38
Your offset time is: 2024-03-29 06:51:38