Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Timed event

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
MADSOFT Games
Representing more than 80% of the internet!




Joined: 06 Nov 2004
Posts: 221
Location: AWESOME land

PostPosted: Fri Jul 25, 2008 5:45 pm    Post subject: Timed event Reply with quote

I want an event to happen every hour, but I'm not sure how to make that work. I don't want to have to write this:
Code:
if (((Hours of play)>=1),or,((hours of play)>=2)),or,etc...
then,
(
script
)
end

Help plz?
_________________
http://www.madsoftgames.net/
http://www.madsoftgames.org/
http://www.andrewdavid.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Jul 25, 2008 8:09 pm    Post subject: Reply with quote

you want set timer
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MADSOFT Games
Representing more than 80% of the internet!




Joined: 06 Nov 2004
Posts: 221
Location: AWESOME land

PostPosted: Sat Jul 26, 2008 7:02 am    Post subject: Reply with quote

James Paige wrote:
you want set timer


Thanks James Awesome Paige, but I'm not sure I understand the "speed" parameter in set timer.
Could anyone please explain it?
Much appreciated
_________________
http://www.madsoftgames.net/
http://www.madsoftgames.org/
http://www.andrewdavid.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Sat Jul 26, 2008 7:09 am    Post subject: Reply with quote

Speed refers to the rate that the 'Count' decreases in ticks.

So a speed of 16 (Roughly one second) means that your 'Count' will go down by one with each second.
Back to top
View user's profile Send private message Send e-mail AIM Address
MADSOFT Games
Representing more than 80% of the internet!




Joined: 06 Nov 2004
Posts: 221
Location: AWESOME land

PostPosted: Sat Jul 26, 2008 7:15 am    Post subject: Reply with quote

So basically, if I want it to count down 1 second every second (real-time) then I set speed to 16?
_________________
http://www.madsoftgames.net/
http://www.madsoftgames.org/
http://www.andrewdavid.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sat Jul 26, 2008 7:15 am    Post subject: Reply with quote

speed is the number of game ticks to count off.

If I wanted something to happen after 10 game ticks, I would probably write

Code:

set timer(1, 1, 10, @something)


This would set up timer #1 to wait for one block of 10 ticks.

However, If I wanted something to happen after 60 seconds, I might write this:

Code:

set timer(1, 60, 18, @something)


This would cause timer #1 to wait for 60 blocks of about 1 second (18 game ticks is one second)

Another way to think of it is: "count times speed equals total ticks to wait".
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MADSOFT Games
Representing more than 80% of the internet!




Joined: 06 Nov 2004
Posts: 221
Location: AWESOME land

PostPosted: Sat Jul 26, 2008 4:06 pm    Post subject: Reply with quote

James Paige wrote:
speed is the number of game ticks to count off.

If I wanted something to happen after 10 game ticks, I would probably write

Code:

set timer(1, 1, 10, @something)


This would set up timer #1 to wait for one block of 10 ticks.

However, If I wanted something to happen after 60 seconds, I might write this:

Code:

set timer(1, 60, 18, @something)


This would cause timer #1 to wait for 60 blocks of about 1 second (18 game ticks is one second)

Another way to think of it is: "count times speed equals total ticks to wait".


Thanks! it's working perfectly! I used this for the day/night feature in Xerion. You can see it in the DEMO
_________________
http://www.madsoftgames.net/
http://www.madsoftgames.org/
http://www.andrewdavid.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group