#mod_development

1 messages · Page 238 of 1

wraith hemlock
#

Yeah I noticed it later on, didn't work though.

dry chasm
wraith hemlock
#

Under the condition that the weapon the player also has SwingAnim = Kat

#

I eventually tried changing player:setVariable to:
self.character:setVariable("CombatSpeed", AttacSpeed)

and was rewarded with stack trace error spam.

slender hazel
#

Hi there! Could you please advise on how to deactivate the Character Profession menu? I've successfully bypassed the menu using this code. However, it's causing an issue where the back button doesn't function on the subsequent menu. How can I address this

    if visible == true then    
        self:onOptionMouseDown({internal = 'NEXT'}, 0,0)
    end
end```
drifting ore
#

i think ive managed to figure out my issue with my invisable texture, the logs are showing that the model is not loading for some reason
is anyone able to help me out with this? im not sure exactly what i need to do for this

#

posted in the modeling channel before but i feel like this is more a mod dev issue at this point

vestal gyro
#

Can you post the xml file for the item?

#

You might have a syntax error in it or put in the wrong file directory from where it should load the model from

drifting ore
#

ill have a look for it

#

@vestal gyro what should the xml file look like? im having a tough time finding it

crisp fossil
#

Is it possible to trigger an item distribution only after a give number of days. Just like the current implementation of machete and samurai. I have a custom item that I like to start appearing at the same time with machete

vestal gyro
#

You can look at that for examples

drifting ore
#

ok got it

vestal gyro
#

You'd also need to put the items (if its clothing) into a fileGuidtable which is also an xml file

drifting ore
#

what do i need to do if its a weapon?

#

also would it help if i send you my test mod?

vestal gyro
#

I'm not on my pc right now but you can look at how other mods do it

drifting ore
#

ok

#

ive been looking at bush craft weapons and i dont see them use an XML file

#

is that beacuse they are only weapons?

vestal gyro
#

Then I think xml files are for clothing mostly? Sorry havent really worked with weapons

#

Well how do they reference the model/texture?

drifting ore
#

im very new to modding and making models so its a bit tough to get my head around

vestal gyro
#

Yeah it was the same for me when doing clothing, so it seems like for the mesh thingies you forgot to put the models_X folder infront of the file directory

drifting ore
#

Ahhhh!

vestal gyro
#

If you had problems with only the crowbar and Gbat that could be it

drifting ore
#

ive had issues with them all

#

the sawbat also failed sadly

#

they work ingame but the model itself is invisable

vestal gyro
#

Hm, what if you copied a mod and replaced their texture with yours, that could help in figuring out if its because of the model or the scripting

#

Model I mean

drifting ore
#

thats not a bad idea

#

ill try that

#

mind if i dm you? ill send over the test version of the mod for you to have a look at

#

for later

vestal gyro
#

I'll have to leave for work in 20 minutes, someone else can probably help you though

drifting ore
#

No worries

light condor
drifting ore
#

tbh ive never played dead island haha

#

but i should probably draw insparation from those games!

#

that is if my models would work XD

drifting ore
#

@vestal gyro the models are working!

#

that is such a relief to see!

vestal gyro
#

good stuff!

drifting ore
#

they were giant tho so i need to scale them down correctly

#

and also apply my own textures to them

#

ill do that in two different tests

#

whats the code to scale an item?

vestal gyro
#

I would assume that you just have to make the model smaller

#

looking good?

#

made some improvements in terms of pictures and description

red tiger
#

If anyone needs bitwise operations for their mods, I've created a GitHub Gist of how to do it in Lua and provided an exposer class for Java if you want Java support.

#

Feel free to use.

#

Hopefully we'll get support in b42 since I've heard more bitwise is used there.

#

=)

red tiger
timber nexus
#

Hello! I popped by because I'm interested in making some custom additions to the available items to sell/buy in the vending machines provided by the "ATM Economy" mod, but I have run into a bit of a snag. Any time I make any changes to the files, the game freaks out and doesn't load a lot of the mod assets properly any more. For any of the mods I use. For instance, if I even have the Anthro Survivors mod enabled after I make changes, the main menu doesn't render any buttons, just the background and music. If I disable that mod, I can load into a world but a LOT of the items from other mods (see; 99% of them) are no longer loaded or even available to be seen with debug. I really have no clue what I'm doing wrong, as I am copying the layout of the already existing recipes provided in the mod's files, could anybody with some experience with modding help me out with this? I've already tried and re-tried the edits with different mods enabled/disabled and nothing seems to work. :c

#

If it helps at all, I am trying to edit the files provided by what is already an edit of the original mod, since the original mod's files are in Spanish and I can only understand English.
I'm trying to add the guns from Vanilla Firearm Expansion (as well as the associated magazines/attachments/ammo), and the additions to VFE Gunrunner's, and the Stalker expansion.
I'm also trying to expand the list of items the ATM converter will accept for money to include some other junk items like cameras and empty cans (of which I am trying to figure out how to make the recipe require multiple of the item to 'craft' the money). I really feel like I did everything right with the edits I made, but the game says otherwise.

Also unfortunately I already had cleared my edits from the mod's directory before coming here, so I would have to re-make the edits again in order to provide any examples.

timber nexus
#

I'd check to see if there was any better luck doing it with Arsenal 2.0/Brita's Weapons but 1) there's way more stuff in those mods that I would have to add, and 2) there are no ATM mods I can find on the workshop that do it already, so I'm assuming it's too difficult to do in the first place...

drifting ore
#

hi all, i was wondering if you all could explain why parts of my model dont show up when in PZ? i made a baseball bat with a sawblade attached to it and for some reason the bat part is not visable

hollow lodge
#

is there any guide or already mentioned topic on how to delete items from a mod? I tried manually deleting the lines from the fileguid.xml and script/clothing.txt but these items still show up in character selection screen

austere sequoia
pulsar rock
#

Hey all, 2 questions:

  1. How would I go about running a very simple function every IRL second? Run it onTick with a modulo? If so, is there a set amount of ticks per second that isn't variable?
  2. How would I send a chat message only the client sees? Not anyone else?
bronze yoke
#

ticks are framerate dependent, if you want to do something based on real time you need to use a counter/compare timestamps

#

i wrote an example of this a few days ago actually

hollow lodge
true nova
hollow lodge
#

yeah but they still show in the game as blank

#

is there an order on how to do it? i deleted everything all at once, so

#

only deleting the lines in the script?

true nova
# hollow lodge yeah but they still show in the game as blank

thats weird. looking at it i have actually modified this mod but have not removed anything just edited their stats. when setting it as obsolete does it spawn in blank items or the old items are still there as blank or is it that in the creation they show up still?

hollow lodge
#

no, I also deleted it from lua files, although they only appear in debug mode and character creation screen

#

you can select it, the option goes to "none"

#

and if you equip it in debug, the game bugs all the player model

#

I basically erased any trace of those item in all the mod folder, and yet they show up in the game, at least their names

true nova
#

honestly not sure at that point. the only thing i could think is the xmls but i don't do clothing so don't know all the functions behind that. one thing i would keep in mind is the Boots and Clothes Expanded mod, which i assume is the mod you are trying to edit, mostly modifies vanilla clothing so it may be something in the vanilla game, but i don't know what you are editing

pulsar rock
hollow lodge
#

nothing big, just removing the jackets and editing the weird speed modifiers

pulsar rock
#

Also curious if anyone knows an answer to the sending of a chat message so only the client sees it.

#

Hm

#

Would something like this work?

    local message = ChatMessage.clone()
    message.setAuthor("System")
    message.setText("Some message")
    message.setLocal(true)
    message.setShouldAttractZombies(false)
    ISChat.instance.addLineInChat(message, ISChat.tabs[1])

Update: it did not. ChatMessage.clone() failed.

crystal oar
#

how do i remove an item from the distributions (other than overwriting it)? is it just table.remove(ItemPickerJava.ProceduralDistributions.list, k) or similar?

crystal oar
#

also does OnPreDistributionMerge really fire after the tables have been merged? that seems counterintuitive

fleet bridge
#

But you need to delete the key and value and you need to know what index number they are

#

And the index will change once you delete

crystal oar
#

i was thinking something like this:

    local result = 0
    local allDistributions = ProceduralDistributions.list
    if allDistributions and #allDistributions > 0 then
        for _, containerDistribution in pairs(allDistributions) do
            if containerDistribution and #containerDistribution > 0 then
                for i, containerItem in pairs(containerDistribution.items) do
                    if containerItem then
                        if containerItem == item then
                            result = result + 1
                            table.remove(containerDistribution.items, i)
                        end
                    end
                end
                for i, containerItem in pairs(containerDistribution.junk) do
                    if containerItem then
                        if containerItem == item then
                            result = result + 1
                            table.remove(containerDistribution.junk, i)
                        end
                    end
                end
            end
        end
    end
    return result
end```
would that work potentially?
pulsar rock
#

Did you ever figure out how to do this, by any chance?

sour island
pulsar rock
#

I'm struggling to use the ChatMessage object hmm

sour island
#
player:addLineChatElement(text, return_color.r, return_color.g, return_color.b, UIFont.Dialogue, vol, "default", true, true, true, true, true, true)

#

This will make the player say the line though

#

Not really a system message

#

You can try processGeneralMessage()

pulsar rock
#

Where is that found in?

#

Ah, root namespace

#

Hm

#

It just takes a string?

#

Let's see

crisp fossil
#

is it possible to group my clothingItems xml into a folder?

pulsar rock
pulsar rock
#

Why is OnMouseMove constantly triggered? hmm

#

I'm also curious, does it matter that an event hook has no arguments? I really only need to trigger something on the event, not do anything with the args.

bronze yoke
#

it doesn't

#

lua doesn't have strict function signatures

pulsar rock
#

Gotcha, good to know

#

Then my question becomes:

  • Why is OnMouseMove triggered constantly, regardless of mouse movement
  • Why is OnMouseDown seemingly not triggered?
bronze yoke
#

on mouse down can get eaten by ui and stuff

pulsar rock
#

Fair enough

#

Also, has anyone figured out a GitHub workflow for easy pushing to the workshop?

coarse sinew
pulsar rock
#

Ah, splendid, thanks!

pulsar rock
timber nexus
#

Gonna push this here once again, 'cos I really do wanna figure out why making any changes completely breaks my ability to use the mod at all. #mod_development message

crisp fossil
#

anyone knows how to add AttachedWeaponDefinitions?
I want to insert this

AttachedWeaponDefinitions.katanaStomach = {
    chance = 1,
    weaponLocation = {"Stomach"},
    bloodLocations = {"Torso_Lower","Back"},
    addHoles = true,
    daySurvived = 60,
    weapons = {
        "Base.Katana",
    },
}```
but I have different katanas and they should differ in chances, daysSurvied, etc.
I saw a mod that did it like this `table.insert(AttachedWeaponDefinitions["katanaStomach"].weapons, "CustomKatana")` but in my case I need to change the other options too and not just the `weapons`
fleet bridge
timber nexus
#

After doing my edits and even injecting them as a completely separate mod locally through c:/users/Zomboid/Workshop, it showed up in-game but when I activated it now my game hangs on Loading Scripts every time I try to launch. :/

#

Can somebody look at this and tell me what I did wrong?

#

The last thing the log shows is "ERROR: module "Base" imports itself" but that shows up multiple times before and doesn't get stuck there.

#

I'm going to nuke my mod list and load basically only the edited mod I made to see if that fixes the issue.

#

Nope. It just hard locks trying to load if I enable the mod. :/
I have zero clue why. There's no error being thrown in the log that shows what's causing an issue with loading the mod, and so far I have recieved zero help with the issue in the first place so I am literally flying blind.

timber nexus
#

Well, I gave up on it for now. I suppose at some point I might get lucky enough that somebody with knowledge on how this works will reply to my pleas for help. I'll just have to settle for using NecroForge and manually removing money/giving items whenever I'm near the vendors. Basically the same thing, just with like 40 extra steps. :^)

hollow current
# pulsar rock Would something like this work? ```lua local message = ChatMessage.clone() ...
local function addLineInChat(message)
    local _Chat = ISChat.instance;
    local _TabID = 0;
    local _Tab;

    for i, tab in ipairs(_Chat.tabs) do
        if tab and tab.tabID == _TabID then
            _Tab = tab;
            break;
        end
    end

    local _FoundMessage = nil;
    for i, msg in ipairs(_Tab.chatMessages) do
        if (msg and not _FoundMessage) then
            _FoundMessage = msg;
        end;
    end

    local _NewMsg = _FoundMessage:clone();
    _NewMsg:setText(message);
    _NewMsg:setServerAlert(false);
    _NewMsg:setServerAuthor(false);
    _NewMsg:setLocal(true);

    ISChat.instance.addLineInChat(_NewMsg, 0);
end;```
#

then call the function to add a client-sided message to chat

crisp fossil
#

how do I print logs?

cosmic ermine
crisp fossil
frank elbow
#

Unlikely, since it'd require the server welcome message to have been unset. But possible. A safer method is creating a "dummy" message object that has at least the minimum methods that the chat code expects

drowsy delta
#

how can i make a specific part of the body have blood on it

#

like the left arm

thick karma
drowsy delta
#

🗿

#

I mean like with code

thick karma
#

I know I'm sorry I couldn't help myself and unfortunately also cannot help you. 😭

#

If I knew I'd tell you

drowsy delta
#

😭 👍

crystal oar
fleet bridge
#

so its effectively not going to roll

crystal oar
#

how do i modify the entry? adding and removing seems easy enough, not sure how to change it

thorny jackal
#

Are modders allowed to do commissions?

crystal oar
thorny jackal
#

Heh, sure don't plan on doing that anytime soon

#

Was wanting to have a mod made, I mean I want it to fix a need I have but for anyone else to use of course, a mod that allows the user to disable certain ingame soundtracks, allowing others to take priority, so I can do combat with it only playing a select few, and have a select few idle songs play too

#

Only cause I can't find anythign like that and nobody else seems to know

drowsy delta
#

how can i edit what items a zombie corpse has when they die?

frank elbow
# drowsy delta like the left arm
-- where player is an IsoPlayer (e.g., player = getSpecificPlayer(0))
local visual = player:getVisual()
visual:setBlood(BloodyBodyPartType.ForeArm_L, 1) -- second argument is in [0.0, 1.0]
player:resetModelNextFrame()
triggerEvent('OnClothingUpdated', player)
frank elbow
drowsy delta
#

mb i meant items

gilded hawk
#

Is there an event that it's fired after the LoadGridsquare? Cause I need to run code after it has loaded

crisp fossil
#

is there a way to add an additional damage after a successful swing? im currently using OnPlayerAttackFinished but I cant figure out the way to do it

hollow current
#

While we're at it, any idea how do you change the styling of the message in terms of color and other possibilities if present, like font and size

alpine scroll
#

I have a question about altering someone's else mod

#

Consider I did download their mod, but want to change something inside of it, like a specific function to work differently

#

If I make another mod, make it so it loads after the original one, and on my mod I add the original as a require, and create a function with the same name, will it override the original function and do as I want?

heady crystal
#

Is anyone here familiar with sound code?

alpine scroll
heady crystal
#

Pretty much. I want to fetch the time a sound emitter is at, but the question is, what the fuck do the variables setTimelinePosition​(long long1, java.lang.String string) even mean

#

A string??? Why?

heady crystal
#

If it's local, you're outta luck

alpine scroll
#

I'm pretty sure the Expanded Helicopter Events can create a sound and then kill it after a while

#

Maybe the code has something you can read about

#

I usually just generate the noise that attract zombies

#

So there is nothing to hear actually

heady crystal
#

Nah stopping it is easy, the problem here is find out at what time it's playing

#

And... set the time too

#

I want to manipulate sound in a more complex way

alpine scroll
#

I think Jab had a mod that create eerie feelings or something like that

#

Using sounds

#

Its the most complex one I can think about

#

Oh, it wasnt a code thing, it was something else

drifting ore
#

dont suppose someone can help me? for some reason parts of my model are not visavle (the crowbar doesnt have the "hook" part on either end and the sawblade doesnt have the baseball bat part its attached to (the part the character needs to hold)

#

for the life of me i dont understand whats causing this issue

#

the models are custom made by myself

frank elbow
#

If you do a "dummy" implementation all you'd need to do is use those rich text tags in the string you return

#

I think someone sent a reference for rich text tags here, but you can also check ISRichTextPanel.processCommand

hollow current
#

That's intriguing, thanks so much!

frank elbow
# heady crystal A string??? Why?

See sounds_vehicle.txt from vanilla. It has a comment at the top that explains it. The example in use is idle, which would be the string passed there

#

Unsure whether there's a way to dynamically seek, since I'm assuming that's what you're after

heady crystal
#

Yeah that's what I want

#

Thanks I didn't know the word for it in English is seek

#

Oh that function is worthless

serene dagger
#

_Imloved i got a long vacation ahead anyone got a good modlist for a looong solo gameplay?

frank elbow
#

This channel is more geared towards creation of mods—I'm sure plenty of people over in #pz_b42_chat have mod lists to share, though

serene dagger
#

thank u il check it out

sharp bison
#

I discovered that JetBrains Rider's default UTF-8 behavior is UTF-8-BOM for windows users. But .lua files written with UTF-8-BOM encoding will not be read in Zomboid - you must use UTF-8 without BOM

it took me ages to figure out why the functions in my .lua scripts weren't being read in.

I noticed this isn't listed anywhere easy to find, so I thought I'd post it here, might be helpful for beginners/noobs like me who switched from Notepad++ to a "fancier" IDE that does extra things they don't know about. Wasn't sure if it should also go into the #pzwiki_editing

mellow frigate
alpine scroll
#

Weird question: Every time I try to update one of my mods on steam, it gives an error 16, but if I try again it works. Any idea why the first try gets bugged?

halcyon fable
#

Where can I find a lua api doc?

young quail
#

Hello everyone. Do you know if there is a mod for blind zombies? Couldn't find it(

coarse sinew
young quail
coarse sinew
#

Wait, that's selling access to a mod, which is against TC

young quail
#

I'm looking for other mods.

young quail
#

V1 in steam

#

V2 in patreon

vestal gyro
#

hmmmm

tiny wolf
#

Hello everybody
Can we create a custom item Category into PZ ?
I want to create my own medical category : EFK_Medical for my items to use the OnlyAcceptCategory script with its

bronze yoke
#

oh that's just a blatant breach of tos huh

alpine scroll
#

Wait, can you have a mod that is not on the workshop?

#

I always assumed you had to upload to the workshop to mod anything

crystal oar
#

no reason you couldn't put it somewhere else, as long as there isn't a paywall. some people prefer to put it on github for instance

alpine scroll
#

What I mean is that I have some mods that I use in a local server. I always assumed that I needed to upload them to steam, add them as workshopid and then put on the mod variable for it to load

#

I could have everything just work locally instead of depending on the steam, considering they are server side only?

crystal oar
#

sure, no reason you'd have to upload it to the workshop if it's just for personal use

alpine scroll
#

Huh

#

Btw, not sure if it was any of you guys, but the blind zombies mod already got all links removed

crystal oar
#

that happens automatically when a mod gets reported, and i assume it was someone here who reported it

alpine scroll
#

Not complaining tbh

#

haha

#

I think its deserved

crystal oar
#

certainly, you can't mod pz if you are putting stuff behind a paywall, it's explicitly laid out in the modding policy

alpine scroll
#

Does anyone know where I can see all "OnEvent" that I can associate a function? I want to make a toggle that every zombie that spawns are crawling or not

crystal oar
alpine scroll
#

Exactly that

#

Thank you

crystal oar
#

so loot on zombies is handled differently than loot in containers right?

bright fog
#

The zombie body is a container

#

But you can access it only on death

crystal oar
# bright fog How so ?

idk mike maybe it's just in a different file? i don't see it in the list on procedural distributions but let me search rq

bright fog
#

Oh

#

That

#

Yeah it's handled elsewhere

#

Idk how however, I've never looked into it

#

ik where to find the answer however give me a sec

crystal oar
#

okay word, i'll dig around

alpine scroll
#

Events.OnZombieDead.Add(<function gos here>);

bright fog
#

nvm I don't know

bright fog
alpine scroll
#
    if not zombie:getOutfitName() then return false end
    local outfit = tostring(zombie:getOutfitName());
    local inv = zombie:getInventory();
    if outfit == "BananaTrama" then
      inv:AddItems("Base.Banana", 1);
    inv:AddItems("Base.Egg", 2);
        if 50 >= ZombRand(1, 100) then
            inv:AddItems("Base.Spiffo", 1);
        end
        if 50 >= ZombRand(1, 100) then
            inv:AddItems("Base.Hat_FurryEars", 1);
      inv:AddItems("Base.SpiffoTail", 1);
    else
      inv:AddItems("Base.Hat_Beret", 1);
        end
    end
end

Events.OnZombieDead.Add(CheckDropsNana);```
#

This is how I handle to make a specific outfit drop specific items

bright fog
crystal oar
#

remove loot from zombies' loot tables

bright fog
#

Yeah so you need to get access to the base stuff then OR you can make an OnDeath function that checks within the inventory of a zombie if there are the items you want to remove

alpine scroll
#

@crystal oar Get the code I just pasted, replace Inv:AddItems with inv:RemoveItems

bright fog
alpine scroll
#

You can do a check if the Item exist I guess?

#

But its on the "OnZombieDead" event

bright fog
#

yeah

#

Either way it's the same base

alpine scroll
#

RemoveOneOf
public void RemoveOneOf(String String)

#

Or ```
DoRemoveItem
public void DoRemoveItem(InventoryItem item)

#

Actually, I thnk the RemoveAll would be best

#
RemoveAll
public void RemoveAll(String itemType)
Remove all the item of the type in parameter inside the container Ex of itemType : Broccoli (no need the module like Base.Broccoli)

Parameters:
    itemType - 

#

I think this avoids a need for a check

#

Since it checks for any matches to remove it

#

Does anyone here know when a zombie is updated? Like when the OnZombieUpdate is being triggered?

flat panther
sour island
#
                  } else if (var18 != null) {
                     VehiclePart var60 = var18.getNearestBodyworkPart(var1);
                     if (var60 != null) {
                        VehicleWindow var61 = var60.getWindow();

                        for(var43 = 0; var43 < var60.getChildCount(); ++var43) {
                           VehiclePart var62 = var60.getChild(var43);
                           if (var62.getWindow() != null) {
                              var61 = var62.getWindow();
                              break;
                           }
                        }

                        if (var61 != null && var61.isHittable()) {
                           var43 = this.calcDamageToVehicle((int)var34 * 10, var2.getDoorDamage(), true);
                           var61.damage(var43);
                           var1.playSound("HitVehicleWindowWithWeapon");
                        } else {
                           var43 = this.calcDamageToVehicle((int)var34 * 10, var2.getDoorDamage(), false);
                           var60.setCondition(var60.getCondition() - var43);
                           var5.setVehicleHitLocation(var18);
                           var1.playSound("HitVehiclePartWithWeapon");
                        }
                     }
                  }

Trying to mess around with hitting vehicles and noticed the conditions for window or part being hit is drastically different. vehicleParts.setCondition doesn't seem to have any type of transmit going on. Ironically, if one calls damage() on the VehiclePart it would also call setCondition and transmit. I'd still need to confirm this though - unless someone else is more familiar with this already.

To test: smack a car door with a bat - it can't have an intact window.

#

setVehicleHitLocation seems to be related to FMOD sounds - and I'm curious why it's not used for the window.

TL;DR: I don't think car parts getting hit is updating in MP (outside of windows)

halcyon fable
#

I’ve never modded or touched the PZ Lua API. I want something really simple:

For a list of vehicle IDs, I want to set the trunk capacity to 0 or, ideally, completely remove the trunk.

alpine scroll
halcyon fable
alpine scroll
#

English only

halcyon fable
# alpine scroll English only

Damn. Actually, I don't have any work. Was thinking about this feature (remove trunk or capacity) to balance a bit the RV interiors mod

halcyon fable
#

I’m not familiar with modding Project Zomboid and was searching for information today. Unfortunately, I couldn’t find a comprehensive Lua API documentation. I’m unsure if I should refer to the Java API instead.

While examining the RV interiors code, I noticed it maintains a table of all vehicles with interiors. If a more experienced modder could guide me, I’m looking for a function similar to:

Lua

vehicle.fromId(id):removeStorage()

I’m not certain if the API supports such a straightforward method, or if it’s even feasible. However, my research suggested that I should join this Discord server and seek guidance from the community.

young pollen
#

How do i know if the player is inside a specific building? (like police station, church, ....)

    local player = getPlayer()
    local currentCell = player:getCell()
    local x, y, z = player:getX(), player:getY(), player:getZ()
    local currentGridSquare = currentCell:getGridSquare(x, y, z)
    local currentRoom = currentGridSquare:getRoom()
    if not currentRoom then
        print("Player is not in a room\n")
        return
    end

    local currentBuilding = currentRoom:getBuilding()
    if not currentBuilding then
        print("Player is not in a building\n")
        return
    end

    --How to know if player is inside a certain building, like police, church, ....

end

Events.EveryOneMinute.Add(EveryOneMinutes)```
bright fog
#

(remember to remove your prints when you upload your mod)

#

But besides that idk, perhaps there's a method to get the type of building

versed ibex
#

got another inv?

thick karma
#

@versed ibex

bright fog
crystal oar
bright fog
#

He deactivated comments

crystal oar
#

big surprise there lol

crisp fossil
#

hi guys is there an easy way to incorporate the bonuses from a custom perk? or do I need to do it manually by adding the bonuses on zombie hit

wraith hemlock
#

I'm rewriting my SCHTASK script so that it should run at set times of the day, this is for restarting the server. Does this look like it'll run fine?

It will just be saved as a batch file.

#

I have no /sd set because I assume that when it runs "goto start" it'll just create new instances of tasks to run at the set times anyway.

slow hound
#

seems like you rewrote alot of the same for no reason. other than that it's mostly good. i'm assuming you are using some task scheduler on the pc to do this?

#

i do something similar for my palworld dedicated box for auto restarts and hourly backups

wraith hemlock
#

Nah I'm just using the server launch batch file itself.

#

basically, this is a rewritten StartServer64, no task scheduler needed. just run as admin.

slow hound
#

this isn't setting a task scheduler to run this file at this time of the day?
SCHTASKS /Create /SC ONCE /ST 05:50 /TN "PZ\10m" /F /TR C:\SteamCMD\rcon\10m.bat

wraith hemlock
#

i mean it is setting a task schedule, but i didn't use task scheduler if you get what i mean

slow hound
#

i guess i dont 😛 maybe i'm a dumb dumb

#

i do have this setup on a server successfully though

wraith hemlock
#

i just wrote it out in batch instead of using that

slow hound
#

so your goal is to run that file one time. it will set all those tasks to be scheduled

#

i dont get why having this over and over matters

::============================================
::start server
::============================================
@setlocal enableextensions
@cd /d "%~dp0"
SET PZ_CLASSPATH=java/istack-commons-runtime.jar;java/jassimp.jar;java/javacord-2.0.17-shaded.jar;java/javax.activation-api.jar;java/jaxb-api.jar;java/jaxb-runtime.jar;java/lwjgl.jar;java/lwjgl-natives-windows.jar;java/lwjgl-glfw.jar;java/lwjgl-glfw-natives-windows.jar;java/lwjgl-jemalloc.jar;java/lwjgl-jemalloc-natives-windows.jar;java/lwjgl-opengl.jar;java/lwjgl-opengl-natives-windows.jar;java/lwjgl_util.jar;java/sqlite-jdbc-3.27.2.1.jar;java/trove-3.0.3.jar;java/uncommons-maths-1.2.3.jar;java/commons-compress-1.18.jar;java/
".\jre64\bin\java.exe" -Djava.awt.headless=true -Dzomboid.steam=1 -Dzomboid.znetlog=1 -XX:+UseZGC -XX:-CreateCoredumpOnCrash -XX:-OmitStackTraceInFastThrow -Xms1g -Xmx18g -Djava.library.path=natives/;natives/win64/;. -cp %PZ_CLASSPATH% zombie.network.GameServer -servername Corner -statistic 0 %1 %2
wraith hemlock
#

The idea is I run this batch as administrator on my other user profile, leave that console essentially alone forever.

#

It runs from 6 AM and runs the last task at midnight, at which point it goes to start, so I don't have to set dates for the schedules, it will just schedule them because its going to run down the list from START.

#

The reason those exist is because the server is running /quit, after each schedule, so if I don't run that start server segment, the server won't restart until the next time the line comes up.

#

If it only existed once, it means the server would only be on for 6 hours a day I think.

#

Because it only starts the server once and then after 6 hours it will run quit. It won't run the start line again until like, 18 hours later?

#

Every time quit is run, it must then start the server.

#

All of its basically just ran sequentially.

#

After the server has started, it then sets a scheduled task for the next time it will shut down.

#

The only other thing I have to consider is how it will interact with udderly updater, which I believe it will:

  1. Udderly will run /quit
  2. The batch file will just go to its next line, which will either be "goto start", or it will set the next restart schedule, then run the server.
#

Guess I'll try.

slow hound
#

that specific script was (written a bit differently) created to work with that mod specifically

#

yours has a bit extra from the original but i remember seeing it around somewhere

#

i mean it should work and the udderly mod shouldn't cause an issue methinks

wraith hemlock
#

Alright, problem is that it will create the tasks for 6AM because they're at the start, but then it will run the server. Because the tasks are only set when their line runs, and the server never runs /quit, it'll never set the tasks for later points in the day.

Maybe if I just put all tasks at the start it will work.

alpine scroll
fleet bridge
#

Will delete all items from zombie corpse

alpine scroll
#

I think you selected the wrong message to respond to haha

#

But yea, remove all would remove if you pass a string to remove a specific item

thorny solar
drifting ore
#

Hi. Can you tell me why my clothes look like this? Jeans are layered on a raincoat. I use masks and models from developers. The script is identical, except for the names and xml files. I even tried to take their texture - the result is the same. At the same time, this does not happen on vanilla items. What is my mistake?

vestal gyro
#

Maybe use the xml file of the lab coat or a coat that goes below waistline, they might have a different one from the jacket (which are not supposed to go much lower than the waist)

drifting ore
#

I can try, but I'm still worried about why this happens to my clothes, but it doesn't happen to the clothes of the developers, provided I use their same masks and their same models, and even if I use their same textures đŸ„Č

#

My/Developers

#

And this often happens with other clothes. Usually on a female character, as it is narrower than a male one

#

from my observations: the developers' clothes seem to cut off the clothes underneath (if you look very closely, you can even see a small strip with a void). My clothes are just layered on top of the other one. I tried to find some script for this or something from the developers, but I didn't find it

vestal gyro
#

I couldnt tell you how many times the female model gave me problems with textures it's insane

vestal gyro
#

how to check if a player is wearing a specific clothing piece?

faint ingot
#

I'm looking through the files for the Common Sense mod.
For the door prying mechanic this mod adds, the prying fail chance adds something called "failBoost".
What is this "failBoost"? I don't see it defined anywhere.

#

I feel like it's something to do with the crowbar or door. So It might be something in the base game, not the mod. But I don't know anything about modding.
I'm just trying to understand.

drifting ore
tranquil kindle
# drifting ore so at the moment we don't have any script responsible for overlapping clothes?

You might wanna mess with Body locations for top piece? From my experience i noticed that some stuff will be hidden by other items. For example i wanted to make a pocket watch that behaves like normal watch, but is visible on your pocket. Ive set body location to wrists which vanila watches use but model was showing on pocket. Problem occured when i wear something that covers said wrist and in return makes watches invisible (Jacket for example because it covered whole arm so it kinda makes sense). After some trial and error i found out that if you have body location on item that is covered by other clothing it wont show (I belive those would be belly button, watches and maybe even fingers for rings if you were to wear gloves yet im unsure about that one). Could you give your waist coat body location same as Jacket to see if it helps?

#

Also is that coat you made 3d model, or is it texture drawn on player model?

drifting ore
#

Maybe I'm making some kind of mistake, I do not know. But visually, as if, I applied everything as usual

verbal yew
#

drop xml

drifting ore
#

My/Developers

verbal yew
#

hmm... vanilla looks ugly...

drifting ore
#

But at least his pants aren't layered on him

#

And they don't stick out through it xD

verbal yew
#

you do something with clothes slots?

drifting ore
#

I can't figure out why the pants go beyond the raincoat. At the same time, this does not happen for developers, all other things being equal

#

If I put the developers texture in my mod: She's starting to act crooked too. In this regard, I have a question: maybe they have a script somewhere separately that is responsible for the correct layering of clothes. But today I rummaged through folders and searched through PowerShell - I didn't find anything similar.

drifting ore
#

Yes, the path is specified to the developer masks

tranquil kindle
#

Only jacket is your item, right?

drifting ore
#

Yes

tranquil kindle
#

Could you send that texture here?

drifting ore
#

Oh yes, one second

tranquil kindle
drifting ore
#

what did you do?

tranquil kindle
#

To be fair i could not find anything wrong with it from screenshots you've send so i made a quick one myself with your texture

#

Jeans look strange but they do not clip like on your screenshot

#

Now ill compare it to zipfile you;ve send

verbal yew
#

lol

drifting ore
#

I can't figure out where I made a mistake stressed

tranquil kindle
#

Yours is top one

#

<m_UnderlayMasksFolder>media/textures/Clothes/JacketLong/Masks</m_UnderlayMasksFolder> is all youre missing i belive

#

as your line is incomplete

drifting ore
#

Wait a second, I'm going to try it now

#

Oh yes, it worked... I do not know why this was an error, because he found the way to the models without these lines. Thank you very much for your help ❀spiffo

#

Thank you too, kERHUS!

crystal oar
#

how do i get from a OnContainerUpdate(object) to said object's inventory? i know it's not object:getInventory(), but not sure what it is

coarse sinew
crystal oar
#

thanks

#

is there something like OnZombieDead that fires once all the loot is populated in a corpse? OnZombieDead says the inventory is not filled when it fires

bright fog
#

It is

#

OnZombieDead the inventory of the zombie is generated

crystal oar
bright fog
#

@bronze yoke is that true ?

bronze yoke
#

yes

#

there is no event for this

#

zombie loot is generated when a player first comes into looting range of the corpse

#

it does not fire any event, even OnFillContainer, despite using the same code that does fire that event

crystal oar
#

well poopy

bronze yoke
#

this creates a frustrating situation where it is very easy to add loot to a zombie corpse (using this event) but hugely tedious to remove items

bright fog
#

yikes

halcyon fable
#

is it possible to remove a part from a vehicle script using lua?

manic magnet
halcyon fable
#

I can get to the part:

local part = getScriptManager():getVehicle(vehicleName):getPartById("TruckBed")

But now what? How do I remove it? Or set it to nil?

manic magnet
bronze yoke
#

i don't recommend this library

#

it pretty much just does what you're doing already, seems pointless to tack on a dependency to save like, three lines of code

manic magnet
#

I see. I have not used it, only seen it around. I would be unable make a recommendation for or against it either way. But to be fair... that is also the reason I don't use Item Tweaker, because I can do whatever I need without an extra library.

I don't know enough about vehicle modding to be useful I suppose. ❀

bronze yoke
#

it's exactly the same thing as item tweaker

manic magnet
#

Ahhhh...

bronze yoke
#

the base syntax for editing vehicles is a little uglier than it is for items but it's still the same level of 'replaces a function call with a different function call'

manic magnet
#

Well... then maybe it would still prove useful for @halcyon fable to pull it down and dig through the Lua, as it may show him how to do what he needs with the base Lua vehicle functions.

bronze yoke
#

i do know how to mess with vehicles but i'm not really sure there's any way to remove a part

#

you basically just pass new script lines to process, there isn't really a line for 'don't have a part'

halcyon fable
#

I’m leaning towards a solution that involves overriding the function

function VehicleUtils.createPartInventoryItem(part)

But I wish I could just remove a part from the vehicle’s parts list.

manic magnet
#

You could probably just set the trunk space to 0... I guess? 😅

halcyon fable
crystal oar
#

is the base map background an image or is the background made by the game? i'm curious if you could either color areas by if they area no-pvp zone or not, or if you could edit the base image to hardcode it for a particular server if not

bright fog
#

wdym the base map background ?

crystal oar
#

so like red but if it's a no-pvp zone then green or something

gleaming sorrel
#

I've noticed for some mods they include 2 options to enable in the mod menu for 1 mod
As an example with the Project fungi mod
There an option for
All Zombies
And
Some Zombies

Does anyone know how to do this

bronze yoke
#

it's just multiple mods

#

a workshop item can have any number of mods in it

gleaming sorrel
vestal gyro
#

why are the icons not showing up

#

I have the icon textures in media/textures

#

and Item_ written before the icon name

verbal yew
#

icon = 5CADDollarcon,

#

without item_ in script

vestal gyro
bronze yoke
#

are they pngs?

vestal gyro
#

yep

vestal gyro
#

im just as confused as you guys trust me

bright fog
gleaming sorrel
bright fog
#

Emaciation ?

gleaming sorrel
# bright fog Emaciation ?

Making the zeds look starved and rotten
It's something that I've wanted to do but didn't have the skill to
Until Goblin Conscript (another zombie texture modder)
Taught me how

#

Now I have to go though every one of my mods
And updated them with this new level of detail

#

First was Human Zeds

crystal oar
#

i can't figure out how to remove an item after OnFillContainer, can anyone give me an example?

    --local containerInventory = container:getInventory()
    --containerInventory:RemoveAll("Money")
    container:RemoveAll("Money")
end

Events.OnFillContainer.Add(LootRemoverOnFillContainer)```
slow hound
#

not 100% but this should work

function LootRemoverOnFillContainer(roomType, containerType, container)
    if container:getItemFromType("Money") then
        container:RemoveAll("Money")
    end
end

Events.OnFillContainer.Add(LootRemoverOnFillContainer)
crystal oar
#

idk, i'm still finding mad money in cash registers

slow hound
#

I dunno. maybe you need to use Base.Money? can't think off the top of my head what needs to go there

maiden thistle
#

so i know this is a bit ambitious since i have basically no coding knowledge but i want to make a personnel mod with some clothes and i think i can fumble my way to make them work but one is causing issues which is a jacket that i want it to have a hoodie up and hoodie down and jacket open kind of thing but no matter what i do i cant get it to work but i can get it working without all that fancy stuff

anyways sorry for the massive amount of text and no punctuation

cosmic condor
#

I encountered an issue with a PNG file saved from Photoshop that caused the game to crash ded

#

no idea why, but it's because of a faulty PNG

versed crane
#

hi all. i am in the middle of making my first mod that lets you refrigerate/heat drinks which give you seasonal buffs. for example, drinking a hot drink in winter will give you happiness and vice versa. the problem is i want to apply this to water sources like water bottles but it seems that water containers are a completely different class of its own when compared to normal food. any suggestions of how i might go around this? thanks.

crystal oar
#

so i feel like i'm trying everything here, nothing seems to be working

    local containerInventory = container:getInventory()
    containerInventory:RemoveAll("Money")
    container:RemoveAll("Money")
    containerInventory:RemoveAll("Base.Money")
    container:RemoveAll("Base.Money")
end

Events.OnFillContainer.Add(LootRemoverOnFillContainer)```
anyone know why?  i'm not getting any error or anything
worthy pawn
#

I have looked and looked without any avail.

Does anyone know how to create an item that will full restore/repair an item/weapon aswell as reset repairs to 0.

This is the only information I've found on the Fixer line.

https://theindiestone.com/forums/index.php?/topic/3735-the-fixing-system/

bright fog
worthy pawn
#

I will look at those. There is one that affects it I had dug into, but has mod options along with it. I will peak at these.

Essentially I want something like a "axe handle" and it repairs an axe to 100%, and no repair count degradation.

bright fog
#

Then I'm sure reading those will help :)

worthy pawn
muted garnet
#

Can somebody say me pls where in vanilla uses this occupation table?:

Professions =
{
    PoliceOfficer = {
        rare = 1,
    },
    ParkRanger = {
        rare = 2,
    },
    ConstructionWorker = {
    },
-- other occupations
}
bronze yoke
#

it might be related to profession vehicles/houses? not sure what a rarity would mean otherwise

muted garnet
#

maybe, this table located in media\lua\server\Professions\Professions.lua and may mean spawns

fleet bridge
crystal oar
#

Well not really I'm trying to make a mod that lets you remove whatever

fleet bridge
#

I think there are vanilla functions to remove loot, it might be in distributions.lua iirc

drifting ore
fast remnant
#

Is there any documentation on modding PZ?

bright fog
#

If you want documentation to explain how modding works uh there isn't much but if you want the java doc yeah

drifting ore
drifting ore
fast remnant
halcyon fable
#

Cant access instance field?

local container = ScriptManager.instance:getVehicle(vehicleName):getPartById(part).container

container is nil. Am I doing something wrong?

#

Given that part is a TrunkBed

bright fog
bright fog
fast remnant
regal star
#

Hi guys! I made a mod for a T-shirt today and would like it to spawn on zombies. I searched the Internet for how to do this, but found nothing. Can you help me please?

drifting ore
#

Media > clothing > clothing.xml in Project Zomboid directory. They create costumes for zombies there

vestal gyro
#

@bronze yoke found the error, never happened to me before when I made icons with gimp but guess this is also a thing you have to keep track of
ERROR: General , 1715615889022> ExceptionLogger.logException> Exception thrown java.util.concurrent.ExecutionException: java.io.IOException: Unsupported bit depth: 16 at FutureTask.report. Message: C:\Zomboid\mods\Goose's Canadian dollar mod\media\textures\Item_10CADollarIcon.png

#

it was 16 bit instead of the 8 bit that's supported by zomboid

#

ok it works now

bronze yoke
#

oh man, i knew that could happen but i didn't think it would come up with icons, i should've mentioned it 😓

maiden thistle
#

so i was some what right about fumbling but i have no idea how to do multiple options
this is what i have
ClothingItemExtra = Zooyork_jacket_Open,
ClothingItemExtraOption = OpenJacket,
clothingExtraSubmenu = CloseJacket,
ClothingItemExtraOption = UpHoodie,

verbal yew
maiden thistle
#

Thanks

maiden thistle
#

just got it working you have no idea how happy i am that it finally works

vestal gyro
austere sequoia
#

I see, you are on topic right now: How many colors (bits?) should I use for custom tiles to make them blend into vanilla?

vestal gyro
#

it seems like zomboid (for pngs) uses 8bit RGB

#

honestly can tell no difference between 8bit RGB and 16bit RGB

#

so its whatever

austere sequoia
#

Thanks, I will give it a shot

wraith hemlock
#

if handWeapon = handWeapon:getSwingAnim():contains("CustomSwing") is this a valid line? for example, will the game actually check if the condition is true?

maiden thistle
#

so one of the problems i have rn is hair going through the hood

#

and with the shorts it makes a long version and when i click it, it throws an error if the error is needed i can get it

#

found a new problem when i put on a hat when the hood is up it deletes the jacket

maiden thistle
#

i guess another minor issue is that the ground items are weirdly shiny

vestal gyro
austere sequoia
vestal gyro
#

just had my mod files open so I had it on quickdraw lol

vestal gyro
#

might just be the gray texture and WorldStaticModels sometimes are just like that

vestal gyro
#

also how to make so you need both items

austere sequoia
vestal gyro
#

oh

#

ok yeah im stupid nvm

bronze yoke
#
Sugar,``` as separate things if you want to need both
vestal gyro
#

it's always the tiny mistakes that have the most impact

#

also thanks albion

austere sequoia
austere sequoia
vestal gyro
#

ight sure

#

I'll also add sugar packets as an optional sugar item since that could also be used

#

as in Sugar/Sugarpackets,

#

its just a stupid mod I made for a friend so it's whatever really

wraith hemlock
#

Anyone know why this doesn't work? I set 2Handed.xml in my anim sets to use WeaponSpeedScale as a variable.

I noticed that when the game is launched, that the variable is not set at all, whereas in other mods, variables show up in the anim viewer in debug.

maiden thistle
vestal gyro
#

yeah

#

might be because of the model then

#

but imo it's not a turn off

#

also look at this guys I majorly fucked up

austere sequoia
slow hound
#

I see a function and a statement and 3 ends. so the easiest reason is you have too many ends? 😄

wraith hemlock
slow hound
#

also does the moddata exist prior to this running?

#

maybe intialize a default value for WeaponSpeedScale and see how it behaves

#

oh nm i somehow missed that line. forget that last comment

wraith hemlock
#

So there is no variable being added at all when the mod is run. Even though it is defined in the animation xmls and in Lua.

#

The mod data is added to the weapon script, yes.

slow hound
#

that makes sense since it's not used in the code. i assumed you were making up an arbitrary number to use for your specific case

#

so is the goal to use the base combat speed value and multiply by your moddata?

wraith hemlock
#

No.

#

Base speed is not used ever.

#

Its trying to change the animation speed scale by using set variable.

#

The game doesn't recognize the variable's existence though.

#

The game never says it adds "WeaponSpeedScale", it doesn't recognize it as a variable. Combat speed is still created and set to 1.2, even though in the xml for 2HDefault, it does not even exist.

bright fog
#

Sry what's the issue here exactly ?

wraith hemlock
wraith hemlock
#

My guess so far is that since it is never making or using the variable "WeaponSpeedScale", then it never gets changed, and then it defaults to using combatspeed which is defined elsewhere.

slow hound
#

yeah that's not any variable used in zomboid code that i see

bright fog
#

Sadly I can't look at any of these files. If you can't figure out your problem I invite you in the modding channel and ask in the animation channel so I can look at it better when I can

slow hound
# wraith hemlock My guess so far is that since it is never making or using the variable "WeaponSp...

I don't do xml stuff with anims so doggy might help you more there. but you can try something like this should work assuming no issues with that xml (no idea what is even changed)

function WeaponOverride(handWeapon)
    if handWeapon == nil or not instanceof(handWeapon, "HandWeapon") then
        return
    end

    local baseWeaponSpeedScale = 1.2
    local modData = handWeapon:getModData()
    local weaponSpeedScale = modData.CSC and baseWeaponSpeedScale * modData.CSC or baseWeaponSpeedScale

    local player = getPlayer()
    player:setVariable("WeaponSpeedScale", weaponSpeedScale)
end

local function OnPlayerUpdate(player)
    local handWeapon = player:getPrimaryHandItem()
    WeaponOverride(handWeapon)
end

Events.OnGameStart.Add(WeaponOverride)
Events.OnPlayerUpdate.Add(OnPlayerUpdate)
#

i think this should work almost no matter what assuming the moddata is there.

mellow frigate
wraith hemlock
#

That was my choice, the reason being that base speed is capped by anim scales.

#

Even if you set your weapon speed to 300 your weapon is never going to get past the limit of weapon animations that's been set by, presumably, "CombatSpeed".

mellow frigate
wraith hemlock
#

My mod needs to get past it.

#

Yeah I don't mind that for now. Even if I just set the speed scale to some number like 1.2 that overrides all conditions, it won't matter to me, because its on a fairly casual server anyway.

#

But what does matter is the speed cap.

#

Another way to solve my problem would be to figure out how to just make it so CombatSpeed doesn't "cap" somehow.

#

What does interest me is that if you just set speed scales in the xml to something like 2.5 it works fine and animations go pretty fast. But if you try to put it as a custom variable so you can write a number into it that depends on say, weapon base speed, or the anim type, or anything like that, it just won't override that file's values.

#

But yeah unless you want to use base speed on weapons to nerf people, its useless :p you can make people attack slow, but if you want to make them attack faster its basically useless and caps out at a low value.

mellow frigate
wraith hemlock
#

is that what your "animfix" is?

slow hound
#

oh here you go. This is the fine sir that wrote the animation guide on steam. i'm sure they know wayyy more haha

wraith hemlock
#

I'm working with Apex by the way he sent you a message earlier, I'm working on the issue myself and hosting the server that the mod will hopefully end up on if figured out.

slow hound
#

my own issue I'm trying to overcome at the moment is reinitializing tile properties without having to restart server

#

there has to be a way

mellow frigate
slow hound
#

ahhh kudos for giving credit so quickly

wraith hemlock
# mellow frigate now that I think of it, I did some speed uncap by overriding the whole combat in...

Yeah this appears in your lua in the moodle mod:

    if useAnimSpeedFix then
        combatSpeed = combatSpeed * 0.8;
        combatSpeedMin = combatSpeedMin * 0.8;
        combatSpeedMax = combatSpeedMax * 0.8;
    end
    --critical hits not taken into account as they are random
    --if player:isCriticalHit()then
    --    combatSpeed = combatSpeed * 1.1;
    --    combatSpeedMin = combatSpeedMin * 1.1;
    --    combatSpeedMax = combatSpeedMax * 1.1;
    --end
    
    return combatSpeed,combatSpeedMin,combatSpeedMax;```
mellow frigate
wraith hemlock
#

Is combatSpeedMin / Max actually defined somewhere else in the game or something?

abstract cairn
#

how would I get the IsoZombie from an IsoCharacter

wraith hemlock
#

Either way the guy who did the run speed mod fix seems to have managed to do what I want to do for run speeds but I have no idea why the game's accepting his variables in those xml files and not mine.

mellow frigate
vestal gyro
abstract cairn
#

also goose do you know how I'd get the isozombie instance from an isocharacter instance

vestal gyro
#

No idea lol I didn't meddle with that yet

abstract cairn
#

i understand how id verify if it exists hypothetically I just dont know how to get it from the IsoCharacter

vestal gyro
#

I usually keep to clothing and items right now

abstract cairn
#

nvm albion is clutch as always

abstract cairn
austere sequoia
abstract cairn
vestal gyro
abstract cairn
vestal gyro
#

(He's trying to downplay the greatness so it looks even better when it comes out)

#

Classical chopie bait and switch

wraith hemlock
#

@mellow frigateDo you know if it is possible to change the values of CombatSpeed min and max?

#

The solution that dhert had with brutal handwork, I think, was that he just recreated vanilla attacks and turned it into a custom attack animation with a keypress.

#

by making it a timed action.

wraith hemlock
#

Does anyone know why some items will throw tooltip errors at you and have blank tooltips?

obtuse pelican
#

Hello amigos, Im curious why a very simple mod i wrote doesnt function. Its a mod that makes your sickness go up slowly after not sleeping and getting high fatigue (my friend groups server has an issue with not sleeping but we want sleep on). I can post the code here if thats okay

slow hound
obtuse pelican
#

I'm kinda new to lua so im not entirely sure exactly what im doing but heres what I have so far:

function CheckFatigue()
  for playerNumber = 0, getNumActivePlayers() -1 do
    local player = getSpecificPlayer(playerNumber)
    local stat = player:getStats()
    local fatigue = stat:getFatigue()

    if fatigue >= 0.8 then
      local sickness = stat:getSickness()

      if fatigue >= 0.9 then
        stat:setSickness(sickness + .05)
      else
        stat:setSickness(sickness + .03)
      end

    end

  end

end

Events.EveryTenMinutes.Add(CheckFatigue);
slow hound
#

i know setSickness is the issue. using moodles is also a good way to set levels of sickness per moodle level

#

you want person to get more sick or to get infected?

obtuse pelican
#

Just more sick, similar to corpse sickness

slow hound
#

i got you. one sec

obtuse pelican
#

At a progressive rate but not instantly kinda deal

slow hound
#

i think i have something that should work pretty well for ya

#

just one more min

obtuse pelican
#

Alright thanks I appreciate it

#

And also just because im curious, is there a reason setSickness doesnt work? I saw it in the official documentation that I read

slow hound
#

albion said it in here before. search is really good in this discord

#

said something about it being tied to fps and cause some issue with updating too fast to set it reasonably

#

but i think sickness is infected level maybe

obtuse pelican
#

Ah I see yeah I just read it, It seems that setSickness is only for zombie infection which is updated every frame. Every other instance of sickness is actually food sickness says albion

#

I guess these are just the quirks you only find by having experience modding lol

slow hound
#
---@public
---@param arg0 float
---@return void
function BodyDamage:setFoodSicknessLevel(arg0) end
bronze yoke
#

there won't be any framerate interference with your function because it happens on EveryTenMinutes which is a fixed rate regardless of framerate

slow hound
#

is sickness infection? vs FoodSicknessLevel?

#

or will you start to become sniffly

bronze yoke
#

sickness is sickness, but sickness is the 'final' value the game recalculates every frame based on your food sickness and infection

#

so if you change sickness directly it'll just get recalculated next frame and discarded anyway

#

for that reason if you want to 'add' sickness you do it through food sickness

obtuse pelican
# slow hound ```lua ---@public ---@param arg0 float ---@return void function BodyDamage:setFo...

I tried to incorporate this but now it seems to have an issue at line 8 but im not sure why:

function CheckFatigue()
    for playerNumber = 0, getNumActivePlayers() -1 do
        local player = getSpecificPlayer(playerNumber)
        local stat = player:getStats()
        local fatigue = stat:getFatigue()
        
        if fatigue >= 0.8 then
        local foodSickness = BodyDamage:getFoodSicknessLevel()

            if fatigue >= 0.9 then
                BodyDamage:setFoodSicknessLevel(foodSickness + .5)
            else
                BodyDamage:setFoodSicknessLevel(foodSickness + .3)
            end

        end

    end

end

Events.EveryTenMinutes.Add(CheckFatigue);
#

the .5 and .3 are just extremes for testing fyi

slow hound
#

You aren't getting the players bodydamage that i see? or im blind

#

i would assume this is showing nil for that line

obtuse pelican
#

Ohhh i completely forgot, yeah its working now thanks guys

slow hound
# obtuse pelican Ohhh i completely forgot, yeah its working now thanks guys

if you wanna base it from the moodle level 1-4 you can do something like

        local moodles = playerObj:getMoodles()
        local tiredLevel = moodles:getMoodleLevel(MoodleType.Tired)

        if tiredLevel > 0 then
            local sicknessIncreaseRate
            if tiredLevel >= 1 then
                sicknessIncreaseRate = 0.01
            elseif tiredLevel >= 2 then
                sicknessIncreaseRate = 0.02
            elseif tiredLevel >= 3 then
                sicknessIncreaseRate = 0.03
            elseif tiredLevel >= 4 then
                sicknessIncreaseRate = 0.5
            end
obtuse pelican
#

Okay gotcha, I might do that just for the last two tiers of fatigue.

obtuse pelican
#

I got one last question, is there a way to pause and wait until loading is done? It seems to throw an error when trying to run local stat = player:getStats() while loading in. It does this every time I create a new character or load the world

#

I mean it makes sense I guess, its trying to get stats of something that doesnt exist yet so if i could have a way to wait until everything is done loading before calling getStats I think that would fix it

mystic lava
#

I'm working on a mod that adds a repair item that will function like tape or glue. If I wanted to add this new item to repair recipes, it would probably be better practice to create new repair recipes that include the new repair item instead of overwriting vanilla repair recipes, but how do I do that? Should I create a new file that imitates the structure of the fixing file or would it be better to somehow append the new item to fixer recipes?

obtuse pelican
bright fog
#

You can most definitely add new repair items

bright fog
thick karma
#

@autumn pumice Well, you wrote a function, but you have to call it from somewhere. A function needs to be activated and provided with the data in its parentheses - writing it is not enough. You have to figure out how you expect to activate that function.

#

And then correctly do so.

autumn pumice
#

hey

#

idk any event what calls when any character eats smth

#

so i dont know how to

versed crane
#

there is a file called ISEatFoodAction with functions that are called when a player eats any food item

versed crane
#

D:\Steam\steamapps\common\ProjectZomboid\media\lua\client\TimedActions

vestal gyro
#

Is there a way to check if a player is wearing a certain clothing piece?

versed crane
#

what you want to do is extend the ISEatFoodAction:perform() function in this module in your own file to add extra functionality to it

#

essentially triggers your code after the playing is done eating

#

also ISDrinkFromBottle is the corresponding file for drinking from any drainable water source

autumn pumice
versed crane
#

haha all good i literally started coding pz mods like 2 days ago

autumn pumice
versed crane
#
local base_perform_eat = ISEatFoodAction.perform

function ISEatFoodAction:perform()    
    base_perform_eat(self)   
    -- do stuff here
end
versed crane
#

sorry was figuring out formatting code

#

in the discord text box

autumn pumice
autumn pumice
versed crane
#

you can try find the instance of the food being eaten by calling the self.item object

#

item has some methods that you can find on the pz javadoc

#

try self.item:getName()

autumn pumice
versed crane
#

im not sure myself entirely

#

but i think self is referencing the class that handles the inventory

autumn pumice
#

ok, then how to get player?

versed crane
#

getPlayer()

autumn pumice
#

k

#

lemme see the javadoc

versed crane
#

wish the javadocs had documentation

autumn pumice
#

cant understand

#

there nothing about it

#

or im blind

#

do i need use:
local plr = getPlayer()
or what

#

?

versed crane
#

yes getPlayer() gets the instance of your character

autumn pumice
versed crane
#

yep

autumn pumice
#

oh

#

wait a sec

versed crane
#

again im new to this so i cant explain why things are the way they are

versed crane
#

zombie.characters.IsoGameCharacter is the class that getPlayer() comes from

autumn pumice
#

lemme check

versed crane
#

sorry let me rephrase that: getPlayer() returns an object of class zombie.characters.IsoGameCharacter

autumn pumice
versed crane
#

ideally base_perform_eat should be the first thing to be called in this function

versed crane
#

the function is getPlayer() without a capital G

#

fix this as well then it will work

autumn pumice
#

oh

versed crane
#

dw about what i just wrote

autumn pumice
versed crane
#

yeah

autumn pumice
#

lemme check

versed crane
#

wait

autumn pumice
#

ye?

versed crane
#

its getPlayer() not GetPlayer()

autumn pumice
#

ok

versed crane
#

other than that i think it should work

autumn pumice
#

no its doesnt working

versed crane
#

i think say() doesnt work at least when i tried it didnt

#

do SayShout()

autumn pumice
versed crane
#

and restart your world

autumn pumice
versed crane
#

alright

autumn pumice
drowsy quest
#

Does anyone have the distribution script for food ready?

autumn pumice
austere sequoia
vestal gyro
#

Yeah

#

Everything is in there

#

Just have to do Ctrl+F to find the food you're looking for

drowsy quest
austere sequoia
# drowsy quest Canned

If you mean the random spawns of canned food in containers (kitchen cabinets, etc), check for the file I hinted you at and ctrl+f as goose said 🙂

drowsy quest
#

Ok, TKS

thick karma
#

In that case

#

It refers to the instance of the type of object on which you're currently operating

thick karma
#

DMing instead is fine but having the convo in public may be better

#

In that people can chime in when the other person helping you doesn't know something

manic magnet
#

@autumn pumice @versed crane self is effectively just a reference to the object that is currently being called. It's similar to this in C++ if you've ever done any work in that.

Anyway, at the end of the day it's simply a variable (of the table type) that is local to the current method. It automatically gets passed as the first argument to any functions you call in that method. Since it is a table, you can tack on additional variables via keys that get propagated the entire way through the method.

In essence it's just a handy way of managing variable data that defines the current state of an instance of an object in your code.

crisp fossil
#

hi, is there a way to programmatically trigger the Place Item from the context menu?

#

this one

manic magnet
manic magnet
#

@crisp fossil you can find the addOption call in lua\client\ISUI\ISInventoryPaneContextMenu.lua on line 3729 it looks like.

             local placeOption = context:addOption(getText("ContextMenu_PlaceItemOnGround"), items, ISInventoryPaneContextMenu.onPlaceItemOnGround, player);
#

ISInventoryPaneContextMenu.onPlaceItemOnGround is what is getting called there.

#

That function gets defined in the same file on line 3750

#
ISInventoryPaneContextMenu.onPlaceItemOnGround = function(items, playerObj)
    local playerNum = playerObj:getPlayerNum()
    local inventoryUI = getPlayerInventory(playerNum)
    local lootUI = getPlayerLoot(playerNum)
    if playerObj:getJoypadBind() ~= -1 and inventoryUI:isVisible() then
        updateJoypadFocus(JoypadState.players[playerNum+1])
        setJoypadFocus(playerNum, nil)
    end
    if inventoryUI:isVisible() and not inventoryUI.isCollapsed and not inventoryUI.pin then
        inventoryUI.isCollapsed = true
        inventoryUI:setMaxDrawHeight(inventoryUI:titleBarHeight())
    end
    if lootUI:isVisible() and not lootUI.isCollapsed and not lootUI.pin then
        lootUI.isCollapsed = true
        lootUI:setMaxDrawHeight(lootUI:titleBarHeight())
    end
    ISInventoryPaneContextMenu.placeItemCursor = ISPlace3DItemCursor:new(playerObj, items)
    getCell():setDrag(ISInventoryPaneContextMenu.placeItemCursor, playerNum)
end
crisp fossil
#

thank you for the reply. yeah this is my dead end because i dont know what to pass on items

#

i was looking where the addOption is defined for sometime now

halcyon fable
#

Is is possible to list every furniture in a building?

manic magnet
manic magnet
crisp fossil
ancient grail
#

Long shot but i had to try

Any modders here interested becoming admin staff of a server?

manic magnet
#

That gets called on line 732 of the same file we've been looking at in the main createMenu function, which also requires items as an argument. 😂

#

All the way back up on line 21:

-- MAIN METHOD FOR CREATING RIGHT CLICK CONTEXT MENU FOR INVENTORY ITEMS
ISInventoryPaneContextMenu.createMenu = function(player, isInPlayerInventory, items, x, y, origin)
#

@crisp fossil That function gets called in a lot of different places... so I guess at this point it depends on what you are looking to do?

manic magnet
crisp fossil
#

thank you so much for the help, i think i have a progress now. it does not place the item but just drop, but i think i can solve this now

hearty estuary
#

hello fiends 👋
does anyone by chance know if there's a good way of fetching a module from a different environment without having to add a table to the global namespace? i'm new to zomboid modding but familiar with lua so when i tried to store the result of a require as i'd usually do i ran into an error since the kahlua implementation doesn't return anything. these modules aren't meant to be public hence why i avoided putting them in the global namespace but is that usually the best option with zomboid modding? thanks

manic magnet
hearty estuary
# manic magnet The lua implementation is close, but definitely not 1:1. Can you give us more de...

for sure! i'm using a second file to add support for ModOptions to my mod and i assumed i'd be able to require that file and store it in a local variable (since other mods dont need access to it) but didnt realize that doesnt work
i've seen other mods use a global table for that so i know i can do that if i need to but ideally i'd like to be able to have that module run in the same environment as the main one for the sake of keeping things clean for myself and other modders

manic magnet
#

So it's a scope problem, is what I think you are saying? I haven't messed around with ModOptions at all, I probably should get around to it here one of these days. I assume, however, that there are probably things that can't be local for the ModOptions methods to interact with inside your mod? That could be the issue?

hearty estuary
#

ah scope is the word is was looking for, thanks lol
id like for all of my files to run in the same scope without reaching out into the global scope but i'm unsure of how to get both of them running in the same scope without using a global table

autumn pumice
#

its works

thick karma
#

I'll provide a pseudocode example below

hearty estuary
#

oh awesome, here's my current require path if anything stands out immediately

thick karma
#

media/lua/client/A.lua:

local A = {}

-- blah blah blah

return A
-- end of file

media/lua/client/B.lua:

local A = require("A")
thick karma
hearty estuary
#

i'll try that out, thanks

thick karma
#

You can see this done a lot in True Music Jukebox for diverse examples

#

Welcome to refactor any code you find in any of my mods on the Workshop. My name on Steam is the same as it is here

hearty estuary
#

i appreciate that, it seems like this is mostly a process of learning by example so i'm glad to have as many as possible

thick karma
#

Indeed it is

thick karma
#

So if you're testing a local module and want to temporarily make it global for testing, just type A = require("A") in console

#

Where A is the module / filename

halcyon fable
#

My final goal is to get the sum of the weight of everything inside a building (items inside containers, object etc.)

manic magnet
coarse sinew
halcyon fable
coarse sinew
mystic lava
bright fog
#

I have no idea, but I know some mods did it

#

And I don't think it's a recipe

#

Not sure tho

mystic lava
bright fog
#

Not sure tbf

#

Perhaps The Workshop ?

mystic lava
bright fog
#

👌

#

Look within crafting mods that add custom glue or some shit like that perhaps idk

muted garnet
#

What for in timedactions uses setJobDelta and setJobType? Like in fishing

function ISFishingAction:update()
   self.rod:setJobDelta(self:getJobDelta());
end
function ISFishingAction:start()
   self.rod:setJobType(getText("ContextMenu_Fishing"));
   self.rod:setJobDelta(0.0);
end
ancient grail
# mystic lava What would be a good way to do that? Shall I create a new file that imports the ...

You mean using the fixer or just the oncreate recipe thing?
It depends on what you want

If you want to add an item on top of the old one you would have to remove the old vanilla
I thing theres a recipe manager
I havent done this before

Another possible method
You could try and hide the old recipes

But if your recipe can co exist with vanilla then you dont have a problem
Just add your recipe

hearty estuary
#

it seems like the context menu calls FixingManager.getFixes(brokenObject) so you could follow that back to find where you can add valid fix items

mystic lava
#

However, my limited knowledge of coding provides that overwriting vanilla entries is not a good practice

ancient grail
#

Yeah dont overwrite
It will break stuff

bronze yoke
#

you can get repair scripts using the script manager or fixing manager but the fixers (items used to fix) are stored as a linked list which i'm unsure you'll be able to interact with

mystic lava
bronze yoke
#

i've never encountered pz actually use a linked list anywhere so it may not be exposed

#

nah, looks like it is exposed, so you might be able to do this?

#

seems like it would be kind of complex

hearty estuary
#

so if you want to make a blanket repair item that can repair any repairable item it might be a lot more involved than adding onto existing recipes

mystic lava
#

In that case, I may just make a script file to house new fixing recipes to incorporate the new repair item, then check that out and see if I can achieve the same results in a more clever and/or seamless way

hearty estuary
#

if you arent already looking through the decomplied zomboid code it might be pretty rough though

bronze yoke
#

this isn't toooo crazy but it's sort of the deep end of lua script editing

#

basically anything else you'd want to do this way would be far more streamlined

#

fixer and fixerskill have public constructors so you should be able to just create them and add them to the fixing's list

mystic lava
hearty estuary
bronze yoke
#

i wouldn't follow this guide, it's very old and the method it uses doesn't even work anymore

hearty estuary
#

oh crap i didnt even realize, is there a more up to date guide?

mystic lava
#

perhaps I shouldn't be trying to do this after having been awake 24hrs

bronze yoke
#

there isn't anything special you need to do to decompile zomboid specifically

hearty estuary
mystic lava
#

I feel like the neuron activation meme right now, not gonna lie

hearty estuary
#

i'm fairly new to zomboid modding so these are just what i've been able to figure out so far

bronze yoke
#

that guide is mostly for generating libraries and setting up capsid, which isn't something anybody uses anymore, it's very old and umbrella is better (as one of the creators of umbrella 😅)

hearty estuary
#

omg thank you for that, umbrella has been a massive help in my early stages so far

#

its been pretty difficult to figure out what is and isnt relevant to zomboid modding at the moment

bronze yoke
#

i can't blame you, i see that guide linked every fifteen minutes here, but i think it really pushes people away

hearty estuary
#

that makes a lot of sense, it definitely did not make me very excited to start modding either

#

now that i know i'll make sure to point people toward umbrella

mystic lava
austere sequoia
mystic lava
bronze yoke
#

it's a library for vscode for zomboid modding

#

you can install it with the lua extension's addon manager (NOT vscode's extension manager, there is another umbrella on there that's nothing to do with zomboid 😭), it'll give you some type checking and intellisense for zomboid functions

mystic lava
austere sequoia
#

What of those buttons do I have to click to find said umbrella extension? Tested several now, but hat no luck

#

(sorry, all of this programming stuff is still very new to me)

bronze yoke
#

with the lua extension enabled, press ctrl-shift-p and a menu should open at the top, type Lua Addon Manager and it should come up, and then it'll take you to a page where you can search for lua addons

austere sequoia
bronze yoke
#

do you have git installed?

#

i forgot it doesn't work when you don't have git and doesn't tell you you need it or give you a helpful error about it U_U

austere sequoia
#

is that a vscode extension?

hearty estuary
bronze yoke
hearty estuary
#

its used often for downloading software packages through the command line as well as maintaining your own

bronze yoke
#

you might need to restart your computer after installing it for it to work

#

(i think we all usually ignore those warnings LOL but it did actually come up for someone here)

hearty estuary
#

normally i dont restart either but i agree for Git i'd definitely play it safe and restart

austere sequoia
#

I just have to have it installed?

#

Oh, it worked 🙂 Thanks a lot!

#

Trying to learn coding it sometimes feels like the guys that invented all the stuff tried to make it extra hard, lol

hearty estuary
#

lol, i know what you mean

#

scripting languages are usually pretty friendly but as soon as i open up Java or C++ i feel like my mind is going to explode

#

i feel like its a lot of fumbling in the dark at first but as soon as you find the light switch it feels awesome

austere sequoia
#

I am already super thankful I discovered unity. I am one of those persons that actually need to see what is happening to understand what is happening. Tried learning java some years back, joined online forums and asked the guys there "how can I make visible what I wrote, so I can see it?". They did not even understand, what I meant, lol

mellow frigate
wraith hemlock
#

Maybe IS will look at that in the future?

mellow frigate
placid drum
#

Has someone tried to make third person or first person mod?

ancient grail
ancient grail
#

You can do this by adding another xml of whatever action you want to speed up
Add a boolean to trigger this instead of vanilla
a float var you can adjust and put it on the speed

muted garnet
#

What for in timedactions uses setJobDelta and setJobType? Like in fishing

function ISFishingAction:update()
   self.rod:setJobDelta(self:getJobDelta());
end
function ISFishingAction:start()
   self.rod:setJobType(getText("ContextMenu_Fishing"));
   self.rod:setJobDelta(0.0);
end
ancient grail
#

Instead of having it static
Ive done this for goose zed mod

ancient grail
muted garnet
#

thanks

nova socket
#

does anyone know a reliable way to detect which mod was removed from workshop

#

0 MB mods are getting on my nerve

vestal gyro
vestal gyro
#

We just found out from context which mods where deleted but yeah

bright fog
#

You just have to find the mod, which is uh easier said than done

vestal gyro
#

Yeah thats the hard part

bright fog
#

Also a tool could easily be made to check every mods workshop ID if it can be accessed

vestal gyro
#

Thats a neat idea

nova socket
coarse sinew
#

It writes in the console.txt what workshop item it gives error on download.

bright fog
# vestal gyro Thats a neat idea

Smthg like Chuck's tool to check reuploads but instead check the workshop ID
https://docs.google.com/spreadsheets/d/1JDO_jELKNQqpNVU_IbzgJ-gprxEU9Pn3kFsCLu_L1YE

nova socket
#

B42 better be having some QoL to this seriously.

#

Basically check if workshop item is even existing, don't load it and report to log or something.

bright fog
bright fog
#

Would also allow you to check if copies exist online

nova socket
#

You have pair of Mods= and WorkshopItems= and one of them might not be an actual workshop item anymore. You can only bubble sort this out reliably by having a collection

bright fog
#

Right ?

#

In it's config

#

So just take that

nova socket
#

yep

bright fog
#

That's all you need

#

Just make a script to check every workshopID

nova socket
#

lets check

nova socket
#

nevermind it just broke up when i copied it for some reason

nova socket
bright fog
#

It works

#

Bcs workshop IDs are just the link page

#

So just check if you can access the link

nova socket
#

entering mod id 1-by-1 just to figure out which one is a goner when you have 200+ mods on a server is not how you solve the problem with missing mods.

bright fog
#

Of course reupload tracker isn't adapted for this here, but the concept is here

bright fog
nova socket
#

this is just maddening i wanna read steam API now to know which page doesn't exist anymore

#

some JSON would be good

#

found it

#

If your mod doesn't exist anymore (for example 1234567890) you will get this

{"response":{"publishedfiledetails":[{"result":9,"publishedfileid":"1234567890","language":0}]}}

If its published you will get something like

{"response":{"publishedfiledetails":[{"result":1,"publishedfileid":"3066276504","creator":"76561198063078194","creator_appid":108600,"consumer_appid":108600,"consumer_shortcutid":0,"filename":"","file_size":"338850","preview_file_size":"73804","preview_url":"https://steamuserimages-a.akamaihd.net/ugc/2110558879653840982/54BA9C9C5BD57F318F43130BBC5DD9EA735D24DE/","url":"","hcontent_file":"2367266303455595942","hcontent_preview":"2110558879653840982","title":"Container Tags","file_description":"[h2]More time to play, less time to sort![/h2]\r\nAdds an ability to add text tags to any containers in the game with simple context menu and UI.\r\n\r\n[h1]FAQ[/h1]\r\n[list]\r\n\t[*][h2]Yes it is safe to add or remove this mod mid-game.[/h2]\r\n        [*][h2]Yes it does support multiplayer (with factions)[/h2]\r\n        [*][h2]You can switch modes between: personal tags, faction tags and disabled using panel button (example below)[/h2]\r\n[/list]\r\n[img]https://steamuserimages-a.akamaihd.net/ugc/2276070691923591956/3526F7C6821BD6BB78FE66B48375E50DD09C767F/?imw=637&imh=358&ima=fit[/img]\r\n[h1]How to Use?[/h1]\r\n[list]\r\n\t[*] Subscribe to the mod.\r\n\t[*] Right click on any container in the game.\r\n[/list]\r\n\r\n[h1]Interface preview[/h1]\r\n[list]\r\n\t[*][img]https://steamuserimages-a.akamaihd.net/ugc/2110558879653865249/89B96DE23379B622F524122006FE0CDA110C7617/?imw=5000&imh=5000&ima=fit[/img]\r\n[/list]\r\n\r\n[h1]Contribute[/h1]\r\n[url=https://patreon.com/dismellion][img]https://steamuserimages-a.akamaihd.net/ugc/2274944075017679576/12820D94B3F7FAD52932A4E4A3C37DC670E5E43F/?imw=256&imh=256&ima=fit[/img][/url]\r\n[url=https://bitbucket.org/demellion/pzmods/src/master/][img]https://steamuserimages-a.akamaihd.net/ugc/2274944075017676323/F052909A8484950B2C582F88DE7497BD6BBE7317/?imw=256&imh=256&ima=fit[/img][/url]\r\n\r\nWorkshop ID: 3066276504\r\nMod ID: containertags","time_created":1698665558,"time_updated":1701280800,"visibility":0,"flags":134223360,"workshop_file":false,"workshop_accepted":false,"show_subscribe_all":false,"num_comments_developer":0,"num_comments_public":134,"banned":false,"ban_reason":"","banner":"76561197960265728","can_be_deleted":true,"app_name":"Project Zomboid","file_type":0,"can_subscribe":true,"subscriptions":82652,"favorited":2222,"followers":0,"lifetime_subscriptions":102894,"lifetime_favorited":2446,"lifetime_followers":0,"lifetime_playtime":"0","lifetime_playtime_sessions":"0","views":55600,"num_children":0,"num_reports":0,"tags":[{"tag":"Build 41","display_name":"Build 41"},{"tag":"Interface","display_name":"Interface"},{"tag":"Misc","display_name":"Misc"},{"tag":"Multiplayer","display_name":"Multiplayer"}],"language":0,"maybe_inappropriate_sex":false,"maybe_inappropriate_violence":false,"revision_change_number":"10","revision":1,"ban_text_check_result":5}]}}
#

so if result field in array of publishedfiledetails is 9 its not there anymore

#

bash/JS can solve that quite easily

nova socket
#

time_updated is a nice thing too

nova socket
#
$ node workshop_checker.js
[ERROR] 1234567890 doesnt exist on Steam Workshop
[OK] Cant Grab This [B41+ MP] [2927605405] was lastly updated on Mon, 06 Feb 2023 01:49:10 GMT
[OK] Immersive Currency [2929712315] was lastly updated on Wed, 13 Dec 2023 21:57:02 GMT
[OK] Immersive Shops [Vehicles Update] [3040894629] was lastly updated on Sat, 06 Jan 2024 22:40:01 GMT
[OK] '82 Jeep J10 [2886832257] was lastly updated on Tue, 11 Apr 2023 18:49:04 GMT
[OK] Barbed Wire + [3095911903] was lastly updated on Mon, 04 Dec 2023 20:22:36 GMT
[OK] Gunsmith [3105394500] was lastly updated on Wed, 28 Feb 2024 20:23:57 GMT

So far so good

bright fog
nova socket
#

ill push it to my mods repo soon and link it

bright fog
#

Nice

nova socket
# bright fog Nice
$ node workshop_checker.js

---
[OK] Immersive Currency [2929712315] was lastly updated on Wed, 13 Dec 2023 21:57:02 GMT
[OK] Immersive Shops [Vehicles Update] [3040894629] was lastly updated on Sat, 06 Jan 2024 22:40:01 GMT
[OK] Container Tags [3066276504] was lastly updated on Wed, 29 Nov 2023 18:00:00 GMT
[OK] Gunsmith [3105394500] was lastly updated on Wed, 28 Feb 2024 20:23:57 GMT

---
[ERROR] 1234567890 doesnt exist on Steam Workshop!
[FATAL] thisshouldbenumber is not a valid Steam Workshop id, should be a number!

Looks something like this

bright fog
#

Nice

#

Looks clean

#

You think you could have something to give the mod ID too if it gives out an error ?

#

Not sure how much complexity that would add however, that's already pretty good as it allows players to check their localy downloaded workshop mods and find the mod with the workshop ID anyway

#

Just a neat feature I thought about

nova socket
#

You can find those in your server settings.ini

bright fog
#

My idea was it would give the mod ID linked to the workshop ID but you can't access that info if the workshop page doesn't exist anymore

nova socket
bright fog
#

My point wasn't that you have to do it with the info it gives back

#

But it's okay it was an idea I thought about when thinking about using the reupload tracker

#

Like I said, getting the workshop ID which doesn't exist anymore is already very good

bright fog
#

Do you think some easier to use would be doable to run the script ?

nova socket
#

regarding "tracking" you have to to have some history of them because once the Steam Workshop item is deleted by author or Steam service, they send a push notification to every subscriber online to remotely delete the mod folder related to it too, so its not even kept on your PC once you are online.

bright fog
#

I'm personally not familiar with json and how to actually run these. And I'm sure having something easier to use for server owners would be great

nova socket
bright fog
bright fog
nova socket
#

I mean there is no better user-friendly format, this is just one single .js snippet

#

You can haul and host web page for that of course if you wanna share

bright fog
#

I mean I know you wrote something that explains how to run it, but my idea was to have something like Chuck's reupload tracker, like an excel sheet online for people to use is very easy for anyone to use, anyone and on any device basically

#

It's already fairly good tbf

nova socket
#

im not a big fan of excel as database

bright fog
#

I'll share it on the modding Discord

bright fog
nova socket
bright fog
#

Hmm

#

You really should join the PZ modding Discord lol

nova socket
#

Kinda always thought this is the place

#

Also somebody should fix the startup unit settings for linux in Dedicated Server section because

ExecStart=/bin/sh -c "exec /opt/pzserver/start-server.sh </opt/pzserver/zomboid.control"

Works very poorly when something bad happens and /opt/pzserver/zomboid.control is left behind as a plaintext file.
Why? Because last message stored in it is quit and server starts... and shuts down itself again because of < directive feeding it a said quit command right after

#

some rm is in order there

#

maybe even better to just :> /opt/pzserver/zomboid.control instead

bright fog
#

Welp I personally don't know shit about servers

#

But perhaps your talents in it could be useful to the Discord and we could make a section about servers where you can share specific guides on the subject as well as shared your work there

#

That way whenever someone joins they can easily have a section on the subject idk

alpine scroll
#

Anyone here knows if the Weird Expanded Helicopter event should create the weird zombies on a server? Because as I was checking the /lua/server folder, the first line in the code has a if isServer() then return end, so technically its either on the wrong folder or it wouldnt run

bright fog
#

isServer() means it won't run server side

#

But it will run client side

#

It's just a block to stop the server in MP to run the file

alpine scroll
#

Got it

#

I was doing something wrong

#

But now I managed to make it so, depending on how much hp you spawn the zombie (I am mainly using createhorde2) it gets a specific characteristic, like become a crawler, its a runner, etc. and then it resets its hp to 1

#

Yes, createhorde2 has a -crawler tag, however the zombie doesnt get set with a canWalk(false) , so it spawns lying down and then gets up

bright fog
#

Interesting

wraith hemlock
#

Don't I still have to write out the attack on keypress for that?

ancient grail
wraith hemlock
#

I'm not sure I would specify the only difference to the game being that I want it to use the custom anim node. For spears and stuff, that's determined by SwingAnim =

ancient grail
#

You can create xmls
You don't need to overwrite anything
Just need to tell it that this player is going to do a different animation with different stuff
Just add a boolean

ancient grail
burnt quartz
#

Where and from which folder do we start making mods? ı watch some videos bu ı cant find starter docs

ancient grail
#

You can customize the speed there too

#

Even how zeds will react if you want to

#

The animset xml part of pz is powerful
But theres no documentation
So its really hard to manipulate

wraith hemlock
#

oh, is this the speed of attacks, or the idle animations?

#

I see in your melee 2handed there is just KatanaCharge.

#

I need to specify. Its the weapons actual swing animations and not its idle stances that I'm trying to change.

#

I'll try this out anyway.

manic magnet
burnt quartz
#

Is there a code that checks if there is a dead body in front of or behind the door?

bright fog
#

Probably not ?

manic magnet
# burnt quartz Where and from which folder do we start making mods? ı watch some videos bu ı ca...

In windows go to the %USERPROFILE%\Zomboid\Workshop directory and create a directory inside there. You want to place Contents, preview.png (the steam preview image) and workshop.txt inside that directory. All of this is to set you up for pushing your mod to steam.

Inside the Contents directory you place your mods directory. Inside here, you place any mods that you want to have included in your workshop download. Any mods inside this mods directory will be pulled down and installed when a user subscribes. There are plenty of Workshop items that simply contain one single mod.

For instance, if I wanted to create a mod called My Awesome Mod I would do the following:

  • Create a directory called MyAwesomeMod located at %USERPROFILE%\Zomboid\Workshop.
  • Create the preview.png and workshop.txt file insed the MyAwesomeMod directory.
  • Create another directory inside the MyAwesomeMod directory called Contents.
  • Create another directory inside the Contents directory called mods.
  • Create yet another directory inside the mods directory called MyAwesomeMod

You can use this reference for creating the directory structure from inside your mod folder (the final one, now located at %USERPROFILE%\Zomboid\Workshop\<mod name>\Contents\mods\<mod name>): https://pzwiki.net/wiki/Mod_structure

Please note that the wiki isn't exactly great for explaining how to mod from that point. There is some good stuff on it. It's just not really thorough.

Feel free to ask questions. ❀

wraith hemlock
#

If my lua isn't in folder media>lua>client, it won't work, right?

#

i had my lua files in lua itself and i just realized that this might have been the reason they didn't work.

slow hound
#

Correct

wraith hemlock
#

Yeah, I tried the boolean method, it doesn't seem to be working for the custom xml.

#

Wait, it does! I just had to unsub from my workshop mod to get it to use the updated version 😄

#

YES!

slow hound
#

Grats!

#

Doesn’t it feel good

wraith hemlock
#

@ancient graildo you have a donate link, dm me.

slow hound
#

That’s awesome

wraith hemlock
#

now i can make suits of armour to augment players to run and attack faster

#

as well

#

There are still some things to iron out like dealing with the randomness of the animation that can cause some noticeable pauses/delays between some attacks and not others. But this is a lot of progress.

ancient grail
bright fog
#

What's the issue ?

#

That doesn't sound like the same issue than at all

#

Not at all

#

The delay is most likely the hitting delay

#

The attack delay

ancient grail
drifting ore
#

Hello to anyone who can help. I am trying to make my first mod and when I go to test it nothing is added, nothing happens. I only have this 1 mod load I have also included some print string for example, print("DynamicSupplyDrops script is loading..."), although when attempting to test I get no debugs in my output log. If anyone can help me figure out how to print debugs into the output log that would be great!

silent bloom
#

Does anyone know if its possible to combine all of these onto one line in the localization file? It feels redundant to have these as separate entries when they will be translated the same, but the parts are unique. I tried to use a * character but it didn't work.

#

To answer my own question for anyone who comes across this in the future through searching, it seems the answer is no. The devs did something similar in their own localization file and it would seem each has to be its own entry. Oh well.

dawn pagoda
#

Anyone with experience know if its actually feasible to make a mod that lowers the quality of a wall if it take enough damage to be at the same level as said level?
For example level 3 takes 50 damage it becomes a level 2.
Im fairly sure it should be possible but i dont have enough experience to know if its possible to do so without it being a huge lag fest.

vestal gyro
#

almost anything is possible with enough restless nights of reading java documentation and enough testing

bright fog
grizzled fulcrum
#

Project Zomboid's logs have a log filter category like DEBUG, LOG, WARN, ERROR. In lua, you can make it LOG by using print() and ERROR by using error() but not the other two. Any possible way? It's not that serious because I am already appending [WARN] prefix to msg