-
Content Count
839 -
Joined
-
Last visited
Community Reputation
897 ExcellentAbout Thomas Die
-
Rank
Senior Member
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Enable-
How to make animals to not run away?
Thomas Die replied to Enth's topic in [Don't Starve Together] Mods and Tools
inst:RemoveTag("scarytoprey") --place this wherever the taggs go rabbit brain found in /scripts/brains/rabbitbrain rabbits and stuff brains I think are set to run away if it has the tag "scarytoprey" so taking it out should do that not sure tho so experiment. brain/THE_ANIMAL_NAMEbrain. will tell you about how things will work. -
can you give skins different voices
Thomas Die replied to dfired's topic in [Don't Starve Together] Mods and Tools
Crash? -
can you give skins different voices
Thomas Die replied to dfired's topic in [Don't Starve Together] Mods and Tools
AddPlayerPostInit(function(inst) if not inst:HasTag("your player tagg") then return end inst:DoPeriodicTask(time between each function, function() --the code end) end) -
can you give skins different voices
Thomas Die replied to dfired's topic in [Don't Starve Together] Mods and Tools
pretty much just have the code run whenever your skin changes but if you're lazy like me just have a periodic task run it -
can you give skins different voices
Thomas Die replied to dfired's topic in [Don't Starve Together] Mods and Tools
inst.components.skinner.skin_name this was from a few months ago but this is where your skin name is -
Making a custom tech tree for follower
Thomas Die replied to AkaiNight's topic in [Don't Starve Together] Mods and Tools
Ngl I think you might have to reconsider the coding, I'm pretty sure this is absurdely effort but I think DarkXero made code for this if it still works. I'm happily willing for someone to tell me otherwise tho. -
Token based drop system for custom survivor
Thomas Die replied to C_Thun's topic in [Don't Starve Together] Mods and Tools
Uhm don't tell anyone but do you see that mini function in the brackets can you add a little end to end it off :] Probably my woopsie. This thing -
Token based drop system for custom survivor
Thomas Die replied to C_Thun's topic in [Don't Starve Together] Mods and Tools
local drop_rate_chance = 0.5 --lower equals higher chance drop local drop_rate_max_chance = 10 --how many items unitll it reaches a 100% rate local drop_rate_item = 'insert_prefab_which_increases_drop_rate' local drop_item = 'Item_which_will_be_dropped' --reused from wortox code line 175 local function GetStackSize(item) return item.components.stackable ~= nil and item.components.stackable:StackSize() or 1 end --reused from wortox code line 183-189 local function AmountOfItem(inst) local item = inst.components.inventory:FindItems(function(i)return i.prefab== drop_rate_item) --will be explained in a spoiler below local count = 0 for i, v in ipairs(item) do count = count + GetStackSize(v) end return count end inst:ListenForEvent("onattackother", function(inst, data) --data.target = target you attacked, data.weapon = weapon you hit them with, data.projectile = object that you hit them with , data.stimuli = thing that you hit --written on line 882 in scripts/components/combat if (math.clamp(math.random() + (AmountOfItem(inst) / drop_rate_max_chance) , 0,1)) > drop_rate_chance then SpawnPrefab(drop_item).Transform:SetPosition(data.target.Transform:GetWorldPosition()) end end) This code should work but it's untested i'll explain the method in the spoilers below if you'd like to change any code just ask but i'll only explain how you should do it Counting The amount of items Calculating the chance of drop on hit kinda burnt out so reply if you're suck and i'll replay tommroow -
Oh sorry put just inst maybe instead of self.inst
-
Before anything server related For a player file inside common_postinit
-
In terms of code or art, if you're talking about code i explained prior for art just use text tool to extract an existing image or use ktool krane to extract and replace, like i did for the custom badges.