Questions on how to use text effects..and stuff in general

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.
Message
Author
Nya-chan Production
Regular
Posts: 50
Joined: Mon Feb 09, 2009 6:45 am
Projects: autumn, Identityless
Location: Ward 7F
Contact:

Re: Questions on how to use text effects..and stuff in general

#31 Post by Nya-chan Production »

JQuartz wrote:
Nya-chan Production wrote:more general approach
Like what?
Hmmm... let me see...
JQuartz wrote:I don't (know?) how to reposition the text box thoughout the game but for the box you state the location, you can use variables to state the positions so when you want to change its position, just change the value of the variable.
I don't need repositioning the text box itself, it's still in the same place all the time. It's actually a part of the custom frame.
The problem is that when I try to center the text that should be in it (with anchoring, aligning and such), it doesn't center on a place, but rather centers on the place given by the main dialogue.
I have been wondering for some time now - am I even using the right style for those dialogues/character names... though you can't probably say without seeing them >__>;;
Currently working on: Identityless
HOW DO I INPUT THIS GODDAMN THING I WANT IN MY GAME TO IT?
WHY ARE THE CHARACTER ARTISTS SO LAZY?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Questions on how to use text effects..and stuff in general

#32 Post by JQuartz »

Nya-chan Production wrote:The problem is that when I try to center the text that should be in it (with anchoring, aligning and such), it doesn't center on a place, but rather centers on the place given by the main dialogue.
Well if it's just a few times you need to do this maybe you can use \n and \ :

Code: Select all

    "This is the main dialogue.\n\n\n\n\n\n\n\n\ \ \ \ \ \ \ \ \ This is the one you want to reposition"
If you want to use it many times, I don't think this method would be a good idea.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

MightyPeanut
Regular
Posts: 31
Joined: Sun Feb 08, 2009 6:25 am
Projects: Sinner's Eve
Contact:

Re: Questions on how to use text effects..and stuff in general

#33 Post by MightyPeanut »

managed to get the extras section working, however i'm still having issues with the menu

in the init i have this currently

Code: Select all

    $ style.choice = Style(style.default)
    $ style.choice.color = "#c0c0c0"
    $ style.menu_choice.hover_color = "#ffffff"
and

Code: Select all

"blah blah blah.{nw}" 
       menu:
                "{=choice}\n1. Go after her{/=choice}":
                        $ hayaki_points += 1
                        "blah blah blah"
the color choice is registered for the menu (ie the choices are in gray font) but hovering over them doesnt have any effect, whether i use style.menu_choice.hover_color or style.choice.hover_color. also, putting {nw} before the menu like that ends up causing the menu to appear on a new page by itself.

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Questions on how to use text effects..and stuff in general

#34 Post by JQuartz »

MightyPeanut wrote:the color choice is registered for the menu (ie the choices are in gray font) but hovering over them doesnt have any effect, whether i use style.menu_choice.hover_color or style.choice.hover_color.
I don't know how to fix it but you can just use

Code: Select all

    $ style.menu_choice[u'text in button'].color = "#ff0000"
    $ style.menu_choice[u'text in button'].hover_color = "#000000"
to achieve the same effect like so:

Code: Select all

init:
    $ style.menu_choice[u'use the main menu generator.'].color = "#ff0000"
    $ style.menu_choice[u'use the main menu generator.'].hover_color = "#000000"
label start:
    "I thought deep and hard but I could not find an answer so I decided to just...{nw}"
    menu:
        "I thought deep and hard but I could not find an answer so I decided to just...{fast}"
        "use the main menu generator.":
            pass
        "do nothing.":
            pass
In the example, the choice 'use the main menu generator.' would be the only one affected. The choice 'do nothing' and other choices will still follow the style set in the options.rpy (line 54 & 58).
MightyPeanut wrote:also, putting {nw} before the menu like that ends up causing the menu to appear on a new page by itself.
Yeah, that's what it should do. If you don't want appear on a new page by itself, just put the text/question under the menu.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

MightyPeanut
Regular
Posts: 31
Joined: Sun Feb 08, 2009 6:25 am
Projects: Sinner's Eve
Contact:

Re: Questions on how to use text effects..and stuff in general

#35 Post by MightyPeanut »

Thanks, that example really helped. The {fast} code solves one problem, and the colours/hover works now. the only problem now is that for some reason, the first choice is cyan, and becomes yellow when hovered over. The second choice is fine, and I'm sure the code is the same.

Code: Select all

    $ style.menu_choice[u'Go after her'].color = "#d0d0d0"
    $ style.menu_choice[u'Go after her'].hover_color = "#ffffff"
    $ style.menu_choice[u'Leave her alone'].color = "#d0d0d0"
    $ style.menu_choice[u'Leave her alone'].hover_color = "#ffffff"
Also, one question from my friend- Is it possible to have two lines appear at the same time (character by character like regular lines, not instantly) like so:
This line appears at the same pace as the one below it at the same time.
This line appears at the same pace as the one above it at the same time.

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Questions on how to use text effects..and stuff in general

#36 Post by JQuartz »

MightyPeanut wrote:the only problem now is that for some reason, the first choice is cyan, and becomes yellow when hovered over. The second choice is fine, and I'm sure the code is the same.
I can't replicate the error so I don't know what's wrong.
MightyPeanut wrote:Also, one question from my friend- Is it possible to have two lines appear at the same time (character by character like regular lines, not instantly) like so:
Not without some tough coding(eg. hide the textbox, create an overlay that consists of 2 ui.texts, that each would display the strings sent to them, adding one letter at a time)
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

MightyPeanut
Regular
Posts: 31
Joined: Sun Feb 08, 2009 6:25 am
Projects: Sinner's Eve
Contact:

Re: Questions on how to use text effects..and stuff in general

#37 Post by MightyPeanut »

Thread ressurection~~ Been busy with school and whatnot (yeah, right >_>) but anyways, I have another question.

I have an extras section atm, that has various extra scenes accessed by a menu with choices leading to each of them, e.g
Welcome to extras section, text, etc etc

Extra #1 (jumps to extra scene 1)
Extra #2 (jumps to extra scene 2)
etc etc
Now then, what I want to do is make it so that as you reach certain points in the main story, extras are unlocked. If no extras are unlocked yet, I want an alternate message instead of the welcome to extras section bit. What would be the easiest way to code this? While I think I may have some idea, I thought it would be better to just ask here, since I don't really have much spare time to spend trying things I'm not sure about.

000
Regular
Posts: 94
Joined: Mon Dec 24, 2007 11:09 am
Projects: Ren'Py Russian distributive
Location: Уфа, РБ, Россия
Contact:

Re: Questions on how to use text effects..and stuff in general

#38 Post by 000 »

MightyPeanut wrote:Now then, what I want to do is make it so that as you reach certain points in the main story, extras are unlocked. If no extras are unlocked yet, I want an alternate message instead of the welcome to extras section bit. What would be the easiest way to code this? While I think I may have some idea, I thought it would be better to just ask here, since I don't really have much spare time to spend trying things I'm not sure about.
How about making a persistent variable, wich, initially being set on, lets say, "false", would be set on "true" right after you unlock any extra. Then, in extras block, you just check it and, If it is set on "false", show your alternate message, else show your extras stuff.
<feels sowwy for his Engrish>

MightyPeanut
Regular
Posts: 31
Joined: Sun Feb 08, 2009 6:25 am
Projects: Sinner's Eve
Contact:

Re: Questions on how to use text effects..and stuff in general

#39 Post by MightyPeanut »

I managed to set the PAGE itself to appear based on a persistent value, but the problem now is that it's basically a menu with lots and lots of choices, each leading to different things, and each needing their own persistent data unlock. How do I do this without making a near infinite amount of menus based on the different combinations of unlocking?

Also, I have a few other questions from me and my friends.
1) if there's a choice, or a regular scene, that adds points to a value (eg str += 1 or something), and someone reads it, scrolls up, rereads/reselects the choice or another choice, will they get another point added into the value (or, if they choose another choice, continue and still keep the point they got from selecting the other choice?)
2) I managed to make unskippable pauses, but transitions are still skipped. For example

Code: Select all

 scene Prologue with slow_dissolve
       $ ui.pausebehavior(2.0)
       $ ui.interact ()
       scene bg black with slow_dissolve
Normally, the prologue cg dissolves in, it pauses there for 2 seconds, then dissolves to a black bg
If someone is mashing mouse click/enter/ctrl, the dissolve effect for the prologue cg is skipped, it appears and stays for 2 seconds, skips the black bg alltogether and continues onto whatevers after it. Is it possible to make the slow_dissolve effect in the first instance unskippable also?
3) Before I asked how to add a blinking arrow to the end of lines. I did get an answer, but at the moment it only appears for the click-for-next-page line end, not regular click-for-next-line line ends. How do I do that efficiently, and also perhaps have separate images for next page/next line?


oh and, sorry about the reposting :x

Post Reply

Who is online

Users browsing this forum: Tomoyo Ichijouji