• 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

1,224
Posts
10
Years
This script adds following pokemon to your game (you have to provide your own OW sprites). It is an updated version from the current script tutorial, but modified so that if all goes in one script section.

Fixes in this version:
Spoiler:

Please follow these instructions closely.
Add this script in a new section above the main (and below the compiler).
Save your game, and close RPG Maker (important).
Download this file
Now download these graphics
Go into your game folder, and from that to your Data folder. Add the Animations.rxdata file you just downloaded. It will ask if you want to replace the current file, you will say yes.
Now, go back to the main folder, and go into the Graphics folder. From there, go into the Animations folder. Here you will extract the graphics you downloaded (emo.png, emo2,png, and Pokemon-Follow.png). Make sure to extract them, not just stick the .rar file in here.
Now the script is installed.
To use this script, we simply need to make two events.

The first one will simply be a blank event. This event will be turned into our dependent event when we trigger it.
It should look like this (can be any ID)
RPGXP_2017-04-05_01-32-21.png


Our second event will be the one that triggers it. It can trigger in whatever way (touch, on a different page, a conditional, etc), but it must use the script you see here: pbPokemonFollow(X)
X refers to the ID of our first event.
Please note that these events should be on the same map.
RPGXP_2017-04-05_01-31-24.png


And that should pretty much be it.
Remember, this is a standalone script and needs no other changes to your scripts to work. So if you mess something up, it's probably not due to this script.

Script Version: 1.4
Credits required: Help-14, zingzags, Rayd12smitty, Venom12, mej71

I've made a few important changes since I first posted, please update
Edit: One more update for following script. There were a lot of problems in the old version with switching and toggling, especially while surfing/biking. Those are fixed. Water pokemon always animate in the water. Added exception array for mons that fit always animating criteria but you don't want them to animate. Added a fix for event transfers
Edit 2: Fixed blacking out issue, and a couple other refreshing issues.

Edit 3: Updated to v17 only, reflection support removed due to conflicts

Also, mini tutorial time. The script to force the sprite to refresh is
Code:
$PokemonTemp.dependentEvents.refresh_sprite
To force the sprite to update it's position(call this after a transfer) add this script
Code:
$NeedFollowerUpdate=true
 
Last edited by a moderator:
43
Posts
8
Years
I tried to follow these instructions closely, with a blank Dependent Event, and another event on the same map.
But when I tried to load the recent save file, it gave me an error: Before install the script, I can't go through impassable tiles , but after install the script, I can go through all impassable tiles ( not the character). Then after I tried to reinstall the script , I tried to load the recent save file and it gave me another error.
---------------------------
Pokemon Mystery Evolution
---------------------------
Script 'Following Pokemon' line 1421: NoMethodError occurred.

undefined method `realEvents' for #<DependentEvents:0x8923de0>
---------------------------
OK
---------------------------
Then I tried to start an new game,but when I call pbPokemonFollow(2), it gave me another error.
---------------------------
Pokemon Mystery Evolution
---------------------------
Script 'Interpreter' line 276: RuntimeError occurred.

Script error within event 9, map 351 (Red's house):

Exception: NoMethodError

Message: Section187:1421:in `old_update_wb'undefined method `realEvents' for #<DependentEvents:0x74f4d00>

***Full script:

pbPokemonFollow(2)


Interpreter:243:in `pbExecuteScript'

Following Pokemon:1418:in `each'

Following Pokemon:1418:in `old_update_wb'

Special Animation:533:in `old_update'

Special Animation:724:in `klein_mapcon_update'

Special Animation:858:in `water_old_update'

Water Bubbles:176:in `pheno_old_update'

Phenomenos:362:in `updateOldFL'

Simple HUD:41:in `update'

Scene_Map:51:in `updateSpritesets'


---------------------------
OK
---------------------------
Please help me... Thank you.
 
Last edited:
1,224
Posts
10
Years
I tried to follow these instructions closely, with a blank Dependent Event, and another event on the same map.
But when I tried to load the recent save file, it gave me an error: Before install the script, I can't go through impassable tiles , but after install the script, I can go through all impassable tiles ( not the character). Then after I tried to reinstall the script , I tried to load the recent save file and it gave me another error.

Then I tried to start an new game,but when I call pbPokemonFollow(2), it gave me another error.

Please help me... Thank you.

This has been fixed, please recopy the script, I have made a few changes. Also, please do not quote the initial post in a reply. It's assumed that's who you're replying to unless you say otherwise, and it makes for unnecessary clutter.
 
32
Posts
10
Years
  • Age 29
  • Seen Nov 19, 2016
Gasp!! Reflection support?! My goodness! That's actually one of the best additions to this. Now it feels pretty complete (being plug n' play is a huge plus too!)

But uh... How come you have the def for Come_back but don't call it anywhere else like Ray's 1.3? Once you're done Surfing, your following Pokemon doesn't reappear.
 
824
Posts
8
Years
I'm kinda Frankenstein'ing this and 1.3 together because I had to do the same for v16 and my game. I managed to add in your status tones subroutine no problem. But I'm having trouble adding reflection support.

I tried copying this code into my game, but it throws an error as soon as I start up a file:
Code:
class Spriteset_Map
 
  alias follower_update update
  def update
    follower_update
    #add to reflected sprites if not already
    if $game_player.pbHasDependentEvents? && !$game_temp.player_transferring
      for i in [email protected]
        if @usersprites[i].is_a?(DependentEventSprites)
          @followersprite = @usersprites[i]
          [COLOR="Red"]event = $PokemonTemp.dependentEvents.realEvents[0][/COLOR]
          count = 0
          fsprite = nil
          for sprite in @reflectedSprites
            if sprite.event == event
              if count==1 #if there are multiple of this same event
                sprite.dispose
                @reflectedSprites.delete(sprite)
                @reflectedSprites.delete(fsprite) if fsprite
              else
                fsprite = sprite
                count = 1
              end
            end
          end
          if count==0 || fsprite.nil?
            @reflectedSprites.push(ReflectedSprite.new(@usersprites[i].sprites[0],event,@viewport1))
            follower_update
          elsif fsprite || fsprite.transfer
            @reflectedSprites.delete(fsprite)
            fsprite.dispose
            @reflectedSprites.push(ReflectedSprite.new(@usersprites[i].sprites[0],event,@viewport1))
            follower_update
          end
          break
        end
      end
    end
  end
 
end
 
class ReflectedSprite
 
  alias follow_update update
  def update
    return false if !@rsprite || @rsprite.nil? || @rsprite.disposed?
    ret=follow_update
    return ret
  end
 
end

The line in red is giving the error because realEvents does not exist as a property of that class.
 

Telemetius

Tele*
267
Posts
9
Years
Say I want to keep my existing custom battle animations without replacing Animations.rpgxp and I really don't care about the pokemon emoticons.
What should I remove from the code?
 
1,224
Posts
10
Years
Gasp!! Reflection support?! My goodness! That's actually one of the best additions to this. Now it feels pretty complete (being plug n' play is a huge plus too!)

But uh... How come you have the def for Come_back but don't call it anywhere else like Ray's 1.3? Once you're done Surfing, your following Pokemon doesn't reappear.

I've updated the script to include this, as well as added a small fix to their placement (when you stop surfing they should appear beside you instead of in the water)

I'm kinda Frankenstein'ing this and 1.3 together because I had to do the same for v16 and my game. I managed to add in your status tones subroutine no problem. But I'm having trouble adding reflection support.

I tried copying this code into my game, but it throws an error as soon as I start up a file:

The line in red is giving the error because realEvents does not exist as a property of that class.

The script was already updated to fix that, please recopy.
 
32
Posts
10
Years
  • Age 29
  • Seen Nov 19, 2016
Huh... Sorry for bugging you, but I've found yet another quirk (on a clean project).

Say you're facing your Following Pokemon, you Save the game, you close it and Continue...
Your Pokemon is no longer facing you and could stand either behind you, facing another direction, or standing in a adjacent tile, sometimes even impassable ones. Sometimes, if the impassable tile is a water one, it'll stand right on top of the player after Continuing.

Of course, none of this happens if you're not facing your Pokemon when you Save/Continue.

Edit: Ha, I hadn't realized this had occurred with regular Dependent Events for the longest time, regardless of version or if I had a Pokemon Following script or not. I quickly found a fix to this, however.

You can fix this by editing pbMapChangeMoveDependentEvents in the original DependentEvent's script. Or you can comment out the last instance of it at the veeeery bottom. I just changed it so it doesn't try to reposition the Pokemon after a map change (or map refresh). Helps a lot with map transfers looking less ugly, actually. Not sure how you want to go about it though!
 
Last edited:

crispybacon1234

Pokémon IR/NG Dev
103
Posts
9
Years
First off, thanks for bringing this script back to life. Previously it was very buggy and you've done a great job fixing some of those bugs.

I was wondering if this script works with versions of Essentials below v16. I'm currently using Kleinstudio's BW Essentials v3.1.1 which is essentially a modified v15.1. I'm aware that there were lots of script changes between v15.1 and v16, but whenever I talk to my Pokémon it asks if I would like to surf.

Is there a way around this, or would it involve editing a lot of the script? Any help or clarification would be greatly appreciated.
 
1,224
Posts
10
Years
Huh... Sorry for bugging you, but I've found yet another quirk (on a clean project).

Say you're facing your Following Pokemon, you Save the game, you close it and Continue...
Your Pokemon is no longer facing you and could stand either behind you, facing another direction, or standing in a adjacent tile, sometimes even impassable ones. Sometimes, if the impassable tile is a water one, it'll stand right on top of the player after Continuing.

Of course, none of this happens if you're not facing your Pokemon when you Save/Continue.

Edit: Ha, I hadn't realized this had occurred with regular Dependent Events for the longest time, regardless of version or if I had a Pokemon Following script or not. I quickly found a fix to this, however.

You can fix this by editing pbMapChangeMoveDependentEvents in the original DependentEvent's script. Or you can comment out the last instance of it at the veeeery bottom. I just changed it so it doesn't try to reposition the Pokemon after a map change (or map refresh). Helps a lot with map transfers looking less ugly, actually. Not sure how you want to go about it though!

I've applied that fix to the script, thanks. Doesn't seem to have an effect on map transfers honestly, but at least it fixes the save thing.

There weren't that many changes from v15, mostly just terrain tags and a few other methods. However, most of those are just things that would crash your game. Asking you to surf makes no sense, I don't see what would cause that.
 
Last edited:
1
Posts
8
Years
  • Age 121
  • Seen Jan 6, 2016
Excellent, but could better support the doors, add to tutorial support for the Pokemon Center, a tutorial on moving the follower Pokemon.

But if you really want to improve the script of course.
 
Last edited:

crispybacon1234

Pokémon IR/NG Dev
103
Posts
9
Years
There weren't that many changes from v15, mostly just terrain tags and a few other methods. However, most of those are just things that would crash your game. Asking you to surf makes no sense, I don't see what would cause that.

I reinstalled the script and set the switches and variables again. Apparently my brain didn't recognise that ItemWalk was also a variable. The script is working fine now.

As for actual bugs with the script, whenever you stop sprinting and stand still the following Pokémon still appears to be sprinting on the spot. Any way to fix this?

EDIT: When you switch Pokémon while surfing the new Pokémon will appear on your head, regardless of type.

EDIT 2: NPC events can walk through your following Pokémon.
 
Last edited:

mewlover22

Pokemon Creator
455
Posts
15
Years
Great to see this one back but as a plug and play version just one question if i don't have walking sprites for a few pokemon will that mess up the script in anyway?
 
1,224
Posts
10
Years
Great to see this one back but as a plug and play version just one question if i don't have walking sprites for a few pokemon will that mess up the script in anyway?

Other than those sprites not showing up, no. I believe the animations will still play though.
 
22
Posts
8
Years
  • Age 28
  • Seen Jan 8, 2017
Code:
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError

Message: Script error within event 6, map 2 (Lappet Town):

Exception: NoMethodError

Message: Section003:123:in `effect?'undefined method `>' for nil:NilClass

***Full script:

pbPokemonFollow(17)


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 `follower_update'

AnimationSprite:87:in `each'

AnimationSprite:87:in `follower_update'

Followers:1511:in `update'

Scene_Map:51:in `updateSpritesets'



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'

Followers:1371:in `update'



This exception was logged in 

C:\Users\us\Saved Games/Pokemon Essentials/errorlog.txt.

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

Any thing? I'm using a clean version of essentials. It occurs when I talk to the npc.
 
1,224
Posts
10
Years
Code:
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError

Message: Script error within event 6, map 2 (Lappet Town):

Exception: NoMethodError

Message: Section003:123:in `effect?'undefined method `>' for nil:NilClass

***Full script:

pbPokemonFollow(17)


Interpreter:243:in `pbExecuteScript'

Any thing? I'm using a clean version of essentials. It occurs when I talk to the npc.

You did not follow the installation instructions exactly.
 
1,224
Posts
10
Years
First off, thanks for bringing this script back to life. Previously it was very buggy and you've done a great job fixing some of those bugs.

I was wondering if this script works with versions of Essentials below v16. I'm currently using Kleinstudio's BW Essentials v3.1.1 which is essentially a modified v15.1. I'm aware that there were lots of script changes between v15.1 and v16, but whenever I talk to my Pokémon it asks if I would like to surf.

Is there a way around this, or would it involve editing a lot of the script? Any help or clarification would be greatly appreciated.


I added a small fix to add compatibility (and tested) for v15. However, crispybacon1234, none of your errors occur in my testing with a clean v15.1.
 
199
Posts
8
Years
  • Age 30
  • Seen Mar 21, 2024
Great to see this one back but as a plug and play version just one question if i don't have walking sprites for a few pokemon will that mess up the script in anyway?

You can add checks with

Code:
FileTest.image_exist?("Graphics/Characters/"+$Trainer.party[0].species.to_s)

if you don't want certain things to happen if the walking sprite doesn't exist.
 
Back
Top