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.

Stupid transfer error ><

Alright, I have an error when I transfer the player...here is the scenario.

The player starts in a forest, goes through it and picks up an item, then continues through, then the player ends up at a village, then he gets talked to by a guard, then the guard leaves, and the map scrolls up and right a little to see something, then I transfer the player inside the house, and this is the error I get.

Error type: NoMethodError
Class: Scene_Map
Message: (eval):1:in `command_355'undefined method `y=' for #<Game_Player:0x3ab8350>

If someone could help me  with this, I will pay them $10000000000009 :D lol, j/k, I will just add you to the credits for helping me with the coding.
 
I can't tell you I know how that happens, but it looks like you chose a teleportation point and altered the map size afterwards, causing the target point being outside of the actual map y-wise -> double-check your teleportation event.

If it isn't that, it has to be a custom script, so please list what scripts you've got.
 
If you're trying to use a call script to set the players transfer coords, it's handled with the
$game_temp class, namely $game_temp.player_new_map_id, player_new_x, player_new_y.

Also, if you're trying to use a call script to move a player within the same map, its an even simpler call, just use $game_player.moveto(x, y)

Using a call script instead of a transfer player command though is redundant, if thats what you're doing. However, it can be great if you write it into a script.

Here's an example of how I do transfer player in my Debug script. This snippet is a method in which you can teleport to different maps from the Debug menu.

Code:
        if map_exist?(@new_map)
          Audio.se_play('Audio/SE/018-Teleport01', 100, 100)
          $game_screen.start_flash(Color.new(255, 255, 255, 160), 5)
          $game_map.setup(@new_map)
          $game_player.moveto(@new_x, @new_y)
          $game_player.straighten
          $game_map.update
          $game_map.autoplay
          $scene = Scene_Map.new
          Graphics.transition(20)
        else ; $game_system.se_play($data_system.buzzer_se)
        end

Hope that helped you out some, good luck :thumb:
 

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