Hey everyone! Lets chat a bit about the InputController. For those of you unfamiliar with it, this post won't mean much to you. For the XML modders (and Overload mod users) out there that are familiar with it, there are a few changes to it in the 1.7 release that you may like to be aware of.
Before 1.7
The 'input' attribute defines the input axis associated with the controller. This might be a normal axis like 'Roll' or 'VTOL' which returns a value anywhere from -1 to 1 or it might be a boolean type input that is either on or off like 'LandingGear' or 'FireWeapons'. Prior to 1.7, those boolean type inputs would return an axis value of 0 or 1.
Input controllers have a 'min' and a 'max' value. If the value of an input axis is greater than 0, the input value is multiplied by the controller 'max' value to get the final output value of the input controller. If the input axis is less than 0, the absolute value of the input axis value is multiplied by the controller 'min' value to get the final output value. An input of zero will always return an output of 0. If the 'invert' attribute is set to 'true' the the value of the input axis is inverted and then the same min/max logic applies.
Example: input="Roll" min="-0.5" max="1" invert="false"
Input: 1 --> Output: 1
Input: 0.5 --> Output: 0.5
Input: 0 --> Output: 0
Input: -0.5 --> Output: -0.25
Input: -1 --> Output: -0.5
Example: input="Roll" min="-0.5" max="1" invert="true"
Input: 1 --> Output: -0.5
Input: 0.5 --> Output: -0.25
Input: 0 --> Output: 0
Input: -0.5 --> Output: 0.5
Input: -1 --> Output: 1
Example: input="LandingGear" min="-0.5" max="1" invert="false"
Input: 1 --> Output: 1
Input: 0 --> Output: 0
Example: input="LandingGear" min="-0.5" max="1" invert="true"
Input: 1 --> Output: -0.5
Input: 0 --> Output: 0
1.7 Changes
The 1.7 update introduces 2 important changes that you should be aware of when working with an InputController. Boolean inputs now return a value of -1 or 1 rather than the 0 or 1 that they used to. This allows those inputs to better take advantage of the min/max values of an input controller. The other change is the addition of the 'invertType' XML attribute.
The 'invertType' can be set to 'axis' or 'output'. The default for most parts is 'axis' and the default for rotators is 'output'. This affects the behavior of controller when 'invert' is set to 'true'. The invert type of 'axis' works just like the old input controller did, where the axis input value is inverted and then the min/max logic runs. If set to 'output' the input controller uses the non-inverted input axis value, runs the min/max logic, and then inverts the output of the controller.
When opening up an old plane file, the game should automatically do any conversions necessary to keep the same functionality as before. This may involve swapping the min/max values and toggling the invert flag. When creating things like custom landing gear on rotators, you may now find yourself needing to set the min value to 0 and the max value to 1 so that the rotator works similar to before the update.
While some things may require a slightly different approach than before, you should still have all the same functionality as before as well as some new functionality.
Example: input="Roll" min="-0.5" max="1" invert="false"
Input: 1 --> Output: 1
Input: 0.5 --> Output: 0.5
Input: 0 --> Output: 0
Input: -0.5 --> Output: -0.25
Input: -1 --> Output: -0.5
Example: input="Roll" min="-0.5" max="1" invert="true" invertType='axis'
Input: 1 --> Output: -0.5
Input: 0.5 --> Output: -0.25
Input: 0 --> Output: 0
Input: -0.5 --> Output: 0.5
Input: -1 --> Output: 1
Example: input="Roll" min="-0.5" max="1" invert="true" invertType='output'
Input: 1 --> Output: -1
Input: 0.5 --> Output: -0.5
Input: 0 --> Output: 0
Input: -0.5 --> Output: 0.25
Input: -1 --> Output: 0.5
Example: input="LandingGear" min="-0.5" max="1" invert="false"
Input: 1 --> Output: 1
Input: -1 --> Output: -0.5
Example: input="LandingGear" min="-0.5" max="1" invert="true" invertType='axis'
Input: 1 --> Output: -0.5
Input: -1 --> Output: 1
Example: input="LandingGear" min="-0.5" max="1" invert="true" invertType='output'
Input: 1 --> Output: -1
Input: -1 --> Output: 0.5
Its also worth pointing out that we have a 'zeroOnDeactivate' attribute as well that, if set to 'true', will cause the output of the controller to be zero when its activation group is not enabled.
Let me know if you have any questions, concerns or problems. Thanks!
anyone know how the pigpen canard rotator works with the string command written like this?
clamp(Canard/40 + String etc...)
@Holdupboi in 1.9 above, use
sum(input)
orsum(input * multiplier)
if you want something faster@Holdupboi set input to a insanely high number
has the
zeroOnDeactivate
attribute been removed?Wait
Hold on
inputType
?How do I make an infinite rolling rotator? Because I want to make a gatling cannon
Will the next update fix the mods on mobile to be fixed because I made a plane with a lot of mods but when I was going to use it with out knowing the mods weren't working and my game crashed and my simple planes files were corrupted and I had to buy the game again because it said that I didn't download it before can you help please?
trying to figure out how to get reverse lights to show up on my car, i can set it to pitch control but it won't let me save any changes other than that, no min, max, or input inverse. Are lights affected by any of these or am I missing something?
Edit: I see now that BeaconLight.State is different from InputController.State. I really want better lighting. D: As of right now I can get brake lights to work though.
How do you invert input in a BeaconLight? They don't have the same inputController
thing as normal Input-controlled parts
Yes @Weaverfish
Possible to set a detacher to activate with anything other than activation group 1-8?
@NathanMikeska zeroOnDisable does not work on cycling pistons
First insight at booleans:
"WTF IS HAPPENING WITH MY LANDING GEAR?!"
remembers this post
._.
oh yeah
Thank you. So many people have been saying that they were glitched. I'm glad I won't be seeing those types of posts again. They were getting a bit obnoxious.
Speaking of literal input controllers, can you make iOS devices connected to keyboards able to recognise all the keyboard controls?
Nice thank you. This answered a few questions I was mulling over.
@WNP78 ok thanks dad
@F104Deathtrap in like an hour (I have homework) ill mention you on an unlisted version, but it should be fine, the stabs are all the way at the back
LOW SPEED ROLL AILERONS CONFIRMED
@ElGatoVolador yes, there already is.
launchCountermeasures
I believe@MechWARRIOR57 Are you sure your stabilizers are large enough and far enough to the rear of your bomber?
@alexchub1 Boolean used to be 1 or 0, now it's 1 or -1. Boolean means only 2 possible outputs, like a light switch. Also, there are a couple ways we can reverse the controls now.
... I have no idea...
Will we get a input for counter measures?
Can someone explain in normal way??