In PokemonField script section, about at line 1000, in def pbWildBattle, when the script say "$PokemonGlobal.nextBattleBGM=nil", you can make a little variation by replacing it with (RAYQUAZA is a little example):
if(species==PBSpecies::HOOH) then
$PokemonGlobal.nextBattleBGM=("Audio/BGM/YourTheme")
else
$PokemonGlobal.nextBattleBGM=nil
end
Thanks for the answer!
But sadly it doesn't work.
The default wild battle theme is still being played.
Can you post the complete script you did?Thanks for the answer!
But sadly it doesn't work.
The default wild battle theme is still being played.
Restore the previous code, by deleting my lines of code.Spoiler:def pbWildBattle(species,level,variable=nil,canescape=true,canlose=false)
if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
if $Trainer.pokemonCount>0
Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
end
pbSet(variable,1)
if(species==PBSpecies::HOOH) then
$PokemonGlobal.nextBattleBGM=("Audio/BGM/VsHOOH.ogg")
else
$PokemonGlobal.nextBattleBGM=nil
end
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
return true
end
if species.is_a?(String) || species.is_a?(Symbol)
species=getID(PBSpecies,species)
end
handled=[nil]
Events.onWildBattleOverride.trigger(nil,species,level,handled)
if handled[0]!=nil
return handled[0]
end
currentlevels=[]
for i in $Trainer.party
currentlevels.push(i.level)
end
genwildpoke=pbGenerateWildPokemon(species,level)
Events.onStartBattle.trigger(nil,genwildpoke)
scene=pbNewBattleScene
battle=PokeBattle_Battle.new(scene,$Trainer.party,[genwildpoke],$Trainer,nil)
battle.internalbattle=true
battle.cantescape=!canescape
pbPrepareBattle(battle)
decision=0
pbBattleAnimation(pbGetWildBattleBGM(species)) {
pbSceneStandby {
decision=battle.pbStartBattle(canlose)
}
for i in $Trainer.party; (i.makeUnmega rescue nil); (i.makeUnprimal rescue nil); end
if $PokemonGlobal.partner
pbHealAll
for i in $PokemonGlobal.partner[3]
i.heal
i.makeUnmega rescue nil
i.makeUnprimal rescue nil
end
end
if decision==2 || decision==5 # if loss or draw
if canlose
for i in $Trainer.party; i.heal; end
for i in 0...10
Graphics.update
end
# else
# $game_system.bgm_unpause
# $game_system.bgs_unpause
# Kernel.pbStartOver
end
end
Events.onEndBattle.trigger(nil,decision,canlose)
}
Input.update
pbSet(variable,decision)
Events.onWildBattleEnd.trigger(nil,species,level,decision)
return (decision!=2)
end
if(species==PBSpecies::HOOH)
return pbStringToAudioFile("VsHOOH.ogg")
end
if(species==PBSpecies::HOOH)
return pbStringToAudioFile("VsHOOH.ogg")
elsif(species==PBSpecies::LUGIA)
return pbStringToAudioFile("VsLUGIA.ogg")
elsif(species==PBSpecies::CELEBI)
return pbStringToAudioFile("VsCELEBI.ogg")
end
Because, if there are more battles with the same Pokémon (e.g a second chance to catch it), it's more efficent. I don't know anything about Letrax's project and I'm trying to give him the best solution (of course from my point of view).Why are you making this so unnecessary complicate? Just use the Event command "Change Battle BGM" right before the battle starts.
Because, if there are more battles with the same Pokémon (e.g a second chance to catch it), it's more efficent. I don't know anything about Letrax's project and I'm trying to give him the best solution (of course from my point of view).