• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Mega Pokemon Cries Mid-Battle?

  • 3
    Posts
    6
    Years
    • Seen Sep 7, 2020
    I've been messing around with Pokemon Essentials for at least 6 years, and I'm at a point where I've started to dig into the code for improvements.
    Now that I've finally gotten around to implementing Mega Pokemon, I wanted to enhance the player experience by having a few sound effects, followed by the cry associated to the Pokemon, but as the mega form.
    In the script section Pokemon_MegaEvolution, I tried to insert pbPlayCry(@pokemon.form) under the MakeMega function. This does not work, and I was hoping to know if more than one head can solve this problem with me?
    ---------------------------
    Pokemon Essentials v17
    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NoMethodError

    Message: undefined method `form' for nil:NilClass

    Pokemon_MegaEvolution:54:in `makeMega'

    PokeBattle_Battle:1702:in `pbMegaEvolve'

    PokeBattle_Battle:2712:in `pbAttackPhase_ebs'

    PokeBattle_Battle:2707:in `each'

    PokeBattle_Battle:2707:in `pbAttackPhase_ebs'

    EliteBattle_Battle:312:in `pbAttackPhase'

    EliteBattle_Battle:231:in `pbStartBattleCore'

    EliteBattle_Battle:230:in `logonerr'

    EliteBattle_Battle:230:in `pbStartBattleCore'

    EliteBattle_Battle:218:in `loop'
    --------------------------------------------------------------------------

    For further context, I'm using a non-modified Elite Battle System, if that helps.
    Thank you all in advance, hope to make a wonderful game with you help🙂
     
    If you're editing in script section Pokemon_MegaEvolution, then you are alread in a pokemon object, so just self.form would do.
    though pbPlayCry takes the pokemon or species as an argument, so you should be able to pass self and if the form was already changed, it'll play the new cry.

    personally not a fan of giving side effects to methods like these though. you should have edited pbMegaEvolve (or its ebs equivalent) in the battle scripts.
     
    Thanks for the tip, I did a more thorough look the next morning and realised that I didn't even have the Cry named right, it was XXX_1Cry instead of XXXCry_1😶 whoops.
    I got it working though, I've little clue about the syntax RPGXP uses, as I'm only leg deep into python 😬
     
    Back
    Top