Laggy player speed after changing graphic?

Hi. I am trying to do something a bit weird, it might not exist any solution to this but i'll ask anyway.

Basically, I want the player's speed to always be at the fastest no matter what. At the same time I want the player's graphic to change when entering a specific area, and then change back to the prior sprite when stepping out of that region (I'm using region IDs to do this.) The problem is that I can't seem to find a good way of keeping the players changed speed when doing this.

I have a simple parallel process event that looks like this:
1639696874593.png


Since the "wait for completion" box is ticked, the players speed gets pretty choppy/laggy...but if I don't have it on I won't be able to move at all. Is there a way to make the player fast at all times with no choppy movement, even after changing the sprite to another and then back again? I really don't want to rely on holding in the dash button all the time.
changing graphic, if done correctly, never causes lag.

the lag is caused by the parallel process running (and changing the graphic) sixty times each second.

the first point is to add waitframes so that the parallel process doesn't run sixty times per second. wait(9) at minimum.

then you should change the logic in a way that the change command is only given if the region ID changes, and not on every region id.
Thank you for the reply!

Adding waitframes did make it a lot smoother! But now the image is changing too slowly (I'm probably doing something wrong). Is there a specific place I should put the wait interval?

Also it's my first time using region IDs so I'm completely clueless... Do you mean I should put something like "$game_player.region_id != 0" instead?

Thanks again and sorry for asking a lot of questions!
No ... something like this ...

Code:
If Script: $gamePlayer.regionId == 1
  If Switch [18 ON REGION 1] is OFF
    Control Switches [18 ON REGION 1] = ON
    Set Move Route: Graphic Cursor '1', Speed 6
  End
Else
  If Switch [18 ON REGION 1] is ON
    Control Switches [18 ON REGION 1] = OFF
   Set Move Route: Graphic Cursor '0', Speed 6
  End
End
Wait 10 Frames

Not sure why you're setting the speed to the same value both times.

So the first time you move from another region to region 1, the switch will be off, so it will turn the switch on and change the graphic. The next time it checks, if you're on region 1, the switch will be on, so there is no need to change the graphic because it's already correct.

The first time you move from region 1 to another region, the switch will be on, so it will turn the switch off and change the graphic. The next time it checks, if you're not on region 1, the switch will be off, so it won't change the graphic again because it's already correct.

So the only time it will change the graphic is when you move from region 1 to another region or vice versa, and once it changes the graphic it won't do it again until you change regions.

And the wait at the end says to only check 6 times a second. Normally you wouldn't be able to move 6 tiles per second, but that's on speed 4. If you find it still too slow, reduce the wait frames. Even a wait 2 frames will remove most of the lag, but generally make it as high as you can without causing a negative effect.
I did what you said and it works in the way I want now. Thank you so much for your help!
But now the image is changing too slowly
that is because the number of waits need to be determined based on the entire event code.
sometimes it is less, sometimes it is more - too low a wait gives too much lag and slows the computer down, too high a wait number and the computer reacts too slow but without lag.

you'll always have to test which number of waits is the best for each event with parallel processes.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/laggy-player-speed-after-changing-graphic.143065/