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
  1. class Game_Map
  2. alias old_setup setup
  3. def setup(jiong)
  4.    if @lv_x == nil
  5.      @lv_x = []
  6.      @lv_y = []
  7.      @lv_direction = []
  8.      @lv_character_hue = []
  9.      @lv_character_name = []
  10.    end
  11.    if @lv_x[jiong]==nil
  12.        @lv_x[jiong]=[]
  13.        @lv_y[jiong]=[]
  14.        @lv_direction[jiong]=[]
  15.        @lv_character_hue[jiong]=[]
  16.        @lv_character_name[jiong]=[]
  17.    end
  18.    old_setup(jiong)
  19. end
  20. def lv_x(one,two)
  21.    return @lv_x[one][two]
  22. end
  23. def lv_y(one,two)
  24.    return @lv_y[one][two]
  25. end
  26. def lv_x2(one,two,three)
  27.    @lv_x[one][two]=three
  28. end
  29. def lv_y2(one,two,three)
  30.    @lv_y[one][two]=three
  31. end
  32. def lv_direction(one,two)
  33.    return @lv_direction[one][two]
  34. end
  35. def lv_direction2(one,two,three)
  36.    @lv_direction[one][two]=three
  37. end
  38. def lv_character_hue(one,two)
  39.    return @lv_character_hue[one][two]
  40. end
  41. def lv_character_hue2(one,two,three)
  42.   @lv_character_hue[one][two]=three
  43. end
  44. def lv_character_name(one,two)
  45.    return @lv_character_name[one][two]
  46. end
  47. def lv_character_name2(one,two,three)
  48.   @lv_character_name[one][two]=three
  49. end
  50. end


  51. class Game_Event
  52. attr_reader   :id
  53. attr_reader   :map_id
  54. alias old_update update
  55. def update
  56.    old_update
  57.    $game_map.lv_x2(@map_id,@id,self.x)
  58.    $game_map.lv_y2(@map_id,@id,self.y)
  59.    $game_map.lv_direction2(@map_id,@id,self.direction)
  60.    $game_map.lv_character_name2(@map_id,@id,self.character_name)
  61.    $game_map.lv_character_hue2(@map_id,@id,self.character_hue)
  62. end
  63. def initialize(map_id, event)
  64.    super()
  65.    @map_id = map_id
  66.    @event = event
  67.    @id = @event.id
  68.    @erased = false
  69.    @starting = false
  70.    @through = true
  71.    if $game_map.lv_x(@map_id,@id)!=nil and !$game_temp.lv_switches
  72.      @event.x = $game_map.lv_x(@map_id,@id)
  73.      @event.y = $game_map.lv_y(@map_id,@id)
  74.      @direction = $game_map.lv_direction(@map_id,@id)
  75.    end
  76.    moveto(@event.x, @event.y)
  77.    refresh
  78.    if $game_map.lv_x(@map_id,@id)!=nil and !$game_temp.lv_switches
  79.      @character_name = $game_map.lv_character_name(@map_id,@id)
  80.      @character_hue = $game_map.lv_character_hue(@map_id,@id)
  81.    end
  82. end
  83. end
  84. class Game_Temp
  85. attr_accessor :lv_switches
  86. end
复制代码
泪流满面,居然有人用我的脚本><

修改好了~~试试看~~~
作者: worseworst    时间: 2009-10-4 15:10
太感谢了~~~
你写的脚本很好啊,怎么会没有人用你的脚本呢?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1