Events' position resets when Ieaving map

karinthefox

Villager
Member
Joined
Apr 13, 2019
Messages
26
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
Hello everyone! I have some trouble and can't figure it out... Would really appreciate it if someone could help me ;__;

During a certain cutscene-event (when it's about to finish) in my game, the NPCs change position. The problem is that, when I leave the map and return, the map resets everything to how it was when the cutscene (that should have ended by now) started. I did the self-switch thing where I turn the event off but, for some reason, it's not working. Could it have to do with the NPCs moving places?

Here are some screenshots of the events too:
 

Attachments

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
RPG Maker by default does that, and am sure many other engines do so. It's because none of the maps work in the background. I have a similar problem but I found some ways around, however they are tedious for me to do for now, but will test them sooner or later. Anyways, in order to preserve the events' locations, I would advise you to look for Yanfly's Remember Event Location plugin. After you put it in your game, the help file tells you how to use the plugin prompt to have the map (any maps you wish) remember the event locations, so when you come back, the characters are found in the last known location they were BEFORE you moved away.

Another way would be through another plugin, whose name I don't remember and I am not home to see the name. Basically, it allows you to run a Common Event before anything else would run on the map, even Parallel Events (today I found out about it from a fellow helping me with some ideas), and you can have your events be teleported to the positions they should be at when moving back to the map that starts the cutscene. Also, switches also reset, so make sure you assign your cutscene event a variable. Then add a conditional to it to trigger only while that variable is 0, and anywhere in the cutscene's lines that go set that variable to 1 or any other value (variables don't reset or change their values when changing maps). This will make sure if player returns to that map they will not see the intro again (or the mentioned cutscene). Hugs, you are loved and appreciated >:D<
 

MushroomCake28

KAMO Studio
Moderator
Joined
Nov 18, 2015
Messages
2,209
Reaction score
3,577
First Language
English
Primarily Uses
RMMV
That's how the engine loads map. By activating a self switch all you're doing is changing the active page on the event, you're doing nothing to keep it's position.
 

karinthefox

Villager
Member
Joined
Apr 13, 2019
Messages
26
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
RPG Maker by default does that, and am sure many other engines do so. It's because none of the maps work in the background. I have a similar problem but I found some ways around, however they are tedious for me to do for now, but will test them sooner or later. Anyways, in order to preserve the events' locations, I would advise you to look for Yanfly's Remember Event Location plugin. After you put it in your game, the help file tells you how to use the plugin prompt to have the map (any maps you wish) remember the event locations, so when you come back, the characters are found in the last known location they were BEFORE you moved away.

Another way would be through another plugin, whose name I don't remember and I am not home to see the name. Basically, it allows you to run a Common Event before anything else would run on the map, even Parallel Events (today I found out about it from a fellow helping me with some ideas), and you can have your events be teleported to the positions they should be at when moving back to the map that starts the cutscene. Also, switches also reset, so make sure you assign your cutscene event a variable. Then add a conditional to it to trigger only while that variable is 0, and anywhere in the cutscene's lines that go set that variable to 1 or any other value (variables don't reset or change their values when changing maps). This will make sure if player returns to that map they will not see the intro again (or the mentioned cutscene). Hugs, you are loved and appreciated >:D<
Hello!

In the end, I made a new map to solve the problem. For some reason the Remember Event Location didn't work on all events :LZSsad:. Still, I kept the Yanfly plugin just in case 'cause I'll probably need it for something else.

Thank you so much for your suggestions!
 

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
Did you use the tag Remember Events? You put that in the Map Notes area for all events to be remembered. Or you put the Remember Event tag within each of the events you need to remember positions for. It should work. It did for me.

You could also use that positioning event as a Parallel Event that runs only once (conditional with a variable as I said before). You could also try Event On Transfer by Ossra, which allows the user to set an event to trigger BEFORE any other event on the map, see how it works (I didn't use it yet) and hope it works (transfer the function of that Action Button event, or set it to Parallel as I said and make it be triggered by that plugin) - you can find Ossra in this other post of mine, expand their SPOILER part and look for Event On Transfer link:

you can find them in this other post of mine, then expand that SPOILER part

Hugs!
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
I have never heard of it not working before. Are you sure you used it correctly?

I also have a Remember Event Position plugin.

If you are going to create duplicate maps just so you have events in different positions, that's a WHOLE lot of extra effort you'll go to, and will introduce other problems - self switches become meaningless because you turn a self switch on on map 1, then send them to map 2 later which is an almost-clone, and the self switch is not turned on for the corresponding event on that map.

I strongly suggest you find out why it wasn't working, and fix that. Your workaround will cause you much grief down the track.
 

karinthefox

Villager
Member
Joined
Apr 13, 2019
Messages
26
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
I have never heard of it not working before. Are you sure you used it correctly?

I also have a Remember Event Position plugin.

If you are going to create duplicate maps just so you have events in different positions, that's a WHOLE lot of extra effort you'll go to, and will introduce other problems - self switches become meaningless because you turn a self switch on on map 1, then send them to map 2 later which is an almost-clone, and the self switch is not turned on for the corresponding event on that map.

I strongly suggest you find out why it wasn't working, and fix that. Your workaround will cause you much grief down the track.
I'm not sure why it wasn't working either. But I tried everything that was suggested and yet the Remember Event Position plugin didn't work (and I tried it on every single one of the NPCs but only one of them moved to the correct spot). I also tried using the plugin on the map itself but it only remembered the "first position" and not the second one (which was the one I wanted it to remember).

I have other maps with more than one cutscene but only this one brought me trouble because I changed NPCs positions.
 

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
If you have same, or similar events to use on different maps I would advise you to use Event Copy plugin from Yanfly. It allows you to create events that you replicate on other maps, and when you need to change them you change the main event in the dummy map (player doesn't access this map anyways). Much easier since I've been using it. You sure you put the tags correctly? Sometimes the descriptions can be confusing. Now, those events you are using, how do they work? Are they Parallel Events? Cause if not they will not move without interaction. I would need a bit more details to see where I can help you improve ^^
 

karinthefox

Villager
Member
Joined
Apr 13, 2019
Messages
26
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
If you have same, or similar events to use on different maps I would advise you to use Event Copy plugin from Yanfly. It allows you to create events that you replicate on other maps, and when you need to change them you change the main event in the dummy map (player doesn't access this map anyways). Much easier since I've been using it. You sure you put the tags correctly? Sometimes the descriptions can be confusing. Now, those events you are using, how do they work? Are they Parallel Events? Cause if not they will not move without interaction. I would need a bit more details to see where I can help you improve ^^
Oh! I didn't know about the Event Copy plugin, that certainly seems useful! I'll be sure to download it, it'll come in handy!

As for the tags, I wrote <Save Event Location> on the notes, just like Yanfly's tutorial says. I tried it on the map's notes first, but it didn't work. Then I tried it directly on the events' notes, but it didn't work either. As for the NPC events themselves, I have them on Action button since the player needs to talk to them once they have changed their position.

Thank you so much for helping me, you're such a sweetheart ;__; I'm still relatively new to RPG Maker so there are many things I sometimes find quite tricky.

I attached some more screenshots. I'm using NPC6 as an example; basically, almost every single NPC (and character) moves or changes the direction they're looking at. Also, all of them (except for the green character in the middle, Angis, and the blue haired one next to him; who should disappear from the scene when I return to the map) have dialogue that's available once the cutscene ends and the player goes talk to them. I didn't put a self-switch on them because it's a dialogue that the player can read as many times as they want (like a standard NPC dialogue).

I'm sorry if my explanations of the problem are not clear. Please, tell me if it's too confusing >__<
 

Attachments

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
Okay, so... as of what I see, and based on my experience with intricate stuff, it should be really easy to create what you'd want. So, events other than Parallel/ Autorun won't do anything on their own because they can't. In order for them to work they need "player-validation" (like interacting with them), most likely that is why they won't be doing anything.

Regarding the plugin, there are 2 functions if I remember correctly, and remember this: tags are put as Comment only, one single line OR as a notetag, I read the description, it says notetag so you placed them correctly. Try giving each of your events a switch and make them Parallel instead. Parallel and Autorun events are the same situation, except Autorun prevents any action from the player (good for intros) - there is also a glitch I noted by mistakes: in any other type of event, when you have Wait functions, during those times of waiting, if you click on the map, your character can actually dash (rapidly move there) even if normally they shouldn't. So I put my Visual Novel-like events as Autorun, and each of them handles the teleportation of the events where they should be at the beginning. Now, Parallel and Autorun events repeat endlessly (they themselves are loops - don't use them with timers, will never work!) so you need to end them by turning their switch off. When you turn on (self )switches you first turn it on, and then end the switch of the current event (closing event's switch should be the last line). So, I would say: create a copy of your map (to preserve your current effort, that's what I do, and then copy-paste back the events that work, while also at times, preserving an old copy of the events I worked a lot on, maybe a plugin no longer works, or I come up with an idea that might need them again - that is why I have "trash maps" XD - oh, and also test maps). In that map:

<> I see the player enters the room so am guessing they are ported to a different map. Something which I am somewhat against, and I would not advise beginners to do, since I've had a lot of fuss with these, and still, after 1300 hours, MV still surprises me with stuff :D
<> create a Parallel/ Autorun event that will handle everything for the player (events' moving - this will be somewhat tricky, but I can help you with this if this sounds tempting).
<> if you don't want an event to move the other events around (takes practice to make it appear natural), set each event in turn as a parallel event that will just do their stuff (move around as needed) when the player comes in the map. And the events move to their locations.
<> Now what? A few things I can say, depending on what you'd need. If you check that Event On Movement plugin I previously told you about, you should be able to set this out correctly.
<> I don't know exactly what you'd want: I understand the NPCs will go to their positions, BUT - is this supposed to happen just once? Or every time the player gets in?
- if answer is 1, then... you could do this :) Until the characters reach their end positions (which should be a couple of seconds), the player cannot leave the map (a few seconds of wait ain't much, and most probably the player will wonder around, instead of being a grinchy tester like me who likes finding the exploits (like I do with my game)). How do I set this up? Well, each character will move with a Movement Route most probably, and Wait as default selected. If they are Parallel events they will move around, allowing the player to also freely move (interacting with Parallel events can be tricky to make - will cover this soon) - while if your characters are Autorun, they won't ever allow the player to move until they end (and they loop indefinitely, like Parallel events, that's why I said about switches, but never make characters into Autorun events, unless you want them to be the intro themselves, or so). What then? Simple! When the characters reach their end location, you turn self switch A on and turn their switch off. Self Switch A page will be Action Button/ Player Touch, so the player can easily interact with them (Interacting with Parallel Events is possible but takes some time to settle, it's variable based, and their values change a lot depending on movement, and parallel events can run even 10 - 20 times per second, or far more - it will make an imbarable lag with so many doing all these calculations at once (if 1 or 2, that's okay, tested it - am looking to create the most INTRICATE RPG/ Visual Novel game ever in RPG Maker MV - I love complexity). Also, before starting the self-switch for each event, you set a different variable (one for each of your characters) to 1, or open another switch, that will signal their arrival on their location. On the door event (so the player can leave) put a conditional in conditional so that when each of the characters has opened that own switch of theirs, the player can leave. And I also covered number 2 situation, cause when the player comes back, things should reset (if you chose the switch). If you chose to set a variable instead for each, then... variables don't reset with map change, so, when the player wants to leave, the conditionals say all the variables are 1, so the player can safely leave ^^ Depending on whther you want this to happen, you gotch yourself this way a repetitive map that will act this way each time.

<> STILL: all nice and shiny, but where did my characters go? Why's the room empty? Forgot I told you to make those characters Parallel Events? And that they need a switchie to trigger them, then to turn it off (so they don't keep repeating their movements on end - also, preferably use the Set Movement Route on Event page 2 instead of Custom Movement on Parallel Events (I don't remember why, but I don't trust the two to behave normally, and really don't want to test that again, at least for now). What's missing is that you have to turn on the switches of those events :) so they can actually do their thingy. So you have 2 stairs: spawn the player up and put a Player Touch/ Event Touch (a lil' difference between the two, but not critical) that will open up the switches of each character. Hopefully I didn't miss anything XD
 
Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,334
Reaction score
326
First Language
German
Primarily Uses
RMMV
I have a alternative Workaround for NPC which are not moving around the Map after Cutscene.
- After the Cutscene, when all NPC are on new Positions, Turn ON a Switch.
- Use that Switch for a new Eventpage in every single NPC.
- Now put the following in the "Autonomous Moveroute" of the NPCs Eventpage, use Script in there.
Code:
$gameMap.events()[ this._eventId - 1 ].setPosition( X, Y );
instead of X and Y you insert the Numbers for the Mapcoordinate.
Code:
$gameMap.events()[ this._eventId - 1 ].setPosition( 3, 7 );
- Than Turn command for the direction you want the NPC to face. Do NOT mark Repeat.
- On the Eventpage, change Frequency to maximum, else it could take a second before the NPC is on new location after entering the map.

Using a new Map like you did, seems to be the best solution in this case.
I use the shown above for smal stuff, bigger stuff would increase the workload dramatically, and its not very flexible.

Maybe still usefull.


Edit: If Events are far outside the visible screen, it could happen that they do not execute their standard moveroute and therfor the NPC does not appear on correct Position until Player comes near it. Just something to keep an eye on , most easy workarounds got their downsides or limitations in flexibility. Thats why the remeber Event Position Script/Plugin could be very useful.

EDIT2: I OVERCOMPLICATED AGAIN.
After Cutscene, Turn a Switch On.
Use that Switch as Pagecondition for a Parallel Event.
Set Every Eventposition and direction manualy with Eventcommand SET EVENT LOCATION
Than use Eventcommand ERASE EVENT.

Thatway the Event runs one Time, each Time the Map is entered.
 
Last edited:

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
That's a good idea, but might seem a lot for a beginner :) Not that my walltext post would be easier to gorge, but I think it would be easier for beginners ^^ Though it can work :) And if it works, it's good. But all in due time. Hugs!
 

karinthefox

Villager
Member
Joined
Apr 13, 2019
Messages
26
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
Okay, so... I tried to do that thing with the NPCs being set to parallel events on the first page and then have action button on the second page together with a variable constant set to 1. I also tried it with only switches... same problem. At least now the characters in the middle (the one with green hair and blue hair) are gone, and the NPCs are all looking in the right direction but the final positions are still wrong. What I want is for the NPCs to remain in their new final position forever (every time the player moves from this map to another and then returns, the NPCs should stay in the same NEW position).

The more stuff I try, the more confused I get...

EDIT: I solved it!! There were 3 things I was missing.

1) I had to put the "Set Even Location" of the NPCs on their first event page, before turning on the self-switch.

2) All the NPC events needed to have the "<Save Event Location>" thingie.

3) The variable conditional on the second page of each NPC event had to be done on the "Contents" window instead of ticking the box on the "Conditions" windows. This is because I was already ticking the Self-Switch box and it seems you can't tick 2 boxes at the same time (or at least it didn't work when I did it that way).

Thank you everyone for all your help and suggestions!! Especially Annwfn, thank you so much!! *hugs* :LZSsmile:
 

Attachments

Last edited:
  • Like
Reactions: Bex

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
One thing I would advise beginners to do is start with a big, like BIGGEST possible map ever :D But, let's say you want to start with a 100x 100 map.
<>The largest size is 250x250 which I am dealing with in my current Chapter of the game.
<> When you increase the size of the map (say from 100x100 to 250x250) the size will always increase rightwards for X and downwards for Y directions respectively. That being said, always start from the left corner and expand slowly until you fill the space. Need more space? Expand the map a bit more.

<> When making the map smaller, it will decrease in size the opposite way: leftwards for X and upwards for Y (keep this in mind, because if you want to add pictures in your game, the location on the screen will use this same principle - ask me on that if you need, I have been using different software's pictures in my game for a few months now).

<> Why a huge map? Well... simple. You create small little "maps" on the big one, leaving blank spaces in between. You'll have to test it out to see how much the player can move around each possible "map" until another part can be seen (which you'd prefer not to allow). In the picture below I set an example from my game, from a Chapter I will work on some other time. Those are some house interiors. The upper two have 14 black squares in between them (counted them now, not when I did them) so the player will not see even the edges of the other ones. Similarly, you can create the rooms and different environments on the same map, and just teleport the player from one to another (with or without that "black screen" option that is ticked by default, which I can say you can leave there - or set it to white instead for a lil' extra feel when "porting the player back in time"). Why would this be helpful? Well, no more map switching for this part, and you can make an entire "chapter" this way, only porting the player away from the map when the chapter is done and the player really has no more need of this map. Therefore, you get beyond events' resetting (variables don't reset on map change).

<> If you want your characters to remain in that fixed position forever, it's easy. Did you use the plugin from Ossra? It will help. First time when the player gets on the map you have the characters move around. Learn how to use the plugin's commands and use it for its ability: create an event that will trigger BEFORE each other events on your maps. What you do is simple (now that I have a clear vision of your ideas ^^):
<> --- <> 1. create a conditional for your Parallel Event characters. Add an Else branch also.
<> --- <> 2. Add a variable to that conditional for each of the characters.
<> --- <> 3. Conditional will trigger only if current character's variable is 0. It results in the characters doing their movement, and switching to the A self-switch. Now what?
<> --- <> 4. Set each of those variables to 1 (so conditional won't trigger anymore).
"Wouldn't that disable the self-switch also??"
<> Good question, though you don't put self switch A ON and Event Switch OFF in the conditional ;) So they are read by the system regardless of the conditional being triggered or not.
<> --- <> 5. Now the magical "Else": add a conditional if "same event variable" is >=1 then teleport this character to the magical locale they will be pinned to. Forever.
<> It would be advisable to make it that the player won't be able to leave the map until the events can trigger that variable to 1, else they will keep repeating (though I doubt players will just reset maps, unless they are some maniacal exploit-huntin' tester like I prefer being).
<> If they trigger their variables to 1 they will be pinned to their location (don't forget to also set their DIRECTION in the teleport event to location panel!). However, they will still be teleported there through their own Else branch. If by any reason it won't look visually pleasing (the player can see it), there are 3 ways around this:
I. use Ossra's plugin and put the conditional in the else branches inside the event that you designate to use with Ossra's plugin functionality. You can safely delete the Else branches afterwards.
II. the easiest way to avoid the player seeing this is to "cheat" a bit. When the player teleports there you use the Fade Out function to make the screen entirely black (hides pictures you may have added on the screen, but even in Fade Out writing can be seen - I mean text boxes, so you can use this with intro events). Now, you can add a Wait 90 or 120 frames (1second and a half/ 2 seconds) then use the magical Fade In screen so that you restore visibility :) The teleport function is before - teleport fade out, wait fade in. Events will continue their functionality even if you teleport the player to another map. When they end, they won't trigger again, cause they on another map. What this specifically does is simple: teleport to player, wait then regain sight. Why this? So the player does not see your events being teleported if they load too fast. And the events being parallel they will do their code lines without taking into account the wait the player has to wait. 1 second and a half won't be that much of a wait anyways, probably just a "spiky load or something" - might give the impression the game is loading some stuff in the background XD
III. Honestly the EASIEST way around this is to set yourself a big map. As I said above. No more map switching results in no more need to do so many switches to preserve characters' locations. They will stay pinned there even when the player is on the other locales, and the switches will apply over the entire map, so if you need to go to event A in a "map" then to tell B in another "map" it's easily possible now, because switches are per map, and you basically have a big map. With small, different maps you end up with A saying "Speak to B", you switch maps and B will be like "Who the fudge is A, I don't know any A". Carrying event functionality is easy to do from one map to another, with giving player an item, or setting a variable, and setting the event on the other map with a conditional based on the new value. So... did you speak to A in map 1? No? My variable is 0, so... "You haven't spoken with A... You liar..." Oh, you really spoke with A? Then variable set to 1 (or you can increment it for a fun fact). Player goes to B and ... use this: Show text "Oh, so you spoke with A \v[variable id] times before? Oh... \|\| Good!" Then add the other functionalities. Now, before I end this little wall post, \v[x] is a function you can add in a Text box so the system reads the value of the variable with that id. So if I have a variable that counts how many times player did something I just increment a variable that counts how many times the player runs an event (basically, that's what it is). So I will have an NPC say "You have done this \v[23] times!" - which will read the value of variable id 23 (you don't put the 0s in front of it). The \| is a text function that says "wait 1 second before showing next text". I abuse this to make text flow more natural, but I wouldn't advise you to do it if you don't feel like it.

Now, last tip: When drawing maps - you can hold right click while having Map button selected (not events button). Then you can select as much as you want from the map. Go somewhere blank in the map and click :) It will copy your selection there. Use it in case you need to replicate portions of map. Like for rooms, before setting the individual pieces of furniture, like in hotels, rooms have same size, but won't necessarily look the same. They do look the same in your case? Cool, Use this option after you've made a first map. Also use the other draw functions afterwards: Pencil instantly pastes your selection, the rectangle will draw it from down upwards (starting from the corner near your cursor, that's how you insert you paste option, a bit trickier to master, but it's good if you need only part of the selection and you control how much), circle does the same but in a "rectangular circle" way that looks too awkward for me to actually use. The paintbrush fills all the tiles of same type with the new selection (don't use it with selections, funny results. Instead change a tile with another: no longer want a red carpet tile in the room? Select the other color (just 1 tile, as you normally do), press the paintbrush and click on the red carpet. Magical change. NOTE: doing this won't change tiles that have "partial" furniture on. By "partial" I mean tables and other pieces that still show the tile below them (they are basically put one over the other)).
 

Attachments

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,334
Reaction score
326
First Language
German
Primarily Uses
RMMV
@Annwfn
Switches are not per Map, Switches and Variables are Global (That means for the whole Game for every Map)
If you turn Switch1 On on Map1 than that Switch is On, no matter on which Map you are or which Event it uses it as condition.

But each Event ID got its own set of Self Switches, which only count for that Event (But with Scriptlines its even possible that Event1 can change the state of Event2's Self Switches or uses them for a Condition but thats another topic).
 

Annwfn

Villager
Member
Joined
Nov 6, 2019
Messages
29
Reaction score
4
First Language
Romanian
Primarily Uses
RMMV
What do you mean? Writing a switch in the box leaves it there. If you assign a switch to an event and turn it on through an event and leave map and return, it'll reset itself. It used to happen... Now I tested it and it actually works! Thanks for telling me that! Hugs >:D<
 
  • Like
Reactions: Bex

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Please don't create long, boring cutscenes in which characters do nothing but stand around talking.
What if I took a lesson from Half Minute Hero? Let the player get dumb powerful each area, but reset them down to just slightly stronger than before for the next map?
Been averaging 2-3 hours sleep for almost a month now. Starting to space out all the time ^^;
loopk wrote on whtdragon's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.
loopk wrote on Avery's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.

Forum statistics

Threads
94,257
Messages
919,451
Members
123,972
Latest member
FeriMyi
Top