Do you mean check what pokemon is in the first position of the party, or check the species before adding it to the array? How are you "showing" the player the pokemon? If the pokemon already exists in the party, you can use pbChoosPokemon to store the species in a variable, as well as the name(if I'm remembering right). You may want to make an identical method that sets the species to whatever you're "showing" the player instead of the pokemon in the party. I'm not entirely sure if that's what you were needing, but I hope that helps.It's easy to check the party for a specific species, but I can't seem to work out how to sort of...reverse that, so it can work out what species of pokemon is first in the character's party. am I missing something super obvious?
Do you mean check what pokemon is in the first position of the party, or check the species before adding it to the array? How are you "showing" the player the pokemon? If the pokemon already exists in the party, you can use pbChoosPokemon to store the species in a variable, as well as the name(if I'm remembering right). You may want to make an identical method that sets the species to whatever you're "showing" the player instead of the pokemon in the party. I'm not entirely sure if that's what you were needing, but I hope that helps.
$pokemonshown = []
def pbshowpokemon
y = $Trainer.party[0].species
z = $pokemonshown.length
i = 0
while i <= z do
if y = $pokemonshown[i]
Kernel.pbMessage(_INTL("You've already shown me this pokemon..."))
break
else
if i = z
$pokemonshown << $Trainer.party[0].species
$game_variables[61] += 1
if $game_variables[61] = 1 or 2
Kernel.pbMessage(_INTL("What a cool pokemon! Do you have any more you can show me?"))
break
end
else
i += 1
end
end
end
end
I think I see your problem now. The highlighted lines should use "==" instead of "=" since the single "=" is actually assigning the value (so it would always return true), while "==" checks whether or not things are equal. It gets me from time to time too, just like those "end" clauses at the end of a script.Code:$pokemonshown = [] def pbshowpokemon y = $Trainer.party[0].species z = $pokemonshown.length i = 0 while i <= z do [COLOR=DeepSkyBlue]if y = $pokemonshown[i][/COLOR] Kernel.pbMessage(_INTL("You've already shown me this pokemon...")) break else [COLOR=DeepSkyBlue] if i = z[/COLOR] $pokemonshown << $Trainer.party[0].species $game_variables[61] += 1 [COLOR=DeepSkyBlue] if $game_variables[61] = 1 or 2[/COLOR] Kernel.pbMessage(_INTL("What a cool pokemon! Do you have any more you can show me?")) break end else i += 1 end end end end
I think I see your problem now. The highlighted lines should use "==" instead of "=" since the single "=" is actually assigning the value (so it would always return true), while "==" checks whether or not things are equal. It gets me from time to time too, just like those "end" clauses at the end of a script.
@tasmania12: using townmapgen.html was difficult for me when I did it since it's not as clear as it could be. You may just have a field that's improperly set up (it happened to me a few times before I got the hang of it). Just look and see if you can find a problem with how it's configured (and follow the notes or wiki closely) and correct it.
That's odd, since I just tried it and the second pokemon didn't cause an error. Maybe there was a typo or something? Here's the exact code I used, so copy/past and see if it works:that always gets me! ugh I even remember thinking about that at one stage, I was all "hmm, should that perhaps have two =s? nahhhh". sigh.
unfortunately, it's still not really working. but I think it's getting closer! what it's doing now is actually throwing an error message at me when I show the character a second pokemon.
That's odd, since I just tried it and the second pokemon didn't cause an error. Maybe there was a typo or something? Here's the exact code I used, so copy/past and see if it works:
Spoiler:$pokemonshown = []
def pbshowpokemon
y = $Trainer.party[0].species
z = $pokemonshown.length
i = 0
while i <= z do
if y == $pokemonshown
Kernel.pbMessage(_INTL("You've already shown me this pokemon..."))
break
else
if i == z
$pokemonshown << $Trainer.party[0].species
$game_variables[61] += 1
if $game_variables[61] == 1 or 2
Kernel.pbMessage(_INTL("What a cool pokemon! Do you have any more you can show me?"))
break
end
else
i += 1
end
end
end
end
I had this problem too, but have just managed to fix it.
In the PokemonEncounters script, you need to replace the lines defining encounters (from line 83) with this:
Code:def pbEncounterType if $PokemonGlobal && $PokemonGlobal.surfing return EncounterTypes::Water elsif self.isCave? return EncounterTypes::Cave elsif self.isGrass? if (Time.now.hour<6||Time.now.hour>=20) return EncounterTypes::LandNight elsif (Time.now.hour>6||Time.now.hour<=12) return EncounterTypes::LandDay elsif (Time.now.hour>12||Time.now.hour<=20) return EncounterTypes::LandMorning elsif pbInBugContest? if self.hasEncounter?(EncounterTypes::BugContest) enctype=EncounterTypes::BugContest end end
It should be fairly straightforward to see where it goes.
def pbStartLoadScreen
$PokemonTemp=PokemonTemp.new
$game_temp = Game_Temp.new
$game_system=Game_System.new
$PokemonSystem=PokemonSystem.new if !$PokemonSystem
@scene.pbStartScene
cmdContinue=-1
cmdNewGame=-1
cmdOption=-1
cmdLanguage=-1
commands=[]
savefile=getSaveFileName("Game.rxdata") <--this is the line 262)
FontInstaller.install
data_system = pbLoadRxData("Data/System")
mapfile=$RPGVX ? sprintf("Data/Map%03d.rvdata",data_system.start_map_id) :
sprintf("Data/Map%03d.rxdata",data_system.start_map_id)
if data_system.start_map_id==0 || !pbRgssExists?(mapfile)
Kernel.pbMessage(_INTL("No starting position was set in the map editor.\1"))
Kernel.pbMessage(_INTL("The game cannot continue."))
@scene.pbEndScene
$scene=nil
return
end
@tasmania12: you could edit the txt file directly, but you'd have to follow the format closely. I just tried the townmapgen.html and the little white square showed up fine. Is the problem getting the square to even appear, or is the problem inputting the information into the boxes?
Okay, does anyone know how to add a new pokemon into Essentials?
Message: Undefined species constant name: [CHARMANDER]
Maybe it's a problem with your browser? Wherever you click, the tiny white square should appear. If it's not your browser, maybe you could try getting a new townmapgen.html (but I don't see how that would fix it).My problem is getting the little white square to come up. It won't come up and it wont auto fill the map position.