• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

[Error] Error related with pbUseMove

  • 32
    Posts
    5
    Years
    • Seen Apr 17, 2020
    Hi, I recently encountered some issues with a script and thanks to some help on discord, I found that some lines were duplicated and causing an issue, I removed those lines but when I launch my game, I get this error
    [PokeCommunity.com] Error related with pbUseMove

    And here's my script
    [PokeCommunity.com] Error related with pbUseMove

    Can anyone help me with this?
     
    Last edited:
    Did you accidentally delete the definition of pbUseMove in PokeBattle_Battler?
     
    I don't think so, I did CTRL+SHIFT+F and searched for def pbUseMove and found this :
    [PokeCommunity.com] Error related with pbUseMove

    and here's my code :
    def pbUseMoveSimple(moveid,index=-1,target=-1)
    choice=[]
    choice[0]=1 # "Use move"
    choice[1]=index # Index of move to be used in user's moveset
    choice[2]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(moveid)) # PokeBattle_Move object of the move
    choice[2].pp=-1
    choice[3]=target # Target (-1 means no target yet)
    if index>=0
    @battle.choices[@index][1]=index
    end
    PBDebug.log("#{pbThis} used simple move #{choice[2].name}")
    side=(@battle.pbIsOpposing?(self.index)) ? 1 : 0
    [email protected](self.index)
    if @battle.zMove[side]==self.index
    crystal = pbZCrystalFromType(choice[2].type)
    PokeBattle_ZMoves.new(@battle,self,choice[2],crystal,choice)
    else
    pbUseMove(choice,true)
    end
    return
    end
    def pbUseMove(choice,specialusage=false)
    # TODO: lastMoveUsed is not to be updated on nested calls
    # Note: user.lastMoveUsedType IS to be updated on nested calls; is used for Conversion 2
    turneffects=[]
    turneffects[PBEffects::SpecialUsage]=specialusage
    turneffects[PBEffects::SkipAccuracyCheck]=(specialusage && choice[2][email protected])
    turneffects[PBEffects::PassedTrying]=false
    turneffects[PBEffects::TotalDamage]=0
    # Start using the move
    pbBeginTurn(choice)
    # Force the use of certain moves if they're already being used
    if @effects[PBEffects::TwoTurnAttack]>0
    @effects[PBEffects::HyperBeam]>0
    @effects[PBEffects::Outrage]>0
    @effects[PBEffects::Rollout]>0
    @effects[PBEffects::Uproar]>0
    @effects[PBEffects::Bide]>0
    choice[2]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(@currentMove))
    turneffects[PBEffects::SpecialUsage]=true
    PBDebug.log("Continuing multi-turn move #{choice[2].name}")
    elsif @effects[PBEffects::Encore]>0 && choice[1]>=0
    if @battle.pbCanShowCommands?(@index) &&
    @battle.pbCanChooseMove?(@index,@effects[PBEffects::EncoreIndex],false)
    if choice[1]!=@effects[PBEffects::EncoreIndex] # Was Encored mid-round
    choice[1]=@effects[PBEffects::EncoreIndex]
    choice[2]=@moves[@effects[PBEffects::EncoreIndex]]
    choice[3]=-1 # No target chosen
    end
    PBDebug.log("Using Encored move #{choice[2].name}")
    end
    end
    thismove=choice[2]
    return if !thismove thismove.id==0 # if move was not chosen
    if !turneffects[PBEffects::SpecialUsage]
    # TODO: Quick Claw message
     
    Last edited:
    The method you quoted is called pbUseMoveSimple. That's not the same as pbUseMove. You did indeed delete something you shouldn't have.
     
    Back
    Top