The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old August 15th, 2013, 09:07 PM
dexter1o6
 
Join Date: Jul 2013
Age: 26
Gender: Male

Advertise here
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:

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[i]
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 by dexter1o6; August 16th, 2013 at 03:40 AM. Reason: Problem solved
Reply With Quote
  #2    
Old August 16th, 2013, 01:11 AM
thor348's Avatar
thor348
That's Oak to You
 
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
You could implement this via script and add conditions but that'll take time depending on your skill. A lame unusual way you could do this would be create an event that was set to player touch and have an encounter. You could modify the music that way by screen tone changes, bgm change, etc. and have the event set to like a certain time of day switch and variable to make it more uncommon and have it set to a random movement in the area with boundaries set if it collides with invisible events, etc. It's lame and no one should ever do something like that but it is a possible solution.
Reply With Quote
  #3    
Old August 16th, 2013, 01:29 AM
dexter1o6
 
Join Date: Jul 2013
Age: 26
Gender: Male
I know the easy way, but I want it to react upon encountering a pokemon set in PBS\\encounters.txt.

So for example, this is the encounterlist as set in the text file (I have altered the scripts to allow more (rare) pokemon in one area, that's why the list is so long):

Spoiler:
LandMorning
PIDGEY,2,4
RATTATA,2,4
MANKEY,2,4
BELLSPROUT,2,4
HOPPIP,2,4
MAREEP,2,5
ABRA,2,5
LOTAD,2,5
BUDEW,2,5
PIDGEY,5,6
RATTATA,5,6
MANKEY,5,6
BELLSPROUT,5,6
HOPPIP,5,6
PSYDUCK,2,5
PONYTA,2,5
PIDGEY,7,18
RATTATA,7,18
HOPPIP,5,6
PIDGEY,3,4
RATTATA,3,4
MEOWTH,2,5
PIDGEY,3,4
RATTATA,3,4
RATTATA,3,4
PIDGEOTTO,18,30
PIDGEOT,36,44
MUDKIP,2,5


As you can see, most pokemon are below level 10, but there is a small chance you might encounter a pidgeot of around level 40.

When encountering pidgeot, I want the music to be different. I understand this may/will include changing some scripts, but you may consider me skilled.

Anyway, thanks for the reply!
Reply With Quote
  #4    
Old August 16th, 2013, 02:31 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Check def pbWildBattle and notice that it mentions pbGetWildBattleBGM. It does what it says on the tin.

You can edit def pbGetWildBattleBGM to do what you want. It's up to you to decide how/when you want to change the battle music (depending on species/map/both/etc.).
__________________
Reply With Quote
  #5    
Old August 16th, 2013, 03:10 AM
dexter1o6
 
Join Date: Jul 2013
Age: 26
Gender: Male
Thanks! I solved the problem. See first post.
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 04:11 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.