Bigfootmech

  • Content Count

    75
  • Joined

  • Last visited

Community Reputation

21 Excellent

About Bigfootmech

  • Rank
    Junior Member
...

Recent Profile Visitors

208 profile views
  1. From looking at the code... maybe: inst.tendency From scripts/prefabs/beefalo.lua:482 local function SetTendency(inst, changedomestication) -- tendency is locked in after we become domesticated local tendencychanged = false local oldtendency = inst.tendency And scripts/prefabs/beefalo.lua:306 if not inst.components.domesticatable:IsDomesticated() or not inst.tendency == TENDENCY.ORNERY then And scripts/prefabs/beefalo.lua:1022 inst.tendency = TENDENCY.DEFAULT try and see what <BEEFALO>.inst.tendency looks like. Alternatvely, scripts/prefabs/beefalo.lua:623 inst.components.domesticatable:DeltaTendency(TENDENCY.PUDGY, TUNING.BEEFALO_PUDGY_WELLFED * -data.delta) inst.components.domesticatable = scripts/components/domesticatable.lua scripts/components/domesticatable.lua:30 self.tendencies = {} Try to see what <BEEFALO>.inst.components.domesticatable.tendencies looks like. If this doesn't work, maybe try to find how much damage the beefalo can do, as that would encode for its tendency https://dontstarve.fandom.com/wiki/Beefalo Finally, I don't think either the Beefalo Widget, or Easy Domesticate mods show this. But they might put you on the right track / give you more code to play with.
  2. Ok, so new-ish to mid level player then I'm not so sure about that. For Moon Dial: The phases of the moon are simple to predict. Day 1, 21, 41, 61, 81... it's new moon. And day 11, 31, 51, 71, 91... it's full moon. Even seasons are ok after you pay a little attention. Day%70 == 1-20 = Autumn, 16-35 = winter, 36-55 = spring, 56-70 = summer. % is the modulo operator (also known as "remainder") The trouble with the "Moon Dial", is that: newer players can't figure out how to make the recipe. And are dying starving. The new-to-mid-skilled players value the gems (and moonstone) too much to "waste" them. Vs making the celestial portal, or icebox chester. The higher skill players can already do the head-maths. So there's kinda no point. And only post-endgame (600-1000+hrs) does it come back in use as decoration in megabases. Also, These two have nothing to do with each other. Cartographer's desk is for sharing explored map between players. (which, along with flares, compasses, ocuvigil... etc kinda loses its purpose with the Global Position server mod. I've seen people usually start using the non-mod ones somewhere like 1000-3000h game time.) Minimap hud is so that you don't have to use map flashing (hitting M twice really fast, while mouse moving). Or that you can see the road in winter >.< Finally, Minimap Hud and Combined Status are fairly popular mods. I personally don't want to upset most of the player base. So I don't want to spend my time and effort, so that I can screw myself over, by helping you ban people. If you get what I'm saying.
  3. Shouldn't be too hard. components/sanity.lua:459 self.rate = self.rate + self.custom_rate_fn(self.inst, dt) The function gets "inst" passed, which is probably either the player, or the sanity component itself. Copying part of the light delta But accounting for the fact that normal lunacy light delta would have already been applied. Also, paying attention to the fact that caves lunacy is always 0? And we're only tweaking the Lunar island one as far as I can tell. So maybe something like local function CustomDrainFunc(self, dt) -- assuming self is the sanity component. If it's the player, replace self with self.components.sanity, or self.inst.replica.sanity?? if not self.light_drain_immune TheWorld.state.isday and not TheWorld:HasTag("cave") and self.mode == SANITY_MODE_LUNACY then local myNewLuncayRedo = - TUNING.SANITY_DAY_GAIN + TUNING.SANITY_DAY_GAIN * mySecretMultiplier -- normal lunacy already applied. Remove it, and then reapply with multiplier. local myNewLunacyAdjust = TUNING.SANITY_DAY_GAIN * mySecretMultiplier -- value to be added to existing lunacy, to save a bit of calculation, but makes it look more confusing in code. return myNewLuncay else return 0 end end
  4. [00:00:55]: [string "scripts/util.lua"]:940: attempt to perform arithmetic on local 'index' (a nil value) In file: scripts/util.lua line: 940 tried to do something like: a = index + b but: index is nil (hasn't been set yet) If this isn't super clear, I also found a similar article on stackoverflow after a quick DuckDuckGO search https://stackoverflow.com/questions/32001268/lua-attempt-to-perform-arithmetic-on-global-mapfinishes-a-nil-value
  5. In components/sanity.lua I think Sanity:OnUpdate (336) is the main update function. This calls Sanity:Recalc(dt) (386) This is the part that calculates the light delta local light_sanity_drain = LIGHT_SANITY_DRAINS[self.mode] local light_delta = 0 if not self.light_drain_immune then if TheWorld.state.isday and not TheWorld:HasTag("cave") then light_delta = light_sanity_drain.DAY else local lightval = CanEntitySeeInDark(self.inst) and .9 or self.inst.LightWatcher:GetLightValue() light_delta = ( (lightval > TUNING.SANITY_HIGH_LIGHT and light_sanity_drain.NIGHT_LIGHT) or (lightval < TUNING.SANITY_LOW_LIGHT and light_sanity_drain.NIGHT_DARK) or light_sanity_drain.NIGHT_DIM ) * self.night_drain_mult end end In components/sanity.lua:364 local LIGHT_SANITY_DRAINS = { [SANITY_MODE_INSANITY] = { DAY = TUNING.SANITY_DAY_GAIN, NIGHT_LIGHT = TUNING.SANITY_NIGHT_LIGHT, NIGHT_DIM = TUNING.SANITY_NIGHT_MID, NIGHT_DARK = TUNING.SANITY_NIGHT_DARK, }, [SANITY_MODE_LUNACY] = { DAY = TUNING.SANITY_LUNACY_DAY_GAIN, NIGHT_LIGHT = TUNING.SANITY_LUNACY_NIGHT_LIGHT, NIGHT_DIM = TUNING.SANITY_LUNACY_NIGHT_MID, NIGHT_DARK = TUNING.SANITY_LUNACY_NIGHT_DARK, }, } In Tuning.lua:1830 SANITY_DAY_GAIN = 0,--100/(day_time*32), SANITY_NIGHT_LIGHT = -100/(night_time*20), SANITY_NIGHT_MID = -100/(night_time*20), SANITY_NIGHT_DARK = -100/(night_time*2), SANITY_LUNACY_DAY_GAIN = 100/(day_time*32), SANITY_LUNACY_NIGHT_LIGHT = 0, SANITY_LUNACY_NIGHT_MID = 0, SANITY_LUNACY_NIGHT_DARK = -100/(night_time*10), As far as I can tell, Lunacy dusk (NIGHT_LIGHT), and night (NIGHT_MID) values are 0. So you can't really multiply them. Also, the "day" light delta (lunacy) has no multiplier in that part of the code. So if you wanted to use a day lunacy "multiplier" or apply dusk/night lunacy to a character, I think you'd have to use components/sanity.lua:456 if self.custom_rate_fn ~= nil then --NOTE: dt param was added for wormwood's custom rate function -- dt shouldn't have been applied to the return value yet self.rate = self.rate + self.custom_rate_fn(self.inst, dt) end As seen with Wormwood/Walter/... etc prefabs/wormwood.lua:607 inst.components.sanity.custom_rate_fn = SanityRateFn prefabs/walter.lua:230 inst.components.sanity.custom_rate_fn = CustomSanityFn And code it (back) in yourself :O Hope this helps!
  6. [00:00:44]: [string "../mods/W.popli/modmain.lua"]:44: attempt to index field 'W' (a nil value) file: <DST INSTALL FOLDER>/mods/W.popli/modmain.lua line: 44 tried to W.accessSomething but W is nil
  7. forumthread = "" Copied from CarlZalph's Sanity Volume Limiter :) https://steamcommunity.com/sharedfiles/filedetails/?id=882610849
  8. > I would assume this would get rid of the widget You should be able to. Especially with "hooking" > Also this is for a server mod, so it should work for every player. Only if you set "all clients require" The 2 settings are: - Client-only - All-clients-require if: Client only = true. Then: only runs on client (not server) if: Client only = false and all clients require = false Then: Only runs on server (not any clients) if: Client only = false and all clients require = true Then: Runs on server and ALL clients (but must be downloaded, or available on Steam Workshop) Tbh, I think this might be the issue. Get back to me if it's something else.
  9. > and furthermore how to restrict the toll to nighttime? Wendy has this. inst.components.sanity.night_drain_mult = TUNING.WENDY_SANITY_MULT You can set it to whatever you like. 1 = "normal" 0.75 = "25% less" 0 = none -1 = "gain what you would normally lose" > Oh and also! @Bigfootmech, you wouldn't happen to have any idea how t0 modify walters gain to a toll? The bit claims the gain = 0 as in; Hmm. This would make me think it's modified somewhere else. prefabs/Walter.lua:230 (part of master_postinit in prefabs/Walter.lua:223) inst.components.sanity.custom_rate_fn = CustomSanityFn This looks about right/suspicious. (note: this is "functional programming" in case you wanna google more) prefabs/Walter.lua:90 local function CustomSanityFn(inst, dt) local health_drain = (1 - inst.components.health:GetPercentWithPenalty()) * TUNING.WALTER_SANITY_HEALTH_DRAIN * inst._sanity_damage_protection:Get() return inst._tree_sanity_gain - health_drain end so tree sanity gain - calculated health drain. Where is tree sanity gain modified.done? prefabs/Walter.lua:84 local function UpdateTreeSanityGain(inst) local x, y, z = inst.Transform:GetWorldPosition() local num_trees = #TheSim:FindEntities(x, y, z, TUNING.WALTER_TREE_SANITY_RADIUS, REQUIRED_TREE_TAGS, EXCLUDE_TREE_TAGS) inst._tree_sanity_gain = num_trees >= TUNING.WALTER_TREE_SANITY_THRESHOLD and TUNING.WALTER_TREE_SANITY_BONUS or 0 end Specifically: prefabs/Walter.lua:87 inst._tree_sanity_gain = num_trees >= TUNING.WALTER_TREE_SANITY_THRESHOLD and TUNING.WALTER_TREE_SANITY_BONUS or 0 Which says: Set "tree stanity gain" to: if there are enough trees (TUNING.WALTER_TREE_SANITY_THRESHOLD), then to "Walter's Forest Sanity Gain" (TUNING.WALTER_TREE_SANITY_BONUS) otherwise, 0 This is because of Lua's looser assigning / syntactic sugar. Hope this helps :)
  10. In the Tutorials and guides section https://forums.kleientertainment.com/forums/forum/247-tutorials-and-guides/page/2/ there's this one, if it helps:
  11. Search is your friend :). Though I do get it's awkward sometimes
  12. The second one sounds a bit like the inverse of Walter's perk (sanity gain near a bunch of trees) The first one... I'm not too sure. Check scripts/worldtiledefs.lua and see if is_shoreline = true is something you're looking for.
  13. Agree to disagree :p Yes, I agree to non-hacking. It would ruin the game for everybody. But your argument doesn't make much sense to me in the context of "doing your best to not miss client-to-client messages while going to/from caves". Or "showing food hunger satisfying values for the client, so you don't have to have the wiki page open" But I also don't want to change your mind at all costs :p So I'm happy to cut it here
  14. The point of the client and server is: having something rather than nothing. For example: The Show Me and Insight mods do show a LOT of things. But aren't available at all if you're gonna go on a Klei official server Even though some of the things would be doable only client-side The same way, for the Chat History stuff - it's great if you're headed in to a mod friendly server, that already has it. But if not, I wanna create an option for the user, that they can have at least something. Because (incomplete) chat logs do exist client-side. I tend to play a lot of unmodded though, so maybe that's just my take on things