• Content Count

  • Joined

  • Last visited

Community Reputation

17 Good

About modding

  • Rank
    Junior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. If I recall correctly, both problems were present in single player version when I was testing it: reverse order of events and missing losefocus. Unless some pitfalls appear, I hope to make it not required for all clients at least. I'll take a look.
  2. Because when "Close" method is called: player.HUD.controls.foodcrafting:Close(inst.inst) It is called on the instance of MouseFoodCrafting: self.foodcrafting = self.containerroot:AddChild(MouseFoodCrafting()) Which has reference to the original method due to the way how inheritance is simulated in class.lua: elseif type(base) == 'table' then -- our new class is a shallow copy of the base class! for i,v in pairs(base) do c[i] = v end c._base = base end The hack just must be into the proper class: local FoodCrafting = _G.require 'widgets/mousefoodcrafting' Given the other code is correct, it will work (I checked it). Of course your code must be executed after Craft Pot's directory was added to package.path For anyone interested, AddClassPostConstruct uses the same wrapper approach but does entirely different thing. It wraps constructor function and __call metamethod of a class which means that your code will be executed for every instance as opposed to modification of the class itself which will serve as a shared metatable for all instances. I don't like the idea of tailoring code like this for a specific mod though. Sometimes it is also called in reverse order (Gain, Lose instead of Lose, Gain). This is why I don't use it. Challenge accepted By the way, the game interprets "client_only_mod = true" in a manner that allows code execution for mastersim. Yes probably it will end up with server-side portion but still useful without it and not required for all clients (I avoid introducing new netvars).
  3. Well something is wrong with this error screen. dont_starve/data/scripts/recipe.lua is a game file, not a mod file. Also the file doesn't have 72 lines of code to have an error on 72th line and doesn't mention SaveGameIndex. As of now the corresponding SW DLC file does but it has a different path (DLC0002/scripts/recipe.lua) and it also checks SaveGameIndex on 76th line before using it on 84th line. Is this copy of the game ok? I can guess what happens here and patch the mod to work around possible errors with specific game installations but currently other tasks are the top priority.
  4. Hey modding, I doubt that it is possible. I suggest you to make a server-side portion of code and a fallback mode for hosts without the mod installed.
  5. Hi. The goal: make the Finder mod fully client-side. The method: find a way to retrieve contents of visible containers, then cache the results in a tree or table structure for better performance and reducing network traffic. The question: how to get contents of containers on client side in any meaningful way. So the first thing to check is prefab.replica.container.classified of course which uses netvars to sync data. When a container is closed, classified prefab is removed and the field is set to nil, when the container is opened, a new classified prefab springs into existence and is attached to the container replica. Tracing it back on the client side leads to global ReplicateEntity function in mainfunctions.lua, which appears to be never called (from accessible lua code): modding$ grep -nwr ReplicateEntity entityscript.lua:501:-- EntityScript:ReplicateEntity() entityreplica.lua:73:function EntityScript:ReplicateEntity() mainfunctions.lua:441:function ReplicateEntity(guid) mainfunctions.lua:442: Ents[guid]:ReplicateEntity() Ok, the next option are netvars themselves. This is how they are used in container_classified.lua (corresponding event listeners are in RegisterNetListeners): table.insert(inst._itemspool, net_entity(inst.GUID, "container._items["..tostring(i).."]", "items["..tostring(i).."]dirty")) The code is pretty simple, it's not difficult to create a custom entity but for this to work one needs a way to make the server to do the similar steps and this brings us back to the classified object which exists when the container is open. I'd be opening and immediately closing containers from the code just to get the contents and cache them but then I looked for existing RPC handlers in networkclientrpc.lua. There are methods to work with already opened containers but no handler to actually open them except general ones like LeftClick handler. P. S. may be the rummage action will do if it works at distance and the data can be accessed between :Open and :OnUpdate runs P. P. S. no, it will not, doesn't work at distance Am I missing something?
  6. If screenshot is a problem, text of the error message will do just as well. A list of other mods you use would be nice too.
  7. Would you like to be more specific?
  8. Version 1.1


    Highlights nearby containers that contain necessary items. Helps to manage storages of two and more chests without burden to search items manually or remember them. DS/RoG/SW version of this mod in Steam workshop DST version of this mod in Steam workshop Controls When ingredients are hovered in crafting menu or an item is held by cursor this mod automatically highlights nearby containers that have items of the same type. Doesn't require special controls. Compatibility Should be compatible with everything: Don't Starve Reign Of Giants Shipwrecked Don't Starve Together
  9. Hi, try the new version here or on steam.
  10. Version 0.8.1


    This is the new location of this mod. This mod provides mechanics to plan bases before building them, calculate total number of required materials, keep plans to use later in the same game, save plans as blueprints to use them in other worlds and build planned things easily. This mod in Steam Workshop. Features + Optional pause mode, literally everything is paused so you can design in peace and silence + During multiple planning the number of planned objects is displayed + Auto-grid. Click and drag to plan many instances of the same item + Improved auto-build. Click plan icon to build the planned items + Your plans are saved automatically in the game save file + Whole plans can be remembered as patterns for future use and shared between save files + Things stitch to invisible grid + Requirements of materials or science machines for construction are honoured + Materials for a plan or one item in a plan are calculated and displayed on hover + Grass, saplings and walls have never been so easy! Compatibility Don't Starve Reign of Giants Shipwrecked Controls: - "P" or the top left button are the default ways to toggle planning mode - Primary control (left click usually) selects, puts and creates - Secondary control (right click) cancels, removes and deletes - Right click a plan to put this plan aside and make it shared between saves - Hold shift when right clicking a plan to delete it permanently - Click and drag to plan many items during one placement - Hold shift when placing something to do another placement easily
  11. There are two types of storing plans: Plans of the current save slot are stored in this slot (represented by upper row of icons). Permanent plans which are saved in one file and are shared between save slots (represented by smaller icons). Both can be deleted by right-clicking on the corresponding plan icon. The only trick is that when plans of the first type are removed, they are moved to the second type at first (this works both as a safety measure against misclicking and a way to create shared plans). If one is sure, shift+right-click is available to remove the plan completely.
  12. Q/E are the default keys to rotate camera view, the mod adapts click-and-drag placements to the current view. Yes, but not just walls.
  13. Sure the future will start as soon as I have dst. I'm interested and it should be easier early on, the main decision for multiplayer version is probably will the plans be shared between people or not.
  14. Thanks, I've made a quick fix to work around the behaviour so the caves can be entered in the save files. It'll be nice if you check whether it fixes part of the problem for you. Though this thing will need a better solution.