Search the Community
Showing results for tags 'component'.
Found 6 results
-
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.
-
Version 1.0.0
19 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.-
- 2
-
-
-
- critical hit
- crit
- (and 4 more)
-
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?
-
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.
-
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.