Project1
标题:
hgfor,看见,请进来聊下,请看短信
[打印本页]
作者:
xufangcun
时间:
2008-11-20 22:40
标题:
hgfor,看见,请进来聊下,请看短信
如图
你这个效果图的右上角那个显示头框的效果,是用脚本做的吗?是的话,请你提供一个脚本,可以吗?我现在在做一个新版的大话,比上次的好很多,加了很多效果,比如:类似
梦3的BB系统和飞行旗,各方面也做了优化,更新了战斗系统,完善了大话的魔法和人法。
这是新版的测试截图:
[LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
hgfor
时间:
2008-11-20 22:46
我现在把脚本发给你,希望对你有所帮助.
战斗中显示坐标图和状态图
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
self.opacity = 0
@sta_back = []
@sta_output = []
@hp_bitmap = RPG::Cache.picture("HP_Meter.png")
@mp_bitmap = RPG::Cache.picture("SP_Meter.png")
@xy_window = Window_xy.new
@xy_window.x = -16
@xy_window.y = -16
@xy_window.opacity = 0
@xy_window.back_opacity = 0
@xy_window.contents_opacity = 255
for actor_index in 1..$game_party.actors.size
@sta_back[actor_index] = Sprite.new
@sta_back[actor_index].bitmap = Bitmap.new("Graphics/Pictures/" + $game_party.actors[actor_index - 1].name + "战斗.png")
@sta_back[actor_index].x = 510-(actor_index - 1) * 130
@sta_back[actor_index].y = 0
@sta_back[actor_index].z = self.z + 1
@sta_output[actor_index] = Sprite.new
@sta_output[actor_index].bitmap = Bitmap.new(180, 120)
@sta_output[actor_index].x = 476-(actor_index - 1) * 130
@sta_output[actor_index].y = -29 #(actor_index - 1) * 80 - 29
@sta_output[actor_index].z = self.z + 200
@sta_output[actor_index].bitmap.clear
@sta_output[actor_index].bitmap.font.size = 10
@sta_output[actor_index].bitmap.font.name = "黑体"
hp_width = $game_party.actors[actor_index - 1].hp * @hp_bitmap.width/$game_party.actors[actor_index - 1].maxhp
hp_rect = Rect.new(0, 0, hp_width, 12)
mp_width = $game_party.actors[actor_index - 1].sp * @mp_bitmap.width/$game_party.actors[actor_index - 1].maxsp
mp_rect = Rect.new(0, 0, mp_width, 12)
end
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
for actor_index in 1..$game_party.actors.size
@sta_back[actor_index].bitmap.dispose
@sta_back[actor_index].dispose
@sta_output[actor_index].bitmap.dispose
@sta_output[actor_index].dispose
end
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
#......................................................................
actor_x = 480#i * 160 + 145
actor_y = 0#i * 80 + 220
@sta_output[i + 1].bitmap.clear
hp_width = $game_party.actors[i].hp * @hp_bitmap.width/$game_party.actors[i].maxhp
hp_rect = Rect.new(0, 0, hp_width, 12)
mp_width = $game_party.actors[i].sp * @mp_bitmap.width/$game_party.actors[i].maxsp
mp_rect = Rect.new(0, 0, mp_width, 12)
@sta_output[i + 1].bitmap.blt(80, 44, @hp_bitmap, hp_rect)
#间距
@sta_output[i + 1].bitmap.blt(80, 56, @mp_bitmap, mp_rect)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity = 255 #if self.contents_opacity > 1
else
self.contents_opacity = 255 #if self.contents_opacity < 255
end
end
end
复制代码
地图坐标
#-----------------------------------------------------------------------------
# ■class map_XY
#-----------------------------------------------------------------------------
class Window_xy < Window_Base
def initialize
super(0, 0, 680, 560) #175, 100
self.contents = Bitmap.new(width - 32, height - 22)
self.opacity = 0
self.back_opacity = 0
self.contents_opacity = 255
self.visible = true
refresh
@x = $game_player.x
@y = $game_player.y
@id = $game_map.map_id
end
def refresh
@x = $game_player.x
@y = $game_player.y
@id = $game_map.map_id
self.contents.clear
a = "001"
bitmap=Bitmap.new("Graphics/Pictures/#{a}")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
$mapnames = load_data("Data/MapInfos.rxdata")
map_name = $mapnames[@id].name
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(2, 4, 80, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(2, 4, 80, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(2, 4, 80, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(10, 24, 120, 15, "X:")
self.contents.font.color = normal_color
self.contents.font.size = 12
self.contents.draw_text(0, 15, 45, 32, @x.to_s,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(60, 15, 90, 32, "Y:")
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(0, 15, 95, 32, @y.to_s,2)
end
def judge
return true if @x != $game_player.x
return true if @y != $game_player.y
return true if @id != $game_map.map_id
return false
end
end
class Scene_Map
alias xy_66rpg_main main
def main
@xy_window = Window_xy.new
@xy_window.x = - 16
@xy_window.y = - 16
xy_66rpg_main
@xy_window.dispose
end
alias xy_66rpg_update update
def update
xy_66rpg_update
@xy_window.visible = false
@xy_window.refresh if @xy_window.judge
else
@xy_window.visible = true
end
end
复制代码
在地图上显示坐标图和人物框
#_______________________________________________________________________________
# 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( 20, 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( 66 ,16 , meter, src_rect)
end
def draw_mapsp2(actor, x, y)
meter = RPG::Cache.picture("SP_Meter")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt( 66, 29, 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")
if actor.level < 99
cw = bitmap.width * rate
else
cw = bitmap.width
end
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(66 , 3, bitmap, src_rect)
end
def nada
face = RPG::Cache.picture("")
end
def draw_heroface(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(23 , 2, 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
self.contents.clear
actor = $game_party.actors[0]
draw_maphp2(actor, 35, 35)
draw_mapsp2(actor, - 40, 60)
draw_heroface(actor, 0, 70)
# draw_actor_statemap(actor, 200, 60, 70)
# draw_actor_levelmap(actor, 80, 10)
draw_mexp(actor, 100, 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
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
mog11_update
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
复制代码
你看看吧
战斗中显示坐标图和状态图这个脚本要调用 地图坐标脚本. [LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
redant
时间:
2008-11-20 22:49
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
#........................................................................
self.opacity = 0
@sta_back = []
@sta_output = []
# @cp_output = []
@hp_bitmap = RPG::Cache.picture("HP_Meter.png")
@mp_bitmap = RPG::Cache.picture("SP_Meter.png")
# @bitmap3 = RPG::Cache.picture("../system/battle/hmcp/底.png")
# @cp_bitmap = RPG::Cache.picture("../system/battle/hmcp/cp_bar.png")
# @cp_output = []
# @cp_back_bar = Sprite.new
#@cp_back_bar.bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_back_bar")
## @cp_back_bar.x = 450
# @cp_back_bar.y = 25
#@cp_back_bar.z = self.z + 1
# @actor_cp_sprite = []
# @actor_cp_sprite_back = []
@xy_window = Window_xy.new
@xy_window.x = -16
@xy_window.y = -16
@xy_window.opacity = 0
for actor_index in 1..$game_party.actors.size
# @cp_output[actor_index] = Sprite.new
# @cp_output[actor_index].bitmap = Bitmap.new(133, 78)
# @cp_output[actor_index].x = 100 + (actor_index - 1) * 133
# @cp_output[actor_index].y = 480 - 78 - 10
# @cp_output[actor_index].z = self.z + 2
# @cp_output[actor_index].bitmap.clear
@sta_back[actor_index] = Sprite.new
@sta_back[actor_index].bitmap = Bitmap.new("Graphics/Pictures/" + $game_party.actors[actor_index - 1].name + "战斗.png")
@sta_back[actor_index].x = 510-(actor_index - 1) * 130
@sta_back[actor_index].y = 0
@sta_back[actor_index].z = self.z + 1
@sta_output[actor_index] = Sprite.new
@sta_output[actor_index].bitmap = Bitmap.new(180, 120)
@sta_output[actor_index].x = 476-(actor_index - 1) * 130
@sta_output[actor_index].y = -29#(actor_index - 1) * 80 - 29
@sta_output[actor_index].z = self.z + 200
@sta_output[actor_index].bitmap.clear
@sta_output[actor_index].bitmap.font.size = 10
@sta_output[actor_index].bitmap.font.name = "黑体"
hp_width = $game_party.actors[actor_index - 1].hp * @hp_bitmap.width/$game_party.actors[actor_index - 1].maxhp
hp_rect = Rect.new(0, 0, hp_width, 12)
mp_width = $game_party.actors[actor_index - 1].sp * @mp_bitmap.width/$game_party.actors[actor_index - 1].maxsp
mp_rect = Rect.new(0, 0, mp_width, 12)
# @src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
# self.contents.blt(10,220, @bitmap3, @src_rect3)
# @sta_output[actor_index].bitmap.blt(66, 44, @hp_bitmap, hp_rect)
# @sta_output[actor_index].bitmap.blt(66, 64, @mp_bitmap, mp_rect)
# @sta_output[actor_index].bitmap.blt(66, 54, @bitmap3, @src_rect3)
#@sta_output[actor_index].bitmap.font.color.set(255, 0, 0)
# @sta_output[actor_index].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[actor_index - 1].hp.to_s + "/" + $game_party.actors[actor_index - 1].maxhp.to_s)
# @sta_output[actor_index].bitmap.font.color.set(0, 0, 255)
#@sta_output[actor_index].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[actor_index - 1].sp.to_s + "/" + $game_party.actors[actor_index - 1].maxsp.to_s)
end
#........................................................................
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
@hp_bitmap.bitmap.dispose
@hp_bitmap.dispose
@mp_bitmap.bitmap.dispose
@mp_bitmap.dispose
#@cp_bitmap.bitmap.dispose
# @cp_bitmap.dispose
for actor_index in 1..$game_party.actors.size
@sta_back[actor_index].bitmap.dispose
@sta_back[actor_index].dispose
@sta_output[actor_index].bitmap.dispose
@sta_output[actor_index].dispose
# @cp_output[actor_index].bitmap.dispose
# @cp_output[actor_index].dispose
end
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#......................................................................
#--------------------------------------------------------------------------
# ● 设置正在攻击标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
#def in_atk(actor_index)
#@sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗1.png")
#end
#--------------------------------------------------------------------------
# ● 设置不在攻击标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
#def out_atk(actor_index)
# @sta_back[actor_index + 1].bitmap = Bitmap.new("Graphics/System/Battle/sta_back/" + $game_party.actors[actor_index].name + "战斗.png")
#end
#......................................................................
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
#......................................................................
actor_x = 480#i * 160 + 145
actor_y = 0#i * 80 + 220
@sta_output[i + 1].bitmap.clear
hp_width = $game_party.actors[i].hp * @hp_bitmap.width/$game_party.actors[i].maxhp
hp_rect = Rect.new(0, 0, hp_width, 12)
mp_width = $game_party.actors[i].sp * @mp_bitmap.width/$game_party.actors[i].maxsp
mp_rect = Rect.new(0, 0, mp_width, 12)
@sta_output[i + 1].bitmap.blt(80, 44, @hp_bitmap, hp_rect)
#间距
@sta_output[i + 1].bitmap.blt(80, 56, @mp_bitmap, mp_rect)
# @sta_output[i + 1].bitmap.font.color.set(255, 0, 0)
#@sta_output[i + 1].bitmap.draw_text(80, 31, 77, 11,$game_party.actors[i].hp.to_s + "/" + $game_party.actors[i].maxhp.to_s)
#@sta_output[i + 1].bitmap.font.color.set(0, 0, 255)
#@sta_output[i + 1].bitmap.draw_text(80, 51, 77, 11,$game_party.actors[i].sp.to_s + "/" + $game_party.actors[i].maxsp.to_s)
#......................................................................
# if @level_up_flags[i]
# self.contents.font.color = normal_color
# self.contents.draw_text(0, 0, 640 , 480, "LEVEL UP!")
#else
# draw_actor_state(actor, 120, actor_y)
# end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity = 255 #if self.contents_opacity > 1
else
self.contents_opacity = 255 #if self.contents_opacity < 255
end
end
end
复制代码
参看
http://rpg.blue/viewthread.php?tid=110064&page=2
哦~~~{/cy} 捡分喽
另外 聊天的话 用短信好了 {/gg}
提问区公开的 就像我钻进来了=。=
作者:
hgfor
时间:
2008-11-20 22:52
在战斗中显示坐标与人物框还是redant给写的呢, {/qiang}
很期待楼主的游戏哦.
敌人我是在脚本里修改坐标的,不用每次都调,真是麻烦啊.
要仿大话就得突破8个敌人,大话是10个敌人的.
作者:
xufangcun
时间:
2008-11-20 23:08
hgfor
谢了,给你一条短信,希望看到。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1