jalsina wrote:But yet your script for AI filling water when it goes below 80%, would or would not work (or at least implemented), given what you are mentioning in this post (even if the variable keeps reading 0)?
I hope DTG /Kuju are in knowledge of the bug which comes at least from TS2015, but probably is one of those core older codes from Kuju.
It seems there has been some problems in the newest European locomotives like the Peppercorn K1 and in Riviera50s.
I don´t remember well, but I think a similar bug was also present in MSTS.
It's one of those bugs that, I think, will never be fixed.
The problem with what I tried to do in the script is that I can't simply turn on the injector in the AI loco when the water level falls below, say, 80%, because there's no way of knowing the true level. So the script was keeping the injectors on all the time (I realised that when I noticed the constant sound of the injectors, coming from the AI loco). I don't even know if the injectors make any difference to the AI loco (as I can't read the water level in them). Basically, the problem with the AI locos is that they operate on very, very simplistic rules. Virtually every core code controller that you try to read from an AI loco comes back with either 0 or a null pointer. You can read the speed, but that's just about all you can read from the core code, for an AI.
jalsina wrote:Once you have it implemented in the Consolidation scripting, how do you print it? Is it a key stroke that displays a screen reading?
The only way I know to get the mass of a train is using the Custom consist editor. I don´t even know if there is something to read it in the Build scenario editor.

I put that line somewhere in the "Update" function in the engine's script, so that it gets called continually (roughly once every 10-20ms). The call to "ScenarioManager:ShowInfoMessageExt" makes the message appear in a dialogue box in the centre of the screen. I find that more useful than using a Print call that puts the text into one of the LogMate tabs, because I can watch values changing in real time, and it's not limited to control values (I can put anything I like in that message - even a simple "Hello" to know that I reached a particular line in a particular function in the script). There are other ways of debugging - another is to run TS in windowed mode with the "-ShowControlStateDialog" launch option, so that you can watch the values of all the controllers.