Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Image Tint Tool for Ren'Py [Addon]

Preview & apply tints to images in Ren'Py · By Feniks

Need Support? Post here! Sticky

A topic by Feniks created Sep 09, 2023 Views: 166 Replies: 8
Viewing posts 1 to 3
Developer

If you're having trouble or run into any bugs with the code, post a comment here! I will try to get back to you within a few days.

Hello,

When adding the base image_tools to my files, everything worked fine, but I received this error when adding the image_tint_tool.rpy file. I'm not sure what went wrong or how to define 'spectrum,' here. Any help would be appreciated.

I'm sorry, but an uncaught exception occurred.
After initialization, but before game start.
  File "renpy/common/00start.rpy", line 83, in _init_language
    renpy.change_language(language)
  File "game/image_tools/image_tint_tool.rpy", line 515, in <module>
    spectrum(horizontal=False))
NameError: name 'spectrum' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
  File "A:\renpy-8.0.0-sdk\renpy\bootstrap.py", line 274, in bootstrap
    renpy.main.main()
  File "A:\renpy-8.0.0-sdk\renpy\main.py", line 660, in main
    run(restart)
  File "A:\renpy-8.0.0-sdk\renpy\main.py", line 76, in run
    renpy.translation.init_translation()
  File "A:\renpy-8.0.0-sdk\renpy\translation\__init__.py", line 583, in init_translation
    renpy.store._init_language() # type: ignore
  File "renpy/common/00start.rpy", line 83, in _init_language
    renpy.change_language(language)
  File "A:\renpy-8.0.0-sdk\renpy\translation\__init__.py", line 667, in change_language
    new_change_language(tl, language)
  File "A:\renpy-8.0.0-sdk\renpy\translation\__init__.py", line 629, in new_change_language
    i.apply()
  File "A:\renpy-8.0.0-sdk\renpy\ast.py", line 2887, in apply
    value = renpy.python.py_eval(expr)
  File "A:\renpy-8.0.0-sdk\renpy\python.py", line 1080, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "A:\renpy-8.0.0-sdk\renpy\python.py", line 1073, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/image_tools/image_tint_tool.rpy", line 515, in <module>
    spectrum(horizontal=False))
NameError: name 'spectrum' is not defined
Developer

Hey there! Did you also download the required color picker tool? It is necessary for this one to work.

Thank you for the quick response! Yes, that was what I needed. Thanks for the heads up!

I'm very disappointed as I can't seem to use this tool.  I downloaded the color picker, and the image tools, but I can't seem to use tint at all!  I get this error message when I try

```I'm sorry, but an uncaught exception occurred.

While running game code:

  File "game/image_tools/image_tint_tool.rpy", line 236, in execute

    screen tinting_tool():

  File "game/image_tools/image_tint_tool.rpy", line 236, in execute

    screen tinting_tool():

  File "game/image_tools/image_tint_tool.rpy", line 283, in execute

    add sprt.check_bg(persistent.sprt_bg):

Exception: An empty string cannot be used as a displayable.```
I have made no edits to the image tint tool, this is straight out of the box, I even tested it on a brand new project and got the same error

Developer

Hey there! My apologies for the error - it looks like an engine update has changed how Ren'Py handles empty strings for displayables. To temporarily fix this, open the game and then open the console with shift+o and type in `persistent.sprt_bg = "black"` and hit Enter. Close the console and the tool should be possible to open. Clearing the background image will cause the error to appear again unfortunately, so I'll be putting out a fix for this as soon as I'm able. Thanks for the report!

Thank you!!  I'll just wait for the update :3

Developer

I investigated a bit and specifically Ren'Py now returns `True` for `renpy.loadable("")` in v8.4, which appears to be an engine bug. I have reported it in the Ren'Py GitHub, and in the meantime you can change the line elif renpy.loadable(s): in the function check_bg around line 124 in image_tint_tool.rpy to elif s and renpy.loadable(s): and this should fix the problem. I will be putting out this fix as an update soon.

Developer

Hey there again, I've put out an update to the common image tools file which you can find here: https://feniksdev.itch.io/image-tools-for-renpy/devlog/1015768/84-engine-bug-fix which should fix your problem. Thanks for your patience!