• 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!
Following Pokemon EX

Resource Following Pokemon EX 2.4.1

f926zTb.gif
HZEiRdb.gif
 
Thank you so much for this! I loved this feature back in HGSS and even back then at Gen 1, it was something I always dreamt of. It's wonderful to have the option in our fangames too. Thank you!
 
Hi @NoNoNever ,
2 years ago, I fixed some issues with the add-on, including tracking delays. I also added some new features.
I was planning to add the swimming Poke icons before I abandoned development. xD
If you want, I can give you the code!
 
Hi @NoNoNever ,
2 years ago, I fixed some issues with the add-on, including tracking delays. I also added some new features.
I was planning to add the swimming Poke icons before I abandoned development. xD
If you want, I can give you the code!
you can send me it if you want, im currently working on a new update
 
Dont update, there is a little bug, wait for a fix first..
 
Hi, I’m still having this bug when moving from one map to another.

 
Just grabbed this and plugged it into essentials, works great so far. What steps would I need to take to add another pokemon to the plugin? I'm very new to essentials this is basically the first thing I've done.
 
Anyone got "Stack level too deep" when install this lastest fix on your project?
 
I tested today
21.1 + hotfix vanilla + lastest following pokemon
I got bug "Stack level too deep".

how to
1. surf to water tile
2. save and close game.
3. load game.

b15b7772c4f650877.png


I don't really understand following code
So I manage to get my game to run again by.
add 1 line to line 12 # force following to temporary stop working.
and get my protagonist back avoid water.

b26be3eac7069e2bd6.png


Please fix it. I love this plug-in.
Thank you in advance.
 
I ran into the same "Stack level too deep" error, and after some testing, it seems to be caused by repeated calls to can_check? involving $game_temp.followers.

When can_check? is called, it accesses $game_temp.followers. The first time this happens, it creates the follower event and sets its position using moveto. While moveto is running, since the player is surfing, the FollowingPkmn.getPokemon script gets triggered to update the swimming sprite. That, in turn, calls can_check? again. But because the follower event hasn't finished initializing yet, the script tries to create the follower again and causing a loop that leads to the "Stack level too deep" error.

I think this could be fixed by moving the sprite refresh code out of moveto and fancy_moveto, and into follow_leader instead.
Ruby:
Expand Collapse Copy
  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

    old_terrain = $map_factory.getTerrainTag(self.map.map_id, self.x, self.y)
    # 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
        if GameData::TerrainTag.exists?(:StairLeft)
          currentTag = $map_factory.getTerrainTag(self.map.map_id, self.x, self.y)
          if currentTag == :StairLeft
            target[2] += (target[1] > $game_player.x ? -1 : 1)
          elsif currentTag == :StairRight
            target[2] += (target[1] < $game_player.x ? -1 : 1)
          end
        end
        # 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?
            # 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

      new_terrain = $map_factory.getTerrainTag(self.map.map_id, target[1], target[2])
      if old_terrain && (old_terrain.can_surf != new_terrain.can_surf) && FollowingPkmn.active?
        pkmn = FollowingPkmn.get_pokemon
        FollowingPkmn.change_sprite(pkmn) if pkmn
      end
      
      # Fix for tall grass and surf animations - recalculate bush depth after movement
      calculate_bush_depth
    end
  end

  #-----------------------------------------------------------------------------
  # Override moveto to ensure bush depth is recalculated after any movement
  #-----------------------------------------------------------------------------
  def moveto(x, y)
    super(x, y)
    calculate_bush_depth
  end

  #-----------------------------------------------------------------------------
  # Override fancy_moveto to ensure bush depth is recalculated after movement
  #-----------------------------------------------------------------------------
  def fancy_moveto(new_x, new_y, leader)
    super(new_x, new_y, leader)
    calculate_bush_depth
  end
 
I'm not sure if this issue is from replacing an older version vs using fresh. But, when I update to this latest version on my project the map transfer issues still exist. However, when I install this on a fresh vanilla Pokemon Essentials this works fine. Any recommendations? I am following the installation instructions and replacing everything. I also updated the trigger to your new trigger and still nothing. Any ideas? I don't get any errors and I have compiled, I can see my engine is now using 2.4.1
 
Back
Top