Project1
标题:
如何保留事件的角色图片?
[打印本页]
作者:
worseworst
时间:
2009-10-4 14:19
标题:
如何保留事件的角色图片?
本帖最后由 worseworst 于 2009-10-4 15:38 编辑
我使用了旅的“保留事件位置”的脚本,但是实现不了保留事件的角色图片。
例如战士A通过“设置移动路线”里的“更改角色图片”变成了战士B,但切换地图后又变回战士A了,我想切换地图后仍然是战士B。
希望高手解答,谢谢~
下面是旅的“保留事件位置”的脚本:
http://rpg.blue/viewthread.php?t ... 6%E4%BD%8D%E7%BD%AE
作者:
「旅」
时间:
2009-10-4 14:38
class Game_Map
alias old_setup setup
def setup(jiong)
if @lv_x == nil
@lv_x = []
@lv_y = []
@lv_direction = []
@lv_character_hue = []
@lv_character_name = []
end
if @lv_x[jiong]==nil
@lv_x[jiong]=[]
@lv_y[jiong]=[]
@lv_direction[jiong]=[]
@lv_character_hue[jiong]=[]
@lv_character_name[jiong]=[]
end
old_setup(jiong)
end
def lv_x(one,two)
return @lv_x[one][two]
end
def lv_y(one,two)
return @lv_y[one][two]
end
def lv_x2(one,two,three)
@lv_x[one][two]=three
end
def lv_y2(one,two,three)
@lv_y[one][two]=three
end
def lv_direction(one,two)
return @lv_direction[one][two]
end
def lv_direction2(one,two,three)
@lv_direction[one][two]=three
end
def lv_character_hue(one,two)
return @lv_character_hue[one][two]
end
def lv_character_hue2(one,two,three)
@lv_character_hue[one][two]=three
end
def lv_character_name(one,two)
return @lv_character_name[one][two]
end
def lv_character_name2(one,two,three)
@lv_character_name[one][two]=three
end
end
class Game_Event
attr_reader :id
attr_reader :map_id
alias old_update update
def update
old_update
$game_map.lv_x2(@map_id,@id,self.x)
$game_map.lv_y2(@map_id,@id,self.y)
$game_map.lv_direction2(@map_id,@id,self.direction)
$game_map.lv_character_name2(@map_id,@id,self.character_name)
$game_map.lv_character_hue2(@map_id,@id,self.character_hue)
end
def initialize(map_id, event)
super()
@map_id = map_id
@event = event
@id = @event.id
@erased = false
@starting = false
@through = true
if $game_map.lv_x(@map_id,@id)!=nil and !$game_temp.lv_switches
@event.x = $game_map.lv_x(@map_id,@id)
@event.y = $game_map.lv_y(@map_id,@id)
@direction = $game_map.lv_direction(@map_id,@id)
end
moveto(@event.x, @event.y)
refresh
if $game_map.lv_x(@map_id,@id)!=nil and !$game_temp.lv_switches
@character_name = $game_map.lv_character_name(@map_id,@id)
@character_hue = $game_map.lv_character_hue(@map_id,@id)
end
end
end
class Game_Temp
attr_accessor :lv_switches
end
复制代码
泪流满面,居然有人用我的脚本><
修改好了~~试试看~~~
作者:
worseworst
时间:
2009-10-4 15:10
太感谢了~~~
你写的脚本很好啊,怎么会没有人用你的脚本呢?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1