In this case is more simple. Make sure to have
Pokemon Essentials v 16.2 and to make a
BACKUP of your save game (because the metadata will be changed and, probably, it will ruin your save data.) and of your
Script.rxdata.
First of all, into PBS/items.txt, add your item line (Replace XXX with your custom ID number):
Code:
XXX,BALLARC,Ballarc,Ballarc,8,0,"Description",2,0,6,
Giving focus to the scripts, into
PField_Metadata script section, after
attr_accessor :bicycle add the following code:
Then, after
@bicycle = false, add the following code:
Then, into
Walk_Run script section, in
def pbCanRun?, right after this:
Code:
!$PokemonGlobal.bicycle && !PBTerrain.onlyWalk?(terrain)
You have to add this:
Code:
&&
!$PokemonGlobal.riding[0]
Then, into
def update?, after this lines:
Code:
if $PokemonGlobal.bicycle
@move_speed = $RPGVX ? 8 : 5.2
You have to add this:
Code:
elsif $PokemonGlobal.riding[0]
@move_speed = $RPGVX ? 7 : 5
Then into
MiscData script section, after line
MetadataPlayerH = 15, add this:
Then, right after
"PlayerH"=>[MetadataPlayerH,"esssssss",:PBTrainers] you have to
put a comma and you have to add this:
Code:
"RidingBGM"=>[MetadataRidingBGM,"s"]
These previous codes allow you to play a custom BGM when you riding a Pokémon. Remember to add the parameter "
RidingBGM" into
PBS/metadata.txt
Then, into
PField_Field script section, after the entire section of
def Kernel.pbMountBike section you have to add this:
Code:
def Kernel.pbRidePokemon(pokemonName)
return if $PokemonGlobal.riding[0]
$PokemonGlobal.riding[0]=true
$PokemonGlobal.riding[1]=pokemonName
Kernel.pbUpdateVehicle
ridingbgm=pbGetMetadata(0,MetadataRidingBGM)
if ridingbgm
pbCueBGM(ridingbgm,0.5)
end
end
After the entire section of
def Kernel.pbDismountPokemon add this:
Code:
def Kernel.pbDismountPokemon
return if !$PokemonGlobal.riding[0]
$PokemonGlobal.riding[0]=false
$PokemonGlobal.riding[1]=nil
$game_player.setDefaultCharName(nil,$game_player.fullPattern)
Kernel.pbUpdateVehicle
$game_map.autoplayAsCue
end
Then, into
def Kernel.pbUpdateVehicle, after this:
Code:
elsif $PokemonGlobal.bicycle
$game_player.character_name=pbGetPlayerCharset(meta,2) # Bicycle graphic
You have to add this:
Code:
elsif $PokemonGlobal.riding[0] # Riding graphic
if $Trainer.gender==0
$game_player.setDefaultCharName("boy_riding_"+$PokemonGlobal.riding[1].to_s,$game_player.fullPattern)
elsif $Trainer.gender==1
$game_player.setDefaultCharName("girl_riding_"+$PokemonGlobal.riding[1].to_s,$game_player.fullPattern)
end
Then, into
PField_HiddenMoves script section, in
HiddenMoveHandlers::CanUseMove.add(:SURF,proc{|move,pkmn|, after
Code:
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
You have to add this:
Code:
if $PokemonGlobal.riding[0]
Kernel.pbMessage(_INTL("You currently can't surf because you're mounting a Pokémon."))
return false
end
Then, into
PItem_Items script section, into
def pbBikeCheck, before the line:
Code:
if $game_player.pbHasDependentEvents?
Add this:
Code:
if $PokemonGlobal.riding[0]
Kernel.pbMessage(_INTL("You currently can't use that because you're mounting a Pokémon."))
return false
end
Then, after the entire section of
def pbBikeCheck, you have to add this:
Code:
def pbRidingCheck
if($PokemonGlobal.surfing || pbGetTerrainTag==PBTerrain::TallGrass)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $PokemonGlobal.bicycle
Kernel.pbMessage(_INTL("You can't mount a Pokémon at the moment."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("It can't be used when you have someone with you."))
return false
end
val=pbGetMetadata($game_map.map_id,MetadataOutdoor)
if !val
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
end
Finally, into
PItems_ItemsEffect script section, after this code:
Code:
ItemHandlers::UseFromBag.add(:BICYCLE,proc{|item|
next pbBikeCheck ? 2 : 0
})
You have to add this:
Code:
ItemHandlers::UseFromBag.add(:BALLARC,proc{|item|
next pbRidingCheck ? 2 : 0
})
)
After the entire section of
ItemHandlers::UseInField.add(:BICYCLE,proc{|item|, you have to add your item script:
Code:
ItemHandlers::UseInField.add(:BALLARC,proc{|item|
if pbRidingCheck
if $PokemonGlobal.riding[0]
Kernel.pbDismountPokemon
else
Kernel.pbRidePokemon("Arcanine")
end
end
})
It's needed that your riding sprites have a specific structure.
- If the trainer is
male:
boy_riding_POKEMONNAME => e.g. boy_riding_Arcanine
- If the trainer is
female:
girl_riding_POKEMONNAME => e.g. girl_riding_Arcanine
If you want to add more riding Items, you have to duplicate Ballarc effect, after Ballarc Item script section, like this:
Code:
ItemHandlers::UseInField.add(:SADDLE,proc{|item|
if pbRidingCheck
if $PokemonGlobal.riding[0]
Kernel.pbDismountPokemon
else
Kernel.pbRidePokemon("Tauros")
end
end
})
And after this line:
Code:
ItemHandlers::UseFromBag.copy(:BICYCLE,:MACHBIKE,:ACROBIKE)
You have to add this:
Code:
ItemHandlers::UseFromBag.copy(:BALLARC,:SADDLE) #Add riding items in this list, separated by a comma
ONLY IF YOU'RE USING THIS SCRIPT
You have to edit
def pbRidePokemon to the following code:
Code:
def Kernel.pbRidePokemon(pokemonName)
return if $PokemonGlobal.riding[0]
$PokemonGlobal.riding[0]=true
$PokemonGlobal.riding[1]=pokemonName
if $game_switches[Toggle_Following_Switch]
$PokemonTemp.dependentEvents.remove_sprite(true)
end
Kernel.pbUpdateVehicle
ridingbgm=pbGetMetadata(0,MetadataRidingBGM)
if ridingbgm
pbCueBGM(ridingbgm,0.5)
end
end
Then, you have to edit
def pbDismountPokemon to the following code:
Code:
def Kernel.pbDismountPokemon
return if !$PokemonGlobal.riding[0]
$PokemonGlobal.riding[0]=false
$PokemonGlobal.riding[1]=nil
if $game_switches[Toggle_Following_Switch]
$PokemonTemp.dependentEvents.Come_back(true)
end
$PokemonTemp.dependentEvents.refresh_sprite
$game_player.setDefaultCharName(nil,$game_player.fullPattern)
Kernel.pbUpdateVehicle
$game_map.autoplayAsCue
end
Then, delete the following section to
def pbRidingCheck:
Code:
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("It can't be used when you have someone with you."))
return false
end
Finally, right after this line:
Code:
if Input.trigger?(Input::CTRL) && ALLOWTOGGLEFOLLOW && !$PokemonGlobal.bicycle
You have to add this:
Code:
&& !$PokemonGlobal.riding[0]