Schrodinger's layered sprite issue(Solved)

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
VolTitanDev
Newbie
Posts: 5
Joined: Mon May 25, 2020 12:07 pm
Projects: Foot fetish fortress VolTitan
IRC Nick: VolTitanDev
Deviantart: timefire69
itch: https://voltitandev.
Contact:

Schrodinger's layered sprite issue(Solved)

#1 Post by VolTitanDev »

Hey everyone so I tried to make a layer character sprite for my VN

Code: Select all

define s = Character("Saktora",color = "#ffffff",who_outlines = [(1,"#008000",0,0)])

layeredimage saktora:
    always:
        "saktora_base"
    group hair:
        attribute bob default:
            "saktora_hair_bob"
    group emotion:
        attribute blush:
            "saktora_emotion_blush"
    group eyebrow:
        attribute relax default:
            "saktora_eyebrow_relax"
        attribute angry:
            "saktora_eyebrow_angry"
        attribute sad:
            "saktora_eyebrow_sad"
    group eye:
        attribute normal default:
            "saktora_eye_normal"
        attribute sarcasm:
            "saktora_eye_sarcasm"
        attribute surprise:
            "saktora_eye_surprise"
        attribute flirt:
            "saktora_eye_flirt"
        attribute cheeful:
            "saktora_eye_cheerful"
        attribute blink:
            "saktora_blink"
    group mouth:
        attribute smile default:
            "saktora_mouth_smile"
        attribute frown:
            "saktora_mouth_frown"
        attribute happy:
            "saktora_mouth_happy"
        attribute shock:
            "saktora_mouth_shock"
        attribute tease:
            "saktora_mouth_tease"
        attribute speak:
            "saktora_speak"
    group outfit:
        attribute amazon default:
            "saktora_outfit_amazon"
        attribute housewife:
            "saktora_outfit_housewife"
        attribute towel:
            "saktora_outfit_towel"

image saktora_speak:
    "saktora_mouth_speak"
    .5
    "saktora_mouth_speak2"
    .5
    "saktora_mouth_speak3"
    .5
    repeat

image saktora_blink:
    "saktora_eye_blink"
    .5

    "saktora_eye_blink2"
    .5
    repeat
but when I attempt to show the sprite in the script

Code: Select all

     show saktora
    s "This is only a test to see if the sprite will appear"
the visual novel starts as usual but when I get to the part were the sprite would appear the game stops and I get a traceback error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 35, in script
    s "This is only a test to see if the sprite will appear"
  File "game/script.rpy", line 35, in script
    s "This is only a test to see if the sprite will appear"
  File "renpy/common/000window.rpy", line 98, in _window_auto_callback
    _window_show()
  File "renpy/common/000window.rpy", line 60, in _window_show
    renpy.with_statement(trans)
RuntimeError: maximum recursion depth exceeded
     
and if I changed the sprite's name the sprite would be invisible

I don't understand what I did wrong when writing the layer code or what might be the cause of the recursion error.
Last edited by VolTitanDev on Mon Jun 15, 2020 9:28 pm, edited 1 time in total.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Schrodinger's layered sprite issue

#2 Post by Per K Grok »

VolTitanDev wrote: Sun Jun 14, 2020 8:20 pm Hey everyone so I tried to make a layer character sprite for my VN

---------

but when I attempt to show the sprite in the script

Code: Select all

     show saktora
    s "This is only a test to see if the sprite will appear"
the visual novel starts as usual but when I get to the part were the sprite would appear the game stops and I get a traceback error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 35, in script
    s "This is only a test to see if the sprite will appear"
  File "game/script.rpy", line 35, in script
    s "This is only a test to see if the sprite will appear"
  File "renpy/common/000window.rpy", line 98, in _window_auto_callback
    _window_show()
  File "renpy/common/000window.rpy", line 60, in _window_show
    renpy.with_statement(trans)
RuntimeError: maximum recursion depth exceeded
     
and if I changed the sprite's name the sprite would be invisible

I don't understand what I did wrong when writing the layer code or what might be the cause of the recursion error.

I did a test run with your code (but different images obviously)

And I did not get any exception.

The problem might be something completely different than the layered image.

Recursion as far as I understand is a function calling itself. To be a useful method it need something to cut the loop of calling itself of at a reasonable amount of repetitions. At 1000 repeats the maximum recursion depth is exceeded. I wouldn't expect layered image is something that use this method. But I'm out of my depth here. :)

User avatar
VolTitanDev
Newbie
Posts: 5
Joined: Mon May 25, 2020 12:07 pm
Projects: Foot fetish fortress VolTitan
IRC Nick: VolTitanDev
Deviantart: timefire69
itch: https://voltitandev.
Contact:

Re: Schrodinger's layered sprite issue

#3 Post by VolTitanDev »

I managed to solve the recursion error with a force recompile but when the game starts my layer sprite is invisible when it was supposed to show

User avatar
VolTitanDev
Newbie
Posts: 5
Joined: Mon May 25, 2020 12:07 pm
Projects: Foot fetish fortress VolTitan
IRC Nick: VolTitanDev
Deviantart: timefire69
itch: https://voltitandev.
Contact:

Re: Schrodinger's layered sprite issue

#4 Post by VolTitanDev »

I figured out that the reason that the layered sprite is invisible is because is the image is a different size than the rest of the layer image

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]