Page 1 of 1

[SOLVED] Side Image problem

Posted: Mon Jul 24, 2017 1:49 pm
by Kumiii
Hello!

I've recently updated my RenPy and I noticed some codes do not work anymore. I'm a beginner in coding, so I am not sure of how to solve my problem. I've been hunting for some solutions and even cookbook, but I cannot really solve my problem due to lack of visualization.

Here is my code :

Code: Select all

define a = DynamicCharacter('player_name',
                            show_side_image=Image("adam/adam.png", xalign=0.0, yalign=1.0))
It gives me this error :

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 40, in script
    a "My name is [player_name], and I am 12 years old."
Exception: Unknown keyword arguments: side_image

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 40, in script
    a "My name is [player_name], and I am 12 years old."
  File "C:\Users\User\Documents\Renpy\renpy\ast.py", line 613, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "C:\Users\User\Documents\Renpy\renpy\exports.py", line 1147, in say
    who(what, interact=interact)
  File "C:\Users\User\Documents\Renpy\renpy\character.py", line 877, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "C:\Users\User\Documents\Renpy\renpy\character.py", line 716, in do_display
    **display_args)
  File "C:\Users\User\Documents\Renpy\renpy\character.py", line 482, in display_say
    what_text = show_function(who, what_string)
  File "C:\Users\User\Documents\Renpy\renpy\character.py", line 700, in do_show
    **self.show_args)
  File "C:\Users\User\Documents\Renpy\renpy\character.py", line 283, in show_display_say
    return renpy.display.screen.get_widget(screen, "what", layer)
  File "C:\Users\User\Documents\Renpy\renpy\display\screen.py", line 1194, in get_widget
    screen.update()
  File "C:\Users\User\Documents\Renpy\renpy\display\screen.py", line 578, in update
    self.screen.function(**self.scope)
  File "C:\Users\User\Documents\Renpy\renpy\ast.py", line 152, in apply_arguments
    return parameters.apply(args, kwargs, ignore_errors)
  File "C:\Users\User\Documents\Renpy\renpy\ast.py", line 139, in apply
    raise Exception("Unknown keyword arguments: %s" % ( ", ".join(values.keys())))
Exception: Unknown keyword arguments: side_image

Windows-7-6.1.7601-SP1
Ren'Py 6.99.12.4.2187
How exactly should I code my side image and what do I need to change?

Re: Side Image problem

Posted: Tue Jul 25, 2017 6:02 am
by warmsundae
your method looks a bit different from the one in the documentation. I can't test it right now, so sorry if it's outdated or you've already tried it.

Re: Side Image problem

Posted: Tue Jul 25, 2017 6:35 am
by wyverngem
I didn't test this, but try

Code: Select all

define a = DynamicCharacter('player_name',
                            image="adam_side")
image side adam_side = Image("adam/adam.png", xalign=0.0, yalign=1.0)

Re: Side Image problem

Posted: Tue Jul 25, 2017 1:21 pm
by Kumiii
Sorry, I tried both methods, while the game works without errors, the side image is still not appearing.

Is there any other methods I can use, or anything I need to change in screens.rpy or options.rpy?

Re: Side Image problem

Posted: Tue Jul 25, 2017 9:23 pm
by wyverngem
Sorry forgot this important bit of code. For some reason it doesn't work without the config.side_image_change_transform

Code: Select all

image side Sophia_side = Image("images/sophia.png", yalign=1.0, xalign=0.0)
define s = Character("Sophia", image="Sophia_side")

define config.side_image_change_transform = change_transform

transform change_transform(old, new):
    contains:
        old
        alpha 1.0
        linear 0.3 alpha 0.0
    contains:
        new
        alpha 0.0
        linear 0.3 alpha 1.0

Re: Side Image problem

Posted: Wed Jul 26, 2017 1:53 am
by Kumiii
For some reason the new version of RenPy kept insisting me to define change_transform, but after some alteration I got the code to work!

Thank you very much!