MV solution to replace/modify SRD movement direction restriction as incompatible with GALV diagonal direction

Hello everyone, I have an issue and maybe you can help me :

In my project, the world map is traversed by airship with the Ultramode 7 plugin and a rotating camera (I'm trying to imitate FF6, so what? 😛 ).
here's a demonstration in this video:



To be able to rotate the camera and move forward all the time with the UP key, move backward with DOWN and rotate the camera with LEFT and RIGHT without moving the airship, I use SRD movement directions restrictions which allows me to block the character's movements only when we are in the airship.
Next to that I have a event in parallel with the key assignments (UP key to move forward in the desired direction according to the rotation of the camera etc.).

Everything worked until I added the GALV Diagonal movement and GALV Character animations plugins, which let me move in all 8 directions like this:



Except that GALV Diagonal movement is not compatible with SRD movement directions restrictions and crashes my game every time or doesn't work (and it doesn't matter which way I put them in the plugin list.)
I'm no .js expert, but it makes sense in the sense that they both modify the way the actor's movements are handled.

And when SDR is deactivated, the combination of the airship normal moves + the rotation results in something as lame as this:



It's clear that if I had to sacrifice one of the two, it would be SDR and the airship's rotating camera, because you still spend more time on foot... 😀

But if anyone has a solution to block the airship's movements again via the classic movements, that would help me a lot. (or perhaps by modifying SRD a bit, as its code is rather short compared to the others?)

(I'd also like to point out that I've tried things like unbinding keys temporarily, but as a result I couldn't move at all 😀)
(I've already done a lot of searching on the forum but I haven't found anything that works in my case.)

Thx 🙂
crashes my game every time
When you get a crash, you need to press F8, go to the Console tab, and post a screenshot of the full error trace. Just saying "they don't work together" doesn't give us any clue what to look at in the code.

Speaking for myself, I would prefer if your post also included thorough descriptions of what's wrong. I usually will not want to take the time to watch a video and guess which part of what I'm seeing isn't supposed to be happening.

I've tried things like debouncing keys temporarily
I really don't know what that's supposed to say. 😛
When you get a crash, you need to press F8, go to the Console tab, and post a screenshot of the full error trace. Just saying "they don't work together" doesn't give us any clue what to look at in the code.

Speaking for myself, I would prefer if your post also included thorough descriptions of what's wrong. I usually will not want to take the time to watch a video and guess which part of what I'm seeing isn't supposed to be happening.

I really don't know what that's supposed to say. 😛

sry, it was "release direction keys" ( typing error = translation error 😀 )

for the error :

1734968474907.png


plugins are arranged in this order:
GALV diagonal movement
SRD movement direction restriction (code on link)

When I deactivate SRD, everything works fine,
When I set SRD above GALV, the game no longer crashes, but the plugin SRD doesn't work either.

When I deactivate GALV, SRD works fine.

thanks for your answer 🙂
How are you rotating the camera with left and right? It seems like whatever plugin you're using for that should automatically be disabling the character walking in those directions at the same time.

It just doesn't look like you should need the SRD plugin at all.
How are you rotating the camera with left and right? It seems like whatever plugin you're using for that should automatically be disabling the character walking in those directions at the same time.

It just doesn't look like you should need the SRD plugin at all.
I don't know what you're talking about.

I use ultramode 7 directly to turn the “yaw” camera in the plugin with the left and right keys via an event on my map that runs in parallel, is not a plugin's feature, there's no specific command for that and no possibility at all of limiting my movements via this plugin.

the game works like this:
when my character is on foot, the camera is fixed and I move around using the arrow keys
when I'm flying an airship, a common event blocks normal movement via SRD (and other common event reactivate movement when I'm landing),
the camera moves behind it and a parallel event is activated with the following instructions :

if UP key pressed :
if angle = 0°
actor go up
if angle = 45°
actor go upright
if angle = 90° actor go upright
actor go right
etc..
if RIGHT key pressed :
angle =+ 45
if LEFT key pressed :
angle =- 45

(this is an overview, the event is more complete than that, but here's the principle)
without SRD movement restrict., when I press the arrow keys, my event that manages the camera and my character's “normal” movements add up... (the last 10sec video will be very explicit)
I don't know what you're talking about.
I use ultramode 7 directly to turn the “yaw” camera in the plugin with the left and right keys via an event
That's what I'm talking about. That's the answer to the question I asked, "How are you turning the camera."

And it affects possible solutions to this - because one of my thoughts was to disable the "right" and "left" movement codes from those button inputs while the airship is active, and that won't work if you're relying on event conditional branches to pick them up.

Try this untested modification. Open the SRD plugin in a text editor and replace lines 67 - 74 with the below:
Code:
        var index = _Game_Player_getInputDirection.call(this);
        if (index % 2)
            return $gamePlayer.isInAirship() ? 0 : index;
        index = (index / 2) - 1;
        index = (index === -1) ? 0 : index;
        if(switches[index] !== 0 && $gameSwitches.value(switches[index])) {
            return 0;
        } else if(conditions[index].length > 0 && eval(conditions[index])) {
            return 0;
        }
        return _Game_Player_getInputDirection.call(this);

1734977206187.png


Leave it below Galv's plugin in the plugin manager.
That's what I'm talking about. That's the answer to the question I asked, "How are you turning the camera."

And it affects possible solutions to this - because one of my thoughts was to disable the "right" and "left" movement codes from those button inputs while the airship is active, and that won't work if you're relying on event conditional branches to pick them up.

Try this untested modification. Open the SRD plugin in a text editor and replace lines 67 - 74 with the below:
Code:
        var index = _Game_Player_getInputDirection.call(this);
        if (index % 2)
            return index;
        index = (index / 2) - 1;
        index = (index === -1) ? 0 : index;
        if(switches[index] !== 0 && $gameSwitches.value(switches[index])) {
            return 0;
        } else if(conditions[index].length > 0 && eval(conditions[index])) {
            return 0;
        }
        return _Game_Player_getInputDirection.call(this);

View attachment 326707

Leave it below Galv's plugin in the plugin manager.
thanks for your help,
it works in part: the main UP DOWN RIGHT LEFT directions are blocked, but the diagonals (when I press up + left, for example) are always activated.

EDIT : I don't know if it's easier to make one switch for all directions than one for each direction ? maybe it would be easier to integrate it higher up ?
Change the third line I gave you above to:
Code:
         return $gamePlayer.isInAirship() ? 0 : index;

I've also updated it in the post above.

That should block all diagonals only when in the airship.
it works! thank you very much! 😢
i'm going to be boring but : replacing the airship condition by a switch would be possible easily and quickly? (i don't want to take you more time)
it would make the modification more versatile if I ever want to use my system for something other than the airship
Of course, you can just replace that bit with the script call for a switch value.
thank you very much for your help @ATT_Turan

For moderators : This thread is solved

Original thread: https://forums.rpgmakerweb.com/threads/solution-to-replace-modify-srd-movement-direction-restriction-as-incompatible-with-galv-diagonal-direction.174109/