Electric Train


Adds electric locomotives to the game.

Content
3 years ago
0.14 - 1.1
69.1K
Trains

b Fix support for Multiple Unit Train Control

4 years ago

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.

4 years ago

Shame on me, I forgot that we have already changed the "same".

4 years ago

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).

https://pastebin.com/JmxLGBYw

4 years ago
(updated 4 years ago)

Reading your code, I see the problem. Here's what happens:

  1. MUTC loads data.lua first, because it's a prereq for ET. No locomotives are created here.
  2. ET loads data.lua and adds the et-locomotive-x.
  3. 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.
  4. 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.

4 years ago

now it should work

4 years ago
(updated 4 years ago)

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.

4 years ago

mk1 has 600kw

4 years ago

Hmm, in that case it must be an interaction with Train Overhaul, it buffs the vanilla engine and makes all the cars heavier.

New response