Author Topic: Proposed changes to faction file parsing  (Read 1247 times)

0 Members and 1 Guest are viewing this topic.

Offline Yitzi

Proposed changes to faction file parsing
« on: March 06, 2015, 10:28:47 pm »
In the process of adding the IGNOREPREREQ faction ability (what I had previously been calling CANBUILDUNIT, but with somewhat more options), I can make a few changes to the way faction files are parsed, to make them more accommodating of common errors.  These are:

1. If something does not require a value, such as WORMPOLICE or TECHSTEAL, it will still treat the following entry as its "value", so something like WORMPOLICE, SOCIAL, ++RESEARCH would not give the desired +2 RESEARCH until it was changed to WORMPOLICE, 0, SOCIAL, ++RESEARCH.  I can remove this, so that WORMPOLICE, SOCIAL, ++RESEARCH gives +2 RESEARCH...however, this will mean that WORMPOLICE, SOCIAL, SOCIAL, ++RESEARCH, which previously would have given +2 RESEARCH, now thinks it's asking for "SOCIAL, SOCIAL" and "++RESEARCH", which are meaningless, so it gives only WORMPOLICE.  This would be no extra effort at all.

2. If something is meaningless (e.g. SOICAL) it is currently ignored.  I think I can have it give an error message instead with only minor extra effort.  (If #1 is used, the unnecessary number after WORMPOLICE or its like would not give an error message, but any non-number things would.)  This will help catch typos, but may cause certain faction files with harmless mistakes to not work until the mistake is fixed.

So...which changes would you like to see, which would you like to not have, and for which do you not care?

 

* User

Welcome, Guest. Please login or register.

Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
105 (33%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 316
AC2 Wiki Logo
-click pic for wik-

* Random quote

Let the Gaians preach their silly religion, but one way or the other I shall see this compound burned, seared, and sterilized until every hiding place is found and until every last Mind Worm egg, every last slimy one, has been cooked to a smoking husk. That species shall be exterminated, I tell you! Exterminated!”
~Academician Prokhor Zakharov Lab Three aftermath

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 34.

[Show Queries]