Maris

  • Content count

    916
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Maris

  1. Hello all. I have a few interesting lines of code in my mod Show Me: local MAIN_VAR_NAME = 'net_ShowMe_chest'; local NETVAR_NAME = 'ShowMe_chest'; local EVENT_NAME = 'ShowMe_chest_dirty'; I use these constants in the code. But recently I decided to change values a little. And the hell began... Case 1: local MAIN_VAR_NAME = 'net_ShowMe_chest1'; local NETVAR_NAME = 'ShowMe_chest1'; local EVENT_NAME = 'ShowMe_chest_dirty1'; Looks fine, but I have many mods installed and somehow it causes a crash (mouseover on Crock Pot and may be other actions): [string "scripts/componentactions.lua':535: attempt to inder a nil value LUA ERROR stack traceback: scripts/componentactions.lua:1535 in (method) CollectActions (Lua) <1521-1547> scripts/components/playeractionpicker.lua:102 in (method) GetSceneActions (Lua) <99-124> scripts/components/playeractionpicker.lua:249 in (method) GetLeftClickAction (Lua) <202-273>7 scripts/components/playeractionpicker.lua:388 in (method) DoGetMouseActions (Lua) <338-392> scripts/components/playecontroller.lua:1895 in (method) OnUpdate (Lua) <1758 2177> scripts/update.lua:202 in () ? (Lua) <159-238> or [00:04:34]: [string "scripts/componentactions.lua"]:1535: attempt to index a nil value LUA ERROR stack traceback: scripts/componentactions.lua:1535 in (method) CollectActions (Lua) <1521-1547> self (valid:true) = People was sending me their crash reports and I was not able to understand what's wrong. It was very long quest to figure out that exact these changes are the reason of the crash. And I was surprised. But OK, I changed it a bit more and the crash has left: local MAIN_VAR_NAME = 'net_ShowMe_chst'; local NETVAR_NAME = 'ShowMe_chst'; local EVENT_NAME = 'ShowMe_chst_dirty'; I still can't belive that such fix can help. But this is real. Also I noticed that my feature (highlighted chests) stop working for Crock Pot. So this not real fix. Later crash came back for these valuse. Step to reproduce: 1) Install mods: Show Me (change vars to these valuse), Smarter Crock Pot, Quick Drop. 2) Start a game with caves. 3) Put a berrie in a Crock Pot. 4) Mouse over the Crock Pot. I'm not sure if you can reproduce crash too. But it worked for me on my computer. It was the same crash with action components. I decided that's easy to find a place with error step by step. So I started from simplest mod - Quick Drop. I removed many pieces of code and each time I started the game and got crash again. Then I removed ALL the code from Quick Drop and... got crash again. What? Really. I started thinking that I'm going crazy. Let's take a closer look. There is an EMPTY mod that causes the crash. Let's check again. 1) If I turn the mod off, there is no crash (with mods Show Me + Smarter Crock Pot). If I turn mod on, crash appears. 2) Okay, may be I mixed files or mods. I added to modmain.lua a line print("Hello from Star!") - and I found it both in the server log and in the client! So exact empty mod causing the crash. 3) Okay, may be I'm missing something... Secret symbols in modinfo or whatever. I removed ALL files and subfolders and created modinfo and modmain from scratch (keeping only version number to prevent updating). But everything other was not the same, even mod name. But mod still caused the crash. 4) Okay, I disabled mod; Quit the DST; Renamed folder of the mod. Started the DST. Enabled the mod (with the same name but in another folder). And now don't cause the crash. Finally! But what is was? The crash depends on folder name? Really? Note that AddComponentAction is not used in all of these three mods. So it's very strange why crash is about components. I decided to play with var names again and it helped: local MAIN_VAR_NAME = 'net_ShowMe_cht'; local NETVAR_NAME = 'ShowMe_cht'; local EVENT_NAME = 'ShowMe_cht_dirty'; No! No no no no... Not again! I don't believe that! Why it helped? How it may help? I just renamed some constants in the mod. Looks quite easy. If you got a crash, rename a constant. That's it! Really? But the issue has not gone. I know that it's still there. Because my feature is still not working for Crock Pot. My feature should highlight Crock Pot if there is berrie in Crock Pot AND in cursor of the player. Let's make a trick. Rename the constants to initial values: local MAIN_VAR_NAME = 'net_ShowMe_chest'; local NETVAR_NAME = 'ShowMe_chest'; local EVENT_NAME = 'ShowMe_chest_dirty'; Tada! Now all works fine. My feature works again. No crash, no conflicts (possibly). But can someone explain to me what is going on here? Why simple renaming of netvars cause such issues? Sadly, this is not the end of story because I keep receiving messages about crashes from other people. I think such bugs should be explained so other modders can solve them. I hope you can help me. May be it's time to summon devs, I'm not sure.
  2. http://cpp.sh/7hh2x I don't think so, because I tried different names. For example: local NETVAR_NAME = 'ShowMh_xz1d'; -- hash = 3921860124 (very high), causes crash If I change one or two characters closer to the end of the name, the hash will also be high. And there will also be a crash. But: local NETVAR_NAME = 'a1'; -- hash = 6363152 (very small), all ok, even feature works. It seems like a higher hash could cause a crash. Still testing with those three mods.
  3. Make a new Crock Pot recipe for you custom dish: 0.5 meat + 0.5 veggie with low priority (to not break high level dishes). Then use this dish in crafting recipe.
  4. Probably you are trying to spawn an item only on client (if you use dedicated server or world with caves). Before pressing Enter check if console has "Remote" mark. You may toggle it by pressing Ctrl key. It's easy to check if an item is on client side only: If you hover the mouse over it, there is no item name If you restart server, an item disappears.
  5. In ShowMe there already is a method to catch the change. It was made few years ago. And it's described on API page of the mod. I was going to suggest a such method. I mean function FoodValuesChanger. That's why I'm talking about patching characters.
  6. Even if you are making a food item, you MAY patch any character (including mod characters). All you need is prefab name of that character. So you can create AddPrefabPostInit initialization in modmain.lua. Are you interested in this method?
  7. I hope so! But I'm not sure if he can reproduce it. It mystically appears and disappears while I change the code.
  8. I told that API functions may work different depending on the moment you use them. It's not about client/server or master/slave. It's about API functions in general, e.g. TheSomething:WhateverFn() So my suggestion is to try to cache it if you found right moment to get true value.
  9. What do you mean by saying "always"? Always in PrefabPostInit function? Where? Try to check it in root of modmain and if you like those values, cache it in local vars. I'm not sure if it will help, but try.
  10. Put this code in the root of modmain. It won't work in many functions and won't work in root of prefab and component files but in root of modmain it works perfectly. Then you may use constnts in any functions. local TheNet = GLOBAL.TheNet local SERVER_SIDE, DEDICATED_SIDE, CLIENT_SIDE, ONLY_CLIENT_SIDE if TheNet:GetIsServer() then SERVER_SIDE = true if TheNet:IsDedicated() then --Dont use GetServerIsDedicated cos it tells only about existence of --dedicated server in game session, and not about current computer. DEDICATED_SIDE = true else CLIENT_SIDE = true --Solution for "ismastersim" issue. <------- You are welcome, Serp! ;) --Use only for net vars but not with "return" operator. end elseif TheNet:GetIsClient() then SERVER_SIDE = false CLIENT_SIDE = true ONLY_CLIENT_SIDE = true end --If you are not in the game, e.g. on main menu, SERVER_SIDE will be nil. Many other common issues I fixed in mod "Top Mod". So you can add to your mod dependency or just copypaste what you need. Example of using for net vars (from my mod): AddPrefabPostInit("player_classified",function(inst) inst.showme_hint = "" inst.net_showme_hint = _G.net_string(inst.GUID, "showme_hint", "showme_hint_dirty") if CLIENT_SIDE then inst:ListenForEvent("showme_hint_dirty",function(inst) inst.showme_hint = inst.net_showme_hint:value() end) end end)
  11. No need to make custom tags if you need tags only on server. Tags are networked. And if you don't use it, it's just useless usage of network traffic and CPU for sending packets. Just use inst.mytag=true and that's it.
  12. Thanks all! I found the bug. I think it was network variable name hash collision or something like that. Yes No. Too complicated. And I'm not sure if it's relevant info because I'm new to the new DST update. True. Prevuios version helped. Sadly that was too early version but enough to find bugged piece of code step by step.
  13. Hello! Recently I updated my mod (Show Me), and now it cause crash for some players. It's strange because logs says that it is different mod. https://pastebin.com/fhNN59QR https://pastebin.com/ykPLeF5g https://pastebin.com/MZDR2Tpa I'm trying to figure out what's going on and how my mod affect another mod. When I test both, all is fine for me, so I can't reproduce the crash. But people keep sending me crash reports. I even tried to use all mods (mostly client mods) that they have, but without crash.
  14. Version 1.11

    16,598 downloads

    Shows exact health of creatures on "inspect" action. (Steam link).
  15. Mini Sign does not support items from mods.
  16. Happy New Year! I wish less bugs in next year.
  17. In modindex.lua you have: function ModIndex:InitializeModInfo(modname) local env = {} Change it please to: function ModIndex:InitializeModInfoEnv() return {} end function ModIndex:InitializeModInfo(modname) local env = self:InitializeModInfoEnv() Thanks in advance.
  18. World Host Mod Crash

    You could add global prefabs = {} I guess
  19. recipe.lua

    self.level = level or 0 self.level.ANCIENT = self.level.ANCIENT or 0 Why 0? It's a table, isn't it?
  20. Some food mods may be incompatible. FIX: Jump implement this into the game please. Thanks in advance:
  21. Finally! Also add icons for mushrooms please.
  22. No updates for long time. Something big is coming?