Recycle Manager 2.0.0 Beta [Now released]Solved

How to download

https://umod.org/plugins/RecycleManager.cs?version=2.0.0&branch=beta

Documentation

https://github.com/WheteThunger/RecycleManager

High level objectives of this update

  • Assign a permissive open-source license, to encourage developers to contribute to and maintain the plugin in the future
  • Narrow the plugin's scope to focus on how recyclers process items, rather than trying to allow players to spawn recyclers
  • Standardize the configuration style, by placing all configuration in the config file, instead of using both a config file and a data file
  • Only add configuration for items that have been customized, so future updates to the game that affect crafting/recycling will automatically apply without having to regenerate/recustomize the config
  • Add support for custom items
  • Reduce likelihood of conflicts with other plugins
  • Provide hooks to allow other plugins to cooperate with this plugin, to resolve potential hook conflicts

 

Change log

Backwards incompatible changes

  • The data file is no longer used. All configuration is now done in the config file
  • Removed commands which generate or refresh the data file
  • Removed feature for spawning recyclers, since there are better plugins for such use cases
  • Removed OnRecycleItemOutput hook, since the new Oxide OnItemRecycleAmount hook works the same

New features

  • Added feature to prevent recycling of custom items, according to their skin ID and/or display name
  • Added feature to customize the recycling output of custom items, according to their skin ID and/or display name
  • Added feature where recyclers can output custom items, by assigning a skin ID and/or display name to the outputs
  • Added recyclemanager.add <item id or short name> command to add an item to the config for overriding its output
  • Added recyclemanager.reset <item id or short name> command to add or refresh an item in the config for overriding its output

Improvements

  • Improved server performance when recycling large stacks of items

Bug fixes

  • Fixed issue where the recycler would stop recycling after one item
  • Replaced deprecated OnRecycleItem hook

For developers

  • Added object OnRecycleManagerItemRecyclable(Item item, Recycler recycler) hook
  • Added object OnRecycleManagerSpeed(Recycler recycler, BasePlayer player) hook
  • Added object OnRecycleManagerRecycle(Item item, Recycler recycler) hook

 

Looking for feedback!

Please let us know what you think.

  • Is this update useful to you?
  • Is this update annoying?
  • Are any features missing that you would like to see added?

I would like to be able to control the speed of certain items as well.

1UtbVce0UoaBNWX.png YaMang

I would like to be able to control the speed of certain items as well.

Ok, that may be a little tricky since right now the recycler runs on a fixed timer. It will have to be updated to run using a dynamic timer according to the next item in the queue. Theres also a potential issue where if players rearrange the items while the recycler is on, the next item may be processed early or late (at the wrong speed) because it was scheduled to recycle based on the item that was previously at the beginning of the queue, so the plugin logic may need to account for that.

Do you want to be able to configure the speed according to item category, item short name, item skin ID, and item display name, or is short name alone enough? Do you also want to be able to override item-specific speeds according to permission? The config is probably going to become a bit more complex...

In my case, I want to default to only specific shortnames.
ex)
shortname: 1.0
shortname: 1.5

like this :D

when I want to recycle for example 1 tarp, I received 50 cloths but when I recycle a stack of 2 tarp, i received 50 cloths too

Before last facepunch update (oct 21st), I added diesel barrel (1x diesel barrel for 120 lowgradefuel) and since the update I received 60 lowgrade...

KBJLmAoES6AzXoK.jpg Leumas1984

when I want to recycle for example 1 tarp, I received 50 cloths but when I recycle a stack of 2 tarp, i received 50 cloths too

Before last facepunch update (oct 21st), I added diesel barrel (1x diesel barrel for 120 lowgradefuel) and since the update I received 60 lowgrade...

Thanks for the report. I just pushed a fix for that issue (3rd beta release). Looks like it was introduced in the 2nd beta release. Please redownload the plugin. Note: The version number is still 2.0.0.

As for the 120 low grade giving 60, that is expected because recyclers operate at 50% efficiency in vanilla. It's a property per recycler that plugins could change, so I'm not sure if it would be appropriate for the plugin to just ignore the efficiency rate. What the "override output" config section actually allows you to do is configure what the recycler thinks the original item ingredients are. I'm not sure how best to communicate this nuance aside from the hint in the config, and the documentation which explains it. One idea I could explore further is to make the plugin ignore recycle efficiency for items with a custom override, which can work as long as the plugin modifies the generated outputs when you run a command like recyclemanager.add. I'll think more about this.

thanks for the fix and explanation for the efficiency

I redownload the plugin with your fix and all is working now

I double the output to 240 to have 120 :-)

Would it be possible to make Safe Zone recyclers faster while pvp monument recyclers are vanilla speed?  This would make recycling in a safe zone less boring but keep the high risk of recylcing normal speed at a monuments

KingSizeKevin

Would it be possible to make Safe Zone recyclers faster while pvp monument recyclers are vanilla speed?  This would make recycling in a safe zone less boring but keep the high risk of recylcing normal speed at a monuments

Sure, I can probably add that. Currently, I am exposing a default recycle time, item-specific recycle times, and permission-based time multipliers. I can also add a safe zone time multiplier so that you can speed those ones up specifically.

Also, a quick update on the development progress: After discussing with folks about the confusion around "override output" being double what is actually output, I'm considering changing that to reflect the exact output, but haven't yet decided. I've also started a UI feature where admins can preview and edit recycle recipies at a recycler, using an interface inspired by the Custom Vending Setup plugin.

I'm currently working out a way to integrate with other plugins to achieve multiple use cases, including 1) Allowing crafting plugins to expose their recipies to Recycle Manager to automatically make custom craftables recyclable into a fraction of their ingredients, and 2) Allowing plugins which have their own recycling configuration to be viewable and editable in the UI.
tDJhY0jDvSjlFlC.png YaMang

I would like to be able to control the speed of certain items as well.

Here to express that there is additional interest in this feature ^

I just pushed another version of the beta. Note: The version number is still 2.0.0 since it's not the official public release.

Summary of changes:

  • You can now configure recycle speed in safe zones, using a multiplier
  • You can now configure recycle speed per item, using multipliers
  • Recycle speed by permission now uses multipliers rather than fixed times
    • If you are already using this feature, please check your config to ensure it's configured right for your server
  • The OnRecycleManagerSpeed hook now accepts a 3rd parameter that allows other plugins to alter recycler speed, allowing potentially many plugins to stack their recycle speed bonuses together without conflict
    • For example, one plugin could increase recycle speed in a particular zone, and another plugin could increase recycle speed based on player allocated skill points; those plugins would just have to integrate with the hook

These multipliers all stack, so in the following example, a player with the fast permission in a safe zone could recycle metal pipes in 0.2 seconds.

{
  "Custom recycle speed": {
    "Enabled": true,
    "Default recycle time (seconds)": 5.0,
    "Recycle time multiplier while in safe zone": 0.5,
    "Recycle time multiplier by item short name (item: multiplier)": {
      "gears": 0.6,
      "metalpipe": 0.4
    },
    "Recycle time multiplier by permission": [
      {
        "Permission suffix": "fast",
        "Recycle time multiplier": 0.2
      },
      {
        "Permission suffix": "instant",
        "Recycle time multiplier": 0.0
      }
    ]
  },

Hey WhiteThunder, just so i'm understanding. 

If the default time is 5 seconds and safezone multiplier is 0.5. That would make the total recycle time 2.5 seconds?

If individual items also have a specific recycle time that stacks with the safezone multiplier. So using metalpipe as an example it would be 0.1 when stacked? Or is it 0.4 of 0.5?

Thank you.

DuckTales

If the default time is 5 seconds and safezone multiplier is 0.5. That would make the total recycle time 2.5 seconds?

If individual items also have a specific recycle time that stacks with the safezone multiplier. So using metalpipe as an example it would be 0.1 when stacked? Or is it 0.4 of 0.5?

Yes to the first question. As for stacking, the formula is just all the multipliers together: Default time * safe zone * item * permission.

In the example I provided, safe zone metal pipe would be 1 second (5 * 0.5 * 0.4). With player also having fast permission. It would be 0.2 seconds (5 * 0.5 * 0.4 * 0.2).

Earlier, there was discussion about simply changing the time, rather than using multipliers, but after introducing all these features, I changed them all to multipliers for consistency.

I have uploaded a new version of the beta.

  • The output config now shows the actual output of items, not the original crafting recipe. This should make it more intuitive for users.
  • Added a UI that allows administrators to configure recycle outputs per item in-game while at a recycler. To use, simply grant the recyclemanager.admin permission, open a recycler, and you will see the "Admin" button.
Locked automatically