Page 1 of 1

2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 6:08 pm
by ahfretheim
Hey all, I've tried making a small modification to the Archers unit listing in the 2.6 ruleset I'm building, asking it to use a new technology for its Req (I'm rebuilding the tech tree to keep civilizations in antiquity a bit longer) and Freeciv seems to refuse to accept the modified .ruleset file and will not load the directory with it in it. As soon as I replace the file with the original units.ruleset from classic, this goes away. Advice?

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 6:34 pm
by cazfi
What error message it gives? Run freeciv server separately (not automatically started by client) to see its messages.

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 6:36 pm
by ahfretheim
cazfi wrote:What error message it gives? Run freeciv server separately (not automatically started by client) to see its messages.


Not sure what you mean by running freeciv server separately, but this is the message I'm getting:

In secfile_from_input_file() [../../../../utility/registry_ini.c:407]: secfile 'data\big\units.ruleset' in section 'NULL': Expected entry name
file "data\big\units.ruleset", line 1, pos 0
looking at: ''

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 6:38 pm
by ahfretheim
Okay I opened the main server and tried opening the ruleset directory there, error message is Illegal String Conversion. Specifically "UTF-8 to CP1252:" It's from the very first character, which actually still comes from the original units.rulesets file. I think there might be something about how Freeciv is reading units.rulesets that is thrown off by how Windows currently interprets text files. My guess is it doesn't throw off the factory files because they're already compiled in the system somehow or cached for perf.

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 6:42 pm
by cazfi
What program you have used to edit the file? Sounds like the ruleset has been saved in an illegal format. Wordpad should be fine.

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sat Jul 14, 2018 7:22 pm
by JTN
Possibly a BOM? I think Notepad tends to add these.

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sun Jul 15, 2018 7:03 pm
by ahfretheim
JTN wrote:Possibly a BOM? I think Notepad tends to add these.


Thank you this is an extremely helpful comment! It didn't cause me issues before the Windows update, but now I seem to have these issues. As crazfi said though, WordPad should be fine, so I'll just use that instead.

Here's the funny part though: I was able to edit techs.ruleset and governments.ruleset just fine in Notepad before it.

Re: 2.6 beta won't recognize new units.ruleset files

Posted: Sun Jul 15, 2018 11:58 pm
by JTN
Could be that units.ruleset contains UTF-8 characters, whereas techs.ruleset and government.ruleset contain only ASCII.

My bet is on this in most 2.6 units.ruleset files:

Code: Select all

[unit_diplomat]
name          = _("Diplomat")
; ...
veteran_names =
; /* TRANS: diplomatic rank. */
  _("?diplomatic_rank:attaché"),


(2.5 and prior rulesets did not include any literal UTF-8 characters, because of a limitation in our localisation system.)