aliens

Author Topic: Modular rulesets : "startingBase" node  (Read 4423 times)

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Modular rulesets : "startingBase" node
« on: January 03, 2014, 02:26:21 am »
I'm trying to add items in starting base, using something like this:
startingBase:
  items:
    STR_FUEL: 200

But not only it removes all other starting items, it looks as if I emptied all the other entries of startingBase: facilities, randomSoldiers, crafts, scientists, engineers
--> The base is completely empty
Am I missing something in the format ?

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Modular rulesets : "startingBase" node
« Reply #1 on: January 03, 2014, 09:43:12 am »
interesting, it looks as though the mysterious "additional string behavior bug" strikes again. the way you are trying to do it is supposed to work, but apparently sometimes doesn't.

there is a thread (or probably several) with discussions about related problems somewhere.
in short: defining additional strings should simply append them to the existing list of strings, unless a string with the same name exists, which is replaced. to erase a string you have to define the string again as an empty string like this: "STR_whatever: {}" (I think it was "{}", it might have been "[]"). but there have been occurences of weird behavior, where some or all previous strings have disappeared.

would you post the ruleset you are trying to use? just so we can try and play around with it.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Modular rulesets : "startingBase" node
« Reply #2 on: January 03, 2014, 07:58:26 pm »
Just this is sufficient. Tested when it's the only ruleset (in addition to XCom1Ruleset)
Code: [Select]
startingBase:
  items:
    STR_AC_AP_AMMO: 12

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Modular rulesets : "startingBase" node
« Reply #3 on: January 03, 2014, 10:17:32 pm »
Starting bases aren't modular. If your ruleset specifies it, it completely clears the previous definitions. They're too complex to make "modular" as they contain savegame content, not static ruleset content. Stuff like crafts, facilities, items, etc, aren't unique and trying to merge them could cause really odd combinations and behavior. Plus it's really ambiguous. In your case, you could be trying to replace the existing starting items, or adding to the starting items, or trying to combine them, or...

The best I can do is add a workaround so for example specifying "items" only overrides the "items" of the startingBase instead of the whole thing, but any deeper and it gets hairy.
« Last Edit: January 03, 2014, 10:19:14 pm by SupSuper »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Modular rulesets : "startingBase" node
« Reply #4 on: January 04, 2014, 12:42:40 am »
For now I can test and toy with my idea by including the entire startingBase node-tree. The issue is then only when somebody wants to use several mods that do it.
In my opinion, this subject can really wait for after 1.0.