Simple Loot

Set multipliers for any item of your choosing!

Total Downloads: 5,019 - First Release: Oct 10, 2017 - Last Update: Dec 8, 2017

5/5, 12 likes
  1. You might be able do an on event handler on:
    OnItemDeployed
    or perhaps:
    OnItemAddedToContainer
     
  2. Nope, CancelInvoke seems to be the fix.
     
  3. Why is the version of the plugin Version 1.0.6 and actually Version 1.0.5?
     
  4. The last version is 1.0.6 but the release descriptor in the .cs code was not updated so it is mentioned 1.0.5.

    Kappasaurus, at the same time I tried the previous release (actual 1.0.5) where you fixed only start error and the plugin works fine.
    It's odd but true :). Thank you!
    [DOUBLEPOST=1511681271][/DOUBLEPOST]Only one assumption: it handles refreshing weirdly enough increasing garbage entities each time it loads. Anyway it should be one now once a restart so it's better than it was.
     
  5. Wait have you already made a fix? Im having the vinalla loot spawn issue also. however im not getting any console errors.

    im just looking around the data .cs to see if i can understand any of it, i have never really worked with markup language. but upon looking at the code in another plugin dealing with refreshing loot to see if i can recognise the loot default or call/delete function.

    maybe im an idiot but is this anywhere close to something thats different?

    Code:
            }        private void OnSpawnLoot(LootContainer lootContainer)
            {
                if (lootContainer?.inventory?.itemList == null)
                    return;            foreach (var item in lootContainer.inventory.itemList.ToList())
                {
                    item.RemoveFromWorld();
                    item.RemoveFromContainer();
                }
    Im aussuming this is the lines to refresh the loot?

    Noticing simalarities with this

    Code:
                var lootContainers = Resources.FindObjectsOfTypeAll<LootContainer>().Where(c => c.isActiveAndEnabled && !c.IsInvoking("SpawnLoot")).ToList();
                foreach (var container in lootContainers)
                {
                    try { container.Invoke("SpawnLoot", UnityEngine.Random.Range(container.minSecondsBetweenRefresh, container.maxSecondsBetweenRefresh)); } catch{}
                }
            }
    Am i close or miles away??
     
    Last edited by a moderator: Nov 29, 2017
  6. Are compatible?
     

  7. so far i cannot get either to work correctly. however if could figure out betterloot and this plugin was updated with a correct on entitiy spawn delete and refresh with new loot script im pretty sure both would be compatible yes, however you have to set multipliers identical i think on on both configuration to avoid a conflict.

    @Kappasaurus

    Bud any closer to a fix yet, im up 30k entities in 2 days and short of apologising to the players and spending hours messing with betterloot or just goinb back to vanilla loot im stuck haha.

    an oh yea, on reload the plugin add around and extra 500+ entities at a time. T.T
     
  8. its still sometimes spawn 1x loot in some barrels
     
  9. Do
    you have found a fix for your problem ? i have the same i don't understand why
     
  10. There is a brute force solution.... Run Timed Execute | Oxide
    With these in the json:
    Code:
      "RealTime-Timer": {
        "00:00:00": "oxide.reload SimpleLoot",
        "00:05:00": "oxide.reload SimpleLoot",
        "00:10:00": "oxide.reload SimpleLoot",
    ...
        "23:45:00": "oxide.reload SimpleLoot",
        "23:50:00": "oxide.reload SimpleLoot",
        "23:55:00": "oxide.reload SimpleLoot"
    to force a refresh every 5 minutes. You may still get some barrels not correctly refreshed, but most will be. Not ideal, but a work around for some.
     
  11. You guys seem not to read messages at all. If reloading plugin that often you will reach entity limit in a couple of days or even earlier. I used TimedExecute with 30 minutes interval to reload SimpleLoot and that caused enormous problems and you are saying here about 5 minutes interval (what's more realtime timer instead of repeat one). Ok try it and have fun.
     
  12. Yes i saw them but i try because nobody explain what's going on with this plugin... That's the goal of a forum, help each other
    Do you have any idea or you're at the same point as me ?
     
  13. I think I've come up with a solution. If anyone is interested, try this.
    [DOUBLEPOST=1512528493][/DOUBLEPOST]
    It's not like it's it's not deleting the entities, Mughisi and I were testing entity leak with Kits and found out that it never seems to go down after an entity is created, even if destroyed and removed.
     

    Attached Files:

  14. I will give this a test tonight. Thanks for working on a potential fix. It sound like a Rust/Oxide issue, since in good faith you have been trying to remove the entities.

    I'm wondering where these entities are going when they are "removed"? I'm going to build a shack there and get rich! ;-)
     
  15. Already loaded thanks, hopefully this works.
     
  16. Uploaded today this update and found out now that all day there were x1 default rates. Uploaded 1.0.5 again.
     
  17. Simple test with no one on on a simple test server. Machine has SimpleLoot running. did a reload, looked at the change in entity count.
    Code:
    > serverinfo
    {
      "Hostname": "Bella Clean",
      "MaxPlayers": 5,
      "Players": 0,
      "Queued": 0,
      "Joining": 0,
      "EntityCount": 91326,
      "GameTime": "05/20/2024 17:13:45",
      "Uptime": 3085,
      "Map": "Procedural Map",
      "Framerate": 263.0,
      "Memory": 1238,
      "Collections": 40,
      "NetworkIn": 0,
      "NetworkOut": 0,
      "Restarting": false,
      "SaveCreatedTime": "11/27/2017 11:02:18"
    }
    > o.reload SimpleLoot
    SimpleLoot was compiled successfully in 1754ms
    Unloaded plugin Simple Loot v1.0.7 by Jacob
    [Simple Loot] Repopulating 2089 loot containers.
    Calling 'OnServerInitialized' on 'SimpleLoot v1.0.7' took 1958ms
    Loaded plugin Simple Loot v1.0.7 by Jacob
    > serverinfo
    {
      "Hostname": "Bella Clean",
      "MaxPlayers": 5,
      "Players": 0,
      "Queued": 0,
      "Joining": 0,
      "EntityCount": 92263,
      "GameTime": "05/20/2024 17:19:02",
      "Uptime": 3114,
      "Map": "Procedural Map",
      "Framerate": 263.0,
      "Memory": 1374,
      "Collections": 40,
      "NetworkIn": 0,
      "NetworkOut": 0,
      "Restarting": false,
      "SaveCreatedTime": "11/27/2017 11:02:18"
    }
    92263-91326=937 more entities net. Reran it again and now it is 93293, and again 94332. Is that expected behavior? I'm running 26 mods on this test instance, and do not think the other mods will affect loot other than FancyDrop which I unloaded before testing. Is there some other test I can do to help?

    Did a quit and restart:
    87921.
    so there is a brute force fix, but not very player friendly.
     
    Last edited by a moderator: Dec 6, 2017
  18. As for me I have only one working way: to use 1.0.5 version and with no reload during a day. Multipliers work but entities grow on restart, i.e. once in 24 hours. It's still best of a bad lot.
     
  19. Begging for a fix on this - I really enjoy this plugin's simplicity, I just wish it worked as intended (without causing entity problems as well). I get issues with vanilla loot without reloading the plugin :(
    I've also tried a previous verison, as well as the fix posted above.
     
  20. I truly believe the author is aware of the problems, but I suspect there may be downstream issues contributing to the challenge in resolving this. From my own testing and looking at the code there is clean up occurring. I suspect the garbage collection is not properly processing entity removal. But I am speculating on that part.