Page 1 of 1

[0.12.24] [Rseding91] Mod with spaces cannot be set as dependency

Posted: Tue Mar 01, 2016 1:39 am
by Supercheese
It seems I have never tried to make one of my mods dependent on another until now, and I've run into a problem: In info.json, setting a dependency for a mod that has spaces in its name fails.

The following works just fine with no problems:

Code: Select all

{
  "name": "Uplink Station",
  "version": "0.1.2",
  "title": "Satellite Uplink Station",
  "author": "Supercheese",
  "homepage": "https://forums.factorio.com/forum/viewtopic.php?f=97&t=19883",
  "dependencies": ["base >= 0.12.17", "? bobelectronics >= 0.12.0", "? bobtech >= 0.12.0", "? filtered-deconstruction-planner >= 0.1.0", "? upgrade-planner >= 1.1.0", "? YARM >= 0.7.0"],
  "description": "Remotely view, explore, attack, or deconstruct by using your spy satellites in orbit."
}
But when I try to add a dependency for Orbital Ion Cannon...

Code: Select all

{
  "name": "Uplink Station",
  "version": "0.1.2",
  "title": "Satellite Uplink Station",
  "author": "Supercheese",
  "homepage": "https://forums.factorio.com/forum/viewtopic.php?f=97&t=19883",
  "dependencies": ["base >= 0.12.17", "? Orbital Ion Cannon", "? bobelectronics >= 0.12.0", "? bobtech >= 0.12.0", "? filtered-deconstruction-planner >= 0.1.0", "? upgrade-planner >= 1.1.0", "? YARM >= 0.7.0"],
  "description": "Remotely view, explore, attack, or deconstruct by using your spy satellites in orbit."
}
The game complains:
Mod dependency ? Orbital Ion Cannon not matching pattern "[?] ModName [ModVersion specifier]".
It seems the check is hardcoded to presume that all mods do not have spaces, which needs to be rectified.

Re: [0.12.24] Mod with spaces cannot be set as dependency

Posted: Tue Mar 01, 2016 1:42 am
by Klonan
You havent specified a version to go along with the name, like

Code: Select all

{
  "name": "Uplink Station",
  "version": "0.1.2",
  "title": "Satellite Uplink Station",
  "author": "Supercheese",
  "homepage": "https://forums.factorio.com/forum/viewtopic.php?f=97&t=19883",
  "dependencies": ["base >= 0.12.17", "? Orbital Ion Cannon >= 0.0.0", "? bobelectronics >= 0.12.0", "? bobtech >= 0.12.0", "? filtered-deconstruction-planner >= 0.1.0", "? upgrade-planner >= 1.1.0", "? YARM >= 0.7.0"],
  "description": "Remotely view, explore, attack, or deconstruct by using your spy satellites in orbit."
}
That might work

Re: [0.12.24] Mod with spaces cannot be set as dependency

Posted: Tue Mar 01, 2016 1:51 am
by Supercheese
With or without the version, the error is the same; I forgot to mention this. [In any event, the version section is technically optional, as indicated by the brackets.]

Re: [0.12.24] [Rseding91] Mod with spaces cannot be set as dependency

Posted: Thu Mar 03, 2016 5:58 pm
by kovarex
Fixed for the next version (thanks to rseding91)

Re: [0.12.24] [Rseding91] Mod with spaces cannot be set as dependency

Posted: Fri Mar 04, 2016 2:39 pm
by daniel34
Two things:
(1) This resolved bug isn't mentioned in the changelog for 0.12.25
(2) Mod names set as dependency with specific characters (such as '+' in Belts+) now give an error:
viewtopic.php?f=91&t=18593&start=20#p130863
Image