Maarx Posted November 13, 2016 Share Posted November 13, 2016 Is this the right place to post a mod suggestion? I feel like I have a really good idea for a mod but I am not sure if I can do it myself. I'll probably give it a try, but if I can inspire somebody else, I feel they could probably do it much better than I. I have been hosting a public dedicated server for cooperative style, up to 24 players or more. The game picks up a whole new type of fun with this many people, but there are a couple common problems revolving around item management. Problem 1: The group collectively generates a LOT of items, which need storage and organization. (You have never seen so many Logs!) Without mods, the inevitable result is constructing a LOT of Chests and Iceboxes, and then trying to somehow organize the items across these containers. This results in an artificially inflated base footprint, which in turn requires Ice Flingomatics in the summer, etc. Furthermore, especially with Iceboxes, the restriction of only one person able to use a container at a time results in people standing around waiting or competing to access the same containers, or dancing rapidly across the containers, searching for the right item. Without someone performing active organization, the items become scattered, and the group collectively loses track of what items they have and what items they still need to get. Solution 1: A single, very large container, with the maximum practical number of slots, which can be opened by multiple players at the same time, and which automatically sorts all of its contents into a consistent ordering, perhaps sorting only when nobody has it open. In the interest of maintaining balance, perhaps there are two versions, a Chest version and an Icebox version, and perhaps they begin as small containers, and you can "feed" them Boards and Gears (right-click?) to make them larger, respectively. Similarly, perhaps they are always fireproof, or perhaps you can "feed" them a Scale to make them fireproof. Similarly, a couple configuration options to limit malicious destruction, perhaps only Admins can hammer it? Problem 2: "This is mine." Players enjoy the concept of certain items being "theirs", but this is difficult to enforce, and requires a careful balance. There is a difference between a player soloing Deerclops, and wanting to keep their Eyebrella, compared to a greifer who logs in, grabs all the valuables, and logs out again, causing the items to be lost. Without mods, the inevitable result is, again, a huge inflation of Chests, marked with Signs threatening violence, sometimes scattered within the base or sometimes "hidden" in remote corners of the map. The result is that, for one reason or another, valuable items go missing with unfortunate frequency. Solution 2: A player can craft a personal storage container. For reasons that will become apparent, I think this container functions like a Backpack, rather than a Chest, but it never rots, at least when it contains items, and is probably fireproof. It, again, has a huge number of slots, but it is not intended for the player to walk around with it, so perhaps it reduces movement speed by an impractical amount (90-95% reduction?). Each container is tied to the person who creates it, and normally, no other player is able to pick it up. But when a player quits the game, the mod instantly creates another such container, moves all of their inventory items into the container, and leaves it on the ground, where they left. After these containers are left untouched for a certain length of time (2 minutes? 10 minutes? Dependent on player's session time?), the containers are magically teleported back to the base, perhaps to a specific structure which attracts them and gathers them all together. The containers can all be safely kept in the same location, since other players cannot touch them, except an Admin is able to pick up other player's containers, mostly to help recover items lost to greifers. I am quite pleased with this idea of mine, and feel it would be a very elegant solution to many of the problems facing large servers, but I haven't written any code in years, and it would probably take me an impractically long time to write. I'd love to inspire somebody else to create it. Link to comment https://forums.kleientertainment.com/forums/topic/71668-mod-suggestion-solution-to-item-management-in-dst/ Share on other sites More sharing options...
SrJardel Posted November 13, 2016 Share Posted November 13, 2016 (edited) 1. Not sure about something specific to sugest, but perhaps Storm Cellar would worth a try? 2. Have you tried Ownership/Modify Ownership already? Edited November 13, 2016 by SrJardel Typo Link to comment https://forums.kleientertainment.com/forums/topic/71668-mod-suggestion-solution-to-item-management-in-dst/#findComment-837118 Share on other sites More sharing options...
Serpens Posted November 13, 2016 Share Posted November 13, 2016 (edited) 1) to find searched items: http://forums.kleientertainment.com/files/file/1609-finder-mod-working-also-for-clients-dst/ to reduce tools number (thousands of shovels with 20% or simular): http://steamcommunity.com/sharedfiles/filedetails/?id=767776640 I'm not sure, but I think it is impossible to allow mutliple players to act with the same container at the time, cause of game client/server limitation. Edited November 13, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/71668-mod-suggestion-solution-to-item-management-in-dst/#findComment-837153 Share on other sites More sharing options...
blubuild Posted November 14, 2016 Share Posted November 14, 2016 On 11/13/2016 at 9:47 PM, Serpens said: I'm not sure, but I think it is impossible to allow mutliple players to act with the same container at the time, cause of game client/server limitation. I don't really think so... running code can modify a container's contents while it's opened by a player with no issues. The container's UI even updates in realtime. And not sure about this one, but I think I might remember multiple players being able to open a container once, when DST was beta? Or maybe I'm just remembering Minecraft. There are too many needed items in this game. Mods that increase item's maximum stack sizes also help. In the near future I'm going to release one that allows full customization of every individual item's stack size (via creating a Lua config file, although there are also various more limited in-game configuration options), along with a few small conveniences that make keeping inventory, such as freely combining stacks of Logs and Boards in your inventory (same for the other refined items), essentially allowing to convert them at will, too (by default, only if you've already unlocked the Refine recipe). It will also depend on a mod library I'm making to make writing mods more convenient and a little easier... The containers in the game are also ridiculously small indeed, which leads to even singleplayer DS worlds requiring bases with ridiculous numbers of chests. But fortunately mods are already available to take care of this problem. Same for private items. There's also a "Buried Treasure" mod that allows players to 'bury' items in a hidden secret container you must remember the location of in order to access, not sure if it still works, though. Link to comment https://forums.kleientertainment.com/forums/topic/71668-mod-suggestion-solution-to-item-management-in-dst/#findComment-837645 Share on other sites More sharing options...
Maarx Posted November 21, 2016 Author Share Posted November 21, 2016 So, I'm giving this a shot, despite zero experience in Lua and zero experience in DS/DST modding before today. I obviously have a ton to learn before packaging anything as my own. But the first big question mark here seems to be whether we can get a container that multiple people can interact with simultaneously, because everything else is moot without this, and so this seems to warrant a proof-of-concept before diving any deeper. So, I started with a shameless copy+paste of the mod "DST Storm Cellar" by Afro1967, because this would be kind of close, if we can allow multiple people to interact with it simultaneously. I copied the folder /mods/workshop-382177939 into /mods/myMod3 (don't ask what happened to 1 and 2). I figured I'd call it "SuperStorage" for now, and updated the first couple lines of modinfo.lua accordingly. I skimmed the code, but the magic doesn't seem to happen anywhere within the mod's code. Rather, the magic seems to happen around here: /scripts/components/container.lua:285 function Container:Open(doer) /scripts/components/container_replica.lua:255 function Container:Open(doer) So, needing to (presumably) modify this code, and given this is component code and not just prefab code, and not knowing how many modifications would be required to establish proof of concept, my first genius idea was to just spin off a total copy of the "container" component, which I figured I'd call a "superstorage" component for now, I guess. So I copied all of the following /data/scripts/ into /mods/myMod3/scripts/ /components/container.lua /components/container_replica.lua /prefabs/container_classified.lua /widgets/containerwidget.lua /containers.lua ... and then I opened up all those files, plus the mod's existing /scripts/prefabs/cellar.lua, plus the mod's modinfo.lua and modmain.lua ... ...and I did a global Find&Replace, all instances of "container" with "superstorage" (and same for Uppercase), and updated the file names in the exact same way. The result of this horrific monstrosity is attached here as [myMod3.rar]. The intention, at this stage, is that the actual object would function identically, because I was intending to (only) make a copy of "container" called "superstorage" but have it be supported by all of the exact same actual code with no "actual" changes yet. But when I try to place the object, I get immediate error. Screenshots are attached, with the steps leading up to it as [1.jpg] and [2.jpg], and the stack trace itself as [3.jpg]. I figure I am probably so hopelessly and fundamentally off base already that I am probably beyond anyone's help but I figured I would post here in case it is some sort of simple gotcha that I am missing so far. myMod3.rar Link to comment https://forums.kleientertainment.com/forums/topic/71668-mod-suggestion-solution-to-item-management-in-dst/#findComment-839935 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now