- 64
- Posts
- 10
- Years
- Seen May 29, 2020
Hi all,
I am looking for a way to play a different battle music if you encounter a specific pokemon.
So for example, if the pokemon (which you randomly encounter) is a pidgey, play the regular music. But if the pokemon you encounter is a (rare and random encountered) pidgeot, play the hyper-ultra-cool-look-out-for-the-dangerous-pokemon-music.
Although I did find some stuff about changing music, or even battle music, I did not find something yet to change the music upon encountering a specific pokemon. Thank you for your help in advance!
Regards,
dexter1o6
EDIT:
I solved the problem in a for me effective but somewhat sloppy way. For those who gave me advise: thanks again!
The script change changes the music when you encounter a wild pokemon of a level equal to or higher then the highest level the first pokemon in 'encounters.txt' can have, in case of the example in my next post, this would be level 24.
In PokemonEncounters:
I am looking for a way to play a different battle music if you encounter a specific pokemon.
So for example, if the pokemon (which you randomly encounter) is a pidgey, play the regular music. But if the pokemon you encounter is a (rare and random encountered) pidgeot, play the hyper-ultra-cool-look-out-for-the-dangerous-pokemon-music.
Although I did find some stuff about changing music, or even battle music, I did not find something yet to change the music upon encountering a specific pokemon. Thank you for your help in advance!
Regards,
dexter1o6
EDIT:
I solved the problem in a for me effective but somewhat sloppy way. For those who gave me advise: thanks again!
The script change changes the music when you encounter a wild pokemon of a level equal to or higher then the highest level the first pokemon in 'encounters.txt' can have, in case of the example in my next post, this would be level 24.
In PokemonEncounters:
Spoiler:
def pbEncounteredPokemon(enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
return nil if @enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
chancetotal=0
chances.each {|a| chancetotal+=a}
rnd=rand(chancetotal)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances
if rnd<chance
chosenpkmn=i
break
end
end
encounter=@enctypes[enctype][chosenpkmn]
return nil if !encounter
level=encounter[1]+rand(1+encounter[2]-encounter[1])
temp=@enctypes[enctype][0]
if level>=temp[2]+20
$PokemonGlobal.nextBattleBGM="37-battle-uxie-mesprit-azelf.mp3"
else
$PokemonGlobal.nextBattleBGM=nil
end
return [encounter[0],level]
end
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
return nil if @enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
chancetotal=0
chances.each {|a| chancetotal+=a}
rnd=rand(chancetotal)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances
if rnd<chance
chosenpkmn=i
break
end
end
encounter=@enctypes[enctype][chosenpkmn]
return nil if !encounter
level=encounter[1]+rand(1+encounter[2]-encounter[1])
temp=@enctypes[enctype][0]
if level>=temp[2]+20
$PokemonGlobal.nextBattleBGM="37-battle-uxie-mesprit-azelf.mp3"
else
$PokemonGlobal.nextBattleBGM=nil
end
return [encounter[0],level]
end
Last edited: