Some pointers debugging custom config

Discussion in 'The Hangar Bay' started by zaphodikus, Jan 6, 2021.

  1. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    When I get a CoQ - which is TIL meaning "Continue Or Quit" bizarrely, with this error in a scenario
    "ArgumentException: An item with the same key has already been added. Key: 1811"

    I'm a bit at a loss to figure out what is causing it - I'm obviously placing a deconstructor at the time, which means the game engine will now double-check all templates. Short of adding my scenario templates one at a time back into the game, any quick clues or techniques one can use aside from doing a slice and dice?

    the key "1811" is an item key ID, but I've got no items with that ID, so it's a built-in conflict? that's probably referencing/requiring something? Or is the error message just misleading/herring? Even in a vanilla game I'm seeing loads of spam warning messages, so hard to tell if intentional.
     
    #1
  2. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,286
    Likes Received:
    8,956
    Which config files have you edited? Config.ecf, ItemConfig.ecf or BlocksConfig.ecf?
    1811 in the BlocksConfig and Config.ecf is the T2 CV Shield Generator. "An item with the same key" doesn't literally refer to an item, but an entry in the config.
     
    #2
    zaphodikus and ravien_ff like this.
  3. ravien_ff

    ravien_ff Rear Admiral

    Joined:
    Oct 22, 2017
    Messages:
    6,413
    Likes Received:
    12,015
    Sounds like you have two blocks or two items that have the same ID of 1811.

    Do a search in your file for 1811 and you should find the problem.
     
    #3
    zaphodikus likes this.
  4. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    Both correct, thanks for confirming my suspicion.

    I had worked my way into trouble with the scenario after copying the config.ecf into the ItemsConfig.ecf and Templates.ecf in a hurry. And that's where the confusion leaked in. I needed to edit Itemsconfig.ecf first, check that nothing blows up, then edit templates.ecf afterwards and re-test everything. I had indeed modified the shieldgeneratorCVT2 , but because I'd copy-pasted my config.ecf in one go was impatient and only found the mistake once I placed a deconstructor in a base on the map, before it went boom. Ha Ha.

    I've rolled back and re-published my scenario for now while i test this thing properly.
    Rule number 1 : spawn all items in and test them in a constructor, and use them
    Rule number 2 : spawn a deconstructor and check deconstructor behaviour is as desired.
    Rule number 3 : start a fresh game in between big changes, since the game caches some data
     
    #4
    ravien_ff likes this.
  5. Máethorel

    Máethorel Lieutenant

    Joined:
    Dec 23, 2019
    Messages:
    19
    Likes Received:
    31
    I am also getting an "item with the same key has already been added" error in my log, but the key listed is 1819758516, which I can't find via search function in any of the config files that I've edited (config.ecf, blocksconfig.ecf, itemsconfig.ecf, templates.ecf). That said, I know it's the base config.ecf file that is the problem, because I only have to swap that file out for the default in order for the server to launch properly. Any clues what I'm missing? I'd be glad to post my files, just don't want to come off like I am trying to get someone to go through everything for me, just need a lil push haha

    Edit: I've also run all four of those files through a difference checker with the original looking for anywhere there's a line duplicated, with no success.
     
    #5
    zaphodikus likes this.
  6. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    if you edit config.ecf, and the other files, you will run into trouble, one or the other approach, editing both will work, but will cause pain. There are other common gotchas, like test regularly, and test using all constructor recipes and all deconstructor inputs. The only way I have found is to slice and dice the problem introduce you changes one chunk at a time until it breaks, and then back up to the last step and slice further. Having a good understanding of which things modify which things is key. Blocksconfig comes first, do them all, then templates and so on.
     
    #6
    ravien_ff likes this.
  7. Máethorel

    Máethorel Lieutenant

    Joined:
    Dec 23, 2019
    Messages:
    19
    Likes Received:
    31
    Yeah, I do test everything after every change, and unfortunately rolling back my most recent change doesn't fix the problem, so I must have made an edit without backing up and not remember, or accidentally cut or pasted something somewhere (though you'd think I'd have found that with diffchecker...)
    At this point honestly my strategy is to reset to default config file and start re-implementing my changes one at a time.
     
    #7
  8. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    Yeah, have had to do that more than once, requires having a system and writing down notes, will have to do the same soon myself.
     
    #8
  9. Máethorel

    Máethorel Lieutenant

    Joined:
    Dec 23, 2019
    Messages:
    19
    Likes Received:
    31
    Fortunately I've got a detailed list of everything I've changed in chronological order, so I should be able to get through a bunch of it fairly quickly before slowing down when I get recent.
     
    #9
    zaphodikus likes this.

Share This Page