Habitant Lv.6
Avertissements : Banni ! Inscrit le : 02/01/2009 Messages : 138
| Sujet: Rendre compatible un script Mer 24 Juin 2009 - 23:25 | |
| Bonjour\Bonsoir! voila il y a quelque temps, je me suis rendu compte que mes 2 bateau ne flottait plus sur l'eau, il marchait sur le sol :S puis j'ai posté un sujet pour m'aider, et bien je viens de me rendre compte que c'était un problème d'incompatibilité avec un des script du Requiem ABS 6, si quelqu'un pourrait me dire ce qui cloche, merci Voila le script : - Spoiler:
#============================================================================== # Requiem Extended Movements #============================================================================== #------------------------------------------------------------------------------ Requiem_Masterpiece.register("Requiem Extended Movements", 1.0, "03/31/2009") #------------------------------------------------------------------------------ class Game_Character attr_accessor :character_name attr_accessor :character_index attr_accessor :move_type attr_accessor :move_route attr_accessor :direction_fix attr_accessor :walk_anime attr_accessor :step_anime attr_accessor :move_speed attr_accessor :through attr_accessor :priority_type def in_range?(parent, target, range) x = (parent.x - target.x) * (parent.x - target.x) y = (parent.y - target.y) * (parent.y - target.y) r = x + y return true if r <= (range * range) return false end def in_direction?(parent, target) return true if parent.direction == 2 and target.y >= parent.y and target.x == parent.x return true if parent.direction == 4 and target.x <= parent.x and target.y == parent.y return true if parent.direction == 6 and target.x >= parent.x and target.y == parent.y return true if parent.direction == 8 and target.y <= parent.y and target.x == parent.x return false end def in_front?(parent, target) return true if parent.direction == 2 and parent.x == target.x and (parent.y+1) == target.y return true if parent.direction == 4 and (parent.x-1) == target.x and parent.y == target.y return true if parent.direction == 6 and (parent.x+1) == target.x and parent.y == target.y return true if parent.direction == 8 and parent.x == target.x and (parent.y-1) == target.y return false end def in_behind?(parent, target) return true if target.direction == 2 and parent.x == target.x and parent.y < target.y return true if target.direction == 4 and parent.x > target.x and parent.y == target.y return true if target.direction == 6 and parent.x < target.x and parent.y == target.y return true if target.direction == 8 and parent.x == target.x and parent.y > target.y return false end def in_beside?(parent, target) return true if target.direction == 2 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y return true if target.direction == 2 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y return true if target.direction == 4 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1) return true if target.direction == 4 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1) return true if target.direction == 6 and parent.direction == 2 and target.x == parent.x and target.y == (parent.y+1) return true if target.direction == 6 and parent.direction == 8 and target.x == parent.x and target.y == (parent.y-1) return true if target.direction == 8 and parent.direction == 4 and target.x == (parent.x-1) and target.y == parent.y return true if target.direction == 8 and parent.direction == 6 and target.x == (parent.x+1) and target.y == parent.y return false end def face_to_face?(parent, target) return true if parent.direction == 2 and target.direction == 8 return true if parent.direction == 4 and target.direction == 6 return true if parent.direction == 6 and target.direction == 4 return true if parent.direction == 8 and target.direction == 2 return false end def is_passable?(object, dir) x = dir == 4 ? -1 : dir == 6 ? 1 : 0 y = dir == 2 ? 1 : dir == 8 ? -1 : 0 return false if !$game_map.passable?(object.x+x, object.y+y) return true end def events_xy(object, dir) x = dir == 4 ? -1 : dir == 6 ? 1 : 0 y = dir == 2 ? 1 : dir == 8 ? -1 : 0 for i in $game_map.events.values return true if i.x == object.x+x and i.y == object.y+y and !i.through end return false end def move_toward(target) sx = distance_x_from(target) sy = distance_y_from(target) if sx != 0 or sy != 0 if sx.abs > sy.abs sx > 0 ? move_left : move_right if @move_failed and sy != 0 sy > 0 ? move_up : move_down end else sy > 0 ? move_up : move_down if @move_failed and sx != 0 sx > 0 ? move_left : move_right end end end end def turn_toward(target) sx = distance_x_from(target) sy = distance_y_from(target) if sx.abs > sy.abs sx > 0 ? turn_left : turn_right elsif sx.abs < sy.abs sy > 0 ? turn_up : turn_down end end def distance_x_from(target) sx = @x - target.x if $game_map.loop_horizontal? if sx.abs > $game_map.width / 2 sx -= $game_map.width end end return sx end def distance_y_from(target) sy = @y - target.y if $game_map.loop_vertical? if sy.abs > $game_map.height / 2 sy -= $game_map.height end end return sy end end
#------------------------------------------------------------------------------ class Game_Event < Game_Character def check_value(comment) return 0 if @list.nil? or @list.size <= 0 for item in @list if item.code == 108 or item.code == 408 if item.parameters[0] =~ /#{comment}[ ]?(\d+)?/ return $1.to_i end end end return 0 end def check_command(comment) return nil if @list.nil? or @list.size <= 0 for item in @list next unless item.code == 108 or item.code == 408 if item.parameters[0] =~ /#{comment} (.*)/ return $1.to_s end end return nil end def check_comment(comment) return false if @list.nil? or @list.size <= 0 for item in @list if item.code == 108 or item.code == 408 if item.parameters[0].include?(comment) return true end end end return false end end
|
|