Project1
标题:
新·地图名显示+地图提示[高手请无视][更新2.0]
[打印本页]
作者:
304475881
时间:
2008-2-22 01:52
标题:
新·地图名显示+地图提示[高手请无视][更新2.0]
如题教程如下[如果不想看教程的话就直接到最下面看完成了的脚本]:
首先打好框子:
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts
end
然后定义函数:
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
end
再借用一下黑暗圣剑2里的成就脚本:
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
return if @chengjiu_list.include?(id)
@chengjiu += @cj_hash[id][0]
@chengjiu_list.push(@cj_hash[id])
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 解锁新的成就:#{@cj_hash[id][1]} ★", 1)
Sound.play_chengjiu
sprite.x = 0
sprite.y = Graphics.height - 72
$sprite_helper.push([sprite, 240, 4])
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
return if @chengjiu_list.include?(id)
@chengjiu += @cj_hash[id][0]
@chengjiu_list.push(@cj_hash[id])
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 解锁新的成就:#{@cj_hash[id][1]} ★", 1)
Sound.play_chengjiu
sprite.x = 0
sprite.y = Graphics.height - 72
$sprite_helper.push([sprite, 240, 4])
end
最后优化:
#-----------------------------------------------------------------------------
# ● 关于使用方法
#-----------------------------------------------------------------------------
#dtmxs("我是地图名")
#dtts("我是地图提示")
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
$mc = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的名称:#{$mc} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 0
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
$ts = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的提示:#{$ts} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 32
end
再优化:
#-----------------------------------------------------------------------------
# ● 关于使用
#-----------------------------------------------------------------------------
#◆条件分歧:$mc == "显示"
# ◆中断事件处理
# ◆
# 除此以外的情况
# ◆脚本:dtmxs("显示")
# : :dtts("这里写提示")
# ◆等待:1帧
# 分歧结束
#◆
#移动的时候在移动前要加一句脚本:$mc = "不显示"
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
$mc = pe
if $mc == "显示"
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
$maps = load_data("Data/MapInfos.rvdata")
@map_id = $game_map.map_id
$currentmap = $maps[@map_id].name
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的名称:#{$currentmap} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 0
end
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
$ts = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的提示:#{$ts} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 32
end
好此教学到此未知,初次写这个还不太熟练,请大家多多体谅………………
以下1.5脚本:
#-----------------------------------------------------------------------------
# ● 关于使用方法
#-----------------------------------------------------------------------------
#dtmxs("我是地图名")
#dtts("我是地图提示")
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
$mc = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的名称:#{$mc} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 0
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
$ts = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的提示:#{$ts} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 32
end
复制代码
以下2.0脚本:
#-----------------------------------------------------------------------------
# ● 关于使用
#-----------------------------------------------------------------------------
#◆条件分歧:$mc == "显示"
# ◆中断事件处理
# ◆
# 除此以外的情况
# ◆脚本:dtmxs("显示")
# : :dtts("这里写提示")
# ◆等待:1帧
# 分歧结束
#◆
#移动的时候在移动前要加一句脚本:$mc = "不显示"
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
def dtmxs(pe)
$mc = pe
if $mc == "显示"
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
$maps = load_data("Data/MapInfos.rvdata")
@map_id = $game_map.map_id
$currentmap = $maps[@map_id].name
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的名称:#{$currentmap} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 0
end
end
#-----------------------------------------------------------------------------
# ● 关于地图提示
#-----------------------------------------------------------------------------
def dtts(pe)
$ts = pe
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new(Graphics.width, 32)
sprite.bitmap.fill_rect(sprite.bitmap.rect,
Color.new(0, 0, 0, 128))
sprite.bitmap.draw_text(0, 0, Graphics.width , 32,
"★ 新地图的提示:#{$ts} ★", 1)
Audio.se_play("Audio/SE/chime2" , 100, 100)
sprite.x = 0
sprite.y = 32
end
复制代码
作者:
雪流星
时间:
2008-2-22 09:09
话说……
这根本算不上教学{/gg}
根本就只是「借用」别人的脚本而已
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1