#mod_development
1 messages Β· Page 514 of 1
Anyone in here able to help with a issue with a map mod i made? Cant get it to show up in the mod list in game and i have no idea whats wrong.
Do your mod.info is good ?
I got this error when I try to call ISUnequipAction. If anyone can help, I'm rly stuck on that
-----------------------------------------
function: start -- file: ISUnequipAction.lua line # 18
Callframe at: StartAction
function: begin -- file: ISBaseTimedAction.lua line # 59
function: addToQueue -- file: ISTimedActionQueue.lua line # 23
function: add -- file: ISTimedActionQueue.lua line # 125
function: unequipItem -- file: ISGearPanel.lua line # 264
function: equipAllClothes -- file: ISGearPanel.lua line # 272
function: onOptionMouseDown -- file: ISGearPanel.lua line # 549
function: onMouseUp -- file: ISButton.lua line # 56
LOG : General , 1642826752432> Object tried to call nil in start
LOG : General , 1642826752433> creating new sourcewindow: C:/Program Files (x86)/Steam/steamapps/common/ProjectZomboid/media/lua/client/TimedActions/ISUnequipAction.lua
ERROR: General , 1642826815034> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in start at KahluaUtil.fail line:82.
ERROR: General , 1642826815035> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in start
...
also posted about this in the mapping chat.
I'm trapped in a bit of a catch-22. I want to do something before my lua code loads, because code there needs to be influenced by something I do later on. The edit I make is persistent so I can get around this by calling ResetLua but the problem is that this gets stuck in a loop because I'll just end up calling ResetLua any time my code loads. Events like OnGameBoot or OnMainMenuEnter get called a second time when ResetLua is called, so I can't hook into those either because I'll once again get stuck in an endless loop.
I could potentially get around this if there's a way to hook into the game exiting, but I don't think I can do that, either
How to modify a recipe to yield 2 different items? Namely, I want "open jar box" recipe to yield both jars and jar lids
As far as I can tell, the game handles it somewhere else other than the recipe file
what are you trying to do beforehand?
can use require to load it before
or put in in shared since that gets loaded first
can go the jank route of having a variable keeping track if youve done the reset
I can't have a variable keeping track of things because that'll get reset when I reload lua, which is required.
I mean the simple option is to tell people my mod has to be loaded twice before it works, but that's not ideal
There's a thing Java does that I need it to do after I do my thing, but it only does it before I can do my thing. And the only way to trigger it from Lua seems to be to call ResetLua. So I can't use Lua to keep track of what I'm doing.
error at function: start -- file: ISUnequipAction.lua line # 18
the exact error is Object tried to call nil in start meaning it tried to function() something, but the function doesnt exist
line #18 in that file is:
self.item:setJobType(getText("ContextMenu_Unequip") .. " " .. self.item:getName());
theres 3 function calls in that line, item:setJobType(), getText() and item:getName() so one of those doesnt seem to exist
getText is a global function, so can rule that out. setJobType and getName are methods of InventoryItem, so those should both exist, unless self.item is pointing to a value that isnt a InventoryItem
So I'm looking for some sort of hook that'll be able to tell my Lua code where it is in that process
I forgot to specify that self.item is a clothing
Basically my goal is to trigger a reload of the SandboxOptions once I've done my thing.
But I already think of all of that. That why I'm stuck xD
what the value of self.item when you print() it? because if its a Clothing subclass of InventoryItem then it should have those methods.
I really just need a hook that triggers only once no matter how often Lua is reloaded. But I'm not sure one exists
do you need to just update the display of them?
Display of what?
of sandbox options
Theres a mod that does something similar like that already. I can get the name for you in a second if you want it
Depends on what you mean by that. I need to reload the SandboxOptions Java object. I need it to re-initialise itself.
Oh, that sounds great!
It's called Change Sandbox Options. Lets you change the sandbox options in-game. I think that's something like what you wanted
Thanks! I'll check it out.
Clothing{ clothingItemName="Jacket_ArmyCamoGreen" }
That is a Clothing, I'm not crazy right ?
Unfortunately it wasn't helpful. It's doing something completely different from what I'm attempting
rip
eh looks like it
I tried several different functions to unequip a clothing but nothing worked. I always get weird errors
got a mod running thats messing with that line throwing a error? theres clearly something different going on (else it would always throw that error unequipping clothes), or how are you calling the timed action?
It's the only mod, I test it
modular helmets are a fun concept
Otherwise I call it like all the other ISTimedActionQueue.add(ISUnequipAction:new(self.char, item, 50));
For example both work:
ISTimedActionQueue.add(ISInventoryTransferAction:new(self.char, item, item:getContainer(), self.char:getInventory()))
and
ISTimedActionQueue.add(ISWearClothing:new(self.char, item, 50))
add a print into the timed action:
function ISUnequipAction:start()
print(tostring(self.item.setJobType), tostring(getText), tostring(self.item.getName))
self.item:setJobType(getText("ContextMenu_Unequip") .. " " .. self.item:getName());
should print out
LOG : General , 1642830184496> function 0x1662484120 function 0x1680374941 function 0x1717067458
not sure how but one of those is seems to be returning nil (since its Object tried to call nil in start)
Thx, I will try that tomorrow, I spend the all night on my mod, I fall asleep
Get some of that left handed action going on xD
https://www.youtube.com/watch?v=lNEr_xVYS8Y&ab_channel=AbraxasDusk
A mod for Project Zomboid that allows you to wield a weapon in your second hand.
Project Zomboid:
https://store.steampowered.com/app/108600/Project_Zomboid/
Offhand Attack Mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2727440840
My Other Mods:
Jump Through Windows Mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=268...
modular underwear when
Heart Underwear (Bulge)
is there a lua event that triggers on the client after it finished loading in to a server
I think OnCreatePlayer? It also fires on single player but you should be able to check whether you're on a server or not using lua.
shouldnt matter if im on a server or singleplayer
was trying with OnGameTimeLoaded
wiki says OnCreatePlayer triggers when a player is being created
not when it finishes loading in
What's the significant difference in this case? The event gives you access to the IsoPlayer object right away and you can start doing stuff with it.
What kind of info do you need from the server? Do you need to wait until the player has fully loaded in?
There is also OnConnected, but not sure on which side that fires
working on multiplayer pause
And OnGameStart / OnLoad could be relevant too
and with the methods exposed to lua this is fiddly to say the least
after a lot of trial and error i have it working
just need to sync to a new player connecting the status
OnGameStart might be what i need
Well, OnCreatePlayer is the moment when the player is created in the world, so that's when gameplay truly starts. But best to try how those events interact with what you're trying to do.
ugh thought it was when creating a character
OnCreatePlayer fires when an IsoPlayer object is added into the world, which happens for existing characters too, not just new ones
OnGameStart did not work
everything is too early to work
well this is why
net is loading after
One thing you could try if there are no other suitable events is request global moddata from the server, and then listen to that event. Since that event means a response from the server, it should fire late enough, even if you request the moddata in an event that's too early.
Could somebody help me figure out how to add true music to multiplayer? I can't figure out how to add my own songs
do you know the behavior when requesting an invalid table
since i dont need a real thing i can request nothing just to trigger a response
Well, if you want the player to get data from the server you could actually use it to send real data, but if you don't want that, I think you can request something invalid too. Let me check...
Okay, OnReceiveGlobalModData event has 2 arguments. The second one is either the data, or false. So it appears that this means it always fires, even if the thing you asked for doesn't exist.
i think the issue is another XD i tried without the code to sync and a client connecting to a paused server simply doesnt load until you cancel the pause
but it doesnt run the unpause on the server for some reason when you cancel
hmmm. Maybe the pause is also pausing the ability to cancel?
wouldnt be surprized
if only the PauselAllClients() and UnpauselAllClients() were exposed to lua
might leave it at "just dont join a paused server its already jank enough as is"
how to make true music addon? I can't figure out how to upload mod or make it
i am completely lost, cannot even do first step. the template they told me to use says it contains file types that are not allowed? Please help me
this all it says template they give me doesnt work?!
anyone know how to spawn modded items or how to access the file for workshop items
i cant find the id for the things i want to spawn
please help with just one step? i just cant figure out how to start
is this not right? why get error?!
still nobody knows how to correctly export vehicle animations via blender?
please somebody message me... i give up for now
have u tried to export the "SportsCar-anims" to see what happens
?
well, i was able to export animations, but it wildly differs from model to model
everytime i think "now i got it" ... next time it's different again
i even tried an alternative fbx exporter now, because apparently the one in blender is not good.
the problem i have now is that the game screams error because of missing bone index
i am able export a single working animation, but as soon as it's about multiple ... non-stop issues
How did you export correctly?
wish i knew
one element is that i had to be in animation tab / object mode for all animations to be exported correctly
but it might as well be some other factor, who knows
Did you configure the script the same as vanillas?
scripts are ok. it's an fbx issue
I'm also interested in this area, if you find something, send me a message. π
Is there a way to circumvent maximum / minimum values for sandbox settings using lua? e.g. setting the population multiplier to 5 or something like that?
A lot of those values seem arbitrarily limited, and the Java code generally gets its values directly from the sandbox options object which enforces those limits, so I'm not sure how to get around it
Unless I want to write a java mod but that means I wouldn't be able to put it on the workshop
tbh the longer I'm working on trying to mod this game, the less I like the state of the modding API
It's nothing but cursed and janky workarounds
It's so hard to do anything more than the most basic stuff
The API seems like it's built solely for content mods, not functionality mods
I'm not necessarily saying this as a complaint though. I understand that there are more important things to work on than modding support. It's just a bit frustrating to find that I simply can't do the things I want to do
hi, where can i find the script with keydown code in origin vanilla .lua of the game? i search this but i dont find. i want change the restriction for keydown "E" (interact). i want derive the vanilla script for add a restriction if door is locked.
in my mod, i want lock door inside house (IsoFlagType inside) and add restriction, player can't enter if door is locked, my script good working with scroll menu to open door, (if door is locked, door no open) it's good too with click on door for opening, if door is lock : no open.
But if i keydown "E" (interact), the door open even if she is locked, why ??
i have derive this for add restriction : iSObjectClickHandle
i have derive this for add restriction : ISLockDoor
i have derive this for add restriction : ISOpenCloseDoor
what script should i derive for add restriction for the keydown interact E please ?
sory for my language, i'm not english ^^ but you understand my friends?
As an aside, have you considered what happens if someone rebinds their interact key to something like "I"? Perhaps you're unable to find it because you're looking for things involving the "E" key rather than a dynamic interact key. It could also be that the code you're looking for is in the java part of the game, although I haven't checked.
no i dont search for keydown E, just dynamic script for interact yes.
Yes i have believe for java script, and we can't derive java script i think?
Hey!
I'm new here and I would love to start creating my own level mod. I'm having an issue finding clean information on how to setup custom mods. I've installed Modding Tools from Steam and I have both Tiled and WorldEditor. I would love to first figure out how to add a basic ground texture for starts. Any clear information would be awesome!
is there a clever way to use 3 different items?
atm my recipe uses:
A/B/C/D/E/F/G
A/B/C/D/E/F/G
A/B/C/D/E/F/G
can I use sth like
3x(A/B/C/D/E/F/G)
?
because if there are more than 8 items and you use them several times the recipe page is quite long
so that especially the game shows 5 of this
instead of 1 of this (5 times)
@dreamy silo i'm fairly new to PZ modding but if your recipe requires 3 instances of one of six different objects, why not tag those six objects with a category and then require three instances of items with that category
for example, cooking requires a "knife", which can be a kitchen knife or a hunting knife etc
and chopping trees requires an "axe", which can be a hand axe, a splitting axe, a fire axe, etc
If you wanted to change mod recipes, where the hell do you go?
For clarification, you're looking to alter the recipes that another mod has created?
Yeah, so Scrap Weapons mod makes use of Empty tin cans to make weapons. Another mod I have, probably hydrocraft or silvercraft, changes the game code so empty tin cans no longer spawn, but instead it's just "Tin Can", which Scrap Weapons doesn't register
well first and foremost your solution will require altering the scrap weapons mod unless you want to track down the mod that's recreating base game items for some incomprehensible reason
do you know where to find the mod info that steam downloads?
@warped quarry I think I saw a YT Video from Hasilein which showed than you can place those tin cans on the ground, get them waterfilled and then you can make an empty one of them again...
https://youtu.be/AC43I3SQR-s?t=471
#ProjectZomboid#Hydrocraft#NEWS
If you find any bug or like to be part of the team - join my discord https://discord.gg/CzMAJpRX
Update is on the way. Important to know BEFORE you do it:
These usable items will be turned intofurniture and not exist any more if they are anchored - all items inthere ale lost. So remove them.
Herbalist Table, Ki...
tbh i've never understood why items on the ground collect water but the item doesn't collect water when equipped
because _if you waer it its either in the backpack or the hand?
exactly
so it wont collect
so if i'm holding a cooking pot or the cooking pot is on the ground, what's the difference
unless you're saying that by holding a cooking pot in my hands, i'm creating a forcefield that prevents rain from falling into it
Does anyone know why some walls seem to be facing the wrong way until I hover over the room?
is there a useful tutorial how to make furniture?
or how to make own chests?
I wanna create a bigger chestmod π
That wall doesn't have a proper North-South variant
Also wrong channel.
OOO got it! thank you and I noticed I was in the wrong channel again π€¦ββοΈ
well, for starters it simplifies the mechanics a lot
i know, it's wild how complex incrementing the contents of held items is, lord only knows how they managed to put the code together to fill containers in your hands from sinks 
what if i sprint
what if i fall down. should the pot get empty then?
actually when holding the item in your hand, the open top doesnt necessarily point upwards
i mean the game is fairly logical about most things, so yeah, naturally containers should empty if you trip while sprinting
and most items ergonomically would be carried upright as it would be literally painful to hold them inverted, such as cooking pots
it's just not worth it. and in like 10 years, this is the first time i see someone suggesting this π
well to be fair, tripping wasn't a thing before b41 
also will water in the pot get tainted then?
obviously π
but that's not realistic :>
that statement is counterfactual - go get a cooking pot full of water and drip food colouring into it
it's raining food coloring?
i'm not sure whether this is a language fail or a science fail but anyway if the rain is contaminated, anything the rain gets into will be contaminated - this is why if you collect rainwater from puddles on the ground, the water is contaminated
the colour in the food colouring was an analogy for the contamination in rainwater
well, if you want containers in player hands to fill while raining, you can probably just script that
personally i dont see the point in it
but then again i never walk around much with pots
is there a way in the game so if you build it build the item on x,y,z and x,y,z+1 if z is the high of the map ? like to build something there take op spaces like 2x2x3
Does anyone know if "Trunk Space Mods" still cause items to despawn?
can you rephrase that? are you asking if it's possible to build on the z-level above you? the answer is no
yea you got it ^^
Hey I'm looking to get into modding PZ, am I able to use another mods code / assets and credit them or is that not allowed?
i mean that's up to the mod creator - if you're based in the USA, it's entirely possible that a mod maker could ask steam to take down your mod if you created a derivative mod without requesting permission
personally i download mods just to look at how they've structured things
I see, it would never be a carbon copy or close. Just to learn.
if you don't publish it on steam, it doesn't matter and nobody can do a thing
the problem comes when you publish someone else's work and pretend that it's yours
Yes, if I were to use any I would credit.
even with attribution and a disclaimer that the work belongs to someone else, it's still presenting the mod as if you've made enough changes to claim it as your own work
credit isn't enough; permission is the gold standard
if i made a mod and someone duplicated it, tinkered with it a little bit, and then reposted it without permission, i would have it taken down even if they credited me on every second line of the mod description
Yeah, I've been modding different games and its different per game. Good to know for this going forward.
to be fair it doesn't much matter what game we're talking about; when it comes to making a derivative work and publishing it, permission from the author is gold because there are people like me out there
Well it depends on the game. As the mod may need the game, and in using the game you've accepted it can be copied and used. Example: Teardown.
all mods need the game the mod runs on by default
I'm not here to argue, thanks for the advice.
neither am i π
Hi! I was wondering if anyone would be available in helping make a mod to remove admin models for multiplayer servers? Basically I would love to remove my personal instance's model for recording purposes.
have you considered recording on a non-admin account and utilizing admin invisibility?
hi guys, i want to learn how to make mode in project z, but i can't find a good tutorial for begginers, i know how to code, but i don't have idea how to create a mod
sorry for my bad english
check the pins here π
yes, i'm trying to create a recipe but doesn't appear in the game, can i share my code?
we have considered that but it is a big project and we need control on how to record and be able to jump between groups.
again, still possible to do with a non-admin account; admins are capable of /teleport target destinationPerson
can i share my code with u?
yea i understand but we dont have enough hands to be able to do that. It is more of a logistical problem that could be solved by removing the model. sidenote just wanted to say thanks for sending ideas
instead of sharing code and a singular problem being found, it would be better if you read the link that i sent you so that you can find the error and know how to prevent making it in the future
i already readed, i'm following this guide on github to add a recipe but doesen't appear in crafting menu
i have literally copied the documentation
module Base
{
recipe Ciao
{
WineEmpty/WineEmpty2/WhiskeyEmpty/BeerEmpty,
Result:SmashedBottle,
Time:20,
Sound:BreakGlassItem,
}
}
as you can see, the module should be "MyMod" or whatever the name of the mod is
imports { Base }
and then recipes should follow
this information was accessible at this link
imports {
Base
}
/** Comments can be multiline like this
and can appear anywhere in the file, even in the
middle of a { block }
**/
item MyItem
{
Type = Normal,
DisplayName = My First Item,
Icon = MyIcon,
Weight = 0.1,
}
}```
thank u man
no worries, please read the documentation in the future
sure
module prova {
recipe Ciao
{
Base.Seaweed,
Result:SmashedBottle,
Time:20,
Sound:BreakGlassItem,
}
}
Sorry again, i'm getting mad, this not work, and i can't understand why
i have readed the documentation, and i have used as module my mod and not the base module
Try Time: 20.0 or Result:Base.SmashedBottle or Sound:Base.BreakGlassItem,
But you should use the import part
i'm trying to ise without import, maybe is the problem
but no
the name of the module is the same name of the id of the mod right?
No, it's just using in game in type like this prova.MyItem
ah okk, but not work
module prova {
recipe Ciao
{
Base.Seaweed,
Result: Base.SmashedBottle,
Time: 20.0,
Sound: Base.BreakGlassItem,
}
}
the mod is detected in game but not show my recipe
remove the sound, see if that's it
{
imports
{
Base
}
recipe Ciao recp
{
Seaweed,
Result: SmashedBottle,
Time: 20.0,
}
}
i'm not going to claim special knowledge here but it makes sense that you need to import Base if you want to refer to items in Base because otherwise how is the computer supposed to know what "Base.SmashedBottle" is
which place is the best to start modding, I have been learning lua for 2 weeks and I'm really lost at this point on where to start modding. I have visited the links on pinned but it is all confusing to me still lol
best way to learn IMHO is to read the code for other mods that do stuff similar to what you want to achieve
Pinned message and I also did that https://github.com/MrBounty/PZ-Mod---Doc
And look at other mod indeed
@drifting ore got your hook working?
What you mean by hook ?
ISScrollingListBox:doDrawItem
ok then
It worked, I just overwrite again the overwrite code
what you call overwrite is really a hook
overwrite is just confusing
Yes sorry, I'm bad at remembering terms, I'm not a computer scientist and English is not my mother tongue so it's sometimes difficult to find the right word
any clue why this is not working?
player:setZombieKills(playerData.zombieKills)``` I checked, playerData.zombieKills is the proper value I want to set, but in game the player zombie kills remain zero
not your fault, most modders I know, including native english speakers, talk about overwrite too π
personally i'd say it depends on the usage, with overwrite completely replacing the original, while hooking is adding extra code to run on top (or bottom) of the original. but its all personal opinion really. sure you could find lots of arguments about it lol
in computer science this is technically a hook, whether you keep the original behavior or not
I would agree with the term overwrite if you actually overwrite the memory where the function is located, but that's not the case here
it also fits the definition of overwrite effectively:
a. To destroy or lose (old data) by recording new data over it
b. To record (new data) on top of already stored data, thus destroying the old data
but your old data is not overwritten? You can still call the original function assuming you keep a reference to it
sure, you can overwrite the contexts of text file and still keep the original if you copy/pasted it too XD
what you're overwriting is the place where the reference to the old function is stored, that's called hooking π
I'm just talking about code π
Finish ! Enjoy ^^
https://steamcommunity.com/sharedfiles/filedetails/?id=2726898781
Thats great! Will try it out
Any clue how to change player weight in MP? I tried this:
getPlayer():getNutrition():setWeight(85.0)```
But it does not change the value in the player info panel
Hi, does someone have a clue if theres a mod which does skill books, recipe magazines etc. to have a slight chance to be destroyed/damaged after reading?
Anyone know how to access the ZomboidFileSystem (https://zomboid-javadoc.com/41.65/zombie/ZomboidFileSystem.html) object from lua?
I tried ZomboidFileSystem.instance:getCacheDir() and was met with
attempted index: instance of non-table: null at KahluaThread.tableget line:1689
Javadoc Project Zomboid Modding API declaration: package: zombie, class: ZomboidFileSystem
Does anyone know of a mod that lets you plaster non-player built walls?
whats wsome cool recent multiplayer mods π
cant. its not exposed to lua
Has anyone downloaded the βSnakeβ mod pack? And how was it?
Yes, Is Just try not importing
Just for try but doenst work
Where is that running from? you probably need to get a valid player value
does anyone have a good modpack for a multiplayer game? heopfully keeping it sort of vanilla
from the lua console in debug mode, it is getting a valid player object, i can set set other fields from the player object, only the weight is not working
REPOST: Hi! I was wondering if anyone would be available in helping make a mod to remove admin models for multiplayer servers? Basically I would love to remove my personal instance's model for recording purposes. It is basically to reduce some logistical problems that can help some creators record easier π
It's work for me
You can make a cloth with all mask and an empty model, you gonna be invisible. You can even call it invisibility cloak
oh shiii. okay okay. Ima have to figure that out
In MP?
It's weird cause it's not even showing the change on client side
Whats that mod for making sleep short?
Sleep with friends
@analog copper better ask in #mod_support or #old_techsupport , here it's about creating mods
sorry
No worries
Anyone know if we have support for custom save data?
Having a hard time finding info on it.
What kind of data do you need to save?
basically a map of strings to booleans
You could use ModData
ooh that may work. thanks
How do you make a recipe give 2 items?
anyone know a mod that allows me to spawn specific zombies
Does anyone know which version of Lua runs on PZ? I'm trying to use the goto command, but it only was added on Lua 2.0.1 . Maybe I won't be able to run this?
don't work,
I'm going crazy, I can't
goto was added in lua 5.2. but pz uses kahlua (not pure lua) which is roughly equivalent to 5.1 so doesnt have it. wouldnt recommend using it if it did though. easy enough to find another way
can i ask a question to you?
?
module prova
{
imports
{
Base
}
recipe Ciao recp
{
Seaweed,
Result: SmashedBottle,
Time: 20.0,
}
}
this code is correct?
the game recognize the mod but in the crafting menu i can't see the recipe
syntax looks fine, though i cant remember if it allows for spaces after : its been ages since i worked with recipes
i'm try to leave spaces now
ah ya looking i dont think spaces is going have to have a effect
it's all day i'm trying to create a recpie
the mod apperas in the mod selection, but in game the recipe doesen't appear in the crafting menu
the space not is the problem
this is the folder
is in Zomboid folder
now I try
@hollow jewel try = instead of :
okk
recipes use :
Oh really? Damn, sorry then
its the folder structure as Soul suggested
if i put all files in media the game doesn't find the mod
dont move the mod.info file
or the poster.png
just the folders lua, scripts, sounds and textures go in media
okkk now i try
thank u guys
now the mod is working but i have only my custom recipe
the other is disappeared
ok i have fixed that
really cool, thank a lot guys
hi, a .lua file script can call java script?
Because i search "Interact" inside script
bind = {};
bind.value = "Interact";
bind.key = 18;
table.insert(keyBinding, bind);````
in shared/keybinding.lua
I made this as a prototype quickly, to see if it was possible. Do you think it might interest people?
The goal being of course to remove the equipped items from the main panel
Basically it's a new tab in the health menu with all the equip items. Instead of having them in the main menu all the time for nothing
Everything works the same way. Double click for equipped, can drag items into other containers, ect
I really interested in this mod.
If you going to finish this mod and If you take any suggestions:
β’ Ability to hide equipped items from main inventory and show only in this panel. Maybe with ModOptions.
β’ Ability to rename it? Again with ModOptions.
β’ Ability to place tab between Health and Protection tabs.
β’ Ability to hide equipped items from main inventory and show only in this panel. Maybe with ModOptions.
Ofc, as I said "The goal being of course to remove the equipped items from the main panel".
β’ Ability to rename it? Again with ModOptions.
I will just name it Equipments I think
β’ Ability to place tab between Health and Protection tabs.
Not possible, finally yes but my mod would lose its ability to stay up to date because I would have to hook basic functions
Thank for your opinion, it rly helps
how can i make something from my inventory drop instantaneously, without the timed action?
how do i start making a mod?
Check other mods that do something similar as what you want to do
uh huh?
what else?
time
but like what do i need to make it, any special programs, what?
Check pinned message
That's really a question for #mod_support or #old_techsupport
ah ok sorry
Before I commit, is anyone working on a mod that allows you to view other players on the map in MP?
Is it possible to make boxes and the like cool items if the room(or exterior) they are in is freezing?
I just noticed that is a thing that is missing and its kinda dumb
How good is the Astar api if one wanted to path for vehicles? I found zombie.ai.astar.AStarPathMap but I wonder how well it would work if I used it for gps, and if it would make the car go into trees
and if it properly calculates the cost when moving trough grass tiles over road
I would check how it is done for fridges and freezers
Interface Mover docstring says βFor instance, a Mover might represent a tank or plane on a game map. Passing round this entity allows us to determine whether rough ground on a map should effect the unit's cost for moving through the tile.β So it could potentialy work for cars i guess?
@hushed cypress not sure any of the astar classes are exposed to lua
you could change them to be freezers but my fear would be if the game checked every loaded container if its in a cold room then turned it on you would get a lot of lag
Does anyone know if there is a way to create new animations? I'm making a slingshot mod, it's all done but the animations and I can't find anything related to it =/
does anyone know how to use mods in a multiplayer server i select them is sever settings under mods the session will use but the game does not seem to recognize them
Check the true actions mods maybe?
This channel is about creating mods, you should rather ask in #mod_support or #old_techsupport
thx
Not saying you should change them to freezers just check how the freezing part is implemented.
It's probably implemented using the lua event EveryOneMinute or something
do i have to learn lua for this?
im asking the cahnnel
if i need to learn lua to create mods
depends on what mod you are making
yes: you should have some understanding on how file structures work, or how files associate with other files
no: some mods do not require coding experience, such as models, sounds and textures
well my problem isnt the programming expoeriuence
just wondering if i can do it in a different programming language
im not a programmer so i cannot answer your question about lua, sorry
damn
just java stuff right?
theres like no framework for it or anything that'd allow you to use a different language?
No
eh if you've got experience in any other language then lua is simple to learn. the language is really basic without a lot of keywords or builtins
I've gotten as far as getting custom animations to play but not create my own yet (pretty sure its an issue with my actual animation track) you can check out my mod "Off Hand Attack" to get an idea of how I did it and maybe that will help? If you make an progress let me know I'm a little stuck at this point xD
<@&671452400221159444> spam link up there
also i have no experience with lua so this is prob stupid but, isnt it quite similar to python,
not even close to python
lmfao
Nothing to do with python really
I had some basic programming knowledge before starting on this but never touched lua prior, it was dead simple to pick up
i never rlly did too much with either
although lua might be useful to pick up
any good guides, or can ilearn enough of it from the modding guide
@grave lynx there's a descent guide from @quasi geode himself π
ya thats not really a lua introduction guide though (its still missing that section) XD
more of the specifics of lua pertaining to the pz engine
Ah true, sorry for throwing you under the bus then π
haha
Thanks man, I'll try it
i actually cant recommend any basic lua guides specifically. I learned it mostly by reading the official manual. but i'm sure google can throw out dozens of various guides
In this version I'm bringing in one of the existing tracks in the game and creating a new AnimSet with it, but the AnimSet will also work if you point it to a new animation track (I've been using true actions: dancing to test it)
Not sure how you managed to do that, i know how to write Lua but the official manual still makes no sense to me whatsoever π
ah well i had some practice at the time reading language specs in EBNF format π
also, had just come down off a 10 year long perl binge π
Has anyone used AutoTsar mods? We just aren't seeing any jeeps or busses.
been busy modding forgot to mod and play
@stuck latch @vernal berry I'd ask in the appropriate channel, like #mod_support or #old_techsupport
Does anyone know if Map Packs (like AIZ Enhanced, etc) are a problem in terms of author permissions? or if they are likely to get removed? i know that repacks/compilations of other mods are usually not ok, but many of these map packs seem to get a lot of support, so im not sure if they are the same.
Steam TOS is very touchy
Iirc for the most part any uploads to steam have creative commons 3 applied
But I think its generally a good idea to ask
yeah, but that's why im wondering how AIZ enhanced 2 has been around since 2017 and still hasn't been removed. Maybe it does have the permissions, but i can't find them on the workshop page.
I'm just wondering theres's something unique to maps that im unaware of
I'm trying to figure out how the population multiplier, population start multiplier, and population end multiplier affect one another. Do they compound somehow or do they to some degree overwrite each other? I'm trying to do some stuff using zombie population, and I don't really know where to find info about this
Man, it would be so helpful to have access not just to public methods on java classes but also public fields. It would actually massively multiply the possibilities.
If I had a wishlist for modding features it would essentially just be this:
- allow reading and writing public fields of exposed classes from lua
- expose all classes unless there's a really good reason not to
- allow monkey patching of java methods from lua.
Hi, is it possible to change the item icon ingame via lua? I played around the Texture Calss but no avail, I want to make the icon dynamic change during some process. Can it be done at current modding possibility?
are items in containers created on cell load or when someone tries to access the container?
Has anyone been able to add custom attachments to vanillas SmallBeltLeft & SmallBeltRight in ISHotbarAttachDefinitions?
I feel like I should be accessing the table and appending an item to attachments but I'm not sure how to do that in lua.
Yup.
local item = ScriptManager.instance:getItem("Base.Needle")
if item then
item:DoParam("Icon = Belt")
end
wow, I didn't think it's possible, thanks.
Has anyone here tried adding a new vehicle mod to a multiplayer server after having the server run for a couple of months and succesfully found the new vehicles in an unexplored cell?
someone told me they would spawn if you venture to an unexplored cell, but i have yet to see it
hey, how about the blood overlay? How do you set it up?
Take a look at your vehicle's script and see which "shader" it is using
Can anyone tell me, if i want for example multiple boxes of 9mm ammo to spawn in zombies, the "for i =" cycle can do the same result as the "rolls =" in the loot generating code?
is there a mod that keeps the cars hood open? Constantly having to open it again, and again, and again when doing repairs is rather annoying
Solved.
Had to rearrange the code around in different order and that fixed the issue. π
How are you testing your mods in multiplayer? Is there an easy way to launch multiple instances of the game?
Does anyone know of a mod that uses global mod data?
Because we agree that I can't use getModData() on another isoplayer? I will just get a nil right ?
Pretty sure you can, only problem is getting a reference to said player depending on the context
That's the easy part since it's when it's in the health panel. There is a patient and a doctor. They can be the same or different. I have the isoplayer but every time I do getModData() on another player I get a nil
Hmm weird. Why not storing it in global mod data then?
Because I can't get them to work!
what's the issue? Have you tried the way I showed you?
I don't remember, you showed me something?
I did π
Look at my profile picture, you will understand that memory is not my thing π
if you don't want to rely on Steam you could use the player username I guess
as a key
That it ? but I don't think it's worked for me
ah so you remember now? π
Maybe I did something wrong
not sure it's working from one player to another, but at least it is sent to server and dispatched back to client
Yes, you have to refresh my memory but once done, I have a pretty good memory ^^
Yeah but if it's on the server, you should be able to get other player data no ?
that's what I think, but yet again, it's pz so you can't be sure about anything unless you try it π
I remember that was the problem with your example. It's client to server transfer and not client to server then to another client
@thin hornet maybe you know about this? How to access mod data from different players, with the info shared between all clients?
I'm trying to add fuel to a campfire via lua code, but the heatSource:addFuel(fuelAmt) method I found on other mods does not seem to work anymore.
Anyone has an idea on how I can do this? Or some other mod that may have this answer?
That doesn't sound like a good idea. What are you trying to achieve exactly?
have you tried to follow the path from the the Add Fuel context menu?
i want to not close and reopen game for debug my mode
reloading the mods probably wouldn't help, debug mode is handled on the java side
but I agree it is so annoying
generator:setFuel(generator:getFuel() + toAdd)
This generator is an IsoObject?
that probably wouldn't work, generator have their own java class, but fire camps don't
O so, ISAddFuel.lua is only for generator ? Mb
I found a addFuel method on ISCampingMenu.lua but it needs a player to be present. My idea is something that would not involve a player action, but rather happen via script.
local cf = campfire
local args = { x = cf.x, y = cf.y, z = cf.z, fuelAmt = fuelAmt }
CCampfireSystem.instance:sendCommand(character, 'addFuel', args)
O I see, it's use a character. No idea, I think you can't
It's fine if it has to take one character action to make it happen, then. I will try this code. You found it on ISAddFuelAction , right?
Yes
You could use the player who set up the camp fire? Not sure what you're trying to achieve
guys i don't find the granade item in media of game, anyone know where is it? i want to make a custom bomb
I'm trying to recreate the BetterRefueling mod and add a few features to it. It seems not to work anymore since 2019.
The idea is that you dump all the fuel on the campfire container and then convert it to fuel in a single action.
But it used a heatSource:addFuel() method that seems to no longer exist. I'm trying to find a way to make it work again.
any suggestions for good firearms mods in the workshop?
i find only molotov
Is the world sound falloff in this game hardcoded? I try to add an big explosion sound with getSoundManager():PlayWorldSound(), but no matter how I adjust the vars, the sound it play always fall off at 10~15 tiles. can't hear it at all at 15+ tiles distance. Is there anyway to work around this?
Arsenal(26) GunFighter Mod + Brita's Weapon pack if you want tons of new weapons, or Firearms B41 if you want smaller amount of weapons and would like to stay close to vanilla
The sendCommand seems to be failing on a "assertValid" function, but I can't find where it is.
Stack trace below
ERROR: General , 1642950135150> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: at MethodArguments.assertValid line:123.
ERROR: General , 1642950135150> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException:
at se.krka.kahlua.integration.expose.MethodArguments.assertValid(MethodArguments.java:123)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:186)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
at zombie.ui.UIManager.update(UIManager.java:808)
at zombie.GameWindow.logic(GameWindow.java:253)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:661)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1642950135151> -----------------------------------------
STACK TRACE
-----------------------------------------
Callframe at: sendCommand
function: sendCommand -- file: CGlobalObjectSystem.lua line # 110
function: addFuelCallback -- file: configureFireplaceAction.lua line # 53
function: onMouseUp -- file: ISContextMenu.lua line # 90
The only thing I can think of is making the sound 2d, but that lose the 3d effect, and other players in MP won't be able to hear it, really a big problem here.
Is Firearms B41 the name of the mod in the Workshop?
yep
@tropic olive @umbral stump this channel is about developing mods, please go to #mod_support for this kind of discussion
Apologies! New to using the server; just lurked until recently.
no worries
looks like the parameter you're sending are no good. Can you show what you're sending exactly?
i have a question tho, is there a list somewhere about the specific zombie types in the game what can have different loot tables from the other zombies like the "Outfit_Police"?
are you sure there's no variation of the PlayWorldSound that takes a radius or something?
Hello all.. is this the place to talk to modder about ideas etc>?
@teal slate found another gem for your little collection! π
public static void setLanguage(Language language) {
if (language == null) {
language = getDefaultLanguage();
}
language = language;
}
guys i have a problem
i can't find the item of bomb in the media of the game
anyone know the file name?
Yep, I cranked all the possible float or int input to something like 500, and it just falloff after 15+ tiles no matter what.
Pipe bombs are defined in scripts/newitems.txt
thank u so much
I was passing the playerNum instead of the playerIsoObj to the function.
Solved it using
local playerObj = getSpecificPlayer(playerNum)
Thanks a lot! It is finally adding fuel to the campfire! π π₯
hum someone asked about getting the current language, but I can't find the question anymore. So if that person is reading, he could try: Translator.getLanguage()
@verbal ivy most of those methods seem to take a radius parameter, not sure about the unit you have to use though
i really hope this is a decompiler artifact and that it's supposed to be this.language = language π
@tacit tusk unless you plan on implementing it yourself I'd say no π
I actually think they are broken, one of them should be the volume, but even if I set them all to 0, the sound still play at full volume.
could be but other places are decompiling this just fine
which variation of the function have you tried?
for example if i want to add damage to zombie with a pipe bomb, how can i do that?
well, all of then in the javadoc:
PlayWorldSoundβ(soundname, boolean, square, float, float, float, boolean); PlayWorldSoundβ(soundname, square, float, float, float, boolean); PlayWorldSoundβ(soundname, boolean, square, float, float, float, int, boolean); PlayWorldSoundImplβ(soundname, boolean, x, y, z, float, float, float, boolean)
I tried set all the float and int to 500 or 0, they all sound the same. Full volume, fall off after 15 tiles.
@teal slate actually you might be right, it's a static field so maybe:
Code:
0: aload_0
1: ifnonnull 8
4: invokestatic #247 // Method getDefaultLanguage:()Lzombie/core/Language;
7: astore_0
8: aload_0
9: putstatic #7 // Field language:Lzombie/core/Language;
12: return
I'm not quite fluent with java bytecode though so I'm not sure
item Bomba artigianale
{
DisplayCategory = Devices,
MaxRange = 10,
Type = Weapon,
MinimumSwingTime = 1.5,
SwingAnim = Throw,
WeaponSprite = Molotov,
UseSelf = TRUE,
DisplayName = Bomba Carta,
SwingTime = 1.5,
SwingAmountBeforeImpact = 0.1,
PhysicsObject = PipeBomb,
MinDamage = 50000,
Weight = 1.5,
MaxDamage = 50000,
MaxHitCount = 50,
Icon = PipeBomb,
ExplosionPower = 0,
ExplosionRange = 50,
ExplosionSound = PipeBombExplode,
SwingSound = PipeBombThrow,
PlacedSprite = constructedobjects_01_32,
Tooltip = Tooltip_Trap,
WorldStaticModel = PipeBomb,
}
with this settings the bomb give damage to me
but no to the zombie
anyone can help me?
looking to start modding, never really done it before. I've come up with a (hopefully) fairly simple QoL mod I want to work on (a box to tick that makes the chatbox pop back up if someone sends a message in it) but I have no idea where to start. any suggestions?
I guess you're right about the method being broken, they all come down to calling this:
public Audio PlayWorldSoundImpl(String string, boolean boolean1, int int1, int int2, int int3, float float1, float float2, float float3, boolean boolean2) {
BaseSoundEmitter baseSoundEmitter = IsoWorld.instance.getFreeEmitter((float)int1 + 0.5F, (float)int2 + 0.5F, (float)int3);
baseSoundEmitter.playSoundImpl(string, (IsoObject)null);
return new FMODAudio(baseSoundEmitter);
}
``` which looks like it's completely ignoring the float parameters
@teal slate another gem? π
wow, talk about spaghetti codes, I'm gonna look into the BaseSoundEmitter Class to see if there is a work around. thanks
the returned object has a setVolume(float) method, you could try that, but I can't see anything about the radius
and yes indeed, it is a big pile of spaghetti code
Thanks, just tested it, the method indeed changed the volume, but the falloff distance is still there, high volume just means instantly changed to loud sound inside a fix range.
For you, what is the important information of an equipment set? I have:
- Bite and scratch resistance for each limb.
- Combat and running speeds modifier.
- Total insulation and mass.
But you think of something else? I see nothing else personally
Yeah well i would be game for getting involved. Mainly i work on 3D within game dev. But i have a general idea for factions, territory wars etc. Was just wondering if anyone was implementing something based around that here π
can't think of anything else important right now. Except maybe the material of the cloth?
like denim, leather etc
also whether it can be repaired or not I guess
Is there a way to get the contents of the corpse container when it is already inside a container?
I have a corpse item inside a campfire container.
When I run corpse:getContainer() , it returns me the campfire, instead of - say - the clothes the corpse is wearing.
I'm not finding another method to refer to what the corpse has inside it.
I'm not 100% sure but I think when you place an IsoDeadBody in a container or inventory it gets transformed into a regular item, until you take it back out. Are you able to inspect the content of other kind of containers when inside a container themselves?
I guess you can still try but don't get mad if nobody is answering your request π
The mod ExtraSauce Sac allows managing containers within containers. Maybe it can help me with this. I'll look at the code.
Thanks!
Is there a way to type things into the lua console on the F11 screen?
Like items:size() without having to go all the way back to a lua file, closing and opening the game again?
I couldn't find a way to use the "Watch Window" too. All tutorials on the forum or youtube did not help.
Imho it's enough.
Hello, can someone help me pls, can I enable mods in existing world in mp? Will it crash or smth
Hey π
this channel is about developing mods. For this kind of support please go to #mod_support
oh sry, ty β€οΈ
humm what about getting out of the debug screen and type something in the lua console available there?
How could I get references to the world items this way?
For instance, how to refer to a specific zombie item inside my campfire container? π€
oh right
I was thinking something like the Google Chrome console, where I could mess with my own lua script while running
Mmmmm, it's not really the kind of thing I'm looking to display but it's not a bad idea. On the other hand it's dead I think because I really don't see where to put it π
maybe a column that shows "condition" that shows the status of that section from Intact, Patched, Hole
and N/A if you are not wearing anything there
few people like me have the guts to say the truth; PZ multiplayer is far from being ready/stable, there i said it, its my opinion and period.
π
was to be a reply for this actually lol
i cant complain much thou since i was never able to make my mincraft mod to work 100% on servers too lmao
I played Zomboid for few days now and find it lacking in:
- Lack of Story mode
- Glitches & clunkiness in combat, zombie biting you while you were pushing, attacking, slapping them
- Unforgiving skill loss on being scratched even once. (7% fatality rate) Too hardcore for a glitched combat sometimes.
- Teleporting car drives in multiplayer
all this on MP?
Yep
yeah teleporting cars i saw myself, its a major bug
i cant even make my no-mod server to work fine
Pay 5 bucks for dedicated server and they set it up for you. What's the issue with that?
so its not a mod thing, this MP feature was released in a rush, because the game was having a selling booster
What's the issue with hosting a server on your side?
Is there a way to remove default map from my server?
did you play MP build 40? i wonder if it was this broken too, i never tried
i dont know man, all the MP servers i create, after i quit the game and enter again to load, the world simple wont load
I'm new and I created my own hosted server (own pc not dedicated), had no issues logging in for me or my friends.
same here i dont know what is the problem
Also got small dedicated server, no issues there. Why don't you get a dedicated server to host for you? It might be your PC compatibility with PZ.
It's not the actual equipment, I can't do that. It's a preset of clothings
'get a dedicated server' ? haha no thanks i wont pay for a 3rd party to fix something wrong with the vanilla coding.. i prefer to wait MP gets more stable, im not even playing much anyway, im just modding for solid 2 months now lol
modding is fun π
Do we have a coder that might wanna help a bit on a mod? PM me for info, it's a fairly simple mod already out on the workshop, obviously you'll be added as a collaborator! π
Explain a bit what you plan to do, because it's too vague
Ok, you're right, sounds sketchy. Basically, my mod is called "Pee In A Bottle", it's dumb, silly but simple. It's meant to help you walk those extra miles when you're desperat for water, so you pee in a empty bottle, drink, gain a bit hydration (not much) and a bit of unhappiness. So far I am up to 230 downloads on the workshop. The thing is, I am very bad at LUA, and my script mostly contains a icon, and a .txt file with like 7 lines of "code" but it does the trick and the mod is working fine.
I wanna add a trait in the game that makes you be able to drink the pee without getting unhappiness, this will be called: "Happy pee drinker", and I wanna add a limit to how much you can pee in a hour, or so. If that is possible and not to much to ask for, it would be nice for some help. I'll send the core files over, you do the magic. I cannot pay anyone unfourtnalley, so if no one wants to help its fine.
Is there a way to remove default spawnpoints from my server?
It's a simple mod, and I am just hella confused it didnt exist on the workshop before.
Hahaha, code is the hard work on your mod. So you ask someone to basically do all the work for just a collaboration. I would be very surprised if someone answered you. But if you want to do it yourself, I would be happy to help if I can
It would be awesome, I used to do LUA modding for FiveM a while back as a hobby, but I was super basic on that stuff really.
In media/map/the map there is a spawnpoints.lua, you can remove it from there
Coding is just a stacking super basic stuff π
Yhe, I'll probabally hit you up for some help later, I am just going to quickly add a pee filtration system to make safe pee.
I know LuaU but no idea how different that is from the Lua in PZ
Just ask here, if I am there and know the answer I will answer it
Alright!
yeah ask the stuff here we will help as we see/can
Do it!
100% sub this mod
Sub to it now! It's out π
heyya, just published my first mod that lets you do stuff on the map without having pens/erasers in your inv. feedback is welcome, code seems simple enough
https://steamcommunity.com/sharedfiles/filedetails/?id=2729545876
Oh i read only half way and got hyped.
Yes i sub it now π
any addons that reduce the sound made by lightswitches at night?
@low yarrow I need to update it quickly tho, my latest update accidentally removed the script files for some reason π
done
mood lmfao
Wrong rcon password
Did you do what I said ? Remove the spawnpoint.lua ? And it's a question for #mod_support
Kind of a mod, made a self hosted discord bot that can let your server admins and users run rcon commands, see server status, death counts and more.
https://github.com/rfalias/project_zomboid_bot
after installing autotsar trailers and removing it, I have some impossible to move cars on the street, can't be drag with another car, any way to fix it?
guys i want to start make a mod with a little bit of lua any suggestion for start?
i know how to add item and recipe but i don't have idea of implementing lua
Anyway of spawn IsoObject on a Z index that has no square yet
getGridSquare not working since it doesnt find a floor tile i guess
edit
need to create the square
local theSquare = getCell():getGridSquare(x, y, z);
if not theSquare then
theSquare = IsoGridSquare.new(getCell(), nil, x, y, z);
getCell():ConnectNewSquare(theSquare, false);
end
Is there a quick way to make the offset correct? as it is becoming a headache
its suppose to be like a hammer but its a bong
Ask #modeling, it's more they kind of stuff
can i ask you something about our repository?
Sure, ask. Don't ask to ask
it would be nice if as a thing to do I added a step by step guide to create the first script in lua in a guided way, do you think it is possible?
because i have readed the coding part, but i have no idea how to get started
You mean like create the first custom item ?
i mean for example
You can but for me there is this guide that is good to start https://github.com/FWolfe/Zomboid-Modding-Guide
create custom actions, such as creating a lighter that with a right click on the table sets it on fire
i have already readed that but don't give a pratic example
Do what seems useful to you, just avoid redoing something already done as much as possible, but otherwise any documentation is welcome
But for me, the best examples are other mods
the problem is that I don't understand how to practically create a lua script and implement it
If you just put a .lua file in media/lua/client. It will be use on the client side
Client side is like the game on your computer, it's usely what you use
for example, i want to create a mod with real scream when press q to actract zombies
but i don't know how to do that
or any mod for getting stared
The beginning is always complicated. You have to look for the simplest. Like how to use the keyboard
After how to scream
ect
baby step
after you will run
like create a mod that when I press g prints something in the console?
Like if you research in this channel keyboard, you find this. It's look like a nice place to start. #mod_development message
exactly
thank you, so now I try but I already know it will turn out badly π€£
hello, i am new to modding, how can i make a simple new clothing item that is a reskin?
i didnt find any good guides so i am asking here
Look at Guide how to make a clothing mod https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Useful links.md
You rly need to understand the event logic
I don't think there is a guide to explain it but it simple
thanks, i will take a look
also, are there any files with thew in game clothing models? i just wanna make a reskin, not a clothing item from scratch
pinned message of #modeling
thx
I planned to do it so there, you have an example of how to say hello when a key is press. https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Event logic.md
thank you so much
Hi everyone! π
Could someone please tell me what scripting language are the .txt files (located in media\scripts folder) written in?
that's really usefull, but i have another question, where i can find all the action, for example: getPlayer():Say("Hello world")
in the documentation of FWolfe the link is broken
i need all the action for the event getPLayer()
Alright fine people, anyone know if I'd be able to add a "sweating" mood onto my character upon consumption of a beverge?
{
DisplayCategory = Food,
HungerChange = 0,
Weight = 0.3,
AlwaysWelcomeGift = TRUE,
Type = Food,
UnhappyChange = +30,
ThirstChange = -20,
DisplayName = Unfiltered Pee in a bottle,
Icon = PeeInBottle,
CustomContextMenu = Drink,
CustomEatSound = robloxdrinking,
Carbohydrates = 39,
ReplaceOnUse = WaterBottleEmpty,
Proteins = 0,
Lipids = 0,
Calories = 100,
Packaged = TRUE,
CantBeFrozen = TRUE,
StaticModel = PopCanDiet,
EatType = popcan,
WorldStaticModel = PopCanDiet,
}```
Don't mind the "robloxdrinking" sound alright.
@worldly olive and anyone else interested in xpMaps:
bonusProfessionLevels:
- Fire Officer
-- Strength : 1
-- Fitness : 1
-- Sprinting : 1
-- Axe : 1
bonusTraitLevels:
- Out of Shape, Strong,
-- Fitness : -2
-- Strength : 4
bonusDescLevels:
-- Strength : 3
-- Fitness : 2
-- Sprinting : 1
-- Axe : 1
bonusProfessionLevels:
- Unemployed
bonusTraitLevels:
bonusDescLevels:
-- Strength : 3
-- Fitness : 3
bonusProfessionLevels:
- Unemployed
bonusTraitLevels:
- Strong, Unfit,
-- Strength : 4
-- Fitness : -4
bonusDescLevels:
-- Strength : 3
-- Fitness : 1
```
So these are the xpMaps for different characters...
The way fitness and strength behave is kind of weird.
Default is 3/3 not 5/5 for some reason?
The 5/5 is set after the fact.
Desc seems to be a blend of the two - which makes sense.
hi, do you know where i can find all action for getPlayer? for example :say()
i can't find in the documentation
it's under IsoPlayer / IsoGameCharacter
thank u so mucyh
How do you guys use Javadoc to mod in LUA?
Anyone know how to add a WorldStaticModel to my item?
Ah interesting - taking firefighter shifts unfit into out of shape... neat.
So I can't track the -4 needed for recovery journal cause it's a -2 after the fact hm...
public void Bitten()
i cant't understand what do this function
is a void so not accept a value in a function
getPlayer():Bitten() i have tried this but give me stack error
https://zomboid-javadoc.com/41.65/zombie/characters/BodyDamage/BodyPart.html#bitten()
bitten() is a function of bodyPart. And bodyPart is a sub class of bodydamage, which is itself a subclass of isoplayer. These are each part of the body (left hand, right, left forearm, right, ect)
Javadoc Project Zomboid Modding API declaration: package: zombie.characters.BodyDamage, class: BodyPart
ah ok, slowly i'm starting to undestand
Hmmm π€
Idk if this info helps lol
BodyDamage is NOT a subclass of IsoPlayer!
O hey it's a sub class of characters like isoplayer
can you give me a example of usage?
also no π
the parent class is Object
Ok, I must not understand the term subclass xD
So what does zombie.characters. mean ?
Hello, here ! I'm new to mod making, please bear with me.
I'm looking to create a mod that would change the speed of zombies when impacted by a light source. Ideas on how to do it ?
it's the package where the classes are located, but has nothing to do with inheritance (as in subclass etc)
a package is nothing more than a collection of classes that makes sense to put together from a human perspective, also adds some specific permissions to access some fields etc but that's it
Ok, merci pour l'explication !
getPlayer():getBodyDamage():getBodyPartβ(BodyPartType.Hand_R) to get the right hand body part
thank u
you could try to check how the other mods that change zombie speed are doing it, but regarding exposure to light I don't know
I know how to change a zombie's speed. What I don't know is how to do it depending on a light source... Thanks anyway !
I managed to add a trait in my mod called "Happy Pee Drinker" It's supposed to make you immune to the unhappiness effect you get from drinking a pee bottle, how would I execute that π
Every zombie is on a tile, every tile have a light variables so you should be able to do what you plan.
https://zomboid-javadoc.com/41.65/zombie/iso/IsoCell.html
https://zomboid-javadoc.com/41.65/zombie/iso/IsoCell.html#getLightSourceAt(int,int,int)
https://zomboid-javadoc.com/41.65/zombie/iso/IsoCell.html#getCurrentLightX()
Javadoc Project Zomboid Modding API declaration: package: zombie.iso, class: IsoCell
Is there a way to get what building/safehouse u are standing on ? I got the isocell from player. but the building list is empty
Ie toy example:
local player = getSpecificPlayer(0);
local cell = player:getCell();
local buildings = cell:getBuildingList();
returns an empty list
Thanks, I'll take a look, seems like the right way to go.
try: lua local safehouse = SafeHouse.getSafeHouse(player:getSquare()) or something like that
also not sure how your stuff is working but the playerObj is not declared in the code you're showing
Sorry edited the mistake, what if i wanted just the building the player is on that is not a safehouse ? I will try the safehouse line
getSpecificPlayer(0):getCurrentSquare():getBuilding()
oh yeah totally forgot about the building part, but what @quasi geode suggested is what I would have said too
Someone know how to use self.character:reportEvent("EventWearClothing") ? Like add code to this event ?
@drifting ore u prank me
I miss clicked π
π
My first lua script π€£
Does anyone have a PZ Lua Reference list or anything? Or even a link to any libraries extensions for Visual Code or something.
guys when the game is paused for stack error, how can i resume?
because i stop and reopen the game every time
f11
I ran into a weird problem, ISScrollingListBox can't recognize if the box to display is in the listBox or in another one. Making it impossible to stack listBoxes. Example:
Yo
Mod idea:
Add a winning condition for the game. It can be as something as complex as constructing a boat and getting the fuck out of dodge or adding a decomposition effect by which after a year (or however long ya want) all zombies begin to die of natural decomposition
never done ui for pz, but do you need to make a parent container for each listbox?
What you mean by a parent container ? The parent of the listBox is the tab itself
it's how i would separate things in Qt at least, by using a new parent layout for the sub elements (if i really needed to, that is).
Do you think that solves the problem?
not a clue, just tossing a potentially(?) helpful answer. like i said, i've never done ui stuff in pz, so i don't actually know.
Is brita's broken
Ok thx. I will quicky check if I can make a patch, otherwise I will just change the layout
Hi there, so Iβm looking to get into Project Zomboid modding, specifically making the mods, any good videos or forums to look at?
Brita's is still broken
hey guys iΒ΄ve been setting custom condition for my weapons and i notice they break after a load, im setting like this:
ConditionMax = 200,
ConditionLowerChanceOneIn = 15,
maybe there is a max value for ConditionMax or something?
happens on meele weapons and firearms
Hi everyone
How can I get ModOptions to work in a multiplayer server? I'm trying to use Brita's Weapon Mod, but I'm not able to see the options while in game
Ye
discord doesnt send links its all intergrated within the app so if someone gifts you itll just pop up natively in the app
I already pinged a mod but itβs been 5 minsβ¦
imagine being such a loser that u go into a discord and do nothing but try and scam people
can anyone help me figure out a can of soup? π
I'm new, hello, and just wanted to start off small and create a can of soup that gave -100 thirst and hunger. I've been able to create the items but when I go to use them in game, I'm not prompted to use the can opener and I can't use a pot to cook it. Bowls don't work either.
so I'm thinking there's a recipe component I'm missing?
but the mod that I modelled mine after didn't have anything about recipies in it
and it was a simple "roll and unroll a sleeping bag" so I assume it had some sort of mechanism that did the transformation
Here's my snippet:
I have a UI panel with drawTexture and drawText elements in it, all are attached to the panel window. When I hide the UI panel with a press of a button, the panel itself and the icons become hidden as intended, but the text remains visible. Anyone have any idea why that might be happening?
Do you remove it from the UI manager or just hide it ?
people, but an accomplished mod so that not only those who are registered in membership, but belong to their affiliation, can enter the shelter. Or is there already such a mod? )
Just hide
You need to remove it from the Ui manager, otherwise it still update even if hide
Ok I'll try that
My pc boot, I can give you the function if you want
I would appreciate it
Check "How to display and remove myUI ?" section:
https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Make an custom UI.md
Thanks so much
I wish I have stumbled upon that page sooner lmao
hey guys, how hard would it be to make those louisville barbed fences pickupable?
Yes, unfortunately there are docs but it is sometimes difficult to find them. After this guide I did it 3 days ago too
Impossible, because it's a wall in game I think
Honestly I don't know, I didn't do this side of modding
shouldnt be that hard but would feel a bit like cheating it wouldnt it ? when zombies cant break it nor climb over it ^^
well there is no difference between that or a regular wodden wall, zombies usually go for the doors...
and of course, its optional for everyone, hence why a mod...
More Builds mod has it in but that mod is broken, half of stuff cant be placed/ working
that mod work fine when i last tried it like 25 days ago. but it bad written and was thinking about try to make a framework for moveable furniture.. just so people have easier time to add new stuff or add new stuff for non coders just like what i did ish for farming but going to make a v2 of that soon to make it even easier.
also most of the building mods break some core fuctions becuase the dont do it right like more building the admin / debug menu is broken for test building stuff. which mean he didnt do a real hook in but just spaghetti code it..
most buildables / non working wall stuff has something to do with with torch/items not equipping i think
either way i jus twanna deleted that mod hence why i asked how hard would be to get the buildable fence mod
@drifting ore I'm trying to solve the issue like you suggested but I've been unsuccessful so far.
Even ignoring the fact that I can't figure out how to hide\show a panel from a single button using the UI Manager functions, even when I use those functions just to disable the UI the text still remains on screen.
Send me your file, I will check one thing quickly
does britas weapon pack work for multiplayer?
It works with both singleplayer and multiplayer
yeah found out i just had a conflicting mod
on my mp server
think i got it figurer out now
Hello! I wanted to make a small mod for myself to add some loot to zombies. Can anyone check the code that is alright? It seems working but i just want to make sure, i dont really know what im doing yet π Also a question: what the "rolls = " line are doing in the code exactly? How can i achieve that some items can have multiple drops than a single one? For example if i want ammo to randomly spawn between 1-4 amount of boxes in bodies?
One more question
Did you try to see if it worked? Also the easy way is just to make the chance of drop like 100 procent to see if it correctly.
is there a place I can get the item ID's for the items that are added from Brita's weapon pack?
so if I want to add them to a starting character
I tried and seems worked, just need to tune the drop rates. I just asked because this is my first mod, and im total noob for programming :\
Have really tried to do drop on zobies before also hard to tell if the drop rate it high or low.
and my other questions are still up
Also I might had made it as inserttable
is it better with insert.table?
With insert table you do so you don't mistakenly outdate vanilla drop table from zombies
To be honest have red the code closely because on a mobile screen atm
does britas have some weird sounds on some of the weapons? liek single shot some weapons sound kinda wonky.
last time i tried it was more like problem with zombies coundnt hear the fire from that mod. .do you know if it fixed?
No idea
I have noticed that the sounds that guns make do attract less zombies than I anticipated, so maybe it is somewhat broken right now
I have experienced that while playing with that mod, yes
I'm once again asking if anyone happens to know if Distribution values are based on percentage
table.insert(ProceduralDistributions["list"]["WardrobeChild"].items, 0.03);```
would this count as 3%? is it based on 1 = 100
we even tried to like up the sound on them with 250 with no zombies even hearing it. so like everygun have silincer by default if you compare it with a shotgun from vanille why we drop the mod again π
yea 0.03 is procentage so that is 3% drop chance
so the game just rolls the dice on whether or not it should contain an item?
and then the container some time have x amount of rolls and how many items is maximum can have / minium
oki, ty
is it possible to add "for i =" cycle to spawn multiple piece of the same item right?
like this:
for i = 1, 4, 1 do
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "Base.DuctTape");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 0.5);
end
will try to spawn 4 times?
i mean this way i can have 1-4 duct tapes randomly in the loot every time
to be honors i cant remember if it based on hash value or not depends how lua append
no, this will just add the 1 item 4 times to the table.
so it do make it like append to lest when insert and not like a hashval thx lexx then i dont have to read on documentaions ^^
Can I call items from my item.txt file in a lua event?
I am trying to make so when you have a specific trait, you wont gain any unhappiness from drinking.
(I've made a pee mod where u drink pee and as of now u gain unhappiness)
then how is it possible to do it? I cant find any proper documentations about this :\
no clue :>
you want to have the chance of a zombie to drop either 1-4 ducttape?
for example, yes
i mean between 1-4 randomly
im curious about both methods π
if it for the whole table you can see the table have a roll
that roll = 1 on a zomboi on the first script you uplaoded here tells the game roll onces on this table when they zombie die
if you change that to 4 it will roll 4 times to see if it drops anything
that a table roll
so the rolls parameter decides how many times the drops can happen in the same body
from the whole loot table yes
there might be 2 ways to do it ^^
but one way "the easy for non modder" might be add a new items which consume .25 on usages there give you a duct tape. and then have the table to have either 0.25,0.50...... contention when found and the other way im not quite sure yet let me see for 2 min
sure, take your time π Thanks for giving me direction
Anyone got a link to button map list? Trying to add buttons in my code, but got no clue which number is what button.
achii value i think the game runing in
I have a texture using tex = getTexture("media/ui/MoreTab/line_100x2.png")
Is there a function to resize the texture like that ? text = resizeTexture(tex, w, h)
also have you tried to see if you can do "KEY_J" ? else i know it somewhere in here ^^
yeah distributions work weird... did a 100% chance on an item but there were still times where it didn't roll the item at all, its gonna be weird to balance if 100% isnt 100%
i take it you know abit more about which mapping they using π
Anyone knows what software people use to create .fbx animations? I've tried many but just result in error or bugged animations
I can't make it work but it's been funny
have you asked in modeling channel ?
but i guess blender
it's blender here
try #modeling, it's more they stuff
ok ok
So I found a list of different events, OnKeyPressed, etc. And I found that GlobalObject() list, for example getPlayer(), etc.
But I wanna know all different functions I could use, for example:
I found a tutorial on how to make text appear over your characters head using a keypress.
But the :Say("Whatever!") you put behind getPlayer() would never be obvious unless I saw that little tutorial. Is there a list of those certain commands/variables?
Yup!
https://zomboid-javadoc.com/41.65/
From here you can find all accessible functions including Say
Javadoc Project Zomboid Modding API package index
For ex. https://zomboid-javadoc.com/41.65/zombie/characters/IsoGameCharacter.html#Say(java.lang.String)
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoGameCharacter
I tested this same function with just prompting a text above head saying test.
But I can't get it to spawn a specific item in a dead zombies inventory, am I doing it wrong?
if (ZombRand(3) == 0) then
zombie:getInventory():AddItem("PeeFilter")
end
end
Events.OnZombieDead.Add(ZombKilled);```
Fixed my own problem! It was supposed to be Base.PeeFilter
Anyone know where I can find the list of item ID's for all of the guns added by Brita's weapon pack?
mods are from workshop
@umbral grove @drifting ore #mod_support
Is there a stable mod for silencers/suppressors ? Silencer/suppressor mod doesnt seem to work (tho it may bcoz theres another silencer mod which im not aware)
I am looking for the lua script for traits, trying to see how the Smoker trait code works in actually minimizing stress when consumed, trying to add that to my own mod.
Is it possible to mod in enormous, many-feet long muzzle flashes?
Or are we currently stuck with the tiny baby flashes?
Anything is possible
Ok Imma leave it here then, I need help with a code that works like this.
(Currently you gain unhappiness from drinking pee in a bottle that I have added.)
With trait "Happy pee drinker" > Drinks pee > Gains no unhappiness
The trait is already in but got no function.
Hi! I'm new to PZ modding, trying to figure out how things work!
Could someone please give me some info about the contents of the .txt files that are located in media\scripts folder? At first, I thought it was lua code, but it doesn't seem like it..
I need it so I can set the appropriate code highlighting in vs code.
Believe me, I thought the same when I tried to look for the part that gives guns the muzzle flashes...
Its all scripts that contain reference tags that are defined in lua.
Hi everyone, small question about the .xml files in generals. (fileguidtable.xml, clothing.xml etc...)
I have seen both mods that entirely redo the fileguidtable.xml or the clothing.xml files and others that just create one with only the stuff added by the mod inside.
As the console.txt file states that mods overrides theses files, I'm a bit lost.
Can I get away with creating a fileguidtable.xml containing only my custom content or is this going to override the WHOLE GUID table ?
workshop mod to show how much gas is remaining at a pump?
If thereβs more than one different silencer/suppressor, will it break all gun sounds ? I got firearms b41 n More attachments
that would also be a question for #mod_support
Thank you for your reply! Oh, you mean they are defined in the .lua files?
e.g. items.txt contains the attributes of each item that is defined in Distibutions.lua linked lists, have I got it right?
But what data structure type is each item reference in items.txt?
e.g.
item BeerEmpty { DisplayCategory = WaterContainer, Weight = 0.1, CanStoreWater = TRUE, Type = Normal, DisplayName = Empty Bottle, ReplaceOnUseOn = WaterSource-BeerWaterFull, Icon = Wine2Empty, StaticModel = BeerBottle, WorldStaticModel = BeerBottle, }
There is no = sign, so item BeerEmpty {} is not an array or a list. It looks like JSON but it isn't either. π I'm sorry for the long post, but I'm trying to understand...
any good mods for increased storage space in wooden crates? cant seem to find one
its a custom format
Kinda stuck with this, so any help is appreciated. Trying to finish my own addon to Better Lockpicking so people can disarm house alarms and I'm having trouble associating the "found alarm" with a given building.
The code giving me problems is:
require "Lockpicking/Actions/CheckAlarmBuildingAction"
function CheckAlarmBuildingAction:perform()
local def = self.building:getBuilding():getDef()
ISBaseTimedAction.perform(self);
if self.obj:getModData()["BetLock_cantCheckAlarm"] == nil then
self.obj:getModData()["BetLock_cantCheckAlarm"] = (ZombRand(100) < 5)
end
if self.obj:getModData()["BetLock_cantCheckAlarm"] then
self.character:Say(getText("UI_cant_check_alarm"))
else
if (self.sq1:getBuilding() and self.sq1:getBuilding():getDef():isAlarmed()) or (self.sq2:getBuilding() and self.sq2:getBuilding():getDef():isAlarmed()) then
self.character:Say(getText("UI_is_alarm"))
local rooms = def:getRooms()
for i = 0, rooms:size()-1 do
local room = rooms:get(i)
if room ~= nil then
local isoRoom = room:getIsoRoom()
local squares = isoRoom:getSquares()
for j = 0, squares:size()-1 do
local square = squares:get(j)
if square ~= nil then
square:getModData().HasAlarm = true
end
end
end
end
else
self.character:Say(getText("UI_is_no_alarm"))
(...)
end
end
end
Specifically the fourth line, "local def = self.building:getBuilding():getDef()" throws a "ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getBuilding of non-table: null at KahluaThread.tableget"
The thing is, a very similar code is used successfully to mark an alarm as attempted and failed to disarm:
function ISDisarmAlarm:perform()
local difference = math.abs(ZombRand(100) - self.baseChance)
local inv = self.character:getInventory()
local def = self.building:getBuilding():getDef()
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
--- Critical Failure
if difference <= 20 then
def:setAlarmed(false)
self.character:Say("Oh god... I think I triggered the alarm")
-- add a sound to the list so zombie/npc can hear it
local soundRadius = 500
local volume = 300
-- Use the emitter because it emits sound in the world (zombies can hear)
self.gameSound = self.character:getEmitter():playSound("burglar2");
addSound(self.character, self.character:getX(), self.character:getY(), self.character:getZ(), soundRadius, volume)
local rooms = def:getRooms()
for i = 0, rooms:size()-1 do
local room = rooms:get(i)
if room ~= nil then
local isoRoom = room:getIsoRoom()
local squares = isoRoom:getSquares()
for j = 0, squares:size()-1 do
local square = squares:get(j)
if square ~= nil then
square:getModData().failedDisarm = true
end
end
end
end
print ("Critical Failure: " .. difference)
--- Complete Failure
Oooh, ok! Thank you!! π
The code is heavily based on https://steamcommunity.com/sharedfiles/filedetails/?id=2653025458
Dislaik helped me in the past with using math.abs for multiple outcomes for a roll.
The question here is that I can set a "getModData().failedDisarm = true" for a building but I cannot do the same with "getModData().HasAlarm = true" and I have no clue why. The latter, however, is crucial to setting up player knowledge on a building-by-building basis. I did implementations of a simple, local variable like "alarmFound = true" but that meant the character kept the "knowledge" and could try to disarm other buildings - even those that were not alarmed.
does anyone know if theres a version of Erie Country with a functional map?
How can I find all the bags that are equipped on a player?
I know how to get all players items local playerItemList = self.char:getInventory():getItems()
But now, how to I extract only bags equiped ?
Hey everyone, i'm newbie here and i'm dedicated server owner π
Please tell me how to fix problem when someone update his mod and there is a error when join server with mods (version of mods).
If i use 30+ mods there is always will be a problem with mod version. How do you solve this problem when working with ur dedicated server?
I'm sure there is should be solution because it's pain to unsubscribe all mods and install it again every time!!!
Hello all π
I am trying to mod my game a little.
Simply, I want to change the code so that I can plumb my sink without being 'indoor' for the sink.
I searched the workshop for 'sink' and nothing showed up.
I then tried to search the media folder for 'sink', nothing too and when I opened the "RainBarrel" folder and looked at the code, I didn't see a thing that would suggest a plumbing code to check if it is indoor or not...
Can someone more knowledgeable help me a little ^^' ?
It's a question for #mod_support, here it's for make mod
I think what you're trying to do is a bit too complicated to begin with.
I looked quickly and I found nothing in the code. It happens that this kind of mechanism is still in java. So very complicated to mod and I have no idea how to do it
oh :/ I am still looking into it, I am in the "timed action" folder rn, maybe plumbing is one ? but if not and it's still in java then I'm caput x)
There is a ISPlumbItem indeed, maybe it do what you looking for
Did Found it but it just calls some function and nothing more that I understand :/
It annoys me so much not being able to exchange data between players that I'm about to throw my mod away. I've been trying to do one simple fucking thing with global modData for days but they shit is so screwed up, it's unusable
Time for a new one π
You're right it's been 12 hours since I last updated
Then maybe you can create a new mod that get sinks to be plumbed outside :p ? (well it's a joke but if you can, you are my angel xD)
Is there a way to contact the developers? To ask them how I can use global modData. It shouldn't take long to explain. And after that, I would use the infos to make a guide
From what I understand you have to flip it over to the server (?)
isServer() will tell you if code is being run by the server or a connected client
generally stuff inside the server folder should be ran by the server
Believe me, everything has already been tried
anything inside the client folders can't communicate with anything inside the server folder (I think) -- that's where shared comes in
you could (and probably have to) use a clientcommand/servercommand if there isn't a send global data
I've been putting off writing EHE to be more server side cause i'm still wrapping my head around it
Wtf is a command ?
There's two events
basically 1 for when server recieves data/command
one where clients receives data/command
This is how I coordinate EHE events between players
EHE ? It's your mod ?
it's all actually still client side - but I have clients send the data to the srever, then back to all others
cause I'm a bad person
Yes
It's exactly what I'm looking for
If you're trying to set the globalmodData - if you have it inside the server folder and tied to an event the server can run
it will be serverside
I assume you're trying to get players to read the data?
Yes, basically I want to be able to read one player's modData from another
Co' no, he already try to help
like the player's IsoPlayer object modData?
Yes, like that otherPlayer:getModData()
But I get a nil every time
I'm actually curious about how players on eitherside of the p2p works - but yeah you'd have to send it to the server upon request
Let me write up an example of what I use
That would be great thanks, can you give me the full name of your mod too pls? I would go watch
---\client\
local function onServerCommandToClient(_module, _command, _args)
--clientside
if _module == "testModule" then
if _command == "sendPlayersUsernamePONG" then
print("RESULT:".._args.username)
end
end
end
Events.OnServerCommand.Add(onServerCommandToClient)
---\server\
local function onClientCommandToServer(_module, _command, _player, _args)
--serverside
if _module == "testModule" then
if _command == "sendPlayersUsernamePING" then
exampleOfClientToServerToClient(true)
sendServerCommand("testModule", "sendPlayersUsernamePONG", _args)
end
end
end
Events.OnClientCommand.Add(onClientCommandToServer)
---sendServerCommand("testModule", "testCommand", _args)
---overload: sendServerCommand(player, "testModule", "testCommand", _args)
---sendClientCommand("testModule", "testCommand", _args)
---overload: sendClientCommand(player, "testModule", "testCommand", _args)
function exampleOfClientToServerToClient(override)
if not override and isClient() then
sendClientCommand("testModule", "sendPlayersUsernamePING",{username=getPlayer():getUsername()})
else
print("ClientOrOveriddenTest:"..getPlayer():getUsername())
end
end
Expanded Helicopter Events = EHE
I haven't tested if this actually works mostly just cleaned up what I have - but this would be an example of the client sending info to the server and back to all clients
I assume you'd want your modData to be sent to the server
and then to be given by the server upon request?
---\client\ function belongs in client, server in server
the last function is an example of a shared command
actually wait lol
Kind of gave you two examples in one
_args is sending a string
but you can also have a shared function get used twice over depending if it's client-side or server side
@drifting ore Also Turbo mentioned LuaNet.lua
Forgot to actually look into that
Anyone know how many positive rating I need until I actually get a rating? I am at 20 atm.
on the workshop
Thx, I will check that. It seems complicated to me. Because how do I recover the value on the client side? I don't see how it works honestly
O I use sendServerCommand("testModule", "testCommand", _args) on the client side right ?
sendSeverCommand sneds the data back to all clients or just 1
To put the data on the server side and then I use sendClientCommand("testModule", "testCommand", _args) to get it back to the client ?
So if I want a player's data. I send the data with sendClientCommand, then on the server sends them back to the other player with sendServerCommand
Ok I will try that thx
Otherwise, what is LuaNet.lua? I look at it rn, it also looks like what I'm looking for
I haven't looked
No, juste a table with bool. Should be OK
Like ~50 boolean
LuaNet is a overly complex unnecessary wrapper around sendClientCommand/sendServerCommand
So you're trying to keep a table of player related info?
Ok, I'll give up now then
Yes, in modData I have the data if the player's arm is cut or not and that's what I want to get and modify from an other player.
ah
I am surprised there isn't a send visual method?
seems like a big thing the MP code already does
What you mean by that ?
No no, change the modData of the player. That's all I want, to have access and modify the modData of a player from another
In my mod I do not change the player's visual. I just equip him with an invisible cloth
I still thought about a layout that would be nice to display equipment and I did that. What do you think ? I don't find it great personally
I did find one that is cool to look at but something is missing, maybe you can get inspiration from it ? https://steamcommunity.com/sharedfiles/filedetails/?id=2695471997
You can double click to unequip and the "Equip weapon" button opens a window with a list of all the weapons at hand. Or you can also double click to add them to inventory or equip them. That also hide equipment in the inventory panel
That sounds neat π
Thx, yes I saw this mod, but I'm trying to do something different so that it's not just a copy
Lists are not very nice but at least it works with absolutely all mods
What I find missing from that mod is that I want an inventory of all clothing layers and what clothing is occupying that layer. That way I'd know if I've got all layeres covered or not. Better to have separate articles with +20 bite for 2 layers than one article with +30 bite covering both of them. Plus you can pad each of the two vs only the one. I'm not aware of any mod that does that. I like the one in The Long Dark: https://thelongdark-archive.fandom.com/wiki/Clothing?file=ClothingUI.jpg.
Clothing is what the player wears on their body, and is the most common protection against the weather. Mechanically, this translates into how fast the Cold meter decreases. Properly maintained clothing will keep the player warm in most environments, at the cost of carrying the clothing, and thus, having less weight to carry other items.
You c...
I see. It's right that it can't do that :/
What I do to know if it does remove two clothing insterad of one is equip it and see if something was removed with the mods and then try to see if it's a downside or not... It's prety long winded ^^'
If a mod did that it would be a really nice QoL
Can't you just look in the protection menu? I don't understand your problem
Anyone familiar with Britta's Weapons?
Is there a function like getPlayer():getBags()? To collect all the bags that the players carry
I have a question regarding moddata and transmit. I'm trying to send data between the server and the client in both ways. when I'm assigning values on the server side and then transmitting, nothing will change on the user's end even so I'm using Moddata.get every time I check.
Is there another way for sending data between both the client and server in both directions, it doesn't have to be anything complex even sending strings will do the job
--- server side code
local Commands = {} -- this table should hold various functions
local onClientCommand = function(module, command, player, args)
if module == 'MyModule' and Commands[command] then
args = args or {}
Commands[command](player, args)
end
end
Events.OnClientCommand.Add(onClientCommand)
--- client side code
local Commands = {} -- this table should hold various functions
local onServerCommand = function(module, command, args) -- note the lack of player arg
if module == 'MyModule' and Commands[command] then
args = args or {}
Commands[command](args)
end
end
Events.OnServerCommand.Add(onServerCommand)
-- example sends
-- Note "MyModule" is passed to the module argument in the above functions
-- "MyCommand" is passed to the command argument in the above functions,
-- which checks the Commands table for a function named "MyCommand"
-- the table is passed as the args argument to the above functions
-- client side sending
sendClientCommand("MyModule", "MyCommand", {key = "value", key2 = "value2"})
-- server side sending to all players
sendServerCommand("MyModule", "MyCommand", {key = "value", key2 = "value2"})
-- server side sending to a specific IsoPlayer
sendServerCommand(playerObj, "MyModule", "MyCommand", {key = "value", key2 = "value2"})
I'll give a try Thanks!
Hey if anyone can help, i get an error that suggests the guid's of my items are messed up but the xml and the guidtable share the same id so im not sure what to do. It usually appears ingame as a variety of rainbow colors with ClothingItem beneath its name. Edit: This seems to only occur when it's in the guidTable with another item, if i isolate it to another mod it works fine.
hey guys im trying to make some custom pills here (medicine), but i dont see any effect entry for any of the medicaments, like the sleeping pills;
item PillsSleepingTablets
{
DisplayCategory = FirstAid,
Weight = 0.2,
Type = Drainable,
UseDelta = 0.1,
UseWhileEquipped = FALSE,
DisplayName = Sleeping Tablets,
Icon = PillsSleeping,
Tooltip = Tooltip_PillsSleeping,
StaticModel = PillBottle,
WorldStaticModel = SleepingTablets_Ground,
Medical = TRUE,
}
so where is the file that connect this item with the sleeping tables effect on the char?
Protection lists areas of the body, not layers. So my arms are protected by long sleeve T shirt and jacket, and possibly other things. Does adding long johns replace the t shirt or does it add to it? What about a tank top? Etc.
i tried to make a recipe for it, when the player take the pills, to consume 1 works fine, but the effect is not working, i set it like this on my .lua
function Wiz_ReduceSleep(items, result, player)
local FatigueChange = -50; <---------------------------------------- ?
end
i want the pill to take fatigue out like coffe
the function comes from the recipe
recipe Take Stimulant Pills
{
Wiz_AwakePills_Tablets;1,
Result:Wiz_AwakePills_Tablets,
RemoveResultItem:true,
Time:30.0,
OnCreate:Wiz_ReduceSleep,
}
since i dont know lua could someone help me on that first part?
I cannot tell exactly cause im not at my PC, but it might have to do with your <files></files>. Each item needs to be in those tags.
NO:
<files>
Item 1
Item 2
</files>
YES:
<files>
Item 1
</files>
<files>
Item 2
</files>
i also tried like this
function Wiz_ReduceSleep (items, result, player)
local Fatigue = self.item:getFatigueChange();
self.character:getStats():setFatigue(self.character:getStats():getFatigue() + Fatigue);
self.item:Use();
self.item:getContainer():setDrawDirty(true);
self.item:setJobDelta(0.0);
self.character:getBodyDamage():JustTookPill(self.item);
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
i tried to make it as a food now it works fine, but the item also disapear when i try to eat it 1/4 or 1/2 only... anybody knows why this happen?
item Wiz_AwakePills_Tablets
{
DisplayCategory = Food,
Type = Food,
FoodType = NoExplicit,
Weight = 0.5,
AlwaysWelcomeGift = TRUE,
HungerChange = -1,
FatigueChange = -50,
EnduranceChange = 15,
Packaged = TRUE,
DisplayName = Stimulant Pills,
Tooltip = Tooltip_PillsStimulant,
Icon = Wiz_AwakePills_Tablets,
CustomEatSound = EatingCrispy,
StaticModel = PillBottle,
WorldStaticModel = SleepingTablets_Ground,
Carbohydrates = 0,
Proteins = 0,
Lipids = 0,
Calories = 10,
}
HI everyone. I'm trying to list all the items in a building, but I got stuck discovering how the items are located in the game. I tried to write some code using getBuilding(), getBuilding():getDef(), getRoom(), but I don't see the way of reaching the items from here. I saw there is a getObjects() method in some classes, but I think that's for things like walls, for example, isn't it?
hey all does anyone know what "Thread Pieces" are from? Its from a mod idk which but its stupid cus it makes it so i need 100pieces to make 1 thread
probably that tank mod