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

Mid Battle Dialogue/Scripted Battles

  • 14
    Posts
    3
    Years
    • Seen May 23, 2022
    hanks. Now that I saw the Mid Battle Dialog plugin it was soon
    AFTER the Max Raid plugin. I changed the code of the dialogue to him and it was right. Thank you for your help
     
  • 2
    Posts
    4
    Years
    • Seen Jan 31, 2021
    Hello, I have a problem I have added the script and tried running the test battle but got the error message seen in the picture, in the right of the picture i have added a screenshot of where i save the scripts. https://ibb.co/yRL794d
     
    Hello, I have a problem I have added the script and tried running the test battle but got the error message seen in the picture, in the right of the picture i have added a screenshot of where i save the scripts. https://ibb.co/yRL794d

    You maybe tried to study the event script and in the process broke it. Open that script and run extendtext.exe given with the PE. this will make up space for that long code to come in 1 single line.
     

    Foxx_Gaming

    Wacky Wahoo Pizza Pasta Man
  • 35
    Posts
    3
    Years
    First of all, this script is amazing!
    With that out of the way, I was wondering if there would be a way to change the music to a sort of "Uh oh! Critical health!" theme (which is indeed possible) but then have it change back once the Pokemon's health rises above a certain threshold. I've gotten the first half down, but I have no clue how to do the second.
    Does anyone have any thoughts on how to make this idea work?
     
  • 71
    Posts
    4
    Years
    This is actually great, I've been testing it and it works perfectly for me, I'm going to use it on a lot of battles because after watching the examples, I actually find it quite easily to use ^^

    I've realized that this script also makes PokeStar Studios possible in Essentials, I'll maybe work on that
     
  • 71
    Posts
    4
    Years
    After some days using it, now this error pops out of nothing each time I use the script and a dialogue ends:
    Code:
    ---------------------------
    Error
    ---------------------------
    Script '[Interpreter]' line 246: RuntimeError occurred.
    
    Script error within event 61 (coords 25,12), map 47 (Ruta 21):
    
    Exception: NoMethodError
    
    Message: Mid battle dialogue:1224:in `createProcesses'undefined method `visible' for nil:NilClass
    
    
    
    ***Full script:
    
    BattleScripting.setInScript("turn0",:Catching_Start)
    BattleScripting.setInScript("halfHPOpp",:Catching_Catch)
    pbWildBattle(:MAGIKARP,5)
    
    
    
    
    Backtrace:
    
    Interpreter:197:in `pbExecuteScript'
    
    PokeBattle_Animation:9:in `initialize'
    
    Mid battle dialogue:1218:in `initialize'
    
    Mid battle dialogue:1162:in `new'
    
    Mid battle dialogue:1162:in `pbHideOpponent'
    
    Mid battle dialogue:1072:in `display'
    
    Mid battle dialogue:96:in `pbBattleLoop'
    
    Mid battle dialogue:86:in `loop'
    
    Mid battle dialogue:125:in `pbBattleLoop'
    
    Battle_StartAndEnd:302:in `pbStartBattleCore'
    
    
    ---------------------------
    Aceptar   
    ---------------------------


    Edit: I'm using turn0 instead of turnStart because I changed that on the script. Just changed:

    TrainerDialogue.display("turnStart#{@turnCount}",self,@scene)

    To:

    TrainerDialogue.display("turn#{@turnCount}",self,@scene)


    So I'm guessing this is not why the error happens
     
    Last edited:
  • 658
    Posts
    7
    Years
    After some days using it, now this error pops out of nothing each time I use the script and a dialogue ends:
    Can't help you with this one because you've edited your script and so line 1224 in your version is different from my version. Try looking through your edits and check for anything that's missing. Use text-compare.com if needed. But the simple solution I can give you is don't edit the scripts, use it how it came out of the box, it'll save you and me alot of trouble.
     
  • 71
    Posts
    4
    Years
    Can't help you with this one because you've edited your script and so line 1224 in your version is different from my version. Try looking through your edits and check for anything that's missing. Use text-compare.com if needed. But the simple solution I can give you is don't edit the scripts, use it how it came out of the box, it'll save you and me alot of trouble.

    Thanks for the page :) I didn't know so now I can use to compare scripts.

    My difference was that I erased the def ChangeTrainerSprite because it also gave me errors. However now I'm using exactly the same script as you.

    And I still have the same error :(

    Code:
    ---------------------------
    Error
    ---------------------------
    Script '[Interpreter]' line 246: RuntimeError occurred.
    
    Script error within event 61 (coords 25,12), map 47 (Ruta 21):
    
    Exception: NoMethodError
    
    Message: Mid battle dialogue:1236:in `createProcesses'undefined method `visible' for nil:NilClass
    
    
    
    ***Full script:
    
    BattleScripting.setInScript("turnStart0",:Catching_Start)
    BattleScripting.setInScript("halfHPOpp",:Catching_Catch)
    pbWildBattle(:MAGIKARP,5)
    
    
    
    
    Backtrace:
    
    Interpreter:197:in `pbExecuteScript'
    
    PokeBattle_Animation:9:in `initialize'
    
    Mid battle dialogue:1230:in `initialize'
    
    Mid battle dialogue:1174:in `new'
    
    Mid battle dialogue:1174:in `pbHideOpponent'
    
    Mid battle dialogue2:162
    
    Mid battle dialogue2:146:in `call'
    
    Mid battle dialogue:1084:in `display'
    
    Mid battle dialogue:108:in `pbBattleLoop'
    
    Mid battle dialogue:86:in `loop'
    
    
    ---------------------------
    Aceptar   
    ---------------------------
     
  • 658
    Posts
    7
    Years
    The script has been updated to v1.6

    There have been various bugfixes to the script. Mainly compatibility issues.
    The format for BattleScripting.copy has changed, please make sure you update your script command accordingly.

    The instructions have been updated as well. Please check them out.
     

    YashPokeFan123

    #PokeFan
  • 283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    The script has been updated to v1.6

    There have been various bugfixes to the script. Mainly compatibility issues.
    The format for BattleScripting.copy has changed, please make sure you update your script command accordingly.

    The instructions have been updated as well. Please check them out.

    does it remove its compatibility with zud plugin?
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    does it remove its compatibility with zud plugin?

    The instructions from the first post of ZUD remain valid.

    In the first script of Mid Battle Dialogue, find the function:
    Code:
      def pbStartBattleSendOut(sendOuts)
    at the beginning of the function, replace:
    Code:
            case TrainerDialogue.eval("battleStart")
            when -1
              pbDisplayPaused(_INTL("Oh! A wild {1} appeared!",foeParty[0].name))
    with:
    Code:
            case TrainerDialogue.eval("battleStart")
            when -1
              # Max Raids - Alters encounter text. (ZUD)
              if defined?(MAXRAID_SWITCH) && $game_switches[MAXRAID_SWITCH]
                text = "Dynamaxed"
                text = "Gigantamax" if foeParty[0].gmaxFactor?
                text = "Eternamax"  if isConst?(foeParty[0].species,PBSpecies,:ETERNATUS)
                pbDisplayPaused(_INTL("Oh! A {1} {2} lurks in the den!",text,foeParty[0].name))
              else
                pbDisplayPaused(_INTL("Oh! A wild {1} appeared!",foeParty[0].name))
              end

    Again in the first file, find the function:
    Code:
      def pbReduceDamage(user,target)
    find the line:
    Code:
        return if target.damageState.iceface
    and below that, paste:
    Code:
        # Max Raids - Damage thresholds for triggering shields. (ZUD)
        damage = pbReduceMaxRaidDamage(target,damage)

    That's all that I see that might cause conflict.

    Also, ZUD should be loaded AFTER Mid Battle Dialogue.
     

    YashPokeFan123

    #PokeFan
  • 283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    im getting this error when try to do brock battle event

    ---------------------------
    Error
    ---------------------------
    Script '[Interpreter]' line 246: RuntimeError occurred.

    Script error within event 21 (coords 20,8), map 2 (Lappet Town):

    Exception: NoMethodError

    Message: (eval):14:in `pbExecuteScript'undefined method `copy' for TrainerDialogue:Module



    ***Full script:

    $PokemonGlobal.nextBattleBGM="BrockBattle"
    # Simple text change for showing that this is the 2nd time you're challening Brock
    TrainerDialogue.set("battleStart","You challenge Gym Leader Brock for the 2nd time!")
    BattleScripting.setInScript("last",:Brock_LastPlayer)
    TrainerDialogue.set("turnStart0",Proc.new{|battle|
    # At the start of the Battle, set Geodude's item to Ring Target.
    # Allows the Pikachu to hit Geodude with Electric Attacks. Plot Armor 100
    battle.battlers[1].item=getID(PBItems,:RINGTARGET)
    })
    BattleScripting.setInScript("smlDamageOpp",:Brock_MockPlayer)
    BattleScripting.setInScript("recall",:Brock_GiveUp)
    TrainerDialogue.set("fainted","Are you giving up already, \\PN?")
    BattleScripting.setInScript("halfHP,2",:Brock_Sprinklers)
    TrainerDialogue.copy("lowHP,2","halfHP,2")
    BattleScripting.setInScript("lowHPOpp,2",:Brock_Forfeit)
    party = []
    species = [:PIDGEOTTO,:PIKACHU]
    for id in species
    party.push(getConst(PBSpecies,id)) if hasConst?(PBSpecies,id)
    end
    # Species IDs of the Pokémon to be created
    for i in 0...$Trainer.party.length
    $Trainer.party=nil
    end
    $Trainer.party.compact!
    for i in 0...party.length
    species = party
    $Trainer.party = pbNewPkmn(species,12)
    $Trainer.seen[species] = true # Set this species to seen and owned
    $Trainer.owned[species] = true
    end
    $Trainer.party[1].pbLearnMove(:AGILITY)
    $Trainer.party[1].pbLearnMove(:SLAM)
    $Trainer.party[1].pbLearnMove(:IRONTAIL)
    $Trainer.party[1].pbLearnMove(:THUNDERBOLT)
    $Trainer.party[0].pbLearnMove(:GUST)
    $Trainer.party[0].pbLearnMove(:WINGATTACK)
    $Trainer.party[0].pbLearnMove(:SANDATTACK)
    $Trainer.party[0].pbLearnMove(:TACKLE)




    Backtrace:

    Interpreter:197:in `pbExecuteScript'

    Interpreter:1458:in `eval'

    Interpreter:197:in `pbExecuteScript'

    Interpreter:1458:in `command_355'

    Interpreter:359:in `execute_command'

    Interpreter:155:in `update'

    Interpreter:102:in `loop'

    Interpreter:158:in `update'

    Scene_Map:162:in `follow_update'

    Scene_Map:160:in `loop'


    ---------------------------
    OK
    ---------------------------
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    TrainerDialogue.copy in not in any script

    What is this script you mentioned:

    Code:
     $PokemonGlobal.nextBattleBGM="BrockBattle"
    # Simple text change for showing that this is the 2nd time you're challening Brock
    TrainerDialogue.set("battleStart","You challenge Gym Leader Brock for the 2nd time!")
    BattleScripting.setInScript("last",:Brock_LastPlayer)
    TrainerDialogue.set("turnStart0",Proc.new{|battle|
    # At the start of the Battle, set Geodude's item to Ring Target.
    # Allows the Pikachu to hit Geodude with Electric Attacks. Plot Armor 100
    battle.battlers[1].item=getID(PBItems,:RINGTARGET)
    })
    BattleScripting.setInScript("smlDamageOpp",:Brock_MockPlayer)
    BattleScripting.setInScript("recall",:Brock_GiveUp)
    TrainerDialogue.set("fainted","Are you giving up already, \\PN?")
    BattleScripting.setInScript("halfHP,2",:Brock_Sprinklers)
    TrainerDialogue.copy("lowHP,2","halfHP,2")
    BattleScripting.setInScript("lowHPOpp,2",:Brock_Forfeit)
    party = []
    species = [:PIDGEOTTO,:PIKACHU]
    for id in species
    party.push(getConst(PBSpecies,id)) if hasConst?(PBSpecies,id)
    end
    # Species IDs of the Pokémon to be created
    for i in 0...$Trainer.party.length
    $Trainer.party[i]=nil
    end
    $Trainer.party.compact!
    for i in 0...party.length
    species = party[i]
    $Trainer.party[i] = pbNewPkmn(species,12)
    $Trainer.seen[species] = true # Set this species to seen and owned
    $Trainer.owned[species] = true
    end
    $Trainer.party[1].pbLearnMove(:AGILITY)
    $Trainer.party[1].pbLearnMove(:SLAM)
    $Trainer.party[1].pbLearnMove(:IRONTAIL)
    $Trainer.party[1].pbLearnMove(:THUNDERBOLT)
    $Trainer.party[0].pbLearnMove(:GUST)
    $Trainer.party[0].pbLearnMove(:WINGATTACK)
    $Trainer.party[0].pbLearnMove(:SANDATTACK)
    $Trainer.party[0].pbLearnMove(:TACKLE)

    There is a TrainerDialogue.copy here.
     
    Back
    Top