Page 1 of 1

Cannot make name box and dialogue box appear [SOLVED]

Posted: Sun Jan 17, 2016 3:43 am
by Mimiruns
I'm a newbie that's learning how to use ren'py to tell stories like everyone else. But I have a lot of questions and issues.

These questions are solved
1: How do I change my font size? I keep trying to change the default font size but whenever I try to preview the game I keep getting an error. [SOLVED]

2: How do I change the default text box (Not just the text but the box itself) colour depending on who is speaking? Surely there has to be a way.

3: How do I make a type writter effect on my text? Instead of the text just appearing there?

4: How to change character names in the middle of the game? (I want characters who have not been introduced yet to have "???" until their name is mentioned, then I want the text box to change to their name the next time they speak.)
EDIT: I now have new issues. I have figured out how to make name boxes, but my custom name boxes and my custom speech boxes can't seem to coexist, It's either one works while the other doesn't no mater what I do. This is the result of following various tutorials that people have linked to.

My scrypt code

Code: Select all

define n = Character('Neptune', color="#ffffff", window_background="Lblue.png")
define u = Character('Uranus', color="#ffffff", window_background="Green.png")
define a = Character('???', color="#ffffff", window_background="anonbox.png")

$ n = Character('Neptune', color = "#ffffff", show_two_window=True)
$ u = Character('Uranus', color = "#ffffff", show_two_window=True)
$ a = Character('???', color = "#ffffff", show_two_window=True)

$ n = Character("Neptune", color = "#ffffff", window_background="Lbluename.png", what_xpos=0, what_ypos=5, who_xpos=2, who_ypos=0.0, show_two_window=True, show_who_window_style="say_who_window2")
$ a = Character("???", color = "#ffffff", window_background="Aname.png", what_xpos=0, what_ypos=5, who_xpos=2, who_ypos=0.0, show_two_window=True, show_who_window_style="say_who_window1")
$ u = Character("Uranus", color = "#ffffff", window_background="Greenname.png", what_xpos=0, what_ypos=5, who_xpos=2, who_ypos=0.0, show_two_window=True, show_who_window_style="say_who_window3")

My options code

Code: Select all

style.say_who_window2 = Style ('say_who_window')
    style.say_who_window2.background = Frame("Lbluename.png", 15, 15)
    style.say_who_window2.xalign = 0.0
    style.say_who_window2.yalign = 1.0
    style.say_who_window2.xpos = 2
    style.say_who_window2.ypos = 49
    style.say_who_window2.left_padding = 15
    style.say_who_window2.top_padding = 15
    style.say_who_window2.right_padding = 15 
    style.say_who_window2.bottom_padding = 15 
    
    style.say_who_window1 = Style ('say_who_window')
    style.say_who_window1.background = Frame("Aname.png", 15, 15)
    style.say_who_window1.xalign = 0.0
    style.say_who_window1.yalign = 1.0
    style.say_who_window1.xpos = 2
    style.say_who_window1.ypos = 49
    style.say_who_window1.left_padding = 15
    style.say_who_window1.top_padding = 15
    style.say_who_window1.right_padding = 15 
    style.say_who_window1.bottom_padding = 15

    style.say_who_window3 = Style ('say_who_window')
    style.say_who_window3.background = Frame("Greenname.png", 15, 15)
    style.say_who_window3.xalign = 0.0
    style.say_who_window3.yalign = 1.0
    style.say_who_window3.xpos = 2
    style.say_who_window3.ypos = 49
    style.say_who_window3.left_padding = 15
    style.say_who_window3.top_padding = 15
    style.say_who_window3.right_padding = 15 
    style.say_who_window3.bottom_padding = 15
My screens code

Code: Select all

  if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "who_window_style"

                    text who:
                        id "who"
Can anyone shed some light on what I'm doing wrong?

Re: How to change text box colour (along with other question

Posted: Sun Jan 17, 2016 4:24 am
by isanart
hey this may be helpful for you if you want to customize your textbox
http://lemmasoft.renai.us/forums/viewto ... f=8&t=9233

To answer your second question (kind of), you can have a different colour text, for example, for every character in your VN. But I don't know if you can a different textbox for every character...

Ren'py allowed to have text-speed which you can control from preferences, if your text-speed bar is full the text would just appear as like that.

To change the character name, I also have ??? person in the beginning then later changed. However, I am achieved this by making a different definition. So I make definition for ??? and also (ex: the char name is Mimi) Mimi.

I am sorry if I am not really helpful, I am also an amateur that learn by myself about renpy. May other member would answer more :)

Re: How to change text box colour (along with other question

Posted: Sun Jan 17, 2016 4:27 am
by Mimiruns
isanart wrote:hey this may be helpful for you if you want to customize your textbox
http://lemmasoft.renai.us/forums/viewto ... f=8&t=9233

To answer your second question (kind of), you can have a different colour text, for example, for every character in your VN. But I don't know if you can a different textbox for every character...
Ren'py allowed to have text-speed which you can control from preferences, if your text-speed bar is full the text would just appear as like that.

I am sorry if I am not really helpful, I am also an amateur that learn by myself about renpy. May other member would answer more :)
Nah I'm not looking for special text boxes, just the default one that changes colour. If I wanted to get a little fancer I'd like it to alternate the name box between the right and left size depending on who's talking.

Re: How to change text box colour (along with other question

Posted: Sun Jan 17, 2016 10:48 am
by Donmai
isanart gave you the right answer. Don't expect anybody here to give you the perfect answer. The perfect answer you will find if you first try to read and understand the documentation. Nearly all your questions are character creation related. You should read here: http://www.renpy.org/doc/html/dialogue. ... -narration and especially here: http://www.renpy.org/doc/html/dialogue. ... er-objects and then go back to the link isanart gave you. That said, here are some (imperfect) answers:

2: Define each character with it's own different frame as a background. You will just have to supply a different colored frame for each one.

Code: Select all

define e = Character('Eileen', color="#c8ffc8", window_background="blue_frame.png")
3: Change characters per second value on options.rpy
Look for these lines

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 0 #change it to something like 30 or 40
4: Define a character named "???". Use it when someone that hasn't been introduced yet is talking.

Re: How to change text box colour (along with other question

Posted: Sun Jan 17, 2016 7:52 pm
by Mimiruns
Donmai wrote: 4: Define a character named "???". Use it when someone that hasn't been introduced yet is talking.
I tried doing that, but I got an error that the name is not recognized. Is there something I'm doing wrong?

Re: How to change text box colour (along with other question

Posted: Sun Jan 17, 2016 8:36 pm
by Donmai
Something like

Code: Select all

define u = Character('???', color="#ffffff")
Should work.

Code: Select all

u "Hello. May I introduce myself?"

Re: How to change text box colour (along with other question

Posted: Mon Jan 18, 2016 2:44 am
by Mimiruns
Thank you, that worked out well, but I still have issues with trying to change the dafault colour of the text box from black to whatever colour the person that's speaking is. Is there any way to do that? If so, how.

Re: How to change text box colour (along with other question

Posted: Mon Jan 18, 2016 2:19 pm
by Mimiruns
Bump for new issues on the first post.

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 1:43 am
by Mimiruns
I hate to bump this so much but I really do need some assistance.

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 2:40 am
by mobychan
It's easier if you just post new question in an answer in your previous topic if it's related or a new one if it's not.
Many people might not care what you changed in your first post.

some problems with your code:
- You define your characters 3 times -> totally unnecessary
- in the two window part your screen is missing code to display the "what" part
- you change the style used by your characters but in their definition you also tell them other xpos/ypos values

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 2:51 am
by Mimiruns
mobychan wrote:It's easier if you just post new question in an answer in your previous topic if it's related or a new one if it's not.
Many people might not care what you changed in your first post.

some problems with your code:
- You define your characters 3 times -> totally unnecessary
- in the two window part your screen is missing code to display the "what" part
- you change the style used by your characters but in their definition you also tell them other xpos/ypos values

Ahh alright, I did not know that since I am completely new to the forums!

1: Understandable, I guess this is what happens when you follow 3 different tutorials who tell you do 3 different things. Things got too messy so I made a new game and started over, now the characters only have one defenition.

Code: Select all

define u = Character("Uranus", color = "#ffffff", window_background="Green.png")
define n = Character("Neptune", color = "#ffffff", window_background="Lblue.png")
define a = Character("???", color = "#ffffff", window_background="anonbox.png")
2: What part would that be? And what is missing? Could you provide an example please?

3: Another reason why I simply just scrapped the first test and made a new one. Now everything is neat again, so how would I go about giving my characters the text boxes I made? The tutorials don't seem to work.

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 3:10 am
by mobychan
2:
The part missing is this:

Code: Select all

text what id "what"
This is the screen you have when starting a new game:

Code: Select all

screen say(who, what, side_image=None, two_window=False):

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu
3:
You already have "window_background=" in your character definitions, if you want separate name boxes don't forget "show_two_window=True"

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 3:59 am
by Mimiruns
mobychan wrote:2:
The part missing is this:

Code: Select all

text what id "what"
This is the screen you have when starting a new game:

Code: Select all

screen say(who, what, side_image=None, two_window=False):

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu
3:
You already have "window_background=" in your character definitions, if you want separate name boxes don't forget "show_two_window=True"
My screen looks identical?

Code: Select all

  # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"
what is it missing?

3: I tried to add that in like so

Code: Select all

define n = Character("Neptune", color = "#ffffff", window_background="Lblue.png"show_two_window=True)
(All in the script.rpy btw)

And I got this error

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 14: invalid syntax
    Character("Neptune", color = "#ffffff", window_background="Lblue.png"show_two_window=True)
                                                                                        ^

Ren'Py Version: Ren'Py 6.99.8.959

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 4:43 am
by mobychan
The last part was missing in your starting post

and you forgot a comma before "show_two_window"

Code: Select all

define n = Character("Neptune", color = "#ffffff", window_background="Lblue.png", show_two_window=True)

Re: Cannot make name box and dialoge box appear at the same

Posted: Tue Jan 19, 2016 5:15 am
by Mimiruns
mobychan wrote:The last part was missing in your starting post

and you forgot a comma before "show_two_window"

Code: Select all

define n = Character("Neptune", color = "#ffffff", window_background="Lblue.png", show_two_window=True)
Thank you very much! It worked! You were a big help!