Search the Community

Showing results for tags 'component'.



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] - General Discussion
    • [Griftlands] - Suggestions and Feedback
    • [Griftlands] - Mods and Tools
    • [Griftlands] - Localization
    • [Griftlands] - Bug Tracker
    • [Griftlands] - 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] Beta Branch
    • [Don't Starve Together] PlayStation
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Nintendo Switch
    • [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!
  • Griftlands
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Beta Branch
  • [Don't Starve Together] Nintendo Switch
  • [Don't Starve Together] PlayStation
  • 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] 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!
  • Griftlands
  • Hot Lava
  • Don't Starve Together
  • [Nintendo Switch] Don't Starve Together
  • [PlayStation] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Categories

  • Hot Lava - Bug Reports

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 8 results

  1. So i added custom component to character and its crashing when: i enter cave i load existing world - creating new world is fine but when i disconnect and resume it teleports my character to some random spot and after few seconds crash server. here is code for component: --blood.lua local Blood = Class(function(self, inst) self.inst = inst self.max = 100 self.current = 0 end) function Blood:OnSave() return {currentblood = self.current} end function Blood:OnLoad(data) if data.currentblood then self.current = data.currentblood self:DoDelta(0, true) end end --Ustawia aktualna wartosc bloodpoints function Blood:SetCurrent(amount) self.current = amount end function Blood:GetCurrent() return self.current end return Blood and i add component to character this way inst:AddComponent("blood") its probably something with saving or loading, maybe? idk
  2. Alright so this is a weird set of questions to be pairing together but they kind of go hand-in-hand. Hopefully they'll be simple enough. I have attached my character's prefab file and will be referencing it in this post. Question A: As shown below, I am trying to make my character say certain things when he eats any foodtype other than meat or pigskin. The problem is, even though my friend and I have tried making exceptions for meat and pigskin, my character is still saying the "badfoodresponses" for those two food groups (if pigskin can even be called a food group). I have looked in eater.lua, edible.lua, pigskin.lua, basically anything pertaining to food or pigskin that I could find in the game's files. This is near the top of the file: local eatbadfoodresponses = { "Ooooh... My belly...", "My body can't digest that...", "URK! I probably shouldn't have eaten that...", } local function oneat(inst, food) print("Running oneat function") if food ~= nil then -- Make sure food is not nil for whatever case that is even possible if food.prefab == "pigskin" then -- Is the food pigskin? print("eating pigskin") inst.components.health:DoDelta(10) -- Add 10 health elseif food.components ~= nil and food.components.edible ~= nil and food.components.edible.foodtype == "meat" then -- Does the food have the edible component and is meat print("eating meat") -- Do nothing, we have a different area of code managing this. else -- Otherwise if it was not pigskin or meat print("eating other") inst.components.talker:Say(eatbadfoodresponses[math.random(#eatbadfoodresponses)]) -- Say that the food did not agree with gara. end end -- If we put an else here we can have something special for the edge-case of food being nil. end local _Eat = inst.components.eater.Eat --backup original function inst.components.eater.Eat = function(self, food, feeder, ...) --override original function if food and food.components.edible and food.components.edible.foodtype ~= "MEAT" then inst.components.health:DoDelta(-5) self.healthabsorption = 0 --lower our healthabsorption to 0 so we get no health from nonmeats end local result = _Eat(self, food, feeder, ...) --call backuped function copy of original self.healthabsorption = 1 --return it to default return result --return the results from _Eat end ^ And this is near the bottom. As you can see, anything non-meat is supposed to deal 5 damage to Garamonde, while actual meat food does not lower his health or sanity at all. Which brings me to Question B: As you can also see, we have made it so Garamonde can eat pigskin and, much like spiders, he is supposed to heal 10 health from it. Instead, it's being treated like a non-meat item and removing 5 health. On another note, pigskin nor meat is being registered when it's printed in console. They're only being treated as "other" food. I hope that's enough information and that anybody at all can help. Me nor my friend can figure this out. garamonde.lua
  3. Pretty self-explanatory. I created a custom component, added some variables and functions. The problem comes with saving these variables. The OnSave function works (I'm checking it with print("OnSave works!")). The OnLoad function on the other hand is not working and I have no idea why. Here's my component: sickness.lua EDIT So I still have that problem with the OnLoad function not working, but now in addition to this I can't seem to make my prefab listen to the "oneat" event. I've looked through many files, all using inst:ListenForEvent("oneat"), and they seem to work. Mine for some reason isn't working. Any help would be great.
  4. Version 1.0.0

    24 downloads

    This code is designed for Don't Starve Together to allow for critical hits and items with critical hit properties. By design this allows all mobs the potential to be able to crit if they have crit chance greater than 0 Using inst.components.combat:SetCrit(critchance, critdmg, critfn) we can define a basic crit settings for a mob. Currently equipment have crit variables as inst.variables rather than component ones. Some fun examples if you have a hat that has crit chance, we can give it to a pigman and he'll be able to crit. Currently tested on a caves enabled server and works as advertised. Suggestions and bugs found for improvements welcome.
  5. It is what the title says, I am trying to make a component. The component is not for a weapon or tool, it is for a characters, the idea is for the component to be a SCENE or POINT, the idea is that the character is able to gravity shove a target away (it will have a cost later). It is supposed to be 'ranged', so the character can do that from a certain distance, not too far but not just too close. The thing is that I seem to be having a problem is that I am having a hard time how to make the whole ranged factor of it. I've tried finding references and the closest I got were the 'more actions' mod, which gave me more light on how to make the whole 'gravity shove' but not how to make it ranged. Is there a way to do it? do I need to create an invisible projectile?
  6. I am trying to port my Thrist mod into DST and I am facing troubles doing it. The thing is - thirst rate shoud depend on temperature of player and also player should start to sweat, if he is overheating. But if I try to call temperature component from thirst component - I get a crash saying "U're trying to access nil temperature blah blah blah". Here is the code from modmain: Here is the code from thrist.lua : What am I doing wrong? How do I fix this? Thanks in advance.
  7. As you can see, crash occurs on missing component "mine" for "trap_teeth". I'm 100% sure that there is no any "RemoveComponent" calls in the code. This component must exist. But for some reason it is missing. How is it possible?
  8. I can't understand what am I doing wrong. AddComponentPostInit("instrument",function(inst) local old_play = inst.Play function inst:Play(musician,...) old_play(self,musician,...) endend)‚ÄčThis code makes Pan Flute unbreakable. And character say "I can't do that" while using it. However this code do nothing.