#mod_development
1 messages · Page 269 of 1
unless lua turns table into string automatically which would be really weird thing to do
Also if you transmit all the things properly, you shouldn't need to sync it to the client
no this -> {} just Example
-- server
local vehicle = addVehicleDebug("Base.ModernCar", IsoDirections.E, nil, getCell():getGridSquare(player:getX(), player:getY(), player:getZ()));
sendServerCommand(player, 'MY_module', 'MY_command', {vehicle = vehicle:getId()}); -- vehicle:getId() is not nil
-- client
function OnServerCommand(module, command, arg)
local vehicle = getVehicleById(arg.vehicle);
-- arg.vehicle is not nil
-- vehicle is nil <- WHY????
end
getVehicleById can return nil if the vehicle doesnt exist
check what the value of arg.vehicle is before the getVehicleById call
wait huh
I see what you mean now lol
Let me double check something
yeah I thought so
this is why the Java codebase is so bad rn
getId() doesn't return the Module.Type of the vehicle
It returns a number, assuming to be the id of the vehicle in the world, but in my testing it always returns 255
You probably want vehicle:getFullName()
yes it's a short
fuck
thank you
if you're just trying to sync the id, it should do it by itself
but currently there is no real known way to set a short in Lua as far as I know
what are you trying to do? get the client to see the vehicle? if the square is not loaded, vehicle will be nil
instead of spawning it on the server have the server tell clients to spawn it
client spawn vehicle is not global
also you included player's variable
where is this player comming from? from args?
OnClientCommand()
you should probably not use players as source of sq and direction
unless you check if its the same player that sent the command perhaps
yeah nvm i think thats fine
if i would do this however ill just send the x y z to the server and not rely on player
thank you

but Not resolved my problem...
congrats
are you trying to spawn a car for a player?
i dont really understand what you're doing
player can only "witness" something if its on a loaded chunk
no square means everything in that square is nil
your best bet is to have client send a command to server to spawn a vehicle, and client is the one issuing the x,y,z params
if you're doing it the other way, vehicle will be nil unless the square that the vehicle is on is loaded
so you can do
local vehSq = vehicle:getSquare()
if not vehSq then return else vehId = vehicle:getId() end```
but if the square isn't loaded then the client doesn't know a vehicle is there 🤷♂️
if (player location x,y,z === vehicle location x,y,z) {
player is no witness
}
this right?
sorry i'm low level english
No player has to load in a square that has the vehicle for the vehicle to exist
On client side
load !== render ??
if the vehicle is at 1000,2000,0
but the square does not exist for the client
then the vehicle will also not exist
spawn vehicle on player:getX,Y,Z()
this vehicle is not exist??
addVehicleDebug(vehArgs.vehicleToSpawn, vehArgs.spawnDir, nil, getCell():getOrCreateGridSquare(vehArgs.vehicleX, vehArgs.vehicleY, 0))```
make sure your z is 0
it wont spawn at z=1 for instance
vehicleX and vehicleY is just getPlayer():getX() and getPlayer():getY()
vehicle is spawn success
but client side getVehicleById(vehicleId) is nil
arg.vehicle may not necessarily be the vehicle id
if you just spawned it in
that number might be something else
server side vehicleId === client side vehicleId
i'm check success
so when you get the Id for the client and server it is the same id?
yes
can vehicles not spawn above z 0?
has to be less than 1
that's something I assumed, guess I'm changing stuff
it can float in the air but it should drop to the ground
if you use debug tool for vehicle angles, you can sometimes see z is between 0 and 1, and you can drop it to set it to 0
but if there is a floor tile at z 1 will it just bug out?
iirc it cannot be spawned above ground floors
is there a mod that reduces tv xp?
what abt the helicopter mods? i havent checked the codes but i thought maybe it used z -1 ?
cuz i thought maybe its able to phase thru zeds and structure to make it seem its on higher z
vehicles can go to zs higher than 1 but i don't think they spawn there, it's quite noticeable because they don't even collide with anything up there lol
there's a couple clips of people getting into crazy car crashes that launch their car into the air, and it clips through a second story wall and lands inside a building
yeah something messes with the vehicle physics during mp desync
maybe multiple clients are sending opposing commands
and it breaks
or even on the walls
https://www.youtube.com/watch?v=_hpDuei5VS4
Didn't stick the landing though
I hope you have car insurance.
i'm find this
OnServerCommand -> CarController init
개 거지 같은거 샌드서버커맨드가 먼저 호출되고 그 다음 차량 동기화가 호출되네 진짜 개 빡치네
LOG : General , 1731088786352> 1,193,091,192> [test] vehicle_spawn_succ number 229
DEBUG: Vehicle , 1731088786378> 1,193,091,217> CarController.<init> > Vehicle vid=229 type=Base.CarNormal has been added at (8104.000488;11778.000977;0.333060) auth=vid:Base.CarNormal(229) pid:(-1) auth=Server static=false active=false
so it seems to work fine
cant spawn above 1 and cant spawn inside of a room, but you can move them after it spawns iirc
I'm setting a couple things to mod data on an item. size and isoSprite. It works great until I restart my game and it loses the isoSprite.
local treeData = treeItem:getModData()
treeData.treeSprite = tree:getSprite()
treeData.treeSize = tree:getSize()
restart the game and:
local data = tree:getModData()
print("Planting da treez")
print(data.treeSprite)
print(data.treeSize)
and no isoSprite in mod data. treeSize is still there though. I'm lost. Do I need to transmit, even in SP?
objects can't be saved
I love PZ. I could probably serialize what I need. Thanks!
Need a JSON parser for PZ Lua?
Oh you mean the object instancing.
nah, I just needed the sprite name from isoTree
thought it would be nicer to store the whole object so I could plop it down later
If you ever need one, know that one exists. =)
I use JSON serialization for packet encryption.
did you have to write all that? The only real solution I've seen for Lua was written in C
nevermind, I just googled it. I guess it is feesible in pure lua
I did. I had to emulate bitwise ops as strings but it works.
I solve the issue of speed using coroutines.
It's slow but it works and I use it for situations that warrant its use.
I tried playing with coroutines but after a few I decided drinking was more fun
Doing it inside the fake LVM (inside of the JVM), is an additional layer of security for virtual side-channel attacks since the Lua memory is jumbled around more.
It's easier to MITM a compromised client on the JVM level since bytecode analysis and modifications are very easy.
I almost came to the conclusion but then I thought, "Why not both?" =)
PZ is one of the funnest sandboxes for writing & testing security solutions.
It's addicting haha
But yeah the tools I wrote for it are open-source if you ever want to pick at it.
coroutines helps a lot with single-threaded environments with limited calc time.
It's pho-async but it's better than nothing.
stuff I wouldn't even think about doing
I've got a bunch of your git goodies bookmarked. some neat stuff
I'll get around to pythoid one day
When I release a revised client-side anti-cheat I'll document my tools a bit to help people who may want to use it or further it in any way.
I wrote a solution that both the client and server work to create an encryption key and then update it ever-so-often.
Really neat for anyone who writes mods or their own anti-cheats in the future to secure their code.
I still need to write a get_event(event_id) method but you can still handle events in pythoid. It's basically ready otherwise.
<3
i uhh can't get this to work somehow
TraitTest
TestProfessions = {}
TestProfessions.addTrait = function ()
local LuckyStart = TraitFactory.addTrait(
"LuckyStart",
getText("UI_trait_luckystart"),
1,
getText("UI_trait_luckystartdesc"),
false
)
local weapon = {
[1] = "Base.KitchenKnife",
[2] = "Base.Spoon",
[3] = "Base.PipeBomb",
[4] = "Base.WoodenMallet"
}
function LuckyStart.OnNewGame(player)
local Item = weapon[ZombRand(#weapon + 1)]
getPlayer():getInventory():AddItem(Item)
end
end
did you use someone's code as a reference?
The return value of addTrait doesn't have anything to register events
you need to do that separately like
function TestProfessions.OnNewGame(player, square)
-- your code here
end
Events.OnNewGame.Add(TestProfessions.OnNewGame)
TestProfessions = {}
TestProfessions.LuckyStartWeapons = {
"Base.KitchenKnife",
"Base.Spoon",
"Base.PipeBomb",
"Base.WoodenMallet",
}
function TestProfessions.LuckyStartNewGame()
-- your stuff here
end
function TestProfessions.addTrait()
local LuckyStart = TraitFactory.addTrait(
"LuckyStart",
getText("UI_trait_luckystart"),
1,
getText("UI_trait_luckystartdesc"),
false)
Events.OnNewGame.Add(TestProfessions.LuckyStartNewGame)
end
something like that
but if you plan on adding lots of traits, I'd go the route of having a separate lua module per trait so in your main traits moduel you can just handle all of that in one place
oh ok, that is fine then 😄
Thanks 👍
those replies you only really need to do if you plan on spending a decent chunk of time for modding
Hey guys, hope you can help.
I'm trying to add some specific settlement machines to my server. I haven't modded much zomboid before, but other games.
Criteria:
- The machines should not be moveable by any other than admins. I've added 60 base weight to the items and tile assets for that reason.
- Admins will place them by item viewer adding them to the map and then placing it, like normal furniture.
- A bunch of recipe scripts are made and tied to the machines through NearItem.
- Specific machine sounds play when the player makes a recipe.
Now, through trial and error I've come so far as to draw the assets in GIMP, make a .pack file, a tiles file, item icons, and the item and recipe scripts in /scripts.
But in-game, it doesn't seem to call the item and recipe scripts in /scripts correctly, and I dont know why. No item icon, no possibility to place the "furniture" even though i've tried to define it as "moveable"
Also the debug log gives me "cannot create recipe for this moveable item: Base.Refinery, warning, moveable not valid"
which is strange, since i've defined it as moveable.
My bet is I'm missing some lua code, but currently have no idea what to write.
Hope any of you can help! thank you.
Workshop page: https://steamcommunity.com/sharedfiles/filedetails/?id=3361737245
hmm might be a question of bad item naming in shared/translate
share ur item script
module Settlements
{
imports
{
Base
}
item Chemlab
{
DisplayName = Chemlab,
DisplayCategory = Furniture,
Type = Moveable,
Icon = item_chemlab,
Weight = 60.0,
WorldObjectSprite = Settlements_1,
}
item Cuisine
{
DisplayName = Cuisine,
DisplayCategory = Furniture,
Type = Moveable,
Icon = item_cuisine,
Weight = 60.0,
WorldObjectSprite = Settlements_0,
}
item Refinery
{
DisplayName = Refinery,
DisplayCategory = Furniture,
Type = Moveable,
Icon = item_refinery,
Weight = 60.0,
WorldObjectSprite = Settlements_2,
}
}
Remove the item_ from Icons, and rename the icons .png's to Item_. And the NearItem attribute in the recipes scripts actually are the moveable names, compose from "CustomName" + "GroupName", you can see this name in the object name filed (in debug press F2 and see the attached image). In this case the door isn't a moveable, but I assigned this name through my mod.
unfortunately I can't run your mod, I don't have all the requirements enabled, I see some items from other mods
so;
- in items script change ot : "Icon =cuisine" and file name "Item_cuisine.png"
- in recipes script change NearItem to the Customname Cuisine
- do I need Groupnames?
thx so much, also for the f2 tip
ye, i remember, sorry bout that. It uses fuelapi and thatdamnlibrary, cause of some gas tank recipes from the refinery
thank you man, helps a lot
Video shows the issue and I can't figure out why the highlighted squares flicker on one side. Any help would be very appreciated. The code for highlighting, which runs off of the OnMouseMove event:
setBigDrag.mouseMove = function()
if not setBigDrag.isDragging then return end
local plZ = getPlayer():getZ()
local endX, endY = ISCoordConversion.ToWorld(getMouseXScaled(), getMouseYScaled(), plZ)
setBigDrag.endX, setBigDrag.endY = endX, endY
local x1, x2 = math.min(setBigDrag.startX, endX), math.max(setBigDrag.startX, endX)
local y1, y2 = math.min(setBigDrag.startY, endY), math.max(setBigDrag.startY, endY)
for x = x1, x2 do
for y = y1, y2 do
local square = getSquare(x, y, plZ)
if square and square:getFloor() then
square:getFloor():setHighlighted(true)
end
end
end
end
forgot to get my desktop off there
for reference, setBigDrag.startX and startY are set at OnMouseDown event:
local startX, startY = ISCoordConversion.ToWorld(getMouseXScaled(), getMouseYScaled(), getPlayer():getZ())
setBigDrag.startX, setBigDrag.startY = startX, startY
How would I apply custom eating animations for items under Type = Food?
the item's EatType parameter sets what animation it uses
im trying to know how do i make a mod
i wanna make the game as 2d/3d as possible
im inspired by the road of the dead and doom
could anyone help me
???
changing the camera perspective isnt possible, youd have to create thousands of custom assets for your mod
i'll do what i can for what i have
for any cost
just tell me what steps i need to do
so i can make it possible
btw are you a scripter
if yes we could work toghether
i can do the assets
i am being so so genuine right now when i say youll have a better time recreating the game from scratch in another engine
heck nah
so are you saying you want to make the game first person? step one is 'rewrite half of the engine' and step two is 'recreate nearly every art asset in the game'
it's a game sized project
please 🙏 just make a new game
what do you mean "we dont need to be copying pz"
its not pz if youre not copying pz
i don't wanna copy project zomboid
what's your experience with game development
demn it ima still try it
glhf
IsoTree is killing me. There's no way to set javafields is there?
yes
trust me, don't rewrite the engine to support full 3d stuff, just use UE5 or something for the love of god
and also the fact that the game is made in java
should deter you enough
don't tell the modding messiah what to do
he is an experienced professional
hey now they have 50% experience...
and there's no way to save an object? specifically an IsoSprite
maybe I'm thinking about this the wrong way
you can't save an object but you can save whatever data you need to reconstruct it
IsoTree is just an object with a sprite name and some java fields. I can copy all of that just fine but I can't figure out how to piece it all back together to make a new IsoTree
I can get the tree to an item, but when I place it back it is a bare tree
how do these things get set in the first place?
there's only a couple of setters on IsoTree.
from looking at the class, setting its sprite should be fine, but the other properties are a little hopeless
the game must set them somewhere though and unless it's just randomised or something there may be a way in through that
I was wondering if sprites can by created on the fly
because it looks like the "tree" gets most of it's constructors from the sprite
already looking through that. was just kinda banging my head for a minute thinking
Is there a way to make eating a Type = Food item instant? Or perhaps just make the time required very short?
i think the eating action takes a fixed amount of time so you'd have to mess with the action to do it
Is there an easier way to just get a 'consume item' action in the context menu with a Type = Normal instead?
not really easier but it can be done with context menus if the actual food stuff isn't needed
mod release: Zomboid Crossing Rabbits Pack https://steamcommunity.com/sharedfiles/filedetails/?id=3362998798
I'm not making a food item, I just needed a way to run a function after using an item
Was using OnEat for running the function, but it seems a bit unnecessary now lol
this is untested, but i would do it like this:```lua
local handleOptionClicked = function()
print("option clicked!")
end
---@type Callback_OnFillInventoryObjectContextMenu
local addContextOption = function(playerNum, context, items)
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
---@cast primaryItem ContextMenuItemStack
primaryItem = primaryItem.items[1]
end
if not primaryItem:getFullType() == "Module.MyItem" then return end
context:addOption("My Option", nil, handleOptionClicked)
end
Events.OnFillInventoryObjectContextMenu.Add(addContextOption)
this creates a context menu option 'My Option' when you select an item of the type Module.MyItem, which fires handleOptionClicked when clicked
this script would go into client right?
yeah!
does the event.OnFillContainer happen even if a container is empty?
it should fire as long as the container did try to spawn items, even if none of them actually spawned
thanks
how large is the area for event.OnFillContainer?
The code works, but it adds the option to every item lol
ohhh i forgot about operator precedence in lua
swap if not primaryItem:getFullType() == "Module.MyItem" then return end for if primaryItem:getFullType() ~= "Module.MyItem" then return end
this works great thanks!! for adding the same context menu option to multiple items, i tried to copy if primaryItem:getFullType() ~= "Module.MyItem" then return end several times but it didn't work
Am I just reading the code the wrong way, and it shouldn't work like this lol?
basically what this line does is ends the function early if the item *isn't* the item you want - if you add multiple then correct items will just trigger the other ones anyway
the easiest way to get it to accept multiple items would be to add a lookup table like this:
-- put this outside of the function
local items = {
"RustRinges.PercentTenRinge" = true,
"RustRinges.PercentTwentyfiveRinge" = true,
"RustRinges.PercentFiftyRinge" = true,
"RustRinges.PercentFullRinge" = true,
}
-- replace the old line with this
if not items[primaryItem:getFullType()] then return end
this checks if the item's type is in the table and returns early only if it isn't
Doesn't feel like = true should be necessary, right?
it's needed here because the item type is the key
it's a little backwards but checking a specific key's value is a lot cheaper and easier than checking the table for a specific value
Sounds reasonable, I suppose lol
Lua feels like the type of language to do something like that
basically if we did```lua
local items = {
"RustRinges.PercentTenRinge",
"RustRinges.PercentTwentyfiveRinge",
"RustRinges.PercentFiftyRinge",
"RustRinges.PercentFullRinge",
}
Ahh, I see
oh come to think of it
it should be written as```lua
local items = {
["RustRinges.PercentTenRinge"] = true,
["RustRinges.PercentTwentyfiveRinge"] = true,
["RustRinges.PercentFiftyRinge"] = true,
["RustRinges.PercentFullRinge"] = true,
}
Figured something was wrong lol
But couldn't find anything online about dicts in Lua
lua is all tables, which are basically dictionaries, other structures are implemented by just using tables in a particular way
I'm making a mod that conflicts with another mod. But the only conflict is 1 lua file, it would work perfectly fine if I could stop that other mod from using that lua. Can I achieve this?
I tried putting same name'd lua file with identical file path in my mod, then having it contain only
return;
end
idk I feel like im doing it wrong 🥲
that should work
the override will only work if your mod is later in the load order - you can ensure this in singleplayer by requiring the other mod in your mod.info
servers will however need to manually place your mod later in the mod order
ooh requiring is what i need i think.. thank you! 🙏
its important to have that
thts how you use a table as a boolean operator
that is if the mods function is global or local returned
if its just local then you cant access its function even if you require it
also how does it conflict ?
i dont need to access its functions, i just needed it to stop using its functions. once i required the file, it properly overwrite it ^_^
requiring doesnt really stop it
anyways can you share the function youre tying to stop
cuz if that function is being called by other function outside of that lua file then the mod will throw error
you can overwrite it this way
function A()
-- original code
end
function A()
return
end
but if the function is local
local function A()
-- original code
end
then this
function A()
return
end
will do nothing
real
Does anyone do unit testing for PZ lua mods? I would like to get better at unit testing, but in lua
It shouldn't be too hard to add your own unit tests
I thought about making a full testing library because mainly for performance reasons to test the speed of code (mainly for tick functions and such) but never got around to it due to me just jumping all over the place at different projects
PZ Mods Unit of test is the user trying to use it. And the Default Report is "Does not work" comment on workshop item thread 
🤣
Alternatively "It does not work with my 250 other mods, and I'm sure that it's your mod the broken one (it's actually not, and another mod is causing issues)"
i remembered @abstract raptor youtube vid about commenters
https://youtu.be/LVJeolLxFS0
Like a mod on the Steam Workshop for Zomboid? Well it's time your familiarize yourself with the types of commenters that already exist, least you fall into any of the wrong categories.
#zomboid
🎙️ Welcome to Tawky's Radio Show! 🎙️
Dive into the surreal world of Tawky, the hand-drawn radio with a direct line to... somewhere else. Whether it's...
I have busted unit tests for my library mod, but it's not testing PZ-specific stuff (i.e., mostly just making sure I don't break core utilities)
Theoretically would be possible to do so with a whole lot of mocking
It'd be nice if the KahluaThread and platform objects were exposed to the Lua side. It'd be nice to control and execute my own threads to perform tasks outside of the main thread entirely.
I'd use this for encryption tasks or computationally-heavy tasks for my mods.
I can see others using this too for any async needs.
i got a question, how does the DB shotgun model work when reloading?
since it goes from closed to broken open
i'm trying to figure it out since a db shotgun i'm fiddling with is swapping models
@tranquil kindle
Has more experience than me with the system, he should be able to explain it fairly easily
yes you need two models
i figured as much, i just don't know how it swaps between them, the scripts it uses
https://steamcommunity.com/sharedfiles/filedetails/?id=2961124369
refer to my nitro gun mod
you need to clone shotgun swing xml iirc
tho theres also another way i recently discover
i belive it was
setWeaponSprite()
mm, i think this might be out of my purview
i'm realizing what i'm thinking of doing would need some new modelling n' stuff
closest i've managed is slight texture alterations, i've still been unable to even figure out modelling
How do I heal an individual limb? As in if I want leftThigh health = 50
you can use something like player:getBodyDamage():getBodyPart(BodyPartType.UpperLeg_L):SetHealth(50)
is there a command to change the value of the full health bar?? in this documentation, I saw a field for OverallBodyHealth but player:getBodyDamage():OverallBodyHealth(70) just brings up errors
but for changing health?
you can use AddGeneralHealth(amount) to add/remove health but keep in mind the game's health system isn't really as simple as a healthbar so it might not have the effect you want
anyone has a snippet that prevents player from being able to take stuff from container. (but can see it)
I see how it works now, I had initially thought big health bar was 1700 (a combination of all the seperate limb health bars)
Perhaps I can calculate a percent number of health to add based on what getHealth() might give me?
yeah all good, i gotcha. its a specific farming function from yaki's weaving (to plant flax), but i have a farming mod that i want to use with their weaving mod.
my farming mod is not supposed to be used with other seed mods that aren't using BTSE_farming.
so, this is why i wanted to disable the farming function of yaki's weaving. i have my own flax being grown and the weaving mod is using that same flax. it is intentional ^^
at the end of the day just disabling that one farming lua from yaki's weaving was all my mod needed to make it compatible
hey @bronze yoke is there really no event which happens when a zombie spawns in the world?
I find that really bizarre, we have OnZombieUpdate but no OnZombieSpawned?
if you're thinking about adding some, an event for getting hit by a zombie is pretty direly needed
yeah this is the number 1 event i would really love to have
and maybe onCharacterMeet
triggers once
when 2 characters are within same cell
Like OnPlayerEnterCell?
or OnPlayerCellEnter OnPlayerCellExit
no clue what that would be used for but it is interesting anyway
because can't you just use getPlayerByOnlineID(id) and if it returns null then they're not in your cell?
like for example my sprite tag
i dont need to set it if the player is far
like loop it?
no, I figure there has to be a func for getting a player on the server from the client that returns nil because they are unloaded outside of your client's cell
i want to reduce the memory usage which is why i wanted this event
adding a looped check to do this beats the purpose
oh I see now
yes when they connect and disconnect
but when will you check during the game time when they are both on the same cell
well ideally I'd setup some sort of nametag api/thing that you don't need to use a sprite for or would just do the rendering and distance checks on the java side so there's no loss of performance
the game does it already for admin nametag/player username thing too
a potentially irrelevant technicality but this will only return nil if they've *never* been in the cell that session
so even if they enter and exit right after, it wont return nil?
yeah
that's weird
not knowing about unmet players isn't actually a 'feature', it was a last minute panic security patch
A whole drawback to current modding is not being able to access things outside of the client's cell/loading distance area without doing stuff on the server*, but even on the server if no one player has loaded it then you wont be able to do anything
so im gonna focus on this more after performance
it didn't behave that way until very late into b41, people were pretty mad because it broke a bunch of mods (and is the reason radio voice chat rarely works)
it might even be reverted in the future
I think just being able to force load and unload square/chunk is already a big help for people who do that stuff
it was to stop cheaters who could teleport to each player and instantly kill everyone on the server by simply not telling them where the players are
you ever familliar with mc modding?
I refer to it a lot because parts of zomboid remind me of minecraft, how it works in the backend like some networking stuff
not from the development side
hmm well in minecraft, most servers usually have their own anticheat plugin on the server side
because minecraft is like zomboid, you can fly and phase through blocks etc without telling the server
but you can use the server command
the one that you type on chat
cuz of java injection i believe
like it really doesn't do any credential checks or something from the players.db?
or whatever you call it
anyone know where to look for this?
i dont remember how padlock works
but maybe i should look there
in the past i've patched the inventory transfer action
ill try that
will it patch rightclick, drag and double click?
yeah
i think you might also need to patch another function related to taking items when crafting a recipe
right right
good idea
i should just add moddata to the container if those functions can access it
if not the ill have to add moddata to the item
btw albion do you know why the global moddata acts weird
i mean when you reference to something using a variable
if you change that variable it wont affect the original data
but for moddata it does
its very weird
show example plez
Does anyone have idea what dictates delay between starting attack with weapon and it dealing damage and causing zombie to play reaction animation? I'm trying to make a bow, but i'd like for damage to target and reaction to be delayed. Thought that maybe messing with those files in anim XML could work, but setting one of these or both at 1000 does nothing.
<m_Events>
<m_EventName>SetVariable</m_EventName>
<m_TimePc>0.0001</m_TimePc>
<m_ParameterValue>ZombieHitReaction=Shot</m_ParameterValue>
</m_Events>
<m_Events>
<m_EventName>AttackCollisionCheck</m_EventName>
<m_TimePc>0.001</m_TimePc>
<m_ParameterValue></m_ParameterValue>
</m_Events>
I also found this in 2handed melee weapons, but it also does not seem to work, maybe because my weapon "IsAimedFirearm=True"
<m_EventName>SetMeleeDelay</m_EventName>
<m_Time>End</m_Time>
<m_ParameterValue>12</m_ParameterValue>
</m_Events>
I also tried changing some item script settings that could from the name of it delay it if it were high enough, but they seem to be no longer used.
I'd prefer around 0,5 s of delay if possible, but so far no luck.
I also do Use custom Firing animation (best i could, considering i wanted to change only Swing animation and reuse Vanila 1handed gun animations
https://i.gyazo.com/15f78c34be34c2db59d4bac728be6719.mp4
Well... yes
Honestly that seems to be about the best way you could do it
Maybe some added animation work would help it feel more natural
https://i.gyazo.com/bb647b5439d5acc6b244eb61384b88e5.mp4 I had better animation, but since i wanted to use vanila animations it caused some "issues" and since we might be getting bows in b42 (maybe)\ I thought it might not be worth the effort
Could possibly find a way to make it load upon aiming, give it a slow aim speed and adjust animation.
I don't think that would be too difficult but can't think of an exact way right now.
That seems like more work, considering all i pretty much would want (if i can't, then whatever, its still pretty good in my opinion) is to delay damage/reaction of zombie by a bit.
Oh, that I'm not sure is possible, you could make it compatible with atro to use projectiles though
I mean, melee weapons do have delay between start of animation and zombie reaction. Especially sledgehammer
Hook isTransferaction
Thought i ask since someone might've discovered/know something about it
Guns work completely different as you probably noticed
I don't wanna give a positive "not possible"
But I feel like if it were possible I would have figured it out
My question still stands, If by some miracle someone has any idea, i'd appreciate reply. If not, i still consider it "good enough" for what it is.
@tranquil kindle how did you do your flamethrower?
Its a gun too, I just messed with Scales of gun in blender to make it stretch muzzle flash to simulate flame and added function on swing to set target on fire
.
youre on right track set the variable you give the target a bit later also the colission
just look for the right syntax to set it to the target
look at dodeath
right ill keep that in mind thank you
im making a gatcha
i can make the item textbased or based on the container items
thats just how you do global
moddata
client/Foraging/forageClient.lua
what if i just set the items weight
and then just drop the item if they rolled it
item container cant spawn items that weigh more than the container limit
it retuns a kahlua table, you should be able to, unless im not understanding (probably)
damn youre right
i already went through this exercise lol
if you want to add a ton of logic to item transfers best bet is the transfer action function
i use item fulltype when i do it
function ISInventoryTransferAction:transferItem(item)
GrabItem is when you're yoinking stuff off the floor
and works for foraging and picking items up off the floor
local hook = ISGrabItemAction.isValid
function ISGrabItemAction:isValid()
if self.item:getContainer():getModData().GatchaMod then
return false
end
return hook(self)
end
oh i hooked on the wrong thing ?
so grab action is just for floor?
this would only be for placed items?
stuff that spawns wont have custom item mod data
for container items
dw ill add button for admins to use it will set the data once they did that
i mean im making a penel that allows admins to set some variables to the gatcha container
Gatcha 
Making a patch for my game that lets me saw logs with the chainsaws from britas, but for some reason it's giving me the option even when I have no chainsaw on me, anyone know what might be causing this?
youre missing a ,
just noticed that as you sent that, thank you so much
I tried to add a custom item to proceduraldistributions but it seemed to just break all the containers
Maybe I'm not supposed to do it like this?
I did it like that with the normal distributions file and it seemed to work there
@fleet bridge ```lua
local hook = ISInventoryTransferAction.isValid
function ISInventoryTransferAction:isValid()
local cType = GatchaMod.getCType(self.item)
if cType and cType == "GatchaMod" then
return false
end
return hook(self)
end
local hook = ISGrabItemAction.isValid
function ISGrabItemAction:isValid()
local cType = GatchaMod.getCType(self.item)
if cType and cType == "GatchaMod" then
return false
end
return hook(self)
end
this worked. i was able to put items but when i take them it just bugg action
yea that works but iirc it gives you some error on timed action
doesnt seem to cause any issues, except the item may stay highlighted
oh I might just need to uncomment the bottom line
nah still not working
I assume my method is just incorrect
this method seems alright but it doesn't seem to allow me to insert a quantity of items?
hi all I'm trying to make a slingshot weapon that uses no ammo type and has unlimited ammo, is this possible via any of the properties?
item ZomboidCrossingSlingshot
{
DisplayCategory = Weapon,
ImpactSound = StoneKnifeHit,
MaxRange = 7,
WeaponSprite = ZomboidCrossingSlingshot,
SoundVolume = 75,
...
Icon = ZomboidCrossingSlingshot,
RunAnim = Run_Weapon2,
CriticalChance = 0,
CritDmgMultiplier = 0,
AimingPerkCritModifier = 0,
AimingPerkRangeModifier = 0,
HitChance = 100,
AimingPerkHitChanceModifier = 0,
AimingPerkMinAngleModifier = 0.05,
RecoilDelay = 25,
SoundGain = 1.5,
ClipSize = 25,
ReloadTime = 50,
AimingTime = 25,
BreakSound = WoodenLanceBreak,
MetalValue = 5,
MaxAmmo = 25,
AttachmentType = Hammer,
}
Just make it melee but use animations of other weapons
very interesting, if it's melee could it still be ranged?
If you set range of it, i dont see issue
Though then it might be problem with XP gains
thanks Nik I'll try it out
Since it no longer will be giving aiming EXP
Though making it infinte ammo isn't hard either, but a small lua code would do
all i can really guess is you're probably getting confused, there's nothing special about how mod data behaves compared to other tables and that inconsistency is actually not possible in the lua language
yeah bugged action
thats fine
TESTDATA = ModData.getOrCreate("TESTDATA")
TESTDATA["key"] = "var"
print(TESTDATA["key"])
local TESTDATA2 = ModData.get("TESTDATA")
print(TESTDATA2["key"])
TESTDATA3 = ModData.get("TESTDATA")
print(TESTDATA3["key"] )
TESTDATA3["key"] = nil
print(TESTDATA["key"] )
wait i think i am confused i didnt know table acts this way
yeah this is just how tables work
i tested it on regular tables
DATATEST = {}
DATATEST["key"] = "var"
print(DATATEST["key"])
local DATATEST2 = DATATEST
print(DATATEST2["key"])
DATATEST3 = DATATEST
print(DATATEST3["key"] )
DATATEST3["key"] = nil
print(DATATEST["key"] )
TESTDATA, TESTDATA2, TESTDATA3 are all references to the same table
so i didnt know all this time thats how tabled behaved
lua never implicitly copies objects or tables (modding would actually be impossible if it did)
variables don't contain tables directly, their 'value' is the address in memory of the table
so when you assign that variable to another one, it just becomes another pointer to that table
this is why setting a table variable to nil doesn't delete the table, you're just deleting the pointer
so you have to = {}
no, that's just making a new table for it to point to
ah
if you want to delete a table you just need to remove all references to it and it'll get garbage collected
so```lua
local t = {}
-- table created, 1 reference
t = nil
-- 0 references, table will be garbage collected
local t = {}
-- table created, 1 reference
t2 = t
-- 2 references
t = nil
-- 1 reference (t2) remains, table will not be garbage collected
i thought i understood tables
but now i dont think i did
if you know c pointers it's basically that but for tables and userdata only
because all other types get copied by value (string, bool, number, etc) but only table and userdata are copied by reference
-- Pass by value (copied)
local val = 123
local copy = val
-- val and copy here are referring to different memory (**sometimes), but both are equal to 123
-- Pass by reference
local t = {}
local t2 = t
-- t and t2 are referring to the exact same memory. t2 is actually a pointer that is referring to t
I'm not the best at explaining, but think about house and house address
in this case, t is the house (the physical block of land which has a house on it) and t2 is just the address of the house
i would say that it is better to not think of t as the house, they're both the address
true, I just think it's easier to say it like that maybe
well easier to understand to someone who doesn't know what pointer is or memory stuff though I am kinda assuming that glytcher didn't know about pointers before
wait, how are they both address?
in that, I just meant an address being a pointer and the house being the memory which has the data
they're both just pointers to the actual table in memory, the table isn't stored in the first variable
is that same behaviour in c too?
depends, often but not always
you can pass pointers to regular variables but anything dynamically allocated is doing this
is it because the table can be allocated anywhere in the memory?
as in it doesn't have a static place in memory just because it's a variable
that's sort of it yeah
variables never contain tables, just references to them - the first reference isn't special in any way
ok I think I was just confused with what you meant
you can think of the table constructor as 'create a new table somewhere in memory and return a pointer to it'
rather than 'create a table in this variable'
oh yes that makes much more sense when you explain it like that, I thought you were talking about some weird thing I've never heard before lol
I see what you mean, I just explained it not that technically
It's hard to explain it in lua-like syntax when lua doesn't have pointers lol
yeah 😭 the reason people get so confused about this is because it isn't really a concept lua bothers you with otherwise
i don't think PIL really explains it either
it has a small two sentence area explaining that tables and userdata are reference and not copy but that's it
if you've learned a language where pointers are explicit and separate from regular variables it's much easier to disect the differences between them
and it's very easy to miss
ye, I was thinking in C mode while trying to write it in lua mode which is a cause for disaster
so if t moves out to a new address
t2 will know?
i got the basic idea of that
but i know that its not gona update unless you update it
I think it'd only move address if it got gc'd which then it wouldn't refer to anything right?
but if you mean if t points to something else then yes t2 will also know
no, t2 is a pointer to the table, it doesn't know or care about t or what it currently points to
oh I misread lol
cuz its weird right
when im using debug
and i have function lets say
ontick that prints stuff
if i remove it it will stop
but if you reset the lua file
it will still continue even if you try to remove it it wont work but its there
its just that the variable that used to be its pointer no longer exist so you can stop the event anymore
yeah exactly
what i was saying about the 'house' and dynamic allocation is basically that it's equivalent to this:cpp Table* t = new Table {}; Table* t2 = t; (they are both pointers to a dynamically allocated object, neither of them store the object) and not this:```cpp
Table t {};
Table* t2 = &t;
ohh ok
whats &t
it's memory location
i dont know what language that is
the & is getting the reference (memory address like 0x1234...) of t
but i think i understand what youre sayin
i only have exp with this using cheat engine and task manager
basically in other languages pointers are explicit and separate from regular value types, unlike in lua where some types are values and some types are pointers and they're treated mostly the same
if thats the same
well not task manager
but proccess hacker
cheat engine my beloved that brings me back a couple years lol
kahlua doesn't really adhere to lua's concept of userdata (imo for the better, it is clearly designed for c) but java objects are userdata
just released my first mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=3364203593
adds a rare type of cigarette that decreases unhappiness instead of relieving stress
wanted to try something super simple first before trying anything else
nik I think I will need to do a lua script, do you have any pointers about how I can make unlimited ammo for a specific item?
ye refill the ammo of the weapon after player swings
use onweaponswing event
perfect
wpn:setAmmo(wpn:getMaxAmmo())
you have yo look for proper syntax tho
this is just to give an idea
someone should make a mod that replaces the pistol animation while walking with the one from watch dogs
make it locked behind aiming level 5
would work very well with the already established tactical aiming inside of the fancy handywork and brutal handywork mod
imagine it with the realistic trajectory overhaul mod
ngl it would work very well if the brutal handywork mod dev just made it.
i mean it is LITERALLY BRUTAL
another cool mod could be a execution mod (like the knife stealth kill/execute that the hunting knife uses)
but instead with a pistol
where you shoot them in the mouth blowing their brains out
What if zombies had finishing moves they could perform on players
could be a sub mod called brutal gunplay
they already do its called a bite
Get fucking suplexed by a zombie
instead of just walking with the pistol normally
you would have the watch dogs pistol walk animation
god if i understood how zomboid does their stuff
id make a mod rn
i barely understand LUA
id called it brutal gunplay
it
would have reworked bolt action rifle animations
more military style animations for the m16
and a reworked pistol set of animations
it would have gun executions
for the bolt action you bang them on the top of their head
for the m16 you shoot them in the stomach than head
for the pistol you blow their brains out through the mouth
i also wanna make a mod that lets you climb onto car wrecks
and parked cars
so you can shoot zombies from on top of them
has someone made like a singleplayer puzzle map for this game?
idk the limitations of creating mods for this game but I imagine that it could be possible to make special keys that only fit in certain doors
with specific spawns for zombies along with limited ammo
nah not seeing any puzzle maps
https://steamcommunity.com/sharedfiles/filedetails/?id=2813669334 heres an old one i remembered. idk if it works still i don't see why not
hey is there a way to modify and increase the fish catch chance if you're using a special rod?
I see ppl sharing their mods, so I also want to 
Workshop Link
It adds craftable helms from the videogame Dark Souls 1. DS 2 and 3 in futures update
This is my first mod, so every advice is welcome 🫶
congratulations
So how the game checks for this id think modifying the ISFishingAction class to check for your special lure is the best thing you could do . i think it would have to be set in new() and then checked for in attractFish(). a bit much but i couldn't find anything that modifies fishing in just the scripts. just setting anything as a lure gives a bonus of some kind though
am i doing this right?
local testitem = {
"Base.Fork",
"Base.Spoon",
"Base.BreadKnife",
"Base.ButterKnife",
}
local function AkidTestTrait(playerindex, player)
if player:HasTrait("Smoker") then
local inv = player:getInventory()
local randomitem = inv:AddItem(testitem[ZombRand(0, #testitem)+1])
end
end
Events.OnNewGame.Add(AkidTestTrait)
It should work
Haven't had my coffee yet 
You don't need the 0, in ZombRand tho
It's always from 0 to #
ah, noted
this one seems to be working as intended
local function AkidTestTrait(player)
local testitem = {
"Base.Fork",
"Base.Hammer",
"Base.BreadKnife",
"Base.ButterKnife",
}
if player:HasTrait("Smoker") then
local inv = player:getInventory()
local randomitem = inv:AddItem(testitem[ZombRand(#testitem)+1])
end
end
Events.OnNewGame.Add(AkidTestTrait)

im not sure if is Buffy here but i hope you like
https://steamcommunity.com/sharedfiles/filedetails/?id=3364600233
What are the common causes for items to vanish after a server restart?
Because I've been tweaking around with the scrap guns mod for server balance and stuff, and I'm noticing there's a single gun that just loves to vanish for no discernable reason without even leaving as much as an error when loading in on the clientside
Networking's always a fun one. I'm having trouble with global moddata that is being made, but not transmitted.
Not exactly sure where this is going wrong, but maybe someone can take a look with me.
I have ModData.getOrCreate("Data") running for everyone who doesn't have it yet.
When a specific action is done by a player, data is put the "Data" moddata by doing a remove, getOrCreate, add, and then transmit. Since this is sent by a client, the data should go to the server, correct?
Then I have requests called in by other clients, but they don't seem to receive any moddata.
I'm not sure what I could be missing. Any suggestions, or should I send up the codesnippets? 😄
keep in mind that ModData.transmit doesn't actually do anything with the data, it just sends it to the server for you to handle
it just fires the OnReceiveGlobalModData event with the name of the table and the table, it doesn't e.g. copy that to the server's mod data
IMO these functions are not really all that useful and i don't personally use them at all
Ugh. Is there anywhere I could read up on how to have it actually copied to the server and other clients?
to get it to do what you want with minimal changes you could do this:```lua
local function handleReceiveGlobalModData(name, data)
-- ignore other keys (e.g. from other mods)
if name ~= "MyModDataKey" then return end
ModData.add(name, data)
end
Events.OnReceiveGlobalModData.Add(handleReceiveGlobalModData)
personally i recommend just sending the specific data you're changing with server/client commands though, so you don't have to send the entire table over the net every time
...Oh. Right. Yeah, I see the logic now.
The table is one that won't get changed very often, but may as well get that right in one go.
Thanks Albion, always a lifesaver 🙂
How do I make a mod for custom VHS tapes
working on my first gun mod
basically works, just doesn't exactly line up with the existing animations
It shoots automatic but not as fast as I was hoping
I set RecoilDelay to 0, what else affects firing rate? I hope it's not dependant on the shooting animation
ui
from what I am seeing, there isn't a real official way of increasing the fire rate of a weapon other than setting recoildelay
unless it's tied directly to the shooting animation time?
yoooo I got it to work thanks!!!
It's jank (lua beginner here) but I wrote something like this
`require "Fishing/TimedActions/ISFishingAction"
local originalAttractFish = ISFishingAction.attractFish
function ISFishingAction:attractFish()
originalAttractFish(self)
local rod = self.character:getPrimaryHandItem()
if rod:getWeaponSprite() == "ZomboidCrossingFishingRodGold" then
return true;
end
... rest copied from original ISFishingAction.attractFish
end`
i think somebody did run into something like that, but it is so high that you shouldn't be able to run into it unless you're doing something like mass generating huge amounts of code

For some reason the logic I wrote wasn't working correctly and it just wasn't acknowledging a huge chunk of the code, but when I removed some other unrelated functions it worked. Couldn't figure it out, but moving half the functionality to a separate file and cutting down the code from 500 lines to 300ish per file just. Fixed it.
¯_(ツ)_/¯
potentially too many locals at top block of the file(?) or an accidental return somewhere in the middle of the file (outside functions).
a runtime error in the file's main execution could also cause it
Is there a way to force cycling with every reload?
I've made it so a rifle can load all its rounds at once with a 5x slower reload compared to normal to bypass the single loading getting janky with repeated reloads at higher levels
And it works fine reloading from empty, but it can reload at say, 1 in the chamber and it bypasses most of the intended slowness
I'll have another looksee tomorrow, thanks for the tips. This is my first time delving into LUA stuff so it's entirely possible there was a formatting error somewhere
I couldn't try this out right away due to it being late for me. But somehow, I'm still struggling with this.
For some reason I'm getting an exception error with 'add' from ModData.add, but it doesn't bother to give more detail or a stack trace 😒
It's like there's no data being grabbed by the code.
print the name and the data and see what you're receiving
name comes out fine, it shows the moddata's name. data prints as 'false'
To add on to it, I did notice the print is showing on the client, not the server. I don't know if that's intended or not.
so theres no data
thats why ModData.add is throwing an error
unless the data value is specifically false
Yeah, no. I understand that there's false means there's no data. But there is data in the moddata 😅 At least for the player who's executing the function.
I'm kind of stumped on where it's going wrong.
local function OnReceiveGlobalModData(key, modData)
if key == "key" and modData and type(modData) == "table" then
--yourcode
end
end
Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)```
if you're on debug, you can just do ModData.request("key")
then look at the global mod data on client side and see what you're getting
if you open debug console and just type in ModData.request("yourtable") it'll get the mod data from server, then you can open the globalmoddata debug tool to see what your client gmd is
and you can see exactly what the info is
Wouldn't doing a ModData.request not have much point, since the server isn't getting the moddata in the first place?
The client running the function has the globalmoddata, and I can see that in the debug option.
Yeah, running the command does nothing to change it.
Well, I figured out why the server isn't getting it, bleh. 'Request for non-existing table' That's a new one.
^ its just part of the debug process, but yea not having a table would generally be an issue
Which strikes me as odd. Both clients have the table in the GlobalModData menu. But the error would mean that the server doesn't have it?
so GMD can exist purely locally
you can do ModData.transmit("key") to send the client mod data to the server
then you need the listener event on server to grab the moddata and add it to the server global mod data
Ahh... I do have ModData.transmit, and I thought the
local function handleReceiveGlobalModData(name, data)
-- ignore other keys (e.g. from other mods)
if name ~= "MyModDataKey" then return end
ModData.add(name, data)
end
Events.OnReceiveGlobalModData.Add(handleReceiveGlobalModData)
Would be the listener event to add it to the server data?
i just learned a weird thing
local sq = getPlayer():getSquare();
local corpse = sq:getDeadBody()
print(corpse)
print(getPlayer())
before running the code what do you guys think will print
probably like
IsoDeadBody@0x128575blah
IsoPlayer@0x5775blah
OR it might say like table@0x735blah
that's how you can do relatively quick java type checking
but in reality you would mainly use instanceof
I think you use this event with ModData.request()?
like you put that event callback on the server
I personally don't know what it means by receive, like is that adding, removing, transmit, request?
actually now thinking about it, you're probably right in that it's used for ModData.transmit
and then it will copy it to server ModData
I imagine onreceive is when it gets some new data in.
What just confuses me now is that I do a ModData.add and a ModData.transmit for the client who adds the data to the globalmoddata, and that shows up fine in the debug. But the server receiving the handle only gets the key, but not the data.
is data false by chance?
it outputs that data is false, yeah.
that means there was no mod data found
do you create it before you add anything to it?
Like ModData.create("blah")
ModData.remove("Zone")
ModData.getOrCreate("Zone")
ModData.add("Zone", zoneTable)
ModData.transmit("Zone")
wait why do you remove it right before you getOrCreate
That's what it runs every time when a client adds a new are
That's... a good question. I might have been trying things out of slight frustration with the removal function 😅
if the remove is needed, use ModData.create() instead of getOrCreate because you know it's not going to exist before that
but apart from that, I don't understand why it would be false
The moddata shows up fine in the debug, is what stumps me. I'd get if it's false because there's no data. But the data is there, and it's being updated properly for that specific player. But when they throw in an update, causing the handle to be called, the server just says 'nothing here'
did you add a print statement to see if it was false im guessing?
Yep
also I just want to make sure that you cahnged "MyModDataKey" lol
Oh 100% I did 😄
hmm this is weird
Huh. I think I got it working now
wat ;-;
Or well, progress.
Player A creates a zone A, Player B has no zones.
Player B creates a zone B, player B now has zone A and B
I need to make it sync to everyone the moment changes are made. And, well. Ensure that players who are offline also get the changes
The thing I changed now is uhh...
local function initGlobalModData(isNewGame)
ZoneSync.Data.InfoStorageExample = ModData.getOrCreate("Zone");
end
Events.OnInitGlobalModData.Add(initGlobalModData);
I added this, is the only thing I modified. From an error earlier where the error said the moddata "Zone" was unknown to it
well idk if you can update offline player's mod data but as soon as they log on you can sync theirs with the server maybe
Dude nice , glad I helped at all
Yeah. When a player hops online is a fairly easy sync, just the changes online that need to be synced is what I gotta look into 😄 Probably the server calling a function to all players to request the data.
If you transmit the mod data from the server, it will push it to all clients.
yep was about to say
that's really helpful so you don't have to do it forreach player
That... makes it much simpler than I imagined, probably? I take it I can just throw transmit after add in the 'onreceiveglobalmoddata' event?
Server gets the data, on receive mod data, do stuff then transmit
And just to be sure. From that point on, there's no need to further call requests from the client side? You transmit, and the players get it?
When the client starts, you might want to request. Depends on how often the server pushes
Yeah, aside from the people that are offline, I mean. But as far as people who are already online, it's considered done?
If you're updating clients when the data changes, you should be good
Alright. I'll hopefully figure it out from here. I don't consider myself particularly bad with coding, but networking always has, and always will break my mind 😅
Contribute to MrBounty/PZ-Mod---Doc development by creating an account on GitHub.
getplayer() will return nil
so everything is nil
assuming the player is dead of course
yes correct they are different objects
they have different data too
no it didnt
this runs while the player is dead? on the "you died" screen?
so you're getting the player's dead body on death?
ya that makes sense
what did you learn about it?
i always thought getplayer() wouldn't return anything when you're dead 🤔
getPlayer() just gets a IsoPlayer instance it seems
so even if the player dies, the IsoPlayer still exists (idk for how long)
esp whben OnPlayerDeath couldn't give the player that died if IsoPlayer was deleted
It passes the player object down on event
I guess I'm thinking of before game start that getPlayer will return nil
But if you're already in game then it should return something
im learning stuff about death what happens to the game and its very weird anyways look at this.,
lol what
i have a key press function that lets me move my players square when i press f
as i leave the corpse and the zeds disapear.. so that means the data doesnt exist for the player anymore
it doesn't look like you're receiving any chunk updates
probably it returns the last known instance of the player object
Thnk you all for the help again. Works perfectly now 😄
for what it's worth, the first two calls are redundant as what you're doing is:
- delete the existing mod data
- create a new empty mod data
- replace that empty mod data with zoneTable
just ModData.add("Zone", zoneTable) is equivalent and faster
Please someone tell me there is an easier way to externally track player kills without parsing players.db.
really with RCON?
no, you do it via lua and send the info to the server
you cant do it via rcon, rcon is very limited in what you can do
Adds all ponchos + recipes. All credits for the original authors. Hope you like it ^^
https://steamcommunity.com/sharedfiles/filedetails/?id=3365224108
Released my first gun mod. Surprised there weren't any other mods that added the sten
https://steamcommunity.com/sharedfiles/filedetails/?id=3365235445
i think you can add command to rcon but i havent done anything like that so idk how
Steam isn't letting me update my mod. "failed to update workshop item, result=8"
anyone know whats going on?
today i learned that the steam workshop has an 8000 character limit for its descriptions.
and it doesn't tell you thats the error if thats the error.
even on the workshop page it just says "There was a problem trying to save the title and description"
is itemzed still a good program to use when making an item, like a gun?
no, it is outdated and doesn't work
what should i use instead?
we just write item scripts manually
oh
anyone know the item name of a walkie talkie?
You can easily find it in the game files
By using VSCode and the searching through the files feature you can search for instances mentioning "Walkie Talkie" and from that go back to the item script of the radio items
My apologies
I’m setting up a server for the first time and haven’t modded before. Can I find that from the server files?
Just, check your personal game files
any modder interested on co managing a server?
we can talk about the setup and all that ..
a client of nine offered
i kinda want to but im way too busy
so i was thinking maybe someone would like to try this
The Lua side stuff & items are all within media/—if you're unsure how to find the item name after searching we can guide you
Is it Radio.WalkieTalkie1
I found a bunch of stuff for it, I think its that?
Yep, that's the full type
Awesome!
inside the server.ini file there is a line to give players' spawning items. I want to give me and my buddies a radio when we spawn, would i place it like this?
# Item types new players spawn with.\nSeparate multiple item types with commas.\nExample: Base.Axe,Base.Bag_BigHikingBag
SpawnItems=Radio.WalkieTalkie1,
Sweet, Thanks for your help!
Heyaa, I wanna ask if the mods turned on reloads when you load a saved game or I need to restart the game everytime to reload a mod?
if you're changing them from the main menu, your mods reload when you leave that screen
if you join a server your mods will also reload, loading a singleplayer save with a different mod list will also trigger a reload, as well as any time you return to the main menu
I see, tysm for the info
I have been losing so much time restarting the entire game for a few changes

I'm not sure if it's weird that I can never find anything on google for simple problems or perhaps that's the norm because no one has trouble with simple little things that I can never get right and drive me bananas. Ok so I've tried calling this function OnGameStart and EveryTenMinutes but I get the same result. player is nil so the 'if' always fails.
local function PrintPlayerSkillLevelsAndModifiers()
local player = getPlayer()
print("STARSKY starting function")
print(player)
if player then
.......
that's very strange, getPlayer() should not be returning nil as long as a player exists, which is always true when those events fire
print(getPlayer())
you can paste that into the command console in debug mode and see what it chucks back at you
can you show how you're adding the function to the event?
I do get a value there.
I can. I know the function executes because I get that first STARSKY line in the log
Events.OnGameStart.Add(PrintPlayerSkillLevelsAndModifiers)```
I would have pasted that a lot sooner but I had to figure out how to do a code block so I don't look like a complete noob
That's at the bottom of the same file
local function PrintPlayerSkillLevelsAndModifiers()
local player = getPlayer()
if player then
print(player)
end
end
Events.OnGameStart.Add(PrintPlayerSkillLevelsAndModifiers)
damn, there was a specific mistake i was hoping you were making but it looks right to me
a lot of people accidentally call the function instead of passing it to the event which would make the prints show up but the actual time it'd run would be far before there was a player
hopes were dashed
As an aside, how do you get the colours in your codeblock?
```lua
```
ah thanks. Beautiful
Other than my code block between the 'if.... end' that's what I have
the only thing I can think of is your folder structure maybe?
It's in Client? I dropped it into another mod's lua and enabled that mod
user/Zomboid/mods/yourmod/media/lua/client/yourmod.lua
as long as it's not in server it should be fine (mixed up my events, anywhere at all is fine), the prints are showing so the file is definitely running
I think, I have whisky on my desk
I have scotch and beer on my desk
when that's all typed out, it looks so unnecessary
Oh yes I see I should put it under the user stuff, I was just cutting corners
trying to save the 10 seconds it would take me to create a new folder structure
I'm still trying to figure out which folder the lua goes in. If I want my mod to run on a server, would it go in Server or Shared?
the folder structure in this game is stupid and neither of those will ensure it runs on the server
the client loads files from all three folders (including server!!), and the server loads from shared and server only
if you want to run code on the server start the file with if isClient() then return end to ensure it doesn't run on the client
i will say that, in the case of this specific code:
a) getPlayer() does not return anything on the server
b) OnGameStart does not fire on the server
That sounds important
Guys/Gals, I really appreciate your help. I try to help out as much as possible on the sub-reddit with in-game stuff I know, as I grow as a modder I will do my best to pay it forward
Heyo, I'm trying to store the buildingID's between loads to mark which one's have been loaded before. I've tried creating a table but that gets reset when I reload the save. I've thought about using ModData, but does that use lots of save space?
if you're only storing the id's, I wouldn't think so
not really yeah
if you're just storing numbers, you can expect each to cost ~20 bytes, it's not really a big deal at all
cool. I didn't wanna do something that would end up maxing out people's hard drives
I've got this big ass module that keeps getting bigger to select multiple squares and returns them in a table. Right now it revolves around mouse events, which feels awful. is there a better way to this?
I've thought about trying to hijack UIElement
@queen oasis @bronze yoke Okay so what the effin poop nuggets. I created a new mod structure under users\zomboid and moved my file over there (it took 10 seconds) and now it finds player. wat? Anyway I'm getting a different error in my code, I'll work on that now. thanks humans. I have no idea why it would work now and not before
progress
That's one of my middle names. Along with "so far, so good"
classic
I've got a timed action that needs to remove the item from the inventory after it's done. do I put that in end() or perform()? I tried both with
if self.item then
self.item:doRemove(self.character)
end
but it didn't work, so I'd also like to know how to do that too
use perform(), stop() fires when the action is cancelled/stops early for any other reason
to remove an item use self.item:getContainer():Remove(self.item)
this causes an error
huuuh, is self.item not an InventoryItem..?
containers definitely have a Remove so the error must be that self.item:getContainer() does not exist, which would imply that self.item is not an item (but also not nil)
If it helps any, this is the Items.txt and is under module named RustRinges
i think the error here is in the lua, where is self.item defined? i assume it's in a new() function, if it's just being passed in where is it being passed in from?
adding a print(self.item) on the line before the error occurs would give some helpful information too
this outputs RustRinges.ThePristineCondition
it sounds like you just passed the string "RustRinges.ThePristineCondition" in then, not an actual instance of the item
probably lol, this is what the code looks like
I wasn't sure if there was a better way to do it
itemName gets defined as o.item in :new()
i think if you just changed primaryItem:getFullType() to just primaryItem it would all start working
after solving the few errors that that change caused, can confiirm it works as intended
thanks albion!! youre the best
glad to help!
Hi all! I've published an animal crossing weapons pack. Enjoy! https://steamcommunity.com/sharedfiles/filedetails/?id=3365477432
Introducing the weapons pack! Animal crossing weapons in Project Zomboid
this looks cool !!
I saw these too, they look epic (esp the dog one)
does dog zed work in sp? Asking because it said made for MP server in desc
is there a way to make something like this server-side only? Im trying to collect player kill counts externally.
externally meaning you want to write it to a file?
There's a mod that displays leader kill boards
You can look there to see how it transmits kills
Does anyone know how to integrate discord bot with the server?
I tried a few things I found on github, but it didn't turn out exactly how I want it to
If someone knows how to set it up, I pay for the bot
They mentioned B42 will use a unique random seed (or multiple) to determine animal trails and fishing spots, so I was wondering if that is currently already in use for other randomised aspects of world generation, like traffic jams or zone stories.
If so, anyone know a mod to set a world seed, or know how to make one?
Could someone help me with that request?
https://theindiestone.com/forums/index.php?/topic/72587-warframe-themed-mod-excalibur-mag-suits-skana-sword-1999-technocyte-zombies-and-protoframe-holsters-for-project-zomboid/
Hello, everyone. I’d like to request a Warframe-inspired mod for Project Zomboid that brings in some iconic elements from the Warframe universe. Imagine being able to find and wear clothing based on Excalibur and Mag! Excalibur’s outfit could be available for male characters, capturing his distin...
i think so yeah maybe
i never tested
i was too tired i fell asleep as soon as i upload
slr
If it doesn't, you can always play using localhost
try this
#1070858800501891172 message
yep thats right
just download mp fastforward mod
I am resigned to using OnMouse events. I modularized my code a bit more but I'm not getting my table back from the OnMouseUp function. I'm sure it's something obvious but I'm not seeing it.
-- called from context menu
Forestry.clearTrees = function()
local selectedSquares = setBigDrag.startBigDrag()
-- table is empty?
end
-- these 2 are in a seperate local module
setBigDrag.startBigDrag = function()
return Events.OnMouseUp.Add(OnMouseUp)
end
local function OnMouseUp()
-- the table is verified populated at this point
return selectedSquares
end
adding to an event doesn't return anything
you would want to trigger any code you need to handle that table in OnMouseUp
(also, if they are declared in the order shown here, you are essentially calling Events.OnMouseUp.Add(nil) because you didn't declare OnMouseUp yet)
setBigDrag.startBigDrag() this highlights an area of the ground?
I was trying to make "local selectedSquares = setBigDrag.startBigDrag()" into local selectedSquares = Events.OnMouseUp.Add(OnMouseUp) but if it doesn't return anything, blah
Events.event.Add(fn) just adds a function to that trigger event
you're not doing anything except adding it to the lua trigger event schedule
that's how I was doing it before but was to seperate it a bit
Events.OnMouseUp.Add(function()
local selectedSquares = setBigDrag.mouseUp()
how I had it before but there's so much going on with the code
yea, it works great but checking for anything that cancels it is a bummer to code
iirc a few vanilla debug functions use the ground highlight tool to get x,y coordinates
i assume you're just doing the same
I was thinking about using setDrag() but I think that only works with moveables. idk, I haven't dug in to the java
useing ISCoordConversion.ToWorld during OnMouseUp, Down and Move
the admin add safehouse tool has a drag tool to set safehouse boundaries, highlights the floor and grabs the corner coordinates
oooh
and the item removal tool does something the same
if thats what you're looking for you can just follow that
I remember looking at the remove tool last week and gave up for whatever reason. I'll look at the safehouse tool
Yo yo hi everyone. I'm working on an RP mod that, among other things, adds xp to certain skills on the start of a new run. I get that PerkBoost is attached to each skill, and it's given by occupations and traits. Ie: Lumberjack gives the axe skill a PerkBoost of 2.
Question: Is PerkBoost used anywhere other than to assign initial XP to that skill? Does PerkBoost ever change or (in Lumberjack case) is Axe PerkBoost always gonna be 2?
it just gives you that level when you start, it's not something that's like stored on the player permanently
though keep in mind that starting levels do affect xp gain permanently
Ah so a skill can have a xp boost and a book multiplier. I guess that's where PerkBoost is used, as I don't see a specific variable for the permanent xp gain. I guess I don't have to worry about it any rate. .... unless I should be applying the permanent xp boost to given xp
oh my bad i got confused, yeah perkBoost is that permanent multiplier
if you want it to be considered 'starting' xp you may want to give the corresponding perk boost but it's up to what you want really
yeah I tell you what, it's so easy to get confused with all this stuff, especially since nothing is named like what I think it should be named. Like Perks
but yeah in normal gameplay perk boost never changes
Do you know if the PerkBoost multiplier is used on Life & Learning XP or VHS tapes?
i'm pretty sure it is, book boosts are applied and i think they have the same toggle when granting xp
Ok thanks for your help Albion.
if you do interact with it the way it works is a little odd, the number you set/get from it is just the level of the perk boost, not the actual multiplier (so setPerkBoost(Perks.Woodworking, 1) gives carpentry the 4x multiplier you'd get from starting at level 1, not a 1x multiplier)
Level 0 — 25% (default for all skills)
Level 1 — 75% Greenblits.png
Level 2 — 100% Greenblits.png Greenblits.png
Level 3+ — 125% Greenblits.png Greenblits.png Greenblits.png
Green bits. Nice. Isn't that what we're talking about?
yeah but the claimed numbers are just lies lol
the multipliers are actually:
0.25x
1x
1.25x
1.33x
or, effectively:
1x
4x
5x
5.32x
Yeah I get that part. Multiples of 25. Kinda dumb way to do it, but okay.
But wouldn't it be:
1x
3x
4x
5x
actually i misremembered, it's 1x, 4x, 5.32x, 6.64x
the in-game displayed numbers are just inaccurate entirely
in-game level 1 is displayed as +75%, which is already an issue because nowhere at all does the game tell you the base rate is 25% so this looks way less significant than it is, but the others are displayed as +100% and +125% which just aren't in any way the actual numbers used
Huh. Okay well thanks again. So bizarre
Just for poops and snot rockets, and because I'm still learning about all this stuff, I decided to create a character with Carpenter occupation and Handy trait. Keeping up on skill books, I watched all the L&L shows to see how far I could get. I was level 10 carpentry on day 4.
very new to lua, how can i detect sound levels (how loud a sound is) and give debuffs if it's too loud? I'm trying to make a mod that adds sensory overload
Good question. You might be better off going through the sounds and finding the ones that bug you the most, then just replacing them. Like, take the original .wav (or whatever they are), making it quieter, and putting that in the mod
Some sounds bug the heck out of me as well. Especially gun sounds when the gun person is outside and I'm inside
I meant like, a trait that gives the character sensory overload
Panicking when they're close to loud sounds and getting stressed
I really like the gun sounds, they're pretty realistic
I've been near guns firing a couple times without ear protection, and it sounds pretty close to that
the OnWorldSound event fires when sounds that attract zombies play
but i don't think it would be possible to detect other kinds of sounds
I'll try it, does it have different volumes that you can specify or just that?
it passes a volume and radius but keep in mind this is just gameplay data and doesn't necessarily have anything to do with how loud the sound actually is
radius is how far zombies can hear the sound from and volume is basically just a tie breaker, if a zombie hears two sounds they're more likely to go towards the louder one
I've noticed mods that add temporary deafness having a problem like that, where mods that play "sounds" to attract zombies make your character deaf for no reason
yeah you'd probably run into the same problem with this
if you turn on a light switch at night i'm pretty sure it plays a 'sound' lol
You said it has a volume setting, so could I say it only makes you panic over a certain volume?
Oh I see. My bad. Now I'll have to do that audio thing myself. Damnit.
yeah, just warning you that that 'volume' is really just a zombie attraction parameter and might not line up with reality
Yeah, I thought making an autism trait would be interesting for players that want to challenge themselves, and I'm basing it on my own experience
One of my biggest symptoms is sensitivity to sound
Especially sudden sounds
I might try a special interests function eventually but I'm working on it one piece at a time
Maybe I could have it so ear protectors or headphones that you can wear muffle the sound and remove the panic?
Could be an interesting trade-off, your hearing gets worse but your character won't lose their shit around loud noises
How do I add panic?
I'm still xmas-wishing for encryption tools to be exposed & provided to Lua for build 42.
🙏
hiya, I'm a little confused with buildingID... does it give each building an incrementing number from 0 as it loads that house from your position? Or does each building have a hardcoded number?
I'm storing the ID's, and noticing that they start from 0 no matter where I am. Just checking if this is just how my code is set up or if that's correct.
Could be they are recyleed
I'm trying to save them to modData, so they aren't being recycled. I was testing with new saves. I thought I would see long ID numbers for each building. I'm not sure if the game assigns a number to each new building as it's loaded, incrementing by 1 each time.
looks like it, started at 772, next 2 buildings I got 773 and 774 - on a new game.
reloaded and 774 is now 801
hmmm, interesting...
Why did it start at 772?
no idea. just got the source opened to find out because I'm curious too
public IsoBuilding() {
this.ID = IDMax++;
this.scoreUpdate = -120 + Rand.Next(120);
}
IDMax starts at 0
restarted again and now it's 2
and it's sequential
2, 3, 4, 10 .. I'm sure it has to do with buildings you've seen into. maybe it was 772 before I didn't restart the game, just made a new game
It does seem like it's either to do with the buildings you've seen, or it counts them in a clockwise route (or something) from your position when the cell is loaded. I get quite a long list without moving or looking into buildings
Also, does anyone know if it's possible to get the number of rooms in a building?
getRooms() maybe. That's under BuildingDef tho.
do you know if it has a size() property?
Maybe, it's an arraylist I think which I think has size, get, etc
Hey y'all, just wondering
How do I make a character panic? I know how to detect zombie attracting sounds now, but don't know about adding the debuff I want to
getPlayer():getStats():setPanic(float)
Guessing that float means the number?
Yep, I believe from 0 to 1 but don't quote me on that
Float basically means it can have decimals
panic is one of the older ones so it's 0-100
So, would the code be like OnWorldSoundEvent:getPlayer():getStats():setPanic(float)?
Do I also need to check for the trait?
Events.OnWorldSound.Add(function to check for trait and add panic)
I'm on my phone or I'd give something more refined but that's the gist of it
How do you check for the trait?
This is driving me crazy. I'm trying to update a perk with a new XP value. The function setXP is giving me 'nil'. I found some documentation that says setXP() has been deprecated. I also tried addXP but that doesn't work either. How should I be doing this?
player:getXp():setXP(perk, newperkstat)
both perk and newperkstat give me values when I print them
for some reason the trait isn't showing up in the character creator.
here's the code:
Autism = {}
Autism.DoTraits = function()
local Example = TraitFactory.addTrait("Autism", getText("Autism"), -1, getText("A mental disability. This trait is not a 1-1 recreation of the real experience, nor is there only one unified experience for everyone with ASD. This is simply based on my own."), false);
TraitFactory.sortList();
local traitList = TraitFactory.getTraits()
for i = 1, traitList:size() do
local trait = traitList:get(i - 1)
BaseGameCharacterDetails.SetTraitDescription(trait)
Events.OnWorldSoundEvent.Add(if player:hasTrait("Autism") == true
then getPlayer():getStats():setPanic(25))
end
end
Events.OnGameBoot.Add(ModExample.DoTraits);
Events.OnGameBoot.Add(ModExample.DoTraits) but your function is called Autism.DoTraits
Question! I'm having some trouble with another mod and how it interacts with mine. Is there an easy-ish way to remove their outfits from the outfitManager or prevent zeds from spawning with those outfits?
Hi everyone,
I am looking around the the Distributions.lua file.
Are these different zomboid types that spawn in the world (the white lines)?
I assume these are loot tables for the different zed outfits, yeah
we have similar questions haha
xD
I just want zomboids to have more cigarettes >:)
so this can ve fixed via translate files?
is there just any way to "hot reload" lua file that is a server component? i have to restart server manually each change. "reload" from debug menu doesnt work
if this is for you to debug your mod i think its possible to reset server side lua
but if you want to do this to avoid the need of a server restart then its not gona work (just saying)
you have to figure out how to find the specific lua tho
im not sure how
but aiterons AUD mod is able to to do that iirc
@wind wasp
whats aiterons aud mod?
also do you have any idea if i can speed up server restart then? it loads in like 5 minutes, and it would be great if i could just launch it without generating whole world and stuff.
i see why there are so many server with little custom scripts the development is pain in ass lol
you probably want to overwrite noise and eliminate mods that print billions of debug logs on load
my test server runs like 300 mods and boots up in 2 minutes
Still can't get the trait to show up 💀
which tutorial are you following? The variable names are all over the place and also hasTrait() should be HasTrait()
no, i just dont want to wait any minute after server close and start again after making small change in code to see its result
It might be an older tutorial, so the hasTrait thing might be outdated
I probably messed up while changing the variables to fit my own mod
Aireron User Debug (tools), this is the spiritual successor:
https://steamcommunity.com/sharedfiles/filedetails/?id=2909488957
It looks ok. And we all start somewhere with this stuff. I'll get something together when I get back to my desk.
does anyone know how to configure NPC Bandits mod
I didn't test this but I think it should work:
-- if you want an icon for this trait, put an 18x18px PNG
-- named trait_Autism.png into media/ui/Traits
local Autism = {} -- don't pollute, keep it local
Autism.doTraits = function()
local addTrait = TraitFactory.addTrait("Autism",
getText("Autism"),
-1,
getText("A mental disability. This trait is not a 1-1 recreation of the real experience, nor is there only one unified experience for everyone with ASD. This is simply based on my own."),
false,
false)
TraitFactory.sortList()
local traitList = TraitFactory.getTraits()
for i = 1, traitList:size() do
local trait = traitList:get(i - 1)
BaseGameCharacterDetails.SetTraitDescription(trait)
end
end
Events.OnGameBoot.Add(Autism.doTraits)
Events.OnWorldSound.Add(function()
if getPlayer():HasTrait("Autism") then
getPlayer():getStats():setPanic(25)
end
end)
"stack overlow" - noice
ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Stack overflow at Coroutine.ensureStacksize line:131..
I want to know when an object is over a shelf/table or anything that makes it higher on the square. Any idea how to know that?
PlayWorldSound is MP only
-- i just learned that PlayWorldSound doesnt work on SP
function GachaMod.playSpin(pl)
if pl == nil then pl = getPlayer() end
local sfx = "GachaMod_Spin_"..tostring(ZombRand(1,4))
if sfx then
if isClient() then
getSoundManager():PlayWorldSound(sfx, pl:getSquare(), 0, 5, 5, false);
else
getSoundManager():playUISound(tostring(sfx))
end
end
end
why are you even using a world sound for a ui sound anyway?
the purpose of world sound is spatialisation, you should only use it for in-world sounds or it'll sound weird
It worked, the character panics at sounds now lol
Just gotta make it only do it at a certain volume now...
How do I check the volume?
the OnWorldSound event returns the volume
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md#onworldsound
What volume do you think would be a good lower limit for the panic?
Is there's an add panic function, and not just set?
Is this a thing?
local customName = object:getCustomName()
right its cuz the functions purpose is for nearby players to also hear it but since its sp there shouldnt be any need for that.. tho it didnt threw error , just didnt play
I tried to check for volume n stuff and now guns don't make sound anymore, so that's odd
Events.OnWorldSound.Add(function(x, y, z, radius, volume, source)
if volume > whatever then
Keep in mind that a lot of mods that attract zombies use a "silent" sound
Yea I know about that
I saw the issue with a temporary deafness mod
Character would randomly go deaf
addSound(getPlayer(), getPlayer():getX(), getPlayer():getY(), getPlayer():getZ(), 5, 1);
this triggers the attract, theres no actual sound
Is there a way to make the panic stack?
Might try putting it as +25 instead of just 25
sets panic to 25
getPlayer():getStats():setPanic(25)
adds 25 to panic
local stats = getPlayer():getStats()
local panic = stats:getPanic()
stats:setPanic(panic + 25)
here
I'll try it, thanks!
What volume is a gunshot?
I'm probably gonna set the lower limit for the panic to slightly lower than the average gunshot
local worldSoundManager = getWorldSoundManager()
worldSoundManager:addSound(nil, x, y, z, radius, volume)
that's usually what I come across
Dickies coveralls from Dawn of the Dead
maybe print the volume and make a bunch of noise and see what you think works
How do I print the volume?
print(volume)
Where can I read the print?
First turn on debug mode: https://pzwiki.net/wiki/Debug_mode
Then you'll find your prints in the command console
Do y'all have any clue why guns stopped making sound, though?
I tried firing a gun to test it out and it just stays silent
Maybe you are in ghost mode?
Does ghost mode do that?
Yea
I think if you Press N in debug mode you enable both?
God mode and Ghost mode
I have a cheat menu that lets you enable stuff like that, I might have ghost mode enabled to avoid getting mauled for making noise lmao
many such cases
Holding shift while starting doesn't seem to work
does anyone know, or can point me to, how to get the custom name property to a sprite?
I'm checking if a square has an object with a custom name listed in a table.
Do I use object:getCustomName()?
i've honestly never heard of this way working, i don't think it's real
use the launch parameter instead
Putting -debug in the launch options doesn't work either
It worked once, and then stopped
Uh
I had that thing where getPlayer() returned nil until I restarted the game. Must be a solar flare.
just looked, you're right, maybe it was an old feature somewhere?
nice you already removed it 😂 I knew I saw it somewhere
not the strangest thing i had to remove from that page today
Finaly, after 8 months, I'm done: https://steamcommunity.com/sharedfiles/filedetails/?id=3366438318
Wow, absolutely stellar work. The custom images and animalese are a nice (and extremely unique) touch!
Thank you, it took forever to record those phonemes. :'D
Share it in supportive satursday on the modding Discord !
What is it?
This looks absolutely SICK. Definitely going to see about adding it to my server...
This is incredibly impressive.
Good job.
A real QoL mod.
what programs would u guys use to make pixel art for 3d models?
would go with blender but that dont seem like an option
The Supportive Saturday is an event where you share mods once a week. Currently the suggestions go out to a handful of other discord servers by means of discord news function. So a great way to share new projects. 👍
local properties = obj:getProperties()
if properties:Is("CustomName") then
local customName = properties:Val("CustomName")
end
hello guys im struggling with a lua code, im using an OnContainerUpdate function , and i want to get the container name, but it keeps giving me a Nul result in the logs.
Can you share your code ?
yes sir (love your pfp btw)
:D
Events.OnContainerUpdate.Add(OnContainerUpdate)
the idea is that , when someone updates a container , this function get's the player name , and current square.
then it searches the cells around the player to look for containers.
then it saves somewhere that the player touched the container
Stack trace
STACK TRACE
function: OnContainerUpdate -- file: logcontainers.lua line # 83 | MOD: Vedo_Tutto
ERROR: General , 1731769137581> 134.102.627> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in OnContainerUpdate at KahluaUtil.fail line:82.
if you're trying to log item transfers that's not really what OnContainerUpdate does
im trying to log the player that have updated the container , and the container name/id
that event is fired when a container is added to/removed from the world, mostly to update the ui to show/hide it