So what i've found in DieselEngine.cs:
There is an enum:
public enum SettingsFlags
{
IdleRPM = 0x0001,
MaxRPM = 0x0002,
StartingRPM = 0x0004,
StartingConfirmRPM = 0x0008,
ChangeUpRPMpS = 0x0010,
ChangeDownRPMpS = 0x0020,
RateOfChangeUpRPMpSS = 0x0040,
RateOfChangeDownRPMpSS = 0x0080,
MaximalPowerW = 0x0100,
IdleExhaust = 0x0200,
MaxExhaust = 0x0400,
ExhaustDynamics = 0x0800,
ExhaustColor = 0x1000,
ExhaustTransientColor = 0x2000,
DieselPowerTab = 0x4000,
DieselConsumptionTab = 0x8000,
ThrottleRPMTab = 0x10000,
DieselTorqueTab = 0x20000,
MinOilPressure = 0x40000,
MaxOilPressure = 0x80000,
MaxTemperature = 0x100000,
Cooling = 0x200000,
TempTimeConstant = 0x400000,
OptTemperature = 0x800000,
IdleTemperature = 0x1000000
}
When the eng is loaded, then each parameter does something with this initlevel ( don't know what, i've usually check parameters with a simple boolean if i writing a code in java.)
...
case "idlerpm": IdleRPM = stf.ReadFloatBlock(STFReader.UNITS.Power, 0); initLevel |= SettingsFlags.IdleRPM; break;
case "maxrpm": MaxRPM = stf.ReadFloatBlock(STFReader.UNITS.None, 0);initLevel |= SettingsFlags.MaxRPM; break;
case "startingrpm": StartingRPM = stf.ReadFloatBlock(STFReader.UNITS.None, 0); initLevel |= SettingsFlags.StartingRPM; break;
...
This thing checks for all of the settings, however i don't know why, because every setting has a default. And of course the initLevel never equals with the result of that long code( initlevel should be around 400000, but the code gives back ~3 million), so makes the code fall back to MSTS diesel settings:
public bool IsInitialized
{
get
{
if (initLevel == (SettingsFlags.IdleRPM | SettingsFlags.MaxRPM | SettingsFlags.StartingRPM | SettingsFlags.StartingConfirmRPM | SettingsFlags.ChangeUpRPMpS | SettingsFlags.ChangeDownRPMpS
| SettingsFlags.RateOfChangeUpRPMpSS | SettingsFlags.RateOfChangeDownRPMpSS | SettingsFlags.MaximalPowerW | SettingsFlags.IdleExhaust | SettingsFlags.MaxExhaust
| SettingsFlags.ExhaustDynamics | SettingsFlags.ExhaustTransientColor | SettingsFlags.DieselPowerTab | SettingsFlags.DieselConsumptionTab | SettingsFlags.ThrottleRPMTab
| SettingsFlags.DieselTorqueTab | SettingsFlags.MinOilPressure | SettingsFlags.MaxOilPressure | SettingsFlags.MaxTemperature | SettingsFlags.Cooling
| SettingsFlags.TempTimeConstant | SettingsFlags.OptTemperature | SettingsFlags.IdleTemperature))
return true;
else
return false;
}
}
Now i've just changed the return false; in the else branch, to return true; to see what happens. And it works(with gearless diesel), just like as it written in the advanced ORTSDieselEngines, however the exhaust is a bit strange, but i just copied that from manual.
So it seems this IsInitialized method is wrong, but i don't know how it can be fixed. The problem is probably caused by that this code expects all of these settings set by eng parameters, even if there are defaults for all.
Another smaller problem, is this: case "cooling": EngineCooling = (Cooling)stf.ReadInt((int)Cooling.Proportional); initLevel |= SettingsFlags.Cooling; break ;
This cooling parameter is not mentioned in the manual (along with some other parameters, that are in the code), but it's also an Enum: NoCooling = 0, Mechanical = 1, Hysteresis = 2, Proportional = 3
I've tried to write in simple numbers to eng Cooling ( 3 ) for example, i've also tried Cooling ( Proportional ) but none of these are accepted, always writes "cannot parse constant number".