I'm having trouble showing my screen "caretBlue". The first time I show it in the script, it works just fine but if I try to show it again, an error occurs.
For context, I'm making a text-based game where the player can input actions. Here's the screen itself:
Code: Select all
screen caretBlue():
modal True
zorder 200
hbox:
xalign 0.5
yalign 0.98
input:
value VariableInputValue("Action", returnable=True)
length 32
copypaste True
prefix ">"
suffix "."
style "caretBox"
textbutton "OK":
action [Hide('caretBlue'), Call("Do")]
keysym('K_RETURN', 'K_KP_ENTER')
text_style "Proceed"
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 41, in script call
call script1
File "game/script1.rpy", line 54, in script
"""
File "renpy/common/00nvl_mode.rpy", line 381, in do_display
**display_args)
AttributeError: 'list' object has no attribute 'replace'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 41, in script call
call script1
File "game/script1.rpy", line 54, in script
"""
File "D:\Games\renpy-7.3.5-sdk/renpy/ast.py", line 715, in execute
renpy.exports.say(who, what, *args, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/exports.py", line 1417, in say
who(what, *args, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/character.py", line 1219, in __call__
self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
File "renpy/common/00nvl_mode.rpy", line 381, in do_display
**display_args)
File "D:\Games\renpy-7.3.5-sdk/renpy/character.py", line 621, in display_say
rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
File "D:\Games\renpy-7.3.5-sdk/renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/core.py", line 3213, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/core.py", line 3631, in interact_core
renpy.display.behavior.input_post_per_interact()
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1129, in input_post_per_interact
i.update_text(content, editable)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1264, in update_text
set_content(new_content)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1259, in set_content
self.set_text([self.prefix, content[0:self.caret_pos].replace("{", "{{"), edit_text, caret,
AttributeError: 'list' object has no attribute 'replace'
Windows-10-10.0.19041
Ren'Py 7.4.5.1648
My Game 1.0
Tue Jun 22 23:05:09 2021
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 41, in script call
call script1
File "game/script1.rpy", line 54, in script
call screen caretBlue
File "renpy/common/000statements.rpy", line 569, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
AttributeError: 'list' object has no attribute 'replace'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 41, in script call
call script1
File "game/script1.rpy", line 54, in script
call screen caretBlue
File "D:\Games\renpy-7.3.5-sdk/renpy/ast.py", line 1969, in execute
self.call("execute")
File "D:\Games\renpy-7.3.5-sdk/renpy/ast.py", line 1957, in call
return renpy.statements.call(method, parsed, *args, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/statements.py", line 278, in call
return method(parsed, *args, **kwargs)
File "renpy/common/000statements.rpy", line 569, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/exports.py", line 3057, in call_screen
rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
File "D:\Games\renpy-7.3.5-sdk/renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/core.py", line 3213, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/core.py", line 3631, in interact_core
renpy.display.behavior.input_post_per_interact()
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1129, in input_post_per_interact
i.update_text(content, editable)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1264, in update_text
set_content(new_content)
File "D:\Games\renpy-7.3.5-sdk/renpy/display/behavior.py", line 1259, in set_content
self.set_text([self.prefix, content[0:self.caret_pos].replace("{", "{{"), edit_text, caret,
AttributeError: 'list' object has no attribute 'replace'
Windows-10-10.0.19041
Ren'Py 7.4.5.1648
My Game 1.0
Tue Jun 22 23:23:10 2021
Any help would be appreciated. Thanks!