#mod_development
1 messages · Page 127 of 1
yeah I cant track it without that being in my IDE.
regular teleport
why I suggested looking at how debug does it
Can someone help me with an issue I seem to be having with my mod here https://steamcommunity.com/sharedfiles/filedetails/?id=2914213621. Basically when I loot a dance card and put it in my inventory and then reglog with it there when I come back it no longer has the display category that my mod should be giving it. Cassettes and Vinyls work similarly and those seem to work perfectly fine.
all teleports use the same setX setlX stuff
the issue was the order of events for onPlayerUpdate and onplayerMove
it was cancelling out the changes in order to 'finish' the movement
We do mod commission. Join our discord server. The links on my profile as i cant send it here.
question
i made a mod that adds some new books
but when i try and enable it my game freezes on loading lua and nothing happens
the game doesnt crash and i get no errors
if anyone wants to take a lok
*look
I was thinking ya dealing with MP and anti-cheat saying 'no'
but honestly I dont even know if they use BE or anything
Where do you customize a capacity for a container again? I know in TileZed I can do 100 - but if I wanted more than that it mentions you need to create custom script to reference it or something?
yea you can change that
ill shoot you a new file you can use to try to change and see if it works. it should in theory, not sure what hardcoded number is. but it's not always the tilzed setting
Oh cool ok - thanks, wasn't sure what I was doing wrong. I tried typing in "240" but it just stopped at 24 - it wouldn't let me go further lol
you are welcome. just make sure it actually works in game also
Yes - very true. All that's left is for me to get the container to accept only specific items. I'm so close lol still confused as hell but so close
i mean you can use the guide to create a custom definition for it
its in the mapping area
The guide?
You're wonderful. Thank you so much
np!
Silly question, not sure how similar it is to python - but in Lua if I want to say:
if name (contains) "123"
what is the syntax/relational operator for that? If I put:
if name == "123"
Will it only find items that are named specifically 123 or will it find items that have 123 in the name?
if anyone knows how to set an item to spawn inside of an item would be awesome, been trying figure this out for a few days an we just cant figure it out. Thank you in advance!
Figured out how to prevent looping from a 2 way teleport tile
this would be cool for like mini game servers for teleporting to whatever minigame on the map or whatnot
Someone plans to make dungeons or something - so I think they wanted something like the RVs or basements
I can't seem to get the lua script working and I know it's because it's wrong lmao
Trying to get a custom container (like a counter/shelf) to only accept "tools" or something specific so I used a Nails and Screwdriver to test but I can still put any items into it.
test_container.AcceptItemFunctionTestContainer = function(inventoryContainer, inventoryItem)
local scriptItem = inventoryItem:getScriptItem()
local name = scriptItem:getDisplayName()
if name == "Nails" or name == "Screwdriver" then
return true
end
end```
How tf are tilesheets supposed to be formatted?
I can't seem to find any info on how TileZed actually separates them.
Here's what I just threw together
i would ask in #mapping if you dont get help here
I need help.
Task: open modal window with text or image or all together with possibility to close this window.
I found this function, but it's give me error
Something about MyFunction.toExecute
When I tried to replace this function ( MyFunction.toExecute) to nil it doesn't work. It's give me the same error but tell me about nil.
What parameters need for ISModalDialog:new ??
No on answered u yet?
U mean spawn inside a bag right? Or a tile container?
damn my mod must be bad
what's the mod?
lightswitch overhaul haha
i'm getting harrassed by some person and their friends
it's not bad btw. pretty sure it doesn't actually have any issues at all. they are just stinkers
Hey guys, is there a way to write mods in typescript yet?
Here what I found for you
is there a way to find an old workshop description i accidentally overwrote?
Go back to previous version
ah
can i bring it back to the updated version again right after copying the description?
@red tiger
You might want to check out jabs work
Pipewrench
Its on the threads
Kahlua is 5.1 so be careful when looking at docs.
Yes
Dont forget to check out the pinned post on #mapping
Use removeitem i believe
Im afk and cant link the propersyntax
it won't restore the description
Does somebody work with GUI ?
can confirm it did not restore the description.
i just wrote a new one
will ur old description be overwritten every time unless you actually change it in the files rather than on steam?
unless you made the workshop.txt file with it
i'll just change the description through workshop.txt from now on
description=[h2]Want colored bulbs? No Problem. Battery connector? Your wish is my command. Sandbox controls? You got it![/h2]
description=
description=[img]https://i.imgur.com/qtZDWr7.gif[/img]
description=[b][i]This mod turns all Vanilla light switches into pick-up and placeable objects, allows you to change any bulb, add battery connectors, and completely reworks lighting from the vanilla game. It even adds the ability to craft right and left-sided switches! Each side (right and left) of the light switch faces in any direction depending on the wall it's touching. You can disable any feature via sandbox settings, some of which change on the fly, and most require a restart. I suggest setting sandbox settings, then restarting your server immediately.[/i][/b]
description=[img]http://i.imgur.com/9iYzwL4h.gif[/img] [img]https://i.imgur.com/VhyjlvW.gif[/img]
description=[h3]This mod can be added or removed from any save, but note that any moved/changed switches will remain even if the mod is uninstalled.[/h3]
...
yea
this works. for spaces just do empty line of description=
ik how, i just didnt realize it would overwrite when i was changing through steam
oversight on my part
ahhh sorry to hear
it's okay it basically just said what the trait did and what i have tested it with
I just copy the steam description before upload and put it into the description text UI which appears before you push the update.
a lot of people never realize you can insert description and change notes in-game before you publish the update.
That’s great, thank you very much!) going to check later!)
yea i kno but it was too late to go back
Didnt work? Darn
i changed description through steam usually when i already shut off the game and dont wanna go back in again, but next time i'll just copy it
well now it says this
Uhhh which post are you referencing?
There's... a few.
I'll try superb survivors.
How should this be installed? https://github.com/Sycholic/Superb-Survivors
Do I download the official mod and then use the above link's files to replace files in the mod files?

if u want help with installing mods, go to #mod_support
i will also link the workshop page there
oh right yes
all of em
thats only in ref to the source the mod was updated recent but the files have changed massively.
If you haven't found an answer yet hit me up - I spent wayyyy too much time trying to figure it out and finally did lmao
That tells me that 61% of the time - it works every time.
Pointing me in the right direction would be appreciated o7

Shoot me a DM if you're cool with that, that way we aren't filling up this spot with a back and forth
Just post what you got over in #mapping, so the information can be archived in-case someone else has the same issue later down the road.
No problem - I can do that. Could you quick give me a rundown of what you're having trouble with?
Hey everyone, so what time do you update your mods if any? there's 31k playing according to steamcharts and it's a Saturday so I was wondering if it would cause a big inconvenience?
Sure thing. Basically the formatting in-general of the sprite sheet in-order to have each angle correctly recognized and ordered by TileZed
Update it during peak hours, just for the meme.
updates only for critital/security ones otherwise only on a restarts of a dedi.
Any specific way to format it in #mapping?
Yeah that would be really awesome. I just need to know how to put the sprites themselves on my combined map sheet. I think I managed to make the sprites themselves somewhat decently.
Also - do you have that template file to help you with the references?
I got it from the Indie forum - but I made a few changes to it to help my brain understand it better, I could upload it in the mapping channel too if that's not against the rules
I didn't see that so an upload would be great. I was just using one of the base game sheets.
Sounds good - I'll get something uploaded here in a bit, just finishing up some things.
Just uploaded it to the mapping channel
Make him hit the griddy
Hi, I added a recipe to make Nails and I want it so that you need to be minimum level of 3 on metal welding and carpentry even tho I added the lines It doesnt seem to work
This is what I used to make the skills required "SkillRequired:Carpentry=3,"
they should be in same line, separated with ;
Thanks, Ill try that
the skills are Woodwork and MetalWelding
module Base
{
recipe Craft Nails
{
ScrapMetal=1,
keep [Recipe.GetItemTypes.Hammer],
keep [Recipe.GetItemTypes.Screwdriver],
Result:Nails,
CanBeDoneFromFloor:true,
Time:1000,
Category:Carpentry,
SkillRequired:MetalWelding=3;SkillRequired:Woodwork=3,
}
}
Thats what Im using
is it true?
Also even tho i diddnt writw 10 it gives me 10 nails as a result
I dont think it is
Oh eya its not
Would anyone be willing to help me through this?
Ok I fixed it
@fast galleon I thought I was on the right path and creating the lua and script reference but the container will accept anything I drag into it.
Here's the script (I have a recipe, item and base file in the scripts folder, this is the base txt script):
{
item TestContainer
{
AcceptItemFunction = TestContainer.AcceptItemFunctionTestContainer,
}
}```
This is the Lua in the lua/servers folder:
```require "Items/AcceptItemFunction"
TestContainer.AcceptItemFunctionTestContainer = function(container,item)
return item:hasTag("Screwdriver","Nails","Screws")
end```
Alternatively, I also tried:
```require "Items/AcceptItemFunction"
TestContainer = {}
TestContainer.AcceptItemFunctionTestContainer = function(inventoryContainer, inventoryItem)
local scriptItem = inventoryItem:getScriptItem()
local name = scriptItem:getDisplayName()
if name == "Screwdriver" or name == "Nails" or name == "Screws" then
return true
end
end```
Either way I do it - the container works perfectly fine, but it will accept any items I add to it as opposed to just those items listed above.
Any suggestions on what I should be looking at?
those look nice but seem REALLLY tall.
you need to set the function on the isoObject from Lua
Good morning.
sup
Apologies - what do you mean by that?
Oh jeez, I forgot all about that line of code - so am I adding that into the lua file I referenced above that I have in the lua/server folder?
I will explain why you have received so many downvotes.
Your Lightswitch Electrician mod allows players to create switch tiles, but switches installed in player-built structures do not work.
As a result, another user created a mod called Light Switch Plus and uploaded it to the workshop. This mod allows switches to work in player-built structures, unlike your mod.
However, you claimed that Light Switch Plus stole your Lightswitch Electrician mod and reported it, resulting in its removal from the workshop.
This incident was shared in a community, and many downvotes were given to your new mod, Light-Switch Overhaul.
I suspect that you reported the mod to monopolize it and prevent its release on the workshop.
If that is not the case, why did you disable comments on your mod?
Anyone know a way to disable the vanilla Gunpowder? I made my own Gunpowder and need the vanilla one to never spawn in the game
Seems like this needs to be handled privately or with mods and not here.
I just wanted to inform about what happened. It's an issue that should be resolved between the two parties involved.
I will not mention it anymore.
is there a way to make clothes not get bloody?
like everytime when blood gets on my wearable cigarette the texture just becomes white
dont know why
Try set BloodLocation on item
Or remove it if you have it
so just remove the whole line?
yep
cheers👍
Planning to finish my ZedScript -> JSON parser today.
When it is finished, it will also have a linter.
Someone need help with lua modding? I can do review code in real time and improve code/add advice. Or I can do review code of some mod and explain it 🙂
- In voice chat
Yea like u know how u can find Paper Bags, Gun Cases or other items that can hold items spawning with items already in them. Like normally Gun Cases have Guns and such and the Paper Bags usually have food and like napkins in it, I wanna add the Card Pack from my mod to spawn inside the Paperbag_Spiffos from the vanilla Distribution file but obviously put the code in my own mod files, but that's where the original game code for spawning items in the bag is but haven't been able to format it to my code or get it to work.
also got a thread for it here
ok
spawn bags with items inside
heres a code we used for Signs of Sickness Server - ToxSick Event
local shotgun = InventoryItemFactory.CreateItem("Base.DoubleBarrelShotgun");
local bag = InventoryItemFactory.CreateItem("Base.ShotgunCase1");
shotgun:setTooltip("initially has 6 chambered shells");
shotgun:setClipSize(6);
shotgun:setCurrentAmmoCount(60);
shotgun:setRoundChambered(true);
shotgun:setAimingTime(90);
shotgun:setMinDamage(shotgun:getMinDamage()*2)
shotgun:setMaxDamage(shotgun:getMaxDamage()*2);
shotgun:setName("SOS ToxSicK Event Shotgun");
getPlayer():getInventory():AddItem(bag);
getPlayer():setWornItem("Back", bag);
bag:setName("SOS ToxSicK Event Gun Case");
bag:getItemContainer():AddItem("BladeSOS.Bloodbath");
bag:getItemContainer():AddItem(shotgun);
another one used as template for Kentucky RP server
local spwnbag = InventoryItemFactory.CreateItem("Base.Bag_Schoolbag")
spwnbag:getItemContainer():AddItem("Base.Apple");
spwnbag:getItemContainer():AddItem("Base.Apple");
spwnbag:setCapacity(70)
spwnbag:setWeightReduction(70)
spwnbag:setName("Kentucky RP - Store Items");
getPlayer():getInventory():AddItem(spwnbag);
getPlayer():setWornItem("Back",spwnbag);
getPlayer():resetModel();
@tame mulchso when I remove the bloodlocation 13 or so error happen when you wear the cigarette
am I able add that code to the file I already have for spawning? or would I need put that code in its own file?
Just do it this way, without any complications or fancy business, and it will just work, as long as some other mod isn't breaking stuff #mod_development message
Just have the code itself, no functions or events or anything else, in a lua file in the server directory.
Obviously use the correct name for the spiffo paper bag and your items; but if you have the container and item names correct, and no other mods messing stuff up, this will just work.
table.insert(SuburbsDistributions["Bag_SurvivorBag"].items, "Base.BlairsBestItem");
table.insert(SuburbsDistributions["Bag_SurvivorBag"].items, 10);
send script here please
ah i thought you needed to spawn items within a container item.. i didnt know you needed distribution codes
you would have to take waht you need this is specific for some other purpose
you have to take what you can and build what you need
I think I tried this code but lemme try again
Try it with an insanely high spawn chance, without any other mods running, and double-checking that all of the names are correct.
yea im trying get the cardpack to spawn inside the Paperbag_Spiffos that already spawns inside of the SpiffoDinningCounter
I know that code works when the right names are used + no other mod is farting up stuff.
There could be an error in your item script itself that means that they can't exist and can't spawn.
his right... try vanilla run you rcode on debug
If this works, and yours doesn't than maybe it's your item script
table.insert(SuburbsDistributions["Paperbag_Spiffos"].items, "Base.Spoon");
table.insert(SuburbsDistributions["Paperbag_Spiffos"].items, 200);
hey thanks Aiteron, it works
local bag = InventoryItemFactory.CreateItem("Base.Bag_BigHikingBag");
bag:getItemContainer():AddItems("Base.Apple", 5);
getPlayer():getInventory():AddItem(bag);
getPlayer():setWornItem("Back", bag);
getPlayer():resetModel();
even though I found a work around but throwing it out there 'is there anything that is triggered 'after' clicking to start and the world has rendered in on the screen. ie dont have to do a 'nil' check on mod created windows. and sup Glytch
heres a concise version of itemspawning inside a bag
ow hey man how r u
chill'n making sure before I move to trying to dig for another issue Im not just half hacking code so it dont break
seen the big guns talking figure'd I'd ask
most people use OnTick function that removes itself after one run
oow i did a similar thing when i tried to detect the fuel pumps
it dont.... I dont know how they setting/linking timing the events up to create the windows but in that time where P2Start shows and the world if ya hit a hotkey, error pop.
local function checkStuff()
local rad = 1
local player = getPlayer()
local cell = player:getCell()
local x, y, z = player:getX(), player:getY(), player:getZ()
for xx = -rad, rad do
for yy = -rad, rad do
local square = cell:getGridSquare(x + xx, y + yy, z)
for i=0, square:getObjects():size()-1 do
local obj = square:getObjects():get(i)
if obj and obj:getPipedFuelAmount() and obj:getPipedFuelAmount() > 0 then
local fuelamt = obj:getPipedFuelAmount()
print(fuelamt)
getPlayer():setHaloNote(fuelamt)
CheckStuffOff()
end
end
end
end
end
function CheckStuffOn()
--getPlayer():setHaloNote("CheckStuffOn")
Events.OnTick.Add(checkStuff);
return true
end
function CheckStuffOff()
--getPlayer():setHaloNote("CheckStuffOff")
Events.OnTick.Remove(checkStuff);
end
I worked around it with this eg. if (myQuestInfoWindow ~= nil) then myQuestInfoWindow:setVisible(not myQuestInfoWindow:getIsVisible()) but I rather make sure Im not missing some 'on world render event' or something
and player and getplayer playeralive or whatever tried those also...
I added new clothing to the game, but even though I didn't set up any configuration for it, zombies are appearing with the new clothing. What can I do to prevent zombies from wearing the new clothing?
I dont know how to help you really i suck at gui modding
all good like I said I got a work around but if its only cuz the keybind event is started too early or something (which I got 0 exp in dealing with) was maybe the cause
its seems like its working, gotta test again bc i made a typo but i think that might been my issue last time or something
yayyy it works, thank you bunches!
can i set it to be more than 100? bc still isnt spawning in every bag, or at least most bags
You can probably set it as high as you like, just test rigorously to make sure it's working as desired? 🙂
okay sweet, wasnt sure i like putting in 200 will make a dif or the cap was 100. Thank you again! Been trying get this figured out for a few days, big help!
AFAIK there's no cap, but a high enough number might bork the calculations in many circumstances.
yea look like for this item the rates in vanilla are pretty high, lowest one is like 30 or 40 with most being 50, thought 100 would make them spawn in atleast most if not all, but ill figure it out bc they are suppose to be like a kids meal toy so i want them in a majority of the bags so i can lower the spawn rate for other places
i have been having a hell of a time moving gas pumps lol
i did get a little help but it's weird that even from a tileproperties edit it give an error. i'll post it later
Anyone know how to make a UI element block aiming?
I've got mouse clicks handled, but I can't figure out how to block Ctrl
The inventory blocks ctrl aiming, but I can't figure out what its doing to do so
It looks like the inventory does this:
function ISInventoryPage:onBackpackMouseDown(button, x, y)
ISMouseDrag = {}
if not isKeyDown(getCore():getKey("Melee")) then
getSpecificPlayer(self.player):nullifyAiming();
end
end```
So if your window has focus, can check for the key and nullify the aim
Yea I've got mouse clicks handled
when the code works fine but PerPlayerRender gridstack throws errors at square getWater 
square:discrad(), square:setZ(1)
seems to not get errors from that anymore, time to quit while I am ahead
Its aiming the camera around I'm trying to suppress
I've been wanting to say this for months.. I love your name.
Straight up S-tier name & PFP
From my understanding, just need to have that check in a more generic function that is not tied to a mouse event to have it nullify the keybind too.
lmao. thanks!
There is an eatKeyPress() but I'm not sure if it would block the aim because that is handled in Java, so the aim would be established before you eat the key afaik.
Yea its not what I need for this, just happy it exists in general
Was trying to find it a few weeks ago, think I was searching for consume instead and never found it
I wanted to make escape close popup windows
ah. even that would be tricky due to how key events work using the eatKeyPress; the vanilla escape key event will likely trigger before yours in the event stack. your best bet for that would be to just decorate the global ToggleEscapeMenu function.
Not home rn and i dont recall
Ive documented that already
Not uploaded to github too

@wet sandal think its something like checkConsumeKey
Decompile UIElement and UIManager to find it
@wet sandal Possiblly ISUIElement:setWantKeyEvents(true)
to block key events
Yeah thats part of it
You need to enable key events
Then you need the function i was talking about to return true when control is pressed
Yep thats it
I'm confused, are you guys talking about the escape key thing I mentioned?
Could probably be used for both, really. But, since Browser8 came in I assume the aim key thing since that was your question
Yeah i was talking about the aim thing
Not having any luck
Its not really about eating the key event I don't think, because you can just hold aim and do this
Whatever, spent too much time on this.
The camera movement can be jarring, but the player doesn't fire their weapon so it's not a big deal.
New Update to my mod, prob wont update for at least a few days
https://steamcommunity.com/sharedfiles/filedetails/?id=2940688973
lol atm im just using offical spiffo PNG but some are hard to find, if you have any feel free link them i got a whole folder of them. Yea was thinking maybe doing something like holos, but before that i wanna try and do a PAWS run since I just added Classic Spiffo
only been able find one other PAWS png tho
building restoration test, don't use it if you want to keep your save
not sure where to post this but lacking the time to make advanced mods, willing to pay ($100+) someone to do a few things, hmu if interested <33
Like what? Dm me
They're supposed to come up to like mid-chest, but I kind of just eyeballed it in Blender.
if this works, it will be possible to move buildings 
maybe not the building, just the tiles
Is there a way to attach a mesh to the player thru a script?
I don't know the specifics, but I THINK its done by using a hidden equipped item in a unique bodyLocation
awesome mod tbh, I love mods that give you the opportunity to collect anything
rn creating adding compatibility in my mod for ur mod https://steamcommunity.com/sharedfiles/filedetails/?id=2914650723
it will work way like I'm getting all items and checking their module and if module is SpiffoCards then adding them into list + checking if item name not is cardpack\cardpackgold\cardpack_trash cos it's not cards
the point of my msg is if u will add more cards it's cool but if u will add more items like cardpack which not in my items blacklist can u shoot me msg in dm
to fast add compatibility for new version of ur mod
thats awesome tbh! ill def add you and keep you updated on updates before the drop, next update will have new items, beside new cards will have a Checklist and a Tin to store cards in
Goooood evening.
Added a building then removed it after I changed my mind.
Do I need to do anything special to remove these "lights" or can I ignore them
this looks like a napping question
Hey, would anybody be willing to help me out with my mod? I got it all written up, but for some reason my items dont exist nor the recipes
No clue what I did wrong
Would recommend sharing your item script. Someone who knows will take a look when they can.
Also consider sharing your folder structure so we can be sure stuff is in the right place.
(screenshots work)
Alright, is there an efficient way to do that? It probably isnt a good idea to copy paste a thousand lines of code in here lol
That's actually fine because Discord will box it into a message.txt file, however, if you just go to the file and hit ctrl+o to open it, that will likely open the folder you're in
And then you can drag and drop your actual file
And then it'll have its original name
oh cool got it
I already sent you dm long time ago . But no reply
How you prefer to share it is up to you
I'm not sure what the issue is but that info should help someone who knows recipes better than I do spot what's wrong.
Pessimists:
AI is gonna take our jobs
AI:
lookin like some yandere sim code
It is absolutely inexplicable to me that files stored in one location somehow behave differently when you reference the exact same files, only stored somewhere else.
Has anyone else encountered an issue with underlay masks somehow affecting opacity of unrelated/uncovered items? If I set my clothing's underlay mask folder to media/textures/Clothes/Jacket/Masks (the vanilla location), it works fine. If I copy that folder and put it into my mod folder, then reference that new copied folder's location, suddenly tights/stockings/etc. get darker when wearing the jacket despite that behavior not occurring when the masks are called from their vanilla location.
Again, these are the exact same masks, the only thing that has changed is where they're being kept...
Here they are when referencing the vanilla folder location...
...and here they are when I move the folder.
Exact same files. Different location. Somehow, different color on the stockings...despite it being a mask for the jacket.
Does anyone knows whether there is an easy way to completely disable a vanilla recipe so that it is not shown in game anymore? Specifically, I want to arrange things so that the recipe is not shown in the craft UI menu when in game, i.e. here:
Does anyone have or looked into a way to fix the First Aid exploit with broken glass? Or is anyone familiar with the FA system to give me some direction?
you meant that you can constantly walk over broken glass to grind first aid?
So with some remaining properties to apply as not mod data I have completed the first library for parsing ZedScript outside of the game and has a linter
yes
would be nice to fix this! but I think this is not only a technical issue but also a question about game design and balancing. have you already some ideas of how a fix might look like?
personally, I'd just want diminishing returns on xp.
50% xp gain on the same injury until it heals.
my first brainstorming idea here would be to store info about the player's injuries and fist aid usage in the player's mod data and then use those data to control the xp gain
but not sure how and if this will really work for this case
Yea, honestly to do the diminishing returns we'd literally only need a counter per injury. But, I really thing that all of the medical stuff is done java side, I'm not seeing much in lua
that would be sh***t
which part xD
the java side part
have you already checked the lua TimedAction code ISApplyBandage.lua? Seems to be relevant here...
I guess we could come in here, but it would be better if we could slide in when the injury is made
I'll have to think about it a bit, idk if I'm up for diving down this rabbit hole with the mods we have going and everything for our server. 😦
Goodnight @odd notch
Anyone know if its possible to animate a piece of clothing?
yyes
i guesss
well im not sure ihavent tried but therere are bones on the clothing
Just thinking of an easy way to fake "air particles" near the player
I haven't messed with Zomboid modeling / animation yet
What programs are good for it?
I'm familiar with Blender
blender works
You know I have to wonder
Would it be possible to make a mod that would allow us to restore power through power plants?
I mean
You’d have to program the whole interaction to do that but wouldn’t it just be reverting the whole city to having electricity again
Cause honestly I have no PZ modding experience but I wanna know if it is possible
I’m a CS major in college
I’m familiar with lua
So
I thought well “I wanna be able to restore the power grid even if it’s temporary and will eventually go out”
It would be a temp fix for a certain area
Since there is a power station you can subvert the power to go into spots
I’m no expert in the matter what so ever
I just think it’s a good idea cause it would give us more of a sandbox goal ya know
But I’m sure if i can make it and make it work it would be a hit mod in the community
Just clearing the zeds to even comfortably start working on the grid
It for sure would
Best way to go about it prob would be looking into the way generators work and then pumping those values up like Arnold after juicing
They work off the grid right?
Like they fill certain areas and lets you use electricity
Yep
That’s what they do
20 tiles where the generator is connected
Dunno how the programming works for that
Soo what if I’m able to do like a directed line of electricity than cover the entire towns area hitting houses and stuff like to cover it
I’d have no clue
You’d have to add in new functions entirely since the way generators work is they explode and everything when not properly taken care of
I need Like a modding tutorial for this…
I can just remove the explosion chance and only add a chance of failure and explosion for the substation itself
I’m still praying I can learn better programming in the next few weeks
If you survive the explosion it attracts a horde of zeds
If you don’t
You blow up and burn to death
Obliterated
Yeah
Meltdown of a power station would be hilarious
But yeah since you only want to set up a line that activates a certain area I recommend looking at how generators work and go from there
thought u were talking about code, was like yea I been there xD
I just need help as to how I make this myself
Like how to edit the code and work on it
We all have
Look up tutorials
Are there any?
Shiiiit
if ur just leaning how to code and make mods for PZ (legit me right now, im big noob and just made my first mod with no experience what so ever) id suggest trying to make a small mod.
Like I picked a Trading Card mod bc was easy and was able to build off someone elses code to make my own. Maybe get an idea for a smaller easy mod, find one that is similar and then read the code, see and learn how it works and then do some tests, remove parts u dont want and changing things to better fit the mod ur making or what u want in ur mod.
Then once u got it started always come here if u need some help like ur stuck with ur code, tried figure it out and didnt work usually someone where can help, might take a couple days if no one knows but eventually someone wise will be able to help.
Always better start small and work ur way up. Like I have tons of big mod idea, but ik I cant do any of them until I can learn more basic stuff first. My next mods I have planned are like a More Posters mod (maybe, might just add Posters to my mod) and a More Comics mod to add like Marvel, DC and other comics. fun fact, vanilla comic uses Superman cover.
hi, guys... I think I chose the wrong channel to bring my modding question... will bring it here. if someone know the cause of my issue, I could use an advice.
Im new to pz modding, and I need some help regarding firearms attachments models. I managed to make the mesh with Blender and to export it as .x file, I made the texture, I made the scripts and made it all to work in-game. I adjusted the position of the attachment at the firearm and the attachment world placement. it all works and look as intended. the problem comes when I place the firearm with the attachment in the world: then the attachment appears flipped, pointing at the opposite direction. let me show an image:
getReplaceWhenUnequip()
what is this for
there is no such tutorial that is very specific to you rmod.. and the thing is , the only way to help you is to actually write the code for you so thats not an option unless you commission.. most of how we help each other is just ask a certain part of the mod project that you are having time with.. but it seemed to me that your looking more of how to mod and not how to do that mod.. so i suggest starting with smaller mod or atleast determine if its doable based on your knowledge and in order to learn is by hitting the ebooks... #1070852229654917180 message
goodluck btw
does anyone have a code snippet that goes through the procedural loot distribution tables and checks if a certain item is in it? My version for some reason is only giving me the original, vanilla tables without any modded items. Not sure what the issue is, the mod with the scanning function is last in the load order, unless that doesn't even matter for server lua
how tf is my mod running BEFORE the mod that I am trying to overwrite? I don't get this...
Did u require?
yes
the issue is how PZ loads the lua files. somehow my mod gets higher priority and executes first
I had to trigger my code with an event instead of running immediately like procedural distribution should do
...scratch that, the game is still spawning the items I was supposed to remove
i stg, this is the second night I cannot sleep because I am trying to get this to work
Can you show your code
Polt is trying to suggest you confirm folder relationship is right. If your file is in a category that loads before the other file, that may be the issue
For ZedScript, in Vehicle -> Part -> door = ,, is this deprecated?
Every part door definition is empty.
Also, the only definition of door { } has a comment with an empty body.
Seems like there's scaffolding in the official ZedScript for some kind of future placeholder or deprecated, legacy or initial phase of implementation of doors for vehicle scripts..
The only place that I can see door assignments that aren't empty strings or empty object bodies are in Vehicle -> Part -> Table.
Hi, Im making a recipe where u can craft nails I want the result of the recipe to be 2 Nails but when I write Result:Nails=2, it gives me 10 instead, how can I fix it?
Isn't there a multiplier in the recipe thing for the amount you craft?
Like a 5 somewhere possibly?
(Remembers seeing this in new script docs)
Use the OnCreate function to add as many nails as you want and add in recipe result remove true.
Otherwise change the materials to match the number of nails you get.
Im not really familier with the OnCreate function, is there any article i can read about it?
Some items like nails are added in batch unless you create the item manually with Item Factory
I'm going to leave this up to the professionals. <3
I don't have the code with me
You can see vanilla scripts and the recipecode.lua file
Thx ill look it up
So I have a fully parsable ZedScript library now. =3
I support parsing all vehicle scripts now.
@quasi geode
Doing some cleanup on the codebase before proceeding.
Im going to put a "OnCreate:AddNailsToInventory," into the recipe then create the file for the recipecode and add "function Recipe.OnCreate.AddNailsToInventory(items, result, player)
end" is that right?
Or do i not add the Recipe.OnCreate and just go with function AddNailsToInventory(items, result, player)
Does ZedScript support comment-line syntax along with comment-block syntax?
It's only officially used on one line in the entire library for vanilla.
o__O
Hey, sorry to like, butt in.
I have a little problem I'm stuck on lol.
models_vehicles.txt has them but they're wrapped in /* */.
You're cool. Ask your question.
so I've created a new item, this item has a condition.
in the items.txt I can add Tooltip =
Not sure how to get that to display the items condition in the player inventory.
I connected the result to the OnCreate function but it still gives me more than what its supposed to give
Ok i fixed it
@red tiger you figure out the comment block yet?
It will just show when you hover
cuz yes /* */ is the block
I'd say that both // and /* */ are supported.
Going to do some modifications to my lexer to support them.
Tooltip = you can read this later,
apparently also # works for single line
I haven't seen this.
That'd be very bad IMO to support C comment syntax and Python at the same time.
Makes no sense.
that's just a string. The item has a max condition of 100. It's not displayed when hovering. I wondered how one would add such a thing.
My code hasn't ran across this yet.
well I think craftweaker looks like a legit zedscript wiki
just scroll to the bottom of that page
wtf Im going to go blow up google thats exactly what I searched for not fucking zenscript
and I def know Im not trying to do a *unix installation
swear between google and yt lately... grrr
Duckduckgo
that wont help with YT putting f'n transscripts up no reason
anyhoot swear I know the name zenscript too and I knew it from somewhere before here..
Gives the sort of results I'd expect from Google from the early 2000's. More infected links populates that site too.
doom? ultima? hmmm
Use DDG with caution.
What do you use?
Google usually asks you for explicit search results if something very similar is more dominant in the results.
Google.
I'm referring to an unofficial name for the .txt files you have in media/scripts for PZ.
yeah but refering to riot games API wonder if its based behind that
Oh ok.
ie. LoL as in League...
okay last shot is it related to this? 'https://github.com/LionelBergen/ZedScript' ?
No. ZedScript is a custom format designed by TIS for Project Zomboid.
These files.
interesting looks jusst like they talking about this in rust lang a macro programming method
ZedScript in this context is not an executable language; it's a storage format for properties of components used in the game.
hmmm
There's some strange syntax differences going on in recipe source items.
I'm seeing item;amount where most recipes use item=amount;item;..
recipe Make Cake Batter
{
keep Spatula/[Recipe.GetItemTypes.Spoon]/[Recipe.GetItemTypes.Fork],
Bowl,
[Recipe.GetItemTypes.Flour]=2,
[Recipe.GetItemTypes.BakingFat];15,
[Recipe.GetItemTypes.Sugar];10,
[Recipe.GetItemTypes.Egg]=2,
Yeast,
[Recipe.GetItemTypes.Milk];5,
Result:CakeBatter,
NeedToBeLearn:true,
Time:50.0,
Category:Cooking,
OnGiveXP:Recipe.OnGiveXP.Cooking10,
OnTest:Recipe.OnTest.WholeEgg,
}
So what, ; and = can both be used as the same delimiter for optional amount arguments provided for recipe items?
Going to assume this until told otherwise. =/
Strange syntax.
edible vs inedible ingredient?
or something that uses a partial amount of the item stack/volume? vs multiple pieces of the same ingredient
It doesn't look like that's the case so far.
well to me thats what it seems like. eg. bakingfat I doubt ya using 15 of them
I'm going through a cleanup phase right now, catching all mis-interpretations of array-like values stored as strings.
same with sugar, then the eggs are clear 2 eggs
dunno just throwing out there atm while my brain going 200
This is where interpretations can be problematic. I'm simply performing logical operations and improvements to rendered JSON.
All good. Your human brain is interpreting a non-human issue though. =P
Pure syntactic conjecture.
Well actually it's nothing to do with how the game interprets it. I'm writing a parser library for working on ZedScript data outside of the game.
The game doesn't interpret JSON for ZedScript.
This is a foundational library for what I'm actually planning to build, a ZedScript editor that's visual, not based on text-editing.
I'm taking the long and hard route on building this so that human-typed errors are less likely to cause issues with the final product.
so like an IDE plugin? or a total standalone
Actually I could build several things out of this one library.
- A linter.
- A syntax highlight plugin.
- A JSON parser.
- A ZedScript exporter from JSON.
- Batch scripts for ZedScript.
- A formatter.
👍
This is the first deep lexer & tokenizer library for ZedScript, so now that it exists, we can do all of these things.
Fenris_Wolf has a shallow, recursive string->val parser in Python 3.
sorry its early my brain just decided to make a curved tangent
A lot of the script process relies on if a== b so sometimes even if you add wrong comment signs it will just make it invalid instead of break everything.
Yeah. This is what has me concerned.
I'm supporting both syntax because then I'd have to assert that this is invalid syntax and throw errors on the vanilla scripts.
most times there will be a warning in logs though which is useful when you look it up 🙂
I'll take a dive in the Java code just to be sure.
The sane way to disable these lines is using commenting.
This will be a nice tool 🙂
I'm feeling more and more likely to write a short paper describing the issues with the current specifications of ZedScript. It may be a good way to communicate what can be improved on over time if picked up by the right people. =)
atleast you not me pulling hair trying to figre out these last 4 errors this mod creates that give no clue why or how it is
other then UI related
Heheh. UI is very hard for people that are new to it.
There's a lot of dead code in ISUI.
its not my code remember... and the error isnt a mod error its core game stuff
what's the error and the line it comes from?
ah
1 sec I can post the small error block
ERROR: General , 1678028829075> DebugLogStream.printException> Stack trace:
java.lang.IllegalStateException
at zombie.ui.UIManager.update(UIManager.java:685)
at zombie.GameWindow.logic(GameWindow.java:262)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:681)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)```
this probably requires an inspection of code before load, so a number of functions added to events to inspect.
So it could be an assigned function from Lua either being nil or assigned as something other than the function.
So update, render, prerender and onresize are reserved function names.
You may have assigned something other than a function to those names.
yeah but sadly its a 1 time only pop only when the world renders after click2start
This is something not a lot of people know.
and I know all about nil functions I had to do nil checks for the hotkey nonsense
You know the reserved names that are in ISUIElement? Good.
Then that might not be the issue.
I'll add that to my list of double look and compare and make sure since this not my code
I'm dumb and have little information. I guess do not interact with UIManager before game start.
I'm also not at a pc, just throwing ideas in case it helps.
you normally dont but this mod somehow inits all keybinds, and if you hit any of them before clicking to start 'different error' which was just nil functions even player and ... isalive or something was even valid so I had to add implicit if's just to make sure one cant trigger what the keybinds did.
myQuestInfoWindow:setVisible(not myQuestInfoWindow:getIsVisible()) ``` for example
Can you remove their function from events?
Or does it make an instance without one.
shrugs ya welcome to look yourself if you wish Im just trying to work on the mod cuz I like it and doesnt seem like anyone is anymore or not publically
Im way too new to lua to know this stuff Im learning it more by trying to debug it.
java isnt an issue
that error just an odd one, pops 4 times every time but never again later only just after the world renders in after hitting C2S
and a mod someone suggested that helps expand on error msg showing them inworld. showed me the keybinds cause but not these ones that mod doesnt even notice those 4
wish clicking the error redbox would cause a break and then open debug
that or maybe if anyone knew what UI stuff that red 'error' popup window was.
@quasi geode Here's my current results for all PZ vanilla ZedScript. This is the current format that I'm running with. If you have any questions or concerns on how I handle certain properties / objects, let me know. =) It's now 100% parsing everything.. Except imports. xD (Easy fix)
The next steps are to write export code to ZedScript.
I won't bug you again for a while.
The next steps will take some time.
Most of this is not lua related, lua doesn't make an uimanager. If it did you could find answers online.
is the quest window from that mod?
yes
thats diff error which was fixed with just nil checks the other windows it can open also did the same problem added the logic there fixed it, but those 4 nothing I do even points back to the mod albeit I know its the mod cuz it never appears if the mod isnt loaded
I have large Ambitions my friend and I get what you’re saying but I think I can do it with a little bit of knowledge and time I’ve had at least 3 years of coding experience with lua Java and C++ and I’m picking up rust
I think I can do this
Just gotta give me the time
you will learn SQL and like it :P
meh SELECT Joke RESULT flat... guess ya just had to work there...
Hey I’ve downloaded JDK and I’m getting the dev tools I need
Can your parser also handle sandbox-options.txt? Uses the same format so I'm curious + I was going to write a "build script" for my own use to cut down on the repetitive process I have for defining new options. I'd like to make it compatible with this format if possible, in case any future tools come in handy 🤠
I would help but ya know my SQL knowledge is like from 1991.
wow I just had a flashback of all the Zenith 386's we had lined up doing HD mirroring and raid creation.
Can you provide me the file?
Like an example of the file? It's a file written by modders
Yeah. I've not seen one.
I could provide mine, but it doesn't have all of the types. I start typing an explanation of them bc I didn't see it documented anywhere, dunno if I finished. I'll try to find it
I'll search pzwiki
wait you just need a sandbox options file with ALL of them?
Convenient, past Omar
This is a simple example of each type of sandbox option available and all of the values they accept.
VERSION = 1,
option ExampleMod.ExampleBoolean
{ type = boolean, default = true, page = ExampleMod, translation = ExampleModExampleBoolean, }
option ExampleMod.ExampleDouble
{ type = double, default = 0.5, min = 0, max = 1.0, page = ExampleMod, translation = ExampleModExampleDouble, }
option ExampleMod.ExampleEnum
{ type = enum, default = 2, numValues = 3, page = ExampleMod, valueTranslation = ExampleModExampleEnumValues, translation = ExampleModExampleEnum, }
option ExampleMod.ExampleInteger
{ type = integer, default = 50, min = 0, max = 100, page = ExampleMod, translation = ExampleModExampleInteger, }
option ExampleMod.ExampleString
{ type = string, default = This value cannot contain a comma or curly braces, page = ExampleMod, translation = ExampleModExampleString, }
cuz I got 20 minutes I'll just flat out make one right now
there's also a skills xp txt file
just have to change all settings to non-default correct?
Uses the same code (or at least one of the methods of the script parser) from what I recall
I intend to provide full support.
What's this one? I haven't heard of it
Ok so the generator how it works is it covers twenty tiles of space around it so….I was thinking when I make this substation repair mod could I apply this effect in a larger scale say make the tiles reach out around that area of town and activate its electricity
one that adds a new skill and the xp it needs and a parent skill, passive or not
Interesting
Send or DM me which files are ZedScript and I'll look into them.
Mod I am working on for NPC's on our role playing server.
https://www.youtube.com/watch?v=QxT06-lFN2c
My DMs are open.
Hey you seem knowledgable can you help me with something
Busy. A lot of active modders here who might be able to help you.
I recently considered this same idea but was gonna tie it to wardrobes (I am an animal crossing enjoyer), very neat
Feel free to ask here.
Alright
This channel is for modding support. (Not mods specifically for players)
Dev chat.
#mod_support If it's the latter.
I’m developing a mod
Ah ok good.
Version 2 will have a player version
I just need to know if something works a way I think it does
Cause I’m making a mod that’s going to let a player repair the electrical grid to specific towns
yeah Nomadic was here last night asking trying to brainstorm on how power works. that would require making an actual grid? or virtually?
Cause I’m gonna make several substations that would allow us repair various towns power each of them only effective in their area
Curious: for your chat messages, are you calling ISChat.addLineInChat with an object mimicking ChatMessage, or something else? Working on a chat mod & trying to keep compatibility in mind
Like Louisvilles power station
Repair that
Louisville gets its power on for say maybe a month or so I’ll add a sandbox option to adjust
The intention is to allow the players MP or solo to activate the grid and get power again
too bad power usage really isnt a thing
I know it sucks
Good to know, thanks!
But I can make it on a time based thing
It “deteriorates”
Over a month the power goes out
yeah but then to me thats 'time to repair it' never dies
That’s the kicker
There’s a chance I’m gonna add for failure
If failed the area sparks and catches fire
Burning down the area and ruining the station
well sporadic/random totally get thats normal in RL so
Exactly
There is always a chance a substation blows up
Happens a lot in unskilled electricians even professionals
I could make it so there’s a critical failure and a normal failure
Normal failure will make it so you have to fix it twice
yeah but you plan on going down that whole road of fuses/disconnects/isolators etc
Once to repair the substation the second to fix it completely
I’m adding a fuse item yes
Fuses are important
well now adays circuit breakers
There will be a break you have to flip after fixing it
If you do it while it’s down a message will show “the power is still down maybe I can fix it”
I’ll have small boxes that will appear to fix
Maybe 2 per station?
if you talking like house supply side yeah 2 for 220/240 but the HV side you'd be 3
but gens only give basically 110/120 anyway generally for portables. so dunno on that front what the community would like
It’s just gonna be for specific towns
Honestly I’m more or less making this mod for myself
But I wanna post it and open source it so I can have community input and help
thats same reasons Im working on Superb, I use it and like it but dev team kinda poof'd from the public so I forked off what was avail.
You’re the reason why superb is still alive!
I should shake your hand
no no!
there no GH for Superb I can find only SSR (its predecesor) so I forked took the latest update Feb 5th? and updated my fork to that then started working on bugs from there 'unofficially'
pretty much all the code the same, there adds and dels but bunch of folders changed and stuff. havent talked to Ryuu or NolanRItchie so I got no clue what they doing at all.
as for that ? I plan on working on it I actually wanna try and get it MP working but Im not even gonna try and do anything new with it till I touch base with any of the devs.
okay laters work day.
See ya
Ah fuck…
I just realized that I use a MacBook not a windows machine for stuff
FUCK
The tools are only available for the fuck windows….
Huh.. apparently there's this for ZedScript...
distributionTable.PickUpTruckLightsSmashedRear = distributionTable.PickUpTruckLights;
distributionTable.PickUpTruckLightsSmashedFront = distributionTable.PickUpTruckLights;
distributionTable.PickUpTruckLightsSmashedLeft = distributionTable.PickUpTruckLights;
distributionTable.PickUpTruckLightsSmashedRight = distributionTable.PickUpTruckLights;
More to do..
odd
media/scripts/vehicles/vehicle_pickuptrucklights_smashed.txt
Wondering if that's an artifact and doesn't belong.
Yeah.. nothing's there for that so I'm ignoring it.
I don't recall seeing semicolons anywhere else as delimiters (or seeing it in the parsing code), so that's what I'd guess too
that is odd
[130:1] :: Ignoring unknown artifact: distributionTable.PickUpTruckLightsSmashedRear = distributionTable.PickUpTruckLights;
[131:1] :: Ignoring unknown artifact: distributionTable.PickUpTruckLightsSmashedFront = distributionTable.PickUpTruckLights;
[132:1] :: Ignoring unknown artifact: distributionTable.PickUpTruckLightsSmashedLeft = distributionTable.PickUpTruckLights;
[132:87] :: Ignoring unknown artifact: distributionTable.PickUpTruckLightsSmashedRight = distributionTable.PickUpTruckLights;
Yeah. It definitely looks like scaffolding or uncommented notes that may need commenting from TIS.
junk data. not sure what its doing there, its from the lua (i spotted and removed it a few days ago)
got the parser fully working validating all vehicles and templates a while ago. moved on to adding lua support, validating items in distribution tables
I can’t get it on Mac
Hey you’re a dev can I ask you a question
It’s quick I promise
technically, that is a question. but i'll let you ask another as well
Ok so electricity you probably seen where I’m working on a mod for this game to be able to restore the power how does electricity work is it a tile based or grid based invisible sorta thing that surrounds the map and uses power everywhere
Thank you.
entire map or tile based (after shutoff)
After shutoff
To be able to restore the power stations and have electricity in the one town
Like in Louisville
We now have two flavors of parsing ZedScript: Shallow & Deep.
=)
I'm currently adding support for sandbox-options.txt.
I just wanna know if it’s even possible to enable the electricity when it shuts off
And then also my other question
its possible but per tile. not ideal really
So you saying that it would be hard to make it so the sections of towns would have power again?
Or would it have to be like a massive coverage
hard is relative. i'm saying the current electric system wasnt designed for much other then handling electricity across the whole map, or in a localized area around a generator on a tile by tile basis
Got to remove an artifact in there but support is there.
I'm not seeing examples for boolean and string, just making sure you didn't miss those ones
I used another one provided by someone else.
but cant you then just fake a generator with radius 300 and be good. or would that tank performance or something ?
I'll test yours now.
Something I just remembered that's worth noting for the booleans: I believe any value that's "true" (case insensitive) is treated as true, everything else false
You have a strange format for it so it'll test my flexible tokenizer.
Already handled as such.
I'd hope it'd work the same despite the lack of newlines lol
So I’d have to make someway for it to be sorta like how a generator works and apply it to the tiles in that town and area
@frank elbow
Nice
I'm unfamiliar with that file, but yeah @balmy pagoda had mentioned that
That is the wrong person, whoops
I'm absolutely blind to scripts. I've never written one myself.
Do you know off the top of your head where an example would be?
If I find out what file and an example to parse I can gobble that up before grabbing some lunch and then working on IRL work stuff.
One thing to note is that my parser doesn't mutually exclude modules and options in files.
It'll mix them via options and modules arrays.
files without versions are inferred VERSION=1,
Better Lock picking, Literacy mod add new skills.
Is it somewhere on a Git repository?
The custom sandbox option parser will reject versionless sandbox-options.txt, but that'd be a linter or checker's job, I suppose
Which is EXACTLY what is going on here with my parser.
Well almost.
Version should be IMO something shared globally.
b42 will have a different schema for ZedScript so I'm worried about not having any sort of version flag or control over that.
This is up to TIS.
Do other scripts not have an equivalent syntax for specifying the version? I've also not written many scripts
I'll gently scream from the mountain-tops to add it and still be lovely.
No. There's zero version-control on other files.
Interesting and unfortunate
I see no github links
I'll add that strict-check for sandbox-options.txt. Thanks for letting me know.
So yes, this will be a linter as well as a parser as well as an API.
Examples of like-errors:
LexerError: [286:1] :: Illegal line in 'Base.CarLightsPolice.Part[GasTank]': install
It's not illegal, however at the time of this example, install wasn't a known object.
yep
I'm not too worried about this file. When someone comes to me to implement it I will.
Is it possible to have a 3D model follow the player? I was looking into using hidden equipment, but that gets the rotation following the player/bones which isn't quite what I'm looking for.
Really I want a particle system to follow the player, but I assume Zomboid lacks those as that would be weird without the upcoming z-buffer.
If equipment is the only way, I can make that work, but need to rethink the style I'm going for.
Just need some sort of visual I can turn on/off to visually tell the player they are in a contaminated building.
Maybe just a screenspace overlay would be fine
Not as cool though
Yeah, this is the issue. The name of my file is alphanumerically higher.
Yep, I figured out my issue
I add animal footprints to the forage system so that players can hunt. I made the footprints as food so that they would become unusable very soon after they were found. Can someone tell me what is the differences between item:getOffAge() and item:getOffAgeMax() so i can greatly reduce the item's freshness time.
anyone know of any assets for larger gates?
instead of being only 2 tiles for each side, having 3 or 4?
inb4 the current tileset doesnt really like when you try to manually make them larger (with the exception of garage doors)
My educated guess would be
item:getOffAge()
- the current age of the item
vs.
item:getOffAgeMax() - the maximum age of the item before spoilage
@pulsar heath I have completed my parser. You can now look at the full code.
Anyone know how to get a list of all the IsoPlayers on a server?
Ah, probably server:getConnectedPlayers
The global object has getOnlinePlayers() which was what I needed
My code is working, it was a logical issue. Poltergeist and Burryaga's comments helped me figure out why.
@ancient grail In the Mod Resources, I recommend renaming the "Lua Folder" post to "Lua load order" or something similar to better describe it 👍
it's thought to vary based on resolution and such
Hmm, hope its not null from the servers perspective
Good, the cell exists per player on the server
How bad is using the OnTick event, when my script only changes two variable?
if you need a specific file to be loaded from the same folder without worrying about file name order you can use this inside your lua file. For the server/a/file.lua (or client or shared)
require "a/file"`
this will load the file if it's not loaded.
somebody knows why my building tab disappeared
ahh
stone hammer and normal hammer is not the same rip
ok
you need carpentry,nails/screws and other tools like hammer i had like that too but you cant build anything and the devs though its useless to have build option if you cant build anything
That sounds bad and I don't even know what are those variables for.
Don't forget, the game runs on 10 ticks per second.
Do you really require to change those variables 10 times per second?
is there some idk channels for modders?
No, i dont need it to be updated every tick, but there is nothing between OnTick and Every10Minutes, which is way to long. The variables would be Infectiontime and infectionLevel
OnPlayerUpdate might be what i was looking for, not sure how often its called
well, there you go.
There seems to exist also Every10Minutes
https://pzwiki.net/wiki/Modding:Lua_Events/EveryTenMinutes
Another technique you can use, although I'm not sure how it works on Lua, is having a variable where you count ticks
And when that variable reaches X nr of ticks, than you calculate whatever you want
Thanks you so much!
EveryOneMinute is missing is this list https://pzwiki.net/wiki/Modding:Lua_Event
Oh wow i'm blind
Reason: Bad word usage
If i want to stop the infection to grow, would it be enough to stop the InfectionTime and InfectionLevel?
I think yes, but need test
I'm trying to understand the whole infection process but what is Fakeinfection for? Is it just the character thinking he is infected?
it's for when infection lethality is turned off
i think there was a trait that gave it before too
Hypochondriac?
You'd think you got infected sometimes from scratches even if you didn't
fakeinfection gives all the symptoms but when it reaches 100 it starts going back down
Anyone know how far away zombies stay loaded?
Ah thank you!
for tooltips
i know there's a way to do a newline
is it like.. <newline>..? i think?
also is there a way to have quotes in the text
like an escape char
or " or something
\n for newlines afaik
you should be able to use 'test "thing"'
or escape the characters
thanks will test some stuff.
afaik it's just a string read into java
u never know with this game, heh
one would think zedscript is just a lua table at first glance, but very much no
or json
i don't assume anymore
It's <LINE> for the rich text object with the name that escapes me (dunno if this applies to the tooltips, just seemed like what was meant by the "<newline>" thing)
ISRichTextPanel or something to that effect
yes this is frustrating..back when i did the drug mod. there was a function that i ran that will make the whole rromm toxic while crafting the meth.. but then if theres like a lobby or some sort of a division but not walls (usually noticeable when the floors are different.. ) it doesnt get the toxic part so its kind of weird seeing it like that
not sure if radius or room is better lol
custom player structures would make room hard to use unless it picks that up
afaik it does not, seeing as other things don't
Yea I've moved to averaging the air around the rooms
Superb-Survivors is even worse than I thought, who uses a global var myDialogueWindow...
Still need to add some weighting by position, but it works well enough
Perl enjoyers would see this and scream in terror
If you see something off keep on dropping the bombs about it and why I will be glad to attempt to elim it
if anything not being the coder and trying to rev/undo bugs/problems this the easiest way for me to learn what not to do
if anything insight why they prefix #'d almost all the folders cuz it just irks me every time I see it
What would be the best way to add a custom sound to a food item?
I was going to say you can do things like this, so that your functions are called only after you make the UI
function QuestManagerInit(newplayerID)
--...
Events.OnKeyPressed.Add(QuestManagerKeyDownHandle)
Events.OnRenderTick.Add(QuestManagerOnRenderTickUpdate)
end
This way the functions would be called after the UI has been made if it followed the usual logic.
Then I noticed the absence of locals and modules
my mod's recipe doesnt show up in the "B" menu why is it? i dont have any "NeedToBeLearn:true" this option.
on hosting server with my pc is okay, but on dedicated server, it doesnt show
i just tested on the hosting server. with my pc. and it shows. but on dedicated server it doesnt show
Omg 1800 items thats gona lag
You already imported base no need tk use it on the recipe
Just say money
can modules have spaces in them?
what might be the problem? of not showing up in dedicateed server?
You can remove the =1 on the trolleycontainer
And i dont think you need to add ( , )
Comma after the money
Iirc
Check out vanilla script to be sure
Also what albion said
no you need comma
No space on your module
Ah ok . Ive mistaken. The :
Thats what you dont need and you didnt add it so all good
i will change the module part and try it on dedicated server
@fast galleon hi bud you know if its possible to control distribution using sandbox? Or perhaps the order of things wont allow this?
They fix this in v42 🙂
||ItemPickerJava.Parse() , is what some mods use||
is there a simple change that will allow the boombox from True Music to attach onto a particular belt slot or Noir's attachments attachment? It seems all i'd have to do is give it a particular trait
Thank you thats what i thought too jist needed to double check. So instead of sandbox i can perhaps use a button ui that will just remove or add from distrib table but can this work without restarting server?
Ow theres a spoiler thing i didnt notice . Ok ill figure out how i can use this
Thanks alot
🙏
Not realy sure if it will function as media device tho .. then again walkies are attachable and they function so i guess it might work
If i can put it on my hotbar that'd be enough
If i can get music to play from a boombox hanging on my backpack? well that's just gravy
nothing beats attracting every zombie in town to we will rock you
You can doparam and make it attacheable
how would i do that?
What am I doing wrong here?
local tobacco_recipes = {
"Hydrocraft.Open Cigarette Carton",
"Hydrocraft.Open Cigarette Pack",
"Hydrocraft.Pack Cigarettes",
"Hydrocraft.Pack Into Carton",
"Hydrocraft.Dry Leaves",
"Hydrocraft.Grind Tobacco",
"Hydrocraft.Roll Cigar",
"Hydrocraft.Put Tobacco in Pipe",
}
for k,v in pairs (tobacco_recipes) do
local recipe = getScriptManager():getRecipe(v)
recipe:setIsHidden(true)
end
I'm trying to disable recipes whose names are listed in the table tobacco_recipes
verify setIsHidden because that name is just wrong in what its saying its doing
Is would be a ? ie logic response and set is changing the logic so kinda doesnt seem right.
There's boolean isHidden() and then there's void setIsHidden(boolean hide)
Am I just reading it wrong?
It's not even working 😦
yeah it just doesnt seem right if thats a valid func I mean its trying to set and ask a bool kinda throws me.
Are my recipe names at least on point? Hydrocraft.Open Cigarette Carton and others are actually several duplicate recipes
Just didn't know if getScriptManager():getRecipe(v) is even able to "get" what I'm trying to find
I dunno on that front. if ya worried about that just test it on something known to be valid
your func could be the right one I dunno I'm IG atm but honestly if I seen that func named like that first thing I'd be doing is refactoring..
It's vanilla
Javadoc Project Zomboid Modding API declaration: package: zombie.scripting.objects, class: Recipe
I understood that, and why I said that too :) its just like why would ya combine a set bool and bool return together as a name.
yeah not your fault... thats not on you. why I said verify its correct
Is there any chance to get a players steam play time for pz?
What is the item code for the treadmill?
Good evening.
hi
wdym item code?
like if i wanted to additem treadmill
@jaunty marten Hey. I finished the parser code for ZedScript. I am however having a blast doing a CLI.. >__>
hmmm, tbh I even don't remember name of treadmill to find reference, single thing that I remember is treadmill have different name than treadmill, there really strange name for it

fully?
From ZedScript to JSON yes.
40ish hours.
I did a code cleaning phase this morning. The code is definitely readable.
sandbox-options.txt is also supported. ;D
its like Human Hamster Wheel
https://github.com/asledgehammer/ZedScriptParser Here you go.
hello fellows, I bring a question
I am practicing with sendclientcommand function
to execute a funtion to a server
function CAP_pressed(KEY)
if KEY == 58 then
local player = getPlayer();
healthUpdate.bodyDmg = player:getBodyDamage();
X = getPlayer():getX();
Y = getPlayer():getY();
Z = getPlayer():getZ();
chunk1 = player:getChunk();
addZombieSitting(getPlayer():getX(),getPlayer():getY(),getPlayer():getZ())
sendClientCommand(player,module,printcode,args)
print("sent")
end
end
Events.OnKeyPressed.Add(CAP_pressed);
so I sent a client command with "printcode" command string
and on the same LUA file i also have following code
function TESTCOMMAND(player, module, command, args)
print("recieved")
if command == printcode then
print ("hi")
end
end
Events.OnClientCommand.Add(TESTCOMMAND)
and... in theory the string "Recieved" and "hi" should b seen in the game
but neither of them appear
although "sent" string is showing up so i know sendclientcommand was executed
could anyone enlighten me with why the command is not being relieved?
No i haven't ran this in single player, i have hosted new server game
I dont know much but can you change function TESTCOMMAND(player, module, command, args) to function TESTCOMMAND(module, command, player, args) and test it
hmm last time i tried to change the parameter orders it showed up an error
but i guess i can try again?
but would that make any difference? since they are just parameters.. but im not an expert haha
change only the TESTCOMMAND function
ok ill try it
oh also i think you need a separate lua in server folder
yes?
so they need to be in a separate .lua?
thought they are just to keep in organized
Yes i think you need to separate this part to server folder
function TESTCOMMAND(player, module, command, args)
print("recieved")
if command == printcode then
print ("hi")
end
end
Events.OnClientCommand.Add(TESTCOMMAND)
and dont forget to change the order to this
TESTCOMMAND(module, command, player, args)
This is from my wip mod and its working
local function OnClientCommand(module, command, player, args)
--print(module)
--print(command)
if module ~= 'MadhousePayment' then
return
end
if command == 'AddExp' then
SendExpToNearestPlayers(player, args[1])
end
if command == 'ReligionCom' then
--
SendReligionCommandToPlayer(player, args[1])
end
if command == 'AddDamage' then
SendDamageToPlayer(player, args[1])
end
end
Events.OnClientCommand.Add(OnClientCommand)
oki ill try it ty
they are in different folders
"sent" is seen in the console
but recieved nor hi shows up...
no error messege
However if I change the parameter to this, it shows up error
sendClientCommand(module,player,printcode,args)
So my mod is still not working. Subscribing to it in the workshop doesnt add my mod to the mod menu. It also doesn't show up if i put the mod folder inside a different workshop mod. Could this be a folder structure error or mod.info error?
Right order is here https://pzwiki.net/wiki/Modding:Lua_Events/OnClientCommand
and send command is like this
when you try uploading your mod to the workshop, does it produce any errors?
No
if it didnt' and was successfully uploaded
then try opening up the debug log
and see if there's any error and the LUA isn't running due to code crash
still .. only showing Sent string.. .sigh..
sendClientCommand(player,module,printcode,args)
function TESTCOMMAND(module, command, player, args)
On dedicated server?
and if you see on lua loaded list, ur mod lua showing up?
where is that
Then you need check file coop-console.txt in zomboid folder
server will print in this file
because printcode is nil
Yep. Printcode is not initialised variable
I think maybe i got it working by changing the mod id
Ah... since it's a string, ill have to "printcode"
Did you set ur item name





