Skip to content

TASScript Tools v1.5

Choose a tag to compare

@Snugggles Snugggles released this 23 Apr 17:34
· 3 commits to main since this release
994f43a

This is an update to the old TAS Tools, now known as TASScript. I've made a lot of fixes and improvements to the code, so that the Scripts themselves run a lot better behind-the-scenes. There's also a fair few new Features that I've implemented, which I'll explain here, starting with...

Keyboard TAS Controls

This was something that I had been meaning to implement a while ago, but never got around to doing it. Now, alongside being able to do Controller Inputs, you can send Keyboard Presses the same way! This is done by using KB("x"). For Example;

KB("Down")
waitFrames(20)
KB("S")

would send the Down arrow Key, wait for 20 in-game frames, then send an S key. You can also hold down Keys by using;

HoldKB("Down")
waitFrames(10)
HKB("Right")
waitFrames(10)
KB("S")
RKB("Down")
ReleaseKB("Right")

HoldKB(x) or HKB(x) to make it faster to Type, in conjunction with ReleaseKB(x) or RKB(x) to hold Keys for extended periods of time.
You're also able to set Controls within TASScript Settings.ahk, to make it a little easier to understand what's happening at a glance. I've pre-assigned Up, Down, Left, Right, Jump, and Pause, to W, S, A, D, Space, and Escape, and to use these you just Copy and Paste the Keyboard Controls from TASScript Settings.ahk into the PlayScript() body, at the very top. Whenever you want to use them, you just do KB(x) without Quotation Marks, so KB(Jump) would send a Space input.

Restructuring of Memory

I've changed the way that you add Memory Addresses to Read Frame Data from! This is all enclosed within the new TASScript Memory Addresses.ini file. The way it is structured is as such;

[InternalDenotion]
EmulatorAHK = "ahk_exe program.exe"
EmuBaseAdd = 0x00000000
EmuOffests = 0x00, 0x00

One feature of this means that it's possible to add non-Emulation program functionality fairly easily, so long as you can find a Memory Address that holds a Frame Counter. This explanation is going to assume that you understand Memory Addresses. To add a new Program to it, you just Copy and Paste the above Block of text and change a few things.

  • 'InternalDenotion' is changed to whatever you will be referencing this entry as. I personally enter it in the structure of Emulation and then Version of the Emulator, e.g. [PS21701509], or for programs I just name it what the program is, e.g. [LeapYear].
  • For 'EmulatorAHK', you just change the last part, from 'program.exe' to what shows up in Task Manager for your program, e.g. if Discord was a game, you'd enter "ahk_exe Discord.exe". Bear in mind the name of the .exe may be different from what it is generally known as.
  • 'EmuBaseAdd' is a hex value that is used to denote where Emulation Memory is stored. If not using an Emulator, you can omit this, or just leave it as 0x00000000.
  • 'EmuOffsets' is used to lay out the Offsets needed, separated by a comma.

macrolua-like Function

I hadn't heard about this little thing called macrolua, but a YouTube comment prompted me to look into it, and it's really cool, so I kind of had to try implement it.
The way that the Tools work, a few frames of inputs can take a while to do. However, the way that macrolua, and now the FGC("x") command works, is you feed it a string of commands, and it parses them to do the inputs. FGC stands for Fighting Game Controller, since the YouTuber that brought it up does TAS videos of Fighting Games.

When you use FGC("x"), you need to include the Quotation Marks inside it, and you also have to be wary of capitalization, otherwise it won't work. How you use it is by giving it preset commands, which are customizable within the TASScript FGC.ahk file. It's pre-filled with 10 buttons and 4 Directions, you just have to change the entries into whatever Keys your Game is using. The Directions are denoted as WASD, and the Buttons are 0 through 9 inclusive, and are used in this way;

FGC("S456")

would set whatever you denote as S, button 4, button 5, and button 6 as pressed, but nothing will happen. This is because you have to use Special Inputs alongside the Key Inputs. Here's a list of them all:

  • "."
  • "q"
  • "h" and "r"
  • "+" and "-"
  • "="

The most important one is ".", the Period. When you use the Period, it waits for the frame to advance, the same as the old waitFrames(x) command does.

FGC("S456.W123.")

is two frames of Inputs. First, it preps S, 4, 5, and 6, and advances the frame, and releases them. Then it preps W, 1, 2, and 3, advances the frame, and then releases the buttons. So, instead of doing a string of commands like;

Down()
Right()
Down()
HoldRight()
HoldSquare()
HoldTriangle()
HoldR1()
waitFrames(1)
ReleaseAll()

for 4 frames of inputs, you can do it like this instead;

FGC("S.D.S.D456")

It's much faster and less cluttered, and easier to type out.

The second one is "q", this lets you queue up frames, the same way waitFrames(x) does for longer than a single frame. You use it simply by writing "q" followed by a number and a Period, so "q54." would just wait 54 frames. You can combine this with a sequence of commands, and have it hold them the entire "q" amount of Frames, as such;

FGC("S.SD.D6.q10.D..D52q100.")

presses S, then S and D together, then D and 6 together, then waits 10 frames before doing D again, there's then a frame with no inputs, and then 100 frames where D, 5, and 2 are held.

"h" and "r" are fairly important as well, as these let you denote holding an input for an unspecified amount of time, and subsequently releasing it. They work similarly to "q" but instead of just a number, you put what input you want held or released, e.g. "hD" will hold D, and it won't be released until you either do another "D" or do "rD", so;

FGC("S.SD.Dh45.q50.r4.")

does S, SD, and then it does D, 4, and 5 together, but doesn't release 4. Then it passes 50 frames, and releases it a frame later.

One of the more exciting ones are the "+" and "-" Inputs, as these let you switch Controls between Players. In the TASScript FGC.ahk file, you can denote what Inputs relate to what Key on the Keyboard, for each player. Technically this is expandable to as many players as you want, but as 4 players is generally the go-to max for most games, I've only set it up to have up to 4. How you use these Special Inputs is just by typing them out. "+" will increase the Active Player Number, and "-" will decrease it. You default to Player 1 when loading a Script, then if you enter "+" you will switch to Player 2, do it again and it would go to Player 3, and once more for Player 4; Then any inputs you do are assigned to that Player.

FGC("D+Aq100.")

would Hold D down for Player 1, Switch to Player 2, Hold A, and bother would be held for 100 frames. If you wanted to control both Player 1 and Player 2 at the same time, you would have to Alternate like so;

FGC("S+S-.D+A-.S+S-.D456+A456-.")

would do S, D, S, then D456 for Player 1, but simultaneously do S, A, S, A456 for Player 2.

When doing longer strings, It can be hard to read, so you are able to do spaces, or even separate them into different FGC("x") commands;

FGC("WD.q25.6." "q33.S5." "q23.S6." "q5.S.AS.A12." "q80.D.S.SD45." "q10.52A..A." "q30.S.D.S.D456.")

has each Fighting Game Move separated to make it easier to partition and read what's happening, but if that's still not clear enough;

FGC("D.S.SD5.")
FGC(".h2h5q3.D..Dr2r5.")
FGC("q30.S.SD.D45.")
FGC("q32.S.D.S.D456.")

also separates inputs, but is easier to read, and you can add Comments to the end of the lines with a semi-colon.

Finally, "=" is there to force Release all Keys that are bound. This can be very taxing on the computer, as it's sending between 14 and 56 keystrokes in a single frame (Depending on number of Players,) so only use it whenever you absolutely need. Prioritize using the tools proper and utilizing "h" and "r" as and when you need to.