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.

transfer player {xp} help please

so im making a option in the menu that allows one to travel from place to place, what i need to know is what is the correct way to transfer player in the script, what i mean is i know that there is "trasfer_player" in scene_map, but how would i go about calling it and making the player go to where ever i want. here is some screenies if that helps.
http://i37.tinypic.com/347hhcm.jpg[/img]
http://i33.tinypic.com/rw01oz.jpg[/img]

i will love who ever helps me, and i will add them to my list of very helpful people in my credits :)
 
Take a look at Interpreter 5, command_201   (look at Interpreter 2 to determine which event command is referenced by command_###)

The bits you need are:

Code:
    # Set transferring player flag
    $game_temp.player_transferring = true
    # appointment method is [direct appointment]
    # Set player move destination
    $game_temp.player_new_map_id = @parameters[1]
    $game_temp.player_new_x = @parameters[2]
    $game_temp.player_new_y = @parameters[3]
    $game_temp.player_new_direction = @parameters[4]

    # If fade is set.     If you want to use 'fade'
    # Prepare for transition
    Graphics.freeze
    # Set transition processing flag
    $game_temp.transition_processing = true
    $game_temp.transition_name = ""

Of course, change @parameters[1-4] to integer values for: map_id, x, y, facing.
You can also include a transition name if you want to use a special transition for 'magic' travel.

Be Well
 
thanks, but i tried that, it didnt work, i dont know if it is me or what here is what i have done so far:
Code:
#==============================================================================
# ** Scene_Travel
#------------------------------------------------------------------------------
#  This class performs travel screen processing.
#==============================================================================

class Scene_Travel
  def main
    # Make command window
    s1 = "Sa'ar"
    s2 = "Capital City"
    s3 = "Cancel"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame Update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of window
    @command_window.dispose
  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  
        command_to_Saar
      when 1  
        command_capital
      when 2  
        command_cancel
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [To saar] Command
  #--------------------------------------------------------------------------
  def command_to_Saar
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
        # Set transferring player flag
    $game_temp.player_transferring = true
    # appointment method is [direct appointment]
    # Set player move destination
    $game_temp.player_new_map_id = 8
    $game_temp.player_new_x = 55
    $game_temp.player_new_y = 42
    $game_temp.player_new_direction = 2

    # If fade is set.     If you want to use 'fade'
    # Prepare for transition
    Graphics.freeze
    # Set transition processing flag
    $game_temp.transition_processing = true
    $game_temp.transition_name = ""
    end
  #--------------------------------------------------------------------------
  # * Process When Choosing [to capital] Command
  #--------------------------------------------------------------------------
  def command_capital
   
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to menu screen
    $scene = Scene_Map.new
  end

end
p.s. thanks so much for the help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
When you say it doesn't work, what do you mean? Does it give you an error message? I, currently, can't check, but I think you need to be in Scene_Map for the transfer to work; I could be wrong. I'll take a better look when I get home from work:)
 
This should work as is. Although it won't transfer until you exit the menu.

Add

    $scene = Scene_Map.new

to the end of the command_to_Saar method.  (and add a 'end' statement to the 'main' method)

Be Well
 

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