#mod_development
1 messages ยท Page 36 of 1
aaa
That's me deflecting blame btw :p
haha
function ISMoveableSpriteProps:pickUpMoveable()
return items
original_ISMoveableSpriteProps_pickUpMoveable( _character, _square, _createItem, _forceAllow )
end```
so, like this, ye?
I suppose it'd be best to pass arbitrary args and always return the result to be best compatible if they change the function in the future to future proof yourself
local original_ISMoveableSpriteProps_pickUpMoveable = ISMoveableSpriteProps.pickUpMoveable
function ISMoveableSpriteProps:pickUpMoveable(...)
-- pre stuff
local result = original_ISMoveableSpriteProps_pickUpMoveable(self, ...)
-- post stuff
return result
end
oh items is not even a global var
You have to put variable names in ISMoveableSpriteProps:pickUpMoveable( _char, etc) for that to work
How'd you go about patching AddItem?
It is a java object. Their functions live in a metatable (It's how kahlua exposes java APIs in the lua code)
I have a utility to do that, sec
Hey i got an question for you guys since someone might know how mods work
Do i need to put certain mods at c/users/zomboid/mods in order for them to work properly?
I used to do them a year ago but problem is
-it takes more space
-need to manually update it every time an mod updates
And i am hosting an Local server
ArendamethUtils = ArendamethUtils or {}
--[[
Usage example:
ArendamethUtils.patchClassMethod(zombie.inventory.types.Moveable.class, "getDisplayName", function(original_fn)
return function(self, arg1, arg2, ...)
local modData = self:getModData()
if modData and modData.new_value then
return modData.new_value
end
local result = original_fn(self, arg1, arg2, ...)
result.someProperty = false
return result
end
end)
]]
ArendamethUtils.patchClassMethod = function(class, methodName, createPatch)
local metatable = __classmetatables[class]
if not metatable then
error("Unable to find metatable for class "..tostring(class))
end
local metatable__index = metatable.__index
if not metatable__index then
error("Unable to find __index in metatable for class "..tostring(class))
end
local originalMethod = metatable__index[methodName]
metatable__index[methodName] = createPatch(originalMethod)
end
Sec, I need to lookup the right java class
no idea honestly, but I think you may have better luck in #mod_support, seeing as this one is intended for mod development
For local mods, yes
For mods you download via steam, they go into a different directory and don't need to move them around manually
This helps to play with - nosteam and gives you time to check comments before breaking your game
Do i just need to put all of them though?
For example brita's weapons causes the server to not start, wonder if putting it on zomboid/mods will fix it
For mods I'm developing to upload to workshop, I have them in Zomboid/Workshop
Or some not working mods
There are 3 places mods are loaded from
Yeah i know
That shouldn't change anything if it is causing issues when it is loading
I host my server without putting any mods at zomboid/mods
1 year before i used to put it all in zomboid/mods then host it
So putting an mod in that directory won't matter?
It won't make a difference if the mod is in Zomboid/mods or in the directory steam automatically installs mods to
(when running pz in steam mode)
If you are running -nosteam, pz will ignore mods installed in the steam mod directory. In which case, you should put them in Zomboid/mods
but since I am hosting an local server I have to not use -nosteam yes?
for my friends to join
LOG : General , 1665821550646> ---------- zombie.inventory.ItemContainer@38d138b4 ----------
---------- Fields -----------
---------- Methods ----------
InventoryItem AddItem (String)
boolean AddItem (String, float)
InventoryItem AddItem (InventoryItem)
ArrayList<InventoryItem> AddItems (String, int)
void AddItems (InventoryItem, int)
InventoryItem DoAddItem (InventoryItem)
InventoryItem DoAddItemBlind (InventoryItem)
InventoryItem AddItemBlind (InventoryItem)
Sorry, wanted to finish this so I could look up java methods in the console.. Need to patch AddItem on the ItemContainer class
ArendamethUtils.patchClassMethod(zombie.inventory.ItemContainer.class, "AddItem", function(original_fn)
return function(self, item, ...)
-- pre stuff
local result = original_fn(self, item, ...)
-- post stuff
return result
end
end)
Because that java method is overloaded, need to check the parameters too
you should really upload all of those utils somewhere for others. They prove to a be useful in a lot of cases
if instanceof(item, "InventoryItem") then
-- case I'm interested in
else
return original_fn(self, item, ...)
end
I'd have to think of way to do that that doesn't end up with versioning issues like other APIs have encountered, e.g. the ItemTweaker api. The way the steam workshop and pz mods do dependencies and multiple versions of the same file, it might result in a situation where people make copies of the files to have their own version, and that'd mask newer versions I'd want to use (ItemTweaker has this issue)
an overall put-together code would look sth like this?
local original_ISMoveableSpriteProps_pickUpMoveable = ISMoveableSpriteProps.pickUpMoveable
local created_item
function ISMoveableSpriteProps:pickUpMoveable(...)
--local worldObj = self:findOnSquare( self.square, self.spriteName );
local result = original_ISMoveableSpriteProps_pickUpMoveable(self, ...)
-- post stuff
return result
end
ArendamethUtils.patchClassMethod(zombie.inventory.ItemContainer.class, "AddItem", function(original_fn)
return function(self, item, ...)
if instanceof(item, "InventoryItem") then
created_item = item
local result = original_fn(self, item, ...)
else
local result = original_fn(self, item, ...)
end
-- post stuff
return result
end
end)
Wonder if you can use that to get back functionalities that stop when you pause game.
Instead of overwriting all lua for each version
Yea, that's looking about right
Can simplify this bit if you care to:
if instanceof(item, "InventoryItem") then
created_item = item
end
local result = original_fn(self, item, ...)
return result
ah yes makes a lot more sense
OnTick fires even when paused, as I recall, so if it uses that event, it should function while paused
There is also OnRenderTick. That one only fires when unpaused, iirc.
(maybe I switched the two, idk)
no they call getgametimecontrols and if it's paused then they don't add buttons, etc
I always thought that with the addition of silent hill inspired mods, somebody would have made a special zombie mod that goes beyond ai. "death knell day" I think has done the most for this. I just think It'd be cool to have a pyramid head enemy the player has to worry about in certain zones with great loot
or for that matter any horror game antagonist
Im half considering getting into modding and trying my hand at it
So if possible I'd wrap the lua and set a global variable to true, then when the java is called I return fake info if it's true or original.
function ISMoveableSpriteProps:pickUpMoveable(...)
local square_name = self.square:getModData().renameEverything_name
local result = original_ISMoveableSpriteProps_pickUpMoveable(self, ...)
-- post stuff
if square_name then
created_item:getModData().renameEverything_name = square_name
end
return result
end```
getting an error thrown at ``local square_name = self.square:getModData().renameEverything_name`` :x
What's the error?
ERROR: General , 1665823078742> DebugLogStream.printException> Stack trace:```
lemme inspect it
or actually try to print it in the first place
Sounds like square is nil?
result get data
ye apparently it is
Does ISMoveableSpriteProps have square? Wasn't that from ISMoveableAction?
i thought it'd be valid since i'd have attempted to use something like local worldObj = self:findOnSquare( self.square, self.spriteName ); firsthand
created item = ???
Inside ISMoveableSpriteProps:pickUpMoveable(...), self refers to an instance of ISMoveableSpriteProps, so self:findOnSquare works
Taking a step back, is it the square that has the metadata or the world object? I'm confused
ArendamethUtils.patchClassMethod(zombie.inventory.ItemContainer.class, "AddItem", function(original_fn)
return function(self, item, ...)
if instanceof(item, "InventoryItem") then
created_item = item
end
local result = original_fn(self, item, ...)
-- post stuff
return result```
Basically refers to object that is created using AddItem
I am trying to store the data on the tile/square for now, seeing as its easier than storing on the world object (?)
but aren't you naming it result?
What if there are two items on the square?
If I modified a dedicated server mod from Filezilla, how would I make sure everyone who logs in sees the updates?
the item classes it'll work with are only Radio and Moveable
You can't place two Radios on the same square
but apparently I didn't check Moveables
lemme see
I think things like cabinets are Moveables, and you can place a radio on a square with a cabinet
soo i'll have to store the moddata on the world object after all
To answer your question though, one of the parameters to the pickUpMoveable function is the square.
If storing the moddata in the square, you'd need to use that parameter.
If storing the moddata in the world object, you can use local obj = self:findOnSquare(square, self.spriteName)
um noo? or I am not quite sure if I understood you correctly
The function you said that gives you error has a result variable but not a created_item
its defined outside of the function
to use in another function
sorry I thought that line gave you error
There is a code path through pickUpMoveable where you pick up multiple moveables at a time. How do you even do that in the game?
maybe it queues each one?
still though i have no idea lol
try printing the item inside your overwrite before you save the created item
wait, soory I keep thinking created item is wrong
could be a string
s.isForceSingleItem = props:Is("ForceSingleItem") or false;
Has to do with the type of sprite / world object
nevermind me
ever get that brain lag while coding when you forget what you're doing and why and what you need to do and you just sit in front of the screen, trying to "restart" your brain?
that's how i just felt lol
If you look at the error message, it says the object on which getModData() was called was nil. That was the issue :)
lemme get fundamental code working first tho
haha np, appreciate you trying to help tho
my brain keeps switching to created_item:getModData()
okaaaay in my attempt to switch from tiles to world objects
I replaced the :perform snippet to :placeMoveable
function ISMoveableSpriteProps:placeMoveable(...)
local result = original_ISMoveableSpriteProps_placeMoveable(self, ...)
-- post stuff
local worldObj = self:findOnSquare( self.square, self.origSpriteName );
print(worldObj)
return result
end```
aaand worldObj returns nil
hmm I think its because the .self before square and origspritename
There is no self.square. self inside placeMoveable is a ISMoveableSpriteProps. ISMoveableSpriteProps doesn't have that field.
self.square was on ISMoveableAction back when you were patching its perform
function ISMoveableSpriteProps:placeMoveable( _character, _square, _origSpriteName )
...
function ISMoveableSpriteProps:pickUpMoveable( _character, _square, _createItem, _forceAllow )
ISMoveableSpriteProps doesn't have self.square, but when perform calls ISMoveableSpriteProps:placeMoveable (etc), it passes its square in as a parameter
So you need to get it from the function parameters
Sorry, long winded way of saying that ๐
haha np but it definitely made it way more clear for me, thanks!
Anyone know how to send an Accept (or Apply or whatever) command to update options based on a new setting state?
Found this promising function that seems to be involved in deicdin whether to show my name in-game
getCore():setShowYourUsername(param)
It's not 100% clear to me from context if param is a bool at all, but I'm like 95%+ confident it is
Unfortunately, calling it, while error-free, did diddly squat to hide my username when I sent "false"
I'm thinking maybe this prepares options to update before user applies settings
LOG : General , 1665825174615> ---------- zombie.core.Core@17a1f3cb ----------
---------- grep: ShowYour ----------
---------- Fields -----------
---------- Methods ----------
boolean isShowYourUsername ()
void setShowYourUsername (boolean)
It's a boolean
Possible that isShowYourUsername() is called early on and it has cached that value
You mean performing via lua the same function as clicking the Apply button in the options UI?
hold on, discovery
When I run that command from the debug terminal it works
What does this mean?
(assume you reach that line from the Lua)
(I can confirm programmatically that I am reaching that line)
This is what I meant, but maybe unnecessary after all
That's a function on zombie.core.Core and it is exposed as a lua function, yea
If I understand you right, when you call isShowYourUsername() after calling setShowYourUsername(), it works?
public boolean isShowYourUsername() {
return this.showYourUsername;
}
public void setShowYourUsername(boolean bl) {
this.showYourUsername = bl;
}
That's all they do
Some client of that class calls isShowYourUsername() to do the actual rendering (or not)
$ grep -r isShowYourUsername ProjectZomboid/zombie/
grep: ProjectZomboid/zombie/characters/IsoGameCharacter.class: binary file matches
grep: ProjectZomboid/zombie/core/Core.class: binary file matches
IsoGameCharacter, looks like
No, when I call getCore():setShowYourUsername(false) in debug terminal during gameplay, it works; when I call getCore():setShowYourUsername(false) (the exact same thing) from my Lua file, no dice.
Maybe not a client-level privilege? Seems odd if not
protected void updateUserName() {
if (this.userName != null && this.isoPlayer != null) {
BaseVehicle baseVehicle;
boolean bl;
Object object = this.isoPlayer.getUsername(Boolean.valueOf(true));
if (this != IsoPlayer.getInstance() && this.isInvisible() && IsoPlayer.getInstance() != null && IsoPlayer.getInstance().accessLevel.equals("") && (!Core.bDebug || !DebugOptions.instance.CheatPlayerSeeEveryone.getValue())) {
this.userName.ReadString("");
return;
}
Faction faction = Faction.getPlayerFaction((IsoPlayer)this.isoPlayer);
if (faction != null) {
if (this.isoPlayer.showTag || this.isoPlayer == IsoPlayer.getInstance() || Faction.getPlayerFaction((IsoPlayer)IsoPlayer.getInstance()) == faction) {
this.isoPlayer.tagPrefix = faction.getTag();
if (faction.getTagColor() != null) {
this.isoPlayer.setTagColor(faction.getTagColor());
}
} else {
this.isoPlayer.tagPrefix = "";
}
} else {
this.isoPlayer.tagPrefix = "";
}
boolean bl2 = this.isoPlayer != null && this.isoPlayer.bRemote || Core.getInstance().isShowYourUsername();
That's where it is called. hmm
Shared or server?
oh, that shouldn't matter in this case :o
Unfortunately it seems to be mattering
I will refresh server
Pretty sure I had the right version loaded, but I'll switch just in case
There are two listed because one is from Steam and one is my live edit
I checked F11 and the file looked right
public static Core getInstance() {
return core;
}
@LuaMethod(name="getCore", global=true)
public static Core getCore() {
return Core.getInstance();
}
Doesn't seem to be doing anything tricky
Are you sure your lua code is running client-side?
It'd do nothing if run server-side (I think)
Yeah I have no clue but I know the code chunk is reached because the line above it is running fine
It's currently in client
Let me try it real quick
It has no effect when I call it in the lua console. Probably need to trigger IsoCharacter:updateUserName() somehow after setting it
btw I can't seem to get findOnSquare to work. printing square returns nil lol
What on Earth?
(Unknown keycodes are screenshots)
Bear with Windows crapshoot screenshotting
I legit just typed this: getCore():setShowYourUsername(false)
In debug console of a hosted game
With I think AC 3 and 12 disabled for other mods iirc
That's all I had to do
I don't know how I triggered anything else
I just hit enter
And voila
Can you show how you're getting square now?
function ISMoveableSpriteProps:placeMoveable(...)
local result = original_ISMoveableSpriteProps_placeMoveable(self, ...)
-- post stuff
--local worldObj = self:findOnSquare( square, self.spriteName );
print(square)
return result
end```
You have to add the variable to the function parameter list to get a reference to the parameter
placeMoveable(character, square, ...)
Doing that changes the contents of ..., so have to change the call to original after doing that
so like:
function ISMoveableSpriteProps:placeMoveable(character, square, ...)
local obj_square = square
local result = original_ISMoveableSpriteProps_placeMoveable(self, character, square, ...)
-- post stuff
--local worldObj = self:findOnSquare( square, self.spriteName );
print(square)
return result
end```
You can't change the order. It's already this way
ah I can't just put the parameters I want in any order
If you look at the vanilla implementation of it (what I copied above). You can see the parameters the function already has
it must be the way its defined in vanilla
Yea. To change the order, you'd have to go in and change all the call sites and change the original implementation
ah lets not do that
:p
edited it, looks correct now?
have to add those parameters to the call to the original too. With this change, the character and square arguments are no longer contained in ... (which is a way to reference an arbitrary number of remaining arguments)
original(self, character, square, ...)
Edited again. I thought you said we have to change the call to original though, that's why I left it the way it is, assuming that changes the call to original
but if not it, then what?
also looks alright now?
I said change the original implementation. Didn't mean how you call the original implementation
That looks right, yep
aaah my bad is misinterpreted what you meant. Seems like its printing square fine now
Ooh.. It doesn't display in singler player at all. I was testing in single player 
Yeah sorry that function is odd
I am still trying to get it sorted but may take a break and come back in a bit. So confused. Improved the rest of what I'm trying to do instead. (Making debug, chat, and server info vanish on aim, reappear on Enter key. For controller players like me.)
Events.EveryTenMinutes.Add(function()
getCore():setShowYourUsername(not getCore():isShowYourUsername())
end)
That works client-side. Not sure what's going on with how you are calling things client-side
@hearty dew Thank you
local fakeNotPaused
TyrirSenpaiUtils.patchClassMethod(zombie.ui.SpeedControls.class, "getCurrentGameSpeed", function(original_fn)
return function(self, ...)
local speed = original_fn(self, ...)
if speed == 0 and fakeNotPaused then
return 1
else
return speed
end
end
end)
local orISInventoryPaneContextMenucreateMenu = ISInventoryPaneContextMenu.createMenu
ISInventoryPaneContextMenu.createMenu = function(...)
fakeNotPaused = true
local original = orISInventoryPaneContextMenucreateMenu(...)
fakeNotPaused = nil
return original
end
Soo I tried to change this to the name stored in the moddata as well. This appears in the condition where you're either placing an item or picking up an item. I tracked the function that makes it appear to this:
function ISMoveableSpriteProps:getSpriteGridCache( _square, _verifyOnly, _getWorldObjects )
Looking at its code though, I am not quite sure if that's the one
You're looking to change the name that is displayed when hovering over the item when in pick-up-moveable mode?
yes, and additionally the name that appears when trying to place it
the same menu appears when you're in place mode and moving your mouse between the tiles
Do you know what's rendering that window?
that's what I am trying to figure out. My search lead me so far nowhere except function ISMoveableSpriteProps:getSpriteGridCache( _square, _verifyOnly, _getWorldObjects )
I'd start by searching for static strings in the UI
$ grep -r 'Hold button and move cursor to rotate' ProjectZomboid/media/lua
ProjectZomboid/media/lua/shared/Translate/EN/IG_UI_EN.txt: IGUI_HoldButton = "Hold button and move cursor to rotate object",
$ grep -r 'IGUI_HoldButton' ProjectZomboid/media/lua
ProjectZomboid/media/lua/server/BuildingObjects/ISMoveableCursor.lua: infoPanel:setFooterText( getText("IGUI_HoldButton")..".[br/]'"..Keyboard.getKeyName(getCore():getKey("Rotate building")).."' = "..getText("IGUI_Cycle2").."."..lastbit, UIFont.Small );
ProjectZomboid/media/lua/server/BuildingObjects/ISMoveableCursor.lua: infoPanel:setFooterText( getText("IGUI_HoldButton")..".[br/]'"..Keyboard.getKeyName(getCore():getKey("Rotate building")).."' = "..getText("IGUI_Cycle3").."."..lastbit, UIFont.Small );
function ISMoveableCursor:setMoveableMode( _mode )
local infoPanel = self:getInfoPanel();
should be infopanel
does anyone know how i would render text on the screen? i don't want to use menu boxes or anything just draw text on the screen
for chat-styled text that appears above the player/zombies/etc, you can use
playerObj:addLineChatElement(string)
I don't actually have any idea how it works since I just found that function in the code of one of the mods
Thanks for confirming this, I'll figure it out
I traced the rendered window all the way to ISMoveableInfoWindow.lua but can't find where exactly does it render the object's name
@hollow current did you check the line infopanel:setBodyText(
Looks like in the render function
That renders an array of lines (self.bodyText), among other things. Might be easier to modify the name used where that bodytext is set
(easier than parsing the text in each line and changing it, or similar)
just did
I actually tried doing that firsthand
inspected the worldObj to see if it had a setName function
the result was rather weird tho
lemme print
so, code:
function ISMoveableSpriteProps:placeMoveable(character, square, origSpriteName, ...)
local item = self:findInInventory(character, origSpriteName );
local item_name = item:getModData().renameEverything_name
-- pre stuff
local result = original_ISMoveableSpriteProps_placeMoveable(self, character, square, origSpriteName, ...)
-- post stuff
local worldObj = self:findOnSquare( square, self.spriteName );
ArendamethUtils.inspect(worldObj, 2)
--worldObj:setName("Test")
if item_name then
worldObj:getModData().renameEverything_name = item_name
end
return result
end```
it prints:
(userdata) zombie.iso.objects.IsoRadio@7836dc66 <
<METATABLE> => table 0x1843472298 {
. [__index] => table 0x1920433559 ** PRUNED. Max depth reached **
}
>
i tried calling a setName on it anyways, which didn't work obviously but somehow didn't throw any errors
** PRUNED. Max depth reached ** That means it went to the depth you specified (2), and didn't go any further
so would need to set to 3 to print out what's inside that table in the __index field
the default is 3 too if you don't pass any number
Mm, so maybe something else is used to get the name in that UI text
okay that does make sense, it has a setName() function
but yet it doesn't appear when picking it up for example
The body text is what is rendered. I'd try to find out what sets that body text
If you go back to here, a few lines below it, it calls setBodyText
function ISMoveableInfoWindow:setBodyText( _bodyTextTable, _font, _align)
the function code doesn't seem to have a lot to do with item name either
infoPanel:setBodyText( _moveProps:getInfoPanelDescription( _square, _object, self.character, ISMoveableCursor.mode[self.player] ), UIFont.Small );
It calls _moveProps:getInfoPanelDescription to provide the body text. Might check that out
if InfoPanelFlags.name then infoTable = ISMoveableSpriteProps.addLineToInfoTable( infoTable, getText("IGUI_Name")..":", 255, 255, 255, Translator.getMoveableDisplayName(InfoPanelFlags.name), 0, 255, 0 ); end```
I believe that's what we're looking for
so if I understand it correctly, it has a locally defined infoTable and if InfoPanelFlags.Name is not nil, it adds the item's name to that table
but how do we exactly override the vanilla name with our own one?
yep
It passes InfoPanelFlags.name there into Translator to localize the name
Can you change InfoPanelFlags.name before that statement is executed?
lemme see if I can put something together, one min
@hollow current In answering that, it might help to find how/where InfoPanelFlags.name is set
@SubscribeEvent
public void onPlayerTick(OnPlayerMoveEvent event) {
IsoPlayer player = IsoPlayer.getInstance();
if (player != null) {
player.addLineChatElement("The player is walking!!!");
}
}```
working on a mod with this new shit api i found
took me like fucking 3 days to get a project setup with it
function ISMoveableSpriteProps:getInfoPanelFlagsGeneral( _square, _object, _player, _mode )
InfoPanelFlags.name = self.name;```
okay i guess this is it
Nice ๐
aye at least you got it working, nice job!
๐ญ
it doesn't help that it seems like that everything in this game is made with lua in mind
i guess a sensible code looks like this?
local original_ISMoveableSpriteProps_getInfoPanelFlagsGeneral = ISMoveableSpriteProps.getInfoPanelFlagsGeneral
function ISMoveableSpriteProps:getInfoPanelFlagsGeneral(square, object, ...)
local obj_name = object:getModData().renameEverything_name
if obj_name then
InfoPanelFlags.name = obj_name
end
-- pre stuff
local result = original_ISMoveableSpriteProps_getInfoPanelFlagsGeneral(self, square, object, ...)
-- post stuff
return result
end```
@hearty dew In the mood for programming slapstick?
You set InfoPanelFlags.name, then call the original, which is going to set it to something different
i thought that'd overwrite the original
go for it!
So I am playing with ways to toggle UI stuff, reading, exploring, learning, you know. And I discover, lo and behold, there is a function very near a function I'd already found called toggleUI
"toggleUI!" I think to myself
How convenient that sounds!
I'll explore it!
I visit toggleUI, and I find this: ISUIHandler.allUIVisible = not ISUIHandler.allUIVisible;. "Oh, lovely," I think. "I was tracking that manually, and because I did so, I missed toggles when I pressed start to go to the Main Menu, causing one missed press exiting the Main Menu every time."
The first line of the original function is ```lua
InfoPanelFlags.name = self.name;
Your code does this ```lua
InfoPanelFlags.name = obj_name
then calls the original immediately afterwards
"I wonder if I can just change my code to call toggleUI, and then when I enter the main menu, I'll naturally be using the game's system of UI toggling, so everything will be fiiiine."
ah I should first call the original then set it?
run, test, run, test, run, test
"Damn it, not working. Wonder if I can see how the Main Menu is opened when I press start. I do know where the Joypad stuff is."
yess, it works
search, hate self, search, hate self
Thanks once again so much!
"Aha! Right here!"
function JoypadControllerData:onPauseButtonPressed()
local joypadData = self.joypad
if UIManager.getSpeedControls() and not isClient() then
if UIManager.getSpeedControls():getCurrentGameSpeed() == 0 or getGameTime():getTrueMultiplier() > 1 then
if MainScreen.instance and MainScreen.instance.inGame and MainScreen.instance:isReallyVisible() then
-- return to game below
--[[
elseif joypadData.pauseKeyTime and (joypadData.pauseKeyTime + 750 > getTimestampMs()) then
-- double-tap, go to main menu below
--]]
else
UIManager.getSpeedControls():ButtonClicked("Play")
return
end
--[[
else
joypadData.pauseKeyTime = getTimestampMs()
UIManager.getSpeedControls():ButtonClicked("Pause")
return
--]]
end
end
if MainScreen.instance and MainScreen.instance.inGame then
ISUIHandler.setVisibleAllUI(MainScreen.instance:isVisible())
Oh, great, so when the main menu is launching, it... wait... What???
"ISUIHandler.setVisibleAllUI(MainScreen.instance:isVisible())"
Why.. but... it says... but why???
IN THEIR OWN START BUTTON FUNCTION THEY USE THE WRONG TRIGGER
So the damn boolean flag doesn't even get set right
isReallyVisible()
These function names lol
Omfg
I can't even discuss their naming practices
I'll lose my damn mind
Specifically, if you missed it, ISUIHandler.allUIVisible = not ISUIHandler.allUIVisible is in toggleUI but doesn't happen in the above code-block because they just directly call ISUIHandler.setVisibleAllUI(), which toggleUI would have done
That's clearly its entire purpose
local isVisible = MainScreen.isntance:isVisible()
if isVisible then
local isReallyVisible = MainScreen.isntance:isReallyVisible()
if isReallyVisible then
local ohReallyVisible = MainScreen.isntance:yesReallyIsVisible()
end
end
lmfao
Ah, tricky. Yea, that's why identifier naming is so important in code. When the semantics are a bit off from the meaning of the names, it can really throw you off and be confusing
Yeah omfg
Why call it allUIVisible?
Oh yeah, because that guy skipped BASIC HUMAN COMMUNICATION in PRESCHOOL
lol sorry
"I'll just use new words, I'm sure it'll be fine."
"isVisibleAllUI" is boring
laaaaame
Some old man wrote it that way
I'm callin it allUIVisible
lol nah f.r. though it was probably the same programmer who wrote it both ways and it never crossed their mind
Omg I'm gonna have to write the most convoluted decoration function to fix this
This is so stupid-looking lol
quick question but how do you update a dedicated server hosted locally to the latest game build
Edit: Figured it out
@hearty dew omg tfw publishing your mod leads you to spend hours fixing a dev's buggy design.
It's only a matter of time before someone reports this, trying so hard to beat them to it ๐ญ
ahhhh tfw you succeed
Hi. I'm making some clothes and I want the player can't be able to workout while using it. Is there any property I can add to or what function can I overrride to do it?
@hearty dew Shout-out to our boys at PZ ๐คช
local function setReallyVisibleAllUI(visible)
if not visible then
priorVisibility = ISUIHandler.allUIVisible
ISUIHandler.allUIVisible = false
ISUIHandler.setVisibleAllUI(false)
else
ISUIHandler.allUIVisible = priorVisibility
ISUIHandler.setVisibleAllUI(priorVisibility)
end
end
local function hasFancyClothes(player)
-- idk
end
local original_ISFitnessUI_updateButtons = ISFitnessUI.updateButtons
function ISFitnessUI:updateButtons(currentAction)
original_ISFitnessUI_updateButtons(self, currentAction)
if hasFancyClothes(self.player) then
self.ok.enable = false
self.ok.tooltip = getText("You can't workout in fancy clothes!")
end
end
Something like that
Thanks... I will try it
Hello everyone.. so version 41.77.7 recently came aboard changing the function of displaying the version number and most likely something else along with it
Ever since then I've been getting lots of errors in different mods. Today I got the chance to go through the DebugLog and scan the codes, only to discover it is something about the versions. Here is the list of all the affected lines that actually stopped working and caused all those mods to just break. Mods are SimplePlayablePiano and ArcadeMachines and CheatMenuRB.
--ALL THE KNOWN ERRORS SINCE 41.77.7
local ver_str = core:getVersionNumber()
CheatCoreCM.PZVersion = tonumber(string.match(getCore():getVersionNumber(), "%d+")) -- checks game version
local versionNumber = tonumber(string.match(getCore():getVersionNumber(), "%d+"))
local customsFileCheck = CheatCoreCM.checkFile("CheatMenuRB", "teleport_locations/customlocations.txt")
compassCore.processJson()
require "CheatMenuRebirth/Teleport/GPSWindow"
local versionNumber = tonumber(string.match(getCore():getVersionNumber(), "%d+"))
if getCore():getVersionNumber() == "41.50 - IWBUMS" then
if getCore():getVersionNumber() == "41.50 - IWBUMS" then
if getCore():getVersionNumber() == "41.50 - IWBUMS" then
if getCore():getVersionNumber() == "41.50 - IWBUMS" then
If anyone can help me fix this and inform the mod developers about the issues so that they can fix it quickly I'd really appreciate it. Thanks ahead. โค๏ธ
What seems to repeat a lot is getCore():getVersionNumber()
What I get is this: STACK TRACE; Object tried to call nil in CheatOption.lua; ERROR: General , 1665838039739> 0> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in CheatOption.lua at KahluaUtil.fail line:82..
[15-10-22 14:47:19.739] ERROR: General , 1665838039739> 0> DebugLogStream.printException> Stack trace:.
(in-game this happens whenever I right click something lol-- unplayable with debug mode on)
@hearty dew Breakthrough!
The error sounds like the indie stone devs removed getCore() from the zombie.Lua.LuaManager.GlobalObject java class.
@LuaMethod(name="getCore", global=true)
public static Core getCore() {
return Core.getInstance();
}
You could decompile the 41.77.7 version of the java class (ProjectZomboid/zombie/Lua/LuaManager$GlobalzObject.class) here http://www.javadecompilers.com/ to check real quick, and see if there is something comparable added in its place.
I can now not only toggle UI without the weird keypress skip coming out of menu after having UI off
but when I come out of menu after entering when my UI was off
the game... REMEMBERS
MUAHAHAHAHA
BASIC QOL FEATURES
HAHAHAHAHA YOU'LL NEVER STOP ME PZ
That or zombie.core.Core no longer has getVersionNumber(). It might could be either from that message
Nice ๐
It works, exactly what I wanted. Thx again
Uh-- how does that decompile-stuff work?
What does it actually do ๐
select ProjectZomboid/zombie/Lua/LuaManager$GlobalzObject.class from the pz game directory to upload. It will create java code from the compiled code in the .class file (decompile it back to source code you can read)
Then you can search it to see if it has a getCore method still
If that still exists, then you could check ProjectZomboid/zombie/core/Core.class for getVersionNumber
this is the only thing that came up
so it is just Version without the Number thingy
You're looking for a function definition like you have with getCore above
And I figured out why name wasn't vanishing and we're not gonna talk about that
public String getVersionNumber() {
something like that
@LuaMethod(name = "getPublicServersList", global = true)
public static KahluaTable getPublicServersList() {
final KahluaTable table = LuaManager.platform.newTable();
if (!SteamUtils.isSteamModeEnabled() && !PublicServerUtil.isEnabled()) {
return table;
}
if (System.currentTimeMillis() - GlobalObject.timeLastRefresh < 60000L) {
return table;
}
final ArrayList<Server> list = new ArrayList<Server>();
try {
if (getSteamModeActive()) {
ServerBrowser.RefreshInternetServers();
final List getServerList = ServerBrowser.GetServerList();
for (final GameServerDetails gameServerDetails : getServerList) {
final Server server = new Server();
server.setName(gameServerDetails.name);
server.setDescription(gameServerDetails.gameDescription);
server.setSteamId(Long.toString(gameServerDetails.steamId));
server.setPing(Integer.toString(gameServerDetails.ping));
server.setPlayers(Integer.toString(gameServerDetails.numPlayers));
server.setMaxPlayers(Integer.toString(gameServerDetails.maxPlayers));
server.setOpen(true);
server.setIp(gameServerDetails.address);
server.setPort(Integer.toString(gameServerDetails.port));
server.setMods(gameServerDetails.tags);
server.setVersion(Core.getInstance().getVersion());
server.setLastUpdate(1);
list.add(server);
}
System.out.printf("%d servers\n", getServerList.size());
}
this it?
no-- ok
something like that doesnt exist
Looking in the wrong place
wait
sorry
I feel so dumb
๐
would this be the same stuff
idk what it was before
but getVersionNumber doesn't exist
these three are version related-- idk which one would I use in the code to fix it rly
You might try reimplementing the old getVersionNumber in lua using that new getVersion method
Hopefully the indie stone devs add it back though ๐
It broke like 3 mods as far as I know-- but from what I can see many mods have this getVersionNumber thingy
is there a way I can inform them directly so that they are aware of what they've done
xD
or at least get some response to know if this'll be reverted back or no
__classmetatables[zombie.core.Core.class].__index.getVersionNumber = __classmetatables[zombie.core.Core.class].__index.getVersion
If you put that in a shared/ lua file that loads early (name it something like !!!!!fix_getVersionNumber.lua and put it in media/lua/shared/), that might fix the other mods
I tried to report a bug here in discord, and they just said to go to their forums to report the bug, but ica to make forum accounts so didn't bother :p
I guess that's the official way to report issues
I think I have a forum account already so I'll go there and report that asap
Thanks a lot Tyrir
you have been helping my dumbass too many times โค๏ธ
@livid geode steam://openurl/https://steamcommunity.com/sharedfiles/filedetails/?id=2875510966
See if that fixes the issue for you
I can't test it since I don't have the new version and not interested in breaking all my mods on an unstable build, but if the new getVersion method does the same as the prior getVersionNumber method that was removed, that should fix the problem
I'll definitely try this for the server
I fixed my mod by switching from getVersionNumber to getVersion. So that definitely worked
All that mod does is make calls to the old getVersionNumber actually call the new getVersion
But there is no way for me to fix the others os this will definitely help. Wish we weren't forced to move to unstable, for some reason our server runs on branch="" which is stable but it can only be joined using a client unstable BETa.
I talked to tech-support and they werent able to help.. weird stuff
I hope the final 41 version fixes everything ๐ฆ
so not sure why, but the collapse button in the UI I have been working is now not in the top right corner
I have to use setX on it to move it
and it's ok if I don't use activateView when I open the window
ok, not sure why it breaks but made it work
@hearty dew So I have this code that almost seems to work, right up until I use the function.
print(tostring(getServerOptions():getOptionByName("DisplayUserName").setValue(true)))
Debug suggests setValue exists when I exclude the arguments and parentheses... tells me it's a function and gives me an address. But when I try to use it, no dice.
I think it's related to this: https://zomboid-javadoc.com/41.65/zombie/network/ServerOptions.html#getOptionByName(java.lang.String)
If you look at that function, you'll notice it claims to return the interface instead (which does not have a setValue method) of one of its implementations (e.g., BooleanServerOption, which has a setValue method).
It seems maybe the function is there but not usable possibly because of this extension issue and the way the function translates into Lua... Can you think of any way to make this function work? Or help me understand an alternate means for accomplishing the same signal?
Javadoc Project Zomboid Modding API declaration: package: zombie.network, class: ServerOptions
LOG : General , 1665843870475> ---------- zombie.network.ServerOptions@1e87569b ----------
---------- grep: getOptionByName ----------
---------- Fields -----------
---------- Methods ----------
interface ServerOptions$ServerOption getOptionByName (String)
LOG : General , 1665843989405> ---------- userdata ----------
(userdata) zombie.network.ServerOptions$BooleanServerOption@4bde1434 <
<METATABLE> => table 0x929852329 {
. [__index] => table 0x1170891972 {
. . [asConfigOption] => function 0x799838746
. . [getTooltip] => function 0x2025002934
. . [getValueAsString] => function 0x752224810
. . [resetToDefault] => function 0x976004912
. . [getValueAsObject] => function 0x1910234669
. . [isValidString] => function 0x288712967
. . [setValueFromObject] => function 0x221165137
. . [setDefaultToCurrentValue] => function 0x1382323683
. . [getValue] => function 0x2103513908
. . [setValue] => function 0x1202069710
Yea, it has a setValue function exposed by kahlua.
after calling setValue, the expected value is there when calling getValue
Wait it's working for you?
LOG : General , 1665844153704> ---------- boolean ----------
true
LOG : General , 1665844159903> ---------- nil ----------
nil
LOG : General , 1665844161920> ---------- boolean ----------
false
yea
Can you share exactly how you wrote it?
the nil is the result of the setValue call. Can ignore that
getServerOptions():getOptionByName("DisplayUserName"):setValue(false)
Oh, yea. You need to use a colon when invoking java methods via lua
You'd use . for java fields
the javadoc says it returns the interface because it can return any of the implementing classes
anyone have a guide to make your own arsenal gunfighter settings for a dedicated server?
@hearty dew omfg Tyrir I hope you get elected President
that option doesn't toggle it clientside tho
that's an option for all players on the server
and will require admin
in mp
WHAT DOES THIS EVEN MEAN I CANT FIND THE ISSUE!!!!!!!!!!!!!!!!!!!!!11
can anyone please tell me
is wrong with this
Okay! @weak sierra @bronze yoke @hearty dew NOW I believe it hides all your player names, among a range of other improvements. https://steamcommunity.com/sharedfiles/filedetails/?id=2875149317
@weak sierra Unfortunately, the name is still terrible. ๐ญ
Great job dude 
A working mod....it's nice to see people living MY DREAM
Thanks @gilded hawk !
Omg so many hurdles
But now it works really well
For both controller and keyboard afaik
Nice ๐
No mod menu customization of key yet
But I my name 100% is hidden correctly and I'm hoping since it throws no errors and worked in the debug, it'll work for other players online
Can someone please help me confirm? Haha
No worries I'll launch -nosteam and try it actually, I guess hopefully that should work
Need the error message. Press the button at the top with a line with a 90 degree angle. That should step the code forward one line and cause the error message to be printed out to the end of Zomboid/console.txt in your user directory
Alright let me load it up again because I got mad and shut everything down
How do I actually invite myself to my game when I launch two -nosteam apps???
Just occurred to me I have no idea how to join myself without Steam
select join and set the ip to 127.0.0.1
@hearty dew this what you need?
ERROR: General , 1665849811810> ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: unknown item type "SMUIClothinge.Hat_ShemaghDown" in ClothingSelectionDefinitions.EPIRifleman.Female at BaseLib.error line:292.
ERROR: General , 1665849811811> DebugLogStream.printException> Stack trace:
se.krka.kahlua.vm.KahluaException: unknown item type "SMUIClothinge.Hat_ShemaghDown" in ClothingSelectionDefinitions.EPIRifleman.Female
at se.krka.kahlua.stdlib.BaseLib.error(BaseLib.java:292)
at se.krka.kahlua.stdlib.BaseLib.call(BaseLib.java:120)
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.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:65)
at zombie.gameStates.MainScreenState.enter(MainScreenState.java:295)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:65)
at zombie.GameWindow.logic(GameWindow.java:297)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:764)
at zombie.GameWindow.run_ez(GameWindow.java:680)
at zombie.GameWindow.mainThread(GameWindow.java:494)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1665849811815> -----------------------------------------
STACK TRACE
-----------------------------------------
Callframe at: error
function: debugClothingDefinitions -- file: CharacterCreationMain.lua line # 977 | Vanilla
function: initClothing -- file: CharacterCreationMain.lua line # 987 | Vanilla
function: randomGenericOutfit -- file: CharacterCreationHeader.lua line # 236 | Vanilla
function: createChildren -- file: CharacterCreationHeader.lua line # 28 | Vanilla
function: instantiate -- file: ISUIElement.lua line # 653 | Vanilla
function: addChild -- file: ISUIElement.lua line # 1082 | Vanilla
function: create -- file: CharacterCreationHeader.lua line # 122 | Vanilla
function: instantiate -- file: MainScreen.lua line # 797 | Vanilla
function: addToUIManager -- file: ISUIElement.lua line # 1009 | Vanilla
function: LoadMainScreenPanelInt -- file: MainScreen.lua line # 2191 | Vanilla
function: LoadMainScreenPanel -- file: MainScreen.lua line # 2100 | Vanilla
unknown item type "SMUIClothinge.Hat_ShemaghDown" in ClothingSelectionDefinitions.EPIRifleman.Female
e
THE DAMN E
I SEEE IT
THE EEEEEEEEEEEEEE
thank you
hopefully thats the issue
it worked thank you
Lol I opened it in nosteam mode and my stuff didn't load because it's from workshop and I freaked out and had to retest everything
Yea, that's a pain in the ass. I wish -nosteam mode had a way to include the workshop mod directory
Yeah I am over it
-additionalmoddirs="path/to/steam/stuff" or similar
So path to Zomboid or the Workshop folder?
Ideally, whatever path you provide as an argument, so you could include steam workshop mods or an extra mod dir you use for development, etc
I see no mods ๐ฆ set the directory to the Workshop folder...
Err, no. I'm saying it is a pain in the ass to test mods in -nosteam mode because a commandline option like that doesn't exist ๐
I wish they had one so you could include steam mods even when running -nosteam
Ohhhhhhhhhhhh
Lmao I'm waiting for the bug reports
Bahahaha hopefully it works
I'm concerned it requires some special privilege being server setting
i am a bit scared if u tried setting the option by hand instead of hooking it that it will require admin access AND affect all players on the server in mp.
Oh so the UIs are not unique to the client?
i told u this like 3 times, but those settings ur messing with are server-side INI file config stuff
the server determines whether u see ppl's names or not normally
and it's pushed to clients only on login or
/reloadoptions
u can hook where those act and toggle it locally but actually changing the option may well not work right
or may work but have side effects
by all means tho test it
maybe it can be done on the client end w/o ill effect
but i am concern
:P
Yeah, I need someone to join me and test this tbh. I don't know if it will work as expected.
I tried launching -nosteam and couldn't even see my mods
I don't know how to do MP testing on mods independently if they don't show up in the list...
I am setting the server settings afaik, so it may well affect everyone. I see what you're saying totally
I am not sure how those server settings actually determine whether to draw the names... unfortunately those might be buried in some lists that are only referenced by index. Got a little lost when I went that direction
i make a dedicated server locally
and test with that as if it were a real server
:p
Oof
Really didn't want to have to go that far lol
I'll look into it later
Likely has unintended behavior... I'll try to test ASAP and remove if necessary
i can test it on my test server when i have time
but the caveat is "when i have time"
lol
im kinda taking a break from intensive shit to do during the weekend
I rewrote this with just the new recipe and seemed to remove a lot of stuff. Is there a way to simply add a recipe w/out touching the existing code? I don't want to overwrite anything, just want to add something.
If you just want the recipe to get into the game, what you had here would work if you just delete the 'NeedToBeLearn:true,' line
Otherwise you need to add a means of learning it
I wanted to add the recipe to engineers only on spawn, basically
And to the magazine
For non-engineers
Then add a lua file to /media/lua/client/ that has this:
local engineer = ProfessionFactory.getProfession('engineer');
engineer:getFreeRecipes():add("Make New Smoke bomb");
end
Events.OnCreateSurvivor.Add(AddNewEngieRecipe);```
Anyone know where I can find the models that are used in the game?
Juuust found them lmao
That'll add it to the Engineer at least. Need a bit more to add it to the existing magazines.
Cool, thanks! I think I got the magazine portion correct already
@weak sierra I updated again and disabled the hiding of other players for now
Everything else should be working for now if you want to use it. Works better than the original.
I'll push a new update after I find someone to help me test multiplayer
maybe add a container it's put in, like an empty tin can
Yeah, that's the next thing. Gonna add newspaper/tin can
Starting small, but i'm going to try to add a lot more scrap/junk functionality to engineer items
hell yeah, i had a similar idea like letting engi make a upgarde to the generator that increases the amount of gasoline it can hold, might be something you could try adding to yours if you're confident enough
sounds fun
I have some ideas for engineers and electrician functionality stuff but then sometimes it's hard to differentiate the two professions.
that's true sadly
I think it's partly because I have no idea what type of engineer the engineer of this game is supposed to be
or have been
i'm guessing an explosives engineer or something in the degree of chemics
if it was an electrical/mechanical/systems/chemical/etc
chemical seems the most fitting
cause like they know about aerosol combustion
and the set up of how aerosol bombs need to be built is very finicky
yeah, I like that
I think that can make what I try to have the engineer do be more specific
It's good to have limits/constraints
hit me up if needed for ideas xd
This one is not bad ๐
Yeah, just list em. I'll start a spreadsheet ๐
as said electrician or engi being able to upgrade the gen to hold like i dunno 150% instead of 100%
glass shard bomb,
engineer being able to make acids and such for metal stuff if you're going for the chemical stuff
yeah acids crossed my mind too
FBI bout to put me on a list after seeing my wikipedia searches
I'ma tell em, "It was all for a video game, sirs and madams"
oh believe me I've attempted modding some of this stuff and the FBI didn't do shit after I literally googled "explosives you can build with every day objects"
๐
I wonder about having electrician make generators more effective somehow and engineers make them hold more gas.
hmm seems fair enough
Or an Engineer making a simple flamethrower?
Sounds fun to aspire towards as a newbie modder with this game
Was wondering what kept vehicle engines updating after you turned it off and walked away. Had a hunch that it has something to do with the engine's temperature so I output it
I was right, but funnily enough the engine's temperature is completely decoupled from ambient. When you start a car up its apparently at 0 degrees and has to get back to 0 before it stops updating, haha
What are folks thinking for bleach bombs? Two ideas I see are:
- Creating a new item for "drain cleaner" and putting that mix in a container
- Adding item for "potassium chloride pills/liquid" and a distilling process and putting that in a container
Any other chemical/acid item ideas?
Drain cleaner seems like a good idea cuz apparently it's also used in sulfur acid attacks...again...officer...it's for a vieo game
Is this spawn "points" (as opposed to regions) file deprecated?
Weird that it was created for the dedicated server but apparently not for any of my local servers
More fun vehicle shenanigans I've found:
- the heater consumes gas and electricity
- Max speed effects your gas consumption even driving at lower speeds
- You burn less gas at higher rpms as long as you're not in top gear yet
Would it be feasible to use the "evolved recipe" mechanic to make bombs with variable effects?
i think it's possible
Cool, I'll go nerd learn about how that stuff works. I think it'd be great to instead of having base items, have them be scalable with certain skills so they're stronger just like having higher weapon skill makes weapons stronger.
base items that are static strength, that is.
:getExtraItems() seems to return an array of the ingredients currently in an evolved recipe item
does anyone know of a mod that has an example of kicking people from the server?
SendCommandToServer("/kickuser "" .. username .. "" -r "" .. args.reason .. """)
This one doesn't work since the client needs admin access, i'd like for players to get kicked automatically when they break some rules, those would be detected client side
Maybe look there :
https://zomboid-javadoc.com/41.65/zombie/commands/serverCommands/KickUserCommand.html
Javadoc Project Zomboid Modding API declaration: package: zombie.commands.serverCommands, class: KickUserCommand
hey, thanks again, i checked it out before but wasn't able to figure out how to use it
doesn't look like anything usable is exposed for KickUserCommand. I'm having the same issue with ServerMessageCommand. The command objects themselves don't appear to be exposed to the lua, so they can only be accessed via sendCommandToServer, but then it checks your access rights before allowing it. The commands themselves are capable of being called without a user attached, but I don't see any way to actually do that. If you could get the server to send a command to itself then maybe, but so far I don't see any way to do it
Question, what happens to the player character when the player enters a car? Does the game stops rendering the player model? If anyone knows this
I believe they disappear, ya. Although some vehicle mods keep you visible, which can lead to funny stuff like weapons sticking out of the windshield
I see, I wonder if I could use some line of code to achieve the same effect for another thing
https://tenor.com/view/speed-wheelchair-me-running-late-gif-14178485 Someone please make this a mod
no heightmap no fun
Is there a special place to find the evolveditem finished items? For example, the normal sandwich that you might find as salvage is in items_food.txt but the values it gives do not correlate with sandwiches that are made from the evolveditem process.
and evolvedrecipes doesn't list the values of the final items, just their names.
that's because the values of an evolved recipe's result are based on the input ingredients, whereas the ones you find use the values in the script
they are the same item
OnUseVehicle being in the server folder while only ever running on the client is driving me insane
Anyone know of a guide for making UI elements?
There are very many UI elements in the game via Lua. The game code is the guide with examples.
the game code is not a guide, you can only root through uncommented code for so much. In all fairness, I'd rather get no answer than a dismissive one, thank you.
Is there a way to see who's calling my function so that I don't need to overwrite them individually.
Crashes the game.
getVersion doesn't exist on 41.77
is there a way to implement visible waypoints for players for quests?
static world markers, or something like that.
Do you mean something like this?
YES please. how?
Unfortunately, I no longer have the code, I lost it in a format ๐คฆ but I'm sure that it is on lua side, let me see if I can find it
omg i got so confused with the question..
im not sure if i understood it...
"i have to not use -nosteam yes?"
if only i can
if whatHeSaid==true then
print(whatHeSaid)
end```
client/Context/World/ISContextDebugHighlights.lua#L51 ->
local arrow = getWorldMarkers():addDirectionArrow(getPlayer(), _square:getX(), _square:getY(), _square:getZ(), "dir_arrow_up", c.r, c.g, c.b, 0.95);
awesome. thank you so much
if you have -nosteam on then you have to manually have them download the stuff from 3rd aparty link like gdrive..
if -nostean is off then its going to return an error if theres a file mismatch
anyways im sure you cant just modify stuff thar way... why not just use steam anyways?
If you mean the function or mod that called your function, not afaik. Lua has debug api that could be used to do that, but it isn't available in pz (or maybe in kahlua, more generally)
yea, it is for the unstable version that removed getVersionNumber and added getVersion. I'll make it compatible on both since other people are trying to run it on stable build ๐
Updated it to work on stable builds if you wanted to use it on stable
Can anyone halp me get my dedicated server to show up right?
I've got made and in my favorites, I'm guessing my ports aren't right but I'm seeing different information from different sources
If you are connecting locally to test mods, you shouldn't have to deal with ports (unless you have some insane firewall setup) when connecting locally to 127.0.0.1
Hmmm well afaik I have the server running here...
But I have no idea how to set the numbers here to get it to show up
change the IP field to 127.0.0.1
Omg that was all I had to do
Are you in steam mode?
facepalm
That just changed all the info I think it may have worked
it's loading Lua
โค๏ธ
Oh, okay. Nice
I had possibly already done any other steps you had in mind... I even forwarded ports like crazy and opened them up in Windows Defender
Wasn't sure if it'd work running in steam mode, but glad it did. It's a little more wonky to get working correctly in steam mode
I assume it's in Steam mode if the bat had a line saying something like D.steam=1 and had no line saying -nosteam
1 is usually true so unless Lua is THAT full of hate...
lol jk
So I am now connecting as a user rather than an admin and that's useful presumably for testing, but what if I want to see how things look for a second player connecting to this server? Do I need to relaunch in Steam mode and connect from two no-steam clients? Will that cause the server to stop connecting players to mods? Or will the nonsteam users created automatically download the mods to some folder on my computer reserved for nonsteam Zomboid modding?
anyone knows a tutorial for making pz animations from scratch?
@weak sierra Tiny update to the mod (username state would always stay hidden after hiding it if you launched the game with username hidden; that has been fixed). 100% works as user, at least with the anticheats disabled that I tend to disable (confirmed by starting my own dedicated server. Thanks to @hearty dew for helping me finish that.
Relaunching Dawn of the Zed with a better description that will hopefully prevent so many people from downvoting it simply because they're oblivious to the problems it solves. https://steamcommunity.com/sharedfiles/filedetails/?id=2875983658
Sorry to anyone dealing with early stages of launching this mod. More complicated than I thought it would be (A) making basic changes to UI in game while in MP, and (B) explaining to the Steam community why a mod needs to exist.
@bronze yoke I think you were interested in using this. Sorry I had to repost. Now that I am able to test on a dedicated server and I have fixed the description, I have no intention of doing so again.
lol when people downvote my mods on Steam without giving any reason (presumably because they wouldn't want to use the mod personally or just because their souls are made of poop), I hate them so much.
I mean not the whole them, but the part of them that works like that.
I am just so annoyed by the mindset of someone who downvotes mods just because they don't want to use them... sigh
devs what do you think about this https://github.com/pz-extender/extender ?
non-steam clients cannot play on steam servers
Sorry I don't understand whether that applies to my situation... I launched PZ through Steam, and I launched the server with "D.steam=1" or something like that set... Would my server have launched as nosteam by default? I didn't click the nosteam bat....
i thought your question was 'do i need to use a steam server and two non-steam clients', sorry
No I must have misspoken if I implied that
but everything will need to be nosteam if you plan on using two clients, as it won't authenticate your steam account twice
Oof... How do people connect game to their mods in nosteam mode? Mine wouldn't load...
just put them in zomboid/mods
Okay so if I copy all of my online mods into zomboid/mods they will appear to the nosteam client?
they should!
Okay phew I will try lmao what a cluster
Wish I could spawn fake online users near me for testing
god yeah
I will get it figured out though, your help is clarifying as usual
@bronze yoke Will I need to pull them out of their numbered Steam Workshop folders? Or will they be recursively located even if they're a bit buried?
unsure but i would do it anyway
Okay fair sounds good
I think I'll check on recursive loading once because it'll take only a minute to test and save a lot of time if it works.
I think your name choice isn't very good for a UI hiding mod, but that's personal choice
taking this into consideration, does that suggest I should make subrecipes that have values like....1 explosive powder (gunpowder derivative) gives +20 explosivepower while say .25 gasolinechemical gives +20 firepower?
I believe there is an admin command for it. Can check the pzwiki or use the /help command which should list it
Well hopefully the fact that it fundamentally improves the functionality of the game will outweigh that for anyone who bothers trying it; but, if not, then the improvements can go unappreciated and downvoted into oblivion, or perhaps stolen and rebranded by someone who likes simpler names.
If you read the desc you'll see it does a smidge more than simply hide UI. It will eventually hide all usernames if at all possible, and hopefully XP updates and other stuff not currently hidden by hiding UI.
guess now I have to learn kotlin too, lol
is there a startup parameter to relocate the whole zomboid folder(on the steam folder not the user)
my windows drive is full and i wanted to move all the files tk a diffrent drive.. i was able to movethe users file but i want tk move everything else
ill give like to to ur mods man
โค๏ธ
Does anyone know a mod that allows other players (who have their own safehouses) to be able to be added to my safehouse? Atm my friend and I have two separate houses and its annoying that he can't sit and interact in my safehouse.
Anyone knows which temp the container need to be to freeze foods?
I'd say that's still hiding UI, usernames are still a UI element.
Sounds nice, just don't like the name choice, I've never personally downvoted a mod though ๐คฃ I just think the name sounds like some sort of conversion mod, or role-playing mod, because it doesn't really relate to UI and Dawn of the Dead is a popular thing, so I'd expect it to relate to that
You should tell the devs, since the UI-hiding function doesn't hide usernames. Programmatically hiding usernames is a separate endeavor entirely.
The relationship is that playing without a UI is cinematic; it makes a game feel more like a movie. Dawn of the Dead is famous zombie movie. The mod's goal is to make playing feel more like being in a zombie movie like Dawn of the Dead. People may not notice how the title relates to the mod's purpose, but it certainly relates.
Fwiw I agree with you. Hiding names should be part of hiding UI. Unfortunately, in vanilla, it's not. Also, in vanilla, playing gamepad, I can't even hide the UI. I would much rather the vanilla game have basic UI hiding and complete gamepad support. Then my poorly named mod would not need to exist at all, lol.
Does anyone have a suggestion on how to make this code look better?
local locations = {
["ZedDmg"] = true
-- TODO: ADD MORE HERE
}
function IsBannedBodyLocation(bodylocation)
return locations[bodylocation] or string.find(bodylocation, "MakeUp_") or string.find(bodylocation, "Transmog_") or string.find(bodylocation, "Hide_")
end
I have the suspicion this will be come a very long chain of 'or' statemens once I find all the other strings to match
I believe you can break safely after the word or
local function go(test)
return false or
false or
false or
false or
false or
test or
false
end
print(tostring(go(true)))
print(tostring(go(false)))
This prints
true
false
Yeah I decided to do that, I'll bother about code clarity once it becomes a problem for now i'm just using a line break
For sure just figured I'd throw it out there in case you were gonna one-line it
does the modded trait "Incomprehensive" work in multiplayer?
Yo random question when I loaded my own server for the first time I noticed a ton of assets failing to load, but this never throws exceptions in debug mode? What's going on here? Are these just mod conflicts that don't cause live issues or what? Or is this not common enough to guess without seeing the errors?
Afaik modded traits can work in multiplayer but Idk what mod adds that. However I have been avoiding a lot of trait mods because they've been throwing tons of exceptions in my debug console
Gotta figure that out myself
the description for incomprehensive is "You tend to find less items while searching containers"
my server does this as well, my guess is that the server just doesn't need most assets so it doesn't load them
Hmmm just so weird because it shouts ERROR at me like it matters, and then seems to not matter
Need to inspect the logs further I think
I copy-pasted but haven't had time to read em
AFK
zomboid spams errors about a bunch of stuff that aren't really errors, so i don't really think much about it
like all that stuff about vehicle distributions and stuff
from a brief examination of the source code, i don't think it will work
make a keyed table with the strings and values that are true and do if tableName[string] then
it looks like it just deletes items when a player with incomprehensive first opens a container
better perf too
stringList = {
"something" = true,
"something else" = true,
}
if stringList[someString] then
--Do things :D
end```
I was planning to to do it, like that, but I generate body locations at run time, and I can't know how many body loc the game will have
๐ค
BodyLocationGroup:getAllLocations()?
if that is a thing then just do this and execute ur table building and such on a load-time event
rather than early
unless u have need to build it early
in which case "load this after clothing mods" or make the name start with Z or something
I'll think about it, i don't know if it's possible for me to generate the list of banned body locations
btw u ever gonna fix that medical fanny pack?
The antibiotics issue?
didn't I fixed it already? ๐ค
if you did then maybe my override did something to stop it from fixing
I'll check now since Im free
{
DisplayCategory = Bag,
WeightReduction = 95, /*50->95*/
ClothingItemExtra = Bag_MedFannyPackFront,
ClothingItemExtraOption = FannyPack_WearFront,
clothingExtraSubmenu = FannyPack_WearBack,
Weight = 0.2,
Type = Container,
Capacity = 2,
DisplayName = Medical Fanny Pack (Back),
Icon = MedFannyPack,
IconsForTexture = MedFannyPack;MedFannyPack_Red;MedFannyPack_Blue,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
BodyLocation = FannyPackBack,
ClothingItem = Bag_MedFannyPackBack,
CanBeEquipped = FannyPackBack,
RunSpeedModifier = 0.98,
WorldStaticModel = FannyPack_Ground,
}```
all i do is adjust the weight reduction
but if u added some new function or smth
(this is an unlisted mod for my server so i don't care to use itemtweaker type overrides here)
i read the code and it still didn't look like it'd check that field, something was commented out
It seems to work
mm
Can you send me your 2850483881\mods\MxBackpacks\media\lua\server\MxBags_AcceptItemFunction.lua
precisely what i was bout to do heheh
-- This is based off media\lua\server\Items\AcceptItemFunction.lua
MxAcceptItemFunction = MxAcceptItemFunction or {}
function MxAcceptItemFunction.MedicalOnly(container, item)
-- print(tostring(item:getScriptItem().Medical)) -- Apparently this does not work :-/
return item:getStringItemType() == "Medical" or item:getDisplayCategory() == "FirstAid"
end```
doesnt look so new
just item type and display cat
a commented out attempt to check .Medical
-- This is based off media\lua\server\Items\AcceptItemFunction.lua
MxAcceptItemFunction = MxAcceptItemFunction or {}
function MxAcceptItemFunction.MedicalOnly(container, item)
-- print(tostring(item:getScriptItem().Medical)) -- Apparently this does not work :-/
return item:getStringItemType() == "Medical" or item:getDisplayCategory() == "FirstAid"
end
Same here

I think you have a mod that changes the display category
What the display category for the antibiotics?
this one is incredibly popular
were u to pick one to support
:p
i do not know off teh top of my head
๐
i also was unable to put Zomboxivir Ampuoles in there from They Knew mod
not sure if Better Sorting covers that or no
it may well
same
it's pretty nicely consistent
here's base game medical stuff
--MEDICAL
TweakItem("Base.AlcoholBandage","DisplayCategory","Medical");
TweakItem("Base.AlcoholedCottonBalls","DisplayCategory","Medical");
TweakItem("Base.AlcoholRippedSheets","DisplayCategory","Medical");
TweakItem("Base.AlcoholWipes","DisplayCategory","Medical");
TweakItem("Base.Antibiotics","DisplayCategory","Medical");
TweakItem("Base.Bandage","DisplayCategory","Medical");
TweakItem("Base.BandageDirty","DisplayCategory","Medical");
TweakItem("Base.Bandaid","DisplayCategory","Medical");
TweakItem("Base.BlackSage","DisplayCategory","Medical");
TweakItem("Base.Comfrey","DisplayCategory","Medical");
TweakItem("Base.ComfreyCataplasm","DisplayCategory","Medical");
TweakItem("Base.CommonMallow","DisplayCategory","Medical");
TweakItem("Base.CottonBalls","DisplayCategory","Medical");
TweakItem("Base.Disinfectant","DisplayCategory","Medical");
TweakItem("Base.FirstAidKit","DisplayCategory","Medical");
TweakItem("Base.Ginseng","DisplayCategory","Medical");
TweakItem("Base.LemonGrass","DisplayCategory","Medical");
TweakItem("Base.Pills","DisplayCategory","Medical");
TweakItem("Base.PillsAntiDep","DisplayCategory","Medical");
TweakItem("Base.PillsBeta","DisplayCategory","Medical");
TweakItem("Base.PillsSleepingTablets","DisplayCategory","Medical");
TweakItem("Base.PillsVitamins","DisplayCategory","Medical");
TweakItem("Base.Plantain","DisplayCategory","Medical");
TweakItem("Base.PlantainCataplasm","DisplayCategory","Medical");
TweakItem("Base.Splint","DisplayCategory","Medical");
TweakItem("Base.SutureNeedle","DisplayCategory","Medical");
TweakItem("Base.SutureNeedleHolder","DisplayCategory","Medical");
TweakItem("Base.Tissue","DisplayCategory","Medical");
TweakItem("Base.ToiletPaper","DisplayCategory","Medical");
TweakItem("Base.Tweezers","DisplayCategory","Medical");
TweakItem("Base.WildGarlic","DisplayCategory","Medical");
TweakItem("Base.WildGarlicCataplasm","DisplayCategory","Medical");```
Oh, look at this, so clean
Damn, I might install that mod too lol
so if these things weren't "Item"
it's even compatible with More Loot Settings
the only such that that mod supports
:P
it's good
xD
Damn ๐ฎ
-- This is based off media\lua\server\Items\AcceptItemFunction.lua
MxAcceptItemFunction = MxAcceptItemFunction or {}
function MxAcceptItemFunction.MedicalOnly(container, item)
-- print(tostring(item:getScriptItem().Medical)) -- Apparently this does not work :-/
return item:getStringItemType() == "Medical"
or item:getDisplayCategory() == "FirstAid"
or item:getDisplayCategory() == "Medical"
end
I'll push this one asap
๐
check the patch notes https://steamcommunity.com/sharedfiles/filedetails/changelog/2850483881
Also I haven't released 5+ new bags because i'm waiting for my gf to make the icons and textures for them 
I'm looking for the vanilla code on how heat sources work. Planning on creating a heater but cant figure out where to look
So, all this time for my transmog mod I have been using item:setClothingItemAsset to set the ClothingItemAsset aka the ClothingItem = in the text files
Should I keep using setClothingItemAsset or should I use item:DoParam("ClothingItem = StuffHere") ?
What are the implications of changing my code to use item:DoParam ? ๐ค
Hello everyone. Stupid question here
I am trying to add a freezer container to the back of a truck
That is ok, its working
However
The item keeps its description of "Fresh, uncooked" until I relog on the client
I do freeze it via a /server/ lua file
How do I update the item on the client so it gets the new properties?
does anyone know how to ban/kick a player from the server side in lua?
when sending the command from the client it needs admin permissions
definitely don't use doparam
doparam only works before something is instantiated and affects every instance of the item
it's for like
editing script file at runtime
u def want the function
also it seems ur QOL anarchist cookbook magazines are somehow incompat with chuck's Named Literature
u read em and it spits a big ol' error, very strange
Odd, what are the errors?
i do also patch ISReadABook for my book xp mod, but that shouldn't touch magazines
but in case relevant..
it just "can't find it"
very odd.
Oh, I do edit the check pz-MxsQoLPack\Contents\mods\MxsMagazines\media\lua\client\magazinesISReadABook.lua
oh do u
Yeah
nutritionist one works fine tho
somehow
that's the one i'd expect something weird with
Ah, interesting ๐ค
got trait and everythin, no error
the anarchist cookbooks yield no recipe on my server just an error
lol
and they are just normal recipe mags afaik
so very odd
Odd the way I made the anarchist magazine is quite simple and vanilla like
item AnarchistCookbook1
{
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = The Anarchist Cookbook Vol. 1,
Icon = EngineerMag1,
TeachedRecipes = Make Flame bomb,
ReplaceOnUse = EngineerMag1,
StaticModel = Magazine,
WorldStaticModel = MagazineEngi1Ground,
}
?
UdderlyEvelyn pinged you about this #mod_development message
my reading mod wraps the original and still calls it normally, so it shouldn't interfere, Mx's script is pretty vanilla
yet it spits errors about not being able to find the item
unless it's a red herring and some other thing is to blame
oh wait Mx
ReplaceOnUse = EngineerMag1,
item AnarchistCookbook1
can't find MxQoLPack.EngineerMag3
it was u
that shudda errored on ur end even
the names dont match
did u not test :O
I have the mod on my server O.o and I never got this error lol
local ISReadABook_perform = ISReadABook.perform
function ISReadABook:perform()
local bookNameLitInfo = self.item:getModData()["namedLit"]
if bookNameLitInfo and self.stats then
---@type IsoPlayer|IsoGameCharacter
local player = self.character
local bodyDamage = player:getBodyDamage()
local stats = player:getStats()
local title = bookNameLitInfo["title"]
local UnhappyChange, StressChange, BoredomChange = namedLit.readerMemory.statsImpact(self.item,title,player)
stats:setStress(math.max(0,stats:getStress()+StressChange))
bodyDamage:setUnhappynessLevel(math.max(0,bodyDamage:getUnhappynessLevel()+UnhappyChange))
bodyDamage:setBoredomLevel(math.max(0,bodyDamage:getBoredomLevel()+BoredomChange))
namedLit.readerMemory.addReadTime(self.item,title,self.character)
end
ISReadABook_perform(self) --line 24
end
line 24 is just calling the vanilla function
I'm testing rn and checking
yeh it was Mx's script.. sorry to bug u
ah cool :D
(I think?)
@weak sierra I dunno man
Oh wait no, I couldn't replicate it - but I think it was related to server/client
shouldnt actually cause an issue
it doesn't create an issue in practice
but it does produce an undesirable error during load
how can it not throw an error if it's the script
bizarre
ur game magic D:
it should either throw an error or find the base item and replace it with that when u read it
xD
Can some1 help me with how to use AddHeatSource? https://projectzomboid.com/modding/zombie/iso/IsoCell.html#addHeatSource(zombie.iso.IsoHeatSource)
declaration: package: zombie.iso, class: IsoCell
function testMod.getPlayerInfo()
testMod.player = getPlayer()
testMod.player.accessLevel = testMod.player:getAccessLevel()
print(testMod.player)
print(testMod.player.accessLevel)
end
Event.OnKeyPressed.Add(testMod.getPlayerInfo)```
Am I using Event.OnKeyPressed.Add wrong? This should print my player and access level each time any key is pressed but it breaks at the event. ๐ฌ
Actually, nothing happens on keypress but the client breaks when loading into the game.
i don't think player.accessLevel is writable
does OnKeyPressed have parameters?
yeah
I assume adding an event listener that doesn't take the correct parameters would cause problems, but I've never tried
fixed
:p
i have no idea how u evaded that problem but i can't be the only one who ran into it given its nature lol
my vehicle spawning mod was broken for like 4 days and nobody said anything
:)

either way it's fixed now
sorry for asking this the third time but I'm having a ton of issues with figuring out where to go from here, no mods have done this before either so might not be possible.
Can I create an item in-game that acts as a heat source? Like just, is it possible or should I stop trying lol
it doesn't
Hi, i try to make my first mod on project zomboid, actually, i wan't to trigger a function everytime a player join the server (it's a hosted server)
So, i try to use the event "OnConnected" but it's doesn't work and i don't understand why. Some peoples to help me ? thx
`local function printPlayers()
print("successfully connected !!")
local players = getAllPlayers();
print(players)
end
print(isServer())
if isServer() then
print("it's Server !! qqqq")
Events.OnConnected.Add(printPlayers);
end`
qqq it's to find easily things with Ctrl+F
Everything works, except that the event is never trigered
Are you running this mod with -debug?
Yes
Is it giving you any errors? Or doing anything? Just curious. I would expect an error because you seem to be trying to print a function that would likely return boolean, but I believe I have to cast those as string to print them safely in Lua
Wondering if you see anything in your error log reflecting what I see
E.g., I have never seen anyone use getAllPlayers() and I can't find it in the doc
I'm not sure whether that function exists
Or what it returns
If it returns anything I would expect it to return an array of player objects, which I don't think Lua would casually print
actually no errors, everything is print, except players, i've made different tests, with simple print in the function like print("abcd")
"it's Server !! qqqq" is printed fine, the only problem is that the event seems to be never triggered
so the function never run
So you want it to print when players connect to server but it's not? Are you testing this on a dedicated server?
Nope it's an hosted server, through Steam
I'm not sure when it would have an opportunity to detect your connection while your Lua is running... You might connect before your Lua loads when you're host
Idk tbh
OnCreatePlayer is not triggered on Character Creation ?
Or OnCreateSurvivor https://pzwiki.net/wiki/Modding:Lua_Events/OnCreateSurvivor
It would probably be triggered as you entered game with new character
i try these
Is your goal to always print a message when player joins server?
Or just test an event hook?
Nope, i try events for an other project of mods
Your OnConnected function could be working, but you might need someone to join you to see it work
I might be free to help you test later
I try the other events
If you see "it's Server !! qqqq" then the function should be getting added successfully.
It looks like you wrote it correctly
Yes, so myb your right, i can't trigger the event as the host
You should at least see successfully connected maybe, but I don't know if getAllPlayers() is legit
Where did you find that function
i removed it for print("abcd") actually, for the test
that's my creation actually x)
I don't think it works unless you have a function you wrote somewhere
i think OnConnected fires on the client
The real function is getNumActivePlayers()
Just so you know
That will get what you probably meant to get when you tried printing getActivePlayers()
Actually i have this on client side
`local function test()
if isServer() then
local playerObj = getPlayer();
print("adfdf");
print(playerObj:getUsername());
print('adfdf"')
end
end
print("qwertyuiop");
Events.OnConnected.Add(test);`
One question, what damage type is food poisoning in project zomboid?
I need to know what to writte in lua to make my pills do effect
If a client connects to you, presumably you would print on their joining, since you are host, but I am not sure. I just freed up if you want me to join you to try it out.
OnCreatePlayer do nothing too, even if i delete my character
this code appears well-formed afaik. I would expect you to get qwertyuiop when your Lua loads, though I have no idea if console gets cleared after that or not, and then you will get adfdf\nadfdf" when someone joins your server.
Let me see your code, OCP is more complex
`local function printco()
print("successfully connected !!")
end
print(isServer())
if isServer() then
print("it's Server !! qqqq")
Events.OnCreatePlayer.Add(printco);
end`
Okay, OCP has 2 params; see here: https://pzwiki.net/wiki/Modding:Lua_Events/OnCreatePlayer
You need to include them in printco as step one of fixing that
OCP events send 2 params and if your function can't receive params there will be issues.
`
local playername = "leevmealone"
local playerId = 0
local function printco(playerId, playername)
print("successfully connected !!")
end
print(isServer())
if isServer() then
print("it's Server !! qqqq")
Events.OnCreatePlayer.Add(printco);
end`
Like this ?
Correct.
Afaik, that should work. I would imagine it would even work for you hosting alone if you load up with that
Actually
Maybe not
print(isServer()) may need to be print(tostring(isServer()))
I have gotten errors in Lua trying to print booleans without casting
Maybe only when I concatenate though, Idr for sure.
Okay great so what that means is watch out when you concat
Because I have for sure thrown errors trying to go, "Blah is " .. boolVar
nice to know
In that case, tostring fixes it
Also tostring can help confirm functions exist in the debug console
Just do Class.function instead of Class:function()
You can tostring it and it will tell you it's a function and give a mem address
Or it'll say nil or something
iirc
It will not work lol obv
yes seems logic, we can only concatenate strings
Sure, some languages would do that automatically with basic datatypes
Especially when the variables have no explicit type
actually OCP doesn't work too, it's a client side event ?
Literally we just right variable = and Lua rolls with it, but don't you dare try to say variableA = variableB + variableC without knowing what types B and C are
It's a little counterintuitive in context.
Hmmm could be not sure. Odd
i try on client
i was on server side with it
does nothing on client side too
i will definitely try more simple events, it's weird
i'm gonna try EveryTenMinutes
EveryTenMinutes work
it's time for me to go sleep, it's 4am here
good night/day
Haha goodnight sorry will help more next time if you want.
Glad ETM worked
@weak sierra Great news! I am currently testing on a server with 3 players and flipping that server setting does NOT affect everyone else! It's safe to hide and show usernames that way as far as I can tell!
I am going to push the update soon and wish you the best of luck with it
I still plan to figure out how to hide XP updates in a future patch
gooood
:D
was worried bout that but im glad i was wrong
did u test what happens if an admin does it?
then maybe
i guess u can't do /reloadoptions while it's on can u cuz no chat box
so probably fine even if it would do that.. 
Uh no but I don't think it matters because I think the variables when accessed from clientside are just clientside variables produced for the client by the server, and once client has them server dgaf what client does with them
At least that's my likeliest interp of the results
I did it with two clients next to one another to see how their names would be affected... Client A hiding ui had no effect at all on Client B. Then I joined with Client C to determine if Client A's recent settings change would be pulled by Client C. Nope. Client C had default server settings
I am satisfied that it's safe but if you find out I'm wrong I am happy to attempt to improve it. You have more testers and contexts so who knows what conflicts could arise.
lol 66% downvotes I don't know why I bother but @weak sierra @bronze yoke @gilded hawk bahaha upgrades! https://steamcommunity.com/sharedfiles/filedetails/?id=2875983658
maybe something is bugged or something?? like 66% downvotes seems insane
I only have 6 responders
No bugs, no comments indicating such
I think there are some people who aggressively hate my name
i guess not many people bother to vote on mods at all but i'd expect the people who'd get mad enough to bother to downvote would be even rarer
I think there are others who believe the mod is pointless because they're too dense to see its use case
Or how it improves on base-game UI hiding
And maybe some people are just mean to all new mods
But of 6 votes, 4 down, no explanations.
Feel free to lmk if it bugs, but I get no errors and it works flawlessly for me
I really think there is a small handful of people who know my mod exists and are mad because they think it's already in vanilla and I modded for nothing
They spotted it and downvoted it together literally minutes after I posted
No way they tried it
dw bout those ppl, nobody else can see the downvotes anyway
:P
I hear you, lol I try not to but I'm just salty about people sometimes
But you're right, important thing is the mod benefits people
Now I want to figure out how to hide experience gains / level-up messages in no-hud mode.
Not sure what keyword to hunt first but maybe XP is all I got
Oh yeah I should trace the text itself
what does it say like fitness +1?
Not really sure where to go really but my first mod Lingering Whispers https://steamcommunity.com/sharedfiles/filedetails/?id=2874678809 is doing pretty well, i'm interested in the modding scene but my coding skills aren't very good, I was wondering if anyone wanted to collaborate on working on adding additional content to this mod or future mods. My skillset is mostly 3D modelling, writing and game design and i'm leaning towards specializing in creepy mods
i'd love to help out, should the project interest me
Currently this mod allows for a low probability for zombies to regain consciousness for a split-second during state-sensitive scenarios, allowing them to speak, such as when you are fighting them, when they are idling, bashing on a door, etc. I'm interested in expanding upon this further by creating even more unsettling scenarios and things they can say
yeah i saw it, i thought it was a great idea
There is a lot that can be done with a slowly degrading consciousness that doesn't need to be entirely speech based as well, such as zombies having a very low probability to open doors to return to places that have significance to them, such as a church, their home, etc
Then in terms of future projects, i'm interested in creating pre-apocalypse and post-apocalypse notes that can be found throughout the game that deliver on a whole range of emotions when you go through, find and read them
If anyone is interested in assisting, i'd love a hand ๐
oh hell yeah
the atmosphere is what makes zomboid what it is for me, so a bunch of extra lore stuff to read would be great
Yeah totally, I think zomboid has a lot of untapped potential for that kind of atmospheric and subtle horror
I might be down, too. I kind of want to try to add Mod Options to your Lingering Whispers โ if you aren't already on it? Regardless, it sounds amazingly awesome; I just want it to happen more frequently (and I think various people have their own preferred frequencies). Would be nice to freely set that value. I am also planning to learn Mod Options for another mod I have, anyway.
Regarding this new idea, I might be down to write stuff for you out of pure boredom, or even get friends to pitch in some stories.
the code side of that would be really easy, but i'm not much of a writer
Kinda like bumping into those scenes you find throughout the game, a burnt car wreck with two corpses, a room where a wife was zombified and the husband decided to end it, all those kinds of scenes but then expanded into written form of rare glimpses at the people that walked the earth
@viral vale Maybe place a discussion post on your mod where you can ask people to "submit" personal notes that you can use/adapt into the pre/post apocalypse notes? Get a body of different styles/emotions using crowd sourcing.
my literacy mod has had a full revamp done for over a month but i don't want to write the dialogue it needs LOL
Nice
Yeah, i'm not sure how to expose those components to be able to up and lower the frequency, so that is definitely on the cards of something I want added to the mod
I do a game writing pretty often, so that is alright ๐
Yeah, that sounds like a good idea
i'm very familiar with sandbox options, i could drop them in for you
Sure ๐ Feel free to see if you can get that working, that kind of stuff would take me awhile of just bashing my head on a keyboard, so any help to improve that function would be awesome haha
i won't be at my computer until tomorrow, but i'll take a look then
No problem ๐ If anyone else wants to jump on board, lemme know ๐
Fwiw, I'm pretty obsessive about grammar when I publish things. If you're open to edits, I am down to help edit your mod's whispers, insofar as they need to be edited. (Common but formally incorrect ways of speaking seem fine, but I would be especially attentive to inconsistent punctuation.)
I think that all the grammar in Lingering Whispers is correct, since it is mostly just single words of talking with the occasional 2-4 words ahaha. But for long-form text for future stuff that would be needed yeah ๐
Haha, fair, but you never know. I'll probably still check when I look at code to contemplate Mod Options


