PDA

View Full Version : [Essentials Script] Help-14's Pokémon Following Character script - fixes and additions


zingzags
May 30th, 2012, 4:23 PM
Well here you go :p
I know it can be cleaner and shortened.


#==============================================================================
# ¡Ü 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"
[email protected][i].x
[email protected][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


replace Kernel.pbMountBike with

def Kernel.pbMountBike
return if $PokemonGlobal.bicycle
$PokemonGlobal.bicycle=true
$PokemonTemp.dependentEvents.remove_sprite(true)
Kernel.pbUpdateVehicle
bikebgm=pbGetMetadata(0,MetadataBicycleBGM)
if bikebgm
pbCueBGM(bikebgm,0.5)
end
end


replace dependent events

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 &&
$MapFactory.getTerrainTag(tile[0],tile[1],tile[2])==PBTerrain::Ledge
# 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
}


add these to your settings

#=========================================================
# ● Config Script For Your Game Here
# Change the emo_ to what ever number is the cell holding the animation
#=========================================================
Current_Following_Variable = 36
CommonEvent = 3
ItemWalk=26
Walking_Time_Variable = 27
Animation_Come_Out = 22
Animation_Come_In = 23
Emo_Happy = 24
Emo_Normal = 25
Emo_Hate = 26
Emo_Poison= 27
Emo_sing= 28
Emo_love= 29


Put this in common events and name it TalkToPokemon

Talkative


Put this in PokemonParty

$PokemonTemp.dependentEvents.refresh_sprite

under

next if havecommand
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
[email protected](true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)


Also place it in PokemonStorage under

def pbTrainerPC
Kernel.pbMessage(_INTL("\\se[computeropen]{1} booted up the PC.",$Trainer.name))
pbTrainerPCMenu
pbSEPlay("computerclose")


also under this

def access
Kernel.pbMessage(_INTL("\\se[accesspc]Accessed {1}'s PC.",$Trainer.name))
pbTrainerPCMenu



in def update of Game_player_ add

$PokemonTemp.dependentEvents.add_following_time

under
$PokemonTemp.dependentEvents.updateDependentEvents

Replace pbEndBattle in Pokemon_ActualScene

def pbEndBattle(result)
@abortable=false
pbShowWindow(BLANK)
# Fade out all sprites
$PokemonTemp.dependentEvents.check_faint
pbBGMFade(1.0)
pbFadeOutAndHide(@sprites)
pbDisposeSprites
end


Also after you are done healing a pokemon from the pokemon center put this in

$PokemonTemp.dependentEvents.refresh_sprite


Place this in PokemonField above def kernel.pbReceiveItem

def Kernel.pbPokemonFound(item,quantity=1,plural=nil)
itemname=PBItems.getName(item)
pocket=pbGetPocket(item)
e=$Trainer.party[0].name
if $PokemonBag.pbStoreItem(item,quantity)
pbWait(5)

if $ItemData[item][ITEMUSE]==3 || $ItemData[item][ITEMUSE]==4
Kernel.pbMessage(_INTL("\\se[]{1} found {2}!\\se[itemlevel]\\nIt contained {3}.\\wtnp[30]",e,itemname,PBMoves.getName($ItemData[item][ITEMMACHINE])))
Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the {3} Pocket.",$Trainer.name,itemname,PokemonBag.pocketNames()[pocket]))
elsif isConst?(item,PBItems,:LEFTOVERS)
Kernel.pbMessage(_INTL("\\se[]{1} found some {2}!\\se[itemlevel]\\wtnp[30]",e,itemname))
Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the {3} Pocket.",$Trainer.name,itemname,PokemonBag.pocketNames()[pocket]))
else
if quantity>1
if plural
Kernel.pbMessage(_INTL("\\se[]{1} found {2} {3}!\\se[itemlevel]\\wtnp[30]",e,quantity,plural))
Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the {3} Pocket.",$Trainer.name,plural,PokemonBag.pocketNames()[pocket]))
else
Kernel.pbMessage(_INTL("\\se[]{1} found {2} {3}s!\\se[itemlevel]\\wtnp[30]",e,quantity,itemname))
Kernel.pbMessage(_INTL("{1} put the {2}s\r\nin the {3} Pocket.",$Trainer.name,itemname,PokemonBag.pocketNames()[pocket]))
end
else
Kernel.pbMessage(_INTL("\\se[]{1} found one {2}!\\se[itemlevel]\\wtnp[30]",e,itemname))
Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the {3} Pocket.",$Trainer.name,itemname,PokemonBag.pocketNames()[pocket]))
end
end
return true
else # Can't add the item
if $ItemData[item][ITEMUSE]==3 || $ItemData[item][ITEMUSE]==4
Kernel.pbMessage(_INTL("{1} found {2}!\\wtnp[20]",e,itemname))
elsif isConst?(item,PBItems,:LEFTOVERS)
Kernel.pbMessage(_INTL("{1} found some {2}!\\wtnp[20]",$Trainer.name,itemname))
else
if quantity>1
if plural
Kernel.pbMessage(_INTL("{1} found {2} {3}!\\wtnp[20]",e,quantity,plural))
else
Kernel.pbMessage(_INTL("{1} found {2} {3}s!\\wtnp[20]",$Trainer.name,quantity,itemname))
end
else
Kernel.pbMessage(_INTL("{1} found one {2}!\\wtnp[20]",e,itemname))
end
end
Kernel.pbMessage(_INTL("Too bad... The Bag is full..."))
return false
end
end



http://dl.dropbox.com/u/7240024/Pokemon-Follow.png
http://dl.dropbox.com/u/7240024/emo.png
http://dl.dropbox.com/u/7240024/emo2.png
http://dl.dropbox.com/u/7240024/Animations.rxdata
http://dl.dropbox.com/u/7240024/Emo_Sing.anm
http://dl.dropbox.com/u/7240024/Emo_Poison.anm
http://dl.dropbox.com/u/7240024/Emo_Normal.anm
http://dl.dropbox.com/u/7240024/Emo_love.anm
http://dl.dropbox.com/u/7240024/Emo_Hate.anm
http://dl.dropbox.com/u/7240024/Emo_Happy.anm
http://dl.dropbox.com/u/7240024/Characters.rar
That should be everything, report any errors down below, anything to help make the code shorter and better post below or pm me.

Nickalooose
May 31st, 2012, 2:30 AM
Impressed.

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

zingzags
May 31st, 2012, 8:35 AM
I forgot something in def update of Game_player_ add

$PokemonTemp.dependentEvents.add_following_time

under
$PokemonTemp.dependentEvents.updateDependentEvents

venom12
May 31st, 2012, 9:16 AM
Great work, i didnt tested much but for now works ok, one thing i would like to have in that is, when we dont moving pokemon still steps like on hgss.

zingzags
May 31st, 2012, 10:50 AM
Great work, i didnt tested much but for now works ok, one thing i would like to have in that is, when we dont moving pokemon still steps like on hgss.

That is a good idea, but it would require the animation to just play. I have no idea how to do that though.

Updated the thread because I forgot a few things.

zingzags
June 2nd, 2012, 10:56 AM
updated, added egg check to see if you have an egg in the first slot of your party. If you have an egg in the first slot of your party the dependent event gets removed.

Lord Varion
June 2nd, 2012, 12:31 PM
I never saw the original script.
But, I'm guessing I'd need the sprites for the pokémon.
But, do I need the old script too ?

zingzags
June 3rd, 2012, 9:50 AM
I never saw the original script.
But, I'm guessing I'd need the sprites for the pokémon.
But, do I need the old script too ?
Yes
Yes
No
I haven't uploaded the sprites but they are in the original thread, search for help -14.

FHJoker
June 5th, 2012, 6:48 AM
I did the above but i got this error message when the GotPokemon Switch is turned on.

---------------------------
Pokemon Essentials
---------------------------
Exception: TypeError

Message: cannot convert Fixnum into String

WalkingPkMn:44:in `+'

WalkingPkMn:44:in `add_following_time'

Game_Player_:401:in `update_old'

Walk_Run:71:in `update'

Scene_Map:85:in `miniupdate'

Scene_Map:83:in `loop'

Scene_Map:95:in `miniupdate'

PokemonMessages:145:in `pbUpdateSceneMap'

PokemonPauseMenu: 16 : in `pbShowCommands'

PokemonPauseMenu: 12: in `loop'



This exception was logged

zingzags
June 5th, 2012, 12:45 PM
I did the above but i got this error message when the GotPokemon Switch is turned on.

---------------------------
Pokemon Essentials
---------------------------
Exception: TypeError

Message: cannot convert Fixnum into String

WalkingPkMn:44:in `+'

WalkingPkMn:44:in `add_following_time'

Game_Player_:401:in `update_old'

Walk_Run:71:in `update'

Scene_Map:85:in `miniupdate'

Scene_Map:83:in `loop'

Scene_Map:95:in `miniupdate'

PokemonMessages:145:in `pbUpdateSceneMap'

PokemonPauseMenu: 16 : in `pbShowCommands'

PokemonPauseMenu: 12: in `loop'



This exception was logged
^ You must did something wrong, because it works fine for me.

Ill check that out, I updated the thread again, I forgot to add something(again), and thanks to Maruno there is an easier way to add random items.

FHJoker
June 6th, 2012, 9:19 AM
I copied it again and got almost the same

---------------------------
Pokemon Essentials
---------------------------
Exception: TypeError

Message: cannot convert Fixnum into String

FollowingCharacter:44:in `+'

FollowingCharacter:44:in `add_following_time'

Game_Player_:401:in `update_old'

Walk_Run:71:in `update'

Scene_Map:104:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

Scene_Map:65:in `loop'

Scene_Map:72:in `main'



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

Message: undefined method `unlock' for nil:NilClass

Interpreter:512:in `command_end'

Interpreter:295:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

Scene_Map:65:in `loop'



This exception was logged
---------------------------
OK
---------------------------

ChaosLord
June 6th, 2012, 12:46 PM
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.)

zingzags
June 6th, 2012, 6:49 PM
I copied it again and got almost the same

---------------------------
Pokemon Essentials
---------------------------
Exception: TypeError

Message: cannot convert Fixnum into String

FollowingCharacter:44:in `+'

FollowingCharacter:44:in `add_following_time'

Game_Player_:401:in `update_old'

Walk_Run:71:in `update'

Scene_Map:104:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

Scene_Map:65:in `loop'

Scene_Map:72:in `main'



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

Message: undefined method `unlock' for nil:NilClass

Interpreter:512:in `command_end'

Interpreter:295:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

Scene_Map:65:in `loop'



This exception was logged
---------------------------
OK
---------------------------
Ill try to see into that.

~Angel~
June 10th, 2012, 11:33 AM
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.

zingzags
June 17th, 2012, 11:17 AM
Update to fix the unlock problem comment out this line
in Interperter line 512:

$game_map.events[@event_id].unlock

to

#$game_map.events[@event_id].unlock

I will try to fix the pokemon not talking soon.

EDIT:nvm I fixed the no talking issue

#==============================================================================
# ¡Ü 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"
[email protected][i].x
[email protected][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

~Angel~
June 18th, 2012, 9:09 AM
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.

p.claydon
June 18th, 2012, 10:50 AM
ok how do i get the pokemon out? ive added all the script stuff from the 1st post but dont know were to go from there (im also asuming the .anm files go in the animation folder

~Angel~
June 18th, 2012, 10:55 AM
ok how do i get the pokemon out? ive added all the script stuff from the 1st post but dont know were to go from there (im also asuming the .anm files go in the animation folder

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.

p.claydon
June 18th, 2012, 11:47 AM
ok your demo works but why is the sprite bulbasaur when the pokemon 1st starts to follow you?

~Angel~
June 18th, 2012, 12:07 PM
I just set it that way. I was getting annoyed with the Over worlds that were there I just set it that way.

p.claydon
June 18th, 2012, 12:09 PM
yh just figured out roughly how it works (i had the call event wrong) but what does the 3 mean in the call script
Kernel.pbAddDependency2(7, "Dependent", 3)

~Angel~
June 18th, 2012, 12:25 PM
yh just figured out roughly how it works (i had the call event wrong) but what does the 3 mean in the call script
Kernel.pbAddDependency2(7, "Dependent", 3)

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.

p.claydon
June 18th, 2012, 12:48 PM
oh

shame we cant scroll through the pokemon like we used too

EDIT

if all your pokemon faint then your pokemon no longer follows you

EDIT

if all your pokemon faint then your pokemon no longer follows you - Fixed

~Angel~
June 18th, 2012, 4:20 PM
You need to update the Pokecenter scripts to. That's why they did not follow. Open up a nurse and add in this: $PokemonTemp.dependentEvents.refresh_sprite

p.claydon
June 18th, 2012, 4:32 PM
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)

zingzags
June 18th, 2012, 5:37 PM
@Rick1234 I left you a few VM's for some of the posts you put up.

@p.claydon It still similar, I just added a few things and made some changes, its not 100% HG/SS though, still a lot of things that needs to be done.

pbPokemonFollow(x) where "x" means the dependent event which you want your following pokemon to be.

Kernel.pbAddDependency2(x, "Dependent", CommonEvent)

The way I set it up was that the commonEvent which you placed the talk_to_pokemon can be edited in the settings section, "x" is still the same as how I explained it before, and "Dependent" is the name of the event, so if you changed the event to lets say Zingzags, you are going to have to change
(x, "Dependent", CommonEvent)
to
(x, "Zingzags", CommonEvent)

Also I have made it so only one pokemon follows you, it works 100% better that way. buy you can make it so that your entire party can show up on screen, if you liked the photo system that Help -14 made for himself awhile ago.

~Angel~
June 18th, 2012, 7:05 PM
@Rick1234 I left you a few VM's for some of the posts you put up.

@p.claydon It still similar, I just added a few things and made some changes, its not 100% HG/SS though, still a lot of things that needs to be done.

pbPokemonFollow(x) where "x" means the dependent event which you want your following pokemon to be.

Kernel.pbAddDependency2(x, "Dependent", CommonEvent)

The way I set it up was that the commonEvent which you placed the talk_to_pokemon can be edited in the settings section, "x" is still the same as how I explained it before, and "Dependent" is the name of the event, so if you changed the event to lets say Zingzags, you are going to have to change
(x, "Dependent", CommonEvent)
to
(x, "Zingzags", CommonEvent)

Also I have made it so only one pokemon follows you, it works 100% better that way. buy you can make it so that your entire party can show up on screen, if you liked the photo system that Help -14 made for himself awhile ago.
I did the pbPokemonFollow(1) with a conditional branch that adds Bulbasaur but oddly nothing shows. I removed A event that was in the way of the script. It erased the move tutor but now the event does not show. This is what I did.

Conditional Branch: Script: pbAddPokemon(Bulbasaur,5)
@>
Else
@>
Branch End
Script: pbPokemonFollow(1)
Control SelfSwitch=A
Is the pbPokemonFollow(1) Men't to be a conditional branch?
Edit: So..I got this message:

---------------------------
Pokemon Enexta
---------------------------
Exception: RuntimeError

Message: Script error within event 1, map 25 (Test Map 2):

Exception: NoMethodError

Message: (eval):1:in `pbExecuteScript'undefined method `talk_to_' for #<DependentEvents:0x9debad0>

***Full script:

$PokemonTemp.dependentEvents.talk_to_
pokemon


Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in

C:\Users\RON III\Saved Games/Pokemon Enexta/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
I am over next to where the move Deleter is and It's giving me that XD I have no event there either.

zingzags
June 18th, 2012, 7:21 PM
Use the extendedtext.exe when you have one of the syntax editing box opened. For example when you add a script to a event, and the box is too short use extendedtext.exe, that is located in the root folder of your project.

~Angel~
June 19th, 2012, 4:18 AM
Use the extendedtext.exe when you have one of the syntax editing box opened. For example when you add a script to a event, and the box is too short use extendedtext.exe, that is located in the root folder of your project. All right I just did that. I went to test and it helped but know something is defenatly wrong!http://daevolutions.deviantart.com/#/d545pe0
I know it's not men't to be like that XC..
Edit: The pokemon is following but no sprite shows up. What's wrong with that? And it's only that problem. Everything else works fine.

I recommend that the setting's scripts be change just a bit. Here is what I did so it does not mess up anyone's game:
#=========================================================
# ● Config Script For Your Game Here
# Change the emo_ to what ever number is the cell holding the animation
#=========================================================
Current_Following_Variable = 36
CommonEvent = 3
ItemWalk=26
Walking_Time_Variable = 27
Animation_Come_Out = 93
Animation_Come_In = 94
Emo_Happy = 95
Emo_Normal = 96
Emo_Hate = 97
Emo_Poison= 98
Emo_sing= 99
Emo_love= 100
This makes it so the animations don't mess up Maruno's animations all ready imputed into the system. I will upload a download link to the animations and scripts A.S.A.P.
Edit: Here is the link for the Scripts:http://www.mediafire.com/download.php?mnoy22sqhbxadlh
Here is the link for the animations: http://www.mediafire.com/download.php?b3l4onfaui24fbf Remove the setting's script part you have and place these in. Remove the animations before placing them in the folder. It does not work if you leave that in there.
Edit: ZingZags can you help me. I want add to the script cause I like the 6 pokemon following the character. Can you help me add that in?

zingzags
June 19th, 2012, 10:13 AM
All right I just did that. I went to test and it helped but know something is defenatly wrong!http://daevolutions.deviantart.com/#/d545pe0
I know it's not men't to be like that XC..
Edit: The pokemon is following but no sprite shows up. What's wrong with that? And it's only that problem. Everything else works fine.

I recommend that the setting's scripts be change just a bit. Here is what I did so it does not mess up anyone's game:

This makes it so the animations don't mess up Maruno's animations all ready imputed into the system. I will upload a download link to the animations and scripts A.S.A.P.
Edit: Here is the link for the Scripts:http://www.mediafire.com/download.php?mnoy22sqhbxadlh
Here is the link for the animations: http://www.mediafire.com/download.php?b3l4onfaui24fbf Remove the setting's script part you have and place these in. Remove the animations before placing them in the folder. It does not work if you leave that in there.
Edit: ZingZags can you help me. I want add to the script cause I like the 6 pokemon following the character. Can you help me add that in?

6 Pokemon following you will create a huge lag, and

#==============================================================================
# ¡Ü 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"
[email protected][i].x
[email protected][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

use this, and make a new game, and tell me if it still doesn't work. Also post an image of the event that gives you the pokemon.

~Angel~
June 19th, 2012, 10:15 AM
6 Pokemon following you will create a huge lag, and

#==============================================================================
# ¡Ü 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"
[email protected][i].x
[email protected][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

use this, and make a new game, and tell me if it still doesn't work. Also post an image of the event that gives you the pokemon.

All right I will input that now and test it.


http://daevolutions.deviantart.com/#/d546u7v Here is the image. It's not working still :/

zingzags
June 19th, 2012, 10:47 AM
Remove the scripts under pbPokemonFollow(12)

~Angel~
June 19th, 2012, 2:02 PM
Remove the scripts under pbPokemonFollow(12)

It does the same thing either way.

zingzags
June 19th, 2012, 7:56 PM
It does the same thing either way.
Send me your data i will fix it for u.

korjamer
June 19th, 2012, 10:24 PM
I'm so glad to see help14's script upgraded! Do you think that you could possibly provide a link to it installed on the newest version of essentials? I did my best to follow your instructions but my game keeps crashing. But anyway, Its a great update to a great addition to essentials! Thank you so much zingzags!

I keep getting this error message every time I talk to a Pokemon after installing the script into a fresh version of the current essentials.

---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError

Message: Script error within event 1, map 25 (Test Map 2):

Exception: NoMethodError

Message: (eval):1:in `pbExecuteScript'undefined method `talk_to_' for #<DependentEvents:0xb1a6770>

***Full script:

$PokemonTemp.dependentEvents.talk_to_
pokemon


Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

What am I doing wrong?

zingzags
June 20th, 2012, 7:17 AM
Add this to the bottom of the script

def Talkative
$PokemonTemp.dependentEvents.talk_to_pokemon
end

And in the common event which holds the "$PokemonTemp.dependentEvents.talk_to_pokemon"
Change it to

Talkative

~Angel~
June 20th, 2012, 10:09 AM
http://www.mediafire.com/download.php?88693q8ju0de1mr Here you go.

~Angel~
June 22nd, 2012, 6:07 PM
Add this to the bottom of the script

def Talkative
$PokemonTemp.dependentEvents.talk_to_pokemon
end

And in the common event which holds the "$PokemonTemp.dependentEvents.talk_to_pokemon"
Change it to

Talkative

Just to tell you this code does not work. I just tested it and got this:
---------------------------
Pokemon Enexta
---------------------------
Exception: RuntimeError

Message: Script error within event 12, map 25 (Test Map 2):

Exception: NameError

Message: (eval):1:in `pbExecuteScript'uninitialized constant Interpreter::Talkative

***Full script:

Talkative


Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in

C:\Users\RON III\Saved Games/Pokemon Enexta/errorlog.txt.

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

p.claydon
June 23rd, 2012, 10:48 AM
dumb question were do i put the files Pokemon-Follow.png (http://dl.dropbox.com/u/7240024/Pokemon-Follow.png), emo.png and emo2.png and how do i use them???

~Angel~
June 23rd, 2012, 4:09 PM
dumb question were do i put the files Pokemon-Follow.png (http://dl.dropbox.com/u/7240024/Pokemon-Follow.png), emo.png and emo2.png and how do i use them???
Put it in the animations folder.

Rayd12smitty
June 25th, 2012, 6:21 PM
First off, this is awesome. You did a great job. I never got around to using Help-14's original script, but now I will use yours.

Now, I hate to be that guy, but for all of those out there, who don't know how to script, could you put up an installation video

~Angel~
June 25th, 2012, 8:29 PM
First off, this is awesome. You did a great job. I never got around to using Help-14's original script, but now I will use yours.

Now, I hate to be that guy, but for all of those out there, who don't know how to script, could you put up an installation video

I know what you mean. I just put up the scripts so people can use it. I am going to update the scripts in then next fix. Also all you have to do is ready it really carefully XD I don't know how to script but when I went through I figured how to add this in.

zingzags
June 25th, 2012, 9:01 PM
HMM, an installation video. I will see when I get the time to do it right now I am busy with life at the moment so I really cannot do much right now.

Rayd12smitty
June 26th, 2012, 4:17 AM
HMM, an installation video. I will see when I get the time to do it right now I am busy with life at the moment so I really cannot do much right now.

No hurry. Thank you for considering it.

~Angel~
June 26th, 2012, 7:20 AM
HMM, an installation video. I will see when I get the time to do it right now I am busy with life at the moment so I really cannot do much right now.

I might be able to do it for you. I forgot how to add it in but I can if you want?

Rayd12smitty
June 27th, 2012, 11:41 AM
I might be able to do it for you. I forgot how to add it in but I can if you want?

I for one, would appreciate it

p.claydon
June 27th, 2012, 2:01 PM
i still can not get the emotion icons to show

~Angel~
July 3rd, 2012, 4:21 PM
i still can not get the emotion icons to show

Sorry I have not been following this lately. Make sure to have this in there:

#=========================================================
# ● Config Script For Your Game Here
# Change the emo_ to what ever number is the cell holding the animation
#=========================================================
Current_Following_Variable = 36
CommonEvent = 3
ItemWalk=26
Walking_Time_Variable = 27
Animation_Come_Out = 22
Animation_Come_In = 23
Emo_Happy = 24
Emo_Normal = 25
Emo_Hate = 26
Emo_Poison= 27
Emo_sing= 28
Emo_love= 29

FHJoker
July 4th, 2012, 11:14 PM
How do I return/send out Pokemon after the initial follow event. And how do I make it so that certain Pokemon can't enter buildings.

~Angel~
July 5th, 2012, 11:24 AM
How do I return/send out Pokemon after the initial follow event. And how do I make it so that certain Pokemon can't enter buildings.

:/ Hm..Zingzag's might know I am just a helper. He is unable to be on for reason's. He may not have put that in there because of lag issue's and use: pbPokemonFollow(x) to make the pokemon follow. Pokemon comming in is something I don't know.

Rayd12smitty
July 9th, 2012, 2:52 PM
Just wondering if a video is a possibility near future. I know everyone is busy and all, but so many more people would use the script if a video was made

~Angel~
July 9th, 2012, 4:03 PM
Just wondering if a video is a possibility near future. I know everyone is busy and all, but so many more people would use the script if a video was made

Forgot all about that XD I am still thinking on it but I am sure I will end up making one.

Rayd12smitty
July 9th, 2012, 4:33 PM
Forgot all about that XD I am still thinking on it but I am sure I will end up making one.

great! Let the thread know when its done. Can't wait

~Angel~
July 9th, 2012, 5:01 PM
great! Let the thread know when its done. Can't wait

I will make sure to post it in the thread :D
Edit: I just finished recording it but the recorder failed to load it when done. Sorry :/ I don't think I will be able to make a video for you guys.

Ramond Hikari
July 13th, 2012, 7:07 PM
So here is my problem: I was trying to talk to my Pikachu when this suddenly popped up:


Exception: NoMethodError

Message: undefined method `unlock' for nil:NilClass

Interpreter:512:in `command_end'

Interpreter:295:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'

Scene_Map:65:in `loop'



And the weirdest thing is that this sometimes happens and sometimes doesn't.
Can you tell me how to fix this? Thanks a lot :D

PS: I am using Pokemon Essential ver7 and I can't find where the Mount Bike script is. Can you tell me where?

Rayd12smitty
July 13th, 2012, 8:26 PM
So here is my problem: I was trying to talk to my Pikachu when this suddenly popped up:



And the weirdest thing is that this sometimes happens and sometimes doesn't.
Can you tell me how to fix this? Thanks a lot :D

PS: I am using Pokemon Essential ver7 and I can't find where the Mount Bike script is. Can you tell me where?

I can't help with the error, but the mount bike is in PokemonField. It isn't too hard to find, and if you need to just search it

[QUOTE=
Edit: I just finished recording it but the recorder failed to load it when done. Sorry :/ I don't think I will be able to make a video for you guys.[/QUOTE]

Oh Really???? Could you possibly email it to me if I PM you my email address?

Rayquaza.
July 14th, 2012, 8:36 AM
If you could input all of these scripts, common events and the rest into the current version of essentials and put up a download link for it that would be greatly appreciated (In the past I've screwed up Emerald Legend by trying to implement new scripts).

Rayd12smitty
July 14th, 2012, 12:29 PM
I like rayquazas idea. If a video can't get up thats the next best thing

~Angel~
July 14th, 2012, 1:46 PM
I can't help with the error, but the mount bike is in PokemonField. It isn't too hard to find, and if you need to just search it



Oh Really???? Could you possibly email it to me if I PM you my email address?

^ I am saying the entire capture device erased the video.

Rayd12smitty
July 14th, 2012, 2:36 PM
^ I am saying the entire capture device erased the video.

Ohhhhh. That sucks. Then could you maybe use rayquaza's suggestion, and upload a file with the script implemented on the newest version of essentials (8)

~Angel~
July 15th, 2012, 4:58 AM
Ohhhhh. That sucks. Then could you maybe use rayquaza's suggestion, and upload a file with the script implemented on the newest version of essentials (8)

I tried to move it to 8 but odd enough something went wrong with my scripts. I am going to update it to 8 soon enough either way. I want to make it so B/W pokemon follow using P-signs kit. I have sprites for them to use. About half of them are done now. I need to figure out why they won't follow.

Rayd12smitty
July 15th, 2012, 8:02 AM
I tried to move it to 8 but odd enough something went wrong with my scripts. I am going to update it to 8 soon enough either way. I want to make it so B/W pokemon follow using P-signs kit. I have sprites for them to use. About half of them are done now. I need to figure out why they won't follow.

Alright. I can wait longer I guess. Please load a file or something if you get it to work.

~Angel~
July 15th, 2012, 4:00 PM
Alright. I can wait longer I guess. Please load a file or something if you get it to work.

Will do. I am going to try to find the problem with the script soon and make it so all 649 before uploading a file. I think I might know where it is.

Rayd12smitty
July 15th, 2012, 4:06 PM
Will do. I am going to try to find the problem with the script soon and make it so all 649 before uploading a file. I think I might know where it is.

great! can't wait to see it, and put it to use

~Angel~
July 15th, 2012, 5:16 PM
great! can't wait to see it, and put it to use

:D Thanks. Hm..I would have to find out maybe how to get it to work. Sprites are not fully done :/ Those take up my time a ton so I might be able to modify the scripts but I am new to it so :/

Rayd12smitty
July 15th, 2012, 5:25 PM
:D Thanks. Hm..I would have to find out maybe how to get it to work. Sprites are not fully done :/ Those take up my time a ton so I might be able to modify the scripts but I am new to it so :/

If you are missing the sprites and thats all, help-14 uploaded them awhile ago here:
http://www.mediafire.com/?g63xg1j7f06a454

~Angel~
July 15th, 2012, 5:43 PM
If you are missing the sprites and thats all, help-14 uploaded them awhile ago here:
http://www.mediafire.com/?g63xg1j7f06a454

Just shiny. I have a thread up for a question/Tutorial check it out it's in the Pokemon essentials section. It's a bit more clear.

shadowriver
July 15th, 2012, 9:40 PM
I just got this to work with V8 and with P-signs b/w kit everything’s working fine.
All i did was move all my map data files to Rick1234's Example Data folder then transferred the data folder back to my game that already had the b/w kit installed.
All the pbs files remained the same I didn’t touch them at all.

The thing was it didn’t work until I put back map data 25 from rick1234's kit to my game then started the game on that map there was no errors why I’m not to Shure yet.

(I assume its still Vr8 even though I replaced most of the data files if not let me know.

#edit, for sum reason it only works on the dependent event on map 25, witch is the test 2 map. whenever i put the dependent event on eny other page nothing shows up and nothing hapens
when i put $PokemonTemp.dependentEvents.refresh_sprite in the healing pokecenter event.

so when the event actually works i have pokemon follow but when all able pokemon faint they dont end up following enymore. does enyone know why this is

~Angel~
July 16th, 2012, 3:47 PM
I just got this to work with V8 and with P-signs b/w kit everything’s working fine.
All i did was move all my map data files to Rick1234's Example Data folder then transferred the data folder back to my game that already had the b/w kit installed.
All the pbs files remained the same I didn’t touch them at all.

The thing was it didn’t work until I put back map data 25 from rick1234's kit to my game then started the game on that map there was no errors why I’m not to Shure yet.

(I assume its still Vr8 even though I replaced most of the data files if not let me know.

#edit, for sum reason it only works on the dependent event on map 25, witch is the test 2 map. whenever i put the dependent event on eny other page nothing shows up and nothing hapens
when i put $PokemonTemp.dependentEvents.refresh_sprite in the healing pokecenter event.

so when the event actually works i have pokemon follow but when all able pokemon faint they dont end up following enymore. does enyone know why this is

Just to tell you. That Data is old. It's easier just to go to the thread I made with a bit more clearer instructions. Go to the pokemon essentials section and look for: Follow Addition? I think that's it.

ambalance
April 7th, 2013, 9:06 PM
Hey guys,

I'm having trouble with Help-14's Pokemon following script.
Everything works fine, until I try to change the Pokemon that is first in my party,
I.e, The pokemon that follows the character.

I get this, when I try to change:
---------------------------
Pokemon Game
---------------------------
Exception: NameError

Message: undefined local variable or method `auto_change_with_animation' for #<PokemonScreen:0xc85c3a0>

PokemonParty:1997:in `pbPokemonScreen'

PokemonParty:1897:in `loop'

PokemonParty:2027:in `pbPokemonScreen'

PokemonPauseMenu:173:in `pbStartPokemonMenu'

PokemonPauseMenu:172:in `pbFadeOutIn'

PokemonPauseMenu:172:in `pbStartPokemonMenu'

PokemonPauseMenu:142:in `loop'

PokemonPauseMenu:256:in `pbStartPokemonMenu'

Scene_Map:188:in `call_menu'

Scene_Map:159:in `update'



This exception was logged in

C:\Users\Cam\Saved Games/Pokemon Game/errorlog.txt.

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


Can anyone help me?

Tayuya of the Sound Four
April 9th, 2013, 3:58 PM
The Pokemon Following Script doesn't seem to work with the latest version of Essentials, if you're using Essentials 11 then it's unlikely there is a fix that will help your issue as of now. If you are using the compatible Version of Essentials with Help's script then someone will help you :P I just thought you should know it doesn't work with Essentials 11

Rayd12smitty
April 9th, 2013, 5:06 PM
The Pokemon Following Script doesn't seem to work with the latest version of Essentials, if you're using Essentials 11 then it's unlikely there is a fix that will help your issue as of now. If you are using the compatible Version of Essentials with Help's script then someone will help you :P I just thought you should know it doesn't work with Essentials 11

That isn't true. I have it working perfectly with version 11. You most likely did something wrong while installing it. I don't know exactly what you error means though. If you PM me your scripts data I can fix it for you most likely

Tayuya of the Sound Four
April 14th, 2013, 8:39 AM
That isn't true. I have it working perfectly with version 11. You most likely did something wrong while installing it. I don't know exactly what you error means though. If you PM me your scripts data I can fix it for you most likely

Really?? That would be such a huge help!! I might of gotten rid of the script because I couldn't get it to work I'll PM you in a bit so you can help me, and then I'll make a tutorial if you don't mind incase others are as script handicapped as me

Harvey_Create
April 14th, 2013, 9:55 AM
hey, would someone like to help me add this to my game, but also with an option to toggle it off for some people?

Sailer26
April 16th, 2013, 11:06 PM
i have a problem.

The pokemon don't apears when i actived the functions

Rayd12smitty
April 17th, 2013, 3:44 AM
^^^ Like I said in PM I can help.

@ Harvey_Create

PM me

warox
April 21st, 2013, 12:23 PM
i love this following script :D! only thing is that im having a hard time getting pokemons to switch with the press of a button like in the old version lol :P

akane159
April 27th, 2013, 10:52 AM
Just to tell you this code does not work. I just tested it and got this:
---------------------------
Pokemon Enexta
---------------------------
Exception: RuntimeError

Message: Script error within event 12, map 25 (Test Map 2):

Exception: NameError

Message: (eval):1:in `pbExecuteScript'uninitialized constant Interpreter::Talkative

***Full script:

Talkative


Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



Interpreter:276:in `pbExecuteScript'

Interpreter:1599:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in

C:\Users\RON III\Saved Games/Pokemon Enexta/errorlog.txt.

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


i have the same problem, you only have to do is this

change
def Talkative
$PokemonTemp.dependentEvents.talk_to_pokemon
end
For this
def pbTalkactive
$PokemonTemp.dependentEvents.talk_to_pokemon
end
and the commont event change (call script)
Talkativefor
pbTalkactive

:D!

raduban
April 28th, 2013, 6:29 AM
can someone explain in a little more detail what to do after setting up the scripts and how the common event is created?

akane159
April 29th, 2013, 9:16 PM
@raduban to create a common event just go to "database" common event and there are some empty space named TalkToPokemon you put in the white box then choose the option to call this script and place it "pbTalkactive" (pbTalkactive if you changed the end of the script talkative to pbTalkactive)

..

I need some help on this, when I talk to my pokemon, animations are not displayed (love / hate / poison / etc) anyone know why?
and add the animation with the same name, and nothing happens

heitres
May 13th, 2013, 8:00 AM
I want to adapt this script to my project, sinc emy project uses the Pokémon Essentials that was release in december of 2012, the version number 11 to be more exactly. How can I adapt this script? Some1 could me explain? Or create some tutorial? Sorry if I am bother you, but here I need help. I want to try to make this optional, everytime the player wants to put his pokemon outside then he/her is free to do so, but the player can make his/her pokemon inside of the pokeball, like ti is in pokeMMO for example. Sorry to waste your time :S

bartyboy6
May 13th, 2013, 10:36 AM
none of these dropbox links seem to work

Exception: NameError

Message: uninitialized constant DependentEvents::Current_Following_Variable

Pokemon Following Characters:61:in `refresh_sprite'

PokemonParty:1995:in `pbPokemonScreen'

PokemonParty:1897:in `loop'

PokemonParty:2024:in `pbPokemonScreen'

PokemonPauseMenu:173:in `pbStartPokemonMenu'

PokemonPauseMenu:172:in `pbFadeOutIn'

PokemonPauseMenu:172:in `pbStartPokemonMenu'

PokemonPauseMenu:142:in `loop'

PokemonPauseMenu:256:in `pbStartPokemonMenu'

Scene_Map:188:in `call_menu'



This exception was logged in

C:\Users\Gebruiker\Saved Games/Pokemon Lunar Version/errorlog.txt.

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

akane159
May 14th, 2013, 6:40 PM
hi men :), look i find this bug, when you lose a battle, i mean when all your pokemon die and show up in the CP, your pokemon will cease to follow after they are cured, do not appear :S, but only happens when all your pokemon die, now if there is at least one live and priests if they appear

Rayd12smitty
May 15th, 2013, 1:11 PM
hi men :), look i find this bug, when you lose a battle, i mean when all your pokemon die and show up in the CP, your pokemon will cease to follow after they are cured, do not appear :S, but only happens when all your pokemon die, now if there is at least one live and priests if they appear

I'm pretty sure this is known. You just have to add the following line again in Pokemon Centers, but only in the autorun page that happens when you die. Just throw in pbPokemonFollow(x) and have a blank event there

akane159
May 15th, 2013, 8:40 PM
thx men that help me a lot xD, but now I have this problem, when I add the script, activates the surf in the water, without a pokemon have learned the technique surf , you speak only in the water and asks if you want to surf if you selec yes, it begins to surf, do i not know why this happens, and also from talking to your pokemon do not appear the animations, emoticons and I have created in the database at the animation with the same names that are in the script :S

Rayd12smitty
May 16th, 2013, 3:46 AM
thx men that help me a lot xD, but now I have this problem, when I add the script, activates the surf in the water, without a pokemon have learned the technique surf , you speak only in the water and asks if you want to surf if you selec yes, it begins to surf, do i not know why this happens, and also from talking to your pokemon do not appear the animations, emoticons and I have created in the database at the animation with the same names that are in the script :S

First problem: This is normal in essentials. If you are playing in debug mode you can use HMs without badges. If you try in the normal game file you won't be able to do this.

Emoticons: Are the correct graphics in the folder Graphics/Animations? If you put the emotion animations in the database are their numbers in the database matching the numbers you put for them in Settings Script?

heitres
May 17th, 2013, 12:07 AM
Some1 can tell me how can I install this script in pokemon essentials v11?

Rayd12smitty
May 17th, 2013, 3:51 AM
Follow the instructions exactly as they say. Trust me it works.

akane159
May 25th, 2013, 6:50 PM
First problem: This is normal in essentials. If you are playing in debug mode you can use HMs without badges. If you try in the normal game file you won't be able to do this.

Emoticons: Are the correct graphics in the folder Graphics/Animations? If you put the emotion animations in the database are their numbers in the database matching the numbers you put for them in Settings Script?

thnx , i only have to change the numbers in the settings script :) , but the animation when the pokemon comes out of the pokeball or when or stored in the pokeball not shown :S and i change the numbers in the settings , and nothing happens

and when i heal to a pokemon in the pokemon center does not disappear when the nurse removed my pokemon (always stays by my side)

heitres
June 3rd, 2013, 2:15 AM
Well, that was already fixed, what a dumb that I am xD

Aljen
June 26th, 2013, 6:31 PM
Zingzags, can you help me to show all 6 pokemon outside the map not only the first one?
<sorry for my bad english, I'm from VietNam> ==
Ah, I got an error with pbWait in pokemon follow script,and I deleted all the pbWait(), does anything can go wrong with it?
Message: Section153:203:in `talk_to_pokemon'undefined method `pbWAit' for #<DependentEvents:0xbc23208>

Ęℓαчиıı
July 5th, 2013, 6:38 PM
Hey there! -w-

I've got a quick question. When picking your starter, what is the command to initiate the Pokemon following you? I can't seem to remember.

EDIT: I found the code!

Nickalooose
July 7th, 2013, 11:13 AM
So does this still work, since it was 2012, and all the graphics file locations are dead...?

Ęℓαчиıı
July 8th, 2013, 4:01 PM
Yes, it works.

Mine is a bit jumpy when the Pokémon move, but it still works. I'm not too sure if it is supposed to be like that, but eh. :\ Do you need the graphics, Nickaloose?

Nickalooose
July 9th, 2013, 2:37 PM
Yes I do, if you have them :)
On another note, I'm not sure I can get this to work... But I'll keep playing with it anyway, but the graphics of emotions is all I need since I'll edit what files it's going to use anyway :)
Thanks.

Hounriom
July 9th, 2013, 7:23 PM
Umm... Someone can send me the graphics please? The links don't work, the page showed me "error 404". I really want use this script. :c

Itachi
August 7th, 2013, 8:46 PM
Hi can someone port this to pokemon fire red?

carmaniac
August 7th, 2013, 9:19 PM
Hi can someone port this to pokemon fire red?

Trying to convert a system from RPG Maker XP to a ROM is nearly impossible. You'd have better luck trying to figure out the code from scratch.

Tayuya of the Sound Four
September 16th, 2013, 10:08 PM
I've been getting this error when trying to talk to my pokemon. Everything else works perfectly except that...I've searched through this thread since other pople have the same issue it seems but none of the solutions help..Any ideas?
http://snag.gy/4vAcm.jpg

aegisrox
September 17th, 2013, 8:22 AM
I've been getting this error when trying to talk to my pokemon. Everything else works perfectly except that...I've searched through this thread since other pople have the same issue it seems but none of the solutions help..Any ideas?
http://snag.gy/4vAcm.jpg


Tayuta, i found the solution of your problem!! :D

The solution if that you dont have defined the Emoticons icons spritesheet, i happens the same to me, and when i defined then it WORKS!!

If you dont know how to do this, send me a PM with your mail and i will send you the solution!!

Regards

Aegis

Tayuya of the Sound Four
September 17th, 2013, 11:43 AM
Tayuta, i found the solution of your problem!! :D

The solution if that you dont have defined the Emoticons icons spritesheet, i happens the same to me, and when i defined then it WORKS!!

If you dont know how to do this, send me a PM with your mail and i will send you the solution!!

Regards

Aegis

Oh thanks! It works now! I can't beleive I missed that u.u

heitres
October 23rd, 2013, 3:09 PM
I just got the script work, its 99% working, but there is a bug with the bike, I can't see where to fix it. My bug is when I use a bike, the pokemon that is following me disappear with this scipt you adviced to implement:

def Kernel.pbMountBike
return if $PokemonGlobal.bicycle $PokemonGlobal.bicycle=true
$PokemonTemp.dependentEvents.remove_sprite(true)
Kernel.pbUpdateVehicle
bikebgm=pbGetMetadata(0,MetadataBicycleBGM)
if bikebgm
pbCueBGM(bikebgm,0.5)
end
end

This script to be more specific in the PokemonField script section:

$PokemonTemp.dependentEvents.remove_sprite(true)


My problem is when I dismount the bike, my pokemon still following me, I can talk with him, but the problem is his sprite stays invisible. I tryed to find where to implement the command:
$PokemonTemp.dependentEvents.refresh_sprite

But I can't find where. Can you help me plz?

Its the only bug I have and need to fix, I just managed to make Dig, Escape rope and use the Bike without have that limitation that deny the player to use that kind of moves/vehicle with dependent event.

heitres
October 25th, 2013, 2:46 AM
OMG, I found where to fix the problem with dismount bike, so easy, I'm really blind, I found it in Pokémon field in the line 1494 I think. There are a condition IF "Return If". The line is like this:

def Kernel.pbDismountBike
return if !$PokemonGlobal.bicycle
$PokemonGlobal.bicycle=false
Kernel.pbUpdateVehicle
$game_map.autoplayAsCue
end

I copied and pasted in the Pokemon follower script, and I followed the same instruction as it is in the surf, there is a pbendsurf, and saw how to do it and I add this $PokemonTemp.dependentEvents.Come_back(true).

After I made it, it become like this:

def Kernel.pbDismountBike
return if !$PokemonGlobal.bicycle
$PokemonGlobal.bicycle=false
Kernel.pbUpdateVehicle
$game_map.autoplayAsCue
$PokemonTemp.dependentEvents.Come_back(true)
end

And fixed my problem. Now I need to fix when my first pokemon in the pokemon party is fainted, how to change the sprite to my second pokemon (if he/she has HP and ofc if I have more than 1 pokemon, but its not a big deal), I will try to add some more features to the script in my game. Thanks for the script PokémonFollower, thanks for your hard work guys :) Now I can really say I have 100% working in this script.

I don't know if you guys are reading my posts, but I just got the way to make the script work, I mean, when you have the first pokemon fainted, the game will search for the second pokemon. I don't know if you guys had the same problem, but for who got, just answer to me and I will post the fix :)

linkthehero
October 29th, 2013, 6:20 AM
AHMMM could you make a kit for where this is inclouded , this would fix many problems

Peaverin
October 30th, 2013, 8:04 AM
It doesn't even shows the pokémon following to me.
I have the pokemon character graphics but not the other ones.
Can someone re-upload the images and the other downloadable things?
Edit: Done.

linkthehero
October 30th, 2013, 8:18 AM
if you help me with the the cript part ,i will give you all graphics
deal or no deal?

heitres
November 4th, 2013, 5:33 AM
Ah I did a starter kit with the Follower Script I have. You can download it, sorry Zingzag, if you want to me to remove I will, this is just to help the ppl.

Btw, I have fixed alot things, my version can give problems with HMs/TMs and veihcles when you have a partner dependent event with you. So if you are using the script I have, my advice is not use a partner.
I created a switch that fix a bug when you are in veihcles and if you change the position of your pokemons, the pokemon that now are in the 1st position will appear while you are surfing, bicycling. Don't forget when you mount bicycle or when you use surf the switch will activate so to not let that happen, but don't forget if you are using a bicycle and when you enter through some door or entrance, you need to implement 2 commands to the teleport event, 1 is to desactivate the switch and the other is to update the sprite. Now if you have the first pokemon in your party fainted or if it is an egg, the game will search for the next pokemon alive and will refresh the sprite (This if you have more than 1 pokemon). And so on. The problems I know with my version is, the partner dependent events can't work very well, especially when the player is on some vehicle and now you can't talk to waterfalls while you have a pokemon following you, you need to use the waterfall manually (like in classic pokemon games, where you need to open the party menu, choose the pokemon with the move and then use it). I may fix that one day, for now I will try to develop my game. I'm newbie to script as well, but I'm trying to learn. Hope you liked it :)

www(dot)mediafire(dot)com/?6ti03tembmszsh1

Joltik
November 4th, 2013, 1:36 PM
Very nice! Everything seems fine, except that there is a strange "jump" in the pokemon sprite whenever you pass through a connection between two maps.
Is there a way to make this smoother, or is it a general problem involving dependent events?

Thank you!

heitres
November 4th, 2013, 3:32 PM
Becareful with my kit. There is NPCs (Red, Leaf, Brendan and May that explain about certain things) my english is not good, but I think the ppl understands what they say. The info they provide is important.

ShadowFiendZX
November 4th, 2013, 4:58 PM
Very nice! Everything seems fine, except that there is a strange "jump" in the pokemon sprite whenever you pass through a connection between two maps.
Is there a way to make this smoother, or is it a general problem involving dependent events?

Thank you!

It's a problem with dependent events. Another funny thing you might want to try with the dependent events is going on bridges. I'm pretty sure Maruno stated somewhere that there were bugs with dependent events.

heitres
November 5th, 2013, 3:23 AM
It's a problem with dependent events. Another funny thing you might want to try with the dependent events is going on bridges. I'm pretty sure Maruno stated somewhere that there were bugs with dependent events.

There is in bridges, if for example you are near to a tile on your map that have a way to block a passage to certain direction, the dependent event won't walk normally. Instead of walk behind the player, it will walk on one of the sides (Left or right) of the player and so on. I hope some day that can get fixed. I wish I could help, but only right now I'm entering on scripting world. Trying to learn more :D

shongshong123
November 9th, 2013, 2:46 AM
hello. i want to make pokemon follow me . how to make in rmxp?

carmaniac
November 9th, 2013, 4:17 AM
hello. i want to make pokemon follow me . how to make in rmxp?

Whole point of this thread is to tell you how to do so. So just follow the thread basically.

shongshong123
November 9th, 2013, 7:21 AM
ok. how i can fill code ? make new script ?

heitres
November 9th, 2013, 9:24 AM
ok. how i can fill code ? make new script ?

Just download this and do the merge of your project with this. Don't forget to see the NPCs the player's mom, Red, Blue, May and Brendan, they explain the best as they can how the script works with the things I added. In some cases the grammar is not so good, but I think that can still be understandable.

About the link, just put "." in the "(dot)" things.

www(dot)mediafire(dot)com/?6ti03tembmszsh1

shongshong123
November 11th, 2013, 8:23 PM
oh. what about file in folder pokemon Essentials ? how to use it :) how i can replace it ?

Jacopo Mii
August 5th, 2014, 2:40 AM
Sorry, i really need your file Characters.rar
But the link doesn't work. Can you reupload it please?
Thanks you!!!!

Darkattributes197
October 25th, 2015, 6:11 AM
Does this still work? I'm using v15 and wanted to know if it worked. Has anyone tried yet?

laxus3d
October 25th, 2015, 7:03 AM
This version is better than the posted by Rayd12smitty?

Darkattributes197
October 26th, 2015, 9:27 AM
This version is better than the posted by Rayd12smitty?


Okay! Does it work for essentials V15 or V15.1? Cause my digimon game could really use this!

Rot8er_ConeX
October 26th, 2015, 10:50 AM
TO EVERYONE:

This version is not the most recent version. You want this (http://www.pokecommunity.com/showthread.php?t=316403) topic.

However, even this version has some issues working in Essentials v15.1. I personally have given up on making Following Pokemon a thing in my game because the sprites disappear when I change maps.