Author Topic: Tried making my own statsting for the first time for XPiratez, but errors abound  (Read 9008 times)

Offline Absle

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Whenever I save this statstring below as XcomUtil_Statstrings.rul and turn on the XcomUtil Statstring mod,

Code: [Select]
# Based on XcomUtil by Scott Jones and BladeFireLight

# See https://www.ufopaedia.org/index.php?title=Statstrings

# These are the default statStrings from XcomUtil.

# Melee has been added as a value that can be reported by statstrings.  Use "melee:" as the criteria.
 
statStrings:
 
- 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: "M"
    firing: [70, ~]
 
- string: "m"
    firing: [60, 69]
 
- string: "R"
    reactions: [60, ~]
 
- string: "r"
    reactions: [50, 59]
 
- string: "H"    strength: [50, ~] 
- string: "h"    strength: [40,49] 
- string: "F"    melee: [70, ~] 
- string: "f"    melee: [50,69] 
- string: "!"    throwing: [50, ~] 

and turn on the XcomUtil Statstring mod, I get an "end of map not found on line 12 column 8" or something (the error message won't let me copy it or interact with any other window or it will clothes itself. Upon copying and pasting that here, I can see that my entries are somehow formatted differently but it doesn't show up as any different in notepad so I have no idea how to fix it. Maybe it looks better in some other environment, but the default statstring .rul file makes no sense in terms of formatting in notepad. Help? Thanks in advance!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
use notepad++, it's free, and has all the stuff you need that notepad lacks. set the language to yaml. the formatting should make a lot more sense.

"- string: "H"    strength: [50, ~]" is bad, there should be a newline between "string: "H"" and "strength: [50, ~]"

Offline Absle

  • Sergeant
  • **
  • Posts: 20
    • View Profile
https://i.imgur.com/SI87vRc.png

Okay, used notepad++ (been meaning to get it anyways), set it to YAML and now I have this. Looks like it should work, but I'm still getting the exact same error.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
they should all be at the same indentation level, so the first letter of "string" should line up with the first letter in "psiStrength" for example

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
There are two types of people:
One is like Warboy or actually most people here, who like Notepad++ for its functionalities.
The other is like me, who spend more time fighting with Notepad++ than using them, because these functionalities regularly mess up the entire indentation all the time, no matter how careful I am.
If you are like me and prefer your data raw, you might want to use EditPad instead.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Solarius Scorch do you have assigned ".rul" files to yaml? For other languages N++ use tabs that are illegal in yaml, but when you use yaml syntax for file it should use spaces for default.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Solarius Scorch do you have assigned ".rul" files to yaml? For other languages N++ use tabs that are illegal in yaml, but when you use yaml syntax for file it should use spaces for default.

Yes, I do everything correctly, but still I find it really clunky. Why not just copy raw data? When I work like this, I never make mistakes.
I'm not pushing it on anyone, I just thought the OP might have a similar problem.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Yes, I do everything correctly, but still I find it really clunky. Why not just copy raw data? When I work like this, I never make mistakes.
I'm not pushing it on anyone, I just thought the OP might have a similar problem.
Editor of choice is thing of personal taste. Is hard to convince anyone to change it when you can made job done in it.
Great example of this is vim and emacs, for beginners is impossible to do any thing in them, but when you get used to its concepts it will be lot more productive that normal editors.

Overall I'm simply curious because N++ never "betray" me when I worked with it.

Offline Absle

  • Sergeant
  • **
  • Posts: 20
    • View Profile
they should all be at the same indentation level, so the first letter of "string" should line up with the first letter in "psiStrength" for example

https://i.imgur.com/89z30Rm.png

Okay, I figured out the formatting on my own last night and I was able to get this to run, but I'm still having a few problems. I haven't rigorously checked to see if everything is working, but some things are blatantly not working so it casts a shadow over the rest of it. Basically the "Sct" and "Snpr" tags are still showing up despite me deleting them, and the "w" tag shows up twice if it's there at all. I still have a copy of the original file in the folder with it, saved as XcomUtil_Statstringsdef.rul. I assumed that the game would only look at the file named exactly XcomUtil_Statstrings.rul, but now I'm guessing that it just looks at all .rul files in the folder. Haven't gotten a chance to test it this morning though.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
you'll most likely have to remove/alter the original statstrings that ship with piratez, sounds to me like it's conflicting

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
..assumed that the game would only look at the file named exactly XcomUtil_Statstrings.rul, but now I'm guessing that it just looks at all .rul files in the folder.

This is true.  All .rul files in the folder are read if the mod is enabled.  You can rename the original to XcomUtil_Statstrings.rul.original or something else so the game won't read it if you want to keep an old copy around.

Offline R1dO

  • Colonel
  • ****
  • Posts: 442
    • View Profile
Or put your .rul in its own folder under mods and ensure it is loaded after the piratez mod (e.g bottom of ingame mod list). That should work as well (and has bonus points for not touching the game files).