Suggestion for an on screen counter? [SOLVED]
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Suggestion for an on screen counter? [SOLVED]
I am hoping to have a on screen counter with a 'number of minutes left' in it. I don't want a live counter that will actively count down. I plan to have a variable that will lower the time left as people choose particular actions so it doesn't matter how fast or slow they read through choices made. I would like to have a fairly simple display of the time left in the upper left of the screen, but I don't see any examples of this sort of code to work with. If anyone can direct me at suggestions I'd appreciate it.
Last edited by Suru on Tue Jun 25, 2019 3:39 pm, edited 1 time in total.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Suggestion for an on screen counter?
You need a variable to hold the numbers of 'minutes' left. You write that out in a screen.Suru wrote: ↑Tue Jun 25, 2019 11:33 amI am hoping to have a on screen counter with a 'number of minutes left' in it. I don't want a live counter that will actively count down. I plan to have a variable that will lower the time left as people choose particular actions so it doesn't matter how fast or slow they read through choices made. I would like to have a fairly simple display of the time left in the upper left of the screen, but I don't see any examples of this sort of code to work with. If anyone can direct me at suggestions I'd appreciate it.
When ever something happens in the script you count down the value of the variable and activate screen to show the updated value.
Code: Select all
default countdown=100
screen counter():
text "Minutes left: " + str(countdown)
label start:
show screen counter
--- stuff happening ---
$ countdown -=1
show screen counter
Re: Suggestion for an on screen counter?
Thanks for replying. This I'm trying to work with. It just tells me: 'show' is not a keyword argument or valid child for the screen statement.
Re: Suggestion for an on screen counter?
Per K Grok wrote: ↑Tue Jun 25, 2019 12:31 pmYou need a variable to hold the numbers of 'minutes' left. You write that out in a screen.Suru wrote: ↑Tue Jun 25, 2019 11:33 amI am hoping to have a on screen counter with a 'number of minutes left' in it. I don't want a live counter that will actively count down. I plan to have a variable that will lower the time left as people choose particular actions so it doesn't matter how fast or slow they read through choices made. I would like to have a fairly simple display of the time left in the upper left of the screen, but I don't see any examples of this sort of code to work with. If anyone can direct me at suggestions I'd appreciate it.
When ever something happens in the script you count down the value of the variable and activate screen to show the updated value.
Code: Select all
default countdown=100 screen counter(): text "Minutes left: " + str(countdown) label start: show screen counter --- stuff happening --- $ countdown -=1 show screen counter
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Suggestion for an on screen counter?
That's puzzling. I did a test run of the script just to see that I had not slipped up somewhere.
I just replaced the pseudo line
---- stuff happens ----
and the code ran as expected.
Below the exact code I tested with.
Code: Select all
default countdown=100
screen counter():
text "Minutes left: " + str(countdown)
label start:
show screen counter
"Hello Dolly"
$ countdown -=1
show screen counter
"Success"
Re: Suggestion for an on screen counter?
I got it working! Thanks very much! All the appreciation!
Per K Grok wrote: ↑Tue Jun 25, 2019 2:18 pmThat's puzzling. I did a test run of the script just to see that I had not slipped up somewhere.
I just replaced the pseudo line
---- stuff happens ----
and the code ran as expected.
Below the exact code I tested with.
Code: Select all
default countdown=100 screen counter(): text "Minutes left: " + str(countdown) label start: show screen counter "Hello Dolly" $ countdown -=1 show screen counter "Success"
Who is online
Users browsing this forum: Google [Bot]