Help for a temporary change of input keys with an event

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
Hi everyone,

First of all please forgive me if this is the wrong section, this is my first post on this forum.
Nice to meet you by the way!

I am currently developping a game with RPG Maker MV and I am struggling to
create a "confusion room" where the player must move with inverted controls (press left= go right).
Ideally I would like to create this as part of an event, so that on the same map the
controls could change more than one time depending on where the player is.
Of course, I only need this to happen on a very specific map, so I do not want to
change the default keyboard inputs.

Any suggestions? Any already made Scripts or Plugins?
Thank you very much for your help.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
This should be able to be done via a common event which you activate when in this room, then turn off afterwards. Use the conditional branch key with the appropriate inputs to change movement.

If that doesn't work you can also request a plug-in though if you do that let us know and we can move this to plug-in requests.
 

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
This should be able to be done via a common event which you activate when in this room, then turn off afterwards. Use the conditional branch key with the appropriate inputs to change movement.

If that doesn't work you can also request a plug-in though if you do that let us know and we can move this to plug-in requests.
Thank you very much, this solution is very simple and perfect!
I totally overlooked to think about using the last page of the conditional branch.

Thanks again
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
You can use a parallel Map Event instead of the Common Event, because this is only taking place on that particular Map.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Do you want the confusion to affect the menu too? And any Show Choices event commands?

If it's only movement, then the event solution would work. Otherwise, you can temporarily swap the mapping between the keyboard key and the direction using a Script event command.

Code:
Input.keyMapper[37] = 'right';
Input.keyMapper[38] = 'down';
Input.keyMapper[39] = 'left';
Input.keyMapper[40] = 'up';
Just remember to swap it back when they leave the map.
 

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
This should be able to be done via a common event which you activate when in this room, then turn off afterwards. Use the conditional branch key with the appropriate inputs to change movement.

If that doesn't work you can also request a plug-in though if you do that let us know and we can move this to plug-in requests.
Sorry to bother you again,

I encountered two odd problems with your solution.

1) If the player keep pressed the button (for example left) the character will go right-left in loop until the key is released,
I guess this is because the parallel process has not enough time to get processeed? Anyway that's not a big problem
2) If the player walk into any kind of wall/border (which is extremely lileky to happen in such a room) the character get totally stuck.
Any idea of why and how to fix this? The game itself is not bugged (i can enter the menu for example) but the character
will not move no matter what. I tried this also in an empty map without any event and I get the same problem
Here i attach two screenshots

Thank you very much in advance

confusion effect on empty map.png confusion room.png
 

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
Do you want the confusion to affect the menu too? And any Show Choices event commands?

If it's only movement, then the event solution would work. Otherwise, you can temporarily swap the mapping between the keyboard key and the direction using a Script event command.

Code:
Input.keyMapper[37] = 'right';
Input.keyMapper[38] = 'down';
Input.keyMapper[39] = 'left';
Input.keyMapper[40] = 'up';
Just remember to swap it back when they leave the map.
This is great! Once I fix the problem with the map I will try it also in the menu.
Thank you very much :)
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
How about showing Pictures of your Eventcode also? =)
But let me Guess:
Your Moveroute needs
"Skip" if cannot Move marked.
and
"Wait" for completion shall NOT be marked.
 

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
How about showing Pictures of your Eventcode also? =)
But let me Guess:
Your Moveroute needs
"Skip" if cannot Move marked.
and
"Wait" for completion shall NOT be marked.
You are right, the code was the most important thing XD
Sorry, i'm a real beginner with RPG Maker

However i do not have any Moveroute, here is how i created everything
(its italian but im sure you will understand, basically i have a parallel event
with 4 different conditional branch changing what happens with a key)Confusion room event code.png
 

Gianmarco

Villager
Member
Joined
Oct 3, 2019
Messages
8
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
Hi again, so no idea of what the problem is?
If you want I can translate in english the eventcode.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Sorry i cant understand that language nor guess what the commands would mean exactly in english.

Also if you dont use the Eventcommand "Moveroute" to control the Movement, please also show the involved other Event and its Eventpages.
So we get a clue how you are manipulating the movement.
Also what is on Page2 of Event89, you just showed Page1 in your Picture.

My Guess is:
The Button input needs to be checked every Frame.
Your Event on the Picture seems to do that, and activates a Switch.
I believe the Eventpages that use that switches, are executed 1Frame later,
and that is why it starts moving, even if it should not.

Thats just my blind Guess.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top