• 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: Essentials Deluxe [v20.1] [DEPRECATED]

5
Posts
3
Years
    • Seen Aug 5, 2023
    Nvm, I see what the problem is. You're trying to apply Trick Room with the :effect key, but Trick Room isn't a battler effect, it's a field effect. So you have to use the :field key to implement this.

    As the tutorial states:
    :effect is only used for effects that apply to a specific battler.
    :team is only used for effects that apply to a specific side of the field (hazards, screens, etc).
    :field is only used for effects that apply to the entire battlefield (Rooms, Gravity, etc).

    Ah yes sorry you're right, although by replacing effect: with field: I am now getting an almost identical error?
    Exception: NoMethodError
    Message: undefined method `first' for 0:Integer

    Backtrace:
    [Essentials Deluxe] Midbattle_Main.rb:521:in `block in midbattle_FieldEffects'
    [Essentials Deluxe] Midbattle_Main.rb:519:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:519:in `midbattle_FieldEffects'
    [Essentials Deluxe] Midbattle_Main.rb:126:in `block (2 levels) in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `block in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `dx_midbattle'
    [Essentials Deluxe] Battle.rb:118:in `pbCommandPhase'
    148:Battle_StartAndEnd:334:in `block (2 levels) in pbBattleLoop'
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Ah yes sorry you're right, although by replacing effect: with field: I am now getting an almost identical error?

    Oh, that's because all of the keys that are used to set PBEffects are entered as an array which may contain several other arrays (one for each effect).

    So it's supposed to look like this:
    Code:
    :field => [ [PBEffects::TrickRoom, 99, "The dimensions were twisted!"] ]

    It's done this way so that you can set a multitude of various effects in a single key, like so:
    Code:
    :field => [ 
         [PBEffects::TrickRoom, 99, "The dimensions were twisted!"],
         [PBEffects::MagicRoom, 99, "All Pokémon's held items lost their effects!"],
         [PBEffects::WonderRoom, 99, "Defense and Sp. Def stats are swapped"],
         [PBEffects::Gravity, 99, "Gravity intensified!"]
     ]
     
    5
    Posts
    3
    Years
    • Seen Aug 5, 2023
    Oh, that's because all of the keys that are used to set PBEffects are entered as an array which may contain several other arrays (one for each effect).

    So it's supposed to look like this:
    Code:
    :field => [ [PBEffects::TrickRoom, 99, "The dimensions were twisted!"] ]

    It's done this way so that you can set a multitude of various effects in a single key, like so:
    Code:
    :field => [ 
         [PBEffects::TrickRoom, 99, "The dimensions were twisted!"],
         [PBEffects::MagicRoom, 99, "All Pokémon's held items lost their effects!"],
         [PBEffects::WonderRoom, 99, "Defense and Sp. Def stats are swapped"],
         [PBEffects::Gravity, 99, "Gravity intensified!"]
     ]

    Ahhhh yes that was the problem! Thank you so much for your help, it seems to be working how I want it to now!
     
    195
    Posts
    7
    Years
    • Seen May 4, 2024
    Hi, so I know that you can make a trainer slide onto the field by placing text, but how would you do this in a double battle with two separate trainers? So that each can say things and activate different effects based on various factors.
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Hi, so I know that you can make a trainer slide onto the field by placing text, but how would you do this in a double battle with two separate trainers? So that each can say things and activate different effects based on various factors.

    The trainer who appears on screen is directly tied to whoever owns whatever the current battler is that was set with the :battler key. If you set up a double battle and use the :DEMO_SPEECH midbattle hash that comes with the plugin, you can see this in action.
     
    195
    Posts
    7
    Years
    • Seen May 4, 2024
    The trainer who appears on screen is directly tied to whoever owns whatever the current battler is that was set with the :battler key. If you set up a double battle and use the :DEMO_SPEECH midbattle hash that comes with the plugin, you can see this in action.

    Ah, I think I see now! Thanks a bunch!
     
    195
    Posts
    7
    Years
    • Seen May 4, 2024
    Ok I'm a little confused now. I've tried a few different approaches, putting :battler => 1 and :battler => 2 in the same hash, thinking that it would change who the current battler is. But it always defaults to the first trainer defined. I can't seem to get the other one to come out at all.

    Code:
      DARRAI = {
    	"turnCommand"	=> {
    	  :speech => ["Oh, you've really picked wrong today!",
    		    "Rai and I will show you what we can do together!"]
        },
    	"turnAttack"	=> {
    	  :battler => 2,
              :speech => ["Taking us on in my domain was a mistake, you know.",
    		    "It's Electric Terrain time!"],
    	  :terrain => :Electric
        }
      }
    This is my latest attempt. It doesn't change the battler to the other trainer. No error messages, runs fine, so the code must work, but I'm missing a trick somewhere.
     
    Last edited:
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Ok I'm a little confused now. I've tried a few different approaches, putting :battler => 1 and :battler => 2 in the same hash, thinking that it would change who the current battler is. But it always defaults to the first trainer defined. I can't seem to get the other one to come out at all.

    Code:
      DARRAI = {
    	"turnCommand"	=> {
    	  :speech => ["Oh, you've really picked wrong today!",
    		    "Rai and I will show you what we can do together!"]
        },
    	"turnAttack"	=> {
    	  :battler => 2,
              :speech => ["Taking us on in my domain was a mistake, you know.",
    		    "It's Electric Terrain time!"],
    	  :terrain => :Electric
        }
      }
    This is my latest attempt. It doesn't change the battler to the other trainer. No error messages, runs fine, so the code must work, but I'm missing a trick somewhere.

    Try battler 3. Battler 2 is the player's second Pokemon, I believe.
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    This doesn't seem to be it either, unfortunately. I tried higher numbers too just in case.

    Hmm, I see. I guess that doesn't work then.
    Thinking it through, I guess it makes sense that it wouldn't work that way, since the Trainer index is only checked for once when the trigger first occurs, it isn't ever updated again even if :battler is changed. So I suppose the only way to make the second foe to appear is when something happens that THEY specifically trigger. For example, if a "attack_foe_repeat" hash is set and a speech key is triggered within it, then whenever any opposing Pokemon attacks, the trainer who owns the Pokemon who attacked will be the one who appears on screen to speak. But you can't specifically call one trainer or the other, it all depends on who's Pokemon is the one who is triggering something.
     
    195
    Posts
    7
    Years
    • Seen May 4, 2024
    Hmm, I see. I guess that doesn't work then.
    Thinking it through, I guess it makes sense that it wouldn't work that way, since the Trainer index is only checked for once when the trigger first occurs, it isn't ever updated again even if :battler is changed. So I suppose the only way to make the second foe to appear is when something happens that THEY specifically trigger. For example, if a "attack_foe_repeat" hash is set and a speech key is triggered within it, then whenever any opposing Pokemon attacks, the trainer who owns the Pokemon who attacked will be the one who appears on screen to speak. But you can't specifically call one trainer or the other, it all depends on who's Pokemon is the one who is triggering something.

    Ah I see...Well, I'm sure I'll figure out a work around.
    I think I came across a possible oversight just now? I was trying to set up Stealth Rocks and ran across this error.
    Code:
    [Pokémon Essentials version 20.1]
    [v20.1 Hotfixes 1.0.3]
    
    Exception: NameError
    Message: uninitialized constant PBEffects::Steelsurge
    
    Backtrace:
    [Essentials Deluxe] Midbattle_Effects.rb:203:in `apply_team_effects'
    [Essentials Deluxe] Midbattle_Main.rb:509:in `block in midbattle_TeamEffects'
    [Essentials Deluxe] Midbattle_Main.rb:505:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:505:in `midbattle_TeamEffects'
    [Essentials Deluxe] Midbattle_Main.rb:125:in `block (2 levels) in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `block in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `dx_midbattle'
    [Essentials Deluxe] Battle.rb:118:in `pbCommandPhase'
    There's an effect for Steelsurge in Midbattle_Effects line 203 that should only be available through ZUD, but is in the file without a check.
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Ah I see...Well, I'm sure I'll figure out a work around.
    I think I came across a possible oversight just now? I was trying to set up Stealth Rocks and ran across this error.
    Code:
    [Pokémon Essentials version 20.1]
    [v20.1 Hotfixes 1.0.3]
    
    Exception: NameError
    Message: uninitialized constant PBEffects::Steelsurge
    
    Backtrace:
    [Essentials Deluxe] Midbattle_Effects.rb:203:in `apply_team_effects'
    [Essentials Deluxe] Midbattle_Main.rb:509:in `block in midbattle_TeamEffects'
    [Essentials Deluxe] Midbattle_Main.rb:505:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:505:in `midbattle_TeamEffects'
    [Essentials Deluxe] Midbattle_Main.rb:125:in `block (2 levels) in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:64:in `block in dx_midbattle'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `each'
    [Essentials Deluxe] Midbattle_Main.rb:37:in `dx_midbattle'
    [Essentials Deluxe] Battle.rb:118:in `pbCommandPhase'
    There's an effect for Steelsurge in Midbattle_Effects line 203 that should only be available through ZUD, but is in the file without a check.

    You are correct, that is indeed an oversight.
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Minor Update (v1.0.7)
    • Fixed a bug related to the effect of G-Max Steelsurge being checked for even if the ZUD Plugin is not installed.
    • Added the :trainer midbattle key. You may set this to a battler index to set which opposing trainer should appear on screen during dialogue. This is only applicable in double or triple battles with multiple opponents. This may be used to specify which trainer should appear on screen during dialogue, even if their Pokemon wasn't the one who triggered a mid-battle property, as shown in this example:

      PaDPlYG.gif


      To set this, set :trainer equal to a battler index (in the same way the :battler key is used), before a :speech key, except the battler indexes in this case must only be ones owned by an opponent. Here is an example of the hash used to produce the above gif:
      Code:
      "turnCommand" => {
        :trainer   => 1,
        :speech    => "I'll speak first!",
        :trainer_1 => 3,
        :speech_1  => "I'll speak second!",
        :trainer_2 => 5,
        :speech_2  => "I'll speak third!"
      }

    Note: When updating, please make a copy of any custom work you've added to Midbattle_Config. Updating the plugin will overwrite any of your additions.
     
    5
    Posts
    4
    Years
    • Seen Nov 10, 2022
    I am having this error in a version of essentials V20.1, which only has the plugins: v20.1 Hotfixes and Generation 8 Pack Scripts
    pd: sorry if there is any mistake, my english is not very good.

    [Pokémon Essentials version 20.1]

    Exception: Errno::EBADF
    Message: Bad file descriptor @ fptr_finalize_flush - Data/PluginScripts.rxdata

    Backtrace:
    008:PluginManager:616:in `close'
    008:PluginManager:616:in `open'
    008:PluginManager:616:in `compilePlugins'
    008:PluginManager:630:in `runPlugins'
    386:Main:28:in `mainFunctionDebug'
    386:Main:18:in `block in mainFunction'
    014:Errors:80:in `pbCriticalCode'
    386:Main:18:in `mainFunction'
    386:Main:45:in `block in <main>'
    386:Main:44:in `loop'
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    I am having this error in a version of essentials V20.1, which only has the plugins: v20.1 Hotfixes and Generation 8 Pack Scripts
    pd: sorry if there is any mistake, my english is not very good.

    [Pokémon Essentials version 20.1]

    Exception: Errno::EBADF
    Message: Bad file descriptor @ fptr_finalize_flush - Data/PluginScripts.rxdata

    Backtrace:
    008:PluginManager:616:in `close'
    008:PluginManager:616:in `open'
    008:PluginManager:616:in `compilePlugins'
    008:PluginManager:630:in `runPlugins'
    386:Main:28:in `mainFunctionDebug'
    386:Main:18:in `block in mainFunction'
    014:Errors:80:in `pbCriticalCode'
    386:Main:18:in `mainFunction'
    386:Main:45:in `block in <main>'
    386:Main:44:in `loop'

    I have no idea what this is, but definitely nothing to do with this plugin. Its something related with Essentials itself, or perhaps the way plugin files are saved in your project. I don't know.
     
    5
    Posts
    4
    Years
    • Seen Nov 10, 2022
    Thank you for answering so quickly.

    The error appears just when I put the plugin, if I remove it it works.
     
    195
    Posts
    7
    Years
    • Seen May 4, 2024
    Minor Update (v1.0.7)
    • Fixed a bug related to the effect of G-Max Steelsurge being checked for even if the ZUD Plugin is not installed.
    • Added the :trainer midbattle key. You may set this to a battler index to set which opposing trainer should appear on screen during dialogue. This is only applicable in double or triple battles with multiple opponents. This may be used to specify which trainer should appear on screen during dialogue, even if their Pokemon wasn't the one who triggered a mid-battle property, as shown in this example:

      PaDPlYG.gif


      To set this, set :trainer equal to a battler index (in the same way the :battler key is used), before a :speech key, except the battler indexes in this case must only be ones owned by an opponent. Here is an example of the hash used to produce the above gif:
      Code:
      "turnCommand" => {
        :trainer   => 1,
        :speech    => "I'll speak first!",
        :trainer_1 => 3,
        :speech_1  => "I'll speak second!",
        :trainer_2 => 5,
        :speech_2  => "I'll speak third!"
      }

    Note: When updating, please make a copy of any custom work you've added to Midbattle_Config. Updating the plugin will overwrite any of your additions.
    Oh! Thanks for this! I'll be sure to update and give it a whirl!
     
    1
    Posts
    2
    Years
    • Seen Mar 28, 2024
    Never mind.. I'm just an idiot and didn't comprehend the instructions.
     

    Attachments

    • Capture.PNG
      Capture.PNG
      4.5 KB · Views: 15
    Last edited:
    423
    Posts
    13
    Years
    • Seen Aug 31, 2023
    Loving your plugins
    Looking forward to the legendary breeding and the birthsigns to being updated but i can imagine those will take some doing

    Are there any other plans in the pipeline?
     
    1,407
    Posts
    10
    Years
    • Seen yesterday
    Loving your plugins
    Looking forward to the legendary breeding and the birthsigns to being updated but i can imagine those will take some doing

    Are there any other plans in the pipeline?

    Im taking a break at the moment before working on those. Beyond that, I dont have any concrete plans. I started working on an in-battle menu for displaying a ton of battle and move info in a neat and organized fashion, but I didn't get very far with it. I might end up rolling that into my Enhanced UI plugin as a new feature, if I ever get around to it. I also began work on implementing the Agile/Strong styles from PLA (of which some compatibility remnants exist in this plugin already), but by the time I actually get around to completing it, im not sure anyone will really care about that mechanic anymore. So I feel like ill end up scrapping those plans.

    I was planning on working on the inevitable Gen 9 battle mechanic whenever Scarlet/Violet comes out, but Terastalizing looks so stupid/lame to me (both aesthetically and conceptually) that I dont think ill have any motivation to work on it. Plus, I believe someone else is already working on it. But we know pretty much nothing about it yet, so im waiting until the games are out to do a deep dive into its mechanics. I hated Dynamax at first too, but I gained a significant appreciation for it as time went on.

    Other than that, I don't have any creative plans for new content atm. I do want to eventually upgrade this plugin to make the midbattle scripting more user-friendly and more robust like the original mid-battle dialogue script, but I still think that's slightly above my skill level. And I am secretly dreading the release of EBDX for v20.1, because I know that means ill have to update all of my plugins for compatibility, which in itself will be several weeks if not months of work, if my experience with the v19 plugin is anything to go by.

    That's about it, as of now. But you can never really predict when inspiration will suddenly strike for a new idea. The Focus Meter System I recently released literally hit me out of the blue simply because of someone on discord complaining about Critical Hit RNG. So, you never know.
     
    Back
    Top