From UFOpaedia
Jump to navigation Jump to search

Edit for clarity

The "default configuration" example was literally the default configuration, copied verbatim from the xcomutil.conf file as it comes in the archive. Are you sure that this is valid syntax? Even if the pluses work just as well, I don't think we should present a "default conf" that has already been tampered with... --Schnobs 12:13, 22 October 2007 (PDT)

I didn't realize that was taken verbatim right out of the code file. If you're looking to have machine-readable examples, or examples right out of the file, feel free to revert it; my apologies. Arrow Quivershaft 13:16, 22 October 2007 (PDT)

I tried to come up with an explanation of the syntax, but... Maybe someone whose english is better than mine should try his hand at this.

An entry consists of two parts:

  • first, the statstring that will be added to a soldiers' name. It can be anything you like, but should better be short.
  • second, the condition to trigger that string (like k:30-59), which itself is made up of two parts: a one-letter handle for the stat (like r for reactions or b for bravery), and the experience range.

Note that these are ranges: lower boundary, dash, upper boundary. Either one can be omitted if the range should be open-end. So 30-50 means "from thirty to fifty", -25 means "anything below 26" (and is equal to 0-25) and 60- means "sixty or higher" (equal to 60-255). 42, unsurprisingly, would mean "a value of exactly 42".

I'm not quite sure how some strings override others.--Schnobs

I can help with that, it's actually very simple. Single character strings accumulate. But any string with more than one character will end the search right there and no further strings will be added to the name. The strings are parsed in the order they are written in XcomUtil.cfg--Mannon 15:42, 1 August 2008 (PDT)
Here's a related tip. If you really want multi character string that will not end statstrings you can still do it, it's just counterintuitive. You have to split each character of your string. For example if you wanted "Sct" for anybody that had high TU's. You just do each letter individually with the same criteria and keep the lines together in your strings so they won't get other stats between them. I did this with an older version of my StatStrings, but ditched it for character space. (I don't like having to chop down long last names to use my strings.) Example below.--Mannon 15:55, 1 August 2008 (PDT)
// Will produce "Sct" for any soldier with 80 or more TU's and will continue to accumulate strings after.
S d:80-
c d:80-
t d:80-


Very useful article, thanks guys. Spike 13:35, 1 February 2009 (CST)


I've added another example. Please feel free to alter it if you can improve on the language. Off the Rails 04:01, 11 October 2012 (EDT)

XcomUtil.cfg substituted by XcomUtil_Statstrings.rul in OpenXCOM1.0 ? with different sintax?

Below are the current contents of XcomUtil_Statstrings.rul

Should we add into this wiki page examples with this sintax as well? (or substitute all exemples to this sintax altogether

# Based on XcomUtil by Scott Jones and BladeFireLight
# See
# These are the default statStrings from XcomUtil.
 - string: "x"
   psiStrength: [~, 30]
 - string: "P"
   psiStrength: [80, ~]
 - string: "p"
   psiStrength: [60, 79]
 - string: "K"
   psiSkill: [60, ~]
 - string: "k"
   psiSkill: [30, 59]
 - string: "b"
   bravery: [60, ~]
 - string: "c"
   bravery: [~, 10]
 - string: "w"
   strength: [~, 25]
 - string: "Snpr"
   firing: [60, ~]
   reactions: [60, ~]
 - string: "M"
   firing: [70, ~]
 - string: "m"
   firing: [60, 69]
 - string: "Sct"
   reactions: [50, ~]
   tu: [60, ~]
 - string: "R"
   reactions: [60, ~]
 - string: "r"
   reactions: [50, 59]

WurmD (talk) 04:29, 13 September 2014 (EDT)

A simple and complete list of available syntax anywhere?

Maybe I'm blind, but I can't find it either in the readme or on this wiki; this article seems more showing off favourite personal setups than actually documenting the basics. For example, the article never explains what d: stands for. A comprehensive list would be good to have.