loopuleasa

  • Content count

    108
  • Joined

  • Last visited

Community Reputation

271 Excellent

1 Follower

About loopuleasa

  • Rank
    Member

Badges

Don't Starve
  • Contributor
  1. Do not forget: We are the minority The game is hard for 95% of players. I just met with a guy IRL, told him I was modding DST, and you know the first thing that he said "Yeah, I know that game, it's such a cool game, but so hard" "Yeah, I am working on a mod collab to make it harder rn" "Even harder than it is?" Was funny in retrospect. Klei are doing a good job, and we are just entitled.
  2. You can have the idea in the project, as long as you help implement it. Huge ideas require coding efforts, and even if the idea is good it won't get made
  3. the functions seem to be local I just want to do a small change down a stack of 3-4 local functions can check the upvalue, no other way? For example, here is my full change (makes bird die after being fed 4 monster meat) It ended up being huge, and I copied over most things ----------------------------------------------------------------- -- Bird dies if fed too much monster meat ----------------------------------------------------------------- --TODO: Shorten functions here, and overwrite only (maybe use upvalue hacker) local function OnBirdStarve(inst, bird) if inst.AnimationTask then inst.AnimationTask:Cancel() inst.AnimationTask = nil end inst.CAGE_STATE = "_death" inst.AnimState:PlayAnimation("death") inst.AnimState:PushAnimation("idle"..inst.CAGE_STATE, false) --PushStateAnim(inst, "idle", false) --Put loot on "shelf" local loot = GLOBAL.SpawnPrefab("smallmeat") inst.components.inventory:GiveItem(loot) inst.components.shelf:PutItemOnShelf(loot) end local function DigestFood(inst, food) if food == nil then return false end if food.components.edible.foodtype == GLOBAL.FOODTYPE.MEAT then --If the food is meat: --Spawn an egg. inst.components.lootdropper:SpawnLootPrefab("bird_egg") else local seed_name = string.lower(food.prefab .. "_seeds") if Prefabs[seed_name] ~= nil then --If the food has a relavent seed type: --Spawn 1 or 2 of those seeds. local num_seeds = math.random(2) for k = 1, num_seeds do inst.components.lootdropper:SpawnLootPrefab(seed_name) end --Spawn regular seeds on a 50% chance. if math.random() < 0.5 then inst.components.lootdropper:SpawnLootPrefab("seeds") end else --Otherwise... --Spawn a poop 1/3 times. if math.random() < 0.33 then local loot = inst.components.lootdropper:SpawnLootPrefab("guano") loot.Transform:SetScale(.33, .33, .33) end end end --Refill bird stomach. local bird = (inst.components.occupiable and inst.components.occupiable:GetOccupant()) or nil if bird and bird:IsValid() and bird.components.perishable then bird.components.perishable:SetPercent(1) --TODO:Bird dies if too much mmeat is given if food.components.edible.foodtype == GLOBAL.FOODTYPE.MEAT and food.components.edible:GetHealth(inst) < 0 then --monster meat is currently the only negative health meat item if bird.monsterbelly ~= nil and bird.monsterbelly ~= 0 then bird.monsterbelly = bird.monsterbelly+1 else bird.monsterbelly = 1 end print(bird.monsterbelly ) if bird.monsterbelly >= 4 then OnBirdStarve(inst, bird) end end end end local function OnGetItem(inst, giver, item) --If you're sleeping, wake up. if inst.components.sleeper and inst.components.sleeper:IsAsleep() then inst.components.sleeper:WakeUp() end if item~=nil and item.components.edible ~= nil and item.components.edible.foodtype ~= nil and ( item.components.edible.foodtype == GLOBAL.FOODTYPE.MEAT or item.prefab == "seeds" or Prefabs[string.lower(item.prefab .. "_seeds")] ~= nil ) then --If the item is edible... --Play some animations (peck, peck, peck, hop, idle) inst.AnimState:PlayAnimation("peck") inst.AnimState:PushAnimation("peck") inst.AnimState:PushAnimation("peck") inst.AnimState:PushAnimation("hop") inst.AnimState:PushAnimation("idle"..inst.CAGE_STATE, true) --Digest Food in 60 frames. inst:DoTaskInTime(60 * GLOBAL.FRAMES, DigestFood, item) end end AddPrefabPostInit("birdcage", DigestFood, OnGetItem, OnBirdStarve) AddPrefabPostInit("birdcage", function (inst) if inst ~= nil and inst.components.trader ~= nil then inst.components.trader.onaccept = OnGetItem end end)
  4. Hi, I am doing a change in birdcage.lua Is it possible to import the functions from the original birdcage.lua, or even call the original ones in my AddPrefabPostInit I do not wish to copy over literally 7 functions for my change. local function DigestFood(inst, food) if food == nil then return false end if food.components.edible.foodtype == GLOBAL.FOODTYPE.MEAT then --If the food is meat: --Spawn an egg. inst.components.lootdropper:SpawnLootPrefab("bird_egg") else local seed_name = string.lower(food.prefab .. "_seeds") if Prefabs[seed_name] ~= nil then --If the food has a relavent seed type: --Spawn 1 or 2 of those seeds. local num_seeds = math.random(2) for k = 1, num_seeds do inst.components.lootdropper:SpawnLootPrefab(seed_name) end --Spawn regular seeds on a 50% chance. if math.random() < 0.5 then inst.components.lootdropper:SpawnLootPrefab("seeds") end else --Otherwise... --Spawn a poop 1/3 times. if math.random() < 0.33 then local loot = inst.components.lootdropper:SpawnLootPrefab("guano") loot.Transform:SetScale(.33, .33, .33) end end end --Refill bird stomach. local bird = GetBird(inst) if bird and bird:IsValid() and bird.components.perishable then bird.components.perishable:SetPercent(1) --TODO:Bird dies if too much mmeat is given if food.components.edible.foodtype == GLOBAL.FOODTYPE.MEAT and food.components.edible:GetHealth(inst) < 0 then --monster meat is currently the only negative health meat item if bird.monsterbelly ~= nil and bird.monsterbelly ~= 0 then bird.monsterbelly = bird.monsterbelly+1 else bird.monsterbelly = 1 end print(bird.monsterbelly ) if bird.monsterbelly >= 4 then --OnBirdStarve(inst, bird) inst.AnimState:PlayAnimation("death") --PushStateAnim(inst, "idle", false) --Put loot on "shelf" local loot = SpawnPrefab("smallmeat") inst.components.inventory:GiveItem(loot) inst.components.shelf:PutItemOnShelf(loot) end end end end
  5. nevermind, solved, the file itself was not getting loaded the component code is fine, it prints now
  6. I got this from Klei's official API docs, it's the double damage example ----------------------------------- -- Component mod example -- -- AddComponentPostInit("componentname", initfn) -- Use this to modify a component's properties or behavior ----------------------------------- local function DoubleHealthDeltaInit(component) print("DOUBLE DAMAGE ENABLED") local original_dodelta = component.DoDelta component.DoDelta = function(self, amount, overtime, cause, ignore_invincible) print("DOUBLE DAMAGE") local double_amount = amount*2 original_dodelta(self, double_amount, overtime, cause, ignore_invincible) end end AddComponentPostInit("health", DoubleHealthDeltaInit) No prints are being shown when taking damage. Similarly, I was trying to get it to work on my Moisture:OnUpdate component, and nothing is printed there either. AddComponentPostInit("moisture", function(self) _OldOnUpdate = self.OnUpdate print("AddComponentPostInit") function self:OnUpdate(dt) print("moisture update") trip_over_chance_on_maxwet(self.inst) _OldOnUpdate(self, dt) end end) Anyone know what is happening here, or any examples on components? Been struggling for 3 days to get this one working. Loop
  7. - You can plant many flowers in a small area, haunt them to turn them into evil flowers, and then you have what's called a sanity station, that you can stay on top of with a bee queen hat and you will gain sanity really fast - Now the unknown mechanic for pro wendies is that an active Abigail 's flower dropped on ground turns into an evil flower when you dc and relog, or when you go to caves and back. This happens as long as the turf dropped on is butterfly plantable. This method can place flowers much tighter than butterfly planting, which creates stronger sanity stations Video of this
  8. This is literally the most delish looking food in the game for me Time to order a burger Btw, OP is cheeky, and has a hidden agenda. He doesn't want a Meme food. What he wants is adding a brand new filler: ferns Well played OP
  9. These could be posted in unknown mechanics thread
  10. I know I am in the minority, and a heretic but I trust the devs
  11. There is caveman 2 mod for this No science machines, and recipes have a chance to drop by mobs
  12. You can make Bacon and Eggs with two monster meat and 100% chance Think about it
  13. These aren't really unknown, they're common crocpot knowledge A few crocpot tricks that might not be known is that you can make bacon and eggs with two monster meat guaranteed, and also the following recipe (Twig, Eel, Lychen, Lychen) does not produce fish sticks Also the cooling and heating values are a bit advanced, and many foods have them.
  14. Fun fact: Klei originally intended to have monster meat not be feedable to birds at all, but decided against jerky and cooked versions, judging from the comments Notice that the bird_egg_cooked does not appear, which allows you to create infinite loops for eggs by cooking them and refeeding them to get full egg freshness again.