Search the Community

Showing results for tags 'custom item'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hot Lava
    • [Hot Lava] - General Discussion
    • [Hot Lava] - Suggestions and Feedback
    • [Hot Lava] - Bug Tracker
    • [Hot Lava] - Strats and Records
    • [Hot Lava] - Developer Log
    • Hot Lava Latest Update
  • Griftlands
    • [Griftlands Alpha] - General Discussion
    • [Griftlands Alpha] - Suggestions and Feedback
    • [Griftlands Alpha] - Bug Tracker
    • [Griftlands Alpha] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Return of Them
    • [Don't Starve Together] PS4
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [DS + DST] Art, Music and Lore
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • The Off-Topic Area
    • Other Klei Services

Categories

  • Don't Starve
    • Custom Character and Skins
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included
  • Griftlands - [Alpha]
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] PS4
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included
  • Griftlands - [Alpha]
  • Hot Lava
  • Don't Starve Together
  • [PS4] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Categories

  • Hot Lava - Bug Reports


Biography


Location


Interests


Occupation


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

Found 3 results

  1. 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
  2. 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
  3. Version Numuro Nope

    812 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