Setup different folders / Using bars or textboxes

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Rocketballs
Newbie
Posts: 2
Joined: Mon Jun 18, 2012 3:21 pm
Projects: Zombie Adventure (placeholder name)
Contact:

Setup different folders / Using bars or textboxes

#1 Post by Rocketballs » Mon Jun 18, 2012 3:36 pm

I started using ren'py recently.
So far things look easy enough to do on my own.
Having actual python knowledge is helping a bit :)
Images are another story though xD

Anyway, 2 problems came up.

I like having things neatly organized in different folders.
How can I split the .rpy files across folders (different story chapther)?
Same with resources. Not having to put everything together in the "game" folder.

I want to display health values (current/maximum). I can do it with text but with a "ui.bar" nothing shows up.
What code do I need?
I wanted it to look like a button basically (the frame around).

Thanks.
(I hope I was clear enough)

User avatar
Raindrops
Regular
Posts: 40
Joined: Fri Jan 27, 2012 4:18 pm
Projects: My Secret Spring (Co-writer & Proofreader), [Secret]
Contact:

Re: Setup different folders / Using bars or textboxes

#2 Post by Raindrops » Mon Jun 18, 2012 4:03 pm

For the first problem, all you have to do is put the location of where you've stored the resources. e.g. If you put it in the bg folder, in the game folder, you would put:

Code: Select all

"bg/bgname.jpg"
Also, for splitting the .rpy files all you have to do is do what you do as normal. e.g.

Code: Select all

# This is in the script.rpy
c "blah blah blah"
jump day1

#In the day1.rpy
c "today is a nice day blah blah blah."
Make sure to save them as .rpy or it won't work. To make a new .rpy in jEdit just press CTRL+N.
TOPofBB
All my life, my heart has yearned for a thing I cannot name.
- Andre Breton

Rocketballs
Newbie
Posts: 2
Joined: Mon Jun 18, 2012 3:21 pm
Projects: Zombie Adventure (placeholder name)
Contact:

Re: Setup different folders / Using bars or textboxes

#3 Post by Rocketballs » Mon Jun 18, 2012 4:16 pm

Every folder has to be inside "game" then?
I tried doing "game" and "res" folders. That's why it didnt work probably.


What I said about splitting the script was not the .rpy files but where to put them.
Can I do:
"game/chapter1/day1.rpy"
"game/chapter1/day2.rpy"
...
"game/chapter2/day10.rpy"

And type:

Code: Select all

# This is in the script.rpy
c "blah blah blah"
jump chapter1/day1
[/s]

This works too. I just tested it.
Options, screens and script have to stay in the "game" but the rest can be in any sub-folder.

All I need is my 2nd problem solved now :)

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Setup different folders / Using bars or textboxes

#4 Post by Showsni » Mon Jun 18, 2012 7:40 pm

Rocketballs wrote:I started using ren'py recently.
I want to display health values (current/maximum). I can do it with text but with a "ui.bar" nothing shows up.
What code do I need?
I wanted it to look like a button basically (the frame around).

Thanks.
(I hope I was clear enough)
You could make a screen to show the bar on. Something like:

Code: Select all

screen healthbar:
    frame:
        xmaximum 250
        xalign 1.0
        yalign 0.0
            hbox:
                text "HP"
                bar value currenthp range maxhp
then use show screen healthbar to show it and hide screen healthbar to hide it.

Post Reply

Who is online

Users browsing this forum: Google [Bot]