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

Script: Deluxe Battle Kit [v21.1]

1,407
Posts
10
Years
    • Online now
    hi wondering if you could help me, i keep getting this error code when fighting gastly, haunter and gengar. ive worked out that it seems to be when they've learnt SPITE. i thought it was the dbk z power but deleting that hasnt got rid of it.


    ive now deleted spite from gastly and everything is working fine for the time being
    this is the pbs file which seems normal and the error is attached.
    thanks
    #-------------------------------
    [SPITE]
    Name = Spite
    Type = GHOST
    Category = Status
    Accuracy = 100
    TotalPP = 10
    Target = NearOther
    FunctionCode = LowerPPOfTargetLastMoveBy4
    Flags = CanProtect,CanMirrorMove,ZPower_HealUser
    Description = The user unleashes its grudge on the move last used by the target by cutting 4 PP from it.
    #-------------------------------

    View attachment 157588
    After playing around with it both in vanilla Essentials and in a project with all of the plugins installed, I have not been able to replicate this error. So either you customized something that has caused this, or it's only triggered in a very specific scenario. All I'm doing is entering a battle with a Gastly that only knows the move Spite and playing 2-3 rounds of the battle and everything seems fine.
     

    WaterIsNice

    Water Enjoyer
    7
    Posts
    43
    Days
    • He / Him
    • Seen Apr 11, 2024
    Yeah but like I said, the code you posted works perfectly fine for me though, which is why I'm not understanding what the problem is that you're having.

    >Every time a Grass-type is switched in, the message "Works!" appears.
    >When the variable reaches 2, the message "Works again!" appears.

    What else are you expecting to happen that isn't happening?
    Hi again, so I tinkered with the code and managed to figure out the problem. I think that after the first speech, I believe that the variable gets set to 1. After removing the RoundStartCommand code and editing some parts, I managed to make it work. Since the code I sent worked for you, there's probably something wrong on my end. Here's the edited code that worked for me.
    Code:
    setBattleRule("Single")
    setBattleRule("midbattleScript", { 
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1   
      },
      "Variable_1" => {
        "speech"   => "Works again!"
      }
     })
     
    1
    Posts
    31
    Days
    • Seen Apr 21, 2024
    Hi there!

    I wanted to report something that happened to a tester of mine. It seems to happen when I tested in Debug mode as well:

    If a pokemon levels up while at Red HP, the low hp music will keep playing even if the pokemon goes to yellow HP

    Maybe this has already been fixed, but I tried to read through the updates and I think I have the most recent version. Thank you.
     
    1,407
    Posts
    10
    Years
    • Online now
    Hi again, so I tinkered with the code and managed to figure out the problem. I think that after the first speech, I believe that the variable gets set to 1. After removing the RoundStartCommand code and editing some parts, I managed to make it work. Since the code I sent worked for you, there's probably something wrong on my end. Here's the edited code that worked for me.
    Code:
    setBattleRule("Single")
    setBattleRule("midbattleScript", {
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1  
      },
      "Variable_1" => {
        "speech"   => "Works again!"
      }
     })
    Maybe I'm just not understanding what it is that you're actually trying to make happen with this. Because your new code works, sure, but it seems completely redundant.
    If all you want is both messages to play when the player sends out a Grass type, why don't you just...put both messages in the "AfterSendOut_GRASS_player_repeat" trigger? Why do you even need to use variables at all?

    Unless you only want the variable message to happen only once during the battle? In which case you can probably just use the "ignoreAfter" Command Key and not even deal with variables at all.
     
    1,407
    Posts
    10
    Years
    • Online now
    Hi there!

    I wanted to report something that happened to a tester of mine. It seems to happen when I tested in Debug mode as well:

    If a pokemon levels up while at Red HP, the low hp music will keep playing even if the pokemon goes to yellow HP

    Maybe this has already been fixed, but I tried to read through the updates and I think I have the most recent version. Thank you.
    Interesting, I never considered that. Should be fixed now.
     
    36
    Posts
    4
    Years
    • Seen yesterday
    Hey, I'm making a Pokémon game for friends that have never played a Pokémon game before.

    I want a trainer (in this instance, Nemona) to explain and encourage the player to use Terastallization in battle against her, and then have her Terastallize her own Pawmi as well.

    I've set her Pawmi to have TeraType = ELECTRIC in the trainers.txt PBS file.

    But for whatever reason, the scipt I'm writing in won't allow me to write more than 12 lines of code.
    This is what I've gotten so far, and I've tested it multiple times and it works fine... but I'm just not allowed to add anymore lines to it. If I hold Shift and press Enter, it just closes the Script down. And I still haven't made Nemona able to Terastallize.

    Code:
    setBattleRule("midbattleScript", {
      "RoundStartCommand_1_foe" => {
        "speech"     => ["Hey!", "When selecting a move, try pressing the Z-button on your keyboard to activate your
    Tera Orb!"]
      },
      "AfterTerastallize" => {
        "setSpeaker" => :Opposing,
        "speech"     => ["Yesss!", "You're pulling off Terastallizing no problem!"]
      },
    })
    TrainerBattle.start(:POKEMONTRAINER_Nemona, "Nemona")

    I first realized this when I tried to copy one of the Trainer Battle Examples into my own game to get a better understanding of how to set it up. And the RPG Maker XP just wouldn't accept it because it was too long.
     
    Last edited:
    1,407
    Posts
    10
    Years
    • Online now
    Hey, I'm making a Pokémon game for friends that have never played a Pokémon game before.

    I want a trainer (in this instance, Nemona) to explain and encourage the player to use Terastallization in battle against her, and then have her Terastallize her own Pawmi as well.

    I've set her Pawmi to have TeraType = ELECTRIC in the trainers.txt PBS file.

    But for whatever reason, the scipt I'm writing in won't allow me to write more than 12 lines of code.
    This is what I've gotten so far, and I've tested it multiple times and it works fine... but I'm just not allowed to add anymore lines to it. If I hold Shift and press Enter, it just closes the Script down. And I still haven't made Nemona able to Terastallize.

    Code:
    setBattleRule("midbattleScript", {
      "RoundStartCommand_1_foe" => {
        "speech"     => ["Hey!", "When selecting a move, try pressing the Z-button on your keyboard to activate your
    Tera Orb!"]
      },
      "AfterTerastallize" => {
        "setSpeaker" => :Opposing,
        "speech"     => ["Yesss!", "You're pulling off Terastallizing no problem!"]
      },
    })
    TrainerBattle.start(:POKEMONTRAINER_Nemona, "Nemona")

    I first realized this when I tried to copy one of the Trainer Battle Examples into my own game to get a better understanding of how to set it up. And the RPG Maker XP just wouldn't accept it because it was too long.
    The "storing scripts" page in the DBK guide explains one way in which you may deal with this issue.
     

    WaterIsNice

    Water Enjoyer
    7
    Posts
    43
    Days
    • He / Him
    • Seen Apr 11, 2024
    Hello, so I wanted to make a trainer battle where the trainer switches when you bring out a grass type pokemon. I believe I have done it incorrectly, but I can't figure out where. Also about the last problem, I just wanted to try out variables to have a better understanding of it.
    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", { 
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
      "ignoreUntil" => "Variable_1",
      "switchOut" => :Random
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
     
    1,407
    Posts
    10
    Years
    • Online now
    Hello, so I wanted to make a trainer battle where the trainer switches when you bring out a grass type pokemon. I believe I have done it incorrectly, but I can't figure out where. Also about the last problem, I just wanted to try out variables to have a better understanding of it.
    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", {
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
      "ignoreUntil" => "Variable_1",
      "switchOut" => :Random
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
    Ah, this one might actually be a bug.
     
    1,407
    Posts
    10
    Years
    • Online now
    Minor Update (v1.1.2)
    • Fixed an issue with low HP music continuing to play when the user's HP increased above the critical zone due to leveling up.
    • Fixed the "But it failed!" message from not displaying correctly when using the move Spite.
    • Fixed a bug that prevented the :Choose, :Random, and :Forced inputs from working with the "switchOut" Command Key in midbattle scripting.
     
    36
    Posts
    4
    Years
    • Seen yesterday
    The "storing scripts" page in the DBK guide explains one way in which you may deal with this issue.

    I looked it over and think I set it up (mostly) right? However, I can't get it to actually trigger.
    In a new .txt file I input the following:

    Code:
    module MidbattleScripts
      NEMONA_TERABATTLE_SCRIPT = {
        "RoundStartCommand_1_foe" => {
          "speech"     => ["Hey, \\PN!", "When selecting a move, try pressing the Z-button to activate your Tera Orb!"]
        },
        "AfterTerastallize" => {
          "setSpeaker" => :Opposing,
          "speech"     => ["Yesss!", "Way to go \\PN!", "You're pulling off Terastallizing no problem!"]
        },
        "TurnStart_PAWMI"
          "setSpeaker" => :Opposing,
          "speech"     => ["Are you ready Pawmi?"]
          "playCry" => :PAWMI,
          "setSpeaker" => :Opposing,
          "speech"     => ["That's what I like to hear!", "We're ready to give it our all!"]
        }
      }
    
    end

    And then in a script inside an event in RPG Maker, I put the following:

    Code:
    setBattleRule("midbattleScript", :NEMONA_TERABATTLE_SCRIPT)
    TrainerBattle.start(:POKEMONTRAINER_Nemona, "Nemona")

    The battle with Nemona will trigger, and she will Terastallize her own Pokémon, but she won't interrupt the battle with the comments I made. How do I fix this?

    Edit: Also, this might be a dumb question, but I thought I might ask anyway; I use slightly larger trainer sprites in my battles, which makes trainer sprites appear as standing below the platform they're usually on. Where do I change the x and y coordinates on the sprite to make it appear in the proper location?
     
    Last edited:
    1,407
    Posts
    10
    Years
    • Online now
    I looked it over and think I set it up (mostly) right? However, I can't get it to actually trigger.
    In a new .txt file I input the following:

    Code:
    module MidbattleScripts
      NEMONA_TERABATTLE_SCRIPT = {
        "RoundStartCommand_1_foe" => {
          "speech"     => ["Hey, \\PN!", "When selecting a move, try pressing the Z-button to activate your Tera Orb!"]
        },
        "AfterTerastallize" => {
          "setSpeaker" => :Opposing,
          "speech"     => ["Yesss!", "Way to go \\PN!", "You're pulling off Terastallizing no problem!"]
        },
        "TurnStart_PAWMI"
          "setSpeaker" => :Opposing,
          "speech"     => ["Are you ready Pawmi?"]
          "playCry" => :PAWMI,
          "setSpeaker" => :Opposing,
          "speech"     => ["That's what I like to hear!", "We're ready to give it our all!"]
        }
      }
    
    end

    And then in a script inside an event in RPG Maker, I put the following:

    Code:
    setBattleRule("midbattleScript", :NEMONA_TERABATTLE_SCRIPT)
    TrainerBattle.start(:POKEMONTRAINER_Nemona, "Nemona")

    The battle with Nemona will trigger, and she will Terastallize her own Pokémon, but she won't interrupt the battle with the comments I made. How do I fix this?
    This needs to be saved in an rb file like the rest of the plugin scripts, not plain txt. I need to clarify this in the guide.

    Btw, "AfterTerastallize" should probably be "AfterTerastallize_player", since otherwise it will trigger whenever *any* trainer uses Terastallization, and it seems like you want it to trigger only specifically when the player uses it.

    Similarly, "TurnStart_PAWMI" should probably be "TurnStart_PAWMI_foe", in case the player also happens to have a Pawmi out on the field. If they do, this could potentially trigger for the player's Pawmi instead of the foe's. Also, since "_foe" is being used here, you no longer need to manually set the speaker at all, since it will always be triggering from the opponent's point of view. Also, since you have two separate "speech" keys in this trigger, you need to differentiate them since you can never have two identical keys in the same trigger. So it should probably look something like "speech_A" and "speech_B", or however you want to identify them.
     
    36
    Posts
    4
    Years
    • Seen yesterday
    This needs to be saved in an rb file like the rest of the plugin scripts, not plain txt. I need to clarify this in the guide.

    Btw, "AfterTerastallize" should probably be "AfterTerastallize_player", since otherwise it will trigger whenever *any* trainer uses Terastallization, and it seems like you want it to trigger only specifically when the player uses it.

    Similarly, "TurnStart_PAWMI" should probably be "TurnStart_PAWMI_foe", in case the player also happens to have a Pawmi out on the field. If they do, this could potentially trigger for the player's Pawmi instead of the foe's. Also, since "_foe" is being used here, you no longer need to manually set the speaker at all, since it will always be triggering from the opponent's point of view. Also, since you have two separate "speech" keys in this trigger, you need to differentiate them since you can never have two identical keys in the same trigger. So it should probably look something like "speech_A" and "speech_B", or however you want to identify them.

    That (and 3 syntax errors) fixed everything, thank you so much!

    A couple of questions, though: Where do I change the position of trainer sprites when playing the Dynamax, Terastallizing, Mega Evolution and Z-Move animations? My sprites aren't the default gen 3-styled sprites, but the slightly larger gen 4-styled ones, so the trainer sprites' feet are positioned below the platform, which looks odd.

    And is there a place to manually set the "speech"- and "text"-windowskins? Because currently when a midbattle script calls for "speech", the game uses the Windowskin "choice 3" file... which I haven't set it to do (to my knowledge), and it's not the default one that every other instance of speech in my game uses
     
    1,407
    Posts
    10
    Years
    • Online now
    That (and 3 syntax errors) fixed everything, thank you so much!

    A couple of questions, though: Where do I change the position of trainer sprites when playing the Dynamax, Terastallizing, Mega Evolution and Z-Move animations? My sprites aren't the default gen 3-styled sprites, but the slightly larger gen 4-styled ones, so the trainer sprites' feet are positioned below the platform, which looks odd.

    And is there a place to manually set the "speech"- and "text"-windowskins? Because currently when a midbattle script calls for "speech", the game uses the Windowskin "choice 3" file... which I haven't set it to do (to my knowledge), and it's not the default one that every other
    1) You'll probably have to directly edit the scripts in the DBK plugin to change trainer sprite positions. There isn't any simplified built-in method to do this otherwise. The method def dxSetPokemonWithOutline in Animation Utilities is where this is handled. I'm guessing you'll just have to play with the Y coordinates.

    2) Everything and anything related to midbattle speech is gone over in great detail in the tutorial.
     

    WaterIsNice

    Water Enjoyer
    7
    Posts
    43
    Days
    • He / Him
    • Seen Apr 11, 2024
    Hello again! So I wanted to expand on the trainer battle by making the Pansear use yawn, and then protect after being switched in. The problem I encountered is that, it always uses protect. Is this a bug, or is it a problem on my end? Thank you.

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", { 
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
        "ignoreUntil" => "Variable_1",
        "switchOut" => 2,
        "useMove" => 3,
        "setVariable" => 4
     },
      "TurnStart_foe_repeat" => {
        "ignoreUntil" => "Variable_4",
        "useMove" => 2,
        "setVariable" => 0
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")

    1712806740876.png
     
    1,407
    Posts
    10
    Years
    • Online now
    Hello again! So I wanted to expand on the trainer battle by making the Pansear use yawn, and then protect after being switched in. The problem I encountered is that, it always uses protect. Is this a bug, or is it a problem on my end? Thank you.

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", {
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
        "ignoreUntil" => "Variable_1",
        "switchOut" => 2,
        "useMove" => 3,
        "setVariable" => 4
     },
      "TurnStart_foe_repeat" => {
        "ignoreUntil" => "Variable_4",
        "useMove" => 2,
        "setVariable" => 0
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")

    View attachment 157893
    Unless I'm not understanding, it seems like you're trying to make a trainer switch out and use a move at the same time. That's obviously impossible, which is why the "useMove" command is being ignored.
     

    WaterIsNice

    Water Enjoyer
    7
    Posts
    43
    Days
    • He / Him
    • Seen Apr 11, 2024
    Unless I'm not understanding, it seems like you're trying to make a trainer switch out and use a move at the same time. That's obviously impossible, which is why the "useMove" command is being ignored.
    Okay, so I edited the code a bit and now I'm a bit confused on why the current code does not work. Once the Pansear is switched in, the variable is set to 4 which will trigger the speech at the start of the foe's turn, but it doesn't happen. Do you happen to know why?

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", { 
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
        "ignoreUntil" => "Variable_1",
        "switchOut" => 2,
        "setVariable" => 4
     },
      "TurnStart_foe_repeat" => {
        "ignoreUntil" => "Variable_4",
        "speech"   => "Yawn!",
        "useMove" => 3,
        "setVariable" => 0
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
     

    WaterIsNice

    Water Enjoyer
    7
    Posts
    43
    Days
    • He / Him
    • Seen Apr 11, 2024
    Okay, so I edited the code a bit and now I'm a bit confused on why the current code does not work. Once the Pansear is switched in, the variable is set to 4 which will trigger the speech at the start of the foe's turn, but it doesn't happen. Do you happen to know why?

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", {
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
        "ignoreUntil" => "Variable_1",
        "switchOut" => 2,
        "setVariable" => 4
     },
      "TurnStart_foe_repeat" => {
        "ignoreUntil" => "Variable_4",
        "speech"   => "Yawn!",
        "useMove" => 3,
        "setVariable" => 0
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
    Upon further testing on a different trainer, I believe that there may be a bug with setVariable. In this new code, the variable is supposed to reach 1 to activate the speech, but it doesn't

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", { 
      "TurnStart" => {
        "setVariable" => 1
     },
      "Variable_1" => {
        "speech" => "1"
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
     
    1,407
    Posts
    10
    Years
    • Online now
    Okay, so I edited the code a bit and now I'm a bit confused on why the current code does not work. Once the Pansear is switched in, the variable is set to 4 which will trigger the speech at the start of the foe's turn, but it doesn't happen. Do you happen to know why?

    Ruby:
    setBattleRule("Single")
    setBattleRule("midbattleScript", {
      "AfterSendOut_GRASS_player_repeat" => {
        "speech"   => "Works!",
        "addVariable" => 1
     },
      "RoundStartAttack_foe_repeat" => {
        "ignoreUntil" => "Variable_1",
        "switchOut" => 2,
        "setVariable" => 4
     },
      "TurnStart_foe_repeat" => {
        "ignoreUntil" => "Variable_4",
        "speech"   => "Yawn!",
        "useMove" => 3,
        "setVariable" => 0
     }
    })
    TrainerBattle.start(:YOUNGSTER, "Ben")
    "setVariable" will never trigger the "Variable" keys. Only "addVariable" or "multVariable" will. This is mentioned in the guide.

    "setVariable" is designed as a reset option to return the variable back to some base value. Its not designed as a means of triggering any keys.
     
    24
    Posts
    1
    Years
    • Seen yesterday
    Find a typo(maybe a typo) in [003]Deluxe Battle Rules. Line 177 should be track instead of track&.name.
     
    Back
    Top