#mod_development
1 messages ยท Page 96 of 1
ok i see
Apologies for the confusion regarding onFill - I forgot I change/mess with two different events for namedLit ๐
I conflated the two
renderdetails was the other one - which as you can guess is done on render
Reminds me - I wish there was more flexibility in that function - I had to overwrite the whole thing to allow for books to stack by type rather than name
unfortunately alot of variation items are different types but share names
creates a weird situation where some items benefit from stacking with name and some with type
VHS would be something that could look nicer with type stacking for example
community patch could use some hooks in there
i had to do some weird stuff to overwrite item names instead of just doing it the way tis does since i didn't want to override the function
yeah I tried to go in after and make changes after the fact but it wasn't panning out
yeah, problem is that function does a lot of stuff and the only way to 'avoid' overwriting it is to just copy most of the function anyway, which sort of misses the point of avoiding overwriting things
patching getname turned out to be pretty elegant for my uses but i don't even remember what weird solution i had to use for splitscreen
Another option I see for this is to set the item script as obsolete then it will not be added as a possible item, and should print warning in debug only.
That would be simpler to remove items but it's risky to set obsolete:false after as other mods might complicate things.
you have to require the filename
and to avoid pointless 'require failed' warnings you'll have to identify the modID as active first
I do this for namedLit for this exact issue
local crossRefMods = {
["CatsWalkWhileReadMod"]="ReadFasterWhenSitting",
["CatsReadMod"]="ReadFasterWhenSitting",
["CatsReadMod(slower)"]="ReadFasterWhenSitting",
["SnakeUtilsPack"]="tooltip",
["Worse Searching"]="ISUI/Worse_PASearch_RefreshContainer_ISInventoryPage",
}
local activeMods = {}
local activeModIDs = getActivatedMods()
for i=1, activeModIDs:size() do
local modID = activeModIDs:get(i-1)
if crossRefMods[modID] and not activeMods[modID] then
require (crossRefMods[modID])
activeMods[modID] = true
end
end
that's just bad since you'd need to check every workshop mod
Oh he's trying to remove magazines
mods really need a load priority system :\
if not a setting modders can set like 'priority=6' in modInfo allow people to reorder loading manually
which servers can do - and which also causes issue
what annoys me most with the version issues is steam clearly has a version control system yet does not make use of it
they barely make update requests
Sorry to anyone using the community patch - I rebranded it a bit and changed the modIDs ๐
yeah I unsub thank you very much ๐
I will fork it instead.
Only 4 subs and its unlisted - thought now would be the best time
better to smooth everything out while that's still an option
also noticing an issue with my upload action - doesn't catch the workshop content stuff
very strange
Update part 2, since I'm a giant dum dum:
that was not the issue, but how I was messing with the order of body locations
even if it seemed to work, some stuff just breaks
already on workshop?
unlisted for anyone interested in using the debug tools
I set up the upload action to go off every Friday 11:59 (so bugs can be worked on over weekends ๐ )
as well as setting up a hotfix branch that will force uploads too
having some issues with that though as PRs from dev to main to hotfix causes main to want another PR back
Hello, how do i access class in the lua code? I want to access zoom value of PlayerCamera https://projectzomboid.com/modding/zombie/iso/PlayerCamera.html
declaration: package: zombie.iso, class: PlayerCamera
getPlayerCamera doesnt work
so what i can do? Create new one? but i want to access object of playercamera that is clearly used in game already!
IsoCamera is exposed
Lua interacts with core for zoom levels
playercamera object is not exposed to lua, it must only be used by the java
where the hell is the "move to floor" option?
it's apparently being used to dupe stuff
LuaManager class
there are a couple things that are partially exposed within their own class, no easy way to find those unfortunately
https://github.com/FWolfe/Zomboid-Modding-Guide
has a good introduction to PZ
local container = item:getContainer()
if container then
container:DoRemoveItem(item)
end
If you're not using this do so - it covers dead bodies and floors
container:remove(item) doesn't handle those other cases
Update schedules are not a solution when you're talking 400-500 mods by different modders; not like all the modders are going to agree to update all of their mods at the same time every week. I think a soft update flag is a more realistic solution than this, but if there simply are no realistic solutions and server owners just need to "deal with it", it is what it is
i see that the player:getX() gives a precise float coordinates, but didn't PZ operate on grid based system? I can'
no i mean the are duping the whole ass item.
i cant spawn object that can fly through float coordinates, but by int grid system right?
and i can't find the commands they are using.
This seems like a good alternative
i'm confused what a 'soft update' flag really means, though? the server can't checksum for a version of a mod it doesn't have
If we could sign up to push on scheduled update time or something, that would be more realistic
Hey guys, as far as I've seen, to make just 1 car model have different skins and that they randomly with one of them, you should do this.
skin
{
texture = Vehicles/skin1,
}
skin
{
texture = Vehicles/skin2,
}
But this doesnt work, it only spawns cars with the first skin. Not with the second one.
I should also say that I'm trying to do this with a vanilla car. Do vanilla cars not support two skins?
If you could help me I would appreciate it!
Thank you in advance!
yea, that's true. I mostly just meant less sparadic updates overall. Like sometimes a mod auther might post several updates in a week
Basically, if the server is running a mod, and it detects that someone tries to join with a "soft updated" version of the same mod, it would not do a checksum
sweats
please consider for a second why we have checksums
because when there is a Lua mismatch in the way clients talk to each other it causes issues
and because lua can intentionally be mismatched to create cheats
But clientside code does not have to be equivalent to run safely.
yes true
Obv it would open a new avenue for exploiters
any server with a single 'soft update' mod would be completely open to clientside cheats
But they are always going to find a way... hence the need for password protected servers
Cheaters gonna cheat
on steam's end they could just use the version control system they literally already have
They could also make it so failed checksums downloaded a temp version from the host - but this would be more work for the devs for an issue that isn't that big of a deal tbh
as far as i know the api doesn't let you access the older versions so it's not something tis can help with
enable download from a host is dangerous
honestly making unlisted mod packs is probably the best answer. I'm not quite sure have the workshop handles unlisted mods but so long as users aren't openly posting other peoples mods to the public making a modpack so you don't have to worry about updates and even make small changes for your server should be ok imo.
one can set up a malicious server
one could follow the question of responsibility from modders to not update so often to hosts not having restart tools to players not really being willing to test stuff in the first place for beta branches - it's all extra work for anyone for mods
that'd be kind of another issue
Fair enough. I definitely see the cause for concern, but perhaps I underestimate it. It seems to me like there are already problems with cheaters and such, i.e., cheating can't be entirely prevented in the presence of cool mods, so other than stopping cheaters from joining with good password protection, idk what can be done about that.
I really wish you could checksum/download off those restorable versions
but a mod itself could be malicious to begin with ๐คทโโ๏ธ
it seems like the simplest solution, all the infrastructure is there
This is kind of my point
Since modders are already inherently capable of changing their mods maliciously...
I don't understand how allowing a modder to push a specially unchecked update would allow that much greater malice to be practiced.
Also I feel like cheaters and people who upload popular mods to the workshop are not identical? Sure, people could be fooled into downloading a couple bad mods from one troll, but that seems already possible to the a similar minor degree.
this wasn't my concern
the issue is if TIS steps in and makes a change it becomes their liability
if there's no checksum i can just swap the files with whatever i want
right now Steam would be on the hook and have to deal with a modder doing shady shit
Which they deal with to my knowledge
Yes, but I don't think TIS would want that on their plate just to placate mod mismatching
I was thinking the checksum would compare current Steam version to client Steam version, rather than comparing client version to server version.
yeah that's fine, we really can't stop mods themselves from being malicious
I'm not saying 0 checking of the mod, but a softened check for mods that flag themselves as soft-updating.
I don't know, somebody here was adding a script to make himself invincible and instakill players
But, yeah, my brain is pretty mediocre, so if it's a stupid idea, no offense taken, haha, I was just trying to think of realistic ways to address the problem (obviously I am aware of the viability of the "oh well" strategy)
there's definitely a limit to how useful that could be, but there are times it would make sense
I said popular mods
How many people are really gonna run a workshop mod that lets someone autokill them?
Invincibly?
especially stuff like burryaga's ui mods, no harm can really come from users using different versions, so long as we can confirm it is a real version of the mod
@thick karma
well he wouldn't advertise that part probably?
It's somebody you help regularly.
If I'm not mistaken Barotrauma checksums the workshop content the server says it has with the player's and downloads off the host if it doesn't match
and there are 10000 examples of updates like that
Is that a mod for keeping servers updated?
Or is that just part of that mod?
Barotrauma is another game entirely
that's correct
They also have an interesting modding license/EULA
i've started modding that recently
the game is source available which is quite refreshing
yeah, source is "open" strictly for its own betterment or for making mods - any distribution or forking is strictly prohibited
basically if you find a bug and know how to fix it you can make the direct suggestion
discuss it was a dev, etc
not to mention changes to features for QoL
Well, I g2g but I just felt inclined to float that at someone official to see what they would say. If the official policy is "mod community's problem," that is fair enough. It just seemed like an issue that could be alleviated pretty easily to me, but I may not see all the consequences properly.
It's been brought up (at least by me personally), my impression from replies was the cost benefit is just not there
hours of work to maybe sort of alleviate 1 problem while also creating a few more
can't speak to their intentions or future plans though
so why this doesn't work? i use local cam = IsoCamera.cameras to get PlayerCamera array, and then try to print(cam[1]) and it doesnt work, while print(cam) works, but i can't access fields of the camera, when i try to print cam.zoom it shows error, when i try cam.getTOffX() also show error, try : instead of dot and also error. Is there any way to get camera zoom factor through lua code or its impossible?
you usually can't access fields
so if theres no getter then how?
not really sure what the pattern is for whether you can or not, but usually only the getter works, and if there isn't one you're out of luck
do you want to add new zoom levels? i'd heard this was only possible through java modding
i have a problem with advanced trajectory mod
the crosshair has different size depending on zoom level
i wanted to change that so its equal
ive already modified it to be affected by range and moodlets
this one stuff irks me and i cant get it fixed
the easiest would be to scale it by zoom factor of camera
so its equal
maybe there are somewhere known values for zoom?
like constants, that would do too
i would just do a curve between min and max
you could grab them from the java
i don't think you'd be able to do much with that cameras field anyway, it's an array of playercameras and they're not exposed
ahhh, grabbing from java is probably hard, like decompiling code or what? i will read the guide
im the meantime
yeah pretty much
nah im not gonna make my own jar files and attach hook to the game
way over my level
you don't need to do that, i just don't think you'll be able to find the constants anywhere else - they shouldn't change or anything really so you don't need to live get them
i would need to find another way to know at what zoom level im, viewport resolution of x and y doesnt change after all
maybe fov?
oh, try getCore():getZoom(playerIndex), where playerIndex is 0-3 (splitscreen player number, 0 usually)
it returns a float so it might be the scaling factor
it works
i get 0.5 for highest zoom and 2.0 for lowest
wonder why i couldnt use player:getPlayerIndex() where player = getPlayer() but i had to use IsoPlayer:getPlayerIndex()
getPlayerIndex() is a static method, not really sure what it returns, getPlayerNum() is the instance method
is there a way to spawn moving physical projectile in PZ, other than spawning object on a grid, remove it, spawn it in x+1 or y+1 grid, remove it, add collision detector, and thats basically all until we have gun overhaul mechanics from devs? This is very limiting, and it shows in Advanced trajectory mod, game has float coordinates, but grid system basically prevents free aiming, you just need to aim on the grid, not necessarily on the target correctly
its a really cool mod, but game limitation prevent further improvement
If you want to get into that you can look up things that extend IsoMovingObject, like cars, players, thrown weapons.
so its possible to have collision detection not based on grid but coordinates? maybe ive misunderstood the mod inner working
but then how to spawn sprite on coordinates and not on grid?
sprite or object
I have very little experience with that, IsoMolotov extends IsoPhysicsObject
you can make collision, but what its good for if the bullet is misaligned on the screen
i will have to tinker with it
can sprite contain moddata
if it is an isoObject sure, but I don't believe it would be an object that gets saved
hmm.. idk why but i just found out from someone that my safecracker mod 's moddata isnt perssitent.. the owner isnt stored so it automatically gets disowned
sprites don't sound like a save-safe object
store the owner? an IsoPlayer?
Oh, I forgot to ask - how do you like the changes? (assuming you've used AUD before)
I haven't used it much.
I didn't even look at the debug part.
Ah - that's all there is atm - apologies if it kept updating prior, I was testing out the upload action
It was expected
Unrelated, anyone know of something that I can dump a list of words into to get synonyms en masse - can't google this as it just gives me synonyms to 'en masse' . _ .
LOL
it's google hell
I wanted to jam namedLit titles into something to see if it makes the titles humorously sound like knockoffs
moby dick is going to cause problems ๐
LOL
hi, i got a question. i played around with the game files but now that i want the go back to default. i forgot the original values, anyways i can reset them or find the values online?
you can verify the integrity of your game files through steam
it'll redownload any changed files
i don't understand...
how do i do thta
that
there's some results for a python library
paraphrasing sites?
morbing whale
thesaurus
can't google that either tho
0 results for Moby dick
did you mean: medic
I'll just have to offer a penny per title pun
why cant you google it? its a website
I want a mass dump of words
searching thesaurus/synonym gives me the actual synonyms for 'en masse' or ' alot of words'
Is there an easy way to forget your safehouse if you can't find it because it was some random house you found during mod testing?
do you have your waranty card?
kidding
it fixed it i think
hey posting those examples helped me figured out where i went wrong with replacing Read in the context menu, thank you and thank you to everyone who helped you and myself* also
now i got it to use random options for context as well
just trying to figure out why the third option comes up blank. but so far i got so it doesn't choose the same option twice when you right click the item
Show your code
nmp
local previousPhrase = ""
local bookItem = ScriptManager.instance:getItem("Base.Lightswitches_fordummies")
local function readOrNot(player_num, context)
if not bookItem then return end
local player = getSpecificPlayer(player_num)
local bookLevel = SandboxVars.Nipswitch.Booklevel
local zapLevel = player:getPerkLevel(Perks.Electricity)
local lowLevel = zapLevel <= bookLevel
local contextRead = context:getOptionFromName(getText("ContextMenu_Read"))
local dumbText = getText("ContextMenu_Three")
local smartText = getText("ContextMenu_Four")
local toolTip = contextRead.toolTip or ISInventoryPaneContextMenu.addToolTip()
if bookItem and contextRead and lowLevel then
toolTip.description = dumbText
local rand = ZombRand(1, 3) -- generate a random number between 1 and 3
local newPhrase = ""
while newPhrase == previousPhrase do -- continue generating new phrase until it's different from previous
if rand == 1 then
newPhrase = "You go cross-eyed trying to read..."
elseif rand == 2 then
newPhrase = "I should tinker with some electronics"
elseif rand == 3 then
newPhrase = "Your brain hurts trying to read"
end
rand = ZombRand(1, 3)
end
previousPhrase = newPhrase
local contextRead = context:insertOptionAfter("Read", newPhrase)
contextRead.toolTip = toolTip
contextRead.notAvailable = true
context:removeOptionByName(getText("ContextMenu_Read"))
else
if bookItem and contextRead and not lowLevel then
toolTip.description = smartText
local contextRead = context:insertOptionAfter("Read", "Read, you Smartypants!")
contextRead.toolTip = toolTip
contextRead.notAvailable = false
context:removeOptionByName(getText("ContextMenu_Read"))
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(readOrNot)
the third option appears only blank
Your zombrand is wrong btw
it's working kinda?
Its going to be 1-2 only
You need to plus1
local function addOrGroupContextOption(context, name, ...)
local subMenu
local identifier = "M' "..name
for i,option in ipairs(context.options) do
if option.name == name then
if not option.subOption then
local newOption = context:allocOption(name)
newOption.id = option.id
context.options[i] = newOption
subMenu = context:getNew(context)
context:addSubMenu(newOption,subMenu)
option.id = 1
subMenu.options[1] = option
subMenu.numOptions = 2
else
subMenu = context:getSubMenu(option.subOption)
end
break
end
end
if subMenu then
subMenu:addOption(identifier,...)
else
context:addOption(identifier,...)
end
end
local function addOrReplaceContextOption(context, name,...)
local identifier = "M' "..name
for i,option in ipairs(context.options) do
if option.name == name then
table.insert(context.optionPool, option)
local newOption = context:allocOption(identifier,...)
newOption.id = option.id
context.options[i] = newOption
return newOption
end
end
return context:addOption(identifier,...)
end
Cuz by default zombrand starts at 0
So even if you declared 1 as starting point the max is still doing a minus 1
So we just add 1 to the max or in your case that you specified the integer you can just say 4 which means 3
Hehee funny aint it
can i just change it to 0 then?
atm it's working exactly how it should except blank for third
every right click is a new option
and never the same twice
ahh
ty
ill show a little test after lol just for fun
i love overcomplicating simple stuff ๐
they want three values, so ZombRand(3) is better
either shift your values to start from zero or do ZombRand(3)+1
You dont need tk use the while loop
Like blair said it will run the code once
So whenever you open it will change
But if you open twice the second time wont change it cuz uve already spawn the item
Can we combine the spawn location into one? Or is it necessary to keep it this way?
`table.insert(ProceduralDistributions.list["WardrobeMan"].items, "myshirt");
table.insert(ProceduralDistributions.list["WardrobeMan"].items, 0.1);
table.insert(ProceduralDistributions.list["WardrobeWoman"].items, "myshirt");
table.insert(ProceduralDistributions.list["WardrobeWoman"].items, 0.1);`
i have a feeling making the recipe item count is going to be tricky via sandboxvar
i havent seen a single example of it yet or im blind
do you mean merging the entire lists together, or are you asking if you can just add to one list to add to both?
if it's the latter, no :(
the latter ๐ฅฒ
No dice
i did mine this way if it helps
require "Items/ProceduralDistributions"
local function nipswitchBook()
local list = ProceduralDistributions.list
local targets = { BedroomSideTable = .000000001, BookstoreStationery = .00000001, LibraryCounter = .00000001,
OfficeDeskHome = .00000001 , LivingRoomShelf = .000000001}
local item = "Base.Lightswitches_fordummies"
for k,v in pairs(targets) do
local items = list[k].items
table.insert(items, item)
table.insert(items, v)
table.insert(items, "Base.Lightswitches_fordummies")
table.insert(items, SandboxVars.Nipswitch.Bookchanceplace * 0.0000001)
end
targets = {inventoryfemale = 0.000000001, inventorymale = 0.000000001}
for k,v in pairs(targets) do
table.insert(Distributions[1].all[k].items, item)
table.insert(Distributions[1].all[k].items, v)
table.insert(Distributions[1].all[k].items, "Base.Lightswitches_fordummies")
table.insert(Distributions[1].all[k].items, SandboxVars.Nipswitch.Bookchancezombie * 0.0000001)
end
ItemPickerJava.Parse()
end
Events.OnInitGlobalModData.Add(nipswitchBook)
this works exactly as intended (thanks to albion)
What the f is the .0000001 lol the imposible to get books mod
Also why mention that alot instead of using a var
It looks like its prone to human error via typo or accidental copy paste mistake
this is sandbox option
no it spawns
i tested with vanilla
if you set integer in sandboxvar to 1 its VERY rare
if you set to 500 its 65%
depending on which container
and also second section is if you want to spawn on zombies ofc
i also tested like 4 different variations of ways to do this and this was the cleanest and worked exactly how I'd* hope for distro lol
sandbox is too complicated for me as for now ๐
Ah the vanilla sandbox?
what you mean
Any Item/Weapon modder up to do a couple commissions? DM me and ill give all the details and money talk
So Iโm
Anyone know how to make character models for project zomboid
Soo
No
Fuuuuuck
authentic peach has done this, and some others have done it by making full body outfits of diff models
the dog mod does it
Created a small QOL mod for quickly moving laundry. Some lazy searches on the workshop didn't turn up anything that did something similar so I made one for a lark.
https://steamcommunity.com/sharedfiles/filedetails/?id=2925034918
funny how I just watched a streamer struggle with this
hi, I'm trying to store information on zombie trough the mod data but I keep loosing the data. I've recreated the issue in a very simple scenario:
On the server side I generate a random number for every zombie:
Events.OnZombieUpdate.Add(function (zed) if not zed:getModData().testNum then zed:getModData().testNum = ZombRand(1000) end end)
on the client side I print it above the zombie head:
Events.OnZombieUpdate.Add(function (zed) zed:addLineChatElement(tostring(zed:getModData().testNum), 1, 0, 0) end)
why:
- the number changes every time I move away from the zombie?
- different users on a dedicated multiplayer server see different numbers over the same zombie?
First problem is that ZombRand(1000) will return different numbers on each computer
but that runs on the server
Ah, my bad
and it should store it in the ModData
I don't know about networking mod data actually, I'll leave this for someone else to answer
And take notes since Imma need to network moddata soon
this "the number changes every time I move away from the zombie?" happens also in SP
Made addXp grab the selected skill similar to level up and level down
not sure if I should instance lock that pop up though
lmao
I don't want to spend too much time polishing the vanilla debug tools
but the drop down menu for adding xp bugged me in testing
I have another idea about your issue
I think the client runs server code, I've seen lots of places in vanilla lua code where it checks if its the server or client
if isServer() or isClient() then
maybe try adding those checks as needed
even if that's the case it should still work in SP
Are you going far enough from the zombie that the area might be unloaded? When you go back to an area it technically isn't the same zombie as before
pretty sure its 150-175
it's possible I'm pretty bad at estimating distances
I'm testing if zombies can even store persistent mod data now
Zombies unloaded in that case, trying to add persistent data is pointless because of things like that
uhm, but shouldn't the clients all have the same moddata?
if the moddata is created by the server
My trick for zombies is to usually attach a token item
it runs on client
Ye, no persistent mod data in my test scenario
but it has the same issue with loading/unloading areas. As soon as the zombie is gone it was all pointless
client runs client and server folders
only in SP
das funny
ok, but assuming that one client always stays close to the zombie, why all the clients are still seeing different values?
As it turns out player zombies save modData
or atleast retain it
let me test unloading chunks
ัะฑะตะน ะผะตะฝั 
yes, those are marked as survivor zombies, they are saved differently
Zombies aren't even maintaining their ID between unloads for me
I teleported across the map and teleported back
So if you want your zombies to save modData just flag them as dead players
testing reloading the game
seems to save
I should do it for every zombie. Probably it will bee to much load on the server
depends what you want this modData for - you're probably overthinking needing it on every zombie
Because it doesnt actually save which zombies are in an area, just how many and their outfits
I'm changing the stats of every zombie to randomize them
ah
also I'm introducing some new types of zombies
There is a mod for that already..... and it went great lengths to save zombie "ids"
yes, I was wondering why they were doing all that work ๐
Because the game isn't made to keep track of every single individual zombie? It is unnecessary
Outfits or token wouldnt really work for randomized stats would it?
I use outfits for special zombie stats/AI
if all zombies of a certain outfit are special in the same way it works, I use it for mine too
But randomized stats would require persistent bReanimatedPlayer=true modData
I wonder how busted it'd be to apply that too every zombie
I would have still expected that the moddata would have been the same for every client. But I guess that also get lost even without unloading the zombie
yes, maybe I could use the outfit
you can avoid the unloading modData with what I mentioned
undeadPlayers retain their modData
uhhh, there might be complications. For example loot is only created on death, but not for a player zombie
ah
so if I had to guess, zombies marked like that would spawn nothing beyond their clothes
maybe I could use the outfit as a random seed to generate the stats
would highly depend on the timing of the event
the outfit stores everything? The specific clothes, their color? Or is just the outfit name?
OnZombieDead is fired before the body is placed - should work
just the outfit
One would have to have an additional flag for actual player zombies though
and I think attached items? I don't remember
attached are their own definitions pointing to the same outfitID
yes, but I think the game saves that. So if you go back to an area a zombie with the same outfit would have an attached item just like before
I might refactoring my AI to use breanimatedPlayer
kind of hate the outfitID attached weapon token method
so maybe a fake item would do. But it feels very hacky
@high citrus would you consider 'setReanimatedPlayer' ?
Seems like you'd be able to use your old code if you have any
reanimated players gets special treatment that might cause additional load on the system
thanks to all for the help. I'll check the various options ๐
@sour island
any thoughts?
that's actually what I was going to attempt / suggest
could get around people not using APIs by hijacking the methodcall
as long as it's done with a non-user in mind
I should note that setting zombies as reanimated survivors to store mod Data should be used sparingly because there are thousands upon thousands of zombies in the game, and if you spam making zombies survivor zombies to store mod data you may end up breaking a save/server.
Perhaps a boolean can be added for that purpose?
IsoZombie.bSaveModData ?
Actually, why don't zombies save modData ๐ค - was it a performance choice or just an oversight with trying to keep saves small?
from what i've seen of the code zombies just aren't really persistent
yes, but there is some information saved
items for example only save a handful of values AND moddata
of course, but it's definitely the bare minimum to stop players from noticing
There's a lot of fakery and recycling of existing zombie data with handling zombies, for optimization purposes, that I am absolutely incapable of explaining adequately, but zombies do not work the way people would assume in many ways.
And I'm sure if people started spamming persistent mod Data onto zombies there would be all sorts of undesired trickle down effects.
I would suggest using custom outfits or tokens to implement special zombies or mod zombies flags, as, AFAIK, they handle the tasks adequately, although I'm sure someone could break a save by spamming enough tokens.
this isn't a channel where you make an idea and it happens. its where you make the idea happen and get help
nope
that's the reality of expecting other people to do hard work for you for free?
well this the correct channel
dude my salary is less than 30 dollars
in my country
you problem not me problem bro.
just stop
you post this often also. its sad really
just understand that if you give a good idea there, you have to see if it will happen, but please don't expect. so much hard work from so many people. unrealistic of you
i have been asking for like 100 modders
now you wait
that's not how that works
and most of them said no
forever maybe
yeah i will be asking forever
don't keep asking over and over though.. at least not here
please ask once per version at least 42,43,...
beggar mentality 
true
actually quite rude when you consider what the purpose of this room is
where should i talk about mods?
You're probably going to just get more frustrated asking that way anywhere - you could have attempted your own idea by this time.
you can learn. i have very little experience and it's working okay for me!
when will anyone will make my idea?

People can't make the idea unless you share it
probably never? suggestions are fine and appreciated but you can't actually expect anyone to make a mod for you
yeah thats true
but i will be waiting until someone make it
my mod is an idea about making louisville an safezone
until day 8
because of the lore
i can't imagine why so many aren't jumping on it lol
[ Everyone disliked that. ]

noooo
well the reason i want that to happen is because of lore
this would be a really large scale mod
The chances to run into someone who shares your vision is very small, the fact that you can't really contribute makes that partnership chance even smaller.
and for all we know it could be b42 content anyway
nope it will be b43 content
probably
oh that's right
that's still very discouraging if someone did intend to start such a large project
If you want your mod to get made you're better off trying something (and showing buggy code here) rather than stomping your feet.
soo my solution to make it happen when an zombie reachs louisville it insta dies
Dude
How do u do that of its a solution
Your solution doesnt solve any problem
time to learn
Yes
Why do you shy away from learning
when everytine you advertise your idea and fish for partners
you always recieve the same comment anyways
We here to help but u have to do it.
if i replace the "Read" context menu, what is the best way for me to add that option to read back to the custom context menu? i have tried like 5 diff ways and none seem to be triggering it, or throw an error.... lol got all the way to the end of doing all that context menu stuff but forgot that it still actually has to read the book after
We will just provide you what you need to learn and figure out possible solutions. If you have gon and learn it when u started asking you by then have learned what you need to do for that mod you want us to build for you
do i have to rewrite the ISReadABook:start() didnt work since i changed the context menu lol. i'm not gonna have to rewrite it will i?
It doesnt take long to learn it. Meanwhile your solution is something you have to wait forever before it materialize .
you shouldn't need to rewrite it
Ahm eat book
Hehhehe
Konijima made a consumable book i guess the idea isnt farfetched . But why did u want to change it
well i'm about to scrap it and just leave it out at this point but i changed the context to say something else instead of read
but it stopped functioning since it's appearing to not be tied to anything now
looks good just does nothing
i wonder if you can change the name of the original option instead? never tried that
otherwise calling the same function as the original should be fine
What about turn into sheets of paper but then the scripts are said to ... Ooo nvm its possibl
actually doubt this works because of some code i've seen posted here
The quest is still the same why tho
the function itself checks for the context_read though is where it keeps erroring for me using it
at the time i need it, it's already removed it from the context
What did that code do
i may scrap it lol.... i really dont want to but so minimal
I thought could have finished the new teleporter mod im doing but i guess ill finish it tom
added options return themselves if you want to crack into the original function that adds it
you should also be able to pick the option out from the context menu
burryaga posted something that deleted an option and replaced it with a new one to fix a grammatical error
i would be surprised if he hadn't tried just renaming it before doing it that way, so i would assume that doesn't work
require "ISUI/ISWorldObjectContextMenu"
---@param waterObject IsoObject
local function isNaturalWaterRemoveOptions(waterObject, context)
if not waterObject or not context then return end
local isInventoryObject = instanceof(waterObject, "IsoWorldInventoryObject")
local bHasProperties = (waterObject:getProperties() ~= nil)
local bStringStartWater = luautils.stringStarts(waterObject:getSprite():getName(), 'blends_natural_02')
if not isInventoryObject and bHasProperties and bStringStartWater then
context:removeOptionByName(getText("ContextMenu_Drink"))
context:removeOptionByName(getText("ContextMenu_Fill"))
end
end
local original_ISWorldObjectContextMenu_doFillWaterMenu = ISWorldObjectContextMenu.doFillWaterMenu
function ISWorldObjectContextMenu.doFillWaterMenu(source, playerNum, context)
original_ISWorldObjectContextMenu_doFillWaterMenu(source, playerNum, context)
isNaturalWaterRemoveOptions(source, context)
end
local original_ISWorldObjectContextMenu_doDrinkWaterMenu = ISWorldObjectContextMenu.doDrinkWaterMenu
function ISWorldObjectContextMenu.doDrinkWaterMenu(source, playerNum, context)
original_ISWorldObjectContextMenu_doDrinkWaterMenu(source, playerNum, context)
isNaturalWaterRemoveOptions(source, context)
end
if you have the context menu in question you can manipulate the options
lemme show what i have atm since im passed this point
Wait most? So theres someone who said yes?
I'm noticing a lot of my textures are getting artifacts - what am I doin wrong . _ .
Nice
Ow ive tried to delete a corpse but it work
I even tried removeeverythingbutfloor function lol
And the timeactio. But no ๐ฒ
could you post the option code again?
yes
ill post entire. its going to my github for example share after anyways
-- This sets requirement for Electrical level from SandboxVars as well as randomized context menu replacement for "Read".
local function readOrNot(player_num, context)
if not bookItem then return end -- if book is not in inventory, exit function
local player = getSpecificPlayer(player_num) -- get player
local bookLevel = SandboxVars.Nipswitch.Booklevel -- Required Electrical level from SandboxVars
local zapLevel = player:getPerkLevel(Perks.Electricity) -- get player's Electrical level
local lowLevel = zapLevel <= (bookLevel - 1) -- set lowLevel to true if player's Electrical level is too low
local contextRead = context:getOptionFromName(getText("ContextMenu_Read")) -- get "Read" context menu option
local dumbText = getText("ContextMenu_Three") -- get text for dumb context menu option
local smartText = getText("ContextMenu_Four") -- get text for smart context menu option
local toolTip = contextRead.toolTip or ISInventoryPaneContextMenu.addToolTip() -- get tooltip for context menu option
local previousPhrase = "" -- set previous phrase to blank
if bookItem and contextRead and lowLevel then -- if book is in inventory and player's Electrical level is too low
toolTip.description = dumbText -- set tooltip to dumb text
local rand = ZombRand(1, 4) -- generate a random number between 1 and 3
local newPhrase = "" -- set new phrase to blank
while newPhrase == previousPhrase do -- continue generating new phrase until it's different from previous
if rand == 1 then
newPhrase = "You go cross-eyed trying to read..."
elseif rand == 2 then
newPhrase = "I should tinker with some electronics"
elseif rand == 3 then
newPhrase = "Your brain hurts trying to read"
end
rand = ZombRand(3) -- generate a new random number between 1 and 3
end
previousPhrase = newPhrase -- set previous phrase to new phrase
local contextRead6 = context:insertOptionAfter("Read", newPhrase) -- insert new phrase into context menu where "Read" was
contextRead6.toolTip = toolTip -- set tooltip for new phrase
contextRead6.notAvailable = true -- set new phrase to not available
context:removeOptionByName(getText("ContextMenu_Read")) -- remove "Read" from context menu
else
if bookItem and contextRead and not lowLevel then -- if book is in inventory and player's Electrical level is high enough
toolTip.description = smartText -- set tooltip to smart text
local contextRead5 = context:insertOptionAfter("Read", "Read, I am a Smarty Pants!") -- insert custom text into context menu where "Read" was
contextRead5.toolTip = toolTip -- set tooltip for "Read"
contextRead5.notAvailable = false -- set "Read" to available
context:removeOptionByName(getText("ContextMenu_Read")) -- remove "Read" from context menu
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(readOrNot) -- add readOrNot function to context menu on book right click
sorry I commented every line for teaching
oh, your new option doesn't call anything - let me pull up what you need
ty yea i wasn't sure how to use it to add back in after replacement
Did your sandbox function worked. Hou could try and add = sandboxvar.something or "somedefaultvalue"
it works. which one you mean?
i'm doing them for every single thing the mod offers
well almost
compression?
png and the icon size is the same afaik
Ow hi polt
I mean in-game option
yea if your compression or max texture size is smaller than texture could cause issues
im honestly just stoked to have a concept to blocking item use in some form, based on perk level
i am not a huge fan of being able to read a book that i wouldnt understand lolol
you need to add items as a parameter to your functionlua local function readOrNot(player_num, context, items) and then use ```lua
context:insertOptionAfter("Read", "Read, I am a Smarty Pants!", items, ISInventoryPaneContextMenu.onLiteratureItems, player_num)
ahhhh omg i was so close before thank you! oh instead of items can i just call the item local?
i forgot its at the top of my script
local bookItem = ScriptManager.instance:getItem("Base.Lightswitches_fordummies")
what's up
My inventory icons looked awful until i switched to this method
drawer:drawTextureScaledUniform(item:getTex(), x2, y2, minDimension * ICON_SCALE, alphaMult, r, g, b);
that's an item script, not the instance(s) of the item(s) in your inventory, which this function needs
I'll take a look at the code, thanks
so many other things make sense now lol... wowzers
if you ever want to change only the text of an option in context menu under specific conditions it should be safe to do.
is there a better way to replace it than removing and readding the way I did? since i lost the original function this way?
this is working perfect btw ty @bronze yoke
no reason now that's it's working
I was trying to think what would prevent that but nothing came to mind so far.
nice, looks good
fair enough. this will make its way to my github haha. i hope you all are okay that any of my code you help me with goes into a public github so others can learn from examples
i plan to pretty much release it all the same way and explain what everything does
after i finish this mod i'll put it all up
Anyone know where the FileWriter saves to?
which one
The one you get in lua by calling getFileWriter(filename)
that seems to be the one goes to Lua folder in Zomboid
@dull moss I thought people would get errors when they enable both mods, turns out they get errors because game auto enabled the second mod for them 
The just a combo of the item category and weight.
Lots of items need more accurate size, hence the manual sizing i'm going to be doing for lots of them
u mean it will be hardcoded? not some calc by formula
A mix
Most items work fine with formula, but some I'd rather just specify their size
And mod items will need the formula obviously
will by painful to resize backpacks and etc when it changes weight by adding items into them

Backpacks will have a set size
oh
They will be the same size inside/out
so empty backpack and full one will have same cell size?
Might add an ability to fold them though
Thats the plan for now, you technically lose no space since you can just put the items inside
Also equipped items will not take an inventory space when im done
yea
fine 

Friend getting these... anyone know what the heck these imply?
LOG : Lua , 1674956145909> Loading: media/lua/client/XpSystem/ISUI/ISSkillProgressBar.lua
LOG : General , 1674956145912> OnLoadSoundbanks
LOG : General , 1674956145913> texturepack: loading Tiles2x
LOG : General , 1674956145959> texturepack: loading Overlays2x
LOG : General , 1674956146140> texturepack: loading JumboTrees2x
LOG : General , 1674956146447> texturepack: loading Tiles2x.floor
LOG : General , 1674956146451> LOADED UP A TOTAL OF 16 TEXTURES
ERROR: General , 1674956146488> RenderContextQueueItem.invoke> java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null thrown during invoke().
ERROR: General , 1674956146490> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null at Invokers$Params2$CallbackStackItem.run line:91.
ERROR: General , 1674956146491> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null
at zombie.util.lambda.Invokers$Params2$CallbackStackItem.run(Invokers.java:91)
at zombie.core.opengl.RenderContextQueueItem.invoke(RenderContextQueueItem.java:77)
at zombie.core.opengl.RenderThread.flushInvokeQueue(RenderThread.java:397)
at zombie.core.opengl.RenderThread.renderLoop(RenderThread.java:170)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:226)
ERROR: General , 1674956147440> RenderContextQueueItem.invoke> java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null thrown during invoke().
ERROR: General , 1674956147441> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null at Invokers$Params2$CallbackStackItem.run line:91.
ERROR: General , 1674956147441> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null
at zombie.util.lambda.Invokers$Params2$CallbackStackItem.run(Invokers.java:91)
at zombie.core.opengl.RenderContextQueueItem.invoke(RenderContextQueueItem.java:77)
at zombie.core.opengl.RenderThread.flushInvokeQueue(RenderThread.java:397)
at zombie.core.opengl.RenderThread.renderLoop(RenderThread.java:170)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:226)
ERROR: General , 1674956147442> RenderContextQueueItem.invoke> java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null thrown during invoke().
ERROR: General , 1674956147442> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null at Invokers$Params2$CallbackStackItem.run line:91.
ERROR: General , 1674956147442> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "zombie.util.lambda.Invokers$Params2$ICallback.accept(Object, Object)" because "this.invoker" is null
at zombie.util.lambda.Invokers$Params2$CallbackStackItem.run(Invokers.java:91)
at zombie.core.opengl.RenderContextQueueItem.invoke(RenderContextQueueItem.java:77)
at zombie.core.opengl.RenderThread.flushInvokeQueue(RenderThread.java:397)
at zombie.core.opengl.RenderThread.renderLoop(RenderThread.java:170)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:226)
Okay, error is gone... he thinks he may have added some mods twice or something.
object.func() but object is nil
This looks really cool!
are you gonna have someone go through and DO all the tetris-ing?
Lol, what do you mean?
is there going to be a default items file that has pre tetris'd items?
length and width etc.
The item sizing is just a dev tool
also, a "rotate" option would be neat.
mouse wheel?
Ye thats probably a good option as well
my question is how are we getting the default sizes for the items?
I am making them
I wrote a formula to size all the items automatically. I am manually overriding the sizes of certain items where I feel the formula has failed.
Which func, which object, which file? (I.e. which mod?) (What kind of mod?) (Any detail whatsoever other than something doesn't exist that the game expects to exist?)
Knowing some object somewhere was nil doesn't exactly narrow things down...
Hey, by chance anyone know of a way to update a items model within lua? Like changing the alice pack model to be the hunting backpack one.
Idk but I think the models are usually defined from .txt scripts in an entirely different folder... i.e., not from Lua. @placid hinge
you can probably use setModelMetaData, but I haven't tested it personally
if the model is encapsulated then you'll probably have to use that, but you'll have to get the current value for the other args (aka everything except the mesh)
you can just DoParam the model
if all you want to do is change the model to another already defined model
DoParam?
oh, actually, clothingitems probably need some special work
i don't see a DoParam anywhere
is there something I don't have decompiled?
Item:DoParam()
you can probably just doparam the clothingitem to the hunting backpack clothingitem actually, i don't think the clothingitem defines anything but appearance
local item = ScriptManager.instance:getItem("Module.ItemName")
if item then
item:DoParam("ClothingItem = OtherClothingItem")
end
oh it's a scripting thing, that makes more sense now
would that change it during runtime though, or would it need a restart? haven't worked with those functions before
depends on what exactly it is, usually it'll only affect items loaded from then on (so mostly useful before the world loads)
A mod with a loop that doesnt check if its running inside the game
Sonething like forexample a code looking for getPlayer() evenif it doesnt exist
odk thats just my guess
some things are always read directly from the script though so those will be fine
if anyone remembers the discussion of coroutine the other day, turns out I was wrong: it probably works as intended, and you could totally use it
turns out (even in normal Lua) it's not meant to be multithreading, but you can use it to make shit like pseudo-asynchronous state machines
haven't actually played around with it, but from what I can see the functionality is there (from Kahlua, but never actually used in the vanilla game as far as I can see. it's globally exposed though)
@idle dawn
funny I literally was going through looking for something and was right around that convo and came back to this
your timing
That's what I was thinking initially ye.
I said in the convo somewhere it's single-thread async.
The whole purpose of it primarily is to do a bunch of things without the main game thread waiting for it.
On 500 zombies, my explosions effectively freeze the game as they all die. Without the delay, they all die in the same frame and take a literal 1-2 seconds before all exploding at the same time.
coroutines works perfectly ๐
coroutines solve this, however of course the game thread is always prioritized so it's not guaranteed to happen immediately as asynch stuff happens.
It's mostly the terminology.
It's not technically another thread, it's the same one but treating it as it's own away from the "primary" one.
This actually causes a VERY important interaction if you plan to use coroutines. If you create one and fire it on the next line, it potentially does not run before the other lines below it due to this asynchronous nature.
tldr, async tasks from coroutines are not guaranteed to run on any specific frame at all.
As an example, lets say when a zombie dies, I want to make a coroutine to make the explosion happen on the zombie location.
This wouldn't work.
The zombie only exists on the exact frame of the zed death event, before it is potentially null. You'd be referencing a null.
I had to actually store it's location outside of the scope of the coroutine then pass it to it.
(Or rather the queuing system I used.)
I think the best case use for most people here with co routines is if you're trying to do a lot of things at once. Like spawning a weed and bong item in every container. Instead of holding up the game thread until it's done, put it in a coroutine. As long as it's not something dependent on timing/event triggers, it helps with prioritizing performance.
The only potential artifact you might see is if you do this with game tiles. Put a weed and bong on all tiles on the map? You'll actually see it spawn like a wave in batches, instead of all at the same time.
This is my ted talk.
it's actually fully synchronous, using the main "game thread," it's just used to hotswap between tasks
which I think is basically what you were saying above but just making sure
Fake threading in essence yep yep.
also the gameloop runs fast enough that it won't block the main loop, even for stuff like game tiles (my tile animations work on this premise, although I don't even use coroutines, because it's fast enough without them)
Try to use it anyways, see if nothing happens.
I think it assists the game loop a lot if stuff that can benefit from coroutines uses it.
it might actually end up making it slower tbh, initiating those and swapping between them is probably only efficient once you get to a certain number of iterations. otherwise the overhead isn't worth it
it's probably miniscule in either case, but still, if you benchmarked it out I bet that'd be the case
https://www.lua.org/pil/9.4.html "Non-Preemptive Multi-Threading."
The example paints a good picture.
Imagine I want to download a bunch of files. It requests, waits for confirmation, yadayada, then goes to the next file.
coroutines effectively lets you tell it to do it all at the same time, independantly of the main thread. (Although not off the thread.)
In this case it's not of use to you if it works fine without one.
sorta. it's not "all at the same time" though, you're just swapping from the "main thread" to a different one, then swapping back (or swapping to another one, and so on). it's all 100% synchronous on the game loop though, so it happens in sequence - it just allows you to leave certain tasks unfinished until a later time when it'll return and finish them
the use cases are pretty slim, tbh. it'd be a nice way to set up a state machine but I can think of easier ways
(which is why it isn't used at all in the vanilla Lua, or any mod that I've seen)
I think it's best use is in cases where you want to do something that takes time, multiple times. OR you want to do a lot of something and it has no connection to specific frames or timings nor cares about the initial state of any references.
So I made a mistake above and said the opposite actually.
If you make a code where you change every single tile in the map to a grass tile, it'l form a wave as it changes each tile one by one.
Because it's acting sequentially and waits for every tile.
If you code it with coroutines, it will effectively change every tile at the same time, as fast as the game loop/thread allows it.
What you're saying on it being syncronous is incorrect, but I'm thinking you're talking about the fact that the main game loop is cooperative to it.
that's called cooperative multithreading, usually
or cooperative multitasking rather
windows 3.1 used that to go between tasks in the old days
:p
before threads
what's incorrect about that? it's inherently synchronous, it can't be asynchronous without access to actual CPU threads (and Lua can't do that, especially in Zomboid's case)
perhaps they brain derp and thought u meant asynchronous
Being in the same thread doesn't mean it's asynchronous.
synchronous = stuck in order with each other.. asynchronous = can operate independently
in case anyone is confused
right, exactly
What you're saying on it being syncronous is incorrect
not sure what this part was getting at
otherwise everyone seems to agree fine
:p
also, in regards to the tile thing: this would be true on lower-level hardware, but there's a ton of operations per-tick, so it actually happens "at the same time" in terms of what the player notices.
if you manage to make something that can't happen across the span of a tick though, that's when you'll start to see issues (and where a state machine would be necessary, in the way you described) but even doing thousands of tile operations doesn't cause that to be necessary, thankfully
For some tile based games you can have a ton of interactions or changes happen on a single tile.
GOOD
NIGHT
See space station 13, where every single tile is simulating a literal atmospheric system consisting of exact pressures that move between every tile, with an air mix that can possibly combust.
The shit that happens on a single tile is insane in that.
As for PZ, I wouldn't know exactly, but it's mostly in the potential.
With my explosion issue, one explosion is fine.
But when 500 zombies are literally dying at the same exact frame because I coded it so when they die they generate said explosive which is programmed to kill the zombies nearby...
You do have to control when the coroutine yields though. You CAN check when a coroutine is stopped, then start it again, but you can never guarantee WHEN it's going to stop.
The reason it's asynchronous and why I say it's wrong to call it synchronous is because when a coroutine is created, it's treated independantly in the main thread. Both of the code effectively run along each other and actually disregard all order. Ideally they both alternate in the thread because there's no actual priority unless you program a dispatcher.
It's quite literally what the coroutine creates.
If the main game loop decides hey I'm gonna take 10 extra cycles to do something brb mom is calling, then it comes back and runs some code, the coroutine could have done it's processes at any point during all that, and be in it's process anywhere if it took long enough.
that's not how it works, though. it's entirely dependent on the main thread - because it has to be called by something. you can't call code without a thread, and in our case there's only one accessible thread, period - so it has to run on that thread
they don't run alongside each other at all, they'll run until they're finished unless you specifically use the coroutine.* commands to manage their state
you can always guarantee when it's going to start, stop, etc. because it either 1) finishes and executes a callback, or 2) you stop it manually
if there's no callback, it'll just go on to whatever's next on the stack, outside of the coroutine
(as usual)
am i understanding this right? they just seem like functions you can pause to me
Some research, you are right that they are ran in order of call stack, but the reason they're called asynchronous is because of how coroutines can yield and resume at any time and during the time they are paused then resumed changes to values can be made without the coroutine actually knowing.
my understanding is if game performance>mod performance then use coroutines?
Don't listen to what I said regarding performance actually. The shit I was talking about was me assuming coroutines were automatically under a scheduler.
oh
You'd have to make your own, and the only use for that is if you want the main thread to have priority over something you're doing.
This is too low level shit I shouldn't be pretending I have authority over reeeee.
Thanks for making me question then correct myself though. I fucked up thinking coroutines are already in a scheduler.
has anyone used the lightRoom boolean before? and if so, what context?
it seems like what trigger lighting up a room by roomdef or room id
any event for game closing? Cant seem to find it
i think is OnAiState
but cant seem to find much info about
how to use it
you want to trigger game close or quit server?
i'm trying to understand what would happen after the game closed
when i say on game close, on quit to menu or quit game
OnDisconnect ?
definitely not related, that's for zombie ai
Anyone know what could be causing this? ERROR: General , 1674979779092> 0> zombie.world.WorldDictionaryException: Warning client has no script for item PZRPRadio.WalkieTalkie6 ERROR: General , 1674979779093> 0> at zombie.world.DictionaryDataClient.parseCurrentItemSet(DictionaryDataClient.java:42) ERROR: General , 1674979779093> 0> at zombie.world.WorldDictionary.init(WorldDictionary.java:213) ERROR: General , 1674979779093> 0> at zombie.iso.IsoWorld.init(IsoWorld.java:2450) ERROR: General , 1674979779093> 0> at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268) ERROR: General , 1674979779093> 0> at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225) ERROR: General , 1674979779094> 0> at java.base/java.lang.Thread.run(Unknown Source) LOG : General , 1674979779094> 0> WorldDictionary: Warning: error occurred loading dictionary! ERROR: General , 1674979779094> 0> ExceptionLogger.logException> Exception thrown zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error. at WorldDictionary.init line:255. ERROR: General , 1674979779094> 0> DebugLogStream.printException> Stack trace: zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error. at zombie.world.WorldDictionary.init(WorldDictionary.java:255) at zombie.iso.IsoWorld.init(IsoWorld.java:2450) at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268) at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225) at java.base/java.lang.Thread.run(Unknown Source)
It crashes my game, it's presumably caused by this code.```
item WalkieTalkie6
{
DisplayCategory = Communications,
Type = Radio,
Icon = WalkieTalkiePolice,
Weight = 0.1,
DisplayName = Radio Tracker,
UseDelta = 0.1,
UseWhileEquipped = FALSE,
DisappearOnUse = FALSE,
TwoWay = TRUE,
TransmitRange = 500,
MicRange = 0,
BaseVolumeRange = 14,
IsPortable = TRUE,
IsTelevision = FALSE,
MinChannel = 10000,
MaxChannel = 500000,
UsesBattery = TRUE,
IsHighTier = TRUE,
WorldObjectSprite = appliances_com_01_40,
Tooltip = Can be used to track radio broadcasts.,
StaticModel = WalkieTalkieTactical,
AttachmentType = Walkie,
}
It also only does this when connecting to my dedicated server.
what do the first 10 lines of your item script look like
module PZRPRadio
{
imports
{
Base, Radio
}
/************************ MADE BY DEVOTAN FOR PROJECT ZOMBOID ROLEPLAY ***********************/
item RadioRedGrid
Is that what you were asking for?
has this file ran before?
The only thing in the file that doesn't work is that part.
first thing that jumps out to me is the comment, but if that was fine before it's not going to be that
i'm guessing the broken one is the last in the file?
this is the right name? WorldObjectSprite = appliances_com_01_40,
I copied directly from items_radio.txt in the game files.
And I didn't edit that part.
fair enough ๐
I changed MicRange, TransmitRange, DisplayName, and UseDelta.
That's it though.
And of course, the item name.
maybe a non-unicode character snuck in somewhere
that's caused a lot of unexplainable issues before
true. can just copy and repaste the script anywhere that lets you paste raw values. there is a hotkey for windows but i forget
Not sure what I'd use to do that.
word works lol
i only use that stuff while working typically so im sure googel docs also
maybe notepad++
ctrl+shift+v
does it
then just copy and paste back into your script file and save
if that doesnt fix then it's a small detail you are missing
I don't know if its this picky, but there is a space after the comma here for WalkieTalkie6 :
UseDelta= 0.1, ^M$
No other line has that. i'm just guessing at this point though (^M$ is the line ending)
wow good catch. not sure if thats it either but damn good eyes lol
I'll try that.
if it's that finnicky... haha. interested to find out
I made the UseDelta higher on the tracker so the battery runs out quicker but it's not important so I hope that fixes it.
Misunderstood what you were talking about for I second but I get it now.
Nope, that didn't work.
still getting this
Does anyone know of a way to get the player to stop turning (even for just a moment), or to make the turn NOT delay TimedActions? I have tried to store the player's turnDelta, then set character:setTurnDelta(0), but the game still seems to think your character is turning so they just stand there until some sort of internal timeout. I'm not doing any sort of waiting if the player is turning, this seems to be something that the game just does.
But this currently causes my offhand attack to be stuck if the player is turning until the turn is small enough to do the attack.
Bro what it doesn't work just for me 
I had someone else test it and it works fine

You can disable action if player start aim or use player:faceLocationF(x, y)
Its an offhand attack, so should be triggered when the player is aiming. ๐
But yea, i guess I can lock the current direction until an animation event; it blends fine after my animation has started. I'll give it a go.
Cool! That seems to have mostly solved it more or less. I am instead using the {get,set}DirectionAngle() to force the forward position until the animation starts. Literally just needed a few ticks to pass for it to just start the animation, and this works. Thanks for the idea!
the raining one? why not soothing storm sounds.. lol
i dont think it would need music though personally. what do i know though.
https://www.youtube.com/watch?v=Rku2CY2cLy0&t=16s this is what the did with the one i based mine off of.
ART โ Nikita Moskalev
https://www.artstation.com/nikitamoskalev
Music โ Daniel Grusuk
https://www.youtube.com/channel/UC7n5Tw8ltdCjOnAbamOKXYQ
Full worck:
https://www.artstation.com/nakvili
is it possible to change a tile's property
{
Type = Integer
Name = PickUpLevel
ShortName =
Min = 0
Max = 5
Default = 0
}
``` specifically, or any tile property after game load?
video bugged while rendering or why there's for 105 seconds just going the rain
it's the music that matters?
what do you guys think about this for the stats icon for fire kills?
is this fine ( a molotov ) or should i use something else?=
Hey all, a question: I'm having a context action require a base.apple but I want to know if there is a function to check for freshness so players can't just use a rotten apple.
need some honest opinions for the icons Zombie Kills total, time alive and fire kills
still thinking about the car kills
i dig it! i might make the background a bit lighter so it's easier to see the bottle?
that IS just some unsolicated advice.
food items have an isRotten() function you can use to check for that.
Like this?
ty :)
ill change the background on all the others
agreed, much better with the lighter background
do them all grey?
shouldnt they match?
i think zombie will look great and the calender will not.
since its the same mod?
thats a good point
maybe diferent backgrounds for each?
bnot as bad as i thought!
cool music
i think that came out fine
though i think doing it as a single day... might look better
i had a transparent background but in some situations... it wasnt so good
the calendar?
mor like the right one i mean.
people will understand it better. it kinda looks like a factory atm.
you must now make 31 calendar icons and have it update in real game days.
....
HAHAHA
lmao
was thinking about that dhert
๐
like make the calendar icon match the day
but i think ill just be lazy and pick a random number for the calendar
hehehe
what day did the outbreak start?
ahaha
i like that one.
so do i
The incident is considered to have begun on the 4th of July, 1993, American Day of Independence. Just two days later the military evacuated residences from around the affected area and set up blockades in what is now known as the Knox Evacuation.
shadows for them all!
so i'd go the 7th
since that would be the day the most died.
7/7
no one can complain if that's "m/d" or "d/m" that way too
generally tiles get their properties from the sprite, you can edit those. Depending what you do, you need to worry about persistence and some properties are harder to set, not sure if gl3tcher figured it out.
i'm just trying to redefine the place and pickup level in this case
yet again, using a sandbox option lol
that should be doable
once i can figure out if it's possible it should be quick from there. i thought of other ways but i may not even mess with it if it gets too complicated
okay sweet
okay so to figure out how to play a looping sound via the ui.
well period. lol.
haha
I don't have the code now but it should be like
Sprite manager:getSprite():getProperties:set()
well if you can make one that plays a .ogg repeatedly on the main menu, that would rock.
lol
the month?
yeah
i'll use this and do some file searching. thank you much!!
there should be a setVal in there probably
im still thinking if i should include car kills or not...,
fire yeah i can see why someone whats to follow that
car kills...
meh
im piggy backing from killcount
if its installed and enabled
i use the stats from the mod
it its not
i just use the game stats
so its up to the user if they want more detailed stats or not
wnat more? install the other guys mod
and mine works in co-op with it
thats not a bad idea
i actually made the fucntions to kill the fire kills
but then... why should i? its already done
if i saw my kills though, seeing what it's comprised of would be interesting for sure
so this way i dont have to code it and if someone wants it also needs the other dude's mod
so i think its a win win
yea and it's a small mod as well lol
mine was only meant to have a way to display some stats in obs
so ill just give the option to have more stuff, just install the extra mod
๐
now lets see if the icons look good ingame
hey nippy, you think you could write up a function to just loop an ogg in the hdlogo lua?
i agree!
Lookin good
now to add the code to save the position and orientation
should be easy enough
--GetModFileWriter(String modId, String filename, boolean createIfNull, boolean append)
local writer = getModFileWriter("Twitch-Stats", "media/ui/TWSTATSpos.txt", true, false)
writer:write("x:".. tostring(STATSTab.getX(STATSTab)) .. "\n" .."y:" ..tostring(STATSTab.getY(STATSTab)))
writer:close()
end
what exactly? and what is hdlogo
i mean i get the first part
i repurposed the lua from that
just to be clear also, you asking for help or seeing if i can? im sure it wouldn't be too bad
i see the file you mean also here
a little of both?
sounds good im checking
seems like base game file being updated to do this?
ZomboidMusic.bank i think
trying to see if im wrong there somehow
looks like you need someone familiar with sound/asset editing .bank files potentially
lol i always run into stuff that's like damn.
thats not a bad idea ๐
i know sounds is in media but i don't know if it's reachable via a mod because it's deep
steamapps\common\ProjectZomboid\media\sound\banks\Desktop
while all you modders are up, I'm trying to check a player's inv for a required item when they do an action via the inventory context menu via this: if self.invMenu.player.getInventory()
but then get the following lua error:
java.lang.RuntimeException: getInventory: Expected a method call but got a function call. Correct syntax: ItemContainer obj:getInventory()```
But I thought the function was the correct way of referencing it if it was the player?
you need a method call
obj:method()
not a function call
obj.function()
Calls to object methods (e.g. the commands available for an instantiated player object) generally pass their object into the function using : in Lua. So any instance in this game is likely to call function-like members of its class with : unless the class has both static and object-oriented behavior, in which case it may sometimes call stuff with .
well im done for now with modding... gonna chill out for a bit. Thanks for the help
nice job man
Okay, I think I understand. Thank you both, I'll try this again not at 6 am.
just like the in-game molotov icon too
As a general rule, all of the Java object methods need "themselves" (their selfs) to work properly (so always use : to call Java object "functions" which technically we call methods), whereas Lua objects may not (so check the usage in the vanilla Lua).
hi can I ask how do I create a NPC
hmm, im having a little problem with the UI "updates"
so im detecting the mod killcount by looking if the table that the mod creates in the player mod data exists
that table only exists after the players kills one zombie
so when the game starts, the ui will default to the simples stats, time alive and zombie kills
but then the table for the killcount mod is created in mod data and the code detects it, but when i remove the ui and add the ui again
it stays the same, only if i reload the save it will change to the extra info in the ui
STATSx, STATSy = loaduiXY()
local player = getPlayer()
local KillModData = player:getModData().AKCModData
if KillModData then
print("KillCount MOD detected")
STATSTab.KillCount = true
print(STATSTab.KillCount)
else
STATSTab.KillCount = false
end
if STATSTab.KillCount then
STATSTab = STATSTab:new(tonumber(STATSx), tonumber(STATSy), 360, 165)
if leftside == "true" then STATSTab.leftside = true else STATSTab.leftside = false end
STATSTab:addToUIManager()
STATSTab:setVisible(true);
else
STATSTab = STATSTab:new(tonumber(STATSx), tonumber(STATSy), 360, 110)
if leftside == "true" then STATSTab.leftside = true else STATSTab.leftside = false end
STATSTab:addToUIManager()
STATSTab:setVisible(true);
end
end```
or do i have to force a render? doesnt it render when i call the new?
its extremely hard to do. Even the devs are still working on doing some of that stuff. If you're looking for NPCs in game, then I would just suggest SuperB survivors mod and even that is a little janky so good luck ma brother.
Anyone have any clue whether cars can be relocated somehow?
i.e. teleported?
(Tried setX/Y/Z/Lx/Ly/Lz)
dunno but cant you just copy the car table despawn the car an spawn in new location using the table?
I'm just not sure how, that's all. I checked the code for the debug tool that lets you spawn vehicles. It seems to grab the vehicle data (not at all clear if it grabs said data in BaseVehicle form or not) and then it sends this command:
local command = string.format("/addvehicle %s", tostring(vehicle))
SendCommandToServer(command)
My problem with that command is that it has no obvious place for telling the vehicle where to spawn.
I guess I could try setX/Y/Z/Lx/Ly/Lz and THEN trigger that command on a vehicle object
check the cheat menu mod, it has a function to spawn cars despawn them and select veichle etc
maybe you can see something there that will help you out ๐
I bet it uses the same menu functions that are built into the game... would be unnecessary for most cheat purposes to spawn a car on a location other than your own
But I will check it out!
never read much of the code handling the cars, only checked the weather bit ๐
and yeah... the weather bit uses the vanilla menu functions
so prolly the cars will do the same, but youll never know without having a look
The mod I am working on is not showing up ingame. For now I am just trying to make a tileset work. Ive done it correctly "based on didericks videos" but the mod itself wont show up in the ingame modlist
Ive also added the craftable code to make it a craftable items
What am I doing wrong?
Is there any proper guide anywhere to make a mod for custom craftable furniture?
Question, is xy here anchored to the UI element you're adding the image to?
So 0,0 would be on top of the element?
Ye, the xy is local to the element
Top-Left.
that'd explain it
Feels like there's not sufficient docs and tutorials for UI.
there isnt ๐
this would also mean the vanilla way buttons can be given images are not to scale or aspect'd right
I know it from all the time I spent working with and on it internally.
im still having problems reseting the ui to add more elements when a certain condition is met
if i reload all the lua ( same as reloading the save kind off ) it works
i even remove the ui from everywhere and start a new instance and still
Work has been demanding lately... I'd really like to work more on my HTML engine for UI in PZ.
Hmm I managed to use the drawn texture but the issues are still there - probably osmething else going on as it's a child of another element
well i fixed my issue...
... char case mistake ...
the var was KillCount and i had Killcount on the check... so nill = false ...
Not using drawTextureAspect ?
I used that
would be texture drawn correctly by a resizable ui element?
the size is right - just seems like the colors are getting blured
Mipmapping?
Mag filter probably
Seems to be effecting vanilla buttons on the left too
I think that there's a way to make mag filter use nearest in PZ API.. not sure
the size is being set to match the textures though
Check and see what moodleUI is doing in Java
I think that is doing something to keep it from blurring but not 100% sure.
Unless the game or UI is drawing over the image I don't see what could be causing discoloration.
UI in vanilla code uses no shaders.
Maybe try saving your png in a different editor or a different bit format..
I'll try that - what's the recommended?
The png decoder or something else might be reading it wrong.
attempted to alter the icons, still not looking good ๐
same issues as me or?
I think idoesnt allow for that
I think the icons look fine tho - what about them doesn't sit well?
You can create a pack file to replace only selective icons
How do you use pack file for purposes other than tile.? I want to learn that
I feel less bad knowing the vanilla icons are also getting scuffed
I tried sampling down to 8-bit
Moodles don't seem to have this issue - so I don't think it's an issue with coding vs repacking textures
Might just have to toss it on the back burner
I suspect it's something to do with children or the UI for the left side buttons
probably related to me messing with it too
Icons also come in .pack files, so they can be overlapped with mapping knowledge
it does ๐
after 3 days i think i finally know enough about UI to start making better looking mods... but damn the learning curve is weird...

