Jump to content

Narrnika

Member
  • Posts

    62
  • Joined

  • Last visited

Profile Information

  • Gender
    Man

Recent Profile Visitors

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

  1. If I understood correctly, function `Rand.NextBool(i)` is equivalent to "chance 1 out i". At the beginning i = 5 is determined, that is, chance 1/5 (is 20%). Next, checked presence of traits `ThickSkinned` and `ThinSkinned` and for each of them, i increases by 10. This is equivalent to a chance of 1/(5+10) = 6%. Thus, an ordinary character, making his way through the forest, has a fairly high chance of being injured. But for a character with the "thin skin" or "thick skin" trait, this chance is equally low.
  2. It looks like damage chance is the same for "Thick/Thin Skinned" traits. It is also very different from the base chance. zombie.characters.IsoGameCharacter: private void damageWhileInTrees() { //... if (Rand.NextBool(i)) { addHole(BloodBodyPartType.FromIndex(j)); i = 5; // basic chance = 1/5 = 0.2 = 20% if (this.Traits.ThickSkinned.isSet()) i += 10; // chance for ThickSkinned = 1/(5+10) = 0.0(6) = 6% if (this.Traits.ThinSkinned.isSet()) i += 10; // chance for ThinSkinned = 1/(5+10) = 0.0(6) = 6% if (Rand.NextBool(i) && (int)getBodyPartClothingDefense(Integer.valueOf(j), false) < 100) { BodyPart bodyPart = getBodyDamage().getBodyParts().get(j); if (Rand.NextBool(i + 10)) { bodyPart.setCut(true, true); } else { bodyPart.setScratched(true, true); } } } }
  3. For the test, create a simple mod with a single lua-file, in which we write the following code (no matter what for - it's just a shortcut to confirm the bug): require "OptionScreens/ModSelector" require "ISUI/ISLabel" local def_create = ModSelector.create function ModSelector:create() def_create(self) self.test = ISLabel:new(0, 0, 17, "test", 1, 1, 1, 1, UIFont.Small, true) self.test:addToUIManager() --self.test:removeFromUIManager() end Such a mod turns on without errors, but if you want to enable something else or disable this mod, the following will happen: ERROR: General , 1610142050060> ExceptionLogger.logException> Exception thrown java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at ArrayList.rangeCheck line:657. ERROR: General , 1610142050061> DebugLogStream.printException> Stack trace: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at zombie.ui.UIManager.update(UIManager.java:765) at zombie.GameWindow.logic(GameWindow.java:246) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71) at zombie.GameWindow.frameStep(GameWindow.java:721) at zombie.GameWindow.run_ez(GameWindow.java:637) at zombie.GameWindow.mainThread(GameWindow.java:464) at java.lang.Thread.run(Thread.java:748) It is important that the error occurs after `Core.ResetLua` function is executed, that is, when our mod is already disabled. In addition, if you look at the function `UIManager.update` in which the error occurs, there are a couple more oddities. In the decompiler, this code looks like this (line numbering is preserved, missing numbers are probably occupied by curly braces): 760: if (Mouse.isLeftReleased()) { 762: n = 0; 763: for (int i1 = UI.size() - 1; i1 >= 0; i1--) { 765: UIElement uIElement = UI.get(i1); Log points to line 765, but we cannot get there at this moment (after restarting Lua). Firstly, because of the condition `Mouse.isLeftReleased()`, and secondly, `UI.size()` at this moment is 0, that is, there should not be a single iteration. Note 1: In test Lua-code has commented line. If you uncomment it (that is, delete the object immediately after creation), then the error does not occur. However, if you use this line directly before calling the `Core.ResetLua` function (for example, in the `ModSelector:onAccept` function), it does not help and the error continues to appear. Note 2: Instead of `ISLabel`, there can be any other UI-element. The problem arises precisely from adding it as a new layer, but not as a child element.
  4. Demonstration in vanilla game: While indoors, start reading the wrong skillbook (less or greater than your current level). The character will say "I don't understand..." or "I already know that...", after which the level of boredom will decrease by 5 points. The error appears due to the use of the function `Say` in client/TimedActions/ISReadABook.lua: 37: self.character:Say(getText("IGUI_PlayerText_DontGet")); 39: self.character:Say(getText("IGUI_PlayerText_TooComplicated")); 41: self.character:Say(getText("IGUI_PlayerText_DontUnderstand")); 53: self.character:Say(getText("IGUI_PlayerText_KnowSkill")); 55: self.character:Say(getText("IGUI_PlayerText_BookObsolete")); Testing this function with additional parameters (in debug console): Player = getSpecificPlayer(0) Player:Say("Test") -- BoredomLevel -5 Player:Say("Test", 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0F, "default") -- BoredomLevel -5 Player:Say("Test", 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0F, "whisper") -- no effect Player:Say("Test", 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0F, "shout") -- BoredomLevel -5 Player:Say("Test", 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0F, "radio") -- no effect The boredom reduction was probably intended for talking to NPCs, but when "talking" to oneself, it looks like a bug. At the same time, it seems rather strange that this happens only indoors - outdoors, boredom changes as usual.
  5. projectzomboid\media\scripts\*.txt https://github.com/FWolfe/Zomboid-Modding-Guide#the-scripts
  6. Try disabling the "Smart Open Mechanics UI" mod for this save. The update has something to do with the mechanic window - possibly conflicted.
  7. If path to mod contains national (no-ascii) characters, then in linux-version this mod is not visible in mod-list, and occurs error like this: WARN : Mod, 1599768637312> ChooseGameInfo.readModInfo> can't find "/home/narrnika/.steam/steam/steamapps/workshop/content/108600/1411032745/mods/Hydrocraft - Traduction Fran??aise/mod.info" LOG : General, 1599768637312> ------------------------------------------------------------- attempted index: getId of non-table: null LOG : General, 1599768637313> ----------------------------------------- STACK TRACE ----------------------------------------- function: populateListBox -- file: ModSelector.lua line # 525 function: onMenuItemMouseDownMainMenu -- file: MainScreen.lua line # 1538 ERROR: General, 1599768637313> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getId of non-table: null at KahluaThread.tableget line:1690. ERROR: General, 1599768637313> DebugLogStream.printException> Stack trace: java.lang.RuntimeException: attempted index: getId of non-table: null at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1690) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:642) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1981) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1783) at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76) at zombie.ui.UIElement.onMouseDown(UIElement.java:993) at zombie.ui.UIElement.onMouseDown(UIElement.java:953) at zombie.ui.UIElement.onMouseDown(UIElement.java:953) at zombie.ui.UIManager.update(UIManager.java:713) at zombie.GameWindow.logic(GameWindow.java:234) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71) at zombie.GameWindow.frameStep(GameWindow.java:708) at zombie.GameWindow.run_ez(GameWindow.java:626) at zombie.GameWindow.mainThread(GameWindow.java:453) at java.lang.Thread.run(Thread.java:748) (actually it is the directory "Hydrocraft - Traduction Fran├žaise") In Steam Workshop are several of these mods and they seem to work without issue in windows. This is not critical, but, IMHO, it is better to do equally - or such paths are acceptable everywhere, or nowhere.
  8. When using functions getFileReader, getFileWriter, getModFileReader, getModFileWriter in lua, national (no-ascii) characters are lost (more precisely, they turn into question marks when writing and into an unprintable character when reading). In the original game (without mods) this is manifested when saving/loading character settings or sandbox settings: Try to read a corrected file: It is not very critical in this particular place, but sometimes creates problems in mods (both when writing and when using). In this regard, the suggestion: if the files are badly read from lua, then read them in java, and transfer a table of strings to lua. And vice versa - transfer to functions a table with strings, which will be written to the file in Java. That is, add something like this: // in addition to getFileReader() @LuaMethod(name = "ReadFileToTable", global = true) public static KahluaTable ReadFileToTable(String param1String, boolean param1Boolean) { ... } // in addition to getModFileReader() @LuaMethod(name = "ReadModFileToTable", global = true) public static KahluaTable ReadModFileToTable(String param1String1, String param1String2, boolean param1Boolean) { ... } // in addition to getFileWriter() @LuaMethod(name = "WriteTableToFile", global = true) public static void WriteTableToFile(KahluaTable param1KahluaTable, String param1String, boolean param1Boolean1, boolean param1Boolean2) { ... } // in addition to getModFileWriter() @LuaMethod(name = "WriteTableToModFile", global = true) public static void WriteTableToModFile(KahluaTable param1KahluaTable, String param1String1, String param1String2, boolean param1Boolean1, boolean param1Boolean2) { ... }
  9. Yes, I would like "favorites" to protect items from accidental destruction (seems this is already implemented for adding fuel)
  10. Build 41.42 Now this error appears regardless of the loading method (continue latest save or load from save's list)
  11. Outdoor temperature: -1.3 Room temperature: 22.0 Temperature inside the car: 3.6 The conditioner in the car is off.
  12. Narrnika

    Menu Bug

    No, the mechanics menu (only it) blocked everything before.
  13. Ok, "ui:drawTextLeft" changed to "ui:drawTextRight". Left to correct the calculation of the X coordinate :-)
  14. 1. Also relevant for other challenges (Storm, Winter, CDDA ...). 2. In the log before the described "STACK TRACE": attempted index: OnInitWorld of non-table: null OnInitWorld() - it's function from scripts of challenges (YouHaveOneDay.lua, AReallyCDDAy.lua, AStormIsComing.lua ...), which are not executed when using "Continue" (see here). 3. Apparently, it's not about the mods - it are here only to force reset lua, which makes the bug more obvious.
  15. Narrnika

    [WIP] more mod tags

    Sounds/Music Adventure/Quests/NPC
×
×
  • Create New...