STAR WARS™: Dark Forces

STAR WARS™: Dark Forces

View Stats:
Shinken Nov 24, 2015 @ 8:00am
Alternative to GlovePIE for vertical mouse aiming (FreePIE)
If you have issues with the increasingly outdated GlovePIE or simply prefer FreePIE here's a FreePIE script that's somewhat similar to the GlovePIE script in the guide.

2017 Update:
I've seen this post has gained some traction on third party sites.
So here's a far improved and updated version of the FreePIE script that runs alot more smoothly because it is using math functions to make vertical aiming feel better:

if starting: deltanumbers = [0] * 50 toggle1 = 0 toggleUp = 0 toggleDown = 0 counter = 0 if counter < 33: counter += 1 #mouse calibration if mouse.deltaY < 0: deltanumbers.append(1) elif mouse.deltaY > 0: deltanumbers.append(-1) else: deltanumbers.append(0) deltanumbers.pop(0) deltaavg = sum(deltanumbers, 0.0) / len(deltanumbers) deltafreq = math.log1p(abs(abs(deltaavg) * math.pow(10,13) - math.pow(10,13))) if deltaavg > 0 and (counter > deltafreq or counter > 30): toggleUp = 1 toggleDown = 0 counter = 0 elif deltaavg < 0 and (counter > deltafreq or counter > 30): toggleUp = 0 toggleDown = 1 counter = 0 else: toggleUp = 0 toggleDown = 0 #------------ #keybindings: #------------ if mouse.getButton(2) or mouse.getButton(3) or mouse.getButton(4) == True: toggle1 = 1 else: toggle1 = 0 #Lookup / Lookdown: keyboard.setKey(Key.PageUp, toggleUp) keyboard.setKey(Key.PageDown, toggleDown) #Centerview on other mouse buttons: keyboard.setKey(Key.NumberPad5, toggle1) #Secondary Fire on right mouse button: keyboard.setKey(Key.Z, mouse.getButton(1)) #Scroll through weaoons with mouse wheel keyboard.setKey(Key.F9, mouse.wheelDown) keyboard.setKey(Key.F10, mouse.wheelUp)


you can make a shortcut to start FreePIE and directly run the script with this line in the shortcut:
C:\Program Files (x86)\FreePIE\FreePIE.exe "C:\Users\Username\Documents\NameOfScript.py" /run
Last edited by Shinken; Nov 22, 2017 @ 5:52am
< >
Showing 1-12 of 12 comments
Shinken Nov 20, 2017 @ 9:33am 
2017 Update merged with 1st post
Last edited by Shinken; Nov 20, 2017 @ 10:42am
Sorta works, but I can only look up or down if I move my mouse back and forth very slowly, and even then, it only moves one pixel at a time.
Shinken Dec 2, 2017 @ 1:17am 
That's actually the opposite to thing the script does on my PC. Maybe related to mouse sensivity? I have my mouse at default 6/11 windows sensitivity @ 2100 dpi.

You can add the following lines to the script and monitor better what it does in the "Watch" tab of freePIE:

diagnostics.watch(keyboard.getKeyDown(Key.PageUp)) diagnostics.watch(keyboard.getKeyDown(Key.PageDown)) diagnostics.watch(mouse.deltaY) diagnostics.watch(deltanumbers[0]) diagnostics.watch(deltaavg) diagnostics.watch(deltafreq)

if you move your mouse just a bit and deltafreq is close to 30, not much should be happening while if you're your mouse hard and deltafreq goes to zero, it should trigger PageUP/PageDown most of the time.
Last edited by Shinken; Dec 2, 2017 @ 1:25am
Deltafreq seems to be staying at a constant 29 for all movements, at the defualt sensitivity on my mouse.

I copied the script as is from here, with changes to invert vertical mouse look.
Last edited by PÖIЙ† βLΛЙK; Dec 2, 2017 @ 9:13am
Shinken Dec 2, 2017 @ 9:52am 
can you repost it with your changes? I'll give it a look - never made it with easy invertability in mind.
It was still not moving properly, even beofre inverting the aim.

if starting: deltanumbers = [0] * 50 toggle1 = 0 toggleUp = 0 toggleDown = 0 counter = 0 if counter < 33: counter += 1 #mouse calibration if mouse.deltaY < 0: deltanumbers.append(1) elif mouse.deltaY > 0: deltanumbers.append(-1) else: deltanumbers.append(0) deltanumbers.pop(0) deltaavg = sum(deltanumbers, 0.0) / len(deltanumbers) deltafreq = math.log1p(abs(abs(deltaavg) * math.pow(10,13) - math.pow(10,13))) if deltaavg > 0 and (counter > deltafreq or counter > 30): toggleUp = 1 toggleDown = 0 counter = 0 elif deltaavg < 0 and (counter > deltafreq or counter > 30): toggleUp = 0 toggleDown = 1 counter = 0 else: toggleUp = 0 toggleDown = 0 #------------ #keybindings: #------------ if mouse.getButton(2) or mouse.getButton(3) or mouse.getButton(4) == True: toggle1 = 1 else: toggle1 = 0 #Lookup / Lookdown: keyboard.setKey(Key.PageDown, toggleUp) keyboard.setKey(Key.PageUp, toggleDown) #Centerview on other mouse buttons: keyboard.setKey(Key.NumberPad5, toggle1) #Secondary Fire on right mouse button: keyboard.setKey(Key.Z, mouse.getButton(1)) #Scroll through weaoons with mouse wheel keyboard.setKey(Key.F9, mouse.wheelDown) keyboard.setKey(Key.F10, mouse.wheelUp) diagnostics.watch(keyboard.getKeyDown(Key.PageUp)) diagnostics.watch(keyboard.getKeyDown(Key.PageDown)) diagnostics.watch(mouse.deltaY) diagnostics.watch(deltanumbers[0]) diagnostics.watch(deltaavg) diagnostics.watch(deltafreq)
Shinken Dec 4, 2017 @ 3:28am 
Yes. Also swapping those two buttons should really make no difference.

if you look again at the watch tab: probably the most important number is "mouse.deltaY" because that's the "raw" value given to the program by the system that everything else is based upon.
Hence if you want to really simplyfy the procedure for testing, this new script would suffice:

if starting: toggleUp = 0 toggleDown = 0 if mouse.deltaY > 0: toggleUp = 1 toggleDown = 0 counter = 0 elif mouse.deltaY < 0: toggleUp = 0 toggleDown = 1 counter = 0 else: toggleUp = 0 toggleDown = 0 keyboard.setKey(Key.PageUp, toggleUp) keyboard.setKey(Key.PageDown, toggleDown) diagnostics.watch(keyboard.getKeyDown(Key.PageUp)) diagnostics.watch(keyboard.getKeyDown(Key.PageDown)) diagnostics.watch(mouse.deltaY)

How is it acting?

Ideally it shoud stay above or below 0 if you continuingly move the mouse in one direction regardless how fast you move it (other than moving it really slowly). It's a binary thing in the other script as well, because we're only serving the two outputs "Up" or "Down" and nothing in between.
Last edited by Shinken; Dec 4, 2017 @ 3:41am
Hmm, still hardly any movements, but it makes a lot more movement than the previous script. It still makes small adjustments the slower I move the mouse, but almost none otherwise.

Enhance Pointer Precision is unchecked
Last edited by PÖIЙ† βLΛЙK; Dec 8, 2017 @ 3:08am
Shinken Dec 5, 2017 @ 5:58am 
I'll have a chat with the FreePIE developer. Hopefully he knows how to solve this issue.
BeefEatingRobot Dec 11, 2018 @ 12:59am 
Hate to bump a dead thread but has there been any progress made on the inverted script?
Shinken Dec 11, 2018 @ 12:28pm 
Originally posted by BeefEatingRobot:
Hate to bump a dead thread but has there been any progress made on the inverted script?
have you tried the regular script? Do you have the same "slow movements" problem even if it's not inverted?
BeefEatingRobot Jan 31, 2019 @ 2:39pm 
Originally posted by Shinken:
Originally posted by BeefEatingRobot:
Hate to bump a dead thread but has there been any progress made on the inverted script?
have you tried the regular script? Do you have the same "slow movements" problem even if it's not inverted?

It does
< >
Showing 1-12 of 12 comments
Per page: 15 30 50