找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 18463|回复: 5

[有回复] 萌新求教

[复制链接]
发表于 2019-10-1 12:42:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
大佬们,这段代码哪里错了呢?


[RenPy] 纯文本查看 复制代码
label connections:

    #show screen trills
    #with fade

    call screen speakings

    screen speakings():
        tag menu
        fixed:
            add "Background_back"
            text "|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 1.0)
            text "你" xalign 0.5 yalign 0.5style "speed_text"
            text "你|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            text "你," xalign 0.5 yalign 0.5 style "speed_text"
            text "你,|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            text "你,能" xalign 0.5 yalign 0.5 style "speed_text"
            text "你,能|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            text "你,能看得到" xalign 0.5 yalign 0.5 style "speed_text"
            text "你,能看得到|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            text "你,能看得到吗" xalign 0.5 yalign 0.5 style "speed_text"
            text "你,能看得到吗|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            text "你,能看得到吗?" xalign 0.5 yalign 0.5 style "speed_text"
            text "你,能看得到吗?|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
            $ renpy.pause(delay = 0.5)
            timer 10 action Start()

    hide screen speakings


下面是renpy 给出的错误提示:

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script_connection.rpy", line 89, in script
    call screen speakings
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/script_connection.rpy", line 91, in execute
    screen speakings():
  File "game/script_connection.rpy", line 91, in execute
    screen speakings():
  File "game/script_connection.rpy", line 93, in execute
    tag menu
  File "game/script_connection.rpy", line 96, in execute
    text "|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
  File "game/script_connection.rpy", line 96, in <module>
    text "|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
Exception: ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?
Stack was <Layer: 'transient'>
<Many: <Fixed at 627c790>>
<renpy.sl2.slast.SLContext object at 0x0627CCF0>

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

Full traceback:
  File "game/script_connection.rpy", line 89, in script
    call screen speakings
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ast.py", line 1947, in execute
    self.call("execute")
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ast.py", line 1935, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\statements.py", line 277, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\exports.py", line 2896, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 2699, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/script_connection.rpy", line 91, in execute
    screen speakings():
  File "game/script_connection.rpy", line 91, in execute
    screen speakings():
  File "game/script_connection.rpy", line 93, in execute
    tag menu
  File "game/script_connection.rpy", line 96, in execute
    text "|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
  File "game/script_connection.rpy", line 96, in <module>
    text "|" xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\exports.py", line 1471, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "C:\Users\Air\Downloads\renpy-7.3.2-sdk\renpy\ui.py", line 289, in interact
    raise Exception("ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?\nStack was "+('\n'.join([str(item) for item in stack])))
Exception: ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?
Stack was <Layer: 'transient'>
<Many: <Fixed at 627c790>>
<renpy.sl2.slast.SLContext object at 0x0627CCF0>

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Dusk 1.0
Tue Oct 01 12:31:26 2019






发表于 2019-10-2 19:51:25 | 显示全部楼层
是否是screen的定义应该在调用(call)之前?试试把下面定义的screen speakings()放在上面,或者这个文件开头,或者screen.rpy文件中?
回复 支持 1 抱歉 0

使用道具 举报

 楼主| 发表于 2019-10-1 14:52:49 | 显示全部楼层
有没有大佬呀、
回复 支持 抱歉

使用道具 举报

发表于 2019-10-4 19:47:57 | 显示全部楼层
什么问题不清楚,但给出这段脚本肯定写错了—— 对screen的定义放到 label
回复 支持 抱歉

使用道具 举报

发表于 2019-10-4 23:41:42 | 显示全部楼层
screen speakings(speaking):
        tag menu
        fixed:
            add "Background_back"
            text speaking  xalign 0.5 yalign 0.5 at transform_blink3 style "speed_text"

label start:
    $speaking =  "|"
    call screen speakings
    pause 0.5
     $speaking =  "你|"
    (后略)
这样试试?把文本内容设置为变量,然后在label过程中修改变量内容,screen显示的文本随之变化
别在label里定义screen啊
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2019-11-3 18:18:40 | 显示全部楼层
yume513 发表于 2019-10-4 23:41
screen speakings(speaking):
        tag menu
        fixed:

大佬,如果我有两个文本内容,想分别定义成两个不同的变量,该怎么办呢? @yume513
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-11-23 13:50 , Processed in 0.118133 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表