Page 1 of 1

Making a rocker switch control in the cab?

Posted: Sat Jan 30, 2016 4:44 pm
by chrisell
Anyone have any tips on how to make a rocker switch control in the cab? ie. one which normally rests in the zero position but can be waggled forwards and backwards, always jumping back to zero?
Right now I have a 3-notch lever and my script looks at the value of the control - if it's larger than a certain value I force the control back to zero. It's a total hack and it only works with the keyboard - if you grab the control with the mouse, the "jump back" function is overridden by the fact that the mouse button is pressed. The HUD doesn't work at all. I've tried "interior tri switch" but that doesn't seem to do much different.

This is for the DH1 DH2 "Wadloper" project I'm finishing up. The throttle control is a joystick that you waggled forwards and backwards to increase/decrease the engine power in discreet steps. My scripts can deal with the discreet steps to change the regulator power but the GUI control is just not ideal right now.

Any ideas?
2016-01-26_00004.jpg

Re: Making a rocker switch control in the cab?

Posted: Sun Jan 31, 2016 2:10 am
by metrobus
Couldn't you make it an irregular notch controller with a single notch at 0.5 and have the reset to notch checkbox ticked.
regards
Edward

Re: Making a rocker switch control in the cab?

Posted: Sun Jan 31, 2016 2:50 pm
by chrisell
metrobus wrote:Couldn't you make it an irregular notch controller with a single notch at 0.5 and have the reset to notch checkbox ticked.
regards
Edward
Wow. That worked. Not sure how it works but it does. I thought with there only being one notch, the lever would be stuck there and be unmovable - I thought you needed notches at the extents of the input values but apparently not. My input range is -1 to +1 with 'no input' being 0 so I made the single notch be at zero and checked "rest in notched position" and it works.
Thanks for the tip.