Search the Community
Showing results for tags 'event'.
Found 6 results
As some of you know , Easter is coming , and therefore we will have a little contest. Contest is simple and straightforward : Draw DST themed Easter egg of your liking. So if you are interested , read all info below: Rules: - No nsfw or gore stuff, all motives have to be family friendly. - You will be able to submit only one drawing in #easter-event that has to be signed by you on the bottom of it.. - Submissions are open until Saturday 8th - 20.00 PM GMT+1 . - After checking all the drawings by staff team, voting will be open at 21.00 PM GMT+1 - Votes will be casted with reacting with following emoji -> , top 3 drawings with most of emojis wins. - Voting will be open until Sunday 9th - 20PM GMT+1, winner will be declared within next 30 minutes from there. - In case of the tie in votes for first 3 places, staff team will have voting of their own and present final decision as single vote. Prizes: 1st place - 20 euros steam gift card. 2nd place- 10 euros steam gift card. 3rd place- 5 euros steam gift card. Prizes will be delivered via steam key or via steam gift, depending from which region you come. Sometimes its not possible to send steam gift card due to difference in currency. We hope to see you there and good luck! DFT discord: https://discord.gg/dft Event submission channel: https://discord.com/channels/340619088399433730/1093249689870159934
Trigger when Crafted/First Loaded
posted a topic in [Don't Starve Together] Mods and ToolsI am trying to make a prefab do something only when its first crafted, something like `OnNewSpawn` but I can only get that to work for players. Does anyone happen to know a workaround by chance? If not i'll attempt messing with onload and onsave again.
I'm trying to make it so that my character gains more sanity from wearing garlands specifically. I had found code for sanity bonus from picking things (in my case, flowers), and I'm hoping I can apply it to increasing the sanity gain from wearing a garland. Does anyone know what the hat worn event is called? EDIT: Would the code for altering the sainty gained from wearing a garland look like this? inst:ListenForEvent( "puteventhere" function(inst, data) if(data and data.object and data.object.prefab=="flowerhat") then if(inst and inst.components and inst.components.sanity) then inst.components.sanity:DoDelta(put sanity change here) end end end )
Help with sheltered event
posted a topic in [Don't Starve Together] Mods and ToolsHello, so I want my character to gain sanity when going under a tree so I did this inst:ListenForEvent("sheltered", function(inst, data) inst.components.talker:Say(GetString(inst, "ANNOUNCE_SHELTERED")) inst.components.sanity:DoDelta(TUNING.SANITY_TINY) The problem's that when she leaves under the tree she gets another sanity boost which I don't want... Is there an "stopsheltered" event ?! Any help's appreciated so much! And thanks for reading !
posted a topic in [Don't Starve Together] Mods and ToolsLet's talk about events in inventoryitem component. There are 4 events: pickup, drop, activeitem and putininventory. When they are triggered? OnPutInInventory OnDropped OnActiveItem OnPickup, OnPutInInventory (first Pickup, then PutInInventory) OnPickup, OnPutInInventory, OnActiveItem OnPickup, OnDropped, OnPutInInventory, OnActiveItemSo when? OnPutInInventory When item is moved to container, inventory or backpackWhen item is equippedWhen item is moved to mouse cursor except moving directly from equipped slot OnDropped When item is dropped on the ground (obvious) When item is picked up from the ground in mouse cursor (if no free cell in inventory)OnActiveItem Only when item is moved to cursorOnPickup When item is moved to inventory (not backpack), obvious When item is moved to cursor, except moving directly from equipped slotWhen item is moved to container, except moving directly from cursor Thank you for reading.
I asked a similar question way back, but I can't find the topic from my profile. So here's my situation. I'm working on fiddling around with a variation of the component kramped.lua. I want to change its purpose from causing events when things are KILLED to causing events when things are CRAFTED or PROTOTYPED. So I noticed this code: self.inst:ListenForEvent( "killed", function(inst,data) self:onkilledother(data.victim) end )and this code: function Danger:onkilledother(victim) --assigns value based on victim, learn to assign value based on item crafted if victim.prefab == "pigman" then if not victim.components.werebeast or not victim.components.werebeast:IsInWereState() then self:OnNaughtyAction(3) end elseif victim.prefab == "babybeefalo" then self:OnNaughtyAction(6) elseif victim.prefab == "teenbird" then self:OnNaughtyAction(2) elseif victim.prefab == "smallbird" then self:OnNaughtyAction(6) elseif victim.prefab == "beefalo" then self:OnNaughtyAction(4) elseif victim.prefab == "crow" then self:OnNaughtyAction(1) elseif victim.prefab == "robin" then self:OnNaughtyAction(2) elseif victim.prefab == "robin_winter" then self:OnNaughtyAction(2) elseif victim.prefab == "butterfly" then self:OnNaughtyAction(1) elseif victim.prefab == "rabbit" then self:OnNaughtyAction(1) elseif victim.prefab == "tallbird" then self:OnNaughtyAction(2) elseif victim.prefab == "bunnyman" then self:OnNaughtyAction(3) elseif victim.prefab == "penguin" then self:OnNaughtyAction(2) end endendSo I've managed to figure out how to set up the functions for various things being crafted or prototyped, but I don't know what event to "listen" for and what data that event contains(item crafted?). Any tips?