设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1976|回复: 2
打印 上一主题 下一主题

[已经解决] 如何在这窗口里面显示我想要的变量?

[复制链接]

Lv1.梦旅人

饕餮

梦石
0
星屑
222
在线时间
677 小时
注册时间
2011-5-9
帖子
486
跳转到指定楼层
1
发表于 2012-3-7 01:57:29 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
没有VIP呀~~希望不要嫌弃这500经验~~~


问题是这样的,我想在这窗口里显示我想要的变量,于是我就输入   \v[1]  我想显示一号变量,可是.........

你看:


怎么显示不出来呀?
我不懂了···怎么才能显示呀??


脚本在这里~帮帮我啦  真的不会脚本···

这是脚本:
  1. #==============================================================================
  2. # ■ Scene_pet
  3. #------------------------------------------------------------------------------
  4. #  处理画面的类。
  5. #==============================================================================

  6. class Status_soumin < Scene_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     menu_index : 命令窗口光标初始位置
  10.   #--------------------------------------------------------------------------
  11.   def initialize(id,menu_index = 0)
  12.     @menu_index = menu_index
  13.     @id=id
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 开始处理
  17.   #--------------------------------------------------------------------------
  18.   def start
  19.     super
  20.     create_menu_background
  21.     create_command_window
  22.     @gold_window = Window_Gold.new(0, 360)
  23.     @soumin_window = Window_soumin.new(160, 0,@id)
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 结束处理
  27.   #--------------------------------------------------------------------------
  28.   def terminate
  29.     super
  30.     dispose_menu_background
  31.     @command_window.dispose
  32.     @gold_window.dispose
  33.     @soumin_window.dispose
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 更新画面
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     super
  40.     update_menu_background
  41.     @command_window.update
  42.     @gold_window.update
  43.     @soumin_window.update if @soumin_window.active
  44.     if @command_window.active
  45.       update_command_selection
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 生成命令窗口
  50.   #--------------------------------------------------------------------------
  51.   def create_command_window
  52.     s1 = "人物属性"   
  53.     s2 = "返回"   
  54.     @command_window = Window_Command.new(160, [s1,s2])
  55.     @command_window.index = @menu_index
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 更新命令窗口
  59.   #--------------------------------------------------------------------------
  60.   def update_command_selection
  61.     if Input.trigger?(Input::B)
  62.       Sound.play_cancel
  63.       $scene = Scene_Menu.new(3)
  64.     elsif Input.trigger?(Input::C)
  65.       if $game_party.members.size == 0 and @command_window.index < 4
  66.         Sound.play_buzzer
  67.         return
  68.       elsif $game_system.save_disabled and @command_window.index == 4
  69.         Sound.play_buzzer
  70.         return
  71.       end
  72.       Sound.play_decision
  73.       case @command_window.index
  74.       when 0      #人物属性
  75.         $scene = Status_soumin.new(0)
  76.       when 1      #离开
  77.         $scene = Scene_Menu.new(3)
  78.       end
  79.     end
  80.   end
  81.   
  82. end


  83. #==============================================================================
  84. # ■ Window_MenuStatus
  85. #------------------------------------------------------------------------------
  86. #  显示菜单画面和同伴状态的窗口。
  87. #==============================================================================

  88. class Window_soumin < Window_Selectable
  89.   #--------------------------------------------------------------------------
  90.   # ● 初始化对像
  91.   #     x      : 窗口 X 座标
  92.   #     y      : 窗口 Y 座标
  93.   #--------------------------------------------------------------------------
  94.   def initialize(x, y,id)
  95.     super(x, y, 384, 416)
  96.     @id=id
  97.     refresh
  98.     self.active = false
  99.     self.index = -1
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 刷新
  103.   #--------------------------------------------------------------------------
  104.   def refresh
  105.     self.contents.clear
  106.     x=10
  107.     y=0
  108.     self.contents.font.color = text_color(3)
  109.     self.contents.draw_text(x, y, 346, 24, "寿命:\v[1]")
  110.     y+=24
  111.     self.contents.draw_text(x, y, 346, 24, "成长:\v[1]")
  112.     y+=24
  113.     self.contents.draw_text(x, y, 346, 24, "健壮:\v[1]")
  114.     y+=24
  115.     self.contents.draw_text(x, y, 346, 24, "魅力:\v[1]")
  116.     y+=24
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 更新光标
  120.   #--------------------------------------------------------------------------
  121.   def update_cursor
  122.     if @index < 0               # 无光标
  123.       self.cursor_rect.empty
  124.     elsif @index < @item_max    # 一般
  125.       self.cursor_rect.set(0, @index * 96, contents.width, 96)
  126.     elsif @index >= 100         # 使用本身
  127.       self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
  128.     else                        # 全体
  129.       self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
  130.     end
  131.   end
  132. end
  133. class Window_soumin2 < Window_Selectable
  134.   #--------------------------------------------------------------------------
  135.   # ● 初始化对像
  136.   #     x      : 窗口 X 座标
  137.   #     y      : 窗口 Y 座标
  138.   #--------------------------------------------------------------------------
  139.   def initialize(x, y,id)
  140.     super(x, y, 384, 416)
  141.     @id=id
  142.     refresh
  143.     self.active = false
  144.     self.index = -1
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 刷新
  148.   #--------------------------------------------------------------------------
  149.   def refresh
  150.     self.contents.clear
  151.     x=10
  152.     y=0
  153.     self.contents.font.color = text_color(0)
  154.     self.contents.draw_text(x, y, 346, 24, "装备说明.")
  155.     y+=24
  156.     self.contents.draw_text(x, y, 346, 24, "属性说明.")
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 更新光标
  160.   #--------------------------------------------------------------------------
  161.   def update_cursor
  162.     if @index < 0               # 无光标
  163.       self.cursor_rect.empty
  164.     elsif @index < @item_max    # 一般
  165.       self.cursor_rect.set(0, @index * 96, contents.width, 96)
  166.     elsif @index >= 100         # 使用本身
  167.       self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
  168.     else                        # 全体
  169.       self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
  170.     end
  171.   end
  172. end
复制代码

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

2
发表于 2012-3-7 08:09:36 | 只看该作者
  1. \v[1]
复制代码
改成
  1. $game_variables[1]
复制代码
试试

点评

但也谢谢你··虽然没能把分给你··但我会记在心里的·  发表于 2012-3-7 16:07

评分

参与人数 1星屑 +100 收起 理由
iisnow + 100 谢谢~

查看全部评分

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
503
在线时间
1478 小时
注册时间
2011-9-17
帖子
1316

开拓者贵宾

3
发表于 2012-3-7 09:36:49 | 只看该作者
LS是对的,但是不能直接修改:
"寿命:\v[1]" 改为 "寿命:#{$game_variables[1]}"
这样才可以

其他的项一样的方法修改

点评

谢谢啦~~可以了!  发表于 2012-3-7 16:06
我帖子中要有是不HX的空白,请Ctrl + A
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-24 00:52

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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