It's exactly what you're thinking of, except it's in 2.1 and probably not as perfect as you would think it will be in 2.2. But it is a damn fine attempt.
Veterans of SRB2 will want to turn it off, as this is on by default. You can toggle this by typing the command "directionchar". There is also an option for Player 2 in splitscreen via "directionchar2".
In the cases of the actual coding ported from 2.2's source which was distributed by toaster, directionchar will have no effect in the following scenarios:
- Exiting the level
- 2D mode (though probably not Axis2D)
- NiGHTS Mode
- A case where the player cannot be controlled
- Gliding and climbing
- Analog Mode (which you probably won't use when you add this lua anyways)
- The player is in their Pain state
- The player is using the homing attack via CA_HOMINGTHOK
- Any and all Ring Slinger gametypes (Match, Team Match, CTF, Tag, H&S)
- Being Carried by an object (You won't have any directional influence on your end most of the time.
- When you play as HMS.
Credits to toaster for the original 2.2 Source.
Credits to LJ Sonik and MPC for assistance in porting.
Credits to MPC for the Splitscreen command and minor bugfixes.
Credits to Lach for making me look lazy and actually try to make this script work as best as possible.
Honorable Mention to Jay with the older versions of this script using an overlay, thanks to some discoveries made from his older coding, we did manage to learn about interpolating issues with MD2s.