Jump to content
Message added by The_Kiiiing,

7 Screenshots

  • 161.3k
  • 9k
  • 429.4 kB

depends on

Works with

About Loot Table & Stacksize GUI

Say goodbye to configuration and data files. This plugin lets yo edit the loot of (almost) every lootable object directly over a custom UI. It also includes a graphical stack size editor thus making it ideal for anyone who is not familiar with editing config files.

Do not use in combination with any other stack size controller or loot plugin.

 

Features:

  • User friendly GUI - no need to edit config files
  • Loot configuration for every prefab in the game
  • Stack size controller supports individual stack sizes for every prefab
  • Support for custom items
  • Support for third party plugins
  • Fully backwards compatible with version 1.x.x
  • Default config included for every prefab
  • Configuration for Smelting Speed, Recycler Speed and Efficiency
  • Supply Drop configuration 

 

Supported prefabs:

  • Crates, Barrels
  • NPCs
  • Trees, Ores, Animal corpses
  • Excavator, Quarries
  • Christmas Presents, Eggs, Loot Bags
  • Collectables like Hemp, Corn, etc.

 

Additional Configuration:

  • Smelting Speed
  • Supply Drop
  • Recycler Speed / Efficiency

img_6.png.d70ebd8d2b67017e9f067a42d6838488.png

 

 Commands:

loottable        - Open the Loottable UI
loottable reload - Manually refresh loot

 

Permission:

loottable.edit - Required to use the Loottable UI

 

Required Dependencies (Oxide only):

Image Library: https://umod.org/plugins/image-library

 

Translations:

This plugin fully supports translation. Out of the box only english is included. For item names to be translated, the plugin https://umod.org/plugins/rust-translation-api is required. English translations are located in /oxide/lang/en/Loottable.json

 

For Developers:

Loot Api:

Developers can use the Loot Api to register loot profiles for custom NPCs or other plugin related loot.

It is highly recommended to use one of the provided wrappers to access the api. Both wrappers offer the same functionality.

Non-static (with documentation): https://gist.github.com/TheKiiiing/53a37e8bbb48d8a24c8e8b21b9da37ac
Static (with documentation):         https://gist.github.com/TheKiiiing/77ee60fa5d23934fd138fde58a2b147f

 

Loot Api Example:

// This example uses the non-static version of the Loot Api
private LoottableApi loottableApi;

void OnServerInitialized()
{
    loottableApi = new LoottableApi(this);
    timer.In(5f, () =>
    {
        loottableApi.ClearPresets();

        loottableApi.CreatePresetCategory("Crates");
        loottableApi.CreatePreset("c_locked", "Locked Crate", "crate_hackable");
        loottableApi.CreatePreset("c_elite", "Elite Crate", "crate_elite");
        loottableApi.CreatePreset("c_military", "Military Crate", "crate_military");
        loottableApi.CreatePreset("c_normal", "Normal Crate", "crate_normal");

        loottableApi.CreatePresetCategory("NPCs");
        loottableApi.CreatePreset(true, "npc_cargo", "Cargo Ship NPC", "npc_militunnel");
        loottableApi.CreatePreset(true, "npc_control", "Control Center NPC", "npc_militunnel");
    });
}

void SpawnNpc()
{
    // Spawn NPC here
    ScientistNPC npc;
  
    // Assign a loot preset to the NPC
    loottableApi.AssignPreset(scientist, "npc_control");
}

void SpawnCrate()
{
    // Spawn crate here
    LootContainer crate;
  
    // Assign a preset to the crate
    if (loottableApi.AssignPreset(container, "c_locked"))
    {
      	// The container has been filled with loot
    	return;
    }
    else
    {
      	// The container is not handled by Loottable
        // Default loot logic goes here
    }
}

The resulting configuration page would look like this:

image.png.684af0bcf45918753f069789b8b211e1.png

 

Custom Items API:

Developers can use the Custom Items Api to add a custom item to the Loottable item list. If an item is marked as persistent it will remain in the custom item list until it is removed by ClearCustomItems. All non-persistent items will be removed after the plugin that registered them has been unloaded.

(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, bool persistent) //(v1.0.27 or higher)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, string customName)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, string customName, bool persistent) //(v1.0.27 or higher)
  
(void) ClearCustomItems(Plugin plugin) //(v1.0.27 or higher)

 

 Hooks:

(object) OnContainerPopulate(LootContainer container)

This hook is called every time a loot container is about to be populated with loot. Returning a non-null value prevents the plugin from spawning loot into that crate.

 

(object) OnCorpsePopulate(LootableCorpse corpse)

This hook is called every time an npc corpse is about to be populated with loot. Returning a non-null value prevents the plugin from spawning loot into that corpse.

 

(object) OnCustomAirdrop(SupplySignal signal)

This hook is called every time a custom supply drop is about to be delivered. Returning a non-null value will cancel the custom supply drop.

 

Outdated documentation for Version 1:


New with version 1.0.27:

Custom Items can now be created and edited directly in the GUI. They can be created from any existing item and modified in the Item Select menu

image.thumb.png.8971c9710fe481b4f3ddfc12298d9129.png          image.png.0ba25246454c9a061bb984a4ffa49582.png

 

You can now create and load backups of your configuration. Commands (F1 or Server Console):

loottable.backup load <name> 	- Load backup with the given name from the backups folder (will wipe your current configuration)
loottable.backup create <name> 	- Create backup of everything with the given name

Backups will be created in the data/Loottable/backups folder. To load a backup, the backup file needs to be present in that folder. When creating backups in the in-game console, the permission loottable.debug is required.

IMPORTANT: DO NOT LOAD BACKUPS FORM SOURCES YOU DO NOT TRUST, they might cause harm to your server

 

New with version 1.0.16:

Custom Items:

Now you can add custom items used by other plugins directly to your loot table. Other plugins can can register these items using the api (documentation below).

image.thumb.png.8ee31fe5d845eaafbfa40969b7748204.png

 

Screenshots:

Overview of crates and their current loot table

crates.thumb.png.d914b3f62a7081d5073dd35a14ce4ce7.png

 

Stacksize Editor

stacksize.thumb.png.7fbdae5610fbdc5a59808b9f13a59d5b.png

 

Commands:

loottable - Open the editor
loottable refresh - Manually refresh crate loot

loottable flags - List available flags (explained below)
loottable flags <name> <1|0> - Enable / disable a certain flag

loottable reload_vanilla_profiles - Manually re-download vanilla loot profiles (only for debuging)

 

Permission:

loottable.edit - Required to use the editor

 

Flags:

There are flags to disable some limits in the editor. Only enable these flags if you really need to as they might cause unexpected behavior of the editor. There are currently 3 flags available:

Debug If enabled, the Debug flag provides more detailed information about errors and other actions in the editor. Don't enable this flag unless you want your console full of spam.

UnlockGatherMultiplier allows you to use gahter multipliers less than one and higher than 1000. Note that multipliers less than one might lead to unexpected results in some cases.

DisableItemLimit Probably the safest flag to use is DisableItemLimit as it simply lets you set stack sizes and every other item amount in the editor as high as 2,147,483,647 which is the biggest possible value of a 32-bit integer.

UnlockFurnaceMultiplier lets you use any value as the furnace speed multiplier. Don't enable this flag unless you know what you are doing, since the default value range from 0.1 to 100 should cover most use cases and larger values might impact server performance.

UnlockItemMultiplier unlocks the multiplier when multiplying a loot table.

DisableStackingHooks will disable all stacking related hooks. Enable if you encounter problems when stacking items.

RefreshLootOnExit controls if all crates get refreshed after closing the editor or when reloading the plugin. Enable this only for testing, there might be an increase in entities.

Refer to the Commands section for more information about enableing flags.

 

Vanilla Configurations:

Since version 1.0.7 there are vanilla loot profiles available for most crates and NPCs. These profiles can be loaded using the "Load default loot table" button at the top center of the editor.

image.png.979cb228f3b255c8e121059d9b336c01.png

DISCLAIMER:

The vanilla loot profiles in the editor might not exactly match the vanilla loot distribution of the game as it uses a completely different loot distribution system than Rust. These profiles rather serve as a reference point for custom loot profiles.

 

 Important for Carbon users:

In order for this plugin to work with carbon, Harmony references need to be enabled. This can be done with the following command:

c.harmonyreference 1

 

Required Dependencies (Oxide only):

Image Library: https://umod.org/plugins/image-library

 

Custom Items API:

Add a custom item to the item list. If an item is marked as persistent it will remain in the custom item list until it is removed by ClearCustomItems. All non-persistent items will be removed after the plugin that registered them has been unloaded.

(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, bool persistent) //(v1.0.27 or higher)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, string customName)
(void) AddCustomItem(Plugin plugin, int itemId, ulong skinId, string customName, bool persistent) //(v1.0.27 or higher)
  
(void) ClearCustomItems(Plugin plugin) //(v1.0.27 or higher)

Example:

Its recommended to delay the call a little bit to make sure Loottable is loaded

private void Init()
{
  timer.In(1f, () =>
  {
    Loottable?.Call("AddCustomItem", this, -946369541, 2664651800, "High Quality Fuel");
  });
}

 

Hooks:

(object) OnContainerPopulate(LootContainer container)

This hook is called every time a loot container is about to be populated with loot. Returning a non-null value prevents the plugin from spawning loot into that crate.

 

(object) OnCorpsePopulate(LootableCorpse corpse)

This hook is called every time an npc corpse is about to be populated with loot. Returning a non-null value prevents the plugin from spawning loot into that corpse.

 

(object) OnCustomAirdrop(SupplySignal signal)

This hook is called every time a custom supply drop is about to be delivered. Returning a non-null value will cancel the custom supply drop.

image.png

image.png

  • Like 11
  • Love 1

User Feedback

1.4m

Downloads

Total number of downloads.

6.7k

Customers

Total customers served.

99.6k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.