On Asking Questions

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
nixrlz
Newbie
Posts: 5
Joined: Sun Aug 13, 2017 11:50 am
Contact:

Re: On Asking Questions

#91 Post by nixrlz » Sat Aug 19, 2017 12:57 pm

How do I link user choice to two variable ?
FOR EXAMPLE :

$ USERCHOICE = "X" OR "Y"

X = IMAGE_CHARACTER1

Y= IMAGE_CHARACTER2

the chosen X or Y become 1 variable = image CHOOSENCHARATER

so i can just type

show image CHOOSENCHARACTER

and the shown image will depend on user choice(whether it's X or Y)

evilangelhl
Newbie
Posts: 1
Joined: Mon Sep 04, 2017 6:48 am
Contact:

Re: On Asking Questions

#92 Post by evilangelhl » Mon Sep 04, 2017 7:02 am

I want to translate Katawa Shoujo from English to Vietnamese for my friends in vietnam. But DejaVuSans not support vietnamese. I don't change font in game. Help me how to change font ? Example font DejaVeSans to Time News Roman (or .....) :( Thanks

JerzyEx
Newbie
Posts: 2
Joined: Sat Oct 07, 2017 3:40 pm
Contact:

Re: On Asking Questions

#93 Post by JerzyEx » Sat Oct 14, 2017 4:40 am

What about updating Python 2.7? Especially platform.py to correctly detect windows version.

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1760
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: On Asking Questions

#94 Post by Imperf3kt » Sat Oct 14, 2017 7:53 am

JerzyEx wrote:
Sat Oct 14, 2017 4:40 am
What about updating Python 2.7? Especially platform.py to correctly detect windows version.
PyTom did not create Python 2.7, he cannot update it.
Python does have an update, it is calld Python 3.4, Ren'Py cannot be 'simply updated' to 3.4 without significant work.
PyTom has also stated his intentions to stay with 2.7.

As to the detecting windows version, start > run > winver
If it says Windows 10, this is not a fault with Python, but a fault with Windows x. If it says something else and does not match what tracebacks, etc report, then it may be python.
Image

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

JerzyEx
Newbie
Posts: 2
Joined: Sat Oct 07, 2017 3:40 pm
Contact:

Re: On Asking Questions

#95 Post by JerzyEx » Sat Oct 14, 2017 9:38 am

Sorry for my english. I mean update current version of Python (2.7.10?) in RenPy. Last Python version is 2.7.14 and it contain new platform.py

Changelog from platform.py:

Code: Select all

...
#    1.0.8 - changed Windows support to read version from kernel32.dll
#    1.0.7 - added DEV_NULL
#    1.0.6 - added linux_distribution()
...
I`am replacing platform.py at renpy/lib/pythonlib2.7 and it`s correctly detect windows version. But this method is a bad way.

seden
Newbie
Posts: 1
Joined: Sat Oct 28, 2017 6:21 pm
Contact:

Re: On Asking Questions

#96 Post by seden » Sat Oct 28, 2017 6:46 pm

Hello,

Here is the error Im getting, some others games are also having the very same..

Code: Select all

Traceback (most recent call last):
  File "/home/seden/bin/Jeux/RPG/!Adult/!Renpy/Heart of Fire-1.1/Heart of Fire.py", line 198, in <module>
    main()
  File "/home/seden/bin/Jeux/RPG/!Adult/!Renpy/Heart of Fire-1.1/Heart of Fire.py", line 195, in main
    renpy.bootstrap.bootstrap(renpy_base)
  File "/home/seden/bin/Jeux/RPG/!Adult/!Renpy/Heart of Fire-1.1/renpy/bootstrap.py", line 270, in bootstrap
    renpy.import_all()
  File "/home/seden/bin/Jeux/RPG/!Adult/!Renpy/Heart of Fire-1.1/renpy/__init__.py", line 365, in import_all
    renpy.styledata.import_style_functions()
  File "/home/seden/bin/Jeux/RPG/!Adult/!Renpy/Heart of Fire-1.1/renpy/styledata/__init__.py", line 26, in import_style_functions
    import renpy.styledata.style_functions  # @UnresolvedImport
  File "style.pxd", line 84, in init style_functions (gen/renpy.styledata.style_functions.c:18784)
AttributeError: 'module' object has no attribute 'StyleCore'
^C
Any idea if there is something to do ?

User avatar
Ookami
Newbie
Posts: 1
Joined: Thu Nov 16, 2017 1:26 pm
Contact:

Re: On Asking Questions

#97 Post by Ookami » Fri Nov 17, 2017 3:41 pm

Hii Does anyone know How to do make appending messages and the ability to scroll up in nvl mode??

opaopa13
Newbie
Posts: 13
Joined: Mon Nov 20, 2017 9:25 pm
Contact:

Re: On Asking Questions

#98 Post by opaopa13 » Tue Dec 05, 2017 10:22 pm

This is probably a really simple syntax problem, but for the life of me, I cannot figure out what I'm doing wrong. All I want is for a bar to descend from off the top of the screen, decrease in value, then rise back up. Here's how I define the bar and its animations (in screens.rpy):

Code: Select all

screen funnybar:
    frame:
        xalign 0.9 ypos 0
        xanchor 1.0 yanchor 1.0
        xsize 500
        bar:
            value funny range 100
            left_bar Solid("#0F0")
            right_bar Solid("#F00")
 
transform descend:
    linear 3.0 ypos 50

transform ascend:
    linear 3.0 ypos 0
Then I try to display the funnybar. But the only things that works is renpy.show_screen("funnybar")!

"show funnybar" generates the default "image not found" silhouette, "screen funnybar" doesn't show anything, so I have to use the renpy.show_screen() python statement. Then I try to apply the transform, and that's where I'm completely stuck: renpy.show_screen() doesn't take a transform, so I don't know how to make it drop down from there.

Can transforms simply not be applied to screens? Am I fundamentally misunderstanding the role of screens? Should I be composing funnybar out of Displayables instead? I hope I can still take advantage of a smooth animation when the bar's value is decreased...

Thank you for any help/guidance!

edit: tried to make a Displayable version instead. Can't get it to display. This is my approach so far:

Code: Select all

define green = Solid("#0F0", xfill=True, yfill=True)
define red = Solid("#F00", xsize=400, yfill=True)
define fbar = HBox(green, red, xpos=500, ypos=500, xsize=500, ysize=50)
Not sure why this one is going wrong either. Any advice?

edit2: Okay, got it. Here's my code -- if anyone wants to look over this and tell me if I made anything more complicated than necessary, I'd appreciate the advice. There's definitely room for improvement, but as this is just used for a brief visual gag, I didn't bother making it a really robust "class".

setup:

Code: Select all

    
        python:
        def show_green(st, at):
            # improvements: replace the globals with local variables; make timing based on clock, not on refreshes
            global target_width, displayed_width
            if target_width < displayed_width:
                displayed_width -= 2
            elif target_width > displayed_width:
                displayed_width += 2
            return Solid("#0F0", xsize=displayed_width, yfill=True), 0.005
    
    define dynamic_green = DynamicDisplayable(show_green)
    define red = Solid("#F00", xfill=True, yfill=True)
    define barback = Solid("#FFF", xfill=True, yfill=True, xanchor=0.5, yanchor=0.5)
    define inner_bar = HBox(dynamic_green, red, xsize=400, ysize=30, xanchor=0.5, yanchor=0.5)
    # note: the thing you want to put on screen needs to be an "image"!
    image fbar = Fixed(barback, inner_bar, xsize=404, ysize=34, xanchor=0.5, yanchor=1.0, xpos=0.95, ypos=0)
Then I can use fbar with Positions and Transforms, just like I want, while also changing its appearance by setting the value of "target_width" (for a gradual change) or both "target_width" and "displayed_width" (for an immediate change).

I hope this helps someone?

RenpyIsBae
Newbie
Posts: 1
Joined: Mon Apr 16, 2018 9:29 pm
Contact:

Re: On Asking Questions

#99 Post by RenpyIsBae » Mon Apr 16, 2018 9:39 pm

Can someone explain like I'm 5 how to dissolve multiple images, I still don't understand. I do know how to do time dissolves but not multiple. Thanks in advance!

denis053
Newbie
Posts: 1
Joined: Mon Apr 30, 2018 5:31 pm
Contact:

Re: On Asking Questions

#100 Post by denis053 » Mon Apr 30, 2018 5:37 pm

I try to run this code:

Code: Select all

    $ texta1 = "testtext"
    image testText = Text(texta1, size=80)
It shows: NameError: name 'texta1' is not defined

Code: Select all

    $ texta1 = "testtext"
    image testText = Text("[texta1]", size=80)
Same error.
What i doing wrong?

User avatar
xavimat
Eileen-Class Veteran
Posts: 1313
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: xavimat
Location: Italy
Contact:

Re: On Asking Questions

#101 Post by xavimat » Tue May 08, 2018 11:07 am

denis053 wrote:
Mon Apr 30, 2018 5:37 pm
I try to run this code:

Code: Select all

    $ texta1 = "testtext"
    image testText = Text(texta1, size=80)
It shows: NameError: name 'texta1' is not defined

Code: Select all

    $ texta1 = "testtext"
    image testText = Text("[texta1]", size=80)
Same error.
What i doing wrong?
Hi denis, better if you open a new thread for new questions, this thread is for "How to ask questions".
Anyway, the problem in your code -it seems- is that you cannot define images outside init phase. That is: Renpy starts executing all init lines: "init, define, default, image...", and, after that, shows the main screen. If your code is inside a label (I'm guessing, we can't see), the image line is executed at init time, and the $ line is not, so texta1 is not defined.
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: birctreel