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?
Perfect! I'm using the Mouse System Ex. It works now 🙂 Thank you
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.
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.