Ergebnis 1 bis 12 von 12

Thema: Item - Pop-Up RMXP Problem

  1. #1

    Item - Pop-Up RMXP Problem

    Servus...
    hab mich bis jetzt immer sehr hilfreich von Euren Themen und Posts durch die anstrengende RGSS - Welt lesen und probiern können. Danke dafür.

    Nun sind aber die grenzen erreicht... =(
    Ich möcht gern den Pop-Up script von Tibuda einsetzen !
    nur bekomm ich einen Fehler beim starten des Spiels...

    Script 'Item Pop-Up' line 259: NoMethodError occurred.
    undefined method `size' for nil:NilClass

    Nach äderungen kommt dann dieser Fehler:
    Script 'Item Pop-Up' line 260: NoMethodError occurred.
    undefined method `[]' for nil:NilClass

    hier mal die passage des scripts:
    Code:
    #--------------------------------------------------------------------------
    # Sprite_Character
    #--------------------------------------------------------------------------
    class Sprite_Character
      alias popup_spr_char_update update
      def update
        popup_spr_char_update
        if @character.is_a?(Game_Character)
          while @character.popup_icons.size > 0
            popup_icon(@character.popup_icons[0][0], @character.popup_icons[0][1],
                       @character.popup_icons[0][2])
            @character.popup_icons.delete_at(0)
          end
        end
        update_icons
      end
    end
    Was ist da falsch?!
    Vielen Dank für Eure Hilfe !
    Mit freundlichen Grüßen fritte

    Geändert von fritte (23.05.2011 um 10:22 Uhr)

  2. #2
    Die Fehlermeldung ist mehr oder weniger eindeutig, in der Zeile 259 / 260 ist eine Methode von einem Objekt aufgerufen worden welches garnicht existiert. Damit wir dir helfen können müsstest du uns die angegebenen Zeilen einmal zeigen. Dadurch wüssten wir zumindest um welches Objekt es sich handelt. Danach muss man herausfinden warum es nicht existiert.

  3. #3
    Hey super das ging ja schnell !

    dann schreib ich einfach mal den ganzen script rein...
    Ich weiß leider nicht wie der befehl für "code" im forum hier heißt...

    Code:
    #==============================================================================
    # ** Item Popup
    #------------------------------------------------------------------------------
    # Tibuda
    # Version 1.12
    # 02.23.07
    #------------------------------------------------------------------------------
    # * Version History :
    # 01.11.07 - Version 1.00
    # 01.13.07 - Version 1.01
    #     - Bug fix: Bug while tryin' to unequip an item in the equipment scene
    #     - Added: Item number font customization
    # 01.19.07 - Version 1.10
    #     - Added: Fading icons when losing items (optional)
    #     - Added: Background image (optional)
    #     - Added: Custom colors for each item
    #     - Added: You can show a icon in events
    #     - Added: Custom colors when calling the popup_icon
    # 01.23.07 - Version 1.11
    #     - Bug fix: Bug while changin'g class or changin' equip in the map
    # 02.23.07 - Version 1.12 (one month)
    #     - Bug fix: Showing icon with 0 items/gold
    #------------------------------------------------------------------------------
    # * Instructions
    # - To show an icon call the following script:
    #    $game_player.popup_icon(icon_name[, number, color])
    #        for the player
    #    self.event.popup_icon(icon_name[, number, color])
    #        for the current event
    #    $game_map.events[id].popup_icon(icon_name[, number, color])
    #        for the the event id
    # - Customizing the duration
    #   ICON_TIME holds the time a icon is shown
    #   ICON_DELAY is time a icon will wait to appear when there's a icon showing
    # - Customizing the item number colors
    #   The NUMBER_COLOR constant is the default color for all the item types
    #   The GOLD_NUMBER_COLOR holds the color for the gold
    #   The ITEM_NUMBER_COLOR hahs hold the color for specific items.
    #   You can add a custom color for a item this way:
    #    ITEM_NUMBER_COLOR = {item_id => item_color, item_id => item_color....}
    #   If you want a default color for all items you can use the item_id 0
    #   Use WEAPON_NUMBER_COLOR for weapons and ARMOR_NUMBER_COLOR for armors
    #==============================================================================
    
    #--------------------------------------------------------------------------
    # module Popup_Item
    #--------------------------------------------------------------------------
    module Popup_Item
      # Fading icons
      FADE_LOSE    = false
      # The time we show the icon
      ICON_TIME    = 40
      # The time before show a new item
      ICON_DELAY   = 24
      # Icon to show when the player gets money
      GOLD_ICON    = "032-Item01"
      # A 32x32 background image
      BACKGROUND   = ""
      # Font for the item number
      NUMBER_FONT  = "Tahoma"
      NUMBER_SIZE  = 12
      NUMBER_COLOR = Color.new(255, 255, 255)
      # Custom font color for specific items
      GOLD_NUMBER_COLOR   = Color.new(255, 255, 0)
      ITEM_NUMBER_COLOR   = {}
      ARMOR_NUMBER_COLOR  = {}
      WEAPON_NUMBER_COLOR = {}
      # True if using Trickster's Method & Class Library
      TRICK_MACL = false
    end
    
    #--------------------------------------------------------------------------
    # Game_Character
    #--------------------------------------------------------------------------
    class Game_Character
      attr_accessor :popup_icons
      alias popup_gm_party_init initialize
      def initialize
        popup_gm_party_init
        @popup_icons = []
      end
      def popup_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        @popup_icons.push([icon_name, number, color])
      end
      def fade_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        popup_icon(icon_name, -number, color) if Popup_Item::FADE_LOSE
      end
    end
    #--------------------------------------------------------------------------
    # Game_Party
    #--------------------------------------------------------------------------
    class Game_Party
      attr_accessor :ignore_icon
      alias popup_gm_party_init initialize
      def initialize
        popup_gm_party_init
        @ignore_icon = false
      end
      def popup_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        $game_player.popup_icon(icon_name, number, color)
      end
      def fade_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        $game_player.fade_icon(icon_name, number, color)
      end
      alias popup_gm_party_gain_gold gain_gold
      def gain_gold(n)
        popup_gm_party_gain_gold(n)
        return if @ignore_icon || n < 1
        if Popup_Item::GOLD_ICON != "" and $scene.is_a?(Scene_Map)
          if Popup_Item::GOLD_NUMBER_COLOR.is_a?(Color)
            color = Popup_Item::GOLD_NUMBER_COLOR
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon(Popup_Item::GOLD_ICON, n, color)
        end
      end
      alias popup_gm_party_gain_item gain_item
      def gain_item(id, n)
        popup_gm_party_gain_item(id, n)
        return if id < 1 or id >= $data_items.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::ITEM_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::ITEM_NUMBER_COLOR[id]
          elsif Popup_Item::ITEM_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::ITEM_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_items[id].icon_name, n, color)
        end
      end
      alias popup_gm_party_gain_weapon gain_weapon
      def gain_weapon(id, n)
        popup_gm_party_gain_weapon(id, n)
        return if id < 1 or id >= $data_weapons.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::WEAPON_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::WEAPON_NUMBER_COLOR[id]
          elsif Popup_Item::WEAPON_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::WEAPON_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_weapons[id].icon_name, n, color)
        end
      end
      alias popup_gm_party_gain_armor gain_armor
      def gain_armor(id, n)
        popup_gm_party_gain_armor(id, n)
        return if id < 1 or id >= $data_armors.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::ARMOR_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::ARMOR_NUMBER_COLOR[id]
          elsif Popup_Item::ARMOR_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::ARMOR_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_armors[id].icon_name, n, color)
        end
      end
    end
    #--------------------------------------------------------------------------
    # Game_Actor
    #--------------------------------------------------------------------------
    class Game_Actor
      alias popup_gm_actor_equip equip
      def equip(equip_type, id)
        $game_party.ignore_icon = true
        popup_gm_actor_equip(equip_type, id)
        $game_party.ignore_icon = false
      end
    end
    #--------------------------------------------------------------------------
    # module RPG
    #--------------------------------------------------------------------------
    module RPG
      #--------------------------------------------------------------------------
      # RPG::Sprite
      #--------------------------------------------------------------------------
      class Sprite
        def popup_icon(name, number = 1, color = Popup_Item::NUMBER_COLOR)
          return if name == "" or name == nil
          return if number.is_a?(Numeric) and number < 0 and !Popup_Item::FADE_LOSE
          @icons = [] if !@icons.is_a?(Array)
          icon = {}
          icon["time"]   = 0 - @icons.size * Popup_Item::ICON_DELAY
          if number.is_a?(Numeric) and number < 0
            icon["fade"] = true
            number       = - number
          else
            icon["fade"] = false
          end
          icon["sprite"] = RPG::Sprite.new(self.viewport)
          if Popup_Item::BACKGROUND != ""
            bitmap = RPG::Cache.picture(Popup_Item::BACKGROUND)
            icon["sprite"].bitmap = Bitmap.new(bitmap.width, bitmap.height)
            icon["sprite"].bitmap.blt(0, 0, bitmap, Rect.new(0,0,bitmap.width,bitmap.width))
          else
            icon["sprite"].bitmap = Bitmap.new(32,32)
            
          end
          bitmap = RPG::Cache.icon(name)
          icon["sprite"].bitmap.blt(4, 4, bitmap, Rect.new(0,0,24,24))
          if Popup_Item::NUMBER_SIZE > 0 and number != 1 and number != ""
            icon["sprite"].bitmap.font.outline = true if Popup_Item::TRICK_MACL
            icon["sprite"].bitmap.font.name  = Popup_Item::NUMBER_FONT
            icon["sprite"].bitmap.font.size  = Popup_Item::NUMBER_SIZE
            icon["sprite"].bitmap.font.color = color
            icon["sprite"].bitmap.draw_text(5, 28 - Popup_Item::NUMBER_SIZE - 1, 27, Popup_Item::NUMBER_SIZE, number.to_s)
          end
          icon["sprite"].ox = 0
          icon["sprite"].oy = 20
          icon["sprite"].x  = self.x
          icon["sprite"].y  = self.y - self.oy / 2 + 1 - icon["time"]
          icon["sprite"].z  = 3000
          icon["sprite"].visible = false
          @icons.push(icon)
        end
        def update_icons
          return unless @icons.is_a?(Array)
          return if Graphics.frame_count % 2 != 0
          i = 0
          while i < @icons.size
            if @icons[i]["time"] > Popup_Item::ICON_TIME
              @icons[i]["sprite"].bitmap.dispose
              @icons[i]["sprite"].dispose
              @icons.delete_at(i)
            else
              @icons[i]["time"] += 1
              if @icons[i]["fade"]
                op = [255 * (1 - @icons[i]["time"] / Popup_Item::ICON_TIME),0].max
                @icons[i]["sprite"].opacity = op
                @icons[i]["sprite"].update
              else
                @icons[i]["sprite"].y -= 1
              end
              @icons[i]["sprite"].visible = @icons[i]["time"] >= 0
              i += 1
            end
          end
        end
        alias popup_sprite_update update
        def update
          popup_sprite_update
          update_icons
        end
      end
    end
    #--------------------------------------------------------------------------
    # Sprite_Character
    #--------------------------------------------------------------------------
    class Sprite_Character
      alias popup_spr_char_update update
      def update
        popup_spr_char_update
        if @character.is_a?(Game_Character)
    259      while @character.popup_icons.size > 0
    260        popup_icon(@character.popup_icons[0][0], @character.popup_icons[0][1],
                       @character.popup_icons[0][2])
            @character.popup_icons.delete_at(0)
          end
        end
        update_icons
      end
    end
    Vielen Dank...

    Geändert von fritte (23.05.2011 um 10:22 Uhr)

  4. #4
    Tut mir sehr leid, aber bis Zeile 260 durch zu zählen ist nicht gerade eine beliebte Angelegenheit. In deinem Scripteditor solltest du Zeilenangaben am linken Rand haben, such am besten einfach die Zeile 259 / 260 und kopiere uns nur einmal diese heraus.

  5. #5
    das sind die letzten Zeilen !
    hatte ich auch extra schon markiert ! markiert !

    Code:
    259 while @character.popup_icons.size > 0
    260 popup_icon(@character.popup_icons[0][0], @character.popup_icons[0][1],
    Danke =)

    Geändert von fritte (23.05.2011 um 10:23 Uhr)

  6. #6
    Kann es sein, dass dieser Fehler bei einem Speicherstand auftritt der gespeichert wurde bevor du dieses Script implementiert hast?

    Um dir einmal den Fehler soweit zu erklären. Die lokale Variable "@character.popup_icons" ist "nil" also nicht besetzt, obwohl hier ein Array erwartet wäre.
    Diese Variable müsste an irgendeiner Stelle gesetzt werden damit dieser Fehler nicht auftritt.
    Dies geschieht meines Erachtens nach hier:
    Code:
    class Game_Character
     attr_accessor :popup_icons
    
     alias popup_gm_party_init initialize
    
     def initialize
       popup_gm_party_init
       @popup_icons = []
     end
    end
    Also bei der Initialisierung (Erstellung) eines Game_Character.
    Sofern also die Variable "@popup_icons" an keiner Stelle des Scriptes auf "nil" gesetzt wird sollte dein Fehler also eigentlich nicht auftreten.

    Falls es sich um einen alten Speicherstand handelt dann versuch einmal eine neues Spiel zu beginnen und es erneut aus zu probieren.

  7. #7
    wow da merkt man das ich echt keine ahnung habe...
    lade keinen spielstand beginne immer mit "neues spiel" und gleich nach dem titelscreen kommt der fehler...

    hab alles nach "nil" abgesucht und nur eines gefunden !

    Code:
    # RPG::Sprite
     #--------------------------------------------------------------------------
     class Sprite
     def popup_icon(name, number = 1, color = Popup_Item::NUMBER_COLOR)
     return if name == "" or name == nil
    desweiteren hab ich wieder mal... mehrere stunden damit zugebracht den fehler selber zu finden und hab tausend sachen probiert...
    das war dann mein letzter versuch gewesen...

    Code:
    class Game_Character
     attr_accessor :popup_icons
    
     alias popup_gm_party_init initialize
    
     def initialize
       popup_gm_party_init
       @popup_icons = []
     end
    end
    @character.popup_icons = [array]
    das da natürlich auch n fehler kam brauch ich dir wahrscheinlich nicht sagen =)
    diese zeile sieht auch irgendwie verloren an der stelle aus...
    über deine hilfe wäre ich sehr dankbar !

    Geändert von fritte (22.05.2011 um 20:33 Uhr) Grund: endlich die "code" funktion endeckt =)

  8. #8
    Versuchst du bereits ein Callscript auszuführen, aber fehlerhaft?

    Wenn nicht, dann poste bitte das komplette Script in Code-Tags und ich schaue mir es einmal genauer an.

  9. #9
    Das Spiel schließt also mit einer Fehlermeldung sobald du bereits ein neues Spiel beginnst, also noch bevor du irgendetwas tun kannst?

  10. #10
    @cornix
    ja gleich nachdem ich "neues spiel" ausgewählt habe ! danach kommt nur noch n blackscreen und das wars...
    ich komme nichmal zur auswahl des intro's oder auf irgendeine map...

    @shisu
    Code:
    #==============================================================================
    # ** Item Popup
    #------------------------------------------------------------------------------
    # Tibuda
    # Version 1.12
    # 02.23.07
    #------------------------------------------------------------------------------
    # * Version History :
    # 01.11.07 - Version 1.00
    # 01.13.07 - Version 1.01
    #     - Bug fix: Bug while tryin' to unequip an item in the equipment scene
    #     - Added: Item number font customization
    # 01.19.07 - Version 1.10
    #     - Added: Fading icons when losing items (optional)
    #     - Added: Background image (optional)
    #     - Added: Custom colors for each item
    #     - Added: You can show a icon in events
    #     - Added: Custom colors when calling the popup_icon
    # 01.23.07 - Version 1.11
    #     - Bug fix: Bug while changin'g class or changin' equip in the map
    # 02.23.07 - Version 1.12 (one month)
    #     - Bug fix: Showing icon with 0 items/gold
    #------------------------------------------------------------------------------
    # * Instructions
    # - To show an icon call the following script:
    #    $game_player.popup_icon(icon_name[, number, color])
    #        for the player
    #    self.event.popup_icon(icon_name[, number, color])
    #        for the current event
    #    $game_map.events[id].popup_icon(icon_name[, number, color])
    #        for the the event id
    # - Customizing the duration
    #   ICON_TIME holds the time a icon is shown
    #   ICON_DELAY is time a icon will wait to appear when there's a icon showing
    # - Customizing the item number colors
    #   The NUMBER_COLOR constant is the default color for all the item types
    #   The GOLD_NUMBER_COLOR holds the color for the gold
    #   The ITEM_NUMBER_COLOR hahs hold the color for specific items.
    #   You can add a custom color for a item this way:
    #    ITEM_NUMBER_COLOR = {item_id => item_color, item_id => item_color....}
    #   If you want a default color for all items you can use the item_id 0
    #   Use WEAPON_NUMBER_COLOR for weapons and ARMOR_NUMBER_COLOR for armors
    #==============================================================================
    
    #--------------------------------------------------------------------------
    # module Popup_Item
    #--------------------------------------------------------------------------
    module Popup_Item
      # Fading icons
      FADE_LOSE    = false
      # The time we show the icon
      ICON_TIME    = 40
      # The time before show a new item
      ICON_DELAY   = 24
      # Icon to show when the player gets money
      GOLD_ICON    = "032-Item01"
      # A 32x32 background image
      BACKGROUND   = ""
      # Font for the item number
      NUMBER_FONT  = "Tahoma"
      NUMBER_SIZE  = 12
      NUMBER_COLOR = Color.new(255, 255, 255)
      # Custom font color for specific items
      GOLD_NUMBER_COLOR   = Color.new(255, 255, 0)
      ITEM_NUMBER_COLOR   = {}
      ARMOR_NUMBER_COLOR  = {}
      WEAPON_NUMBER_COLOR = {}
      # True if using Trickster's Method & Class Library
      TRICK_MACL = false
    end
    
    #--------------------------------------------------------------------------
    # Game_Character
    #--------------------------------------------------------------------------
    class Game_Character
      attr_accessor :popup_icons
      alias popup_gm_party_init initialize
      def initialize
        popup_gm_party_init
        @popup_icons = []
      end
      def popup_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        @popup_icons.push([icon_name, number, color])
      end
      def fade_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        popup_icon(icon_name, -number, color) if Popup_Item::FADE_LOSE
      end
    end
    #--------------------------------------------------------------------------
    # Game_Party
    #--------------------------------------------------------------------------
    class Game_Party
      attr_accessor :ignore_icon
      alias popup_gm_party_init initialize
      def initialize
        popup_gm_party_init
        @ignore_icon = false
      end
      def popup_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        $game_player.popup_icon(icon_name, number, color)
      end
      def fade_icon(icon_name, number = 1, color = Popup_Item::NUMBER_COLOR)
        $game_player.fade_icon(icon_name, number, color)
      end
      alias popup_gm_party_gain_gold gain_gold
      def gain_gold(n)
        popup_gm_party_gain_gold(n)
        return if @ignore_icon || n < 1
        if Popup_Item::GOLD_ICON != "" and $scene.is_a?(Scene_Map)
          if Popup_Item::GOLD_NUMBER_COLOR.is_a?(Color)
            color = Popup_Item::GOLD_NUMBER_COLOR
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon(Popup_Item::GOLD_ICON, n, color)
        end
      end
      alias popup_gm_party_gain_item gain_item
      def gain_item(id, n)
        popup_gm_party_gain_item(id, n)
        return if id < 1 or id >= $data_items.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::ITEM_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::ITEM_NUMBER_COLOR[id]
          elsif Popup_Item::ITEM_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::ITEM_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_items[id].icon_name, n, color)
        end
      end
      alias popup_gm_party_gain_weapon gain_weapon
      def gain_weapon(id, n)
        popup_gm_party_gain_weapon(id, n)
        return if id < 1 or id >= $data_weapons.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::WEAPON_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::WEAPON_NUMBER_COLOR[id]
          elsif Popup_Item::WEAPON_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::WEAPON_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_weapons[id].icon_name, n, color)
        end
      end
      alias popup_gm_party_gain_armor gain_armor
      def gain_armor(id, n)
        popup_gm_party_gain_armor(id, n)
        return if id < 1 or id >= $data_armors.size or @ignore_icon || n < 1
        if $scene.is_a?(Scene_Map)
          if Popup_Item::ARMOR_NUMBER_COLOR[id].is_a?(Color)
            color = Popup_Item::ARMOR_NUMBER_COLOR[id]
          elsif Popup_Item::ARMOR_NUMBER_COLOR[0].is_a?(Color)
            color = Popup_Item::ARMOR_NUMBER_COLOR[0]
          else
            color = Popup_Item::NUMBER_COLOR
          end
          popup_icon($data_armors[id].icon_name, n, color)
        end
      end
    end
    #--------------------------------------------------------------------------
    # Game_Actor
    #--------------------------------------------------------------------------
    class Game_Actor
      alias popup_gm_actor_equip equip
      def equip(equip_type, id)
        $game_party.ignore_icon = true
        popup_gm_actor_equip(equip_type, id)
        $game_party.ignore_icon = false
      end
    end
    #--------------------------------------------------------------------------
    # module RPG
    #--------------------------------------------------------------------------
    module RPG
      #--------------------------------------------------------------------------
      # RPG::Sprite
      #--------------------------------------------------------------------------
      class Sprite
        def popup_icon(name, number = 1, color = Popup_Item::NUMBER_COLOR)
          return if name == "" or name == nil
          return if number.is_a?(Numeric) and number < 0 and !Popup_Item::FADE_LOSE
          @icons = [] if !@icons.is_a?(Array)
          icon = {}
          icon["time"]   = 0 - @icons.size * Popup_Item::ICON_DELAY
          if number.is_a?(Numeric) and number < 0
            icon["fade"] = true
            number       = - number
          else
            icon["fade"] = false
          end
          icon["sprite"] = RPG::Sprite.new(self.viewport)
          if Popup_Item::BACKGROUND != ""
            bitmap = RPG::Cache.picture(Popup_Item::BACKGROUND)
            icon["sprite"].bitmap = Bitmap.new(bitmap.width, bitmap.height)
            icon["sprite"].bitmap.blt(0, 0, bitmap, Rect.new(0,0,bitmap.width,bitmap.width))
          else
            icon["sprite"].bitmap = Bitmap.new(32,32)
            
          end
          bitmap = RPG::Cache.icon(name)
          icon["sprite"].bitmap.blt(4, 4, bitmap, Rect.new(0,0,24,24))
          if Popup_Item::NUMBER_SIZE > 0 and number != 1 and number != ""
            icon["sprite"].bitmap.font.outline = true if Popup_Item::TRICK_MACL
            icon["sprite"].bitmap.font.name  = Popup_Item::NUMBER_FONT
            icon["sprite"].bitmap.font.size  = Popup_Item::NUMBER_SIZE
            icon["sprite"].bitmap.font.color = color
            icon["sprite"].bitmap.draw_text(5, 28 - Popup_Item::NUMBER_SIZE - 1, 27, Popup_Item::NUMBER_SIZE, number.to_s)
          end
          icon["sprite"].ox = 0
          icon["sprite"].oy = 20
          icon["sprite"].x  = self.x
          icon["sprite"].y  = self.y - self.oy / 2 + 1 - icon["time"]
          icon["sprite"].z  = 3000
          icon["sprite"].visible = false
          @icons.push(icon)
        end
        def update_icons
          return unless @icons.is_a?(Array)
          return if Graphics.frame_count % 2 != 0
          i = 0
          while i < @icons.size
            if @icons[i]["time"] > Popup_Item::ICON_TIME
              @icons[i]["sprite"].bitmap.dispose
              @icons[i]["sprite"].dispose
              @icons.delete_at(i)
            else
              @icons[i]["time"] += 1
              if @icons[i]["fade"]
                op = [255 * (1 - @icons[i]["time"] / Popup_Item::ICON_TIME),0].max
                @icons[i]["sprite"].opacity = op
                @icons[i]["sprite"].update
              else
                @icons[i]["sprite"].y -= 1
              end
              @icons[i]["sprite"].visible = @icons[i]["time"] >= 0
              i += 1
            end
          end
        end
        alias popup_sprite_update update
        def update
          popup_sprite_update
          update_icons
        end
      end
    end
    #--------------------------------------------------------------------------
    # Sprite_Character
    #--------------------------------------------------------------------------
    class Sprite_Character
      alias popup_spr_char_update update
      def update
        popup_spr_char_update
        if @character.is_a?(Game_Character)
          while @character.popup_icons.size > 0
            popup_icon(@character.popup_icons[0][0], @character.popup_icons[0][1],
                       @character.popup_icons[0][2])
            @character.popup_icons.delete_at(0)
          end
        end
        update_icons
      end
    end
    hey echt super ... ein "callscript" mach ich doch indem ich ein event setze und dieses dann umbennene, oder?! (zb. $LE_type2_1)(für n lichtkegel am fenster...)
    oder ruf ich einen "callscript" über ein event mit einem "eventcomand" und dann seite 3 "script" auf?!

    Vielleicht sollt ich mal noch erwähnen was sonst noch für scripte laufen?! =)

    SDK 2.4
    Slipknot Message System
    MOG - Location Name
    Mode7 1
    Mode7 2
    Mode7 3
    Kritischer Treffer
    Eventtext
    LM_Picterlock
    LM_main
    Weapon Level 0.1 Beta by Jenz
    Level Up Box By Akxiv
    MiniMap made by squall
    After Battle
    Item Popup 1.12 by Tibuda

    Dann kommt das Main...

    Ich hoffe ihr könnt damit was anfangen !?
    Vielen Dank für eure geduld und mühe...

  11. #11
    Es liegt nicht an diesem Item-Popup-Script. Der Fehler, so nehme ich an, liegt an einer ganz anderen Stelle.
    Ich denke, dass mindestens ein weiteres Script welches du in deinem Spiel verwendest nicht mit dem Icon-Popup-Script kompatibel ist und diese Scripte sich dadurch gegenseitig behindern.
    Versuchst du nämlich dieses Item-Popup-Script alleine in ein Projekt zu importieren funktioniert es.

  12. #12
    Wow ich glaub das liegt am Mode7!
    habt vollkommen recht jetzt kommt zumindest kein fehler !
    Ich danke euch vielmals für die intensiven und schnellen antworten!
    werde ich mal wieder ein problem haben weiß ich ja wer hier die ahnung hat ;-)
    Danke !

    [Closed]

    Geändert von fritte (23.05.2011 um 15:16 Uhr)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •