• Content Count

  • Joined

  • Last visited

Community Reputation

4146 Excellent

About CarlZalph



Recent Profile Visitors

13144 profile views
  1. Any mods? I know that there are a few ways to cause that to happen with invalid texture data or manipulating userdata's __index fields improperly.
  2. You'll probably have to prepend "GLOBAL." before those types of constants. GLOBAL.CHARACTER_INGREDIENT.HEALTH, etc.
  3. It's bad form to copy-paste functions when all your mod is doing is adding functionality, you kill all other mods' functionality and forces you to update your mod if Klei makes any changes to the copied bit. This is a prehook and it'll give a flat rate of +5 sanity for flowers. If you want to say double whatever Klei does, then record the value of sanity before the old function is called and delta the after value to see how much it increases baseline, then double it. AddPrefabPostInit( "flower", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local pickable = inst.components.pickable if not pickable then return end local onpickedfn_old = pickable.onpickedfn pickable.onpickedfn = function(inst, picker, ...) local rets = {} if picker and picker:HasTag("winnie") -- I prefer actually checking character prefab over tags, tags are limited in how many may exist on one entity: picker.prefab == "winnie" then if picker.components.sanity then picker.components.sanity:DoDelta(5) end end if onpickedfn_old then rets = {onpickedfn_old(inst, picker, ...)} end return GLOBAL.unpack(rets) end end ) You also left off the `GLOBAL.TheWorld.ismastersim` check which is required when you're touching components. Components exist on the server, and clients sometimes get replicated versions of them which house minimal information.
  4. They are, and a lot of footage was scanned frame by frame to deduce some AI timings. Not perfect, but good enough.
  5. LUA makes no distinction with numbers for DST as it's using a slightly modified version 5.1 base and as such all number types are stored as 64-bit doubles. But yeah, I wasn't sure if you were asking for printing things out to the user or for internal use, the code I provided was just an example with some prints. The thing you have made there will round down to the nearest 0.1 for the final product. But for printing this in a string to the user anywhere, you'd want to still use the "%0.1f" formatted printing.
  6. Internally LUA floats follow IEEE-754's specification for floating point. For displaying a float, I'd suggest using formatting parameters that you can get with string.format: for i=0,2400,100 do local percent = i / 2400 * 100 print(percent, string.format("%.0f", percent), math.floor(percent)) end Output: 0.0 0 0 4.1666666666667 4 4 8.3333333333333 8 8 12.5 12 12 16.666666666667 17 16 20.833333333333 21 20 25.0 25 25 29.166666666667 29 29 33.333333333333 33 33 37.5 38 37 41.666666666667 42 41 45.833333333333 46 45 50.0 50 50 54.166666666667 54 54 58.333333333333 58 58 62.5 62 62 66.666666666667 67 66 70.833333333333 71 70 75.0 75 75 79.166666666667 79 79 83.333333333333 83 83 87.5 88 87 91.666666666667 92 91 95.833333333333 96 95 100.0 100 100 Note that the first column is default float printing, second is using rounding but not affecting the value used, and the last is rounding down always. If you want just one extra decimal point you can use "%.1f" for the format parameter. More on parameters for string.format: I'd advise to only use this for displaying purposes and for all logic to use the actual float without any rounding/truncation. But there are cases where this behaviour is desired, so apply to your use case.
  7. It feels weird having a 3 year old mod get deprecated by it being integrated into the base game.

    1. ShadowDuelist


      I'd take it as a recognizing from the devs that the mod was so good that it had to be a part of the game.

  8. It looks like your morgue either got corrupted, or some assumption made from Klei when they updated it to make it not backwards-compatible with an old one. Try deleting the file located at: ~/Documents/Klei/DoNotStarveTogether/####/client_save/morgue
  9. In the meantime~ Lightning/any flashing: Insanity: Colour cubes and other post processing:
  10. function c_makeinvisible() local player = ConsoleCommandPlayer() player:AddTag("debugnoattack") print("Has debugnoattack tag?", player, player:HasTag("debugnoattack")) end From the files. I haven't checked how far reaching debugnoattack tag has, so there might be other side effects that this introduces.
  11. Whenever I play Wortox I always have too many souls and go over to the nearest player and plop down 3-4 so I don't explode and lose sanity.
  12. Careful about confirmation bias. 35 players is a rather small sample to use against a snapshot of the entire playerbase. For example, I just did a snapshot at 10:13AM EST and it contains 21416 players in its player counts. Of that only 58 players chose wes. Unformatted blurb: Likewise take note that of those players 16956 of them were vanilla prefabs and not a modded character (3866) or still pending to select one (595). While there are many factors that go into play when one should consider about which character needs rebalanced or reworked, popularity is one such facet. No one likes to play characters that are too demanding in upkeep, too hard mechanically, etc versus the payout. Take Wendy for example: With Abigail's rework and tuned values she negates the combat aspect of the game pretty much entirely for the average user. Her popularity is #1 and has been so since this rework, sans Walter's release for the new character hype train, trumping even the old Queen Wigfrid. (Aside: This sample taken at this time has more of a bias to the China region than US+EU, China still favours Wigfrid a _lot_, bumping up her numbers right now. Taken at ~5PM EST and Wendy's numbers shoot up even more from US+EU, it's periodic.) See outputs for:
  13. From my tests the gift drops happen at a random interval between [6, 12] 6-minute intervals. So some time between 36 and 1h12m, but always on a 6-minute partition assuming the client is playing continuously, for all weekly in-game drops.
  14. I haven't really played Warly much due to my lack of knowledge on the recipes in the game. I know you can suit his food needs by stuffing him with two meaty stews every 2 days and be fine, but I think that sort of ruins his theme. If meatballs/stew were nerfed, then that would ultimately push towards people to learn the other recipes. Too much imbalance and it'll promote another 'king' food that everyone makes and neglects the rest. But I think most of this lies with the current state of farming. If it were more gorge-like, then I feel people wouldn't mind putting more variety into their dishes. As it stands those ingredients are too time consuming to obtain for the payoff, especially when considering other food generating sources like bunnymen farms. Also I saw these in my local grocer the other day: Perhaps leafy meat could make these? Nothing like the taste of a meatless meatball. Hmm, 'meat' as a word looks weird to me now.
  15. @Scrumch I assume this feather stage is important and networked, so it should be done via a networked variable. The function GetBuild from the AnimState should be called via: AnimState:GetBuild() If the variable isn't needing to be networked, then you could get away with storing it onto the player reference itself via: playerinst.featherstage = # Ensure to save this variable in the OnSave and OnLoad callbacks, see Klei code for other prefabs for that. The hotkey would be able to interface with both of these methods because both of these variables should be on the local player instance. However, I'd recommend attaching the hotkey to an RPC call if something special is supposed to happen on the server-side. Further I'd study Woodie's prefab the most. It has pretty much everything you'd need to get this up and running.