Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

TrollandToad.com
Reply
 
Thread Tools
  #201    
Old June 14th, 2017 (6:12 AM). Edited June 14th, 2017 by JustKenneth.
JustKenneth's Avatar
JustKenneth JustKenneth is offline
Developer Pokemon The Kingdom of Meralas
     
    Join Date: Oct 2009
    Location: Belgium
    Gender: Male
    Nature: Calm
    Posts: 8
    Hey all,

    first, thanks for the script! Very helpful.
    I ran into an issue while playtesting, when I lose a battle the follower doesn't reappear, it's still there but invisible.
    When I interact with it an error shows up.

    edit:
    Also while pressing 'CTRL' the player is able to walk through walls.

    ---------------------------
    Zircon and Citrine
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `-' for nil:NilClass

    Follow pokemon:743:in `talk_to_pokemon'

    Follow pokemon:1559:in `update'

    Scene_Map:68:in `main'

    Scene_Map:65:in `loop'

    Scene_Map:72:in `main'

    Main:49:in `mainFunctionDebug'

    Main:27:in `mainFunction'

    Main:27:in `pbCriticalCode'

    Main:27:in `mainFunction'

    Main:59






    Any ideas?
    __________________
    "And as the sails arrived, the forest vanished and the city fell. Meralas is king now."
    - Xhicco - Pokemon: The Kingdom of Meralas
    Reply With Quote

    Relevant Advertising!

      #202    
    Old June 16th, 2017 (9:01 PM). Edited June 16th, 2017 by destron4444.
    destron4444 destron4444 is offline
       
      Join Date: Jan 2017
      Gender: Male
      Posts: 3
      It Will not show a unfainted Pokemon
      You may need to add pbPokemonFollow to any event with a start over switch attached. I find blacking out may turn the pbPokemonFollow script off.
      Use "D" to cycle through Pokemon or set a unfainted Pokemon to you first party slot.
      see Line 25
      "ALLOWFIELDSWITCHING = true # Allow the player to cycle through pokemon"
      "Ctrl" in playtest will toggle "no collision" if held. it will toggle your following Pokemon if pressed

      I am having a problem with the
      Line 915
      #===============================================================================
      # * Auto add Script to Kernel.pbCanUseHiddenMove, fix HM bug
      # * Fixed so non-pokemon follower dependent events will return false
      #=============================================================================== section of the follower script
      If the follower script is NOT activated any Partner Dependency will cause the player not able to surf..etc as normal.
      But if the follower script IS activated the player can surf and the any Partner Dependency will walk on water. I have tested this in Playtest as well as game mode on a fresh V16 to find the same issues.
      Reply With Quote
        #203    
      Old June 16th, 2017 (10:27 PM).
      destron4444 destron4444 is offline
         
        Join Date: Jan 2017
        Gender: Male
        Posts: 3
        Update
        If in playtest while follower script installed, if no Pokemon are in the players party when surf is called
        it gives the error

        ---------------------------
        Pokemon Essentials
        ---------------------------
        Exception: NoMethodError

        Message: undefined method `hp' for nil:NilClass

        Follower:419:in `check_surf'

        Follower:880:in `pbSurf'

        PField_HiddenMoves:560

        PField_HiddenMoves:555:in `call'

        Event:54:in `trigger'

        Event:49:in `each'

        Event:49:in `trigger'

        Scene_Map:175:in `follow_update'

        Follower:1552:in `update'

        Scene_Map:68:in `main'
        Reply With Quote
          #204    
        Old June 17th, 2017 (7:20 PM).
        Venomous_Zero86's Avatar
        Venomous_Zero86 Venomous_Zero86 is offline
        Pokemon Chosen Ones (Coming Soon)
           
          Join Date: Mar 2016
          Gender: Male
          Posts: 51
          can i get what were suppose to put in a text or script file i dont know how to add the script code in the event
          Reply With Quote
            #205    
          Old June 17th, 2017 (8:08 PM).
          FallenStorm's Avatar
          FallenStorm FallenStorm is offline
          Pokemon Hyperion Developer
             
            Join Date: Jun 2016
            Location: California
            Gender: Male
            Posts: 14
            How can I make it where even if my Pokemon is fainted, it's still following me? (or make the next non-fainted Pokemon follow me)
            Reply With Quote
              #206    
            Old June 18th, 2017 (8:27 AM).
            Vendily's Avatar
            Vendily Vendily is offline
               
              Join Date: Aug 2015
              Gender: Female
              Nature: Calm
              Posts: 727
              Quote:
              Originally Posted by FallenStorm View Post
              How can I make it where even if my Pokemon is fainted, it's still following me? (or make the next non-fainted Pokemon follow me)
              You could change all instances of $Trainer.party to $Trainer.ablePokemonParty, which is the party, minus eggs and fainted pokemon.
              __________________
              Resources for ROM hackers has moved.

              Reply With Quote
                #207    
              Old June 19th, 2017 (2:42 AM). Edited June 19th, 2017 by destron4444.
              destron4444 destron4444 is offline
                 
                Join Date: Jan 2017
                Gender: Male
                Posts: 3
                Quote:
                Originally Posted by Venomous_Zero86 View Post
                can i get what were suppose to put in a text or script file i dont know how to add the script code in the event
                This info is the VERY FIRST post of this forum
                Make blank event (x) " (x) is the number of any script on said page"
                add"pbPokemonFollow(x)" to a trigger script ..ie starter choice, blackout,poke center,mom, prof, trainer, cut-table tree, player touch, event touch ,auto run ..etc
                you could just use pbPokemonFollow(1) given you have some sort of event on the page ..say a door
                Reply With Quote
                  #208    
                Old July 4th, 2017 (1:27 PM).
                Venomous_Zero86's Avatar
                Venomous_Zero86 Venomous_Zero86 is offline
                Pokemon Chosen Ones (Coming Soon)
                   
                  Join Date: Mar 2016
                  Gender: Male
                  Posts: 51
                  Quote:
                  Originally Posted by destron4444 View Post
                  This info is the VERY FIRST post of this forum
                  Make blank event (x) " (x) is the number of any script on said page"
                  add"pbPokemonFollow(x)" to a trigger script ..ie starter choice, blackout,poke center,mom, prof, trainer, cut-table tree, player touch, event touch ,auto run ..etc
                  you could just use pbPokemonFollow(1) given you have some sort of event on the page ..say a door
                  ---------------------------
                  Pokemon Chosen Ones
                  ---------------------------
                  Exception: NoMethodError

                  Message: undefined method `length' for nil:NilClass

                  Following Pokemon:1779:in `update'

                  Scene_Map:51:in `updateSpritesets'

                  Scene_Map:45:in `each'

                  Scene_Map:45:in `updateSpritesets'

                  Scene_Map:96:in `miniupdate'

                  Messages:145:in `pbUpdateSceneMap'

                  Messages:1519:in `pbMessageDisplay'

                  Messages:1005:in `pbMessage'

                  Messages:649:in `command_101'

                  Interpreter:304:in `execute_command'



                  This exception was logged in

                  C:\Users\Mike\Saved Games/Pokemon Chosen Ones/errorlog.txt.

                  Press Ctrl+C to copy this message to the clipboard.
                  ---------------------------
                  OK
                  ---------------------------

                  this keeps comming up
                  Reply With Quote
                    #209    
                  Old July 4th, 2017 (7:56 PM). Edited July 5th, 2017 by Ulithium_Dragon.
                  Ulithium_Dragon's Avatar
                  Ulithium_Dragon Ulithium_Dragon is offline
                     
                    Join Date: Jul 2015
                    Gender: Male
                    Nature: Timid
                    Posts: 20
                    I have been using the follow script very successfully and all that, but I've noticed it as a major flaw at the moment: the following character will only ever use movement frames 1 and 2.

                    This is because the script forces them to move one space each time the player does, but does not account for when the player is walking continuously, which means that every other step uses movement frames 3 and 4.

                    This causes the follower sprite's movement to look very janky and out of place, since they're basically only doing 1/2 of a normal walking gait (left foot forward, left foot forward, left foot forward, etc.).

                    I've been scratching my head trying to think of a way to alter the script to stop this from happening, but I just don't know enough about both Ruby, and what the limitations of RPG Maker XP are concerning what base functions are avaliable for use. The script uses "move_down", "move_up", "move_left", and "move_right", but I can't think of any way to have it detect when the player is moving continuously, and the only way to force the follower to use frames 3 and 4 would be to have the script be able to tell that the player is holding down the movement key...

                    To show an example of what I mean, I set up a Character sprite that uses the numbers 1, 2, 3, and 4 in place of each movement frame (color coded for easy viewing):



                    As you can see, only frames 1 and 2 are ever used, even when the player is moving continuously (and making use of the PC sprite's 3 and 4 frames).

                    Script:
                    Spoiler:

                    Code:
                    class PokemonTemp
                      attr_accessor :dependentEvents
                    
                      def dependentEvents
                        @dependentEvents=DependentEvents.new if [email protected]
                        return @dependentEvents
                      end
                    end
                    
                    
                    
                    def pbRemoveDependencies()
                      $PokemonTemp.dependentEvents.removeAllEvents()
                      pbDeregisterPartner() rescue nil
                    end
                    
                    def pbAddDependency(event)
                      $PokemonTemp.dependentEvents.addEvent(event)
                    end
                    
                    def pbRemoveDependency(event)
                      $PokemonTemp.dependentEvents.removeEvent(event)
                    end
                    
                    def pbAddDependency2(eventID, eventName, commonEvent)
                      $PokemonTemp.dependentEvents.addEvent($game_map.events[eventID],eventName,commonEvent)
                    end
                    
                    # Gets the Game_Character object associated with a dependent event.
                    def pbGetDependency(eventName)
                      return $PokemonTemp.dependentEvents.getEventByName(eventName)
                    end
                    
                    def pbRemoveDependency2(eventName)
                      $PokemonTemp.dependentEvents.removeEventByName(eventName)
                    end
                    
                    
                    
                    class PokemonGlobalMetadata
                      attr_accessor :dependentEvents
                    
                      def dependentEvents
                        @dependentEvents=[] if [email protected]
                        return @dependentEvents
                      end
                    end
                    
                    
                    
                    class Game_Event
                      def set_starting
                        @starting=true
                      end
                    end
                    
                    
                    
                    def pbTestPass(follower,x,y,direction=nil)
                      return $MapFactory.isPassableStrict?(follower.map.map_id,x,y,follower)
                    end
                    
                    # Same map only
                    def moveThrough(follower,direction)
                      oldThrough=follower.through
                      follower.through=true
                      case direction
                      when 2 # down
                        follower.move_down
                      when 4 # left
                        follower.move_left
                      when 6 # right
                        follower.move_right
                      when 8 # up
                        follower.move_up
                      end 
                      follower.through=oldThrough
                    end
                    
                    # Same map only
                    def moveFancy(follower,direction)
                      deltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
                      deltaY=(direction == 2 ? 1 : (direction == 8 ? -1 : 0))
                      newX = follower.x + deltaX
                      newY = follower.y + deltaY
                      # Move if new position is the player's, or the new position is passable,
                      # or the current position is not passable
                      if ($game_player.x==newX && $game_player.y==newY) ||
                         pbTestPass(follower,newX,newY,0) ||
                         !pbTestPass(follower,follower.x,follower.y,0)
                        oldThrough=follower.through
                        follower.through=true
                        case direction
                        when 2 # down
                          follower.move_down
                        when 4 # left
                          follower.move_left
                        when 6 # right
                          follower.move_right
                        when 8 # up
                          follower.move_up
                        end 
                        follower.through=oldThrough
                      end
                    end
                    
                    # Same map only
                    def jumpFancy(follower,direction)
                      deltaX=(direction == 6 ? 2 : (direction == 4 ? -2 : 0))
                      deltaY=(direction == 2 ? 2 : (direction == 8 ? -2 : 0))
                      halfDeltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
                      halfDeltaY=(direction == 2 ? 1 : (direction == 8 ? -1 : 0))
                      middle=pbTestPass(follower,follower.x+halfDeltaX,follower.y+halfDeltaY,0)
                      ending=pbTestPass(follower,follower.x+deltaX,    follower.y+deltaY,    0)
                      if middle
                        moveFancy(follower,direction)
                        moveFancy(follower,direction)
                      elsif ending
                        if pbTestPass(follower,follower.x,follower.y,0)
                          follower.jump(deltaX,deltaY)
                        else
                          moveThrough(follower,direction)
                          moveThrough(follower,direction)
                        end
                      end
                    end
                    
                    def pbFancyMoveTo(follower,newX,newY)
                      if follower.x-newX==-1 && follower.y==newY
                        moveFancy(follower,6)
                      elsif follower.x-newX==1 && follower.y==newY
                        moveFancy(follower,4)
                      elsif follower.y-newY==-1 && follower.x==newX
                        moveFancy(follower,2)
                      elsif follower.y-newY==1 && follower.x==newX
                        moveFancy(follower,8)
                      elsif follower.x-newX==-2 && follower.y==newY
                        jumpFancy(follower,6)
                      elsif follower.x-newX==2 && follower.y==newY
                        jumpFancy(follower,4)
                      elsif follower.y-newY==-2 && follower.x==newX
                        jumpFancy(follower,2)
                      elsif follower.y-newY==2 && follower.x==newX
                        jumpFancy(follower,8)
                      elsif follower.x!=newX || follower.y!=newY
                        follower.moveto(newX,newY)
                      end
                    end
                    
                    
                    
                    class DependentEvents
                      def createEvent(eventData)
                        rpgEvent=RPG::Event.new(eventData[3],eventData[4])
                        rpgEvent.id=eventData[1]
                        if eventData[9]
                          # Must setup common event list here and now
                          commonEvent=Game_CommonEvent.new(eventData[9])
                          rpgEvent.pages[0].list=commonEvent.list
                        end
                        newEvent=Game_Event.new(eventData[0],rpgEvent,
                           $MapFactory.getMap(eventData[2]))
                        newEvent.character_name=eventData[6]
                        newEvent.character_hue=eventData[7]
                        case eventData[5] # direction
                        when 2 # down
                          newEvent.turn_down
                        when 4 # left
                          newEvent.turn_left
                        when 6 # right
                          newEvent.turn_right
                        when 8 # up
                          newEvent.turn_up
                        end
                        return newEvent
                      end
                    
                      attr_reader :lastUpdate
                    
                      def initialize
                        # Original map, Event ID, Current map, X, Y, Direction
                        events=$PokemonGlobal.dependentEvents
                        @realEvents=[]
                        @lastUpdate=-1
                        for event in events
                          @realEvents.push(createEvent(event))
                        end
                      end
                    
                      def pbEnsureEvent(event, newMapID)
                        events=$PokemonGlobal.dependentEvents
                        found=-1
                        for i in 0...events.length
                          # Check original map ID and original event ID 
                          if events[i][0]==event.map_id && events[i][1]==event.id
                            # Change current map ID
                            events[i][2]=newMapID
                            newEvent=createEvent(events[i])
                            # Replace event
                            @realEvents[i]=newEvent
                            @lastUpdate+=1
                            return i
                          end
                        end
                        return -1
                      end
                    
                      def pbFollowEventAcrossMaps(leader,follower,instant=false,leaderIsTrueLeader=true)
                        d=leader.direction
                        areConnected=$MapFactory.areConnected?(leader.map.map_id,follower.map.map_id)
                        # Get the rear facing tile of leader
                        facingDirection=[0,0,8,0,6,0,4,0,2][d]
                        if !leaderIsTrueLeader && areConnected
                          relativePos=$MapFactory.getThisAndOtherEventRelativePos(leader,follower)
                          if (relativePos[1]==0 && relativePos[0]==2) # 2 spaces to the right of leader
                            facingDirection=6
                          elsif (relativePos[1]==0 && relativePos[0]==-2) # 2 spaces to the left of leader
                            facingDirection=4
                          elsif relativePos[1]==-2 && relativePos[0]==0 # 2 spaces above leader
                            facingDirection=8
                          elsif relativePos[1]==2 && relativePos[0]==0 # 2 spaces below leader
                            facingDirection=2
                          end
                        end
                        facings=[facingDirection] # Get facing from behind
                        facings.push([0,0,4,0,8,0,2,0,6][d]) # Get right facing
                        facings.push([0,0,6,0,2,0,8,0,4][d]) # Get left facing
                        if !leaderIsTrueLeader
                          facings.push([0,0,2,0,4,0,6,0,8][d]) # Get forward facing
                        end
                        mapTile=nil
                        if areConnected
                          bestRelativePos=-1
                          oldthrough=follower.through
                          follower.through=false
                          for i in 0...facings.length
                            facing=facings[i]
                            tile=$MapFactory.getFacingTile(facing,leader)
                            passable=tile && $MapFactory.isPassableStrict?(tile[0],tile[1],tile[2],follower)
                            if i==0 && !passable && tile && 
                               PBTerrain.isLedge?($MapFactory.getTerrainTag(tile[0],tile[1],tile[2]))
                              # If the tile isn't passable and the tile is a ledge,
                              # get tile from further behind
                              tile=$MapFactory.getFacingTileFromPos(tile[0],tile[1],tile[2],facing)
                              passable=tile && $MapFactory.isPassableStrict?(tile[0],tile[1],tile[2],follower)
                            end
                            if passable
                              relativePos=$MapFactory.getThisAndOtherPosRelativePos(
                                 follower,tile[0],tile[1],tile[2])
                              distance=Math.sqrt(relativePos[0]*relativePos[0]+relativePos[1]*relativePos[1])
                              if bestRelativePos==-1 || bestRelativePos>distance
                                bestRelativePos=distance
                                mapTile=tile
                              end
                              if i==0 && distance<=1 # Prefer behind if tile can move up to 1 space
                                break
                              end
                            end
                          end
                          follower.through=oldthrough
                        else
                          tile=$MapFactory.getFacingTile(facings[0],leader)
                          passable=tile && $MapFactory.isPassableStrict?(
                             tile[0],tile[1],tile[2],follower)
                          mapTile=passable ? mapTile : nil
                        end
                        if mapTile && follower.map.map_id==mapTile[0]
                          # Follower is on same map
                          newX=mapTile[1]
                          newY=mapTile[2]
                          deltaX=(d == 6 ? -1 : d == 4 ? 1 : 0)
                          deltaY=(d == 2 ? -1 : d == 8 ? 1 : 0)
                          posX = newX + deltaX
                          posY = newY + deltaY
                          follower.move_speed=leader.move_speed # sync movespeed
                          if (follower.x-newX==-1 && follower.y==newY) ||
                             (follower.x-newX==1 && follower.y==newY) ||
                             (follower.y-newY==-1 && follower.x==newX) ||
                             (follower.y-newY==1 && follower.x==newX)
                            if instant
                              follower.moveto(newX,newY)
                            else
                              pbFancyMoveTo(follower,newX,newY)
                            end
                          elsif (follower.x-newX==-2 && follower.y==newY) ||
                                (follower.x-newX==2 && follower.y==newY) ||
                                (follower.y-newY==-2 && follower.x==newX) ||
                                (follower.y-newY==2 && follower.x==newX)
                            if instant
                              follower.moveto(newX,newY)
                            else
                              pbFancyMoveTo(follower,newX,newY)
                            end
                          elsif follower.x!=posX || follower.y!=posY
                            if instant
                              follower.moveto(newX,newY)
                            else
                              pbFancyMoveTo(follower,posX,posY)
                              pbFancyMoveTo(follower,newX,newY)
                            end
                          end
                          pbTurnTowardEvent(follower,leader)
                        else
                          if !mapTile
                            # Make current position into leader's position
                            mapTile=[leader.map.map_id,leader.x,leader.y]
                          end
                          if follower.map.map_id==mapTile[0]
                            # Follower is on same map as leader
                            follower.moveto(leader.x,leader.y)
                            pbTurnTowardEvent(follower,leader)
                          else
                            # Follower will move to different map
                            events=$PokemonGlobal.dependentEvents
                            eventIndex=pbEnsureEvent(follower,mapTile[0])
                            if eventIndex>=0
                              [email protected][eventIndex]
                              newEventData=events[eventIndex]
                              newFollower.moveto(mapTile[1],mapTile[2])
                              newEventData[3]=mapTile[1]
                              newEventData[4]=mapTile[2]
                              if mapTile[0]==leader.map.map_id
                                pbTurnTowardEvent(follower,leader)
                              end
                            end
                          end
                        end
                      end
                    
                      def debugEcho
                        self.eachEvent {|e,d|
                           echoln d
                           echoln [e.map_id,e.map.map_id,e.id]
                        }
                      end
                    
                      def pbMapChangeMoveDependentEvents
                        events=$PokemonGlobal.dependentEvents
                        updateDependentEvents
                        leader=$game_player
                        for i in 0...events.length
                          [email protected][i]
                          pbFollowEventAcrossMaps(leader,event,true,i==0)
                          # Update X and Y for this event
                          events[i][3]=event.x
                          events[i][4]=event.y
                          events[i][5]=event.direction
                          # Set leader to this event
                          leader=event
                        end
                      end
                    
                      def pbMoveDependentEvents
                        events=$PokemonGlobal.dependentEvents
                        updateDependentEvents
                        leader=$game_player
                        for i in 0...events.length
                          [email protected][i]
                          pbFollowEventAcrossMaps(leader,event,false,i==0)
                          # Update X and Y for this event
                          events[i][3]=event.x
                          events[i][4]=event.y
                          events[i][5]=event.direction
                          # Set leader to this event
                          leader=event
                        end
                      end
                    
                      def pbTurnDependentEvents
                        events=$PokemonGlobal.dependentEvents
                        updateDependentEvents
                        leader=$game_player
                        for i in 0...events.length
                          [email protected][i]
                          pbTurnTowardEvent(event,leader)
                          # Update direction for this event
                          events[i][5]=event.direction
                          # Set leader to this event
                          leader=event
                        end
                      end
                    
                      def eachEvent
                        events=$PokemonGlobal.dependentEvents
                        for i in 0...events.length
                          yield @realEvents[i],events[i]
                        end   
                      end
                    
                      def updateDependentEvents
                        events=$PokemonGlobal.dependentEvents
                        return if events.length==0
                        for i in 0...events.length
                          [email protected][i]
                          next if [email protected][i]
                          event.transparent=$game_player.transparent
                          if (event.jumping? || event.moving?) || !($game_player.jumping? || $game_player.moving?) then
                            event.update
                          elsif !event.starting
                            event.set_starting
                            event.update
                            event.clear_starting
                          end
                          events[i][3]=event.x
                          events[i][4]=event.y
                          events[i][5]=event.direction
                        end
                        # Check event triggers
                        if Input.trigger?(Input::C) && !pbMapInterpreterRunning?
                          # Get position of tile facing the player
                          facingTile=$MapFactory.getFacingTile()
                          self.eachEvent {|e,d|
                             next if !d[9]
                             if e.x==$game_player.x && e.y==$game_player.y
                               # On same position
                               if not e.jumping? && (!e.respond_to?("over_trigger") || e.over_trigger?)
                                 if e.list.size>1
                                   # Start event
                                   $game_map.refresh if $game_map.need_refresh
                                   e.lock
                                   pbMapInterpreter.setup(e.list,e.id,e.map.map_id)
                                 end
                               end
                             elsif facingTile && e.map.map_id==facingTile[0] &&
                                   e.x==facingTile[1] && e.y==facingTile[2]
                               # On facing tile
                               if not e.jumping? && (!e.respond_to?("over_trigger") || !e.over_trigger?)
                                 if e.list.size>1
                                   # Start event
                                   $game_map.refresh if $game_map.need_refresh
                                   e.lock
                                   pbMapInterpreter.setup(e.list,e.id,e.map.map_id)
                                 end
                               end
                             end
                          }
                        end
                      end
                    
                      def removeEvent(event)
                        events=$PokemonGlobal.dependentEvents
                        mapid=$game_map.map_id
                        for i in 0...events.length
                          if events[i][2]==mapid && # Refer to current map
                             events[i][0]==event.map_id && # Event's map ID is original ID
                             events[i][1]==event.id
                            events[i]=nil
                            @realEvents[i]=nil
                            @lastUpdate+=1
                          end
                          events.compact!
                          @realEvents.compact!
                        end
                      end
                    
                      def getEventByName(name)
                        events=$PokemonGlobal.dependentEvents
                        for i in 0...events.length
                          if events[i] && events[i][8]==name # Arbitrary name given to dependent event
                            return @realEvents[i]
                          end
                        end
                        return nil
                      end
                    
                      def removeAllEvents
                        events=$PokemonGlobal.dependentEvents
                        events.clear
                        @realEvents.clear
                        @lastUpdate+=1
                      end
                    
                      def removeEventByName(name)
                        events=$PokemonGlobal.dependentEvents
                        for i in 0...events.length
                          if events[i] && events[i][8]==name # Arbitrary name given to dependent event
                            events[i]=nil
                            @realEvents[i]=nil
                            @lastUpdate+=1
                          end
                          events.compact!
                          @realEvents.compact!
                        end
                      end
                    
                      def addEvent(event,eventName=nil,commonEvent=nil)
                        return if !event
                        events=$PokemonGlobal.dependentEvents
                        for i in 0...events.length
                          if events[i] && events[i][0]==$game_map.map_id && events[i][1]==event.id
                            # Already exists
                            return
                          end
                        end
                        # Original map ID, original event ID, current map ID,
                        # event X, event Y, event direction,
                        # event's filename,
                        # event's hue, event's name, common event ID
                        eventData=[
                           $game_map.map_id,event.id,$game_map.map_id,
                           event.x,event.y,event.direction,
                           event.character_name.clone,
                           event.character_hue,eventName,commonEvent
                        ]
                        newEvent=createEvent(eventData)
                        events.push(eventData)
                        @realEvents.push(newEvent)
                        @lastUpdate+=1
                        event.erase
                      end
                    end
                    
                    
                    
                    class DependentEventSprites
                      def refresh
                        for sprite in @sprites
                          sprite.dispose
                        end
                        @sprites.clear
                        $PokemonTemp.dependentEvents.eachEvent {|event,data|
                           if data[0][email protected]_id # Check original map
                             @map.events[data[1]].erase
                           end
                           if data[2][email protected]_id # Check current map
                             @sprites.push(Sprite_Character.new(@viewport,event))
                           end
                        }
                      end
                    
                      def initialize(viewport,map)
                        @disposed=false
                        @sprites=[]
                        @map=map
                        @viewport=viewport
                        refresh
                        @lastUpdate=nil
                      end
                    
                      def update
                        if [email protected]
                          refresh
                          @lastUpdate=$PokemonTemp.dependentEvents.lastUpdate
                        end
                        for sprite in @sprites
                          sprite.update
                        end
                      end
                    
                      def dispose
                        return if @disposed
                        for sprite in @sprites
                          sprite.dispose
                        end
                        @sprites.clear
                        @disposed=true
                      end
                    
                      def disposed?
                        @disposed
                      end
                    end
                    
                    
                    
                    Events.onSpritesetCreate+=proc{|sender,e|
                       spriteset=e[0] # Spriteset being created
                       viewport=e[1] # Viewport used for tilemap and characters
                       map=spriteset.map # Map associated with the spriteset (not necessarily the current map).
                       spriteset.addUserSprite(DependentEventSprites.new(viewport,map))
                    }
                    
                    Events.onMapSceneChange+=proc{|sender,e|
                       scene=e[0]
                       mapChanged=e[1]
                       if mapChanged
                         $PokemonTemp.dependentEvents.pbMapChangeMoveDependentEvents
                       end
                    }

                    Can anyone think of a way to fix this behavior? I'm stumped. :L
                    Reply With Quote
                      #210    
                    Old July 5th, 2017 (1:41 PM).
                    Ulithium_Dragon's Avatar
                    Ulithium_Dragon Ulithium_Dragon is offline
                       
                      Join Date: Jul 2015
                      Gender: Male
                      Nature: Timid
                      Posts: 20
                      Quote:
                      Originally Posted by Ulithium_Dragon View Post
                      I have been using the follow script very successfully and all that, but I've noticed it as a major flaw at the moment: the following character will only ever use movement frames 1 and 2.

                      This is because the script forces them to move one space each time the player does, but does not account for when the player is walking continuously, which means that every other step uses movement frames 3 and 4.

                      This causes the follower sprite's movement to look very janky and out of place, since they're basically only doing 1/2 of a normal walking gait (left foot forward, left foot forward, left foot forward, etc.).

                      I've been scratching my head trying to think of a way to alter the script to stop this from happening, but I just don't know enough about both Ruby, and what the limitations of RPG Maker XP are concerning what base functions are avaliable for use. The script uses "move_down", "move_up", "move_left", and "move_right", but I can't think of any way to have it detect when the player is moving continuously, and the only way to force the follower to use frames 3 and 4 would be to have the script be able to tell that the player is holding down the movement key...

                      To show an example of what I mean, I set up a Character sprite that uses the numbers 1, 2, 3, and 4 in place of each movement frame (color coded for easy viewing):



                      As you can see, only frames 1 and 2 are ever used, even when the player is moving continuously (and making use of the PC sprite's 3 and 4 frames).

                      Script:
                      Spoiler:

                      Code:
                      class PokemonTemp
                        attr_accessor :dependentEvents
                      
                        def dependentEvents
                          @dependentEvents=DependentEvents.new if [email protected]
                          return @dependentEvents
                        end
                      end
                      
                      
                      
                      def pbRemoveDependencies()
                        $PokemonTemp.dependentEvents.removeAllEvents()
                        pbDeregisterPartner() rescue nil
                      end
                      
                      def pbAddDependency(event)
                        $PokemonTemp.dependentEvents.addEvent(event)
                      end
                      
                      def pbRemoveDependency(event)
                        $PokemonTemp.dependentEvents.removeEvent(event)
                      end
                      
                      def pbAddDependency2(eventID, eventName, commonEvent)
                        $PokemonTemp.dependentEvents.addEvent($game_map.events[eventID],eventName,commonEvent)
                      end
                      
                      # Gets the Game_Character object associated with a dependent event.
                      def pbGetDependency(eventName)
                        return $PokemonTemp.dependentEvents.getEventByName(eventName)
                      end
                      
                      def pbRemoveDependency2(eventName)
                        $PokemonTemp.dependentEvents.removeEventByName(eventName)
                      end
                      
                      
                      
                      class PokemonGlobalMetadata
                        attr_accessor :dependentEvents
                      
                        def dependentEvents
                          @dependentEvents=[] if [email protected]
                          return @dependentEvents
                        end
                      end
                      
                      
                      
                      class Game_Event
                        def set_starting
                          @starting=true
                        end
                      end
                      
                      
                      
                      def pbTestPass(follower,x,y,direction=nil)
                        return $MapFactory.isPassableStrict?(follower.map.map_id,x,y,follower)
                      end
                      
                      # Same map only
                      def moveThrough(follower,direction)
                        oldThrough=follower.through
                        follower.through=true
                        case direction
                        when 2 # down
                          follower.move_down
                        when 4 # left
                          follower.move_left
                        when 6 # right
                          follower.move_right
                        when 8 # up
                          follower.move_up
                        end 
                        follower.through=oldThrough
                      end
                      
                      # Same map only
                      def moveFancy(follower,direction)
                        deltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
                        deltaY=(direction == 2 ? 1 : (direction == 8 ? -1 : 0))
                        newX = follower.x + deltaX
                        newY = follower.y + deltaY
                        # Move if new position is the player's, or the new position is passable,
                        # or the current position is not passable
                        if ($game_player.x==newX && $game_player.y==newY) ||
                           pbTestPass(follower,newX,newY,0) ||
                           !pbTestPass(follower,follower.x,follower.y,0)
                          oldThrough=follower.through
                          follower.through=true
                          case direction
                          when 2 # down
                            follower.move_down
                          when 4 # left
                            follower.move_left
                          when 6 # right
                            follower.move_right
                          when 8 # up
                            follower.move_up
                          end 
                          follower.through=oldThrough
                        end
                      end
                      
                      # Same map only
                      def jumpFancy(follower,direction)
                        deltaX=(direction == 6 ? 2 : (direction == 4 ? -2 : 0))
                        deltaY=(direction == 2 ? 2 : (direction == 8 ? -2 : 0))
                        halfDeltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
                        halfDeltaY=(direction == 2 ? 1 : (direction == 8 ? -1 : 0))
                        middle=pbTestPass(follower,follower.x+halfDeltaX,follower.y+halfDeltaY,0)
                        ending=pbTestPass(follower,follower.x+deltaX,    follower.y+deltaY,    0)
                        if middle
                          moveFancy(follower,direction)
                          moveFancy(follower,direction)
                        elsif ending
                          if pbTestPass(follower,follower.x,follower.y,0)
                            follower.jump(deltaX,deltaY)
                          else
                            moveThrough(follower,direction)
                            moveThrough(follower,direction)
                          end
                        end
                      end
                      
                      def pbFancyMoveTo(follower,newX,newY)
                        if follower.x-newX==-1 && follower.y==newY
                          moveFancy(follower,6)
                        elsif follower.x-newX==1 && follower.y==newY
                          moveFancy(follower,4)
                        elsif follower.y-newY==-1 && follower.x==newX
                          moveFancy(follower,2)
                        elsif follower.y-newY==1 && follower.x==newX
                          moveFancy(follower,8)
                        elsif follower.x-newX==-2 && follower.y==newY
                          jumpFancy(follower,6)
                        elsif follower.x-newX==2 && follower.y==newY
                          jumpFancy(follower,4)
                        elsif follower.y-newY==-2 && follower.x==newX
                          jumpFancy(follower,2)
                        elsif follower.y-newY==2 && follower.x==newX
                          jumpFancy(follower,8)
                        elsif follower.x!=newX || follower.y!=newY
                          follower.moveto(newX,newY)
                        end
                      end
                      
                      
                      
                      class DependentEvents
                        def createEvent(eventData)
                          rpgEvent=RPG::Event.new(eventData[3],eventData[4])
                          rpgEvent.id=eventData[1]
                          if eventData[9]
                            # Must setup common event list here and now
                            commonEvent=Game_CommonEvent.new(eventData[9])
                            rpgEvent.pages[0].list=commonEvent.list
                          end
                          newEvent=Game_Event.new(eventData[0],rpgEvent,
                             $MapFactory.getMap(eventData[2]))
                          newEvent.character_name=eventData[6]
                          newEvent.character_hue=eventData[7]
                          case eventData[5] # direction
                          when 2 # down
                            newEvent.turn_down
                          when 4 # left
                            newEvent.turn_left
                          when 6 # right
                            newEvent.turn_right
                          when 8 # up
                            newEvent.turn_up
                          end
                          return newEvent
                        end
                      
                        attr_reader :lastUpdate
                      
                        def initialize
                          # Original map, Event ID, Current map, X, Y, Direction
                          events=$PokemonGlobal.dependentEvents
                          @realEvents=[]
                          @lastUpdate=-1
                          for event in events
                            @realEvents.push(createEvent(event))
                          end
                        end
                      
                        def pbEnsureEvent(event, newMapID)
                          events=$PokemonGlobal.dependentEvents
                          found=-1
                          for i in 0...events.length
                            # Check original map ID and original event ID 
                            if events[i][0]==event.map_id && events[i][1]==event.id
                              # Change current map ID
                              events[i][2]=newMapID
                              newEvent=createEvent(events[i])
                              # Replace event
                              @realEvents[i]=newEvent
                              @lastUpdate+=1
                              return i
                            end
                          end
                          return -1
                        end
                      
                        def pbFollowEventAcrossMaps(leader,follower,instant=false,leaderIsTrueLeader=true)
                          d=leader.direction
                          areConnected=$MapFactory.areConnected?(leader.map.map_id,follower.map.map_id)
                          # Get the rear facing tile of leader
                          facingDirection=[0,0,8,0,6,0,4,0,2][d]
                          if !leaderIsTrueLeader && areConnected
                            relativePos=$MapFactory.getThisAndOtherEventRelativePos(leader,follower)
                            if (relativePos[1]==0 && relativePos[0]==2) # 2 spaces to the right of leader
                              facingDirection=6
                            elsif (relativePos[1]==0 && relativePos[0]==-2) # 2 spaces to the left of leader
                              facingDirection=4
                            elsif relativePos[1]==-2 && relativePos[0]==0 # 2 spaces above leader
                              facingDirection=8
                            elsif relativePos[1]==2 && relativePos[0]==0 # 2 spaces below leader
                              facingDirection=2
                            end
                          end
                          facings=[facingDirection] # Get facing from behind
                          facings.push([0,0,4,0,8,0,2,0,6][d]) # Get right facing
                          facings.push([0,0,6,0,2,0,8,0,4][d]) # Get left facing
                          if !leaderIsTrueLeader
                            facings.push([0,0,2,0,4,0,6,0,8][d]) # Get forward facing
                          end
                          mapTile=nil
                          if areConnected
                            bestRelativePos=-1
                            oldthrough=follower.through
                            follower.through=false
                            for i in 0...facings.length
                              facing=facings[i]
                              tile=$MapFactory.getFacingTile(facing,leader)
                              passable=tile && $MapFactory.isPassableStrict?(tile[0],tile[1],tile[2],follower)
                              if i==0 && !passable && tile && 
                                 PBTerrain.isLedge?($MapFactory.getTerrainTag(tile[0],tile[1],tile[2]))
                                # If the tile isn't passable and the tile is a ledge,
                                # get tile from further behind
                                tile=$MapFactory.getFacingTileFromPos(tile[0],tile[1],tile[2],facing)
                                passable=tile && $MapFactory.isPassableStrict?(tile[0],tile[1],tile[2],follower)
                              end
                              if passable
                                relativePos=$MapFactory.getThisAndOtherPosRelativePos(
                                   follower,tile[0],tile[1],tile[2])
                                distance=Math.sqrt(relativePos[0]*relativePos[0]+relativePos[1]*relativePos[1])
                                if bestRelativePos==-1 || bestRelativePos>distance
                                  bestRelativePos=distance
                                  mapTile=tile
                                end
                                if i==0 && distance<=1 # Prefer behind if tile can move up to 1 space
                                  break
                                end
                              end
                            end
                            follower.through=oldthrough
                          else
                            tile=$MapFactory.getFacingTile(facings[0],leader)
                            passable=tile && $MapFactory.isPassableStrict?(
                               tile[0],tile[1],tile[2],follower)
                            mapTile=passable ? mapTile : nil
                          end
                          if mapTile && follower.map.map_id==mapTile[0]
                            # Follower is on same map
                            newX=mapTile[1]
                            newY=mapTile[2]
                            deltaX=(d == 6 ? -1 : d == 4 ? 1 : 0)
                            deltaY=(d == 2 ? -1 : d == 8 ? 1 : 0)
                            posX = newX + deltaX
                            posY = newY + deltaY
                            follower.move_speed=leader.move_speed # sync movespeed
                            if (follower.x-newX==-1 && follower.y==newY) ||
                               (follower.x-newX==1 && follower.y==newY) ||
                               (follower.y-newY==-1 && follower.x==newX) ||
                               (follower.y-newY==1 && follower.x==newX)
                              if instant
                                follower.moveto(newX,newY)
                              else
                                pbFancyMoveTo(follower,newX,newY)
                              end
                            elsif (follower.x-newX==-2 && follower.y==newY) ||
                                  (follower.x-newX==2 && follower.y==newY) ||
                                  (follower.y-newY==-2 && follower.x==newX) ||
                                  (follower.y-newY==2 && follower.x==newX)
                              if instant
                                follower.moveto(newX,newY)
                              else
                                pbFancyMoveTo(follower,newX,newY)
                              end
                            elsif follower.x!=posX || follower.y!=posY
                              if instant
                                follower.moveto(newX,newY)
                              else
                                pbFancyMoveTo(follower,posX,posY)
                                pbFancyMoveTo(follower,newX,newY)
                              end
                            end
                            pbTurnTowardEvent(follower,leader)
                          else
                            if !mapTile
                              # Make current position into leader's position
                              mapTile=[leader.map.map_id,leader.x,leader.y]
                            end
                            if follower.map.map_id==mapTile[0]
                              # Follower is on same map as leader
                              follower.moveto(leader.x,leader.y)
                              pbTurnTowardEvent(follower,leader)
                            else
                              # Follower will move to different map
                              events=$PokemonGlobal.dependentEvents
                              eventIndex=pbEnsureEvent(follower,mapTile[0])
                              if eventIndex>=0
                                [email protected][eventIndex]
                                newEventData=events[eventIndex]
                                newFollower.moveto(mapTile[1],mapTile[2])
                                newEventData[3]=mapTile[1]
                                newEventData[4]=mapTile[2]
                                if mapTile[0]==leader.map.map_id
                                  pbTurnTowardEvent(follower,leader)
                                end
                              end
                            end
                          end
                        end
                      
                        def debugEcho
                          self.eachEvent {|e,d|
                             echoln d
                             echoln [e.map_id,e.map.map_id,e.id]
                          }
                        end
                      
                        def pbMapChangeMoveDependentEvents
                          events=$PokemonGlobal.dependentEvents
                          updateDependentEvents
                          leader=$game_player
                          for i in 0...events.length
                            [email protected][i]
                            pbFollowEventAcrossMaps(leader,event,true,i==0)
                            # Update X and Y for this event
                            events[i][3]=event.x
                            events[i][4]=event.y
                            events[i][5]=event.direction
                            # Set leader to this event
                            leader=event
                          end
                        end
                      
                        def pbMoveDependentEvents
                          events=$PokemonGlobal.dependentEvents
                          updateDependentEvents
                          leader=$game_player
                          for i in 0...events.length
                            [email protected][i]
                            pbFollowEventAcrossMaps(leader,event,false,i==0)
                            # Update X and Y for this event
                            events[i][3]=event.x
                            events[i][4]=event.y
                            events[i][5]=event.direction
                            # Set leader to this event
                            leader=event
                          end
                        end
                      
                        def pbTurnDependentEvents
                          events=$PokemonGlobal.dependentEvents
                          updateDependentEvents
                          leader=$game_player
                          for i in 0...events.length
                            [email protected][i]
                            pbTurnTowardEvent(event,leader)
                            # Update direction for this event
                            events[i][5]=event.direction
                            # Set leader to this event
                            leader=event
                          end
                        end
                      
                        def eachEvent
                          events=$PokemonGlobal.dependentEvents
                          for i in 0...events.length
                            yield @realEvents[i],events[i]
                          end   
                        end
                      
                        def updateDependentEvents
                          events=$PokemonGlobal.dependentEvents
                          return if events.length==0
                          for i in 0...events.length
                            [email protected][i]
                            next if [email protected][i]
                            event.transparent=$game_player.transparent
                            if (event.jumping? || event.moving?) || !($game_player.jumping? || $game_player.moving?) then
                              event.update
                            elsif !event.starting
                              event.set_starting
                              event.update
                              event.clear_starting
                            end
                            events[i][3]=event.x
                            events[i][4]=event.y
                            events[i][5]=event.direction
                          end
                          # Check event triggers
                          if Input.trigger?(Input::C) && !pbMapInterpreterRunning?
                            # Get position of tile facing the player
                            facingTile=$MapFactory.getFacingTile()
                            self.eachEvent {|e,d|
                               next if !d[9]
                               if e.x==$game_player.x && e.y==$game_player.y
                                 # On same position
                                 if not e.jumping? && (!e.respond_to?("over_trigger") || e.over_trigger?)
                                   if e.list.size>1
                                     # Start event
                                     $game_map.refresh if $game_map.need_refresh
                                     e.lock
                                     pbMapInterpreter.setup(e.list,e.id,e.map.map_id)
                                   end
                                 end
                               elsif facingTile && e.map.map_id==facingTile[0] &&
                                     e.x==facingTile[1] && e.y==facingTile[2]
                                 # On facing tile
                                 if not e.jumping? && (!e.respond_to?("over_trigger") || !e.over_trigger?)
                                   if e.list.size>1
                                     # Start event
                                     $game_map.refresh if $game_map.need_refresh
                                     e.lock
                                     pbMapInterpreter.setup(e.list,e.id,e.map.map_id)
                                   end
                                 end
                               end
                            }
                          end
                        end
                      
                        def removeEvent(event)
                          events=$PokemonGlobal.dependentEvents
                          mapid=$game_map.map_id
                          for i in 0...events.length
                            if events[i][2]==mapid && # Refer to current map
                               events[i][0]==event.map_id && # Event's map ID is original ID
                               events[i][1]==event.id
                              events[i]=nil
                              @realEvents[i]=nil
                              @lastUpdate+=1
                            end
                            events.compact!
                            @realEvents.compact!
                          end
                        end
                      
                        def getEventByName(name)
                          events=$PokemonGlobal.dependentEvents
                          for i in 0...events.length
                            if events[i] && events[i][8]==name # Arbitrary name given to dependent event
                              return @realEvents[i]
                            end
                          end
                          return nil
                        end
                      
                        def removeAllEvents
                          events=$PokemonGlobal.dependentEvents
                          events.clear
                          @realEvents.clear
                          @lastUpdate+=1
                        end
                      
                        def removeEventByName(name)
                          events=$PokemonGlobal.dependentEvents
                          for i in 0...events.length
                            if events[i] && events[i][8]==name # Arbitrary name given to dependent event
                              events[i]=nil
                              @realEvents[i]=nil
                              @lastUpdate+=1
                            end
                            events.compact!
                            @realEvents.compact!
                          end
                        end
                      
                        def addEvent(event,eventName=nil,commonEvent=nil)
                          return if !event
                          events=$PokemonGlobal.dependentEvents
                          for i in 0...events.length
                            if events[i] && events[i][0]==$game_map.map_id && events[i][1]==event.id
                              # Already exists
                              return
                            end
                          end
                          # Original map ID, original event ID, current map ID,
                          # event X, event Y, event direction,
                          # event's filename,
                          # event's hue, event's name, common event ID
                          eventData=[
                             $game_map.map_id,event.id,$game_map.map_id,
                             event.x,event.y,event.direction,
                             event.character_name.clone,
                             event.character_hue,eventName,commonEvent
                          ]
                          newEvent=createEvent(eventData)
                          events.push(eventData)
                          @realEvents.push(newEvent)
                          @lastUpdate+=1
                          event.erase
                        end
                      end
                      
                      
                      
                      class DependentEventSprites
                        def refresh
                          for sprite in @sprites
                            sprite.dispose
                          end
                          @sprites.clear
                          $PokemonTemp.dependentEvents.eachEvent {|event,data|
                             if data[0][email protected]_id # Check original map
                               @map.events[data[1]].erase
                             end
                             if data[2][email protected]_id # Check current map
                               @sprites.push(Sprite_Character.new(@viewport,event))
                             end
                          }
                        end
                      
                        def initialize(viewport,map)
                          @disposed=false
                          @sprites=[]
                          @map=map
                          @viewport=viewport
                          refresh
                          @lastUpdate=nil
                        end
                      
                        def update
                          if [email protected]
                            refresh
                            @lastUpdate=$PokemonTemp.dependentEvents.lastUpdate
                          end
                          for sprite in @sprites
                            sprite.update
                          end
                        end
                      
                        def dispose
                          return if @disposed
                          for sprite in @sprites
                            sprite.dispose
                          end
                          @sprites.clear
                          @disposed=true
                        end
                      
                        def disposed?
                          @disposed
                        end
                      end
                      
                      
                      
                      Events.onSpritesetCreate+=proc{|sender,e|
                         spriteset=e[0] # Spriteset being created
                         viewport=e[1] # Viewport used for tilemap and characters
                         map=spriteset.map # Map associated with the spriteset (not necessarily the current map).
                         spriteset.addUserSprite(DependentEventSprites.new(viewport,map))
                      }
                      
                      Events.onMapSceneChange+=proc{|sender,e|
                         scene=e[0]
                         mapChanged=e[1]
                         if mapChanged
                           $PokemonTemp.dependentEvents.pbMapChangeMoveDependentEvents
                         end
                      }

                      Can anyone think of a way to fix this behavior? I'm stumped. :L
                      Alright nevermind - I fixed it by doing what was mentioned here:
                      https://www.pokecommunity.com/showthread.php?p=9133551#post9133551
                      __________________
                      Reply With Quote
                        #211    
                      Old July 6th, 2017 (1:16 PM).
                      The_Don The_Don is offline
                         
                        Join Date: Jul 2017
                        Posts: 13
                        As you can see in the image in that specific map my follow pokemon walks in front of me or on the same tile the the player does, it works perfectly on other maps. How can this be solved?
                        Click image for larger version

Name:	POKEFOLLOWPROBLEM.png
Views:	96
Size:	312.3 KB
ID:	82396
                        Reply With Quote
                          #212    
                        Old July 16th, 2017 (8:00 PM).
                        Venomous_Zero86's Avatar
                        Venomous_Zero86 Venomous_Zero86 is offline
                        Pokemon Chosen Ones (Coming Soon)
                           
                          Join Date: Mar 2016
                          Gender: Male
                          Posts: 51
                          this error comes up i did it properly even watch a video

                          ---------------------------
                          Pokemon Chosen Ones
                          ---------------------------
                          Exception: NoMethodError

                          Message: undefined method `length' for nil:NilClass

                          Following Pokemon:1779:in `update'

                          Scene_Map:51:in `updateSpritesets'

                          Scene_Map:45:in `each'

                          Scene_Map:45:in `updateSpritesets'

                          Scene_Map:115:in `follow_update'

                          Following Pokemon:1551:in `update'

                          Scene_Map:68:in `main'

                          Scene_Map:65:in `loop'

                          Scene_Map:72:in `main'

                          Main:74:in `mainFunctionDebug'



                          This exception was logged in

                          C:\Users\Mike\Saved Games/Pokemon Chosen Ones/errorlog.txt.

                          Press Ctrl+C to copy this message to the clipboard.
                          ---------------------------
                          OK
                          ---------------------------
                          Reply With Quote
                            #213    
                          Old 3 Weeks Ago (7:58 AM). Edited 3 Weeks Ago by Auroran.
                          Auroran Auroran is offline
                             
                            Join Date: Feb 2013
                            Gender: Male
                            Posts: 19
                            Hi, I followed these instructions on a clean install of version 17 and got the following error when trying to run the game
                            Quote:
                            Script 'Followme' line 1431: Name Error Ocurred

                            undefined method `pbSwitch' for class `PokemonScreen'
                            This is my first time editing the script in essentials.

                            Edit: Apparently someone over on Relic Castle is having the same issue, so it is an issue with v17?
                            Reply With Quote
                              #214    
                            Old 3 Weeks Ago (3:05 PM). Edited 3 Weeks Ago by wungsoo.
                            wungsoo wungsoo is offline
                               
                              Join Date: Aug 2017
                              Posts: 1
                              I don't know if anyone will reply to this but I have a bug when blacking out from a trainer battle.
                              I've tried disabling the Following script in the Starting Over event with pbToggleFollowingPokemon and then re-enabling it with pbPokemonFollow. However the issue still occurs. What happens is that there is an invisible pokemon that I can talk to still next to me and it causes a loop that will end up making my game crash. Is there any fix to this? Thanks!


                              This is the same thing that happened.

                              Quote:
                              Originally Posted by JustKenneth View Post
                              Hey all,

                              first, thanks for the script! Very helpful.
                              I ran into an issue while playtesting, when I lose a battle the follower doesn't reappear, it's still there but invisible.
                              When I interact with it an error shows up.

                              edit:
                              Also while pressing 'CTRL' the player is able to walk through walls.

                              ---------------------------
                              Zircon and Citrine
                              ---------------------------
                              Exception: NoMethodError

                              Message: undefined method `-' for nil:NilClass

                              Follow pokemon:743:in `talk_to_pokemon'

                              Follow pokemon:1559:in `update'

                              Scene_Map:68:in `main'

                              Scene_Map:65:in `loop'

                              Scene_Map:72:in `main'

                              Main:49:in `mainFunctionDebug'

                              Main:27:in `mainFunction'

                              Main:27:in `pbCriticalCode'

                              Main:27:in `mainFunction'

                              Main:59






                              Any ideas?
                              Reply With Quote
                                #215    
                              Old 5 Days Ago (10:46 AM). Edited 5 Days Ago by Ceddy.
                              Ceddy's Avatar
                              Ceddy Ceddy is offline
                              Apprentice Fan Game Creator
                                 
                                Join Date: Aug 2017
                                Gender: Male
                                Nature: Jolly
                                Posts: 1
                                Hey dudes,
                                First of all...good job with this huge script.
                                But my problem is that I follow all the steps just like you did in your pictures but I still get a huge error message when I try to turn it on. I will send the error message as well. Please somebody needs to help me...pls...
                                Exception: RuntimeError
                                Exception: NoMethodError
                                Message: Section184:1274:in `pbFollowEventAcrossMaps'undefined method `bridge' for #
                                Reply With Quote
                                  #216    
                                Old 3 Days Ago (9:38 AM).
                                SolarLegacy SolarLegacy is offline
                                   
                                  Join Date: Sep 2015
                                  Gender: Male
                                  Posts: 3
                                  Does anyone happen to know the script to toggle off and on the follower?
                                  I wanted to make it so that during certain events it is hidden.
                                  Reply With Quote
                                    #217    
                                  Old 2 Days Ago (4:14 PM).
                                  komaoto's Avatar
                                  komaoto komaoto is offline
                                     
                                    Join Date: Mar 2014
                                    Location: Brazil
                                    Gender: Male
                                    Posts: 87
                                    Code:
                                    ALLOWTOGGLEFOLLOW = true             # Allow the player to toggle followers on/off
                                    Be sure to read the script. Most questios are already answered in the top section of the script.
                                    Reply With Quote
                                    Reply

                                    Quick Reply

                                    Join the conversation!

                                    Create an account to post a reply in this thread, participate in other discussions, and more!

                                    Create a PokéCommunity Account

                                    Sponsored Links
                                    Thread Tools

                                    Posting Rules
                                    You may not post new threads
                                    You may not post replies
                                    You may not post attachments
                                    You may not edit your posts

                                    BB code is On
                                    Smilies are On
                                    [IMG] code is On
                                    HTML code is Off

                                    Forum Jump


                                    All times are GMT -8. The time now is 4:59 PM.