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

Timer?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Wed Jan 10, 2007 10:25 am    Post subject: Timer? Reply with quote

I have an idea for my game, where the hero has a certain amount of time to do a certain objective. Like 10 seconds.. I know it's possible to plotscript this stuff and show a timer and all that stuff. But I was wondering if somebody could help me make a quick script that sets up a timer and stuff.

My ultimate plan for it, is if the player can set all 3 tags on before the timer runs out, then an event would happen. But if the player fails, something else would happen.

Could anyone be cool enough to kinda construct it and explain it so I can figure out how to make one later on? You will get mad props in the game I am working on now.
Back to top
View user's profile Send private message Send e-mail AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Wed Jan 10, 2007 10:32 am    Post subject: Reply with quote

Code:
global variable(1, seconds)
global variable(2, minutes)
global variable(3, hours)

script, start timer, begin #records timer start
 seconds:=seconds of play
 minutes:=minutes of play
 hours:=hours of play
 set tag(tag:Timer, on)
end

script, elapsed time, begin #returns elapsed time in seconds
 variable(total)
 total:=(hours -- hours of play)*3600 #3600 sec/hr
 total+=(minutes -- minutes of play)*60 #60 sec/min
 total+=seconds -- seconds of play
 return (total)
end

script, check timer, begin
 if (check tag(tag:Timer),and,elapsed time > 300) # 5 minutes, let's say
 then
 (
   #do whatever you do when the timer has run out
 )
end


This is kind of rudimentary, but it should point you in the right direction.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Wed Jan 10, 2007 10:36 am    Post subject: Reply with quote

I'm sure that can help.. But I'm no plotscripter, so how will I use those three scripts to do the one thing I need to do? I'm pretty sure I know what to do with the globals.
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Wed Jan 10, 2007 11:12 am    Post subject: set timer Reply with quote

scripting a timer in the current version is a huge pain, but the next release will contain a cool new plotscripting command which makes timers really easy. 'plot:set timer'

You can test the feature out now if you use a nightly WIP build
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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