Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 3 posts ] 
    Ares
  Fri Feb 25, 2011 11:25 pm
mv95
User avatar
Member


Location: The Netherlands
Multiple Timers
By: Ares


Introduction
Basically, this script allows you to set up invisible timers which you can use to control events. This was made upon "request" of Totum, but I thought it might be helpful for other people too.

Features
  • Practically unlimited amount of timers (I don't know why you would need over ~50 active timers simultaneously anyway...)
  • Short methods, easy to work with

Screenshots
<Post screenshots of the script in action here. If the purpose of the script is not obvious from a single screenshot, try storyboarding the function of the script with screenshots. If screenshots cannot be taken of the system in action, please say so to prevent people from asking.>

Demo
-on demand-

Script
Expand to see the code.


Instructions
Step 1. Copy/Paste Script into new script slot above 'main'.
Step 2. Enjoy!

Functions
  • set_timer("name",time[,active]) - using this in a call script will create a timer named "name", which will run for time seconds if active is true. (active is true by default)
  • pause_timer("name") - will pause timer "name"
  • activate_timer("name") - will activate timer "name"
  • timer_exist?("name") - will return true if timer "name" exists, and will return false if it doesn't.
  • at_time?("name", time) - will return true if timer "name" is at time. Otherwise returns false.
  • finished("name") - will return true if timer "name" has reached 0 (equal to at_time("name",0), but shorter)


FAQ
Q: Why is 'request' in quotation marks?
A: He didn't actually request the script, I designed it for him to solve his problem. But it is inspired by him, that's why he's in the credits.

Compatibility
I haven't tested it for any compatibility issues, so please report them should you encounter them (which I think you will not).

Credits and Thanks
Thanks to Totum for "requesting" the script.

Author's Notes
This script was whipped up quickly, so I'm open to any suggestions. Feel free to ask questions, I'll answer them if I have the time.

Terms and Conditions
Please do not redistribute this script on another forum (other than http://www.hbgames.org) without my permission (which you can get by PM-ing me).
You are free to use this script if you just mention my name in your credits.

_________________
Check out my project: The Swords of Aldineon

Old Stuff


Last edited by Ares on Mon Feb 28, 2011 1:13 pm, edited 1 time in total.

Top Top
Profile      
 

    Kingdom Ablaze
  Sat Feb 26, 2011 12:54 am
Smile, you never know when you are on camera!
User avatar



Location: Usa
i like it, i wrote my own version not too long ago, yours is clean and well documented.
Quote:
(I don't know why you would need over ~50 active timers simultaneously anyway...

i made my version of this script for respawning events. i like your idea for being able to check what time in the event is, i could do alot with that, thank you :D

_________________
Image
Kingdom Ablaze Twitter: https://twitter.com/KingdomAblaze
Kingdom Ablaze Deviant Art: http://kingdomablaze.deviantart.com/
Kingdom Ablaze: Facebook: https://www.facebook.com/KingdomAblazeTradingCardGame


Top Top
Profile      
 

    Glitchfinder
  Sat Feb 26, 2011 2:17 am
BEWARE: Glitchfinder's sense of humor sucks.
User avatar
Staff

Party Mascot

Location: Approximately 93 million miles from Sol.
Well, hmm. I saw the name of this thread, and was sure I'd find something else. I don't mean a script that does something else, though. I just mean this. I made that a couple of years ago, and never got much in the way of comments on the hbgames thread. I had assumed that this thread was some kind of repost, so my apologies for that.

Anyway, I have to admit, your solution is clean and simple. This was effectively the first script I finished, and it has a lot of stuff that could probably be done better, like you appear to have done.

_________________

Just call me Glitch.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group