Project1

标题: 真·对话加强脚本出错有人知道什么问题吗? [打印本页]

作者: jhhuang    时间: 2007-8-21 18:53
标题: 真·对话加强脚本出错有人知道什么问题吗?
在头像显示中我加入了         if $1 == 1
           $1 = $data_actors[387].name
当$1等于1时
就$1变为387号人物的名字.但$1 = $data_actors[387].name这一段显示错误
还有就是"$"这个符号什么意思?在RPG帮助里找不到...

      #——头像设置
      if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
         @face_file = $1 + ".png"
         @x = @face_indent = 128
         if $1 == 1
           $1 = $data_actors[387].name
        end
         if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
         self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 120, 120))
         end
        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
      end
作者: jhhuang    时间: 2007-8-21 18:53
标题: 真·对话加强脚本出错有人知道什么问题吗?
在头像显示中我加入了         if $1 == 1
           $1 = $data_actors[387].name
当$1等于1时
就$1变为387号人物的名字.但$1 = $data_actors[387].name这一段显示错误
还有就是"$"这个符号什么意思?在RPG帮助里找不到...

      #——头像设置
      if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
         @face_file = $1 + ".png"
         @x = @face_indent = 128
         if $1 == 1
           $1 = $data_actors[387].name
        end
         if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
         self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 120, 120))
         end
        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
      end
作者: 精灵使者    时间: 2007-8-21 19:00
我建议把$后面的名字设为字符,最好开头大写。否则容易出错。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1