Registered Users
  • Content count

  • Joined

  • Last visited

Community Reputation

2,698 Excellent

About DarkXero

  • Rank
    Senior Member


Don't Starve Together
  • Contributor
Oxygen Not Included
  • Alpha Contributor

Recent Profile Visitors

7,571 profile views
  1. Make boomerang. Get morsel from bird/rabbit. Replace monster meat with morsel. Use 3 cooked monster meat for 3 eggs. 1 morsel + 3 eggs = 1 meatballs. HARDCORE tier: no eggs. Go to caves and fish (on lakes that don't freeze down there) or chop mushtrees for 9999 filler mushrooms. ASCENDED GOD tier: no caves. Eat the monster meat cooked, put the rest for jerky, heal with spider glands, recover sanity with tam o' shanter or whatever. Or just use a tent with all that extra silk you get from spiders, it gives health and sanity. Alternatively, play as Wigfrid. I DON'T CARE tier: no monster meat valid recipes. Make moleworm farm and enjoy morsels for days. Or make more boomerang and go smack more birds, since those don't stop coming. FROGGER tier: no meat valid recipes. Play as Webber. I SELL GEARS AND GEARS' ACCESORIES tier: any meat will kill you. Play as WX-78. I INVITED KCDA TO PLAY BUT HE BLOCKED ME tier: Fill a screen with farms and store dragonfruits on them. Also plant saplings for twigs. 1 fruit + 3 twigs = 1 dragonpie. I AM HERE FOR THE SKINS MAN tier: c_godmode()
  2. Cheers for sanity?

    -- Emote for Sanity inst:ListenForEvent("emote", function(inst, data) if inst:HasTag("cheery") then inst.components.sanity:DoDelta(25) inst.components.hunger:DoDelta(-25) for k, v in pairs(AllPlayers) do if v ~= inst and v:IsNear(inst, 16) and v.components.sanity then v.components.sanity:DoDelta(10) end end end end) You can use TheSim:FindEntities and loop through the result, too. But this isn't as expensive. The 16 is the range in units (1 turf = 4 units).
  3. if v.entity == "critter_puppy" then should be if v.prefab == "critter_puppy" then if "critter_puppy" is the name of the prefab of your critter (the name you use to spawn it). elseif v.entity == "player" then should be elseif v:HasTag("player") then because players can have different prefabs like "wilson", or "willow" (or other mod characters). But they all have the player tag.
  4. Well then you didn't replace all instances correctly. I setup my code as local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "character_speed_mod") end local function onbecamehuman(inst) -- Set speed when reviving from ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "character_speed_mod", 2) end local function giveitem(inst) local item = SpawnPrefab("axe") inst.components.inventory:GiveItem(item) end local function OnLoad(inst, data) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) inst:ListenForEvent("ms_respawnedfromghost", giveitem) inst:ListenForEvent("ms_becameghost", giveitem) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) end end local function master_postinit(inst) inst.OnLoad = OnLoad inst.OnNewSpawn = OnLoad end which is what the template would look like. I kill myself and then revive and see I have two axes in my inventory.
  5. local item = SpawnPrefab("friskbandaid") inst.components.inventory:GiveItem(item)
  6. I was right. local function OnKeyPressed(inst, data) if data.inst == ThePlayer then if data.key == KEY_R then if data.inst.HUD and (data.inst.HUD:IsChatInputScreenOpen() or data.inst.HUD:IsConsoleScreenOpen()) then return end if TheWorld.ismastersim then BufferedAction(inst, inst, ACTIONS.DODGE):Do() else SendRPCToServer(RPC.DoWidgetButtonAction, ACTIONS.DODGE.code, inst, ACTIONS.DODGE.mod_name) end end end end
  7. You have to present some context. I can only guess in what kind of spaghetti is this "tiny bit of code" used. My best guess is that you have a key that triggers a transformation and you don't want the console interfering. In that case you want to put that code in the function that sends the transformation RPC (ran by client), not the action itself (ran by server).
  8. @ScottHansen I can replicate the crashing at around the minute 50 mark or snapshot 8. You don't need godmode or anything of the like. What's required is to have either "Command Line Arguments: -threaded_physics -threaded_render" or "use_threaded_renderer = true" in client.ini. So you guys should go revert some of the commits made by @bizziboi. Or announce the render args are deprecated or something. Without threaded render the game doesn't crash... at least for now. And it doesn't look like it will crash anytime soon (after many hours).
  9. Mod Character Help

    local function onpreload(inst, data) if data then if data.maxhealth then inst.components.health:SetMaxHealth(data.maxhealth) end if data.maxhunger then inst.components.hunger:SetMax(data.maxhunger) end end end local function OnSave(inst, data) data.maxhealth = inst.components.health.maxhealth data.maxhunger = inst.components.hunger.max data.healthtosave = inst.components.health.current data.hungertosave = inst.components.hunger.current end local function OnLoad(inst, data) if data then if data.healthtosave then inst.components.health:SetCurrentHealth(data.healthtosave) inst.components.health:ForceUpdateHUD(true) end if data.hungertosave then inst.components.hunger.current = data.hungertosave end end end
  10. Mod Character Help

    You are setting the current health first (preload), and updating your max health later (load). There's a caveat when setting max health using that method, I'm sure you can spot it: function Health:SetMaxHealth(amount) self.maxhealth = amount self.currenthealth = amount self:ForceUpdateHUD(true) --handles capping health at max with penalty end It also happens with hunger too.
  11. The Obligatory Forum Upgrade Thread

    I got the O2 badge but can't remember posting in the subforum. So, uh, there's that to fix. The color palette is the same ol' orange black white, but now there are clear distinctions between different content. It's welcomed. I don't like that the reply box text is light grey (unlike posts), because I have to concentrate to read what I'm currently writing. Overall, the update gets a thumbs up from me. Most important of all: there's a Lua syntax option in the code writing box. And looks like the "Paste" function is broken? Welcome the white void that shall not be deleted.
  12. Mod Character Help

    data.health = inst.components.health.current data.hunger = inst.components.hunger.current This causes the issue. The component data gets saved as "data.hunger = table" for the hunger component. Then we were replacing that table for a number doing "data.hunger = value". Try renaming your stuff from data.health to data.healthtosave and data.hungertosave so there are no name collisions.
  13. Mod Character Help

    You had a wrong OnSave and you ended up saving a table (which made data.hunger.hunger work). Try generating a new world.
  14. Mod Character Help

    You are storing a number value inside the data table with key "hunger". local function onpreload(inst, data) if data then if data.health then inst.components.health:SetCurrentHealth(data.health) end if data.hunger then inst.components.hunger.current = data.hunger end end end With OnLoad and OnSave should be enough though. function EntityScript:SetPersistData(data, newents) if self.OnPreLoad ~= nil then self:OnPreLoad(data, newents) end if data ~= nil then for k, v in pairs(data) do local cmp = self.components[k] if cmp ~= nil and cmp.OnLoad ~= nil then cmp:OnLoad(v, newents) end end end if self.OnLoad ~= nil then self:OnLoad(data, newents) end end FIRST, the entity runs its PreLoad method. SECOND, the entity runs the OnLoad function of its components. THIRD, the entity runs its OnLoad method.