rail_pictures()

Place to get help with not working mods / modding interface.
Post Reply
SPolygon
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jan 02, 2016 8:22 pm
Contact:

rail_pictures()

Post by SPolygon »

Hello. I want to add a new rail type via a mod. I thought I could just copy the code and graphics of the vanilla rail and edit them to my liking, but I don't really understand how I can replace the sprites of the new straight rail and curved rail entities I'm adding.
I was expecting the graphics definition to be included in the entity entry of the rails, but instead there is just a single line saying

Code: Select all

pictures = rail_pictures()
Where can I find the original definition of rail_pictures() and how can I create my own?

eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: rail_pictures()

Post by eduran »

At the beginning of entities.lua you can find:

Code: Select all

rail_pictures = function()
  return rail_pictures_internal({
   {"metals", "metals", mipmap = true},
   {"backplates", "backplates", mipmap = true},
   {"ties", "ties", variations = 3},
   {"stone_path", "stone-path", variations = 3},
   {"stone_path_background", "stone-path-background", variations = 3},
   {"segment_visualisation_middle", "segment-visualisation-middle"},
   {"segment_visualisation_ending_front", "segment-visualisation-ending-1"},
   {"segment_visualisation_ending_back", "segment-visualisation-ending-2"},
   {"segment_visualisation_continuing_front", "segment-visualisation-continuing-1"},
   {"segment_visualisation_continuing_back", "segment-visualisation-continuing-2"}
  })
end
and demo-rail-pictures.lua has the definition of rail_pictures_internal(). The wiki entry about the rail prototype could also be helpful.

Post Reply

Return to “Modding help”