11 March 2016 - Forum Rules

Main Menu

Just Discovered Lua Scripting, WOW!

Started by RyanfaeScotland, September 25, 2016, 04:17:27 PM

Previous topic - Next topic


I can't believe you guys have been holding out on me for so long!

I read about Lua scripting a while back when considering doing some work on Monkey Island but never really looked into it. That was about 10 years ago and then last night I happened to notice Gens has Lua scripting capabilities and now I can't stop coding!

Here's what my Toejam and Earl screen looks like just now:

This is going to make figuring things out so much faster and more fun! I've done a handful of serious things (loops for all present locations, enemy locations and so on, display for the count down timer for presents) and some fun things (Press X to warp to the elevator).

Still don't quite think like a scripter though because I realised after 20 iterations of 'increase value in save state by 1 in hex editor, reload, note different, repeat) that I could just script an increment function to a key and edit the memory directly!

So, I'm sorry, this is a bit of a none descript topic, just wanted to say Lua scripting is awesome. Wouldn't mind hearing about some of your favourite scripts, functions or uses if anyone wants to share?


The main one I have gone through is which I was linked in . I have no great desire to play the game with it but to go through it saw me consider some things I might not have otherwise done and I like it for that.

I tend not to use it as I do try for "runs in hardware" as the basis for things and the systems I tend to play on all have top debugging capabilities, though should I go back to the megadrive I probably would want something there.


Yeah I get the runs on real hardware thing and can see this being a real temptation into the darkside with quick and powerful results at the expense of real hardware compatibility.

Just from the topic you linked (not the script) it's funny it should mention a hud because that's one of the first things I thought of for T&E, drawing more items on the map (presents, ship pieces, enemies, pretty much everything).


Is there some tuto for Lua scripting in GENS ?


Yes, just get the Gens version with Lua support (Gens Re-recording) and it should come with a file called gens-lua.html, which has a tutorial an all the documentation you should need. It also comes with several examples.

(...I think. I haven't used it in 10 years.)
There has to be a better life.


I'm using r57shell for my flavour of Gens that has it and it has a few example scripts. The one I really caught interest in it from was one for Gain Ground which I think I found via a TAS video, I'd need to search again to be sure though and it's a bit late for that.

I can however pass you these two links that are working out pretty handy: Lua in Gens: and Lua in General YouTube also turns up some fun and interesting videos although nothing really suited for tutorials but the guy Xkeeper showcases some really cool stuff,, of note: Drag and Drop Mario ( and Rainbow Riding (

September 27, 2016, 02:49:40 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

Mz, just noted the names of the HTML files we both mention and I'd be surprised if they aren't the same file.  :thumbsup:

Here is the Gain Ground script I was on about: does lots of cool stuff and is pretty well coded (I think) so a good example to look at.


Thank you very much. I use Gens on a daily basis and never dared to use Lua. It may be tile for a try !