赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 7404 |
最后登录 | 2013-10-11 |
在线时间 | 28 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 28 小时
- 注册时间
- 2007-12-22
- 帖子
- 102
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
如题教程如下[如果不想看教程的话就直接到最下面看完成了的脚本]:
首先打好框子:
#-----------------------------------------------------------------------------
# ● 关于地图名称
#-----------------------------------------------------------------------------
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
复制代码 |
|