Jump to content

firebyte

Pre Member
  • Content Count

    1
  • Joined

  • Last visited

  • Medals

Posts posted by firebyte


  1. For those who wish to use the Thrustmaster TWCS throttle, I've thrown together a FreePIE script which utilises all of the buttons and applies the full-range-throttle-fix as per other comments here.

     

    The throttle and vJoy ID numbers can be changed simply in the script, without needing to change every reference by using THROTTLE_ID and VJOY_ID respectively.

     

    Hope this helps!

     

    # Thrustmaster TWCS Mapping Script for Arma 3 with FreePIE
    # Fixes throttle issues associated with Arma 3.
    # By firebyte
    # https://forums.bistudio.com/topic/104325-a-fix-for-full-axis-throttle-mapping/
    
    # When plugging and unplugging your devices, the ID number
    # of your device may change. Rather than trying to find
    # each reference to the device in the script, just change
    # the respective values below.
    
    # THROTTLE_ID is the ID number of your physical TWCS throttle.
    
    # VJOY_ID is the ID number of the vJoy instance your TWCS throttle
    # is supposed to pass data to, from FreePIE.
    
    THROTTLE_ID = 0
    VJOY_ID = 0
    
    # There has been discussion about adding referencing for devices 
    # by name here: http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=21709
    # NOTE: This will require a custom build of FreePIE, as discussed in the
    # thread.
    
    def update():
    
    	# TWCS Ministick 2 (X,Y)
    	vJoy[VJOY_ID].x = (joystick[THROTTLE_ID].x)
    	vJoy[VJOY_ID].y = (joystick[THROTTLE_ID].y)
    	
    	# TWCS Throttle Axis (Z)
    	vJoy[VJOY_ID].z = (joystick[THROTTLE_ID].z)
    	
    	# TWCS Rocker Axis (RZ)
    	vJoy[VJOY_ID].rz = (joystick[THROTTLE_ID].zRotation)
    	
    	# TWCS Antenna Axis (Slider 0)
    	vJoy[VJOY_ID].dial = (joystick[THROTTLE_ID].sliders[0])
    	
    	# TWCS 8-directional POV (aka D-Pad)
    	# setAnalogPOV() is used to update the POV hat's
    	# direction, when the hat is used on the controller.
    	vJoy[VJOY_ID].setAnalogPov(0, joystick[THROTTLE_ID].pov[0])
    		
    	
    if starting:
    	virtualAxisMax = vJoy[VJOY_ID].axisMax
    	joystick[THROTTLE_ID].setRange(0, virtualAxisMax)
    	vJoy[VJOY_ID].dial = joystick[THROTTLE_ID].sliders[1]
    	freeTrack.update += update
    	
    # Buttons are programmed as labelled on TWCS Throtlle Manual
    # found at http://ts.thrustmaster.com/download/accessories/manuals/TWCS_throttle/TWCS_Throttle_Manual_All.pdf
    
    # Python is a zero-index language, meaning that Button 1 
    # is Button 0 when accessed programmatically.
    
    # Button 1
    if joystick[THROTTLE_ID].getDown(0):
    	vJoy[VJOY_ID].setPressed(0)
    
    # Button 2
    if joystick[THROTTLE_ID].getDown(1):
    	vJoy[VJOY_ID].setPressed(1)
    
    # Button 3
    if joystick[THROTTLE_ID].getDown(2):
    	vJoy[VJOY_ID].setPressed(2)
    
    # Button 4
    if joystick[THROTTLE_ID].getDown(3):
    	vJoy[VJOY_ID].setPressed(3)
    
    # Button 5
    if joystick[THROTTLE_ID].getDown(4):
    	vJoy[VJOY_ID].setPressed(4)
    
    # Button 6 (TWCS Ministick Momentary Push Button)
    if joystick[THROTTLE_ID].getDown(5):
    	vJoy[VJOY_ID].setPressed(5)
    
    # Button 7
    if joystick[THROTTLE_ID].getDown(6):
    	vJoy[VJOY_ID].setPressed(6)
    
    # Button 8
    if joystick[THROTTLE_ID].getDown(7):
    	vJoy[VJOY_ID].setPressed(7)
    
    # Button 9
    if joystick[THROTTLE_ID].getDown(8):
    	vJoy[VJOY_ID].setPressed(8)
    
    # Button 10
    if joystick[THROTTLE_ID].getDown(9):
    	vJoy[VJOY_ID].setPressed(9)
    
    # Button 11
    if joystick[THROTTLE_ID].getDown(10):
    	vJoy[VJOY_ID].setPressed(10)
    
    # Button 12
    if joystick[THROTTLE_ID].getDown(11):
    	vJoy[VJOY_ID].setPressed(11)
    
    # Button 13
    if joystick[THROTTLE_ID].getDown(12):
    	vJoy[VJOY_ID].setPressed(12)
    
    # Button 14
    if joystick[THROTTLE_ID].getDown(13):
    	vJoy[VJOY_ID].setPressed(13)
    	
    
    # DIAGNOSTICS
    
    # TWCS Ministick 2 (X,Y)
    diagnostics.watch(joystick[THROTTLE_ID].x)
    diagnostics.watch(joystick[THROTTLE_ID].y)
    
    # TWCS Throttle Axis (Z)
    diagnostics.watch(joystick[THROTTLE_ID].z)
    
    # TWCS Rocker Axis (RZ)
    diagnostics.watch(joystick[THROTTLE_ID].zRotation)
    
    # TWCS Antenna Axis (Slider 0)
    diagnostics.watch(joystick[THROTTLE_ID].sliders[0])
    
    # TWCS 8-directional POV (aka D-Pad)
    diagnostics.watch(joystick[THROTTLE_ID].pov[0])
    
    # Button 0
    diagnostics.watch(joystick[THROTTLE_ID].getDown(0))
    
    # Button 1
    diagnostics.watch(joystick[THROTTLE_ID].getDown(1))
    
    # Button 2
    diagnostics.watch(joystick[THROTTLE_ID].getDown(2))
    
    # Button 3
    diagnostics.watch(joystick[THROTTLE_ID].getDown(3))
    
    # Button 4
    diagnostics.watch(joystick[THROTTLE_ID].getDown(4))
    
    # Button 5
    diagnostics.watch(joystick[THROTTLE_ID].getDown(5))
    
    # Button 6
    diagnostics.watch(joystick[THROTTLE_ID].getDown(6))
    
    # Button 7
    diagnostics.watch(joystick[THROTTLE_ID].getDown(7))
    
    # Button 8
    diagnostics.watch(joystick[THROTTLE_ID].getDown(8))
    
    # Button 9
    diagnostics.watch(joystick[THROTTLE_ID].getDown(9))
    
    # Button 10
    diagnostics.watch(joystick[THROTTLE_ID].getDown(10))
    
    # Button 11
    diagnostics.watch(joystick[THROTTLE_ID].getDown(11))
    
    # Button 12
    diagnostics.watch(joystick[THROTTLE_ID].getDown(12))
    
    # Button 13
    diagnostics.watch(joystick[THROTTLE_ID].getDown(13))
    
    # Button 14
    diagnostics.watch(joystick[THROTTLE_ID].getDown(14))
    

     

    • Like 1
×