Essentials Script Family Tree

Started by FL November 27th, 2014 5:40 AM
  • 21386 views
  • 66 replies

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
#===============================================================================
# * Family Tree - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. It displays a sixth page at pokémon
# summary showing a little info about the pokémon mother, father, grandmothers
# and grandfathers if the pokémon has any.
#
#===============================================================================
#
# To this script works, put it above PSystem_System. Put a 512x384 background
# for this screen in "Graphics/Pictures/Summary/" as "bg_6" and as "bg_6_egg".
# This last one is only necessary if SHOWFAMILYEGG is true. You also need to
# update the below pictures on same folder in order to reflect the summary
# icon change:
# - bg_1
# - bg_2
# - bg_3
# - bg_4
# - bg_movedetail
# - bg_5
#
# -At PField_DayCare, before 'egg.givePokerus if rand(65536)<POKERUS_CHANCE' 
# line add line 'egg.family = PokemonFamily.new(egg, father, mother)'
#
# -At PScreen_Summary, change both lines '@page = 5 if @page>5'
# to '@page=6 if @page>6'
#
# -Before line 'if Input.trigger?(Input::A)' add line 'handleInputsEgg'
#
# -After line 'when 5; drawPageFive' add 'when 6; drawPageSix'
#
# -Change line '_INTL("RIBBONS")][page-1]' into:
#
# _INTL("RIBBONS"),
# _INTL("FAMILY TREE")][page-1]
#
# -Change both lines 
# 'if @party[newindex] && (@page==1 || [email protected][newindex].egg?)' into:
#
# if @party[newindex] && 
#   (@page==1 || [email protected][newindex].egg? || (@page==6 && SHOWFAMILYEGG))
#
# -After both
# 
#  pbChangePokemon
#  @ribbonOffset = 0
#  dorefresh = true
#
# add:
#
#  if SHOWFAMILYEGG && @pokemon.isEgg? && @page==6
#    dorefresh = false
#    drawPageSix
#  else
#    dorefresh = true
#  end
#
#===============================================================================

class PokemonSummary_Scene
  SHOWFAMILYEGG = true # when true, family tree is also showed in egg screen.

  def drawPageSix
    [email protected]["overlay"].bitmap
    base=Color.new(248,248,248)
    shadow=Color.new(104,104,104)
    textpos=[]
    if @pokemon.isEgg?
      overlay.clear
      pbSetSystemFont(overlay)
      @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_6_egg")
      imagepos = []
      ballimage = sprintf(
        "Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
      imagepos.push([ballimage,14,60,0,0,-1,-1])
      pbDrawImagePositions(overlay,imagepos)
      textpos=[
         [_INTL("TRAINER MEMO"),26,16,0,base,shadow],
         [@pokemon.name,46,62,0,base,shadow],
         [_INTL("Item"),62,318,0,base,shadow]
      ]
      if @pokemon.hasItem?
        textpos.push([PBItems.getName(@pokemon.item),16,352,0,
          Color.new(64,64,64), Color.new(176,176,176)])
      else
        textpos.push([_INTL("None"),16,352,0,
          Color.new(184,184,160),Color.new(208,208,200)])
      end
      drawMarkings(overlay,82,292)
    end  
    # Draw parents
    parentsY=[78,234]
    for i in 0...2
      parent = @pokemon.family && @pokemon.family[i] ? @pokemon.family[i] : nil
      iconParentParam = parent ? [parent.species,
          parent.gender==1,false,parent.form,false] : [0,0,false,0,false]
      iconParent=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconParentParam))
      overlay.blt(234,parentsY[i],iconParent.bitmap,Rect.new(0,0,64,64))
      textpos.push([parent ? parent.name : _INTL("???"),
          320,parentsY[i],0,base,shadow])
      parentSpecieName=parent ? PBSpecies.getName(parent.species) : _INTL("???")
      if (parentSpecieName.split('').last=="♂" ||
          parentSpecieName.split('').last=="♀")
        parentSpecieName=parentSpecieName[0..-2]
      end
      textpos.push([parentSpecieName,320,32+parentsY[i],0,base,shadow])
      if parent
        if parent.gender==0
          textpos.push([_INTL("♂"),500,32+parentsY[i],1,
              Color.new(24,112,216),Color.new(136,168,208)])
        elsif parent.gender==1
          textpos.push([_INTL("♀"),500,32+parentsY[i],1,
              Color.new(248,56,32),Color.new(224,152,144)])
        end
      end
      grandX = [380,448]
      for j in 0...2
        iconGrandParam = parent && parent[j] ? [parent[j].species,
            parent[j].gender==1,false,parent[j].form,false] :
            [0,0,false,0,false]
        iconGrand=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconGrandParam))
        overlay.blt(
            grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
      end
    end
    pbDrawTextPositions(overlay,textpos)
  end

  def handleInputsEgg
    if SHOWFAMILYEGG && @pokemon.isEgg?
      Kernel.echoln("@page="[email protected]_s)
      if Input.trigger?(Input::LEFT) && @page==6
        @page=1
        pbPlayCursorSE()
        dorefresh=true
      end
      if Input.trigger?(Input::RIGHT) && @page==1
        @page=6
        pbPlayCursorSE()
        dorefresh=true
      end
    end
    if dorefresh
      case @page
        when 1; drawPageOneEgg
        when 6; drawPageSix
      end
    end
  end
end

class PokemonFamily
  MAXGENERATIONS = 3 # Tree stored generation limit

  attr_reader :mother # PokemonFamily object
  attr_reader :father # PokemonFamily object

  attr_reader :species
  attr_reader :gender
  attr_reader :form
  attr_reader :name # nickname
  # You can add more data here and on initialize class. Just
  # don't store the entire pokémon object.

  def initialize(pokemon, father=nil,mother=nil)
    initializedAsParent = !father || !mother
    if pokemon.family && pokemon.family.father
      @father = pokemon.family.father
    elsif father
      @father = PokemonFamily.new(father)
    end
    if pokemon.family && pokemon.family.mother
      @mother = pokemon.family.mother
    elsif mother
      @mother = PokemonFamily.new(mother)
    end

    # This data is only initialized as a parent in a cub.
    if initializedAsParent
      @species=pokemon.species
      @gender=pokemon.gender
      @name=pokemon.name
      @form=pokemon.form
    end

    applyGenerationLimit(MAXGENERATIONS)
  end

  def applyGenerationLimit(generation)
    if generation>1
      father.applyGenerationLimit(generation-1) if @father
      mother.applyGenerationLimit(generation-1) if @mother
    else
      father=nil
      mother=nil
    end
  end

  def [](value) # [0] = father, [1] = mother
    if value==0
    return @father
    elsif value==1
    return @mother
    end
    return nil
  end
end 

class PokeBattle_Pokemon
  attr_accessor :family
end
Tested on Essentials v18.1. Doesn't works with versions older than v18. If this script isn't working on latest Essentials version, please inform on this thread.

v17.2 script.

kcgcrazy

Male
Canada
Seen May 14th, 2021
Posted January 19th, 2016
119 posts
7.9 Years
PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
#===============================================================================
# * Family Tree - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. It displays a sixth page at pokémon
# summary showing a little info about the pokémon mother, father, grandmothers
# and grandfathers if the pokémon has any.
#
#===============================================================================
#
# To this script works, put it above main, put a 512x384 background for this
# screen in "Graphics/Pictures/summary6" and in "Graphics/Pictures/summaryEgg6".
# This last one is only necessary if SHOWFAMILYEGG is true. You also need to
# update the below pictures in order to reflect the summary icon change:
# - summary1
# - summary2
# - summary3
# - summary4
# - summary4details
# - summary5
#
# -At PokemonDayCare, before line '$Trainer.party[$Trainer.party.length]=egg'
# add line 'PokemonFamily.new(egg, father, mother)'
#
# -At PokemonSummary, change both lines '@page=4 if @page>4'
# to '@page=5 if @page>5'
#
# -Before line 'if Input.trigger?(Input::UP) && @partyindex>0'
# add line 'handleInputsEgg'
#
# -Change line 'if @page!=0' to 'if @page!=0 && !(SHOWFAMILYEGG && @page==5)'
#
# -After line 'drawPageFive(@pokemon)' add
#
# when 5
#   drawPageSix(@pokemon)
#
#===============================================================================

class PokemonSummaryScene
  SHOWFAMILYEGG = true # when true, family tree is also showed in egg screen.
  
  def drawPageSix(pokemon)
    [email protected]["overlay"].bitmap
    overlay.clear
    @sprites["background"].setBitmap(@pokemon.egg? ? 
        "Graphics/Pictures/summaryEgg6" : "Graphics/Pictures/summary6")
    imagepos=[]
    if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
      status=6 if pbPokerus(pokemon)==1
      [email protected] if @pokemon.status>0
      status=5 if pokemon.hp==0
      imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
    end
    if pokemon.isShiny?
      imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
    end
    if pbPokerus(pokemon)==2
      imagepos.push([
          sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
    end
    [email protected] ? @pokemon.ballused : 0
    ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
    imagepos.push([ballimage,14,60,0,0,-1,-1])
    pbDrawImagePositions(overlay,imagepos)
    base=Color.new(248,248,248)
    shadow=Color.new(104,104,104)
    pbSetSystemFont(overlay)
    naturename=PBNatures.getName(pokemon.nature)
    itemname=pokemon.item==0 ? _INTL("None") : PBItems.getName(pokemon.item)
    [email protected]
    if @pokemon.name.split('').last=="♂" || @pokemon.name.split('').last=="♀"
      [email protected][0..-2]
    end
    textpos=[
       [_INTL("FAMILY TREE"),26,16,0,base,shadow],
       [pokename,46,62,0,base,shadow],
       [_INTL("Item"),16,320,0,base,shadow],
       [itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
    ]
    textpos.push([_INTL("{1}",pokemon.level),46,92,0,
           Color.new(64,64,64),Color.new(176,176,176)]) if [email protected]?
    if [email protected]?
      if pokemon.gender==0
        textpos.push([_INTL("♂"),178,62,0,
            Color.new(24,112,216),Color.new(136,168,208)])
      elsif pokemon.gender==1
        textpos.push([_INTL("♀"),178,62,0,
            Color.new(248,56,32),Color.new(224,152,144)])
      end
    end    
    base=Color.new(248,248,248)
    shadow=Color.new(104,104,104)
    # Draw parents
    parentsY=[78,234]
    for i in 0...2
      parent = @pokemon.family && @pokemon.family[i] ? @pokemon.family[i] : nil
      iconParentParam = parent ? [parent.species,
          parent.gender==1,false,parent.form,false] : [0,0,false,0,false]
      iconParent=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconParentParam))
      overlay.blt(234,parentsY[i],iconParent.bitmap,Rect.new(0,0,64,64))
      textpos.push([parent ? parent.name : _INTL("???"),
          320,parentsY[i],0,base,shadow])
      parentSpecieName=parent ? PBSpecies.getName(parent.species) : _INTL("???")
      if (parentSpecieName.split('').last=="♂" ||
          parentSpecieName.split('').last=="♀")
        parentSpecieName=parentSpecieName[0..-2]
      end
      textpos.push([parentSpecieName,320,32+parentsY[i],0,base,shadow])
      if parent
        if parent.gender==0
          textpos.push([_INTL("♂"),500,32+parentsY[i],1,
              Color.new(24,112,216),Color.new(136,168,208)])
        elsif parent.gender==1
          textpos.push([_INTL("♀"),500,32+parentsY[i],1,
              Color.new(248,56,32),Color.new(224,152,144)])
        end
      end    
      grandX = [380,448]
      for j in 0...2
        iconGrandParam = parent && parent[j] ? [parent[j].species,
            parent[j].gender==1,false,parent[j].form,false] : 
            [0,0,false,0,false]
        iconGrand=AnimatedBitmap.new(pbCheckPokemonIconFiles(iconGrandParam))
        overlay.blt(
            grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
      end
    end
    pbDrawTextPositions(overlay,textpos)
    drawMarkings(overlay,15,291,72,20,pokemon.markings)
  end
  
  def handleInputsEgg
    if SHOWFAMILYEGG && @pokemon.egg?
      if Input.trigger?(Input::LEFT) && @page==5
        @page=0 
        pbPlayCursorSE()
        dorefresh=true
      end
      if Input.trigger?(Input::RIGHT) && @page==0
        @page=5 
        pbPlayCursorSE()
        dorefresh=true
      end
    end
    if dorefresh
      case @page
        when 0
          drawPageOne(@pokemon)
        when 5
          drawPageSix(@pokemon)
      end
    end
  end
end


class PokemonFamily
  MAXGENERATIONS = 3 # Tree stored generation limit
  
  attr_reader :mother # PokemonFamily object
  attr_reader :father # PokemonFamily object
  
  attr_reader :species
  attr_reader :gender
  attr_reader :form
  attr_reader :name # nickname
  # You can add more data here and on initialize class. Just 
  # don't store the entire pokémon object.
  
  def initialize(pokemon, father=nil,mother=nil)
    initializedAsParent = !father || !mother
    if pokemon.family && pokemon.family.father
      @father = pokemon.family.father
    elsif father 
      @father = PokemonFamily.new(father)
    end
    if pokemon.family && pokemon.family.mother
      @mother = pokemon.family.mother
    elsif mother
      @mother = PokemonFamily.new(mother)
    end
    
    # This data is only initialized as a parent in a cub.
    if initializedAsParent 
      @species=pokemon.species
      @gender=pokemon.gender
      @name=pokemon.name
      @form=pokemon.form
    end
    
    applyGenerationLimit(MAXGENERATIONS)
  end
  
  def applyGenerationLimit(generation)
    if generation>1
      father.applyGenerationLimit(generation-1) if @father
      mother.applyGenerationLimit(generation-1) if @mother
    else
      father=nil
      mother=nil
    end  
  end 
  
  def [](value) # [0] = father, [1] = mother
    if value==0
     return @father
    elsif value==1
     return @mother
    end
    return nil
  end
end  
  
class PokeBattle_Pokemon
  attr_accessor :family
end
very cool script. I just had to change a few things so this would work with the IV/EV screen.

kcgcrazy

Male
Canada
Seen May 14th, 2021
Posted January 19th, 2016
119 posts
7.9 Years
Looks like I failed implementing the script. I copied all by Show Printable Version and implemented the textblocks at the different sections in essentials. But even if I get an Egg (which should have parents :) )there are only question marks instead of pictures and infos about parents.
this happens to me as well

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
Looks like I failed implementing the script. I copied all by Show Printable Version and implemented the textblocks at the different sections in essentials. But even if I get an Egg (which should have parents :) )there are only question marks instead of pictures and infos about parents.
Sorry, my mistake. It's 'egg.family = PokemonFamily.new(egg, father, mother)' instead of 'PokemonFamily.new(egg, father, mother)'. I updated the thread.

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
i get this here:

http: //i.gyazo.com/5d90b4df88f4f1933d3e249ae0e212b8.png

what i have done wrong? :(
This script won't displays the family of pokémon that hatched before this script was added. Make a test: Put two compatibles pokémon at Day Care, generate an egg (I suggest using debug options) and check the egg family.

~Angel~

Lead developer for Pokémon Millennium

Age 23
Male
United States Of America.
Seen June 22nd, 2018
Posted August 20th, 2017
281 posts
11.6 Years
I just thought I'd tell you FL, since this is yours after all that I'm gonna use this as well, I came up with a small additional mock-up/creation of what it'll look like, probably don't have it correct right now, but it'll be modified. Anyway, I reused some of the old information provided to make this mock-up, it can be located here: http://fohlenetech.deviantart.com/art/Pokemon-Millennium-Egg-Summary-Family-Tree-499988323?ga_submit_new=10%253A1418483169
Keep up the good work!
Male
Omnipresence
Seen June 12th, 2021
Posted March 19th, 2021
1,224 posts
7.6 Years
It doesn't work, there are a lot of "Syntax Error", how to fix it? (v14)
You could try reading the post :)

PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
It gives me error on handleInputsEgg. What did I do wrong?
Edit: Ok I fixed it and now I feel stupid. You just need to add the symbol @ for it to work (@handleInputsEgg). ������
What? @handleInputsEgg doesn't make sense.

kcgcrazy

Male
Canada
Seen May 14th, 2021
Posted January 19th, 2016
119 posts
7.9 Years
Excuse me lord FL, I have very little coding knowledge and I pretty much messed up my entire RMXP project trying to make this work. I have managed to actually start my game without error message and access the family tree panel but there are only??? pokemons and also when I press up/down button to move between my Pokemon, it gives me an error and then shuts down.
first, before making script changes always make a backup of your game in case you mess things up, second the ??? is probably because you have not started a new game or did something wrong, try starting a new game and then use the daycare, and third when getting errors copy and paste them so people can see the error, theres nothing someone can do to help if they cant see the error.

kcgcrazy

Male
Canada
Seen May 14th, 2021
Posted January 19th, 2016
119 posts
7.9 Years
Ok thanks for the advice kcgcrazy, from now on I will be always making a backup file. Also I kinda figured a couple of things and now I finally got it to work. I guess every experiment is meant to fail at first until it actually comes to life :p ALL HAIL FL
trial and error, trial and error

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
Excuse me lord FL, I have very little coding knowledge and I pretty much messed up my entire RMXP project trying to make this work. I have managed to actually start my game without error message and access the family tree panel but there are only??? pokemons and also when I press up/down button to move between my Pokemon, it gives me an error and then shuts down.
I my opinion this isn't necessary, since all steps are described here, you can just reverse all steps for fixing the possible problem.

And the new game isn't necessary, but this script only affects new eggs generated on Day Care.
Male
Seen 1 Hour Ago
Posted 21 Hours Ago
801 posts
7.5 Years
Man, I really love this script, thanks a lot! I've been tinkering with it and made some graphics to go with my Summary page layouts, and I really like the results. I still have to tweak them, but it's coming along.

However, I do have a couple of questions in case you have any quick ideas for some solutions.

1) Is it possible for this to display the icons for shiny Pokemon, if any of the parents/grandparents were shiny? I tested it, and it just shows the regular icon even if I made one of them shiny prior to breeding. It's just a small detail, but I would love it if there was a way to implement that. Other forms still display (Such as Rotom's forms), so I was wondering if this would be a simple thing to add.

2) When breeding with Ditto, is there some way to make it so Ditto always takes the 'role' of the gender opposite it's partner (in terms of how it's displayed on the page)? I ask this because of my attached screenshot.

You'll notice that Gardevoir's grandfather on her father's side is a Jellicent (named Majellyn here). It's a male Jellicent. However, since I bred it with a Ditto, the Ditto by default assumes the 'role' of the male (I assume?), and thus the male Jellicent now displays as a female Jellicent; despite sitting in the slot designated for the male parent. Or something like that. It's just an odd visual quirk that is slightly annoying given my layout, and if there is an easy way to resolve this, that would be great (though something tells me it's more trouble than its worth).

3) This question isn't really specific to this script, but I was wondering if there was a way to resize certain icon sprites on the page? I just want to shrink the grandparent's sprites down so they're smaller than the parent's sprites. I assume i have to use zoom=0.5 or something like that, I'm just not sure how to implement it.

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
Man, I really love this script, thanks a lot! I've been tinkering with it and made some graphics to go with my Summary page layouts, and I really like the results. I still have to tweak them, but it's coming along.

However, I do have a couple of questions in case you have any quick ideas for some solutions.

1) Is it possible for this to display the icons for shiny Pokemon, if any of the parents/grandparents were shiny? I tested it, and it just shows the regular icon even if I made one of them shiny prior to breeding. It's just a small detail, but I would love it if there was a way to implement that. Other forms still display (Such as Rotom's forms), so I was wondering if this would be a simple thing to add.

2) When breeding with Ditto, is there some way to make it so Ditto always takes the 'role' of the gender opposite it's partner (in terms of how it's displayed on the page)? I ask this because of my attached screenshot.

You'll notice that Gardevoir's grandfather on her father's side is a Jellicent (named Majellyn here). It's a male Jellicent. However, since I bred it with a Ditto, the Ditto by default assumes the 'role' of the male (I assume?), and thus the male Jellicent now displays as a female Jellicent; despite sitting in the slot designated for the male parent. Or something like that. It's just an odd visual quirk that is slightly annoying given my layout, and if there is an easy way to resolve this, that would be great (though something tells me it's more trouble than its worth).

3) This question isn't really specific to this script, but I was wondering if there was a way to resize certain icon sprites on the page? I just want to shrink the grandparent's sprites down so they're smaller than the parent's sprites. I assume i have to use zoom=0.5 or something like that, I'm just not sure how to implement it.
1. Yes! After line 'attr_reader :form' add 'attr_reader :shiny'. After line '@form=pokemon.form' add '@shiny=pokemon.isShiny?'. Change

	iconParentParam = parent ? [parent.species,
          parent.gender==1,false,parent.form,false] : [0,0,false,0,false]'
Into
	iconParentParam = parent ? [parent.species,
          parent.gender==1,parent.shiny,parent.form,false] : [0,0,false,0,false]'
Change

        iconGrandParam = parent && parent[j] ? [parent[j].species,
            parent[j].gender==1,false,parent[j].form,false] : 
            [0,0,false,0,false]
Into

        iconGrandParam = parent && parent[j] ? [parent[j].species,
            parent[j].gender==1,parent.shiny,parent[j].form,false] : 
            [0,0,false,0,false]
2. Before line 'applyGenerationLimit(MAXGENERATIONS)' add

 
    # switch the parent position in Ditto case.
    if @mother && @mother.gender==0 # male
      temporary = @mother
      @mother = @father
      @father = temporary
    end
    if @father && @father.gender==1 # female
      temporary = @mother
      @mother = @father
      @father = temporary
    end
3. The sprite class has the variables zoom_x and zoom_y, so you only need to make it as zoom_x=0.5 and you have a half zoom. However, the icons are drawed by an AnimatedBitmap class that consist of several BitmapWrapper, a class that extends from Bitmap, so none have the zoom property. But we can use stretch_blt when copying the bitmap. Change:

         overlay.blt(
            grandX[j],68+parentsY[i],iconGrand.bitmap,Rect.new(0,0,64,64))
Into

 
        overlay.stretch_blt(Rect.new(grandX[j],68+parentsY[i],32,32),
           iconGrand.bitmap,Rect.new(0,0,64,64))
i have this error :S , i cant run my game
Spoiler:


and if i erase this line
Spoiler:



i have this error when i wan to see the family tree
Spoiler:


you can help me TT_TT please
PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
Male
Seen 1 Hour Ago
Posted 21 Hours Ago
801 posts
7.5 Years
Nice! Thanks a lot, everything works exactly how I want now! It's really starting to come together.

One last thing though, if you don't mind...

I'm thinking it would be cool if you could display the Pokemon's Egg Groups on this page, since it's relevant information to go along with this. I've been trying to figure out how to implement this (I made a thread asking for help in the Essentials forum, but I'm not expecting a response anytime soon).

By working off existing scripts that I've found, this is what I've come up with so far:

 dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@pokemon,31)
    compat10=dexdata.fgetb
    compat11=dexdata.fgetb
    eggGroupArray=[
        nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
        _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
        _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
        _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
    ]
    eggGroups = compat10==compat11 ? eggGroupArray[compat10] : 
        _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
    textpos=[
       [_INTL("Group: {1}",eggGroups),200,354,0,base,shadow],
    ]
   dexdata.close
But I'm not sure how to implement it, or if I'm even on the right track. I'd appreciate it if you could point me in the right direction!

The attached screenshot is just to show where I'm thinking I could display the information (also showing off all your fixes!)

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 6 Days Ago
1,971 posts
11.1 Years
Nice! Thanks a lot, everything works exactly how I want now! It's really starting to come together.

One last thing though, if you don't mind...

I'm thinking it would be cool if you could display the Pokemon's Egg Groups on this page, since it's relevant information to go along with this. I've been trying to figure out how to implement this (I made a thread asking for help in the Essentials forum, but I'm not expecting a response anytime soon).

By working off existing scripts that I've found, this is what I've come up with so far:

 dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@pokemon,31)
    compat10=dexdata.fgetb
    compat11=dexdata.fgetb
    eggGroupArray=[
        nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
        _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
        _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
        _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
    ]
    eggGroups = compat10==compat11 ? eggGroupArray[compat10] : 
        _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
    textpos=[
       [_INTL("Group: {1}",eggGroups),200,354,0,base,shadow],
    ]
   dexdata.close
But I'm not sure how to implement it, or if I'm even on the right track. I'd appreciate it if you could point me in the right direction!

The attached screenshot is just to show where I'm thinking I could display the information (also showing off all your fixes!)
I guess that you biggest problem is that pbDexDataOffset second paramether must be the Pokémon index number (species) and you are passing a PokeBattle_Pokemon instance.

Add this def on your script.

  def getEggGroupString(species)
  dexdata=pbOpenDexData
  pbDexDataOffset(dexdata,species,31)
  compat10=dexdata.fgetb
  compat11=dexdata.fgetb
  eggGroupArray=[
      nil,_INTL("Monster"),_INTL("Water1"),_INTL("Bug"),_INTL("Flying"),
      _INTL("Ground"),_INTL("Fairy"),_INTL("Plant"),_INTL("Humanshape"),
      _INTL("Water3"),_INTL("Mineral"),_INTL("Indeterminate"),
      _INTL("Water2"),_INTL("Ditto"),_INTL("Dragon"),_INTL("No Eggs")
  ]
  ret = compat10==compat11 ? eggGroupArray[compat10] : 
      _INTL("{1}, {2}",eggGroupArray[compat10],eggGroupArray[compat11])
  dexdata.close
  return ret
end
So, if you call 'getEggGroupString(parent[j].species)' (on the right spot where 'parent' and 'j' exist, of course), this will return you the Egg Group formatted.