DynamicDisplayable "Can't find 'this/image that exists.png'."

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.
Post Reply
Message
Author
User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

DynamicDisplayable "Can't find 'this/image that exists.png'."

#1 Post by ISAWHIM »

I have a dynamic displayable working perfect in "screens.rpy", but due to needing manipulation by movement/position. I have to make another set in the script.rpy area.

This is what works in my screens.rpy

Code: Select all

define clock_h1 = "clock/num 11.png"
screen sideInfo:
    zorder 10
    fixed:
        add DynamicDisplayable("clock_h1") xpos 1576 ypos 112
This is what I am trying to do...
- Position an ICON of players, at various locations. (Only ones that are visible)
- Change the players "State", to "sleeping" or "quest", or "sleeping and quest", or "none"

I can't even get an image to load, because it complains that anything I put, just can't be found, or is not defined... The path it shows is correct.

These are some things that didn't work...

Code: Select all

define ico_me = "ico/me.png"
image dd_me = DynamicDisplayable(ico_me)

define ico_me = "ico/me.png"
define dd_me = DynamicDisplayable(ico_me)

define ico_me = "ico/me.png"
image dd_me = DynamicDisplayable("ico_me")

define ico_me = "ico/me.png"
define dd_me = DynamicDisplayable("ico_me")

define ico_me = "ico/me.png"
image dd_me = DynamicDisplayable("[ico_me]")

define ico_me = "ico/me.png"
define dd_me = DynamicDisplayable("[ico_me]")
... also following all of those failed displays, is the "dynamic change" code...
There is more than one CHR... "for CHR in chr.nameList"
I just simplified it to show what I am trying to do.
I left-out all the positioning code...

Code: Select all

python init:
    def fSwapMyIcons():
        global ico_me
        global ico_you
        CHR = "me"
        Q = "sleeping"
        ico_me = "ico/" + CHR + Q + ".png"
        renpy.show("ico_" + CHR, layer="screens", zorder=11)
        CHR  = "you"
        # ico_you is already a value, "ico/you.png"
        renpy.hide("ico_" + CHR, layer="screens", zorder=11)
This didn't work either...

Code: Select all

python init:
    def fSwapMyIcons():
        CHR = "ico_me" + "sleeping"
        ico_chr = "ico/" + CHR + Q + ".png"
        renpy.show(ico_chr, layer="screens", zorder=11)
It keeps displaying, where the image should be...
"image 'ico/me.png' could not be found"
or
"image 'ico_me' could not be found"
or
it crashes, pointing to an irrelevant location, complaining that "ico" is not defined. Though, nowhere in code, does "ico" exist, like that, as a value or string.
or
nothing is displayed

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: DynamicDisplayable "Can't find 'this/image that exists.png'."

#2 Post by ISAWHIM »

Sorry, I finally found a combination that worked...

Simplified from above.

Code: Select all

python init:
    class ChrClass()
        cNameList = []
        def __init__(self,cName,I,Q):
            self.cNAME = cNAME
            self.I = I
            self.Q = Q
            self.cNameList.append(self)

    def fSwapMyIcons():
        #ChrClass.cNameList is just a text-name for each character (self)
        #Results for "i" are... "ChrMe", "ChrYou", which all have an attribute "I" for the "Icon path currently displaying".
        #Results for "Q" are the "Quest variations", "sleeping", "quest", "sleeping quest", or ""
        for i in ChrClass.cNameList:
            i.I = "ico/" + i + i.Q + ".png"
            renpy.show("dd_" + i, layer="screens", zorder=11)
            if i.HideMe == True:
                renpy.hide("dd_" + i, layer="screens")

define ChrMe = ChrClass("me","ico/me.png","sleep")
image dd_me = DynamicDisplayable("ChrMe.I")
I NEEDED, the character-class variable for the image-path in quotes, not RAW or quoted as a "[swapVar]"...
Plus...
I needed to "show" the "dd_name"... after I set the image-path in the

Post Reply

Who is online

Users browsing this forum: No registered users