• 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] Re-Visiting The Addition of the Triple-Type

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
The thread started by Black Temple Guardian really piqued my interest; all along I've wanted to see Pokemon with triple-typings, but never been able to implement it myself.

And still I haven't been able to.

But after seeing that thread (and also for the more obvious fact of avoiding necro-ing an almost-two-month-old thread), it made me want to implement the triple-type. But, the information isn't all there; I've tried doing everything that was suggested, but I kept getting a weird compiler editor that says the following;

Code:
Exception: NameError
Message: uninitialized constant PBColors
Compiler:1680:in `pbCompilePokemonData'
Compiler:4098:in `pbCompileAllData'
EditorMain #####:275:in `pbEditorMenu'
EditorMain #####:85:in `loop'
EditorMain #####:279:in `pbEditorMenu'
EditorMain #####:285
EditorMain #####:285:in `pbCriticalCode'
EditorMain #####:285

I don't think PBColors has anything to do with this; maybe does it have to do with the compiling of the data itself? I've honestly hit a road-block and don't know where else to turn. However, I would like to re-ignite this discussion and join in on this; my own personal project, I would like my Pokemon to have triple-types, among many other things.

Any help would be appreciated!

Original thread, started by Black Temple Guardian:
https://www.pokecommunity.com/showthread.php?t=379877
 

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
I don't know if this information can be helpful but every time I met that error it was because I had (or hadn't) made modifications to the editor scripts following this guide: http://reliccastle.com/forums/showthread.php?tid=254 . You may try making the same fixes to the editor scripts as well. Just remember to keep a backup.

Literally just as I figured it out I went back to see my thread and saw you posted a response. Thanks!

Now the problem is actually getting the Type3 field to appear in my Editor. I don't know what else I can do to make it appear, other than potentially changing EditorScripts to Scripts in order to edit fields (if THAT's even possible).
 

Telemetius

Tele*
267
Posts
9
Years
Literally just as I figured it out I went back to see my thread and saw you posted a response. Thanks!

Now the problem is actually getting the Type3 field to appear in my Editor. I don't know what else I can do to make it appear, other than potentially changing EditorScripts to Scripts in order to edit fields (if THAT's even possible).

It's possible to edit the fields of editorscripts.rxdata and I found that it shares a nearly identical structure to Scripts.rxdata. I don't know if that's all it takes to implement a third type but you can start from it. Maybe someone else with an in-depth knowledge of it can answer.
 

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
It's possible to edit the fields of editorscripts.rxdata and I found that it shares a nearly identical structure to Scripts.rxdata. I don't know if that's all it takes to implement a third type but you can start from it. Maybe someone else with an in-depth knowledge of it can answer.

It is, and I have. It is in the editor, and as far as I know, it works.

Black Temple Guardian, I've fixed a problem with the game drawing a Normal icon. This is what you need to do...
In PokeBattle_Pokemon, you need to find "def type2" and directly below it, insert this script:

Code:
# Returns this pokemon's third type.
  def type3
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@species,10)
    ret=dexdata.fgetb
    dexdata.close
    return ret
  end

(I assume you've done this already)
Next, go to PScreen_Summary and search for "type2rect", then directly below it insert this:

Code:
type3rect=Rect.new(0,pokemon.type3*28,64,28)
This draws a third type picture from the bitmap called "typebitmap.bmp".

Next is reorganization of all three type icons. Underneath the type3rect you just wrote, insert this:

Code:
if pokemon.type1==pokemon.type2
      overlay.blt(370,146,@typebitmap.bitmap,type1rect)
    else
      [COLOR="Red"]overlay.blt(304,146,@typebitmap.bitmap,type1rect)[/COLOR]
      overlay.blt(370,146,@typebitmap.bitmap,type2rect)
    end
    if pokemon.type3==pokemon.type2
      overlay.blt(436,146,@typebitmap.bitmap,type1rect)
    else
      overlay.blt(370,146,@typebitmap.bitmap,type2rect)
      [COLOR="Red"]overlay.blt(436,146,@typebitmap.bitmap,type3rect)[/COLOR]
    end

If you want the three types to look nice, you'll have to use an image editing software to change the look of this summary page to fit the three icons. The image is called "summary1.png", under "Pictures" in the Graphics folder.

Case in point, I implemented this and added the Fire-type to White Kyurem, and fused it.

Lo and behold!
https://drive.google.com/open?id=0B7naGiszoz_rZTdBVjBXMjl1OWs

A little cleaning up here and there, but everything functions. Tertiary typings are now a thing.

If you would like me to write up a thread tutorial on tertiary typings, I can and gladly will. This was fun!
 
824
Posts
8
Years
My game has had a triple type for a while now, but it's been exclusive to Delta Pokemon. So I've never had to edit the compiler scripts - at least not for that particular function of mine.

In order to make it work, be sure that you edit the type effectiveness code to use 16 as the base instead of 8. Otherwise, a triple-typed Pokemon with three types that all resist a move will be counted as an immunity to that type of move.
 

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
My game has had a triple type for a while now, but it's been exclusive to Delta Pokemon. So I've never had to edit the compiler scripts - at least not for that particular function of mine.

In order to make it work, be sure that you edit the type effectiveness code to use 16 as the base instead of 8. Otherwise, a triple-typed Pokemon with three types that all resist a move will be counted as an immunity to that type of move.

Yeah, I'm trying to work out all the kinks; normally-effective moves are now super-effective because of the addition of the third type, and I'm still trying to figure it out.

EDIT: Also, it might've been something I did, but testing this on Black Kyurem causes Outrage to completely break. Haven't tried it out with other Dragon-type moves yet, but I will soon.
 
Last edited:
220
Posts
13
Years
  • Seen Nov 29, 2021
My game has had a triple type for a while now, but it's been exclusive to Delta Pokemon. So I've never had to edit the compiler scripts - at least not for that particular function of mine.

In order to make it work, be sure that you edit the type effectiveness code to use 16 as the base instead of 8. Otherwise, a triple-typed Pokemon with three types that all resist a move will be counted as an immunity to that type of move.

Massive bump (mainly because this thread is useful), but I just wanted to point out that this should only happen if you've a pokemon with three types that is then granted an addition type by the [Type3] effect.
 
220
Posts
13
Years
  • Seen Nov 29, 2021
It is, and I have. It is in the editor, and as far as I know, it works.

Black Temple Guardian, I've fixed a problem with the game drawing a Normal icon. This is what you need to do...
In PokeBattle_Pokemon, you need to find "def type2" and directly below it, insert this script:

Code:
# Returns this pokemon's third type.
  def type3
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@species,10)
    ret=dexdata.fgetb
    dexdata.close
    return ret
  end

(I assume you've done this already)

[...]

If you would like me to write up a thread tutorial on tertiary typings, I can and gladly will. This was fun!
Just a minor point:
In the above "pbDexDataOffset(dexdata,@species,10)" should be some number other than 10 as that's already taken.
Other than that, that would be very helpful for people. People that totally aren't me. Honest.
>_>
<_<

Also my problem appears to not be false displaying, but it actually adding the normal type. Fighting moves against a venusaur, for example, register as normal effectiveness. Which they shouldn't.

EDIT: I have solved the problem I was having! It was with the compiler code I was back then blindly copying. It was wrong.
Instead it should be this:
Code:
        if !lastsection["Type3"] || lastsection["Type3"]==""
          if !lastsection["Type2"] || lastsection["Type2"]==""
            if !lastsection["Type1"] || lastsection["Type1"]==""
              raise _INTL("No Pokémon type is defined in section {2} (PBS/pokemon.txt)",key,sectionDisplay) if hash==requiredtypes
              next
            end
            lastsection["Type2"]=lastsection["Type1"].clone
        end
          lastsection["Type3"]=lastsection["Type2"].clone
        end

It's amazing what a break and some experience can do.

EDIT 2: Your summary code also doesn't work right; with just two types it still shows the third type. This should address that:
Code:
    if pokemon.type1==pokemon.type2
      overlay.blt(370,146,@typebitmap.bitmap,type1rect) # If just one, display in middle
    elsif pokemon.type2==pokemon.type3
      overlay.blt(304,146,@typebitmap.bitmap,type1rect) # If just two, display type 1 in middle
      overlay.blt(370,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
 
Last edited:
Back
Top