Removing wall or foundation refund nothing (instead I have to pay)

Hi,
I've install this mod as the first one on my localhost server. I've changed nothing in the configuration so far. The only I've done is add the permission "removertool.normal" to the Oxide default group. The plugin page doesn't give much on how to use the tool, so I went ahead a use it, but it doesn't seems to work as I was expecting.

To test how the mod I've jsut gave myself 1000 woods, put 4 twigs foundations. So, now I'm at 800 woods (50 woods per foundation). I activate the remove tool using the chat "/remove". Aiming at a foundation, it shows me "Price: Wood x30" and "Refund: Wood x20", which is what the JSON config says (so far so good). But when I remove the twig foundation, it cost me 10 woods, so I'm down at 760 woods.

So... How does this works? And is there any more info on what the "Price" means? I mean, the price shows 30 woods, but the twig foundation cost 50 woods. So I'm kinda lost here...

To test, I changed the price and refund percentage to 100% and 75% using "remove.building <priceP / refundP> <percentage>". So, the UI now does show price as being 50 woods and the refund being as being 25 woods. And when I remove the part, it removes 25 woods from my inventory.

So, it looks like the price shown is good (while I have no clue why it is configurable to something else than the in-game cost), but the refund math is reversed.

Merged post

So, I've been trying to figure out what is going on here. Placeable items such as doors works perfectly, but Buildable items such as Wall doesn't work as expected out of the box. I've played a bit with the config file and the Twigs Wall (for simplicity). For reference, the building cost is 50 woods.

TL;DR

  • With the default configuration, removing a buildable item will COST you 20% of the original building cost.
  • remove.building <price / refund> <percentage> allows you to set the price or refund cost using a percentage, but will be saved as a raw value specific to the material in the JSON.
    • For the twigs wall example, remove.building refund 60 will be saved as a refund of 30 woods.
  • remove.building <priceP / refundP> <percentage> allows you to set the price or refund cost using a percentage, and will be saved as a percentage without any reference to the material in the JSON.
    • For the twigs wall example, remove.building refundP 60 will be saved as a refund of 60.0%.
  • If you want a refund when removing a buildable item, you must use either command above to bring the price value under the refund value.

Default Generated Config

Here the default config as generated the first time. We see that the sum of Price (30) + Refund (20) is equal to the Cost (50). Look at other buildings and grades, it seems the default value are all Price = 60% of Cost and Refund = 40% of Cost. In game the GUI shows as much. But when removed, 10 Woods are removed from inventory.

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": {
              "wood": {
                "amount": 30,
                "skinId": -1
              }
            },
            "Refund": {
              "wood": {
                "amount": 20,
                "skinId": -1
              }
            }
          }
        }
      }
    }
  }
}

Modifying config using remove.building <price / refund> <percentage>

100 %

I've been changing the config using the above with a value of 100. The config layout is the same, but now both Price and Refund values are 50. The GUI shows as much and when removing we are deducted 0 woods.

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": {
              "wood": {
                "amount": 50,
                "skinId": -1
              }
            },
            "Refund": {
              "wood": {
                "amount": 50,
                "skinId": -1
              }
            }
          }
        }
      }
    }
  }
}

Price 60% - Refund 40%

I've been changing the config using the above with a value of 60 for the price and 40 for the refund. The GUI shows as much and when removing we are deducted 10 woods.

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": {
              "wood": {
                "amount": 30,
                "skinId": -1
              }
            },
            "Refund": {
              "wood": {
                "amount": 20,
                "skinId": -1
              }
            }
          }
        }
      }
    }
  }
}

Price 40% - Refund 60%

I've been changing the config using the above with a value of 40 for the price and 60 for the refund. The GUI shows as much and when removing we are credited 10 woods (but using a deducted red UI).

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": {
              "wood": {
                "amount": 20,
                "skinId": -1
              }
            },
            "Refund": {
              "wood": {
                "amount": 30,
                "skinId": -1
              }
            }
          }
        }
      }
    }
  }
}

Price 0% - Refund 60%

I've been changing the config using the above with a value of 0 for the price and 60 for the refund. The GUI shows as much and when removing we are credited 30 woods (this time using the green deposited UI).

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": {
              "wood": {
                "amount": 0,
                "skinId": -1
              }
            },
            "Refund": {
              "wood": {
                "amount": 30,
                "skinId": -1
              }
            }
          }
        }
      }
    }
  }
}

Modifying config using remove.building <priceP / refundP> <percentage>

Using 100%

I've been changing the config using the above with a value of 100. for both priceP and refundP. The config layout is different and the Price and Refund values are 100. The GUI shows the specific value based on the building cost and when removing we are deducted 0 woods.

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": 100.0,
            "Refund": 100.0
          }
        }
      }
    }
  }
}

PriceP 0% and RefundP 60%

I've been changing the config using the above with a value of 0 for the priceP and 60 for the refundP. The config layout is different and the Price and Refund values are respectively 0 and 60. The GUI shows the specific value based on the building cost and when removing we are credited 30 woods. Contrary to the previous command, it shows as "Free" for the price instead of "0"

{
  "Remove Info (Refund & Price)": {
    "Building Blocks Settings": {
      "Wall": {
        "Display Name": "Wall",
        "Building Grade": {
          "Twigs": {
            "Price": 0.0,
            "Refund": 60.0
          }
        }
      }
    }
  }
}


Merged post

Quick note to add when using the JSON format resulting of remove.building <price / refund> <percentage>, you can manually change so that twigs wall can refund stones material.