The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: killer in the heat on May 12, 2007, 05:35:04 PM

Title: Script
Post by: killer in the heat on May 12, 2007, 05:35:04 PM
is there a Script for making the name of the map show
Title: Re: Script
Post by: Kokowam on May 12, 2007, 05:39:32 PM
http://rmrk.net/index.php/topic,16879.0.html

Same page as this one -.-
Title: Re: Script
Post by: killer in the heat on May 12, 2007, 05:59:56 PM
none of them worked for me the bitmap failed
Title: Re: Script
Post by: Kokowam on May 12, 2007, 06:07:22 PM
The Floating Message script?
Title: Re: Script
Post by: killer in the heat on May 12, 2007, 06:25:55 PM
yeah
Title: Re: Script
Post by: Kokowam on May 12, 2007, 06:32:12 PM

class Floating_Location < Window_Base
   #--------------------------------------------------------------------------
   # The position of the window
   # [x,y]
   #
   # x = 1 => left
   # x = 2 => center
   # x = 3 => right
   #
   # y = 1 => top
   # y = 2 => center
   # y = 3 => bottom
   #--------------------------------------------------------------------------
   POSITION = [1,1]
   def initialize
      @map_name = get_name
      if @map_name == ""
            @size = [32,32]
      else
            @size = Win_Size.new(@map_name)
      end
      width = @size[0]
      height = @size[1]
     
      case POSITION[0]
      when 1
        ox = 0
      when 2
        ox = 640-(width+32)
        ox = ox/2
      when 3
        ox = 640-(width+32)
      end
     
      case POSITION[1]
      when 1
        oy = 0
      when 2
        oy = 480-(height+32)
        oy = oy/2
      when 3
        oy = 480-(height+32)
      end
     
      super(ox, oy, width+32, height+32)
      self.contents = Bitmap.new(width, height)
      if @map_name == ""
            self.visible = false
      else     
            self.opacity = 240
            self.back_opacity = 240
            self.contents_opacity = 240
      end
      @frame_wait = Graphics.frame_count + 60
      refresh
   end

   def refresh
      self.contents.font.color = Color.new(217,87,0,255)
      self.contents.draw_text(0, 0, @size[0], @size[1], @map_name)
   end

   def update
      if @map_name == ""
         self.dispose
         return
      end
      if get_name != @map_name
         self.dispose
         return
      end
      if @frame_wait <= Graphics.frame_count
         if self.opacity > 0
            self.opacity -= 20
            self.back_opacity -= 20
            self.contents_opacity -= 20
         else
            self.dispose
            return
         end
      end
   end

   def get_name
      data = load_data("Data/MapInfos.rxdata")
      data[$game_map.map_id].name
   end

end

class Win_Size < Window_Base
   
   def initialize(text)
      super(0, 0, 640, 480)
      self.contents = Bitmap.new(640 - 32, 480 - 32)
      @w = contents.text_size(text).width
      @h = contents.text_size(text).height
      self.dispose
    end
   
   def [](value)
     if value == 0
       return @w
     else
       return @h
     end
   end

end

class Scene_Map
   DISABLED_MAP_IDS = [2,3] # Change this to the map IDs of the map you don't want the feature for.

   alias   :main_orig   :main
   alias   :update_orig   :update
   alias   :transfer_player_orig  :transfer_player

   def main
      @floating_location.dispose unless @floating_location.nil?
      unless DISABLED_MAP_IDS.include?($game_map.map_id)
        @floating_location = Floating_Location.new
      end
      main_orig
      @floating_location.dispose unless (@floating_location.nil? or
                                         @floating_location.disposed?)
   end

   def update
      @floating_location.update unless (@floating_location.nil? or
                                        @floating_location.disposed?)
      update_orig
   end
   
   def transfer_player
      transfer_player_orig
      @floating_location.dispose unless (@floating_location.nil? or
                                        @floating_location.disposed?)
      unless DISABLED_MAP_IDS.include?($game_map.map_id)
        @floating_location = Floating_Location.new
      end
   end
end

That should work...
Title: Re: Script
Post by: killer in the heat on May 12, 2007, 06:51:39 PM
?????  ?46???RGSSError?????
failed to create bit map

thats what it say when i tryed it
Title: Re: Script
Post by: Kokowam on May 12, 2007, 06:52:37 PM
It works for me...
Title: Re: Script
Post by: :) on May 12, 2007, 07:08:24 PM
upload game data.
Title: Re: Script
Post by: Mushroom Panda on May 15, 2007, 09:32:46 PM
Are you using PK?
Title: Re: Script
Post by: WcW on May 15, 2007, 10:56:42 PM
Here's another script in the database that works fine for me:

http://rmrk.net/index.php/topic,7032.0.html (http://rmrk.net/index.php/topic,7032.0.html)