Diagonal movement and overlapping

Hello! I'm not exactly new to RPG Maker, but it's the first time in many years I sit down to learn again. Also, first time posting here. I'm trying to make a new (old) project, and I wanted to implement diagonal movement. I'm using JV Master Script, and I found the following issues:

1. When moving diagonally, the player speed increments, I guess because math, and I'd like to know if there is a way to make that not happen.
2. The player sprite overlaps with some tiles (like shown in the example), and I know it's only a visual thing, but I'd like to fix that too. I don't want to use overlapping events to fix that (setting an event with the object sprite and putting it as "same as player"), because I want to save as much memory as possible, and by doing that the map would we overflowing with events for that sole purpose.

Any ideas?

Thank you 🙂.
1. To fix the speed increase, you could try a different diagonal movement script to see if it solves the problem.
DoubleX's Diagonal Movement Script
Victor Sant's Diagonal Movement
It's also possible that your JV Master Script is an old version, and that the latest version fixes that problem. But I was unable to get to the script through wayback so I don't know the version...

2. Are you using tilesets or parallaxes to make your maps?, if its tilesets then all you need to do is have a non-walkable tile [X], then place the visual tiles above it [✰] (VXAce supports 3 layers: ground, decal1, decal2), tiles set to ✰ appear above the player, the X and ✰ are refering to the Database's Tilesets Page where you can set the Passage for tiles. So all your furniture should be set to ✰, then you can either set a duplicate floor tile to X or a transparant decal tile to X
Just realised that depending on the direction you're moving that this will look weird...
Although... if you had duplicate furniture tiles that were only the top half set to ✰, that would solve the problem?
Thank you for your response 😀. But unfortunately, none of those links work.

For the DoubleX, when I download the .rar file it says that it's empty, and clicking the other link it says it doesn't exist; and for Victor's script, it says that Wayback hasn't archieved that page (the download link itself). The JV Master Script is also possibly a very old one, since the version I found was from some guy that copied it in a video, and he said that the link was 10 like years old haha. And yes, putting the "☆" symbol on a tile over the player does indeed, look weird.

What I have done is to have the A layer with the floor, the B with the object (with an "O" symbol), and above that, an empty event with a move route set to "this event > through on". That seems to do the trick, but I want to avoid using singular events as much as possible to save memory... Sooo...

Maybe I could try making a parallax and using only two layers and no events, but I'm not sure if that's gonna work, and also if I wanted to use animated parallaxes and other effects (which I will), that might lock me from using those for other maps. Also, if tiles work as I think they do, making so many parallaxes might defeat the purpose of saving memory.

Oh, and concerning the diagonal player speed, I might be able to live with that. I'll just focus on the things I can do now and think later about the stuff that is too hard to do by myself yet. Thank you for your time and suggestions uwu.
Well I tried with the script links...
Any way, heres the positions of the tiles I would've used.
The X being a transparant tile, and the ☆ being these 3 furniture tiles for this map.
All events can be removed by doing this, but note the X and ☆ on the same square for two of the tiles.

Edit: those bottom 4 Xs were probably meant to be 1 tile higher, but you get the idea.
When moving diagonally, the player speed increments, I guess because math, and I'd like to know if there is a way to make that not happen.
I don't understand the problem completely. But I think you mean that the time to travel one sqaure diagonally is the same as one square in a 4dir direction. Yes I can see that.
This mod should work for you. unless you change the movement speed during the game then there will need to be a few more adjustments.

Spoiler: JV Master 8Dir
Ruby:
#==============================================================================
# 8 Dir Move                                                  JV Master Script
#------------------------------------------------------------------------------
# Make player move in 8 dir, supports diagonal pattern.
#==============================================================================

module JvScripts
  module Dirs8
    
    Switch = 0               # Switch id for toggle 4/8 dir, 0 if always 8 dir
    DiagonalSuffix = "_di"   # Suffix for 8 dir charsets
                             # 8 dir charsets include in the first char
                             # the orthogonal and in the second the diagonal
    Diag_Speed = -0.5        # speed reduction for diagonal
    Player_Move = 4          # speed for player movement. default 4
  end
end

#==============================================================================
# Game CharacterBase
#==============================================================================
class Game_CharacterBase
 
  def move_diagonal(horz, vert)
    @move_succeed = diagonal_passable?(x, y, horz, vert)
    if @move_succeed
      @x = $game_map.round_x_with_direction(@x, horz)
      @y = $game_map.round_y_with_direction(@y, vert)
      @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))
      @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))
      increase_steps
    end
    if diagonal_charset?
      set_direction_diagonal(horz, vert)
    else
      set_direction(horz) if @direction == reverse_dir(horz)
      set_direction(vert) if @direction == reverse_dir(vert)
    end
  end
 
  def set_direction(d)
    if !@direction_fix && d != 0
      @direction = d
      @character_index = 0 if diagonal_charset?
    end
    @stop_count = 0
  end
 
  def set_direction_diagonal(horz, vert)
    if !@direction_fix && horz != 0 && vert != 0
      if horz == 4 && vert == 2
        @direction = 2
      elsif horz == 4 && vert == 8
        @direction = 4
      elsif horz == 6 && vert == 2
        @direction = 6
      elsif horz == 6 && vert == 8
        @direction = 8
      end
      
      @character_index = 1
    end
    @stop_count = 0
  end
 
  def diagonal_charset?
    true if @character_name.include?(JvScripts::Dirs8::DiagonalSuffix)
  end
end

#==============================================================================
# Game Player
#==============================================================================
class Game_Player < Game_Character
  def move_by_input
    return if !movable? || $game_map.interpreter.running?
    if JvScripts::Dirs8::Switch > 0
      if $game_switches[JvScripts::Dirs8::Switch] == true
        @move_speed = JvScripts::Dirs8::Player_Move + JvScripts::Dirs8::Diag_Speed
        case Input.dir8
        when 2, 4, 6, 8
          @move_speed = JvScripts::Dirs8::Player_Move
          move_straight(Input.dir4)
        when 1
          move_diagonal(4, 2)
        when 3
          move_diagonal(6, 2)
        when 7
          move_diagonal(4, 8)
        when 9
          move_diagonal(6, 8)
        end
      else
        move_straight(Input.dir4) if Input.dir4 > 0
      end
    else
      if Input.dir8 > 0
        @move_speed = JvScripts::Dirs8::Player_Move + JvScripts::Dirs8::Diag_Speed
        case Input.dir8
        when 2, 4, 6, 8
          @move_speed = JvScripts::Dirs8::Player_Move
          move_straight(Input.dir4)
        when 1
          move_diagonal(4, 2)
        when 3
          move_diagonal(6, 2)
        when 7
          move_diagonal(4, 8)
        when 9
          move_diagonal(6, 8)
        end
      end
    end
  end
end
#==============================================================================
Thank you for your response 😀. But unfortunately, none of those links work.

For the DoubleX, when I download the .rar file it says that it's empty, and clicking the other link it says it doesn't exist; and for Victor's script, it says that Wayback hasn't archieved that page (the download link itself). The JV Master Script is also possibly a very old one, since the version I found was from some guy that copied it in a video, and he said that the link was 10 like years old haha. And yes, putting the "☆" symbol on a tile over the player does indeed, look weird.

What I have done is to have the A layer with the floor, the B with the object (with an "O" symbol), and above that, an empty event with a move route set to "this event > through on". That seems to do the trick, but I want to avoid using singular events as much as possible to save memory... Sooo...

Maybe I could try making a parallax and using only two layers and no events, but I'm not sure if that's gonna work, and also if I wanted to use animated parallaxes and other effects (which I will), that might lock me from using those for other maps. Also, if tiles work as I think they do, making so many parallaxes might defeat the purpose of saving memory.

Oh, and concerning the diagonal player speed, I might be able to live with that. I'll just focus on the things I can do now and think later about the stuff that is too hard to do by myself yet. Thank you for your time and suggestions uwu.
Would you like to try this link to download my script?
I don't understand the problem completely. But I think you mean that the time to travel one sqaure diagonally is the same as one square in a 4dir direction. Yes I can see that.
This mod should work for you. unless you change the movement speed during the game then there will need to be a few more adjustments.

Spoiler: JV Master 8Dir
Ruby:
#==============================================================================
# 8 Dir Move                                                  JV Master Script
#------------------------------------------------------------------------------
# Make player move in 8 dir, supports diagonal pattern.
#==============================================================================

module JvScripts
  module Dirs8
 
    Switch = 0               # Switch id for toggle 4/8 dir, 0 if always 8 dir
    DiagonalSuffix = "_di"   # Suffix for 8 dir charsets
                             # 8 dir charsets include in the first char
                             # the orthogonal and in the second the diagonal
    Diag_Speed = -0.5        # speed reduction for diagonal
    Player_Move = 4          # speed for player movement. default 4
  end
end

#==============================================================================
# Game CharacterBase
#==============================================================================
class Game_CharacterBase
 
  def move_diagonal(horz, vert)
    @move_succeed = diagonal_passable?(x, y, horz, vert)
    if @move_succeed
      @x = $game_map.round_x_with_direction(@x, horz)
      @y = $game_map.round_y_with_direction(@y, vert)
      @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))
      @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))
      increase_steps
    end
    if diagonal_charset?
      set_direction_diagonal(horz, vert)
    else
      set_direction(horz) if @direction == reverse_dir(horz)
      set_direction(vert) if @direction == reverse_dir(vert)
    end
  end
 
  def set_direction(d)
    if !@direction_fix && d != 0
      @direction = d
      @character_index = 0 if diagonal_charset?
    end
    @stop_count = 0
  end
 
  def set_direction_diagonal(horz, vert)
    if !@direction_fix && horz != 0 && vert != 0
      if horz == 4 && vert == 2
        @direction = 2
      elsif horz == 4 && vert == 8
        @direction = 4
      elsif horz == 6 && vert == 2
        @direction = 6
      elsif horz == 6 && vert == 8
        @direction = 8
      end
   
      @character_index = 1
    end
    @stop_count = 0
  end
 
  def diagonal_charset?
    true if @character_name.include?(JvScripts::Dirs8::DiagonalSuffix)
  end
end

#==============================================================================
# Game Player
#==============================================================================
class Game_Player < Game_Character
  def move_by_input
    return if !movable? || $game_map.interpreter.running?
    if JvScripts::Dirs8::Switch > 0
      if $game_switches[JvScripts::Dirs8::Switch] == true
        @move_speed = JvScripts::Dirs8::Player_Move + JvScripts::Dirs8::Diag_Speed
        case Input.dir8
        when 2, 4, 6, 8
          @move_speed = JvScripts::Dirs8::Player_Move
          move_straight(Input.dir4)
        when 1
          move_diagonal(4, 2)
        when 3
          move_diagonal(6, 2)
        when 7
          move_diagonal(4, 8)
        when 9
          move_diagonal(6, 8)
        end
      else
        move_straight(Input.dir4) if Input.dir4 > 0
      end
    else
      if Input.dir8 > 0
        @move_speed = JvScripts::Dirs8::Player_Move + JvScripts::Dirs8::Diag_Speed
        case Input.dir8
        when 2, 4, 6, 8
          @move_speed = JvScripts::Dirs8::Player_Move
          move_straight(Input.dir4)
        when 1
          move_diagonal(4, 2)
        when 3
          move_diagonal(6, 2)
        when 7
          move_diagonal(4, 8)
        when 9
          move_diagonal(6, 8)
        end
      end
    end
  end
end
#==============================================================================
Thank you so so much! It worked 100%. If by changing the speed during the game you mean holding shift, it works perfectly while running too. If what you mean is to change the defalut speed (for example, from 3 to 5), I actually hadn't thought about that. In case I might want to do that in the future, well... I'm no programmer. But you also don't have to do that for me haha. Altough I would be very, very grateful if it doesn't take much of your time. Having the script itself was already super helpful, and having it modified even more. Thank you again :3.

Would you like to try this link to download my script?
Thank you! Thank link does work. But since Roninator2 modified the other script, I think I'll be using that one for now. Tho I might take a loot at yours to try and understand the logic behind it. I'm just an illustrator and music composer so programming isn't really my thing. That's one of the reasons I'm using RPG maker after all haha. But again, thanks for the reply 🙂.

Well I tried with the script links...
Any way, heres the positions of the tiles I would've used.
The X being a transparant tile, and the ☆ being these 3 furniture tiles for this map.
All events can be removed by doing this, but note the X and ☆ on the same square for two of the tiles.

Edit: those bottom 4 Xs were probably meant to be 1 tile higher, but you get the idea.
Ok, since I don't know if I'm explaining myself correctly, I made a video with different tile combinations.

(Note: I'll be using "x", "o" and "☆" depending on how those tiles show up in the editor to avoid repeating myself too much).

1. The tile with the flowerpot is a tile set as "x"(layer "A"), with another tile set as ☆ (layer "B"). As you can see, that makes me walk behind the object,which is not the desired output.
2. The bottom right corner of the bed is an event set to "above characters", which also looks weird (it pretty much works the same as the flowerpot).
3. What I am looking for is something like the top of the chair and table there. For that, there is the "o" wooden floor(layer "A"), with another couple "o" tiles on it (layer "B") which contain the upper part of the chair and table, and above that, an event set to "same as characters" and the "trough" box checked (I had a move route set to through before but discovered that option after).
I want to achieve the same visual effect as in the third example but without using events. So that the player cannot walk on them, but when the diagonal walk animation plays, the events go through and avobe the sprite. Just like in this video. Is there a way to do that using only tiles?

Edit: I added a new layer "C" to try what you said (Layer "A" "x/o", laver "B" ☆ and layer C "x"), but it has a the same effect as just using an "x" layer: when the player sprite walks diagonally, the object is behind the player.

1. The tile with the flowerpot is a tile set as "x"(layer "A"), with another tile set as ☆ (layer "B").
I don't know what else to tell you, it works fine for me.
spot1 can be walked behind (base RM "☆" functionality),
spot2 can't be walked on but appears above the player when moving diagonally (combines base "☆" and "X" functionality)
spot3 can't be walked on and appears below the player when moving diagonally (base RM "X" functionality)
I don't know what else to tell you, it works fine for me.
spot1 can be walked behind (base RM "☆" functionality),
spot2 can't be walked on but appears above the player when moving diagonally (combines base "☆" and "X" functionality)
spot3 can't be walked on and appears below the player when moving diagonally (base RM "X" functionality)
Well... Now it worked somehow? I deleted some scripts I was testing... So maybe it was that? Sorry for the headache. The important thing is OMG IT WORKS NOW!! So thank you :').

Edit: I should note that ot works fine for individual tiles, but when there is one next to another (just like the chair and table), it doesn't. But I guess it's still less than half the amount of events I was going to use to begin with, so it's much better 🙂.
I should note that it works fine for individual tiles, but when there is one next to another (just like the chair and table), it doesn't
There are no circumstances where you'd need to use an event over either a "☆" only or both a "☆" and "X" (for these cases of player movement above/below tiles, that I can think of). Yes you'd need an event to add a makeshift fourth tile layer but thats different.
The only positional downside is that if the player is below one of these tiles you'll appear above it when moving diagonally up to it's side (which would look weird for the table legs, etc), but this result is the same for both methods.
So as shown above earlier in 'Events.png' the table would be "☆" and "X", while the chair would be "☆" only. I'm not sure how the player sprite would interact between the top and bottom halves of the chair portion of that sprite, but if the player appears below the top half of the chair and above the bottom half then you'd just need to make the bottom half a "☆" only as well.

Original thread: https://forums.rpgmakerweb.com/threads/diagonal-movement-and-overlapping.173535/