• 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.

[Error] Error related with pbUseMove

32
Posts
4
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
    1567029808-2019-08-28-23-02-02-pokemon-neutron-rpg-maker-xp.png

    And here's my script
    1567029808-2019-08-28-23-01-19-pokemon-neutron-rpg-maker-xp.png

    Can anyone help me with this?
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Did you accidentally delete the definition of pbUseMove in PokeBattle_Battler?
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    I don't think so, I did CTRL+SHIFT+F and searched for def pbUseMove and found this :
    1567034794-2019-08-29-00-24-56-editeur-de-scripts.png

    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:

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    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