Welcome to the PokéCommunity!

Hi there! Thanks for visiting PokéCommunity. We’re a group of Pokémon fans dedicated to providing the best place on the Internet for discussing ideas and sharing fan-made content. Welcome! We’re glad you’re here.

In order to join our community we need you to create an account with us. Doing so will allow you to make posts, submit and view fan art and fan fiction, download fan-made games, and much more. It’s quick and easy; just click here and follow the instructions.

PGM is all set for February. This month, we're playing through a game known as Eevee's Tile Trial. If you wish to earn rewards, please head over to our event thread by clicking on the provided link and give yourself a shot at the game!

Hey Unregistered! How fast can you game? The Marathon II is up and running in Video Game's - compete against your friends to see how quickly you can complete sixty intense in-game challenges. See you there!

#==============================================================================
# ¡Ü Credits to Help - 14 for both the scripts and Sprites
# ¡Ü Edited by Zingzags
# -Fixed bugs
# -Clean ups
# -Fixed Surf Bug (After Surf is done)
# -Fixed def talk_to_pokemon while in surf
# -Fixed Surf Check
# -Fixed Type Check
# -Added Door Support
# -Fixed Hp Bug
# -Added Pokemon Center Support
# -Animation problems
# -Fixed Walk_time_variable problem
# -Added random item loot
# -Added egg check
#==============================================================================
# Zingzags comments
#==============================================================================
# I know its not perfect, and it can be shortened, for example addind an array
# for the random items.
#==============================================================================
#==============================================================================
# ¡Ü Control the following Pokemon
#==============================================================================
def FollowingMoveRoute(commands,waitComplete=false)
$PokemonTemp.dependentEvents.SetMoveRoute(commands,waitComplete)
end
#==============================================================================
# ¡Ü Pokemon Following Character v3 By Help-14
#==============================================================================
class DependentEvents
#==============================================================================
# Raises The Current Pokemon's Happiness levels +1 per each time the
# Walk_time_Variable reachs 5000 then resets to 0
# ItemWalk, is when the variable reaches a certain amount, that you are able to talk to your pokemon to recieve an item
#==============================================================================
def add_following_time
if $game_switches[2]==true && $Trainer.party.length>=1
$game_variables[Walking_Time_Variable]+=1 if $game_variables[Current_Following_Variable]!=$Trainer.party.length
if $game_variables[Walking_Time_Variable]==5000
$Trainer.party[0].happiness+=1
$game_variables[Walking_Time_Variable]=0
if $game_variables[ItemWalk]==5
else
$game_variables[ItemWalk]+=1
end
end
end
end
#----------------------------------------------------------------------------
# - refresh_sprite
# - Change sprite without animation
#----------------------------------------------------------------------------
def refresh_sprite
if $Trainer.party.length!=$game_variables[Current_Following_Variable]
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
change_sprite($Trainer.party[0].species, shiny, false)
elsif $Trainer.party[0].hp<=0
remove_sprite
end
end
end
#----------------------------------------------------------------------------
# - change_sprite(id, shiny, animation)
# - Example, to change sprite to shiny lugia with animation:
# change_sprite(249, true, true)
# - If just change sprite:
# change_sprite(249)
#----------------------------------------------------------------------------
def change_sprite(id, shiny=nil, animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
if shiny==true
events[i][6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[i][6])
@realEvents[i].character_name=sprintf("%03ds",id)
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
if animation==true
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
$game_variables[Walking_Time_Variable]=0
end
end
end
#----------------------------------------------------------------------------
# - remove_sprite(animation)
# - Example, to remove sprite with animation:
# remove_sprite(true)
# - If just remove sprite:
# remove_sprite
#----------------------------------------------------------------------------
def remove_sprite(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
events[i][6]=sprintf("nil")
@realEvents[i].character_name=sprintf("nil")
if animation==true
$scene.spriteset.addUserAnimation(Animation_Come_In,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
$game_variables[Current_Following_Variable]=$Trainer.party[0]
$game_variables[Walking_Time_Variable]=0
end
end
end
#----------------------------------------------------------------------------
# - check_surf(animation)
# - If current Pokemon is a water Pokemon, it is still following.
# - If current Pokemon is not a water Pokemon, remove sprite.
# - Require Water_Pokemon_Can_Surf = true to enable
#----------------------------------------------------------------------------
def check_surf(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
events[i][6]=sprintf("nil")
@realEvents[i].character_name=sprintf("nil")
else
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
if $Trainer.party[0].hasType?(:WATER)
remove_sprite
else
remove_sprite
pbWait(20)
end
elsif $Trainer.party[0].hp<=0
end
end
end
end
#----------------------------------------------------------------------------
# - talk_to_pokemon
# - It will run when you talk to Pokemon following
#----------------------------------------------------------------------------
def talk_to_pokemon
e=$Trainer.party[0]
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
pos_x=@realEvents[i].x
pos_y=@realEvents[i].y
end
end
if e==0
else
if e.hp>0 && !$Trainer.party[0].egg?
if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true
else
if e!=6
pbPlayCry(e.species)
random1=rand(5)
if $game_variables[ItemWalk]==5
items=[:POTION,:SUPERPOTION,:FULLRESTORE,:REVIVE,:PPUP,
:PPMAX,:RARECANDY,:REPEL,:MAXREPEL,:ESCAPEROPE,
:HONEY,:TINYMUSHROOM,:PEARL,:NUGGET,:GREATBALL,
:ULTRABALL,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,:DUSKSTONE,
:REDAPRICORN,:BLUAPRICORN,:YLWAPRICORN,:GRNAPRICORN,:PNKAPRICORN,
:BLKAPRICORN,:WHTAPRICORN
]
random2=0
loop do
random2=rand(items.length)
break if hasConst?(PBItems,items[random2])
end
Kernel.pbMessage(_INTL("{1} seems to be holding something, it looks like {1} wants to give it to me.",e.name))
Kernel.pbPokemonFound(getConst(PBItems,items[random2]))
$game_variables[ItemWalk]=0
end
if random1==0
$scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)
pbWait(50)
Kernel.pbMessage(_INTL("{1} loves this tune so much that {1} is singing it.",e.name))
elsif e.happiness>0 && e.happiness<=50
$scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)
pbWAit(70)
Kernel.pbMessage(_INTL("{1} hate to travel with {2}.",e.name,$Trainer.name))
elsif e.status==PBStatuses::POISON && e.hp>0 && !e.egg?
$scene.spriteset.addUserAnimation(Emo_Poison, pos_x, pos_y-2)
pbWait(120)
Kernel.pbMessage(_INTL("{1} is badly poisoned, {1} needs help quick.",e.name))
elsif e.happiness>50 && e.happiness<=100
$scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)
pbWait(100)
Kernel.pbMessage(_INTL("{1} is still undecided for whether traveling with {2} is a good thing or not.",e.name,$Trainer.name))
elsif e.happiness>100 && e.happiness<150
$scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)
Kernel.pbMessage(_INTL("{1} is happy traveling with {2}.",e.name,$Trainer.name))
elsif e.happiness>=150
$scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)
pbWait(70)
Kernel.pbMessage(_INTL("{1} loves traveling with {2}.",e.name,$Trainer.name))
end
else
end
end
end
end
end
def Come_back(shiny=nil, animation=nil)
events=$PokemonGlobal.dependentEvents
if $game_variables[Current_Following_Variable]==$Trainer.party.length
$game_variables[Current_Following_Variable]
else
$game_variables[Current_Following_Variable]
end
if $game_variables[Current_Following_Variable]==$Trainer.party.length
remove_sprite(false)
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
else
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
change_sprite($Trainer.party[0].species, shiny, false)
end
for i in 0..$Trainer.party.length-1
if $Trainer.party[i].hp>0 && !$Trainer.party[0].egg?
$game_variables[Current_Following_Variable]=i
refresh_sprite
break
end
end
for i in 0...events.length
for i in 0..$Trainer.party.length-1
if $Trainer.party[i].hp<=0
id = $Trainer.party[i].species
else
id = $Trainer.party[i].species
end
end
if events[i] && events[i][8]=="Dependent"
if shiny==true
events[i][6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[i][6])
@realEvents[i].character_name=sprintf("%03ds",id)
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
if animation==true
else
end
end
end
end
#----------------------------------------------------------------------------
# - check_faint
# - If current Pokemon is fainted, change other Pokemon.
#----------------------------------------------------------------------------
def check_faint
if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true
else
if $Trainer.party[0].hp<=0
$game_variables[Current_Following_Variable]=0
remove_sprite
elsif $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
end
end
end
def SetMoveRoute(commands,waitComplete=false)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
pbMoveRoute(@realEvents[i],commands,waitComplete)
end
end
end
end
#----------------------------------------------------------------------------
# - Auto add Script to Kernel.pbSurf, It'll check curent Pokemon when surf
#----------------------------------------------------------------------------
def Kernel.pbSurf
# if $game_player.pbHasDependentEvents?
# return false
# end
if $DEBUG ||
(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORSURF : $Trainer.badges[BADGEFORSURF])
movefinder=Kernel.pbCheckMove(:SURF)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The water is dyed a deep blue... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Surf!",speciesname))
pbHiddenMoveAnimation(movefinder)
# $PokemonTemp.dependentEvents.check_surf
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
$PokemonTemp.dependentEvents.check_surf
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end
#----------------------------------------------------------------------------
# - Auto add Script to pbEndSurf, It'll show sprite after surf
#----------------------------------------------------------------------------
def pbEndSurf(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsSurfableTag?(currentTag)&&!pbIsSurfableTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
$PokemonTemp.dependentEvents.Come_back(true)
end
return true
end
return false
end
#----------------------------------------------------------------------------
# - Auto add Script to Kernel.pbCanUseHiddenMove, fix HM bug
#----------------------------------------------------------------------------
def Kernel.pbCanUseHiddenMove?(pkmn,move)
case move
when PBMoves::FLY
if !$DEBUG && !$Trainer.badges[BADGEFORFLY]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::CUT
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::HEADBUTT
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="HeadbuttTree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::SURF
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
terrain=Kernel.pbFacingTerrainTag
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbMessage(_INTL("Let's enjoy cycling!"))
return false
end
if !pbIsWaterTag?(terrain)
Kernel.pbMessage(_INTL("No surfing here!"))
return false
end
return true
when PBMoves::STRENGTH
if !$DEBUG && !$Trainer.badges[BADGEFORSTRENGTH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Boulder"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::ROCKSMASH
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORROCKSMASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Rock"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::FLASH
if !$DEBUG && !$Trainer.badges[BADGEFORFLASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("This is in use already."))
return false
end
return true
when PBMoves::WATERFALL
if !$DEBUG && !$Trainer.badges[BADGEFORWATERFALL]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if terrain!=PBTerrain::Waterfall
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::DIVE
if !$DEBUG && !$Trainer.badges[BADGEFORDIVE]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.diving
return true
end
if $game_player.terrain_tag!=PBTerrain::DeepWater
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDiveMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::TELEPORT
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome) # Home
end
if healing
mapname=pbGetMapNameFromId(healing[0])
if Kernel.pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
return true
end
return false
else
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
when PBMoves::DIG
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if !escape
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
mapname=pbGetMapNameFromId(escape[0])
if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
return true
end
return false
when PBMoves::SWEETSCENT
return true
else
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn)
end
return false
end
def pbPokemonFollow(x)
Kernel.pbAddDependency2(x, "Dependent", CommonEvent)
$PokemonTemp.dependentEvents.refresh_sprite
end
def Talkative
$PokemonTemp.dependentEvents.talk_to_pokemon
end

I will test this later, not right now, but I will... If anyone else can test this now and let us know any bugs and such... It's nice you've placed all of the resources too, sometimes some people just give the script... +5 to you haha

Edit: I put the script in a fresh version of Essentials and no error but nothing shows up

Edit again: Got Pikachu to show up but it says nothing except for it's cry no emotion bubble, how do i fix it. And how to I make gender differences show up?

Edit Again: I got another problem, using the latest version of essentials unedited before the follow script, I can only talk (hear their cry) in Test map2(Where I got my pokemon) and Test Map 1(outside) not in the daycare map I get something like this
---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError

Looks great, but which section is pbMountBike's at? It's the only thing missing part I actually need. Seems to work without it, though when talking to your Pokemon, you get a call from Prof.Oak(Testing this with the latest version of Essentials.)

Edit: I put the script in a fresh version of Essentials and no error but nothing shows up

Edit again: Got Pikachu to show up but it says nothing except for it's cry no emotion bubble, how do i fix it. And how to I make gender differences show up?

Edit Again: I got another problem, using the latest version of essentials unedited before the follow script, I can only talk (hear their cry) in Test map2(Where I got my pokemon) and Test Map 1(outside) not in the daycare map I get something like this
---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError

Hm...Nice job yet I can't figure out how to add
in def update of Game_player_ add

$PokemonTemp.dependentEvents.add_following_time

under
$PokemonTemp.dependentEvents.updateDependentEvents
I am unsure of where to put it. I looked but I don't see where you say to put it.

Edit: Well Never mind I got it but now It's giving me a problem with the
Put this in PokemonParty
Code:
$PokemonTemp.dependentEvents.refresh_sprite part as well as the piece under it. I put it exactly where you said to unless I am mistaken.
Edit 2:
---------------------------
Pokemon Essentials
---------------------------
Script 'PokemonParty' line 2: NoMethodError occurred.

undefined method `dependentEvents' for nil:NilClass
---------------------------
OK
---------------------------
This is the Error I get. Not sure of what it means. Maybe you can help me? Now it's just giving me a bunch of errors. I am going to repute it back in and start over.
Edit: I got it to work but now I need to figure out how to make the pokemon follow.
My Last Edit: How do I add pokemon? It's not working for me.

Update to fix the unlock problem comment out this line
in Interperter line 512:

Code:

$game_map.events[@event_id].unlock

to

Code:

#$game_map.events[@event_id].unlock

I will try to fix the pokemon not talking soon.

EDIT:nvm I fixed the no talking issue

Code:

#==============================================================================
# ¡Ü Credits to Help - 14 for both the scripts and Sprites
# ¡Ü Edited by Zingzags
# -Fixed bugs
# -Clean ups
# -Fixed Surf Bug (After Surf is done)
# -Fixed def talk_to_pokemon while in surf
# -Fixed Surf Check
# -Fixed Type Check
# -Added Door Support
# -Fixed Hp Bug
# -Added Pokemon Center Support
# -Animation problems
# -Fixed Walk_time_variable problem
# -Added random item loot
# -Added egg check
#==============================================================================
# Zingzags comments
#==============================================================================
# I know its not perfect, and it can be shortened, for example addind an array
# for the random items.
#==============================================================================
#==============================================================================
# ¡Ü Control the following Pokemon
#==============================================================================
def FollowingMoveRoute(commands,waitComplete=false)
$PokemonTemp.dependentEvents.SetMoveRoute(commands,waitComplete)
end
#==============================================================================
# ¡Ü Pokemon Following Character v3 By Help-14
#==============================================================================
class DependentEvents
#==============================================================================
# Raises The Current Pokemon's Happiness levels +1 per each time the
# Walk_time_Variable reachs 5000 then resets to 0
# ItemWalk, is when the variable reaches a certain amount, that you are able to talk to your pokemon to recieve an item
#==============================================================================
def add_following_time
if $game_switches[2]==true && $Trainer.party.length>=1
$game_variables[Walking_Time_Variable]+=1 if $game_variables[Current_Following_Variable]!=$Trainer.party.length
if $game_variables[Walking_Time_Variable]==5000
$Trainer.party[0].happiness+=1
$game_variables[Walking_Time_Variable]=0
if $game_variables[ItemWalk]==5
else
$game_variables[ItemWalk]+=1
end
end
end
end
#----------------------------------------------------------------------------
# - refresh_sprite
# - Change sprite without animation
#----------------------------------------------------------------------------
def refresh_sprite
if $Trainer.party.length!=$game_variables[Current_Following_Variable]
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
change_sprite($Trainer.party[0].species, shiny, false)
elsif $Trainer.party[0].hp<=0
remove_sprite
end
end
end
#----------------------------------------------------------------------------
# - change_sprite(id, shiny, animation)
# - Example, to change sprite to shiny lugia with animation:
# change_sprite(249, true, true)
# - If just change sprite:
# change_sprite(249)
#----------------------------------------------------------------------------
def change_sprite(id, shiny=nil, animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
if shiny==true
events[i][6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[i][6])
@realEvents[i].character_name=sprintf("%03ds",id)
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
if animation==true
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
$game_variables[Walking_Time_Variable]=0
end
end
end
#----------------------------------------------------------------------------
# - remove_sprite(animation)
# - Example, to remove sprite with animation:
# remove_sprite(true)
# - If just remove sprite:
# remove_sprite
#----------------------------------------------------------------------------
def remove_sprite(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
events[i][6]=sprintf("nil")
@realEvents[i].character_name=sprintf("nil")
if animation==true
$scene.spriteset.addUserAnimation(Animation_Come_In,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
$game_variables[Current_Following_Variable]=$Trainer.party[0]
$game_variables[Walking_Time_Variable]=0
end
end
end
#----------------------------------------------------------------------------
# - check_surf(animation)
# - If current Pokemon is a water Pokemon, it is still following.
# - If current Pokemon is not a water Pokemon, remove sprite.
# - Require Water_Pokemon_Can_Surf = true to enable
#----------------------------------------------------------------------------
def check_surf(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
events[i][6]=sprintf("nil")
@realEvents[i].character_name=sprintf("nil")
else
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
if $Trainer.party[0].hasType?(:WATER)
remove_sprite
else
remove_sprite
pbWait(20)
end
elsif $Trainer.party[0].hp<=0
end
end
end
end
#----------------------------------------------------------------------------
# - talk_to_pokemon
# - It will run when you talk to Pokemon following
#----------------------------------------------------------------------------
def talk_to_pokemon
e=$Trainer.party[0]
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
pos_x=@realEvents[i].x
pos_y=@realEvents[i].y
end
end
if e==0
else
if e.hp>0 && !$Trainer.party[0].egg?
if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true
else
if e!=6
pbPlayCry(e.species)
random1=rand(5)
if $game_variables[ItemWalk]==5
items=[:POTION,:SUPERPOTION,:FULLRESTORE,:REVIVE,:PPUP,
:PPMAX,:RARECANDY,:REPEL,:MAXREPEL,:ESCAPEROPE,
:HONEY,:TINYMUSHROOM,:PEARL,:NUGGET,:GREATBALL,
:ULTRABALL,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,:DUSKSTONE,
:REDAPRICORN,:BLUAPRICORN,:YLWAPRICORN,:GRNAPRICORN,:PNKAPRICORN,
:BLKAPRICORN,:WHTAPRICORN
]
random2=0
loop do
random2=rand(items.length)
break if hasConst?(PBItems,items[random2])
end
Kernel.pbMessage(_INTL("{1} seems to be holding something, it looks like {1} wants to give it to me.",e.name))
Kernel.pbPokemonFound(getConst(PBItems,items[random2]))
$game_variables[ItemWalk]=0
end
if random1==0
$scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)
pbWait(50)
Kernel.pbMessage(_INTL("{1} loves this tune so much that {1} is singing it.",e.name))
elsif e.happiness>0 && e.happiness<=50
$scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)
pbWAit(70)
Kernel.pbMessage(_INTL("{1} hate to travel with {2}.",e.name,$Trainer.name))
elsif e.status==PBStatuses::POISON && e.hp>0 && !e.egg?
$scene.spriteset.addUserAnimation(Emo_Poison, pos_x, pos_y-2)
pbWait(120)
Kernel.pbMessage(_INTL("{1} is badly poisoned, {1} needs help quick.",e.name))
elsif e.happiness>50 && e.happiness<=100
$scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)
pbWait(100)
Kernel.pbMessage(_INTL("{1} is still undecided for whether traveling with {2} is a good thing or not.",e.name,$Trainer.name))
elsif e.happiness>100 && e.happiness<150
$scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)
Kernel.pbMessage(_INTL("{1} is happy traveling with {2}.",e.name,$Trainer.name))
elsif e.happiness>=150
$scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)
pbWait(70)
Kernel.pbMessage(_INTL("{1} loves traveling with {2}.",e.name,$Trainer.name))
end
else
end
end
end
end
end
def Come_back(shiny=nil, animation=nil)
events=$PokemonGlobal.dependentEvents
if $game_variables[Current_Following_Variable]==$Trainer.party.length
$game_variables[Current_Following_Variable]
else
$game_variables[Current_Following_Variable]
end
if $game_variables[Current_Following_Variable]==$Trainer.party.length
remove_sprite(false)
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
else
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
change_sprite($Trainer.party[0].species, shiny, false)
end
for i in 0..$Trainer.party.length-1
if $Trainer.party[i].hp>0 && !$Trainer.party[0].egg?
$game_variables[Current_Following_Variable]=i
refresh_sprite
break
end
end
for i in 0...events.length
for i in 0..$Trainer.party.length-1
if $Trainer.party[i].hp<=0
id = $Trainer.party[i].species
else
id = $Trainer.party[i].species
end
end
if events[i] && events[i][8]=="Dependent"
if shiny==true
events[i][6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[i][6])
@realEvents[i].character_name=sprintf("%03ds",id)
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
else
events[i][6]=sprintf("%03d",id)
@realEvents[i].character_name=sprintf("%03d",id)
end
if animation==true
else
end
end
end
end
#----------------------------------------------------------------------------
# - check_faint
# - If current Pokemon is fainted, change other Pokemon.
#----------------------------------------------------------------------------
def check_faint
if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true
else
if $Trainer.party[0].hp<=0
$game_variables[Current_Following_Variable]=0
remove_sprite
elsif $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
end
end
end
def SetMoveRoute(commands,waitComplete=false)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
pbMoveRoute(@realEvents[i],commands,waitComplete)
end
end
end
end
#----------------------------------------------------------------------------
# - Auto add Script to Kernel.pbSurf, It'll check curent Pokemon when surf
#----------------------------------------------------------------------------
def Kernel.pbSurf
# if $game_player.pbHasDependentEvents?
# return false
# end
if $DEBUG ||
(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORSURF : $Trainer.badges[BADGEFORSURF])
movefinder=Kernel.pbCheckMove(:SURF)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The water is dyed a deep blue... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Surf!",speciesname))
pbHiddenMoveAnimation(movefinder)
# $PokemonTemp.dependentEvents.check_surf
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
$PokemonTemp.dependentEvents.check_surf
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end
#----------------------------------------------------------------------------
# - Auto add Script to pbEndSurf, It'll show sprite after surf
#----------------------------------------------------------------------------
def pbEndSurf(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsSurfableTag?(currentTag)&&!pbIsSurfableTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
$PokemonTemp.dependentEvents.Come_back(true)
end
return true
end
return false
end
#----------------------------------------------------------------------------
# - Auto add Script to Kernel.pbCanUseHiddenMove, fix HM bug
#----------------------------------------------------------------------------
def Kernel.pbCanUseHiddenMove?(pkmn,move)
case move
when PBMoves::FLY
if !$DEBUG && !$Trainer.badges[BADGEFORFLY]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::CUT
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::HEADBUTT
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="HeadbuttTree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::SURF
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
terrain=Kernel.pbFacingTerrainTag
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbMessage(_INTL("Let's enjoy cycling!"))
return false
end
if !pbIsWaterTag?(terrain)
Kernel.pbMessage(_INTL("No surfing here!"))
return false
end
return true
when PBMoves::STRENGTH
if !$DEBUG && !$Trainer.badges[BADGEFORSTRENGTH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Boulder"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::ROCKSMASH
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORROCKSMASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Rock"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::FLASH
if !$DEBUG && !$Trainer.badges[BADGEFORFLASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("This is in use already."))
return false
end
return true
when PBMoves::WATERFALL
if !$DEBUG && !$Trainer.badges[BADGEFORWATERFALL]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if terrain!=PBTerrain::Waterfall
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::DIVE
if !$DEBUG && !$Trainer.badges[BADGEFORDIVE]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.diving
return true
end
if $game_player.terrain_tag!=PBTerrain::DeepWater
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDiveMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
when PBMoves::TELEPORT
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
#if $game_player.pbHasDependentEvents?
# Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
# return false
#end
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome) # Home
end
if healing
mapname=pbGetMapNameFromId(healing[0])
if Kernel.pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
return true
end
return false
else
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
when PBMoves::DIG
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if !escape
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
mapname=pbGetMapNameFromId(escape[0])
if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
return true
end
return false
when PBMoves::SWEETSCENT
return true
else
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn)
end
return false
end
def pbPokemonFollow(x)
Kernel.pbAddDependency2(x, "Dependent", CommonEvent)
$PokemonTemp.dependentEvents.refresh_sprite
end

Everything works fine. I like it :D I just tested it's perfect. Yet in the script you should use CNG's way. He was able to make the pokemon moving even with out the player taking a step. You should look into it. Also How do I make the pokemon appear outside of the pokeball without adding 6 pokemon? Just a quick question. Just looked at it once again. The script now does not change it so Pokemon Come out when collected I might upload a video if you want to know what I mean.

It's a simple set up. Just read it though and think of where you might find the stuff he is talking about. Also the .Anm does not go in that folder. It goes in the Data Folder.
Edit: For the people who can't figure out how to put this in I made a upload for them. This makes it so much easier on Zingzags. Just dowload and replace the folder you have. Warning! This will replace all scripts and Maps you have made. I suggest coping the Map data you all ready have and Replacing it once done. Make sure to delete the Map data in the folder once extracted. Your welcome Zingzags ;D I thought this would help.
Edit: Left the link out XD http://www.mediafire.com/?mdxz0zxm7xkjbrp This file does not contain the Overworlds for it. The scripts are all seperated by me to make sure I know where to place stuff. I will update this link everytime there is a new update on the script.

I am unsure of what the '3' Means. Sense it's based of the work Help-14 I figured the same scripts he used works for the same exact one here. Once the newer version of this came up it stop working. So now it's just a matter of time until Zingzag's checks back in to tell us more. 3 is for the common event.

yh forgot that there was a second event page for the nurse for when you loose soo it seams to be almost identical to the old script (except its less buggy and you can not switch between your pokemon/turn off)

The PokéCommunity

Meta

Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, or The Pokémon Company International. We just love Pokémon.