http://code.google.com/p/macrolua/
Some small improvements after testing analog scripting a bit.
v1.13, 2/18/2011
Enhancements:
- Parsing for analog controls simplified:
- You can override a hold with another hold. No need to use
^or*before holding again. - To cancel a hold, use any non-hold. Putting
^or nothing before the command will input the value for one frame, then release.
- You can override a hold with another hold. No need to use
Problems fixed:
- Scripting analog and binary commands on the same frame no longer causes parse errors.
- Analog values were not being shown by
input-display.lua. (Although the shown values are still wrong.)
Unlike 1.12, I'm pretty satisfied with the parser now.
Well, I was going to prepare a demo video but the desync rate is outrageous. I've gotten macro and FBM desyncs in FBA-rr before but it's really bad with analogs. It's probably due to FBA's long-standing problem with savestates: information that's supposed to be getting saved and restored isn't. If you've ever loaded an FBA savestate to find the audio messed up, you know what I'm talking about. (On the other hand, I haven't gotten desyncs with MAME-rr macros.)
So instead, here's a proof of concept script using the forgottn module:
??? # activates text dump mode
&9 W4
< # player 1
_1_T[321],W8,_L_T[-1234],W4,^1,_T[ABcDh],w8,^L,T[0]...
/ # player 2
_t[-7fffh],w7*,R.D.L.U.1s._t[+7fffh],W7*.
>
$8 !
| |UDLR1SC@~ | T| | UDLR1SC@~ | T| | |
| |......... | | | ......... | | | load slot 9 |
| |......... | | | ......... | | | |
| |......... | | | ......... | | | |
| |......... | | | ......... | | | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ......... | -7FFF| | |
| |....1.... | 141| | ...R..... | | | |
| |..L.1.... | -4D2| | .D....... | | | |
| |..L.1.... | -4D2| | ..L...... | | | |
| |..L.1.... | -4D2| | U........ | | | |
| |..L.1.... | -4D2| | ....1S... | | | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | 7FFF| | |
| |..L...... | ABCD| | ......... | | | |
| |......... | 0| | ......... | | | |
| |......... | | | ......... | | | |
| |......... | | | ......... | | | save slot 8 |
The resulting text dump. Note the case-insensitivity and the way holds can cancel prior holds.
Hi!
I wanted to ask you, from which game is your blog's picture, the one with the cat creature?
Thanks!
Posted by: UncleSamPatriot | 02/23/2011 at 10:11 AM
At the beginning of each month I change the pic and talk about last month's pic.
You'll find out the details then. =)
Posted by: dammit | 02/23/2011 at 10:52 AM
Hi!
Do you know why i got a delay, growing on each stateload, with that kind of script?
&6w40.(B.w10)3.25.w60 # should whiff
&6w40.(B.w10)2.25.w60
&6w40.(B.w10)1.25.w60
&6w40.(B.w10)0.25.w60
&6w40.(F.w10)1.25.w60
etc...
Maybe i'm doing something wrong?
Posted by: ESN | 07/24/2011 at 09:53 AM
So what's going on in the script?
P1 taps back a few times then does UOH? Is the delay before the first action? Does the delay cause something to fail? Does it happen if you split it up into separate scripts with "!" ?
Posted by: dammit | 07/24/2011 at 02:01 PM
Exactly. I want to check all blk adv/hit adv/cr hit adv min/max values.
Delay begins to appear right after the second state load.
What happens exactly is:
- macrolua launch
- first line : fine
- second line : state load fine, but then, following commands are executed after something like 2 seconds
- third line : state load is still fine, but now, commands are executed after 5sec.
- etc...
After a dozen lines, commands are executed at 50 of the 3S timer (starting at 99), the whole macro requires more than 5min, which is quite annoying to check a simple uoh.
Just tested this, the .mis file only contains these lines:
&6w30.4w30
&6w30.1w30
&6w30.4w30
&6w30.1w30
&6w30.4w30
&6w30.1w30
The last line has ~15sec delay between state load and the LP.
Beside this little issue, everything is fine. It's just a little long.
Not sure to understand what you mean by separate scripts. Is it possible to run several .mis files one after the other?
Posted by: ESN | 07/24/2011 at 05:18 PM
It's not recommended to put multiple stateloads in one script, especially with CPS3 since it's slow. It's better to break it up with one load per script. You can make a script ignore the rest of the file with a "!" symbol. That way you can get lots of scripts in one file and observe each case separately. To use your example:
&6w30.4w30! (optional comments here)
&6w30.1w30! (etc)
&6w30.4w30!
&6w30.1w30!
&6w30.4w30!
&6w30.1w30!
Only the first (top) one gets loaded so you have to shuffle them around with copy/paste to use the one you want.
Posted by: dammit | 07/24/2011 at 06:41 PM
I see.
It's a shame (though, it kind of works in fact), loading successive states open possibilities to automate frames data collection with another LUA script running at the same time.
Btw, one thing i thought while writing macros, a nice feature would be to output comments (or another sort of comments, different of #) in the lua console.
Great job anyway, really useful tool!
Posted by: ESN | 07/25/2011 at 03:26 AM
I'll see what I can do about getting successive loads to work better, and printable comments shouldn't be hard.
Posted by: dammit | 07/28/2011 at 01:31 AM