Author Topic: Proposed changes to faction file parsing  (Read 1206 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.
Did you miss your activation email?


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
-=-
103 (32%)
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: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

The Progenitor race appears to sense, and possibly even manipulate, local fields an untrained human cannot percieve without mechanical aid, including at the very least electricity and magnetism. This sensitivity creates entirely new worlds of artistic endeavors for the race- or it may be developed into a powerful combat awareness that can foil any attempt at surprise.
~Prime Function Aki Zeta-5 'Alien Analysis'

* Select your theme

*
Templates: 5: index (Alpha Centauri), 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 (Alpha Centauri), TopicRating/.english (Alpha Centauri), PortaMx/PortaMx.english (Alpha Centauri), OharaYTEmbed.english (Alpha Centauri).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 37.

[Show Queries]