Search the Community
Showing results for tags 'component'.
Found 2 results
Hi, How can I add my own tag to local function Update in perishable.lua component? I tried adding AddClassPostConstruct function with doing my new local Update funcion, and calling it in new LongUpdate and new StartPerishing in AddClassPostConstruct, but it break the game whatever i try. But when I copy whole perishable.lua to my mod folder it works then, but I don't think I should do this like this.
16 downloadsThis 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.