I posted on git (https://github.com/magu5026/ElectricTrain/issues/7), posting here so everyone know what's up. The new rewrite looks great, but needs some work to make it compatibility with Multiple Unit Train Control again. Also noticed the new code isn't on git yet.
Thanks for taking a look. I'm getting an error when I try to load ET 27 and MUTC 19 (after removing ET dependency). Was it working in another configuration? Note that MUTC does not create the "-mu" locomotives until data-updates.lua is called, unless we work out something different. ET 27 works when I remove MUTC (although migrating an older save from ET 13 didn't correctly unlock the new ET provider structure and I had to start a new save).
Reading your code, I see the problem. Here's what happens:
MUTC loads data.lua first, because it's a prereq for ET. No locomotives are created here.
ET loads data.lua and adds the et-locomotive-x.
Still in ET data.lua, ET checks for existence of MUTC, and attempts to access et-locomotive-x-mu, which does not exist because MUTC has not had a chance to discover et-locomotive-x in the data-update phase.
Game crashes, but if it didn't, data-updates would run and MUTC would detect the et-locomotive-x and add et-locomotive-x-mu here.
I would suggest moving the CreateTrainInterface("*-mu") commands to data-updates and keep MUTC as a pre-req for ET.
Thanks, I also fixed the dependency on my end so everything works now!
BTW, did you intend for the Mk2 locomotive to be weaker than the Mk1? You set Mk2 to 900kW and Mk3 to 1.8MW, but leave Mk1 at vanilla default of 1.0MW.