Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Map name on teleport

I've seen this before, but like usual i lost it and thought i didn't need it... but it seems like it will help...

ex : your walking to the left and see the exit point to the next map...
-you touch the exit point
-screen fades to black
---" Lake of Horror"
-Screen fades to the map
---"Lakes of Hooro" Fades...
-you motivate where ever you please...

I want it to say the map name as i go to the next map and vice versa...

can someone help me... and i know im asking alot lately... but it just helps me out... thanks guys ;) :thumb:
 
You can do that with events.

You will need to draw out all the map names as pictures (you would need to do that, anyway, with a script). Then, at every transfer point, just fade the screen to black, show the picture (map name), then transfer the player and fade back in.
 
Try this out...

I created this Location_Window class to display on the main menu, but it should work for your case as well.

Add the following class in the Window_ section

Code:
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This window displays current location on the menu screen.
#==============================================================================

class Window_Location < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
#
# I named my maps like: "Tun Tavern 023"
# to keep the map file number in the name
# so I added these 4 lines to remove the last 4 characters
# from the name.
#    mapname = $data_map_infos[$game_map.map_id].name
#    text_width = mapname.size
#    text_width -= 4
#    short_name = mapname.slice(0,text_width)
#
# To use the shortened name, replace the following line with
#
#    self.contents.draw_text(4, 0, 120, 32, short_name)
#
    self.contents.draw_text(4, 0, 120, 32, $data_map_infos[$game_map.map_id].name)
  end
end

Then modify the transfer_player method in Scene_map

Code:
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Make Location window             # MOD FROM HERE
      @location_window = Window_Location.new
      @location_window.x = 240
      @location_window.y = 208
      @location_window.opacity = 0
      @location_window.back_opacity = 0
      # Execute transition
      Graphics.transition(80)
      @location_window.dispose           # TO HERE
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
  end
end

That should be close to what you're looking for.

Be Well
 
I just used your script brewmeister and it gives me the error that reads this

'Window_Location' 27 No Method error
undifined method '[]' for nil: NilClass

and everything is filled in... the onlything i got with that is the $game_map.map_id in that position... whats wrong???
 
one more minor problem... seems like all else is working grand...

the font isn't showing.... no text what so ever... just the box...

makes me sad... but still... can you fix this minor bug...:thumb:
 
Hmmmmmm....... (that's me thinking!)

I assume you changed the '..opacity' settings, otherwise
you wouldn't see the window.

In 'Window_Location', try setting
self.contents.font.color = system_color
to
self.contents.font.color = normal_color

It may be conflicting with another script... ???

Or, it could be trying to use a font that you don't have.
(only if another script overwrites Window_Base)

If that doesn't do it, can you post your scripts.rxdata file?

Be Well
 
Okay here it is...

Transfer player fix
Code:
 #--------------------------------------------------------------------------
   def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Make Location window             # MOD FROM HERE
      @location_window = Window_Location.new
      @location_window.x = 240
      @location_window.y = 208
      @location_window.opacity = 225
      @location_window.back_opacity = 225
      # Execute transition
      Graphics.transition(80)
      @location_window.dispose           # TO HERE
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
  end
end

and here is the window location script

Code:
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This window displays current location on the menu screen.
#==============================================================================

class Window_Location < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
#
# I named my maps like: "Tun Tavern 023"
# to keep the map file number in the name
# so I added these 4 lines to remove the last 4 characters
# from the name.
    mapname = $data_map_infos[$game_map.map_id].name
    text_width = mapname.size
    text_width -= 4
    short_name = mapname.slice(0,text_width)
#
# To use the Long name, replace the following line with
#
#    self.contents.draw_text(4, 0, 120, 32, $data_map_infos[$game_map.map_id].name)
#
    self.contents.draw_text(4, 0, 120, 32, short_name)
  end
end

this is how i have it setup in my game

scene_menu
...blah...
||||||||
...blah...
Window_Location
Main
 
I guess the 'normal_color' didn't work.

What I meant was: post the 'scripts.rxdata' file from your 'data' folder in your game. (so I can look to see if there are
any other scripts conflicting with these.)
 
Color.new(255,255,255,255) instead then? Maybe normal_color ain't working?
Anyhow, you could try typing the following line in Window_Location, right before the text drawing takes place:
Code:
p short_name
If that brings up an empty windows box, you ought to know that something's wrong. That might not be the script, I don't think it is, because it worked just fine for me.
 
HAHa!

I just had a tad bit more editing... lol...
but anyway thanks guys...
i got it to work

well anyway it does work... but is there a script code to make it fade to black so the next map isn't shown while the text is???

if not don't worry about this... and

do you want credit... if so... please give me the name you want to use and any additional information...:thumb: :thumb: :thumb:
 
Well, at least my scripts don't interfere with it (I remember I didn't edit anything in Window_Base class except for draw_item_name method, but I "aliased" it anyway) ^_^

$fontface and $fontsize only occur in illegal version of RMXP, although under some rare conditions you may do so in legal RMXP. This forum doesn't tolerate illegal RMXP FYI.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top