Sujet n°271
Posté par Durarwen le 30 Jan - 11:01 (2008)
Titre : Probleme dans un script
bah voila je voulais testerm on jeu et quand je commence a jouer tout va bien jusqu'a ce que je descende dasn la piece principale du la maison et viola ce que ca m'écrit:

http://img441.imageshack.us/img441/1946/probleme1iv9.jpg

Posté par Sphinx le 2 Fév - 21:09 (2008)
^^ on peut avoir la ligne du script qui pose problème ? =)

Posté par Durarwen le 3 Fév - 09:27 (2008)
ba laligne je l'ai suprimée mais résultat ya plus le son de l'animation><

    unless @@_animations.include?(animation)
          @@_animations.push(animation)
        end
      end
      @_reverse = reverse
      split_list = animation.name.split('/')
      if split_list.length == 2 and split_list[0].length == 1
        case split_list[0]
        when "R"
          @_option = 1
        when "N"
          @_reverse = false
        when "M"
          @_option = 2
        end
      end
      update_animation
    end
       
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end


ce qui est en rouge marchait aps alors je l'ai viré ><

Posté par Sphinx le 3 Fév - 09:43 (2008)
tiens le mien ne pose aucun pb, et je n'y ai apporté aucune modif...

Code:
module RPG
  class Sprite < ::Sprite
    @@_animations = []
    @@_reference_count = {}
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = 0
      @_animation_duration = 0
      @_blink = false
      @_reverse = false
      @_option = 0
    end
   
    def animation(animation, hit, reverse = false)
      dispose_animation
      @_animation = animation
      return if @_animation == nil
      @_animation_hit = hit
      @_animation_duration = @_animation.frame_max
      animation_name = @_animation.animation_name
      animation_hue = @_animation.animation_hue
      bitmap = RPG::Cache.animation(animation_name, animation_hue)
      if @@_reference_count.include?(bitmap)
        @@_reference_count[bitmap] += 1
      else
        @@_reference_count[bitmap] = 1
      end
      @_animation_sprites = []
      if @_animation.position != 3 or not @@_animations.include?(animation)
        for i in 0..15
          sprite = ::Sprite.new(self.viewport)
          sprite.bitmap = bitmap
          sprite.visible = false
          @_animation_sprites.push(sprite)
        end
        unless @@_animations.include?(animation)
          @@_animations.push(animation)
        end
      end
      @_reverse = reverse
      split_list = animation.name.split('/')
      if split_list.length == 2 and split_list[0].length == 1
        case split_list[0]
        when "R"
          @_option = 1
        when "N"
          @_reverse = false
        when "M"
          @_option = 2
        end
      end
      update_animation
    end
       
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
       
        if position == 3
          if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = self.viewport.rect.height - 160
          else
            sprite.x = 320
            sprite.y = 240
          end
        else
          sprite.x = self.x - self.ox + self.src_rect.width / 2
          sprite.y = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
       
        if @_reverse and position == 3
          sprite.x = 620 - sprite.x
          sprite.y = 328 - sprite.y
        end
        if not @_reverse
          sprite.x += cell_data[i, 1]
          sprite.y += cell_data[i, 2]
        else
          sprite.x -= cell_data[i, 1]
          sprite.y -= cell_data[i, 2]
        end
       
        sprite.z = 2000
        sprite.ox = 96
        sprite.oy = 96
        sprite.zoom_x = cell_data[i, 3] / 100.0
        sprite.zoom_y = cell_data[i, 3] / 100.0
        sprite.angle = cell_data[i, 4]
        if @_option == 1 and @_reverse
          sprite.angle += 180
        end
        sprite.mirror = (cell_data[i, 5] == 1)
        if @_option == 2 and @_reverse
          sprite.mirror = (sprite.mirror == false)
        end
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end
  end
end

Posté par Durarwen le 3 Fév - 09:47 (2008)
ba ca doit etre le perso que j'ai mis qui marche pas parce que sa bug toujours

Posté par Sphinx le 3 Fév - 09:49 (2008)
:? ben jsais pas alrs... :?

Posté par nico08 le 18 Fév - 22:01 (2008)
Vous ne savez pas comment il faut faire ?
Parce que j'ai exactement le même problème X( !

Posté par Sphinx le 18 Fév - 22:43 (2008)
^^" vous avez quoi comme scripts ajoutés ? ^^'

Posté par nico08 le 19 Fév - 10:33 (2008)
Je n'ai ajouté aucun script , je n'y ai pas touché . Mais apparement j'ai supprimé la ligne qui marchait pas et sa marche .