赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 1 |
经验 | 1884 |
最后登录 | 2012-1-11 |
在线时间 | 10 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 10 小时
- 注册时间
- 2011-12-19
- 帖子
- 7
|
本帖最后由 CockyGuy 于 2012-1-9 21:31 编辑
首先在Main之前插入脚本:- #==============================================================================
- # ■ Spriteset_Map
- #------------------------------------------------------------------------------
- # 处理地图画面活动块和元件的类。本类在
- # Scene_Map 类的内部使用。
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- # 生成显示端口
- @viewport1 = Viewport.new(0, 0, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 200
- @viewport3.z = 5000
- # 生成元件地图
- @tilemap = Tilemap.new(@viewport1)
- @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
- for i in 0..6
- autotile_name = $game_map.autotile_names[i]
- @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
- end
- @tilemap.map_data = $game_map.data
- @tilemap.priorities = $game_map.priorities
- # 生成远景平面
- @panorama = Plane.new(@viewport1)
- @panorama.z = -1000
- # 生成雾平面
- @fog = Plane.new(@viewport1)
- @fog.z = 3000
- # 生成角色活动块
- @character_sprites = []
- for i in $game_map.events.keys.sort
- sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
- if not sprite.character.ring.empty?
- ring = BrightRing.new(@viewport1,sprite.character)
- @character_sprites.push(ring)
- end
- @character_sprites.push(sprite)
- end
- @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
- # 生成天气
- @weather = RPG::Weather.new(@viewport1)
- # 生成图片
- @picture_sprites = []
- for i in 1..50
- @picture_sprites.push(Sprite_Picture.new(@viewport2,
- $game_screen.pictures[i]))
- end
- # 生成计时器块
- @timer_sprite = Sprite_Timer.new
- # 刷新画面
- update
- end
- end
复制代码 再在Main前插入一个脚本(这俩可以放一起,随便。)- class BrightRing < RPG::Sprite
- attr_accessor :offset_x
- attr_accessor :offset_y
- attr_accessor :character
- def initialize(viewport, character = nil)
- super(viewport)
- self.character = character
- @offset_x = 0
- @offset_y = 0
- self.visible = true
- self.z = 9
- self.bitmap = RPG::Cache.picture(character.ring)
- end
- def update()
- x = (character.real_x - $game_map.display_x + 3) / 4
- y = (character.real_y - $game_map.display_y + 3) / 4
- adjust_offset(x, y)
- self.x = x + @offset_x
- self.y = y + @offset_y
- end
- def change_ring(bitmap)
- self.bitmap = bitmap
- end
- def hide_ring
- self.visible = false
- end
- def show_ring
- self.visible = true
- end
- def adjust_offset(x, y)
- @offset_x = 16 - (self.bitmap.width / 2)
- @offset_y = 16 - (self.bitmap.height / 2)
- end
- end
- class Game_Character
- attr_accessor :ring
- alias :ori_character_initialize :initialize
- def initialize
- @ring = ''
- ori_character_initialize
- end
- end
- class Game_Event < Game_Character
- alias :ori_event_initialize :initialize
- def initialize(map_id, event)
- ori_event_initialize(map_id, event)
- ring_initialize
- end
- def ring_initialize
- command = @event.pages[0].list[0]
- if command.code == 108 and command.parameters[0][0] == 64
- @ring = command.parameters[0][1,command.parameters[0].size - 1]
- end
- end
- end
复制代码 将你的"光环"素材保存在Graphics/Pictures文件夹,例如文件名为11.png。
在你想要显示这个光环的事件的【事件页】第一页第一个事件必须是注释。内容是在本例子中就是======================================
[@]刺夜之枪[/@]
图片跟着事件走。
变成尸体后在【设置移动路线】事件中调用脚本- self.brightring.hide_ring
复制代码 光环就没了。
额,写的仓促脚本有点缺陷……默认我这个是自动跟踪事件移动的,如果想要小改位置貌似访问不到……
������������ |
|