Level restart not working properly

Niloc

Veteran
Veteran
Joined
Jul 27, 2020
Messages
71
Reaction score
12
First Language
French
Primarily Uses
Other
Hi, I am building a stealth game in which whenever the player gets caught the level restarts.
To make the level restart I use this event :
1596474498274.png

Normally it works pretty fine but I started using Yep's buttonCommonEvents to use my map abilities as common events (before that I had to copy paste it on each page which isn't so convenient). One of the ability is interefering with the restart event and I'm not sure why.

It's a "phase" ability that allow my player to move forward very quick while being shortly invisible.

"
◆If:Invisible is OFF
◆If:Ability gauge ≥ 2
◆Control Switches:#0003 Invisible = ON
◆Plugin Command:qSight player visible false
◆Play SE:Evasion2 (35, 120, 0)
◆Set Movement Route:Player (Skip, Wait)
:Set Movement Route:◇Opacity:0
:Set Movement Route:◇Speed:6
:Set Movement Route:◇Frequency:5
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇Speed:4
:Set Movement Route:◇Frequency:3
:Set Movement Route:◇Opacity:255
◆Plugin Command:qSight player visible true
◆Control Switches:#0003 Invisible = OFF
◆Control Variables:#0009 Ability gauge -= 2

:Else
◆Text:main character(0), Window, Bottom
:Text:I'm out of energy !

:End

:Else
◆Control Variables:#0003 Disable Lock = 0
◆Plugin Command:qSight player visible false
◆Play SE:Evasion2 (35, 120, 0)
◆Set Movement Route:Player (Skip, Wait)
:Set Movement Route:◇Opacity:0
:Set Movement Route:◇Speed:6
:Set Movement Route:◇Frequency:5
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇1 Step Forward
:Set Movement Route:◇Speed:4
:Set Movement Route:◇Frequency:3
:Set Movement Route:◇Opacity:255
◆Plugin Command:qSight player visible true
◆Control Switches:#0003 Invisible = OFF
◆Control Variables:#0009 Ability gauge -= 2

:End
"

When I start the game, it automatically plays this part :
◆Text:main character(0), Window, Bottom
:Text:I'm out of energy !

And when I restart a level the ability is automatically used even if I'm not pressing the linked key.
I've been trying to figure out what is wrong for a while but I can't get it. Does anyone have an idea ? Or do you know a good plugin that would allow me to restart the level easy ?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,732
Reaction score
7,378
First Language
German
Primarily Uses
RMMV
You should restructure your event.

One of the biggest (and unfortunately random) problems is that map events only exists on a map.
So if you are transferring the player to a different map, the current map event gets deleted - and that includes the commands after the transfer command.
SOME of the commands will remain in memory until processed, but for any more complex structures it is usually better to have an event end at the transfer command and have an autorun on the target map continue with the rest of the commands.

and since you have multiple transfers in that event, probably back to this map from what you're writing, you need to be rather tricky on which command is triggered when.
You'll probably have to continue the bughunt after restructuring the events, but first you need to get that problem above fixed before you can search for the next bug.
 

Niloc

Veteran
Veteran
Joined
Jul 27, 2020
Messages
71
Reaction score
12
First Language
French
Primarily Uses
Other
Alright thanks ! I'm gonna try to just remake the event cleaner then :D
 

Niloc

Veteran
Veteran
Joined
Jul 27, 2020
Messages
71
Reaction score
12
First Language
French
Primarily Uses
Other
So well, I fixed it but that was the weirdest thing ever.
Basically the event was good. But for some reason when I placed in in common event 11 it just bugged (maybe something in yanfly's pluging ?). I put it in an other slot and now it works just fine. I spent hours to try to fix this haha
 

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

Latest Threads

Latest Profile Posts

Ami
--- Overused ---

Hero: (Drink 3 HP Bottle L)
F.Healer: Don't drink too much,or you got sick!
Hero: Nah,i'm okay. it's the way to repleni---
(Hero Collapse)
Hero: (Weak) Ugh...my head (Coughing Then Vomiting)
F.Healer: I told you to don't Drink 3 HP Bottle L or you're Sick. Let's go to Doctor.
Shaking off the dust. Clearing the cobwebs. Time to get back to gam-mak!
I should have looked for this earlier....

It makes MV only need OGG files, and it fixes the audio lag issue. :LZSexcite:
Battle of the original characters! my main character for my game vs. my friend's main character of his comic...
A video game has a brand attached to it.
No offence meant, but it is disadvantageous to use the default RM graphics due to the fact that they can correlate your game strongly to other RM games and whatever associations a user has with those unrelated games.

Forum statistics

Threads
103,212
Messages
998,029
Members
134,687
Latest member
pen
Top