Disable mouse click movement

Hello, I would like to know if there's a way to disable movement when you click somewhere on the map. However, certain events can still be activated from far. To be more precise, I'm trying to make a system where your mouse is your gun and it's possible to shoot everywhere, certain events interact with this shooting (for example you can kill a zombie, break a jar, etc), while shooting at walls doesn't do anything.


I would appreacite it if someone could help!


Thanks for your time  🙂
Do you want to disable it permanently or only at certain times, and for a set period?
Permanently
Changing this bit of code should stop player movement by mouse ... rpg_objects.js line 41:

Code:
Game_Temp.prototype.setDestination = function(x, y) {
    return; // <---- add this line here
    this._destinationX = x;
    this._destinationY = y;
};



And how are you activating events from afar?
Perfect! I'm using the Mouse System Ex. It works now  🙂 Thank you
Do you want to disable it permanently or only at certain times, and for a set period?



How would you disable it at certain times?

I'm trying to set up a system where you switch between modes A and B:

A: You can interact with special events by either pressing directional buttons (keyboard) or clicking on-screen buttons (mobile). Player cannot move.


B: Interact-able objects as defined above cannot be started in this mode. In this mode the player can move and explore the area.


In mode A, I cannot move the character via directional input (because it triggers one of the events available), but I can still move via mouse click. I would like to disable movement via mouse click (but still maintain mouse clicking) when I enter mode A.
Allocate a switch that will disable the mouse movement when you turn the switch on.  In the example below I'll use 15, so just change that to whatever switch id you want to use.


Game_Temp.prototype.setDestination = function(x, y) {
if ($gameSwitches.value(15)) { return }; // <---- add this line here
this._destinationX = x;
this._destinationY = y;
};


Turn the switch on when you want to disable mouse-click movement, and off when you want to enable it again.


If there are updates to the engine and you replace your scripts, you'll need to redo the change.
Allocate a switch that will disable the mouse movement when you turn the switch on.  In the example below I'll use 15, so just change that to whatever switch id you want to use.

 Omg, thank you so much <3
It was a fast reply too!

I need to learn to program for RPG Maker MV. That was so simple.
lol - it was simple because I knew that method existed, and that's what triggers the player to move.  I had a terrible time going through that logic the first time I needed to look at the pathfinding process 😀  - because it's something new in MV, and Ace didn't have it at all, without external scripts.
Changing this bit of code should stop player movement by mouse ... rpg_objects.js line 41:

Code:
Game_Temp.prototype.setDestination = function(x, y) {
    return; // <---- add this line here
    this._destinationX = x;
    this._destinationY = y;
};



And how are you activating events from afar?

Yanfly add plugin for activation events afar

@Nacura , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/disable-mouse-click-movement.61605/