Which function stops the player's movement when touching an event?

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
48
Reaction score
21
First Language
Greek
Primarily Uses
RMMV
So i have a minigame, and in that minigame there are some events that must always be visible to the user. Let's call those "A". The map's width is large, so i have some transparent events which, when the player touches, force the "A" to jump in focus again. If the player goes back, other events force the "A" to jump to their previous place.

This works perfectly unless you try to use the mouse. When you click somewhere, the player goes towards that square, but if they touch an event - even if the event doesn't do anything (due to conditions not being met) - the player stops in place and awaits a new input.

So i thought there must be some function that stops the player's movement when the event is triggered. So i then thought i could simply negate that when the minigame starts, and re-enable it when the minigame ends - since the minigame doesn't contain any other player touch events.

No matter how much i searched through the .js files i couldn't find (or couldn't understand) the function responsible for this. I'm a junior in JS so it might be in front of me, but i can't see it.

Can someone help?
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,060
Reaction score
441
First Language
Portuguese - Br
Primarily Uses
RMMV
Hmmm... Do you try to set an autorun event instead?
Because if the autorun is on, the player will be stopped.
So, in short, do you want a way to stop the player from moving, right?
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
48
Reaction score
21
First Language
Greek
Primarily Uses
RMMV
Hmmm... Do you try to set an autorun event instead?
Because if the autorun is on, the player will be stopped.
So, in short, do you want a way to stop the player from moving, right?
No, i want the exact OPPOSITE. I want the player to continue moving, even if stepping on "player touch" events.
For example, if you press the right arrow and keep it pressed, the player will not stop (i am guessing because the input is continuous) <- that's what i want.

If you click with the mouse, then the player will stop when encountering a player touch event. I am guessing this is because the mouse click is not continuous, so it's cancelled or something. I want to bypass this, just for this minigame.
 

IFCATS

Villager
Member
Joined
Feb 3, 2020
Messages
14
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
oh I'll follow this cause I have the same issue.
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,060
Reaction score
441
First Language
Portuguese - Br
Primarily Uses
RMMV
hmmm!! I think you can track the set destination position when you click with the mouse. Maybe this can help? Don't know. I never used the mouse, so I did not know that the player stops when touch a player touch event o_O
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
332
First Language
German
Primarily Uses
RMMV
Maybe i got another solution for you.

Use 1 Parallel Event for the whole Map, that can check the conditions and teleports "A" to the correct place.
- Conditions could be Event positions in comparrison to player position.
- Or if Player moves over a certain RegionID
- Or the distance of Maptiles between the Player and different Map Coordinates,
"A" will be teleported to the coordinate with the shortest distance to the Player, that could be one solution.

In this Scenario your Events on Trigger Event/Player Touch would not be needed anymore.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
Try this plugin: https://github.com/TorD/TDDP-Repo/blob/master/TDDP_PlayerTouchPassage.js :)

I don't think it offers an on/off function, but to force-stop the player in events that should stop them, you could try assigning the player a short (blank?) move route via Set Movement Route right at the start of the event. Alternatively the current terms of use state you can edit the plugin so long as you don't redistribute the edit; you could add, say, a check for "is switch X on" before processing the eventIsBlocking bit, e.g.
JavaScript:
 Game_Player.prototype.eventIsBlocking = function() {
        if ($gameSwitches.value(1)) return true;  // <-- added! Default behaviour when switch 1 is on
        interpreter = $gameMap._interpreter;
// etc...
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
48
Reaction score
21
First Language
Greek
Primarily Uses
RMMV
Maybe i got another solution for you.

Use 1 Parallel Event for the whole Map, that can check the conditions and teleports "A" to the correct place.
- Conditions could be Event positions in comparrison to player position.
- Or if Player moves over a certain RegionID
- Or the distance of Maptiles between the Player and different Map Coordinates,
"A" will be teleported to the coordinate with the shortest distance to the Player, that could be one solution.

In this Scenario your Events on Trigger Event/Player Touch would not be needed anymore.
I try to avoid using parallels for complex things, since they tend to behave oddly at times / or add lag. I only use them for setting up a map when it needs the same setting all the time (like, always do this -> erase event. This basically will do the same things to the map every time it's loaded.) But i might try this with the regions you mentioned, since i could always wait for 60 frames before running it from the start. I doubt that's going to lag the game.



Try this plugin: https://github.com/TorD/TDDP-Repo/blob/master/TDDP_PlayerTouchPassage.js :)

I don't think it offers an on/off function, but to force-stop the player in events that should stop them, you could try assigning the player a short (blank?) move route via Set Movement Route right at the start of the event. Alternatively the current terms of use state you can edit the plugin so long as you don't redistribute the edit; you could add, say, a check for "is switch X on" before processing the eventIsBlocking bit, e.g.
JavaScript:
 Game_Player.prototype.eventIsBlocking = function() {
        if ($gameSwitches.value(1)) return true;  // <-- added! Default behaviour when switch 1 is on
        interpreter = $gameMap._interpreter;
// etc...

I'm definitely trying this one since the creator is ok with editting.

Thanks everyone for your input!
 

MiD

Veteran
Veteran
Joined
Oct 22, 2018
Messages
48
Reaction score
21
First Language
Greek
Primarily Uses
RMMV
To whoever may have the same question as me, Caeth's answer does exactly what i wanted. With his addition, set the switch to "ON" at the beginning of the game (normal behavior) and to "OFF" whenever you want to bypass movement blocking. Thanks a ton!
 

IFCATS

Villager
Member
Joined
Feb 3, 2020
Messages
14
Reaction score
5
First Language
Italian
Primarily Uses
RMMV
Thank you so much the plugin worked wonder for me too
 
  • Like
Reactions: MiD

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

Latest Threads

Latest Posts

Latest Profile Posts

How do you do when you want to work on projects but the game companies make so many games available for free because of the quarantine?
Kes
I have just stepped down from being a Mod, so please don't send me any more pm's with Mod questions. Thanks
The laptop I've had for almost 3 years has blue screened and is stuck on a boot loop. Can't wait to make games on nothing!
Made a brief video showcasing early game play... Got a copyright claim by BIG UP! (https://big-up.style/) for using music I bought from here (Future Steam Punk Pack). Now I wonder if I should strip any purchased music from here out of my game. :LZSskeptic:
Cleaned character animation and new room


I'm not sure if I should open a thread for this in games in development..

Forum statistics

Threads
95,477
Messages
929,441
Members
125,717
Latest member
Schiraz
Top