I messed up but I'll give you my conclusion by comparing with my own regional Pokédexes.
If you observe the errorlog_kanto, you will see this at the end of the file:
Code:
[ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10 ; 11 ; 12 ; 13 ; 14 ; 0 ; 16 ; 17 ; 18 ; 19 ; 20 ; 21 ; 22 ; 23 ; 24 ; 25 ; 26 ; 27 ; 28 ; 29 ; 30 ; 31 ; 32 ; 33 ; 34 ; 35 ; 36 ; 37 ; 38 ; 39 ; 40 ; 41 ; 42 ; 43 ; 44 ; 45 ; 46 ; 47 ; 48 ; 49 ; 50 ; 51 ; 52 ; 53 ; 54 ; 55 ; 56 ; 57 ; 58 ; 59 ; 60 ; 61 ; 62 ; 63 ; 64 ; 65 ; 66 ; 67 ; 68 ; 69 ; 70 ; 71 ; 72 ; 73 ; 74 ; 75 ; 76 ; 77 ; 78 ; 79 ; 80 ; 81 ; 82 ; 83 ; 84 ; 85 ; 86 ; 87 ; 88 ; 89 ; 90 ; 91 ; 92 ; 93 ; 94 ; 95 ; 96 ; 97 ; 98 ; 99 ; 100 ; 101 ; 102 ; 103 ; 104 ; 105 ; 106 ; 107 ; 108 ; 109 ; 110 ; 111 ; 112 ; 113 ; 114 ; 115 ; 116 ; 117 ; 118 ; 119 ; 120 ; 121 ; 122 ; 123 ; 124 ; 125 ; 126 ; 127 ; 128 ; 129 ; 130 ; 131 ; 132 ; 133 ; 134 ; 135 ; 136 ; 137 ; 138 ; 139 ; 140 ; 141 ; 142 ; 143 ; 144 ; 145 ; 146 ; 147 ; 148 ; 149 ; 150 ; 151 ; 152 ; 153 ; 154 ; 155 ; 156 ; 157 ; 158 ; 159 ; 160 ; 161 ; 162 ; 163 ; 164 ; 165 ; 166 ; 167 ; 168 ; 169 ; 170 ; 171 ; 172 ; 173 ; 174 ; 175 ; 176 ; 177 ; 178 ; 179 ; 180 ; 181 ; 182 ; 183 ; 184 ; 185 ; 186 ; 187 ; 188 ; 189 ; 190 ; 191 ;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 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 899 ; 0 ; 901 ; 902 ; 903 ]
I assume that you added the last Pokémons? Maybe #899 or #901-#903.
All the 0's you see are not normal. To understand what's happening, let's check how you edit the reigonal dex.
Let's see the function
def pbRegionalDexEditorMain
that you use to add a Pokémon.
Check the following lines:
Code:
else # Cancel
cmd2 = pbMessage(_INTL("Save changes?"),
[_INTL("Yes"),_INTL("No"),_INTL("Cancel")],3)
if cmd2==0
# Save new dexes here
tosave = []
for i in 0...regionallist.length
tosave[i] = []
for j in 0...regionallist[i].length
tosave[i][regionallist[i][j]] = j if regionallist[i][j]
end
end
save_data(tosave,"Data/regional_dexes.dat")
$PokemonTemp.regionalDexes = nil
pbSavePokemonData
pbMessage(_INTL("Data saved."))
break
elsif cmd2==1
break
end
end
In this code, "tosave" is supposed to be the content of the regional Pokédex. It takes the form of an array:
Code:
tosave[ <regional Pokédex index> ][ <Pokémon number in the national dex> ] = <Pokémon number in the regional dex> if the associated Pokémon is in this regional Pokédex.
However, as not all Pokémons are in a given regional Pokédex, this fills the array with empty places. For example, if Pokémon #252 is not in this regional Pokédex, then
Code:
tosave[ <regional Pokédex index >][ 252 ]
will be empty.
BUT, the array "knows" that it must have a certain length. So, the array will have empty slots.
Now observe the following code, that "loads" the data contained in "tosave":
Code:
def pbAllRegionalSpecies(region)
ret = [0]
return ret if region<0
dexList = pbLoadRegionalDexes[region]
return ret if !dexList || dexList.length==0
for i in 0...dexList.length
ret[dexList[i]] = i if dexList[i] && dexList[i] > 0
end
ret.map! { |e| e ? e : 0 } # Replace nils with 0s
return ret
end
For some reason, the function adds many 0's to the result. Why does this happen to you and not to me? If you read the code just above, you'll see:
Code:
for i in 0...dexList.length
ret[dexList[i]] = i if dexList[i] && dexList[i] > 0
end
This is meant to remove the empty slots of the "tosave" variable from above, and return just a list of the national indices of the Pokémons, in the order that they appear in the regional Pokédex (it kinda "inverts" the array "tosave"). And then, after this loop, you see this line:
Code:
ret.map! { |e| e ? e : 0 } # Replace nils with 0s
This replaces the empty slots by 0's.
Now, why do you have empty slots? Because the regional numbers of your Pokémons are not contiguous. You have a jump from from 14 to 16, then from 251 to 899, and from 899 to 901. Can you check this?