v19 Showing icon based on form

This thread pertains to v19 of Pokémon Essentials.

Desbrina

Rookie
Member
Joined
May 3, 2021
Posts
7
Age
32
I'm trying to do a script that shows the Pokémon available on map. I have it loading the data in and showing correctly for the majority, but struggling to work out how to do forms.

The code I have currently. The print gives me :RATTATA_1

Ruby:
species=havespecies[i]
          p species
          # Show Pokémon icon
          @sprites["icon#{i}"]=PokemonSpeciesIconSprite.new(species,@viewport)
          @sprites["icon#{i}"].x=24+100*(i%ICONSPERROW)
          @sprites["icon#{i}"].y=80+100*(i/ICONSPERROW).floor

          if $Trainer.owned?(species)
            @sprites["caught#{i}"].setBitmap("Graphics/Pictures/Custom/mapencounters-caught")
            seen+=1; caught+=1
          elsif $Trainer.seen?(species)
            @sprites["caught#{i}"].setBitmap("Graphics/Pictures/Custom/mapencounters-notcaught")
            seen+=1
          else
            @sprites["caught#{i}"].setBitmap("Graphics/Pictures/Custom/mapencounters-notcaught")
            @sprites["icon#{i}"].tone=Tone.new(-255,-255,-255) # Blacked out
          end

I only have the standard Rattata registered in the Pokédex, not the Alolan, which is form 1, but as you can see from the attachment, Rattata is in there twice, though with no icon and shows as seen when the form isn't.
 

Attachments

  • Screenshot 2021-05-03 at 18.53.18.png
    Screenshot 2021-05-03 at 18.53.18.png
    156.4 KB · Views: 16

Desbrina

Rookie
Member
Joined
May 3, 2021
Posts
7
Age
32
It did, the params bit sorted it. Just need to go back and do some testing on an unmodified version as I’m seeing strange behaviour with forms
 
Top