Jump to content


Photo

Window Timer


  • Please log in to reply
2 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 20 October 2012 - 09:33 PM

Window Timer
-Tsukihime

This script provides basic countdown timer functionality for windows.
The timer is stored in frames, and decreases by 1 per frame update.

I have also implemented two features to demonstrate how it is used (ie: make this script actually useful)

1. Message windows. Automatically skips the message when time-out
2: Choice window. Automatically selects a time-out choice.

Download

Script: http://db.tt/BUQC7Vfa

Usage

This script uses the control character "\T" (case insensitive) to specify time-out.
It is used in text input as follows

\T[n]

Where n is the number of seconds before time-out (1 second = 60 frames)

In message windows, you just need to include the control character somewhere.

In choice windows, the last choice that contains a time-out control will be selected as the time-out choice. So for example you might have

choice 1
   Yes
choice 2
   No
choice 3
   \T[5]Can you repeat the question?

If choice 2 was the cancel choice, and you time-out, then choice 3 will be selected.

For developers

For the most part you will probably only need to specify the time-out behavior. Simply alias or super that method

def update_timeout
   super
   # your code

Edited by Tsukihime, 20 October 2012 - 09:36 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 ashes999

ashes999

    Advanced Member

  • Ace Member
  • 55 posts
  • RM Skill - Jack of All Trades

Posted 31 August 2014 - 08:14 PM

This is exactly what I needed--thanks so much!

 

I hope you don't mind; I added it to my global/shared repo of scripts here.



#3 Reyce

Reyce

    Newbie

  • Ace Member
  • 1 posts
  • LocationDublin - Ireland
  • RM Skill - Designer

Posted 21 November 2014 - 09:02 AM

This is pretty cool and handy.

 

One issue/question in relation to the 2nd feature: If a choice is made should the timer not disappear or become inactive? When I was testing it I had a choice followed by a choice and the timer seemed to continue over to the second choice?


- I make board games - 

http://unitedearthboardgame.com/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users