A bug within renpy

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

A bug within renpy

#1 Post by firecat »

So an old code like this one:

Code: Select all

golf = "golf.jpg"
    renpy.show("golf")
    renpy.hide("golf")
seems to not be working, at first I thought it was the new GUI but still same problem. So after many many countless testing from other versions, i decided to copy volume 3 of my game script, options and screens onto the newest renpy and the 6.99.7 version which was originally created from. Still broken.

This lead to the conclusion that renpy has some sort of bug within the main code. There's other bugs found on all versions too, including but not limited:

android errors: cant detect JDK

"duplicate labels" is an error itself, im 1000% sure the code i enter is correct and so does many other systems besides renpy.

most of the stuff in cookbook no longer work, you can see the errors yourselfs.

IOS might be broken

and many many more which can be found at questions and answers.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

morganw
Regular
Posts: 51
Joined: Fri Nov 20, 2015 7:00 pm
Contact:

Re: A bug within renpy

#2 Post by morganw »

If it's in a python function, golf is a string not an image.
If it's outside a python function, it's missing the image function and the line prefixes to indicate the you want to run a python function (renpy.show and renpy.hide).
In both cases you don't want to indent with whitespace as you don't want to define a new block.

Has this been copied and pasted from different parts of a python function? If not I think it would just be:

Code: Select all

image golf = "golf.jpg"
$ renpy.show("golf")
$ renpy.hide("golf")
or

Code: Select all

image golf = "golf.jpg"
show golf
hide golf

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#3 Post by firecat »

morganw wrote:If it's in a python function, golf is a string not an image.
If it's outside a python function, it's missing the image function and the line prefixes to indicate the you want to run a python function (renpy.show and renpy.hide).
In both cases you don't want to indent with whitespace as you don't want to define a new block.

Has this been copied and pasted from different parts of a python function? If not I think it would just be:

Code: Select all

image golf = "golf.jpg"
$ renpy.show("golf")
$ renpy.hide("golf")
or

Code: Select all

image golf = "golf.jpg"
show golf
hide golf
its actual python code, not renpy screens or imagemaps. the,

renpy.show and renpy.hide tell the computer to find the code in repy and then follow "show" or "hide" code.

the code you give me does not fix the problem or many other problems i have at the moment. Nor are they actual working python codes.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: A bug within renpy

#4 Post by trooper6 »

morganw is correct though about your image code.
Have you looked at the documentation on python statement equivalents? https://www.renpy.org/doc/html/statemen ... ing-images

If you want to use the python code to display images, first you must define the image, then you can display it.

golf = "golf.jpg" is not how you define images.

using only python equivalencies you can:

Code: Select all

init python:
    renpy.image("golf", "images/golf.jpg")

label start:    
    python:
        renpy.show("golf")
        e("Hello")
        renpy.hide("golf")
        e("Goodbye")
        
    return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#5 Post by firecat »

trooper6 wrote:morganw is correct though about your image code.
Have you looked at the documentation on python statement equivalents? https://www.renpy.org/doc/html/statemen ... ing-images

If you want to use the python code to display images, first you must define the image, then you can display it.

golf = "golf.jpg" is not how you define images.

using only python equivalencies you can:

Code: Select all

init python:
    renpy.image("golf", "images/golf.jpg")

label start:    
    python:
        renpy.show("golf")
        e("Hello")
        renpy.hide("golf")
        e("Goodbye")
        
    return
Nope got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 445, in script
    python:
  File "game/script.rpy", line 457, in <module>
    battle("win", "lose", dayo_HP, dark_HP, xalign=0.5, yalign=0.5)
  File "game/script.rpy", line 36, in battle
    renpy.image("owie", "owch.png")
Exception: Images may only be declared inside init blocks.
Im using init python which is: https://www.renpy.org/doc/html/python.h ... -statement

The code you give does not work because it is not possible.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: A bug within renpy

#6 Post by trooper6 »

I don't post code I haven't tested. I'm using that code and it does work for me. Since you don't believe me, I'll attach my project so you can run it yourself.

I don't know what you have going on, but your error message says you have to define your images in an init python block. And that can't be inside a class or something like that. Just put it on its own.
Attachments
Real Scratch.zip
(842.78 KiB) Downloaded 56 times
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: A bug within renpy

#7 Post by Divona »

It look like you tried to define the image inside a module "battle()" instead of "init python:" outside the module. That's not going to work. It's:

Code: Select all

init python:
    renpy.image("golf", "images/golf.jpg")

    def battle():
        ......
Not:

Code: Select all

init python:
    def battle():
        renpy.image("golf", "images/golf.jpg")
Completed:
Image

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#8 Post by firecat »

Divona wrote:It look like you tried to define the image inside a module "battle()" instead of "init python:" outside the module. That's not going to work. It's:

Code: Select all

init python:
    renpy.image("golf", "images/golf.jpg")

    def battle():
        ......
Not:

Code: Select all

init python:
    def battle():
        renpy.image("golf", "images/golf.jpg")
that makes no sense, you can not add a code on the starting line when there are others after it. That's like adding a video before the visual novel story. the code you show me will put the image before the battle but not remove it after the fight.

@trooper6: no that not how my code works, i made it before defining the characters, have you not read anything on my sentence. if i didnt do this then the whole code would have been a mess, the code you added only works within the "start:" not outside. Plus there's easier ways to added within "start:" but my code goes outside it.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: A bug within renpy

#9 Post by xela »

morganw, trooper6 and Divona are all right but none of them actually answered the question :D

Code: Select all

    golf = "golf.jpg"
    renpy.show("golf")
    renpy.hide("golf")
This code can be rigged to work in renpy but it should not, at least according to documentation. The first and only argument to the renpy.show function is "name", which is the name of the tag associated with the displayable you which to show (in this case an image). The only way to permanently (for the duration of the game) tag an image in renpy as all three pointed out is:

Code: Select all

image golf = "golf.jpg"
or python equivalent of the same:

Code: Select all

init python:
    renpy.image("golf", "golf.jpg")
both of which can only be executed in the init phase.

Code: Select all

    renpy.show("golf")
    renpy.hide("golf")
or show/hide in Ren'Py script will both display and hide them correctly.

=====================================>>>
The thing is that while it may be useful when showing images in Ren'Py script or screens cause of the automatic image prediction system, it is not even remotely useful to do when using renpy.show() because you would have to predict them manually anyway. Answering the actual question, proper/most used Python code to show/hide an image in Ren'Py is:

Code: Select all

    renpy.show("temp_tagname", what=Image("golf.jpg"))
    renpy.hide("temp_tagname")
without any declarations. If you wish to use an interim variable like:

Code: Select all

golf = "golf.jpg"
than:

Code: Select all

    renpy.show("temp_tagname", what=Image(golf))
    renpy.hide("temp_tagname")
will still work. Whenever your use "what" keyword argument, temporary tag will be created for you internally, which you can use to hide the displayable later. I hope this answers the question.

=====================================>>>
most of the stuff in cookbook no longer work, you can see the errors yourselfs.
Most of the stuff in cookbook is not maintained/updated by the respective posters and some of it is poorly written code. As Ren'Py evolves, stuff is bound to break :( and there is very little to no moderation to Q&A/Cookbook sections.
Like what we're doing? Support us at:
Image

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#10 Post by firecat »

@xela: it halfway worked, on 6.99.7 the image would hide any GUI including the battle GUI. This code only helps becomes a background, i dont think its possible to even move it.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: A bug within renpy

#11 Post by xela »

firecat wrote:@xela: it halfway worked
So we're halfway to the finish line where everything works :)
firecat wrote:on 6.99.7 the image would hide any GUI including the battle GUI.
This is not Ren'Py/Python terminology. "the image" does not hide anything, renpy.hide(), renpy.hide_screen(), renpy.scene() functions (or their Ren'Py script equivalents) or automatic routines (such as changing contexts for example), all can hide displayable in Ren'Py. GUI = Graphical User Interface consists of any number of displayable which could be shown in a number of ways on any number of layers. How you hide them depends on what function (and with what args/kwargs) was used to display them.
firecat wrote:This code only helps becomes a background, i dont think its possible to even move it.
That code is generic and correct. It will not fail you as long as it is used correctly. One way of moving a displayable using python is by adding ATL instructions to at_list keyword argument of the renpy.show function, if that's what you asked here.
Like what we're doing? Support us at:
Image

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#12 Post by firecat »

xela wrote:
firecat wrote:@xela: it halfway worked
So we're halfway to the finish line where everything works :)
firecat wrote:on 6.99.7 the image would hide any GUI including the battle GUI.
This is not Ren'Py/Python terminology. "the image" does not hide anything, renpy.hide(), renpy.hide_screen(), renpy.scene() functions (or their Ren'Py script equivalents) or automatic routines (such as changing contexts for example), all can hide displayable in Ren'Py. GUI = Graphical User Interface consists of any number of displayable which could be shown in a number of ways on any number of layers. How you hide them depends on what function (and with what args/kwargs) was used to display them.
firecat wrote:This code only helps becomes a background, i dont think its possible to even move it.
That code is generic and correct. It will not fail you as long as it is used correctly. One way of moving a displayable using python is by adding ATL instructions to at_list keyword argument of the renpy.show function, if that's what you asked here.
no the code become very limited, if it stays in the background then users will face problems with the gui. no one wants another repeat of FFXII GUI in cutscenes.

Those where dark times...
https://www.youtube.com/watch?v=nt63cofBHnw
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: A bug within renpy

#13 Post by xela »

firecat wrote:no the code become very limited, if it stays in the background then users will face problems with the gui. no one wants another repeat of FFXII GUI in cutscenes.

Those where dark times...
https://www.youtube.com/watch?v=nt63cofBHnw
(it's FF VII)

I loved this game :)

What do you mean by: "if it stays in the background"? I don't understand how what we were talking about could be related to the problem in FF VII. You can hide/show anything, you'd normally want to put GUI like that on a screen and hide it when it is not needed. Like here:

https://youtu.be/5b9Tt9eOw8o?t=9

Just one extra line of code could hide stats and viewport with battle log during attacks.

What are you trying to do exactly?
Like what we're doing? Support us at:
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: A bug within renpy

#14 Post by Alex »

Just a shot in the dark - is "golf.jpg" a fullscreen size opaque image? If so then it is quite ok that it's covering all the other images and gui elements onscreen when shown. In this case it should be shown with different zorder than other images or on different layer.
If it's not so then just ignore this post...

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: A bug within renpy

#15 Post by firecat »

xela wrote:
firecat wrote:no the code become very limited, if it stays in the background then users will face problems with the gui. no one wants another repeat of FFXII GUI in cutscenes.

Those where dark times...
https://www.youtube.com/watch?v=nt63cofBHnw
(it's FF VII)

I loved this game :)

What do you mean by: "if it stays in the background"? I don't understand how what we were talking about could be related to the problem in FF VII. You can hide/show anything, you'd normally want to put GUI like that on a screen and hide it when it is not needed. Like here:

https://youtu.be/5b9Tt9eOw8o?t=9

Just one extra line of code could hide stats and viewport with battle log during attacks.

What are you trying to do exactly?
On the remake of FFVII they remove the big select GUI from the screen and added small one on the left side. As you can see it is better to show little of the gui then a huge box row of it.

https://www.youtube.com/watch?v=ola_YYuGuIQ

https://www.youtube.com/watch?v=i5gnVT-tjuY

The idea of rpg homebrew was to give the developer options as to how they wanted to present the battle. if they desire to not have the gui for any reason then it is ok by me. This bug that im calling it, has ruin that central idea of adding new ways to use it. Yes still works as basic battle but can't do much after it, heck i dont know how much more broken i has become, the imagemap might not work anymore.

@Alex its 100% physical with many colors.
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

Post Reply

Who is online

Users browsing this forum: No registered users