Avrei bisogno di una mano con questo script. Io avrei intenzione di creare un abs con i personaggi a 8/9 pose e 8 direzioni. Lo script qui sotto mi permette di far questo.
Ma la grafica dell'eroe non posso mai cambiarla. Metti che il mio personaggio deve attaccare, anche facendo "rimuovi grafica" non funziona.
Non c'è un modo per fare un call script per questo script e cambiare la grafica del chara?
Qui sotto lo script che ho usato e le immagini che stavo usando per fare le prove.
Spoiler
#AndrewBrewer's 8 Direction Multi Frame Movement # sets up module for referencing module EIGHT_WAY DIRSPRITE = true end # enables diagonal movement and idle pose class Game_Player < Game_Character def move_by_input return unless movable? return if $game_map.interpreter.running? case Input.dir8 when 0; set_graphic_idle(character_name, character_index) when 1; set_graphic_walk(character_name, character_index); move_lower_left when 2; set_graphic_walk(character_name, character_index); move_down when 3; set_graphic_walk(character_name, character_index); move_lower_right when 4; set_graphic_walk(character_name, character_index); move_left when 7; set_graphic_walk(character_name, character_index); move_upper_left when 6; set_graphic_walk(character_name, character_index); move_right when 8; set_graphic_walk(character_name, character_index); move_up when 9; set_graphic_walk(character_name, character_index); move_upper_right end end end class Game_Character $NOF_X = 8 # change this to number of frames across def initialize @id = 0 @x = 0 @y = 0 @real_x = 0 @real_y = 0 @tile_id = 0 @character_name = "" @character_index = 0 @opacity = 255 @blend_type = 0 @direction = 2 @pattern = 1 @move_route_forcing = false @priority_type = 1 @through = false @bush_depth = 0 @animation_id = 0 @balloon_id = 0 @transparent = false @original_direction = 2 @original_pattern = 2 # Change to desired stop frame @move_type = 0 @move_speed = 4 # Movement speed @move_frequency = 6 @move_route = nil @move_route_index = 0 @original_move_route = nil @original_move_route_index = 0 @walk_anime = true @step_anime = false @direction_fix = false @anime_count = 0 @stop_count = 0 @jump_count = 0 @jump_peak = 0 @wait_count = 0 @locked = false @prelock_direction = 0 @move_failed = false end # changes character graphic to idle pose def set_graphic_idle(character_name, character_index) @tile_id = 0 @character_name = "$Neku" # change this to your idle graphic file @character_index = character_index end # changes character graphic to walking animation def set_graphic_walk(character_name, character_index) @tile_id = 0 @character_name = "$Neku_run" # change this to your walk graphic file @character_index = character_index end # changes character graphic to running animation def set_graphic_run(character_name, character_index) @original_pattern = 2 # set this to the frame you want to be your running pose in your run animation or @tile_id = 0 @character_name = "$Neku_run" # change this to your run graphic file @character_index = character_index end #=========================================================================================== # corrects directional movement def move_lower_left(turn_ok = true) set_direction(1) if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or (passable?(@x-1, @y) and passable?(@x-1, @y+1)) @x -= 1 @y += 1 increase_steps @move_failed = false else @move_failed = true end end def move_lower_right(turn_ok = true) set_direction(3) if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or (passable?(@x+1, @y) and passable?(@x+1, @y+1)) @x += 1 @y += 1 increase_steps @move_failed = false else @move_failed = true end end def move_upper_left(turn_ok = true) if EIGHT_WAY::DIRSPRITE == true set_direction(7) end if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or (passable?(@x-1, @y) and passable?(@x-1, @y-1)) @x -= 1 @y -= 1 increase_steps @move_failed = false else @move_failed = true end end def move_upper_right(turn_ok = true) set_direction(9) if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or (passable?(@x+1, @y) and passable?(@x+1, @y-1)) @x += 1 @y -= 1 increase_steps @move_failed = false else @move_failed = true end end #========================================================================================= # enables multiple frames def update_animation speed = @move_speed + (dash? ? 1 : 0) if @anime_count > 18 - speed * 2 if not @step_anime and @stop_count > 0 @pattern = @original_pattern else @pattern = (@pattern + 1) % $NOF_X end @anime_count = 0 end end def update if jumping? # Jumping update_jump elsif moving? # Moving update_move else # Stopped update_stop end if @wait_count > 0 # Waiting @wait_count -= 1 elsif @move_route_forcing # Forced move route move_type_custom elsif not @locked # Not locked update_self_movement end # enables dash sprite if dash? set_graphic_run(character_name, character_index) end update_animation end end # enables multiple frames class Sprite_Character < Sprite_Base def update_bitmap if @tile_id != @character.tile_id or @character_name != @character.character_name or @character_index != @character.character_index @tile_id = @character.tile_id @character_name = @character.character_name @character_index = @character.character_index if @tile_id > 0 sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32; sy = @tile_id % 256 / 8 % 16 * 32; self.bitmap = tileset_bitmap(@tile_id) self.src_rect.set(sx, sy, 32, 32) self.ox = 16 self.oy = 32 else self.bitmap = Cache.character(@character_name) sign = @character_name[/^[\!\$]./] if sign != nil and sign.include?('$') @cw = bitmap.width / $NOF_X @ch = bitmap.height / 9 else @cw = bitmap.width / 12 @ch = bitmap.height / 8 end self.ox = @cw / 2 self.oy = @ch end end end def update_src_rect if @tile_id == 0 index = @character.character_index if @character.direction % 2 != 0 && EIGHT_WAY::DIRSPRITE == true index = @character.character_index pattern = @character.pattern < $NOF_X ? @character.pattern : 1 sx = (index % 4 * $NOF_X + pattern) * @cw sy = (index / 4 * 4 + (@character.direction + 7) / 2) * @ch self.src_rect.set(sx, sy , @cw, @ch) else pattern = @character.pattern < $NOF_X ? @character.pattern : 1 sx = (index % 4 * $NOF_X + pattern) * @cw sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch self.src_rect.set(sx, sy , @cw, @ch) end end end end
E' abbastanza urgente, spero che qualcuno riesca ad aiutarmi.