#mod_development

1 messages · Page 228 of 1

hidden compass
#

Hello everyone!

I have a question about image files. The vanilla images look clear even when scaled up with the drawTextureScaled function, etc., but my own images look blurred. What is the difference? I don't think it is a size issue, since the vanilla images (extracted from the pack file) also have the same icon size (e.g. 32 x 32).

bright fog
hidden compass
sour island
#

I've ran into the same issue - not sure why compression impacts textures loaded using get texture. There's also issues with textures that are larger than the maximum set in options (not that this is impacting you right now).

hidden compass
#

Sorry, I solved it myself. The same PNG file was displayed clearly when from the pack file. I will also try turning off the compression option, thanks!

sour island
#

I never tried to pack my sprites before. That's interesting, I wonder if there's a performance benefit.

pine patio
#

Hello, quick question, how can I see the current coordinates of my character?

neon bronze
#

player:getX()
:getY()
:getZ()

manic magnet
#

I'm pretty certain that .pack files were made for compression purposes to allow transfer of data over networks (HTTP transfers specifically) faster in Java. I doubt it has a performance benefit, compression generally is the opposite of a performance benefit, unless your bottleneck is the network as opposed to the disk. It probably has a slight size on disk benefit, though.

#

The only reason I know about .pack files is because I did a lot of work with Tomcat servers back in the day... I had RIM as a client. Those were dark times... 😅

thick karma
manic magnet
#

Do you think it would be inappropriate to make an occupation for Marine and make one of their bonuses the ability to eat crayons? (I can say these things, because I am a Marine. 🤣)

thick karma
manic magnet
thick karma
#

Lol I probably read too much into most things.

#

To answer the question I would have preferred to answer: yes, that would be classic comedy.

#

Make that mod.

manic magnet
manic magnet
sour island
#

Still testing the update to Game Night. Doing final passes on the two new add-ons and the new volumetric render feature.

#1215626507846688808

👉👈 If anyone wants to test.

lunar robin
#

Maybe this is a dumb question, but guys, what is the best way to overwrite vanilla function?
I need to overwrite (remove) boolean value playerObj:getCurrentSquare():Is(IsoFlagType.exterior) in:
File: ...\media\lua\client\ISUI\ISWorldObjectContextMenu.lua
Function: ISWorldObjectContextMenu.createMenu (line 556)

if door and not door:IsOpen() and doorKeyId then
    if playerInv:haveThisKeyId(doorKeyId) or not playerObj:getCurrentSquare():Is(IsoFlagType.exterior) then
        if test == true then return true; end
        if not door:isLockedByKey() then
            context:addOption(getText("ContextMenu_LockDoor"), worldobjects, ISWorldObjectContextMenu.onLockDoor, player, door);
        else
            context:addOption(getText("ContextMenu_UnlockDoor"), worldobjects, ISWorldObjectContextMenu.onUnLockDoor, player, door, doorKeyId);
        end
    end
end

Can I just copy the whole file and make needed edits and it will work, or I can somehow overwrite the conditional statement for this exact code block?

desert kelp
#

call it like this

ISWorldObjectContextMenu = ISWorldObjectContextMenu or {}

then add the whole function you want to change

nocturne valley
#

hi, i'm making a mod and it is all going well, exept for the scratch texture that for some reason is black. here's some pictures of the bug + the scratch texture

coarse sinew
# lunar robin Maybe this is a dumb question, but guys, what is the best way to overwrite vanil...

God, no! That is the main function to build the Context Menu. You can remove the ContextMenu_LockDoor and ContextMenu_UnlockDoor and do your logic. Like this:

---@param player integer
---@param context ISContextMenu
---@param worldobjects table
---@param test boolean
local function onFillWorldObjectContextMenu(player, context, worldobjects, test)
    if test and ISWorldObjectContextMenu.Test then return true; end
    if test then return ISWorldObjectContextMenu.setTest(); end

    local playerObj = getSpecificPlayer(player);
    local playerInv = playerObj:getInventory()
    local door, doorKeyId = nil, nil;

    for _, worldObj in ipairs(worldobjects) do
        if instanceof(worldObj, "IsoDoor") or (instanceof(worldObj, "IsoThumpable") and v:isDoor()) then
            door = worldObj;
            if instanceof(worldObj, "IsoDoor") then
                doorKeyId = worldObj:checkKeyId()
                if doorKeyId == -1 then doorKeyId = nil end
            end
            if instanceof(worldObj, "IsoThumpable") then
                if worldObj:getKeyId() ~= -1 then
                        doorKeyId = worldObj:getKeyId();
                end
            end
        end
    end

    context:removeOptionByName(getText("ContextMenu_LockDoor"));
    context:removeOptionByName(getText("ContextMenu_UnlockDoor"));

    if door and not door:IsOpen() and doorKeyId then
        if playerInv:haveThisKeyId(doorKeyId) or not playerObj:getCurrentSquare():Is(IsoFlagType.exterior) then
            if not door:isLockedByKey() then
                context:addOption(getText("ContextMenu_LockDoor"), worldobjects, ISWorldObjectContextMenu.onLockDoor, player, door);
            else
                context:addOption(getText("ContextMenu_UnlockDoor"), worldobjects, ISWorldObjectContextMenu.onUnLockDoor, player, door, doorKeyId);
            end
        end
    end

end
Events.OnFillWorldObjectContextMenu.Add(onFillWorldObjectContextMenu)
lunar robin
#

Oh! Thank you!
Mind asking as well, does this logic translate also to the player pressing E on a door from inside? Like if the door's closed (without boolean value) he can't open it right?

#

I suspect that logic implements from the context menu builder?

coarse sinew
#

No, I think the interactions using E are in Java side, and I don't think they can be changed.

hallow cradle
#

Hello everyone. For some reason it's not showing in my mod when I turn on Project Zomboid. The mod is supposed to be for breaking stones into 4x chipped stones (1. pick up stone 2. get hammer/club_Hammmer/stone_hammer, etc.. 3. right-click on the stone and break it) . Is there something wrong with this code? btw am I supposed to have also "function file for that" ?

hardy ingot
#

Also Chipped stone is "SharpedStone"

#

Always good to check the Item IDs on the Wiki, some have weird names

hallow cradle
#

thank you ill try it

hallow cradle
#

Hmm it's still not working... Do I also need model ground file ?

#

i am planning to use stone and "sharpedstone" from game file do i still need to make that "model ground file" ?

thick karma
# desert kelp call it like this ISWorldObjectContextMenu = ISWorldObjectContextMenu or {} t...

@lunar robin and just to second what Elyon is saying, doing it the way Cyclone suggests would be pointless. ISWorldObjectContextMenu definitely exists before your mod files load, and if it did not already exist and you somehow added your function to an empty table of the same name before the original table existed, then your modded function would be overwritten by the original function when the vanilla file created the original table. So this is the wrong way for more than one reason.

sour island
#

I'll be on later tonight, but if you guys have buddies feel free to hop on anytime.

warped yew
#

Hello everyone, Is it possible to somehow compile the mod without leaving the game? and check it immediately. Local/client

thick karma
#

There are a few ways, but it depends on your mod. Reloading Lua mods that decorate original functions will redecorate them, causing the decoration to fire twice. Also, reloading Lua mods that add functions to events or objects will not change the copy of the function that is attached to those events / objects... You would need to remove the modded function, change it, and add it back.

#

But if you don't need to reload any functions attached to stuff or any decorations, you can reload individual Lua files via the F11 debug menu if you launch game with the -debug launch option

#

@warped yew

#

You can search for files you want to reload by name via empty box under the white-bg file viewer.

#

It's a very small search box with no default text so it's easy to miss

#

You can also overwrite functions and other objects via the debug console in debug mode. @warped yew

#

To try alt versions of them

#

But same rules apply to decorations and attached functions

neat herald
#

Does anyone know where I can find the sound files or the different text options for sounds for recipes?
Shooting in the dark and reusing old recipes sounds that I know work.

bronze yoke
#

look in the files prefixed with sounds_ in media/scripts/

drifting ore
#

Anyone got template files for cars?

drifting ore
#

Or any idea on how to make a car mod?

echo lark
#

is it possible to somehow write a recipe that requires a total of 10 items but those items can be diferent items? like if i want a recipe that requires 10 bags of chips, but doesnt have to be 10 of the same chip id, and can be like 4 crisps 3 crisps2 and 3 crisps4

bronze yoke
#

frustratingly no

#

i think if it's a food item you can make it take a total amount of hunger from a group of items

echo lark
# bronze yoke frustratingly no

damn. yeah i wana do it for items that are basically the same thing but diferent ids. chips/pop/crossword mags/wordsearches. oh well, ill try someting else, thanks!

neat herald
bronze yoke
#

this one's a bit more complicated, it sets an animation variable, but i think the way it's set up most of the filenames in media/AnimSets/player/actions should be valid

#

somebody should probably make a list for this 😅

neat herald
abstract cairn
#

Can someone tell me why this isn't working? (Having trouble with netcode, went into a hosted world to test it).
On a quest for the forbidden net code knowledge lmao
(Server file)

local function CA_OnZombieDeadServer(zombie)
    zombie:getModData().CAMainData = {}
    print("Zombie Died Server Side!")

    sendServerCommand('CA', 'TestCommand', { message = "Hello! This is sent to client!" })

end

Events.OnZombieDead.Add(CA_OnZombieDeadServer)

(Client file)

local MyModuleServerCommands = {}

function MyModuleServerCommands.TestCommand(args)
    print(args.message)

    for playerIndex = 0, getNumActivePlayers() -1 do
        local playerObj = getSpecificPlayer(playerIndex)
        playerObj:Say("Received Message!002");

    end


end

local function OnServerCommand(module, command, args)

    for playerIndex = 0, getNumActivePlayers() -1 do
        local playerObj = getSpecificPlayer(playerIndex)
        playerObj:Say("Received Message!001");

    end

    if module == 'CA' then
        MyModuleServerCommands[command](args)
    end
end

Events.OnServerCommand.Add(OnServerCommand)
bronze yoke
#

what is happening exactly? does the serverside print show up? do you get the Received Message!001?

abstract cairn
#

As in like the server zombie died print

thick karma
#

media/lua/????/????/????.lua?

thick karma
#

Come to think of it, where is your server file? And do you have any errors in console.txt?

earnest minnow
#

Seems like the Random Vehicle story for the Tire Change event consistently uses vehicles in the "Good" vehicle zone. Can anyone confirm this for me?

manic magnet
earnest minnow
manic magnet
#

But you are right. I have never come across anything other than vehicles in the "Good" vehicle spawn zone for that event... interesting. That's still anecdotal, obviously. But it's interesting!

earnest minnow
#

I just did a test in debug mode spawning them multiple times and they only spawn offroad, SUV, and sports cars (seemingly at the same % rate)

#

but the base are definitely different

#

if I had to guess, they are spawning them in with the default (0.7) baseQuality but with a much higher chanceToPartDamage

manic magnet
#

I wonder if it's possible to alter that with a mod...

#

I haven't messed with vehicle stories at all.

earnest minnow
#

Definitely possible for the vehicle zones. They are all lua scripts

manic magnet
#

Oh... true. You could just add more vehicles to the spawn list for the zone.

#

So the question here is whether vehicle stories pulls vehicles from its own separate list or if it pulls them from a specific zone spawn list?

earnest minnow
#

the lua file states in the comments that the carcrash event uses this spawnrate so it seems to pull for specific zones

manic magnet
#

Interesting. I will definitely be digging around on this when I get a chance.

frank elbow
#

Random vehicle stories are hardcoded; the Java code grabs the VehicleZoneDistribution table and essentially converts it to a HashMap

#

Same for random building & zone stories. For the changing tire one see RVSChangingTire; the "good" is hardcoded in spawnElement

frank elbow
manic magnet
#

Thanks for the knowledge @frank elbow ❤️

earnest minnow
#

Sweet. That's exactly the info I need!

#

this.addVehicle(var8, var2.position.x, var2.position.y, var7, var2.direction, "good", (String)null, (Integer)null, (String)null);
there it is

#

no info on baseVehicleQuality so I suppose the value is hidden somewhere

#

it's definitely not the same value as "good" because they would all spawn at high quality

eager wharf
#

i have no experience in coding or modding at all

#

how difficult would it be for me to make TV stations broadcast normally indefinitely

#

and possibly add some custom news announcements on each existing channel

abstract cairn
# thick karma Where is the client file saved?

Sorry for late response! Got on much later today,

client is in
media/lua/client/filename.lua

server is in
media/lua/server/filename.lua
I have a shared one but in the shared folder but it doesnt really impact it.

I realized it might be because of the testing method today as I was thinking about it...
Do you know how the server and client commands work during each possible scenario? And also how the server and client files work depending on each scenario?
IE the 3 possible ones,
Playing solo/singleplayer
Playing in a Hosted world
Playing in a dedicated server (connecting to a dedicated server running the mod)

I realized that I actually never checked stuff like that prior and just assumed it was the same as Godot, Unity, UE5 etc.

I wasn't getting any errors I don't believe, maybe, I might do some more testing in a bit (gonna eat first)

abstract cairn
bronze yoke
#

hosted and dedicated pretty much behave exactly the same

#

hosted internally just runs a dedicated server in the background, it's not one shared environment like singleplayer is

muted garnet
#

I want to create a user interface window with yes/no buttons, like the trading window in vanilla, using client and server commands, but at the moment of calling the commands the code crashes, please tell me how to fix it, does anyone know, this code should display a window with a choice for the player to whom the request was sent:

client:

ISWorldObjectContextMenu.SendAnswerWindow = function(worldobjects, playerObj, clickedPlayer)
    print(playerObj)
    print(clickedPlayer)

    if playerObj and clickedPlayer then
        print("players data successfully transferred")
        sendClientCommand("123", "TradeRequestSent", playerObj)
    end
end

function receiveTradeRequestSentNotification(senderName)
    local player = getPlayer()
    local modal = ISModalDialog:new(getCore():getScreenWidth() / 2 - 175,getCore():getScreenHeight() / 2 - 75, 350, 150, getText("IGUI_TradingUI_Youreceivedtraderequest", senderName), true, nil, ISTradingUI.onAnswerTradeRequest);
    modal:initialise()
    modal:addToUIManager()
    modal.requester = player;
    modal.moveWithMouse = true;
    ISTradingUI.tradeQuestionUI = modal;
end

Events.OnServerCommand.Add(function(command, player, ...)
    if command == 'TradeRequestSent' then
        receiveTradeRequestSentNotification(...)
    end
end)

server:

Events.OnClientCommand.Add(function(command, playerObj, recipientName)
    if command == "TradeRequestSent" then
        sendServerCommand(playerObj, 'TradeRequestSent', recipientName)
    end
end)

code fucks up at this line:
sendClientCommand("123", "TradeRequestSent", playerObj)

bronze yoke
#

the third argument should be a table

#

e.g. sendClientCommand("123", "TradeRequestSent", {playerObj})

coral zealot
#

Hi im new to modding, can anyone help me find out why it's not showing ingame in the mods ?

bronze yoke
muted garnet
#

that is, first I need to get the player’s ID and then send it?

#

cuz there is an error 'Can`t save key' with playerObj

bronze yoke
#

yeah, you can't send most kinds of objects

#

you can mostly only send basic types (number, string, table, etc)

muted garnet
#

I received the player id, but after clicking the context menu nothing happens, prints are displayed only in the SendAnswerWindow function, can you help me pls?:

ISWorldObjectContextMenu.SendAnswerWindow = function(worldobjects, playerObj, clickedPlayer)
    print(playerObj)
    print(clickedPlayer)

    local playerID = playerObj:getOnlineID()

    print(playerID)

    if playerObj and clickedPlayer then
        print("players data successfully transferred")
        sendClientCommand("123", "TradeRequestSent", {playerID})
    end
end

server:

Events.OnClientCommand.Add(function(command, playerID, recipientName)
    print("123abc")
    local recipientID = recipientName:getOnlineID()
    local requester = playerID:getPlayerByOnlineID()
    if command == "TradeRequestSent" then
        print("abcdeftd")
        sendServerCommand(requester, 'TradeRequestSent', {recipientID})
    end
end)
bronze yoke
#

the args for your OnClientCommand function are out of order

#

but that shouldn't stop the first print in that function from happening, so i don't know what's happening there

muted garnet
#

maybe in client I need to change first arg to playerID and third arg to clickedPlayerID?

muted garnet
bronze yoke
#

well server prints don't output to the console, that's just a client log

muted garnet
#

so where can I check they?

bronze yoke
#

check Zomboid/coop-console.txt

abstract cairn
abstract cairn
abstract cairn
abstract cairn
bronze yoke
#

it's not

#

it really bugs me that they put the one argument that's different for the two events in between them instead of at the end 😅

muted garnet
#

@bronze yoke thanks for the help

abstract cairn
#

or ig i could just

#

scroll up and see the mega chad who made the trade UI

#

wait no

#

i have it right

#

WHY IS IT NOT WORKING THEN AAA

i shall now debug heheheha

eeey got it to work

main swan
verbal yew
#

Guys, which moodle index for cold?

#

MoodleType.Cold?

#

or ModleType.HasCold?

#

MoodleType.Panic - it's stress?

abstract cairn
verbal yew
#

what is getSickness? it's not cold, what it is?

#

and how to get cold (like sick, when character have cought)

bronze yoke
#

the sickness you get from being infected, drinking bad water, eating rotten/raw food

#

MoodleType.HasACold

bronze yoke
#

poison causes sickness, it isn't sickness itself

#

same with infection and fake infection

verbal yew
#

Anti-overheating in normal (relatively) condition :D

local function lesstemperature()    
    local player = getPlayer();

    local body = player:getBodyDamage();
    local moodles = player:getMoodles();
    local stats = player:getStats();
    local currentInfectionRate = (player:getHoursSurvived()-body:getInfectionTime())/body:getInfectionMortalityDuration();
    local currentTemperature = player:getBodyDamage():getTemperature(); -- 37.000, 37.5

    if currentTemperature > 37.0 
     and moodles:getMoodleLevel(MoodleType.HeavyLoad) < 3    -- не должно быть конкретного перегруза
     and moodles:getMoodleLevel(MoodleType.Pain) < 4        -- не должен испытывать сильнейшую боль
     and moodles:getMoodleLevel(MoodleType.Panic) < 4        -- не должен испытывать сильнеёшую панику
     and moodles:getMoodleLevel(MoodleType.HasACold) < 1    -- не дожен быть простужен
     and body:getHealth() > 50                                -- не должен быть в хламину без здоровья
     and body:getPoisonLevel() < 25                            -- не должен быть отравлен
     and stats:getSickness() < 0.25                            -- не должно быть тошноты
     and currentInfectionRate < 0.05                        -- не должно быть больше 5% зомбификации
    then
        player:getBodyDamage():setTemperature(currentTemperature-0.2);
    end
    
end

Events.EveryOneMinute.Add(lesstemperature);
abstract cairn
#

is there an event callback for zombies despawning or being recycled? Just asking for funni

bronze yoke
#

nope

hardy skiff
#

Hi guys, is it possible to replace the CarMechanicsOverlay for vanilla vehicles with a new one? tried to assign new values to the element but the original mechanics overlay still remains. No error popped up.ISCarMechanicsOverlay.CarList["Base.PickUpTruckLightsFire"] = ISCarMechanicsOverlay.CarList["Base.93chevySuburban"]; ISCarMechanicsOverlay.CarList["Base.PickUpVanLightsFire"] = ISCarMechanicsOverlay.CarList["Base.90pierceArrow"];

peak nymph
#

Hi all
I'm having trouble including a library mod as a requirement of my mod
I am using TchernoLib
If I include it on my mod.info file in this format
require=TchernoLib
Then my mod does not seem to load at all, no items present in game, tab missing from item spawner admin menu

If I don't include this I get this error
`function: CCharcoalMound.lua -- file: CCharcoalMound.lua line # 3 | MOD: Hiemas's Survival Kit

ERROR: General , 1712910408414> 0> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: initCGO of non-table: null at KahluaThread.tableget line:1689.
...
function: CCharcoalMound.lua -- file: CCharcoalMound.lua line # 3 | MOD: Hiemas's Survival Kit`

In this file (media\lua\client\CharcoalMound\CCharcoalMound.lua)
require 'GlobalObject/CGlobalObjectCreator' require 'CharcoalMound/SharedCharcoalMound' ShGO.initCGO('charcoalMound')

And i'm not sure what i'm doing wrong or why it can't access ShGO from the Library

Edit: NVm, turns out I just forgot to enable the lib in the steam workshop config for the server

worn geode
#

Hi all,
I am working on making a small mod for myself, some extra map icons cause you know cant have too many of them. I noticed that Extra Map Symbol mod has a github archive of their work so I am heavily using their mod as a template (unless there is a more updated way of doing so) - huge shout of to them - however one thing I noticed is that all their images are 20x20 px. Is there a way we can have big px sizing and having automatic transforming of px sizing. I loose a lot of detail if i make it a larger format and then scale down myself to the point where I might as well just write instead :/

abstract cairn
#

Anyone know what this is?

worn geode
#

if i would take a stab in the dark its whatever the time is that the last zombie saw the player

#

idk where you are looking to see this so i can only assume ¯_(ツ)_/¯

abstract cairn
thick karma
#

Iirc

#

I am pretty sure I use this in Meditation as a determining factor in whether player is allowed to become invis.

worn geode
true plinth
#

sorry to the necropost, but your issue is a major issue encoutered by many mods dev : you cannot send container contents from server to clients.
The trick is to apply your custom "change container contents" to every clients (by a SSystem/CSystem command).
Its works, but sometime a desync appear between players.
You can use also sendObjectChange("container") from the server, but it's really really buggy (items disappear, etc.)
Another solution should be using the gameClient.objectSyncReq, but too bad it's not exposed in lua 😢

bright fog
#

I have made something similar sort of to check whenever a zombie was getting deleted by debug/admin menu to remove their sounds emitters (needed for custom zombie sounds to not have fantome sounds)

#

Which means I hooked a lua function to a java function getting triggered

abstract cairn
#

interesting thats a pretty good idea but I'm probably just going to make a timed garbage collector and accept the edge cases where they overlap within that time period

#

also speaking of which anyone know how I can get/save the current game time? getGameTime() is lookin weird n I dont know if it actually works like that

abstract cairn
#

ye but can I just do getGameTime() and it'll return the current game time? [as in if I save it to a variable and then get that variable later will it be the current time or the saved time]

bright fog
#

Oooh

bright fog
#

What you did right here will just save the time at the moment this part runs

#

If you remove () you need to add it when you call that variable

#
local dict = {}
dict.value = getGameTime
local time = dict.value()
#

That should be it

peak nymph
#

Hi all
Does anyone have any idea why a context menu item added via the event system would be getting added twice? (using TchernoLib)
The "Test" item is added to the menu twice
Here is printed twice
But I can only see CCharcoalMound Init printed once

`require 'GlobalObject/CGlobalObjectCreator'
require 'CharcoalMound/SharedCharcoalMound'
ShGO.initCGO(CharcoalMound.key)

local function addCharcoalMoundLightOption(context, isoObj, playerNum, x, y, test)
if not context then return end
if not isoObj then return end
local playerObj = getSpecificPlayer(playerNum)
if not playerObj then return end
local square = isoObj:getSquare()
if not square then return end
local optionText = "Test" -- fix
local option = context:addOption(optionText, isoObj, null, square, playerObj)
print('Here')
end
print('CCharcoalMound Init')

Events.OnCGlobalObjectContextMenu_charcoalMound.Add(addCharcoalMoundLightOption)`

gilded hawk
#

Do we know what the boolean arguments for AddXP do?

grizzled fulcrum
bright fog
bright fog
grizzled fulcrum
#

I'd think you would use it like

local oldTime = getGameTime()
-- do stuff
local newTime = getGameTime()
-- diff = newTime-oldTime
bright fog
#

But in his case he wants to run the function since he wants to get the time whenever he refers to his dict entry

grizzled fulcrum
#

ohh I see now

eager wharf
hallow cradle
versed merlin
#

Hey folks, asked before but I don’t think anyone saw it. I’m interested in doing an overhaul mod and am curious if that is something I could start learning now or if it’d be better to hang out closer to 1.0?

thick karma
#

Not sure what kind of overhaul you're doing but I'd just go for it. I wouldn't even wait for 42, let alone 1.0. People have been waiting for 42 for years. I'm sure there's time. And the things you learn making an overhaul for 41 will surely help prepare you to overhaul 42 or 1.0 or whatever later version of the game you're hoping to mod.

cloud shell
true plinth
mellow frigate
nimble badger
thick karma
#

Reloading in-game however would do this.

peak nymph
thick karma
#

I notice you're adding your function to a custom event. Is it possible you trigger that event twice somehow?

peak nymph
thick karma
#

I never see anyone add to context menus by adding to a custom event that way so it's sort of my best guess. I'm p sick right now so not on PC and thus not reading files right this minute.

#

I just add my menu items to vanilla events

peak nymph
thick karma
#

What exactly is the intention of your menu option? It's an option for right clicking the ground / objects right?

peak nymph
#

yeah, when right clicking the object want to add a context menu for lighting it the same way as a camp fire, but was just adding a test context item to begin with

thick karma
#

I think using a custom event for that would unnecessarily complicate the process

#

There are examples in Jukebox/Menu.lua that you are welcome to refactor from True Music Jukebox.

peak nymph
#

I was recommended the lib as I ran into issues a while back when trying to communicate between server and client for updating to ignited etc (and some additional functionality I was attempting including a burning timer and harvest option when finished)

thick karma
#

I mean TchernoLib might help you sync stuff easier somehow (I am not sure) but making a custom event just to add a context menu option doesn't seem like it would be necessary at all for client-server sync. A context menu is a purely clientside phenomenon. It's only the consequences of firing that option that might require sync.

peak nymph
#

just thought I’d try the lib methods seeing as I was using by it anyway, but will try go with a vanilla method

thick karma
#

Yeah, I'm not sure why that event isn't working as expected, but the vanilla one works for me. There is a function in TMJ (JukeboxMenus.load iirc) that decides whether to add a custom menu based on whether it finds a jukebox on that square. You could probably rework that to suit your purposes in a fairly straightforward way.

#

Also it demonstrates how to make players walk to what they right clicked before they do the thing

#

And make it compatible for gamepad people

#

If either of those goals is of interest to you

peak nymph
#

yeah will take a look thanks

thick karma
hallow anvil
#

hey fellas I'm looking for a tshirt icon from the game, I'm making a clothing mod and I can't find a default icon in the game files

hallow anvil
hallow cradle
versed merlin
thick karma
#

I mean later builds are allegedly going to have more options for stuff like NPC AI which seems highly relevant to some of your goals, but nevertheless I would probably just do what can be done now and worry later about stuff that later builds will make easier.

#

@versed merlin

versed merlin
#

Yeah, that was in a round about way what I was getting at lol

#

But looking at it I agree, who knows when any of that will actually happen

bright fog
#

In years

#

That's at least what you have to expect

#

In fucking years xD

thick karma
#

I mean skinning zeds and making bosslike zeds and obv vehicle modding all works fine right now and you could easily get started on that... and I highly doubt the incoming updates are going to utterly break compatibility with existing vehicle models / skins permanently (though they may need to be loaded differently someday) because that seems like it would unnecessarily require a lot of work to be redone... And faction wars are sort of already possible on some level, though it depends on what you mean by that. The nature of each goal would determine whether I would personally want to wait to try it. If you mean AI factions fighting AI factions, that might need to wait.

versed merlin
#

That is fair, and yeah I mean factions fighting each other for territory and the like.

thick karma
#

I see, yeah, I think planned AI features will probably make your life easier regarding that specific goal

bright fog
#

What's your mod plan exactly ?

bright fog
bright fog
#

👌

#

I'm working a mod to easily add fully customized zombies variants if you're interested @versed merlin

thick karma
#

But if you're boring you can't use it. @versed merlin

bright fog
#

wdym xD

thick karma
#

lol sorry I am stupid so puns are the only kind of joke I ever learned.

hallow cradle
#

as soon as gain more experience with Lua i'll try to make another part of map that is radioactive zone (you will need a gas mask) and also a lvl2 radioactive zone (you will need a full bio hazard suit).

bright fog
#

Anyway taking a break rn, working on other stuff before going back at it but it's already in shape and the work to do is mostly on my addon that uses the framework

thick karma
#

You said if Darkfine is interesting* instead of interested*

#

So I contrasted it with boring.

#

Because I'm so funny.

bright fog
#

oh mb

thick karma
#

lol yes how dare you set up my golden comedy with a typo

bright fog
outer crypt
#

Does anyone know how setting multiple overlays to a container works? At what point does it go from no overlay to the first, second, etc? I have a 25 weight container that overlays twice and works well but another container with 5 weight that never activates the 2nd overlay...

#

I know both overlays work because I have moved them around a bit.

#

I'm expecting that it is weight set and that the 5 container isn't large enough to make it to the 2nd overlay...

vestal gyro
#

If I want to make a vanilla trait inaccesible to people so they can't pick it during the character creation screen do I just copy the vanilla code for it and change the values?
Or could I make it so every other trait is mutually exclusive with that one?

hallow cradle
vestal gyro
#

Theres no mod that does this tho

hallow cradle
#

you mean you have to earn it during play ?

vestal gyro
#

The only way I could think of doing it is using the rebalance trait mode code and make the traits I want to remove cost 999 points

#

No just not able to pick it as in it doesn't appear in the traits list

hallow cradle
vestal gyro
#

You are not supposed to

hallow cradle
#

0.o

vestal gyro
#

But you can't physically completely remove them from the code which is probably because they are in the base game

#

I attempted to do it a few days ago but got completely stuck till I gave up at 7am

#

But tomorrow I'll attempt it again

hallow cradle
vestal gyro
#

Thanks, will also release a clothing mod tomorrow which will be my second mod ever

vestal gyro
bronze yoke
#

i think if you make a new trait with the same id it overwrites the old one, if you set it as a profession trait and don't actually give it to a profession then it won't be pickable at all

vestal gyro
#

Thanks really appreciate it

slow graniteBOT
#
l9paco has been warned

Reason: Bad word usage

lusty karma
#

Question for modders, would it be hard to make a mod that let you adjust the range of a generator? Something that would be compatible or be used with "Visible Generator Range" mod. Many times i realize the range of my generator is too big for my base and then it power next houses for example. What if we could change that range to make it lower/(bigger?).

bronze yoke
#

there's already a mod that does that

#

it can't be done with lua

hallow cradle
#

Guys I just made a mode that allows you to break stone into 4x chipped stone. Now I have a problem with animation. When it starts animation It doesn't equip a hammer. It hits the stone with a fist instead. How to fix it? I try to use the chatbot but he complicates it for no reason.

lusty karma
#

do you know the name of the mod?

bronze yoke
#

customisable generators or something like that

lusty karma
#

Thanks 🙂

vestal gyro
#

Is it like the carpentry dissasembly animation but without the tools in hand?

hallow cradle
#

hold on ill record it

hallow cradle
#

but doing it without hammer in hand

vestal gyro
#

I know of quite a few mods where it just does that, maybe its very annoying to implement

vestal gyro
#

Im on my phone rn sorry

hallow cradle
#

oh oke

#

np

vestal gyro
#

But as long as it's only visual then it should be fine

#

Like for example if the recipe can only be done with hammer in the inventory

hallow cradle
#

I know that blowtorch have that function (when u disassemble object) it force you to equip that tool as primary.

vestal gyro
#

Can you send the code of the function?
You probably just have to put in the hammer item ID and implement that function in your recipe if I had to take a guess

hallow cradle
#

module Base
{
recipe Make Chipped Stone
{
Stone=1,
keep Hammer,

   Result:SharpedStone=4,
   Sound:Hammering,
   Time:300.0,
   AnimNode:BuildLow,
       Category:Survivalist,
}

}

bronze yoke
#

you can use Prop1 and Prop2 to set what items the character will hold

hallow cradle
#

where do I put it ?

abstract cairn
quasi kernel
#

We are WINNING!

bright fog
#

If you put it in with ()

#

It just runs the function and returns the value the moment it's called that way

#

Like any other function

abstract cairn
abstract cairn
bright fog
#

np xd

#

Best way is to try it tbf

abstract cairn
#

It's like using a calculator for 2+4

bright fog
#

lol

abstract cairn
#

Yeah but I didn't know if I could call it like zombrand which I'm guessing I can so like W

bright fog
#

You can yes

abstract cairn
#

And I'm lazy in regards to uploading to workshop every test so I'm trying to add as much before testing n debugging lol

bronze yoke
#

that's just caching the gametime object

#

that isn't the time, it's the class responsible for tracking time

abstract cairn
#

Does it not give an instance of the game time class?_?

#

Or do I have to go select the values from the game time class I'd want to use

#

Before saving it

bright fog
abstract cairn
bright fog
#

Is that a feature that only works in servers ?

#

If not just test it in solo ?

bronze yoke
#

i think getGametimeTimestamp() will give you what you want

abstract cairn
#

I'm new okay T_T
I'm testing what I can solo but it's mainly player on player and UE5 makes me want to test everything in a multiplayer environment too

bright fog
#

Just click the link

bronze yoke
#

in your recipe

#

e.g. Prop1:Hammer

abstract cairn
#

Also just to reiterate players can only modify their own mod data meaning id have to make player one tell the server to tell player 2 to update their mod data

abstract cairn
bronze yoke
#

yeah

bright fog
#

If you can manage aPES3_CursedDemon

abstract cairn
hallow cradle
vestal gyro
quasi kernel
#

I feel immeasurable joy and anxiety looking at this.

lunar robin
#

@thick karma Hi!
Any chance I can be added to modding resources?

thick karma
#

I pinged you into it but just FYI you can find threads (like Modding Resources) by clicking this button in the future:

#

It's near the top-right corner of Discord on Desktop.

lunar robin
#

Sorry, didn't pay attention. Thank you!

verbal yew
#

its possible to patch create menu like:
if i get 2 negative perk then clear list with negative perk?

brittle dock
#

@sour island I know you’re still polishing the existing mods, but out of curiosity, does the concept of “Game Night - Brick Toys” intrigue you or fill you with dread?

abstract cairn
thick karma
#

Though it would be super dope if we could.

muted garnet
#

Can I use client/server commands to send to only one player? I need to send UI window with yes/no to clickedplayer with sender player details and show UI window only for clickedplayer and not for both players at the same time:

server:

Events.OnClientCommand.Add(function(module, command, player, args)
    print("123abc")

    local playerID = args[1]
    local clickedPlayerID = args[2]

    local playerObj = getPlayerByOnlineID(playerID)
    local clickedPlayer = getPlayerByOnlineID(clickedPlayerID)
    
    print(clickedPlayerID)
    print(playerObj)


    if command == "TradeRequestSent" then
        print("abcdeftd")
        sendServerCommand("123", 'TradeRequestSent', {playerID})
    end

    
end)

client:

Events.OnServerCommand.Add(function(module, command, args)

    if command == 'TradeRequestSent' then

        local playerObj = getPlayerByOnlineID(args[1])

        local modal = ISModalDialog:new(getCore():getScreenWidth() / 2 - 175,getCore():getScreenHeight() / 2 - 75, 350, 150, getText("IGUI_TradingUI_RequestTrade123", playerObj:getDisplayName()), true, nil, ISTradingUI.onAnswerTradeRequest);
        modal:initialise()
        modal:addToUIManager()
        modal.requester = playerObj;
        modal.moveWithMouse = true;
        ISTradingUI.tradeQuestionUI = modal;

    end
    
end)
sour island
brittle dock
bronze yoke
muted garnet
bronze yoke
#

you still need all the other arguments

muted garnet
#

what do you mean about?

bronze yoke
#

you only passed one string

muted garnet
#

I got it, thanks

#

I found

hallow anvil
#

how do I get my clothing to be pickable at start and how do I set up its spawns?

warped yew
#

Hello everyone, sorry for my bad English! Friends! Please tell me what function can be used for an action so that endless animation animations are hung on the player) or what events/classes?

bright fog
warped yew
thick karma
# bright fog You mean have an animation loop ?

To clarify (I have some idea of what they're doing from DMs), they want to put player in an unconscious animation state and leave them that way indefinitely with no ability to independently cancel the animation until they have been healed somehow.

bright fog
#

Perhaps there's a method for that

bronze yoke
#

you can make an uncancellable timed action, and you can restrict the player from moving

#

but if you can't cancel your timed action you can't open the menu so it's not ideal 😅

thick karma
#

Classic

bronze yoke
#

well the first escape press usually cancels it - if you can't cancel it, every escape press tries and fails to

thick karma
#

Well you could mod around that, right? Set a flag while the timed action is active and if player presses Escape while it's active, just directly call the function to open the main menu?

bronze yoke
#

yeah, probably

#

you could build it into the function you have to override to make it uncancellable even

thick karma
#

Still, classic Zomedy

bronze yoke
#

something something actionqueue.cancancelaction

verbal yew
mellow frigate
thick karma
quasi kernel
#

Is anyone here fortunate enough to have contact with bikinihorst? I want to get an "OK" from them so I can avoid some conflict. Same goes for the More Smokes creator, but I'm unsure if they're here.

#

I need it for my mod.

#

I could just publish the More Smokes patcher but I also don't wanna deal with random stuff happening because of it.

bright fog
#

Like seriously wtf is that

#

You are not reposting their mods ! THEY HAVE NO REASONS TO BE AGAINST IT

quasi kernel
#

Well, they could have reasons. Namely errors tracing to their end that are faults of my own. I don't wanna give them an influx of bug reports that aren't even theirs-

bright fog
#

Unless you do things badly, they won't have errors related to their mod

#

That just won't happen

#

Please stop fucking worrying so much about your mod, JUST DO IT

quasi kernel
#

a

#

i just wanna try and do the right thing

bright fog
#

Please seriously it's pissing me off looking at you being scared like a small tiny rabbit who's shitting himself. Sorry if it feels rude but just do it mate ????

#

I know but I told you multiple times already

#

You are not reposting their mods, there's no way a modder comes to you against you and you get hated by everyone just for doing a fucking patch

#

Everyone loves patch and is here jerking off modders who do it bro, wtf do you expect hate for ???

quasi kernel
#

It's just a big mod, it's not a tiny patcher mod.

#

It's practically an overhaul, things can go wrong.

bright fog
#

And that's okay bro

#

If you are doing things right in your mod, all the errors will lead back to YOU

#

Perhaps other mods you patch can appear in it but they will ALWAYS trace back to you

#

Unless you do some weird ass decoration and fail to do it properly (which is kind of hard to fail)

#

But just do it please, do your stuff

#

If you keep acting like that in life you just won't do shit of your life

#

Just do it

quasi kernel
#

sorry-

bright fog
#

This gif can't be more accurate

thick karma
#

Lol yeah model your behavior after Shia

#

That's pretty much my main strategy for being happy in life.

#

WWSD?

bright fog
#

Lol

thick karma
#

(making an easy joke but while my tone wouldn't be the same I do agree with the sentiment that patching is righteous and people who stand in the way of compat patches without doing their own equally effective compat patches are the enemy.)

thick karma
#

(and nobody does a compat patch for farming as good as yours)

#

(and I doubt anyone ever will)

#

Bikini used to be taggable here. If they left the server or by some means beyond my knowledge made themselves untaggable here, then they really have no rational place to complain about the consequences of not being contacted about something like this, afaic. I say be available to support your mods or accept the consequences of not doing that. That's not being a tool 101.

quasi kernel
#

I guess all I gotta tackle is the map objects loader-

#

Does anyone know an instance of crops being loaded on the vanilla map?

quasi kernel
#

Gonna somehow have to find a way to force the map loading to come last, which is gonna be a pain.

#

Not 100% sure if it's possible but oh well, guess I'll find out.

bright fog
#

Coordinates on the left

quasi kernel
#

Thank you.

#

There a way to teleport to coords quickly? I haven't had to do that before.

bright fog
#

I don't remember where tho

#

Right click > Main (debug) > teleport

quasi kernel
#

Ah, thankie

ashen pine
#

how do you make clothes, prefer a video as its hard for me to read and keep up lmao

stable wren
#

Hello there 😄
I've an question, how to check equip item is gun or melee weapon?

mellow frigate
stable wren
#

Thanks you

mellow frigate
#
function AFM.isWeaponEquippedBareHands(player)
    return WeaponType.getWeaponType(player) == WeaponType.barehand;
end
abstract cairn
#

I know I can attach mod data to classes/specific objects like players and zombies, but is there a global mod data I can add stuff to as the client? as in the client can add some data to a global mod data table which is accessible by the server and the clients? [and then make it so the server does an occasional culling of the mod data]

bronze yoke
#

there is global mod data, look at the ModData class

#

it has methods for synchronising it but i've never needed to sync it so i'm not personally familiar with their usage

abstract cairn
#

also does the lua playerObj:getModData().NameOfData = {}
actually initialize the mod data or-

bronze yoke
#

yeah

abstract cairn
#

like if I wanted to access the global mod data would it literally just be ModData.get() or ModData.create()

bronze yoke
#

yeah, i find getOrCreate the most useful unless you specifically need to initialise something

abstract cairn
#

but getOrCreate is for global mod data not the object ones?
(also why not just use get() when grabbing it and create when making it ?_?)

bronze yoke
#

oh, for object data you don't need these methods no

bronze yoke
abstract cairn
#

so for object data it would be getModData().NameOfData [no () at the end]

and for global it would be ModData.getOrCreate().NameOfData

abstract cairn
bronze yoke
#

it's best to keep the table cached so you don't incur java overhead from grabbing it, so i just call getorcreate once when the global mod data system starts

#

e.g.

local modData

Events.OnInitGlobalModData.Add(function()
    modData = ModData.getOrCreate("MyMod")
end
sour island
abstract cairn
bronze yoke
#

i'm not really sure what you're using mod data for but the first one would probably require less network traffic

#

i don't really use mod data in a synchronised fashion (at most having clients request/send information using commands when necessary) so i don't really have the experience to say how well that structure works

abstract cairn
#

Actually I think I have an idea that does best of both worlds...

#

ty appreciate it ^_^

abstract cairn
#

actually maybe you can only getPlayerByOnlineID from server

#

this isn't working client side and is returning an error (and neither message is being said) [just tried in hosted game still same problem]

bronze yoke
#

you need to call getOnlineID with a colon, it's an instance method

abstract cairn
#

also this is throwing an error but I think it's because getGametimeTimestamp() returns a long instead of a string

bronze yoke
#

you can wrap it in tostring() to avoid that

abstract cairn
#

anyone know what the two args for daysInMonth are for?

bronze yoke
#

year and month

#

the official javadocs on tis's website have parameter names, i recommend using that one over the community site

abstract cairn
#

albion you cant just keep nonchalantly answering every question I have almost instantly like a super computer
im going to start being able to ask what the meaning of life is and your gonna say 42 lmao ty
also I will now hunt down the doc you are speaking of ty for the lead

abstract cairn
#

and then you send it instantly too T_T ty you're awesome lmao

abstract cairn
#

anyone know if I could hook into/use the combat log in my mod? [and if so how, cause im reading the docs and its not really clear...] would be nice to see the location of when people attack but smh asking for too much lmao

slow graniteBOT
#
xerpage has been warned

Reason: Bad word usage

sour island
#

Anyone familiar with context menus know what could cause the menu not to clear after selecting an option?

slow graniteBOT
#
svebsks has been warned

Reason: Bad word usage

abstract cairn
#

do you mean its not closing the context menu when you select an option? I don't remember if the mod we made that uses context menus closes itself or not, but it might not.. I think maybe most of the context menus close because they either explicitly say to or they have you do a timed action and it automatically closes it? (I think?) dont trust me im just tryin to be helpful but I don't know for certain lol

I think ours auto-closed...

also anyone know why this returns an error?
(client)

playerObj:Say(tostring(getGameTime().getHour()))
bronze yoke
#

use a colon

abstract cairn
#

I DID AND IT- AGHSDFJD

abstract cairn
abstract cairn
abstract cairn
#

Does anyone know why this is obsolete/discontinued? I understand having a player getting damage event to detect different times of damage, but being bitten or attacked doesn't trigger one other than bleeding (which gets triggered a billion times over the course of an injury alongside being present in almost every injury in the game)
How can I call an event from when a zombie attacks a player? Using the OnWeaponHit for the server (despite it being a client side) doesn't trigger when the zombie attacks either...
[going to see if I can use event even if its obsolete]

bronze yoke
#

it's obsolete because nothing ever triggers it

#

the great part of this is that it wasn't replaced with onplayergetdamage, there was simply no event at all for player damage for a pretty significant stretch of time

#

onplayergetdamage was a recent addition, and that event hasn't worked for at least as long as i've been with the game

abstract cairn
#

then how would I call an event/func when a zombie attacks a player or a player gets attacked by a zombie? The OnPlayerGetDamage can work for literally every other form of damage BUT zombies [although again ig the damage comes from the bleeding from the zombies rather than the zombies biting etc... although that makes me wonder what damage type is the "drag down" thing...]

#

I literally just want to make a counter for how many times a player gets hurt by a zombie lmao I thought this would be one of the easier parts :l

#

maybe I could do this?
Is there a state for attacking for zombies?

bronze yoke
#

drag down doesn't do damage, it just kills you

#

ai state change is promising

abstract cairn
#

huge?

bronze yoke
#

keep in mind most zombie attacks miss

abstract cairn
#

can I see subclasses of a given parameter? IE it gives me the state can I see if it has a subclass?

#

cause I see this, and I don't know if it means eating a corpse or eating the player...

#

actually the last player hit int for the IsoZombie might be it, but it's an integer which confuses and scares me lmao

neon bronze
#

It could be the players id in mp

abstract cairn
#

I've figured out a way to do it, I just need to check whether or not an IsoGameCharacter is a player or a zombie

anyone know how I can check if a class has a specific subclass? IE if the IsoGameCharacter has the IsoZombie subclass?

bronze yoke
#

instanceof(character, "IsoZombie")

abstract cairn
# bronze yoke ``instanceof(character, "IsoZombie")``

I thought that was for seeing if it was a subclass of a superclass not if there was a subclass attached to it

(what I've been using so far is this [just realized I could reuse it rn])
(I will try that though cause its probably better in every way lmao)

abstract cairn
bronze yoke
#

what do you mean by 'subclass attached to it'? you may be misunderstanding how classes work

abstract cairn
warped yew
#

Hi all! Can you tell me how to install IS content?

vestal gyro
#

Bro get some sleep chopie isnt it like 7am for you

abstract cairn
#

if I knew what you meant by IS I would try to help lmao

I'm trying to check if the newState is == the class AttackState, I've been using the getName and the tostring but I think if I just directly compare the classes it's much better
ie


if newState == class AttackState then

dunno how I'd do that as I've never actually directly compared a reference to see what class it is...

abstract cairn
bronze yoke
#

if newState == AttackState.instance()

#

the states are singletons so you can just do an object comparison

#

don't use getname, it's only exposed in debug mode

sour island
#

The context menu is meant to auto close - Ive never seen it not close before. I'm wondering if there's something to me adding the sub menu wrong or something.

ripe badger
#

I'm trying to alter some recipes from the Gunfighter mod for a local server.
While I was able to change the recipe, in game there is both the original recipe and the update recipe.
All I changed was the time the recipe takes, I'm just wondering what it is I've done to make the recipes duplicated, I assumed the old one would disappear.

This is their recipe.

{
    recipe Make 5.7x28mm Ammunition
    {
        Brass57            = 1,
        GunPowder        = 2,
        PrimerSM        = 1,
        Lead57            = 1,
        keep Lyman_TMag/Lee_LoadMaster,
        Sound            : Reloading_Press,
        Result            : Base.Bullets57,
        Time            : 60.0,
        CanBeDoneFromFloor    : TRUE,
        NeedToBeLearn        : true,
    }
}```

This is mine.

```module Base
{
    recipe Make 5.7x28mm Ammunition
    {
        Brass57            = 1,
        GunPowder        = 2,
        PrimerSM        = 1,
        Lead57            = 1,
        keep Lyman_TMag/Lee_LoadMaster,
        Sound            : Reloading_Press,
        Result            : Base.Bullets57,
        Time            : 15.0,
        CanBeDoneFromFloor    : TRUE,
        NeedToBeLearn        : true,
        Override        : true,
    }
}```
bronze yoke
#

more than one recipe with the same name can exist

#

you can explicitly mark it as an override with override:true

#

oh... you did

#

you might need to put the override line first if i remember right...?

ripe badger
#

I'll give that a try.

bronze yoke
#

some of the parameters that do weirder stuff get acted upon as soon as they're read rather than at runtime like most do

vestal gyro
#

the double in this one is the chance for the item to spawn right?

thick karma
#

It corresponds to that chance but is not exactly that chance. @vestal gyro

#

Players can adjust the likelihood from a base rate determined by that chance, and also I believe the die gets rolled for spawning any given item more than once in most cases, so the real odds of seeing the item may be higher or lower than that number depending on circumstances and user settings.

vestal gyro
#

so stuff like loot rarity settings (or other factors) is being multiplied by that number to get the exact chance

thick karma
#

Yes, basically. I do not know the specific formulas applied, though. Sorry. 😦

vestal gyro
#

yeah no worries thats all I need to know, thanks

thick karma
#

Good luck!

ripe badger
verbal yew
#

i mean you rewrite some code part in your mod folder, but if u subscribe on your mod - game enable they from steam, not from documents/pz

verbal yew
#

this brita's weapon Pack / arsenal gunfighter?

ripe badger
#

Originally it was just a local mod however I have recently uploaded it to the workshop and subscribed to it.

ripe badger
verbal yew
ripe badger
#

I'll do that in future, I tried the changes before I uploaded it however.
Since uploading and subscribing to it I've not made any changes yet.

vestal gyro
#

so would this override the vanilla traits?

bright roost
#

I want to add some different rip options to clothing types, is there a way for me to achieve this?

I basically want to be able to rip clothes into a new item im implementing

verbal yew
#

where you check numbers of cover body part, holes, etc and get amount of your item based on this

#

if u want use specific clothes for rip, then you should get func for search item in recipe too (or just add all your clothes item like item1/item2/item3=1)
something like [Recipes.GetItemType.Hammer] - its in lua func

verbal yew
#

not sure about event

#

OnCreatePlayer should be i think

#

but if u set , true); for vanillas perks its set perk invisible in create menu

vestal gyro
#

thats the point

verbal yew
#

but u can get this perk (if they dinamic for example)

vestal gyro
#

I'll do Events.OnConnected.Add(function) since it's for a server

bronze yoke
#

ongameboot should be right

#

oncreateplayer is way too late

vestal gyro
#

putting it in the client folder should make it work right

#

Ight I'll try it now hope it works

#

ok its working thank you guys

bright roost
verbal yew
verbal yew
#

not perfect, because im dont take numbers of cover parts, but...

#

this is should be something what u want

vestal gyro
#

@verbal yew@bronze yokethanks the mod finally works

verbal yew
#

New fabrictype open way for patches clothes with new fabric

#

in context menu or in ui with clothing part

ripe badger
verbal yew
grizzled fulcrum
#

I may have been doing mod data wrong this whole time, is there a difference in the table's storage location for these two:

ModData.get("table")
getPlayer():getModData()["table"]
#

Now looking back on it, I can only assume ModData.get returns a global moddata table whereas getting the player's mod data table is local to that player? If that is the case then I was doing it wrong for so long 😭

mellow frigate
torn igloo
#

ModData.get("table") is global mod data.
getPlayer():getModData()["table"] is object's mod data. The player is the object.

Global mod data is independent of client and server, they need to be manually synced if you want to make them available on both
Object mod data is tied to the object and is downloaded whenever that object is loaded.

They both serve different purposes. In the past, a lot of mod use getModData() to store their database but these database is universally shared on both client and server which can bloated up MP bandwidth. Global mod data can be used as a server-side only database so you don't have to send everything over. You can also use it as a specific user's database where only that user need to recieve that data while other users don't need to.

grizzled fulcrum
#

I was using global mod data to store individual player mod data, I will change this asap!!!!!!!!!!

bright fog
#

Yeah store directly in the player

grizzled fulcrum
#

also is getPlayer():getOnlineId() the player id used in stuff like getSpecificPlayer(id)?

bright fog
#

I believe yes

grizzled fulcrum
#

ty

coarse sinew
#

As Tcher said, getPlayer() is equivalent to getPlayerIndex(0), but when there are multiple local players you can use getPlayerIndex(index)

grizzled fulcrum
#

All I want to know is how to get the current player's id from the player object. I guess I could just use 0 but I'd ideally want it to work for split screen too. (playerNum is required for getting moodle via MoodleFactory mod api)

thick karma
grizzled fulcrum
#

ohh I am glad there was such function

#

wait there is getplayernum and getplayerindex, they are 2 seperate numbers!!

thick karma
#

Also it's possible there is now a :getPlayerIndex() that I am seeing kn the Javadoc that I would imagine may be equivalent and simply a more precise name for getting the same info but I've never used getPlayerIndex (and it doesn't take a parameter or get called like getSpecificPlayer does)

grizzled fulcrum
#

is the index for split screen and the num for the entity player id or something?

thick karma
#

Yes

#

Although to be clear, the joypad index is 1 more than the player index

#

"the index for splitscreen" is ambiguous

#

Context is important

#

But yes, if you want the player object for player 2, you go getSpecificPlayer(1)

#

Their joypad data however will be index 2.

grizzled fulcrum
#

sorry I am not very well versed with splitscreen as I've never played with keyboard and mouse & 1 player only

thick karma
#

How dare you not know everything!?

#

Shame!

#

Shame!

#

/sarcasm ❤️

hallow cradle
#

I just finished watching Lua tutorial (4h) and I am trying to solve issue for my mode (so my mode allow you to break stone into 4x chipped stone but can't put in: "keep" more than 2x hammers cuz it breake code for some reason + "Prop1" cant put more hammers it also break code) my code: module Base
{
recipe Make Chipped Stone
{
Stone=1,
keep Hammer,

   Result:SharpedStone=4,
   Sound:Hammering,
   Time:100.0,
   AnimNode:BuildLow,
   Category:Survivalist,
   Prop1:Hammer,
}

}

grizzled fulcrum
hallow cradle
#

I can only make this mod work if I have only one hammer as option for breaking the stones

grizzled fulcrum
thick karma
verbal yew
thick karma
#

Woulda saved me a hell of a lot of modding

verbal yew
#

prop1:source=2,

hallow cradle
verbal yew
hallow cradle
#

oh oke

#

ill try

grizzled fulcrum
thick karma
# hallow cradle I just finished watching Lua tutorial (4h) and I am trying to solve issue for my...

One option would be to ditch recipe strategy and just attach a function to the context menu when interacting with Stone. Then you can add the option if you have any of a range of hammers, and just fire the result (generate 4 chipped stone items in player inventory) when player chooses that option. Would probably wanna make a timed action for it too though, so the quality of feel would have a complexity cost.

verbal yew
# hallow cradle ill try

Prop1
Used to indicate the item that will be in the main (right) hand during crafting.
Exampme:
Prop1:Screwdriver,

Also, as an item, you can specify a resource for crafting Source=%Ordinal number of the resource%. Example:
Prop1:Source=1

Prop2
Used to indicate the item that will be in the extra (left) hand during crafting.
Example:
Prop2:Log,

Also, as an item, you can specify a resource for crafting Source=%Ordinal number of the resource%. Example:
Prop2:Source=3

hallow cradle
#

btw guys how did you learn making mods in project zomboid?

bright fog
#

Definitely the best way to learn

verbal yew
#

same

thick karma
verbal yew
bright fog
#

Tho I suggest starting on a well written mod first bcs one of the two mods I had to look at was terrible lmao

grizzled fulcrum
#

I never stopped learning, trial and error constantly

thick karma
grizzled fulcrum
hallow cradle
thick karma
#

Remember when Neo learns kung fu?

bright fog
thick karma
#

That's how.

hallow cradle
bright fog
#

bruh

thick karma
#

lmao

bright fog
thick karma
#

Thank you Jvla

#

❤️

bright fog
#

The joke is dead now

hallow cradle
#

xd

thick karma
#

That joke will never die.

bright fog
#

Even when you make a good joke Burrya it ends up getting its knees fucked hahalol

grizzled fulcrum
# bright fog <:hahalol:810231606069166130>

the mod I learnt off (I already knew lua thank the heavens) did 127 table.insert calls all copy pasted with just a small string changed for each of them ☕
probably more like 114 ish but it is still significant

thick karma
bright fog
#

This is the kind of thing you'll see a lot in modding lmao

bright fog
#

idk man you tend to make bad jokes hahalol

thick karma
#

Brough.

#

Is bad like some new kid's slang for amazing

#

golden

#

priceless?

bright fog
#

probably

thick karma
#

I don't follow.

#

There are resources in this that I have used... I didn't exactly just go down through this list but it's got a lot of good ones in it.

#

Also I think a lot of us are either trained or professional programmers and some of us are just relentlessly obsessive reverse engineers who refuse to quit.

bright fog
#

lmao

thick karma
#

That wasn't a joke...

#

I think the problem is y'all don't know what jokes are...

#

My jokes are amazing...

bright fog
#

Still made me laugh that last part ShibaNom

thick karma
#

Why is everyone laughing at me?

#

😭

bright fog
#

I'm not a dev tbf, I do some programmation stuff with Python, Matlab for my studies and that helped knowing how to handle new programming languages

thick karma
thick karma
bright fog
thick karma
#

SEE? That was classic.

bright fog
#

nah

thick karma
#

Psssssh

#

pffffft

#

If I still had my katana I would fight you, but I talk too much so they replaced it with a spiffo surrounded by dead bodies 😦

hallow cradle
#

One thing guys. Can you now do something else in Lua (like building simple apps calculators etc)? I suppose most of you start learning Lua sam as I start now (cuz of Zomboid mods). Do you know how to use function,table,module,if statement,etc..

hallow cradle
thick karma
#

Oh what you're cool because you're French and you have an axe?

thick karma
#

Okay, actually that checks out.

#

Axes are cool.

bright fog
#

For you a typical french weapon is an axe lol ?

zenith igloo
#

you can make a working calculator in the game UI

hallow cradle
#

I mean can you build

thick karma
#

KEEP UP BROUGH

bright fog
#

bruh

thick karma
#

brough

bright fog
#

How dare you don't even respect my pronouns

thick karma
#

There is no funny way to spell sis.

#

How am I supposed to express my feeling and be hilarious at the same time?

#

(Also, honestly, never clicked your PFP until you said that. lol)

hallow cradle
#

@zenith igloo I mean can you now say u have some Lua experience. Like could you us this for building something in roblox ?

bright fog
#

damn you're not even curious about your dear modder friend ?

thick karma
#

lmao there are so many PFP's to click, and Sir seemed so straightforward I did not think twice about it.

bright fog
zenith igloo
bright fog
#

I just love my pronons, they are so unique

thick karma
#

Forgive me, I'm a poor American so my brain is withered by soda.

zenith igloo
#

everything has its own stuff

grizzled fulcrum
#

I presume lua can't get tables by reference, which I wish it did because that would be so good like c++, for example

local data = getPlayer():getModData()["test"]
data["hello"] = "world"
print(getPlayer():getModData()["test"]["hello"])
thick karma
grizzled fulcrum
#

OOO

#

YEEES that is very ultra mega good

thick karma
#

It is very important and useful.

grizzled fulcrum
#

I still sympathise with the & and * characters though 😦

thick karma
#

Ha I don't know many people who are attached to pointer management. C must have really given you Stockholm Syndrome.

hallow cradle
#

i am planning to learn C++

#

how hard is it ?

#

i mean how long to learn it as newby who never code before

thick karma
#

Asking how long it takes to learn to program in a language is sort of like asking how long it takes to learn math.

#

There is endless math and you never really finish learning math, and how far you get depends on where you start.

#

In a lot of ways.

#

But the fundamentals are not atrociously harder to grasp than any other language.

hallow cradle
#

but it's the best for doing something with memory right ?

#

I guess reading it

#

C++

thick karma
#

It runs faster than many other major languages for things like that, yes. Best, I'm not sure.

frank elbow
#

The answer to "best for X" is going to vary depending on who you ask. Different languages are often better suited for different tasks, but "best" is difficult

#

Some would argue for Rust instead, for example, among many others

bright fog
#

Got a friend who was debating that Excel sucks ass for example, and there's just different applications types. He was like any other language is better than Excel, and like yeah but you have to learn it before lol

grizzled fulcrum
#

excel is a language?

#

like microsoft excel? or am I dumb

thick karma
#

Sort of. It has its own scripting rules.

frank elbow
#

It's technically turing complete as of a few years ago

#

But I wouldn't call it a programming language

#

"It" here being the expressions within Excel

#

Excel itself is a program, of course

grizzled fulcrum
#

it is very helpful imo, the stuff you can do is lots

#

I learned how to use some of it about 2 days ago and it solved one of my headaches for a uni subject pretty quickly

bright fog
#

Yeah, it's just types of applications to do with it

#

And yeah any other programming language can do what Excel does for sure

#

But you have to bother coding the tools for it first

#

Or find the tools to do it in a library and shit

thick karma
#

Of course Excel VBA is a language and calling it "Excel" for short would not be unreasonable imo

#

So to say it's both is arguably fair enough.

bright fog
#

I'm not talking about VBA

thick karma
#

It's not just VBA generally though, it's a special version for Excel, right?

frank elbow
#

VBA is unambiguously a programming language; I think what's being discussed is whatever they call their expression syntax

bright fog
#

Ignore the VBA shit, I'm talking about Excel itself and it's not a language but there's very similar applications

thick karma
#

I dunno I avoid Excel. (And Office.)

#

I'm saying the language used in Excel the app is to my knowledge officially called Excel VBA by MS.

#

Or at least one of the languages.

bright fog
#

It is yes

frank elbow
#

Formulas != VBA, to be clear

#

They can include it, I think? I'm no Excel wizard either. But I've unfortunately seen VBA and it is not that

bright fog
#

Whatever I'm talking about Excel, no one talks about VBA by calling it Excel

frank elbow
#

As they shouldn't

thick karma
#

Right that would not make sense lol

bright fog
#

yeah

#

Both can exist without the other but can be linked together very easily

thick karma
#

Well, this conversation is no longer funny at all, so I'm leaving.

bright fog
#

boomer

grizzled fulcrum
#

Is there a way to pop out the lua console stdout into a seperate window? Trying to read what my mod outputs while loading and stuff is hard because it doesn't even show, but even in game the output window is very small on my 1920x1080 monitor

thick karma
#

haha you wish

#

I have tried to make that stupid thing bigger but it's drawn in Java

#

I can only resize its parent window

grizzled fulcrum
#

there's have to be a way

thick karma
#

Annoying a.f.

#

This is the secret

grizzled fulcrum
#

well the base game outputs stdout to a file, I wonder if I could grab that live

#

although it wouldn't be the lua console though

thick karma
#

Yeah I'm not sure; I can just barely read it so I've never gone out of my way to find that file. 😦

#

My primary complaint is not being able to resize it to see more of it.

#

Seeing only 10 lines is annoyning a.f.

grizzled fulcrum
#

talking about java, I see people saying java patches, is that done in lua (somehow) or via manually patching the class files?

thick karma
#

The latter unfortunately.

#

Hence most of us avoid it.

grizzled fulcrum
#

that sucks

thick karma
#

Indeed

grizzled fulcrum
#

I see why, noone wants to manually patch stuff

cosmic sequoia
#

I'm currently creating a vehicle mod and I'm have trouble with the animated object doors, hood, windows and trunk, everything is fine in blender but when I export the fbx and load into the game all the animated object are placed at the origin ie in the center of the vehicle. has anyone got experience with this? I've been stuck for days on this

manic magnet
#

I think @thick karma's jokes are funny. The rest of you are probably just to young to appreciate the humor... but you'll get there.

Also today I found out that apparently @bright fog is best girl? 🤣

bright fog
#

wat

#

That's not for me xD

manic magnet
bright fog
#

lmao

#

Nah I'm a man

#

Best girl is for a character hahalol

#

The one you see everywhere on my profile

manic magnet
#

Yeah, I figured. I was intending to be silly. 😁

bright fog
#

And in the sus link in my bio lol

thick karma
manic magnet
#

Sometimes I miss modding Minecraft. Then I remember that it was all done in Java and I slap myself for being silly.

thick karma
#

lol I learned Java right after HTML/CSS looong ago so I have a soft spot for it. I would love to mod Zomboid in Java if it were easy to enable and disable Java mods.

grizzled fulcrum
thick karma
#

lol all the Java hate

#

Poor Java

#

"surprisingly easy given Java is trash"

#

lmao is how I read that

manic magnet
#

I mean... technically it wouldn't be difficult to build your own loader that inserts hooks and such via reflection, just like they did with Minecraft. In fact, it would be easier because you wouldn't have to do all of the deobfuscation.

grizzled fulcrum
#

I used to make the point that java runs on anything (and it does) but to be fair anything and a potato newer than an ibm machine from the 1900s can run at least C or Rust

thick karma
manic magnet
thick karma
#

there have been several efforts to make Java modding more popular in Zomboid but it hasn't stuck yet

#

If anyone mass markets a really great one I would totally try to spin up a coneless vision mod because tbh I hate that cone stuff.

#

I know a manually installable one exists, but I don't like that it can't be easily enabled / disabled in game

#

Wish 42 would add ability to just disable cone-vision outright in sandbox, but I know they won't because they have put far too much time into making and improving that cone.

manic magnet
#

You would have to build a wrapper with an installer for it, like Forge or Fabric for it to he well adopted, in my opinion.

manic magnet
thick karma
#

I mean, it's been done, I just don't like that it has to be manually installed and removed.

#

And it's only on my PC and can't be passed automatically to my friends.

vestal gyro
#

not be best

#

but it has a place in my heart

true plinth
manic magnet
#

I would prefer for it to extend the client side of things as well, but even just the server would be nice.

bright fog
true plinth
#

Some majors issue can be fixed if methods from gameclient class can be exposed (synchronize container from server to client for example)

grizzled fulcrum
#

am I going crazy or do I have to use table.insert to add a table to player mod data?

#

I've tried:

local player

-- Attempt 1
local data = player:getModData()["MyMod"]
data.test = true

-- Attempt 2
player:getModData()["MyMod"].test = true

Do I really have to use table.insert every time I want to write a value to this?

#

My table isn't even being added to the mod data, despite me doing

player:getModData()["MyMod"] = myTable
thick karma
#

How are you checking whether data.test is stored?

#

To answer directly, no, you do not need to use table.insert to do what you are doing

#

And besides that table.insert is for inserting things into tables, not inserting tables

grizzled fulcrum
#

In OnCreatePlayer, I am making sure the mod data is created if it doesn't exist

local data = player:getModData()[AQConstants.MOD_ID]

local newChar = (data == nil or data._modVersion == nil)
if newChar then
    -- Here I want to set player:getModData()[AQConstants.MOD_ID] table to AQPlayerModDataStructDummy
    -- I do not want to set the local variable "data" to AQPlayerModDataStructDummy
    data = AQPlayerModDataStructDummy
    return
end
#

I think like I program everything in C even when it's not C so in C i'd just make data a pointer to the table and then set *data to AQPlayerModDataStructDummy or something

thick karma
#

The problem is you're putting a new table into a simple variable if player:getModData()[etc] doesn't exist

#

If it doesn't exist your line just results in data = nil when it resolved

#

Then data is just a simple object storing nil rather than pointing to an actual table field in which things could be stored.

grizzled fulcrum
#

so line 1 can result in data = nil?

#

but I am checking for that right below

thick karma
#

Correct. If that table location doesn't exist yet it would be nil

#

What exactly are you trying to add to mod data?

#

In plain English

grizzled fulcrum
#

variables that I can use to track certain things like player statistics and I also keep the version of the mod that was used to create/modify the player's mod data in there too

#

I want them to persist also*** and in the future maybe (maybe) replicate between clients visually (via server stuff)

#

and also I thought that setting a new value at a key that doesn't exist creates the key with the value (if its assignment and not getting the value) so that's my reasoning why I just did that

#

oh and for context AQPlayerModDataStructDummy is just my mod's mod data but using default values in a table (like a kind of default)

thick karma
#

You're basically doing the latter

#

You're not really grabbing a table ref if MyModsData doesn't exist

grizzled fulcrum
#

im assigning to the variable not the table reference right?

#

but then you'd think player:getModData()[AQConstants.MOD_ID].testVariable = 0 would work and create a table in mod data like: { testVariable = 0 }

#

im gonna double check that really quick one second

thick karma
#

Right. You need to do:

player:getModData().MyModsData = {}

and then you can do

local data = player:getModData().MyModsData

data.x = 5
#

And at that point, player:getModData().MyModsData.x will be 5

bright fog
#
local player

-- Attempt 1
local data = player:getModData()["MyMod"]
data = data or {}
data.test = true
thick karma
#

player:getModData()["MyModsData"] would not automatically make a table. It would just attempt to access a nonexistent field in the root mod data table

thick karma
bright fog
#

???

thick karma
#

If the stuff right of = were not already a table, you just wrote:

local data = nil
local data = data or {}
data.test = true
bright fog
#

I just tested it that works lmao

thick karma
#

That does not link data to a table in mod data

#

You are wrong lol

#

You are misunderstanding what you've done

#

The stuff right of equals resolves first

#

Order of operations

bright fog
#

that writes an empty table in data if data doesn't already have one

thick karma
#

Yes but not into player mod data

#

The goal is not to store in a "data" variable but to gave that data preserve when trying to pull it through player:getModData() later

#

print(player:getModData()["MyMod"].test) would error in your example (because you never actually declared that player:getModData()["MyMod"] is a table, only that data is a table)

grizzled fulcrum
#

I actually understand now, I got the order wrong. I need to sleep but I DIGRESS!!!!!
I will try the following:

-- It's intended for it to be a table OR nil, I check it below if so
local data = player:getModData()[AQConstants.MOD_ID]

local newChar = (data == nil or data._modVersion == nil)
if newChar then
    player:getModData()[AQConstants.MOD_ID] = AQPlayerModDataStructDummy
    return
end

-- theoretically should be TRUE
print(data == AQPlayerModDataStructDummy)

this should work right?
even after I set the table directly, data is still a table reference so in theory if I access data variable later on it will be not nil?

thick karma
grizzled fulcrum
#

ya it is

#

but it's weird because I tried this same thing before and it didn't work -_-

bright fog
#

It does write directly in mod data

thick karma
#

Lol then you didn't share all your code

#

I am not guessing

bright fog
#

give me a sec I'll show you what I did

thick karma
#

I've written like 20 mods

#

I'm not remotely uncertain

#

For Zomboid

#

Not 20 mods in life

grizzled fulcrum
#

I am spinning upo the game
I WILL BE THE BEARER OF BAD NEWS!!!!!

thick karma
#

This is not my first rodeo

#

Lol

bright fog
#

bro fuck off and let me finish my message

thick karma
#

Lmao I am only responding to the literal code example you posted

#

It was incomplete in a way that will confuse newbies

bright fog
#

Wrote that code first, wrote some data in mod data at tag on .test

-- OnPlayerUpdate

    local data = player:getModData()
    local dataMod = data.test
    if not dataMod then
        print("setting mod data")
        dataMod = {}
    end
    print(dataMod)
    dataMod.hello = true

then deleted all that, and updated lua and replaced everything with that to not write anything and just access data

-- OnPlayerUpdate

    local data = player:getModData()
    local dataMod = data.test
    print(dataMod.hello)
#

bruh spiffo

boreal condor
#

Hey guys, I'm new to modding and I'm struggling to find the info I need, hopefully someone can point me in the right direction.

I can't find the "capacity" of liquid containers. I can see from the wiki a Cooking Pot can hold up to 25u of water, a Saucepan 20u, a water bottle 10u.. etc

I've been searching the web and the files but I can't find anything that makes reference to that... at least that makes sense to me, but I might be missing something trivial.

grizzled fulcrum
grizzled fulcrum
# bright fog Wrote that code first, wrote some data in mod data at tag on `.test` ```lua -- O...

also you sure it reloaded correctly? not doubting your case but I went back to restarting my game every time because reloading my lua 9/10 wouldn't unregister the event callbacks before reloading the lua so it would just keep adding and if I changed the callback in my new lua and reloaded it, would just have an old callback and a new callback being executed for that event, not just the new one

bright fog
#

Nah I write my codes to not reload the lua files with the events

#

But I just tested with the exact same way I call it with the or and it didn't work no

candid ridge
#

uh, sorry if it's been asked over here alot but how do you get about recompiling a modified jar file?

#

I cant seem to wrap my head around

thick karma
bright fog
#

I'm not showing anything out of context lmao

thick karma
#

Lol I am showing you exactly what happens when you try to follow the steps you're suggesting one at a time

bright fog
#

Like there's literally nothing more to what I just explained in my message above and I tried with the or method like I showed at first and no that one didn't actually work I tried again

thick karma
#

It throws an error trying to access test.hello through mod data.

#

It works fine when accessing dataMod.hello because it's a different object entirely.

#

lol just don't do what Doggy is suggesting, they'll figure it out later. @grizzled fulcrum

bright fog
#

???

thick karma
#

Ask anyone who has been modding this game for years. Albion, Chuck, etc. will tell you the same thing and the proof is in the code I just posted in console. @grizzled fulcrum

bright fog
#

I really don't like your attitude rn, I'm not being a complete jerk about the subject nor am I saying you're a lier or anything like that

#

You really have to fuck off with this attitude

thick karma
#

lol well I forgive your attitude ❤️

bright fog
thick karma
#

People are going to say wrong code is wrong when it's wrong

#

I'm sorry.

bright fog
#

I'm not lying or anything, I did it like that

thick karma
#

Post it in console 1 line at a time using global variables and try printing player:getModData().test.hello and show us the screenshot

#

prove me wrong

#

by all means

#

My rejection of your code is not personal

#

It's just code.

#

Code either does what we think or doesn't. In the case of what you posted, it doesn't.

#

I don't hate you but you're welcome to hate me.

#

Just food for thought, you're also telling me I'm wrong and I'm not mad at you about it. And you even swore at me! In earnest! ❤️

#

(Because I'm a determinist so I don't blame ya or anybody else for the physics of consciousness.)

#

(If we controlled our thoughts the world wouldn't be a shit place to live for so many people.)

grizzled fulcrum
# boreal condor Hey guys, I'm new to modding and I'm struggling to find the info I need, hopeful...

I initially thought you could find all the stuff in media/scripts but it appears I am wrong. The only instance I could find for a units listing is taking the ConditionMax=5 and UseDelta=0.05 variables from the media/scripts/items_food.txt Line 2716 recipe and multiplying them to get some sort of number?
But then again, 5/0.05=100 and there definitely aren't 100 uses in a full saucepan with water ;-;

thick karma
#

Screenshot for ease of comparison.

#

(Missed a line when I rewrote for clarity. Just clarifying it's still wrong.)

grizzled fulcrum
#

I don't want to add fuel to the fire but I tested it as well and the same result, even when using different names for the globals to make sure it wasnt some sort of namespace issue

grizzled fulcrum
grizzled fulcrum
#

and I did try this before, the reason why it wasn't "working" was because I didn't scroll down in the console so I only saw the first like 5 entries and assumed my table wasn't in it 😂

thick karma
#

😭

#

Classic modding.

boreal condor
# grizzled fulcrum I initially thought you could find all the stuff in `media/scripts` but it appea...

thanks, yeah seems like the thing with liquids is nontrivial...

I found some promising code in lua/server/RainBarrel/BuildingObjects/RainCollectorBarrel.lua

it very clearly has the max capacity defined there, I might need to do some fiddling to fully figure it out, but there are other related files around

what's weird is I can't find any other container at all - Water Bottles, Cooking Pots... I'm looking into decompiling the game and see if somehow that helps

grizzled fulcrum
#

maybe it's hardcoded into the java

frank elbow
#

They're there, just a matter of knowing what to look for (which gets easier)

vestal gyro
boreal condor
# frank elbow Water bottles: `WaterBottleEmpty` (`items.txt`) & `WaterBottleFull` (`items_food...

yes I know where the items are defined, I was just saying I couldn't find where the liquid capacity is

item WaterPot
  {
    DisplayName = Cooking Pot with Water,
    DisplayCategory = Water,
    Type = Drainable,
    Weight = 3,
    Icon = Pot_Water,
    CanStoreWater = TRUE,
    EatType = Pot,
    FillFromDispenserSound = GetWaterFromDispenserMetalBig,
    FillFromTapSound = GetWaterFromTapMetalBig,
    IsCookable = TRUE,
    IsWaterSource = TRUE,
    RainFactor = 1,
    ReplaceOnDeplete = Pot,
    ReplaceOnUseOn = WaterSource-WaterPot,
    Tooltip = Tooltip_item_RainFromGround,
    UseDelta = 0.04,
    UseWhileEquipped = FALSE,
    StaticModel = CookingPot,
    WorldStaticModel = CookingPotWater_Ground,
    Tags = HasMetal,
}```
bronze yoke
#

it's the use delta

#

uses = 1/UseDelta

hallow cradle
#

I am trying to solve animation problem (I want to when player only have "ClubHammer, StoneHammer, Hammer or Ball-pen Hammer, to show that hammer hitting the ground example: if you have club hammer, club hammer will be showed in animation. I tried to put: Prop1:Hammer/ClubHammer/etc, but it's break code. I also tried search for "Saw log " in recipes.text and find something that dosen't work for my code: Prop1:Source=2,
Prop2:Log,

tranquil kindle
hallow cradle
#

I don't think so.

#

only thing that's break my code is Prop1:Hammer,ClubHammer,etc..

#

the reason why added /ClubHammer it dosen't show clubhammer as option for breaking stone if i only left this code: [Recipe.GetItemTypes.Hammer]

#

i think for this i need to use "if statement" (like if player only have club hammer then show clubhammer in animation)

#

correct me if I am wrong

tranquil kindle
#

I think i found the issue, but let me test it

hallow cradle
#

oke

tranquil kindle
#

Im not sure if that would cause you errors or anims to not work, but you do have "keep [Recipe.GetItemTypes.Hammer]" but then you did not repeat "keep" when stating club hammer.

tranquil kindle
# hallow cradle oke
recipe Make chipped stone
    {
        keep [Recipe.GetItemTypes.Hammer]/keep ClubHammer,
        Stone,
        

        Result:SharpedStone=4,
        Time:100.0,
        Category:Survivalist,
        AnimNode:BuildLow,
        Prop1:Source=1,
        Sound:Hammering,
    }
hallow cradle
#

@tranquil kindle tnx

verbal yew
# hallow cradle <@286889717985705986> tnx
recipe Make chipped stone
    {
        keep [Recipe.GetItemTypes.Hammer]/ClubHammer,  -- << Source=1.
        Stone,                                              -- << Source=2,
        

        Result:SharpedStone=4,
        Time:100.0,
        Category:Survivalist,
        AnimNode:BuildLow,
        Prop1:Source=1,
        Sound:Hammering,
    }
#

[Recipe.GetItemsTypes.Hammer] - it's func return all items with tag Hammer

#

and it's should keep [Recipe.GetItemTypes.Hammer]/ClubHammer,

#
keep [Recipe.GetItemTypes.Scissors]/[Recipe.GetItemTypes.SharpKnife], 
keep [Recipe.GetItemTypes.SharpKnife]/SharpedStone/MeatCleaver,

for example

verbal yew
#

sawing

peak nymph
#

Hi all, does anyone know of any mods that use custom character/ranged weapon animations, preferably aiming and firing anims, just so I can see how they work for a weapon I’m trying to add

violet shell
#

Is it possible to have a sound looping several times ? I'm making a very small mod that allows to rip a parachute into sheets, and I set up the time needed to rip longer than the vanilla sound "ClothesRipping", in my recipe I have this line : "Sound:ClothesRipping", I would like the sound loop 2 or 3 times to match the duration of the action I set up. Any idea ?

verbal yew
# violet shell Is it possible to have a sound looping several times ? I'm making a very small m...

https://www.youtube.com/watch?v=VJoDABrzRM8
download something like than like MP3 or OGG, create your custom sound

► Download Link: https://freesoundstock.com/products/clothes-ripping-sound-effect
► Sound Effects Pack: https://freesoundstock.com/products/soundeffectspack
► By getting the Sound Effects Pack you’ll be able to use all our sounds royalty free for all projects.
--------------------------------------------------------------------------------------...

▶ Play video
#

for example on screen your Sound:ClothesRipping be like Sound:zReVAC2_Inject

grizzled fulcrum
#

I've been on the edge about having my mod's code initialise in the main file or in the OnGameBoot event. I've seen people do both and I am not sure what's standard practice. I'd like to think OnGameBoot is the way to do it but wouldn't that mean if someone were to enable your mod, they would have to restart the game to trigger OnGameBoot to actually initialise the mod?

hallow cradle
#

anyone know how to edit text style like this and imoprt Gif and png ?

coarse sinew
bright fog
#

You directly initialize stuff in the main file (so add functions in the main file and not within another function)

#

And if you need to delay stuff, use OnGameStart

grizzled fulcrum
#

ok

bright fog
#

I've yet to find any use cases for OnGameBoot

candid ridge
#

Does anyone here know how to use CFR to decompile classes?

#
java -cp "D:\Tools\IntelliJ IDEA Community Edition 2021.2.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 %*```
#

this is for IntelliJ but not sure how do you repurpose this for CFR?

#

:/

bright fog
#

CFR ?

candid ridge
#

java decompiler

bright fog
#

yes thank you I guessed it

#

But I don't know it

candid ridge
#

my decompile_PZ.cmd is structured like this

bright fog
candid ridge
#
decompile.cmd D:\Games\steamapps\common\ProjectZomboid\zombie .\decomp
bright fog
#

idk shit about cmd not gonna lie lol

candid ridge
#

yeah its fine I'm just posting my problem if incase anyones willing to help

bright fog
#

👌

bright fog
candid ridge
#

yeah but you need intelliJ right?

#

I dont want to install a whole ass software just to access it's decompiler only

#

I have an IDE setup already

bright fog
#

I don't use IntelliJ

#

I just installed it to decompile

#

And you can uninstall it right after

candid ridge
#

huh

#

it says intellij as a pre requiste?

bright fog
#

Once all the files are decompiled it just makes copies of them in a folder and I open them with VS code

bright fog
#

Not to open the files themselves, you can use it sure but no need for it

candid ridge
#

Yeah but I want to avoid using intellij

bright fog
#

👌

candid ridge
#

people over here seemed to use cfr just fine

#

so I'm not sure how did they do it exactly

bright fog
#

I suggest asking in the modding Discord, Albion told me about all these tools to decompile

candid ridge
#

could you point out wheres the modding discord?

bright fog
#

Took me a while to understand at first bcs it was the first time I did this and I'm not a developper so I'm not familiar with any of this but I managed to do it

candid ridge
#

didnt know there was one

bright fog
#

(it says unknown but click on it anyway)

echo lark
#

anyone know if its possible to get a normal item to break when using it? or does it have to be classified as a weapon? trying to make wooden needle break after using it so many times.

bright fog
#

You can definitely do a custom durability system for items yeah

#

Susceptible does it with its filters

river anvil
#

Hey, I've got a silly question. I wanted to try and make a custom wearable container of sorts, but I'd like it to go into for example neck slot (like a necklace or a scarf). Is that possible? Or can wearable containers only go on the back and fanny pack slots?

bright fog
#

Nah you can definitely make containers on other parts

#

A lot of mods do it with leg containers for example