Scripts / 24 hour clock script

Author
Message
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 8th Jun 2014 10:01 Edited at: 12th Jun 2014 14:37
Here\'s a working 24 hour script where the time goes up each hour. At the moment it goes up very quickly but this could be slowed down greatly.





PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 8th Jun 2014 10:26
Oh by the way to slow it down change the 0.5 in the calculation after HourOfDay. Example 0.25 would make it take twice as long

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2014 11:32
isnt that 2seconds for 1 hour?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 8th Jun 2014 20:33 Edited at: 8th Jun 2014 20:38
Yes it is, very quick I know but easily changed, only got to that point before I had to go to work and be a while before I finish this script sort of just posted it as an example of a basic timer script. Some simple math can be used to make 1 hour last as long or short as you'd like could even have







As a simpler way of making every 60 seconds as 1 hour. And now that I have typed it I prefer this way , easier to read



And this could be made more user editable friendly by this



PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2014 22:20
yes that's much nicer

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 9th Jun 2014 10:40 Edited at: 9th Jun 2014 10:46
Updated first post with a much nicer and easier for non coders to edit the time delay as well as lots more comments .



funny side note, have found myself just typing codes here on the forum instead of making like i normally do then copying here so if anything doesnt work on this one let me know but i will endeavour to test it later, i see nothing that should stop it but

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Jun 2014 13:13
Quote: " if TimePassed == delay then"

needs a capital D in delay

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 9th Jun 2014 14:00
Nice catch. Fixed

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 10th Jun 2014 21:59
Do you apply these to a random object or where do we tell it to start? I see a lot of useful scripts on here but they all have more directions to it then paste into a txt rename lua and apply to an object. Any help would be appreciated so I can understand it better.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jun 2014 23:26
yes just copy it to a file called hour.lua and apply it to the script field of an object and it'll start as soon as the game starts

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 11th Jun 2014 14:29 Edited at: 11th Jun 2014 15:15
The reason why I asked is because I immediatly tried that and nothing happened. I will try again when I have a moment, thanks for the response!!



Edit: It does not work for me, I placed it on an object and even added the prompt but it stays on hour 0:00.



Do I need to add any globals?



Sorry if this is simple.. I am slow at first because I am unsure.. but once I learn I advance quickly.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 02:19
fixed, it's just the timepassed doesnt really ever equal the delay (because it's going up too fast)


life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 12th Jun 2014 03:24 Edited at: 12th Jun 2014 03:28
Thanks smallg I was a little worried that would happen I'll update the first post now



Also added a bit under --Script by AuShadow, =)

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
Stefos
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 31st Oct 2010
Location:
Posted: 12th Jun 2014 14:17
Does anyone actually run these scripts ? I get an error in line 38 !

http://soul-reflection.com/images/master1_0001.jpg
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 12th Jun 2014 14:31 Edited at: 12th Jun 2014 14:35
@Stefos that line is optional just remove it. I think its the \ causing the issue.



Anyway I still cannot get it to do anything. I applied it to an object on my map and waited, nothing happens. I am willing to continue to test it out but I want to
PM
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 12th Jun 2014 14:38
I have no idea how those \ got in there, I have removed them however

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
almightyhood
11
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 12th Jun 2014 14:42
those \'s get into code from the private message system maybe that's how ? it has thrown me off a couple of times now lol.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
BarZaTTacKS
10
Years of Service
User Offline
Joined: 3rd Feb 2014
Location:
Posted: 12th Jun 2014 14:42 Edited at: 12th Jun 2014 15:45
It is a glitch in the forum, look around you will sometimes see \ right before a ' or "



Edit: Ok I can see its counting. Silly me was thinking this was a change the sky type of 24 hour clock script already made. I can see how useful this is for timing events.. thank you!!!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 20:30
Quote: "Does anyone actually run these scripts ? I get an error in line 38 !"


yes i did run my code which i fully corrected, just forgot to mention it when i posted


Quote: "Edit: Ok I can see its counting. Silly me was thinking this was a change the sky type of 24 hour clock script already made. I can see how useful this is for timing events.. thank you!!! "


i did make a day / night script, it's not great but you can play around with it's settings and see if it's at least a little better than 24/7 day time
http://fpscrforum.thegamecreators.com/?m=forum_view&t=207801&b=2&msg=2488584#m2488584
and u can make the 2 work together with a little effort (although i'm not sure they will completely match up on time as i use a 1 - 100 system and shadow is using a 0 - 24 system)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-12-22 05:01:53
Your offset time is: 2024-12-22 05:01:53