- Video tutorial
- Features
- Optional plugins
- How it works
- Limitations regarding the map and drone marketplaces
- Limitations regarding the travelling vendor
- Data providers
- Permissions
- Screenshots
- Configuration
- Localization
- FAQ
- How do I buy items faster (no transaction delay)?
- How do I make items restock instantly?
- How do I allow players to purchase more items in bulk?
- Why do some items show more stock than configured?
- Why is stock different than vanilla?
- Can I sell more than 7 items?
- How do I display custom item names?
- How do I setup custom monuments?
- Developer API
- API_IsCustomized
- API_RefreshDataProvider
- Developer Hooks
- OnCustomVendingSetup
- OnCustomVendingSetupGiveSoldItem
- OnCustomVendingSetupDataProvider
- Credits
Features
- Allows customizing items sold at monument vending machines
- Supports vendors that have invisible vending machines, such as those at bandit camp and fishing villages
- Supports the travelling vendor
- Supports all monument types, including custom monuments
- Saves customizations for future restarts and wipes, based on the vending machine's relative position to the monument
- Synchronizes edits with copies of the vending machines at duplicate monuments
- Compatible with NPC vending machines spawned at monuments by plugins such as Monument Addons
- Allows bypassing dynamic pricing per vending machine
- Allows customizing vending machine skins
- Allows disabling vending machine map markers
- Allows disabling delivery drone access
- Supports Economics and Server Rewards as both payment and merchandise
- Supports blueprints, as well as items with custom skins and names
- Supports attachments and other child items
- Supports alternative ammo types and amounts
How it works
When you open an NPC vending machine, if you have permission, you will see an edit button. Clicking that edit button will reveal a container UI where you can customize the vending machine.
Code:
{
"Enable liquid currency": false,
"Economics integration": {
"Enabled": false,
"Item short name": "paper",
"Item skin ID": 2420097877
},
"Server Rewards integration": {
"Enabled": false,
"Item short name": "paper",
"Item skin ID": 2420097877
},
"Override item max stack sizes (shortname: amount)": {}
}
Code:
"Override item max stack sizes (shortname: amount)": {
"wood": 10000,
"stones": 5000
}
Code:
bool API_IsCustomized(NPCVendingMachine vendingMachine)
Code:
void API_RefreshDataProvider(NPCVendingMachine vendingMachine)
Code:
object OnCustomVendingSetup(NPCVendingMachine vendingMachine)
Code:
void OnCustomVendingSetupGiveSoldItem(NPCVendingMachine vendingMachine, Item item, BasePlayer player)
Code:
[PluginReference]
Plugin CustomVendingSetup;
void OnCustomVendingSetupGiveSoldItem(NPCVendingMachine vendingMachine, Item item, BasePlayer player)
{
// Run some logic to count the purchase
}
void OnNpcGiveSoldItem(NPCVendingMachine vendingMachine, Item item, BasePlayer player)
{
// Don't count the purchase if CustomVendingSetup is controlling the vending machine,
// since `OnCustomVendingSetupGiveSoldItem` will also be called in that case
if (CustomVendingSetup?.Call("API_IsCustomized", vendingMachine) is true)
return;
// Run some logic to count the purchase
}
Code:
Dictionary<string, object> OnCustomVendingSetupDataProvider(NPCVendingMachine vendingMachine)
Code:
class PluginData
{
[JsonProperty("VendingProfile")]
public object VendingProfile;
}
PluginData _pluginData;
void Init()
{
_pluginData = Interface.Oxide.DataFileSystem.ReadObject<PluginData>("Test_VendingProfile") ?? new PluginData();
}
Dictionary<string, object> OnCustomVendingSetupDataProvider(NPCVendingMachine vendingMachine)
{
if (vendingMachine.net.ID == 123456)
{
return new Dictionary<string, object>
{
["Plugin"] = this,
["GetData"] = new System.Func<JObject>(() =>
{
return _pluginData.VendingProfile as JObject;
}),
["SaveData"] = new System.Action<JObject>(data =>
{
_pluginData.VendingProfile = data;
Interface.Oxide.DataFileSystem.WriteObject("Test_VendingProfile", _pluginData);
}),
};
}
return null;
}
