ErickC, on 10 July 2020 - 09:51 AM, said:
I develop for other platforms, too, and what I have learned is that all we're really missing out on is more advanced materials and the ability to hard-code custom animations. But the thing is, we already add secondary maps to existing models in both MSTS and OR using parameters in the SD file, and you can always script animations externally. In fact, as I pointed out earlier, even though MSFS models can have custom hard-coded animations, the sim processes animations more efficiently when the model only contains code that tags it for an external module to control it. We already basically do this for signal models, so why can't we do it for other models and skip the middle man of adding code into models entirely?
A few years ago I actually made a custom OR branch, where I added a scripting interface that allowed – at least by my intention – all controls to be overtaken by the script, and it was also possible to define new ones by the script with custom names, connected to the 3D model animation nodes and cabview definitions, with a possibility to connect a custom sound sms to the script, and it was possible to create a custom keymap as well. That can be warmed up if there is a real demand of such a possibility within OpenRails. I haven't published that development officially, however I archived my branch to GitHub. To have an impression how I imagined at the first shot this interface, one could check (for coders only!) e.g. this file, a small, but more detailed description is available at the first part of it. The interface was as simple as having two functions:
SetControlValue("NameOfControl", index, value)
GetControlValue("NameOfControl", index)
where the "NameOfControl" is either a built-in MSTS or OR control name, or a custom one, implicitly defined at first use. Multiple scripts can be assigned to a locomotive, but the control names are common for all scripts connected to a locomotive.
I haven't tested it widely, at some time I wanted to discuss the interface with the community, just I didn't feel the time had came. It just dropped into my mind again, when I watched a video of those Russian guys presenting their locomotive model in their own simulator. It looks like its controls are widely detailed, all switches are working and add their own logic to the overall locomotive operation. This could never be possible to be accomplished with generalized controls, that OpenRails uses today, no matter how many additional controls are added. The program must be specialized to that specific locomotive. And this is where a script can help. The other case where a scipt can be useful if someone wants to model a window that can be opened by pressing Ctrl+Alt+Shift+Q. :)