Leaving the map on the left side

Hi People,

A complete noob over here. Just experimenting a bit with MV, not trying to produce a game or anything.
So address me as such, I won't be offended. ;-)

I was making a map with a street that goes from left to right. I was thinking it was an nice idea to have some cars drive trough that street with an interval. I had no problems moving a car from left to right and having it disappear from the edge of the map but the other way round was much more difficult. The car halts on the 0,9 and stays there.
Theoretical it should go to the -1,9 coordinate with "move left" but it seems impossible to go below zero.

Is there a solution that I'm not aware of or should I completely rethink the idea because of limitations in the MV engine?
I found some work-around. I defined the opacity in the movement script. So I turned the opacity to zero at the end of the movement and set it to 255 at the beginning.
This way the car disappears when it reaches the end of the map.

I keep thinking there should be a more eloquent way to move a car repeatedly (preferably random) from one side from the map to the other. But at least now it does more or less what I want. ;-)
I keep thinking there should be a more eloquent way to move a car repeatedly (preferably random)
Well, first, yes, as far as I am aware, you cannot use negative values for your map axis. However, you can just shift your map over. So for example, if you have a map that is 15x15, then make it 17x15.
There is likely a black tile in one of your tile sets, so for the added 2 tiles on the left side, make them black tiles. In your database, go to your tiles, and assign the black tile a star. Now the cars can pass underneath. The player will be able to as well. If you are brand new, I don't really recommend getting into using plugins just yet, but I suppose it's worth considering using Yanfly's Region Restrictions plugin (it's part of Yanfly's free plugin set). You can use region restrictions to set up event-pass regions (any event can pass through, but players can't), player-pass regions (the opposite; player can pass through but events cannot), and no-pass regions (nothing can move through the region - great for adding additional collision to maps)

As for having the cars come and go randomly, you can use variables that roll a number randomly. You can then set a conditional branch to set the rules for when they come and go. How the cars are drawn can be done in a few ways. In this example below, I would recommend creating a buffer on your map (so if your maps is 17x15, change it to 17x20) And place your different colored cars in this buffer. You can also use the Set Movement Route command and enable "Transparent ON". I would use a separate autorun event to set all your cars to transparent when the map is loaded (make sure to use the "erase event" or "exit event processing" on this separate auto-run event so it only happens when the map loads)
Here is the example logic for the randomizer:
(It's written in semi-laymens terms, sorry, I normally post screenshots for this kind of stuff, but don't have time)
roll RandomVariable from 0 - 60
If RandomVariable = 20
roll RandomVariable again 0 - 2 (or however many different colored cars your have)​
If RandomVariable = 0​
Set (blue car) location to the right side of the street​
If Random Variable = 1​
Set (green car) location to the right side of the street​
If RandomVariable = 2​
Set (red car) location to the right side of the street​

If RandomVariable = 40
(repeat the steps for "If RandomVariable = 20" but assign the car events to the left side instead)

wait 120

make sure it's in a parallel event.
Thank you for the input TheAM-Dol. I'll definitely give this a try.
As for the scripting, I think I'll figure this out. I have some earlier experience in programming but are a bit unsure how to implement this in RPG Maker MV. I'm much more familiar working with a dedicated scripting editor and not within a small and hard to edit screen.
As for the scripting,
Well, take it from me who is a complete dunce when it comes to real programming, the RPG Maker equivalent is dummy-safe and easy to implement.
Events contain your "scripts" (I'm sure you have already figured out how to create events, but just in case, press f6 on the keyboard and double click anywhere)
Inside the event, you will have your event's "code" or "script" on the right side. Double click anywhere in this space to add a new "event command" or in other words, a "line of code".
Page 1 mostly has your logic and operators such as variables, switches, and conditionals, loops, and labels. These are important for logic flow and will be used a lot. (among other things on Page 1 as well)
Page 2 has a lot of world interactions, such as movement, showing pictures, playing sounds
Page 3 has system controls, battle controls, and other things.
Spend a little time getting familiar with the stuff contained on these pages. From my own experience, they seemed to be laid out in logical order of frequency of use. Page 1 contains most frequently used items, Page 2 second most frequently used items, and page 3 least frequently used items (of course, that's pretty arbitrary and may depend on your game and/or workflow)
Here's a quick screen shot of an event that is using the random number thing like I talked about before. It's not the same code as I wrote above, but should give you an idea (if I remember, the day after tomorrow I can actually take the time to write an example event for you to copy and learn from)
Logic.PNG


(you'll notice the trigger is set to Action Button, but this event actually is meant to run as a Parallel event, I just temporarily disabled it by setting it as an Action Button and forgot to change it back before the screen shot :LZSlol:)
There is likely a black tile in one of your tile sets, so for the added 2 tiles on the left side, make them black tiles. In your database, go to your tiles, and assign the black tile a star. Now the cars can pass underneath. The player will be able to as well.
If you just not put any tile there the tile will still be rendered as black if you don't have a parallax background set. Then the player also cannot walk there.
Your events should be able to go there though. At least if you set them to through just before you have them walking "off" the map. And remember to set them back to through off when they reenter the map. Otherwise the player can walk right through them.
the RPG Maker equivalent is dummy-safe and easy to implement

I understand what you are trying to say. But for me it's the restrainment of the menu-driven way of programming that gives me an uneasy feeling. I'm used to opening files and editing the code directly.
But I see advantages. 🙂

Thanks again for the examples and helping me solve my "riddle".
If you just not put any tile there the tile will still be rendered as black
Thank you for pointing this out.
I will give this a try also.. All in the process of learning. ;-)

Up front I would say I don't like a black border around my map but I can't really say without giving it a try so I definitely will.

Thanks again for your advice!
Hello janneman63, regarding the use of tiles and such, I have a full lesson about map making on my game-tutorial project Learn RPG Maker MV (from my signature).

To achieve the desired effect of cars leaving the map is easy both the way @TheAM-Dol suggests and with pictures (you can move them off the screen).

I explain the basics about maps creation and in the Database lesson, I also cover the topic about tileset configuration and management, and I also have a lot of examples made with pictures on this project.

You can play it directly on your browser (or support it to have access to the source files)

I hope it to be useful for you! 😉
Hi CleanWater,

I have a full lesson about map making on my game-tutorial project Learn RPG Maker MV (from my signature)

Thank you for you contribution. I did gave your tutorial a look and I really liked the idea of a game as a tutorial. I've gone through the first few lessons and I will be back for more. Perhaps even pay you for the source code (and the effort) just to get a peek under the hood for some of the techniques. ;-)
I'm glad to know that!

It's this kind of feedback that gives me motivation to keep going on with my work! 😀

Perhaps even pay you for the source code (and the effort) just to get a peek under the hood for some of the techniques. ;-)

I guarantee you will love to check these source files! There's a lot of neat stuff there! 😉

Original thread: https://forums.rpgmakerweb.com/threads/leaving-the-map-on-the-left-side.150862/