No image tag associated with speaking character (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
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

No image tag associated with speaking character (SOLVED)

#1 Post by Geckos »

So everytime I try to script my main character's side image, I get this error
An exception has occured.
While running game code:
File "game/script.rpy{, line 62, in script
File "renpy/common/00keymap.rpy", line 187, in python
File "renpy/common/00keymap.rpy", line 243, in script
File "renpy/common/00keymap.rpy", line 251, in python
File "renpy/common/00library.rpy", line 29, in python
Exception: Say has image attributes (u'scared',), but there's no image tag associated with the speaking character.


If I just hit "reload" it loads fine, and even displays the image correctly.

Am I not defining the character correctly somewhere?
It's starting to eat a lot of my time having to hit reload each time I tweak the side image.

Example of script:

Code: Select all

    k happy "happy"
    k neut "neut"
    k sad "sad"
    k embarrassed "embarrassed"
    k grin "grin"
    k blank "blank"
    k derp "derp"
    k surprised "surprised"
    k shocked "shocked"
    k thoughtful "thoughtful"
    k scared "scared"
    
    "Test."
    
    
    "Testing..."
    
Example of side image

Code: Select all

image side kenna happy = LiveComposite(
        (307, 320),
        (0, 0), "char/mc/head.png",
        (0, 0), "char/mc/outfit_1.png",
        (0, 0), "char/mc/happy.png",
        (0, 0), "char/mc/clouds.png",
        (0, 0), Animation("char/es/blink/es_blink0.png", 3.7, "char/mc/new_blink_1.png", .10, "char/mc/new_blink_2.png", .25, "char/mc/new_blink_1.png", .10),
        (0, 0), "char/mc/hair.png",)
This is the definition of my character.

Code: Select all

#Kenna
define k = Character('Kenna', image="kenna",color="#961436", what_color="#961436", show_two_window=True, who_xalign=0.45, who_yalign= -0.08)
define kc = Character('???', color="#961436", image="kenna", what_color="#961436", show_two_window=True, who_xalign=0.45)
define narratore = Character (None, kind=nvl, show_two_window=True,)

the full traceback is

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 62, in script
  File "renpy/common/00keymap.rpy", line 187, in python
  File "renpy/common/00keymap.rpy", line 243, in script
  File "renpy/common/00keymap.rpy", line 251, in python
  File "renpy/common/00library.rpy", line 29, in python
Exception: Say has image attributes (u'scared',), but there's no image tag associated with the speaking character.

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

Full traceback:
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\execution.py", line 288, in run
    node.execute()
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\ast.py", line 455, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\exports.py", line 803, in say
    who(what, interact=interact)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\character.py", line 807, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\character.py", line 673, in do_display
    **display_args)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\character.py", line 476, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\ui.py", line 237, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\core.py", line 1853, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\core.py", line 2406, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\layout.py", line 749, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\behavior.py", line 289, in event
    rv = run(action)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\behavior.py", line 211, in run
    return var(*args, **kwargs)
  File "renpy/common/00keymap.rpy", line 187, in _reload_game
    renpy.call_in_new_context("_save_reload_game")
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\game.py", line 279, in call_in_new_context
    return renpy.execution.run_context(False)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\execution.py", line 509, in run_context
    context.run()
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\execution.py", line 288, in run
    node.execute()
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\ast.py", line 720, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\python.py", line 1304, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/00keymap.rpy", line 251, in <module>
    renpy.pause(0)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\exports.py", line 920, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\ui.py", line 237, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\core.py", line 1837, in interact
    self.show_window()
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\display\core.py", line 1526, in show_window
    renpy.config.empty_window()
  File "renpy/common/00library.rpy", line 29, in _default_empty_window
    store.narrator("", interact=False)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\character.py", line 750, in __call__
    self.resolve_say_attributes(False)
  File "E:\Program Files (x86)\renpy-6.16.3-sdk\renpy\character.py", line 701, in resolve_say_attributes
    raise Exception("Say has image attributes %r, but there's no image tag associated with the speaking character." % (attrs,))
Exception: Say has image attributes (u'scared',), but there's no image tag associated with the speaking character.

Windows-7-6.1.7601-SP1
Ren'Py 6.16.3.502
Demo 2.0 0.0
Last edited by Geckos on Sun Jan 12, 2014 10:39 pm, edited 1 time in total.
Image ImageImage

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: No image tag associated with speaking character

#2 Post by PyTom »

You shouldn't have to do this.

Can you put together a small replication, so I can debug the problem?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: No image tag associated with speaking character

#3 Post by Geckos »

PyTom wrote:You shouldn't have to do this.

Can you put together a small replication, so I can debug the problem?
Indeed I can! I sent you a pm with the small replication.
Image ImageImage

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: No image tag associated with speaking character

#4 Post by PyTom »

I've fixed the underlying bug in Ren'Py, but the fix is a bit complicated. As a work around, edit renpy/common/00keymap.rpy

Around line 236 (my line numbers are different), change:

Code: Select all

label _save_reload_game:
    python hide:
        renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
        renpy.music.stop()
to

Code: Select all

label _save_reload_game:
    with None

    python hide:
        renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
        renpy.music.stop()
.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: No image tag associated with speaking character

#5 Post by Geckos »

@Pytom
Awesome! Thanks so much. It works now without having to reload.

Sorry I did something to break ...something.
But thanks again for helping me!
Image ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users