• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Dynamax [DBK Add-On] [v21.1]

Resource Dynamax [DBK Add-On] [v21.1] v1.0.9

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
Before you say "but I'm sure I gave it one in the PBS data", I'm sure you have, but there's a bug in Essentials where partner trainers do not inherit the inventories that are set in the PBS data, so partner trainers will always have an empty inventory. I alerted Maruno to this bug a long time ago, but I guess he never included it in the Hotfixes patches. I already fixed this in my own game when I discovered it, so I kinda forgot about this bug entirely. I'll include my own fix for this in the next update for the DBK plugin.
Thanks for telling me about that bug and the tweaks. I wasn't sure how far along you were on the raid battle plugin (which I'm sure would make setting up my raid battles much easier), and I figured that getting this working would help me figure out some of my other complex battles down the road, so I'll get to trying out that script.

Edit: I tested it first with a partner trainer that had more than one Pokemon, but the partner trainer did not dynamax after the third KO even when they were down to their last Pokemon. I also tried with the partner trainer that had just one, but it still didn't work.
 
Last edited:

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
Well this wasn't supposed to happen even with the old script. Which this battle is using.
46973a1728862056b69678f1396793472.png


I'm going to break down what's going on here. First I started a raid where May decided to Terastalize, and I'm fairly certain I didn't even give her a Tera Orb. So I decided to test this with Leaf, who is supposed to be available at this point in my game. May was just left in as a placeholder, but I digress. And now I'll breakdown what the original script does exactly. Or at least what it was supposed to do as written.

Code:
Expand Collapse Copy
setBattleRule("midbattleScript",
"BattlerFainted_player_repeat" => {"addVariable"  => 1},
"BattlerFainted_ally_repeat" => {"addVariable"  => 1},
"Variable_1" => {"text"  => ["The storm raging above you is growing stronger!"]},
"Variable_2" => {"text"  => ["The storm is growing even stronger!"]},
"Variable_3" => {"text"  => ["The storm is getting too strong to withstand!"]},
"Variable_4" => {"text"  => ["You were blown out  of the den!"], "endBattle" => 2},
"BattlerHPCritical_foe" => {"battlerHP" => 0},
"RoundEnd_10" => {"setVariable" => 4},
"ignoreAfter" => "AfterDynamax_Player",
"ignoreAfter" => "AfterDynamax_Ally",
"RoundStartCommand_player_repeat_odd" => {"text"  => ["Dynamax energy gathered around \\PN!"],
"disableDynamax" => false}, "RoundStartCommand_player_repeat_even" => {"disableDynamax" => true},
"RoundStartCommand_ally_repeat_odd" => {"disableDynamax" => true},
"RoundStartCommand_ally_repeat_even" => {"disableDynamax" => false}
)
You already know about the variable thing and the 10 round limit. I don't need to explain that, so I'll focus on what you thought did nothing. I wasn't going to waste time or energy on the correction since I didn't need to before, but seeing as how this seems to be a bug, I think it's worth explaining.

At the end, the script was supposed to swap the ability to Dynamax between the player and the ally. The ignore after commands trigger in the event that either Dynamaxes, turning off the clock that alternates the ability to Dynamax, which is supposed prevent a second Dynamax. This is supposed to keep Max Raid Battles as close to the source material as possible. The turn before I Dynamaxed, Leaf did. This means that the partner AI did not care about the script at all. It's also revealed that there is some information I'm still missing. Did this happen because my Pokemon were weaker than that Bulbasaur? Is the AI seeing my team? That would definitely explain why the AI refused to use Dynamax at all when I entered the raid with a full team on my original save. For now, I kind of welcome it if it gets the AI to Dynamax, but I thought I should mention it since it just happened.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,198
Well this wasn't supposed to happen even with the old script. Which this battle is using.
46973a1728862056b69678f1396793472.png


I'm going to break down what's going on here. First I started a raid where May decided to Terastalize, and I'm fairly certain I didn't even give her a Tera Orb. So I decided to test this with Leaf, who is supposed to be available at this point in my game. May was just left in as a placeholder, but I digress. And now I'll breakdown what the original script does exactly. Or at least what it was supposed to do as written.


You already know about the variable thing and the 10 round limit. I don't need to explain that, so I'll focus on what you thought did nothing. I wasn't going to waste time or energy on the correction since I didn't need to before, but seeing as how this seems to be a bug, I think it's worth explaining.

At the end, the script was supposed to swap the ability to Dynamax between the player and the ally. The ignore after commands trigger in the event that either Dynamaxes, turning off the clock that alternates the ability to Dynamax, which is supposed prevent a second Dynamax. This is supposed to keep Max Raid Battles as close to the source material as possible. The turn before I Dynamaxed, Leaf did. This means that the partner AI did not care about the script at all. It's also revealed that there is some information I'm still missing. Did this happen because my Pokemon were weaker than that Bulbasaur? Is the AI seeing my team? That would definitely explain why the AI refused to use Dynamax at all when I entered the raid with a full team on my original save. For now, I kind of welcome it if it gets the AI to Dynamax, but I thought I should mention it since it just happened.
I'm not really that invested in figuring out how or why this isn't working, tbh. All the individual mechanisms seem to work as intended, it's more an issue of compiling them all together in a way where the logic flows the way you want it to. Which sorta goes beyond the scope of this thread imo, as it's not really a plugin issue as it is an issue with your individual concept you're trying to implement.

With that said, I popped in the original script that I provided for you the other day, and it all seemed to work fine for me (again, I didn't do a deep dive on testing it, though). It's bare bones obviously, but everything did as I expected it to, and how I outlined it to you. Like I said, you should probably just use what I gave you as a base to work off of and tweak it from there.

The reason I say that is because I think a large part of why you're having issues is simply due to your formatting. The way you're writing your script is messy and hard to keep track of because you just put everything on a single line for each trigger. Idk if that's the way you're writing it, or if that's just how it's being pasted on here. But look at the formatting in the script I provided, it's far neater and easier to track what's happening.

For example, these lines in your script:
Ruby:
Expand Collapse Copy
"ignoreAfter" => "AfterDynamax_Player",
"ignoreAfter" => "AfterDynamax_Ally",
Are doing absolutely nothing. The reason is because the way you formatted your script puts these commands outside of any trigger, so these commands are never being read at all. If you changed your formatting, you'd probably catch why pretty quickly.
 

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
Edit: I tested it first with a partner trainer that had more than one Pokemon, but the partner trainer did not dynamax after the third KO even when they were down to their last Pokemon. I also tried with the partner trainer that had just one, but it still didn't work.

You say that it does nothing, but that is simply not true as I've tested it myself. It did in fact work, just not quite as intended as I mentioned last night since the AI Dynamaxed despite it being on a turn it shouldn't have been allowed on. If it had done that on its Dynamax turn, I would've been locked out of Dynamax. In reality, your version of the script doesn't work as intended either as I've mentioned in this edit.

The issue I'm trying to highlight is that the partner AI is ignoring the midbattle script and looking at my team to determine what it should and shouldn't do as that is the only explanation for this odd behavior.

Edit: Nevermind, it seems that it was only doing this because I held Ctrl which I hadn't been expecting to do anything. Go ahead disregard everything about this post except the fact that I already tried your script.
 
Last edited:

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,198
You say that it does nothing, but that is simply not true as I've tested it myself. It did in fact work, just not quite as intended as I mentioned last night since the AI Dynamaxed despite it being on a turn it shouldn't have been allowed on. If it had done that on its Dynamax turn, I would've been locked out of Dynamax. In reality, your version of the script doesn't work as intended either as I've mentioned in this edit.

The issue I'm trying to highlight is that the partner AI is ignoring the midbattle script and looking at my team to determine what it should and shouldn't do as that is the only explanation for this odd behavior.

Edit: Nevermind, it seems that it was only doing this because I held Ctrl which I hadn't been expecting to do anything. Go ahead disregard everything about this post except the fact that I already tried your script.
Yes, CTRL skips all eligibility checks while in debug mode and just assumes that Dynamax should always work when held. The same is true for Z-Moves, Tera, etc.

Your "ignore" commands would never work normally because you didnt put them INSIDE any midbattle triggers. Theyre just floating out on their own and arent attached to anything, so there's no way for them to ever be read. They would work if you actually put them inside of a trigger of some kind.

I tried my script, and it works. Note that by "works", I do not mean that it does what you want it to do. I just means it follows the logic that I would expect it to follow. Making it work exactly like you're trying to make it work is much more complicated, which is why I say to use it as a base and build upon it from there. Im only really concerned about whether the plugin works or not, and nothing so far indicates to me that it doesn't (besides the Essentials bug with partner items, which again, isnt a problem with this plugin specifically).
 

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
I tried my script, and it works. Note that by "works", I do not mean that it does what you want it to do. I just means it follows the logic that I would expect it to follow.
Correct me if I'm wrong, but shouldn't this force Dynamax after 3 Pokemon have fainted even without a Dynamax Band? Because if not, then that's exactly what I'm missing here, and it would make the most sense. It's more of something that I was expecting to happen regardless of if I provided the trainer a Dynamax Band.
Code:
Expand Collapse Copy
"RoundStartAttack_ally_repeat" => {
    "ignoreAfter"    => "AfterDynamax_ally",
    "ignoreUntil"    => "Variable_3",
    "dynamax"        => true
  },
 
Last edited:

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,198
Correct me if I'm wrong, but shouldn't this force Dynamax after 3 Pokemon have fainted even without a Dynamax Band? Because if not, then that's exactly what I'm missing here.
Code:
Expand Collapse Copy
"RoundStartAttack_ally_repeat" => {
    "ignoreAfter"    => "AfterDynamax_ally",
    "ignoreUntil"    => "Variable_3",
    "dynamax"        => true
  },
The trainer still needs a Dynamax Band. All the regular Dynamax requirements are still necessary.
 

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
Where's the setting that adds the Power Spot tag by default? I can't find it even after checking all of the script files, and it keeps adding the tag back to my game's Route 1 when I playtest.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,198
Where's the setting that adds the Power Spot tag by default? I can't find it even after checking all of the script files, and it keeps adding the tag back to my game's Route 1 when I playtest.
I assume you mean the map_metadata.txt PBS flags? If so, that shouldn't be happening.

The plugin comes with a PBS file that adds the "PowerSpot" flag to maps 10, 37, 56, 59, 61, and 64 by default. But only the first time you install the plugin. It stops adding them anymore after that (unless you hold Shift while compiling).
 

Nova Ozuka

Novice
Member
Joined
Apr 15, 2022
Posts
14
I mean, I'm not holding shift and it is adding it back, so removing the tag has been an extremely temporary solution since it just gets added back automatically. But thanks for telling me about the PBS file so I can do something about it on my end.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,198
I mean, I'm not holding shift and it is adding it back, so removing the tag has been an extremely temporary solution since it just gets added back automatically. But thanks for telling me about the PBS file so I can do something about it on my end.
Hmm, after some investigating, it seems like the map_metadata file added by the plugin has some invisible junk data saved in the text that prevents the "once per installation" check from working for some reason. Very odd. Anyway, I'll fix this in the next update.
 
Back
Top