#mod_development
1 messages Β· Page 486 of 1
How to change mod loading order using Lua?
Shouldn't as we use the old emitter system - what sounds are you referring to?
I rely on alphabetical order aswell as placing files deeper in folders.
Not really, overriding the same file depends on basic mod order.
Basic mod order is set in mods/default.txt.
Oh?
I'd like to know how to change it using Lua.
Ahh
That would be a great ability for players and some modders
There's a file writing function
Let me double check my config thing
local configFile = "media/config/"..modId..".config" local fileReader = getModFileReader(modId, configFile, false) if fileReader then
I use this for writing config files -- I mostly took apart and modified config stuff in sandbox+
But if media/ is stated then you could probably write in the same directory that media is inside
Which I think is contents?
But this would be the mod's folder... Idk if it can reach the game's
Hi, I made my own spritesheet and loaded it in the game through my mod. How can I draw my new tiles from Lua?
Yes, but where is the default.txt placed?
Also isn't it media/lua
Note this is B41.55 btw. Weapon sounds, steps, zombie groans, a good chunk of the new sounds tbh.
Could be something else as well, I still need to do further testing.
Sorry for the late reply, was afk.
Huh, testing it further with only EHE that doesn't seem to be the issue. My apologies then for the trouble.
No worries - if EHE does cause issues even with other mods I'd be curious to check out any fixes.
just a guess, though you may be able to do that via
local currentGameMods = ActiveMods.getById("currentGame"):getMods(); -- or "default"
local myModIndex = currentGameMods:indexOf("myModID");
if myModIndex < currentGameMods:size()-1 then
local item = currentGameMods:remove(myModIndex);
currentGameMods:add(item);
manipulateSavefile(saveFolder, "WriteModsDotTxt") -- get saveFolder somehow from somewhere for current save or inject into ModSelector? unsure.
-- if default then:
-- saveModsFile() -- ?
end
Infos for "example" taken from ProjectZomboid\media\lua\client\OptionsScreens\ModSelector.lua
Hi, everyone. I'm looking for partner who is good with coding / scripting in PZ and can help with this, idk how to describe it... module based weapons mod ?! Where the "real" gun is only receiver and all other parts are only added as "mods" and then ...on top of them... the attachments as well.
Is that not how the guns already work?
and idk if it's even possible to do in PZ, I almost lost all of my scripting knowledge in PZ after almost half a year brake. If you are interested, please DM me.
Lower the safety lock, so the model will be more reliable
do we have this already... I haven't played PZ for quite a long time now and only wanted to touch it when i complete my mod.
I will.... but I don't think that's gonna be visible on playermodel anyway D
I think it will, but it's up to you π
I don't think PZ has ability yo dismantle entire weapon and "kitbash" semi-compatible parts... since vanilla guns are so "lame".
There are weapon attachments actually
yes, but they are lasers, optics, slings and that kind of stuff
I know it goes upto 6 types, I'm not sure if you can add more types
Barrels and stocks too
can you mount attachment (supressor) on top of attachment (barrel) ?
Depends if you can add more attachment types to weapons
I wanted to look into this for combining melee weapons
Are you stuck to the 6 types that are listed under weapon's variables?
the problem is there are 6 ( one base) essential weapon parts to just build vanilla weapon without laser/flashlight, sights , rails, grips and etc.
Thanks, I will check it out. But, I do have really hard time to get back into PZ scripting since I'm also busy with other project. That's why I'm looking for partner who has experience with it. I just didn't want to my idea and models to go waste. There are tons of helmets, food and armor ( I couldn't really figure out clothing) that I made for pz but never finalized it.
i feel you
When I add a tile to a square like this:
local sq = grave:getSquare()
local name = 'spear_traps_01_8'
local tile = IsoObject.new(sq, name)
sq:AddTileObject(tile)
how to get a reference to this tile so I can remove it later using sq:RemoveTileObject(tile)
I tried to create a new IsoObject with same square and same name, then to remove that object but it's not working
I could keep my own reference, but that wouldn't work when you quit and reload your game
If you can get a reference to the square at the time you want to remove it, you can call square:getObjects() to get a table of IsoObjects associated with that square. You can then iterate over the list of objects to look for the one you want. If you're using a custom tile name it may show up as the value of isoObect:getName() or isoObject:getSpriteName() or isoObject:getSprite():getSpriteName(). Or at least, that's been my one experience attempting something similar recently.
@kind surge I tried to use square:getObjects(), but when I iterate and print obj:getName() or obj:getSprite() or obj:getSpriteName() they all return nil except for the base object on top of which I add my own tile. In my case the base object is ISEmptyGraves
do I have to call something like tile:setName() or tile:setSprite() maybe?
mind to share your code? π
Have you checked the output of those commands when run on the IsoObject when you create it? I did have the problem of all of those being nil when the Sprite wasn't being created successfully due to the tilepack not being loaded correctly. Of course that led to the tile not showing up, but no errors were thrown and the IsoObject was created (it was just "empty").
@kind surge thx, let me try that
Not at all, I'll DM you
One question for the right understanding. For example, if I wanna create a simple new item with a crafting recipe, do I have to create a new files that are written in the items and recipes schema or do I have to write the information in the existing files?
I have 0 experience and this question might be stupid.
oh no
in your mod directory you create a file -> mods/YourMod/scripts/my_items.txt and add your items into it.
module MyModModuleName {
imports {
Base,
}
item MyNewItem {
...
}
}
So, is there a way to implement a working freezer as part of a vehicle? E.g., say I wanted to make a refrigerated truck with a freezer where the truck bed goes.
yes
Say, like, an Ice Cream Truck?
π
just credit chuck is all i ask
Yiss
Hmm, so I extracted the code and applied it to the van above, but I can't quite grox out how to get it to freeze and not fridge. thought it was a matter of temperature at first, but it seems not? Also thought I could change the type from"fridge" to "freezer" but that didn't do anything either:
IceCreamTruckFreezer = {}
IceCreamTruckFreezer.Create = {}
IceCreamTruckFreezer.Init = {}
IceCreamTruckFreezer.Update = {}
function IceCreamTruckFreezer.Create.Fridge(vehicle, part)
local invItem = VehicleUtils.createPartInventoryItem(part);
part:getItemContainer():setType("freezer")
part:getItemContainer():setActive(true)
end
function IceCreamTruckFreezer.Init.Freezer(vehicle, part)
if vehicle:getBatteryCharge() > 0.1 then
part:getItemContainer():setCustomTemperature(-1.0)
else
part:getItemContainer():setCustomTemperature(1.0)
end
end
function IceCreamTruckFreezer.Update.Freezer(vehicle, part, elapsedMinutes)
local temp = part:getItemContainer():getTemprature()
--print("IceCreamTruckFreezer.Update temp:"..temp)
local tempMin = -1.0
local tempMax = 1.0
if vehicle:getBatteryCharge() > 0.0 then
if temp < tempMin then
part:getItemContainer():setCustomTemperature(tempMin)
elseif temp > tempMin then
part:getItemContainer():setCustomTemperature(temp - elapsedMinutes / 20)
end
--uses 50% of battery charge in 24 hours if the fridge would store items with 150 weight when the engine is not running (but only if items are in the container)
if not vehicle:isEngineRunning() and part:getItemContainer():getContentsWeight() > 0.0 then
local energyConsumption = 0.5 * (part:getItemContainer():getContentsWeight() / 150) --scales the energy energy consumption with the weight of the items in the trunk
VehicleUtils.chargeBattery(vehicle, -energyConsumption / (60 * 24) * elapsedMinutes )
end
else
if temp < tempMax then
part:getItemContainer():setCustomTemperature(temp + elapsedMinutes / 20)
elseif temp >= tempMax then
part:getItemContainer():setCustomTemperature(tempMax)
end
end
end
Thoughts? I'm worse at lua than I am at modeling, and the documentation I have for PZ doesn't mention refrigeration at all. π
Idk but line 2 has a typo, it should be local temp = part:getItemContainer():getTemperature() instead
lol, I didn't even notice that.
true
sadly it would be very hard to make because infinite maps aren't possible as of rn
so unless someone made an absolutely MASSIVE world then it wouldnt be feasible
but i agree it would be a really fun mod
I mean, Cherbourg is a bloody massive map
true
so yes its possible
and that repetitive scenery of furniture would make it seem infinite
How to insert a string to the list of strings?
list:add(str) -- adds to the end only
@thin hornet perfect, thank you
You are Lua hero π
Works like a charm.
Almost done with my ice cream mod. just need to do some final touch ups and some QoL stuff.
Heya! I'm having some trouble with a mod I am making where I am trying to simplify engine parts and engine repair
To put it simply, I'm trying to make it so 20 condition = 1 part. 1 part = +20% repair.
I am having trouble figuring out what I did wrong, I've modded lua before with Factorio and Paradox games but the syntax here is new to me
function ISTakeEngineParts.perform()
ISBasedTimedAction.perform(self)
self.item:setJobDelta(0)
local cond = self.part:getCondition();
local skill = self.character:getPerkLevel(Perks.Mechanics) - self.vehicle:getScript():getEngineRepairLevel();
local partsGained = math.floor(getEngineRepairLevel / 20)
local args = { vehicle = self.vehicle:getId(), skillLevel = skill }
getPlayer():getInventory():AddItems("EngineParts", partsGained)
self.character:getXp():AddXP(Perks.Mechanics, (partsGained * 3);
end
Figure out the freezer thing?
Well, it should prob be local partsGained = math.floor(self.vehicle:getScript():getEngineRepairLevel() / 20) instead
ISBasedTimedAction.perform(self)
self.item:setJobDelta(0)
local cond = self.part:getCondition();
local skill = self.character:getPerkLevel(Perks.Mechanics) - self.vehicle:getScript():getEngineRepairLevel();
local partsGained = math.floor(self.vehicle:getScript():getEngineRepairLevel() / 20);
local args = { vehicle = self.vehicle:getId(), skillLevel = skill }
self.part:setCondition(0.0);
local inventory = getPlayer():getInventory():AddItems("EngineParts", partsGained);
self.character:getXp():AddXP(Perks.Mechanics, partsGained * 3);
end```
Didn't work
We made progress, though
The bar now fills up and completes, but it still produces no parts and doesn't dismantle the engine
Setup a print after you've set partsGained to see what it is producing
print("parts Gained", partsGained)
Like this?
print("Parts Gained: " .. partsGained)
Might be easier to find in console if you add some new lines before/after it (print("\n\n\nParts Gained: " .. partsGained .. "\n\n\n"))
Ack
It didn't print in the console for some reason
I did find this though
ERROR: General , 1635248367010> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: perform of non-table: null```
Right beneath function: perform -- file: ISTakeEngineParts.lua line # 31
I want to say thank-you very much for helping and also sorry about all the trouble
Tyvm!
Do you have debug version enabled?
The function self.vehicle:getScript():getEngineRepairLevel() returns the level of the Mechanics skill that is required to work on the engine for that type of vehicle. For vanilla vehicles it's in the range of 3-5. I think your line for calculating partsGained should be local partsGained = math.floor(cond / 20); based on your stated objective.
Nope π
I don't think the guy that made that code knows either. π
assuming by the call that it's an ArrayList instead of a table:
list:add(index, str) -- arg 1(number) being the index you want to shove the second arg into
-- will move everything from that index one further and your second arg will now occupy that index in arg 1
I just came up with a mod idea: Bigfoot
π΄
π
@long meadow there is your horse
Aaron on a horse
that's amazing!
hi all! I have a problem with an NPC that I donβt know how to solve more efficiently. NPCs move around the global map along points of interest. These points are represented in the form of a graph. In total, 1000+ points are needed for the entire map. Arranging manually is about 10+ hours. Anyone have any ideas on how to automatically detect these points?
Here example of moving NPC by points and looting: https://www.youtube.com/watch?v=YqqbK-Dg69o
Stupid idea which you've likely already determined but - can AI get an index of loot spawn categories and maybe prioritize ticking 'each' box (then have it weighed against Zombie Spawn + Previously visited checks? (eg: They won't bash their head against a high density zombie area just to get the loot and they'll need to find new pastures once t hey've previously searched an area?)
If the map has zombie heatzones + loot tables + cells for areas I'd imagine there is some floating game data you might be able to tap into for navigation
Bearing in mind I got no idea how it works in game data but
You could seperate the map maybe into 'sectors' made up of a number of Cells - the NPCs will try and explore those sectors in an expanding perimeter from say - their location and then base - periodically they could then also perform 'deep' forays to areas of the map (closest to furthest) based upon loot tables to try meet certain needs - if heat zone is too hot - they will withdraw, mark the sector as 'searched' and try another location
If that is even remotely viable my thinking is that in reality - People are likely to set up base - and upon setting up their safe zone they're going to have two basic priorities - knowing whats immediately around them - and securing that zone and going out for very specific needs/goods - thus two search types
People are also likely to bug out unless extremely desperate if a situation looks a little too risky, especially if there is theoretically plenty other pastures to explore
The map has Nav zones which are apparently used for zombie migration. Buildings have room definitions that you could also leverage maybe? As if to say "We can find X loot here because it's a grocery storage room". If you could build a map of sorts of points of interest for NPCs, you could potentially link that with nav zones for pathing?
Is there such a mod that lets you plaster and/or paint brick walls? My main base is the big warehouse in Muldraugh and there's so much paint stored there and I can't use it haha
how can I get zomboid models into blender?
in my Building Time you can plaster and paint brick walls that you build. pre-placed walls are a different thing though, I have no idea if there's a mod for that
@nimble spoke Oh awesome! I'll check it out, even if it means demolishing a section of pre-made brick and rebuilding it just so I can paint it haha
I thought it was a real screenshot ree
Noo π₯²
Is it possible to replace the zombie animations?
yes, there's at least one mod that does it
is there a method to it?
You can just override the files
or change the animation xml files that point to the model/anim file
with a .x?
I think so yeah, but some guys here have been experimenting with FBX, don't know what the result was
how do I convert fbx to .x?
A free way to do this is to download an old version of blender, 2.70 (You can download it here: https://download.blender.org/release/)
Then you follow these steps on how to enable .x import/export (and I believe save as .x but not 100% sure).
https://blender.stackexchange.com/questions/8740/how-do-i-export-an-obj-to-an-x-file
are there any good tutorials on making melee weapons? I spent pretty much the whole day on and off trying to get mine to work and it just isn't happening. I can't get the model to be the right size or properly position it for on the ground and on my person.
@wet dune I use this website: https://3d-convert.com/en/convert/fbx-to-x.html
Convert FBX files quickly and easily to X files, online and completely free. But the converter can do even more: STL files for 3D printing, OBJ files for computer animations or CAD are no problem for it.
sometimes it fails to convert some models though
but isn't zomboid handling .fbx now?
I can see a lot of .fbx models in media/models_X/WorldItems/ and in media/models_X/vehicles/
@hot patrol if you find one that works, please share! π
I've looked but sadly it seems evereything is for either guns or clothing
if they are then I'm doing something wrong
@hot patrol are you able to see your 3d model at all in the game?
yes
so it's just a matter of sizing and positioning?
yep
I got the pose very cle when in the hand but it was totaly broken when on my back or the ground
so I think my method was not the right one
I tried to make my own melee weapon too, but I wasn't able to go as far as you for now
mine was just not showing on screen
but I was able to make my own sweatshirt though! π
it could have just been so big it didn't render. that happened to me
If it looks right in hand but not on the ground you need the world attachment in the model script. Check a model from a weapon with similar orientation and copy those values for your model
as for the back attachment there are lots of options, you're probably using one that is meant for a different model orientation
my question is how should i be exporting the model? The way I got it to fit in the players have was by orientating it in a janky way via blender
Is that the proper way?
when I imported the wood plank which is what I am using as a base it is just stood straight up and is much larger than my model but when I went off that is was giant
I know for guns placing you model similarly to how the devs have the vanilla ones works (at least in what I watched)
local function removeWeight()
local items = getAllItems()
local sz = items:size()
for i = sz-1,0,-1 do
local item = items:get(i)
if string.find(item:getTypeString(), "Container") then
item:DoParam("Capacity = 999999")
item:DoParam("WeightReduction = 100")
end
end
end
Events.OnPreMapLoad.Add(removeWeight)
```Info: I have this in the shared folder. It works fine in single player, however, in multiplayer the capacity is only increased on containers I spawn in - even on brand new worlds.
Any reason why this would be happening and any suggestions on how to fix it?? Thank you
@dawn lynx have you tried to move that code to lua/server instead?
No I've only tried client and shared - I can try that though
Don't think it'll make a difference tho as everything else works but worth a shot anyways
@dawn lynx I'm not sure but isn't server for multiplayer stuff?
It is - yeah, but shared gets loaded on singleplayer and multiplayer
ah ok
Anyone know which file the random events are in? I'm wanting to check out the code for them.
Do you mean meta events?
When exporting it from blender you should make it so it look good when attached to the character. The Origin will be the point where it is connected with the hand bone by default.
To make it look right on the ground you should add this offset and rotate parameters there:
did anyone ever encounter such a bug?
when reloading my script
Events.OnPreFillWorldObjectContextMenu.Add
doesnt call when i right click after
no error nothing
i print before = it show, i print right in it too = doesnt show
print('test 1')
Events.OnPreFillWorldObjectContextMenu.Add(function(player, context, worldobjects, test)
print('test 2')
it work when i first load the game, if i reload the script then i just get the print(test 1)
Attached to the player as in on their back? Also how about the scaling?
whoa never encountered such fuckery
Events.OnInitGlobalModData.Add(function()
print("OnInitGlobalModData")
--instance:initGlobalModData()
end)
Events.OnPreFillWorldObjectContextMenu.Add(function(...)
print("OnPreFillWorldObjectContextMenu")
--instance:onPreFillWorldObjectContextMenu(...)
end)
Events.EveryOneMinute.Add(function()
print("EveryOneMinute")
--instance:everyOneMinute()
end)
When i reload script and right click: it print EveryOneMinute
it's as if the events are switched but that make no sense
it might seem like i have to set OnInitGlobalModData after all other event but i could be wrong
Who create mod USS Barack Obama?
Okay faulty clearly is Events.EveryOneMinutes|EveryTenMinutes.Add(function() if i just comment out this one, every work upon script reload.....
nevermind i have no idea what is going on
Events.EveryOneMinute.Add(function()
print("EveryOneMinute")
end)
Events.OnPreFillWorldObjectContextMenu.Add(function(player, context, worldobjects, test)
print("OnPreFillWorldObjectContextMenu")
end)
Somebody load this script, test it and reload the script and test it again the event will be all messed up
EveryOneMinute will print OnPreFillWorldObjectContextMenu
OnPreFillWorldObjectContextMenu will still print OnPreFillWorldObjectContextMenu
It's so random but it could be just me or a real bug
I forgot to say but β¦ I can pay whoever will create this mod for the whole community.
this is probably one of the mods that I want the most and that will make me say that this game is the best I could have played in my whole life :β)
I'm hardly knowledgeable enough to say with much confidence but I don't thing something like that is possible to mod. I imagine you would need to rewrite entire elements of the UI.
If the weapon looks right on your imported character model in blender but is too big in game you have to change the scale in the export window to around 0,01 or something
And nope. Attached to the hand
If you haven't already imported the character model you should get the model which is pinned in the modeling channel
Any reason my audio is not looping correctly in the game, it stop before starting again
Ok so when you say attached to the hand in blender how should it look? I'm working with a 2 handed weapon.
I want. Donβt know how to make. Reeeee.
Hi, any clue what mod is adding a green outline around the zombie(s) you're targeting?
I frequently see this in live streams
thats in the options menu
oh nice, let me check
Quick question how can you edit perks in code
Under display, you can choose to have none, range, or range+melee
It's not mod, this is a configuration in game
Found it! Thank you @drifting ore @dawn shuttle and @pearl prism
anyone tested if these mods work?
Also if i enable them on an existing save file will it destroy it?
https://steamcommunity.com/sharedfiles/filedetails/?id=1456646886&searchtext=rope
https://steamcommunity.com/sharedfiles/filedetails/?id=2399606723&searchtext=rope
@rocky otter No clue about whether the mods are working, but about your save file ,you can just backup your Zomboid/Saves folder in case something wrong happens
if they do what they say there and just that there shouldn't be any problems
looks like just some more recipes
Yesterday I played a bit with rifles. I was wondering, is there a way to use your rifle as a melee weapon?
at some point I was out of ammo with some zombies really close to me, I had to put away my rifle to get a melee weapon
felt awkward π
Press space
You can push with them
yeah like using the part you put against your shoulder when you shoot
It just keeps them away and can push them to the ground
still good to know, thank you
is it possible to change what's happening when you double click an item in your inventory? Like for example if I double click on a book, nothing happens, I would like to make my character to read the book when I double click it
also for keys, like if I double click a key, I want it to go straight to my keyring
You could probably hook into the ISInventoryPane:onMouseDoubleClick and add the checks and do it with a mod.
media\lua\client\ISUI\ISInventoryPane.lua line # 951
or rather the ISInventoryPane:doContextualDblClick in line # 914
@dry chasm thanks I will check
local origDblClickFnc = ISInventoryPane.doContextualDblClick;
function ISInventoryPane:doContextualDblClick(item, ...)
local playerObj = getSpecificPlayer(self.player);
if instanceof(item, "Literature") then
-- initiate the reading part
end
if instanceof(item, "Key") then
-- now check keyRing container, instanceof(obj, "KeyRing")? unsure
-- do stuff with it afterwards
end
return origDblClickFnc(self, item, ...);
end
as example
@dry chasm oh that looks promising π
Oh, for 2 hand weapons i did it a little bit different as it requires a pose which can variate.
So i just imported a baseball bat from PZ and kept my scales and origin as this:
(And exported in 0.01 Scales)
I guess I should call origDblClickFnc only when the item is not litterature and not a key?
or well it shoulnd't matter since those are doing nothing anyway
original one does it's check for each seperately without differentiating - i'd just do it the way as in the example i've shown - also just in case somethig ever changes in vanilla and requires to run nevertheless - even if such a change never occurs, best to be safe
indeed
Actually, I havent used a character in blender for my 1 hand weapons as well. Forget what i said. π
Just make sure the weapon origin is centred and around the grip.
A character still could be useful to get a feel for it in case you dont want to use a PZ Vanilla weapon as reference for the scales.
As far as i remember you can export the weapon to your mod folders and see directly ingame a change after a few seconds. So its relative easy to adjust the offset.
Anyone familiar on how to hot wire on better lock picking mod? I select one bottom wire then randomly select the top wires. Is this correct?
You need to pair 2 bottom wires that creates the correct combination to start the car
Thank you. I just clicked all the wires at random and I didnβt know how to do it correctly haha
np!
what's the difference between getPlayer() and getSpecificPlayer()?
IIRC getPlayer() gives you the last player instance of the client? (so 2nd player if 2 player split screen?)
with getSpecificPlayer and passing the playerID in, you get the object of the player? π€ unsure on how exactly but yea.
In some cases, events or similar you get the id and not the object i believe
haven't meddled with that yet though, so other people may have more experience and can fill it out some more π
Is it possible to add variants to existing clothing? Ie i make a texture and then add its ability to spawn?
@rose notch I know you can make your own variants, and what would be the point if you couldn't add it to spawn?
When you call getPlayer():getInventory():getItemsFromCategory("Container"), it returns an arrylist of InventoryItem, but this class has no method to add items to it. So I guess I need to get an ItemContainer instance (this one has a method addItem). So how do I get an ItemContainer instance from an InventoryItem that is a container?
I believe you do item:getContainer() to get the ItemContainer from an InventoryItem
@agile coral that would return the container in which the item is stored
aaah got it !
You have to call item:getInventory():addItem(theItemToAdd)
This i guess
@dry chasm works like a charm, thanks!
My only problem now, is it only works from the player inventory panel, but not from the looting panel
I'm pretty sure I did this with mine and it was too big. I'll try again tho.
if you add a variation to an existing item it will spawn just like the others. For example I added a new texture to schoolbag (must also add the icon for it)
https://i.imgur.com/Jb6MPsh.png I did what you said and it's close but.
what use is there to those ceramic and titanium armor plates in the safehouses?
Anyone knows of a mod that does something along the lines of item auto drop off in containers?
I finally did it
apparently using a wood pland in blender to allign the model was a bad ideo
tried the bat and boom
I might cry
https://i.imgur.com/vJVxb70.png I stand victorious
3D items were either the worst thing to be added to the game or the best... π
the best
100%
ok now I just need to fix the placement position bot that is easier
only problem is
why are the settings on the left now showing up? https://i.imgur.com/A2dje84.png
@sour island sorry to bother but I heard you found out a way to add custom moods, how much work would that require to do?
I think that was a misunderstanding
if mood's enum hasn't been opened up via a .txt or exposed differently you can't add to it
same for what was previously skills and sandboxOptions
kk thx
you could try pinging Nasko
That modding wish list must be big lol
Is there a way to retrieve how a function was called? Like what event called it as an example
I supposed I can just pass a string through the function as an argument
Example for events:
function YourFunction(event_type, a,b,c)
--stuff here
if event_type == 1 then --SomeEvent
--stuff here
else --SomeAnotherEvent
--stuff here
end
--stuff here
end
Events.SomeEvent.Add(function(...)
YourFunction(1, ...)
end)
Events.SomeAnotherEvent.Add(function(...)
YourFunction(2, ...)
end)
Is there a guide or something on how to add a tab to the menu options and make it work?
Do you think it would be a good idea if each mod has its own tab?
I suppose it depends on the mod, and if it had a lot of configuration options.
You can try Mod Options (B41 only):
https://steamcommunity.com/sharedfiles/filedetails/?id=2169435993
But there is no custom tab yet.
ill take a look, thanks
Hey guys! I have a genuine question, does anybody knows how to retexture clothes or has some kind of a guide that might come in handy?
My best guess would be to check the forums
how can I spawn a car into the world is there a command?
You can use the cheat menu mod
I am making a scenario and want to spawn a car for the player
And you can also set ur launch options to debug mode
By command I don't know, but I know that there are some "cheat menu" mods that have this kind of function
If you want to create a place on the map that can spawn cars this is easier to ask the "mapping" guys
Ill have a look at cheat menu and see wgat they use
@candid sonnet
Sent you a friend request - would like to inquire about something! I saw your Pancit Canton mod hahah!
Do any of you guys know how to get all the Windows from an IsoRoom instance?
It says that you should be able to call getWindows() on an IsoRoom instance, but to my knowledge I am not receiving anything.
The "[]" represents what should be an ArrayList of IsoWindow.
It's not like there's no windows either; you can see two of them here.
But the ArrayLists are just empty.
@hollow oyster check those links:
https://dislaik.github.io/pz_modding/scripting_manual/clothing_mod/
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Official Dislaik's Documentations
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
does zupercart work?
someone do this #pz_b42_chat message
How are you iterating them?
Have you tried using size() to see their lengths
local allWindowsForCurrentIsoRoom = currentIsoRoom:getWindows(); print(allWindowsForCurrentIsoRoom)
for i = 0, allWindowsForCurrentIsoRoom:size()-1 do
print("We have reached window number #" .. i) -- Debug Message
---@type IsoWindow
local currentWindow = allWindowsForCurrentIsoRoom:get(i)
currentWindow:removeSheet()
currentWindow:addSheet()
end
As far as I'm aware, this is a pretty standard way of going about it.
public ArrayList<IsoWindow> getWindows() {
return this.Windows;
}
Hm
That's the method in IsoRoom
so, I would imagine it will return me the Windows ArrayList that belongs to that IsoRoom
of which I have 3.
I see the windows, but apparently the IsoRooms do not have any actual windows.
I had a similar issue with a list never being used
I think it was a cell's buildings list always being empty
Is it something I should report to the devs?
It may just be vestigial code
Yeah, if that was my codebase I would like to know so I could remove it
It would be very confusing to create an instance of a class and call a method that essentially does nothing.
I don't even know what the purpose/difference IsoRoom and RoomDef are
π€·ββοΈ
Double check the uses of .Windows
Could be only used in specific contexts
Like open windows
You'd have to check the uses in the java files
That was just an educated guess
Does RoomDef have anything related to windows?
It has an ArrayList of RoomRect and another ArrayList of MetaObject
I don't know if Window inherits from either of those in some way
but still, I feel like the method getWindows() should get all the windows for that instance.
I agree
Your only way around may be to use the room's getTileList method to get all of the IsoGridSquares within that room, and then use the IsoGridSquare's getWindow methods.
I'm going to talk to Nasko first or maybe a dev.
I'm still curious what the hell the windows list is being used for if it's empty
I feel like reporting this would be worth more than trying to redneck a way around it.
But thank you for the suggestion, that might work too.
Maybe it's player built structure logic?
I dunno, all I know is that it's confusing
Well there's no code to add anything to the Windows ArrayList within IsoRoom. So if it's used, it would need to be a child class.
I would imagine that the instance of the room is made and filled elsewhere.
windows included.
Oh, yeah, I guess since getWindows returns a reference to the ArrayList, things can be added to it outside of the IsoRoom class
If we had all the code, we could check the usages of it
or set a data breakpoint

show me the YUMMY WINDOWS
Searching the zombie directory for getWindows returns only the IsoRoom.class file. No references to it in the media/lua directory either
My friend told me to check the lightswitch array. It does return stuff
so I am going to assume that the getWindows() method is broken.
Do windows have a building reference?
Like get building?
You have getcurrentbuilding for players
I have an isoRange function that grabs swathes of gridSquares fractally
I am checking its methods and properties
You could brute force it
All tiles within a range of 50 that contain windows -- if window's building == player's : do your thing
IsoGridSquare has a few different getWindow<x> methods. So whether you use the IsoRoom.getTileList method or a brute force search you should be able to query each square for the windows nearby.
And IsoWindow extends IsoObject, so yes, it has a reference to the square it's on.
Oh yeah that's true -- you have the rooms - tilelist would be ideal
I doubt it would be that much faster if they have a proper getter -- and I doubt they're inclined to fix it which would require them to set the windows.
Iirc I saw something called "calculate windows"
What does calculate windows do? 
π€·ββοΈ
Rabbit hole
local currentIsoRoom = currentRoom:getIsoRoom();
local tileList = currentIsoRoom:getTileList(); print(tileList);
The tileList is also empty.
did a quick test:
local p = getPlayer(); -- player
local sq = p:getSquare(); -- player square
local r = sq:getRoom(); -- room
local sqs = r:getSquares(); -- room's squares
for i=0, sqs:size()-1 do -- iterating all squares of the room
local csq = sqs:get(i); -- current square of iteration
local winN = csq:getWindowTo(csq:getN()); -- get window between current and north
local winE = csq:getWindowTo(csq:getE()); -- get window between current and east
local winS = csq:getWindowTo(csq:getS()); -- get window between current and south
local winW = csq:getWindowTo(csq:getW()); -- get window between current and west
if winN then print(winN); end
if winS then print(winS); end
if winE then print(winE); end
if winW then print(winW); end
end
Thank you, I'm going to try this
where did you find the getSquare(); method? I can't see it in the IsoPlayer class
inherited from IsoMovingObject
alternatively: local o = ObjectViewer:new(0,0, 500, 500, getPlayer());o:initialise();o:addToUIManager();
(keep in mind that it also lists non-exposed functions IIRC)
What is o
local o = ObjectViewer:new(0,0, 500, 500, getPlayer()); -- new objectViewer (part of Debug Window in F11 usually)
o:initialise(); -- initialise
o:addToUIManager(); -- add to UI
I'm sorry, I don't understand what that does.
just a window that lists contents of the object you pass as the last argument.
Oh, so you can inspect it in the debug menu?
Oh that is cool.
Actually, my bad, it doesn't seem to include inherited functions like from IsoMovingObject π sorry (or I'm blind, unsure)
Well I can grab all the windows.
or at least, all the windows from my current room
I want to try and add sheets to them.
I can find windows, but addSheet() and removeSheet() don't seem to do anything.
though I did see that you need to pass in a character.
getSquare comes from IsoObject iirc
Anyone made a Lua debugger work on vscode? I'd be nice to have breakpoints/watch
I keep crashing while driving my autotsar bus
function: WeaponAltLoadToggle -- file: GunFighter_02Function.lua line # 1009
ERROR: General , 1635463034012> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getPrimaryHandItem of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1635463034012> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getPrimaryHandItem of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:88)
at zombie.input.GameKeyboard.update(GameKeyboard.java:65)
at zombie.GameWindow.logic(GameWindow.java:236)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:726)
at zombie.GameWindow.run_ez(GameWindow.java:628)
at zombie.GameWindow.mainThread(GameWindow.java:471)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1635463034013> -----------------------------------------
STACK TRACE
function: WeaponAltLoadToggle -- file: GunFighter_02Function.lua line # 1009
anyone?
"GunFighter_02Function.lua line # 1009"
Does that Gun Fighter mod have any kind of hotkeys? Is it that one that only works for specific weapons for custom functionality?
If it is, try avoiding pressing the keys while driving? Aside of that, no clue of the mod π€· sorry, but from the error,
I doubt the issue is only with autotsar cars, but rather all cars? As the error seem to happen on another mod, unless that file
is part of autotsar, but no clue on my end.
@wraith kraken any clue where does that file come from? GunFighter_02Function.lua
I don't have it in my Zomboid media folder
On description page of Arsenal(26) GunFighter Mod , seems that was the mod i was thinking of in regards to limitation to only certain weapons.
Unless weapon script is formatted within certain parameters and contains certain required information, some features of this mod [WILL NOT WORK]
the gunfighter mod?
yes
I disabled it but it still crashes
same crash?
yep
same saved game?
while driving my bus, but it took longer to crash
yes
@wraith kraken try a new game
did you disable the mod for the save - or only in main menu?
both
no clue what the issue is then, as that file shouldn't load anymore if it's not in the modlist π€·ββοΈ
if it crashes on that file I think it means it's still enabled somehow
not sure if you can disable a mod for an existing saved game
you can, hence i asked (though can cause issues)
oh ok
wow, how many mods do you have? π
instead of pressing continue:
Press load, choose the save, bottom on more/change mods unsure how that was called and exact procedure but yea
you can change "savegame activated mods" that way
yes
is it normal for fps to drop while driving?
with that many mods, highly possible?
but it all depends on what the mod/s do, so... yea
though, in all honesty, if you disabled the mod and still receive the same error - about the same file line # 1009, then either another mod has a file with that name which was the actual culprit - or it isn't deactivated for the current savegame you tried on... aside of that, i can't think of another possibility atm π
I think so too
Error posted on that mod's discussion:
https://steamcommunity.com/workshop/filedetails/discussion/2297098490/3100138655161523094/?ctp=12#c3119298624515393551
The answer right beneath:
fixed 4 next update..
seems like it doesnt crash anymore
all good
thanks guys
i guess ill disable those mods until it gets fixed
does anbody know what the clothing rip sound is called in the game files?
ClothesRipping
thank you

anyone know what the pushbackmod means in the weapon scripting? Somone suggestion I make the pillow have a high knock back chance and I wanted to do that
it was set to 3 and I put it to 10 but I don't notice any difference
anyone know if there is a way to create map stories?
Hopefully I can release my Ice Cream Mod this weekend. I want to do a playtest or two to see how items spawn and fix any bug I might have missed. I also plan to release an update for my Ramen Mod that gives static world models for all the ramen items.
After that, the long and laborious process of giving static world models to all my other mods. I suppose AAApoc would be first among them...
@hot patrol oh, I've just seen you implemented the Pillow armor we talked about π
That was all Micheal. He saw your idea and liked it so much he asked me if he could do the model for it. So I have to thank the both of you for that. :)
The stories system has an enum associated with it. This means unless it's given the same treatment skills was given you'd have to write your own story system from scratch.
I have no clue what that means so I assume that I don't have the know how to accomplish it.
Unfortunate since I wanted my dakimakura to only spawn on special "neckbeard" zombies or in a story like this

Alright, Im trying to troubleshoot Authentic Animations. I installed it just recently however it is not working and the Q key causes an error, also my Escape key is not functioning. Does anyone have a fix or something that I did wrong?
any clue what could trigger this error?
SEVERE: null
java.lang.NullPointerException: Cannot invoke "zombie.core.properties.PropertyContainer.Is(zombie.iso.SpriteDetails.IsoFlagType)" because the return value of "zombie.iso.IsoObject.getProperties()" is null
at zombie.iso.IsoGridSquare.renderFloorInternal(IsoGridSquare.java:7101)
at zombie.iso.IsoGridSquare.renderFloor(IsoGridSquare.java:6979)
at zombie.iso.IsoCell.performRenderTiles(IsoCell.java:901)
at zombie.iso.IsoCell.renderTilesInternal(IsoCell.java:587)
at zombie.util.lambda.Invokers$Params2$CallbackStackItem.run(Invokers.java:91)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.core.profiling.AbstractPerformanceProfileProbe.lambda$invokeAndMeasure$1(AbstractPerformanceProfileProbe.java:91)
at zombie.util.lambda.Stacks$Params4$CallbackStackItem.invoke(Stacks.java:286)
more specifically why woud getProperties() return null?
public PropertyContainer getProperties() {
return this.sprite == null ? null : this.sprite.getProperties();
}```
There is no sprite.
This is getProperties from the IsoObject class.
If (this.sprite == null) is true, it will return null. If (this.sprite == null) is false it will return this.sprite.getProperties();
The IsoObject class has a property:
public IsoSprite sprite;
That is probably null for you.
@vestal umbra thx let me check
I believe you are looking for the PerkFactory class.
build/classes/zomboid/zombie/characters/skills/PerkFactory.class
Hey guys... so I installed some mods in my game for the first time.. now when my character goes to run he starts slowly limping. Any idea what mod might do that or is it something else?
Mods I'm running
Arsenal 26
Britas
Cheat menu
Lock picking
Minimal display
Mod options
Mod template
prepper starter kit
Raven creek
Raven creek loot map
Tactical weapons
thank you π
@vestal umbra thanks, your explanation helped me fixed my bug π
Nice! Glad to hear it!
any clue how to add custom settings to the sandbox?
Check the pinned messages there is a mod in there
MySandBox mod or something, I used it and it worked
This one
@royal ridge awesome, thx β€οΈ
is there a guide on making custom zombies? I want to make a neckbeard guy who spawn with my mod weapon
@royal ridge so it's just about setting SandboxVars.MyMod.MyCustomOption = myValue?
nevermind, now I got it π
I want to add an option so you can decide whether the spear traps will kill the player if he walks on a spear trap
Should I put this in the page "Character", or "Sadisitic AI Director", or in my own page, like "Spear Traps"
the latter feels a bit overkill for a single option
@vestal umbra that seem overkill for a single option no?
What about your future options
for now I put it under Sadisitic AI Director, I think it's a good place π
What if you add more traps
if I have some more, then I'll make my own page
And more options for traps
I wouldve made a new page even for one option. It is very likely that you will get more options.
π
@vestal umbra I'll follow your advice if it happens, but I really don't see any other option to add
and I don't plan on adding new kind of traps
spear traps were painful enough to develop π
still some issues to fix
The people using your spear trap mod will find new settings that they want you to add
@vestal umbra woud you give it a try?
The spear trap?
yes
it's here for now: https://github.com/quarantin/zomboid-spear-traps
@vestal umbra I guess you're right about users asking more options, and if I can do it I will, but after thinking about it, I think the option "Spear Traps Kill Player" is really meant to be in Sadistic AI Director
It's up to you as to where you would put it.
cause it's really a sadistic option π
I'm going to pass on trying them out for now, I'm still working on my own mod.
no worries
I'm nearly done, just have to find the correct event to hook my mod into.
@vestal umbra what mod are you developing?
It's a mod called "Wait My Ass"
The first time you spawn into the world, the house that you spawned in has all of its doors and windows covered with sheets. The windows have a random number of barricades on them as well.
I always thought it was weird that you spawn after the start of the apocalypse but seemingly did nothing to defend yourself
do you add a hammer and nails in your inventory at the start?
yeah but if your character was able to barricade windows, it means he had a hammer and nails, no?
so maybe he used all his nails, but he should still have a hammer IMHO
Maybe I will add that later
or at least in a container in the house
but I'm going to leave it out for now.
I'd like to get this first version of the mod working.
sure
now I have to find out how to give injuries to my character
for when he walks on a grave with no spears
or maybe only when he's running, not sure
Giving a hammer and nails is OP
I made some lua files for my mod and now I keep getting a black screen when I try to load in
can anyone take a look at what I did wrong?
cat.outfit is wrong @hot patrol
You're also not closing your "
I'm also not sure if the weapons array should have a comma
Json would fail on that. I dont know how Lua handles it.
Pretty sure I followed the vanilla to a T there but if I still have issues I will recheck it
Ok
still broken but the weapon seems right
here is my reference https://i.imgur.com/HXdJHbt.png
So I fixed a bunch of errors I ended up finding and i'm fairly certain it is the way it should be now but I still get the black screen. Can anyone spot something wrong with the outfit maybe? the intructions were less clear on this one. https://i.imgur.com/xhwo4js.png
about the extra comma, for Lua it's OK, but for JSON it would be a syntax error
how are you supposed to get the GUID here? The guide I followed never specified so I literally just randomly generated one online. Could that be my problem? https://i.imgur.com/qxu01pr.png
@hot patrol theoretically it could, but considering the range of possibilities you have as much chances of this happening than winning the lottery twice in a row
if you ever get in trouble, just change it and that's it
yes
only "smarter way" would have been to check UUID of all zomboid code and mods but that would probably be painful
there must be something else wrong with my code that i'm not seeing. I did fix a lot already
@hot patrol what problem do you have?
when I load the game I just get a black screen and the music keeps going
nothing in console.txt?
I know it is something with the lua since it is all I added
no errors
or crashes
just the black screen
@hot patrol does it happen when you start a game, or you can't even see the main menu options?
have you tried to start a new game?
well sometimes some data can get corrupted, especially if you got crash etc. It's worth trying to be sure it's not this kind of problem
Can't even start a new save with the mod
do you have your code published somewhere?
try to comment every lines in the last file you posted and start a game
@hot patrol is that the full content of your mod?
that is just me trying to make a special zombie outfit to spawn my item
everything else is tested and works
try what now?
like this:
--ZombiesZoneDefinition.Default = {};
--table.insert(ZombiesZoneDefinition.Default,{name = "Neckbeard", chance=0.2, gender="male"});```
then start a game and see if you still get a blackscreen
Does anyone here know of an event that I could hook into after initial creation? I tried OnCreatePlayer but it doesn't seem to work.
I want to modify windows and doors for the first time a player is created.
@hot patrol Mind to zip your whole mod and upload it here? so I can try to load it and see if I can troubleshoot the issue
hehe
@hot patrol All right I get a black screen too
but I can see this in console.txt:
-----------------------------------------
function: AttachedWeaponDefinitions.lua -- file: AttachedWeaponDefinitions.lua line # 11
LOG : General , 1635534766517> attempted index of non-table
like 11 is literally the end of it
what could be wrong there?
should the } not be there?
@hot patrol I think the problem is AttachedWeaponDefinitions does not exist or is not a table
@hot patrol no line 11 is just the end of your statement, so it gives that line
problem is actually at first line I think
yea but that is in the vanilla files and this guide says it is how you get zombies to spawn with weapons https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/
This is a visual guide for mappers and modders who need to add or modify PZ's loot entries using the new ProceduralDistributions.lua approach. Whilst the ProceduralDistributions.lua file has been in the game for quite a while (i.e. the Gigamart shelves having distinct loot types), TIS will be eve...
wrong one
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
i was about to ask π
yea the first guide I linked will be the next mission I take on lol
@hot patrol try to add this before everything else:
AttachedWeaponDefinitions = AttachedWeaponDefinitions or {};
it seems to fix the bug for me, but now I get another bug in HairOutfitDefinitions.lua

lol
still black screen for me but maybe It fixed the first problem like you say
I will check
yep
hairoutfit
I'm adding the same start bit on there to
bet that will fix it
HairOutfitDefinitions = HairOutfitDefinitions or {};
anyone know if the propane trucks actually work in fillibusters?
propane or fuel or whatever
Or if the zupercart mod works for that matter
@hot patrol try this: ```HairOutfitDefinitions = HairOutfitDefinitions or {};
HairOutfitDefinitions.haircutOutfitDefinition = HairOutfitDefinitions.haircutOutfiDefinition or {};
before the table.insert bit
@hot patrol you also need this: ZombiesZoneDefinition = ZombiesZoneDefinition or {}
and then I get the loading screen
require "Definitions/HairOutfitDefinitions"
after seeing the attached weapon error I figured that was it
so I premtivly added it to them all
π
cat.haircut = "Picard:50;PonyTail:50";
i do not see any haircutDefinition with either of those?
maybe needed? π€·ββοΈ
also require the file for the best
they are somewhere else
as when yours loads before the original, it will just be overwritten
I saw them
lemme see
they are in hairstyles
the xml
hairdefinitions are just the zombie outfits in game
none of them use those styles
@vestal umbra have you tried OnGameStart?
It wouldn't work for what I want.
it should be called just after the game has finished loading or starting
I want the mod to trigger one time only after character creation
I believe this would trigger it everytime you reload a save.
indeed, but you can store a boolean somewhere so you know you don't have to do it again
like: someObject:getModData()['initialized'] = true and then in your function you just check for that value
if true, do nothing, otherwise do your stuff
@vestal umbra wouldn't that work?
Yes that is a good idea.
cool
I don't know how to do that yet, but I did consider a boolean.
can anyone think of a reason why my zombie outfit doesn't show up in the debug zombie spawner?
i'm stumped
How would the boolean keep its value across an entire save?
@vestal umbra I suppose you could do something like this:
getPlayer():getModData()['initialized'] = true
the content of ModData is reloaded on game load
assuming you put lua primitive types in there, like integers, booleans, or tables
I'm going into a Dead by Daylight match now but I will try it later.
ok, let me know when/if you succeed
How difficult would be to make a mod which would show the weight permanently? Like without to click on main inventory to see it?
not very hard
@hot patrol looks like a syntax error in your XML file
@hot patrol are you sure this is valid syntax? --fedora--
does not look like valid XML
try this instead maybe: <!-- fedora -->
that's a comment in XML format
@sharp crystal how do you want to display this information?
@weary matrix shurutsue figured it out. I have just about everything working noiw
hello, is it possible to modify the rate of change of endurance per tick, or does all this happen behidn the scenes and is not modifiable by using lua?
getEnduranceChange() seems to merely pertain to the one time benefit some item can give
I reckon calculating the ΞEndurance between ticks and setting Endurance with every other tick to counteract the endurance change as performed by the engine behind the scenes might be not the best solution
Basically, I'd like to implement a more realistic asthma inhaler that doesn't just give a "bump" once
@hot patrol sweet!
@hot patrol on my side I just published my mod on steam workshop!!!!! π π π
https://steamcommunity.com/sharedfiles/filedetails/?id=2640351732
I tried to make it balanced
so for example unless you change sandbox settings, you die too if you walk over the trap π
that's how it goes when you walk on the pointy bits
indeed

that pit needs some cover for camouflage
@teal rampart you mean for multiplayer?
ooo
π
sneaky
I've thought about it
will think about it when we have multiplayer with version 41+
ayup. it's still a bit off... it was just my first thought when i saw it π
right now the multiplayer part is so boring I'm not sure I want to spend any more time on it π
i guess grabbing some bushes and replanting them around the pit should be enough
for starters π
can we grab bush and plant them already?
im not sure, lol
But nice mod. Do you plan on adding any other traps
@weary matrix Okay I can work on this boolean now. What is the concept of it?
chuck explained it briefly to me, but do you just kinda like store a boolean inside of an object?
Finally
congrats! π₯³
@vestal umbra yeah everything you put in modData is saved and restored when you load a game
doesn't work to store Java objects though
local player = getPlayer();
local hasModBeenRan = player:getModData().HasModBeenRan;
if hasModBeenRan == nil then return; end
```\
could I do this?
provided that I set player:getModData().HasModBeenRan = true later
@vestal umbra yes looks good, except I would change your check like this: if hasModBeenRan == true then return
Fair.
you can set it to true just after that last line BTW
I'm gonna set it to true after it's fully ran
at the end.
player:getModData().HasModBeenRan = true;
like this, right?
yes
I use array notation, but that should work too
you're just calling the value of the property at the end of the day
You're welcome! I hope it will work π
indeed
@proud fern @dry chasm thank you guys π
was that in regards to that gamestart event? You could also check the players survived time and ignore it if it's higher than a certain time
like 1h or something
especially you @dry chasm, I would never be done by now without your help π
I just want to hook into an event that runs at the start
once and only once per save.
We won't know for sure π
well, once and only once per character really
so saving the boolean on the player would be even better
I imagine that a new player would also mean that it creates a new boolean.
yea, was just an idea as another person used time before, not sure for what though
You can hook into the hour event
no no
Mod idea-expansion of expanded heli events that includes hostile military NPCβs and possibly a hostile heli that shoots at u
Oh yeah but the issue is
onGameStart does not run my code.
I think the hook is too early for my code to run.
mhmm could be
though do you use player:stuff or getPlayer():stuff?
onGameStart does not provide the player arg IIRC
is there anything between "EveryTenMinutes" and "onTick" to register an event on?
player:stuff
is anyone proficient in custom zombie outfits?
I got it to work; just a reminder to everyone here:
If you call to an event, you have to pass in all the parameters that that event uses. If you do not do this, the event will not trigger.
Which, in my opinion, defeats the purpose of the event.
π€ If you just want your function ran when an event triggers, you do not need to use all arguments provided.
If you however do wish to trigger an event, then yes.
Okay, but why then did my function not trigger when I hooked it to OnKeyPressed
even though I pressed keys
Oh wait, it's because you want to trigger the event.
I understand.
I just put my mod on the workshop if anyone is interested
https://steamcommunity.com/sharedfiles/filedetails/?id=2640451854
@vestal umbra congrats mate! Will give it a try now
Sweet, it is intended to work for a new safe but it will work on your current save too
it will just add sheets and barricades to the home that you logged off in.
what if we made zombeis edible
depends
zombie human then no
but I might be more eager to eat zombie pig, if well cooked
@vestal umbra seems to be working OK π
Sweet. I know there is a bug still @weary matrix
Certain doors are not provided with sheets. Apparently doors to the south and west are not part of the tileSet
@vestal umbra maybe try to increase the square scanning area by one
Just tried a new game with Zombie speed = sprinters, but I end up with 100% sprinters, no slow zombie at all, is that normal?
when I watch zomboid streams I can see some are sprinters, but most zombies are not
How would I do that?
Because currently, I am retrieving the tileset of the house
@vestal umbra can you show me the code you use to retrieve the tiles?
I'll DM you it
sure
In hydrocraft you can skin zombies then cook the body and eat it after, but as youβd imagine the stats are pretty bad
This was a great suggestion - and we've added hostile helis that shoot at the player. π
Hi @sour island, do you play with sprinters by any chance?
@sour island when I set zombie speed = sprinters, all the zombies are sprinters
is that normal?
I know vanilla has a random one but the % is high
there's a mod called config zombies and another called sandbox+ that lets you customize it more
warning tho sandbox+ breaks with other mods that use the main menu
aah good to know will look into it
i don't use other mods that change the main menu so I should be fine hopefully
Mix zombie speeds any way you want.``` β€οΈ
thx @sour island I think that will do
damn I installed sandbox+ but I get no extra options in sandbox settings
Do IsoObject store a unique ID (that's also persistent after saving/loading)?
@dawn shuttle maybe try keyId, I'm not sure though
otherwise the class is serializable so IIRC it means it should have a unique ID
ah nevermind, the serializable field is unique per class, not per instance
what are you trying to achieve?
Hey guys, I have 0 scripting experience whatsoever but I'm looking to create a super simple mod in which metalworking and mechanics skill can be used to craft reinforced car parts. I'm planning to just copy-paste and alter vanilla assets, but I'm having a difficult time finding the assets to rip.
saving an object ID in an .ini file
So that object is queryable from the client's selection
@dawn shuttle I know Lua is able to write files, but not sure about the Lua shipped with Zomboid, it's a special one
@dawn shuttle what kind of object?
I did see getModData() but I wasn't able to figure out a way to achiev that
writing files is no issue, as well as reading
@tall pivot which assets are you looking for?
@sick palm ah, good to know I've been wondering
I saw writing/reading np yeah, it's the pesky ID that is causing me issues
Specifically Containers
@dawn shuttle depending on the kind of object, maybe you can just save the fields of interest and recreate the item when you need it?
I'm looking for all three breeds (standard, sport, and heavy) variations of tires, windows, hood/trunk lids, and doors.
I'm trying to find the sprites/textures for each as well as the defined values to copy and alter.
overall unsure on ability to reference an item without its position or similar (like via an id or something), though storing it's square position somewhere is a possibility and then checking that square for said object.
Not sure if I understood. In my case it's existing containers in the world that I essentially want to tag
I was able to use setName(string) which permanently changed the name. If I knew that would not cause an issue I'd just generate a UUID and job done lol
does that persist through save-loading would be the question.
it does
then i guess it just depends on what exactly you want to achieve. Like, just when interacting with it? Or also when away from it automatically?
I thought about coords based saving, but the main issue with this is how easy it is to desync the value since you can move containers around
I'm trying to achieve the ability to click on a container, set some user values and then save that info in a .ini file with the key being the ID of the container
so the ini file part is.... for some reason.
If it's supposed to just be for that save, you can set moddata
alternatively, if you need a file written and all
you can set part of the mod data, example:
ContainerID = 1,
MyData = {
something = 5,
somethingElse = "Hello
}
store it in an ini file (for whatever reason? Debugging?)
And load this file upon world load or something
I did try playing around moddata but was not successful
and when interacting with the object, you can compare ini and moddata
Do you have a moddata example?
local mdata = item:getModData();
mdata.Something = "This is some string";
mdata.Data = {
"This is a table, filled by index with strings",
"very useful, maybe?",
}
-- later on
local mdata = item:getModData();
if mdata and mdata.Something and mdata.Data then
for _,v in ipairs(mdata.Data) do
print(v);
end
end
probably a bad example, but yeah.
I'll give that a go! Merci beaucoup @dry chasm and @weary matrix (Also congrats on your first mod!)
Good luck!
thx, and good luck @dawn shuttle
@tall pivot have you checked the tilesets?
the .pack files
I'm not sure it's there
No, I literally have no idea what I'm doing but I'm starting to somewhat understand.
What filepath can I find tilesets in?
@tall pivot mmn maybe try to find a mod that does something similar with cars, to see how it's done
That's a good idea, I could find a standalone vehicle mod like M911 and reverse engineer it
@tall pivot they should be in media/texturepacks
@tall pivot TileZed
once you install it and configure it properly you should have access to most tiles
Thanks.
night all!
night co
Does anyone know where I can find the values for vehicle parts in vanilla files?
In what folder can I find values for hoods, windows, and tires?
i.e. health and weight
For weight/ConditionMax (part health) it's in ProjectZomboid\media\scripts\vehicles\vehiclesitems.txt
Thanks a bunch.
np!
I'd suggest either downloading notepad++ or vs code. Both of these software has a search that allows you to find keywords in multiple files in a directory
I have both, haha
VS code is much easier on the eyes
both configurable, but dark mode vs code is A+
Wait, is repairing vehicle items vanilla now? I'm still using a mod for that lmao
certain parts you can repair in vanilla like trunk/trunk Lid. Most is find replacement parts, macgyver lol
Jeff, do you know what these stats mean?
Doesn't matter.
Things are starting to make sense to me!!!
great feeling
np for ping
should be in ProjectZomboid\media\ui
Thank you.
I'm actually looking for inventory icons, maybe I can check inventory then.
Nope, media>inventory only has two magazine pngs LOL
achieved what I was trying to do btw @dry chasm π
I apologize, my mind's somewhere else, what when why? π
About the issue of saving a unique ID to an item lol
getModData was the way to go
ah!
What inspires y'all to make mods?
imagination
For me at the moment, I'm implementing what I want in my playthroughs
mildly bugged by the fact X or Y is not in the game
as in?
coordinates? they are π
lmaooo

or as an answer related to What inspires y'all to make mods?
yes lol
i have an asthmatic character and he is in dire need of an inhaler
no worries π
someone code this man an inhaler
so i need to mod one in since the other mods no longer supply inhalers
ive fixed the code of PZ Med
oh cool I'm recruit now reporting for duty
and i can inhale! :p
yay living!
i just don't like the mechanism... i want it to be a bit more realistic
wow this is so cool
I don't know how to code for shit
but I can comb through and alter values
but i'm a dabbling noob and trying to properly register my functions on events
this opens so many doors, I can go revive dead mods on Workshop
