Instant CG and BG gallery

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Instant CG and BG gallery

#151 Post by Imperf3kt »

tohtamish wrote: Wed Mar 07, 2018 11:15 am Is it possible to use this gallery code as the chapter selection at the beginning of the game? (something like "walking dead" game)
You could modify it to, but as it stands: no

But modifying it is pointless, just make a simple screen with imagebuttons in a grid.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Gouka
Regular
Posts: 66
Joined: Thu Feb 01, 2007 1:24 pm
Projects: Demon Wraith
Contact:

Re: Instant CG and BG gallery

#152 Post by Gouka »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/gallery_setup.rpy", line 26, in script
    init +1 python:
  File "game/gallery_setup.rpy", line 29, in <module>
    renpy.image (gal_item + " butt", im.Scale("bg CG000", " bg CG001", "bg CG003", "bg CG006"(gal_item), thumbnail_x, thumbnail_y))
TypeError: 'unicode' object is not callable

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

Full traceback:
  File "game/gallery_setup.rpy", line 26, in script
    init +1 python:
  File "C:\Users\ateli\Documents\Messiah No.1\renpy-7.2.1-sdk\renpy\ast.py", line 896, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\ateli\Documents\Messiah No.1\renpy-7.2.1-sdk\renpy\python.py", line 1929, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/gallery_setup.rpy", line 29, in <module>
    renpy.image (gal_item + " butt", im.Scale("bg CG000", " bg CG001", "bg CG003", "bg CG006"(gal_item), thumbnail_x, thumbnail_y))
TypeError: 'unicode' object is not callable

Windows-8-6.2.9200
Ren'Py 7.2.1.457
DWraith_final 1.0
Sun Mar 17 17:22:35 2019
I keep getting this error over and over again, and I have deleted most of what the error states and only left bg CG000
Check the Chaos Lord development at http://atelieredgeproductions.wordpress.com

User avatar
Ajeb
Newbie
Posts: 15
Joined: Thu Feb 07, 2019 7:22 am
Projects: FLY : Forever Loving You (2)
Deviantart: AjebFLY
itch: ajeb
Contact:

Re: Instant CG and BG gallery

#153 Post by Ajeb »

Hi ! I know this is an old cg framework but my game has been in development since 2015 (it's been a while I know) and I'd like to keep on using this one so that my players don't lose their progress.
My question is: has anyone managed to use conditionswitch /dynamic displayables / livecomposite images with this cg framework? I'd like to add more variations/customization that gets shown on cgs without having to save 100 different variations of a cg everytime...

I keep having the following error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 1081, in script
    init +1 python:
  File "game/screens.rpy", line 1084, in <module>
    renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
Exception: Expected an image, but got a general displayable.

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

Full traceback:
  File "game/screens.rpy", line 1081, in script
    init +1 python:
  File "C:\Users\PC\Documents\Softwares\renpy-8.1.1-sdk\renpy\ast.py", line 823, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\PC\Documents\Softwares\renpy-8.1.1-sdk\renpy\python.py", line 1178, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/screens.rpy", line 1084, in <module>
    renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
  File "C:\Users\PC\Documents\Softwares\renpy-8.1.1-sdk\renpy\display\im.py", line 922, in __init__
    im = image(im)
  File "C:\Users\PC\Documents\Softwares\renpy-8.1.1-sdk\renpy\display\im.py", line 1978, in image
    return image(arg.target, loose=loose, **properties)
  File "C:\Users\PC\Documents\Softwares\renpy-8.1.1-sdk\renpy\display\im.py", line 1993, in image
    raise Exception("Expected an image, but got a general displayable.")
Exception: Expected an image, but got a general displayable.
And obviously I know I have to edit the framework for it to support dynamic displayables but I have no idea where to start... Does anybody have any idea what I could do/look for/try to change? I've tried a few not-so-smart things but nothings works

If it's not possible, would you happen to know of a similar cg framework that supports displayables/condition switches/layered images etc?

Thanks!
Image
Image

User avatar
henne
Newbie
Posts: 18
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Instant CG and BG gallery

#154 Post by henne »

Replace

Code: Select all

    renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
with

Code: Select all

    renpy.image (gal_item + " butt", Transform(gal_item, size=(426, 240)))
It's mostly about replaceing "im.Scale" with "Transform".

https://www.renpy.org/doc/html/trans_tr ... #Transform

User avatar
Ajeb
Newbie
Posts: 15
Joined: Thu Feb 07, 2019 7:22 am
Projects: FLY : Forever Loving You (2)
Deviantart: AjebFLY
itch: ajeb
Contact:

Re: Instant CG and BG gallery

#155 Post by Ajeb »

henne wrote: Tue Apr 09, 2024 5:29 am Replace

Code: Select all

    renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
with

Code: Select all

    renpy.image (gal_item + " butt", Transform(gal_item, size=(426, 240)))
It's mostly about replaceing "im.Scale" with "Transform".

https://www.renpy.org/doc/html/trans_tr ... #Transform
Thank you very much, I knew it would be something as simple as that but didn't know quite where to look. This is lifesaving thanks!!! (Aegis Alver supremacy)
Image
Image

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]