Locale files can't have spaces after variable names anymore.

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

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

Locale files can't have spaces after variable names anymore.

Post by eradicator »

(Not sure if this is a bug/feature/etc. Feel free to move.)

While trying to update an old 0.13 mod i noticed that in 0.13 local.cfg files used to allow spaces after the variable name. But in 0.16 the game will throw "unknown-key:" for any such occurance. It think the locale files are much more readable with spacing, so it'd be nice if this would work again.
spacing.png
spacing.png (26.08 KiB) Viewed 746 times

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Locale files can't have spaces after variable names anymore.

Post by bobingabout »

It was a non-standard feature of the ini/config file format to begin with, by removing spaces, they're just bringing it closer to a conforming standard.

Why do it when they did? I dunno, maybe they changed to use a different parser that doesn't allow this non-standard configuration.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: Locale files can't have spaces after variable names anymore.

Post by eradicator »

bobingabout wrote:maybe they changed to use a different parser that doesn't allow this non-standard configuration.
That is my suspicion too. But it really makes the files difficult to work with when they're just an unformatted blob of text (and i have to handle 3 languages on my own here). I see the thread was moved to "suggestions", so i guess i'll have to write me a script that automatically strips the space on my end if i want that feature back.

Code: Select all

s/\s*=\s*/=/

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Locale files can't have spaces after variable names anymore.

Post by bobingabout »

When I was trying to write my own game, I wrote something called initool. It's a Dif tool for ini files, to merge them together. Because I literally wrote everything by myself, it includes truncation, stripping out all spaces before a tag, before and after the =, and at the end of line, including removing all comments.

The main reason it does that is because this is part of the game engine itself, so only keeps the information it can use, in a format it can use, but it can output the information too.

one of the things it should be able to do is strip down a locale file in Factorio.

I haven't tested it with anything other than standard ASCII though, so it might not work with any extended characters.
https://www.dropbox.com/sh/6v2ckwti6dqf ... 9KdAa?dl=0
There is a difference, I can't remember what it is.

It's a command line tool, so, open a command prompt and run it, I'm fairly sure it will report the commands on how to use it as an error message.
(last edit date, 6 years ago yesterday. don't expect me to remember how to use it)

Keep in mind... Why do I mod factorio? I was writing my own game, suffered a hard drive crash and lost over a months worth of work. So I wanted to do something else for a while to do to take my mind off the failure, so started modding Factorio. I haven't gone back yet.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: Locale files can't have spaces after variable names anymore.

Post by eradicator »

bobingabout wrote:Keep in mind... Why do I mod factorio? I was writing my own game, suffered a hard drive crash and lost over a months worth of work. So I wanted to do something else for a while to do to take my mind off the failure, so started modding Factorio. I haven't gone back yet.
That sounds pretty familiar. Except i didn't lose anything. I just felt that some more experience was required :D.
Also while i thank you for the offer, if i'm going to use a special parser for that i'd rather write my own one that perfectly fits my needs (and give myself a reason to not have my regex knowledge rust too much ;).
The problem with using a personal pre-parser is mostly that i'm the only one benefiting from it. Any potential helpful user that wants to translate to his own language...would still have to use the "raw" version that is provided in the zip file.
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 “Ideas and Suggestions”