r/Tf2Scripts • u/Kered13 • Apr 07 '13
Script [Script] Perfect charge turning with mouse
UPDATE: As of 2014/04/24, this no longer works.
UPDATE: 2014/6/18 The circle is complete
This scripts allows you to turn as much you want while using your mouse.
Download
Installation guide by o0Brilliance0o
In my last charge turning script thread, there was some discussion about making a charge turning script with a virtual joystick that used a mouse. I said it was theoretically possible, but I had my doubts that it would work very well.
How wrong I was.
This script has surpassed my wildest expectations. You could probably play scout or sniper entirely with this mouse to joystick mapping and barely even notice the difference. Now apply this to charge turning, where mouse movements are crippled but joystick movements are completely unlocked. Dodging a charge becomes completely impossible, you can only try to run or kill the demoknight first. It's borderline broken. But as long as charge turning continues to be possible with a controller, I don't see why I shouldn't make it work with a mouse.
Installation and usage instructions are included in the .zip. I have included both Windows and Linux versions. The Windows version comes with a Visual Studio solution if you want to compile it yourself, or just see how it works. The Linux version is just a python script.
If you have been using the keyboard charge turning script, note that this one uses a slightly different demoknight.cfg (also included in the .zip), so you will want to update that. The TF2 script uses the same principle of holding mouse2 to activate the joystick.
UPDATE: Since the Steampipe update, all scripts need to go in "tf\custom\<any folder name>\cfg". Everything else remains the same.
UPDATE 2013/8/27: The 8/27 patch has changed the way controllers work in TF2. This introduces a new step in installation, and requires a small change in demoknight.cfg. Some of you probably noticed that the script stopped working, this will get it working again. I have updated the download with a new cfg and instructions, but if you already have the script just follow the instructions below:
1) Configure VJoy in Steam Big Picture:
- Run VJoy. Map Buttons 1-4 to some keys, as well as Up, Left, and Slider+. Do this for both VJoy controllers, and make sure they are both enabled. (Screenshot)
- Run Big Picture. Go to Settings > Controller, it should say "Controller Detected: VJoy Virtual Joystick" (if not, then Big Picture is reading the wrong controller). Click "Edit Controls". Map the first four buttons to buttons 1-4 in VJoy. Then scroll down to Left Stick X and Left Stick Y, map these to Left and Up. Finally, map Right Stick X to Slider+. Save this configuration (if you don't see a save button, press Esc). (Screenshot, screenshot)
- You can now close Big Picture and VJoy. You don't need to run them again.
2) In your demoknight config, add the line "joy_axis_deadzone 0".
Now TF2 should detect VJoy and the script should work exactly like before.
One last important note: Sometimes TF2 will execute 360controller.cfg automatically when it detects a new controller, and this messes up several joystick parameters. If the script is working, but doesn't feel right (turns too slowly, feels like it has acceleration) then run your demoknight.cfg again to correct these parameters. 360controller.cfg may also change some HUD parameters, which you'll have to fix. I haven't been able to find a solution to completely stop this from happening. (EDIT: I'm pretty sure this can be solved by creating an empty 360controller.cfg, put it in the same folder as your other scripts).
3
u/Crit-a-Cola Apr 16 '13
I need some help with this script, or at least, one of the steps.
I installed "VJoy Virtual Joystick Driver v1.2" exactly as the readme said, I set up the script and all that, I did everything I possible could do in order to set this script up, but I see no entries at all. Advanced doesn't have anything inside it either, which is confusing to me. Did I install it wrong? I chose the second to last link on the download page, very bottom.
5
u/KumoNin Sep 07 '13
I have a problem, I can't edit the buttons in Big Picture.
1
u/uberplebian Apr 08 '13
I may seem dumb but is the shortcut supposed to still say error: usage when i run it? Cause i can't seem to get the script to work.
1
u/niicol Apr 09 '13
i have italian pc and i dont find the "target" thing in the file properties. is it the destination of the file or what?
1
u/CommanderStamen Apr 09 '13
Got a question. I have the thing all set up, sensitivity set up and everything, but when I run it and boot the game, it doesn't do anything. What could I do to fix that?
1
u/mellowyellower Apr 15 '13
Is this able to turn on and off? I like to demopan with this but I want to switch it off web I play another class.
1
u/[deleted] Apr 21 '13
is there any way to make it so the controls aren't swapped? like if i move my mouse right i turn right
1
u/woktie May 12 '13
I have 1 problem with it, the script seems to work fine for me and i installed it correctly but... normally my TF2 runs fine. but whever i use the script I have huge FPS lag... so i checked my processes and it seems that the "Mouse To Joystick.exe" takes up 48% of my CPU. I dont think this could be right? and is there any way to fix this? because the script is not worth it for me if i have Huge FPS lag because then i still cant land a hit with the charge.
1
u/eggstreme May 18 '13
Sounds really cool. However, of course I have a problem. After executing the script, and with the executable running, holding m2 does completely disable horizontal mouse movement, but turning doesn't work at all, so it doesn't seem to activate the joystick. In joy.cpl, the slider bar does move with the mouse, so your program and VJoy both work fine, but the program doesn't seem to work for me in game. Any ideas?
1
u/Scootbootman May 26 '13
Whenever i Try and use the script it says Vjoy.dll is missing but i checked its install i can't figure it out.
1
u/BlueLion_ Jun 04 '13
While I had no troubles getting this to work, and the turning feels very natural, I end up getting frame rate issues a few minutes in. Is this normal for vjoy/mouse to keyboard? I know this because as soon as I closed both programs and switched to scout, the frames went back to normal
1
u/MizzouriMan Jun 15 '13
Would it be possible to make a script like this for OSX?
1
u/[deleted] Jul 15 '13
http://www.youtube.com/watch?v=EozreJ9UHxY Install tutorial by Brilliance. He made it after I linked him this in steam chat. Feel free to watch it if you have any problems.
1
u/iporkii Jul 16 '13
It says "make sure the path and file name is correct." I did this:"C:\Users\Derp\Downloads\Windows\Mouse to Joystick.exe--sensitivity 4.04"
1
u/Marevin Aug 01 '13
Hi Kered, first of all, thanks for the effort you put into this, looks amazing. Wanted to ask, if using a mouse instead of the keyboard to steer the charge, do you still have the same turning cap like you have with the keyboard? Or is it possible to just make a 180º turn right away with the mouse?
1
u/rdj107 Aug 30 '13
Err, by slider+ do you mean slider-? In the picture yjr mapped button is -
1
u/Diskein Sep 07 '13
I have followed all the steps, and I really dont know what I did wrong, the script makes once M2 is pressed, turning left or right is awfully slow, its not steady, it does move to the direction I want, but not at the speed I want, it moves more like a pixel per second... any help? I have set the right sensitivity in Mouse to Joystick shortcut, chose another preferred device, correctly set maps to the "controller" and I am running TF2 with the little program working...
1
u/alicia31 Sep 10 '13
I need some help with Mouse to Joystick.exe, i have error:usage like this: http://i.imgur.com/rANH0jv.jpg What can i do for fix this problem
1
u/Bielthepedreiro Sep 12 '13
My charge is like this = ~~~~ :(
1
u/HVoit Sep 14 '13
I need some help with this.My big picture looks like this http://imgur.com/WlrzTrp Also, only one controller shows up instead of 2.
1
u/FreddyTeddy Sep 14 '13
I did everything described by the guide. I put the extra command in the demoknight script, did exactly like you with Vjoy and Big Picture mode and I DO have the sensitivity parameter in the shortcut, and I exec the script exactly like I did before the update when it worked. yet it doesn't work.
WHY
1
u/Medibro Sep 18 '13
Finally got it working. What do I need to change in the Config to get KP_INS (Number Pad 0) to replace the default mouse 2? I tried modifying it myself but now I can only charge in absolute straight lines. I can't even turn one degrees.
1
u/endlessponders Sep 18 '13
OP. Anyone who has installed a controller that has xinput capabilities will not be able to use this. I recommend uploading your .cfg from the tenfoot folder so everyone can grab it and not open big picture mode. It'll just detect it from there hopefully.
Otherwise xinput is colliding with vjoy.
1
u/bad_at_smart Sep 22 '13
I too am getting a locked horizontal movement when holding m2.
I figure this means the cfg is installed and booted up correctly, and that the problem lies with VJoy itself.
My joy.cpl settings are all good, 2 controllers configured to "VJoy Virtual Joystick" (the only option given to me actually), so that's good.
I check my .exe shortcut I created, the only launch option being "--sensitivity 6" (even adapted my tf2 sensitivity, normally 10, to this). Ran it as admin.
Yet, my x-axis is still locked. I can turn upon releasing m2, but not while holding it. Any idea what could be wrong?
1
u/Machine5757 Jul 29 '24
Hey! i don't know if you made this script, but would it be possible to modify it to make it so you can walk as if you were barely pushing the left stick on a controller? (to walk real slow, like 50 units/s)
3
u/[deleted] Sep 03 '13 edited Sep 03 '13
I'm having trouble to get Steam to recognize Vjoy. Everytime I try it only says "XInput controller detected" and I can't even edit the controls. I mean literally, there is no button for editing controls on the screen inside the controller settings.
1
u/TimePath Apr 08 '13
Congratulations on getting this working, this could also be useful to any aspiring game developer wishing to support joysticks who doesn't own any.
On an abstract level, how does it work?
2
u/[deleted] Sep 22 '13 edited Sep 23 '13
i need some help, when i use the script, instead of turning, i end up looking up and down. i have all setting exactly like the screenshots.
[EDIT] i've worked out that the game disabled the horizontal mouse and didnt activate the virtual joystick, how can i sort this out?
1
u/Tupar Apr 16 '13
I need help getting this to work. I've installed everything correctly to the best of my knowledge, and when activating the demoknight exec it disables turning left and right completely when holding down m2.
1
u/Catalan102 Apr 23 '13
The mouse one is way harder to setup i rather keep the normal one unless kered is willing to walk me through step by step but i hardly doubt it even though the mouse one does sound better and easier :(
1
u/jansteffen May 07 '13
Hey, I might be really stupid, but how do I add the sensitivity flag? This is the default "C:\Users\Jan\Downloads\Mouse to Joystick\Windows\Mouse to Joystick.exe" (with the "s) now where do I add the flag? I tried "C:\Users\Jan\Downloads\Mouse to Joystick\Windows\Mouse to Joystick.exe --sensitivity 4"
"C:\Users\Jan\Downloads\Mouse to Joystick\Windows\Mouse to Joystick.exe" --sensitivity 4
"C:\Users\Jan\Downloads\Mouse to Joystick\Windows\Mouse to Joystick.exe--sensitivity 4"
but it keeps telling me that it's invalid...
1
u/Holypear May 19 '13
I'm having a problem, everything works and both controllers are running, but when I hold M2, I can only look up/down, any horizontal mouse movements are blocked. Maybe I'm putting the sensitivity into that shortcut wrong? I put it in as "6 sensitivty"
1
u/UnAVA Jun 06 '13
Hmm I've tried a lot of things like deleting all of my old controller drivers, unplugging all of my controllers, etc. But I can't get the Slider to actually move when I move the mouse.
I have Mouse to Joystick running as admin and have VJoy as Preferred Device, but the slider just does not move. I tried with both the full version and the driver only version of VJoy 1.2. What am I doing wrong here?
1
u/[deleted] Jun 10 '13
The Mouse to Joystick refuses to stay open for more than enough to see it flash on my screen. What is going wrong?
1
u/iporkii Jul 16 '13
The shortcut thing has me stuck. What do you mean by "shortcut"? Sorry, I'm a retard.
1
u/simplyASI9 Jul 17 '13
Wasn't working for me at first, then I copied the autoexec and demoknight cfg files from tf\custom\whatever into tf\cfg and it worked
1
u/[deleted] Aug 02 '13
Commenting to come back later
1
u/[deleted] Aug 30 '13 edited Aug 31 '13
just wanted to add to this, if you have your active weapon appearing in the center of your screen or anywhere whenever you switch, you can fix it by going to options then click advanced and turn off quick switch, hit apply, then re-enable quickswitch and click apply.
Edit: a more effective way would be to add hud_fastswitch 1 to your demoknight.cfg You can also revert from the 360 control scheme by executing undo360controller
1
u/jansteffen Aug 31 '13
Thanks for giving updating advices after the patch, good to see that you're still keeping everything up to date around here. The only thing that bothers me is that mouse to joystick always seems to use an entire core of my quad CPU, which is quite brutal for the CPU after some time
1
u/FLYuri Sep 03 '13
kered13 if you ever find a way to bypass the 360controller do let me know, im still having problem with the script, thanks a bunch !
1
u/MrStylo Sep 10 '13
I binded everything that needs to - and nothing. Tho mouse can easily looks up and down. Don't know what to do now, everything worked before this update.
1
u/Maixell Jan 20 '23
That's interesting but seems like a lot of works for à video game.
1
u/Kiwifarmer Apr 08 '13
This is amazing. Thanks a lot for the effort!
1
u/KingSupaDupa Jul 12 '13
Amazing! This makes charging so much more fun
-1
u/iporkii Oct 03 '13 edited Oct 03 '13
I tried it, And whenever I move my mouse to the edge of the mousepad, I do an about 90 degree horizontal turn. Like, it looks like Im aimbotting. So, I guess you can say I cant turn at all. I had this script before the update, and now I cant seem to get it to work :c Also, you say to edit slider+, but the screenshot shows slider-.
EDIT:I'm so sorry! I had an earlier installation of the script in another folder. I deleted it and now it works! It is kinda annoying though, I suddenly do 90 degree turns suddenly.
EDIT OF MY EDIT: Its because I had my 'A' key bound to slider+ when air strafing.
Thanks!
0
u/[deleted] Apr 21 '13
[deleted] — view deleted comment
0
u/[deleted] May 02 '13
[deleted] — view deleted comment
0
u/[deleted] Aug 04 '13
[deleted] — view deleted comment
0
u/[deleted] Aug 12 '13
[deleted] — view deleted comment
0
u/[deleted] Aug 30 '13
[deleted] — view deleted comment
0
u/[deleted] Sep 05 '13
[deleted] — view deleted comment