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

[Scripting Question] Help with 3rd type

87
Posts
4
Years
  • Hi, a while ago I found this thread: https://www.pokecommunity.com/showthread.php?t=391589 and there it says:
    WARNING: This tutorial will break anything that relies upon [PBEffects::Type3], which is used for moves that assign a third type. It's possible to make those moves function and have three-typed Pokemon, but that is beyond the scope of this tutorial.

    I am a noob at Ruby so can anyone help me how to not break [PBEffects::Type3] ?


    P.S.: I use Essentials v17.2
     
    Last edited:
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    PBEffects::Type3 is basically the battle effect that simulates a "third type" during battle, like when a Pokemon uses Forest's curse to give the opponent the Grass type, or Trick-or-Treat to give the Ghost type. Black Temple Guardian's tutorial is basically having you make that effect permanent instead of lasting only inside battle, which breaks the moves that I mentioned since it can no longer change the Pokemon's third type.

    If you don't care about type-changing moves like that, then it's not really worth your time to try to not break it. It's a really tedious process otherwise. Instead of replacing PBEffects::Type3 with "type3" like the tutorial says, you can create a new type3 variable modeled after the type1 and type2 variables already in the scripts, and rename everywhere you see PBEffects::Type3 with PBEffects::Type4. You also need to edit several other places that the tutorial doesn't go over, like anywhere in the battle scripts where it calculates a "typemod" variable and divides it by 8. You need to have it divide by 16 instead, since your Pokemon can now have up to 4 types during battle.

    Unfortunately, there's no tutorial to show exactly which spots you need to edit. There's a reason why the tutorial you found just replaces PBEffects::Type3 instead. This thread might help you understand why you need to edit more than what you found in the tutorial: https://www.pokecommunity.com/showthread.php?t=350480.
     
    87
    Posts
    4
    Years
  • PBEffects::Type3 is basically the battle effect that simulates a "third type" during battle, like when a Pokemon uses Forest's curse to give the opponent the Grass type, or Trick-or-Treat to give the Ghost type. Black Temple Guardian's tutorial is basically having you make that effect permanent instead of lasting only inside battle, which breaks the moves that I mentioned since it can no longer change the Pokemon's third type.

    If you don't care about type-changing moves like that, then it's not really worth your time to try to not break it. It's a really tedious process otherwise. Instead of replacing PBEffects::Type3 with "type3" like the tutorial says, you can create a new type3 variable modeled after the type1 and type2 variables already in the scripts, and rename everywhere you see PBEffects::Type3 with PBEffects::Type4. You also need to edit several other places that the tutorial doesn't go over, like anywhere in the battle scripts where it calculates a "typemod" variable and divides it by 8. You need to have it divide by 16 instead, since your Pokemon can now have up to 4 types during battle.

    Unfortunately, there's no tutorial to show exactly which spots you need to edit. There's a reason why the tutorial you found just replaces PBEffects::Type3 instead. This thread might help you understand why you need to edit more than what you found in the tutorial: https://www.pokecommunity.com/showthread.php?t=350480.

    I might have another problem, when i open the summary screen it doesn't show thethird type icon but i can't understand why
     
    87
    Posts
    4
    Years
  • Follow step 4 in the link you posted

    I did it correctly but it still doesn't work, here is my code after I followed step 4:

    Code:
        type1rect = Rect.new(0,@pokemon.type1*28,64,28)
        type2rect = Rect.new(0,@pokemon.type2*28,64,28)
        type3rect = Rect.new(0,@pokemon.type3*28,64,28)
          if @[email protected]
          overlay.blt(436,146,@typebitmap.bitmap,type1rect) # If just one, display in middle
        elsif @[email protected]
          overlay.blt(370,146,@typebitmap.bitmap,type1rect) # If just two, display type 1 in middle
          overlay.blt(436,146,@typebitmap.bitmap,type2rect) # And type 2 to the right
        else
          overlay.blt(304,146,@typebitmap.bitmap,type1rect) # Else type 1 on the left
          overlay.blt(370,146,@typebitmap.bitmap,type2rect) # Type 2 in the middle
          overlay.blt(436,146,@typebitmap.bitmap,type3rect) # And type 3 on the right
        end
     
    Back
    Top