TestGameHentai,
не удалось воспроизвести ошибку, но из кусочков предоставленнного кода кажется получилось сделать чтоб работало. проверь
Код
default cpl = ''
define player = Character("[cpl]", color="#ffffff")
init python:
input_name = VariableInputValue('cpl',returnable = True)
screen charname(prompt):
modal True
frame:
background Frame("#000000")
align (0.5,0.5)
xsize 600 ysize 350
vbox:
xfill True
yfill True
text prompt xalign 0.5
input id "input" value input_name xalign 0.5
hbox:
xalign 0.5
textbutton("Подтвердить"):
action Return(cpl)
label start:
label namepl:
"Как же меня зовут?"
$ cpl = renpy.input("Назовите себя:", screen="charname", length=24, exclude="'\{\}\[\]@.,<>\"\|/№#$;%^:&?*()_=+1234567890`~").strip()
#$ cpl = _return
jump test
return
label test:
"..."
if cpl == "":
"\[Требуется ввести имя\]"
jump namepl
else:
"Точно."
jump next
label next:
player "Меня зовут [cpl]."
return
lf2mr,
тут я честно говоря плаваю, и вероятно есть более правильное решение, например через команду on
но там в интерфейсе по умолчанию все сложно, потому я обычно костылирую через timer
Код
screen myscreen:
timer .01 action Function(myfunc)
Но возможно следует вообще пересмотреть логику функции и сделать ее более благоприятной для движка, тоесть чтобы оно не делало что-то гловально вне языка скринов
цитирую:
Цитата
Screens must not cause side effects that are visible from outside the screen. Ren'Py will run a screen multiple times, as it deems necessary. It runs a screen as part of the image prediction process, before the screen is first shown. As a result, if running a screen has side effects, those side effects may occur at unpredictable times.
Using Python generators in screens may cause unpredictable results. This traces back to an issue with the way the Python interpreter compiles Python source code that will be used in a screen context. Generators can be used in Python functions called from a screen, but not in the screen itself.