• 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.

[Question] How do I give a Pokemon only 1-3 moves without an error?

68
Posts
5
Years
  • Age 44
  • Seen Sep 19, 2023
So, in the trainers.txt file, I'm making a Brock trainer. Obviously, he's weaker compared to other gym leaders. And also, his Pokemon can only really learn like two moves up to that point, so I'm only giving it those two moves. However, when I do it, running the game gives me an error? How do I simply give it under four moves without getting an error? Do I have to put some kind of value in for no move?

Like this:
Spoiler:

Where the commas are is where it is giving me the error.
 
68
Posts
5
Years
  • Age 44
  • Seen Sep 19, 2023
Don't mean to bump, but since this is an important error I have on my project, I was wondering if anyone could help me? It seems like an easy enough fix, just that I don't know how to do it with v19. You used to be able to just leave the moves blank in previous versions I think, but something that was changed doesn't allow it. So what variable do I put in between those commas?
 

StCooler

Mayst thou thy peace discover.
9,289
Posts
4
Years
  • Age 28
  • Seen Apr 24, 2024
Try without the commas.

If you find:
Code:
module TrainersMetadata
you'll see that in the compiler, moves have this "formatting":
Code:
    "Moves"     => [TPMOVES,     "eEEE", :PBMoves, :PBMoves, :PBMoves, :PBMoves],
The interesting part is "eEEE" ; this means that, when you write "Moves = " in trainers.txt, the compiler expects at least one move, and then up to three optional moves. When the compiler reads:
Code:
 Moves = TACKLE,DEFENSECURL,,
it will first split it into a list. It expects this list to consist of one to four strings, and then converts these strings to a PBMoves constant.
In the above case, the list will be:
Code:
["TACKLE", "DEFENSECURL", "", ""]
and the compiler will try to convert "TACKLE" to the constant PBMoves::TACKLE, "DEFENSECURL" to PBMoves::DEFENSECURL, and "" to... Well, to an error.
However, if you write:
Code:
 Moves = TACKLE,DEFENSECURL
without the commas, the list will be:
Code:
["TACKLE", "DEFENSECURL"]
thus no error!
 
Back
Top