Search the Community

Showing results for tags 'code'.



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 Early Access] - General Discussion
    • [Griftlands Early Access] - Suggestions and Feedback
    • [Griftlands Early Access] - Mods and Tools
    • [Griftlands Early Access] - Localization
    • [Griftlands Early Access] - Bug Tracker
    • [Griftlands Early Access] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included: Spaced Out!] - Bug Tracker
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
    • Oxygen Not Included DLC Alpha
  • 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
  • Klei Entertainment Games
  • Other Stuff

Categories

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

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out! (Alpha)
  • Griftlands - [Early Access]
  • 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
  • Oxygen Not Included: Spaced Out! (Alpha)
  • Griftlands - [Early Access]
  • 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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End



Biography


Location


Interests


Occupation


Favorite Game


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

Found 32 results

  1. Hi, here I am posting links to free points and spools. Like this: https://accounts.klei.com/link/gimmepointsplz - free 850 points. https://accounts.klei.com/link/pinetreepioneers - free 450 spools. https://accounts.klei.com/link/gimmesomespool - free 450 spools.
  2. Howdy. I need your help with projectile that is facing the wrong direction. It's artillery shell and I need its tip to be directed to the target. I have tried using local function OnThrown(inst) inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround) inst.AnimState:PlayAnimation("idle") end but it does not work. I have also looked into boomerang and blowdart and didn't find any clue. If someone approached the same problem in the past I will be grateful for your help.
  3. Hi! I'm trying to make a mod that reduces the quantity of slots on a backpack, however I'm unable to accomplish it. I would appreciate some help in how to reduce the quantity of slots, the backpack interface changes, but it continues with the same quantity of slots. My modmain will go attached here. I would appreciate any help! modmain.lua
  4. Hello again. sorry for all the questions..! this time Its not Giggabyte I need help with. I'm making a character for my friend, and she wants her character to have a small sanity boost when killing things. not just monsters but even passive creatures like bunnies and birds. I have googled solutions and came across: https://forums.kleientertainment.com/forums/topic/51989-gain-sanity-during-day-and-gain-sanity-on-kill/ https://forums.kleientertainment.com/forums/topic/67456-gain-sanity-from-killing-monsters-lose-sanity-from-attacking-people/ https://forums.kleientertainment.com/forums/topic/57033-character-gain-sanity-upon-kill-not-working/ though none of these worked. I have also copied the code directly from Wathgrithr's(?) .lua but Im not really sure exactly what bits did what I was wanting and/or what i didnt need to copy and I got lost. I thought about copying the code: inst:ListenForEvent("onattackother", function(inst, data) if data.target.prefab == "spider" then inst.components.sanity:DoDelta(TUNING.SANITY_TINY) end end) (from the third link) and just copying this for every creature in the game but that would take forever and would probably cause problems. Ive tried putting code in the masters_postinit spot, above that, under the line "local prefabs = FlattenTree(start_inv, true)" but nothing Im doing is working. I really just need to know what code I need and where I put it. any help is greatly appreciated! thank you in advance!!
  5. So, I'm trying to make my character afraid of Pickaxes. Being that he himself is made of rock. I've found a thread that point's me in the right direction. But I'm wondering how do I check other player's inventories for Them holding a pick, and how do I check the ground for random dropped pickaxes, either from corpses or people not using chests. Thanks in advance
  6. So, we're trying to make a tool for the player to use, that, when it hits 0% durability, instead of breaking, will go in the player inventory and stay there, unusable until it gets repaired. I'm aware that we'd need to add a repair action, but we're struggling to actually work out how to make this happen. I did find an old thread with some code from w00tydood, but it didn't actually work. Could use a hand here on figuring out how to make this work.
  7. Well i cut it short. There is a few abilities that i want to add my sword but i don't know how to make a code for them here is abilities Restores health %5 of damage and has a little long range. Thanks for help.
  8. Well i'm searching for some codes for custom weapon and i'll cut it short. I need a code for dash like ruby but i try to use rubys code but it is not works. And also i need code for area damage. Thanks for help.
  9. Im new to modding and i went a little bit too ambitious with my first mod and now im having troubles fixing bugs. most of them only happen on the client side, and works fine on the host's side. I have been working on a backpack that has a level system, the stats are working properly, however i wanted the item's name to be updated too when it is upgraded. The updated name only shows on the host's screen and the client just sees the default name. Another problem im having is that I wanted it to be upgraded when a specific item is inserted into the inventory and the bag is then closed for the upgrade to trigger. (the item is consumed). This works as intended on the host, but the client must drop the backpack for this to happen. Im thinking maybe there is a different event it can listen to to trigger the checking and upgrading functions? local function CheckForUpgrade(inst) local container = inst.components.container for i = 1, container:GetNumSlots() do local item = container:GetItemInSlot(i) or nil if item ~= nil and item.prefab == "screw" and inst.level < 5 then inst.level = inst.level+1 container:RemoveItemBySlot(i) applyupgrades(inst) end end end function applyupgrades(inst) inst.name = "Daihatsu +"..inst.level inst.components.equippable.walkspeedmult = 0.8+ inst.level * 0.02 + inst.penalty inst.components.armor.absorb_percent = 0.3 + inst.level * 0.04 end These are the functions im using to do the job, CheckForUpgrade triggered by ListenForEvent("onclose") Any help is appreciated, thanks.
  10. [00:02:48]: [string "scripts/components/inventory.lua"]:637: attempt to index local 'inst' (a nil value) LUA ERROR stack traceback: scripts/components/inventory.lua:637 in (method) GiveItem (Lua) <636-769> scripts/prefabs/player_common.lua:1941 in (method) OnNewSpawn (Lua) <1937-1949> scripts/networking.lua:250 in () ? (Lua) <238-256> =[C]:-1 in (method) SendSpawnRequestToServer (C) <-1--1> scripts/mainfunctions.lua:1289 in (local) cb (Lua) <1287-1290> scripts/frontend.lua:541 in (method) DoFadingUpdate (Lua) <505-545> scripts/frontend.lua:593 in (method) Update (Lua) <553-710> scripts/update.lua:92 in () ? (Lua) <33-129> well here is crash log and here is my swords code i believe it's causes error local assets = { --sword + -- Asset("ANIM", "anim/fuingetsu.zip"), -- Asset("ANIM", "anim/swap_fuingetsu.zip"), -- Asset("ATLAS", "images/inventoryimages/fuingetsu.xml"), -- Asset("IMAGE", "images/inventoryimages/fuingetsu.tex"), -------------------------------------------------------------------------- --hammer + -- Asset("ANIM", "anim/hakai.zip"), -- Asset("ANIM", "anim/swap_hakai.zip"), --Asset("ATLAS", "images/inventoryimages/hakai.xml"), -- Asset("IMAGE", "images/inventoryimages/hakai.tex"), --------------------------------------------------------------------------- --icicle + -- Asset("ANIM", "anim/kinshara.zip"), -- Asset("ANIM", "anim/swap_kinshara.zip"), -- Asset("ATLAS", "images/inventoryimages/kinshara.xml"), -- Asset("IMAGE", "images/inventoryimages/kinshara.tex"), --------------------------------------------------------------------------- --pen --Asset("ANIM", "anim/tsuitou.zip"), -- Asset("ANIM", "anim/swap_tsuitou.zip"), -- Asset("ATLAS", "images/inventoryimages/tsuitou.xml"), -- Asset("IMAGE", "images/inventoryimages/tsuitou.tex"), -------------------------------------------------------------------------- --bow + -- Asset("ANIM", "anim/shinsou.zip"), -- Asset("ANIM", "anim/swap_shinsou.zip"), -- Asset("ATLAS", "images/inventoryimages/shinsou.xml"), -- Asset("IMAGE", "images/inventoryimages/shinsou.tex"), --------------------------------------------------------------------------- --light staff -- Asset("ANIM", "anim/raika.zip"), -- Asset("ANIM", "anim/swap_raika.zip"), -- Asset("ATLAS", "images/inventoryimages/raika.xml"), -- Asset("IMAGE", "images/inventoryimages/raika.tex"), --------------------------------------------------------------------------- --axe + -- Asset("ANIM", "anim/tobiume.zip"), -- Asset("ANIM", "anim/swap_tubiume.zip"), -- Asset("ATLAS", "images/inventoryimages/tobiume.xml"), -- Asset("IMAGE", "images/inventoryimages/tobiume.tex"), -------------------------------------------------------------------------- --scythe + -- Asset("ANIM", "anim/shirayuki.zip"), -- Asset("ANIM", "anim/swap_shirayuki.zip"), -- Asset("ATLAS", "images/inventoryimages/shirayuki.xml"), -- Asset("IMAGE", "images/inventoryimages/shirayuki.tex"), --------------------------------------------------------------------------- --spear + -- Asset("ANIM", "anim/shiden.zip"), -- Asset("ANIM", "anim/swap_shiden.zip"), -- Asset("ATLAS", "images/inventoryimages/shiden.xml"), -- Asset("IMAGE", "images/inventoryimages/shiden.tex"), --------------------------------------------------------------------------- } local prefabs = { } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_kinshara", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function onattack_kinshara(inst, attacker, target) player.components.talker:Say("Wingardium Levi... What do you expect me to do with that? Nya~") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst:AddComponent("talker") inst.AnimState:SetBank("kinshara") inst.AnimState:SetBuild("kinshara") inst.AnimState:PlayAnimation("idle") inst.components.weapon:SetOnAttack(onattack_kinshara) inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "kinshara" inst.components.inventoryitem.atlasname = "images/inventoryimages/kinshara.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true if owner HasTag("swarduser") then --item turning to sword local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_fuingetsu", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("fuingetsu") inst.AnimState:SetBuild("fuingetsu") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("sharp") inst:AddTag("fuingetsu") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("weapon") inst.components.weapon:SetDamage(40) inst.components.weapon.attackrange = 1.1 inst.components.weapon.hitrange = 1.1 inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "fuingetsu" inst.components.inventoryitem.atlasname = "images/inventoryimages/fuingetsu.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end if owner HasTag("hammeruser") then --item turning to hammer local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_hakai", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("hakai") inst.AnimState:SetBuild("hakai") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("hakai") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("tool") inst.components.tool:SetAction(ACTIONS.HAMMER, 1) inst.components.weapon.attackrange = 1.1 inst.components.weapon.hitrange = 1.1 inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "hakai" inst.components.inventoryitem.atlasname = "images/inventoryimages/hakai.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end if owner HasTag("bowuser") then --item turning to bow local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_shinsou", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function onattack_shinsou(inst, attacker, target) if attacker and attacker.components.sanity then attacker.components.sanity:DoDelta(-5) elseif attacker and attacker.components.sanity < 10 then player.components.talker:Say("I... can't... aim... did i say it right? Nya~") end end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.components.weapon:SetOnAttack(onattack_shinsou) inst.AnimState:SetBank("shinsou") inst.AnimState:SetBuild("shinsou") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("shinsou") inst.AddTag("bow") inst:AddComponent("weapon") inst:AddComponent("talker") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst.components.weapon:SetDamage(15) inst.components.weapon:SetRange(8, 10) inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "shinsou" inst.components.inventoryitem.atlasname = "images/inventoryimages/shinsou.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end if owner HasTag("axeuser") then --item turning to axe local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_tobiume", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("tobiume") inst.AnimState:SetBuild("tobiume") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("tobiume") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("tool") inst.components.tool:SetAction(ACTIONS.CHOP, 1) inst.components.weapon.attackrange = 1.1 inst.components.weapon.hitrange = 1.1 inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "tobiume" inst.components.inventoryitem.atlasname = "images/inventoryimages/tobiume.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end if owner HasTag("scytheuser") then --item turning to scythe local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_shirayuki", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("shirayuki") inst.AnimState:SetBuild("shirayuki") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("sharp") inst:AddTag("shirayuki") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("weapon") inst.components.weapon:SetDamage(20) inst.components.weapon.rosing = true inst.components.weapon.attackrange = 1.1 inst.components.weapon.hitrange = 1.1 inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "shirayuki" inst.components.inventoryitem.atlasname = "images/inventoryimages/shirayuki.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end if owner HasTag("spearuser") then --item turning to spear local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_shiden", "symbol0") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("shiden") inst.AnimState:SetBuild("shiden") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() inst:AddTag("shiden") if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("weapon") inst.components.weapon:SetDamage(40) inst.components.weapon.attackrange = 1.1 inst.components.weapon.hitrange = 1.1 inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "shiden" inst.components.inventoryitem.atlasname = "images/inventoryimages/shiden.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) inst.components.inventoryitem.keepondeath = true end end return inst end return Prefab( "common/inventory/weapon", fn, assets) and here is my character's lua local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), } local prefabs = { "book_birds", "book_tentacles", "book_gardening", "book_sleep", "book_brimstone", "shadow_despawn", "statue_transition_2", } -- Custom starting items local start_inv = { "kinshara", } -- When the character is revived from human, well works local function onbecamehuman(inst) -- Set speed when reviving from ghost (optional) inst.components.locomotor.walkspeed = 4.6 inst.components.locomotor.runspeed = 7 inst.components.combat:SetAttackPeriod (0.6) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor.walkspeed = 8.0 end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst.components.locomotor.walkspeed = 4.6 inst.components.locomotor.runspeed = 7 inst.components.combat:SetAttackPeriod (0.6 ) if not inst:HasTag("playerghost") then onbecameghost(inst) end end --Critters sanity aura local function critter_SanityAura(inst) local x, y, z = inst.Transform:GetWorldPosition() local delta = 0 local ents = TheSim:FindEntities(x, y, z, 20, {"critter_puppy", "player" , "critter_kitten"}) local bonus_sanity = nil local distsq = nil local totalDelta = nil for k, v in pairs(ents) do if v ~= inst then if v.prefab == "critter_puppy" then bonus_sanity = -TUNING.SANITYAURA_MEDIUM distsq = math.max(inst:GetDistanceSqToInst(v), 1) delta = delta + bonus_sanity / distsq elseif v.prefab == "critter_kitten" then bonus_sanity = TUNING.SANITYAURA_SMALL distsq = math.max(inst:GetDistanceSqToInst(v), 1) delta = delta + bonus_sanity / distsq elseif v:HasTag ("player") then bonus_sanity = -TUNING.SANITYAURA_SMALL distsq = math.max(inst:GetDistanceSqToInst(v), 1) delta = delta + bonus_sanity / distsq else end end totalDelta = totalDelta + delta end if #ents > 0 then totalDelta = totalDelta / #ents else totalDelta = 0 end return totalDelta end --For can not wear anything --local function OnEquip(inst) --Get the equipped item -- local hat = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) -- local body = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.BODY) -- local hand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HAND) --If it doesn't have your unique tag drop it --if not hat:HasTag("youruniquetagname") then -- inst.components.inventory:DropItem(hat) -- end -- if not body:HasTag("youruniquetagname") then -- inst.components.inventory:DropItem(body) --end -- if not hand:HasTag("fuingetsu") then -- inst.components.inventory:DropItem(hand) -- end --end --Can't pick up chester local function OnPickup(inst) if data.prefab == "chester_eyebone" then local eyebone = data.prefab inst.components.sanity:DoDelta(-30) inst.components.inventory:DropItem(eyebone) end end --Counter freeze attack local function OnBeingAttacked(inst, data) local damage = data and data.damage if damage then local last_time_first_hit = inst.last_time_first_hit local current_time = GetTime() -- If the hit is the first, or more than 60 seconds passed, reset the damage received and the last hit time -- Else, add it up if (last_time_first_hit == nil) or (current_time - last_time_first_hit > 59.5) then inst.total_damage_received = damage inst.last_time_first_hit = current_time else inst.total_damage_received = inst.total_damage_received + damage end -- We pass 50 damage, freeze everything, then reset damage and timer if inst.total_damage_received > 49.5 then if inst.level < 40 then inst.components.talker:Say("My skills are sealed for now. Nya~") end local x, y, z = inst.Transform:GetWorldPosition() -- First table, table with "must have" tags, entities with freezable component have freezable tag -- Second table, table with "cant have" tags, player has player tag inst.components.talker:Say("It hurts! Nya~") local ents = TheSim:FindEntities(x, y, z, 20, {"freezable"}, {"player"}) for i, v in ipairs(ents) do v.components.freezable:AddColdness(10) v.components.freezable:SpawnShatterFX() end inst.total_damage_received = 0 inst.last_time_hit = nil end end end --Stat chance on moons local function PowerUpAtNewMoon(inst) if TheWorld.state.isnight then if TheWorld.state.moonphase == "new" then inst.components.combat:SetAttackPeriod (0.4) inst.components.locomotor.walkspeed = 6 inst.components.locomotor.runspeed = 10 inst.Light:Enable(true) inst.Light:SetRadius(18) inst.Light:SetFalloff(0.75) inst.Light:SetIntensity(.7) inst.Light:SetColour(70/255,230/255,12/170) inst.components.talker:Say("The curse has gone We are finally free! Nya~") elseif TheWorld.state.moonphase == "full" then inst.components.combat:SetAttackPeriod (0.8) inst.components.locomotor.walkspeed = 3.2 inst.components.locomotor.runspeed = 4 inst.components.talker:Say("I can feel the curse of moon. The moon binds us! Nya~") end elseif TheWorld.state.isdusk then if TheWorld.state.moonphase == "new" then inst.components.combat:SetAttackPeriod (0.4) inst.components.locomotor.walkspeed = 6 inst.components.locomotor.runspeed = 10 inst.components.talker:Say("I can't feel the moon. Finally i can be free. Nya~") elseif TheWorld.state.moonphase == "full" then inst.components.combat:SetAttackPeriod (0.8) inst.components.locomotor.walkspeed = 3.2 inst.components.locomotor.runspeed = 4 inst.components.talker:Say("Oh! I can feel the moon. This night will be cursed. Nya~") end elseif TheWorld.state.isday then inst.components.locomotor.walkspeed = 4.6 inst.components.locomotor.runspeed = 7 inst.components.combat:SetAttackPeriod (0.6) end end --Restat for foods local function oneat(inst, food) if food and food.components.edible and food.prefab == "fishsticks" then inst.components.health:DoDelta(50) inst.components.sanity:DoDelta(50) inst.components.hunger:DoDelta(50) inst.components.talker:Say("Itadakimasu. Nya~", 1.2, true) elseif food and food.components.edible and food.prefab == "fishtacos" then inst.components.health:DoDelta(50) inst.components.sanity:DoDelta(50) inst.components.hunger:DoDelta(50) inst.components.talker:Say("Itadakimasu. Nya~", 1.2, true) elseif food and food.components.edible and food.prefab == "fish" then inst.components.health:DoDelta(20) inst.components.sanity:DoDelta(30) inst.components.hunger:DoDelta(20) inst.components.talker:Say("Itadakimasu. Nya~", 1.2, true) elseif food and food.components.edible and food.prefab == "fish_cooked" then inst.components.sanity:DoDelta(-15) inst.components.talker:Say("Don't you know the fire is not good for me! Do not try to eat that me again!!!. Nya~", 1.2, true) elseif food and food.components.edible and food.prefab == "ice" then inst.components.health:DoDelta(5) inst.components.sanity:DoDelta(10) inst.components.talker:Say("Itadakimasu. Nya~", 1.2, true) elseif food and food.components.edible and food.prefab == not "ice" or "fish_cooked" or "fish" or "fishtacos" or "fishsticks" then local hungerboost = 5 local sanityboost = -5 local foodcheck = food.prefab == "spoiled_food" and 0 or hungerboost inst.components.health:DoDelta(0) inst.components.sanity:DoDelta(-5) inst.components.hunger:DoDelta(5) inst.components.talker:Say("I shouldn't eat that. Nya~") end end --Level system local function levelexp(inst, data) local max_exp = 999999999994650 local min_exp = -99999999999999 local level = math.min(inst.level, max_exp) local health_percent = inst.components.health:GetPercent() local sanity_percent = inst.components.sanity:GetPercent() local hunger_percent = inst.components.hunger:GetPercent() if inst.level <=999999999994650 then inst.components.talker:Say("[EXP] \n".. (inst.level)) end --level 0 (start) if inst.level >0 and inst.level <=10 then inst.components.health.maxhealth = math.ceil (50) inst.components.hunger.max = math.ceil (50) inst.components.sanity.max = math.ceil (50) --level 1 elseif inst.level >10 and inst.level <=20 then inst.components.health.maxhealth = math.ceil (55) inst.components.hunger.max = math.ceil (55) inst.components.sanity.max = math.ceil (55) --level 2 elseif inst.level >20 and inst.level <=40 then inst.components.health.maxhealth = math.ceil (60) inst.components.hunger.max = math.ceil (60) inst.components.sanity.max = math.ceil (60) elseif inst.level > 20 then inst.AddTag("fridge") --level 3 elseif inst.level >40 and inst.level <=70 then inst.components.health.maxhealth = math.ceil (65) inst.components.hunger.max = math.ceil (65) inst.components.sanity.max = math.ceil (65) --level 4 elseif inst.level >70 and inst.level <=110 then inst.components.health.maxhealth = math.ceil (70) inst.components.hunger.max = math.ceil (70) inst.components.sanity.max = math.ceil (70) --level 5 elseif inst.level >110 and inst.level <=160 then inst.components.health.maxhealth = math.ceil (75) inst.components.hunger.max = math.ceil (75) inst.components.sanity.max = math.ceil (75) --level 6 elseif inst.level >160 and inst.level <=220 then inst.components.health.maxhealth = math.ceil (80) inst.components.hunger.max = math.ceil (80) inst.components.sanity.max = math.ceil (80) --level 7 elseif inst.level >220 and inst.level <=290 then inst.components.health.maxhealth = math.ceil (85) inst.components.hunger.max = math.ceil (85) inst.components.sanity.max = math.ceil (85) --level 8 elseif inst.level >290 and inst.level <=370 then inst.components.health.maxhealth = math.ceil (90) inst.components.hunger.max = math.ceil (90) inst.components.sanity.max = math.ceil (90) --level 9 elseif inst.level >370 and inst.level <=460 then inst.components.health.maxhealth = math.ceil (95) inst.components.hunger.max = math.ceil (95) inst.components.sanity.max = math.ceil (95) --level 10 elseif inst.level >460 and inst.level <=560 then inst.components.health.maxhealth = math.ceil (100) inst.components.hunger.max = math.ceil (100) inst.components.sanity.max = math.ceil (100) --level 11 elseif inst.level >560 and inst.level <=670 then inst.components.health.maxhealth = math.ceil (110) inst.components.hunger.max = math.ceil (110) inst.components.sanity.max = math.ceil (110) --level 12 elseif inst.level >670 and inst.level <=790 then inst.components.health.maxhealth = math.ceil (120) inst.components.hunger.max = math.ceil (120) inst.components.sanity.max = math.ceil (120) --level 13 elseif inst.level >790 and inst.level <=920 then inst.components.health.maxhealth = math.ceil (130) inst.components.hunger.max = math.ceil (130) inst.components.sanity.max = math.ceil (130) --level 14 elseif inst.level >920 and inst.level <=1060 then inst.components.health.maxhealth = math.ceil (140) inst.components.hunger.max = math.ceil (140) inst.components.sanity.max = math.ceil (140) --level 15 elseif inst.level >1060 and inst.level <=1210 then inst.components.health.maxhealth = math.ceil (150) inst.components.hunger.max = math.ceil (150) inst.components.sanity.max = math.ceil (150) --level 16 elseif inst.level >1210 and inst.level <=1370 then inst.components.health.maxhealth = math.ceil (160) inst.components.hunger.max = math.ceil (150) inst.components.sanity.max = math.ceil (160) --level 17 elseif inst.level >1370 and inst.level <=1540 then inst.components.health.maxhealth = math.ceil (170) inst.components.hunger.max = math.ceil (170) inst.components.sanity.max = math.ceil (170) --level 18 elseif inst.level >1540 and inst.level <=1720 then inst.components.health.maxhealth = math.ceil (180) inst.components.hunger.max = math.ceil (180) inst.components.sanity.max = math.ceil (180) --level 19 elseif inst.level >1720 and inst.level <1910 then inst.components.health.maxhealth = math.ceil (190) inst.components.hunger.max = math.ceil (190) inst.components.sanity.max = math.ceil (190) --level 20 elseif inst.level >1910 and inst.level <=2110 then inst.components.health.maxhealth = math.ceil (200) inst.components.hunger.max = math.ceil (200) inst.components.sanity.max = math.ceil (200) --level 21 elseif inst.level >2110 and inst.level <=2320 then inst.components.health.maxhealth = math.ceil (210) inst.components.hunger.max = math.ceil (210) inst.components.sanity.max = math.ceil (210) --level 22 elseif inst.level >2320 and inst.level <=2540 then inst.components.health.maxhealth = math.ceil (220) inst.components.hunger.max = math.ceil (220) inst.components.sanity.max = math.ceil (220) --level 23 elseif inst.level >2540 and inst.level <=2770 then inst.components.health.maxhealth = math.ceil (230) inst.components.hunger.max = math.ceil (230) inst.components.sanity.max = math.ceil (230) --level 24 elseif inst.level >2770 and inst.level <=3010 then inst.components.health.maxhealth = math.ceil (240) inst.components.hunger.max = math.ceil (240) inst.components.sanity.max = math.ceil (240) --level 25 elseif inst.level >3010 and inst.level <=3260 then inst.components.health.maxhealth = math.ceil (250) inst.components.hunger.max = math.ceil (250) inst.components.sanity.max = math.ceil (250) --level 26 elseif inst.level >3260 and inst.level <=3520 then inst.components.health.maxhealth = math.ceil (260) inst.components.hunger.max = math.ceil (260) inst.components.sanity.max = math.ceil (260) --level 27 elseif inst.level >3520 and inst.level <=3790 then inst.components.health.maxhealth = math.ceil (270) inst.components.hunger.max = math.ceil (270) inst.components.sanity.max = math.ceil (270) --level 28 elseif inst.level >3790 and inst.level <=4070 then inst.components.health.maxhealth = math.ceil (280) inst.components.hunger.max = math.ceil (280) inst.components.sanity.max = math.ceil (280) --level 29 elseif inst.level >4070 and inst.level <=4360 then inst.components.health.maxhealth = math.ceil (290) inst.components.hunger.max = math.ceil (290) inst.components.sanity.max = math.ceil (290) --level 30 elseif inst.level >4360 and inst.level <=4660 then inst.components.health.maxhealth = math.ceil (300) inst.components.hunger.max = math.ceil (300) inst.components.sanity.max = math.ceil (300) end inst.components.health:SetPercent(health_percent) inst.components.hunger:SetPercent(hunger_percent) inst.components.sanity:SetPercent(sanity_percent) end --Exp for kill local function onkill(inst, data) local victim = data.victim if ( victim:HasTag("catcoon") ) then inst.level = inst.level -969696 inst.components.talker:Say("There is nothing to say...") end if ( victim:HasTag("chester") or victim:HasTag("glommer") or victim:HasTag("hutch") or victim:HasTag("lavae_pet") ) then inst.level = inst.level - 50 inst.components.talker:Say("Oh come on! Why i did that? I'm cursed now. Nya~") end if ( victim:HasTag("smallbird") or victim:HasTag("babybeefalo") or victim:HasTag("toddlerbeefalo") ) then inst.level = inst.level - 10 inst.components.talker:Say("I feel bad about that. It was so cute. Nya~") end if ( victim:HasTag("pigman") or victim:HasTag("bunnyman") or victim:HasTag("rocky") ) then inst.level = inst.level - 5 inst.components.talker:Say("Should i do that? I mean it feels bad. Nya~") end if ( victim:HasTag("butterfly") or victim:HasTag("crow") or victim:HasTag("robin") or victim:HasTag("robin_winter") or victim:HasTag("canary") or victim:HasTag("rabbit") or victim:HasTag("mole") or victim:HasTag("grassgekko") or victim:HasTag("mandrake") ) then inst.level = inst.level + 1 levelexp(inst) end if ( victim:HasTag("eyeplant") or victim:HasTag("bee") or victim:HasTag("spider") or victim:HasTag("frog") or victim:HasTag("batilisk") or victim:HasTag("mosquito") or victim:HasTag("deer") or victim:HasTag("deerantler") or victim:HasTag("perd") or victim:HasTag("monkey") or victim:HasTag("buzzard") or victim:HasTag("snurtle") ) then inst.level = inst.level + 2 levelexp(inst) end if ( victim:HasTag("birchnutdrake") or victim:HasTag("killerbee") or victim:HasTag("tentacle") or victim:HasTag("tentacle_pillar") or victim:HasTag("spider_warrior") or victim:HasTag("teenbird") or victim:HasTag("little_walrus") or victim:HasTag("teenbeefalo") or victim:HasTag("penguin") or victim:HasTag("lightninggoat") or victim:HasTag("slurtle") ) then inst.level = inst.level + 3 levelexp(inst) end if ( victim:HasTag("tallbird") or victim:HasTag("spider_spitter") or victim:HasTag("merm") or victim:HasTag("spider_hider") or victim:HasTag("spider_dropper") or victim:HasTag("pigguard") or victim:HasTag("koalefant_summer") or victim:HasTag("koalefant_winter") or victim:HasTag("beefalo") or victim:HasTag("walrus") ) then inst.level = inst.level + 5 levelexp(inst) end if ( victim:HasTag("hound") or victim:HasTag("firehound") or victim:HasTag("icehound") or victim:HasTag("knight") or victim:HasTag("rook") or victim:HasTag("bishop") or victim:HasTag("deer_red") or victim:HasTag("deer_blue") or victim:HasTag("lavae") or victim:HasTag("worm") or victim:HasTag("mossling") or victim:HasTag("beeguard") ) then inst.level = inst.level + 7 levelexp(inst) end if ( victim:HasTag("bishop_nightmare") or victim:HasTag("knight_nightmare") or victim:HasTag("rook_nightmare") or victim:HasTag("crawlinghorror") or victim:HasTag("crawlingnightmare") or victim:HasTag("shadow_knight") or victim:HasTag("shadow_bishop") or victim:HasTag("shadow_rook") or victim:HasTag("ghost") or victim:HasTag("werepig") or victim:HasTag("lureplant") ) then inst.level = inst.level + 10 levelexp(inst) end if ( victim:HasTag("leif") or victim:HasTag("krampus") or victim:HasTag("warg") or victim:HasTag("spat") or victim:HasTag("deciduoustree") ) then inst.level = inst.level + 25 inst.components.talker:Say("That's what i was talking about. Nya~") levelexp(inst) end if ( victim:HasTag("beequeen") or victim:HasTag("Goose") or victim:HasTag("dragonfly") or victim:HasTag("bearger") or victim:HasTag("spiderqueen") or victim:HasTag("deerclops") or victim:HasTag("minotaur") or victim:HasTag("klaus") or victim:HasTag("toadstool") ) then inst.level = inst.level + 50 inst.components.talker:Say("Hell Yea! I am the strongest. Nya~") inst.SoundEmitter:PlaySound("dontstarve/characters/alishia/bosskill") levelexp(inst) end end --startin gstats for level system local function onpreload(inst, data) if data.level then inst.level = data.level levelexp(inst) if data.health and data.health.health then inst.components.health.currenthealth = data.health.health end if data.sanity and data.sanity.current then inst.components.sanity.current = data.sanity.current end inst.components.health:DoDelta(0) inst.components.sanity:DoDelta(0) inst.components.hunger:DoDelta(0) end end --just for save local function onsave(inst, data) data.level = inst.level end --Extra damage from hounds local function ExtraHoundDamage(inst) local _GetAttacked = inst.components.combat.GetAttacked inst.components.combat.GetAttacked = function(self, attacker, damage, ...) if attacker and attacker:HasTag("hound") and damage then damage = damage * 1.5 end return _GetAttacked(self, attacker, damage, ...) end end --Extra damage from overheat local function IncreaseHurtRate(inst) inst.components.temperature.hurtrate = inst.components.temperature.hurtrate * 2 end local function DecreaseHurtRate(inst) inst.components.temperature.hurtrate = inst.components.temperature.hurtrate / 2 end -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "alishia.tex" ) inst:AddTag("alisha") inst:AddTag("bookbuilder") inst.transformed = true inst:AddComponent("keyhandler") inst.components.keyhandler:AddActionListener("alishia", TUNING.alishia.KEYTWO, "SpeedUp") inst.components.keyhandler:AddActionListener("alishia", TUNING.alishia.KEY3, "IceAttack") inst.level = 0 end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "alishia" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(50) inst.components.hunger:SetMax(50) inst.components.sanity:SetMax(50) --healt regen inst.components.health:StartRegen(3, 60) --overheat and min temperature inst.components.temperature.mintemp = 10 inst.components.temperature.overheattemp = 60 inst.components.temperature.inherentsummerinsulation = TUNING.INSULATION_TINY * -1 --start for level system --inst.visual_cos = true inst.level = 0 --Well no idea inst:AddComponent("heater") inst.components.heater.heatfn = function() return -25 end inst.components.heater:SetThermics(false, true) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1 --For level up inst:ListenForEvent("killed", onkill) inst:ListenForEvent("levelup", levelexp) --For do not lose or gain sanity (night, dusk or night) inst.components.sanity.neg_aura_mult = 0 inst.components.sanity.night_drain_mult = 0 inst.components.sanity.dusk_drain_mult = 0 --Hunger rate inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE --Extra fire damage inst.components.health.fire_damage_scale = 2 --Master code for on equip --inst:ListenForEvent("equip", OnEquip) --Master code for eyebone inst:ListenForEvent("onpickup", OnPickup) --Master code for Extra hound damage ExtraHoundDamage(inst) --Can not be freeze if inst.components.freezable then inst.components.freezable.Freeze = function() end end --Master code for Overheat inst:ListenForEvent("startoverheating", IncreaseHurtRate) inst:ListenForEvent("stopoverheating", DecreaseHurtRate) --Master code for Moon stats inst:WatchWorldState("isday", PowerUpAtNewMoon) inst:WatchWorldState("isdusk", PowerUpAtNewMoon) inst:WatchWorldState("isnight", PowerUpAtNewMoon) inst:WatchWorldState("moonphase", PowerUpAtNewMoon) --Master code for freeze counter attack inst.total_damage_received = 0 inst.last_time_first_hit = nil inst:ListenForEvent("attacked", OnBeingAttacked) --Master code for gain or lose sanity from pets inst.components.sanity.custom_rate_fn = critter_SanityAura inst:DoPeriodicTask(1, critter_SanityAura) inst:ListenForEvent("equip", function() local equippedweb = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equippedweb ~= nil and equippedweb:HasTag("fuingetsu") then elseif inst.level <461 then inst.components.combat.damagemultiplier = 1.5 else inst.components.combat.damagemultiplier = 0.7 end end) inst:ListenForEvent("unequip", function() local unequippedwep = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if unequippedwep ~= nil and unequippedwep:HasTag("fuingetsu") then inst.components.combat.damagemultiplier = 1 else inst.components.combat.damagemultiplier = 1 end end) inst.OnLoad = onload inst.OnNewSpawn = onload inst.OnSave = onsave inst.OnPreLoad = onpreload --Master code for eat code inst.components.eater:SetOnEatFn(oneat) end return MakePlayerCharacter("alishia", prefabs, assets, common_postinit, master_postinit, start_inv)
  11. First of all forgive my english it's not my main language and i'm not sure that i can explain correctly what i want. I'm making a custom weapon which switchable with other forms it must have a main form and with hotkeys it must change another.(I hope that it's understandable) all of weapons have different textures and different abilites (sword, bow, speat, scythe) and i don't know how to make all of them in 1 .lua i hope it is understandable
  12. 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
  13. I'm using this code for when eat something not "fish or cooked fish or ice or fishsticks or fish tacos" gives 5 hunger and -10 sanity elseif food and food.components.edible and food.prefab == not "ice" or "fish_cooked" or "fish" or "fishtacos" or "fishsticks" or then local hungerboost = 5 local sanityboost = -10 local foodcheck = food.inst.prefab == "spoiled_food" and 0 or hungerboost inst.components.health:DoDelta(0) inst.components.sanity:DoDelta(0) inst.components.hunger:DoDelta(5 - food:GetHunger() * eater.hungerabsorption) inst.components.talker:Say("I shouldn't eat that. Nya~") end but when i eat something it crash. lost server connection.
  14. ^ title. Can't find it! In temperature.lua, the overheating threshold is "self.overheattemp" and is declared as "TUNING.OVERHEAT_TEMP" (which in tuning is declared as 70). But neither in tuning nor in temperature.lua can I find any variable that defines the freezing temperature threshold. Anyone has any ideas? Oh, and, I also couldn't find where the overheating and freezing warning temperatures are declared. For freezing it's 5 and for overheating it's 65 or something along the lines, but I can't find it anywhere
  15. So, I know that you need to have animation files imported and then selected when to play what. For the inactive bernie, things are laid out pretty straight forward, since him being inactive means only two animations (beaten up and normal idle). For the active version, you have multiple ones, like 5 or so, not entirely sure, yet, in the bernie_active.lua there is only one animation declared and it's in fn: inst.AnimState:PlayAnimation("idle_loop") So... where exactly is the code that applies all of the other animations including trottling taunt animation, walking animation, waking up animation, getting hit animation etc.?
  16. Good morning/day/evening, sir/madam! I'm currently making a character for DST, all artwork is done, but now I need some help with coding, more specifically: Heat and cold damage. I wanted to make that my character takes the double heat damage per second and lower heat tolerance, but no cold damage what so ever. As when the temperature drops below some point, character gaining speed and damage boost, his hunger rate is draining faster. Item. And here I have no idea what so ever even on the file hierarchy. I want to make an amulet that will be neglecting sanity drain from night (dusk one still should be there) and full darkness. (additionally if you can, give me some tutorials on character specific item creation, like how to make it what so ever I will be grateful) Thanks for the help beforehand P.S Sorry if something wasn't clear, or for my terrible grammar, English isn't native language for me. Though I will totally understand the answers, if you have questions to ask go ahead I'll try to reply ASAP. fawkes.lua
  17. Hello! I have a question on going about making a character friendly with bats. Its not as easy as just adding the tag "bat" to masterpost_init so... thinking about this has been interesting to say the least. I know that I will have to modify the behavior of the batilisk themselves. Is this possible to do just on the characters prefab script? Or is this going to have to be more in depth. I have just basic programming knowledge and after searching for anything bat mod related on the workshop to look at code and compare I have decided to come here for assistance. Any help will be greatly appreciated for I am stumped. Sindrake
  18. Hey everyone! New to the DST modding community. I'm trying to create a mod based off of me and my friends characters from another game, however the problem that I'm currently having is that I want to swap the Sanity gain during daytime/night time. As of right now I think I have things working semi-correctly but I'm not 100% sure on the matter. This is currently what it looks like. inst.components.sanity.custom_rate_fn= function(inst) local dapperness = 0 local lightval = inst.LightWatcher:GetLightValue() local day = TheWorld.state.isday and not TheWorld:HasTag("cave") if day then dapperness = TUNING.SANITY_NIGHT_DARK * 0.2 else local lowval = TUNING.SANITY_LOW_LIGHT if lightval <= lowval then dapperness = TUNING.SANITY_NIGHT_DARK dapperness = -1 * dapperness else dapperness = 0; end end return dapperness end It feels a bit off however. Throughout the day, Sanity drops to about 150-160 (From 200) and during the night it ends up back at around 170? I feel like in the winter nights this might be a bit too much. I was also hoping to make it so that during "Dusk" time no Sanity gain or decrees would happen, however that doesn't appear to work. Any help would be highly appreciated! ----- One other side note, I'm trying to also add an aura to another Character that gives +1 science to everyone around you in a radius (Similar to that of the Science machine) however I had no luck there either.
  19. I need some help trying to get some code to work, so you see, I'm trying to get my character to have code like when he gets at 200 hunger he gets new changes then we gets at 180 hunger he gets new changes then when he gets 150 hunger he gets new changes, this just example but I wanna try code like that, so I did this... inst:DoPeriodicTask(1, function() if (self.hunger.current >= (self.hunger.max * 200)) then inst.components.locomotor.runspeed = 10.15 * TUNING.WILSON_RUN_SPEED end end) inst:DoPeriodicTask(1, function() if (self.hunger.current >= (self.hunger.max * 180)) then inst.components.locomotor.runspeed = 1.15 * TUNING.WILSON_RUN_SPEED end end) inst:DoPeriodicTask(1, function() if (self.hunger.current >= (self.hunger.max * 150)) then inst.components.locomotor.runspeed = 10.15 * TUNING.WILSON_RUN_SPEED end end) but it doesn't work , does anyone know a way to make stuff happen when health, sanity and hunger go at a certain number?! I would really love some help !
  20. Hi. I'm looking someone to help me with code to new modification. I'm an artist so I have no idea how to step in world of pain and numbers. Idea and material were rotting on my computer for nearly year. I have basic animation to new maschine, so ability to implement them into game is requirement to collaboration. Write here or PM me here or on Steam (it's fastest way to reach me) - Marqson All new stuff and ideas here (obviously not Wilson and standard Don't Starve assets) are mine, and using them without my approval will be **** move. Also english is not my first language.
  21. This might be long depending the answer, but I was wondering if was possible to make it so that when nothing is equipped in the hands slot, you can fire a projectile similar to the fire staffs?
  22. This is for a Waverly mod I'm making. It needs to be able to craft Wickerbottom's books, and must make all neutral and hostile, or other, mobs to attack her on sight. Thanks in advance. ~Union
  23. How would I make it so that my character has access to the magic tab by default?