Modding Help Question about merchant selling and buying prices

Discussion in 'Starbound Modding' started by Brandeeno, Dec 8, 2016.

  1. Brandeeno

    Brandeeno Void-Bound Voyager

    So I was wondering if there was a way to make it so that when you sell something, you get back the amount it would cost in the "buy" section. I set the ["defaultSellFactor" :] to 1.0 instead of 0.2 but it doesn't seem to make a difference. Is there an equation or ratio to ["defaultSellFactor" :] and ["defaultBuyFactor" :] or do I have to edit other files to make it work?

    If there's a mod that already changes the buy and sell prices to be equivalent, could you possibly link it to me to save time? I'll unpackage it and use it as an example.

    Thanks for your time.
     
  2. Ultimate sandvich

    Ultimate sandvich Scruffy Nerf-Herder

    Well I think you might have to change it for every merchant. Like, if you take a look at the files of terramart you get the following:
    Code:
    "interactData" : {
        "config" : "/interface/windowconfig/merchant.config",
        "paneLayoutOverride" : {
          "windowtitle" : {
            "title" : "Terramart",
            "subtitle" : "^#b9b5b2;Food, farming and pet supplies"
          }
        },
        "buyFactor" : 1.0,
        "sellFactor" : 0.2,
        "items" : [
          { "item" : "cropshipper" },
          { "item" : "henegg" },
          { "item" : "robothenegg" },
          { "item" : "mooshiegg" },
          { "item" : "fluffaloegg" },
          { "item" : "firefluffaloegg" },
          { "item" : "poisonfluffaloegg" },
          { "item" : "icefluffaloegg" },
          { "item" : "electricfluffaloegg" },
          { "item" : "grassseeds" },
          { "item" : "flowerygrassseeds" },
          { "item" : "petball" },
          { "item" : "foodbowl" },
          { "item" : "pethouse" }
        ]
      },
    You can see it has its own buyFactor and sellFactor. So if you'd want to change this, you'd have to do this through patching, making it like this I think:
    Code:
    [
        {
        "op": "replace",
        "path": "/interactData/sellFactor",
        "value": 1.0
        }
    ]
    Put this code in a file called terramart.object.patch in a folder similar to the structure used in-game, so in this case -/yourmod/objects/outpost/terramart and it should work, but only for the terramart.

    EDIT: I just tried it myself, and it worked for me.
     
    Last edited: Dec 8, 2016
  3. Brandeeno

    Brandeeno Void-Bound Voyager

    Thank you so much! it worked!
     
  4. Ultimate sandvich

    Ultimate sandvich Scruffy Nerf-Herder

    You're welcome ^-^ If you need any more help, don't be afraid to contact me!
     
    Brandeeno likes this.
  5. patigooo

    patigooo Space Hobo

    where do i find this file?
     
  6. projectmayhem

    projectmayhem Spaceman Spiff

    you have to unpack your assets, then it is in the objects folder.
     

Share This Page