• 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] Making Pokemon not listen to the player.

15
Posts
7
Years
    • Seen Aug 19, 2017
    In my game I want to make a pokemon that don't listen to the player until a certain event. How can I do it? I am having problem in it. If you all can help me then thanks to you.
     
    Last edited by a moderator:

    Telemetius

    Tele*
    267
    Posts
    9
    Years
  • You mean you want to force a specific pkm disobedience?
    You can try this, credits to Themaster for the help.

    Code:
    elsif isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) && $game_switches[XXX]
          othermoves=[]
          for i in 0...4
            next if i==choice[1]
            othermoves[othermoves.length]=i if @battle.pbCanChooseMove?(@index,i,false)
          end
          if othermoves.length>0
            @battle.pbDisplay(_INTL("{1} is ignoring your orders!",pbThis)) 
            newchoice=othermoves[rand(othermoves.length)]
            choice[1]=newchoice
            choice[2]=@moves[newchoice]
            choice[3]=-1
          end

    Paste it under:

    Code:
    elsif @effects[PBEffects::Encore]>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

    Edit YOURPOKEMONSPECIES and XXX.
     
    Last edited:
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    You could just use this code in PokeBattle_Battler:
    Code:
      def pbObedienceCheck?(choice)
        return true if choice[0]!=1
        if @battle.pbOwnedByPlayer?(@index) && @battle.internalbattle
          badgelevel=10
          badgelevel=20  if @battle.pbPlayer.numbadges>=1
          badgelevel=30  if @battle.pbPlayer.numbadges>=2
          badgelevel=40  if @battle.pbPlayer.numbadges>=3
          badgelevel=50  if @battle.pbPlayer.numbadges>=4
          badgelevel=60  if @battle.pbPlayer.numbadges>=5
          badgelevel=70  if @battle.pbPlayer.numbadges>=6
          badgelevel=80  if @battle.pbPlayer.numbadges>=7
          badgelevel=100 if @battle.pbPlayer.numbadges>=8
          move=choice[2]
          disobedient=[COLOR=Red]isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) &&
             $game_switches[XXX]
          [COLOR=Green]# true if disobedient species and switch XXX is on, otherwise false[/COLOR][/COLOR]
    This applies to every Pokémon of that species.
     
    15
    Posts
    7
    Years
    • Seen Aug 19, 2017
    You mean you want to force a specific pkm disobedience?
    You can try this, credits to Themaster for the help.

    Code:
    elsif isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) && $game_switches[XXX]
          othermoves=[]
          for i in 0...4
            next if i==choice[1]
            othermoves[othermoves.length]=i if @battle.pbCanChooseMove?(@index,i,false)
          end
          if othermoves.length>0
            @battle.pbDisplay(_INTL("{1} is ignoring your orders!",pbThis)) 
            newchoice=othermoves[rand(othermoves.length)]
            choice[1]=newchoice
            choice[2]=@moves[newchoice]
            choice[3]=-1
          end

    Paste it under:

    Code:
    elsif @effects[PBEffects::Encore]>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

    Edit YOURPOKEMONSPECIES and XXX.
    hello I tryied your script but it didn't worked I am jusing the elite battle system
     
    15
    Posts
    7
    Years
    • Seen Aug 19, 2017
    hello I tryied your script but it didn't worked I am jusing the elite battle system

    Hello there I have to do it for 3 pokemon pikachu,charizard and primape. I am following the story of ash ketchum so i need that script for his pikachu charizard and primape. And how do I use it.
     
    Back
    Top