Blocking the Player's Diagonal Movement (GaryCXJk's Free Movement) (VX Ace)

Hello! In my project, I've created a small table (as an example for testing) that the player can push or pull using these scripts: http://himeworks.com/2013/09/restricted-move-inputs/ and https://rpgmaker.net/scripts/255/. However, I'm also using a Free Movement script (https://area91.multiverseworks.com/rmvxa/scripts/gameplay/free_movement), meaning that even though I've blocked diagonal movement for the table, the player can slowly drift away from the table by moving diagonally. I've tried my best to manually disable the player's diagonal movement, with very little progress.

Spoiler: Image
Code_15.png

As you can see in the image, I've tried a multitude of methods to disable the player's diagonal movement, but the best I've managed is disabling their diagonal sprites. While good to know that I can do that... it doesn't actually help much. Eventually, I'll have a sprite showing the player gripping the table, so the player doesn't turn their back on it. (Direction Fix isn't applicable here. It interferes with the Restricted Move Inputs script.)

Does anyone know how to go about this? I have everything else working in this event- this is the last issue. As always, any help would be appreciated.

Oh, and since I believe it'll come up, I've already tried
Code:
CXJ::FREE_MOVEMENT::ENABLE_DIAGONAL = false
. That didn't work either, I'm afraid.

Edit: I'm a dummy. That above line of code works. Let's pretend this never happened.
Can this thread be closed? (If you didn't already, and if it can be, you should report it with a message like "thread can be closed")
If the player can quit the game (return to title) and start a new game or load an existing one without closing the game for good, the constant you changed with that line of code will stay that way.

Those things are named constants for a reason, changing them during runtime is never a good solution code-wise.
You won't have any issues if the player can't do what I wrote above, and if you change it back before the player can take control again in the game though.

Can this thread be closed? (If you didn't already, and if it can be, you should report it with a message like "thread can be closed")
I never understood the reason of this obsessive "close all solved topics" thing here.
I mean, sure, if the topic opener asks it to be closed, okay, but otherwise, why is there any need to close it?
Not to mention that some solved topics here got major coding errors or overly convoluted solutions, and when I see them locked, I always just scream in my head. >.> Can't really correct them if they are closed, unless I ask it to be reopened, but no thanks, that's too much hassle 😛
I never understood the reason of this obsessive "close all solved topics" thing here.
I mean, sure, if the topic opener asks it to be closed, okay, but otherwise, why is there any need to close it?
Not to mention that some solved topics here got major coding errors or overly convoluted solutions, and when I see them locked, I always just scream in my head. >.> Can't really correct them if they are closed, unless I ask it to be reopened, but no thanks, that's too much hassle 😛
The posts will just get really old, a few years old, and necroposting is not allowed. Even a month old post really shouldn't be posted in.
Honestly, to me necro-posting is less of a pain than finding someone with the same problem as yourself, and being unable to reply, as is the case with a closed thread.

On the topic though, Sixth, do you have an alternate way to go about this? I hadn't considered the player quitting the game. The constant is set back to true once the player activates the event they're dragging around again, but I'd prefer to do it properly, if I could.
Honestly, to me necro-posting is less of a pain than finding someone with the same problem as yourself, and being unable to reply, as is the case with a closed thread.

On the topic though, Sixth, do you have an alternate way to go about this? I hadn't considered the player quitting the game. The constant is set back to true once the player activates the event they're dragging around again, but I'd prefer to do it properly, if I could.
Yeah, but necro posting is not allowed...
You could find this line that Free Movement script:
Code:
    if CXJ::FREE_MOVEMENT::ENABLE_DIAGONAL && Input.dir8 > 0 && Input.dir8 % 2 != 0
And change it to this:
Code:
    if $game_switches[555] && Input.dir8 > 0 && Input.dir8 % 2 != 0
This will let you toggle diagonal movement with the assigned switch. If the switch is turned ON, you can move diagonally, if it's turned OFF, you can't.
Replace 555 with the switch ID you want to use for this.
This will render the ENABLE_DIAGONAL setting in the script ineffective, it won't change anything after the edit, only the assigned switch can enable/disable the diagonal movement.

For the record, I am not talking about months old topics, but about a few days old ones which I happen to read too late to help or to correct the help given if it's faulty, because it's already locked by then.
But I don't see the harm of adding relevant information to any topic, be it very old or just a few days old regardless.
For the record, I am not talking about months old topics, but about a few days old ones which I happen to read too late to help or to correct the help given if it's faulty, because it's already locked by then.
But I don't see the harm of adding relevant information to any topic, be it very old or just a few days old regardless.
Ah. I see. Yeah...but if it really is faulty, you (or the person who started the thread) could report it, and say that it should be reopened. But I don't think the OP (is that what the person who started the thread is called?) would report it as being closed unless they have tested it and it works.
For the record, I am not talking about months old topics, but about a few days old ones which I happen to read too late to help or to correct the help given if it's faulty, because it's already locked by then.
But I don't see the harm of adding relevant information to any topic, be it very old or just a few days old regardless
I agree with you Sixth. It would be great to have the information updated or corrected.
they have tested it and it works.
But maybe it's not the best way?

If maybe the forum could allow some members that are the experts in stuff like the coding to make a report on a thread and provide information for the adjustment, then a mod can add the info in for future reference.
But maybe it's not the best way?

If maybe the forum could allow some members that are the experts in stuff like the coding to make a report on a thread and provide information for the adjustment, then a mod can add the info in for future reference.
Yes that makes sense. But of course I am not a moderator or admin, so I don't have power to do that.
I'd like to happily note that Sixth's solution works. Feel free to keep talking about necro-posting. ;p
I'd like to happily note that Sixth's solution works. Feel free to keep talking about necro-posting. ;p
He started it! No, I'm joking 😀

Original thread: https://forums.rpgmakerweb.com/threads/blocking-the-players-diagonal-movement-garycxjks-free-movement-vx-ace.90653/