Modding Help __merge is driving me nuts

Discussion in 'Starbound Modding' started by Nakano15, Feb 4, 2015.

  1. Nakano15

    Nakano15 Pangalactic Porcupine

    Hello, i am trying to make a mod which removes the energy cost of the guns, but for some reason, every change i try to do on the code results into crash.
    One time i were able to make the game run with the mod loaded, but it seems like the game crashes at the item loading generationg procedurally generating items as weapon (or some stuff like that).
    And yes, i were reading this page, but still does not works.

    How can i make THIS work correctly?
    Code:
    {
      "__merge" : [],
      "gunLevelEnergyCostPerDamage" :
        [ "linear", "clamp",
        [0, 0],
        [1, 0],
        [2, 0],
        [3, 0],
        [4, 0],
        [5, 0],
        [6, 0],
        [7, 0],
        [8, 0],
        [9, 0],
        [10, 0]
      ]
    }
    
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    Patches need square brackets.
    Every patch example I have given has them.
    Like I said - you move to fast - you will miss even the most obvious.

    Code:
    [{
      "op" : "replace",
      "path" : "/gunLevelEnergyCostPerDamage",
      "value" : [ "linear", "clamp",
        [0, 0],
        [1, 0],
        [2, 0],
        [3, 0],
        [4, 0],
        [5, 0],
        [6, 0],
        [7, 0],
        [8, 0],
        [9, 0],
        [10, 0]
        ]
    } ]
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

  4. Nakano15

    Nakano15 Pangalactic Porcupine

    I guess this would be better...
    http://community.playstarbound.com/index.php?threads/basic-patching-now-with-path-guide-v1-7.84496/
    And i did not remember of that thing about __merge.
    I will try to mod now that i know about the "op" command.[DOUBLEPOST=1423024048][/DOUBLEPOST]

    Edit:. It is still not working. It seems to not be able to parse the list.
    Code:
    {
      "op" : "replace",
      "path" : "/gunLevelEnergyCostPerDamage",
      "value" : [ "linear", "clamp",
        [0, 0],
        [1, 0],
        [2, 0],
        [3, 0],
        [4, 0],
        [5, 0],
        [6, 0],
        [7, 0],
        [8, 0],
        [9, 0],
        [10, 0]
        ]
    }
    It says that "(VariantException) Cannot call get with index on Variant type string, must be List type".
     
    Last edited: Feb 4, 2015
  5. The | Suit

    The | Suit Agent S. Forum Moderator

    Your patch is 99% correct.
    You just rushed ahead and didn't read the guide properly. So you are missing 2 brackets.
    You should stop being in a rush and read the material slowly.
     
  6. Nakano15

    Nakano15 Pangalactic Porcupine

    Sigh... Enough games, I will not try anymore, better I wait until someone else work on it.
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    Patches need square brackets.
    Every patch example I have given has them.
    Like I said - you move to fast - you will miss even the most obvious.

    Code:
    [{
      "op" : "replace",
      "path" : "/gunLevelEnergyCostPerDamage",
      "value" : [ "linear", "clamp",
        [0, 0],
        [1, 0],
        [2, 0],
        [3, 0],
        [4, 0],
        [5, 0],
        [6, 0],
        [7, 0],
        [8, 0],
        [9, 0],
        [10, 0]
        ]
    } ]
     
  8. Nakano15

    Nakano15 Pangalactic Porcupine

    It's because i wanted to make just that change so i could play the game, since i kind of find a gibberish weapons cost energy.
    Also, i think i tried that too and gave error, but i will try again.
     
  9. The | Suit

    The | Suit Agent S. Forum Moderator

    Just to be sure, you did rename the file
    Code:
    levelingmultipliers.functions.patch
     
  10. Nakano15

    Nakano15 Pangalactic Porcupine

    Yes, did, but i guess the error was because of something else.
    But it seems like the mod is going to work now, thanks.
    I have got angry because i passed 3 entire hours trying to do this simple mod.
     
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    No problem
    Don't be afraid to ask for help if you can't figure something out.
    Most people are friendly - I am the most sarcastic of the bunch.
     
  12. Nakano15

    Nakano15 Pangalactic Porcupine

    Neither I am that much of serious person, but either way, Thanks.
     

Share This Page