#mod_development
1 messages ยท Page 226 of 1
I also tried to change them in MapObjects.OnLoadWithSprite() thinking I could bypass whatever was happening in TileDefs with no luck...
This video helped with that exact problem https://www.youtube.com/watch?v=cYMM8nphppk you can use udim texture tiling to bake multiple textures into one
This video shows how to combine multiple textures of a model into a single texture.
can recipes give off two items?
multiple of the same item yes 'Result:Egg=12', different items not sure if you can add ; between them if that will work
phuc
Do you guys know if it is possible to add specific items to a profession? I mean, if you start selecting a specific profession, you have those items in the inventory.
or specific clothes
looks like that might be somewhere in the MainCreationMethods.lua
Hi! The OnKeyPressed event has the parameter "key":
-- something
end
Events.OnKeyPressed.Add(onKeyPressed)```
"key" is an integer encoding the actual key you pressed on the keyboard. For example, for my keyboard I have
key = 17 <--> W
key = 30 <--> A
key = 31 <--> S
key = 32 <--> D
Is this the same on for every PC? (I guess yes???) Moreover, what if the player changes key bindings? Will "key = 17" for example still mean that the player pressed the move-forward key? Or does it mean always that player presses W, no matter of the key binding?
I know I can figure out the second question by just testing it changing the key binding in my game but maybe someone here happens to know... ๐
This is indeed possible. For example
local profession = player:getDescriptor():getProfession()
if profession == "TheProfessionIWantToModify" then
player:getInventory():AddItem("Base.SomeItem")
end
end
Events.OnNewGame.Add(createMyPlayer)```
Might need to create a company called "Green Oven" just to make it work, lol! "When you want the best, buy Green Oven!" or "Green Oven generators, when your power is lean, you gotta go green!"
When creating items for mods, is their a character limit?
Thank you very much for the suggestion, this seem to work as intended.
Say no more
Green Oven: When life gives you bugs, make dinner.
Is there something not working properly with the trip function?
Every time I call to trip the player it just freezes me in an animation
Anyone know how can I force tilepack file to get me some file format like this anhnpc_0?
It keeps forcing to name with an additional "_0". Got lucky once but I don't know what i did
Reference in the image
Because of this, I can't link it to the tile property ๐ญ
Combine all the images into one? And after you make the pack they will have the correct name. It's not necessary to have a tilesheet for each npc.
Reason: Bad word usage
Ohh i see so I just combine all the npc into one tilesheet? Let me try that thanks Elyon
Yes like this. Just make sure the width is divisible by 128 and the height by 256.
How do you do the second image btw? All I got is ??? when loading in the tile property
Combine them in paint, PS, or whatever program you use
Wait let me try to combine first then check from there. Thanks again!
Reason: Bad word usage
worked now thanks @coarse sinew . sprite still needs to be polished but it's a good start
Reason: Bad word usage
Reason: Bad word usage
Reason: Bad word usage
I wonder what's going on
Reason: Bad word usage
Anyone know any mods that mess up foraging zones globally? I.e. overwrite modded foraging zones with vanilla? I'm desperately trying to find the cause for this (nothing obvious like ForagingZ is enabled)
Most likely scam links to Discord servers
Could simply be wrong load order of maps
I noticed that if you create a custom clothing, by copying one from the base game, using the same "ClothingItem" parameter adds it to the game distribution and you can find it in game.
Is there a way to prevent this from happening, without creating an entire cloth item from scratch?
I mean Definitions not Distribution
Are you sure you're modifying the clothing ID and not replacing the base one ?
this is the test item I made:
item SuperTankTop
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Super Tank Top,
ClothingItem = Vest_DefaultTEXTURE_TINT,
BodyLocation = TankTop,
Icon = Vest_White,
BloodLocation = ShirtNoSleeves,
ScratchDefense = 100,
BiteDefense = 100,
RemoveOnBroken = false,
CanHaveHoles = false,
Insulation = 0.55,
Weight = 0,
WindResistance = 1,
WindResistance = 1,
FabricType = Cotton,
WorldStaticModel = BulletVest_Ground,
}
The clothingItem seems to be shared with the base tanktop
and it replaces it in game
isn't the ID, in this case, SuperTankTop?
ahno, that's the type
I added all those parameters to see the behaviour, but it replaced the one in game, as I see zombies wear this and I don't want to.
I wonder if I need to write, yet another lua script, to delete all items of this type from the world.
No you don't want to replace the base one, change ClothingItem name
can I just change the name directly or should I create another xml file? I see that Vest_DefaultTEXTURE_TINT has a .xml file.
This xml also has its own GUID which is used in the file clothing.xml.
You modified the base .xml ??
no no
You need to create your own then yeah
I see, let me try.
For the GUID, use a GUID generator online
should this GUID be added to the clothing.xml file or can I ignore that step?
This is my first time doing animations for Project Zomboid (and any game really) so I followed the Steam animation guide linked on pzwiki. I did everything correctly as listed but I am getting a warning in the lua console in game saying "Animation Clip not found: AQ_BrushTeeth". If anyone knows about this error, please let me know!
You didn't change the animation name in the Blender file
BOb_RP or some shit like that, you need to rename that, it's this that defined the name of the animation clip
Did you restart your game when creating the animset with the animation clip ?
I can't look at Blender rn so I can't verify that what it's supposed to look like but what I can tell you is that it's not where I change the name of the clip nor at it
you need to add the guid to your new clothingitem xml file,(xml file name is the same as your ClothingItem name on your item) also you need to make a fileGuidTable like the one in the base game files with a new xml entry referencing the guid and your items name
yes
Did you change the name in the green bar ?
yes, in the third image I posted the green bar is the orange bar
green just means editing and orange means not I believe
Didn't see the 3rd screen mb
Did you use the IK model ? Make sure your export settings are the same
maybe it matters where I put it?
I have it currently in media/anim_X/AQ_BrushTeeth.fbx but I tried in a subfolder named Kate as well
No I didn't
No it doesn't matter
What did you use as a model then ?
The default model that comes with the guide (the guide attaches a template that contains all the bones like Bip01_Head and IK_R_Calf)
:|||||
Then you did use the IK model
that is odd
I opened ANIM_TEMPLATE.blend not IK_ANIM_TEMPLATE.blend
ANIM_TEMPLATE.blend for whatever reason contains IK_R_Calf and IK_R_Thigh entries but they aren't linked to anything and no IK stuff shows up for modelling
Use the IK model, why would use you use the non IK one ?
I thought it would be harder to animate lol
Ill reanimate it in IK model and come back
It's wayy easier to animate with IK lmao
Like WAY WAY WAY easier
Bcs you don't just have to rotate every single bones, you just move the IK and the whole body parts follow the movement
Yeah, I found a steam guide which explained exactly that. It works! Thank you.
Reason: Bad word usage
Do you need to do anything special to override vanilla recipes? Every attempt so far just seems to be ignored.
Nevermind, apparently I was editing the wrong function.
When using commands like getTimestampMs() for getting the actual time the game is running, can't this result in overflow errors when the game is running for quite a long time?
Nope, getTimestampMs() returns the current IRL time in milliseconds from the Unix epoch 1970. The long data type (type that function returns) in Java has a maximum value of 2^63-1, which means it can represent times up until about 292 million years from the epoch. So, overflow isn't a concern
Is there a way to edit entries in the vanilla (.txt) script files without fully overwriting said files? If there's no other option, what does one do for mod compatibility?
(Don't know if it's important to mention, but the files in question would be evolvedrecipes.txt and items_food.txt)
Not sure about the evolvedrecipes.txt but for items as in items_food.txt, you can use the following:
local item = ScriptManager.instance:getItem("Base.MyItem")
if item then
item:DoParam("Weight = 5.0")
end
end
Events.OnGameBoot.Add(changeMyItem)```
This shouldn't cause any mod conflicts (except for other mods which also modify the Weight parameter of the item or base their code on the expectation that it has a different value ofc).
Thanks, I'll try playing around with that.
He finally fixed it, was annoying all these bugs
https://steamcommunity.com/sharedfiles/filedetails/?id=3205413404
My new vanila look like vehicle, enjoy ๐
I've been getting this error on line 14 in this mod I've been working on.
line 14 is just if player:getPerkLevel(Perks.Doctor) >= math.random(0, 10) then.
idk how it could be erroring, I checked the logs and it basically said Object tried to call nil?
I'm confused.
math.random doesn't exist, use ZombRand(0, 10)
ohh
thanks
it is if no one answered. There was a list of those but I dont remember where rn.
I am not looking which integer stands for which key. My question is whether those integer-key association are the same for every player and how they behave if people change their game's key bindings.
from what I remember its same for everyone
ingame changes in the bindings doesnt effect the integers there unless you add customizable bindings in mod options etc.
not %100 on it tho
no prob. I'll just do some tests to find out more
local sm = ScriptManager.instance
function OverwriteEvolvedRecipes()
sm:getItem("Base.Roasted Vegetables"):DoParam("MaxItems":"12");
end
Does anyone have an idea what I could do to edit MaxItems? It's formatted like this:
MaxItems:6
Instead of like this in evolvedrecipes.txt
MaxItems = 6
The function on the top seems to be meant for overwriting parameters in the latter format, I tried adapting it, but no dice
Is there a java command to check whether a worn clothing item is currently hidden by another one which has been defined via the body location command "setHideModel()".
I know you could easily find out by writing a custom function for this but I am wondering whether the game as a simple predefined command instead.
Where are defined Icon from script files ?
item Hat_GasMask
{
DisplayCategory = Accessory,
Type = Clothing,
DisplayName = Gas Mask,
ClothingItem = Hat_GasMask,
BodyLocation = MaskEyes,
Icon = GasMask, <-----------------------------------------
CanHaveHoles = false,
BloodLocation = Head,
Insulation = 0.75,
WindResistance = 0.60,
WaterResistance = 1.0,
Tags = GasMask,
}
It is the png name suffix. add Item_ as prefix and you get the png name. Item_GasMask is inside UI2.pack
tileed
Is that in the modding tools ?
yes, Tilezed
Am I supposed to put the .pack I want to view in a specific folder to see them in the pack viewer ?
yeah idk it's completely empty and nothing to select the .pack file
Hello pals, it's me again. I am adding to my mod some zombies with custom clothes (these clothes are from vanilla). I defined the new type of zed with this specific clothes in the \media\clothing file (clothing. xml). The code is the following:
<outfitManager>
<m_MaleOutfits>
<m_Name>Samplezed</m_Name>
<m_Guid>514dd1c6-606d-4662-b94d-c23bb8dc3385</m_Guid> <!--This code is unique, generated by an internet guid page -->
<m_Top>false</m_Top>
<m_Pants>false</m_Pants>
<m_AllowPantsHue>false</m_AllowPantsHue>
<m_AllowTopTint>false</m_AllowTopTint>
<m_AllowTShirtDecal>false</m_AllowTShirtDecal>
<m_items> <!--Hat_Cowboy -->
<itemGUID>ae7791f9-a5df-48d8-882f-a0749b8af2b1</itemGUID>
</m_items>
<m_items> <!--Vest_BulletArmy -->
<itemGUID>1a437dbb-cee9-4013-8e8a-e158acf98b62</itemGUID>
</m_items>
<m_items> <!--Bag_DuffelBag -->
<itemGUID>b02d3217-b692-4035-8a61-8c4305998464</itemGUID>
</m_items>
<m_items> <!--Gloves_FingerlessGloves -->
<itemGUID>cf0b766a-c273-49b0-bee4-5a0bb6496491</itemGUID>
</m_items>
<m_items> <!--Shirt_HawaiianRed -->
<itemGUID>6067cc54-e9f1-4731-a163-ba8f9d55bc03</itemGUID>
</m_items>
<m_items> <!--Trousers_Denim -->
<itemGUID>229b23f6-8e8f-4f16-837b-4fe950c48bfc</itemGUID>
</m_items>
<m_items> <!--Shoes_TrainerTINT -->
<itemGUID>6fed6e2b-3a72-4bac-aac5-09585984493d</itemGUID>
</m_items>
</m_MaleOutfits>
</outfitManager>```
Also, in the media\lua\shared\NPCs folder I added the .lua file for distributions. The file is the following:
require 'NPCs/ZombiesZoneDefinition'
MAZombiesZoneDefinition = ZombiesZoneDefinition or {};
ZombiesZoneDefinition.Army = {
Samplezed = {
name = "Samplezed",
chance = 90, --I added a high spawn just to verify if it's working or not
gender="male",
},
}
ZombiesZoneDefinition.Police = {
Samplezed = {
name = "Samplezed",
chance = 90, --I added a high spawn just to verify if it's working or not
gender="male",
},
}
ZombiesZoneDefinition.Prison = {
Samplezed = {
name = "Samplezed",
chance = 90, --I added a high spawn just to verify if it's working or not
gender="male",
},
}
MAZombiesZoneDefinition.Default = ZombiesZoneDefinition.Default or {};
table.insert(ZombiesZoneDefinition.Default,{name = "Militartenis", chance= 80});
Do you see anything wrong with this? Is there something that I am missing? I have been strugling with these for a couple days and I can't figure out what's wrong. PLEASE HALPPPP ๐ฆ
Put the code parts in code boxes at the very least please with triple ` start and end
oh, sorry ๐ฆ
Thx, will help a bit in the reading of all this
Thanks a lot! Please take into account that many zombies spawn without clothes (underwear), so it's definetly doing something
today i make it possible to share mods recommendations in-game
(not only Discover)
Hello pals, for those who read my problem, I already found the solution
zed crucifixion mod when?
someone already made it long time ago ๐
https://steamcommunity.com/sharedfiles/filedetails/?id=2871633245
YOOOOOO
so I did that and it still shows error
I am not sure what I have to do but I have XML file too
media/AnimSets/player/actions/AQ_BrushTeeth01.xml but thats it
https://hastebin.com/share/ezudiwoqix.xml <-- Contents of AQ_BrushTeeth01.xml
Although I am glad I had to redo animation in IK model because I made a much better one ๐
hi
i need a lil help
if otherPlayer and otherPlayer ~= playerObj and not otherPlayer:isAsleep() then print("Print Other Player: " .. otherPlayer:getDisplayName()) -- Check that we've right-clicked a player and shows their display name. -- Create an option in the right-click context menu. local option = context:addOption(getText("Make Up"), worldobjects, ElliesTattooParlorContextMenu.AddMakeUp, playerObj, otherPlayer) if math.abs(playerObj:getX() - otherPlayer:getX()) > 2 or math.abs(playerObj:getY() - otherPlayer:getY()) > 2 then local tooltip = ISWorldObjectContextMenu.addToolTip(); option.notAvailable = true; tooltip.description = getText("ContextMenu_GetCloser", otherPlayer:getDisplayName()); option.toolTip = tooltip; end Trigger(otherPlayer, playerObj) end
this now triggers the ui when i click rmb and now when i click the makeup option in the context menu
i also wanted to make it have a sub menu so i can allow all makup options to be in it
Is there a way to check whether the game is played with a controller instead of mouse and keyboard?
@thick karma question for you
A second question if someone happens to know: How do I find out whether the player presses one of the walk forward/right/left/backwards keys? I know I can use Events like OnKeyPressed and then work with the parameter "key" somehow. For example "key = 17" means player pressed "W" and thus move forward with default key binding. BUT the problem is: if a player changes the key binding, "W" and thus "key = 17" may not mean that the player pressed the move-forward key. So how do I figure this out properly taking into account that the player may have changed the key binding?
I am no expert, maybe these could help you? lua/shared/JoyPad/JoyPadSetup.lua Line 808
The most used method I've seen is:
local playerObj = getPlayer();
local playerNum = playerObj:getPlayerNum();
if JoypadState.players[playerNum+1] then
--- do something
end
So JoypadState.players[playerNum+1] returns true if the game is played via controller and false otherwise?
Problem is that I don't have a controller by myself and thus cannot playtest
When I added controller support to BM I installed an app on my phone, PC Remote (by Monect). Because I don't have a controller either.
getCore():getKey("Forward")
getCore():getKey("Left")
getCore():getKey("Backward")
getCore():getKey("Right")
Many thanks!!! exactly what I need! I'll try this asap!!!
check keyBinding.lua for existing bind names
JoypadState.players[playerId + 1]
This gives a JoypadData table. If it is nil then it equates to nil == true which is false.
JoypadData.isActive
I believe this is a boolean that checks if the controller is actually being used. Because you can have a controller plugged in but not using it.
many thanks!!
there are also a handful of java joypad functions that are in lua but im not sure how effective they are and what they do (isJoypadConnected(int index))
Take my words with a grain of salt though, I am not the best with controller stuff and I never use controller on PZ
No it returns data, but it returns nil if there is no controller player, so checking its existence is effective.
@mellow frigate Sorry just saw this
I use this @small topaz
playerIndex = playerIndex or 0
return JoypadState.players[playerIndex + 1]
end```
So if I need to get a specific player's data I can provide index, otherwise I can just go if ExampleModule.getJoypadData() then --> I know at least one gamepad user is connected
Also I can use playerIndex to get joypad data which for me often makes code look more intuitive... since joypad ids are offset 1 from player index.
Do you know whether a command like
getCore():getKey("Forward")
also gives the numerical key value for a controller in case one is used?
Why are you pinging the mods? @scenic sinew
Go go ! Metagames Man !
Trying to upload another gif on imgur and it's giving me issues lol
Do vanilla files get overwriten if the name is the same of the vanilla file?
I am trying to get animations working and saw I need a player.xml file in media/AnimSets but I am not sure if my one will overwrite the vanilla one located at the same place.
yes
I do not want to do that but if I do not specify my own name prefixes in the player.xml file, it wont recognise my action xml in media/AnimSets/player/actions so I am not sure how I will do it.
Your own name prefixes ?
yes
because I want all my files to be distinguishable from vanilla files (except for ones I must name the same like ContextMenu_EN.txt for translation
I'm sorry but what action are you talking about ?
I'm fairly certain there's no need for that to make custom player animations
And mods that add custom animations are all compatible so you probably don't have to touch that action thing ?
It is an animation I made, xml file is at media/AnimSets/player/actions/AQ_BrushTeeth01.xml
Yes but that won't replace anything ?
The guide pinned doesn't say to anywhere and I couldn't find a single person that has any info on this but my only time the anim clip got recognised is if I had a player.xml file
I am assuming the player.xml file represents the folder beside it (being media/AnimSets/player)
And if I did not include this file, it would complain that the anim clip wasn't found
Where is that player file located ?
I presume this to be because my anim clip has prefix AQ_ and not Bob_ or Kate_ like the base game has it, and so I have to specify my custom prefixes.
<animSet>
<animNodeFilter>
<folderPrefixes>Bob</folderPrefixes>
<folderPrefixes>Kate</folderPrefixes>
<namePrefixes>Bob_</namePrefixes>
<namePrefixes>Kate_</namePrefixes>
</animNodeFilter>
</animSet>
that is the vanilla one yes
.
There's really no need to do that and in fact is causing way more problems than anything else
And if you want to have them be distinguishable from vanilla, name it AQanimationName instead
How would it cause more problems than not? But I will have no prefix as I thought initially my animation might clash with another mod if they were to have the same name
Did you check other mods how they add custom animations ?
Well yes, but you can just name it without a prefix
(go damn prefish)
No because I was sure that the animation guide would have covered everything I need to know about animations but it did not
No it really doesn't
There's no correct guide out there that explains everything about animations and how they work
There really is no need to have prefixes and it causes you issues because now you are required to add your prefixe to player.xml
If you just don't use your prefixe you have no issues
fair enough
Also the bob and kate prefixes are most likely to recognize male and female animations
(which usually are the same but there are one or two variations)
I presumed that as the game does refer internally to those
So if you want your files to be unique, just name them another way
My zombie animations are just named clickerWalk and shit like that, that's unique enough tbf
I mean I could just do it without an _ but it doesnt matter anyway
Also I have to ask since there are like no resources on this, what is m_Conditions and where are they stored (I am assuming it's a table of conditions stored somewhere
I see a lot of actions' animation have a condition to be able to do the animation but I am not sure where these are stored
You can access a condition on an IsoGameCharacter with getVariable()
There are variations of this function like
ty
You can also use set instead of get to change the variable status
And you have nothing else to do to create a custom condition
You just add a custom variable name to the animSet
And set it elsewhere
I don't think they are persistent no, if you mean like their status is saved after a reload
yes
If you caught a zombie might animation and reload your game, then come back, it will not finish the animation so I guess no ? I haven't looked into that
But why would you care about persistence of animation variables ?
I was just curious if I needed to reset them when the user quits
Nah no need for anything like that
The important part is making sure you trigger back the variable to false once your animation is done. I'm not familiar enough with this but you can setVariable via the animsets themselves
Depends if you want your animation to loop brushing your teeth until the player cancels it or just do the animation once and shit
But basically you could do a function that checks onTick that player is brushing its teeth via the getVariable and if you set your animation in a loop
And just do your happiness reduction like you currently do
Now I am getting something about a "did noto find node with condition"
So I added ```xml
<m_Conditions>
<m_Name>PerformingAction</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>BrushTeeth</m_StringValue>
</m_Conditions>
and it fixed the above but introduced a new warning (the same one I used to get) "Anim Clip not found: BrushTeeth"
Reason: Bad word usage
Reason: Bad word usage
https://steamcommunity.com/sharedfiles/filedetails/?id=3206781334
My newest mod, enjoy! ๐
Still have no idea after trying so much
Tried using Bob_ prefix like here, tried looking at other mods' xml files and using that as a base
your mod isnt online anywhere, so one could have a look, is it?
how do I download stuff on github?
You can click the green "Code" button in the middle-top-right-half (lol) of the screen and then "Download ZIP"
You can also clone a repository
^ but I wouldn't require it for a one-time download imo
anims_x
the folder is called anims_X, not anim_X
that is probably why the game says it cant find your animation, since it is in the wrong place
Does it work now?
just tested it, works. I would also suggest to set looped to true in your xml, or else the avatar will stop after the first stroke
Depends what he wants and what his animation is
Kind of told him about this
I mean, brushing teeth (action takes quite some time), but animation stopping after the very first stroke (like 5% into the action time) surely is not on purpose ๐
Depends how he made his animation
But if you tested it and the animation is just a single stroke well okay
Dude could tell us, but I believe they had a stroke after realizing a typo in a folder name caused all those grey hair
no way ๐ญ
also I do intend to loop it don't worry, that xml was placeholder to make sure I wasnt messing it up
To me, this comes off as "I told you so" mentality (might be just the way I interpret it). Yes, you did tell me about this prior but why do you figure you need to tell me in this manner? The XML data that I pushed was unequivocally placeholder data that I copied from vanilla game and modified so to make sure I wasn't being the dumb one. Yet here we are and I still end up being the dumb one for something so small as a folder name. Dergeissler took a swift look at the animation and even they could tell it was not intentional. That is all.
yes I have struggled with this exact issue for around two days now
What ? That's absolutely not what it was supposed to mean
Just told him I already told you about the loop stuff
No worries man, it is ALWAYS a typo
Man if you knew the shitty mistakes I've made in the past and that I still make sometimes
A lot of the time I interpret things the wrong way and I am not going to blame it on some medical label so I apologise.
np man
Happens to me too
I understand the confusion tbf
I don't always use the right sentence for stuff, while I'm fairly fluent in english, it still isn't my main language and I tend to this kind of example happen where it means a specific thing
Reading it again I understood the confusion instantly
Regardless, it's still a pretty bad animation to begin with lol. Had to dust off Blender and come out of the code cave to muster up the courage to do anything related to Blender.
I figure it is better to see a bad animation rather then nothing at all though
amazing to see that online disputes can end peacefully instead of as digital knivefights, lol. Good thing discord isnt reddit
What rig did you use ?
Yeah Reddit is a shitshow lol
I did take your advice to learn how to use IK rig and like you said, it is much easier once you understand it.
Right you're the guy I told about this
Yes I probably was the only person with this issue in a 100km radius considering there were 15 entries in this entire discord of the animclip log
The last people that asked about this were in the stone ages of like 15 BC.
ok im just too much of a level 1 animation and not a level 100 animation boss to figure this out myself.
I wish to transition from animation A to animation B half way through a timed action.
I thought maybe I could just re-call setActionAnim half way through using the update function but I realised that I do not know how I would do that (I saw an onTick event mentioned earlier but I extremely hate using onTick for things like this (really) and I believe there has to be a better alternative
Can you describe what your animations should do at what time exactly ?
So I have a timed action that lasts for 6 seconds and I want to use multiple animations during the action (aka use animation BrushTeeth for the first half of the action and then use animation BrushTeeth02 for the second half of the action)
I do such things in Infected Player mod
I will have a look when I get time, thanks!
Anyone know what could cause "Stack overflow (1283)
While performing: FBO.startDrawing zombie.core.textures.TextureFBO" crash?
You'll probably have better luck asking for help if you do this or post screenshots rather than post error fragments... A lot of the time fragments are missing important info:
!console
Help the people helping you by posting your console.txt from %UserProfile%\Zomboid.
For hosted servers, please also post the coop-console.txt from the same folder.
Also are you modding or using a mod? If you're making a mod, posting the code that produced a stack overflow is probably going to help people help you better.
It's a vehicle mod I have updated to include some door animations but the propblem is that it does not cause any issues with me. Seemingly only client who are connected to a dedicated server that has the mod.
Any time a client gets close to the vehicle or tries to spawn one in, they crash with 1283 code sometimes with the textureFBO and others from the drawVehicle java function.
But this doesnt effect everyone. Some server admins have said the mod works great while others have the problem
Then, in addition to a console log featuring the error, I would also share a modlist where it works great and another where it doesn't.
All this info together would help someone narrow down the issue in theory
I unfortunately don't have time and energy to help further than suggesting you provide more detailed info and just leave it here to increase your odds of getting useful help.
I'm crashing soon
But best of luck; the bugs must die.
the call stack would be very useful here, FBO.startDrawing is a low level part of the renderer, the issue probably originates from something incorrectly configured with the vehicle and something higher up in the call stack would probably indicate what that is
@bronze yokehi. what event i should use for this:
local function zReVAC2_SpawnRate()
local specZombieSpawnChance = SandboxVars.zReV2.SpecZombieSpawnChance * 0.001;
table.insert(ZombiesZoneDefinition.Default,{name = "zReVAC2_ZombieECO", chance= specZombieSpawnChance});
end
OnInitGlobalModData
thanks :ะท
local function initZREVACATraits()
local zReAntibodies = TraitFactory.addTrait("zReAntibodies", getText("UI_trait_zReAntibodies"), 10, getText("UI_trait_zReAntibodiesDesc"), true);
end
for this too? ^^'
technically you don't need any event for traits, but OnGameBoot is commonly used
@bronze yoke
local antibodyPowerRATE = {
[1] = 0.8,
[2] = 0.5,
[3] = 0.2,
};
local antibodyPower = SandboxVars.zReV2.AntibodyPower;
if LabRecipes_InfectionRate(player) > antibodyPowerRATE[antibodyPower] then
sandbox type like enum with 3 options.
it's right stuff in antibodyPowerRATE[antibodyPower]?
Anyone here crack the egg of growing trees properly?
From what I can tell by reading through the java, trees are handled by some mechanism in ErosionMain. I am trying to figure out how to trigger the game to adjust my mod-placed trees to be in the right season (like adjust the leaves and stuffs, force them to grow up, etc).
Ideally, my end goal is:
Create a tool which allows staff on a server to select an area then "trigger" trees in that area, whether it be planting new ones, growing existing, etc.
Specifically, I found NatureTrees, which is an ErosionCategory that gets triggered during LoadGridsquare under some convoluted circumstances which appears to handle tree growth and season changes.. but I just can not figure out how to hook into it to force it.
I am confident wind impact on tree tiles is handled by the tileset. I I wonder if it is the same for season tiles. Probably map gods could help you if nobody can do it here. Alree is one of them.
I don't remember either
You can just do print(ZombRand(0,1)) multiple times in the console and see what it gives you
thanks, from 4 to 11 xD
yeah as I thought
hey all, i'm currently working on my first firearms mod and i've run into a problem.
I want to make my weapon compatible with existing attachments e.g. the x2 scope with a sniper rifle.
But as far as I understand it, you have to set the property for both the attachment (MountOn) and the weapon (ModelWeaponPart).
My approach would be to redefine the vanilla attachments in my mod to include my weapon.
but this seems very cumbersome to me and I wanted to ask if there is a better solution?
Are you 100% sure about that? Cause for professions, adding them only via OnGameBoot will not suffice. Reason is that if a character dies and the player chooses "Create New Character" in the in-game-after-death menu, the game calls the vanilla function "BaseGameCharacterDetails.DoProfessions()". This will delete all professions and completely reset them. Deletion also applies to modded professions, but not the reset (reset only applies to professions added in "DoProfessions()"). So, in case you add new professions only via OnGameBoot, the result is that new professions won't be available anymore if players choose the "Create New Character" option after death. To fix the issue, the creation of new professions should also be appended to the vanilla function "BaseGameCharacterDetails.DoProfessions()".
I am not sure if this also applies to traits but since the vanilla game treats them very similar to the professions via a function called "BaseGameCharacterDetails.DoTraits()", I am wondering...
https://steamcommunity.com/sharedfiles/filedetails/?id=3208087133&result=1
New mod, enjoy! ๐
hi, how much i can lower condition for gasmask for example, what is the value, it is a integer or double? it is 10? or what?
hey folks, does any one know where trait properties are defined? For example, I can't find the properties of SpeedDemon or Desensitized.
In main creation methods, I can see the traits created:
eg:
TraitFactory.addTrait("SpeedDemon", getText("UI_trait_SpeedDemon"), 1, getText("UI_trait_SpeedDemonDesc"), false);
But I can't see where the specific properties are set. Does anybody know?
traits work backwards from how you're thinking, they don't really have properties associated with them, they just get checked for in relevant code
e.g. speed demon would be checked for in the part of the java that handles driving
I see, so that's hard coded
I just spawned the item in game and the condition is an integer. 10 is the pristine condition. 1-2 is worn, 0 is broken
In an animsets animation xml, what is the m_TimePc property? I have no clue what it is and I can only presume it triggers the event using that time but it is very confusing.
...
<m_Events>
<m_EventName>EventName</m_EventName>
<m_TimePc>0.50</m_TimePc>
<m_ParameterValue></m_ParameterValue>
</m_Events>
...
It seems the event isn't triggered at all if the m_TimePc value is >= 1.00
Anyone know if its supported to use the charge in Car batteries as a crafting component like water in a bottle?
Hello all. I have a question that I'm hoping someone can enlighten me on.
I want to create a standard recipe, that is not evolved, but allows two basic ingredients, but also have the option of using a different modded ingredient without requiring the dependency for that mod to be required/installed. Basically allowing the recipe to work IF the mod is installed, otherwise it works with standard base game ingredients.
Lets say a Cheese Sandwich for instance, that only requires Base.Cheese, and Base.BreadSlices. But lets say a separate mod also has "Sourdough Bread Slices", or "Rye Bread Slices".
Is there a way to include these in recipe scripts/lua code to allow them to be optional, but not depend on those mods to be installed/ran on the server?
Trying to find an open ended way to make recipes for items with potential for other mods to work alongside without requiring them outright.
Please let me know if anyone has an idea, appreciate the help!
Cant you just add the modded item normally to the recipe as you do with other stuff?
I'm not sure, but it looks like tags are made for such adaptability. It does not satisfy your 'vanilla pre-existing recipe' requirement though
i'm pretty sure you can just add the item to the recipe and it'll ignore it if the item isn't found (because the mod isn't loaded)
I could add an ingredient such as "Base.BreadSlices/CustomMod.SourdoughSlices", as an option. But I am unsure if it will require the linked mod to be loaded if I do that, or if it will throw an error. If that makes sense?
This is exactly what I'm trying to figure out Albion.
but if you add it in the mod override, it will not be in vanilla anyway ..
Well I want to include it as my own Module, not as part of Base game. Just meant that the recipe may use mostly Vanilla Ingredients, but would like to add options for modded ingredients as well, without it throwing errors, or requiring that mod to be loaded.
then use a tag
so other modders can add the tag to their own items
Any reference for using tags? I have not gotten so far into modding PZ yet, though I'm pretty well versed in programming in general.
Also, can anyone confirm what Albion said is true? That adding a modded ingredient to a recipe will just be ignored if the mod isn't loaded?
There are vanilla tags you could use as examples, looks for them in the existing vanilla script files then see how they are used in vanilla lua. beware some of them are also used in Java and could have specific behaviors hard to see only from lua.
I'm assuming they are just Referenced as "Tag=" in the script files?
I'd use 'Tags = Floor' as an exemple
Alright, great. Thank you
Putting aside that Albion is always true, you can test it in no time ๐. Trust does not prohibit verification.
i'm not actually certain about this one, but i do seem to remember it being that way
it should only take a few seconds to test, just add a completely fake item id to a recipe and see what happens
Thats true. I guess I was curious where to look if an exception is thrown on that, or if it's just not shown/ignored in a recipe.
Thank you all for your help!
Good looking mod, does it just retexture the van or adds a new one?
I might add it to our server, tbh.
I'm in need of some assistance when it comes to editing an evolvedrecipe via script; specifically it's MaxItems value.
evolvedrecipe Roasted Vegetables
{
BaseItem:RoastingPan,
MaxItems: 6,
ResultItem:PanFriedVegetables2,
Cookable:true,
Name:Place Ingredients in Roasting Pan,
}
local sm = ScriptManager.instance
function OverwriteEvolvedRecipes()
sm:getItems("Base.Roasted Vegetables"):DoParam("MaxItems","9");
end
I've tried formatting various ways within DoParam(), but nothing works. I suspect that getItems doesn't work for evolvedrecipes in the first place, but then the question becomes how do I edit the maxItems value in a mod compatibility friendly way?
indeed recipes are not items
I've tried getRecipes as well, does just as little, getEvolvedrecipes doesn't exist as far as I'm able to tell.
maxItems parameter of evolved recipes is only ever written by loading the script file. it is public though. My mods do not allow to write public parameters but maybe @bronze yoke 's mods can do so. (this is for once you got the list of evolved recipes)
RecipeManager.getAllEvolvedRecipes() or RecipeManager.getEvolvedRecipe(InventoryItem inventoryItem, IsoGameCharacter gameCharacter, ArrayList arrayList, boolean boolean1)
they're still read-only in my mod i'm afraid
Would any of those help with achieving my goals? The first one sounds like it would only return a list of all available evolvedrecipes, as for the second one I wouldn't even know what to do with it.
So a file overwrite is the only option then?
Progress on an old PC UI mod
When players sneak and are close to a wall, they automatically take cover behind the wall and use a different sneaking animation. Does anyone knows how to check whether a player is using this "close-to-a-wall-sneaking-animation"?
I know about the "player:isSneaking()" command to check whether player is sneaking but it does to tell whether they are close to a wall. Moreover, there is a command "player:checkIsNearWall()" but I am not sure what it does since it returns a float (not boolean). Seems somehow related to the problem but I am not able to figure out how exactly.
Is there a way to get the angle of the playerโs current FOV?
The view central direction is character:getAnimAngleRadians(). I do not know for the opening angles around that direction
it is computed inside IsoGridSquare.CalcVisibility. Good luck with that ๐ฆ
Thanks! Do I need to decompile the Java code to look at that? (I found your guide)
yes or look at available code the first few time before you decide to invest in decompiling. code can be found from PZ modding wiki links. here is current version: https://zomboid-javadoc.com/41.78/
Javadoc Project Zomboid Modding API package index
there are other options. I do not use them but others do around here.
I found this https://projectzomboid.com/modding/zombie/iso/IsoGridSquare.html#CalcVisibility(int)
but it doesn't say anything about what the function does.. do I need decompiling for that?
And what is the difference between projectzomboid.com/modding and zomboid-javadoc.com ?
declaration: package: zombie.iso, class: IsoGridSquare
One is updated, the other no
There isn't many differences tho
And to know what a method does exactly yeah you need to decompile, believe me you'll understand so much by doing that
You can guess what a method does by using it and seeing the result
I see, thank you! I guess I'll try to decompile then
i have a question someone here might be able to answer, i dont know anything about lua, ive read all the guides on here and checked the website and couldnt get my idea to work. so i figured ill ask here if its even possible.
i was trying to write code, that changes an items weight based off of its remaining use delta. kind of like how buckets of water change weight when they are half full, but to work for something like a pack of cigarettes that changes weight the more items you remove
does anyone know if thats even possible? or how hard it would be to pull off?
i'd try using a event like EveryOneMinute and in it cicle trough player items and if it finds the item you want you set its weight based on the useDelta
or every tick but this one can be laggy
the way i was trying to get it to work was on the recipe to remvoe an item, using OnCreate
so like you remove an item from the item with a usedelta, then it checks its weight and changes it
i tried for days, trying to learn lua/do it but i couldnt get it it work
Do you want to do this for items which have the field "Type = Drainable"?
Edit: Ok clear, ... you already wrote it. My bad. ๐
so remove the result item chache the useDelta of the item create a new one in the player inventory set its weight with the cached usedelta
Might be even better to only apply the weight change when the player opens an inventory menu instead of OnEveryMinute event. Performance might be better then...
yeah i didnt know it was only on a recipe
damn how do i send code
lol
Do you want to change the weight only after a recipe has been applied? Or are their other actions in game where you would like to change?
@indigo pasture you have to use the " ` " symbol three time at the beginning and at the end of the code
function Recipe.OnCreate.Oncreate(items, result, player, selectedItem)
local originalUseDelta = 0
for i = 1, items:size() do
local item = items:get(i-1)
if item:getType() == "YourItem" then
originalUseDelta = 0
end
end
local newItem = player:getInventory():AddItem("YourItem")
newItem:setWeight(originalUseDelta)
end```
uuh, basicaly the idea is to have items called liked "Boxed Engine Parts" for exmaple. where you can bundle up like 100 engine parts, then use a recipe to remove 1/5/10 at a time. then have code that updates the boxed items weight
thank you
And you can type lua after the first three ` to get syntax highlighting :)
in case weight should only change after a recipe has been applied, than what Pallontras suggested is the way to go
also that use delta is a value between 0 and 1 so you need to do some maths to get your desired weight
... although I am not sure how this should really change the weight of an item which has been used as ingredient. What this does is making a completely new item and setting its weight to zero. Or is this what OP wants?
function Recipe.OnCreate.Oncreate(items, result, player, selectedItem)
local originalUseDelta = 0
for i = 1, items:size() do
local item = items:get(i-1)
if item:getType() == "YourItem" then
originalUseDelta = item:getUsedDelta()
end
end
local newItem = player:getInventory():AddItem("YourItem")
newItem:setWeight(originalUseDelta * yourValue)
newItem:setUseDelta(originalUseDelta)
end```
yeah didn't see the 0 there
fixed it
well what im trying to do is made items like packs of cigarettes change weight when you remove an item from it yea
also need a new item for the result item if you remove it
no the result items fine. ill try it right now, thanks!!, i no joke spent like 4 or 5 days trying to learn lua and kept failing
i hope this works
Ok. So this assumes the ingredient item is fully consumed by the recipe (i.e. removed from the inventory)?
yeah i made it with this in mind
forgot to explain
uuh well no. its gonna be box that has 100 uses, then i was going to make a few recipes to remove certain ammounts from the box.
so i would need to remove the item first then add the new one right?
yeah
lol, so, first off. thank you very much for your help i appreciate it, but ive figured it out and it turns out its a vanilla feature, you just need to add the weightempty property to your item, figured it out cuz of a propane torch XD
Does anyone knows how I get the actual framerate the player is playing with in the moment I check? There is the "getPerformance():getFramerate()" command but it seems to give me only the Framerate cap the player has set in the display options
anyone got some kind of template for making signs? I wanted to make a sign so I could have a custom shop sign on a server I play on but idk how to go about it lol
i have the art itself just not like, isometric'ified or anything
i tried looking at dirkie's tutorial but he doesnt have a template linked for any uh, signs anywhere
Hey folks, does anyone know if a mod exists that muffles sounds from the outside of a vehicle, like the trigger when you enter a building? Does anyone know the particular event name/function for this that I could use?
Hello guys
I want to create a mod to change a simple thing :
Vanilla -> When a player is hit by a gun, he receive a bullet wound
My mod -> When a player is hit by a gun, he receive a deep wound
Do someone know where is the PZ code about damages received/gave into the game ?
Can't find where this is managed ๐ฎ
Reason: Bad word usage
damage states are stored in isoPlayer:getBodyDamage():getBodyParts(). you can access and change them anytime. (see Infected Player mod client/InfectedPlayerStats.lua as an example) and replace on player update any bullet wound by a deep wound. But I do not know how to avoid vanilla initial bullet wound at the time of damage.
Reason: Bad word usage
Thanks a lot @mellow frigate It's a good strategy, i will take a look.
Problem i think i gonna get is : sometime i want to let the Bullet wound, sometime i want to change it by deep wound and sometime by a scratch
I think with your player update function, i won't be able to get "new" wound : it will change all current old and new bullet wounds :/ isn't it ?
I was looking into PZ lua code, on lua events list... i can't find something linked to the moment where player get the injury
It will be harder to implement but you can add the conditions you want
Good morning, could anyone help me with some information?
I'm trying to fix a bug in my zombie kill counter, but I don't know where this information is saved. I already looked in the players.bd file but without success. If anyone knows where it is, could you send me a private message. Thanks
A bug in a mod you created affecting the zombie killcounter?
Exactly, I have a problem with a death counter mod..
I wasn't the one who developed the mod, I'm a developer and I'm trying to adjust this counter for the server where I play... but I've already looked in the .db files for this information and I can't find it...
But even though a mod is not used, where is this information saved in vanilla?
In each player's blob in players.db. But you have to decode it.
What do I need to decode this file? Today I am using SqlLite to open the players.db file that is on the server. Would I have to get the player.db that is on the player's machine?
In the players.db file on the server, not in the kill information
In the vanilla game, the character screen including the vanilla death counter are controlled by the lua client/XpSystem/ISUI/ISCharacterScreen.lua . Also, there seems to be a java command which can be used in lua to get the player's kill count: player:getZombieKills() . I didn't test this command but the vanilla code uses it on the appropriate places, so I guess it works in this way.
cool, I'll check this file and command... thank you very much for your attention and help...
Don't know about that .db file but in most cases, when you change something about the player's user interface (as displaying the kill count in a different way), this happens in the client folder.
interesting, I'll check the files saved on a player's machine... thank you very much my friend.
Hi, my Titled is having a stroke dealing with 2x textures. I might've messed up somewhere but I can't remember. Can someone help?
Reason: Bad word usage
Reason: Bad word usage
Is anybody working on a tinnitus mod and hearing protection? I think it would be cool for gunshots to cause temporary hearing loss without protection
Anyone know what container correspond to "PlankStashGuns" ?
ah yeah they spawn with events iirc?
https://projectzomboid.fandom.com/wiki/Floorboards_Stash ok i see now, thanks !
Uuuh idk, do they spawn with events ?
Perhaps
You can now build Moats in Project Zomboid https://steamcommunity.com/sharedfiles/filedetails/?id=3209330253
Hi @pulsar heath Excuse me, can I ask you a question about Twitch integration?
Hi there, sure
I have installed your mod, and it works wonderfully, I congratulate you
everything works very well, what doesn't work are the traits and the car parts
My game is in Spanish, could there be a problem?
I think it might be... I'm portuguese and the game doesn't like the punctuation used in languages like Spanish or Portuguese
I'll have a look when r get back from work and see if I can fix the issue.. Only been testing in english
Anything else feel free to dm me, I'll have some info for you tomorrow
Thank you very much M3ss, I await your response
Thank you very much for the mod, I congratulate you, we will be online
they can spawn on some places found on annotated map according to the wiki
I wonder if there will be any sort of changelog to codebase before B42 drops.
Would be a nice thing to have to stash fixes beforehand.
it'll release on unstable long before stable, that's your time to update stuff
On TrueMusicRadio the audio changes when entering or leaving a vehicle for the radio inside it. You could check to see if the player is in a vehicle and if the sound source is outside the vehicle... Then you would need to adjust the audio levels... probably on everything.
isn't that effect just accomplished by making it quieter? that's what i've seen in regular true music anyway
for a true muffle you'd want to pass it through a low pass filter, but i'm doubtful we have any power to do that from lua
anyone know the lowest rate that something can spawn in a procedural distro? like is it 0.01 the lowest or can you go 3 digits past the decimal, so like 0.001
well i used 0.01 for some items and they were spawning pretty frequently but didnt realy care for that item. but i got another item im tryin to make very rare, so was wondering how log can it go
Is there any way to find out the distance from a zombie to a car window? I need a loop that will check the distance of each window to the zombie, but it only turns out that with one window the code reads the distance either from all windows in the car or from the entire car as a whole
hey guys. I'm creating a mod where the client sends a zombie object to the server, and the server removes it from the map.
sendClientCommand("myMod", "removeZombie", zombieISO)
ERROR: sendClientCommand: can't save key,value=1.0,zombie.characters.IsoZombie@17bf7d6
Can anyone do it?
you can't transmit objects
an object is really just a memory address, it won't be the same between client and server
in this case i don't think you need to use a client command at all, zombies are usually handled by clients so you should just be able to remove it from there
but generally, you need to transmit something that can be used to identify the object on the other end, like some kind of id
Thanks for the answer. So when a client removes the zombie, it will have an effect on other players.
do your own testing but it seems likely to me
Is there an event firing more often than OnTick? Tried OnRenderTick and OnPlayerUpdate but they seem to be the same for me.
no, there isn't really a way to fire more often, that is the tickrate of the game
the best you could do is just run your code multiple times ๐
OnZombieUpdate will usually fire a bunch of times per tick
what do you need to call something so rapidly for?
I am trying to time the equipment of a clothing item exactly with a certain movement of the player. An my current impression is that it might be be not possible cause OnTick doesn't fire often enough. XD But the whole thing happens in the range of milliseconds. So a super small delay shouldn't be a huge think... But I am still playing around with things trying to make it perfect, Maybe I have some kind of OCD don't know XD
so something like 'equip this item the very moment the player crosses this tile'?
the game simulates in discrete ticks, so checking more often than once a tick won't actually give you more fine of a view into anything
nothing happens 'smoothly', just at a good enough tickrate that nobody can tell
yeah. executing the code more often won't do the trick in my case
I'm trying to make a minor change to a .class file but I'm really struggling, I come from powershell scripting so was expecting to just edit the line and put the file back in place but java doesn't work like that, is there a method I should be doing for this?
Anyone know what the m_TimePc event keyword in a animation xml file? It seems to trigger the event at a certain time but the metric I do not understand. I presume 0.10 may be a tenth of the animation's length?
What are you trying to do exactly ?
Uuh I wouldn't be too sure about that but I'm interested to know
Ngl java modding is a bit sus
Attempting to input a couple anticheat methods, this one being simply to add the steamid to the user at the point of user creation so the user we create is pre-bound to a steamid
We can do a python workaround to sideload it directly into the DB after the add but would rather the code takes both inputs and then that new file can be shared to server admins if they want it
Can't you already access that ??
Not directly in the server console, the steamid add command doesn't work, the normal add command doesn't accept extra variables
Add command ?
yeah theres an add command for steamid in the commands list
its just not exposed to the console it seems
Wait so what's your plan exactly ?
You just want to add the steamID of a player and link it to the character he's playing ?
No, we have a whitelisting process but it's very possible that applicants can just supply a steamid that isn't their own
So on whitelist add we want to bind it to a steamid before they even try to log in
Haven't been able to check yet, was going off first bat at viewing the java and my standard scripting logic does not apply to java
I haven't touched lua
Also didn't fancy writing out the whole process again in lua when I could append two lines in two files and achieve the same result
Bcs if your goal is just to kick players that are not in the whitelist steamIDs and you can access the steamID of a player via a lua function, you can handle everything from lua
goal is, people apply for whitelist, we do /adduser username password steamid and bind it all together at creation
The issue is that like I said, Java modding is sus. From what I understood it basically requires to recompile the whole code and redistribute it
Yeah I'm noticing that it requires recompiling the whole thing
All this can be done from lua as long as you find the function to access the steamID. I'll try looking for that later
If you know how to read the doc it shouldn't be too hard
Maybe this can help you, without recompiling java
https://steamcommunity.com/sharedfiles/filedetails/?id=2825060402
I'll have a look over this later, thanks
Looking at it, do you even need the java patch... ?
If you have ideas for the lua I'd appreciate a headstart on where to look, otherwise I'll probably dive into this in about 12 hours or so
And thanks for the responses both
Hi I have a question - does the moddata persist for all zombies? I am trying this and it seems to persist across zombie
local modData = zombie:getModData()
modData.isSprinter = true
modData.hasSpottedPlayer = true
Yes, it creates an exposed class for Lua for the server, and adds support for RCON. Which is not possible in Lua.
I am trying to put the item in my character's hand while performing an animation but self:setOverrideHandModels(nil, self.toothbrush:getStaticModel()) doesn't seem to work. I've tried switching around the parameters so that the model comes first but no luck.
Nevermind it's because getStaticModel is returning nil but the item itself is a ComboItem so it's not nil
Using the string "Base.Toothbrush" worked fine weirdly enough.
Why would you need that ? Aren't server commands doable already
Basically you would store the steamID within mod data, added or removed via commands like Elyon showed, and everytime a player joins you would get his steamID and check that he's within the list of accepted steamID and if so then don't do anything and if not then disconnect him
Client is literally the only instance that has some control over zombos.
Server doesn't even know if they are moving or doing anything right now.
It doesn't know the speed, what it does, its animation state in some cases not even current square of the thing.
hi guys, does anyone know why if I set the maximum condition of an item to 100000 it loses all the condition after restarting the server?
ConditionMax from InventoryItem is not saved and loaded for each item instance. see save and load methods of the class. I guess it reloads automatically the value from the associated ScriptItem.
ty, did you know what is the max value accepted?
I am doing a fix that fixes zombies during the night, in sp, vanilla game zombies don`t attack player through an open window and I wanna fix it, but it turns out that the calculation system does not work correctly and calculates the distance from ALL windows or from the entire car if at least one is open, that is, if you stand against the wall and open the window that will be near the wall (let's say the back right one), then if a zombie will approach the left front window, which is closed, the code will assume that the zombie has approached the open window
Whatever, as long as you change the max for the type, not the max for the instance.
how can i change that?
by changing the max condition field value in the script file of your item type.
that's what i did
You can now walk freely on Kentucky's shores: https://steamcommunity.com/sharedfiles/filedetails/?id=3209945047
restart a new game then or just create new instances of items. items compute their condition depending on max condition at item creation time.
i did try to wipe the game
what item are you using for your test ?
Hat_GasMask or Hat_NBCmask
i overrided this items and added a MaxCondition value of 100000
ok, then restart the game and create a new instance of Hat_GasMask.
yeah but if players use this item and than i restart the server they lose all the condition from the item you know?
how can i solve this problem?
yeah that's why we only change mod lists of servers between wipes.
but i did wipe the game but every time i reboot the server the condition is gone, idk if i managed to been clear
Is there a way to reload all LUA without having to go back to the main manu, and back in the game?
Cause i'm modding the inventory UI and this is painfull and distracting going back and forth every time >.<
No but you can reload the inventory UI...
And your mod files...
Fwiw
I don't have the code but the chunk is available in Wookiee Gamepad Support
In the inventory and loot file
Using the F11 menu reload the files for the vanilla INV UI and then my UI?
Used for resizing it properly in game on gamepad
Probably. Depends on what exactly you're trying to do and how you're implementing it.
beware overriden callbacks and event registration reload can be tricky. it changes a lot your design to allow smooth reload.
Well, thank you, I need to investigate that.
On an unrelated note, did anyone try to use the Teal language to mod zomboid? I'm feeling very very tempted to use teal to write my mods instead of raw lua
If you decorate functions or register functions to events, you can copy paste the override into console to redecorate the original function (assuming you globalize access to the necessary variables). Functions that are attached to events can be removed, modified, and re-added
Teal is good for more complex mods and requires familiarity with static typing, it's not useful for relatively simple mods, which is what most of the workshop is. I personally prefer the dynamism and directness of Lua.
( @gilded hawk )
Agreed, I really appreciate Lua these days. When I first met Lua and Lua said, "You must index my stuff from 1," I raised an eyebrow so high it popped off my head, but despite this I've come to really like it
By decorate function, you mean using pre and post hooks like this?
local old_ISInventoryPage_render = ISInventoryPage.render
function ISInventoryPage:render()
old_ISInventoryPage_render(self)
end
Yeah like in that case you would need to copypaste your render to console, but first you would need to make the backup function global for testing, or better yet put it in a returned local module and import it to the console for global use during testing
If you just paste the override into console it won't be able to see old_ISInventoryPage_render
Yeah that makes a lot of sense
Also, talking about something else, does anyone know a way to store the reference of a container to easily check it's content even when a player is far away?
Like, I have this shelf, and I want to make it so that I can remotely send items to it.
I found a way to move items remotely, but I haven't found a good way of easily store the reference to the ItemContainer
You need Global Object management. I strongly advise to use TchernoLib GlobalObject service because it simplifies (a lot) vanilla interface. It remains complex.
I'm not surprised to hear that someones as skilled as you already found a way to use GlobalObject in a simpler way
I'm still smashing my head against the wall with it
I will have a look, thank you.
I'm blushing
hello guys why mods dont work in server?
You may be looking for #mod_support
Looks neat, but I wouldn't use it for modding for the same reasons I don't use Moonscriptโwould involve a more complex workflow for testing (a build script is easy to set up, but still requires an extra step even if set up to build on save)
I prefer annotation comments for typing
Do you mind sharing how you are writing tests for your mods? It's something I never did on lua and mods
Oh, I meant for testing the mod in-game. I did use busted to write some tests for my library & theoretically you could do the same for mods but I haven't ever tried to
Examples of some busted tests: https://github.com/omarkmu/pz-omi-lib/tree/main/test
Lua utility library. Contribute to omarkmu/pz-omi-lib development by creating an account on GitHub.
If done for mod files it'd probably be best to have them outside the actual mod directory so the mods aren't bloated with tests that'd have to be written to not run ingame anyhow
Hey guys. I need server.lua to get the list of all zombies on the map. Can anyone do it?
This works in client.lua to get zombies from the player's current cell:
getWorld():getCell():getZombieList()
However in server.lua I need something like this:
getWorld():Cell[0]:getZombieList()
I've been searching for days but I can't find a solution.
I also looked into something like this, and it doesn't seem feasible without loading the cells in question(?). I know sounds can pull zombies from around the map / unloaded areas but yeah.
So server.lua cannot access data from cells loaded by players?
Hi guys! Anyone can tell me if I can transform an item in another one when is become rotten? Like making milk convert to yoghurt when it is rotten ๐
Check the ReplaceOnRotten script tag. For example Icecream
item Icecream
{
DisplayName = Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Icecream,
Packaged = TRUE,
ReplaceOnRotten = IcecreamMelted, --- it's replaced with melted ice cream
DaysFresh = 1,
DaysTotallyRotten = 1,
HungerChange = -30,
UnhappyChange = -10,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IceCream,
Tags = GoodFrozen,
}
i will see! thanks ๐
Can you clarify what server.lua is in this case? If you mean server code, yes/no - how the game handles network data is complicated.
Clear! It is a multiplayer mod. So server.lua is the file that will be executed by the server.
I simply need to get the list of zombies and delete some from the map.
If I do this on the player side (client.lua), the zombie:removeFromWorld() command doesn't work. So I need to find a way to do it on the server side.
Any reason why item is not going rotten?
item Fermented_vinegar
{ DisplayName = Vinagre fermentando, DisplayCategory = Food, Type = Drainable, DaysFresh = 1, DaysTotallyRotten = 1, ReplaceOnRotten = Base.Vinegar, UseDelta = 0.1, UseWhileEquipped = FALSE, Icon = Icecream, Weight = 0.3, WorldStaticModel = Vinegar, }
Try without Base.
I might have the code for that. Let me look it up.
in lua/client
local function onZombieUpdate(zombie)
local onlineID = zombie:getOnlineID();
sendClientCommand("ZoneProtection", "RemoveZombie", { onlineID = onlineID });
zombie:removeFromWorld();
zombie:removeFromSquare();
end
Events.OnZombieUpdate.Add(onZombieUpdate);
in lua/server
if not isServer() then return; end
local ZoneProtection = {};
function ZoneProtection.RemoveZombie(player, args)
local function deleteZombie(id)
local zombies = getCell():getZombieList();
for i = 0, zombies:size() - 1 do
local zombie = zombies:get(i);
if instanceof(zombie, "IsoZombie") and zombie:getOnlineID() == id then
zombie:removeFromWorld();
zombie:removeFromSquare();
return;
end
end
end
--print("[ZoneProtection] RemoveZombie request from: "..player:getUsername())
pcall(deleteZombie, args.onlineID);
end
local function onClientCommand(module, command, player, args)
if module == "ZoneProtection" and ZoneProtection[command] then
ZoneProtection[command](player, args)
end
end
Events.OnClientCommand.Add(onClientCommand);
#mod_development message <- has an explanation on how networked code works.
Yeah you just need to make sure it gets updated for each clients
what is pcall ?
But I'm pretty sure removing the zombie on the client side will remove it for the server using remove from world etc
protected call
what does it do ?
Looks weird to define a function within another (I mean I do it too but in this case making it local in another function)
A quick question, how do I make it so that when the character puts on a specific hat, his hair disappears?
masks ?
You use masks I believe
So that this stops happening
I suppose so, but is that in the helmet/hat pro guid?
thank you so much!
I don't remember, give me a sec
executes a given function and catches any errors that occur during its execution
i put here?
unfortunately, when I remove a zombie on the client side, the zombie is recreated again, after a few milliseconds, in the same location where it was before.
Did you use remove from world/square'?
zombie:removeFromWorld(); zombie:removeFromSquare();
removeFromWorld()/client
So prevents any errors from popping and that's it ? What is the point of using it ?
the zombie is removed, but is instantly recreated.
I didn't find a mask to make my hair invisible ;q
Looking at the debug stuff a command does seem to be needed - weird as you can kill and move bodies around without one
Pretty much, it prevents any unhandled errors from interrupting the server and crashing it. Zombies can disappear by the time the command gets from client to server due to timing, desync, stale zombies, ...
What a error fixifier was supposed to be lol
Ask in #modeling , there'll be people who know more about it
Ok thanks :)
Wait what, errors can crash a server ?
Some yes, depending on severity
It got rotten but no replaced ๐ฆ, correction it disspared
good to know
I mean it SOMEWHAT works
It doesn't halt execution if there is an exception 
We do this in our EventZones mod: Maybe you can glean something useful from how we protect zones:
Sorry, replied to wrong person.
ะัะตั
ะฟัะธะฒะตัััะฒัั ๐ค
ะััั ะ ัััะบะพัะทััะฝัะต ัะฐะทัะฐะฑะพััะธะบะธ ?
Greetings to all ๐ค
Are there any Russian-speaking developers?
We do this in our event zone mod (see message above)
I am very grateful to you. I will use part of the code and give you credit in the workshop.
Is your mod public?
Its in our pack
https://steamcommunity.com/sharedfiles/filedetails/?id=3210604443&searchtext=
So guys, I made a mod that adds the clothing of CRM soldiers
From the series "the walking dead the ones who live", I would be grateful to anyone who wants to take a look
does anyone know if you can use lua to override vanilla distributions of items? specifically the min/max
is there a particular reason to use Intellisense IDEA IntelliJ over Krakatau, Procyon, Vineflower, JD-GUI (github.com/java-decompiler), or others?
Is it possible to make a recipe with a chance of failure or multiple items, such as 1-5?
With how fernflower appears to still be the integrated decompiler in IDEA I didn't list it above (https://github.com/JetBrains/intellij-community/commit/2f2c4ee0d0f1648307ed7e1b08530fba8fefcf97) if any of you are familiar with decompilers and are wondering why I didn't ask about that one
use what you want
the main reason guides point to it is just because a lot of people in the community already use intellij anyway
is it standard in academic circles or something? At the risk of derailing the channel
to my knowledge intellij is the most popular java ide generally
oo I'll have to look into stuff. when I took DS&A in java aeons ago lots of people had to do extra tutoring/etc to try and get eclipse to work right
I wish I knew how to answer this since I kinda buried it with a secondary convo. So I'm bumping
oh, you can implement any custom recipe functionality in lua with the OnCreate recipe property
I just wanna say I prefer vineflower over IntelliJ's one because sometimes vineflower makes stuff easier to read (as in it decompiles it into more readable code)
but that's my opinion of course
Also what does ISInventoryPaneContextMenu.transferIfNeeded do? What is the "needed" part of it mean? I thought using this function would transfer the item from a backpack (before I recursed the inventory for the item) to the main inventory if it wasn't already in the main inventory but it does not do that. Is ISInventoryPaneContextMenu.transferItems what im looking for?
Can someone help me? i'm having several issues. my first issue is that his head is translucent, and my second is that clothes are not hiding his body parts.
your model faces normals are inverted
how in the hell did that happen
idk happen with me all the time
thank u gamer
np
that fixed it 100%
but how do i fix clothing clipping
i thought clothes hid your body parts ๐ฆ
like
some clothes dont hide my body pa rts
then theres cases like tihs
i dont wear these pants but idk why this is even happening
most pants in general seem to hide his foot and arm??? but only one of them???
Reason: Bad word usage
Reason: Bad word usage
Reason: Bad word usage
hi guys!
I am still trying to use the ReplaceOnRotten param to make an item to be replaced on rotten, but whenever the item is rotten it dissapear :S
First question, type Drainable cannot be rotten?
Anyone knows why the item is rotten and then it dissapear instead of been replaced? Could it be that chaging from a type to another is not allowed? (FOOD to DRAINABLE)
Hello wonderful people. I was working on a little tool to parse and display the distributions. While making this I found some errors in the base game code. @tribal remnant Convinced me to turn this into something useful. I am not great at UI stuff, and noob to WPF, but I'm have a separate project for the logic, so if someone with some (Cross Platform? Not sure if AvaloniaUI for example is still a thing?) UI experience comes along, it won't be hard to switch the frontend. Enjoy the random screenshot of me failing to DataBind xD. Probably need to set templates for the rows or something. I'm also very new to PZ, so any suggestions on problem areas for modders that I could automate would be very welcome ๐
๐
Can anyone help me
With this?
If so, I don't know the answer, but you might have better luck in #modeling
I would dupe your questions over there
wanna port tabletopsim mtg to pz? xD
this is MTG
Also had to google tabletopsim and felt dumb to realize it's table top sim ๐
anyone know of an easy way to change the min/max of a procedural distribution?
i wana make all ammo have a max cut off that isnt 99. to limit the ammount of ammo that can spawn.
and i wana do it for like all guns storse/military bases but have diferent cutt offs for each place. so like gunstores only have a max of 10 while military bases can have 20/30 or wtv
You can modify it as you would a lua table
Using the OnGameBoot event, I modify the game's distro
This is what I do to add items, but nothing stops you from looking up the correct entry and modifying it.
table.insert(ProceduralDistributions.list[distID].items, item..sealed)
table.insert(ProceduralDistributions.list[distID].items, chance)
distributionTable.gunstore.locker.procList would get you to that table
but then the entries aren't keyed, so you'd need to forloop to check the name
got it. thank u m8
Did you ever tried to add a custom trait to a player (not yourself) in multiplayer? I mean creating a trait with a mod and then right clicking a non-admin player to add the trait.
I'm starting to believe there is a bug in the base game.
- I can add the trait to myself as an admin, I see it and it's still there after I relog.
- If I add the trait to another player then I do see the trait in the admin window but the player can't see it. If the player relog, it's not there for any of us.
- If the other player gets the trait from something (like a custom journal calling AddTrait() ), I don't see it as an admin, but he sees it. It's still there after a relog. If I add the trait from the admin panel then I see the trait in the admin panel but the trait disappears on the player side, even after relog.
Reason: Bad word usage
Does this seem to affect all traits or a specific trait? I know traits declared in client will disappear upon certain interactions with the admin tools because server does not know the trait exists.
looks to me that you are wearing clothing items which are configured to mask the right arm and foot (meaning they make them invisible). not 100% sure though
I'll add that functionality to the editor I'm working on soon
this is somewhat related, but does anybody know of a mod that despawns logs or what is so special about them that is doesn't allow them to do so?
Logging then probably goes the same route as placing them on the floor which I think ignored removal
You'd need to pick them up and drop them (rather than place) I imagine
its weird since logs for some reason do not despawn even if they aren't placed
Is there a way to see what TimedAction the player is currently doing?
ISTimedActionQueue.getTimedActionQueue(playerObj).queue[1].Type
queue[1] will be nil if the player isn't doing an action
many thanks!
Please, how do I place an icon in my "submenu"?
ike in the mod building menu that has a hammer symbol
I wanna make a custom Background for my own personal use only (with my own art) but I have no idea where to begin
how would one change the text for "click to begin" to something else? I'm stupid and I cant find it lmao
In TableBuildMenuMachines.lua line 52:
local newCarpentryOption = context:insertOptionAfter(getText("ContextMenu_Build"), getText("ContextMenu_Machines"));
newCarpentryOption.iconTexture = getTexture("media/ui/building_menu.png");
I see you have already copied the icon from the building menu, replace it with whatever image you want, preferably 20x20px. And change the name of the image too.
making a chevalier primani
so that's what I wonder how do you have access to this? lol
Because I hadn't posted it anywhere, I tried to do it, but I couldn't, so I came here to ask for help.
by downloading your mod
So does that mean I sent a broken file to the workshop?
When I tried to do this, there were some errors and I went backwards
probably
Thank you for your help, and also for reporting this bug
dear indie stone please get rid of red pixel in e_riverbirchJUMBO_1_10.png thank you.
Most likely not the place for that lol
true but i am modding ergo I chose here instead of general cause i couldnt post a picture there lmao
Is their an easy or efficient way to execute code when the players completed all TimedActions which they had in the TimedAction queue?
Specifically, what I need is this:
- if player is not doing a TimedAction, then execute some code (no problem here for me)
- if player is doing TimedActions, then wait for all TimedActions to complete and execute the code then (that's my problem)
Only way to realize the 2nd part I could think of is to use something like the OnTick event and check every tick whether TimedActions are done. However, I am afraid that this might not be good performancewise in case the player has a lot of actions in the queue.
Ideally there is some kind of lua event which fires when the queue has emptied but I didn't found such an event yet...
hook ISTimedActionQueue:onCompleted
if after that function is called self.queue[1] is nil the player has completed every action in their queue
you might need to hook ISTimedActionQueue:clearQueue and stopDoingActionThatCanBeCancelled (unqualified global function) to catch cancels too
Hello yall im looking to commission a mod for my single player world
Many thanks again! Seems to be exactly what I need!
If anyone knows how to get a retexture for the base trees to work let me know! I've tried packing the textures into a pack file but the trees look the same in game.
possibly they require manual download
Try replacing the base game file of the trees with your own and see if it changes them
If it doesn't, the issue most likely comes from you, if it does work but didn't work within a mod then that's probably due to the need for manual download (and you're fucked and have to make a guide on how to download your custom trees textures for people on your modpage)
I've seen mods not require manual download for it, I think I might just be packing the file wrong...
I'm pretty sure if I replace the base textures it will forcibly work when what im tryin to do is use the mod to change it like how other mods do
I've never seen mods replace the tree's textures
so idk
also there isn't much info about .pack yeah
Perhaps you could ask in the mapping Discord
They probably know more
got it worky with help of mega chad who is the only mod maker ik who did it
Nice
Do you have an idea when exactly this stopDoingActionThatCanBeCancelled function is called?
I am just getting started with trying modding for PZ.
I've made a new trait that starts you with a fanny pack full of maps, and I'd like to equip the map to the character. Having trouble finding info on this or other mods to reference for this particular step.
Any pointers?
Here's how the lua code is set up now...
local function onGameBoot()
TraitFactory.addTrait("WellTraveled", getText("UI_trait_WellTraveled"), 3, getText("UI_traitdesc_WellTraveled"), false, false);
TraitFactory.sortList();
end
local function onCharacterCreation(playerObj, square, profession)
if playerObj:getHoursSurvived() == 0 then
if playerObj:HasTrait("WellTraveled") then
local fannyPack = playerObj:getInventory():AddItem("Base.Bag_FannyPackFront");
local maps = {"Base.MarchRidgeMap", "Base.MuldraughMap", "Base.RiversideMap", "Base.RosewoodMap", "Base.WestpointMap", "Base.LouisvilleMap1"}; -- Add or remove maps as needed
for _, map in ipairs(maps) do
fannyPack:getItemContainer():AddItem(map);
end
-- equip the fanny pack to the front here?
end
end
end
Events.OnGameBoot.Add(onGameBoot);
Events.OnNewGame.Add(onCharacterCreation);
is anyone here in charge of the modded mod manager series?
To equip the fanny pack to the body, you can try
playerObj:setWornItem("FannyPackFront", fannyPack)
Morover, for adding your trait properly to the TraitFactory, you might append some code like
for i=1,traitList:size() do
local trait = traitList:get(i-1)
BaseGameCharacterDetails.SetTraitDescription(trait)
end```
to your ``onGameBoot()`` function . This is to ensure that your trait gets its correct description in the pregame-menu where you can select traits (or does your trait already has your description displayed??)
Another thing I would think about is to addtionally append your ``onGameBoot()`` function to the vanilla function ``BaseGameCharacterDetails.DoTraits()``. This is to ensure that your new trait is still shown in the trait selection menu in case a character dies and the player chooses the "Create New Character" option (i.e. playing with a new character in the same game world where you could find your old character dead/zombified). So using smth like
```local vanilla_DoTraits = BaseGameCharacterDetails.DoTraits
function BaseGameCharacterDetails.DoTraits(...)
vanilla_DoTraits(...) -- execute vanilla function
onGameBoot() -- execute your trait function
end```
Btw: for polishing your fanny pack stuff, you might also want to check whether the player already has another fanny pack in the inventory. Could happen if the player manually chooses a fanny pack during character creation. This shouldn't result in bugs but in this case, a character may start with 2 fanny packs. So in case you want to avoid such a situation...
Wdym ?
Thanks so much for the details and advice!
The description is appearing properly when I create a new game and select traits for my character, so I'm not sure if I need to make your second suggested change?
I didn't think about creating a new character on the same world, great tip! ๐ฎ
Ok. Then you might not need the iteration through the traitList. I just thought about this cause you need this when creating a new profession, so I thought traits need it as well since the game treats them quite similarly.
For the thing about creating a new character, best idea is to simply check how your code works in this case. If your trait appears in the menu, then it is not necessary to append it to DoTraits . Just thought about this because again, this is necessary for creating new professions...
the mods like, remake mod manager, mod load order fixes copy other players load order etc
As it turns out, it does appear in the traits list for a new character on an existing game too. ๐
Thanks! I definitely want to be adding professions soon too, so I'm sure this will be useful info.
I am going to make the mod add some random maps instead of a set list, and I want to come up with something else for the trait as well.
Trying to add some 3 point traits to flesh out the list.
Hello! I'm trying to add an "RequireInHandOrInventory = Base.Pen" parameter to the crosswords and wordsearch magazines so they will require it to use them, but I can't achieve that. Could someone help me with that, please?
also I just wanna know how to add any parameters to any items or recipes
You mean the addons that use the name "Mod Manager" ? No I highly doubt anyone manages that
Also know that any load order mod you find doesn't actually do it right nor is there a point to it
Most cases, unless you use mods that keep replacing vanilla stuff you end up with mods rewriting the same thing, load order will matter but even then they might just be incompatible. Anyway in most cases you only need load order for maps
And that's it
Hello guys !
Do someone know how to create a recipe which result into two items of different name please ?
Rather complicated, but this is what Mackus did in MoreBrews. Hope this offers some useful insight on how to fix the problem.
You can add anything in the OnCreate functions overloads of recipes. see recipecode.lua line 373+
@anyone Do you know how a mod can affect tile blending ? I'm having a hard time with double water blending recovering my grass tile see here: #mapping message
has someone already added zones from lua ?
zones ?
IsoMetaGrid.Zone
Has anyone considered replacing all of the zombies in the game with silverback gorillas? That would be scary I think
this is a good idea i like this
someone should do this
actually nevermind fuck you
jk ily
Planet of the Apes
wow nice code, but just starting 2 days ago modding xD... but i will come back when my knowledge level up
Just give your idea, or no one will ask you since we have no idea what your idea can be
No point in teasing nothing
hi, what is the difference between SandboxVars.MyModId and getSandboxOptions():getOptionByName()? I see them being used for similar reasons but why would they be interchangably used and not one or the other?
there is no difference
the second one is much uglier and is probably only used by people who don't know about the other one or saw it somewhere and assumed it actually did something differently
Which is why i was asking if it was all made by one person or a group of people
one of those addons should be a load order jumbler in order to load things properly, cuz yknow mods be all round the place especially with big load lists
something similar to rimpy's "sort" would be cool
the original mod's creator has not been around for a long time, the addons are created by whoever wants to
Today I will make tomatoes require tomatoes to grow. (Progress on the silly farming patch mod!)
Was mostly tampering with additional items required to sow a seed. Tomato just happened to be convenient.
And like I told you, load order barely matters in PZ, and like I told you it only matters if mods either replace the same vanilla files (which most mods don't) and probably means they are incompatible anyway (load order between 2 mods that replace the same file will just make the last loaded override the first and thus probably break the first mod)
It matters also for dependencies but if the modder did its job correctly, it doesn't matter
Even if a mod adds a possible compatibility with another mod that's optional, the load order will not matter either if the modder wrote its code correctly (so like add a check for that other mod on save load and not on game boot, so that way if the optional mod wasn't loaded before it will still be detected)
Load order matters for maps tho here I have no idea how it should be handled and I doubt there are virtual rules on how to load maps between each others, or at least there's probably no info in the files itself
Maps that replace the same cells will be compatible, one or the other will be deactivated in the worst case and it could show the in-game map of the other one thus rendering in-game map useless (like spawn in the forest but on the map it says there's building there)
In the actual worst case, a map replaces only half the cells used by another map and you end up with half a map crossing another map, so let's say 2 city maps will just bend weirdly with others and will just be like those chunk bug of Minecraft
So no, we don't need a rimpy's sorter
Also back then when rimpy existed, it didn't actually properly order stuff
It was just fake load order and could even in fact cause more problems
yeah but now its way better and the rimworld modding community pretty much recommends it all the time
Unless you mean just an outside tool to manage mods, which we have mod manager sort of for that
Possibly yeah, I haven't played for ages
what outside tool would that be? i only know of the steam mod manager thing which is sorta built into the game
and yknow the vanilla mod manager
Hesitant to come back since it always took me days to order my modlists, perhaps I should look at it, also missing on so many new stuff
Rimpy is, or at least was, an outside tool to order mod lists way easier
It was basically mod manager but as an app outside the game
oh u were refering to rimworld in that point
i thought you meant there was one for zomboid ๐
Nah yeah Rimpy
Can you get running speed and strength?
Give me a sec
You can access:
-Speed
-Sight
-Hearing
-Cognition
You can't retrieve:
-Memory
-Strength
-Toughness
-Transmission
If I'm not mistaken
In my mod I access the stats of a zombie and if they are the right one I don't have to update them
But in the case of those 4 last ones I have to update them multiple times to make sure they are the right one and then I stop updating them
The way I do it is by accessing the classFields of a zombie
You can't do in the base lua but Albion has a mod to do it:
https://steamcommunity.com/sharedfiles/filedetails/?id=3001901955
What this allows you to do is this
zombie --your IsoZombie
local zombieSpeed = zombie.speedType -- for some reason I don't use it I don't remember why)
local zombieSight = zombie.sight
-- etc
-- .hearing, .cognition
-- .strength exists I believe but I didn't use and I don't remember why
You might be able to use .strength and access the strength
I don't remember why I didn't use it tho
thank you very much for the detailed answer, I received the referral, I will try
Oh yeah I remember now
.stength doesn't work
The reason is that the value of strength is modified by the toughness of a zombie
So you will not access the actual strength defined with sandbox options
You'll recieve a value of the strength that's defined based on toughness
toughness can't be accessed either
Your best bet is to make sure toughness stays the same for a zombie, or find out how the game defined the strength based on toughness (by looking in the java)
Also for Accessible Fields, you just have to download the mod and active it, nothing else
You don't have to import anything in your lua files
Just make sure to require the mod if you end up using it
Also there might be methods to access the speed of a zombie a different way
out of curiousity, why aren't classes fields accessible in the first place without mods? Is that intentional by the devs?
i'm not really sure but it seems intentional
accessible fields is just a bunch of metatable hackery redirecting to the methods used by the debugging ui to show class fields, so the lack of it isn't an oversight at the least
the api that uses is really really unwieldy for literally any other application though, which is why i wrote accessible fields
i think those methods are just a wrapper over java's reflection library so it might just be that it wasn't something they needed until then, and that was the easiest way to do what they needed it for
the inability to write to fields is overtly intentional but i don't really know what the motivation for that is
i think they're just kind of afraid to expose any more reflection stuff than they have to, which is kind of fair
Fair enough i guess. Accessible fields made my life so much easier on so many accounts so great job with that
Hi all
Iโm trying to go about commissioning a mod, me and my group are having trouble finding any takers
Just a mod that adds PTT to radios while still being able to use voice activation for proximity chat maybe even some sound effects to the start and end of the message like a click, beep, static etc
And to be difficult some radio like effects to voices coming through radios
Thanks!
You manage the HP of the zombie yourself right ? I'm doing that for my tanky zombies too
when working with distribution files, what is the most number I can add for rarity? 0.001? or can make it even more rare?
I set their HP very high and just keep track of the damage dealt to them and if it falls under 0 the zombie is killed
so looking at the rarirty in my distribution file
if it was 0.1 and i make it .001 im essentially making it 100 times for rare than before correct?
oh no that is 1000 times more rare
hmm... something like that, but nope.
if u work only with hp your melee weapon stack damage over 4k after 3 hit +-
and in online work only 270-300hp if im not wrong
i drop that code after hour +-
not home at this time
zReJuggernautOutfits = {
"zRe_Military_exo3",
}
local function zReZombieisJuggernaut(target)
local zombieOutfit = target:getOutfitName()
for _, v in pairs(zReJuggernautOutfits) do
if v == zombieOutfit then return true end
end
return false
end
local function OnWeaponHitCharacter(attacker, target, handWeapon, damage)
if not (target:isZombie() and zReZombieisJuggernaut(target)) then return end
if not target:getModData().zReZFlag then
target:setHealth(40)
target:getModData().zReZAbsorb = 50
target:getModData().zReZFlag = true
target:transmitModData()
end
if target:getModData().zReZAbsorb > 0 then
if handWeapon:isRanged() and target:isOnlyJawStab() then -- if ranged, disable resist to instakill and damage stack
target:setOnlyJawStab(false)
end
if not handWeapon:isRanged() and not target:isOnlyJawStab() then -- if melee, enable resist to instakill and damage stack
target:setOnlyJawStab(true)
end
local AbsorbDamage = 0
if handWeapon:isRanged() then
AbsorbDamage = 1 -- need improve for weapon category/type/caliber etc
end
if not handWeapon:isRanged() then -- if melee, stagger on
target:setStaggerBack(true)
AbsorbDamage = 3 -- need improve for weapon category/type/one-twohands
end
target:setHealth(40)
target:getModData().zReZAbsorb = target:getModData().zReZAbsorb - AbsorbDamage
target:transmitModData()
--target:DoZombieStats()
else
target:setHealth(2)
target:setOnlyJawStab(false)
--target:DoZombieStats()
end
attacker:Say( "zReZFakeHP: "..tostring(target:getModData().zReZAbsorb).." Health: ~"..tostring(math.floor(target:getHealth()*100 - math.floor(damage * 100))) )
end
Events.OnWeaponHitCharacter.Add(OnWeaponHitCharacter)
Reason: Bad word usage
Hello, I'm trying to get what the player is looking at when holding down the right click the problem I encountered is that the code I made does not return a value between 0 and 360 so could someone help.
During my tests, that in fact didn't really happen
Like yes the damage will ramp up, but not to such extremes
And surprisingly my damage was staying constant after a while
3-5 melee hit
It's been a while I've worked on it now but I believe the reason might be that the damage increases based on missing health of the zombie or some shit like that ?
iirc, player:getDir():toString() will return a string value telling you at which direction a character is facing, for example "N" for north or "NW" for north west. Not sure if that might help you.
if im not wrong, here exist stuff If your strike hits only the same target (a chain of continuous strikes), then each strike increases by a percentage.
I'll have to check that out
But in my test of my function that allows higher HP amounts, the damage stopped increasing after a certain amount
I set my zombie health to like 5k
more then 300 hp (30.000 flat hp) not work in mp
zombies just like ghost something like this problem
Really ?
That would explain many issues I got with Bloaters in the original mod then
Zombies having their outfit disappear and shit
by 300 hp you mean setHealth(3) or setHealth(300) ?
300
setHealth(300)
hmm
I never went that high in the original mod
I don't remember to how much it's set wait
I was referring to the player rotation degrees.
I have an idea for a mod, but I was hoping to get some feedback on how plausible the idea would be to implement?
go on
Did you try ?
player:getDirectionAngle()
There also:
player:getLookAngleRadians()
Something similar might already exist, or it might not quite work; let me know either way ๐
The idea stems from being disappointed that books & magazines disappear after reading, because if the world ended I would end up re-reading the same content time and time again, albeit with diminishing returns each time (as I do IRL).
The easiest implementation I've imagined would be after reading a book/magazine, remove it from the inventory and replace it with a "used book/magazine" item with reduced stats. The downside to this is that after you've read something, the leftover item will still only provide the reduced stats for any other players reading it for the first time.
The preferred implementation would be a system where books & magazines are randomly assigned an ID from an array on generation to determine the book/magazine title. After reading, the item would remain in the player's inventory, and a variable in the player file would record the amount of times that particular array ID has been read. The stats would be determined per-title, so a book that you've read 5 times would still be called "The Old Man and the Sea", and would still provide a full bonus to another player who hasn't read the book yet.
The second implementation might require some further work for balance, but I personally love the idea of gathering a library & knowing it won't suddenly disappear.
How can I check if an IsoSquare is in a safehouse or not?
This sounds like a such a good immersive idea!
Well shit, that's exactly it.
Oh man, it even refills to generate the same amount of boredom relief if you wait long enough between re-reads.
Part of me is bummed because I kinda miss coding, but it IS a beautiful feeling to have your dream mod simply handed to you.
Yeah, I get that feeling, on the brigth side, it means that your idea was so good that someone already made it.
ups
sry about that
here ya go
This mod makes it so magazines don't disappear and you can reread them
(sort of)
It's not perfect in my opinion tho
I like that way of thinking-- PLUS now I know that's "easily" achievable if at least 2 other people have tackled the issue before. Gives me reason to continue thinking big! ๐
like Armor Absorb System :ะท
Yeah!
A lot of really cool stuff in this one; thanks for sharing!
Doesn't reduces the stats the magazine gives but instead you get a new item that you can do different things with
That's crazy to get examples of BOTH implementations I had imagined. I think the biggest lesson I've learned today is how bad I am at searching for existing content.
Know that a lot of stuff is possible in the game
It's one of my favorite projects ๐
Something about finding titles stimulates my brain idk why
Plus stuff like this can occur, which I know it's ground breaking gameplay, but made me laugh
@sour island Do you remember me mentioning you the loot manager thingy I wanted to make?
Vaguely?
Well, I'm almost done making it!
๐ฎ
I'm tidiy up the SP code, and then I'll work on the MP one ๐
Was this the loot randomizer thing? or
The mod that allowed you to send your loot to a container in your base remotely
I don't think we spoke about that, or if we did it was long ago lol
Yeah it was months ago
It was my mod to make it so that you throw all your look in a container, and it gets sent to the right container wirelessly, like minecraft's EC2 mod
Have a look ๐
Clip 1: Sending an item from loot pile to loot receiver
of FFS the clip is corrupted ๐ (im remaking it)
Well speak of the Chuckle and he will appear;
Thanks for making that mod, I'm about to start a new solo game to check it out! (assuming it doesn't play nicely with pre-explored chunks)
It actually applies to existing book items, rather then mess up the distribution. ๐
Personally not a fan of scripting variations of the same item ๐ - not to mention the mod features 3000+ titles
With this mod, you've made me an offer I can't refuse-- I hope you realize you've now become my Modfather.
Thank you for the kind words ๐
@sour island Okay, so I finally got a good clip of how the loot manager sends items to a marked container.
This mod should make tidying up loot in the base so much easier, as it stops you from walking back and forth from your vehicle or loot pile.
And as you can see if your items stack is too heavy to fit in the container is also disables the option.
@mellow frigate this is what we talked about a few days ago, I even managed to get it working without having to use an item ๐
Neat ๐ฎ
Yeah! Its cool ๐
GG
I dig it; does it preserve item durability?
What do you mean?
A better example of how a "Loot Receiver" is set, and sending an item to it from a nearby container.
If I eat 1/2 an apple, then send the apple to the fridge, does the fridge spawn an apple with 50% remaining, or does it spawn a "full" apple?
Or if the crowbar is close to breaking, same thing
It will send the exact item you want to send. So, if you have half apple, half apple will be sent
Also, can anyone tell me how to check if a square is in a faction safe house? i think that I need to add this check to avoid griefing, but I don't know where to start ๐
No idea, did you check the methods related to IsoSquare ?
Javadoc Project Zomboid Modding API declaration: package: zombie.iso.areas, class: SafeHouse
Ah good to see thank you
Looking for testers: https://discord.com/channels/136501320340209664/1215626507846688808
Currently Testing: Game Night's Trading Card Game & Volumetric Rendering Update.
- New Add-Ons: Magic The Gathering and Pogs
- The update has impacts on all on the old add-ons too, so they've been bundled temporarily. Make sure to unsub from game night related mods before joining.
@verbal yew Added compatibility for your zRe Armor pack with Susceptible via my Overhaul addon
Does anyone know where the zombie infection is handled in the files? Trying to modify the values of a zombie made from a player but not sure where to look for it.
Looking specifically for the code around killing a player and making the zombie.
Mmmm...sounds interesting. Although to make sense of it and not have it magically teleport I'd say use something like a drone to send the item to the configured container
That's most likely handled in the java
How difficult is it to create a fly effect around a player?
Good evening or afternoon, how can you translate your mod from English to Ukrainian ? โน๏ธ . I don't understand how to make it
For what I'm doing I don't think so.
What I'm trying to do is rotate an object following the course by right clicking as the player does, so far very inaccurately
As in have an object rotate the same direction as the player basically ?
Or aim at the cursor ?
that turns in the same direction as the player when you aim with the right click course
What's your issue with doing that exactly ?
get the correct angle to make the rotation of the object
Why can't you use the player angle ?
Hmm just tested it and I see the issue
It outputs cardinal directions instead of an actual angle
InventoryItem:setWorldZRotation()
Test values, see what it sets
Do a correlation with actual angle from player
You can do some basic trigonometry for this too
Get coordinate of cursor, get coordinate of player, calculate angle on your circle, do a correlation between your 2 angle values so they correspond
Finally got this working, wheat from Soul Filcher's and LGR living in harmony with intercompatible seeds and seed packets.
I'm now at the point where I can accept mod compatibility requests. This is specifically for FARMING mods.
๐
If you have any requests, please feel free to shoot me a message.
Right now, Le Gourmet Revolution, Soul Filcher's Awesome Time / Farming Time, and 'Mo Crops are all compatible.
The mod may be experimental as it stands but at least it's more stable than the last version-
..which was 4,000+ lines of manual data entry.

This has been reduced to under 100 lines per patcher thus far, so we're vibin!
https://steamcommunity.com/sharedfiles/filedetails/?id=2885777084 would enter the list, I'd be happy too
I'll add it to the list, hopefully it doesn't brick the mod like it did in the last version!1
brick ?
Yeah like, in the old version it would always run into an error in the grow code and break everything.
Not entirely sure why, but this system is more stable anyways.
I did not change anything so it will probably do the same.
I'll make a quick patcher and test it soon.
thx
Really easy for me to make patchers now, hence why I'm taking requests
All else fails, you can look into it if you wish for maintenance purposes. It's stupid easy to set up the patchers lol
If you feel the coffe mod needs adjustement, I'd be happy to make a step in the right direction.
