• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Make Master Ball fail on one specific Pokemon [very old version of Essentials]

thepsynergist

Vinemon: Sauce Edition Programmer and Composer
  • 790
    Posts
    16
    Years
    So, it's been a few years since I've been on this forum, and I decided to pickup and finish Pokemon Pyrite. However, I've a question regarding one of the Pokemon in my game.

    I wanted to know if there's a way I can modify the script that handles Master Ball function and make it so it doesn't work on either a specific Pokemon, or a Pokemon whose rareness value is 0.

    Now, here's the caveat. Since it's been so long since I've been here, Pokemon Essentials versions have vastly improved. The version I'm using is from a build made in 2010, so the code will probably be antiquated.

    if x>255 || isConst?(ball,PBItems,:MASTERBALL)
    shakes=4
    else
    x=1 if x==0
    y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) )
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    end

    If anyone can figure this out, that'd be awesome. If all goes well, my game should be done by next month, if anyone still follows Pokemon Pyrite.
     
    Last edited by a moderator:
    This should work for you.
    Code:
    if x>255 || (isConst?(ball,PBItems,:MASTERBALL) && !battler.species==SPECIES NAME)
    shakes=4
    elsif isConst?(ball,PBItems,:MASTERBALL) && battler.species==SPECIES NAME
    shakes=0
    else 
    x=1 if x==0
    y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) )
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y 
    end
     
    It works, but not like a Pokeball normally acts.

    This script makes it so you use the Master Ball the script just ends. It doesn't show the throwing or ball shake animations. I was hoping it would throw and not shake, and display the "XXX broke free!" message.

    Other than that, it works, so thank you very much.
     
    It's a modified pre v1 build. It's been in use since 2009, and I've added dozens of scripts with it, to the point that most modern builds of Pokemon Essentials throws up all kinds of syntax errors (it's just too old.)

    It's not feasible at this time to upgrade the engine, because of how much it's been edited over the years (I don't even remember a lot of the edits I made 5 or so years ago.)
     
    Try this code:

    Code:
    if x>255 || (isConst?(ball,PBItems,:MASTERBALL) && battler.species!=XIADES)
    shakes=4
    elsif(isConst?(ball,PBItems,:MASTERBALL) && battler.species==XIADES)
    shakes=rand(4)
    else 
    x=1 if x==0
    y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) )
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y
    shakes+=1 if pbRandom(65536)<y 
    end
     
    I understand, now. Start your game, open the DEBUG menu and activate the Battle log. The game probably should show a message error: paste it here.
     
    It didn't have any effect.

    Apparently, the side effect of that code made it so Master Balls no longer worked at all. I dunno how that might of happened, but for now, I reverted the code back.

    Would it be easier to ask for a conditional branch where it checks if a Pokemon's rareness value was 0, rather than a specific Pokemon?
     
    Last edited by a moderator:
    Try with the last chance:
    Code:
        if x>255 || (isConst?(ball,PBItems,:MASTERBALL) && !isConst?(battler.species,PBSpecies,:XIADES))
        shakes=4
       elsif(isConst?(ball,PBItems,:MASTERBALL) && isConst?(battler.species,PBSpecies,:XIADES))
        shakes=rand(4)
       else
        x=1 if x==0
        y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) )
        shakes+=1 if pbRandom(65536)<y
        shakes+=1 if pbRandom(65536)<y
        shakes+=1 if pbRandom(65536)<y
        shakes+=1 if pbRandom(65536)<y
       end
     
    You're welcome! I'm currently making a game with a friend and we appreciate your help: i'll writing you a PM with all details, in these days.
     
    Back
    Top