• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [Essentials v17] Following Pokemon v 1.4.1

WolfPP

Spriter/ Pixel Artist
1,309
Posts
5
Years
  • I noticed a bug when you change form fusing pokémon (Kyurem in case).
    If I have RESHIRAM or ZEKROM like first pokemon ($Trainer.party[0]) and fuse to Kyurem, when i back into overworld the sprite won't refresh (even if i putted '$PokemonTemp.dependentEvents.refresh_sprite' (true) or (false) and give me error when i try to talk to it, because he was deleted by fusion, obviously.
    The correct is to turn back to poké ball (calling remove_sprite instead refresh) because Reshiram/Zekrom doesn't exist (until you separate White Kyurem).

    How can we fix that?
    Also i think the code for that is:
    Code:
    #Update sprites on use item
    module ItemHandlers
      
      class << self
        alias follow_triggerUseOnPokemon triggerUseOnPokemon
      end
      
      def self.triggerUseOnPokemon(item,pokemon,scene)
        ret = follow_triggerUseOnPokemon(item,pokemon,scene)
        $PokemonTemp.dependentEvents.refresh_sprite(false) if ret
        return ret
      en
    end
     
    Last edited:

    JoelMatthews

    Trans Dude with a Chill 'Tude
    21
    Posts
    5
    Years
  • Not all of the emotions from HGSS were included with the script, so I made them myself. Anyone is free to use them if they wish.

    The Code (add this tiny bit just under the other emotions in the script]:
    Spoiler:

    The Animations File (to be placed in /Data/:
    Spoiler:


    The Image File (to be added into /Graphics/Animations/)
    Spoiler:


    Emotions were ripped from here, make sure you give credit.
     

    mybusiness

    Guest
    0
    Posts
    Does anyone have the problem that after you lose a battle, the pokemon no longer follows you (the dependent event in no longer active)?
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Thanks 'pbRemoveDependencies()' here:
    Spoiler:


    You need create a event again, usin a new event called "Dependent" and stuffs into Poké Center nor Mother's House.
     

    mybusiness

    Guest
    0
    Posts
    Too lazy to put those into every Center. Rather, I'll create a new argumet for pbRemoveDependencies and removeAllElements to handle following pokemon as exceptions.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Just remove that part of code and put remove_sprite(false) and after heal, refresh_sprite(true). More simple.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • If you have variations, like Giratina (need to change the map), Solgaleo/Lunala (change its forms when the player changes the map to Ultra Space), I made this code to refresh the OW:
    Inside 'class DependentEventSprites', above 'case $Trainer.party[0].status', paste:

    Code:
            if MultipleForms.hasFunction?($Trainer.party[0],"getForm")
              $PokemonTemp.dependentEvents.refresh_sprite(false)
            end
     
    163
    Posts
    7
    Years
    • Seen May 3, 2024
    Hi Guys...

    I read all the post and i don't know how to solve this...

    Does anyone know why every time I transport, leave or enter a house the sprite refresh and my pokemon comes out of the Pokeball again?
     
    163
    Posts
    7
    Years
    • Seen May 3, 2024
    Has anyone gotten that the first Pokemon that goes with you does not appear from the Pokeball, if not from the side of the trainer, as in the original games? I'm trying with EBS, but I think the challenge exceeds my scripting capabilities. XD
     
    163
    Posts
    7
    Years
    • Seen May 3, 2024
    Just remove that part of code and put remove_sprite(false) and after heal, refresh_sprite(true). More simple.

    Would someone be kind enough to show me how to install this fix or maybe a capture of their starting over configuration in the Pokemón center? I can't get the following script to reactivate after the blackout.
     
    163
    Posts
    7
    Years
    • Seen May 3, 2024
    I have a very strange issue ... Here I go ... When I go to the Pokemon Center and the sprites disappear or appear as indicated, it works well ... Except for a Pokemon, which does not disappear from the map when it should do so ... (However , when I use ctrl to get or remove the Pokemon from the POKEBALL everything goes well ...) It only happens with that Pokemon. Curiously, it is the first one that appears in my project that has an additional form, but I don't know if it has anything to do with it ...
     
    10
    Posts
    4
    Years
    • Seen Apr 11, 2020
    Add Water Reflection to Following Pokemon event:

    Inside Following Script, change all '==Dependent' to '[/Dependent/]'. The script haves 6 lines with that. Replace all of them:
    Code:
      def change_sprite(id, shiny=nil, animation=nil, form=nil, gender=nil, shadow=false)
        events=$PokemonGlobal.dependentEvents
        for i in 0...events.length
          if events[i] && events[i][8][COLOR="Red"][/Dependent/][/COLOR] #=="Dependent" #original code

    Code:
      def remove_sprite(animation=nil)
        events=$PokemonGlobal.dependentEvents
        for i in 0...events.length
          if events[i] && events[i][8][COLOR="red"][/Dependent/][/COLOR] #=="Dependent" original code

    Code:
      def talk_to_pokemon
        e=$Trainer.party[0]
        events=$PokemonGlobal.dependentEvents
        for i in 0...events.length
          if events[i] && events[i][8][COLOR="red"][/Dependent/][/COLOR] #=="Dependent" original code

    Spoiler:


    Code:
    def SetMoveRoute(commands,waitComplete=true)
        events=$PokemonGlobal.dependentEvents
        for i in 0...events.length
          if events[i] && events[i][8][COLOR="red"][/Dependent/][/COLOR]#=="Dependent"

    Code:
    class Interpreter
      
      def command_end
        # Clear list of event commands
        @list = nil
        # If main map event and event ID are valid
        if @main && @event_id > 0 && !($game_map.events[@event_id] && $game_map.events[@event_id].name[COLOR="red"][/Dependent/][/COLOR])#=="Dependent")

    Change the red line:
    Code:
    def pbPokemonFollow(x)
     [COLOR="Red"] Kernel.pbAddDependency2(x, "DependentReflection", Unused_Common_Event)[/COLOR] #Kernel.pbAddDependency2(x, "Dependent", Unused_Common_Event)
      $PokemonTemp.dependentEvents.refresh_sprite
      $PokemonTemp.dependentEvents.Come_back(nil,false)
      $game_switches[Following_Activated_Switch]=true
      $game_switches[Toggle_Following_Switch]=true
    end

    Then, search 'Sprite_WaterReflection' script, and add the red line:
    Spoiler:


    Finally, inside 'PField_DependentEvents' search to 'def createEvent(eventData)' and add the red line:
    Spoiler:



    Thanks Vendily to made that great edition!

    Hi WolfPP, using this script does nothing inside my game for following pokemon reflection and i don´t know why.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • From Fresh v17.2, ignore all what I wrote and inside 'Sprite_Character' script, change:
    Code:
      def initialize(viewport, character = nil)
        super(viewport)
        @character = character
        @oldbushdepth = 0
        @spriteoffset = false
        if !character || character==$game_player || (character.name[/Reflection/] rescue false)
          @reflection = Sprite_Reflection.new(self,character,viewport)
        end
        @surfbase = Sprite_SurfBase.new(self,character,viewport) if character==$game_player
        update
      end

    for this:
    Code:
      def initialize(viewport, character = nil)
        super(viewport)
        @character = character
        @oldbushdepth = 0
        @spriteoffset = false
        @reflection = Sprite_Reflection.new(self,character,viewport)
        @surfbase = Sprite_SurfBase.new(self,character,viewport) if character==$game_player
        update
      end
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • What you posted don't help too much for help you. Paste all error here.
    Also, if you read your error says:
    Code:
    undefined method pb switch for class PokemonParty Class

    Maybe you're using other version of Essentials instead v17+. If so, you need to adapt the script or download v17.2 OR copy 'def pbSwitch' and
    paste inside class PokemonParty from the newest versions.
     
    1
    Posts
    4
    Years
    • Seen May 29, 2020
    when I die of saprese the pokemon the key is pressed to the void I get this error for when to 17.2
    Pokemon essentials verison 17.2
    exception: nomethoderror
    message: undefined method for nil:nilclass
    PF:638:in talk_to_pokemon
    PF:1559:in update
    scena_map:234:in main
    scena_map:231:in loop
    scena_map:236:in main
    main:54:in mainfunctiondebug
    main:32:in mainfunction
    main:32:in pbcristalcode
    main:32:in mainfunction
    main:64
     
    1
    Posts
    4
    Years
    • Seen Mar 23, 2020
    I've found a crash with this script, unfortunately. If you have a Pokemon with field moves (such as Dig, Strength, etc) and attempt to use the new Ready Menu by pressing F, it produces this error and crashes.

    Code:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pok�mon Essentials version 17.2]
    Exception: ArgumentError
    Message: wrong number of arguments(3 for 2)
    PScreen_ReadyMenu:310:in `pbCanUseHiddenMove?'
    PScreen_ReadyMenu:310:in `pbUseKeyItem'
    PScreen_ReadyMenu:307:in `each'
    PScreen_ReadyMenu:307:in `pbUseKeyItem'
    PScreen_ReadyMenu:304:in `each'
    PScreen_ReadyMenu:304:in `pbUseKeyItem'
    Scene_Map:219:in `follow_update'
    Following_Pokemon:1551:in `update'
    Scene_Map:234:in `main'
    Scene_Map:231:in `loop'

    Im also having a similar problem as you, can any one help?
     
    2
    Posts
    4
    Years
    • Seen May 21, 2020
    Excepción: NoMethodError
    Mensaje: undefined method `>' for nil:NilClass
    RPG__Sprite:123:in `effect?'
    RPG__Sprite:434:in `effect?'
    RPG__Sprite:433:in `each'
    RPG__Sprite:433:in `effect?'
    AnimationSprite:31:in `update'
    AnimationSprite:88:in `update'
    AnimationSprite:87:in `each'
    AnimationSprite:87:in `update'
    Scene_Map:51:in `updateSpritesets'
    Scene_Map:45:in `each'
    Excepción: RuntimeError
    Mensaje: Script error within event 12, map 5 (Ruta 1):
    Exception: NoMethodError
    Message: Section003:123:in `effect?'undefined method `>' for nil:NilClass
    ***Full script:
    pbPokemonFollow(11)

    Interpreter:243:in `pbExecuteScript'
    RPG__Sprite:434:in `effect?'
    RPG__Sprite:433:in `each'
    RPG__Sprite:433:in `effect?'
    AnimationSprite:31:in `update'
    AnimationSprite:88:in `update'
    AnimationSprite:87:in `each'
    AnimationSprite:87:in `update'
    Scene_Map:51:in `updateSpritesets'
    Scene_Map:45:in `each'

    Interpreter:276:in `pbExecuteScript'
    Interpreter:1606:in `command_355'
    Interpreter:494:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `follow_update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `follow_update'
    Acompañante:1551:in `update'
     
    Back
    Top