How to make NPCs walk off the edge of the screen and pop back out the other end in a loop?

arcadekitten

Villager
Member
Joined
Feb 9, 2021
Messages
21
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hi everyone! This is my first time posting so I apologize if I put this in the wrong place or mess up or anything. I just wanted to know if it was possible to have NPCs walk off the edge of the screen and pop back out the other end in a loop? I'm not sure exactly how to describe it in words, so I drew some visuals of what I have in mind!

forum-loop npcs 1.png-forum-loop npcs 2.png-forum-loop npcs 3.png


I noticed this kind of effect in Pokemon games as well, like in Castelia City in Black & White!

6c0f9ffcce695562837ace778473dc0a.gif


I just wanted to know if it was possible to achieve an effect like this in RPGmaker(I use MV) as I think it would be really handy not just for my current project but for many future projects as well! It's not the end of the world if it can't be achieved, but I'd really like to be able to do it if it's possible. I am also not opposed to plugins if there's one that can help for this, but I'd prefer a plugin that I don't have to pay for. Thank you in advance !

Some other notes:

-I'd really like for the NPC to transfer seamlessly off the screen when looping back around(as if walking into an area you can't see), but it's not the end of the world to have them suddenly vanish at the end of the screen and then pop back at the start.

-The player doesn't need to be able to talk to these NPCs as they're just filler to make the area look busy and populated. They'll probably just walk through the player if anything.

-I only want the NPCs to be able to this loop. I don't want the player to be able to walk to the end of the screen and pop back out the other end like the NPCs do.

Thank you again!!
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
1,057
Reaction score
687
First Language
Polish
Primarily Uses
RMMV
It's really simple to do, especially if you don't need to make them talk to the player. Just make them go in one direction several times (9 for example, if map has 10 tiles) and them teleport to the other edge, make it parallel process and you're done. You can also make it more random by setting Y axis while teleporting to the edge, so they dont always pop up at the same place on the other edge of the screen-would be more natural. I can make a sample for you if you need too.
 

arcadekitten

Villager
Member
Joined
Feb 9, 2021
Messages
21
Reaction score
3
First Language
English
Primarily Uses
RMMV
It's really simple to do, especially if you don't need to make them talk to the player. Just make them go in one direction several times (9 for example, if map has 10 tiles) and them teleport to the other edge, make it parallel process and you're done. You can also make it more random by setting Y axis while teleporting to the edge, so they dont always pop up at the same place on the other edge of the screen-would be more natural. I can make a sample for you if you need too.
Hey thanks for responding!! Yeah, I figured I would have to do something with transfers, but I still wanted to check if anyone knew a way to make it look less choppy, etc. But I suppose transfers will still work for my current project! I never heard of being able to set the Y axis differently while transferring though! :o That sounds like it could be really helpful, could you show me a sample? And thank you so much for offering to!
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
1,057
Reaction score
687
First Language
Polish
Primarily Uses
RMMV
Sure! I'll make a sample for you in the evening.
 

arcadekitten

Villager
Member
Joined
Feb 9, 2021
Messages
21
Reaction score
3
First Language
English
Primarily Uses
RMMV
Oh, wow! It didn't load in until I restarted my RPGmaker, so I wasn't quite sure what you were talking about at first. But I see it now! Thank you so much for your help!
 

arcadekitten

Villager
Member
Joined
Feb 9, 2021
Messages
21
Reaction score
3
First Language
English
Primarily Uses
RMMV
Yeah, okay, so you can check the example of this.
Ah, I am encountering a problem now though...

On maps the same size as the example it works fine, but when I have bigger maps and try to increase the amount of times they move left or right, they don't seem to work as intended. They usually spawn back in the middle of the map and then they stop at the edge of the map after only having "cycled" once. I counted the amount of times I had them move and made sure it was at least one less than the tilecount of the map. I don't understand what the issue is. : (

I'm still a beginner at RPGmaker so I don't really know how this all works, but thank you for being patient with me!
 

arcadekitten

Villager
Member
Joined
Feb 9, 2021
Messages
21
Reaction score
3
First Language
English
Primarily Uses
RMMV
Ah, I am encountering a problem now though...

On maps the same size as the example it works fine, but when I have bigger maps and try to increase the amount of times they move left or right, they don't seem to work as intended. They usually spawn back in the middle of the map and then they stop at the edge of the map after only having "cycled" once. I counted the amount of times I had them move and made sure it was at least one less than the tilecount of the map. I don't understand what the issue is. : (

I'm still a beginner at RPGmaker so I don't really know how this all works, but thank you for being patient with me!
Wait, I think I figured it out! I forgot to change the constant in the upper right event used in the example! Haha, sorry if I was blowing up yours/anyone's notifications, but maybe if someone is having a similar problem to me, it'll help them remember things they can check!
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
1,057
Reaction score
687
First Language
Polish
Primarily Uses
RMMV
Yes If the map is bigger you need to change the coords for Y in that blank event in corner fo the map and modify the number of steps in the characters events. Glad you figured that out!
 

SpyreStudio

Veteran
Veteran
Joined
Aug 9, 2019
Messages
36
Reaction score
14
First Language
English
Primarily Uses
RMMV
Wait, I think I figured it out! I forgot to change the constant in the upper right event used in the example! Haha, sorry if I was blowing up yours/anyone's notifications, but maybe if someone is having a similar problem to me, it'll help them remember things they can check!
There may be an easier way to do this, but your entire map would be looped; if you don't mind that, then this works for you. If this is for a short scene or a small room or something, or even larger maps, you can do this pretty easily and it achieves the desired effect. You can always modify the mapping to kind of hide where they enter and exit anyways. Make it impossible for the player's view area to overlap with the boundaries of your map, say 5-10 squares out.


Set the Map Scroll type to horizontal, create a sprite and an event with a movement route of (Move Right [REPEAT]). Try that out and see how it feels. Otherwise, you'd just have to manually set each movement route specifically to that map. Or find some other workaround.
 

Latest Threads

Latest Posts

Latest Profile Posts

Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png

Forum statistics

Threads
117,171
Messages
1,105,124
Members
153,261
Latest member
balthubu
Top