#mod_development
1 messages · Page 553 of 1
how do I change the main menu theme?
I have my code laid out like this but it isnt working?
Free Online GUID/UUID Generator
ive never used it myself, but that is what I see people replying to people asking about GUID generation
ohhhh, thank u !!!!
found this mod. you can probably find out from here. https://steamcommunity.com/sharedfiles/filedetails/?id=2670552173&searchtext=main+menu+music
I had it named as theme2 aswell, which is the normal name of it and it didnt work. but for my alarm replacement mod it shows that I dont need the vanilla file name to replace
ok so I need a audio bank I guess
but how tf do I do that lmao
hi where do i start when i want to create a cooldwn on respawn this is for pvp to avoid spawn killing
ight I found this guide that shows how to make custom audios
https://steamcommunity.com/sharedfiles/filedetails/?id=2474838710
damn TileZed is disrespected every chance
dose any one know if some one has done a mod for a C96 mauser and other ww1/2 guns in the game ?
🤔 ?
I actively try to avoid using it
Isn't it the only supported map editor program for this game
Hello!
I'm aware what I'm going to ask is probably close to impossible and that's why it's fine if no one answers as I completely understand it.
Going to the question: does anyone have any idea if it could be possible (or something close to it) to spawn base male/female skeletons (basically just empty characters) somehow (in MP)?
That would be needed for "rp purposes", like fake NPCs.
If that would be possible, does anyone think it would be possible to animate them (thinking of it as they should have their skeleton which is just the base character one) or dress them?
Thank you, sorry again for the weird overcomplex question.
I am using setIsThumpable to make IsoThumpable object temporarily nonhitable. Code that does this runs on server side. isThumpable is correctly set to false for players that don't have the object loaded. But players that had the object loaded before I changed isThumpable still have it set to true. Only thing that currently helps is reloading the object on client (either reconnecting or leaving and returning to the area where the object is). How do I properly send from server to all connected clients that object has changed so they have to update it? I tried this using transmitCompleteItemToClients() but that doesn't quite work because I end up with two overlaping and almost identical IsoThumpable objects occupying same grid square. Only difference between them is that the original one has isThumpable set to true and the copy has it set to false. I need to change it on the original IsoThumpable, not create copy of it with changed property. Is there vanilla function that I can use or do I have to make my own custom command to achieve this?
😉 "rp purposes"
😳 
More seriously, you can spawn IsoPlayers like the NPC mods do
I'm not sure what hiccups that could create in MP tho
But if they're meant as shop keepers or something, you could also set their god-mode on - the issue is zombies would still want to eat them.
I see, I see. That's useful, I'll check their code a bit to get some ideas.
Perhaps some kind of ghost mode, but that would be invisible to players as well so it could complicate some stuff.
Thank ya
Could have them die and respawn in a couple of in-game hours
or even check to see if the area is clear enough
Yeah.
Actually the "dying" thing would not be too much of a problem cause it would be made for a semi-private server in which I would have no issues both giving admin to everyone to see them or just putting them in safe places.
My idea was to use them as some kind of placeholders to give some ambience, just that
oh
I think you could retool mannequins for that - if they have animation capabilities i'm not sure
Oh
I'll try to check spawning some basic characters and see if it works/how would it work and perhaps have a look at mannequins if I completely fail
Though I see there are various mannequins tho im not sure if they just have animations or they are completely different models
Might be alot of work, may be better to just wait for NPCs lol
true lol
Perhaps pretending to have someone there could be smarter 😅
Oh yeah mannequins definitely use animation btw, just checking out.
You got a fair point tbh, I'll avoid the IsoCharacter thing as its way too complex. But Mannequin stuff perhaps
guys, you can throw a link to a complete guide to creating mods for clothes
you could just do it with OnserverCommand. Have the serverside code send the command using "sendServerCommand" to all players with the coordinates in the args. Then you just need to get the cell with the coordinates using getGridSquare(). if it is nil, then the area is unloaded, if it gives a cell, it is loaded. then just get the correct isoobjects from the objects on the cell and modify isthumpable.
It should be pinned somewhere in modelling if I ain't wrong
@tired charmok, thx
Like there are multiple useful things in there. There is even more since I last checked so it's surely full of good stuff.
@autumn ether https://dislaik.github.io/project_zomboid_modding/scripting_manual/clothing_mod/ this one in particular was useful
Oh nvm it's dead sry
this one is quite useful as well https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
@tired charmthx bro. БОЛЬШОЕ СПАСИБО, БРАТ
goes in very deep even with model importing so should contain everything if I remember correctly
you're welcome, I'll pretend to understand the second sentence
any mod that disables the use of speed up buttons?
Packet manipulation is the only way I know to do this but requires modding the engine of the game's server code.
I see, fair. Thank you.
Anyone know of a complete list of all settings for workshop.txt?
I feel like I'd have to inspect the JNI to look.
the best advice i can give you is to upload empty workshop.txt and edit it directly in steam
That'd populate every setting?
yes, here take example from my mod
version=1
id=2830301361
title=Project Fumo - boid
description=Adds ability to have fumos in project zomboid!
descrption= BLA BLA BLAH
description=Have a great day!
tags=Build 41;Items;Misc;Pop Culture;Silly/Fun
visibility=public```
@jagged ingot
id is given by uploading on steam workshop
same as you choose tags in workshop menu
Oh to clarify I know what these do
I'm having trouble seeing a 3D object food item in game
name also is given in workshop upload meny
I'm looking at taking a dissassembler to the JNI machine code for PZ-implementation of workshop txts so I thought I'd ask here first.
Can I pm?
no problem
Thanks.
What's the api class to add a column to the inventory table? I want to add a column showing the item / stack weight
The APIs for this game are not as robust as that - you'd have to dig into the lua and piece the UI together afaik
The bright side is you can make your own API to do what you want tho.
Not had a chance to look into modding zomboid yet. Is the majority of the game written in lua?
There are chunks of it in Lua - almost all UI is Lua based
The double edge sword of this is if a majority of the UI's process is all in 1 function you are going to have a hella of a time making it work with other mods that touch the same function.
But you can make it do whatever you want so to speak.
The main game is written in Java - with alot of exposed getters/setters for Lua
Im trying to set up RV interior for the multiplayer server i have with my friends. we are starting from a new save and in the instructions it says
"the map file "vehicle_interior" needs to be put in top priority for MP"
How can i do this?
I've been following a tutorial on youtube to mod Zomboid (Link:https://www.youtube.com/watch?v=N6tZujOPnDw) and I guess its outdated. In my "Mod\media\lua\server\items\FFM-Distributions.lua" do I need to add the ProceduralDistributions.lua also?
This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.
0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...
in topic of distribution
i also need help
Check out #mod_support
But to also answer when you choose mods the menu should have a map priority button. I'm not sure if that button exists for the hosting though.
is there a version of Lockpicking that actually works with the current Framework? Tried a bunch and no success
okay
i have question
is there any way to make some effect take on player
like interact with toy -> reduce boredom
module Base
{
recipe interact with fumo
{
Time:300,
Sound:PutItemInBag,
Category:Entertainment,
}
}
this is my current code
anybody knows how to make it "enjoyable for character"?
Anybody know if it's possible to get a vehicle's key from the player's inventory?
Not check if they have the key. Specifically get the key itself.
im having trouble with two sandbox options translation/tooltips not showing up, and one sandbox option just not showing up at all (type string on that one)
VERSION = 1,
option UdderlySkillbookXP.Multiplier = {
type = double,
default = 5.5,
min = 0.01,
max = 10,
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_Multiplier,
}
option UdderlySkillbookXP.NeedLight = {
type = boolean,
default = true,
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_NeedLight,
}
option UdderlySkillbookXP.ReadWhileWalking = {
type = boolean,
default = false,
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_ReadWhileWalking,
}
option UdderlySkillbookXP.WalkingMultiplier = {
type = double,
default = 0.5,
min = 0.01,
max = 10,
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_WalkingMultiplier,
}
option UdderlySkillbookXP.SittingMultiplier = {
type = double,
default = 1.0,
min = 0.01,
max = 10,
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_SittingMultiplier,
}
option UdderlySkillbookXP.SkillWhitelist = {
type = string,
default = Woodwork;Electricity;MetalWelding;Mechanics
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_SkillWhitelist,
}```
Sandbox_UdderlySkillbookXP = "Udderly Skillbook XP",
Sandbox_UdderlySkillbookXP_Multiplier = "XP Multiplier",
Sandbox_UdderlySkillbookXP_Multiplier_tooltip = "XP gain per page multiplier (before any others).",
Sandbox_UdderlySkillbookXP_NeedLight = "Need Light To Read",
Sandbox_UdderlySkillbookXP_NeedLight_tooltip = "If checked, requires light to read.",
Sandbox_UdderlySkillbookXP_ReadWhileWalking = "Allow Reading While Walking",
Sandbox_UdderlySkillbookXP_ReadWhileWalking_tooltip = "If checked, allows users to read while walking with a separate multiplier applied.",
Sandbox_UdderlySkillbookXP_WalkingMultiplier = "Walking Multiplier",
Sandbox_UdderlySkillbookXP_WalkingMultiplier_tooltip = "Multiplier applied (on top of the regular one) when walking while reading is enabled and the user is walking.",
Sandbox_UdderlySkillbookXP_SittingMultiplier = "Sitting Multiplier",
Sandbox_UdderlySkillbookXP_SittingMultiplier_tooltip = "Multiplier applied (on top of the regular one) when the user is sitting while reading .",
Sandbox_UdderlySkillbookXP_SkillWhitelist = "Skill Whitelist",
Sandbox_UdderlySkillbookXP_SkillWhitelist_tooltip = "List of semicolor-delimited skill names - internal names from the game, not the normal names. If blank, defaults to Carpentry/Electrical/Metalworking/Mechanics.",
}```
anyone see a mistake?
sorry to spam i thought it'd collapse those..
:|
you will want to create a onCreate function that then applies the stat changes on the player
player:getXp():AddXP(Perks.Tailoring, 80);
end```
some thing like this?
just changing values for boredom and unhapnnies change?
ok apparently it was using the copy in the workshop folder, so updating that one fixed the two that were showing up but im not sur why the string one is missing..
if somebody would help with lua command to change unhapines and boredom i would be thankfull
how do I change the main menu song? I followed this guide I found on steam and it doesnt work.
https://steamcommunity.com/sharedfiles/filedetails/?id=2474838710
check date of last update
a tip for future
something < 3 months can be taken as outdated
ya there are a few changes from the beta built compared to released
but mostly all of it is the exact same
its just the music is found in a different bank file
\Steam\steamapps\common\ProjectZomboid\media\music
usually looking at game files helps
im not quite sure how to overwrite thing but internet propably do
I have tried to make a custom "Theme2" ogg file and it didnt work
I have tried to follow that guide by extracting "ZomboidMusic.bank" and editing the files mx_intro_main_120bpm.wav, mx_intro_stop_120bpm.wav, and mx_intro_end_120bpm.wav
then I repacked the bank file and put it into my mod
and it didnt work
player:StressChange = -20;
player:UnhappyChange = -20;
player:BoredomChange = 10,
end```
will this function work?
number of errorrs says to me
no
player:getBodyDamage():setBoredomLevel(player:getBodyDamage():getBoredomLevel() - b);
player:getBodyDamage():setUnhappynessLevel(player:getBodyDamage():getUnhappynessLevel() - u);
b and u being the values you are reducing it by
okay, thank you
so i put in the middle of function?
player:getBodyDamage():setBoredomLevel(player:getBodyDamage():getBoredomLevel() + 10);
player:getBodyDamage():setUnhappynessLevel(player:getBodyDamage():getUnhappynessLevel() - 20);
end```
yes that should be right
thanks!
somehow it doesn't work
ohhh
{
recipe squish da fumo
{
destroy FUMOTH_power,
Time:300,
Result:FUMOTH_power=1,
OnCreate:Recipe.OnCreate.OpenFUMOTH_power,
Sound:PutItemInBag,
Category:Entertainment,
squished,
}
}```
I forgot
module Base
{
recipe squish da fumo
{
destroy FUMOTH_power,
Time:300,
Result:FUMOTH_power=1,
OnCreate:Recipe.OnCreate.OpenFUMOTH_power,
Sound:PutItemInBag,
Category:Entertainment,
OnCreate:squished,
}
}```
second one is propably correct
@shadow geyser it still doesn't work, any advice?
type = string,
default = Woodwork;Electricity;MetalWelding;Mechanics
page = UdderlySkillbookXP,
translation = UdderlySkillbookXP_SkillWhitelist,
}```
this is part of sandbox options for my mod
everything else shows up but this one
anyone know why?
it's the only type = string one
i suspect relevant, but i don't know what's up
there is not recipe field from what I can see in the vanilla code. they all only have "items, result, player" try removing the recipe field. from what I can tell, its only the onGiveXP functions that have the recipe field
okay, will do
i get this error
Callframe at: PerformMakeItem
function: perform -- file: ISCraftAction.lua line # 58
ERROR: General , 1658451398160> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in squished at KahluaUtil.fail line:82.
ERROR: General , 1658451398161> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in squished```
{
recipe squish da fumo
{
destroy FUMOTH_power,
Time:300,
Result:FUMOTH_power=1,
OnCreate:Recipe.OnCreate.OpenFUMOTH_power,
Sound:PutItemInBag,
Category:Entertainment,
OnCreate:squished,
}
} ```
^current code
is it because "onCreate reapeats?"
player:Say(tostring(roll1))
player:Say(KaeldorDice[(roll1 + 0)] .. "!")
Question - how do you make an action say something to everyone around you? Like a proper message and not just over your own head?
I am so incredibly stupid
ok so this guide 100% works with 0 issue. it is just that I was editing the WRONG FILE

happens all the time
or a small text error
and 4 hours goes away
I was editing the music for when you create or load into a game
not the main menu music
im going to just restart from step 1
delete everything and extract the vanilla bank file again
you probably shouldn't have two OnCreate but they error here is from lua file
how does your function look ?
function squished(ingredients, result, player)
player:getBodyDamage():setBoredomLevel(player:getBodyDamage():getBoredomLevel() - 10);
player:getBodyDamage():setUnhappynessLevel(player:getBodyDamage():getUnhappynessLevel() - 20);
player:getBodyDamage():setStressLevel(player:getBodyDamage():getStressLevel() - 20);
end
Hi there. I'm the co-author of SmallTownResponders. And there's been an issue plaguing it for a while now.
I've got code to dynamically replace zeds and cars, buuut...
scriptReloaded() causes doors/windows to bug out (as in you won't be able to lock the doors, and interacting with them causes log spam about "null"). As in setScriptName()
and the zombies refuse to save their changes beyond being reloaded
but the vehicles... Here's the kicker
if I use setScriptName() Without using scriptReloaded(), it doesn't break anything, but the car won't update itself unless you leave and come back to it
my dilemma is that I'm completely at a loss on how to force the car to update? (I know this is the millionth time I've asked about this, but yeahh.....)
any idea?
so its something with "setStressLevel"
If you delete that line it should work.
okay, thank you
hm i have it set up like this in my mod and it works fine
player:getBodyDamage():setUnhappynessLevel(player:getBodyDamage():getUnhappynessLevel() - 10);
player:getBodyDamage():setBoredomLevel(player:getBodyDamage():getBoredomLevel() - 50);
end ```
It works
thanks!
i can finally go to sleep
yupi
anyone know if I can add custom RCON commands to a server? looking to add toggled wailing sirens and fog
Is there any way to conveniently see and/or edit .class files in the Lua directory without having to decompile every single one?
I may be late for response (was away). There's a core-mod being worked on for clients that allows for manipulation of music for the main and loading screen. The problem is that it requires the game itself to be modded, not through the workshop.
You can still achieve this. Let me grab the code that allows it.
See? Yes. There's a JavaDocs for 41.65 and a TypeScript typings for 41.71. I can grab both links.
Editing? Yes. There're tools for this. Fernflower is a CLI one. For each individual class, you can double-click on a .class file in IntelliJ IDEA.
There're also GitHub repositories that guides decompilation of the .class files.
I would love to have these references
yeah I got the music editing to work. I was just wondering if it was possible tohave the music be edited by a mod instead of changing the game files themselves.
These are the unofficial JavaDocs for 41.65:
https://zomboid-javadoc.com/41.65/
These are TypeScript typings for 41.71:
https://github.com/asledgehammer/PipeWrench/tree/41.71
Yes you can.
Very much appreciated. Thank you
how would I do that? this is what I got when I edited the game files themselves.
poggers
Here's code from one of my mods:
function MusicPlayer:updateVolume()
local pz_volume = getPZVolume();
if pz_volume > 0.0 then
self._volume = pz_volume;
if self.disable_pz_music then
-- Disable Project Zomboid's music by setting their volume to zero.
setPZVolume(0.0);
getSoundManager():StopMusic();
end
else
if not self.disable_pz_music
and pz_volume == 0.0
and self._volume ~= 0.0 then
-- Restore Project Zomboid's internal music volume.
setPZVolume(self._volume);
end
end
end
--------------------------------------------------------------------------------------
-- ###### ####### ## ## ## ## ######## ## ## ###### ######## --
-- ## ## ## ## ## ## ### ## ## ## ### ### ## ## ## ## --
-- ## ## ## ## ## #### ## ## ## #### #### ## ## ## --
-- ###### ## ## ## ## ## ## ## ## ## ## ### ## ## #### ######## --
-- ## ## ## ## ## ## #### ## ## ## ## ## ## ## ## --
-- ## ## ## ## ## ## ## ### ## ## ## ## ## ## ## ## --
-- ###### ####### ####### ## ## ######## ## ## ###### ## ## --
--------------------------------------------------------------------------------------
PZ_SOUND_MANAGER = getSoundManager();
-----------------------------------------------------------------
stopSoundManager = function() getSoundManager():stop() end
-----------------------------------------------------------------
getPZVolume = function() return getSoundManager():getMusicVolume() end
-----------------------------------------------------------------
setPZVolume = function(volume) getSoundManager():setMusicVolume(volume) end
-----------------------------------------------------------------
stopPZMusic = function() end
-----------------------------------------------------------------
any way to recompile a class I made?
Yes. Make a JAR file of all package roots in the PZ install. It is easiest to do this with the dedicated server since they're housed in the java folder. Add the dependencies to the project. Add your class in and compile it.
All the IDE / javac cares about are the calls that class are making / referencing are resolvable.
I assumed I would of used code similar to this when I started this project. but I was sorely mistaken lmao
If your compiler complains about something not being found, simply find it and add it to your project.
hm...
Yes. I used GameSound / GameSoundClip to play music instead. Install your music files in /media/sounds/
I am only making two classes, one to turn the fog on and one to turn it off
so would I just put the bank file in the sounds folder, or would I have to recreate the banks/Desktop path too?
I don't know if there's exposed API for loading custom fmod banks.
Check zombie.GameSounds
I didnt find zombie.GameSounds, but I did find zombie.GameStates which has a MainScreenState that also has a musicTrack state in that
I have no idea where any of that is
Ah. Yeah the audio API for Zomboid can be confusing. It's a bit of a maze.
Some deprecated / dead code in there.
For a mod like expanded heli events it uses a wailing siren audio byte. I am wondering if there is a way to access that sound (if it isn't a custom one) and trigger it via Lua
It's the Java stuff.
im on the https://projectzomboid.com/modding site
Hey. That JavaDocs is old. 2015 old.
It's so dated that using it will hurt you.
It's from the mid 30's in major version.
Use this instead: https://zomboid-javadoc.com/41.65/
Javadoc Project Zomboid Modding API package index
I was wondering, aside from TrueMusic, is there a way to get different in game music? I love the in game music don’t get me wrong. I just want to have some different music for RP reasons.
The code I mentioned above helps stop the music for PZ.
I will try to wrap my head around literally any of this lol
Ah wonderful thank you. I want to add some songs from Sons of Anarchy show and Days Gone game for a biker RP
-- Create your own sound emitter
emitter = FMODSoundEmitter.new()
-- Create your own GameSound
sound = GameSounds.getSound(..)
-- Play your GameSound
clip = sound:getRandomClip()
channel = emitter:playClip(clip, nil)
-- Stop your GameSound
emitter:stopSound(channel)
-- Check if your GameSound is playing
emitter:isPlaying(channel)
I don't want you to waste hours researching the API like I did.
the hero we needed lol thank you
thanks, I barely understand any of this to begin with, so it would take me more than a few hours
true chad
I'll have my buddy make a guide for it.
I think more people need to know this.
This is from his code too which is a full music player, having things like fadeIn / fadeOut.
This is not used code anymore since he went full-on core-modding and redesigned it to work in Java.
I thought core coding was frowned upon as it can't connect as a mod for others to use except the server its on
I've done it for several years. My buddy's done it for nearly a decade.
People didn't frown on his work when he allowed for custom weapon mods back then. 🙂
Im asking why the official wiki says its not allowed
yeah
must be a nightmare, does he have a fully decompiled game then?
or does he go class by class
Yeah. He has decompiled archives going back to build 31.
Self decompiled? thats a lot of work for one person to clean those out
You can do either. It's not wise to go through all classes and fix them. Just fix the ones you use.
You don't have to decompile all classes to mod it.
well yeah thats what I thought
idek how you would get ahold of anything but the .class files
not that you need more than that
IntelliJ IDEA makes decompiling classes so much easier. It uses a packaged CLI analytic decompiler for Java called fernflower.
yeah I noticed I could just click and go
Simply open a .class file.
Back then in the alpha days of Minecraft, you'd need to decompile it through CLI or scripts.
only issue is figuring out how to make my own biz
for my first core project I want to add a wailing siren + fog command so I can
/startfog + intensity
and
/start siren (entire map)
Ah. You can do this with a core mod that pairs with an API on the Workshop
It's built for Twitch command integrations.
I wouldn't mind looking at the source code for those but that isn't usually available
Im looking to go inhouse, I've learned I don't want to be relying on other people's code if I want to work on stuff like this
The first one is an API for you to do your own stuff in-house.
The second one is an example implementation.
I see, I'll look into these
Sure thing. The game doesn't allow for custom commands to go through RCON and server Lua.
OnClientCommand and OnServerCommand is a thing.
It has to come from either client Lua or server Lua, so no console interface & RCON.
the plugin seems to say it supports RCON
which is good as it's what I'm looking for
It's a custom command class and a mod to the CommandBase class to dynamically load Java command classes like it. The custom command forwards the command info to Lua.
Then you can do what you want.
Don't have to use it of course. It's an option though. 🙂
Better than doing it myself, thought I might learn more there is 0 documentation on that kind of mod
shweet, not often you see that in the modding community
or at least in the workshop

He's working on a generator for generating TypeScript typings for the Lua codebase for the game too. That community / org works on modding tools.
The code there is documented (mostly)
Hope the tool helps if used. 😄
Oh. Haha. Maybe he saw the guide for PipeWrench.
for you are you often making mods in java or lua more?
Both. Java more.
you work with a server ?
I used to do that a long time ago. Been looking for work lately for it.
ye, I'd think Lua is better for making mods for others and java is better for working on a customized server type of scene
Yup. I don't want to turn this into a #ad for the org however there is a bukkit-like framework for PZ on there too.
Java modding is best for servers.
That's the aim
I like Lua, however (And this is all my opinion), Lua isn't scalable like TypeScript, a language designed to compile to other languages and designed to scale.
You write typescript for java ? or for lua
It's fast and flexible. TypeScript is too but in different ways that act as safety and compiler checks for what causes most problems in bigger scripting codebases.
I write TypeScript, Java, and Lua.
Interchangable. 🙂
JS is web or Node.
well I mean TypeScript as JS
TS is primarily used for and targets compiling to JS.
It can compile to other languages too. 🙂
You use TS to write mods or to compile Lua to Java
Compile TS to Lua.
how do you squish the scope of TS into a limited box like Lua?
I thought it would be the other way around
@wraith root It's actually the other way around since types aren't explicitly a part of the language's syntax.
Lua is more expressive at the cost of constraint.
Can you give me an example?
Actually this is wrong. Java is the most different out of the three. TypeScript comes close to Java however TypeScript does things differently with OOP. Lua has no types. If anything, Lua is closest to JavaScript ES5.
Are trades between players stored in any log anywhere?
I believe the general consensus with Java (and by extension I'd presume TS) is that it has a massive range of availability for modding since it deals with source
versus Lua which has to find points of access in the code to get ahold of
I'd assume in the console logs if anything is said about it when the transaction occurs. Other than that I'm not sure.
I'm seeing a ton of logs, dedicated host, but nothing related to trades
Currently trying to solve an unexplainable case of "rollback", trying to proof what his friend gave him before the restart
I don't think that if it were logged it would be there. It'd most-likely be in general
Let me check something..
You can make the log entry yourself actually..
These events are pretty vague though..
Looking at 41.71 events now..
It's weird
We had 17 people online
11 logged out before restart, 6 stayed in
But out of the 6, only ONE got rolled back
I'm thinking this is more of a client issue / error / disconnect than a ser ver issue
He did mention he left for the toilet and came back to being disconnected
But a scheduled restart ALWAYS saves progress
RequestTrade
AcceptedTrade
TradingUIAddItem
TradingUIRemoveItem
TradingUIUpdateState
At least TradingUIAddItem has more info.
Lera you could possibly suggest logging trades to the devs. I think this is a good suggestion.
anyway to override the need to have chat open to see global server messages>
Does anyone know where I can find the code that makes "axeman" function the way that it does? I've done some prowling around in the animstates where I thought it would be, but had no luck, and the lua files only found me where the trait is created, not where its special axe speed bonus is defined.
I'm asking because I want to try and make similar traits for long blades, blunt weapons, etc.
the problem is in your oncreate function. what is line 4?
there is no setstresslevel. it is just setstress. you should check the javadoc when putting in functions.https://zomboid-javadoc.com/41.65/
Javadoc Project Zomboid Modding API package index
Out of curiosity, does anyone here besides me and a couple people I know write Lua using modules?
ive been convinced about them, so will be using them more in the future
although in my case its just about having less pollution in the global space rather than trying to take advantage of the reusability of code.
Better practices = better code.
IMO only pseudo-classes should be in global space.
constant tables too.
Oh neat I just found this on lua-users.org:
-- converts a mutable object to an immutable one (as a proxy)
local function const(obj)
local mt = {}
function mt.__index(proxy,k)
local v = obj[k]
if type(v) == 'table' then
v = const(v)
end
return v
end
function mt.__newindex(proxy,k,v)
error("object is constant", 2)
end
local tc = setmetatable({}, mt)
return tc
end
🙏
Does anyone know in which ui lua file players health bar is contained?
Character info sub panel
Yes, the closest I got is ISHealthPanel.lua but I can't pin-point exact component. I want to put my custom module below this bar, perhaps even overriding healthbar rendering would be easiest.
Not to dredge up an old Convo but those access points are designed - I'm fairly certain IS could've blanket access the whole shebang but took a more measured approach for the sake of security
That convo was interesting
When putting an item with a -100000 weight into a car's storage, the car "dissapears" anyone know exactly what happens?
I remember about maybe 2 years ago, that was not a problem, but it is now.
Anyone else getting reports of sandbox vars resetting on dedicated servers? I was using getSandboxOptions():updateFromLua() in one of my functions - and have since commented it out - but people occasionally are still saying it's happening.
If someone is willing to help me out with the final part of my mod, mostly just troubleshooting and fixing the final parts, that would be great. I tried to make a medicine type object, but for some reason, it will not be a consumable objects, just a plain object.
The other issue is the semi-infinite weight item.
When ever it's put in a vehicle, the vehicle breaks. Would love to find either a workaround or something for that.
I set my mod to hidden, but can easily undo that. but if no one is willing to even help me, i don't see the point in un-hiding the mod.
As of right now, i consider the mod "broken" and would love to have it fixed.
It is only those two issues i have been dealing with, so if you are not awfully busy, some help would be marvelous.
im not sure, but I think the weight of the items in a vehicle affect the physics of the vehicle. maybe the extremely negative number is messing with the physics of the car drastically that it gets thrown away. wouldn't be the first time cars experienced weird physics stuff
also no one can really help you very well without being able to see the code
Well, i would allow that, sure, it's not like i guard the code, it's just, if no one is even willing even to look, and give advice, there is no reason to pull out the mod from the closet.
It could be cool if the weightless item or what ever could be blocked from being put into vehicle storage.
But i would suspect such requires more complicated scripting then i have knowledge and skill to write.