Search the Community
Showing results for tags 'lua'.
Found 4 results
Hey is there a way to make a weapon's-tool's animation a punch from the script (*.lua). And if the answer is: Use "custom animation template" how can I make it exclusive to this weapon, find and use the default punch animation?
I'm building, or trying to build, a mod called More Drops (DS). I ported it to Don't Starve from "Don't Starve Together", so my lua knowledge is very limited, but I've been working on this thing for days and can't figure it out, so I need to ask for help. I figured out how to expand on the original mod authors work by adding new trees and resources, but when it comes to "hackable" resources, I'm stumped. So this is what I was trying, and tons of variations on this. This doesn't work and I don't understand why, and I'll show you what does work in the next two. --bamboo if inst.name == "Bamboo Patch" and utils.LootRandom(bambooChance) then utils.DoTimes(GetModConfigData("bambooAmount", KnownModIndex:GetModActualName("(JEM) More Drops DS")), inst.components.lootdropper.SpawnLootPrefab, inst.components.lootdropper, "bamboo") end This does work --Spawn extra logs for tall trees if inst.components.growable.stage == 3 and utils.LootRandom(logChance) then utils.DoTimes(GetModConfigData("extralogstall", KnownModIndex:GetModActualName("(JEM) More Drops DS")), inst.components.lootdropper.SpawnLootPrefab, inst.components.lootdropper, "log") end And this works as well if inst.name == "Evergreen" and inst.components.growable.stage ~= 1 then if utils.DropLootRandom(inst, "pinecone", seed_chance) then print("Dropped seed") end end Now I'm not sure how much of the files I should paste here, but here's the start of the trees.lua just to add a bit more context local utils = require("utils") local logChance = GetModConfigData("logChance", KnownModIndex:GetModActualName("(JEM) More Drops DS")) local function ImproveTree(inst) --Do these when the tree is fully chopped local seed_chance = GetModConfigData("treeseedchance", KnownModIndex:GetModActualName("(JEM) More Drops DS")) local egg_chance = GetModConfigData("eggChance", KnownModIndex:GetModActualName("(JEM) More Drops DS")) local coconut_seed_chance = GetModConfigData("coconutChance", KnownModIndex:GetModActualName("(JEM) More Drops DS")) local bambooChance = GetModConfigData("bambooChance", KnownModIndex:GetModActualName("(JEM) More Drops DS")) local oldonfinish = inst.components.workable.onfinish inst.components.workable:SetOnFinishCallback(function(inst, chopper) All of the info is called in modmain.lua correctly as far as I can tell, I made sure to add things in the same way as the working code. I expected this to drop some extra bamboo! I've tried so many different ways, even made my own choppable.lua file and added it the same way the original author added pickable.lua, but I figured it's gotta be a bit more like trees than regular resources, since you use a tool and it drops the item on the ground rather than adding to invetory. If you want to see the whole mod, I've uploaded it here and in dropbox: https://www.dropbox.com/s/ahss2d0s861j2an/%28JEM%29%20More%20Drops%20DS.7z?dl=0 (JEM) More Drops DS.7z
i have attached the log file, but i keep getting an error, mainly Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. repeatedly, any ideas, help much appreciated! log.txt
Because damn are these things strong. I got killed by 1 Werepig despite wearing an undamaged log suit, a spear and having full health. I don't even know how it happened so fast. I was watching my health meter and it suddenly went from little below average to death, so I guess the thing either got a critical hit or he broke my bloody log suit. And I'm not even sure if I actually hit the him because as far as I know, the only time when you can hit him in a proper battle of strength is when he's attacking. That's not a big window, especially considering you have to get freaking hit in order to land an attack. And even if I hit it, there was no indicator and I must've hit it at least 7 times. I know Beefalo less bulky then that!And this was just 1 bloody Werepig, and if it wasn't for the very sudden drop in health I would've danced around my Vision of Hell level Campfire 'till morning. Now think about newcomers who will likely have more then 1 pig chasing after them after they first find out you can have them as bodyguards, or folks who forget to check the moon phase when gathering their pig army to conquer a few spider nests on yonder island. They'll have to fend of more of these things near a too small campfire. I dunno about you, but that sounds like an extremely unfair way to die in a game that's otherwise quite fair when it comes to death.My proposition: Remove kiting from Werepigs, make them less bulky and have the character make an off hand comment if it's the evening before full moon. To even this out, Werepigs should stop dropping Pig Skin. I propose 2 monster meat and 1 normal meat or something.