Hello, I'm trying to change a control value with a key press. I want the B key press to swith the CVSwitchBatterie to 1. (Then later LOVE + B to reset the control value to 0, its initial value) I have uploaded the input mapper and the main engine blueprint file as attached files. Thank you!
Hi, after renaming .txt to .xml I have opened both files in BPE. Few things... InputMapper definition for B key is wrong. With button pressed down you´re increasing control start, but with button released you are decreasing control start. So even if you have defined your button as "PushAndHoldButton", B key in released position starts to decrease control value of associated controler, namely CVSwitchBatterie. So it will be always set to 0 when B key is released and will behave as a normal "PushButton". I suggest to change "DecreaseControlStart" to "IncreaseControlStop". This way when you release B key, controler CVSwitchBatterie should stay in position, as there´s no any input to set it back to 0. And put both sensitivities (analog and digital) to higher numbers, so the button will safely get to value 1, when you release B key, and won´t stay between 0 and 1 I use to use numbers between 40 - 60. As there´s no script attached, it´s hard to tell about the rest of it.
Hi, Thank you for your answer! I forgot to add the script files, oups I guess there is a problem there too as, even with the modification you suggest, it is still not working. As you can see, I'm not sure what to put where
I need to know what do you mean by LOVE + B. Also, you do not need to use two scripts with almost the same code. Usually, the one that belongs to simulation, is just a minimalistic one. The second, attached to main engine blueprint is the one responsible for loco behavior. Btw, you have literally nothing in those scripts, so no wonder nothing is working right now
In the real train, I think it is a lever to switch on the battery and a button on a screen to switch it off. As the "high resolution" cabine is in progress, I used a virtual controller (no animation, no link to a "real" action in the cab) to try to understand how to make the system work in TS.
Ok, and what happens when you switch that lever off?? Will go battery off as well, like when you push the button on display? Is that lever self-adjustabe, means will it return to 0 position, when you release it?? If you provide me enough info, I can prepare it for you. Btw, will you consider your loco as an expert one? Because control settings may depend on it. All my locos have the same InputMapper associated for all control levels - simple, intermediate and expert in engine blueprint.
Well, I was wrong it seems: the switch on is via a push bouton which return to a neutral position after press. The extinction is via a button around a screen. The aim is to provide a as realistic as possible Régiolis (https://en.wikipedia.org/wiki/Régiolis) which will be open source, so yes, I guess it can be called as expert one. The "stop and go" InputMapper will not be used, if possible. The external 3D is there and the work just begun with the 3D cabine. I don't know what you need to know ? Again, thank you for your answers, all are very helpful!
So if I understood it correctly, one button is switching battery ON, and another one on the screen is switching battery OFF. Am I correct?? If so, it needs two button controlers and one which will represent battery itself. Easy to do, with little scripting. Just confirm if I get it correcty or if I´m wrong.
Ok, here it is. Just rename it, export and try it. Do not forget to set the control type to Expert... It should work as follows - press B to switch batteries ON, and then press C to switch batteries OFF. Two buttons pressed at the same time does nothing, or at least should do nothing. Script is written very fast, so there may be mistakes, but overall it should work, if you export it properly.
I do not know where the problem is but it is still not working I made an "export with references", tried the files. As it what not working, I tried an "forced export with references" and it still the same thing...
Something must be wrong on your side then. This is so simple, just two buttons, and one Batterie controler, nothing more, so it must work... Do you really put those files where they should be? Do you delete Blueprints.pak in your assets folders after every change you make? Are all paths correct?? Check everything.