Central Rails

by adamius

Central set of rails auto-generated as you explore so you can easily build your base along it. It provides rails, signals, power, wiring and concrete automatically. Other than that it is up to you to build crossings and everything else.

Content
4 years ago
0.17 - 0.18
28
Trains

b [fixed] 0.18.37 breaks central rails

4 years ago
(updated 4 years ago)

Here is the log from the crash:

  12.572 Error AppManagerStates.cpp:1448: The mod Central Rails (0.18.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event central_rails::on_configuration_changed
__central_rails__/control.lua:425: attempt to index field 'collision_mask' (a nil value)
stack traceback:
        __central_rails__/control.lua:425: in function 'on_runtime_mod_setting_changed'
        __central_rails__/control.lua:464: in function <__central_rails__/control.lua:462>
4 years ago

The tile-unknown tile prototype appears to be missing a collision mask.

4 years ago

Updated code snippet:

  -- find the water tiles
  global.is_water = {}
  for k,v in pairs( game.tile_prototypes ) do
     global.is_water[k]=false
     if v.collision_mask and v.collision_mask["water-tile"] then
        global.is_water[k]=true
     end
  end
4 years ago
(updated 4 years ago)

Merged. Thanks!

4 years ago

You're welcome. I'm still puzzled as to why there is a tile prototype with a nil value for that field.

I also suspect that this part of your code could be using game.get_filtered_tile_prototypes, though it's in initialization code and so likely shouldn't matter much. I think though that globals might be one of the things that's part of the shared state, and I don't know that your list of the waterness of all tiles needs to be there.

I couldn't get get_filtered_tile_prototypes to work correctly though, and so I confined my surgery on your mod to the change I just showed you. :-)

4 years ago

I'm not convinced its the best but its... ok. The real work is in the intersection code which I haven't merged in because it only made things worse and slower.

I don't know why the tile prototype changed - I can't see any mention in Wube's changelog. Is it in plain sight?

4 years ago
(updated 4 years ago)

I can't see either, and nobody responded to my reply to the 0.18.37 release announcement.

Yes, I can see how the intersection code would be a mess. Personally, I just rip up the intersection and replace it with my own when it gets to the point that I need one. :-)

New response