• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Scripting Question] EBS and Z-Moves - Z-Moves Available without Crystals

  • 3
    Posts
    12
    Years
    • Seen Feb 2, 2021
    Hello, this is my first time posting in this forum in years, but hopefully someone can help me!
    Basically, I'm trying to make EBS and Z-moves compatible. I'm using Marcello's Z-moves script posted by Amethyst and kindly ported over to 17.2 by Tea-Rex.

    Currently, I have it so when a Pokemon has a Z-Crystal and uses a Z-move, the script can tell if the Z-Move is valid or not correctly, so that functionality is down. Same with one Z-move per battle. The problem is that Pokemon without Z-Crystals or Mega Stones have Z-moves available to them. It isn't just that the button is drawn up, it's that they have full access to them.

    Z-Moves are done in the UI similarly as Mega Evolution is, below is an example:
    Spoiler:

    And below is how the inputs are dealt with:
    Spoiler:

    I tried messing around with the code above, but that didn't really fix the issue. On the bright side, using a Z-move with a Pokemon not holding a Z-Crystal does disable Z-moves for the rest of the fight, even for Pokemon holding a Z-Crystal, so I know that much is working fine.

    If anyone could point me in the right direction, I'd really appreciate it!
     
    Edit: Fixed some things, still feels like this could be simpler, but it seems to work.

    Oh I figured it out I think! If anyone is attempting to do something like this too, maybe this will help!

    Basically the Z-Move script I downloaded had pbIsZCrystal? defined, but the given PBS files didn't use that Special Item flag. This would be the proper item definition (assuming the same script is being used):
    Spoiler:

    That in itself didn't fix the problem, so I made adjustments to the following code like so:
    Spoiler:

    I feel like this is basically using paperclips to hold it together, but it fixed the problem. Mega Evolution works properly, and Z-Moves only register if the pokemon is holding a Z-Crystal. Seems to play nice with multiple Z-Crystals on a team as well.

    If any bugs come up, I'll probably update the post, but for now, it seems basic functionality is working!
     
    Last edited:
    Back
    Top