UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Timers

broken avatar :(
Created 10 years ago
by nabaro
0 Members and 1 Guest are viewing this topic.
2,460 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
The map that I'm working on relies a lot on timers, so I'm going to ask three questions about them. Answers to any would be greatly appreciated. How do I pause a timer? How do I extract the current value (how many seconds) of a timer? How do I make it so that more time goes down on them more or less than one second per second? Thanks in advance!
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
How do I pause a timer?

probably with a variable and an if statement. If the variable is true (or a certain value) then the code in the if statement gets processed.

Quote
How do I extract the current value (how many seconds) of a timer?

Again, you could just declare variables certain values like:

Code Snippet
Plaintext
var1 = 1;
var2 = 2;
wait(var1);
wait(var2);
Quote
How do I make it so that more time goes down on them more or less than one second per second?

You would need to do some math then. The UGX wiki's script guide might help with this, but basically:

Code Snippet
Plaintext
var = 5;
new_var = var + 10;


Obviously if you want to do multiplication or division you gotta change the signs but thats really all it is. I don't think theres an engine clock so your going to have to really think.
Last Edit: March 28, 2014, 12:42:16 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
I don't think theres an engine clock so your going to have to really think.

There is an engine clock, which can be accessed by
Code Snippet
Plaintext
 setTimer(time);

or
Code Snippet
Plaintext
SetClock( time, full time, material, height, width);
I'm just wondering whether there are functions that can alter the timers created by these functions.

(Edited to add the code correctly).
Last Edit: March 28, 2014, 01:15:37 am by nabaro
Marked as best answer by nabaro 10 years ago
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
I think that timer / clock functionality is pretty basic and you can't really stop / pause it. You can make the clock faster by setting the full time to less than 60 seconds and vice versa.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Thanks  :)! One more thing, is there a way to return the value of the time that the timer/clock is at?
Last Edit: March 28, 2014, 03:08:55 pm by nabaro
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
I don't think the engine has any function for that. You'll have to keep track of that with your own code.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 January 2014
Last active: 3 years ago
Posts
143
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
nabaro's Groups
nabaro's Contact & Social Linkschelseafan122099nabarogamerblast11
Okay, thanks so much for your help! :)

 
Loading ...