• Announcements

    • JanH

      Rhymes with Play 136 - Oxygen Not Included   04/27/2017

      Join the Klei team this Thursday, April 27th at 3:30 PM PDT (10:30 PM UTC), where we will be talking about and playing Oxygen Not Included, only on the Rhymes with Play Dev Cast on Twitch. Where is it?
      On our official Twitch channel here:
      http://www.twitch.tv/kleientertainment
       
      Times:
      10:30 PM UTC (Coordinated Universal Time)
      6:30 PM ET (East)
      5:30 PM CT (Central)
      4:30 PM MT (Mountain)
       
      When is it?
      Thursday, April 27th at 3:30 PM PDT (10:30 PM UTC). Here's a handy tool to figure out what time that means for you:
      http://www.worldtimebuddy.com

DarkXero

Registered Users
  • Content count

    2,895
  • Joined

  • Last visited


Community Reputation

2541 Excellent

About DarkXero

  • Rank
    Senior Member

Recent Profile Visitors

6,374 profile views
  1. The mod is "all_clients_require_mod = true", so the compass function runs on clients (people joining cave servers). The fueled component doesn't exist on clients, and you end up indexing a nil of a table. Either turn the client requirement to false, or add a check AddPrefabPostInit("compass", function(inst) if inst.components.fueled then -- do fueled thing end end) to verify that the component exists.
  2. Go ahead and do as you please. I don't need credit.
  3. local focustime = { bee = 3, toadstool = 5, } local function OnFocusCamera(inst) local player = GLOBAL.TheFocalPoint.entity:GetParent() if player ~= nil then GLOBAL.TheFocalPoint:PushTempFocus(inst, 6, 22, 6) end end local function DoDeathFocus(inst) if inst.modcamerafocusdeath:value() then if inst.modcamerafocusdeathtask == nil then inst.modcamerafocusdeathtask = inst:DoPeriodicTask(0, OnFocusCamera) end elseif inst.modcamerafocusdeathtask ~= nil then inst.modcamerafocusdeathtask:Cancel() inst.modcamerafocusdeathtask = nil end end local function CancelDeathFocus(inst) inst.modcamerafocusdeath:set(false) end local function TriggerDeathFocus(inst) inst.modcamerafocusdeath:set(true) inst:DoTaskInTime(focustime[inst.prefab], CancelDeathFocus) end local function DeathFocusInit(inst) inst.modcamerafocusdeath:set_local(false) if not GLOBAL.TheNet:IsDedicated() then inst:ListenForEvent("modcamerafocusdeathdirty", DoDeathFocus) end if GLOBAL.TheWorld.ismastersim then inst:ListenForEvent("death", TriggerDeathFocus) end end local function DeathFocus(inst) inst.modcamerafocusdeathtask = nil inst.modcamerafocusdeath = GLOBAL.net_bool(inst.GUID, "mod.modcamerafocusdeath", "modcamerafocusdeathdirty") inst:DoTaskInTime(0, DeathFocusInit) end for k, v in pairs(focustime) do AddPrefabPostInit(k, DeathFocus) end
  4. Say your character prefab is "walton", then you would go like: local emotesay = { walton = { research = "Yay", -- /joy emoteXL_annoyed = "Ugh", -- /no }, } local function EmoteReact(inst, data) if data then local saytable = emotesay[inst.prefab] if saytable then local saying = saytable[data.anim] if saying and inst.components.talker then inst.components.talker:Say(saying) end end end end AddPlayerPostInit(function(inst) inst:ListenForEvent("emote", EmoteReact) end) Since you said "characters" (plural) in your main post, I made it so anybody with data on the table would have the strings. This way not only you can make a table to include many mod characters all in one, you can also include the official characters as well. It's a general solution that you can modify to suit your needs. It goes on modmain, because it makes use of AddPlayerPostInit. You can even make "character specific" code for your prefab file like this: local saytable = { research = "Yay", -- /joy emoteXL_annoyed = "Ugh", -- /no } local function EmoteReact(inst, data) if data then local saying = saytable[data.anim] if saying and inst.components.talker then inst.components.talker:Say(saying) end end end -- inside your master_postinit function local function master_postinit(inst) inst:ListenForEvent("emote", EmoteReact) end You skip the prefab checks (since it's just for your character) and just react to the emote animations.
  5. Well, just because something is unloaded doesn't mean it doesn't consume resources. It depends on the implementation. Sometimes the world pushes events to the asleep entities (beyond awaking them) and they react, or sometimes they have tasks that keep running in the background (beefalo domestication task). Tumbleweeds get events pushed to them (although they don't completely react to them because they have a guard for when they are asleep). You are correct in thinking that the heavy wind calculations aren't done (since they are performed in the OnUpdate method of the blowinwind component, and that gets paused when the tumbleweed unloads). However, I was just thinking of just having them exist. Like flowers. And having lag spikes when suddenly loading 100 tumbleweeds in one corner of the desert (where they do demand the wind calculation).
  6. local emotesay = { wilson = { research = "Yay", -- /joy emoteXL_annoyed = "Ugh", -- /no }, willow = { research = "Fire", -- /joy emoteXL_annoyed = "Water", -- /no }, } local function EmoteReact(inst, data) if data then local saytable = emotesay[inst.prefab] if saytable then local saying = saytable[data.anim] if saying and inst.components.talker then inst.components.talker:Say(saying) end end end end AddPlayerPostInit(function(inst) inst:ListenForEvent("emote", EmoteReact) end) You can see the rest of animations at emotes.lua.
  7. local function onmatured(inst) inst.SoundEmitter:PlaySound("dontstarve/common/farm_harvestable") inst.AnimState:OverrideSymbol("swap_grown", inst.components.crop.product_prefab,inst.components.crop.product_prefab.."01") end Game tries to put the "food01" symbol of "food" build to replace "swap_grown" of the farm crop. For the food, you have a folder with the food frames and a spriter project. Is the food frames folder (the symbol name) named "food01"? If not, then it's invisible. You don't need code hacks for farms when you can just use the correct names. For the drying rack you need additional hacks because game calls inst.AnimState:OverrideSymbol("swap_dried", "meat_rack_food", product) and you can't append your stuff to the meat_rack_food zip. What those mods do (maybe) is overwrite the onstartdrying and ondonedrying functions of the drying rack to use the correct builds. AddPrefabPostInit("meatrack", function(inst) if inst.components.dryer then local _onstartdrying = inst.components.dryer.onstartdrying local _ondonedrying = inst.components.dryer.ondonedrying local function onstartdrying(inst, ingredient) _onstartdrying(inst, ingredient) if ingredient and ingredient.prefab == "mything" then inst.AnimState:OverrideSymbol("swap_dried", "mythingbuild", "mythingsymbol") end end local function ondonedrying(inst, product) _ondonedrying(inst, product) if product and product.prefab == "mything" then inst.AnimState:OverrideSymbol("swap_dried", "mythingbuild", "mythingsymbol") end end inst.components.dryer:SetStartDryingFn(onstartdrying) inst.components.dryer:SetDoneDryingFn(ondonedrying) end end) So you can make the rack call the correct builds and symbols.
  8. Currently, when you do "/wave", you get the animation "emoteXL_waving3" or "emoteXL_waving4". You also have random animations for "/sit" and "/squat". It is annoying to make "/wave" until you get the expression you want, and the same applies to the others. Consider including emotes (like "/wave1", "/wave2", "/sit1", "/sit2") that correspond to a unique animation.
  9. Intended to be faster than you. They are supposed to gobble everything near you while you despair. You can chase them until dusk arrives and they go away. You can chase them to run over tooth traps. You can lure them with berries to kill them when they approach. Or red caps so they die from food damage. Go near them during the nightmare phase of the ruins, now you can kite them as always. Bonus points if you lure in depth worms or bunnymen for the best loot party ever. Remember to not get in range of several shadow monkeys or you risk getting overwhelmed. Boomerang. Fire staff. Ice staff. Weather pain. Any of the darts. Enough to hit the animal once and trigger his wrath onto you. No need for mindless chasing into the edge of the map. On average, you are slightly faster than them (6 run speed versus 5 average tumble speed). The speed can vary between 2.5 and 7.5 speed. It also changes for every clock segment. I never had an issue with tumbleweeds. Just click them once and watch Wilson eventually catch up. All working as intended. Maybe tumbleweeds should be looked into. Not so much for balance or farming, but for server health. If they spawn and nobody picks them up, they end up on the edge of the desert, consuming CPU resources doing nothing, just bouncing on the edge of the world while also demanding speed recalculations. Can't say I experienced tumbleweed lag though, I always pick them up when I enter the desert.
  10. You can nuke those components via replacing them with your mod with files with empty classes. e.g mymod/scripts/components/desolationspawner.lua: return Class(function(self, inst) self.inst = inst end) Or you can nuke the constructors from modmain: GLOBAL.require("components/desolationspawner")._ctor = function() end GLOBAL.require("components/regrowthmanager")._ctor = function() end Since the components aren't referenced anywhere beyond AddComponent functions, you are good to go.
  11. Hope all is well.

    You were a large driving force to get me to spew code out in the Mods and Tools subforum before you could do the same.

     

    1. DarkXero

      DarkXero

      All is well.

      Thank you for your kind words.

  12. Hello DarkXero,

        Long time no see. Here I need your generous help again.

        Since the cave edition of DST was officially published, the mod of World Regrowth didn't work for this edition to make the cave resouces respawnable. I have tried and tried with no result. Would you please help me? Much appreciate!

    Sincerely Yours,

    Jupiters

    World Regrowth.zip

  13. Very nice. The beefalo bugs were fixed, and the domesticatable component is more robust. I have seen way less instances of domestication loss ticks. The beefalo doesn't go feral as fast as before, which is nice. However, a few of them are still there. I write the test process again. 1) Pick character 2) c_give("dragonpie", 2) 3) c_spawn("saltlick") 4) c_spawn("beefalo") 5) Give dragonpies to beefalo 6) Run away from beefalo, about a screen and a half (so the greetings and begs don't get in the way) 7) c_godmode() 8) c_speedup() Those pies should give around 2.5% of domestication. Now wait 5, or 10 days or until the salt lick runs out. Go for a coffee. If everything went fine, then no decay should be observable. You can also pen the beefalo in a very tiny cage instead of letting it wander and it will sometimes lose domestication.
  14. I went to test the beefalo changes. With the sleeping and entity asleep changes, most problems were addressed. Beefalo won't lose domestication while asleep, and the extra range helps them lick the salt while off-screen. This is pretty good for people that go caving. However, there's still a problem, easy to see. 1) Spawn beefalo. 2) Spawn salt lick. 3) Give the beefalo a dragonpie, some twigs. 4) Give yourself V2C mode (godmode). 5) Stand a screen away from the salt lick (so the beefalo won't run to greet you, but it's awake). 6) c_select() the beefalo, c_speedup() the game. 7) You will see 99.9% of the time the (nodecay) tag. What happens on the 0.01% of the time? The beefalo needs to salt itself again. But it's far from the salt lick, the distance needed is 4, instead of 15. So it needs to walk to it. If it takes too long, you can get a domestication loss tick in there. Why could this happen? It wandered too far from the lick, because of its brain, or because it went to greet you and spent some extra seconds on alarm state or beg state. So basically, solitary bases are fine. Bases with people running around may find their beefalo go feral without notice. Also these weren't fixed. I updated the reports with possible solutions. On a more happy note, the twiggy trees have the perfect ornament distribution out of all the Winter's Feast trees.
  15. Don't redeem it if you aren't on the beta. Game will crash, and you will get a blank thingy on the Steam inventory. Oops. Well, if anybody commits the same mistake, don't worry, you got it. It will appear later. Probably. You can only use it on the beta branch, as of now.