Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

10 Pages V  « < 8 9 10  
Reply to this topicStart new topic
> + [ Mini - Map ] +, * Minimap created with script, no image file needed *
Tacoghandi
post Jun 23 2011, 11:30 AM
Post #181


Level 1
Group Icon

Group: Member
Posts: 11
Type: None
RM Skill: Undisclosed




QUOTE (Kread-EX @ Jun 23 2011, 01:28 PM) *
You need to put "MMEV" (without quotes) in a comment inside the event.

I tried that it doesn't seem to be working.
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jun 23 2011, 11:53 AM
Post #182


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Yes, because you also need a type, such as MMEV npc, MMEV treasure... Or you can define your own types. Have you read the script instructions?

Something that the instructions don't mention though: your even must have a graphic. Not a tile graphic but a character graphic.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Tacoghandi
post Jun 23 2011, 12:18 PM
Post #183


Level 1
Group Icon

Group: Member
Posts: 11
Type: None
RM Skill: Undisclosed




QUOTE (Kread-EX @ Jun 23 2011, 02:53 PM) *
Yes, because you also need a type, such as MMEV npc, MMEV treasure... Or you can define your own types. Have you read the script instructions?

Something that the instructions don't mention though: your even must have a graphic. Not a tile graphic but a character graphic.

Aah...that was my issue. Do you know how to correct that at all.

[edit] Actually I suppose i can just turn a tile graphic into a character one.
thanks for your help and quick reply.

This post has been edited by Tacoghandi: Jun 23 2011, 12:32 PM
Go to the top of the page
 
+Quote Post
   
HEast
post Jul 7 2011, 01:22 PM
Post #184



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




QUOTE (Blackmorning @ Feb 1 2009, 09:47 AM) *
I was able to edit it to make water tiles appear a different color.
Also forest tiles get their own color.
Here's the edited script if anyone wants it.

Edited Mini-Map Script (Colors for Water & Forest):

CODE
#===============================================================
# ? [VX] ? MiniMap ? ?
# * Plug N Play Minimap (Don't need image~) *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 09/06/2008
# ? Version: 1.0 Beta
# Water and bush/forest tiles now have their own color.  (Blackmorning)
#--------------------------------------------------------------
# ? Credit: KGC for XP MiniMap Script,
# this script can't be done without his MiniMap.
#--------------------------------------------------------------

module MiniMap
  #==========================================================================
=
  # [START] MINIMAP SCRIPT SETUP PART
  #---------------------------------------------------------------------------
  SWITCH_NO_MINIMAP = 10 # Turn ON this switch to NOT SHOW minimap
    
  MAP_RECT = [380, 10, 150, 150] # Minimap size and position
  # [X, Y, Width, Height]
  # You can change it in game, by call script:
  # $game_system.minimap = [X, Y, Width, Height]

  MAP_Z = 0 # Minimap's Z-coordinate
  # Increase this number if there is problem that minimap show below some objects.

  GRID_SIZE = 5 # Minimap's grid size. Recommend to use more than 3.
  
  MINIMAP_BORDER_COLOR = Color.new(0, 0, 0, 160) # Minimap's border color
  # Color.new(Red, Green, Blue, Opacity)
  MINIMAP_BORDER_SIZE = 2 # Minimap's border size
  
  FOREGROUND_COLOR = Color.new(224, 224, 255, 160) # Passable tile color
  FOREST_COLOR = Color.new(0, 124, 0, 140) # Forest tile color
  BACKGROUND_COLOR = Color.new(0, 0, 0, 160) # Unpassable tile color
  WATER_COLOR = Color.new(0, 0, 224, 140) # Water tile color

  USE_OUTLINE_PLAYER = true # Draw outline around player in minimap?
  PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192) # Player Outline color
  USE_OUTLINE_EVENT = true # Draw outline around events in minimap?
  EVENT_OUTLINE_COLOR = Color.new(160, 0, 160, 160) # Event Outline color
  
  PLAYER_COLOR = Color.new(255, 0, 0, 192) # Player color
  #---------------------------------------------------------------------------

  OBJECT_COLOR = {} # Don't change or delete this line!
  #===============================================================
  # * SETUP EVENT KEYWORD & COLOR
  #---------------------------------------------------------------
  # ** Template:
  # OBJECT_COLOR['keyword'] = Color.new(Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  # * 'keyword': Word you want to put in event's comment to show this color
  # ** Note: 'keyword' is CASE SENSITIVE!
  # * Color.new(...): Color you want
  # You can put between 0 - 255 in each argument (Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  OBJECT_COLOR['npc'] = Color.new(60,60,60,160) #grey
  OBJECT_COLOR['treasure'] = Color.new(255,255,0,160) #yellow
  OBJECT_COLOR['enemy'] = Color.new(139,0,0,160) # dark red
  OBJECT_COLOR['merchant'] = Color.new(0,255,0,160) #green
  OBJECT_COLOR['save'] = Color.new(0,255,255,160) #turquoise
  OBJECT_COLOR['teleport'] = Color.new(160,0,160,160) #purple
  OBJECT_COLOR['door'] = Color.new(255,255,255,255) #white
  
  #==========================================================================
=
  # * [OPTIONAL] TAGS:
  #---------------------------------------------------------------------------
  # Change keyword for disable minimap & keyword for show event on minimap~
  #-----------------------------------------------------------------------
  TAG_NO_MINIMAP = '[NOMAP]'
  TAG_EVENT = 'MMEV'
  #---------------------------------------------------------------------------

  #---------------------------------------------------------------------------
  # [END] MINIMAP SCRIPT SETUP PART
  #==========================================================================
=
  
  def self.refresh
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.refresh
    end
  end
  
  def self.update_object
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.update_object_list
    end
  end
end

#==============================================================================
# ? RPG::MapInfo
#==============================================================================
class RPG::MapInfo
  def name
    return @name.gsub(/\[.*\]/) { }
  end

  def original_name
    return @name
  end

  def show_minimap?
    return !@name.include?(MiniMap::TAG_NO_MINIMAP)
  end
end
#==============================================================================
# ? Game_System
#==============================================================================
class Game_System
  attr_accessor :minimap
  alias wora_minimap_gamsys_ini initialize
  
  def initialize
    wora_minimap_gamsys_ini
    @minimap = MiniMap::MAP_RECT
  end
  
  def show_minimap
    return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  end
end
#==============================================================================
# ? Game_Map
#==============================================================================
class Game_Map
  alias wora_minimap_gammap_setup setup
  def setup(map_id)
    wora_minimap_gammap_setup(map_id)
    @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
    @map_info = @db_info[map_id]
  end
  
  def show_minimap?
    return @map_info.show_minimap?
  end
end
#==============================================================================
# ? Game_Event
#==============================================================================
class Game_Event < Game_Character
  def mm_comment?(comment, return_comment = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
        if @list[i].parameters[0].include?(comment)
          return @list[i].parameters[0] if return_comment
          return true
        end
      end
    end
    return '' if return_comment
    return false
  end
end
#==============================================================================
# ? Game_MiniMap
#------------------------------------------------------------------------------
class Game_MiniMap
  def initialize(tilemap)
    @tilemap = tilemap
    refresh
  end

  def dispose
    @border.bitmap.dispose
    @border.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
  end

  def visible
    return @map_sprite.visible
  end

  def visible=(value)
    @map_sprite.visible = value
    @object_sprite.visible = value
    @position_sprite.visible = value
    @border.visible = value
  end

  def refresh
    @mmr = $game_system.minimap
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max

    @x = 0
    @y = 0
    @size = [map_rect.width / grid_size, map_rect.height / grid_size]

    @border = Sprite.new
    @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
    @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
    b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    @border.bitmap = Bitmap.new(b_width, b_height)
    @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
    @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
    @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
    @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
    
    @map_sprite = Sprite.new
    @map_sprite.x = map_rect.x
    @map_sprite.y = map_rect.y
    @map_sprite.z = MiniMap::MAP_Z
    bitmap_width = $game_map.width * grid_size + map_rect.width
    bitmap_height = $game_map.height * grid_size + map_rect.height
    @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @map_sprite.src_rect = map_rect

    @object_sprite = Sprite.new
    @object_sprite.x = map_rect.x
    @object_sprite.y = map_rect.y
    @object_sprite.z = MiniMap::MAP_Z + 1
    @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @object_sprite.src_rect = map_rect

    @position_sprite = Sprite_Base.new
    @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
    @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
    @position_sprite.z = MiniMap::MAP_Z + 2
    
    bitmap = Bitmap.new(grid_size, grid_size)
    # Player's Outline
    if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
      bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
      brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
        bitmap.rect.height - 2)
      bitmap.clear_rect(brect)
    else
      brect = bitmap.rect
    end
    
    bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
    @position_sprite.bitmap = bitmap

    draw_map
    update_object_list
    draw_object
    update_position
  end

  def draw_map
    bitmap = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, MiniMap::WATER_COLOR)
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    
    $game_map.width.times do |i|
      $game_map.height.times do |j|
        if !$game_map.ship_passable?(i,j)
          rect = Rect.new(map_rect.width / 2 + grid_size * i,
          map_rect.height / 2 + grid_size * j,
          grid_size, grid_size)
          bitmap.fill_rect(rect, MiniMap::BACKGROUND_COLOR)
        end
        
        if !$game_map.passable?(i, j)
          next
        end
        rect = Rect.new(map_rect.width / 2 + grid_size * i,
          map_rect.height / 2 + grid_size * j,
          grid_size, grid_size)
        if grid_size >= 3
          if !$game_map.passable?(i, j)
            rect.height -= 1
            rect.x += 1
            rect.width -= 1
            rect.width -= 1
            rect.y += 1
            rect.height -= 1
          end
        end
        if !$game_map.bush?(i,j)
          bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
        else
          bitmap.fill_rect(rect, MiniMap::FOREST_COLOR)
        end
      end
    end
  end

  def update_object_list
    @object_list = {}
    $game_map.events.values.each do |e|
      comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
      if comment != ''
        type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
        @object_list[type] = [] if @object_list[type].nil?
        @object_list[type] << e
      end
    end
  end

  def draw_object
    bitmap = @object_sprite.bitmap
    bitmap.clear
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    rect = Rect.new(0, 0, grid_size, grid_size)
    mw = map_rect.width / 2
    mh = map_rect.height / 2

    @object_list.each do |key, events|
      color = MiniMap::OBJECT_COLOR[key]
      next if events.nil? or color.nil?
      events.each do |obj|
        if !obj.character_name.empty?
          rect.x = mw + obj.real_x * grid_size / 256
          rect.y = mh + obj.real_y * grid_size / 256
          # Event's Outline
          if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
            bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
            brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
            rect.height - 2)
            bitmap.clear_rect(brect)
          else
            brect = bitmap.rect
          end
          bitmap.fill_rect(brect, color)
        end
      end
    end
  end

  def update
    if @mmr != $game_system.minimap
      dispose
      refresh
    end
    draw_object
    update_position
    if @map_sprite.visible
      @map_sprite.update
      @object_sprite.update
      @position_sprite.update
    end
  end

  def update_position
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    sx = $game_player.real_x * grid_size / 256
    sy = $game_player.real_y * grid_size / 256
    @map_sprite.src_rect.x = sx
    @map_sprite.src_rect.y = sy
    @object_sprite.src_rect.x = sx
    @object_sprite.src_rect.y = sy
  end
end
#==============================================================================
# ? Spriteset_Map
#------------------------------------------------------------------------------
class Spriteset_Map
  attr_reader :minimap
  alias wora_minimap_sprsetmap_ini initialize
  alias wora_minimap_sprsetmap_dis dispose
  alias wora_minimap_sprsetmap_upd update
  
  def initialize
    wora_minimap_sprsetmap_ini
    if $game_map.show_minimap?
      @minimap = Game_MiniMap.new(@tilemap)
      $game_system.show_minimap = true if $game_system.show_minimap.nil?
      @minimap.visible = $game_system.show_minimap
    end
  end
  
  def dispose
    @minimap.dispose if !@minimap.nil?
    wora_minimap_sprsetmap_dis
  end

  def update
    if !@minimap.nil?
      if $game_system.show_minimap
        @minimap.visible = true
        @minimap.update
      else
        @minimap.visible = false
      end
    end
    wora_minimap_sprsetmap_upd
  end
end
#==============================================================================
# ? Scene_Map
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
  attr_reader :spriteset
end


Thanks, this edited version is great.
One of the best scripts ever.

This post has been edited by HEast: Jul 7 2011, 01:26 PM
Go to the top of the page
 
+Quote Post
   
maniak2221
post Mar 18 2012, 04:51 PM
Post #185



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




The only issue I have with it
is when I make changes to any map in the game and load a game save and
go to that area the game will crash and it says the error is on line
136, the game works fine when I start a new game but it's like the
script can't pickup any map changes on a game load. I'm no coder but
wouldn't it be possible to add somewhere that when a game is loaded to
recheck the data/mapinfos.rvdata ?

CODE
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
   alias wora_minimap_gammap_setup setup
   def setup(map_id)
     wora_minimap_gammap_setup(map_id)
     @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
     @map_info = @db_info[map_id]
   end

   def show_minimap?
     return @map_info.show_minimap?
   end
end

I'm not sure if you could help me but It would be awesome if you could.
Go to the top of the page
 
+Quote Post
   
Ndoelicious
post Dec 1 2012, 03:51 PM
Post #186


Level 15
Group Icon

Group: Revolutionary
Posts: 282
Type: Mapper
RM Skill: Intermediate
Rev Points: 50




Is there a way to make the main character dots invisible on the map?


__________________________
One idiot is actually talk more than three geniuses combined!
-Patrick Star-

Go to the top of the page
 
+Quote Post
   
Geekman
post Feb 1 2013, 09:50 PM
Post #187


Level 4
Group Icon

Group: Member
Posts: 49
Type: Event Designer
RM Skill: Intermediate




Lovely script. Thanks. happy.gif
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Feb 7 2013, 05:47 AM
Post #188


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 916
Type: Scripter
RM Skill: Skilled
Rev Points: 120




@Geekman
You should not post brief sentences like that without any further comment, since they are irrelevant to the topic itself.
In this case, the topic was more than three months old, and this is called Necroposting.
You should post in old topics just to ask for support or give support to someone who asked for it.

Jens


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
Niixs
post Feb 13 2013, 04:16 AM
Post #189



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Beginner




How am i going to put the
mapinfo and name name of the map

using this script

[END] MINIMAP SCRIPT SETUP PART
#===========================================================================

def self.refresh
if $scene.is_a?(Scene_Map)
$scene.spriteset.minimap.refresh
end
end

def self.update_object
if $scene.is_a?(Scene_Map)
$scene.spriteset.minimap.update_object_list
end
end
end


and this part
#==============================================================================
# ¦ RPG::MapInfo
#==============================================================================
class RPG::MapInfo
def name
return @name.gsub(/\[.*\]/) { }
end

def original_name
return @name
end

def show_minimap?
return !@name.include?(MiniMap::TAG_NO_MINIMAP)
end
end

I'm little bit confuse pls help me out
Go to the top of the page
 
+Quote Post
   
Sorias
post Apr 13 2013, 07:31 AM
Post #190



Group Icon

Group: Member
Posts: 1
Type: Writer
RM Skill: Skilled




I copied and pasted this script into the right place and it says this when I start my game:

"unable to find Data/MapInfos.rvdata"

What does that mean?

I'm using VX Ace
Go to the top of the page
 
+Quote Post
   

10 Pages V  « < 8 9 10
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2013 - 10:35 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker