# Narrnika

Member

62

• Gender
Man

## Recent Profile Visitors

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

1. ## ThickSkinned and ThinSkinned is the same, while player in trees

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. ## ThickSkinned and ThinSkinned is the same, while player in trees

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. ## Issue with UIManager

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. ## Erroneous reduction boredomlevel

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. ## item id Where Can I Find the List of Vanilla Rendition Items and Recipes

projectzomboid\media\scripts\*.txt https://github.com/FWolfe/Zomboid-Modding-Guide#the-scripts

Try disabling the "Smart Open Mechanics UI" mod for this save. The update has something to do with the mechanic window - possibly conflicted.

9. ## Save my clothes!!!

Yes, I would like "favorites" to protect items from accidental destruction (seems this is already implemented for adding fuel)
10. ## solved Mod System Bug

Build 41.42 Now this error appears regardless of the loading method (continue latest save or load from save's list)
11. ## The temperature in car is not correct when it is in room

Outdoor temperature: -1.3 Room temperature: 22.0 Temperature inside the car: 3.6 The conditioner in the car is off.

No, the mechanics menu (only it) blocked everything before.
13. ## minor <RIGHT> in RichText

Ok, "ui:drawTextLeft" changed to "ui:drawTextRight". Left to correct the calculation of the X coordinate :-)
14. ## solved Mod System Bug

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.