TASScript 2.0 is an enhancement to JPC-rr that gives the TASser direct access to the event stream, providing quick and easy command input and editing functionality. It offers complete control over event timing down to the sub-millisecond, and precise control over mouse and joystick movements. Furthermore, it enables a macro-like ability to copy a series of inputs and insert them when and where desired. But most importantly, TASScript 2.0 finally breaks down the barrier to refactoring DOS TASses that has long frustrated TASsers.
Download Link - JPC-rr 11.2 w/ TASScript 2.01 (Updated 2018/11/06 - Minor bug fixes)
EDIT:
Now merged into JPC-rr 11.8, and proposed as a new version 11.9-alpha. Please use this one moving forwards.
History
For years I have been fed up with the inability to refactor TASses in JPC-rr. Numerous times when making a TAS I've realized a mistake earlier in my run. Being forced to retreat, fix the problem, and then
redo all my work from that point on killed any joy I had in making the TAS. Last year, I decided I'd had enough and
wrote some lua scripts (TASScript 1.0) to try and solve the issue. Although it was somewhat successful, allowing me
to refactor a short 41 second movie, it was tedious and imprecise. When I tried to use it to refactor a longer 9 minute movie, it became an unbearable slog.
Then in January, I saw
dwangoAC at AGDQ changing the event stream on Donkey Kong Country mid-playback and said to myself,
"I want THAT!" I have since been putting my time into creating a version of that for JPC-rr, and TASScript 2.0 is the result of that work.
Description
TASScript 2.0 provides a new window for viewing, entering and modifying events:
The TASScript window is separated into four parts:
Past Script (Top)
This shows events that already occurred in your TAS. The Past Script is not editable.
Future Script (Middle)
This shows events that are scheduled to happen. Edit this area to create/update your TAS.
Message Area (Bottom)
This area shows messages from the TASScript system.
Action Buttons
There are five action buttons:
1) Unlock/Lock
Click "Unlock" to open the Future Script for editing. You can also click on the Future Script area to open it. To save your changes, click "Lock". You must fix all errors before you can lock in your changes.
2) Cancel
Click "Cancel" to discard your changes and revert to the last-saved Future Script. Editing is automatically cancelled if you advance a frame or load a save state.
3) Export
Clicking "Export" will let you export your TASScript to a file.
4) Sound
Unchecking "Sound" will turn off the sounds made by the TASScript window.
5) Help
The question mark button opens the Help window.
Entering Commands
You can type commands directly in to the Future Script area and lock it to save your changes, or you can use the classic methods of creating events to append to the end of the current Future Script. If there is a series of commands you repetitively use, you can copy those to a text file and paste them into the Future Script area whenever you need them.
Here are the commands you can enter in the Future Script area:
Wait:#
Emulator waits without creating any events for the specified number of milliseconds. # can be any decimal value. If a Wait comes before a Type command, the value may be altered slightly on locking to ensure the Type command occurs at a valid timestamp.
Example: "Wait:24.5"
Type:{list of keys}
Emulator types the keys listed. Usually you will want to type each key twice, once for key-down and once for key-up. Only the lower case key values are valid. To type an upper case or special character, use a shift key first. See the virtual keyboard for the list of normal keys. Special keys are listed below.
Example: "Type:<lshift>ttaassvv<lshift>iiddeeooss..oorrgg<lshift>11<lshift>" will type "TASVideos.org!"
Special Keys:
<esc> = escape
<bksp> = backspace
<tab> = tab
<enter> = enter
<lctrl> = left ctrl
<rctrl> = right ctrl*
<lshift> = left shift
<rshift> = right shift
<lalt> = left alt
<ralt> = right alt*
<caps> = caps lock
<num> = num lock
<f1>-<f12> = f1-f12
<scroll> = scroll lock
<num0>-<num9> = numpad 0-9
<num> = numpad minus
<num> = numpad plus
<numdel> = numpad delete
<prtscr> = print screen*
<numenter> = numpad enter*
<home> = home*
<up> = up*
<down> = down*
<left> = left*
<right> = right*
<pgup> = page up*
<pgdown> = page down*
<end> = end*
<ins> = insert*
<del = delete*
<pause> = pause*
NOTE:
Special keys with asterisks (*) take twice as long to input in JPC-rr than other keys. Use alternatives where possible.
MXMove:#, MYMove:#
Emulator moves the mouse along the X or Y axis by the specified amount. # must be a whole number between -255 and 255 inlclusive.
Example: "MXMove:-75"
Example: "MYMove:40
MZMove:#
Emulator moves the mouse scroll wheel by the specified amount. # must be a whole number between -7 and 7 inclusive.
Example: "MZMove:7"
MClick:#
Emulator clicks the specified mouse button. # must be a whole number between 0 and 4 inclusive.
Example: "MClick:2"
JButtonA:#, JButtonB:#, JButtonC:#, JButtonD:#
NOTE:
org.jpc.modules.Joystick must be in the run's assembly module list.
Emulator sets the state of the corresponding joystick button. # must be either 0 for off or 1 for on.
Example: "JButtonA:1"
JAxisA:#, JAxisB:#, JAxisC:#, JAxisD:#
NOTE:
org.jpc.modules.Joystick must be in the run's assembly module list.
Sets the corresponding joystick axis value. # must be a positive or negative whole number, or zero.
Example: "JAxisA:-10000"
TASScript Examples
The package comes with a TASScripts directory that has three examples of simple TASScripts you can use to boot the system. You will never need to TAS the start up ever again!
Basic Boot.TAS
This boots the system skipping fdconfig.sys and autoexec.bat. This is the fastest way to boot up, but you won't activate himem mode, which may be an issue for some games.
Himem Boot with Mouse.TAS
This boots the system in himem mode and installs the mouse driver with settings to work with the mouse support enhancement (see below)
Himem Boot no Mouse.TAS
This boots the system in himem mode but no mouse
If you'd like an example of a TASScript for a whole game,
here is the one for my QFG2 submission.
Usage
To refactor a movie, simply load that movie and run until you get to just before the place you want to change. Be sure to create a save state, then unlock the Future Script area and make your changes. Be sure to lock again before continuing.
I also found the TASScript window very useful for new TASsing as well, especially when typing. Not having to use the Virtual Keyboard is a plus in my books. Also, the precise mouse movements come in handy, though dragging the pointer is still useful to get it in the right area.
Other Enhancements
There are other previous enhancements I made that are part of this bundle:
Multiple Save Directories
When you first try to save or load, it will ask you which directory you want to use. You can always change this directory using the 'D' key. This will let you keep a detailed folder structure of all your saves you can go back to any previous save and never have to overwrite an old save because you've used up all 12 function keys worth.
Mouse Support
For most games, to get mouse support to work properly, before loading the game uninstall ctmouse (or just skip over it in the Autoexec), and then install it again using: "ctmouse /r32".
Once you start up your game, you'll be able to click on the mouse pointer and then drag it to where you want it to go, and let go of it. That will increment the frame and move the mouse for you. Check the menus for other manual ways of moving the mouse, as well as ways of changing the mouse settings if /r32 doesn't work for you and you want to use different numbers.
Keyboard Support
When you have the virtual keyboard window active, you can now just type and it will submit the keyboard commands for the letters you've typed. Much better than clicking on the keyboard buttons. I personally still find entering "Type:" commands in the TASScript window even easier.
Final Comments
This has been a long time coming, and I'm glad to finally have this out the door. Please let me know your thoughts and ideas in this thread, including any errors you run into and any improvements you can think of. I'm going to be devoting my spare time to something else for a while, but I'll be monitoring the thread and will be happy to fix any problems or fine-tune this to make it even better.
Given that this adds a whole new method of input and editing to JPC-rr, I'd also like to recommend adding this version to the
TASVideos JPC page for people to find and download. My hope is that the TASScript window will lower the learning curve for the emulator and motivate more people to make DOS TASses. However that will only work if people know about it. If someone is willing to integrate my changes with the latest version of JPC-rr to make a new version, I'd be very happy to provide my support.
Kudos, and many thanks for the TASVideos community for keeping up the push to gaming perfection.