Changelog tutorial
- themadgunman
- Inserter
- Posts: 47
- Joined: Wed Jan 18, 2017 5:07 pm
- Contact:
Re: Changelog tutorial
This whole tab hatred thing really needs fixing, especially as most IDE's will automatically add a tab when you do a new line from an already indented line, I think I spend more time debugging my changelog than I do my actual mod code atm
I suspect this is why 90% of mod changelogs don't actually work in game
I suspect this is why 90% of mod changelogs don't actually work in game
Re: Changelog tutorial
Spaces won the whitespace war. If your IDE is any good you can configure it to convert tabs to spaces when it saves the file.themadgunman wrote: ↑Sat Mar 16, 2019 2:01 pm This whole tab hatred thing really needs fixing, especially as most IDE's will automatically add a tab when you do a new line from an already indented line,
- themadgunman
- Inserter
- Posts: 47
- Joined: Wed Jan 18, 2017 5:07 pm
- Contact:
Re: Changelog tutorial
I just switched it to automatically indent with spaces rather than tabs, for some reason this never occured to me before, thanks for the tip
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: Changelog tutorial
Some text editors allow changing tabs to spaces, can save you a lot of time.themadgunman wrote: ↑Sat Mar 16, 2019 2:42 pmInteresting, time for Uncle Google to earn his keep today and inform me on how to do this in VS, thanks for the tip
For example, I am using "Sublime Text". Under menu "View" → "Indentation", there are whole bunch of options including "Indent Using Spaces", setting "Tab Width", "Convert Indentation to Spaces".
I am sure other (free) modern text editors have similar functions as well.
- themadgunman
- Inserter
- Posts: 47
- Joined: Wed Jan 18, 2017 5:07 pm
- Contact:
Re: Changelog tutorial
yeah it was actually just a simple setting change, it just never occured to me to look tbhSchallfalke wrote: ↑Sat Mar 16, 2019 3:14 pm Some text editors allow changing tabs to spaces, can save you a lot of time.
For example, I am using "Sublime Text". Under menu "View" → "Indentation", there are whole bunch of options including "Indent Using Spaces", setting "Tab Width", "Convert Indentation to Spaces".
I am sure other (free) modern text editors have similar functions as well.
Re: Changelog tutorial
Updated the text again. I actually fixed a changelog to try out a few things. Now the tutorial contains a lot of boring stuff about where to use spaces and how many, or how to indent lists correctly.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Changelog tutorial
The changelog cannot be encoded in UTF-8-BOM, this will cause Factorio to error on line 1. I recommend to use plain UTF-8 (no Byte Order Mark) instead.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Changelog tutorial
Thank you, updated!
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
- BlueTemplar
- Smart Inserter
- Posts: 3202
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Changelog tutorial
Is changelog.txt in the YAML format or the JSON format, or neither ?
viewtopic.php?p=416982#p416982
viewtopic.php?p=416982#p416982
BobDiggity (mod-scenario-pack)
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Changelog tutorial
Where is it said it's in JSON format?
Btw it very clearly isn't json
Btw it very clearly isn't json
- BlueTemplar
- Smart Inserter
- Posts: 3202
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Changelog tutorial
Doing a search on the linked thread (both pages) found no reference to JSON. Hence why I asked as the format is so visually different to JSON.
- BlueTemplar
- Smart Inserter
- Posts: 3202
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Changelog tutorial
Does Factorio changelog support the JSON type syntax of YAML 1.2 or the full YAML syntax?
As my understanding was that it only supported a simplified syntax that is YAML compliment.
As my understanding was that it only supported a simplified syntax that is YAML compliment.
- Omnifarious
- Filter Inserter
- Posts: 276
- Joined: Wed Jul 26, 2017 3:24 pm
- Contact:
Re: Changelog tutorial
No... YAML is an alternative to JSON. It might be that you can represent more kinds of data with YAML (though I suspect not because YAML doesn't really have a distinction between integers and strings), but superset implies that all JSON files are YAML files, which is definitely not the case. JSON is a curly-brace based syntax, and YAML is whitespace (and some special delimiter characters) based.
- BlueTemplar
- Smart Inserter
- Posts: 3202
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Changelog tutorial
https://yaml.org/spec/1.2/spec.html#id2759572
(Though this seems to be morphing into a pointless discussion about the definition of "superset", my bad...)YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file. This makes it easy to migrate from JSON to YAML if/when the additional features are required.
BobDiggity (mod-scenario-pack)
- Omnifarious
- Filter Inserter
- Posts: 276
- Joined: Wed Jul 26, 2017 3:24 pm
- Contact:
Re: Changelog tutorial
Interesting. I'm going to have to test out a few YAML parsers and do some investigations to see if that means what it seems it should mean based on a plain reading. In practice, YAML files typically do not use curly or square brackets. Anyway, you're right. This is kind of silly. The changelog parser seems simplistic, and I suspect that it does not support the full YAML syntax, and only a restrictive subset.BlueTemplar wrote: ↑Tue Mar 26, 2019 11:14 pm https://yaml.org/spec/1.2/spec.html#id2759572(Though this seems to be morphing into a pointless discussion about the definition of "superset", my bad...)YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file. This makes it easy to migrate from JSON to YAML if/when the additional features are required.
-
- Long Handed Inserter
- Posts: 80
- Joined: Sat Aug 20, 2016 8:00 pm
- Contact:
Re: Changelog tutorial
I've found another picky requirement of the changelog parser: The header line of dashes (and subsequent dashed lines between versions) must have exactly 99 dashes. I've tried it with 80, 98, 99, and 100. The only one that works is 99.
Re: Changelog tutorial
Thanks! I've included that information.badtouchatr wrote: ↑Fri Mar 29, 2019 6:14 am I've found another picky requirement of the changelog parser:
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Changelog tutorial
Update: Empty lines must be really empty -- spaces or even tabs will cause a parsing error!
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!