Jump to content

Lua Scripting with Desmume


Recommended Posts

I've been looking into writing a script to run on Desmume. I'm thinking of running it on either Platinum or one of the Gen V games. I haven't been able to find any detailed instructions for setting things up, can anyone help me out? It doesn't have to be Lua, really it should be something that "plugs in" to the emulator (fires button inputs straight into the emulator rather than using something like the Robot in Java to send keyboard and mouse events over the desktop). Also, if I wanted to look into reading the memory from the frame, how would I figure out what address and value correspond to what (ie. tiles, items, Pokemon health, player position, etc.)? 

  • Like 1
Link to comment
Share on other sites

it´s been a while since i´ve messed with lua scripting and Desmume. ok, so i´m gonna go off the assumption that you do have prior knowledge with writing scripts and Lua Scripting. So far, i´ve found this fourm post about this subject,kinda, so it might help to an extent, but if it doesn´t, let me know and i´ll just tell you how instead.

https://www.romhacking.net/forum/index.php?topic=22681.0

 

but, in the instance you are unfamiliar with Lua scripting, here is an explanation about it:

http://www.fceux.com/web/help/fceux.html?LuaScripting.html

Link to comment
Share on other sites

Okay I'll try that out. Basically the project is a simple grinder that'll automatically train Pokemon for me. All it'll do is run in the grass and fight Pokemon (use a set move I provide beforehand) until PP runs low or it needs to be healed, where it'll use Fly to get back to the closest city, heal, and run back to continue fighting. I have a couple more features I might want to build on but that's the general idea. I was thinking Lua to give input to the emulator but either a) reading through the memory or b) analyzing the frame for text to figure out what the player needs to do. Is Lua a good option for the second part or would it be better to use another language to figure this out? I've combed through the memory files here:

https://projectpokemon.org/docs/gen-4/list-of-items-by-index-number-r23/

but I'm not sure what to be looking for. Thanks

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...