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.

Reply
 
Thread Tools
  #1    
Old August 15th, 2013 (9:07 PM). Edited August 16th, 2013 by dexter1o6.
dexter1o6 dexter1o6 is offline
     
    Join Date: Jul 2013
    Age: 29
    Gender: Male
    Posts: 64
    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
    [email protected][enctype][chosenpkmn]
    return nil if !encounter
    level=encounter[1]+rand(1+encounter[2]-encounter[1])
    [email protected][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
    Reply With Quote

    Relevant Advertising!

      #2    
    Old August 16th, 2013 (1:11 AM).
    thor348's Avatar
    thor348 thor348 is offline
    That's Oak to You
       
      Join Date: Nov 2012
      Location: Arizona
      Gender: Male
      Nature: Calm
      Posts: 136
      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 (1:29 AM).
      dexter1o6 dexter1o6 is offline
         
        Join Date: Jul 2013
        Age: 29
        Gender: Male
        Posts: 64
        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 (2:31 AM).
        Maruno's Avatar
        Maruno Maruno is offline
        Lead Dev of Pokémon Essentials
           
          Join Date: Jan 2008
          Location: England
          Posts: 5,173
          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.).
          __________________
          Go to the Pokémon Essentials Wiki

          | Downloads | Tutorials | Fangames |
          | All Animations Project |

          Follow me on Twitter: @maruno42


          Reply With Quote
            #5    
          Old August 16th, 2013 (3:10 AM).
          dexter1o6 dexter1o6 is offline
             
            Join Date: Jul 2013
            Age: 29
            Gender: Male
            Posts: 64
            Thanks! I solved the problem. See first post.
            Reply With Quote
            Reply
            Quick Reply

            Sponsored Links
            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

            Forum Jump


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