• Content Count

  • Joined

  • Last visited

Community Reputation

71 Excellent

About TheSkylarr

  • Rank
    Senior Member

Recent Profile Visitors

1205 profile views
  1. I would just make the amulet have no effect while equipped, and fix the bug, that way it can still be crafted when needed by your character, even if they aren't going to be using it. Can I see the code you're using to make them have the crafting discount inherently?
  2. The Deployable component pushes an event to TheWorld if specfiically a PLANT is planted, with info about who planted it. We can use this to elegantly grant sanity (or other effects) to the planters. Info about the event itself and when it gets pushed can be found in a few places, namely deployable.lua and farmplantable.lua. Anyway, since we have access to this event, we can listen for it on specific characters using an AddPlayerPostInit() in modmain. Here's an example I threw together that should work for your needs. Make sure to change the tag to one only your character has, or change it to detect your character in some way, like a prefab name. AddPlayerPostInit(function(inst) -- This will run on any characters that have the tag below, whenever they plant something in a plot -- "world" is needed as the first parameter due to listening from TheWorld. local function OnPlanted(world, data) -- Grant sanity, or whatever else, to the planter here if data.doer.components.sanity then data.doer.components.sanity:DoDelta(3) end end if inst:HasTag("MY_TAG") then -- Make sure to set this tag to your character's tag GLOBAL.TheWorld:ListenForEvent("itemplanted", OnPlanted) -- Pushed in FarmPlantable.lua, Deployable.lua, and more. end end) That should work for you. If you wanted to put this in your character's prefab script instead of modmain, that can also be done with some adjustment. We'd have to listen for the event in master_postinit() instead of inside an AddPlayerPostinit(), and we wouldn't have to filter by tag since we know 100% this will only run on our character. Other than that, we could reuse the same OnPlanted() function as I put above. In master_postinit() TheWorld:ListenForEvent("itemplanted", OnPlanted) and somewhere above master_postinit() local function OnPlanted(world, data) -- Grant sanity, or whatever else, to the planter here if data.doer.components.sanity then data.doer.components.sanity:DoDelta(3) end end I would only do this though if you're overly bothered about having your modmain filled up with stuff that could be somewhere else, like I always am. Either solution will perform just fine. Good luck!
  3. These guides looks pretty well written! As far as the mods you listed in your top 15, I only disagree with Too Many Items Plus, as I don't believe that mod has been functional in quite some time. Good job on the writing, though I think the tutorials section of the modding subforum may not be the best place for them, perhaps the parent DST modding forum, or perhaps the general DST discussion forum.
  4. I believe your issue is that your image file for swap_tranquility isn't inside a folder, it's just sitting in the same folder as the spriter project. Try making it like this With swap_tranquility.png being inside that new folder, and make sure to correct your spriter project with the correct new image, as it won't find the old one now that you've moved it.
  5. The item being invisible in hand is likely something wrong with the values inside OnEquip, specifically AnimState:OverRideSymbol(). Taking a snippet from the custom item templates found in the Tutorials and Guides section of the forums, here's how it should be structured to avoid the invisible issue owner.AnimState:OverrideSymbol("swap_object", "Your_build(*.zip_filename)", "Symbol_from_your_build(name_of_subfolder_with_art)") As for the inventory icon issues, in your item's prefab, comment out these 2 lines underneath AddComponent("inventoryitem"), inst.components.inventoryitem.imagename = "tranquility" inst.components.inventoryitem.atlasname = "images/inventoryimages/tranquility.xml" and put this somewhere in your file, OUTSIDE OF A FUNCTION, and before the return at the bottom. RegisterInventoryItemAtlas("images/inventoryimages/tranquility.xml","tranquility.tex") This will properly register your item's icon with the game, as long as the name of your prefab is the same as the filename of the tex, it will work fine, and should fix both inventory icon issues. If it doesn't, leave another comment here though. Side things, the structure of your tranquility.lua file is a little strange, having your OnEquip and OnUnequip functions inside your constructor fn isn't necessarily wrong, but doesn't line up with how it's normally done, and also, at the bottom you have it returning common/inventory/tranquility. To be honest, I have no idea what that does, if it does anything different, than just returning the name of the prefab.
  6. Hey guys, I threw together a batch script a few days ago that I've been using CONSTANTLY, so I figured I'd share it, as it's saved me so many annoying clicks. It's as simple one-liner that opens the Client and Server logs in Windows Terminal, so you'll need that to use this. It comes with Windows 11 by default as far as I know, and Windows 10 users can install it from the Microsoft Store for free. Here's the code, it's pretty simple. It tells wt (Windows Terminal) to make a couple of tabs, color them red and blue, name them, and make them tail the client and master_server logs. Nothing much to it, but pretty useful for me, and I hope to you too! cmd /c "wt --title "Server Log" --tabColor #AA0000 PowerShell Get-Content %homepath%/Documents/Klei/DoNotStarveTogether/master_server_log.txt -wait; new-tab --title "Client Log" --tabColor #0000AA PowerShell Get-Content %homepath%/Documents/Klei/DoNotStarveTogether/client_log.txt -wait" Here's a download for it if you'd like. It uses the same exact code from above, just pasted inside a batch file. open_logs.bat
  7. Are Label and Image engine functions? They seem to fall in line with a lot of the other things listed here.
  8. Seems like this is broken with the update to the crafting UI. Dang. From a few minutes of glancing at the code, it may be able to be mostly reused, just will need some changes to replace the new UI rather than the old one. Unfortunately I have no idea how to do this on my own.
  9. You still need to declare the used assets in your assets table, you're doing that correct?
  10. You're probably running in to some operator precedence mishap, take a look at this lua article, that should help.
  11. I believe your problem is that ShadowFormController is getting called A LOT from the hungerdelta event listener, since that event is pushed whenever the character's hunger updates. You should add a check to both of your ShadowFormController if statements to make sure you haven't already ran that code. You can add, remove, and check for tags using. inst:AddTag("sunform") -- doesn't have to be sunform, any alphanumeric string afaik inst:RemoveTag("sunform") inst:HasTag("sunform") -- This one is treated more like a variable than a function you can run by itself, use it in if statements
  12. What exactly is your idea? There are a lot of different people with expertise in different areas around this forum, for instance I'm more versed in characters, sounds, and post processing than anything else.
  13. Does png only scan inside images?
  14. Very useful, I've always kept my icons to 128x128 and just copied the xml between my mods, I was always too scared to try and change it!
  15. You take a look here, though I'm not sure why you want to