Hi !
So, I have a project in school, and I'm creating a visual novel. In this game, your stamina decreases or increases when you change your location and make choices, and you can have a "Game over" if your stamina reaches 0.
The system works, however, I have a problem : I want the "stamina bar" to always be visible (for example on the top left of the screen), even during choices, dialogues, etc and I haven't found how to do it.
It'll just be text (for now), like for example : "Your stamina = 60"
Thanks in advance if you can help me :3 !!
Stamina bar always visible
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.
Re: Stamina bar always visible
Screens are made for this.
Try
http://www.renpy.org/doc/html/index.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/style_pro ... properties
Try
Code: Select all
screen stamina_scr:
vbox:
align (0.02, 0.02)
text "Stamina = [stamina]"
bar value stamina range max_stamina xmaximum 100
label start:
$ max_stamina = 100
$ stamina = 60
"Let's begin"
show screen stamina_scr
"Your stamina is [stamina]"
menu:
"Choice 1":
$ stamina -= 10
"..."
"Choice 2":
$ stamina -= 50
"... ... ..."
"?"
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/style_pro ... properties
Re: Stamina bar always visible
Thanks
It works, except the stamina = [stamina] part.
I would like it to be like stamina = 95, is it possible ? Because it showing me exactly the text "stamina = [stamina]"
It works, except the stamina = [stamina] part.
I would like it to be like stamina = 95, is it possible ? Because it showing me exactly the text "stamina = [stamina]"
- Attachments
-
- example.png (11.41 KiB) Viewed 1387 times
Re: Stamina bar always visible
o_O How did you do this?
What version of Ren'Py do you use? Show the code that gives you the result on the picture, 'cause code works fine for me.
What version of Ren'Py do you use? Show the code that gives you the result on the picture, 'cause code works fine for me.
Re: Stamina bar always visible
I'm using the version 6.12.1.1520
Do I need to install it again ? Am I going to lose my scripts if I do that :O ?
Do I need to install it again ? Am I going to lose my scripts if I do that :O ?
Re: Stamina bar always visible
This version is way too old - a lot has changed. Like the interpolation of variables enclosed in square brackets was added in ver 6.13.
You'd better update the Ren'Py or install latest version as a separate one to use both of them.
If you do, nothing would be lost in your code (everytime you launch your project Ren'Py creates .rpyc files for its own use from your original .rpy files; if the project refusing to run in old version of Ren'Py just delete all .rpyc files - not the .rpy!). But due to changes in Ren'Py you might need to change some of your code.
In your 6.12 try
http://www.renpy.org/doc/html/changelog.html#
http://www.renpy.org/doc/html/changelog ... en-py-6-13
You'd better update the Ren'Py or install latest version as a separate one to use both of them.
If you do, nothing would be lost in your code (everytime you launch your project Ren'Py creates .rpyc files for its own use from your original .rpy files; if the project refusing to run in old version of Ren'Py just delete all .rpyc files - not the .rpy!). But due to changes in Ren'Py you might need to change some of your code.
In your 6.12 try
Code: Select all
text "Stamina = %(stamina)d"
http://www.renpy.org/doc/html/changelog ... en-py-6-13
Re: Stamina bar always visible
It's working now, thank you a lot
Who is online
Users browsing this forum: No registered users