[1.1.88] Mod changelog gets invalidated when sub-lines are matching

Things that has been reported already before.
Post Reply
troastervista
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Sep 06, 2023 6:26 am
Contact:

[1.1.88] Mod changelog gets invalidated when sub-lines are matching

Post by troastervista »

I made a mod, but for this post, nobody cares so fast forward this is my mod's changelog:
Image
All works! However, look carefully at the highlighted area.
What did I do? I wrote costs 100% of Artillery and costs 100% of $Artillery.
For some reason deleting the $ sign invalidates my changelog, there's literally no other change.
Image
What else does my action do? Makes both lines have the same text.
Image

I read other posts such as this one: [1.0.0] In-game mod manager does not always allow viewing the changelog

With my style of writing, it's not the first time I encountered this.

If you want to copy the changelog for testing, here it is:

Code: Select all

---------------------------------------------------------------------------------------------------
Version: 0.1.0
Date: 03.11.2023
  Additions:
    - New researches:
      Optimized Cargo Wagon 1 and 2
      Optimized Fluid Wagon 1 and 2
  Bugs:
    - Unnoticed
  Info:
    - Something
  TODO:
    - Optimized Locomotive 1
      prerequires Optimized Cargo and Fluid Wagon 1
      costs 100% of railway
      buffs the wagon properties that Cargo and Fluid wagons got a buff for
    - Optimized Locomotive 2
      prerequires Optimized Locomotive 1 and Optimized Cargo and Fluid Wagon 2
      costs 150% of railway
      buffs the wagon properties that Cargo and Fluid wagons got a buff for as well as engine power, top speed and efficiency
    - Optimized Artillery Wagon 1
      prerequires Optimized Cargo and Fluid Wagon 2
      costs 25% of Artillery
      just buffs the wagon properties that Cargo and Fluid wagons got a buff for
    - Optimized Artillery Turret 1
      prerequires Artillery
      costs 100% of Artillery
      buffs the turret properties such as rotation speed
    - Optimized Artillery Wagon 2
      prerequires Optimized Artillery Turret 1 and Optimized Artillery Wagon 1 and Optimized Cargo and Fluid Wagon 3
      costs 100% of Artillery
      buffs the wagon properties that Cargo and Fluid wagons got a buff for, but also the turret properties
    - May branch into specializations
      defense trains optimized to be able to kill biters
      other trains with pros and cons https://discord.com/channels/659845766474629121/1142384198397730856/1157625059062591512
Maybe add a debug for changelogs so it tells you on which line it failed. If it's not enabled by default or because it's useless except for mod makers, maybe make it work automatically for mods that are not zip files, but folders since that's what modders use.
Last edited by troastervista on Sat Nov 04, 2023 7:30 pm, edited 1 time in total.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1656
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: [1.1.84] Mod changelog gets invalidated when sub-lines are matching

Post by Pi-C »

troastervista wrote:
Fri Nov 03, 2023 5:21 pm
Maybe add a debug for changelogs so it tells you on which line it failed.
Actually, we have that already! Start the game from the command line so you can keep an eye on the game's debugging output. In the main menu, open "Mods" and select your mod in the mod manager. If there is something wrong with your changelog, the "Changelog" button will be disabled and the log will show a message telling you why the changelog couldn't be parsed (assuming the mod really has a changelog).

However, debugging your changelog this way is rather tedious because you can fix only one bug at a time, then you must restart. Changelog Tools is somewhat better in that regard. Don't mind that the mod hasn't been updated beyond Factorio 0.18, it's not a real mod but just some python scripts distributed via the mod portal.

Running the script will output all buggy lines in a changelog, running in "Zorro" mode will output an analysis of each line in a file, with an explanation of what exactly is wrong with it (if necessary). I helped with development by providing a number of test cases and I can affirm that it finds all the common mistakes as well as some of the more obscure ones. IIRC, there are one or two rare bugs that aren't covered yet. Unfortunately the author has been MIA for some years now, so I guess the mod has been discontinued for good.


About your bug: I can imagine that duplicate lines may throw an error, but I'm not on a computer with Factorio right now, so I can't test. Perhaps something like this would work:

Code: Select all

TODO:
    - Optimized Locomotive 1:
      - prerequires Optimized Cargo and Fluid Wagon 1
      - costs 100% of railway
      buffs the wagon properties that Cargo and Fluid wagons got a buff for
    - Optimized Locomotive 2
      - prerequires Optimized Locomotive 1 and Optimized Cargo and Fluid Wagon 2
      - costs 150% of railway
      - buffs the wagon properties that Cargo and Fluid wagons got a buff for as well as engine power, top speed and efficiency
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Bilka
Factorio Staff
Factorio Staff
Posts: 3159
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [1.1.88] Mod changelog gets invalidated when sub-lines are matching

Post by Bilka »

Duplicate: 81480

Reason for disallowing duplicate lines (including sublines) is that changelog lines sometimes accidentally get duplicated during git merge. This is not wanted, so the parser errors when it happens.

As Pi-C says, the game already outputs the changelog issues in the log file or directly in stdout. You can also use FMTK for changelog validation outside of Factorio: viewtopic.php?p=587397#p587397

There is also documentation of the changelog format, which may make it easier to write a correct changelog: https://wiki.factorio.com/Tutorial:Mod_changelog_format
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Duplicates”