[RM2K3] TRANSFER PLAYER SHOWS PREVIOUS MAP BEFORE MOVING PLAYER?

Posts

Pages: 1
Hey there! I have some issues with a custom menu I'm making in RM2k3 (steam edition). I never had issues with this before steam, but all of a sudden rpg maker doesn't want to work with me?

I disabled the menu, and assigned the X key as a "exit custom menu" button. What the event is supposed to do is teleport the player from the menu map back to the target map, and it sort of does. However, instead of doing it seamlessly, the game will hide and show the screen of the menu, before actually teleporting the player. What's annoying is that I'm using almost the same programming I used for the player to access the menu in the first place!

Here's a gif of the bug:


Here's the programming I used to enter the menu map:


And here's the exit programming that's giving me trouble for no reason I can figure out:


Even if I put a "wait" function to 1 second, the game will still do what the gif shows above.

The menu itself consists of 3 overlapping pictures. The player is surrounded on either side by a touch event to make the menu scroll through music choices, and the tile they stand on allows them to play and pause the music at will. I'm pretty sure those events don't affect anything with this bug, but I wanted to mention it anyway.

If anyone has any ideas, it would be great to hear them, and thank you!
Hi bleet,

The only difference that I can see is that, in the initial transfer, to the Jukebox, you enveloped the final Show Screen command in Wait commands. "Wait" often allows the RPG Maker 2003 engine to update things behind the scenes—for example, if you put two Move Picture commands one right after the other, with a 0 transition time, and they both operate on the same picture, one of them will be ignored. But if you place a Wait command between them, even if it's 0.0 Wait, both of them can operate.

If you say that you already tried putting Wait commands around the exit code's Show Screen, and that there hasn't been a change, then I am also stumped.

Regards,
Zack
I think putting one small wait before the show screen command should fix it. You can also use wait 0.0 and it'll work.
It's the parallel process, I suspect. I've had a lot of issues with parallel processes behaving in unexpected ways compared to other triggers. Is that something you can change to autorun?

You can use a parallel process to trigger the autorun by turning on a switch in the conditional branch which activates a second page, set to autorun, on this event. I'm not certain this will fix the problem, but that's what I'd try if I were you.

edit: This is assuming the "wait" doesn't fix it. I've had a few issues with rm2k3 in which it really seemed like a wait should fix this kind of thing and it doesn't.
Magi
Resident Terrapin
1028
Parallel process is essentially a "while" loop instruction in traditional programming languages. The problem with these loops whenever we're concerned with using time-sensitive functions is that the loop doesn't care about standing around for them to complete in the way other event triggers would.

Try placing your wait options directly after both the hide and show screen events instead of having them clustered around show screen. Sometimes even RM2K3 gets very touchy about its internal order of operations.

Failing that, try cutting out all your event code until it behaves as expected. This will allow you to (eventually) isolate what is actually causing you grief.
Thank you everyone for the advice! I also hate parallel processes as they're sometimes a lazy way of doing things. Will fiddle around with the programming later and see if any of your suggestions work. ٩( 'ω' )و
I figured it out and I feel really dumb for it!

I had totally forgotten that parallel process is the devil if you're not smart about it; so I changed the parallel process part of the event to just detect the exit keypress and turn on the exit .switch. , then the second page was an auto-run event to teleport the player without issue.





Thank you everyone for helping me think critically about those darn tricky parallel processes! :)
Anyway, time when i used 2k3, i have must self to uninstall it at sometime to go, because i begind understand it was not law version, (hacked or something... )

These Paraled or auto events i wasn´t used.

Glad to hear that worked, bleet. Incidentally, did you try using the wait command to fix it as others suggested? I'm curious to know if that actually worked. Intuitively, it seems like it ought to, but again, I've attempted that fix in several places in Ara Fell where it didn't.
author=BadLuck
Glad to hear that worked, bleet. Incidentally, did you try using the wait command to fix it as others suggested? I'm curious to know if that actually worked. Intuitively, it seems like it ought to, but again, I've attempted that fix in several places in Ara Fell where it didn't.


No, spacing out waits didn't work. In fact, it broke it even worse, where the game would teleport you out without showing the screen. And once you're in the new area, the parallel process stops, so the screen stays black.

I think the true only way to do things like this is have a parallel process turn on an auto-run event, I don't think with this kind of effect it's even possible to have it fully function like that? As far as I can understand, the program is able to complete all commands instantaneously and doesn't need waits between commands unless they're supposed to be time sensitive, like an extended cutscene or animation. So I'm assuming the issue I had earlier happened not because it didn't have enough time to complete each step, but that it executed so quickly it looped back on itself and also tried to complete itself simultaneously? I dunno lol that's my guess.
>I think the true only way to do things like this is have a parallel process turn on an auto-run event,

Yeah, after extensive butting my head against a wall, I finally had to concede this was the only way to do it. If you want to save yourself a switch, you can have the autorun use the key-checking variable instead.
The problem is that you have no waits and it's parallel process. You got that part right but I don't think anybody suggested the engine didn't have enough time? Basically when you press exit menu = 6, the code processes so fast that it gets to the end while you are still holding 6 and it repeats itself. Putting the wait prevents it from repeating and gives the user time to let go of the button. I think 0.3 is the average time for that.

The way you did it prevents it from repeating, but I would suspect a wait would also do it. Also, if you are going to new map doesn't the event stop processing anyways? (it's been a while since I coded stuff) Also also, you put in the line "end event processing" but I suspect that doesn't do what you think it does. It will basically just start the parallel process over again and if you are still holding 6 it will all repeat. If it was a "talk" event then it would work, but being parallel process means it will start itself after you end event processing. This is probably why the waits didn't work for you.

One solution is to put a label loop at the end.

after everything
label 1
wait 0.3
jump to label 1

That will activate after all the code then stay in that loop instead of going back to the top of the paralell process code. You don't actually need to use this, but I thought I'd mention it.

In general you should add waits to almost everything that repeats. Even though you don't think you need them, you actually do. If I don't know exactly the wait I need then I tend to put a high wait, .05 to 1 sec, and test it. If things work ok and you can see the long wait, reduce it. If you don't notice the wait, then leave it. Not only does it make sure your code activates correctly it will prevent a parallel process from running over and over and fast as possible. When that happens you start to get lag. Putting in small waits reduces lag for a parallel process. Even where you have it checking for button input on page one, there should be a 0.0 or 0.1 wait.

I just noticed that the second page is autorun with no exit. You should have a third page with no parallel/autorun to finalize the event. It may work this time but you leave an autorun open ended like that you are looking for trouble. I'm pretty sure it works here because you are leaving the map and as soon as you do the event stops processing. It might not even be reaching the end event processing. Because it's autorun, normally it would just keep repeating just like a parallel process. So changing it to autorun was only a coincidental solution. It has nothing to do with what fixed it xD Putting it on page 2 prevented the key input from repeating, that's what solved it.

haha I keep thinking of more things to say. There is nothing wrong with parallel processes if you learn how they work. The thing about autorun is that it prevents your hero from moving, and I think other sprites with event movement(horizontal, towards hero). They each have their own use. Autorun is for cutscenes or anything you need to prevent other events from processing. And parallel process is for the rest. Don't forget about common events, which can be parallel processes events that happen on any map(or single run events). You could make page 2 a common event and when you press 6 it calls that common event. You still need waits though!
author=Link_2112
The problem is that you have no waits and it's parallel process. You got that part right but I don't think anybody suggested the engine didn't have enough time? etc..


Wow that's a lot of advice! Thank you for taking the time to write all of that. What you said is true, that what I did works for now. If I ever need help beyond that I'll definitely keep your post in mind. I've been tinkering with rpgmaker for years now but I'm definitely not perfect yet, so thank you.:)
Np, I enjoy problem solving in 2k3. I used to code tight out but haven't done it in years so I live vicariously through helping people like you haha If you have any other issues feel free to PM me.
Pages: 1