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

Project1

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

美兽大大帮我改下脚本··

 关闭 [复制链接]
跳转到指定楼层
1
乌有君  发表于 2008-1-25 05:44:30 回帖奖励 |倒序浏览 |阅读模式

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

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

x
第3次修改了··
  1. class Window_HUD < Window_Base
  2. def initialize
  3. super(300,100,200,200)#########################窗口位置、大小
  4. self.contents = Bitmap.new(width - 32, height - 32)
  5. self.contents.font.size = 20
  6. refresh
  7. end
  8. def refresh
  9. self.contents.clear
  10. self.opacity = 100############################窗口透明度
  11. actor = $game_actors[5]#######################角色ID
  12. bitmap=Bitmap.new("Graphics/battlers/#{actor.battler_name}")
  13. src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  14. self.contents.blt(0, 0, bitmap, src_rect)
  15. x = 0
  16. y = 23
  17. draw_actor_name(actor,x,y)
  18. draw_actor_class(actor,x,y + 0)
  19. #############################################################################
  20. self.contents.font.color = system_color
  21. self.contents.draw_text(x, y+40, 120-10-2, 32, "HP", 0)
  22. self.contents.font.color = normal_color
  23. self.contents.draw_text(x, y+40, 160, 32, $game_actors[5].hp.to_s, 2)
  24. #draw_actor_hp(actor,x,y + 40)
  25. #############################################################################
  26. for i in 4..5
  27.    draw_actor_parameter(actor,x, y + 20 *( i - 1),i-1)
  28. end
  29. $hudtemp = [actor.hp,actor.str,actor.dex,actor.class_id]
  30. end
  31. end

  32. class Scene_Map
  33. Window_HUD_SWITCH_ID = 150 ############################开关,打开时显示窗口
  34. alias raz_hud_main main
  35. alias raz_hud_update update
  36. def main
  37. @hud_window = Window_HUD.new
  38. raz_hud_main
  39. @hud_window.dispose
  40. end

  41. def update
  42.    @hud_window.visible = $game_switches[Window_HUD_SWITCH_ID] ? true : false
  43. actor = $game_actors[5]#######################角色ID
  44. maptemp = [actor.hp,actor.str,actor.dex,actor.class_id]
  45. for i in 4..5
  46.    if $hudtemp != maptemp then
  47.      @hud_window.refresh
  48.      @hud_window.update   
  49.    end
  50. end
  51. raz_hud_update
  52. end
  53. end
复制代码


游戏开始的时候,我不打算开此开关··然后一开始就跳出窗口半秒又消失,再打开菜单再关闭也跳出半秒再消失··我想改为不会跳出来··怎么改?
2
乌有君  发表于 2008-1-25 19:06:46
谁来帮帮我啊
回复 支持 反对

使用道具

3
乌有君  发表于 2008-1-25 19:07:28
可参考这个脚本改··也是显示状态的··可它没这BUG


  1. Playerdate_SWITCH = 1 # 当1号开关打开,本脚本才开始工作。
  2. Playerdate_magicdef =19
  3. Yellowkey_itemid=1
  4. Bluekey_itemid=2
  5. Redkey_itemid=3
  6. Greenkey_itemid=41

  7. #==============================================================================
  8. # ■ Window_PlayerDate
  9. #------------------------------------------------------------------------------
  10. #  显示玩家状态的窗口。
  11. #==============================================================================

  12. class Window_PlayerDate < Window_Base
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化窗口
  15.   #--------------------------------------------------------------------------
  16.   def initialize
  17.     super(0, 0, 160, 480)#395)#192,416
  18.     self.contents = Bitmap.new(width - 32, height - 32)
  19.     self.z =210
  20.     self.opacity=0
  21.     self.back_opacity =255
  22. #    self.contents_opacity = 255
  23.     self.visible = false
  24. #    self.contents.clear
  25.     refresh
  26. #    if $game_switches[XY_SWITCH]
  27. #      self.contents_opacity = 0
  28. #    else
  29. #      self.contents_opacity = 5
  30. #    end
  31.    
  32.   end
  33.   
  34.   
  35.   def refresh
  36.     if $game_switches[50]#进入屏幕右侧状态栏换到左侧
  37.       self.x=0
  38.     else#进入屏幕左侧状态栏换到右侧
  39.       self.x=480
  40.     end

  41.     self.contents.clear
  42.     x=25
  43.     x=30 if !$game_switches[27]
  44.     y=75
  45.     y=40 if !$game_switches[27]
  46.     #actor = $game_party.actors[1]
  47.     draw_actor_graphic($game_party.actors[0], 20, 35)

  48.     self.contents.font.color = system_color
  49.     self.contents.draw_text(40, 11, 25, 20, "第", 0) if $game_switches[36]
  50.     self.contents.draw_text(100, 11, 25, 20, "层", 0)if $game_switches[36]
  51.     self.contents.draw_text(0, 55, 50, 20, "等级", 0)
  52.    
  53.     if $game_switches[42]
  54.       a=$game_variables[1]+81
  55.       if $game_variables[1]==3
  56.         a=116
  57.       end
  58.       if $game_variables[a]!=0
  59.         bitmap = Bitmap.new("Graphics/Pictures/up.png")
  60.         self.contents.blt(40,55 , bitmap, Rect.new(0, 0, 20, 20))
  61.       end
  62.     end

  63.     self.contents.draw_text(4, 65+x, 40, 20, "生命", 0)
  64.     self.contents.draw_text(4, 65+x*2, 40, 20, "攻击", 0)
  65.     self.contents.draw_text(4, 65+x*3, 40, 20,"防御", 0)
  66.     self.contents.draw_text(4, 65+x*4, 40, 20, "魔防", 0) if $game_switches[Playerdate_magicdef]
  67.     self.contents.draw_text(4, 65+x*5, 40, 20, "速度", 0) if $game_switches[27]

  68.     self.contents.draw_text(4, y+x*6, 40, 20, "经验", 0)
  69.     self.contents.draw_text(4, y+x*7, 40, 20, "金币", 0)

  70.     if $game_switches[26]
  71.       bitmap = RPG::Cache.icon("101-01")#黄钥匙)
  72.       self.contents.blt(10, 280, bitmap, Rect.new(0, 0, 32, 32))   
  73.       bitmap = RPG::Cache.icon("101-02")#蓝钥匙)
  74.       self.contents.blt(10, 307, bitmap, Rect.new(0, 0, 32, 32))
  75.       bitmap = RPG::Cache.icon("101-03")#红钥匙)
  76.       self.contents.blt(10, 334, bitmap, Rect.new(0, 0, 32, 32))
  77.       bitmap = RPG::Cache.icon("101-04") if $game_switches[43]#绿钥匙)
  78.       self.contents.blt(10, 361, bitmap, Rect.new(0, 0, 32, 32)) if $game_switches[43]

  79.     else
  80.       self.contents.font.color = text_color(6)   
  81.       self.contents.draw_text(8, 285, 50, 20, "黄钥匙", 0)
  82.       self.contents.font.color = text_color(4)   
  83.       self.contents.draw_text(8, 313, 50, 20, "蓝钥匙", 0)
  84.       self.contents.font.color = text_color(2)   
  85.       self.contents.draw_text(8, 341, 50, 20, "红钥匙", 0)
  86.       self.contents.font.color = text_color(3)   
  87.       self.contents.draw_text(8, 369, 50, 20, "绿钥匙", 0) if $game_switches[43]
  88.     end
  89.    
  90.     @xgraphic=$game_party.actors[0].character_name
  91.     @xfloor=$game_variables[2]
  92.     @xlevel=$game_actors[$game_variables[1]+1].level
  93.     @xlevelup=$game_variables[$game_variables[1]+81] if $game_switches[42]
  94.     @xlife=$game_actors[$game_variables[1]+1].hp
  95.     @xattact=$game_actors[$game_variables[1]+1].str
  96.     @xdefence=$game_actors[$game_variables[1]+1].dex
  97.     @xmagicdef=$game_actors[$game_variables[1]+1].int if $game_switches[Playerdate_magicdef]
  98.     @xspeed=$game_actors[$game_variables[1]+1].agi if $game_switches[27]
  99.     @xexp= $game_actors[$game_variables[1]+1].exp
  100.     @xgold=$game_party.gold
  101.     @xyellowkey=$game_party.item_number(Yellowkey_itemid)
  102.     @xbluekey=$game_party.item_number(Bluekey_itemid)
  103.     @xredkey=$game_party.item_number(Redkey_itemid)
  104.     @xgreenkey=$game_party.item_number(Greenkey_itemid) if $game_switches[43]
  105.     @xpoison=$game_switches[13]
  106.     @xpoor=$game_switches[15]
  107.     @xcurse=$game_switches[16]
  108.     @xslow=$game_switches[12]
  109.     @xchange=$game_switches[50]
  110.    
  111.    
  112.     self.contents.font.color = normal_color
  113.     self.contents.draw_text(32, 0, 60, 45, @xfloor.to_s, 2) if $game_switches[36]
  114.     self.contents.draw_text(40, 0, 80, 45, @xfloor.to_s, 2) if !$game_switches[36]
  115.    
  116.     self.contents.draw_text(50, 50, 65, 30, @xlevel.to_s, 2)
  117.     self.contents.draw_text(43, 65+x, 72, 20,@xlife .to_s, 2)
  118.     self.contents.draw_text(50, 65+x*2, 65, 20,@xattact .to_s, 2)
  119.     self.contents.draw_text(50, 65+x*3, 65, 20,@xdefence .to_s, 2)
  120.     self.contents.draw_text(50, 65+x*4, 65, 20,@xmagicdef .to_s, 2) if $game_switches[Playerdate_magicdef]
  121.     self.contents.draw_text(50, 65+x*5, 65, 20,@xspeed .to_s, 2) if $game_switches[27]

  122.     self.contents.draw_text(50, y+x*6, 65, 20,@xexp.to_s, 2)
  123.     self.contents.draw_text(50, y+x*7, 65, 20, @xgold.to_s, 2)
  124.    
  125.     self.contents.font.color = text_color(6)
  126.     self.contents.draw_text(75, 285, 25, 20, @xyellowkey.to_s, 2)
  127.     self.contents.font.color = text_color(4)
  128.     self.contents.draw_text(75, 313, 25, 20, @xbluekey .to_s, 2)
  129.     self.contents.font.color = text_color(2)
  130.     self.contents.draw_text(75, 341, 25, 20, @xredkey.to_s, 2)
  131.     self.contents.font.color = text_color(3)
  132.     self.contents.draw_text(75, 369, 25, 20, @xgreenkey.to_s, 2) if $game_switches[43]
  133.    
  134.     self.contents.font.color = text_color(3)
  135.     self.contents.draw_text(8, 390, 30, 30, "毒".to_s, 0) if $game_switches[13]
  136.     self.contents.font.color = text_color(5)
  137.     self.contents.draw_text(36, 390, 30, 30, "衰".to_s, 0) if $game_switches[15]
  138.     self.contents.font.color = text_color(4)
  139.     self.contents.draw_text(64, 390, 30, 30, "咒".to_s, 0) if $game_switches[16]
  140.     self.contents.font.color = text_color(1)
  141.     self.contents.draw_text(92, 390, 30, 30, "慢".to_s, 0) if $game_switches[12]
  142.    
  143.    
  144.    
  145.   end
  146.   
  147.   def judge#用于判断是否数据变更,节约内存
  148.     return true if @xgraphic!=$game_party.actors[0].character_name
  149.     return true if @xfloor!=$game_variables[2]
  150.     return true if @xlevel!=$game_actors[$game_variables[1]+1].level
  151.     return true if @xlevelup!=$game_variables[$game_variables[1]+81] if $game_switches[42]
  152.     return true if @xlife!=$game_actors[$game_variables[1]+1].hp
  153.     return true if @xattact!=$game_actors[$game_variables[1]+1].str
  154.     return true if @xdefence!=$game_actors[$game_variables[1]+1].dex
  155.     return true if @xmagicdef!=$game_actors[$game_variables[1]+1].int if $game_switches[Playerdate_magicdef]
  156.     return true if @xspeed!=$game_actors[$game_variables[1]+1].agi if $game_switches[27]
  157.     return true if @xexp!= $game_actors[$game_variables[1]+1].exp
  158.     return true if @xgold!=$game_party.gold
  159.     return true if @xyellowkey!=$game_party.item_number(Yellowkey_itemid)
  160.     return true if @xbluekey!=$game_party.item_number(Bluekey_itemid)
  161.     return true if @xredkey!=$game_party.item_number(Redkey_itemid)
  162.     return true if @xgreenkey!=$game_party.item_number(Greenkey_itemid) if $game_switches[43]
  163.     return true if @xpoison!=$game_switches[13]
  164.     return true if @xpoor!=$game_switches[15]
  165.     return true if @xcurse!=$game_switches[16]
  166.     return true if @xslow!=$game_switches[12]
  167.     return true if @xchange!=$game_switches[50]
  168.     return false
  169.   end

  170. end

  171. ###########################################################################
  172. #                           下面的东西不需要掌握~                         #
  173. ###########################################################################

  174. class Scene_Map
  175. alias xy_66rpg_main main
  176. def main
  177.    @Playerdate_window = Window_PlayerDate.new
  178.    @Playerdate_window.x = $game_variables[105]
  179. #   @xy_window.y = 480 - 96
  180. #   @xy_window.opacity = 0
  181.    xy_66rpg_main
  182.    @Playerdate_window .dispose
  183. end
  184. #--------------------------------------------------------------------------
  185. # ● 刷新画面
  186. #--------------------------------------------------------------------------
  187. alias xy_66rpg_update update
  188. def update
  189.    xy_66rpg_update
  190.    if $game_switches[Playerdate_SWITCH]
  191.      @Playerdate_window .visible = true     
  192.      @Playerdate_window .refresh if @Playerdate_window.judge
  193.    else
  194.      @Playerdate_window .visible = false
  195.    end
  196. end
  197. end
  198. #==========================================================================
  199. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  200. #==========================================================================
复制代码
回复 支持 反对

使用道具

头像被屏蔽

Lv1.梦旅人 (禁止发言)

七仙女

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-15
帖子
559
4
发表于 2008-1-25 20:21:36 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

茄孓

梦石
0
星屑
72
在线时间
140 小时
注册时间
2007-5-29
帖子
956
5
发表于 2008-1-25 20:27:22 | 只看该作者
对啊, 应该要大于0才能发出奖赏的
回复 支持 反对

使用道具 举报

6
乌有君  发表于 2008-1-25 20:39:19
··别说没用的··谁帮我改下啊··我就这次保证下次不会再用这个BUG了··
回复 支持 反对

使用道具

7
乌有君  发表于 2008-1-25 21:03:21
救命啊!
回复 支持 反对

使用道具

Lv1.梦旅人

月下可怜人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2005-11-23
帖子
4085

第1届短篇游戏比赛亚军

8
发表于 2008-1-25 21:05:52 | 只看该作者
LZ你先把悬赏取消了,我再回答你的问题。
纵然千里外,我等雁归来。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

喵,小柯的宠物

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-15
帖子
2310
9
发表于 2008-1-25 21:09:16 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

10
乌有君  发表于 2008-1-25 21:10:04
好人卡取消不了了··如果不要我就不给你··就自己结帐··
回复 支持 反对

使用道具

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

本版积分规则

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

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

GMT+8, 2025-7-22 18:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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