Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
ghostkrashers
16
Years of Service
User Offline
Joined: 19th Jul 2010
Location:
Posted: 21st Jul 2010 00:40
I have looked everywhere for this comand. How do I make an integer go up once every second. I am trying to put a timer on my game.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jul 2010 01:14
Here's one way:

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 21st Jul 2010 02:05
if you don't want your program to wait, try this:


The fastest code is the code never written.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 10:24 Edited at: 21st Jul 2010 10:28
...or this:


I multiply by .001 as someone said DBP multiplies faster than dividing...

I also use this additional code to give me a string for the full time:


Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Jul 2010 10:28 Edited at: 21st Jul 2010 10:42
Quote: "I multiply by .001 as someone said DBP multiplies faster than dividing..."


Possibly, but you need to perform the operation 10's of 1000's of times, before such an optimization would give any significant benefit.

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 10:38
Quote: "but you need to performance the operation 10 of 1000's of times to give any significant benefit"

Thanks, I didn't know that! Still look after the pennies and the pounds look after themselves as they say!

Better to make something very very slightly faster than very very slightly slower I would have thought...

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 21st Jul 2010 10:53
Matrix utils has nice ticker commands for timed events, I use them a lot

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 12:05
Is there anything matrix utils can't do? If there is I don't want to do it...

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 21st Jul 2010 12:26
Quote: "Is there anything matrix utils can't do? If there is I don't want to do it..."


I know! The amount of times I've spent time writing a function and then come across a command in matrix utils that performs the same. I've said before it should really be included in the base installation, or at least some kind of popup after installing that highlights the good (nay, essential!) plugins.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jul 2010 12:32
Each of Hawkblood's ,baxslash's and sladeiw's solutions are better then mine. [Hides in a corner and sulks. ]
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 13:00
Quote: "Each of Hawkblood's ,baxslash's and sladeiw's solutions are better then mine. [Hides in a corner and sulks. ] "

Wow, I think I might actually get a screendump of that and frame it!! I'm honoured

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Jul 2010 13:22
Floating point multiplication is slower than integer division, so:


[b]
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 13:36
Quote: "Floating point multiplication is slower than integer division"

Well, I guess I'm going to have to change my code again then...

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 21st Jul 2010 19:53
Regarding multi vs division.



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jul 2010 22:22 Edited at: 21st Jul 2010 22:23
Quote: "Wow, I think I might actually get a screendump of that and frame it!! "


Am I allowed to edit the spacing and spelling first?

Looks like I was having a bad day.

Edit Or everyone else was having a good day.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 21st Jul 2010 22:42
GG, you are allowed a few screwups every once in a while.... It reminds us that tho you may be god-like, you are not yet a god.

The fastest code is the code never written.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Jul 2010 22:43
Regarding multi integer!!


Wow, talk about lightning fast in comparison!!

Quote: "Am I allowed to edit the spacing and spelling first?"

Too late it's on the wall...

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jul 2010 23:39
Oh no! My reputation is in tatters.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Jul 2010 00:25
Quote: "Oh no! My reputation is in tatters"

Me thinks it might take more than an internet screendump on the wall of an old drunk to ruin your reputation GG!!!!!

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Jul 2010 00:36
I didn't know it was on my wall. I must have drunk more than I thought.

Login to post a reply

Server time is: 2026-07-25 05:32:46
Your offset time is: 2026-07-25 05:32:46