Page 1 of 1

Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 4:13 am
by Dollarluigi
In one of my projects, I wanted to have a brackets show up and was able to pull that off.

In game, I have the word "[REDACTED]" show up and this is done by just adding an extra bracket to the beginning:

Code: Select all

[[REDACTED]
The visual novel runs fine, but the backlog ends up having an error message after this comes up in the dialogue. Is there any way I can fix this or am I going to have to change "[REDACTED]" to something else entirely?

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 4:32 am
by Ocelot
Just tested on new project and everything works fine.

What exact error do you have? What did you change related to backlog or text display?

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 10:23 am
by zmook
Could you post the code for the dialogue and the error message?

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 2:39 pm
by Dollarluigi

Code: Select all

    scene bg cafeteria with fade
    stop music fadeout 1.0
    play music restaurant
    h "Vivian, what are you doing?"
    show censoredplate with dissolve
    show vivian dirty with dissolve
    v "Making [[REDACTED]. What's it look like?"
    h "..."
Image
Image

At this part, the backlog works properly.

Image
Image

After Vivian's line, the backlog stops working.

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 2:50 pm
by Ocelot
What changes did you make to the dialogue box and history screen?

Error message is incomplete. We will need whole message. There is a Copy BBCode button for posting it on forums.

Also, at this moment Vivian's line is not yet added to history screen.

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 2:55 pm
by Dollarluigi
Ocelot wrote:
Thu Nov 18, 2021 2:50 pm
What changes did you make to the dialogue box and history screen?

Error message is incomplete. We will need whole message. There is a Copy BBCode button for posting it on forums.

Also, at this moment Vivian's line is not yet added to history screen.
This comes up right after Vivian's line:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00gamemenu.rpy", line 173, in script
    $ ui.interact()
  File "renpy/common/00gamemenu.rpy", line 173, in <module>
    $ ui.interact()
  File "game/screens.rpy", line 884, in execute
    screen history():
  File "game/screens.rpy", line 884, in execute
    screen history():
  File "game/screens.rpy", line 891, in execute
    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
  File "game/screens.rpy", line 420, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 420, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 429, in execute
    frame:
  File "game/screens.rpy", line 432, in execute
    hbox:
  File "game/screens.rpy", line 438, in execute
    frame:
  File "game/screens.rpy", line 441, in execute
    if scroll == "viewport":
  File "game/screens.rpy", line 456, in execute
    vpgrid:
  File "game/screens.rpy", line 466, in execute
    transclude
  File "game/screens.rpy", line 891, in execute
    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
  File "game/screens.rpy", line 895, in execute
    for h in _history_list:
  File "game/screens.rpy", line 897, in execute
    window:
  File "game/screens.rpy", line 900, in execute
    has fixed:
  File "game/screens.rpy", line 914, in execute
    text what
NameError: Name 'REDACTED' is not defined.

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

Full traceback:
  File "renpy/common/00gamemenu.rpy", line 173, in script
    $ ui.interact()
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00gamemenu.rpy", line 173, in <module>
    $ ui.interact()
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3315, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 3735, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/screen.py", line 436, in visit_all
    callback(self)
  File "renpy/display/core.py", line 3735, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "renpy/display/screen.py", line 447, in per_interact
    self.update()
  File "renpy/display/screen.py", line 637, in update
    self.screen.function(**self.scope)
  File "game/screens.rpy", line 884, in execute
    screen history():
  File "game/screens.rpy", line 884, in execute
    screen history():
  File "game/screens.rpy", line 891, in execute
    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
  File "game/screens.rpy", line 420, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 420, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 429, in execute
    frame:
  File "game/screens.rpy", line 432, in execute
    hbox:
  File "game/screens.rpy", line 438, in execute
    frame:
  File "game/screens.rpy", line 441, in execute
    if scroll == "viewport":
  File "game/screens.rpy", line 456, in execute
    vpgrid:
  File "game/screens.rpy", line 466, in execute
    transclude
  File "game/screens.rpy", line 891, in execute
    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
  File "game/screens.rpy", line 895, in execute
    for h in _history_list:
  File "game/screens.rpy", line 897, in execute
    window:
  File "game/screens.rpy", line 900, in execute
    has fixed:
  File "game/screens.rpy", line 914, in execute
    text what
  File "renpy/text/text.py", line 1574, in __init__
    self.set_text(text, scope, substitute)
  File "renpy/text/text.py", line 1693, in set_text
    i, did_sub = renpy.substitutions.substitute(i, scope, substitute)
  File "renpy/substitutions.py", line 270, in substitute
    s = formatter.vformat(s, (), kwargs)
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 563, in vformat
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 585, in _vformat
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 646, in get_field
  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/string.py", line 605, in get_value
  File "renpy/substitutions.py", line 228, in __getitem__
    raise NameError("Name '{}' is not defined.".format(key))
NameError: Name 'REDACTED' is not defined.

Windows-10-10.0.19041
Ren'Py 7.4.10.2178
School For The Friendless 1.1
Thu Nov 18 11:03:16 2021

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 3:13 pm
by Dollarluigi
Okay, I went back and set "REDACTED" as a variable and I set it to "[REDACTED]" and now it's working.

Code: Select all

default REDACTED = "[REDACTED]"

Re: Escape Character Messing Up Backlog

Posted: Thu Nov 18, 2021 3:30 pm
by Ocelot
Dollarluigi wrote:
Thu Nov 18, 2021 3:13 pm
Okay, I went back and set "REDACTED" as a variable and I set it to "[REDACTED]" and now it's working.

Code: Select all

default REDACTED = "[REDACTED]"
That is treating symptom, not the cause. There are a lot of potential problems which could arise in the future.

When you modified history screen you have deleted line substitute False from text definition.
Part of code displaying dialogue text should look like:

Code: Select all

                text what:
                    substitute False

Re: Escape Character Messing Up Backlog

Posted: Mon Nov 22, 2021 9:09 pm
by Dollarluigi
Ocelot wrote:
Thu Nov 18, 2021 3:30 pm
When you modified history screen you have deleted line substitute False from text definition.
Part of code displaying dialogue text should look like:

Code: Select all

                text what:
                    substitute False
I'm not quite sure I understand what you're getting at. I don't remember deleting anything.

Here's what I found in the code:

Code: Select all

                $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
                text what:
                    substitute False

        if not _history_list:
            label _("The dialogue history is empty.")