Post subject: Lua framework for Dolphin + Cheat Engine RAM watch
JoselleAstrid
She/Her
Joined: 9/9/2013
Posts: 35
https://github.com/yoshifan/ram-watch-cheat-engine I've posted about this Lua script framework a few times in the past, but I figured I should make a proper thread for it instead of hijacking some other thread. That way I can field questions here, as well. Anyway, I've given the framework a major update: - New detailed tutorial - You can now cleanly separate your own custom layouts from the framework code - Reorganized a lot of things to enable writing shorter, more expressive code Here's a video showing an example of a RAM display: https://www.youtube.com/watch?v=Hri8f8Pgim8 Introduction based on the GitHub README:
RAM watch is a powerful tool for researching games - for modding, speedrunning, or just generally learning how the game works. The tool-assisted speedrun community makes extensive use of RAM watch on emulated games. The most popular Gamecube/Wii emulator is Dolphin, and so far, Cheat Engine has been the most popular RAM watch solution for Dolphin. In addition to supporting RAM viewing and scanning (and even modifying), Cheat Engine also includes a Lua scripting engine. This opens up many more possibilities for boosting research productivity, including:
  • More interactivity. With Lua scripting, you can create a separate Cheat Engine window with arbitrary GUI elements: buttons, text fields, and so on. You can record values to a .txt file as the game runs, and then paste results into a spreadsheet to make a graph (e.g. showing your character's speed over time).
  • More flexible RAM viewing compared to Cheat Engine's address list display. For example, you can set your font and font size, limit the number of decimal places in a float, and make the display update as often as once per frame.
  • It's easier to build upon previous results. Instead of entering the same pointer base for 10 different address list entries, you can save that pointer to a Lua variable and re-use that variable. You can run RAM values through formulas like sqrt(x^2 + y^2) and display the result.
This repository contains:
  • A Lua framework for writing custom RAM displays with the above features. Although the Lua framework can be used for any game, the main focus is on games running in Dolphin emulator.
  • A tutorial covering the basics of the Lua framework.
  • Advanced display layouts for a few games, most notably F-Zero GX and Super Mario Galaxy 1 and 2.
You can get a RAM watch script up and running without any prior knowledge of Lua coding. If you do know some Lua (or are willing to learn), this framework can help you write display scripts for any game you like.
Joined: 1/13/2014
Posts: 56
Thanks for this, I got a lot of use out of the last iteration and I'm excited to use this. Hopefully this will finally give me the motivation to make this galaxy 2 tas I've wanted to do for a while.
jdaster64
He/Him
Joined: 12/1/2012
Posts: 103
Location: New Donk City
Ooh, how did I not know about this before? Seems like it'll address Dolphin's lack of Lua support and CE's lackluster native support for dynamic memory watching in one stroke; excited to try this out!
Fog
Experienced player (626)
Joined: 4/5/2014
Posts: 459
I'm running into an issue where the local dolphin returns true: "Error:...wnloads/ram-watch-cheat-engine-master/games/gamename.lua:31: attempt to index a boolean value (local 'dolphin')"
JoselleAstrid
She/Her
Joined: 9/9/2013
Posts: 35
Fog: Can I see gamename.lua up to the point where the local dolphin is set? And what Cheat Engine version are you using? I've read that require() can return true if the required file (dolphin.lua in this case) does not have a return statement at the end of the file, but if it's finding the repository's dolphin.lua then that should be covered. And I'm asking the CE version in case different Lua versions have different loader behavior.
Fog
Experienced player (626)
Joined: 4/5/2014
Posts: 459
yoshifan wrote:
Fog: Can I see gamename.lua up to the point where the local dolphin is set? And what Cheat Engine version are you using? I've read that require() can return true if the required file (dolphin.lua in this case) does not have a return statement at the end of the file, but if it's finding the repository's dolphin.lua then that should be covered. And I'm asking the CE version in case different Lua versions have different loader behavior.
I'm using Cheat Engine 6.6, and modifying the sample.lua file (which hasn't changed in my new file). EDIT: Apparently just having a file in the cheat table folder called dolphin.lua (or any other required file) causes it to break.
JoselleAstrid
She/Her
Joined: 9/9/2013
Posts: 35
Oh, didn't think of the cheat table folder. Yeah, that'd break it. Perhaps I should look into making the require() paths more explicit for everything other than games/layouts. Thanks for finding the issue.