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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: TLF
打印 上一主题 下一主题

有没有在非战斗界面下可以图片显示HP MP的方法

 关闭 [复制链接]

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
11
发表于 2009-5-29 04:14:58 | 只看该作者
  1. DT_SWITCH = 66

  2. #_______________________________________________________________________________
  3. # MOG_MPW HUD Elena V2.0           
  4. #_______________________________________________________________________________
  5. # By Moghunter
  6. # http://www.atelier-rgss.com
  7. #_______________________________________________________________________________
  8. module MOG
  9. #HUD Position.
  10. STMAPX = 476   # X Pos
  11. STMAPY = - 16 # Y Pos
  12. #Disable HUD Switch ID.  
  13. STMAPVIS = 1
  14. #Windowskin name.
  15. STMAPSKIN = ""
  16. #Window Opacity.
  17. STMAPOPA = 0
  18. end
  19. $mogscript = {} if $mogscript == nil
  20. $mogscript["mpstelen"] = true
  21. ###############
  22. # Window_Base #
  23. ###############
  24. class Window_Base < Window   

  25. def draw_maphp2(actor, x, y)
  26. text = RPG::Cache.picture("HP_Tx")   
  27. cw = text.width
  28. ch = text.height
  29. src_rect = Rect.new(0, 0, cw, ch)
  30. self.contents.blt( 75, 0, text, src_rect)
  31. meter = RPG::Cache.picture("HP_Meter")   
  32. cw = meter.width  * actor.hp / actor.maxhp
  33. ch = meter.height
  34. src_rect = Rect.new(0, 0, cw, ch)
  35. self.contents.blt( 94 ,16 , meter, src_rect)
  36. end  

  37. #def draw_mapsp2(actor, x, y)
  38. #meter = RPG::Cache.picture("SP_Meter")   
  39. #cw = meter.width  
  40. #ch = meter.height *  actor.sp / actor.maxsp
  41. #src_rect = Rect.new(0, 0,  cw, ch)
  42. #self.contents.blt( 81, 2, meter,  src_rect)
  43. #end

  44. def draw_mapsp2(actor, x, y)
  45. meter = RPG::Cache.picture("SP_Meter")   
  46. cw = meter.width  
  47. ch = 60 - meter.height *  actor.sp / actor.maxsp
  48. src_rect = Rect.new(0, 0,  cw, ch)
  49. self.contents.blt( 81, 2, meter,  src_rect)
  50. end


  51. def draw_mexp(actor, x, y)
  52. actor = $game_party.actors[0]
  53. if actor.next_exp != 0
  54. rate = actor.now_exp.to_f / actor.next_exp
  55. else
  56. rate = 1
  57. end
  58. bitmap = RPG::Cache.picture("Exp_Meter")
  59. #bitmap.z = 10
  60. if actor.level < 99
  61. cw = bitmap.width
  62. else
  63. cw = bitmap.width
  64. end   
  65. ch = bitmap.height - bitmap.height * rate
  66. src_rect = Rect.new(0, 0, cw, ch)
  67. self.contents.blt(88 , 6, bitmap, src_rect)

  68. end
  69. def nada
  70. face = RPG::Cache.picture("")
  71. end  
  72. def draw_heroface(actor,x,y) #"Graphics/system/menu/headp/" + actor.name + ".png"
  73. face = RPG::Cache.picture("../system/menu/HeadP/"+actor.name+"【地图】.png" ) rescue nada
  74. cw = face.width
  75. ch = face.height
  76. src_rect = Rect.new(0, 0, cw, ch)
  77. self.contents.blt(93 , 8, face, src_rect)
  78. end  

  79. end
  80. ##############
  81. # Game_Actor #
  82. ##############
  83. class Game_Actor < Game_Battler
  84. def now_exp
  85. return @exp - @exp_list[@level]
  86. end
  87. def next_exp
  88. return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  89. end
  90. end
  91. #####################
  92. # Window_Status_Map #
  93. #####################
  94. class Window_Sthero < Window_Base
  95. def initialize
  96. super(0, 0, 310, 120)
  97. self.contents = Bitmap.new(width - 32, height - 32)
  98. self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   
  99. self.contents.font.bold = true
  100. self.contents.font.size = 20
  101. self.contents.font.name = "Georgia"
  102. self.opacity = MOG::STMAPOPA

  103. refresh
  104. end  
  105. def refresh
  106.    if $game_switches[DT_SWITCH]
  107. #actor = $game_party.actors[0]

  108. #draw_maphp2(actor, 35, 35)
  109. #draw_mapsp2(actor, - 40, 60)
  110. #draw_mexp(actor, 100, 10)
  111. #draw_heroface(actor, 0, 70) 游啊游
  112.      self.contents.clear
  113. actor = $game_party.actors[0]

  114. draw_maphp2(actor, 35, 35)
  115. draw_mapsp2(actor, - 40, 60)
  116. draw_mexp(actor, 100, 10)
  117. draw_heroface(actor, 0, 70)
  118. end

  119. # draw_actor_statemap(actor, 200, 60, 70)
  120. #draw_actor_levelmap(actor, 80, 10)   

  121. end
  122. end
  123. ###############
  124. # Game_Player #
  125. ###############
  126. class Game_Player < Game_Character
  127. attr_accessor :wref
  128. end
  129. #############
  130. # Scene_Map #
  131. #############
  132. class Scene_Map
  133. alias mog11_main main
  134. def main
  135. @sthero = Window_Sthero.new
  136. @sthero.x = MOG::STMAPX
  137. @sthero.y = MOG::STMAPY
  138. if $game_switches[MOG::STMAPVIS] == false
  139. @sthero.visible = true  
  140. else
  141. @sthero.visible = false  
  142. end  
  143. mog11_main
  144. @sthero.dispose
  145. end
  146. alias mog11_update update
  147. def update
  148. mog11_update
  149. if $game_switches[MOG::STMAPVIS] == false
  150. @sthero.visible = true  
  151. else
  152. @sthero.visible = false  
  153. end
  154. if $game_switches[DT_SWITCH]
  155.     @sthero.visible = true
  156.     if $game_player.wref == true
  157. @sthero.refresh
  158. $game_player.wref = false
  159. end
  160.     else
  161.     @sthero.visible = false  
  162.      $game_player.wref = false
  163.   end
  164.   
  165. #if $game_switches[MOG::STMAPVIS] == false游啊游
  166. #@sthero.visible = true  
  167. #else
  168. #@sthero.visible = false  
  169. #end  
  170. #if $game_player.wref == true
  171. #@sthero.refresh
  172. #$game_player.wref = false
  173. #end
  174. #else
  175. # @sthero.visible = false  
  176.   #$game_player.wref = false

  177. #end

  178. end
  179. end  
  180. ##############
  181. # Game_Party #
  182. ###############
  183. class Game_Party
  184. alias mog11_check_map_slip_damage check_map_slip_damage  
  185. def check_map_slip_damage
  186. for actor in @actors
  187. if actor.hp > 0 and actor.slip_damage?
  188. $game_player.wref = true
  189. end
  190. end
  191. mog11_check_map_slip_damage  
  192. end
  193. end
  194. ###############
  195. # Interpreter #
  196. ###############
  197. class Interpreter
  198. alias mog11_command_311 command_311
  199. def command_311
  200. mog11_command_311
  201. $game_player.wref = true   
  202. end   
  203. alias mog11_command_312 command_312
  204. def command_312
  205. mog11_command_312
  206. $game_player.wref = true   
  207. end   
  208. alias mog11_command_313 command_313
  209. def command_313
  210. mog11_command_313
  211. $game_player.wref = true   
  212. end   
  213. alias mog11_command_314 command_314
  214. def command_314
  215. mog11_command_314
  216. $game_player.wref = true   
  217. end   
  218. alias mog11_command_315 command_315
  219. def command_315
  220. mog11_command_315
  221. $game_player.wref = true   
  222. end   
  223. end   
  224. ################
  225. # Game_Battler #
  226. ################
  227. class Game_Battler
  228. alias mog11_attack_effect attack_effect
  229. def attack_effect(attacker)
  230. mog11_attack_effect(attacker)  
  231. $game_player.wref = true
  232. end
  233. alias mog11_skill_effect skill_effect
  234. def skill_effect(user, skill)
  235. mog11_skill_effect(user, skill)
  236. $game_player.wref = true  
  237. end  
  238. alias mog11_item_effect item_effect
  239. def item_effect(item)
  240. mog11_item_effect(item)
  241. $game_player.wref = true  
  242. end
  243. alias mog11_add_state add_state
  244. def add_state(state_id, force = false)
  245. mog11_add_state(state_id, force = false)
  246. $game_player.wref = true  
  247. end
  248. end
复制代码


素材自理

截图看 我签名处的游戏

是否是LZ 要的效果?
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
93 小时
注册时间
2008-5-16
帖子
745
12
发表于 2009-5-29 04:19:05 | 只看该作者
写个窗口,内容是
bitmap类吧
让其宽度随HP变化即可
然后窗口显示在某Scene内
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2008-10-19
帖子
326
13
 楼主| 发表于 2009-5-29 05:46:39 | 只看该作者
以下引用redant于2009-5-28 20:14:58的发言:

DT_SWITCH = 66

#_______________________________________________________________________________
# MOG_MPW HUD Elena V2.0           
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#HUD Position.
STMAPX = 476   # X Pos
STMAPY = - 16 # Y Pos
#Disable HUD Switch ID.  
STMAPVIS = 1
#Windowskin name.
STMAPSKIN = ""
#Window Opacity.
STMAPOPA = 0
end
$mogscript = {} if $mogscript == nil
$mogscript["mpstelen"] = true
###############
# Window_Base #
###############
class Window_Base < Window   

def draw_maphp2(actor, x, y)
text = RPG::Cache.picture("HP_Tx")   
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt( 75, 0, text, src_rect)
meter = RPG::Cache.picture("HP_Meter")   
cw = meter.width  * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt( 94 ,16 , meter, src_rect)
end  

#def draw_mapsp2(actor, x, y)
#meter = RPG::Cache.picture("SP_Meter")   
#cw = meter.width  
#ch = meter.height *  actor.sp / actor.maxsp
#src_rect = Rect.new(0, 0,  cw, ch)
#self.contents.blt( 81, 2, meter,  src_rect)
#end

def draw_mapsp2(actor, x, y)
meter = RPG::Cache.picture("SP_Meter")   
cw = meter.width  
ch = 60 - meter.height *  actor.sp / actor.maxsp
src_rect = Rect.new(0, 0,  cw, ch)
self.contents.blt( 81, 2, meter,  src_rect)
end


def draw_mexp(actor, x, y)
actor = $game_party.actors[0]
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.picture("Exp_Meter")
#bitmap.z = 10
if actor.level < 99
cw = bitmap.width
else
cw = bitmap.width
end   
ch = bitmap.height - bitmap.height * rate
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(88 , 6, bitmap, src_rect)

end
def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y) #"Graphics/system/menu/headp/" + actor.name + ".png"
face = RPG::Cache.picture("../system/menu/HeadP/"+actor.name+"【地图】.png" ) rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(93 , 8, face, src_rect)
end  

end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#####################
# Window_Status_Map #
#####################
class Window_Sthero < Window_Base
def initialize
super(0, 0, 310, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   
self.contents.font.bold = true
self.contents.font.size = 20
self.contents.font.name = "Georgia"
self.opacity = MOG::STMAPOPA

refresh
end  
def refresh
   if $game_switches[DT_SWITCH]
#actor = $game_party.actors[0]

#draw_maphp2(actor, 35, 35)
#draw_mapsp2(actor, - 40, 60)
#draw_mexp(actor, 100, 10)
#draw_heroface(actor, 0, 70) 游啊游
     self.contents.clear
actor = $game_party.actors[0]

draw_maphp2(actor, 35, 35)
draw_mapsp2(actor, - 40, 60)
draw_mexp(actor, 100, 10)
draw_heroface(actor, 0, 70)
end

# draw_actor_statemap(actor, 200, 60, 70)
#draw_actor_levelmap(actor, 80, 10)   

end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
@sthero = Window_Sthero.new
@sthero.x = MOG::STMAPX
@sthero.y = MOG::STMAPY
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true  
else
@sthero.visible = false  
end  
mog11_main
@sthero.dispose
end
alias mog11_update update
def update
mog11_update
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true  
else
@sthero.visible = false  
end
if $game_switches[DT_SWITCH]
    @sthero.visible = true
    if $game_player.wref == true
@sthero.refresh
$game_player.wref = false
end
    else
    @sthero.visible = false  
     $game_player.wref = false
  end
  
#if $game_switches[MOG::STMAPVIS] == false游啊游
#@sthero.visible = true  
#else
#@sthero.visible = false  
#end  
#if $game_player.wref == true
#@sthero.refresh
#$game_player.wref = false
#end
#else
# @sthero.visible = false  
  #$game_player.wref = false

#end

end
end  
##############
# Game_Party #
###############
class Game_Party
alias mog11_check_map_slip_damage check_map_slip_damage  
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
$game_player.wref = true
end
end
mog11_check_map_slip_damage  
end
end
###############
# Interpreter #
###############
class Interpreter
alias mog11_command_311 command_311
def command_311
mog11_command_311
$game_player.wref = true   
end   
alias mog11_command_312 command_312
def command_312
mog11_command_312
$game_player.wref = true   
end   
alias mog11_command_313 command_313
def command_313
mog11_command_313
$game_player.wref = true   
end   
alias mog11_command_314 command_314
def command_314
mog11_command_314
$game_player.wref = true   
end   
alias mog11_command_315 command_315
def command_315
mog11_command_315
$game_player.wref = true   
end   
end   
################
# Game_Battler #
################
class Game_Battler
alias mog11_attack_effect attack_effect
def attack_effect(attacker)
mog11_attack_effect(attacker)  
$game_player.wref = true
end
alias mog11_skill_effect skill_effect
def skill_effect(user, skill)
mog11_skill_effect(user, skill)
$game_player.wref = true  
end  
alias mog11_item_effect item_effect
def item_effect(item)
mog11_item_effect(item)
$game_player.wref = true  
end
alias mog11_add_state add_state
def add_state(state_id, force = false)
mog11_add_state(state_id, force = false)
$game_player.wref = true  
end
end


素材自理

截图看 我签名处的游戏

是否是LZ 要的效果?


对了,就是这样子的
锐意制作中...
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2008-10-19
帖子
326
14
 楼主| 发表于 2009-5-29 05:51:33 | 只看该作者
以下引用tommay于2009-5-28 17:01:14的发言:

不明白,为什么对默认系统不满意的人为什么不肯花时间学学脚本呢?永远是一句“我是脚本白痴”,难道这也值得炫耀?难道自己游戏华丽的系统都是由诸多不明来源的脚本“凑”起来的?恕我直言,不明其内涵,再多脚本凑在一起,仍然是没有灵魂的东西,与你的游戏没有什么联系。

算了吧,这样下去也不是办法。要不学脚本,要不默认系统玩玩也挺好,何苦呢。。。


[本贴由作者于 2009-5-28 17:03:16 最后编辑]


好吧,我是很偷懒的人,自己不愿学脚本,又想让游戏更加美观一些,看起来好象太美好了……
但是,脚本也不是一天两天能学会的,我总是喜欢边做边学,在制作的过程中反复研究。我拿别人的脚本也不是不会看,我也会尝试去修改一些内容,只是自己并不晓得怎样正确的去改,自然更不敢自己写了……
说实话,我现在还没有找到一个系统介绍脚本编写的教程,不晓得阁下是否有所推荐?
锐意制作中...
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3427
在线时间
3629 小时
注册时间
2006-9-6
帖子
37402

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

15
发表于 2009-5-29 05:56:21 | 只看该作者
说句废话就是:可以用事件做,不会的话技术区有范例,虽然很简陋…… - -
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2008-10-19
帖子
326
16
 楼主| 发表于 2009-5-29 06:15:43 | 只看该作者
以下引用越前リョーマ于2009-5-28 21:56:21的发言:

说句废话就是:可以用事件做,不会的话技术区有范例,虽然很简陋…… - -


- -其实我一开始就想用事件实现,但是如何让图片根据血量准确改变呢……
锐意制作中...
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
17
发表于 2009-5-29 06:44:20 | 只看该作者
素材自理 开关好像是66 号

游戏是解密版的

脚本+素材 就行了
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-22 19:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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