Vehicles loop?

I've added vehicle events in the red area, the highway (inaccessible by the Player), and I enabled the looping in the Scroll Type in the Map Properties.
The green area is where the Player is able to access and see a glimpse of the highway and the vehicles driving left and right.

But the vehicle events only happen once and don't show up again even when the "Through" is marked ON in the Event Options. Triggering them as "Parallel" doesn't do the trick either.

Maybe because the area is too large for the events to loop when they go too far away from the Player?
If so, is there another method to make this work?

123123.png
Hello again!

A lot of information is missing. It is not very easy to find out the real cause of the problem.

Did you do the test by creating a simple map with nothing, with just one npc in a fixed direction with horizontal loop enabled?

Try:
  • Use the CTRL key and go to the edge of the map to see if they actually stopped there.
  • Create the situation on an empty map.

Tip: never create anything complex directly in your project, or create a separate map or test project.

Good luck
Hi, @Dev_With_Coffee

Sorry if it's too dark, uploading longer gifs is not easy. I've made a small map to test this and here's what's happening:
The character jumps off out of center when walking a few steps, and the vehicles... well, it's like the events only operate at a smaller area around the character only.


gif 1.gif

321.png

4321.png

1111.png
I did the simulation:
Spoiler
RMMV-Loop_Horizontally.png

See the result:


My best guess is a plugin incompatibility.
I suggest creating a Script command in Motion Route, where an IF checks the coordinates of the event if it is at the end or beginning of the map and transfers it to the other end of the road.

Vehicles going to the right:
JavaScript:
if(this._x > 15){$gameMap.event(this._eventId).setPosition(0, this._y)}

Vehicles going left:
JavaScript:
if(this._x < 1){$gameMap.event(this._eventId).setPosition(16, this._x)}

Replace the number 15 with the size of the map width.

Good luck :LZSjoy:
@Dev_With_Coffee
The problem is still the same as shown earlier in the gif with or without the script. 🙁
I've tested it by turning off the plugins for Fullscreen and offed the 1920x1080 resolution, and the vehicles looped normally exactly the same as your simulation (but the lights were going off the Vehicle events, anyways).
I believe this is due to the functionality of the "loop" only running in a smaller area around the character while everything else (events and such) is still running off-screen as intended.

(The script shown in the screenshot is fully the same as you've provided it except that I did as told; to change the number "15" to the map width, mine is 17.)

132131.png
Sorry, did you remember to disable horizontal loop?
This Script is used to simulate looping on events, without affecting the map. It is equivalent to the Set Event Location... event command
Sorry, did you remember to disable horizontal loop?
This Script is used to simulate looping on events, without affecting the map. It is equivalent to the Set Event Location... event command

Yes, I disabled it just now. The vehicles are now looping on the northern highway on the main map, as I've learned how and when to set the numbers in the script that you provided.
Thanks a bunch for your help, Dev. 😀
Sorry if I wasn't clear before, but I thought the very fact that the code was inserted in the event route and not the map and the fact that the function has the same name as the event command.

Good luck!
Sorry if I wasn't clear before, but I thought the very fact that the code was inserted in the event route and not the map and the fact that the function has the same name as the event command.

Good luck!
Forgive me, I'm the one who's multi-tasking with my project and I get confused with what the heck I'm doing. But yes, I did place the code inside the event itself in the "Autonomous Movement" (event route), not as a command such as "Set Movement Route" - as far as I knew by doing some testing, placing the code as a command doesn't work. But it did work as an "Autonomous Movement".
placing the code as a command doesn't work
But the idea is precisely to use the route, because several events with parallel process would cause lag.

From my comment it is also understood that the video I posted was to show that the problem was Plugin incompatibility, the Script is explained later as an alternative solution to the Loop itself, since the idea is just to make the vehicles appear at the other end . That's why I found it very strange that you left the loop activated since the Script itself already does the loop function.

Precisely because the function name refers to the event command name, I didn't say to use it as an event command:
I suggest creating a Script command in Motion Route
But it's already been resolved, good luck on your project progress.
That's why I found it very strange that you left the loop activated since the Script itself already does the loop function.
I forgot to disable it. But it worked after I turned the loop off.
Precisely because the function name refers to the event command name, I didn't say to use it as an event command.
I know you didn't say that. Not saying you did. I just babble a lot. My apologies.

But thank you so much for your help.
I really needed it. 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/vehicles-loop.141985/