Space Engineers

Space Engineers

Simple cruise control
Drakkath 14 sierpnia 2020 o 5:25
Determine the thruster type
Hello Andrew

Thanks for SCC, that's really great! I use it for my Atmo multi-purpose ship (transporter / miner). It would be great if I could also use SCC for my shuttle (planet-to-space). At the moment the ship only has Hydro propulsion, but as soon as I find platinum in my current game, I will convert the shuttle to Atmo + Ion. To do this, however, SCC would have to be able to control Atmo and Ion separately. This means that when the ship starts from the planet, first Atmo and as soon as Atmo no longer perform, switch to Ion.

You have written:

"Yes, it is programmatically impossible to distinguish the type of engines,"

This is possible, I myself use a method to distinguish between oxygen and hydrogen for gas tanks for my Airlock script. I have only had SE (love it) for a few months but have already written a few scripts for my personal needs. These were also my first C# programs, usually I program in other languages.

You can use the "BlockDefinition" property of the "IMyCubeBlock" interface to determine the internal name of the thruster. Then you can use the known list of names to determine the exact type of thruster:

https://github.com/malware-dev/MDK-SE/wiki/Type-Definition-Listing

If that would help you, I could write a function that you can then integrate into SCC to identify the thrusters. You just have to tell me how you want the function to be called and what exactly should be returned.
< >
Wyświetlanie 1-1 z 1 komentarzy
Andrew  [producent] 24 listopada 2020 o 9:48 
@Drakkath, I missed your message and only saw it now.
I know this, but unfortunately this method is not universal. This way I can only distinguish between 3 types of vanilla engines. In mod engines, BlockDefinition can be anything at all, and this method will not work.
That's why I didn't implement it. I don't want to make an algorithm that will only work in the vanilla world. I would have to say that the script distinguishes between engine types, but this would not be true.
We need a universal method that distinguishes the type of fuel. But this is not possible in IngameScript. This is probably easy to do in ModAPI, but alas.
< >
Wyświetlanie 1-1 z 1 komentarzy
Na stronę: 1530 50