Ren'Py always throws error for custom text tag

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
kostek00
Regular
Posts: 129
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Ren'Py always throws error for custom text tag

#1 Post by kostek00 » Sun Jun 23, 2019 1:29 pm

I tired to make my own self closing text tags but Ren'py was throwing me error that they don't exist. Then I tried non-self closing text tag but result was the same. I tried for the last time and copied example from documentation and it's also error. I then reinstalled Ren'Py and tried on fresh project but it also resulted in the same error. Any ideas what is going on?

Code: Select all

I'm sorry, but an uncaught exception occurred.

While processing text tag {bang} in u'This is {bang}!'.:
  File "game/script.rpy", line 8, in script
    "This is {bang}!"
Exception: Unknown text tag u'bang'

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

Full traceback:
  File "game/script.rpy", line 8, in script
    "This is {bang}!"
  File "D:\Programy\Ren'Py\renpy\ast.py", line 706, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "D:\Programy\Ren'Py\renpy\exports.py", line 1336, in say
    who(what, *args, **kwargs)
  File "D:\Programy\Ren'Py\renpy\character.py", line 1139, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "D:\Programy\Ren'Py\renpy\character.py", line 842, in do_display
    **display_args)
  File "D:\Programy\Ren'Py\renpy\character.py", line 591, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "D:\Programy\Ren'Py\renpy\ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\Programy\Ren'Py\renpy\display\core.py", line 2701, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "D:\Programy\Ren'Py\renpy\display\core.py", line 3193, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "D:\Programy\Ren'Py\renpy\display\core.py", line 2093, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 519, in renpy.display.render.render_screen
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\screen.py", line 675, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 1127, in render
    st, at)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 154, in renpy.display.render.render
  File "render.pyx", line 247, in renpy.display.render.render
  File "D:\Programy\Ren'Py\renpy\text\text.py", line 1989, in render
    virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)
  File "D:\Programy\Ren'Py\renpy\text\text.py", line 590, in __init__
    self.paragraphs = self.segment(text.tokens, style, renders, text)
  File "D:\Programy\Ren'Py\renpy\text\text.py", line 1172, in segment
    raise Exception("Unknown text tag %r" % text)
Exception: Unknown text tag u'bang'

Windows-8-6.2.9200
Ren'Py 7.3.0.271
Sun Jun 23 19:27:45 2019

rames44
Veteran
Posts: 232
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Ren'Py always throws error for custom text tag

#2 Post by rames44 » Sun Jun 23, 2019 4:01 pm

It will be easier to help you if you’d post the code you’re using for the tag function and how you’re registering it.

User avatar
kostek00
Regular
Posts: 129
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Ren'Py always throws error for custom text tag

#3 Post by kostek00 » Sun Jun 23, 2019 4:10 pm

It's exact copy from documentation that also don't work:

Code: Select all

init python:
    def bang_tag(tag, argument):
        return [ ( renpy.TEXT_TAG, "size=40"), (renpy.TEXT_TEXT, "!"), (renpy.TEXT_TAG, "/size") ]

    config.self_closing_custom_text_tags["bang"] = bang_tag

label start:
    "This is awesome{bang}"
And I'm using newest version 7.3.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: Ren'Py always throws error for custom text tag

#4 Post by PyTom » Tue Jun 25, 2019 1:33 am

I just landed a fix for this. There was a problem that it wouldn't work unless you had a non-self closing tag defined as well.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
kostek00
Regular
Posts: 129
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Ren'Py always throws error for custom text tag

#5 Post by kostek00 » Tue Jun 25, 2019 6:47 am

Thanks for update. I'll be waiting for release.

trajano
Regular
Posts: 60
Joined: Sun Jun 16, 2019 7:59 pm
Github: trajano
Contact:

Re: Ren'Py always throws error for custom text tag

#6 Post by trajano » Tue Jun 25, 2019 9:31 pm

Seems like a lot of fixes went in. Hope we get a release soon.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], span4ev