• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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] making a move change to another move mid battle.

  • 465
    Posts
    8
    Years
    • Seen Jun 17, 2024
    So my aim is to hopefully give megas new moves that they only get as megas, sort of like a pseudo signiture z-move.

    I know moves changing in and out of battle can be done, (SwSh main legendaries for example) but thats done at the start of battle.

    any way i could do this? unless somehow reworking it to do that, maybe if its holding the right megastone the corresponding move changes but only works IF its a mega using it? (so it'd just fail otherwise)

    any help would be great.
     
    So my aim is to hopefully give megas new moves that they only get as megas, sort of like a pseudo signiture z-move.

    I know moves changing in and out of battle can be done, (SwSh main legendaries for example) but thats done at the start of battle.

    any way i could do this? unless somehow reworking it to do that, maybe if its holding the right megastone the corresponding move changes but only works IF its a mega using it? (so it'd just fail otherwise)

    any help would be great.

    Try looking at the Dynamax Script on how to handle that.
     
    Hmm definetly the right direction but its an ebs to essentials thing which is annoying (using ludicrous' one they even say max moves dont work for ebs)

    but it does lead me the right way (feel its down to how ebs managed moves) might go the if holding stone route and changes a moves type.

    edit: slight issue is, as it uses set form it needs to change from one form to the other, same issue here as tusing dynamax code....

    gonna try with secret power/weather ball code.
     
    Last edited:
    Hmm definetly the right direction but its an ebs to essentials thing which is annoying (using ludicrous' one they even say max moves dont work for ebs)

    but it does lead me the right way (feel its down to how ebs managed moves) might go the if holding stone route and changes a moves type.

    edit: slight issue is, as it uses set form it needs to change from one form to the other, same issue here as tusing dynamax code....

    gonna try with secret power/weather ball code.

    Do you want the move to display as the different move in the fight menu? I've done something very similar to this (probably even a bit more complicated), so I can show you how to do it using the method I used (whether or not you want it to display the new move).

    If you want it to display the new move, can you send everything in "def generateButtons"? If you have 2 of these, send the one under "class NextGenFightWindow". I don't have the unedited version of this so it would be easier for me to explain what to do if I could look at that to compare it with how I edited it.

    Either way, you'll need to find the section under "# Force the use of certain moves if they're already being used", where you can actually have the Pokemon use the other move. You could also look at Nature Power and it may be easier to do something like that instead (didn't think of this when I was doing it).

    You may also want to have the AI recognize that a new move is being used.
     
    Last edited:
    yea, tried a bit with secret power, kinda messed it up at first but found something that worked

    tested with charizard with dragon pulse becoming draco meteor (example move)
    issue is dragon pulse is function 000 so had to make sure other moves worked still.
    Code:
    class PokeBattle_Move_000 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        move=0 #getConst(PBMoves,:TACKLE) || 0
        if isConst?(@id,PBMoves,:DRAGONPULSE) && isConst?(attacker.species,PBSpecies,:CHARIZARD) && attacker.form==2
          move=getConst(PBMoves,:DRACOMETEOR) || move
        end
        if move==0
          return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        end
        if move!=0
          thismovename=PBMoves.getName(@id)
          movename=PBMoves.getName(move)
          @battle.pbDisplay(_INTL("{1} turned into {2}!",thismovename,movename))
          target=(USENEWBATTLEMECHANICS && opponent) ? opponent.index : -1
          attacker.pbUseMoveSimple(move,-1,target)
          return 0
        end
      end
    end

    Wanted it changing in display but this works just as good ^^
     
    yea, tried a bit with secret power, kinda messed it up at first but found something that worked

    tested with charizard with dragon pulse becoming draco meteor (example move)
    issue is dragon pulse is function 000 so had to make sure other moves worked still.
    Code:
    class PokeBattle_Move_000 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        move=0 #getConst(PBMoves,:TACKLE) || 0
        if isConst?(@id,PBMoves,:DRAGONPULSE) && isConst?(attacker.species,PBSpecies,:CHARIZARD) && attacker.form==2
          move=getConst(PBMoves,:DRACOMETEOR) || move
        end
        if move==0
          return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        end
        if move!=0
          thismovename=PBMoves.getName(@id)
          movename=PBMoves.getName(move)
          @battle.pbDisplay(_INTL("{1} turned into {2}!",thismovename,movename))
          target=(USENEWBATTLEMECHANICS && opponent) ? opponent.index : -1
          attacker.pbUseMoveSimple(move,-1,target)
          return 0
        end
      end
    end

    Wanted it changing in display but this works just as good ^^

    I would recommend doing all this in the super class (Pokebattle_Move) "pbEffect" method so everything is in one place (and this is usually called first in the subclass methods anyway). Also if you want it to change the display I can help you with that if you send the "generateButtons" method in EliteBattle_3.
     
    Back
    Top