• Content Count

  • Joined

  • Last visited

Community Reputation

236 Excellent


About squeek

  • Rank
    Senior Member


Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @SyntaxError01 this is not compatible with Don't Starve Together. Use http://steamcommunity.com/sharedfiles/filedetails/?id=345692228 for DST.
  2. Very true. To be clear, Minecraft has no autodownloading features at all for mods (mods are all third-party, there is no official modding API, and there is no singular trusted host for mods). I think I really bungled up my post back there, and I take it all back. Adding support for autosyncing mods uploaded to these forums would indeed be nice.
  3. @Silentdarkness1, for mods not on the Workshop, clients would just need to sync their mods with the server before joining it. Note that this is how Minecraft handles things to this day and it seems to do alright in terms of modding. It's convenience-based functionality you're talking about, not core functionality. Everything will still work fine if mods are not on the Workshop; it'll just be less convenient for clients, as they'll have to manually download/install the mods that the server is using in order to be able to join it (hence the rise of modpacks within Minecraft modding).
  4. Nice work. Added to the The Big List Of Mod-Related Code Suggestions.
  5. G) See LocoMotor:UpdateGroundSpeedMultiplier in components/locomotor.lua. Changing the player's locomotor component's slowmultiplier variable to 1 should remove the slowness on creep (webs). E) AddPrefabPostInit. See the API Examples mod.
  6. Why not study game files? A) see components/kramped.lua B) see components/builder.lua's DoBuild function. You can listen for the "builditem" or "buildstructure" event on the player, or, if it's a custom item that's being crafted, you can use the OnBuilt function of the prefab. C) STRINGS.PIG_TALK_FOLLOWWILSON = {"Changed strings"} D) see stategraphs/SGwilson.lua's "frozen" state
  7. Yes, as I was trying to get at, there's no way to make a 'template' function for overriding tuning variables. They are all used in different ways, so you have to figure out how they are used in order to make sure that your change will have the intended effect. The timeout variable is specific to the autosaver component. Most of the TUNING.*_TIME variables are used in components/clock.lua, but SEG_TIME is used all over the place.To properly change the total day time, you'll have to overwrite all variables that depend on it. A very basic start would be: local function MultiplyTuningVariableBy(keypath, multiplier) assert(type(keypath) == "string") -- table.getfield and table.setfield are non-standard functions defined in util.lua -- they allow for getting and setting child keys using a string -- table.getfield(tbl, "a.b.c") would get the value of tbl["a"]["b"]["c"] local cur_value = table.getfield(TUNING, keypath) if cur_value ~= nil then table.setfield(TUNING, keypath, cur_value*multiplier) endendlocal tuning_variables_affected_by_total_day_length = { "SEG_TIME", "TOTAL_DAY_TIME", "WILSON_HUNGER_RATE", "BLUEAMULET_FUEL", -- etc, there are a ton that would need to be in this table, see tuning.lua}function c_dayspeed(new_day_length) -- get the ratio of new:old day length local day_length_ratio = new_day_length/TUNING.TOTAL_DAY_TIME -- multiply all relevant variables by that ratio for _,keypath in ipairs(tuning_variables_affected_by_total_day_length) do MultiplyTuningVariableBy(keypath, day_length_ratio) endendBut that's only the beginning. You'd now have to go through each and every one of the affected variables and see how it's used and check if you need to do anything further to make sure it'd work properly. For example, you'd probably want to do a dummy call to Clock:SetSegs to force it to update it's variables using the new SEG_TIME value. local clock = GetClock()clock:SetSegs(clock:GetDaySegs(), clock:GetDuskSegs(), clock:GetNightSegs())As you can probably tell, you've chosen a much more difficult task that you might have first thought. Day length was not written to be adjustable on-the-fly, and to allow it to be, you're going to have to modify a whole lot of stuff every time the day length changes.If you don't already, I'd highly suggest using a text editor that has good find-in-files support because that's the best way to find all references to a variable in the Don't Starve code. Something like Notepad++ or Sublime Text would work.
  8. Those values are not actually controlled by the recipe, they are controlled by the prefab (the recipe hunger/health/sanity settings are only used to set the values of the prefab at startup). To modify them, you'd want to use a PrefabPostInit like so: -- in modmain.luaAddPrefabPostInit("powcake", function(inst) inst.components.edible.healthvalue = 0 inst.components.edible.hungervalue = 0 inst.components.edible.sanityvalue = 0end)