Space Engineers

Space Engineers

Ba-Sing-Se Adjustable Thrusters
DedeJuozapas 25 Dec, 2024 @ 5:56am
AdjustThrustMultiplierSlider value is gone after reloading the game
Hello @Arbiter, I was trying to create a script for a ship to automatically adjust thruster multiplier and found out about a weird glitch happening when the world is turned off and loaded again. AdjustThrustMultiplierSlider value disappears and magically returns when on the control panel menu I press on the thruster itself. Not changing any value, just pressing on the thruster object in the menu of active grid blocks. This fixes the AdjustThrustMultiplierSlider value for all the other grids and their thrusters as well. Here is the script I used to determine if the value exists:

void Main(string argument, UpdateType updateSource)
{
// Get all thrusters on the grid
List<IMyThrust> thrusters = new List<IMyThrust>();
GridTerminalSystem.GetBlocksOfType(thrusters);

if (thrusters.Count == 0)
{
Echo("No thrusters found on the grid.");
return;
}

// Iterate over each thruster
foreach (var thruster in thrusters)
{
// List all terminal properties
var properties = new List<ITerminalProperty>();
thruster.GetProperties(properties);

// Find and display only the "AdjustThrustMultiplierSlider" property
foreach (var property in properties)
{
if (property.Id == "AdjustThrustMultiplierSlider")
{
try
{
float value = thruster.GetValue<float>(property.Id);
Echo(value.ToString("F2"));
}
catch
{
Echo("[Error reading value]");
}
}
}
}
}

If the value exists code will output the multiplier values when we run the script. But when we reload the game, this script outputs nothing. As mentioned above, the value appears only when pressing on a thruster in the control panel.
I’m sorry for bothering you at this time of year. Even if it’s a small bug I would appreciate it if you look into this when you have the time.