Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Tue May 21, 2013 10:26 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Apr 05, 2012 5:41 am 
Miko-Class Veteran
User avatar

Joined: Fri Mar 16, 2012 11:38 am
Posts: 922
Location: Tokyo, Japan
Projects: Untitled Japanese study game
Organization: Pure Anarchy
I'm having a little problem with a kind of journal system I've been using.
Basically there is a button in the main paying screen that the player can click to see a list of words they've been taught.
If they click any of those words, they will be shown an explanation of what the word means.

After a lot of messing around, it was working great, except for 1 problem...

Once I get a large list of vocabulary, I can't display them all. Any new words end up off screen.

I've been trying to figure out how to implement a good solution, such as having a scroll bar, or make it possible to have different pages. I should also mention that the list I want to show may have 200-500 words.



Code:
label aff_screen:
    scene bg notebook
    python:
       
        ui.hbox()
       
        # Column 1
        ui.vbox(xpos=0, ypos=50, xanchor='left', yanchor='top') # this positions the text
 

        if vocab_konbini > 9:
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini2", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini3", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini4", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini5", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini6", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini7", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini", clicked=ui.returns("dozo"))
            ui.textbutton("Konbini15", clicked=ui.returns("dozo"))
        if vocab_ichi > 9:
            ui.textbutton("Ichi", clicked=ui.returns("dozo"))
        if vocab_ni > 9:
            ui.textbutton("Ni", clicked=ui.returns("dozo"))
        if vocab_san > 9:
            ui.textbutton("San", clicked=ui.returns("dozo"))
        if vocab_shi > 9:
            ui.textbutton("Shi", clicked=ui.returns("dozo"))
        if vocab_yon > 9:
            ui.textbutton("Yon", clicked=ui.returns("dozo"))
        if vocab_go > 9:
            ui.textbutton("Go", clicked=ui.returns("dozo"))
        if vocab_roku > 9:
            ui.textbutton("Roku", clicked=ui.returns("dozo"))
        if vocab_shichi > 9:
            ui.textbutton("Shichi", clicked=ui.returns("dozo"))
        if vocab_nana > 9:
            ui.textbutton("Nana", clicked=ui.returns("dozo"))
        if vocab_hachi > 9:
            ui.textbutton("Hachi", clicked=ui.returns("dozo"))
        if vocab_kyu > 9:
            ui.textbutton("Kyu", clicked=ui.returns("dozo"))
        if vocab_ju > 9:
            ui.textbutton("Ju", clicked=ui.returns("dozo"))
        if vocab_hyaku > 9:
            ui.textbutton("Hyaku", clicked=ui.returns("dozo"))
        if vocab_sen > 9:
            ui.textbutton("Sen", clicked=ui.returns("dozo"))
        if vocab_man > 9:
            ui.textbutton("Man", clicked=ui.returns("dozo"))

           
        ui.text("Last line")
        ui.close() # for the vbox
       
        ui.close() # for the hbox
       
        ui.textbutton("", clicked=ui.returns("goback"))
        ui.imagebutton("return.png", "return_hover.png", clicked=ui.returns("goback"), ypos=0, xpos=0)
       
    $ picked = ui.interact()
    if picked == "goback":
        return
                                                   
    if picked == "dozo":
        $ picked = "goback"
        call explaindozo
        jump aff_screen


PS: I know that I've repeated some words, and they all lead to the same explanation. That's because I wanted this to be easier to read for other people.

_________________
Working on a VN to teach lower-conversational Japanese, and a guide to living in Japan.
It's a very long dev process.

You could help me with my game A LOT by filling out this anonymous 10 question survey: http://www.surveymonkey.com/s/6GR57YB
Massive thanks to everyone who has already filled it out!
You can see a Q&A about the survey here: http://tinyurl.com/SurveyQandA


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 8:01 am 
Veteran
User avatar

Joined: Tue Aug 12, 2008 12:02 pm
Posts: 356
Location: The treacherous Brazilian Rainforest
Projects: Valentine Square (writer) Spiral Destiny (programmer)
You can put your vbox inside a viewport and use a hbar to scroll.

_________________
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 8:12 am 
Miko-Class Veteran
User avatar

Joined: Fri Mar 16, 2012 11:38 am
Posts: 922
Location: Tokyo, Japan
Projects: Untitled Japanese study game
Organization: Pure Anarchy
Ooh, this is exciting.

I'm still having one problem though. I can show an image in the viewport, but I'm not sure how to show the journal and the entries.

Here's what I have so far:
Code:
screen button:
    vbox xalign 0.1 yalign 0.1:
        textbutton "Notebook" action ui.callsinnewcontext("aff_screen")
    # you can also use an image button:
        imagebutton:
            idle "button_idle.png"
            hover "button_hover.png"
            action ui.callsinnewcontext("aff_screen")
 

           
    #***************** VIEWPORT ************************
screen viewport_example:
    side "c b r":
         area (100, 100, 600, 400)

         viewport id "vp":
             draggable True

             add "visabackground.png"

         bar value XScrollValue("vp")
         vbar value YScrollValue("vp")     

I've tried replacing the image with other things, with no success.

_________________
Working on a VN to teach lower-conversational Japanese, and a guide to living in Japan.
It's a very long dev process.

You could help me with my game A LOT by filling out this anonymous 10 question survey: http://www.surveymonkey.com/s/6GR57YB
Massive thanks to everyone who has already filled it out!
You can see a Q&A about the survey here: http://tinyurl.com/SurveyQandA


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 12:38 pm 
Miko-Class Veteran
User avatar

Joined: Fri Dec 11, 2009 5:25 pm
Posts: 939
Quote:
I've tried replacing the image with other things, with no success.

This might be that you got errors trying to replace image with multiple buttons. You see, <side "c b r":> means that one element will be placed inside the viewport (image), one - at the bottom (horizontal bar) and one - at right (vertical bar). So, you could replace image with <vbox()>, that will have all your textbuttons. Should work.


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 1:20 pm 
Miko-Class Veteran
User avatar

Joined: Fri Mar 16, 2012 11:38 am
Posts: 922
Location: Tokyo, Japan
Projects: Untitled Japanese study game
Organization: Pure Anarchy
Despite checking the Ren'Py wiki, I still can't find any arguments that I can use with vbox that won't come back with a wide variety of error messages.

_________________
Working on a VN to teach lower-conversational Japanese, and a guide to living in Japan.
It's a very long dev process.

You could help me with my game A LOT by filling out this anonymous 10 question survey: http://www.surveymonkey.com/s/6GR57YB
Massive thanks to everyone who has already filled it out!
You can see a Q&A about the survey here: http://tinyurl.com/SurveyQandA


Top
 Profile Send private message  
 
PostPosted: Fri Apr 06, 2012 10:09 am 
Miko-Class Veteran
User avatar

Joined: Fri Dec 11, 2009 5:25 pm
Posts: 939
Quote:
I still can't find any arguments that I can use with vbox that won't come back with a wide variety of error messages

Try to use smth from here - http://www.renpy.org/doc/html/screens.html
Code:
screen viewport_example:
    side "c b r":
         area (100, 100, 600, 400)

         viewport id "vp":
             draggable True

             vbox:
                 textbutton "abc" action Return("dozo")
                 textbutton "abc" action Return("dozo")
                 textbutton "abc" action Return("dozo")
                 textbutton "abc" action Return("dozo")
                 textbutton "abc" action Return("dozo")
                 textbutton "abc" action Return("dozo")

         bar value XScrollValue("vp")
         vbar value YScrollValue("vp")


Top
 Profile Send private message  
 
PostPosted: Fri Apr 06, 2012 10:51 am 
Miko-Class Veteran
User avatar

Joined: Fri Mar 16, 2012 11:38 am
Posts: 922
Location: Tokyo, Japan
Projects: Untitled Japanese study game
Organization: Pure Anarchy
It's not what I had originally planned, but I think using this new method, the final result will be much better.

No only that, but now I have many new possibilities for other things I can add to the game.

Thanks a lot!

_________________
Working on a VN to teach lower-conversational Japanese, and a guide to living in Japan.
It's a very long dev process.

You could help me with my game A LOT by filling out this anonymous 10 question survey: http://www.surveymonkey.com/s/6GR57YB
Massive thanks to everyone who has already filled it out!
You can see a Q&A about the survey here: http://tinyurl.com/SurveyQandA


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


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
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group