Jump to content

[Project Zomboid] ZomboWin - A ZomboLewd Framework mod


Recommended Posts

12 hours ago, MorningDance1997 said:

Hey I can't defeat a zombie now, seems to be an issue with strength check? When I do it in debug mode it highlights the line with "local strLevel = player:getPerkLevel(Perks.Strength);"

Please let me know if anyone knows a fix for this, because I dont

Link to comment
18 hours ago, MorningDance1997 said:

Hey I can't defeat a zombie now, seems to be an issue with strength check? When I do it in debug mode it highlights the line with "local strLevel = player:getPerkLevel(Perks.Strength);"

Okay quick update: the error is that the error is null, from a quick bit of help from the PZ discord, with the error "attempted index: getPerkLevel of non-table: null", I have only a nude survivors and zombies mod along with zombowin and defeat, anyone know a fix?

Link to comment

I start the game and keep getting an error.

 

`attempted index: isNPC of non-table: null
function: OnZombieUpdate -- file: ZomboWinDefeatZombieHandler.lua line # 1204 | MOD: ZomboWin Defeat
java.lang.RuntimeException: attempted index: isNPC of non-table: null

Link to comment
On 5/9/2024 at 9:59 AM, bueir said:

yeah it would be cool to have more npc interation, like being able to surrender to hostile npc or pointing a gun at them, having them defeated, idk

I'm hoping for something like this after build 42.

Link to comment
On 5/10/2024 at 8:49 PM, CptAmelia said:

I'm hoping for something like this after build 42.

yeah unfortunately we ain't gonna see anything about that any time soon, since build 42 isn't even out yet and their ambitions with npc seems.. ambitious

Link to comment
On 4/30/2024 at 5:58 AM, TNT90 said:

So I really want to make the clothing damage work properly and took a look at the code. 

  Reveal hidden contents

                                if target:HasTrait("viciousZombies") and not target:isNPC() then
                                                -- Editor note --
                                    -- here should be the code to check local var "item:itemlocation/ type"
                                    -- then compare item to clothing list index to determine which subindex it belongs to.
                                    -- then when item subindex is retrieved, thats when i'll know which holetype to use.
                                    -- then a local var will be set to remember what clothing type and which holes to receive damage.
                                    local function getIndexNum(bodyPart)
                                        return clothingToHoleMap[bodyPart] or 0
                                    end

                                    local indexNum = getIndexNum(bodyPart)
                                    if IndexNum ~= 0 and not IndexNum == nil then 
                                        --print("IndexNum returned as: " .. indexNum)
                                        
                                        local conditionDamage = 1;
                                        local dmgMultiplierChance = 0;
                                        
                                                    -- Editor note --
                                        -- apply condition damage
                                        item:setCondition(item:getCondition() - conditionDamage)
                                        
                                                    -- Editor note --
                                        -- apply hole to clothing
                                        local holeIndex = holeType[indexNum]
                                        local chosenHole = holeIndex[ZombRand(1, #holeIndex)]
                                        local bloodPart = BloodBodyPartType.FromString(chosenHole)

                                        target:addHole(bloodPart)
                                    end
                                end

 

I think it has to be in here somewhere as the next if statement to remove clothing to the ground works correctly. 

 

I've also been trying to compare/contrast it to the original ZomboLewd defeat script that worked last time I checked. 

Some subtle differences but most is the same. The main difference is in the part indexing I think. 

The first thing I can think of to do would be to try putting that new function definition outside of the current function it is in. But I don't know if that would even matter. Been a long time since my undergrad programming minor.

 

Thoughts? 

ZomboWinDefeatZombieHandler.lua 49.18 kB · 27 downloads ZomboLewdDefeatZombieHandler.lua 7.96 kB · 14 downloads

Man, thank you for pointing the problem! Yes, that was the indexing. I just put old indexing in the file and commented new indexing function. Seems to work, but still needs testing btw.

ZomboWinDefeatZombieHandler.lua

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use