Stack Size Controller
Allows you to set the max stack size of every item.
Total Downloads: 39,390 - First Release: Feb 10, 2017 - Last Update: Oct 27, 2017
- 5/5, 50 likes
-
Hey, having some issues with it. i typ ein the commands and everything and yet still will not work. it help alot.
-
-
From this:
Code:" Cooked Bear Meat"
Code:"Cooked Bear Meat"
-
missing items..
Silencer?
muzzle?
doors? -
-
hey Canonpy, I've installed the plugin onto my server trying to change the stack size, but it will not work. I'm admin and all type in /stack all 20000 for examble and doesn't show command initiated. Checked my data folder. Shows nothing on this plug in. Any help would be appreciated .
-
-
I have no clue, im kinda new to this
[DOUBLEPOST=1513401004][/DOUBLEPOST] -
... silly me i should have looked!
~FoX~ -
Once I change any stack sizes through the config file, I reload the plugin, and it's fine. When the server restarts, the config goes back to default.
-
Hey, I finally decided to add a modded server. (currently own a vanilla one). I used this mod and it is fantastic but i wanted to change the values quickly by just multiplying all the values by set amount (5). I modified your code and added this. It would be nice if you release something similar like this with your next version.
Basically you type "/stacktimes 5" and it multiplies all the current/ default values by the set amount.
Code:[ChatCommand("stacktimes")] private void StackTimesCommand(BasePlayer player, string command, string[] args) { if (!hasPermission(player, "stacksizecontroller.canChangeStackSize")) { SendReply(player, "You don't have permission to use this command."); return; } if (args.Length == 0) { SendReply(player, "Syntax Error: Requires 1 argument. Syntax Example: /stackall 65000"); return; } int stackAmount = 0; if (int.TryParse(args[0], out stackAmount) == false) { SendReply(player, "Syntax Error: Stack Amount is not a number. Syntax Example: /stackall 65000"); return; } var itemList = ItemManager.itemList; foreach (var item in itemList) { if (item.condition.enabled && item.condition.max > 0) { continue; } if (item.displayName.english.ToString() == "Salt Water" || item.displayName.english.ToString() == "Water") { continue; } Config[item.displayName.english] = (int)Config[item.displayName.english] * Convert.ToInt32(args[0]); item.stackable = (int)Config[item.displayName.english] * Convert.ToInt32(args[0]); } SaveConfig(); SendReply(player, "The Stack Size of all stackable items has been multiplied with " + args[0]); }
-
Notes
- Items with durability are not added to the config, and will not stack above 1. This is done to prevent exploits.
- Items manually added to the config that have durability will automatically be changed to 1.
- If an item name has an /n in it, this is intentional, DO NOT change it, or that will break the item stacking.
- Items not being split in half and greater than 65,535 will split to 65,000 and the rest of the total amount (something involving the max 16 bit integer (65,535))
- Stacking an item over 2,147,483,647 will cause an error when loaded and will not stack the item at that number. 2,147,483,647 is the max for stack sizes for all stack size plugins.
-
-
-
Because i cannot return a default value i had to use the current value and multiply it.
I will try and find a better way and post it but my point was it would be great if we had a multiplier value to quickly set the the value of all applicable items fast -
OK so here is code that works perfectly. The only issue is that once you multiply the values you cannot revert back because it multiplies the current configured values and not from the default values (I do not know where to get the default values unless you store it manually).
The code below only updates item values that is more that 1. Items like beds and clothes will be unaffected for now. (you can update that manually).
It also defaults to 65000 if the calculations are more than 65000 to prevent issues.
I tested it and works nice but if there is a better way please let me know.
Code:[ChatCommand("stacktimes")] private void StackTimesCommand(BasePlayer player, string command, string[] args) { if (!hasPermission(player, "stacksizecontroller.canChangeStackSize")) { SendReply(player, "You don't have permission to use this command."); return; } if (args.Length == 0) { SendReply(player, "Syntax Error: Requires 1 argument. Syntax Example: /stackall 65000"); return; } int stackAmount = 0; if (int.TryParse(args[0], out stackAmount) == false) { SendReply(player, "Syntax Error: Stack Amount is not a number. Syntax Example: /stackall 65000"); return; } var itemList = ItemManager.itemList; foreach (var item in itemList) { //Only get items that is already more than one to insure we only get stackable items. if (Convert.ToInt32(Config[item.displayName.english]) > 1) { //If the calculation is more that 65000 then force it to 65000 to prevent stack issues else calculate as normal if (Convert.ToInt32(Config[item.displayName.english]) * Convert.ToInt32(args[0]) > 65000) { Config[item.displayName.english] = 65000; item.stackable = 65000; //Lets add the values that has been changed to the console for now :) Puts("[STACKER]Changed the value of: " + item.displayName.english + " to: 65000"); } else { Config[item.displayName.english] = (int)Config[item.displayName.english] * Convert.ToInt32(args[0]); item.stackable = (int)Config[item.displayName.english] * Convert.ToInt32(args[0]); //Lets add the values that has been changed to the console for now :) Puts("[STACKER]Changed the value of: " + item.displayName.english + " to: " + Config[item.displayName.english]); } } else { //Ignore it because it is probibly not stackable. (lets print it in the console :) Puts("[STACKER]ERROR: Cannot change the value of: " + item.displayName.english + " to: " + Config[item.displayName.english]); } } SaveConfig(); SendReply(player, "The Stack Size of all stackable items has been multiplied with " + args[0]); }
-
This will return false is the value exceeds the max 32 integer (2,147,483,647), which will throw an error if the config contains it. Anything above 65,000 won't cause an error, just an annoying stack issue.
Code:if (int.TryParse(args[0], out stackAmount) == false) { SendReply(player, "Syntax Error: Stack Amount is not a number. Syntax Example: /stackall 65000"); return; }
Code:if (item.condition.enabled && item.condition.max > 0) { continue; }
-
Does anyone run this plugin as well as Skins? I notice that this error occurs when I reload Stack Size Controller, resets the config to default, and the errors all have to do with skins.
Code:StackSizeController was compiled successfully in 3828ms[Stack Size Controller] Creating a new configuration file.[BUNDLE] Not found in bundle: assets/content/ui/ingame/ui.item.dropped.anim.anim[BUNDLE] Not found in bundle: assets/content/ui/ingame/ui.item.dropped.controller[BUNDLE] Not found in bundle: assets/content/ui/ingame/ui.item.pickup.anim.anim[BUNDLE] Not found in bundle: assets/content/ui/ingame/ui.item.pickup.controller[BUNDLE] Not found in bundle: assets/content/ui/menu/ui.serverbrowser.item.controller[BUNDLE] Not found in bundle: assets/content/ui/ui.itemicon.shader[BUNDLE] Not found in bundle: assets/content/workshop/skin/ak47/digital camo/skin.ak47.digitalcamoak47.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/ak47/military camo/skin.ak47.militarycamoak47.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/ak47/temper/skin.ak47.temperedak47.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/balaclava/rust nightmare - balaclava/skin.balaclava.nightmarebalaclava.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/balaclava/the necrophagus - balaclava/skin.balaclava.skinbalaclava.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/balaclava/the rust knight/skin.balaclava.therustknight.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/balaclava/valentines balaclava/skin.balaclava.valentinebalaclava.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/balaclava/zipper face/skin.balaclava.zipperface.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/bandana/creepy clown bandana/skin.bandana.creepyclownbandana.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/bandana/wizard bandana/skin.bandana.wizardbandana.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/beenie/winter deers/skin.beenie.winterdeers.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/box.wooden.large/ammo v2 wooden box/skin.woodstorage.ammowoodenbox.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/box.wooden.large/christmas storage/skin.woodstorage.christmasstorage.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/box.wooden.large/first aid green wooden box/skin.woodstorage.firstaidgreen.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/box.wooden.large/gun box - military green/skin.woodstorage.gunbox.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/burlap.shirt/skin.burlapshirt.piratevest&shirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/gloves.burlap/boxer's bandages/skin.burlapgloves.boxer'sbandages.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hat.bucket/medic helmet/skin.buckethat.medichelmet.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hat.cap/friendly cap/skin.cap.friendlycap.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hat.cap/rescue cap/skin.cap.rescuecap.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/bchillz! hoodie/skin.hoodie.bchillzhoodie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/bloody hoodie/skin.hoodie.bloodyhoodie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/cuda/skin.hoodie.cuda87hoodie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/rhino/skin.hoodie.rhinocrunchhoodie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/safety crew/skin.hoodie.safetycrew.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/hoodie/skeleton hoodie/skin.hoodie.skeletonhoodie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/jacket/provocateur jacket/skin.jacket.provocateurjacket.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pants/blue track pants v.2/skin.pants.bluetrackpantsv.2.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pants/old prisoner pants/skin.pants.oldprisonerpants.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pants/punk rock pants/skin.pants.punkrockpants.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pistol.revolver/revolver outback/skin.revolver.revolveroutback.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pistol.semi/contamination pistol/skin.semiautopistol.contaminationpistol.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pistol.semi/halloween bat/skin.semiautopistol.halloweenbat.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pistol.semi/red shine/skin.semiautopistol.redshine.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/pistol.semi/semiauto pistol reaper note/skin.semiautopistol.reapernotepistol.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/rifle.bolt/bolt rifle dreamcatcher/skin.boltrifle.dreamcatcher.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/rifle.bolt/ghost bolt rifle/skin.boltrifle.ghostboltrifle.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/rifle.bolt/tundra bolt action/skin.boltrifle.tundraboltrifle.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shoes.boots/army boots/skin.boots.armyboots.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shoes.boots/bloody boots/skin.boots.bloodyboots.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shoes.boots/punk boots/skin.boots.punkboots.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shoes.boots/scavenged sneakers/skin.boots.scavengedsneakers.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shotgun.pump/pump shotgun chieftain/skin.pumpshotgun.pumpshotgunchieftain.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shotgun.pump/the swampmaster/skin.pumpshotgun.theswampmaster.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/shotgun.waterpipe/the peace pipe/skin.pipeshotgun.thepeacepipe.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/blue plaid sleeping bag/skin.sleepingbag.blueplaidsleepingbag.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/merry christmas sleeping bag/skin.sleepingbag.astonchristmas.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/merry christmas/skin.sleepingbag.christmasbag.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/sleeping horror/skin.sleepingbag.horrorbag.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/tiger crown/skin.sleepingbag.tigercrownsleepingbag.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/sleepingbag/usa wood camo sleeping bag + dirt/skin.sleepingbag.woodcamosleepingbag.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt.long/creepy jack/skin.longtshirt.creepyjack.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt.long/merry reindeer long t-shirt/skin.longtshirt.merryreindeer.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/argyle scavenger/skin.tshirt.argylescavenger.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/aztec long t-shirt/skin.longtshirt.azteclongt-shirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/baseball tshirt/skin.tshirt.baseballtshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/black skull&bones tshirt/skin.tshirt.blackskull&bonestshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/frankensteins sweater/skin.longtshirt.frankensteinssweater.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/green checkered shirt/shirtgreen.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/hacker valley veteran/skin.tshirt.hackervalleyveteran.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/japanese murderer tshirt/skin.tshirt.murderertshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/missing textures full/skin.tshirt.missingtexturesfull.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/nightmare sweater/skin.longtshirt.nightmaresweater.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/ser/skin.tshirt.serwintertshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/sign painter's long tshirt/skin.longtshirt.signpainter'slongtshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/smile t-shirt/skin.tshirt.smilet-shirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/target practice tshirt/skin.tshirt.targetpracticetshirt.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/varsity jacket/skin.longtshirt.varsityjacket.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/tshirt/vyshyvanka/skin.tshirt.vyshyvanka.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/unknown/farmer hat/skin.boonie.farmerhat.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/unknown/murica balaclava/skin.balaclava.muricabalaclava.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/unknown/rasta beenie/skin.beenie.rastabeenie.itemskin.asset[BUNDLE] Not found in bundle: assets/content/workshop/skin/unknown/rorschach skull/skin.balaclava.rorschachskull.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.beenie/black/hat.beenie.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.beenie/blue/hat.beenie.blue.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.beenie/green/hat.beenie.green.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.beenie/red/hat.beenie.red.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.cap/blue/hat.cap.blue.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.cap/forestcamo/hat.cap.forestcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.cap/green/hat.cap.green.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.cap/grey/hat.cap.grey.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hat.cap/red/hat.cap.red.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hoodie/black/hoodie.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hoodie/blue/hoodie.blue.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/hoodie/green/hoodie.green.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.snow/jacket.snow.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.snow/jacket.snow.woodland.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/blue/jacket.blue.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/desertcamo/jacket.desertcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/green/jacket.green.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/hunter/jacket.hunter.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/jacket.red.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/multicam/jacket.multicam.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/snowcamo/jacket.snowcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/jacket.vagabond/urbancamo/jacket.urbancamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/pants/forestcamo/pants.forestcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/pants/jeans/pants.jeans.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/pants/snowcamo/pants.snowcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/pants/urbancamo/pants.urbancamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/shoes.boots/black/shoes.boots.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/shoes.boots/tan/shoes.boots.tan.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt.long/black/tshirt.long.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt.long/grey/tshirt.long.grey.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt.long/orange/tshirt.long.orange.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt.long/yellow/tshirt.long.yellow.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/black/tshirt.black.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/blue/tshirt.blue.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/flag.germany/tshirt.flag.germany.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/flag.russia/tshirt.flag.russia.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/forestcamo/tshirt.forestcamo.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/gmod/tshirt.gmod.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/red/tshirt.red.itemskin.asset[BUNDLE] Not found in bundle: assets/prefabs/clothes/tshirt/urbancamo/tshirt.urbancamo.itemskin.asset[Stack Size Controller] Updating configuration file with new values.
-