Lood^.^! Ciudadano Experto
Mensajes : 36 Fecha de inscripción : 13/09/2008 Edad : 30 Localización : Yo tmb te kiero
| Tema: Script 8 direcciones y correr Dom Sep 14, 2008 11:14 pm | |
| TECLAZ-Correr INSTRUCCIONESPegar encima de Main y Disfrutar. Algunas cosas editables encontradas gracias a Samo the Thief, son las siguientes: SPEED_DASH = 5 eso es mas que obvio que es la velocidad de dash XD SPEED_NORMAL = 4 la velocidad normal del pj KEY_DASH = Input::A la tecla para hacer dash NO_FILE_DASH = true si se pone en false, entonces permite que al correr, el grafico del chara se cambie a el mismo nombre + _dash ej. 001-Fighter01_dash NO_DASH_SWITCH = 999 es el numero de switch para activar o desactivar el correr SCRIPT
- Spoiler:
- Código:
-
#------------------------------------------------------------------------------ # Movimientos en 8 Direcciones y Correr #------------------------------------------------------------------------------ class Game_Player < Game_Character SPEED_DASH = 5 SPEED_NORMAL = 4 KEY_DASH = Input::A NO_FILE_DASH = true NO_DASH_SWITCH = 999 end class Game_Player < Game_Character alias dash_update update def update unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing if !($game_switches[NO_DASH_SWITCH]) if Input.press?(KEY_DASH) if (dash_graphic_exist?($game_party.actors[0]) or NO_FILE_DASH) if @move_speed != SPEED_DASH @move_speed = SPEED_DASH @dash_on = true $game_player.refresh end end elsif @dash_on == nil or @dash_on @move_speed = SPEED_NORMAL @dash_on = nil $game_player.refresh end end end dash_update end def dash_graphic_exist?(actor) begin RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue) rescue return false end return true end alias dash_refresh refresh def refresh dash_refresh if $game_party.actors.size != 0 actor = $game_party.actors[0] if @dash_on and dash_graphic_exist?(actor) fileplus = "_dash" else fileplus = "" end @character_name = actor.character_name + fileplus @character_hue = actor.character_hue end end end class Game_Player < Game_Character alias update_para_quarter update def update update_para_quarter unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing case Input.dir8 when 1 move_lower_left when 3 move_lower_right when 7 move_upper_left when 9 move_upper_right end end end end class Sprite_Character < RPG::Sprite alias update_para_quarter update def update update_para_quarter if @tile_id == 0 if (@character.direction - 2) % 2 == 1 if quarter_graphic_exist?(@character) if character.dash_on and dash_quarter_graphic_exist?(@character) @character_name = @character.character_name + "_dash_quarter" else @character_name = @character.character_name + "_quarter" end self.bitmap = RPG::Cache.character(@character_name, @character.character_hue) case @character.direction when 1 n = 0 when 3 n = 2 when 7 n = 1 when 9 n = 3 end else @character.direction = @character.sub_direction n = (@character.direction - 2) / 2 end sx = @character.pattern * @cw sy = n * @ch self.src_rect.set(sx, sy, @cw, @ch) else self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue) sx = @character.pattern * @cw sy = (@character.direction - 2) / 2 * @ch self.src_rect.set(sx, sy, @cw, @ch) end end end def quarter_graphic_exist?(character) begin RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue) rescue return false end return true end def dash_quarter_graphic_exist?(character) begin RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue) rescue return false end return true end end class Game_Character attr_accessor :direction attr_accessor :sub_direction def move_lower_left unless @direction_fix @sub_direction = @direction @direction = 1 @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction) end if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2)) @x -= 1 @y += 1 increase_steps end end def move_lower_right unless @direction_fix @sub_direction = @direction @direction = 3 @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction) end if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2)) @x += 1 @y += 1 increase_steps end end def move_upper_left unless @direction_fix @sub_direction = @direction @direction = 7 @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction) end if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8)) @x -= 1 @y -= 1 increase_steps end end def move_upper_right unless @direction_fix @sub_direction = @direction @direction = 9 @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction) end if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8)) @x += 1 @y -= 1 increase_steps end end def dash_on if @dash_on != nil return @dash_on else return false end end end CREDITOSNuse Editado por MIE-TAN | |
|
Mie-Noir-ForPlatinum- HinataHokage -Admin-
Mensajes : 92 Fecha de inscripción : 12/09/2008 Edad : 30 Localización : With my love..
Hoja de personaje Personaje: (100/100) Nombre: Hatake Kanashi Raza: Elfo/a
| Tema: Re: Script 8 direcciones y correr Dom Sep 14, 2008 11:16 pm | |
| Violet, si pones un script muy largo , ponlo en spoiler | |
|
Huésped Invitado
| Tema: Re: Script 8 direcciones y correr Lun Sep 15, 2008 6:02 am | |
| En spoiler no, segun escuche de sketch, hay que ponerlo en el formato codigo, sino se dañan Nuse XD. |
|
GManonimate Ciudadano V.I.P Experto
Mensajes : 77 Fecha de inscripción : 13/09/2008 Edad : 29 Localización : Donde no estas tu ò.ó
Hoja de personaje Personaje: (61/1000) Nombre: GladiadorMagico Raza: Humano/a
| Tema: Re: Script 8 direcciones y correr Lun Sep 15, 2008 6:19 am | |
| Si, por que cambia los Code del foro por los del coso, xD. | |
|
Lood^.^! Ciudadano Experto
Mensajes : 36 Fecha de inscripción : 13/09/2008 Edad : 30 Localización : Yo tmb te kiero
| Tema: Re: Script 8 direcciones y correr Lun Sep 15, 2008 3:05 pm | |
| EH ke yo lo puse en codigo!!!! xD Solo que no me aprecia necesario ponerlo en spoiler pero si la magnifica mie tan lo desea yo lo hare xD | |
|
Contenido patrocinado
| Tema: Re: Script 8 direcciones y correr | |
| |
|