Ergebnis 1 bis 20 von 101

Thema: RPG Maker XP Intro

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1
    Zitat Zitat von Llcoolray Beitrag anzeigen
    Öh wie?
    Ich hab den post doch gelöscht weil ichs ned richtig einfügen konnte oder siehst du den etwa??
    Ich habe den Post gelesen, als er noch nicht gelöscht war...

  2. #2
    Hey ich hab hier ein paar probleme mit diesem Script, und hoffe ihr helft mir weiter. Also dieses Script soll beim betreten von der Stadt oder einem gebiebt den Namen oben links anziegen. Aber wie kann ich das machen das dieser name angezeigt wird. Wenn ichs richtig verstanden hab könnte man auch ein kleines Image anstatt nur dem Text erscheinen lassen, also wenn mir des jemand sagen könnte wo und ob ich ein Image in den Spiele ordner hochladen muss oder wie das funktioniert und wie ich es dann schaff das ich es bei jedem neuen gebiet mit dem jeweiligen Namen angezeigt bekomm wäre ich sehr dankbar^^

    Code:
    #============================================================================
    # ** Map Location Popup
    #----------------------------------------------------------------------------
    # Yeyinde
    # 1.0.0
    # 06/07/07
    # SDK Version : (2.2) - Parts: I, III
    #============================================================================
    
    #-----------------------------------------------------------------------------
    # SDK Auto-installer
    #-----------------------------------------------------------------------------
    unless Object.const_defined?(:SDK)
      begin
        require 'SDK'
      rescue LoadError
        print 'This script (Map Location Popup) requires the SDK to run.'
        exit 1
      end
    end
    
    #-----------------------------------------------------------------------------
    # SDK Log
    #-----------------------------------------------------------------------------
    SDK.log('Map Location Popup', 'Yeyinde', '1.00', '06/07/07')
    
    #-----------------------------------------------------------------------------
    # SDK Check Requirements
    #-----------------------------------------------------------------------------
    SDK.check_requirements(2.2, [1, 3])
    
    #-----------------------------------------------------------------------------
    # SDK Enabled Check
    #-----------------------------------------------------------------------------
    if SDK.enabled?('Map Location Popup')
    
    #==============================================================================
    # ** Location_Popup
    #------------------------------------------------------------------------------
    #  Customization module
    #==============================================================================
    
    module Location_Popup
      # Display Type (0:text 1:image)
      DISPLAY_TYPE = 0
      # Show Type (0:fade 1:scroll)
      SHOW_TYPE = 1
      # Showing Duration (Excludes transition time) - Units: Frames
      SHOW_TIME = 100
      # Transition Duration (For one transition) - Units: Frames
      TRANSITION_TIME = 10
      # Image Type (0:MapID 1:MapName)
      IMAGE_TYPE = 0
      # Image Prefix (For DISPLAY_TYPE 1)
      IMAGE_PREFIX = 'Location_'
      # Image Sufix (For DISPLAY_TYPE 1)
      IMAGE_SUFFIX = ''
      # Popup exemptions (Syntax: [map_id1, mapid2, etc.] EX. [1, 5, 6])
      NO_POPUP_MAPS = []
    end
    
    #==============================================================================
    # ** Game_Temp
    #------------------------------------------------------------------------------
    #  This class handles temporary data that is not included with save data.
    #  Refer to "$game_temp" for the instance of this class.
    #==============================================================================
    
    class Game_Temp
      #---------------------------------------------------------------------------
      # * Aliasing
      #---------------------------------------------------------------------------
      alias_method :map_name_popup_int, :initialize
      #---------------------------------------------------------------------------
      # * Public Instance Variables
      #---------------------------------------------------------------------------
      attr_accessor :new_location_name
      attr_accessor :location_popup_show
      #---------------------------------------------------------------------------
      # * Object Initialization
      #---------------------------------------------------------------------------
      def initialize
        # Call aliased method
        map_name_popup_int
        # Crate new variables
        @new_location_name = ''
        @location_popup_show = false
      end
    end
    
    #==============================================================================
    # ** Game_Map
    #------------------------------------------------------------------------------
    #  This class handles the map. It includes scrolling and passable determining
    #  functions. Refer to "$game_map" for the instance of this class.
    #==============================================================================
    
    class Game_Map
      #---------------------------------------------------------------------------
      # * Aliasing
      #---------------------------------------------------------------------------
      alias_method :map_name_popup_setup, :setup
      #--------------------------------------------------------------------------
      # * Setup
      #     map_id : map ID
      #--------------------------------------------------------------------------
      def setup(map_id)
        # Call aliased method
        map_name_popup_setup(map_id)
        # Set temporary variable
        if Location_Popup::DISPLAY_TYPE == 0 || 
            (Location_Popup::DISPLAY_TYPE == 1 && Location_Popup::IMAGE_TYPE == 1)
          location_text = $data_mapinfos[@map_id].name
        else
          location_text = @map_id.to_s
        end
        $game_temp.new_location_name = location_text
        $game_temp.location_popup_show = true
      end
    end
    
    #==============================================================================
    # ** Sprite_LocationPopup
    #------------------------------------------------------------------------------
    #  This sprite is used to display the current location when it is entered.  It
    #  observes $game_temp.new_location_name to know when to refresh
    #==============================================================================
    
    class Sprite_LocationPopup < Sprite
      #---------------------------------------------------------------------------
      # * Object Initialization
      #---------------------------------------------------------------------------
      def initialize
        # Call superclass method
        super()
        # Set co-ordinates
        self.x = 640
        self.y = 16
        self.z = 999999
        # Set some variables to save space
        @show_time = Location_Popup::SHOW_TIME
        @transition_time = [Location_Popup::TRANSITION_TIME, 1].max
        # Refresh
        refresh
      end
      #---------------------------------------------------------------------------
      # * Reset Variables
      #---------------------------------------------------------------------------
      def reset_variables
        @current_location = $game_temp.new_location_name
        @frames_remaining = @show_time + @transition_time * 2
      end
      #---------------------------------------------------------------------------
      # * Refresh
      #---------------------------------------------------------------------------
      def refresh
        # Clear existing bitmap
        if self.bitmap != nil
          self.bitmap.dispose
          self.bitmap = nil
        end
        # Reset variables
        reset_variables
        # Stop if the location is not to be displayed on this map
        if Location_Popup::NO_POPUP_MAPS.include?($game_map.map_id) ||
            !$game_temp.location_popup_show
          @frames_remaining = 0
          return 
        end
        $game_temp.location_popup_show = false
        # Branch for text display
        if Location_Popup::DISPLAY_TYPE == 0
          text = @current_location
          bitmap = Bitmap.new(32, 32)
          width = bitmap.text_size(text).width + 8
          bitmap.dispose
          self.bitmap = Bitmap.new(width, 32)
          self.bitmap.draw_text(0, 0, width, 32, text)
        else # Branch for image display
          name = Location_Popup::IMAGE_PREFIX + @current_location + 
            Location_Popup::IMAGE_SUFFIX
          self.bitmap = RPG::Cache.picture(name)
        end
        # Reset x co-ordinates
        self.x = Location_Popup::SHOW_TYPE == 0 ? 640 - 16 - self.bitmap.width : 640
        # Set opacity if fade type
        self.opacity = 0 if Location_Popup::SHOW_TYPE == 0
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # Call superclass method
        super
        # Refresh if location was changed
        refresh if @current_location != $game_temp.new_location_name
        # If there is still a frame remaining
        if @frames_remaining > 1
          # Branch per frames remaining
          case @frames_remaining
          when (@show_time + @transition_time )...(@show_time + 
              @transition_time * 2)
            # Branch per showing type
            if Location_Popup::SHOW_TYPE == 0
              self.opacity += 256 / @transition_time
            else
              self.x -= (self.bitmap.width + 16) / @transition_time
            end
          when 1..(@transition_time + 1)
            # Branch per showing type
            if Location_Popup::SHOW_TYPE == 0
              self.opacity -= 256 / @transition_time
            else
              self.x += (self.bitmap.width + 16) / @transition_time
            end
          end
          # Remove one frame
          @frames_remaining -= 1
        end
      end
    end
    
    #==============================================================================
    # ** Scene_Title
    #------------------------------------------------------------------------------
    #  This class performs title screen processing.
    #==============================================================================
    
    class Scene_Title
      #---------------------------------------------------------------------------
      # * Aliasing
      #---------------------------------------------------------------------------
      alias_method :map_name_popup_database, :main_database
      #--------------------------------------------------------------------------
      # * Main Processing : Database Initialization
      #--------------------------------------------------------------------------
      def main_database
        # Call aliased method
        map_name_popup_database
        # If global variable $data_mapinfos has not yet been defined
        #  and if the setup is to use the map name in some way (Text/Mapname image)
        if $data_mapinfos.nil? && Location_Popup::DISPLAY_TYPE == 0 || 
            (Location_Popup::DISPLAY_TYPE == 1 && Location_Popup::IMAGE_TYPE == 1)
          # Load Mapinfos data
          $data_mapinfos = load_data('Data/MapInfos.rxdata')
        end
      end
    end
    
    #==============================================================================
    # ** Scene_Map
    #------------------------------------------------------------------------------
    #  This class performs map screen processing.
    #==============================================================================
    
    class Scene_Map
      #---------------------------------------------------------------------------
      # * Aliasing
      #---------------------------------------------------------------------------
      alias_method :map_name_popup_sprite, :main_sprite
      #--------------------------------------------------------------------------
      # * Main Processing : Sprite Initialization
      #--------------------------------------------------------------------------
      def main_sprite
        map_name_popup_sprite
        @location_popup_sprite = Sprite_LocationPopup.new
      end
    end
    
    end
    #-----------------------------------------------------------------------------
    # End SDK Enabled Check
    #-----------------------------------------------------------------------------

  3. #3
    Das Skript benötigt das SDK.
    Das SDK sind Skripte, die meistens angefordert werden.
    Also suche am besten auf rmxp.org nach dem SDK und kopiere eifach gleich alle 4 Teile (es sind 4 Skripte) über das Main-Skript und unter die SDK-Skripte das Skript mit dem Namen. Damit ein Bild erscheint, wird es schon schwieriger, dazu solltest du jemanden Fragen, der Ruby gut kann, also nicht mich.

  4. #4
    Äh ja das SDK hab ich schon lange^^ also des is kein prob. Weiß eben nur nicht wie ich des erscheinen lassen kann. Aber danke und ich warte einfach bis vlt einer vorbeikommt der weiß wies funzt^^

  5. #5
    Der Name der Map wird automatisch angezeigt bei dem Skript!
    Wenn nicht, hast du was falsch gemacht!

  6. #6
    Echt?also muss ich eigentlich nichts verändern das nur der name angezeigt wird?? komisch...hab SDK ganz normal wie auf der Seite beschrieben rein und danach des Mapteil.....vlt verträgt sichs mit dem AMS nicht?

    Naja bei mir is des SDK script in einem ganzen Teil zusammen also alle 4 teile. Muss ich dann das Name script in des SDK oder eine Neue Scriptseite unter dem SDK??

    Geändert von Llcoolray (11.06.2007 um 19:16 Uhr)

  7. #7
    Doch nicht das Name ins SDK!
    Mach es so:

    Die ------------ Linien sind nur zum Abtrennen (unwichtig).
    Extra_Mapnamen ist das Namens-Skript.
    Das Blaue ist unwichtig, da kann irgendetwas hin (da sind meine Skripte eigentlich).
    Und unten findest du das Main.

    Geändert von Expresseon (11.06.2007 um 19:54 Uhr)

  8. #8
    Ja genau so hab ichs bloß das bei mir des SDK in einem Stück ist also nich in die 4 teile aufgeteilt...funzt aber ned...naja mal sehen wo der fehler liegt

  9. #9
    Dann benutze das SDK in aufgeteilter Form (und nicht das Upgrade vergessen).

    PS: Dein Projekt heißt "Project1"? OMG! Ändere das, das hört sich gammlig an!

  10. #10
    Naja upgrade un alles vorhanden is die neueste version, und da steht auch das des in einem stück verwendet werden kann aber ich schau mal obs einzeln besser funzt.

    Is doch nur der working Title -.-""""

  11. #11
    Mal ne Frage: Du benutzt doch das "Name Popup" Script von rmxp.org (also da hab ichs sofort gefunden)? Ich versichere dir zu 100%, dass es mit den 5 einzelnen SDK-Teilen funktionieren muss, wenn du es unter das SDK setzt. Zur Sicherheit solltest du mal die anderen Skripte, die du benutzt, posten.

  12. #12
    Echt? Ok mal sehen dann schau ich nochmal nach dem aufgeteilten SDK

    also hab jetzt fast wieder alle raus will die erst reinmachen wenn cih fertig bin..gibt sonst zuviel probs...aber ich hab noch des SDK und des AMS mehr ned achso ja doch ncoh des vollbildscript

Berechtigungen

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