Posts for asiansteev


Experienced Forum User
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Derakon wrote:
If I recall correctly, the NES zapper just has a simple light sensor -- pulling the trigger makes the game redraw the screen differently so the gun can say if it's seeing a specific color (or color transition, or whatever). There's nothing that directly says "the zapper is pointed at this pixel". That said, the ability to say "fire the zapper now", regardless of positioning, would seem to be rather important. :)
right, which makes the zapper.read return table seem kind of odd... it returns 3 values: x, y and click, indicating whether the trigger is being pulled this cycle/frame... but what are x and y if click is false? couldn't we get away with just returning x and y and when those two values are false, it's assumed that there was no click? anyway, being able to manually trigger a zapper click through Lua is my end-goal, any ideas?
Post subject: EmuLua fceux zapper set function?
Experienced Forum User
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Hey guys... just wondering if there was an easy way to manually set an NES Zapper click in Lua. The only function dealing with the Zapper on the wiki is zapper.read(), which returns the coordinates and whether the zapper is currently being fired. I'd like to do something similar to clicking on the screen with the mouse to fire the zapper. The joypad has both a get and set, it seems like the zapper should/might as well. If there is no built in function, there's probably a value that I could shove into a location in memory to get it to go off, I just thought it might be built-in. Thanks!!
Experienced Forum User
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Kuwaga wrote:
I'd code it like this: weapon_names = {"Arm Cannon","Atomic Fire",...} Then use "if next_weapon > max_weapon" or "if next_weapon > table.maxn(...)" or "> #weapon_names" Keep in mind that in lua arrays (which really are tables) start with 1 as their lowest index (which really is a key) per default though. Nice work.
awesome. the script has been updated to define the tables in a single line (and all the array indexes fixed likewise)
Alden wrote:
For what it's worth I dug up an old script I was working on for MM 1, 2 and 3. Not sure if it is even in a working state, though it was at some point. I got hung up on the graphical issues. Would love to see a TAS using your script someday! http://lua.pastebin.com/Y5MS2nyR
looks awesome (same as mine, but for mm1 2 and 3, correct?), but i could not get it to work :(
Post subject: Quick weapon select in Mega Man games via LUA
Experienced Forum User
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Hey guys, I've recently started getting into LUA scripting for NES games, and oh my god it's so much fun. I've been playing around with using the select button in Mega Man games to quickly switch weapons. It can be a pain figuring out where in memory some of this stuff takes place though. Here's the script and a link to the video. Let me know what you think. I'll be updating this thread as I make progress. video -> http://www.youtube.com/watch?v=cBcOoNtULVQ the script -> https://gist.github.com/614747