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

Z-Move Add On

1,401
Posts
10
Years
  • Age 35
  • Online now
Making it compatible with Dynamax is my next step. I have a lot of time during the holidays so I'll work on it.



Yes indeed. I cried a lot while writing this post XD
I have this code on a separate branch on a GitHub fork of the current Essentials v18.dev (hence my work here). Maybe I can make a pull request to make your life easier?


Ultra Burst wasn't in the base code given by the OP so I completely forgot it...
I'll do it soon.

I have Ultra Burst pretty much already implemented (I adapted a really rough draft of Z-Moves in my project for testing purposes), I can send you what I have if you're interested. It's basically just an adaptation of a script Wolf posted on here for v17.

And yeah, I feel you on the tears lol. Updating the Dynamax script had me pulling my hair out for months and just typing up the post alone to describe how everything works was a multi-day ordeal lol. And then when people ask questions I specifically went through the trouble killing myself to explain in the post...😵 lol

As far as compatibility goes, I've already included some basic compatibility placeholders for Z-Moves/Ultra Burst in the compatibility script I included with Dynamax. At least, as far as getting the correct buttons to appear in battle. Hopefully that'll provide a solid starting point.
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
I have Ultra Burst pretty much already implemented (I adapted a really rough draft of Z-Moves in my project for testing purposes), I can send you what I have if you're interested. It's basically just an adaptation of a script Wolf posted on here for v17.
Yes please! PM me or post it here?

And yeah, I feel you on the tears lol. Updating the Dynamax script had me pulling my hair out for months and just typing up the post alone to describe how everything works was a multi-day ordeal lol. And then when people ask questions I specifically went through the trouble killing myself to explain in the post...😵 lol

As far as compatibility goes, I've already included some basic compatibility placeholders for Z-Moves/Ultra Burst in the compatibility script I included with Dynamax. At least, as far as getting the correct buttons to appear in battle. Hopefully that'll provide a solid starting point.

I just installed your Dynamax plugin. I must say, this is clean code :)
I merged my Z-move plugin + your Dynamax plugin. The main issue I see is the cohabitation of the Dynamax button and the Z-move button lol.
I also had to define stuff related to Ultra-Burst, so that the code works.
Besides, when the merge is over, I plan on removing the compatibility checks. They won't be needed anymore.

I'll work on this in the next days :)
 
1,401
Posts
10
Years
  • Age 35
  • Online now
Yes please! PM me or post it here?



I just installed your Dynamax plugin. I must say, this is clean code :)
I merged my Z-move plugin + your Dynamax plugin. The main issue I see is the cohabitation of the Dynamax button and the Z-move button lol.
I also had to define stuff related to Ultra-Burst, so that the code works.
Besides, when the merge is over, I plan on removing the compatibility checks. They won't be needed anymore.

I'll work on this in the next days :)

I sent you what I have. Also, something I want to point out about the Z-Crystal items that always seemed like a mistake to me, even with the original iteration of this script:

The key item versions of the Z-Crystals aren't properly labeled as key items. They use "14" as their final value (which is defined by pbIsZCrystal2?), but this, from what I can tell, is completely unneeded for anything. You don't even need to include that method. Instead, they should use the number "6", and be classified as true key items. This way when you view them in the Key Items pocket in the bag, they don't have amounts listed next to them, and aren't treated as consumable items that can be removed from the bag. That's where this part of the installation comes in:

add this:
Code:
if pbIsZCrystal?(item)
      return true
    end
Not sure what this code does though, it was in the base plugin.

What this does is prevent the "holdable" version of Z-Crystals (the ones listed like NORMALIUMZ2) from being added to your bag. Basically, when you use the Key Item version of a Z-Crystal (which are infinite in use, which is why they should be labeled as key items), it creates a new, holdable version of that Z-Crystal and puts it on a Pokemon. Then when you remove the Z-Crystal from the Pokemon, that holdable version gets deleted and isn't returned to the bag (otherwise you could just infinitely spawn holdable Z-Crystals that get sent to the first pocket of your bag). This is how I believe this code was always SUPPOSED to work, but was an oversight that has just been repeatedly copied by everyone who attempts to update this script in some way.


EDIT: Nvm, I'm wrong. Using 14 as the item type number is actually fine (and necessary, with how you structured the code). The issue is actually this line in def pbIsImportantItem?:
Code:
return true if itemData[ITEM_FIELD_USE] && itemData[ITEM_FIELD_USE]==14  # Key item representing Z-Crystals.
It should actually be this instead:
Code:
return true if itemData[ITEM_TYPE] && itemData[ITEM_TYPE]==14  # Key item representing Z-Crystals.

Changing this fixes the issue of the key item Z-Crystals having a finite quantity.
 
Last edited:

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
Yo, first of all, you are a wonderful human being for uploading this.
Second, this step is backwards
unknown.png

Third, I don't have one.
Thank you for coming to my Ted Talk
 
125
Posts
4
Years
  • Age 22
  • Seen Nov 20, 2023
So up to now,have anyone made the dynamax and Z-moves work together?
I try that,only to keep getting errors,and most of them are about Ultra-Burst.
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
Yo, first of all, you are a wonderful human being for uploading this.
Second, this step is backwards
Third, I don't have one.
First of all, thank you. Second, thank you again. Third, that's all XD

Thank you for coming to my Ted Talk
????

So up to now,have anyone made the dynamax and Z-moves work together?
I try that,only to keep getting errors,and most of them are about Ultra-Burst.
Lucidious and I are working on this. Ultra Burst will be in a future release.

For now, if you want to make it work, here is the quick fix that I ran:

Spoiler:
 
Last edited:
125
Posts
4
Years
  • Age 22
  • Seen Nov 20, 2023
The error is "undefined pbEnemyShouldUltraBurst?""pbAttackPhaseUltraBurst"and so on,maybe they should be edit too.
 
Last edited:

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
The error is "undefined pbEnemyShouldUltraBurst?""pbAttackPhaseUltraBurst"and so on,maybe they should be edit too.

You're right, I didn't test my code. Here is the script that works:

FILE: Data\Scripts\023_Dynamax\003_Mechanic_Compatibility.rb

Spoiler:
 
125
Posts
4
Years
  • Age 22
  • Seen Nov 20, 2023
It works,the only problem is after I press Z,the movename doesnt change,when I choose the right move,It will turn to z-move.Otherwise,the game will crash.
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
Bug Report: You cannot attack Period if you aren't using a Z-Move when there is more than 1 opponent. here is the error message:
Spoiler:


and here is the code associated with the error:
Spoiler:
 
1,401
Posts
10
Years
  • Age 35
  • Online now
Bug Report: You cannot attack Period if you aren't using a Z-Move when there is more than 1 opponent. here is the error message:
Spoiler:


and here is the code associated with the error:
Spoiler:


I believe all that needs to be done to fix that is add "next if !b" in this piece of code here:
Code:
# Prepare for Z Moves
    @battlers.each_with_index do |b,i|
      next if !b # <- HERE
      next if @choices[i][0]!=:UseMove
      side=(opposes?(i)) ? 1 : 0
      owner=pbGetOwnerIndexFromBattlerIndex(i)
      @choices[i][2].zmove=(@zMove[side][owner]==i)
    end
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
Thanks Lucidious89 :)
I updated the main post with that fix.
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
Bug Report 2(Electric Boogaloo): Pressing the trigger for Z-Moves will ALWAYS show the Z-Move anim and message even when the move you used isn't compatible with the Z-Crystal (Example Fairy Crystal using a water move) and after that you won't be able to use a Z-Move period
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
Bug Report 2(Electric Boogaloo): Pressing the trigger for Z-Moves will ALWAYS show the Z-Move anim and message even when the move you used isn't compatible with the Z-Crystal (Example Fairy Crystal using a water move) and after that you won't be able to use a Z-Move period

This is weird. I cannot replicate this bug. Can you be more precise? Which Z-crystal, what Pokémon, which moves does it have?
It feels like the game is not checking whether the Z-move is compatible.

In the file: Data\Scripts\012_Battle\003_Battle\010_Battle_Phase_Command.rb, in the definition of:
Code:
   def pbFightMenu(idxBattler)
can you check if the function pbCanZMove?(idxBattler) always returns true?

Btw, this function should be:
Spoiler:

Check if you have exactly that.
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
I'm using a Primarina with the fairy type Z-Crystal and the move I attempted to use was both Sparkling Aria and Hyper Voice. they both brought up the error. here is the fight menu code you asked me to check over with the code you presented right next to it for comparison.
unknown.png

I brought this issue up to Lucidious privately and he asked if I had the incompatibility message in my code too, I showed it to him and he said it's different from what you are using and what's on the thread here. this is the code I showed him
unknown.png
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
I think you are mentioning two different bugs.

From your previous post:
Spoiler:

I understand that pressing the Z-move button will trigger the Z-move even if the move you choose is not compatible, and this happens without error message, while from this post:
Spoiler:
I understand that you are getting an actual error message when the moves aren't compatible.

Please help me help you, if I don't understand your problems I won't be able to help. What does actually happen?

By the way, I am currently working with Lucidious89 on making a compatibility file between his Dynamax plugin + my Z-move plugin. Maybe you should wait a week or two?
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
where in my 2nd post with the images did I say "I am getting an Error Message". if I was, I'd have posted it. I'm not forum illiterate.
when I said "they both brought up the error" I was referring to the exact same error from my original Error Report 2(Electric Boogaloo) post. what isn't happening period is when the moves aren't compatible it DOESN'T say "{1} is not compatible with {2}!" and that has been my problem since posting.
what I was describing in my second post is that the code i got from your original post does not match what you currently have in the dev build. if what you have in the dev build fixes this error I was hoping you'd say "Here is the code and see if it fixes this major bug in the script"
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
where in my 2nd post with the images did I say "I am getting an Error Message". if I was, I'd have posted it. I'm not forum illiterate.
when I said "they both brought up the error" I was referring to the exact same error from my original Error Report 2(Electric Boogaloo) post. what isn't happening period is when the moves aren't compatible it DOESN'T say "{1} is not compatible with {2}!" and that has been my problem since posting.
Ok, my mistake, sorry. You didn't use the term "error" in the first post while you did in the second, hence my failure to understand.
what I was describing in my second post is that the code i got from your original post does not match what you currently have in the dev build. if what you have in the dev build fixes this error I was hoping you'd say "Here is the code and see if it fixes this major bug in the script"
A new failure to understand.
  • What do you call "the dev build"? Is it Essentials v18.dev?
  • How can they not match? The screenshot with my code + your code displays the exact same code!
  • What are you trying to show me with your second screenshot? The message "{1} is not compatible with {2}" is not displayed, which means that one of the two conditions (at least) is false. Now investigate your code to see if cw.zbutton is set to 2 at some point (if ever), or if the function pbCompatibleZMoveFromIndex?() returns true while it shouldn't.
 

StCooler

Mayst thou thy peace discover.
9,295
Posts
4
Years
  • Age 28
  • Seen today
It works,the only problem is after I press Z,the movename doesnt change,when I choose the right move,It will turn to z-move.Otherwise,the game will crash.
Sorry I skipped your post!
For the movenames not changing, this will be added in the next release.
The game crashes when you select the wrong move? What error message does it display?
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
"The Dev Build" The version of the Z-Move script you are currently working on with Lucidious
The First screenshot: you stated in your initial post after I reported my bug to double check
Code:
def pbFightMenu(idxBattler)
that's all I'm doing there.
The Second screenshot: I brought this exact problem up with Lucidious and when he looked at the public code and the private code you two are working on he mentioned via DM's he said, Quote: "the version im using is heavily modified compared to the one he posted in the thread, and that part of the code is actually different" end Quote.
Looking further back into the code cw.zbutton is indeed equal to 2 simply because when the problem arises I receive the message "Primarina surrounded itself with its Z-Power!" which only triggers when pbUseZMove is called. I'm unsure how to check which condition pbCompatibleZMoveFromIndex? is in
 
Back
Top