Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: DifferentlySane on September 13, 2023, 12:50:59 PM

Title: Can't remove custom faction
Post by: DifferentlySane on September 13, 2023, 12:50:59 PM
Hello all, relative newbie to modding here.

I've added a custom faction, still tinkering with them a bit, so I wanted to temporarily remove them from my alphax.txt file. If I comment out their lines under #CUSTOMFACTIONS, though, the game crashes when I try to start a new game. I get as far as the 'select a faction to play' screen, but the actual faction selection options and all the buttons are missing. The only things visible are the background, and the 'faction quote' information box.

I've tested commenting/uncommenting this line, and that's the difference between being able to run the game and not.

My guess is that there's a game file somewhere that still has the custom faction listed and it's expecting it in alphax.txt, and crashing when it can't find it? I've checked Alpha Centauri.Ini, which just has the original factions as the defaults, so it's (probably) not that.

Any ideas?
Title: Re: Can't remove custom faction
Post by: Buster's Uncle on September 13, 2023, 02:42:49 PM
What you're describing is what happens when the #NAMELINE in the faction.txt doesn't quite agree with what's in alphax.txt under #CUSTOM FACTIONS.  One character off in one custom faction, and you can't start a game...
Title: Re: Can't remove custom faction
Post by: DifferentlySane on September 13, 2023, 03:28:33 PM
The faction works when leave the name in, it only causes a problem if I use the ; in front to make it a comment. Presumably it's not interpreting this as a comment, but as a change to the actual faction name.

I've now tried deleting the line entirely, and that works, so presumably there's more to making a line a comment than just putting a semi colon at the start?
Title: Re: Can't remove custom faction
Post by: bvanevery on September 13, 2023, 04:01:09 PM
You are not going to be able to interrupt a multi-line list of stuff in alphax.txt by putting a ; in front of a line.  The parser isn't smart enough to handle that.  It looks like a list with an interruption in it.  Delete lines entirely, or move them to the end of the list so that the list is not interrupted.

Remember that it's a file format, not a programming language with some kind of robustly tested commenting standard behind it.  It was done good enough to ship a game product 20+ years ago.  Not good enough to handle all possible corner cases that anyone would ever throw at it.

Always update your various counts of things too.  Like #UNITS, it has to match the number of lines.
Title: Re: Can't remove custom faction
Post by: Misanthrope on September 14, 2023, 05:25:32 AM
...One character off in one custom faction, and you can't start a game...

Working with a programming project, that's exactly what happened.  Massive block of programming code and everything worked fine, EXCEPT when someone tried to use it.  ANY input would break the whole thing because of ONE goof'd delimiter hidden in 20+Kb. worth of cage coding text.

....ONE character off.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 33 - 892KB. (show)
Queries used: 19.

[Show Queries]