Stucuk's Network Forums
https://forum.stucuk.net/

Values
https://forum.stucuk.net/viewtopic.php?f=18&t=5914
Page 1 of 1

Author:  Visinescu [ Tue Feb 05, 2019 6:33 pm ]
Post subject:  Values

Hi there, I can't figure out how I can reduce time values in counters. I've looked over the tutorial on the forum and I lnow how to add seconds. So I have 10 mins and 30 sec, and what I need to do is that every 1 second reduce 1 second from the time value till it goes to 0 but I can't figure how exactly.

Author:  stucuk [ Sun Feb 10, 2019 11:21 am ]
Post subject:  Re: Values

what are you trying to achieve? What is the goal?

P.S This forum is pretty dead. Everyone is now using a Discord Server. You can join it via the link below. Note that you don't need to download the Discord Client. You can use it through a web browser.

- https://discord.gg/zeHaMuj

Author:  Visinescu [ Sun Feb 10, 2019 9:51 pm ]
Post subject:  Re: Values

Well, I want the player to know how much time he's got to finish the mission. At the beginning he has 10 mins and every one min I want to change the value to 9,8,7 etc till it goes to 0. I know how to add them like 11,12,13 etc, but I can't figure how I can decrease the minutes.


Thank you !

Author:  stucuk [ Mon Feb 11, 2019 11:03 am ]
Post subject:  Re: Values

Well when your displaying it you can just take the maximum value like 10 and take away the current time. Or you can have a variable start at 10 and just decrease it each minute.

Code:
every bla bla bla do
begin
 SomeVariable    = SomeVariable+1;
 StringToDisplay = 10-SomeVariable;
 if SomeVariable < 10 then
 enable;
end;


Code:
SomeVariable = 10;

every bla bla bla do
begin
 SomeVariable = SomeVariable-1;
 if SomeVariable > 0 then
 enable;
end;

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/