regex support in name migration

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2089
Joined: Sat Jun 11, 2016 6:41 am
Contact:

regex support in name migration

Post by Optera » Fri Jul 12, 2019 7:17 am

Problem:
For LTN to indicate carriage positions I am generating virtual signals for every rolling stock in data phase.
The virtual signal names are currently "LTN-"..entity.name which can get in conflict with other LTN signals so i need to rename them to something more unique like "ltn-position-"..entity.name.
However this also means the old signals vanish from all combinators.
Suggestion:
Add regex support to migration so we can migrate auto generated names as well as hard coded ones.
For example to migrate all base rolling stock currently this is required:

Code: Select all

{
  "virtual-signal":
  [
    ["LTN-locomotive", "ltn-position-locomotive"],
    ["LTN-cargo-wagon", "ltn-position-cargo-wagon"],
    ["LTN-fluid-wagon", "ltn-position-fluid-wagon"],
    ["LTN-artillery-wagon", "ltn-position-artillery-wagon"]
  ]
}
with regex it would become this:

Code: Select all

{
  "virtual-signal":
    [["LTN-(.*)", "ltn-position-$1"]
  ]
}

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: Therenas