I'm playing around with some screen language again and testing out a super rough character creation screen.
Currently I have a little screen with a name input box, no issues there thankfully,a nd im trying to add a cycleable section below it for something like pronouns, a title, etc for the character as a text displayable.
here's my code for this!
Code: Select all
default list1 = {
"1" : "",
"2": "",
"3": ""
}
default selection_variable = 0
screen charcreate:
image "images/createbg.png"
fixed:
xpos 650
ypos 490
text "{color=#000000}This book belongs to{/color}":
size 30
input:
ypos 65
xpos 20
pixel_width(500)
value VariableInputValue("player_name")
textbutton ">":
xpos 650
ypos 700
action CycleVariable(list1, values=["1","2","3"], loop=True)
text "[list1[selection_variable]]":
xpos 675
ypos 700
textbutton "Start":
xpos 1500
ypos 1000
action Jump("continue")
keysym('K_RETURN', 'K_KP_ENTER')
and then the current error i am getting is:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 15, in script
call screen charcreate
File "renpy/common/000statements.rpy", line 671, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "renpy/common/00action_data.rpy", line 75, in __call__
_set_field(self.object, self.field, self.value_to_set(), self.kind)
File "renpy/common/00action_data.rpy", line 253, in value_to_set
value = self.current_value()
File "renpy/common/00action_data.rpy", line 79, in current_value
return _get_field(self.object, self.field, self.kind)
File "renpy/common/00action_data.rpy", line 36, in _get_field
raise Exception("The {!r} {} does not exist.".format(name, kind))
Exception: The '1' global variable does not exist.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 15, in script
call screen charcreate
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\ast.py", line 1968, in execute
self.call("execute")
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\ast.py", line 1950, in call
return renpy.statements.call(method, parsed, *args, **kwargs)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\statements.py", line 349, in call
return method(parsed, *args, **kwargs)
File "renpy/common/000statements.rpy", line 671, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\exports.py", line 3413, in call_screen
rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\ui.py", line 301, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\core.py", line 2165, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\core.py", line 3197, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\screen.py", line 793, in event
rv = self.child.event(ev, x, y, st)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\layout.py", line 1202, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\behavior.py", line 1174, in event
return handle_click(self.clicked)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\behavior.py", line 1095, in handle_click
rv = run(action)
File "C:\Users\Wampl\OneDrive\Documents\renpy-8.2.0-sdk\renpy\display\behavior.py", line 395, in run
return action(*args, **kwargs)
File "renpy/common/00action_data.rpy", line 75, in __call__
_set_field(self.object, self.field, self.value_to_set(), self.kind)
File "renpy/common/00action_data.rpy", line 253, in value_to_set
value = self.current_value()
File "renpy/common/00action_data.rpy", line 79, in current_value
return _get_field(self.object, self.field, self.kind)
File "renpy/common/00action_data.rpy", line 36, in _get_field
raise Exception("The {!r} {} does not exist.".format(name, kind))
Exception: The '1' global variable does not exist.
Windows-10-10.0.19045 AMD64
Ren'Py 8.2.0.24012702
char creation test 1.0
Wed Feb 14 07:45:18 2024
I currently don't feel that the selection_variable is set up to cycle correctly, but i'm not 100% what I need to be doing here with it