Timer

Non-platform specific questions.

Timer

Postby LucasA33 » Fri Aug 29, 2008 8:22 pm

I want to make a timer, So That It starts at 5min and text counts down to zero, then My actor Gets destroyed.
LucasA33
 
Posts: 79
Joined: Mon Jul 21, 2008 12:17 am
Location: Science, Technology, Computers, Programming, and Robotics.
Score: 1 Give a positive score

Re: Timer

Postby BlarghNRawr » Fri Aug 29, 2008 8:49 pm

start the text actor at 500, then create a timer for one second, set repeat to forever.
when the timer finishes, make the text -1.
then actor destroyed when text = 0! :D
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Timer

Postby LucasA33 » Fri Aug 29, 2008 8:53 pm

I got Partaily right, Tell me, Where I put the One Second Thang
LucasA33
 
Posts: 79
Joined: Mon Jul 21, 2008 12:17 am
Location: Science, Technology, Computers, Programming, and Robotics.
Score: 1 Give a positive score

Re: Timer

Postby BlarghNRawr » Fri Aug 29, 2008 8:59 pm

im not sure but i think its...
(text actor) Create actor -> ...ummmm
if(textactor = 0)
destroyactor... ur actor...
sumthing like that, u may need to ask sumone better at coding
try mine though
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Timer

Postby Rux » Sat Aug 30, 2008 12:03 am

Ok first its a WHOLE lot easier just to use a var.
First make a var don't change anything. We'll just call that timeV.
Now on the timer actors create actor,
Code: Select all
timeV = 500;

This will set the timer to 500 or you could set it to any time you want.

Now on draw actor of the timer,
Code: Select all
textNumber = timeV;

This will make you timer set its self to the var every frame.

Then create your timer set it to 1000 ms.

Then on the timer event,
Code: Select all
timeV = timeV - 1;
if(timeV == 0)
{
   DestroyTimer("YourTimer");
   DestroyActor("YourActor");
}


Good Luck! :D
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Re: Timer

Postby BlarghNRawr » Sat Aug 30, 2008 4:04 pm

...awww
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Timer

Postby Spidy » Wed Sep 03, 2008 6:55 am

Rux wrote:Ok first its a WHOLE lot easier just to use a var.
First make a var don't change anything. We'll just call that timeV.
Now on the timer actors create actor,
Code: Select all
timeV = 500;

This will set the timer to 500 or you could set it to any time you want.

Now on draw actor of the timer,
Code: Select all
textNumber = timeV;

This will make you timer set its self to the var every frame.

Then create your timer set it to 1000 ms.

Then on the timer event,
Code: Select all
timeV = timeV - 1;
if(timeV == 0)
{
   DestroyTimer("YourTimer");
   DestroyActor("YourActor");
}


Good Luck! :D


hmmm........ :)
Image
VOTE FOR MY SIGNATURE PLEASE.......THANK YOU
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron