How is "data.pokemon" modeled and where can I find those models? #169
-
Hey All! I'm trying to use the Python tool to export data from a ROM hack to use in another project I'm working on. In the other project, I'm reading Pokemon data from a JSON file in order to generate markdown files.
There's more to it, but you get the idea. Currently, I know I can do something like I can crawl through the codebase to figure this out but thought it'd save time to just ask. Even if only so I can better know where to start crawling from. While I'm at it, I'd love to know what the limits of the Python tool are. I get the feeling I'm going to need a decent setup in order to accomplish my goals. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The python tool reads model objects the same way that the table tool does. So anything you see as an entry in the table tool, you can access the same way in Python. For example, if you look at the pokemon data in the table tool, you notice that the stats table is called The python tool also has access to the |
Beta Was this translation helpful? Give feedback.
-
If I'm not burned out when I finish the pokemon GBA games, I might do the final fantasy GBA games next. I'll go ahead and close this if you're satisfied with my answer, feel free to join the discord server (link in the help menu) if you want to talk about the tool progress or python usage in a more conversation setting. |
Beta Was this translation helpful? Give feedback.
The python tool reads model objects the same way that the table tool does. So anything you see as an entry in the table tool, you can access the same way in Python.
For example, if you look at the pokemon data in the table tool, you notice that the stats table is called
data.oikemon.stats
and it has a field calledhp
. So you could typedata.pokemon.stats['charizard'].hp
to read or write charizard's HP stat.The python tool also has access to the
editor
, which you can use to run any methods on the main application (see EditorViewModel) and you can index it to get access to each individual tab that's currently open. For example,editor[0].Refresh()
will refresh the content in the first tab.