• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist 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.

Type3 & PBTypes.maxValue

  • 58
    Posts
    11
    Years
    • Seen May 29, 2020
    Hi all,

    I've been trying to add a Type3. With this I mean that pokemon can have 3 types. For example: Gyarados becomes Water, Flying, Dragon, and Masquerain becomes Bug, Water, Flying.

    This means adding 'Type3', adding a line to the compiler to read Pokemon.txt, altering the effectiveness check and changing 'modtype' (was 0, 1, 2, -4-, 8, 16; becomes 0, 1, 2, 4, -8-, 16, 32, 64).

    So far most things seem to work. Except that I have some problems with the DARK type. When using a DARK-type move, the move is sometimes skipped: Krokorok used Bite! ... Zubat used Supersonic! (and supersonic is executed).

    It is not always skipped. I know it fails on Zubat, Wingull, Surskit, Sewaddle, Weepinbell, Emolga, Pansage and Sandile. But it succeeds on for example Marill, Psyduck and Sandshrew.

    Because the DARK-type is the last move of Types.txt, I tried switching the DARK-type with, in this case, the FIRE-type. After this, the FIRE-type failed. That makes me think it may be related to PBTypes.maxValue. But I have no clue of the exact location of the error.

    I logged every change, but the log is not self-explanatory (without looking into the script). I included it anyway to give an idea of the changes I made:

    Spoiler:


    Thanks in advance for your help,

    dexter1o6


    EDIT:
    ...and there's the next thing that apparently doesn't work yet. The FIRE-type seems to be super-effective at Hoothoot. So, that's no good -_- And it means the problem probably doesn't lie with .maxValue...

    To make it a bit more clear, all hints help. I may be able to fix the problem myself, but I need guidance through the script. Like, what scripts are likely to be part of the problem?


    EDIT2:
    I now have a large list of pokemon on which the problem does (not) occur, and I've concluded that pokemon with two types are the problem. If the defending pokemon has one or three types, it works.

    I think the problem might be in pbExtraTypes. Does anyone know what kind of parameter is returned by PBTypes.getEffectiveness? Is that a boolean or an integer? And why is the argument 'opponentType2' set to 'nil'? Just to get to know the pieces of code I'm working with...
     
    Last edited:
    Back
    Top