Search the Community
Showing results for tags 'Custom Item'.
-
It's not game breaking or anything, but the icons of the custom items that my character spawns with don't show up in character select. Am I missing a file or a line of code? Their inventory icons do show up once I spawn, so I don't know why they don't show up in this screen. I'll leave the luas of both items attached as well just in case. gutsybat.lua pklifeup.lua
-
Hi! I've been working on a new mod for a commissioner of mine, and so far everything seems fine, but when I test it on worlds with caves the custom weapon of that character refuses to spawn with the command DebugSpawn, and when I craft it the character holds it and can use it but it's invisible on the inventory and cant be selected (also the animation when attacking glitches out and makes the character's arm invisible along with the weapon itself). I also can't pick it up pressing space when I debug spawn it. I checked if all clients require mod in modinfo.lua was set to true and it is, so I have no idea what might be the problem. I've tried it also when playing on offline mode and on local and it just doesn't wanna work. I also tried uploading it to workshop to see if that happened to fix it, but to no avail. This also didn't happen to me on my first mod where I added a custom healing item. No idea what might be causing it honestly. Any help is truly appreciated, I'll attach a couple of files that may be the cause. "bloodshot" is the character, "shotknife" is the weapon. bloodshot.lua shotknife.lua modinfo.lua modmain.lua
-
Hello Again! I need some assistance in regards to some custom items I've worked on for a friend. I was recently notified of a game crashing bug that only occurs with more than one person on a sever. Alone it doesn't crash, but once someone joins, boom. The items in question buff the player by temporarily giving them either a cooling or heating radius. I am using Ultroman's Aura Code and other references I've looked into to turn the crafter into a walking heater/cooler for a duration of time (the reason for the aura was for possible changes in case my friend wanted that buff to apply to other characters nearby by increasing the buffing range). I definitely screwed up in the heating & cooling, but unfortunately the error log is rather obscure to me, and since it doesn't crash with one player, so I can't seem to pinpoint this. I did browse through any existing examples of say portable heaters, thermal stones and similar items, but I was never comfortable when coding this. It was rather hard for me to tell whether or not my character was warming up or cooling down when these items applied their buff. Any assistance or insight will be greatly appreciated. I've attached the client_log and two item prefab files. This is what I have for the Heating. Cooling is pretty much the same but with different temp values. local assets = { Asset("ANIM", "anim/wyrdflask_heating.zip"), Asset("ATLAS", "images/inventoryimages/wyrdflask_heating.xml"), } local prefabs = { "wyrd", "wyrdflask" } -- HEATING AURA WORKS DIFFERENTLY THIS ONLY APPLIES THE BUFF -- ONCE BUT THE BUFF LASTS BASED ON WHAT heatingAuraDuration -- IS. RADIUS IS SET TO 1 SO THAT WYRD IS THE ONLY ONE WHO -- GETS THE BUFF. --------------------------------------- -- LOCAL EASY TO FIND VARIABLES - START --------------------------------------- -- TUNING.TOTAL_DAY_TIME = 8 MINUTES = 480 SECONDS / X = TOTAL TIME. -- WORK WITH DIVISION/MULTIPLICATION OF TOTAL DAY TIME -- EX: TUNING.TOTAL_DAY_TIME * 2 = DAYS local heatingAuraDuration = TUNING.TOTAL_DAY_TIME/1.6 -- 5 MINUTES local heatingAuraRadius = 1 -- RADIUS OF AURA local heatingTick = 0.1 -- DELAY IN WHICH HEATING AURA ACTIVATES WHEN CRAFTED --------------------------------------- -- LOCAL EASY TO FIND VARIABLES - END --------------------------------------- -------------------------------- -- WYRD EXCLUSIVE PICKUP - START - --CODE REFERENCED FROM maliblues : https://forums.kleientertainment.com/forums/topic/113820-help-preventing-custom-item-from-going-into-backpackschestsetc/?do=findComment&comment=1287064 -------------------------------- local function OnPutInInventory(inst) local owner = inst.components.inventoryitem:GetGrandOwner() if owner == nil then return elseif owner.components.inventory and owner.prefab ~= "wyrd" then inst:DoTaskInTime(0.1, function() owner.components.inventory:DropItem(inst) owner.components.talker:Say("That flask is cursed...") end) end if owner.components.container then --for chests --test when in backpack with diff owner inst:DoTaskInTime(0.1, function() owner.components.container:DropItem(inst) end) end end -------------------------------- -- WYRD EXCLUSIVE PICKUP - END -------------------------------- ------------------------------------------------------ -- RETURNS ORIGINAL FLASK AFTER TIME REACHES 0 - START ------------------------------------------------------ local function OnFinished(inst) local owner = inst.components.inventoryitem.owner local flask = SpawnPrefab("wyrdflask") inst:Remove() if owner ~= nil and owner.components.inventory then -- CHECK IF THE OWNER ITEM IS VALID AND NOT A CONTAINER owner.components.inventory:GiveItem(flask) elseif owner ~= nil and owner.components.container then -- OR IF THE OWNER IS VALID AND IS A CONTAINER owner.components.container:GiveItem(flask) else inst.components.lootdropper:SpawnLootPrefab("wyrdflask") -- DROPS NORMAL FLASK AS BASIC LOOT IN THE CASE OF ABOVE end end ------------------------------------------------------ -- RETURNS ORIGINAL FLASK AFTER TIME REACHES 0 - END ------------------------------------------------------ ----------------------- -- HEATING CODE - START ----------------------- -- Heated Character emits constant temperatures depending on the temperature range it's in local heats = { 30, 40, 60 } local function GetHeatFn(receiver) return heats or 20 end local function turnOnHeating(receiver) receiver:AddTag("HASHEATER") receiver:AddComponent("heater") receiver.components.heater.heatfn = GetHeatFn receiver.components.heater:SetThermics(false, true) end local function turnOffHeating(receiver) receiver:RemoveTag("HASHEATER") receiver:RemoveComponent("heater") end ----------------------- -- HEATING CODE - END ----------------------- --------------------- -- START OF AURA CODE --------------------- local onEndAura = function(receiver, wyrdflask_heatingGUID, wyrdHeatingAura) -- Fail-safe. if not receiver or not receiver:IsValid() then return end -- If the receiver has the heating aura task, cancel it. if receiver[wyrdHeatingAura] then receiver[wyrdHeatingAura]:Cancel() receiver[wyrdHeatingAura] = nil end turnOffHeating(receiver) end local onApplyAura = function(receiver, wyrdflask_heating) -- "receiver" = Player -- "wyrdflask_heating" = Item applying the aura -- Fail-safe. if not receiver or not receiver:IsValid() then return end -- Use the created entitie's unique ID to create a unique name. local wyrdflask_heatingGUID = wyrdflask_heating.GUID --Create a single instance of the aura to prevent stacking from multiples of the same flask. local wyrdHeatingAura = "wyrdHeatingAuraID" -- If the receiver does not already have our heating aura on from this particular -- wyrdflask_heating, start the heating aura task, and store it in a variable on the receiver. if not receiver[wyrdHeatingAura] then -- TASK APPLIES HEATING EFFECT receiver[wyrdHeatingAura] = receiver:DoTaskInTime(heatingTick, function(receiver) turnOnHeating(receiver) end) end -- Ending the Aura after some time -- Create a unique variable-name to store the end-aura task on the receiver. local endwyrdHeatingAura = "wyrdHeatingEntireAura" -- If the receiver already has an end-aura task, then we need to cancel it, -- so we can restart it with a refreshed end-time. if receiver[endwyrdHeatingAura] then receiver[endwyrdHeatingAura]:Cancel() receiver[endwyrdHeatingAura] = nil end -- Use DoTaskInTime to schedule calling the function that ends the aura after a while without renewals. -- We store the task on the receiver using our unique variable-name. receiver[endwyrdHeatingAura] = receiver:DoTaskInTime(heatingAuraDuration, onEndAura, wyrdflask_heatingGUID, wyrdHeatingAura) end local applyAuraInRange = function(inst) -- Store the position of the aura-emitting entity in x, y, z variables. local x,y,z = inst.Transform:GetWorldPosition() -- Any player that is not a ghost or in limbo. -- AURA RADIUS = 1 - MAKES IT SO WYRD IS THE ONLY ONE WITH THE HEATING BUFF local ents = TheSim:FindEntities(x, y, z, 1, {"player"}, {"playerghost", "INLIMBO"}, nil) -- Apply the aura to any of the found entities within the radius, including the aura-emitting -- entity itself if it fits the tag-list parameters! for i, v in ipairs(ents) do onApplyAura(v, inst) end end ------------------- -- END OF AURA CODE ------------------- -- Write a local function that creats, customizes, and returns an instance of the prefab. local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("wyrdflask_heating") inst.AnimState:SetBuild("wyrdflask_heating") inst.AnimState:PlayAnimation("idle") MakeInventoryFloatable(inst, "small", 0.2) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end --inst:AddTag("undroppable") inst:AddComponent("lootdropper") inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem:SetOnPutInInventoryFn(OnPutInInventory) inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem:EnableMoisture(false) inst.components.inventoryitem.atlasname = "images/inventoryimages/wyrdflask_heating.xml" inst:AddComponent("fueled") inst.components.fueled:InitializeFuelLevel(heatingAuraDuration) inst.components.fueled:StartConsuming() inst.components.fueled:SetDepletedFn(OnFinished) MakeHauntableLaunch(inst) inst:DoTaskInTime(0, applyAuraInRange) -- APPLY THE AURA INSTANTLY return inst end -- Finally, return a new prefab with the construction function and assets. return Prefab( "wyrdflask_heating", fn, assets) client_log.txt wyrdflask_heating.lua wyrdflask_cooling.lua
- 1 reply
-
- custom item
- crash
-
(and 4 more)
Tagged with:
-
Hello to All! EDIT: I have been working on this since yesterday, and now the issue has changed slightly. Please excuse my edits. I have been working on making some custom items for a friend's character. All the functions he wanted have been completed and I am currently in the process of testing for crashing, balance, code cleanup/commenting and likewise. I've hit a snag though when it comes to the use of containers such as the backpack, chest, etc. The items I've made are supposed to be character exclusive and undroppable. The character spawns with their exclusive item and that same item is used for various recipes. Once the "fuel" runs out, it reverts back to the original item. My issue is, when this item is placed in a backpack/container and it's dropped in the world. When the fuel hits zero, the item disappears. It doesn't get added back into the container's inventory nor does it just "loot drop" into the world. It has to do with the function "OnFinished". This is called when the fuel hits zero, it gets removed, then immediately gives the player the original item. A pseudo "replace" function essentially. I couldn't find any "replace with" function to use. local function OnFinished(inst) local owner = inst.components.inventoryitem:GetGrandOwner() local flask = SpawnPrefab("wyrdflask") inst:Remove() if owner ~= nil then -- CHECK IF THE OWNER ITEM IS VALID IN THE EVENT THE FLASK SOMEHOW ENDS UP IN THE WORLD owner.components.inventory:GiveItem(flask) else inst.components.lootdropper:SpawnLootPrefab("wyrdflask") -- DROPS NORMAL FLASK AS BASIC LOOT IN THE CASE OF ABOVE end end Even though the item "undroppable", it isn't immune to container shenanigans such as putting it in a backpack. So if someone puts the crafted item into a backpack or container and it reaches zero, it's gone if that container is dropped anywhere in the world. I did put in a check to see if the owner is nil in the event the item somehow gets dropped into the world, but unfortunately, it sees the container as an owner. I speculated that perhaps the "world" aka nil would cause the item to just "loot drop" into the world, but it just makes it disappear completely. It probably sees the grandowner as Limbo or something, and I unfortunately don't know how to exactly check if "owner = limbo". It might be better to make it so it cannot go into a backpack/chest/etc in the first place, but I don't know how to go about that. If anyone could provide assistance, I would be extremely grateful. Thank You! P.S. If anyone could assist in making the items pickup exclusive by this character named "wyrd", that would also be grand. I've tried using this below at the very bottom of the item's function fn(sim), but when testing, any character I spawn as can pick it up. local oldOnPickup = inst.components.inventoryitem.OnPickup inst.components.inventoryitem.OnPickup = function(self, pickupguy) if pickupguy.prefab == "wyrd" then if not self.inst.itemowner then self.inst.itemowner = pickupguy end if pickupguy == self.inst.itemowner then oldOnPickup(self, pickupguy) elseif pickupguy.components.talker then pickupguy.components.talker:Say("That flask is cursed...") end elseif pickupguy.components.talker then pickupguy.components.talker:Say("Definately can't touch this...") end end wyrdflask_health.lua
-
Hello again, I tried to add a custom item, which can only be used and crafted by my custom character, but I don't get it... The item should be a throwing star/shuriken. It should do damage like a spear (maybe less, not sure about that) and the item should be stackable up to 15 times. After throwing and doing damage the item should disappear like a blow dart. The item should be craftable without a science machine or alchemie machine in an extra tab. Thank you for your help
- 12 replies
-
- custom item
- item
-
(and 1 more)
Tagged with:
-
Hey I trying to practice custom items but my custom item dont showing on hand. My item is called chocolate_weapon Crystal The Wolf Praktyka.rar
-
Hello~ I'm looking for how to make a custom tab and the tap appears near custom item like a maxwell's journal. also the tab only shows to custom character. I already made recipe, item prefab etc etc. but not the "tab" part. Hope you have a good day and happy all the time <3
-
- custom
- custom item
-
(and 1 more)
Tagged with:
-
[Help] Custom item sprite went wrong
Kronas posted a topic in [Don't Starve Together] Mods and Tools
so i dont understand how can we fix this issue ? i mean when you make a custom item there suppose to be away to make the handle somewhere right ? -
Hello to anyone who is reading that, so I don't even know where to start to be honest. I've looked trough prefabs and found amulet one, since I haven't looked in modding for years(and when I did it was basically change some values here and there), I have no idea how the file should look for like one custom amulet, the file has a few listed in there. Anyhow I was wondering if someone can help me with making custom amulet, the one that will lower sanity drain from dusk and night, I'll attach the original file I found. The other question I have is where exactly and how exactly do I get sprites of amulet(s) from the base game, so I can resprite over them and then pack it back together. Thanks for help beforehand. TL;DR How to make lua file for just a singe amulet and how to make proper anim set for it Dunno if what I've said is understandable but ask questions right away I'll do my best to answer, also sorry for my grammar, English is not my native language amulet.lua
- 5 replies
-
- coding help
- artwork help
-
(and 1 more)
Tagged with:
-
I have been attempting to use this tutorial by Dana Adams but its nearly 5 years old and very difficult to follow if you are using more updated tutorials for character making like this one by dleowolf. Does anyone know of a more straight forward or updated tutorial?
- 10 replies
-
Well hello i'm tryin to make a custom weapon but i need little help with a code it's little comlicated and i'm not sure that i can explain it. Well the first thing i want to do is a changeable weapon i mean it's start with something like a rod and it has no abilies it can't do anything it has no damage just a rod and when the character lvl up (i have code fot this) the rod can change shape (i mean texture,i have textures for all of them) and it become tools ( actually you can switch on or off with hotkeys) it can be axe, pickaxe, shovel, hammer, pitch fork (hotkeys: ctrl+1 for axe, ctrl+2 for pickaxe, ctrl+3 for shovel, ctrl+4 for hammer, ctrl+5 for pitch fork) I don't know how it seems to you but i think it's compicated. Thanks for helping
-
Hey, everyone! I'm looking to get some assistance coding some stuff. I apologize, as the list is quite long. Is it possible to make it so a character starts losing health from Sanity drain after Sanity reaches 0? Is it possible to make it so a character's Wetness goes up when attacked by specific enemies; in this case, Shadow Creatures? Is it possible to make a weapon use the Blow Dart's attack animation instead of the standard one, or do I need to create a new animation in Spriter if I want something other than the default? Is it possible to make a weapon reward sanity on killing specific enemies; in this case, Shadow Creatures? Is it possible to make a weapon be able to "reload" its finite uses, like being fueled, only with drain being on use instead of constant while equipped? And can I make it fueled only by one specific item; in this case, Papyrus? I'm happy to be getting more experienced at coding, but more complicated stuff like this still eludes me, so thank yous are very much in order to anyone that can help with even one of the above.
-
- character perks
- mod
-
(and 1 more)
Tagged with:
-
I'm making a a pair of self character for DST and in their unique traits I'd like them to have custom items. I don't know where to start looking for code to rip or how to make my own, so any help is appreciated Item #1 - Music Box 1 gold nugget, 1 cut stone, 2 silk Equipable, nonflamable, durability of 600 seconds, +10 sanity/min while equipped. Craftable and useable only by Character A Item #2 - Lighter It's functionally identical to Willow's lighter but it needs to be specific to Character A Item #3 - Drawings 1 papyrus, 10 petals, 1 black feather Non-equipable, flamable. Upon creation restores 50 sanity, no real use after that other than fire fuel. Craftable only by Character B So yeah if anyone can help it would be greatly appreciated
- 1 reply
-
- help
- custom item
-
(and 1 more)
Tagged with:
-
Hello, I've been working on a Shadow Wilson mod for a few days and everything seems to be in order, except for the custom axe I'm trying to make. I made a recipe for it and placed the recipe in the game, but the image for the axe won't show up in game and when you try to create the item it just takes your ingredients and the log notes that it can't find the prefab for the item. The game boots up just fine and the long configuration text from the mod tools at boot-up doesn't show any errors. I've included a .zip for the mod but if you need individual files instead let me know. Help would really be appreciated! shadowwilson dst.zip
- 2 replies
-
- axe
- custom item
-
(and 1 more)
Tagged with:
-
Version Numuro Nope
827 downloads
My very first mod. I had been working on this for a month or 2 now. Playing around with this character will let you see how **** my personality can be. And yes, I did the fohkin' ****e art for this mod. A very nice and exquisite quote: "Punk-a-loid..." Stats: Health: 180 Hunger: 150 (Hunger Rate: 1.3) Sanity: 200 Compatible w/: Vanilla/Reign of Giants/Shipwrecked Pros'n cons: *Able to sketch on papyrus to regain sanity *Can withstand winter, but despises summer *Not easily scared, though has nyctophobia (Nyctophobia = terrified of the dark) (Hits hard and has quite the endurance) (Slightly slower than other characters) (Starts off with a pencil and 10 papyrus to show the function of the pencil) (Is a feline, meaning he's related to catcoons and tigersharks) Custom voice: Alto Saxophone Please like, follow and comment on this if you will! Much will be appreciated! :3 If there is any text that's Wilson's text or if he says "It's a... thing.", do tell me, I'd be more then happy to change it c: P.S. Special thanks to Deeyadee for shading my 'bigportraits' file and Dragon Wolf Leo for programming my pencil! Please, go 'watch' Deeyadee in DeviantArt and download Leo's mods! You won't regret it! Links here, please check'em out as a favour for me, yes? : (up for ART commissions, with pay tho) Deeyadee: http://deeyadee.deviantart.com/ https://www.facebook.com/fartfac3 (up for MOD commissions, also with pay) Dragon Wolf Leo: http://steamcommunity.com/id/dleowolf/myworkshopfiles/?appid=322330 http://dleowolf.deviantart.com/journal/Don-t-Starve-Commission-Info-and-Status-575424017 Also, please download my other mods if you like this one, please and thank you! :3 http://forums.kleientertainment.com/profile/806566-g/?do=content&type=downloads_file&change_section=1- 52 comments
-
- 7
-
-
- reign of giants
- shipwrecked
-
(and 5 more)
Tagged with:
-
Ok so, I made a character with custom items, however, once I tested it through a server, I realized that people becomes unable to connect or gets into a never ending loading screen. HOWEVER this started once I added the inst.entity:AddNetwork()and if not TheWorld.ismastersim then return inst end inst.entity:SetPristine()of course before the first line there the items would never appear, so, that explains why the connection problem was not happening, but still. Does anyone has any idea of what is happening? and anyone could give a hand?
- 6 replies
-
- Dont starve together
- custom item
-
(and 5 more)
Tagged with:
-
Ok, I created a custom item for a character mod that works. All I have to do is add the item's "characteristics" in it's prefab folder. I want this item to give my player the ability to teleport just like the teleportation wand. I tried digging for the Orange staff's prefab file but I don't know how to piece it together. Can you send me a coding text that I can simply copy and paste into my item's prefab file? Thanks a bunch
- 3 replies
-
- Dont Starve Together
- Reign of Giants
- (and 8 more)
-
Introducing Wakkari, the Red Fox for DST http://forums.kleientertainment.com/files/file/1085-wakkari-the-red-fox-dst/ In next update: filling 50% of speech file (will be finished then) maybe adding new function to Bell Staff Hope you won't get any trouble with it, but if so - feel free to type it here