Someone emailed me asking for one of my old Lua scripts, since the place I left it, pastey.net, is down. Rather than just send along my archive copy, I gave it an overhaul.
It's for the SNES version of SimCity and it draws a grid showing important parameters like land value and growth rate on the playfield, along with the values of each square in the grid. It also marks the city center tile, which is important for some computations. FatRatKnight was the one who found the key memory addresses. (The grid without the numbers is available in the in-game map, but it's really slow to load and it's squeezed into a small window, so it's hard to use.)
It seems snes9x-rr's box drawing code changed since 2009, and the old script had all the boxes filled in opaquely, so that had to be fixed. Also, text characters used to be 8 pixels wide and now they're 4. That means I could get rid of an ugly method of making three-digit numbers fit in 2x2 boxes. Other things changed:
- instructions in the console window
- more user control in the form of hotkeys
- customizable box border and interior opacity
- easier to customize, with all the relevant stuff clearly marked at the top
- areas with zero value now have no grid there instead of a black box
- the grid won't be drawn unless the in-game HUD is removed with button Y, to avoid ugly overlap
- the city center is marked with a colored tile instead of a silly character symbol
- less unreadable scripting style
There's still no version of snes9x-rr that has input.registerhotkey()
, so I had to specify keyboard keys for user control via input.get()
. Actually, 1.52-r185 does have the hotkey function, but doesn't have any bindable Lua hotkeys. It's also missing a bunch of gui functions, so it'll crap out on this script. You have to use 1.43 or 1.51. It seems like snes9x-rr development is lagging behind the other emus, not that there's a whole lot of progress anyway.
Recent Comments