• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Congratulations to all of the game jam participants! 🥳 The winners have all been decided and announced.
    If you haven't yet, check out the entries for Eevee Expo's Game Jam here!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

Resource Marin Side Stairs - v21 2025-06-10

Aioros

Novice
Member
Joined
Nov 24, 2022
Posts
15
Aioros submitted a new resource:

Marin Side Stairs - v21 - v21.1 Compatibility for Marin's Enhanced Staircases

I have this working on my project, but with fixes all over the place which made it harder to find all the changes I did.
I will leave a small disclaimer, when I was fiddling with this I may have cut out parts that weren't of use to me which may have removed certain features.
I downloaded a clean essentials just with hotfixes and following pkmn plugins to make sure I found all the code I edited, hopefully I didn't miss anything.

This still works like the old plugin...

Read more about this resource...
 
If I try to use an event with the Slope name (it is considered a stair event if it has that name) and don't use comments, it will give a different type of error but that's to be expected since it's poorly used.

If I try to just have an event with the Slope name around it won't cause that error you described for me, however I'd like to point out it wouldn't be productive to try to trick the script into thinking there's a stair event and not giving it the comments that make it work, so if that's a non stair event I'd recommend renaming it something else, it could even be something like Slope! or Slope_ and it won't consider it a stair event, or if you want to change stair event name you can go in the def is_stair_event? and change the (...) == "Slope" to a different keyword but then you'll have to change all stair events you've done previously.
 
I encountered a very specific bug.
If you enter a ladder slope and walk up it naturally, the animation between your character and the follower is synchronized.
If you enter a slope vertically, step on the slope below, and then complete the ladder, the follower gets stuck at the coordinate of the first slope you stepped on.
The fix for this in my case was as follows:

Ruby:
Expand Collapse Copy
  def slope(x, y, ypos = 0, yheight = 1, begin_offset = 0)
    @stair_start_x = self.is_a?(Game_Player) ? @x : (@real_x / Game_Map::REAL_RES_X).round
    @stair_start_y = self.is_a?(Game_Player) ? @y : (@real_y / Game_Map::REAL_RES_Y).round
    if self.is_a?(Game_FollowingPkmn)
      @stair_start_x = (self.real_x / Game_Map::REAL_RES_X).round
      @stair_start_y = self.y
    end
    @stair_end_x = @stair_start_x + x
    @stair_end_y = @stair_start_y + y
    @stair_y_position = ypos
    @stair_y_height = yheight
    @stair_begin_offset = begin_offset
    @stair_start_y += ypos
    @stair_end_y += ypos
  end

Could it have something to do with a different version of Following EX? It could very well. So I'll share a version I tested and approved with precision, including the very strange staircase animations and the well-done staircases, for anyone interested.
Code:
Expand Collapse Copy
class Game_FollowingPkmn < Game_Follower
  def follow_leader(leader, instant = false, leaderIsTrueLeader = true)
    return if @move_route_forcing
    # Don't interrupt movement unless leader has moved significantly
    return if (jumping? || moving?) && !instant &&
              leader.x == @last_leader_x && leader.y == @last_leader_y
    end_movement

    # Check if the leader has moved to a new tile
    if @last_leader_x.nil? || @last_leader_y.nil? || leader.x != @last_leader_x || leader.y != @last_leader_y
      @last_leader_x = leader.x
      @last_leader_y = leader.y
      maps_connected = $map_factory.areConnected?(leader.map.map_id, self.map.map_id)
      target = nil

      # Get the target tile that self wants to move to
      if maps_connected
        behind_direction = 10 - leader.direction
        target = $map_factory.getFacingTile(behind_direction, leader)
        if target && $map_factory.getTerrainTag(target[0], target[1], target[2]).ledge
          # Get the tile above the ledge (where the leader jumped from)
          target = $map_factory.getFacingTileFromPos(target[0], target[1], target[2], behind_direction)
        end
        target = [leader.map.map_id, leader.x, leader.y] if !target
        # Added
        if defined?(on_stair?) && on_stair?
          if leader.on_stair?
            if leader.stair_start_x != self.stair_start_x
              # Leader stepped on other side so start/end swapped, but not for follower yet
              target[2] = self.y
            elsif leader.stair_start_x < leader.stair_end_x
              # Left to Right
              if leader.x < leader.stair_start_x && self.x != self.stair_start_x
                # Leader stepped off
                target[2] = self.y
              end
            elsif leader.stair_end_x < leader.stair_start_x
              # Right to Left
              if leader.x > leader.stair_start_x && self.x != self.stair_start_x
                # Leader stepped off
                target[2] = self.y
              end
            end
          elsif self.on_middle_of_stair?
            target[2] = self.y
            # Leader is no longer on stair but follower is, so player moved up or down at the start or end of the stair
            if leader.y < self.stair_end_y - self.stair_y_height + 1 || leader.y > self.stair_end_y
              target[2] = self.y
            end
          end
        end
      else
        # Map transfer to an unconnected map
        target = [leader.map.map_id, leader.x, leader.y]
      end
      # Move self to the target
      if self.map.map_id != target[0]
        vector = $map_factory.getRelativePos(target[0], 0, 0, self.map.map_id, @x, @y)
        @map = $map_factory.getMap(target[0])
        # NOTE: Can't use moveto because vector is outside the boundaries of the
        #       map, and moveto doesn't allow setting invalid coordinates.
        @x = vector[0]
        @y = vector[1]
        @real_x = @x * Game_Map::REAL_RES_X
        @real_y = @y * Game_Map::REAL_RES_Y
      end
      if instant || !maps_connected
        moveto(target[1], target[2])
      else
        fancy_moveto(target[1], target[2], leader)
      end
      # Fix for tall grass and surf animations - recalculate bush depth after movement
      calculate_bush_depth
    end
  end
 end
 
I encountered a very specific bug.
If you enter a ladder slope and walk up it naturally, the animation between your character and the follower is synchronized.
If you enter a slope vertically, step on the slope below, and then complete the ladder, the follower gets stuck at the coordinate of the first slope you stepped on.
The fix for this in my case was as follows:

Ruby:
Expand Collapse Copy
  def slope(x, y, ypos = 0, yheight = 1, begin_offset = 0)
    @stair_start_x = self.is_a?(Game_Player) ? @x : (@real_x / Game_Map::REAL_RES_X).round
    @stair_start_y = self.is_a?(Game_Player) ? @y : (@real_y / Game_Map::REAL_RES_Y).round
    if self.is_a?(Game_FollowingPkmn)
      @stair_start_x = (self.real_x / Game_Map::REAL_RES_X).round
      @stair_start_y = self.y
    end
    @stair_end_x = @stair_start_x + x
    @stair_end_y = @stair_start_y + y
    @stair_y_position = ypos
    @stair_y_height = yheight
    @stair_begin_offset = begin_offset
    @stair_start_y += ypos
    @stair_end_y += ypos
  end

Could it have something to do with a different version of Following EX? It could very well. So I'll share a version I tested and approved with precision, including the very strange staircase animations and the well-done staircases, for anyone interested.
Code:
Expand Collapse Copy
class Game_FollowingPkmn < Game_Follower
  def follow_leader(leader, instant = false, leaderIsTrueLeader = true)
    return if @move_route_forcing
    # Don't interrupt movement unless leader has moved significantly
    return if (jumping? || moving?) && !instant &&
              leader.x == @last_leader_x && leader.y == @last_leader_y
    end_movement

    # Check if the leader has moved to a new tile
    if @last_leader_x.nil? || @last_leader_y.nil? || leader.x != @last_leader_x || leader.y != @last_leader_y
      @last_leader_x = leader.x
      @last_leader_y = leader.y
      maps_connected = $map_factory.areConnected?(leader.map.map_id, self.map.map_id)
      target = nil

      # Get the target tile that self wants to move to
      if maps_connected
        behind_direction = 10 - leader.direction
        target = $map_factory.getFacingTile(behind_direction, leader)
        if target && $map_factory.getTerrainTag(target[0], target[1], target[2]).ledge
          # Get the tile above the ledge (where the leader jumped from)
          target = $map_factory.getFacingTileFromPos(target[0], target[1], target[2], behind_direction)
        end
        target = [leader.map.map_id, leader.x, leader.y] if !target
        # Added
        if defined?(on_stair?) && on_stair?
          if leader.on_stair?
            if leader.stair_start_x != self.stair_start_x
              # Leader stepped on other side so start/end swapped, but not for follower yet
              target[2] = self.y
            elsif leader.stair_start_x < leader.stair_end_x
              # Left to Right
              if leader.x < leader.stair_start_x && self.x != self.stair_start_x
                # Leader stepped off
                target[2] = self.y
              end
            elsif leader.stair_end_x < leader.stair_start_x
              # Right to Left
              if leader.x > leader.stair_start_x && self.x != self.stair_start_x
                # Leader stepped off
                target[2] = self.y
              end
            end
          elsif self.on_middle_of_stair?
            target[2] = self.y
            # Leader is no longer on stair but follower is, so player moved up or down at the start or end of the stair
            if leader.y < self.stair_end_y - self.stair_y_height + 1 || leader.y > self.stair_end_y
              target[2] = self.y
            end
          end
        end
      else
        # Map transfer to an unconnected map
        target = [leader.map.map_id, leader.x, leader.y]
      end
      # Move self to the target
      if self.map.map_id != target[0]
        vector = $map_factory.getRelativePos(target[0], 0, 0, self.map.map_id, @x, @y)
        @map = $map_factory.getMap(target[0])
        # NOTE: Can't use moveto because vector is outside the boundaries of the
        #       map, and moveto doesn't allow setting invalid coordinates.
        @x = vector[0]
        @y = vector[1]
        @real_x = @x * Game_Map::REAL_RES_X
        @real_y = @y * Game_Map::REAL_RES_Y
      end
      if instant || !maps_connected
        moveto(target[1], target[2])
      else
        fancy_moveto(target[1], target[2], leader)
      end
      # Fix for tall grass and surf animations - recalculate bush depth after movement
      calculate_bush_depth
    end
  end
 end
Hey, sir, thank you very much for your sharing. I want to use your code. Do you intend to replace the relevant classes and methods in the V21.1 staircase with this code? I'm sorry, my programming skills are quite basic, so I want to confirm with you before proceeding with the actual operation. By the way, I would like to ask if this is compatible with the latest version of Following EX? Yes, that amazing plugin has undergone a recent update. I plan to replace the code I'm currently using with Following EX with this updated plugin after completing the map drawing work.
 
Hey, sir, thank you very much for your sharing. I want to use your code. Do you intend to replace the relevant classes and methods in the V21.1 staircase with this code? I'm sorry, my programming skills are quite basic, so I want to confirm with you before proceeding with the actual operation. By the way, I would like to ask if this is compatible with the latest version of Following EX? Yes, that amazing plugin has undergone a recent update. I plan to replace the code I'm currently using with Following EX with this updated plugin after completing the map drawing work.
Hi, there's still another ladder script option, which is this one:
It seems stable too, and I like how it works.

But I'm still polishing it and will post an update regarding the follower there to improve it even further.
 
OK. I thought these two pieces of code of yours were a supplement and correction to the V21.1 side staircase plugin for this gentleman, because you mentioned that there would be strange phenomena when following the vertical ascent onto the slope. To be honest, I attach great importance to this issue of texture, so I couldn't help asking. If these two pieces of code are an independent solution for the staircase effect, I think I will consider optimizing the game in the later stage. At present, the texture displayed by the V21.1 side staircase plugin is truly impressive.
Hi, there's still another ladder script option, which is this one:
It seems stable too, and I like how it works.

But I'm still polishing it and will post an update regarding the follower there to improve it even further.
 
Back
Top