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

Project1

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

[已经解决] 自编脚本出错

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
255 小时
注册时间
2010-11-13
帖子
162
跳转到指定楼层
1
发表于 2012-2-4 16:37:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我刚刚写了一个勋章的脚本,插在菜单中用.
结果我发现无论当变量49等于多少时
勋章显示的都是变量49等于1时的图标
请问有人能教一下吗?谢谢了
一下是脚本
def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(10, 75, 120, 32, "勋章")
  if $game_variables[49] =1
    bitmap=Bitmap.new("Graphics/XZ/1")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =2
    bitmap=Bitmap.new("Graphics/XZ/2")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =3
    bitmap=Bitmap.new("Graphics/XZ/3")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =4
    bitmap=Bitmap.new("Graphics/XZ/4")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =5
    bitmap=Bitmap.new("Graphics/XZ/5")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =6
    bitmap=Bitmap.new("Graphics/XZ/6")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =7
    bitmap=Bitmap.new("Graphics/XZ/7")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =8
    bitmap=Bitmap.new("Graphics/XZ/8")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =9
    bitmap=Bitmap.new("Graphics/XZ/9")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =10
    bitmap=Bitmap.new("Graphics/XZ/10")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =11
    bitmap=Bitmap.new("Graphics/XZ/11")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =12
    bitmap=Bitmap.new("Graphics/XZ/12")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =13
    bitmap=Bitmap.new("Graphics/XZ/13")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =14
    bitmap=Bitmap.new("Graphics/XZ/14")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =15
    bitmap=Bitmap.new("Graphics/XZ/15")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =16
    bitmap=Bitmap.new("Graphics/XZ/16")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =17
    bitmap=Bitmap.new("Graphics/XZ/17")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =18
    bitmap=Bitmap.new("Graphics/XZ/18")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =19
    bitmap=Bitmap.new("Graphics/XZ/19")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =20
    bitmap=Bitmap.new("Graphics/XZ/20")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =21
    bitmap=Bitmap.new("Graphics/XZ/21")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    else
    bitmap=Bitmap.new("Graphics/XZ/21")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    end

点评

搞什么飞机  发表于 2012-2-4 16:47

评分

参与人数 2星屑 -122 收起 理由
jiuji250 -100 下次看清楚门牌
死伤殆尽 -22 错区

查看全部评分

Lv4.逐梦者

梦石
0
星屑
6545
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

2
发表于 2012-2-4 21:21:57 | 只看该作者
一个 = 号是赋值.
两个 = 号是判断.

点评

谢谢  发表于 2012-2-4 21:25











你知道得太多了

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 17:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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