Page 1 of 1

Regulator(Throttle) and RPM. Where's the connection?

Unread postPosted: Sun Jan 05, 2014 5:49 pm
by bnsfsubdivision
Weird Subject, really but it pretty much describes my problem. I was wondering what the actual connection between the Regulator and the RPM is. The Throttle has by default the ControlName "Regulator" and controls the RPM value. But it can apparently have any other name assigned to it like "lvrThrottle" as example and it will still control the rpm even though there's nothing in the code which actually tells the Controller to control the rpm. I'm trying to set up a fake Regulator and fake rpm controller but I'm not able to let the fake Regulator change the fake rpm because I have no idea how to assign the regulator to them like it's the case with the default Throttle and the default RPM. I have been through every line in the simulation files and can't seem to find any connection. Hopefully some of you experienced folks know something and can help me out. Thanks in advance! *!!wink!!*

Re: Regulator(Throttle) and RPM. Where's the connection?

Unread postPosted: Sun Jan 05, 2014 8:29 pm
by mrennie
bnsfsubdivision wrote:Weird Subject, really but it pretty much describes my problem. I was wondering what the actual connection between the Regulator and the RPM is. The Throttle has by default the ControlName "Regulator" and controls the RPM value. But it can apparently have any other name assigned to it like "lvrThrottle" as example and it will still control the rpm even though there's nothing in the code which actually tells the Controller to control the rpm. I'm trying to set up a fake Regulator and fake rpm controller but I'm not able to let the fake Regulator change the fake rpm because I have no idea how to assign the regulator to them like it's the case with the default Throttle and the default RPM. I have been through every line in the simulation files and can't seem to find any connection. Hopefully some of you experienced folks know something and can help me out. Thanks in advance! *!!wink!!*


There are some predefined control variable names that act as keywords for the core code, and "Regulator" is one of them. Maybe you saw "lvrThrottle" in the "Pick transform name" field of the Interior Lever interface element connected to the control value. If, on the other hand, you've seen a control value with the control name "lveThrottle", then that would be a fake control value that's connected to a throttle lever in the cab, but elsewhere in the engine blueprint there would have to be another control value named "Regulator" (but with no associated interface element). The trick then is to have the engine's LUA script read the position of the "lvrThrottle" (the control manipulated by the player), do some internal manipulations and conversions on that value, and then assign the result to "Regulator" so that it's passed on into the core code, where the rpm is calculated. If you know how to programme and understand LUA code, you can do some really fancy stuff with control variables.

Re: Regulator(Throttle) and RPM. Where's the connection?

Unread postPosted: Sun Jan 05, 2014 8:52 pm
by BNSFdude
If you have it, look at the LUA for the Class 57/0. Simon Hall basically bypassed every core control he could to get more realistic performance for it.

Re: Regulator(Throttle) and RPM. Where's the connection?

Unread postPosted: Mon Jan 06, 2014 3:47 am
by bnsfsubdivision
mrennie wrote:There are some predefined control variable names that act as keywords for the core code, and "Regulator" is one of them.

I thought so and that's exactly what I wanted to know. I will set up a new script as my current one doesn't do exactly what I need as I described and will post here once I'm successful. Thank you guys for your help and hopefully I'll be able to grab somewhere an old copy of the Class 57/0 to avoid the lua.out's and to learn out of Simon's work.