1. Hi,

    After this new update hit my server got some weird bug with ammunition researching. Somehow ammunition research gives me between 50k and 200k ammo bp's. It depends on which ammo. Tested on pistol bullet which was 50k and rocket which was 200k.
    I have no clue what plugin is causing this.
    Here some screenshots.
    I tried unloading all plugins and even without plugins the bug persist. I contacted Helk from FP and he confirmed its modded only its not on vanilla. I think its a bug in Oxide itself.
     

    Attached Files:

    Last edited by a moderator: Aug 19, 2016
  2. Wulf

    Wulf Community Admin

    I had a few people test with all of Oxide's research hooks disabled, and they still had the issue. With Oxide not touching any other researching spots, I don't see how it can be the cause.
     
  3. This is because of stacksizecontroller i believe.
     
  4. I really don't know but its none of the plugins cause i tested with all plugins loaded and after that i did in console unload * and checked everything was unloaded. And still it gave me 50k pistol bullet bp's

    And its for sure not StacksizeController cause when i try to stack it, it stacks to like 1000
     
    Last edited by a moderator: Aug 19, 2016
  5. Calytic

    Calytic Community Admin Community Mod

    The Fix.
    1. Download & install ItemConfig for Rust | Oxide
    2. Open config/ItemConfig.json
    3. Change blueprintStackSize for every item to the amount of blueprints players should receive for researching the item
    4. Reload ItemConfig

    The default formula used for ammunition is: (stackSize / craftedAmount) * 2

    Non-ammo blueprintStackSize is based on rarity:
    Common: 20
    Uncommon: 15
    Rare: 10
    Very Rare: 5
     
  6. U sure this absolutely works since the plugin is older then the update. And since this issue isn't any plugin related bug it shouldn't be fixed with just a random plugin. But thats my oppinion. Did any other modded server owner found this bug also?
     
  7. Calytic

    Calytic Community Admin Community Mod

    ItemConfig is dynamic and doesn't need to be changed to work.
     
  8. Of course a plugin can fix an issue introduced later than the plugin.
    Imagine Rust introducing a bug that sets the stack size of one particular item to a very large unintended number: You'd likely still be able to fix the issue with StackSizeController, even when it was updated before the Rust update.
     
  9. I'll give it a try but i don't think it would fix it, but if it would it should be just temporary and there should be made a good proper fix for this.
    I'll reply back when i tested it and will post the results. Cause its kinda absurd that i need to use a plugin for something thats not related to any other plugin but the plugin manager itself.
    Its not Rust which is confirmed by the devs. And its not my plugins which i can confirm cause i disabled all of them and it ran vanilla with just only oxide.
     
  10. This has really nothing to do with stacksize controller, it just gives me 200k bp's of rockets when i research one and it should be like 5.
    And like said in my previous post, i ran the server pretty much vanilla to test it out without ANY plugin loaded besides oxide itself. So there is going something wrong between Rust and oxide that gives me this bug. I am not here to blame anyone for this stupid bug, i am just here to get this fixed and acknowledged.

    Edit: Just tested it and like i thought this is no fix @Calytic Tnx for your try tho.
    There is no real settings that gives me the option how many bp's i can get from one bullet.
     
    Last edited by a moderator: Aug 19, 2016
  11. I was just giving an example for a situation where an older plugin could fix a bug, I wasn't blaming StackSizeController :p
     
  12. Keep in mind that unloading StackSizeController does not undo the changes it did to allow the items to stack higher. I just tested with 5.56 ammo with the default stack size of 100 and 1 of those gave me 66 blueprints, after that I added the StackSizeController plugin and changed the stacksize to 1000 which then resulted in 666 blueprints when using 1 of those on the research table.

    The issue you are having is in fact with StackSizeController or any other plugin that changes the stacksize of items. Basically what happens is when researching an item is that it calculates the amount of blueprints it should give.
    Code:
     int amount = researchItem.info.Blueprint.blueprintStackSize != -1 ? researchItem.info.Blueprint.blueprintStackSize : this.GetBlueprintStacksize(researchItem));
    However for ammo and maybe some other items, the blueprintStackSize is set to -1 which results in the GetBlueprintStacksize method to be executed, and this method creates a new amount based on the rarity of the item or in case of ammo, the stacksize:
    Code:
        public int GetBlueprintStacksize(Item sourceItem)
        {
            int num = this.RarityMultiplier(sourceItem.info.rarity);
            if (sourceItem.info.category == ItemCategory.Ammunition)
            {
                num = Mathf.FloorToInt((float)sourceItem.info.stackable / (float)sourceItem.info.Blueprint.amountToCreate) * 2;
            }
            return num;
        }
    
     
  13. I just tested it by setting max stacksize to vanilla 32 on pistol bullets and it still gave me 50k of bp's, thats why i said it didnt actually work. Or i setted it wrong. Cause there are alot of pistol bullet settings in that plugin but only one showing with stacksize of blueprints
    [DOUBLEPOST=1471614932][/DOUBLEPOST]Then i got a 2nd good question. Why does this only apply on bullets and not on medical suppliments? if i research a syringe it literally gives me the vanilla amount of syringe bp's. This only occurs with ammo and nothing else. And i do have custom stacksize for medical suppliments aswell
     
    Last edited by a moderator: Aug 19, 2016
  14. Second code fragment in my post, for ammo it uses the stacksize to determine the amount, for other items it uses the rarity of the item.
     
  15. Alright gonna test that now and ill post the results in a few moments
    [DOUBLEPOST=1471616928][/DOUBLEPOST]Tested it like u said and it worked it gives me 3 rockets now. But now im thinking its based on its rarity right.
    I use BetterLoot. Can it maybe that causing the issue? Cause that alters rarity of items(finding them actually).
    Might be a wild guess, not that good in understanding how these plugins work.
    Not sure if it only works with unloading but so far i see it has only to do with stacksize controller indeed. I already notified the plugin developer thru the support page of its plugin and gave him the link of this thread.
     
    Last edited by a moderator: Aug 19, 2016
  16. Rarity has nothing to do with the amount of blueprints you obtain for ammo, only other items are affected by rarity. The easiest solution would probably be to allow StackSizeController also modify the stacksizes of blueprints or a separate plugin that allows you to configure ResearchTables as in how many blueprints you obtain per item when researching.
     
  17. Calytic

    Calytic Community Admin Community Mod

    I was incorrect, the reading is dynamic but not the writing.
     

    Attached Files:

  18. Code:
    void OnServerInitialized()
            {
                permission.RegisterPermission("stacksizecontroller.canChangeStackSize", this);            var dirty = false;
                var itemList = ItemManager.itemList;            foreach (var item in itemList)
                {
                    if (item.condition.enabled && item.condition.max > 0) { continue; }                if (Config[item.displayName.english] == null)
                    {
                        Config[item.displayName.english] = item.stackable;
                        dirty = true;
                    }                item.stackable = (int)Config[item.displayName.english];
                }            if (dirty == false) { return; }            PrintWarning("Updating configuration file with new values.");
                SaveConfig();
            }
    Couldnt we detect if item is blueprint and if so set its item.stackable to false??
     
  19. Calytic

    Calytic Community Admin Community Mod

    What would that accomplish?
     
  20. Make blueprints not stackable. :D