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

Dynamax & Max Raid Battles [Essentials v18.1]

AskipLudo

The Masked Guy
159
Posts
7
Years
  • Hello, I wanted to try this, and got an error, maybe I've forgot something tho

    Spoiler:


    EDIT: the error occur when using a move and pokemon from trainers/or myself will spam his attacks
     
    Last edited:
    125
    Posts
    4
    Years
    • Seen Nov 20, 2023
    And it seems to occur another bug,when I caught any pokemon,the error is" in 'pbUnmaxMove' undefined method 'moves' ".
    (I solve it by copy the old "def CancelChoice"and named it"def CancelChoiceCaught" and replace it in Battle_StartAndEnd.It's stupid but works well.)
     
    Last edited:
    1,408
    Posts
    10
    Years
    • Seen yesterday
    And it seems to occur another bug,when I caught any pokemon,the error is" in 'pbUnmaxMove' undefined method 'moves' ".
    (I solve it by copy the old "def CancelChoice"and named it"def CancelChoiceCaught" and replace it in Battle_StartAndEnd.It's stupid but works well.)

    Oh, whoops. Here, just do this:

    In the new code I gave you in the previous fix, just add this additional piece of code:
    Code:
        if pbDynamaxInstalled? [B][I]&& pbRegisteredDynamax?(idxBattler)[/I][/B]
          pbUnregisterDynamax(idxBattler)     
          @battlers[idxBattler].pbUnMaxMove
        end
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Hello, I wanted to try this, and got an error, maybe I've forgot something tho

    Spoiler:


    EDIT: the error occur when using a move and pokemon from trainers/or myself will spam his attacks

    The error doesn't seem to be pointing to any Dynamax code. And it seems like you're running another battle-related script (SOS Battles). So most likely its not my script, but some kind of clash between another script that clashes with mine. Try making sure the Dynamax script is below ALL other scripts that affect battle. And any of the "Additional Installations" in my instructions should be made in your third party scripts too, if they affect areas of the base Essentials script that Dynamax needs.
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Thanks for solving it!
    By the way,in the new Trainer dynamax method,if a trainer have no ace,he/she wont dynamax any pokemon.
    However,if I set muti ace,the trainer will dynamax the first sent ace,which seems not a good choice.
    Could you please keep the old method that "dynamax last sent one" or random dynamax when no ace is set?
    Thanks anyway.

    What you're describing is sort of how it's designed to be. It seems like an overall improvement imo, so I'm not sure why you'd want it the old way.

    If you don't want a particular NPC to use Dynamax, don't set any Trainer Aces.
    If you want an NPC to use Dynamax with a specific Pokemon in their party, set that Pokemon as their Trainer Ace.
    If you want an NPC to use Dynamax with their first Pokemon, set the first Pokemon in their lineup as their Ace.
    If you want an NPC to use a random Pokemon as their Dynamax (and not their first Pokemon), then just make all the Pokemon in their party their Ace besides the first one.

    I feel like this offers more control than the previous method which was too random, since you had no idea of predicting what the AI's final Pokemon would be. Now you always know who they will Dynamax, or can control which Pokemon in their lineup they may Dynamax.
     

    AskipLudo

    The Masked Guy
    159
    Posts
    7
    Years
  • The error doesn't seem to be pointing to any Dynamax code. And it seems like you're running another battle-related script (SOS Battles). So most likely its not my script, but some kind of clash between another script that clashes with mine. Try making sure the Dynamax script is below ALL other scripts that affect battle. And any of the "Additional Installations" in my instructions should be made in your third party scripts too, if they affect areas of the base Essentials script that Dynamax needs.

    Removed the SOSBattle error still appear, I've added all the "additional installations" but what do you mean by "third party scripts"
     
    125
    Posts
    4
    Years
    • Seen Nov 20, 2023
    Yes,Ace method is excellent.
    However, if I make all the Pokemon in their party their Ace besides the first one,the second sent out pokemon must use dynamax.
    I dont actually know how AI decide the order of pokemon,but I would like to suggest a method that really "random".
    For example,if there are more than one Ace in the party,than when you send one of them out,It just "have chance" to dynamax rather than"must".
    Also,just like Trainers in Sword&Sheild,they dynamax their last pokemon,It's also a good method,I think.
    Maybe I cant express well,sorry.
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Removed the SOSBattle error still appear, I've added all the "additional installations" but what do you mean by "third party scripts"

    I mean scripts that you added in. Dynamax scripts are designed for the base Essentials v18.1 scripts. So I can't account for any outside scripts you added in. Some scripts may change elements of the default Essentials script which Dynamax also needs to change in some way, and because of that it can cause incompatibility errors.

    I have no idea what areas of the base script SOS Battles change, but I'm willing to bet it changes something Dynamax uses. Or perhaps something else you have installed. All I can suggest is installing Dynamax in a fresh copy of v18.1 with no other scripts installed, and testing if you get the same error.
     

    AskipLudo

    The Masked Guy
    159
    Posts
    7
    Years
  • I mean scripts that you added in. Dynamax scripts are designed for the base Essentials v18.1 scripts. So I can't account for any outside scripts you added in. Some scripts may change elements of the default Essentials script which Dynamax also needs to change in some way, and because of that it can cause incompatibility errors.

    I have no idea what areas of the base script SOS Battles change, but I'm willing to bet it changes something Dynamax uses. Or perhaps something else you have installed. All I can suggest is installing Dynamax in a fresh copy of v18.1 with no other scripts installed, and testing if you get the same error.

    Okay, I will try this ^^

    EDIT: Found the problem sad cause I wanted to use this. I removed the lavender ghost (https://www.pokecommunity.com/showthread.php?t=441236) from my script and it worked
     
    Last edited:
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Yes,Ace method is excellent.
    However, if I make all the Pokemon in their party their Ace besides the first one,the second sent out pokemon must use dynamax.
    I dont actually know how AI decide the order of pokemon,but I would like to suggest a method that really "random".
    For example,if there are more than one Ace in the party,than when you send one of them out,It just "have chance" to dynamax rather than"must".
    Also,just like Trainers in Sword&Sheild,they dynamax their last pokemon,It's also a good method,I think.
    Maybe I cant express well,sorry.

    I don't really see a ton of utility to that, really. The whole point of changing it to this method was to move AWAY from randomness, because its impossible to plan out a challenging fight if you can't control which specific Pokemon the AI saves its Dynamax for. Now you can do that. I don't really like having the AI Dynamax Pokemon at random, because then they might waste it on a Pokemon that doesn't make much use of it.

    However, if you do want to implement a random chance element to whether the AI decides to Dynamax or not, I suppose all you'd have to do is add something like "if rand(10)<5" to the "pbEnemyShouldDynamax?" method.
     
    125
    Posts
    4
    Years
    • Seen Nov 20, 2023
    Thanks for answering.
    In short, I think when a trainer has five Aces, I suggest that he should dynamax a random one, but now he dynamax the second one he sends out.
    In this method,I know he will dynamax his second sent out pokemon,and it will reduce some challenge and fun.
    Did I think about it in a wrong way?
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Thanks for answering.
    In short, I think when a trainer has five Aces, I suggest that he should dynamax a random one, but now he dynamax the second one he sends out.
    In this method,I know he will dynamax his second sent out pokemon,and it will reduce some challenge and fun.
    Did I think about it in a wrong way?

    No, it just sounds like you WANT your NPC's to use Dynamax randomly. Which is fine, that's just the opposite of what I was trying to do. I changed it to this method to REMOVE randomness. The intent was that you would be able to choose specific Pokemon for NPCs to Dynamax, like how it works in the main series. For example, Gym Leaders always Dynamax their signature Pokemon. They dont randomly use it with their other party members. Thats what i was trying to emulate here. Being able to set multiple aces is just a cool extra perk, its not really the intent behind the design.
     
    5
    Posts
    8
    Years
    • Seen Nov 21, 2023
    Method 3: Pokemon internal name. Input the internal name of a species in place of "pkmn", and the raid will attempt to spawn that species.
    Example:
    pbMaxRaid(2,5,:GENGAR)
    This will attempt to create a 2v1 battle 5-star Gengar raid. Gengar may or may not spawn in its Gigantamax form.

    I've tried this but all I get is Ditto spawning. Even when I try to use the encounter table, several times the script generates a Ditto Raid.

    What may I be doing wrongly about the first case? And, also ,can I set the raid pool to each den manually?
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    I've tried this but all I get is Ditto spawning. Even when I try to use the encounter table, several times the script generates a Ditto Raid.

    What may I be doing wrongly about the first case? And, also ,can I set the raid pool to each den manually?

    Would you mind posting the exact code you entered so I can see if there's simply an input error? And on what map? (Assuming this is a default essentials map)

    Remember, if youre entering a raid rank that the species cannot legally spawn in (Magikarp in a 5 Star raid, Mew in a 2 Star Raid, etc), the raid will return no viable species, and thus default to Ditto.

    And no, there isnt a way to set a pool of specific species for each raid. Although i suppose its possible to repurpose the RAID_DEFAULT array to establish a set list of species, and then purposely input an impossible combination of factors so it defaults to a Pokemon in that array. But that would be a rather clunky work-around, and it wouldnt be something you could change for each raid. Maybe thats a feature ill get to one day.
     
    125
    Posts
    4
    Years
    • Seen Nov 20, 2023
    Now a similar bug comes up when I choose to dynamax and then press F to shift,and then cancel it.(And it can be solved in similar way,too. )
    Also,when my pokemon level up by rarecandy,,the Max HP increases but the HP is still the old number.(I guess it's because the wrong position of @totalhp = stats[PBStats::HP] in clacstats)
     
    Last edited:
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Now a similar bug comes up when I choose to dynamax and then press F to shift,and then cancel it.(And it can be solved in similar way,too. )
    Also,when my pokemon level up by rarecandy,,the Max HP increases but the HP is still the old number.(I guess it's because the wrong position of @totalhp = stats[PBStats::HP] in clacstats)

    Both issues are now fixed. Thanks.
     
    1,408
    Posts
    10
    Years
    • Seen yesterday
    Great script but
    Well everything is working fine except that i can not access my in game kanto pokedex only and also the region selection feature is not woring max raid database have i done something wrong ?
    And yes it is fresh essentials not even a single extra script

    That's probably because you dont have any Pokemon in other regional dexes. In the Pokemon PBS file, you need to add regional numbers to each species in the "RegionalNumbers" setting. The Pokemon PBS I provided ONLY has Pokemon set in the Kanto Regional dex (this is an oversight, as I simply copied the PBS data found in the Gen 8 project, just with Habitats added in), but the Johto Dex is empty. If you add a species to the Johto Dex, the region setting in the Database will automatically update to include this.


    EDIT: I've updated the Pokemon PBS file in the download with the correct regional numbers. Use that instead.
     
    Last edited:
    Back
    Top