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.

Found wrap maps script - how to make work with 'move event'?

I'm trying to set up a scene where the characters are going down a long corridor, speaking with each other. I've got a parallel process event driving the characters forward one 'move left' at a time. The problem is that I don't know how long the player will want to leave the text on the screen, so I thought I'd try to wrap the map left/right to keep the characters going instead of having them stop at the X=0 point.

I did manage to find a map wrapping script online, but I'm still running into the 'stop at X=0' problem - when moving the characters manually, they can cross the left/right boundary with no problem, but the move event command doesn't process across it, presumably because it's still treating the 'X-1' motion as an invalid value.

Below is the code I believe covers the left/right motion at the left edge of the map - what changes do I need to make to this to permit it to allow a move event command to carry the player, or another sprite, across that boundary?
Code:
   def refresh_left

     unless $game_temp.outside_array[$game_map.map_id]

     else

       if $game_player.real_x == 0

         if Input.press?(Input::LEFT)

           def $game_player.passable?(x, y, d)

             return true

           end

           @left_trigger = true

         end

       end

     end

   end

 
 

Ares

Member

I took a quick look at this, and I think the problem is in the fact that the snippet you posted only lets the player walk on the connected map if he is pressing the left key.
If you post the whole map wrapping script I could take a look and try to find a workaround to make it work with the 'move route' event command.
 

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