Curved Rail Mod in Version 15

Place to get help with not working mods / modding interface.
Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Curved Rail Mod in Version 15

Post by Pippaf1 »

How to make the curved rail mod work in version 15? As this mod makes any form of complex junction easer to make.
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Pippaf1 wrote:How to make the curved rail mod work in version 15? As this mod makes any form of complex junction easer to make.
You can place curved rails in Map Editor, I think that all you need is make recipe for it.


Always add links to mods:
daniel34/CurvedRail [0.13]
thislooksfun/CurvedRail-tlf [0.14]
Last edited by darkfrei on Tue Sep 12, 2017 5:10 pm, edited 2 times in total.

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

Sorry but I fail to see how this helps.
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by impetus maximus »

what is the purpose of a curved rail mod?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Code: Select all

data:extend({
  {
    type = "item",
    name = "curved-rail",
    icon = "__base__/graphics/icons/curved-rail.png",
    flags = {"goes-to-quickbar"},
    subgroup = "transport",
    order = "a[train-system]-b[curved-rail]",
    place_result = "curved-rail",
    stack_size = 50,
  },
  {
    type = "recipe",
    name = "curved-rail",
    enabled = false,
    ingredients = {{"rail", 4}},
    result = "curved-rail",
  }
})

table.insert(
    data.raw["technology"]["railway"]["effects"],
    { type = "unlock-recipe", recipe = "curved-rail" }
)

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

darkfrei. Thank you for the help. But I am not a coder and this might be a daft question, but which file does this code need to be copyed to?
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Pippaf1 wrote:darkfrei. Thank you for the help. But I am not a coder and this might be a daft question, but which file does this code need to be copyed to?
mods/MyFirstMod_0.0.1/data.lua


The second file must be
mods/MyFirstMod_0.0.1/info.json
with text:

Code: Select all

{
  "name": "MyFirstMod",
  "version": "0.0.1",
  "title": "It's the name of my first mod",
  "author": "ItsMyName",
  "description": "The mod adds old good curved rails, nothing else",
  "dependencies": ["base"],
  "factorio_version": "0.15"
}
:arrow: With program "Notepad++" is much better.

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

darkfrei. Tryed the code and got the folowwing error mesage:

Failed to load mods:___CurvedRail__?data.lua:2unexpected Symbol near char(160)
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Pippaf1 wrote:darkfrei. Tryed the code and got the folowwing error mesage:

Failed to load mods:___CurvedRail__?data.lua:2unexpected Symbol near char(160)
Please add your data.lua

But here is an error:
___CurvedRail__
must be
__CurvedRail__
two "_" by the name of mod, not more, not less.

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

darkfrei. Please see below copy of the data.lua as requested. As to the other error, if it is what I thik it is, it is a transcribing error on my part.

Code: Select all

data:extend({
  {
    type = "item",
    name = "curved-rail",
    icon = "__base__/graphics/icons/curved-rail.png",
    flags = {"goes-to-quickbar"},
    subgroup = "transport",
    order = "a[train-system]-b[curved-rail]",
    place_result = "curved-rail",
    stack_size = 50,
  },
  {
    type = "recipe",
    name = "curved-rail",
    enabled = false,
    ingredients = {{"rail", 4}},
    result = "curved-rail",
  }
})

table.insert(
    data.raw["technology"]["railway"]["effects"],
    { type = "unlock-recipe", recipe = "curved-rail" }
)
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Pippaf1 wrote:darkfrei. Please see below copy of the data.lua as requested. As to the other error, if it is what I thik it is, it is a transcribing error on my part.
Please check that you use encoding without BOM
2017-09-12 22_09_04.png
2017-09-12 22_09_04.png (5.42 KiB) Viewed 4683 times
It works perfect
2017-09-12 22_10_56.png
2017-09-12 22_10_56.png (52.05 KiB) Viewed 4683 times

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

darkfrei. I have no idea what that is never mind wherer to find out.
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by darkfrei »

Pippaf1 wrote:darkfrei. I have no idea what that is never mind wherer to find out.
Did you install Notepad++?
https://notepad-plus-plus.org/

The error message writes which line has the error symbol, just find and check it.
2017-09-12 22_45_57.png
2017-09-12 22_45_57.png (15.27 KiB) Viewed 4678 times
data.lua:2 is second line, here is all ok.

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

darkfrei. I have installed Notepad++ but the encodeing selection does not give me encode in UTF-8 without BOM. The only choises it gives me are UTF-8 or UTF-8-BOM.
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

Pippaf1
Inserter
Inserter
Posts: 31
Joined: Sun Apr 26, 2015 11:37 pm
Contact:

Re: Curved Rail Mod in Version 15

Post by Pippaf1 »

Addendum. All seems to work now; well at least factorio now accepts the mod, no error reports, so will have to see how it goes in the game. darkfrei thank you very much for all your help It has been most appreciated.
Philippa
Transport Belt Repair Engineer

Watch what you wish for. You may just get it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Curved Rail Mod in Version 15

Post by eradicator »

Have you tried making a blueprint of a single curved rail? You'd need two of them tho becaues blueprints can only rotate 4-ways and not 8 as the original curved rail.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”