赞 | 2 |
VIP | 2 |
好人卡 | 4 |
积分 | 1 |
经验 | 96076 |
最后登录 | 2015-12-27 |
在线时间 | 93 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 93 小时
- 注册时间
- 2008-5-16
- 帖子
- 745
|
本帖最后由 ★_茄孓 于 2009-7-28 18:30 编辑
话说我下午回的3个帖子都没掉了,汗```不过也好!!!
LS的做法很好``不过VX的行走图里面是分多个人物的,所以RMXP是不支持选择第几个,还需要外界设置来调用下..
范例.rar
(207.3 KB, 下载次数: 310)
需要设置的地方是 数据库角色名字的地方/事件名字的地方
如果该角色或事件的行走图是RMXP默认行走图则无需设置什么
如果是RMVX行走图``
请把那张VX图看做一个坐标系以最左上角的那个动作为[0,0]看 则
角色名=[X坐标,Y坐标,X向总帧数,Y向总帧数,人物X向总帧数]
所以你要
第1个人物的话请设定
阿尔西斯=[0,0,12,8,3]
第2个人物的话请设定
阿尔西斯=[3,0,12,8,3]
第4个人物的话请设定
阿尔西斯=[9,0,12,8,3]
第5个人物的话请设定
阿尔西斯=[0,4,12,8,3]
第6个人物的话请设定
阿尔西斯=[3,4,12,8,3]
事件的设置和角色的设置一样!
复制代码到MAIN前
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :src
- #--------------------------------------------------------------------------
- # ● 设置
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- def setup(actor_id)
- actor = $data_actors[actor_id]
- @actor_id = actor_id
- @name = actor.name
- @src = [0,0,4,4,4]
- if @name.include?("=")
- @src = eval(@name.split(/=/)[1])
- @name = @name.split(/=/)[0]
- end
- @character_name = actor.character_name
- @character_hue = actor.character_hue
- @battler_name = actor.battler_name
- @battler_hue = actor.battler_hue
- @class_id = actor.class_id
- @weapon_id = actor.weapon_id
- @armor1_id = actor.armor1_id
- @armor2_id = actor.armor2_id
- @armor3_id = actor.armor3_id
- @armor4_id = actor.armor4_id
- @level = actor.initial_level
- @exp_list = Array.new(101)
- make_exp_list
- @exp = @exp_list[@level]
- @skills = []
- @hp = maxhp
- @sp = maxsp
- @states = []
- @states_turn = {}
- @maxhp_plus = 0
- @maxsp_plus = 0
- @str_plus = 0
- @dex_plus = 0
- @agi_plus = 0
- @int_plus = 0
- # 学会特技
- for i in 1..@level
- for j in $data_classes[@class_id].learnings
- if j.level == i
- learn_skill(j.skill_id)
- end
- end
- end
- # 刷新自动状态
- update_auto_state(nil, $data_armors[@armor1_id])
- update_auto_state(nil, $data_armors[@armor2_id])
- update_auto_state(nil, $data_armors[@armor3_id])
- update_auto_state(nil, $data_armors[@armor4_id])
- end
- end
- class Game_Event < Game_Character
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :name
- attr_reader :src
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # map_id : 地图 ID
- # event : 事件 (RPG::Event)
- #--------------------------------------------------------------------------
- def initialize(map_id, event)
- super()
- @map_id = map_id
- @event = event
- @name = event.name
- @src = [0,0,4,4,4]
- if @name.include?("=")
- @src = eval(@name.split(/=/)[1])
- @name = @name.split(/=/)[0]
- end
- @id = @event.id
- @erased = false
- @starting = false
- @through = true
- # 初期位置的移动
- moveto(@event.x, @event.y)
- refresh
- end
- end
- class Sprite_Character < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- if @character != nil
- if @character.is_a?(Game_Player)
- @bitmap_x = $game_party.actors[0].src[0].to_i
- @bitmap_y = $game_party.actors[0].src[1].to_i
- @bitmap_width_pattern = $game_party.actors[0].src[2].to_i
- @bitmap_height_pattern = $game_party.actors[0].src[3].to_i
- elsif @character.is_a?(Game_Event)
- @bitmap_x = @character.src[0].to_i
- @bitmap_y = @character.src[1].to_i
- @bitmap_width_pattern = @character.src[2].to_i
- @bitmap_height_pattern = @character.src[3].to_i
- end
- end
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_hue != @character.character_hue
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_hue = @character.character_hue
- if @tile_id >= 384
- self.bitmap = RPG::Cache.tile($game_map.tileset_name,
- @tile_id, @character.character_hue)
- self.src_rect.set(0, 0, 32, 32)
- self.ox = 16
- self.oy = 32
- else
- self.bitmap = RPG::Cache.character(@character.character_name,
- @character.character_hue)
- @cw = bitmap.width / @bitmap_width_pattern
- @ch = bitmap.height / @bitmap_height_pattern
- self.ox = @cw / 2
- self.oy = @ch
- end
- end
- self.visible = (not @character.transparent)
- if @tile_id == 0
- sx = @character.pattern * @cw + @bitmap_x * 32
- sy = (@character.direction - 2) / 2 * @ch + @bitmap_y * 32
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- self.opacity = @character.opacity
- self.blend_type = @character.blend_type
- self.bush_depth = @character.bush_depth
- if @character.animation_id != 0
- animation = $data_animations[@character.animation_id]
- animation(animation, true)
- @character.animation_id = 0
- end
- end
- end
- class Game_Character
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- if jumping?
- update_jump
- elsif moving?
- update_move
- else
- update_stop
- end
- if @anime_count > 18 - @move_speed * 2
- if not @step_anime and @stop_count > 0
- @pattern = @original_pattern
- else
- @bitmap_pattern = $game_party.actors[0].src[4].to_i
- @pattern = (@pattern + 1) % @bitmap_pattern
- end
- @anime_count = 0
- end
- if @wait_count > 0
- @wait_count -= 1
- return
- end
- if @move_route_forcing
- move_type_custom
- return
- end
- if @starting or lock?
- return
- end
- if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
- case @move_type
- when 1
- move_type_random
- when 2
- move_type_toward_player
- when 3
- move_type_custom
- end
- end
- end
- end
复制代码 |
|