#mod_development
1 messages ยท Page 103 of 1
I wish someone would make timeaction tools
And serverclient tools
That modders would require to make life easier
Make it module.
Yeah, I tried to spawn bandages on zombies but I can't seem to find a way to listen for zombie spawning events. If I can listen to spawn events then getting to work properly would be easy. In the meantime I'm just using the method that scalyZeds did(Overriding underwear and using it to spawn the bandage/costumes)
Oh and for anyone interested, If I complete my Lua transpiler project, it'll be analytical.
Just admit you are instance of ChatGPT ok?
I'm planning it out in a markdown.
RIP my humanity
It's ok brother
IF anyone knows how to listen to zombie spawn events and run LUA on the spawned zombies (Once only when they spawn, not every time you load that zombie) that would be a massive help >.>
it's not possible
So sandbox vars can accept any types, even bytes? 
not in the way you describe i mean, there literally just isn't a hook or event for it
the best you can do is to just indiscriminately grab zombies and test that you haven't already operated on them
Actualy if you have a zombie counter then it might do the trick but only limited to your vicinity not the whole world if there are other players
Why doesn't zomboid have a lua hook for OnZombieCreated 
Lol
Maybe it's for perf reasons to prevent missuse? But idk, I feel like trying to hack your way around it would just be worse perf wise
Zombie's also can't save modData for performance concerns
You can still sue their modData for per session stuff tho
Its currently under debate. might make a appearance later.
pogs
so you can hook into their OnZombieUpdate - and set a boolean to true for 'onCreate'
Ow hi fenris
Gotcha. In my experience (I work in games too :P) I find that trying to lock down scripting just results in "Creative" solutions by scripters and end up costing more perf than locking down the functionality saves
sure. people use hacks to get around limitations
alternatively for my usecase having a way to specify custom item defines/clothing defines to add to all outfits via script would solve my problem without require a onspawn event
How did you open that inspection window? not finding here...
It could be more performant to make the event per zombie group instead of per zombie and leave it to the user to iterate through them, that way you save on LUA Interop performance (Not sure how expensive LUA-Java interop is)
I made it
My initial thoughts on the transpiler: https://github.com/asledgehammer/PipeWrench-Electron-App/blob/main/LuaToTypeScript.md
Is java modding a thing? Or is it mainly constrained to just lua scripting? (sorry for all the questions ๐ )
You can mod the Java. Just know you cannot upload it to the workshop.
If you are jab then yes
Been Java modding here since 2014.
inspect tool is on public release atm too - im just updating it to include reference linking
Security concerns from valve or just not supported by zomboid?
Both. TIS isn't against it unless you uhhh yeah do silly shit.
Lua modding is safe.
Debugger Not yet on steam?
Wierd, Arma Mods are allowed to have C++ DLLs on the workshop
Java is gray-zone.
cool, thanks!
2 links
I feel like if TIS implemented a packaging/signing system that would fix the security concerns (Similar to what Bohemia does)

Please don't.
lol
I like the ability to mod my Java.
You'd still have it, you'd just sign your mod when you upload it
Although I'd imagine that it would probably be too much work for such a niche part of the modding scene
Does zomboid even have a mod/patch loader for java?
I wrote some of my own but no.
several lol
Oh?
I wouldn't know about em.
theres multiple java mod loaders
Of course I wouldn't know about other patchers.. I write my own stuff. xD
Whats the perf cost of LUA scripts vs native java? Is it as bad as say C++ vs LUA?
IsoPlayer:getAccessLevel() or IsoPlayer:isAccessLevel(string level)
cheers
Kahlua is what is used to emulate Lua. It runs in Java. It has to transform Java <-> Lua for objects when executing pcalls.
I havent done any serious profiling, but the native java should be faster by far, considering we use kahlua
It's a little hit but it runs in a VM.
I should look into java modding for zomboid ๐ Seems like it could be fun
Kahlua also uses older invocation / reflection practices which means it runs a little slow.
oof
Modding in PZ with Kotlin is fun too.
ewww Kotlin ๐
TypeScript just peeks around corner and giggles
Tbh Java is kinda icky too IMO but
It's magic lol
I use TS at work for gamescripting
Yeah you can Typescript mod if you want.
I wouldn't dare do some of the stuff I do using Kahlua in that regard ๐
I made PipeWrench so people can mod in TS.
You know that TIS could upgrade Kahlua if it were a priority.
I did this for my servers back in the day.
Upgraded the under-the-hood code to make it slightly faster.
Convert zomboid to C#
oh noes not C# please
/me converts it to perl instead
RUST time
wanted to ask something, I looked at the game files and in the media/scripts folder there were some sounds (attributed to items) that I didn't find in the media/sounds folder, does anyone know where are they?
In native files probably
Tbh old .net is pretty ass, modern dotnet is actually close to C/C++ levels of perf which is pretty nutty. Just don't use LINQ or it will set fire to an orphanage
Sounds script can point to any media from original game too so.
This game would run insanely faster if:
- Medium PRNG is provided alongside high-quality PRNG
- The map format & tile coordinate system were to be rewritten in factors of 2 using bitwise calculations from chunk-coordinate to world-coordinate
- Less files for the map format.
=)
Java is good enough to run "The Sims 1". =)
The game would run faster if it was ECS 
I have no idea what I'm looking at
Multiple threads go vrrrrrrr
Oh and thanks to a friend's research:
4) If RakNet were to use multi-threading
How many zombies do you want:
ECS: Yes
the game would run faster if just sit in main menu
You can support ABSURD amounts of active agents using ECS
oh, sorry for the dumb question, they probably were in the .bank files, I didn't know what they were until I used 2 seconds searching in google...
Yeah its pretty simple rule - if you don't see some media in mods, look for media in base game dir.
Although I'm pretty sure you can't implement the design pattern in java due to object shenanigan's and lack of access to low level memory (For cache optimization shenanigan's ) (L1 Cache go BRRRRRR)
Same goes for required lua, you can require anything from base game dir lua folder
lol
Can't stress it enough.
Actually a good point
I'd set all the base game lua to use actual module format, but i'm not allowed to break things ๐ฆ
I'll break things. :D
Haha
I get that you guys have a process / plan.
that would break every mod existing that is bigger than 1 lua function
I'm also considering straight-up converting your entire Lua codebase to Typescript.
It'll be modules then..
pretty much. why i cant do it lol
Why can't you use a deprecation or API version?
I'd love to see revisions.
I know it sounds way easier to implement than it actually is. =(
that be nice, but setup work.
also, not part of my task list atm (still the newbie on the team)
90% of my time spent modding PZ is working on this exact issue / category.
apparently for me to open the .bank files I need to have FMOD Studio, which is paid, F... though, I think I have no reason for opening them
Sooo that's why I'm so interested in what'll happen there. xD
Thanks for responding to the questions.
One more thing before I run away: Mods having a internal form of versioning for files would be epic. Servers could use the same workshop items and specify a version to use.
Would solve most of the problems with uploading workshop content and servers.
Does workshop even have versioning of files?
No. TIS would need to make the folder-structure support it.
That means you somehow will have stream older version from server to client
Personally I'd like to see mod versioning, but I think to be effective the server would have to transfer mods to the clients, which could be problematic for some larger mod or busy / low bandwidth servers
mod_root/
versions/
a_version/
media/ ..
another_version/
media/ ..
mod.info
..
Code can be sent using loadstring() and Client/Server commands.
zstd might save the day
I have a working case of this as a template.
zstd can compress non-blobs up to 90%
code isnt the issue, text is relatively low bandwidth. I'm thinking more models & textures
oh, well yeah.
Okay then build a shared folder for all versions that can be used as a fallback folder.
where youve got mods that are 1gb+ in size, or 15 different vehicle mods installed etc
lookup:
- Specific version folder
- Shared folder
- PZ media install folder
You could split it into parts and apply patches depending on what was changed.
but thats a bit complicated.
My suggestion may not be the optimal one however I feel like it could serve as a vehicle for an eventual solution to mod version controls.
keeping previous versions in the mod folder only really solves half the issue though (mainly, duplicate conflicting workshop items, reuploads etc), where transfering directly from the server would fix.
Glad I can pass those long-time thoughts to someone at TIS.
Well the funny thing is this is totally doable already.
Man I was surprised to have direct answers on topics from devs
but ya lots to consider with it though. i've put some thought into it but its really not my area
You don't see that every day now
yea 10/10 here
ah well...i'm a new dev for TIS, and been a modder for years, so this channel still kinda my home ๐
very much hope you take some of the energy about certain problems here over to there
Let me know if you want a study case / experiment to play with that allows for server-specific content being sent to and ran by clients.
also walkie talkie voip been broken since november pls help
I'll actually try compressing some mods with zstd and see how it goes
lol i did note that convo the other day, but with b41 out of the way i wouldnt expect any sort of fix anytime soon
i reported it two patches before they closed that..
they spent that time telling me it wasn't a problem :(
but yeah..
just wish it had a setting like the other anti-cheat stuff.
If the patch is simple I'll try to make one in the meantime.
Already reverse-engineered and deobfuscated var names for some parts of Radio code to investigate that.
Lol
It's definitely tied to user permissions from the symptoms so that removes a lot of possibilities as to what actually breaks it.
Just needs more looking into.
Maybe the player simply needs all player's data sent to their client on login.
could compare a decompile of an old build to the current
and just like..
copypasta
<_<
hunting it down should be easier if u poke at that
i kinda wish i didnt update my decompile lol
Yeah. Just don't want to put too much time into the patch when I have active projects.
i wish i had money to give or something, i do not :P
No worries. It's fun to have 100000 projects.
overwhelms me a bit
heh
i have lists upon lists upon lists
but im tryna raise a 3yo
so
Constantly tearing apart this game for fun.
anyway it's time for me to write the sandbox fix finally, have time tonight to actually code it
I'm mapping out a new Lua transpiler ATM for future work.
Nice.
Going to try to interpret Lua code as ES5 JavaScript and transpile it to TypeScript.
It'll need to resolve var assignments from a collection of Lua code so I can see what types are inferred.
A useful tool: https://www.planttext.com/
PlantText is an online tool that quickly generates images from text. Primarily, it is used to generate UML (Unified Modeling Language) diagrams. It is based on a text language called PlantUML.
This is going to be fun.
If anyone in here likes to plan out their projects, I'd recommend getting PlantUML installed on your VSCode install.
The link above also works as a website portal for PlantUML.
the plan
lol
i do more extensive notes for big projects but always just notepad-esque stuff.
i am an agent of chaos
putting it a bit mildly there
I refer to the above

whatever works for someone to keep organized tho eh
bunch of windows open isn't killin me so whatev
suuuuure 
For me it's like 100 projects = 5 releases
yours are on average of greater scope than mine, to be fair
but yeah i try to finish what i do
used to not
Nah. It's simply a failure to plan / organize.
(me)
If I had the time I did like last year, I'd be working on 3 concurrent projects. =)
if i start more than one, one of them will sit on hold lol
I go back and forth to keep things from getting stale.
If I get stuck on one I can always flop over to another project.
I avoid burnouts this way.
yeah with how big your projects seem to be that makes sense
mine are usually within "i can grind through this in a week or two" (if i have the time, anyway) territory
wrote most of the sandbox sync stuff, tired tho, i think i'll finish tomorrow
will play game for the rest of tonight nodnod
=)
Hope my big projects helps make your projects smaller in time invested in figuring things out.
That's when I know that not only is my time worth it, but that it is successful.
is getLuaTest what i'd use to set a certain script parameter via a lua script?
for recipe specifically
trying to use sandboxvar int for item amount for recipe then i can wrap this up and release a good update for lightswitch electrician
How do I get the parent object of a backpack's ItemContainer (inventory)?
I want to access the modData of whatever object is currently holding an item.
If its a world object, like a cabinet or something, I can do
local objectThatHasTheContainer = containerHoldingTheItem:getParent()
local modData = objectThatHasTheContainer:getModData()```
However, when that item is in a backpack, `getParent()` just returns nil.
Answer: Apparently `getContainingItem()` is used to get the backpack object from the backpack inventory....
Why doesn't getParent() handle both cases?
zombies i spawn using addZombiesInOutfit() despawn almost instantly and dont chase the player. Debug log says "removing stale zombie". How do I fix this?
Is this in an MP setting? You are probably spawning them on the Client. You should be spawning them on the Server.
The Client will load files in both the Client and Server folder.
Under what circumstances are you calling addZombiesInOutfit()?
Are you "protecting" it from be called by Clients?
e.g.
--- code to spawn zombies
end```
If the container is on a character, you can do: container:getCharacter()
Or are you trying to get the moddata for a bag that has been placed in the world?
oh, i'm behind. ha.
Nah. I added the edit like a millisecond after you posted
the lua file to spawn the zombies is under the "server" subfolder in the lua folder
Yes, but like I said, that doesn't matter as much as you think it would. ๐คทโโ๏ธ
Clients will load and run lua files in all folders. Shared, Client, and Server.
damn
So you need to add something to prevent Clients from calling code they shouldn't even if its in the Server folder.
this specific code is set to run when the player says a certain phrase in chat, and sometimes it spawns them properly and sometimes it doesn't. I'm just confused as to why.
Because the Server will normally "reject" zombies added by a Client.
You'll need to learn how to do Server-Client Communication.
A player says something > Their client sends a command to the server
Server receives the command > Server spawns the zombies
https://steamcommunity.com/sharedfiles/filedetails/?id=2735092774&searchtext=server
reading through this, and the example lines dont make much sense to me. sendClientCommand(string, string, KahluaTable) --> The event is triggered by the player source. This doesn't tell me what it wants for the strings or the table, just that it wants them. Do i put the function names? triggers?
The intended use is
1st String - A module name (like your mod's name or something)
2nd String - A command name (the specific thing you want to occur)
KahluaTable - The arguments/data you want to pass to the server. Can be nil
So on the other side, you'd first use the Module string to check if the incoming ClientCommand is for you and then use the Command plus Arguments to call the specific function you want.
if i'm understanding this, first string is basically an ID and the second string is a function name, with the table being the parameters for said function?
Yes. You need to create a function that listens for the command and puts it together and calls it correctly.
that's how people use them, literally speaking they are just two strings that get passed from end to end
Imma sleep and try again when I get home from school
I've convinced myself we're never getting a TLOU overhaul mod for a very, very long time.
decided to continue work on water pipes mod that I dropped a few month ago and found this. mb in that time I didn't know premade func for it so my question is in pz really no shortcut for this shit ๐ฅด ? wtf.. tried to find smth on wiki or in source but nothing
Working on breaking down code blocks now...
Going to pause here for tonight.
About this i noticed on my reference the actual arg wasnt even used
Just the command and module
any clue why this doesn't actually calculate the weight properly? All i'm getting is one piece of scrap, although the input item has a weight of 3
--variable scrap amount
function Recipe.OnCreate.RecycleToScrapMetal(items, result, player)
local scrapQuantity = 0
for _, item in ipairs(items) do
scrapQuantity = scrapQuantity + (item:getRealWeight() * 2)
end
player:getInventory():AddItem("Base.ScrapMetal", scrapQuantity)
end
@stable flame
You can syntax highlight posted code.
Wait, are you confusing item weight with quantity?
Thinking that real weight is how heavy the item is and that AddItem's 2nd param might be an integer quantity.
Just a hunch.
hmm, was looking to transform the item weight into a quantity
aka its weight in scrap
public boolean AddItem(String type, float useDelta)
:getRealWeight at least exists? I can't even find it in pz source lul
there's a separate method for adding multiple items at once
declaration: package: zombie.inventory, class: ItemContainer
remember reading that getWeight() was deprecated and to use getRealWeight
strange then
๐ฅด
and i've finally solved my problem in mp
local ZedList = player:getCell():getZombieList()
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
print(zombie:
getOnlineID())
local x,y,z = player:getX(), player:getY() , player:getZ();
zombie:pathToLocationF(x, y ,z)
end```
now just need to add a Custom tag when spawning the zombies and only call those
I have this nasty habit of drilling on something and planning it well into the night.
(Read up)
oh fenris was around ๐
I saw but why :getRealWeight() doesn't declared as method
@red tiger youre nuts... all that work... jesus
Had to put the thought somewhere..
Planning phase for a new Lua transpiler.
well as long as it was productive, its a good thing ๐
I have a basic transpiler right now.. but I don't like it. It only exports definitions of arbitrary types.
The goal of this one is to be analytical and resolve types by combing code.
this deprecation notice is on ItemContainer, not InventoryItem?
hmmm i hiave a big problem... when i solve the problem i lose interest in finishing the simple parts of the solution...
need to create a table with the zombies spawned
and call those zombies only...
ill just grab the id and use that
easy enough i guess
hmmm i wonder
setWalkType(String string)
if i can make a zombie a runner in code
Oh God I really need to stop asking questions..
thats more asking me to have a nightmare...
ISUI... i hate it so much
ISUI is big enough to need guardrails and type safety.
tbh everything exposed to modding should have guardrails and type safety
50/50 ๐
well i made a zombie run and my game just froze ๐
ill think about it later... breakfast time
managed to crash the game now ๐
function Recipe.OnCreate.RecycleToScrapMetal(items, result, player)
local scrapQuantity = 0
for _, item in pairs(items) do
scrapQuantity = scrapQuantity + math.floor(item:getWeight() * 2)
end
player:getInventory():AddItem("Base.Scrap Metal", scrapQuantity)
end
it doesn't like the math
player:getInventory():AddItem("Base.Scrap Metal", scrapQuantity)
a white space in the item name?
opps, missed it
Starting to feel tired.
go rest
Doing IRL work work ATM.
ill only have to worry about IRL work next month
yeah... until the point that its 7 days a week with no days off till november ๐
sometimes its not the body but the brain that needs it more...
was stuck b4 sleep... i wake up and have the solution in my head
so i can say at least this time sleeping was productive ๐
still, not good for your health
Not wrong.
but i know how it is...
Oh well
i suffer from the same problem
even if i try to sleep and i have something thats bothering me that i want to find a solution
it will be more trying to sleep and coding in my head
than actually sleeping... so yeah... zombie mode and code away
Ever dreamed in code?
sometimes yeah
Ever remember it? Write it down?
when i was making my twitch api lib... that happened a lot
usually i wake up and just grab the laptop sitting next to me ๐
I've solved problems in my sleep. Fucking crazy stuff.
and type it away
Best ideas come when not actively thinking about them, aka while trying to sleep or on the can
There's thinking about the problem and there's actually following through with logic and literally coding it out in your sleep.
The latter one is terrifying.
toilet time is spent solving another problems... ๐
like actually thinking about my real work
and i have to get things ready... only 1 month to go and i've done nothing to setup the new work season
=/
ugh a simple idea turning into a full hour of trial and error ๐งจ , such is the modding life
lol
took me 3 days of messing around to figure out these damn light switches
then again i dont know shiat
speaking of which. what am i doing wrong here?
local context = ISWorldObjectContextMenu.createMenu(player, worldobjects, x, y)
context:setVisible(false)
it's working but it's throwing an error also
java.lang.RuntimeException: __add not defined for operands in get
im trying to just remove any context menu from when you are using the lightswitch
the error hits on the top line
Does anyone know how to get items to spawn on top of beds? I didn't see it in the distribution or ProceduralDistributions lua files. I noticed some mods before do it without having to edit the map itself.
So Albion pointed it out earlier but you might have missed it.
AddItem(...) will only ever add a single item
You need AddItems(...) for your scrapQuantity to have any purpose.
Had no idea that was a thing ๐
thought the quantity after is applied if specified
thank you for the tips
mb x or y is nil
why x is a table xp
using AddItemS actually returns nothing for me
wondering if i should replace for _, item in ipairs(items) with something like item:getType() and specify a list
Oh, yeah. That's a Java Arraylist that gets fed into the OnCreate call.
pairs and ipairs work on Lua Tables.
Need something like
local item = items:get(i);
if item:IsWeapon() then
condition = item:getCondition();
break;
end
end```
can i just use something like ISWorldObjectContextMenu.removeToolTip() joke lol it's easy to add or replace but i can not figure out how to remove
what r u even trying to do?
remove right click context from only on that sprite lol
so nothing happens when you right click it
then just do :setVisible(false) on parent context menu
why r u trying to create new one
i tried all different ways lol i couldnt find a good enough example to figure it out
derp brain i guess
crude example but I think u'll get the idea
local function a(context)
context:setVisible(false)
end
onfillworldcontextmenu.add(a)
Blech. Is there a consistent way to do damage to everything? Seems different objects have different functions to take damage, which seems wrong (if true, that's annoying). IsoObject and IsoMovingObject both have Hit, but this seems to be just part of the class definition and does nothing; only some objects define this (like IsoZombie). Other stuff like IsoObjects have just Damage(float) that I can call, and vehicles has hitVehicle(character, weapon)
Everything has the WeaponHit(weapon, character) function, but this only does the overwhelmingly helpful java code of:
}```
im using that. i have no idea what the parent menu is though.
try this one
local function onFillWorldObjectContextMenu(player, context, worldobjects)
context:setVisible(false)
end
Events.OnFillWorldObjectContextMenu.Add(onFillWorldObjectContextMenu)
here is what i'm using atm so it's not so hard to understand my usage
local spriteList = {"lighting_indoor_01_0", "lighting_indoor_01_1", "lighting_indoor_01_2", "lighting_indoor_01_3", "lighting_indoor_01_4", "lighting_indoor_01_5", "lighting_indoor_01_6", "lighting_indoor_01_7"}
local getSprite = getSprite
local ISWorldObjectContextMenu = ISWorldObjectContextMenu
local function hideBulb(player, worldobjects)
for i, spriteName in ipairs(spriteList) do
local sprite = getSprite(spriteName)
local prop = sprite:getProperties()
if not sprite then return end
if prop:Val("CustomName") == "Switch" then
local context = ISWorldObjectContextMenu.removetoolTip(player, worldobjects)
context:setVisible(false)
end
end
end
Events.OnFillWorldObjectContextMenu.Add(hideBulb)
also i'm sorry for burying your post @dark wedge ๐ฆ
local spriteList = {"lighting_indoor_01_0", "lighting_indoor_01_1", "lighting_indoor_01_2", "lighting_indoor_01_3", "lighting_indoor_01_4", "lighting_indoor_01_5", "lighting_indoor_01_6", "lighting_indoor_01_7"}
local getSprite = getSprite
local ISWorldObjectContextMenu = ISWorldObjectContextMenu
local function hideBulb(player, context, worldobjects)
for i, spriteName in ipairs(spriteList) do
local sprite = getSprite(spriteName)
local prop = sprite:getProperties()
if not sprite then return end
if prop:Val("CustomName") == "Switch" then
context:setVisible(false)
end
end
end
Events.OnFillWorldObjectContextMenu.Add(hideBulb)
u missed context arg
hideBulb(player, worldobjects) -- ur code
hideBulb(player, context, worldobjects) -- should be this
i think i did that and no luck ill try again
u need to hide context menu fully, right?
wdym?
player and worldobjects
no worries! i have a feeling the answer is "no" and just have to brute force it using the different ways. ha
idk how it should work
cos u always get hided context menu
u didn't use worldobjects arg
yea or player. i only did when i was defining context earlier
since we removed. no use
ngl sometimes i just dont even get this lol
i normally learn best this way but i'm struggling lol and thank you also
local spriteList = {"lighting_indoor_01_0", "lighting_indoor_01_1", "lighting_indoor_01_2", "lighting_indoor_01_3", "lighting_indoor_01_4", "lighting_indoor_01_5", "lighting_indoor_01_6", "lighting_indoor_01_7"}
local getSprite = getSprite
local function hideBulb(context)
for i, spriteName in ipairs(spriteList) do
local sprite = getSprite(spriteName)
local prop = sprite:getProperties()
if not sprite then return end
if prop:Val("CustomName") == "Switch" then
context:setVisible(false)
end
end
end
Events.OnFillWorldObjectContextMenu.Add(hideBulb)
`function: hideBulb -- file: testcontext.lua line # 9 | MOD: Lightswitch Electrician
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@d41fe7be
java.lang.RuntimeException: Object tried to call nil in hideBulb
i'm def not doing this right it feels
i have to be close
don't remove player arg
even if it's not used?
now context arg is a player
oh
i see so you can call it to be nil?
or it just always is 0
is the first always player?
yea
ah
okay i got it
no error but no work
gonna try a couple things here now
i think i am good for now lol thank you again.
nothing is safe anymore. ๐
well this kinda works
local ZedList = player:getCell():getZombieList()
local x,y,z = player:getX(), player:getY() , player:getZ();
local zedcount = 0
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
if zombie then
zedcount = zedcount +1
if zedcount < 10 then
zombie:pathToLocationF(x, y ,z);
end
end
end
player:Say(tostring(zedcount))```
nop...
guys can someone help me with this one pls
if getActivatedMods():contains("FunctionalChainsaw") then
require "Ftool_Actions"
end
if im making another mod thats named FunctionalChainsaw2
then woulding this get activated thing detect itself??
It should not return true because of "FunctionalChainsaw2".
contains should only be looking for exact matches, not partial matches.
Nice thank you.
I really thought it was a partial thing
Thnx
Im really confused right now like how do i create another version and prevent them from conflicting
FunctionalChainsaw2? 
One of my problem is the way i structure the first one
Ye about to make it
@tacit plover and i are almost done
just remake or new features?
finally... some results
local ZedList = player:getCell():getZombieList()
local TWESpawnedZeds = 4
local zedcount = 0
local totalzeds = ZedList:size()-1
player:Say("Total zeds: " .. tostring(totalzeds))
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
if zombie then
zedcount = zedcount +1
if zedcount < TWESpawnedZeds then
player:Say("Sending zed: " .. tostring(zedcount))
zombie:pathToLocationF(player:getX(),player:getY() ,0);
end
end
end```
Not really new feature
Ammm the thing im trying is that if the first version is installed then overwrite it
why 0 instead player:getZ()?
But then i realized my functions for the first one has 1k gas this one has 600
xp
Whatver ill nake the github for now public
well its working, if the value is set to 4 it will send 3 because of the for
the if i mean
while is <
missing a =
or just move the increment to be done after sending the zombie
either way works i guess
@jaunty marten
Congrats bro
Is that from chucks code
what?
The say ah nvm so its not. Hehe cuz its similar
im still a traitor since im using AUD and not chuck's tool ๐
but you remember why right?
i wonder if he already fixed it
and done
local ZedList = player:getCell():getZombieList()
local zedcount = 0
local totalzeds = ZedList:size()-1
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
if zombie then
zedcount = zedcount +1
if zedcount <= zedQ then
zombie:pathToLocationF(player:getX(),player:getY() ,0);
end
end
end
end
oops
not done
Im pretty sure he will fix it . Once hes set on a goal theres no stopping chuckGPT
need to fix the lazy part
z is 0
and also
replace the getplayer with vars...
so only one call is made to the instance
b4 someone kicks my ass for bad coding habits ๐
local ZedList = player:getCell():getZombieList()
local zedcount = 0
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
if zombie then
zedcount = zedcount +1
if zedcount <= zedQ then
zombie:pathToLocationF(x,y,z);
end
end
end
end```
is this good enough or can i improve it sill?
local sourceId = source:getOnlineID();
local x = source:getX()
local y = source:getY()
local z = source:getZ()
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", args.ZedX,args.ZedY)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(args.ZedX, args.ZedY, x, y, args.ZedQ)
ZedsToPlayer(source,args.ZedQ,x,y,z)
end
done i hope
now the car alarms ....
hmmm, trying to do my mod better and have question is there any way to merge two textures in single one in kahlua? I need to set a few sprites on object and currently uses just :SetSprite and :SetOverlaySprite so I have only 2 slots for textures, it's fine for now but I'll need more in future. I can't merge them manually cos it's 16 * 2 * 2 = 64 extra textures and that's not final count => it's too shitty way. I'm sure for 99% pz can't provide feature to merge textures but... maybe? 
i remember chuck had a trick for the alpha that could possible be of use to you for what you want to do
something about the overlay of 2 textures and mixing cant quite remember
@sour island I'm begging you, please tell me I can do this in pz
will this work?
Events.OnPlayerUpdate.Add(function(player)
if player:isAiming()
player:nullifyAiming()
getCore():setOptionAimOutline(false)
end
end)
removing the aim outline?
or stoping him from aiming?!
i saw something similar in britas or arsenal
i think
Removing the outline
Idk what nullifyaiming is
Maybe its the red version of the aim
But idont care abt that i care more abt the aimoutline
Also how do i remove that option from the settings
Just spawn another instance of sprite overlay
I did this for one of my mod
wdym?
You want them to look merge but you can always out stuff on top if each other
Basically having infinite layers
how to do it? setSprite or setOverlaySprite accepts only 1 arg > sprite_obj, there's no such arg for layer num
yeah from what im seeing in another mod, it resets the aiming
hello. was making a car mod and keep running into code related issues, basically what i've done here is added a bodywork part that does not exist in vanilla (front bumper) and wanted to make it detachable. First of all, part does not appear when i spawn the car, second, it does exist in the mech. overlay, third, when i'm trying to install it it gives me this issue (getDisplayName() of non table). Also when clicking on "install" local it also gives me two errors (getDisplayName() of non table and getType of non table). Screenshots attached.
I suspect that the game does not consider this as a part, but clueless on how to fix it
This issue bugs me for a couple of days now and i will be very grateful if someone gives me a clue on how to fix this
Show your code
No problem, but which code exactly?
How you spawned the car
spawned using a debug menue
Ow so youre not developing a mod?
by that you mean?
#1019767076094758924
โ๏ธ
youll need to overwrite the code of the car for that to work
and add the part location
mmm its not related to the pz assets, it is my asset that i want to integrate and am miserable at
dunno if you can do that with scripting or if youll actually need to code it in lua
This is the comms for modders who authors mod.
Idk how to help you if its not mod related tbh even if i wanted too. But i think the debug menu isnt really spawning the vehicle its just client sided
Then heres the part i will attempt to make change your code but since you arent writting any
.im lost as to what to do
Nit being rude or anything just pointing you the right direction thats all
vehicle modding has scripting part, which should be all set and lua part, which i have no major experience at and suspect as a potential issue
dont suspect it is the reason
you cant just add parts to the car
youll need to alter the code to accept the new part
in theory youll have to overwrite the default code for the car
and add in the bits and pieces youll need to add a bumper
in theory yes, but making it work is a whole other problem
you should check the modding guide
i think theres something there about modeling
a sec ill check
Show the code
there are vehicle mods that utilise custom parts such as armor and they do have additional lua code
Ownroght its just script nvm sorry
yeah thats the reason why they have it
since the base car has no way to atach the new parts
they rewrote the code to allow it
Amm debug doesnt work wait let me give you a piece of code that will actually spawn
=-y
i think a good mod for you to have a look inside would be the workshop
have a look inside the code of this mod https://steamcommunity.com/sharedfiles/filedetails/?id=2680473910&searchtext=workshop
i bet you can get a pretty good idea of what you have to do from the code they use
plocal spawnV = "Base.Car2"
local command = "/addvehicle ".. spawnV .. ' '.. tostring(getPlayer():getUsername())
SendCommandToServer(command)
function randV()
local scripts = getScriptManager():getAllVehicleScripts()
local allV = scripts:size()+1
local randV = ZombRand(1, allV)
local randM = scripts:get(randV):getModule():getName()
local randN = scripts:get(randV):getName()
local spawnV = randM..'.'..randN
local command = "/addvehicle ".. spawnV .. ' '.. tostring(getPlayer():getUsername())
SendCommandToServer(command)
end
randV()
and for the car itself check https://steamcommunity.com/sharedfiles/filedetails/?id=2926401528
anyway i think youll have better luck asking the #modeling chat
im really lost and confused idont understand the problem or youdont understand whats going on...
first you said non table
and mentioned vehicle parts...
its non exsitent which is why the part never exist cuz the car doesnt exist
try to spawn a regular thing then try again
also what did you do to get the error
you should have a code or script or a mod you are working on right
anything will help pinpoint the problem and we can provide solution if we know the answer
oke thanks, not really sure how to use it as i am a doughnut in coding which i apologise for
now about that
the car itself does exist (dont mind the mask), was spaund through the debug menue
the basic are put together as a set of scripts
this part is pretty much based on vanilla
then cars have the lua folder, where mainly their distribution zones, mechanics overlay and translation names are defined
but now it seems that for custom parts this is not enough
the error is triggered upon installing the front bumper
can u show the code how u did it?
thanks for the links, will check how they put it together
Im not particularly experienced with car modding
You should probably wait for others to help u...i thought issue was spawnning vehicle
yeah, i was doubting that this thread is the most appropriate, but as it is code related i decided to post it here
thanks for the help anyways, will check out those two mods linked above and figure something out
What m3ss is telling you to with them is to actually use it as reference
I know, thats how i learned the basics aswell, hopefully it will help
performance wise alone it's probably better to make these outside of PZ
try to automated the process the best you can
especially if you're trying to add on more than just 1 texture - and if I understand you're trying to add 64 textures??
The trick mentioned that I use is in photoshop and it's for nicer looking recolors
I manually separate the elements and just change each one to a different combo of colors - for anyone curious
There's probably a way to automate what you're doing - but it should be done once
outside of PZ if possible - that'd be my advice
yea, manually made fine for this but I need it for other way
What are you trying to merge exactly?
I know recoloring textures makes them look bad and overlays are a better way to keep consistency
basically I need to merge pieces of these images
?
sec
as I said it's too much to merge all of it by photoshop
i created a photoshop acttion forre sizing to icon sizess
you just have to select the thing then press the action
since chuck mentioned automate
each water pipe type (WaterPipe_*) can have one of 3 green dot types
rn it's fine cos I'm using setSprite for water pipe and setOverlaySprite for dots
but it's shit cos idk what to do if I'll need 3rd slot for some image
plumbing mod?
and I want to find some way to merge 2 sprites in single
yeah
all of these
add another obj?
and you cant make like pre merged stuff
thats what i was saying
probably not an option for him
it's just a crutch
like and current state with :setOverlaySprite
there will be so much textures then
16 * (2 ^ 3)
ye if you cant find a way to then thats just one option
seems now I remember why I dropped this mod..
cant you
setOverlaySprite = {"a","b","c"}
never messed around with that kind of mod
crutch?
(shitty way)
overlaysprite only just a string
already changed source
and setSprite and setOverlaySprite
we do lots of shitty stuff anyways .. besides youre building an irrigation mod so time to get your hands dirty ๐ฉ
I mean that's what vanilla does and mapping, they put more objects to combine them where necessary.
whats the easiest way to get a cell from xy?
yep

huh?
ISA uses combo overlays to be honest. Merged out of game.
if the pipes are isoObjects you can attach IsoSprites to it
Like the floor erosion, sounds good idea.
they could added some way to merge in-game and just don't use it
merging images in game is very costly tho
if do it each frame xp
even adding IsoSprites on top of an IsoObject is somewhat a costly approach
it should merge 2 textures in single one and it will be basic texture so it's -0% to performance
if there's any way
Yes, but if that becomes a norm you'd get longer bootup times
cause your game is merging textures
you should be able to add sprites onto isoObject though
it have to just override bytecode of texture by bytecode of another one, not so hard thing
That's a good idea, gonna test this and make the Battery Bank an IsoGenerator with attached sprites, new incompatible version incoming ๐
maybe there's way to get bytecode of texture and set it so I can override one manually..
Are you trying to add these to an item icon?
just found IsoSpriteGrid, idk what is that but seems it not for me
like in inventory? I assumed based on the art it was on the grid
do u mean these?
local function applySpriteToObject(sprite, isoObject)
if not isoObject:getAttachedAnimSprite() then
isoObject:setAttachedAnimSprite(ArrayList.new(4))
end
---@type IsoSprite
local isoSprite = getSprite(sprite)
isoSprite:setName(sprite)
---@type IsoSpriteInstance
local isoSpriteInstance = IsoSpriteInstance.get(isoSprite)
---@type ArrayList
local isoObjectAttachedAnimSprite = isoObject:getAttachedAnimSprite()
if isoObjectAttachedAnimSprite then
isoObjectAttachedAnimSprite:add(isoSpriteInstance)
return isoSpriteInstance
end
end
sprite is a string of the texture
so by this code u can free applied a few textures to object, right?
you'll have to make these into sprites like for mapping
I've added 3-4 sprites over every tile for the load tests
it lagged when teleporting and stuttered a bit when walking
but that was every single tile on every z
cool, thanks 
now I have sense to complete this mod
local sourceId = source:getOnlineID();
local x = source:getX()
local y = source:getY()
local z = source:getZ()
local ZedList = player:getCell():getZombieList()
if ZedList then
zombie = ZedList:get(0)
if zombie then
x = zombie:getX()
y = zombie.getY()
z = zombie.getZ()
end
end
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", args.ZedX,args.ZedY)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(args.ZedX, args.ZedY, x, y, args.ZedQ)
ZedsToPlayer(source,args.ZedQ,x,y,z)
end
``` thinking about the zombie spawning... do you guys think this would be viable?
its wrong... correcting it...
btw just found another interesting thing https://projectzomboid.com/modding/zombie/core/textures/SmartTexture.html
declaration: package: zombie.core.textures, class: SmartTexture
feels gotcha
nil 
ok i think i've got it
local sourceId = source:getOnlineID();
local x = source:getX()
local y = source:getY()
local z = source:getZ()
local zombie = nill
local ZedList = source:getCell():getZombieList() -- get zombies in the cell
if ZedList then -- if no zombie was found values are kept from source
zombie = ZedList:get(0) -- get first zombie found
if zombie then
args.ZedX = zombie:getX() -- set the spawn for the existing zombie x and y
args.ZedY = zombie:getY()
end
end
print("Zedspawn [".. sourceId .."] quant: ", ZedQ)
print("Zedspawn [".. sourceId .."] XY: ", args.ZedX,args.ZedY)
print("Zedspawn [".. sourceId .."] PlayerXY: ", source:getX(),source:getY())
createHordeFromTo(args.ZedX, args.ZedY, x, y, args.ZedQ)
ZedsToPlayer(zombie,args.ZedQ,x,y,z)
end
function ZedsToPlayer(source,zedQ,x,y,z)
local ZedList = source:getCell():getZombieList()
local zedcount = 0
for i=0, ZedList:size()-1 do
local zombie = ZedList:get(i);
if zombie then
zedcount = zedcount +1
if zedcount <= zedQ then
zombie:pathToLocationF(x,y,z);
end
end
end
end```
dont see anything else wrong... but i never do.... ๐
your indentation is all kinds of fucked up, but beyond that I don't see anything too egregious at first glance
hey just wanted to know that that i decide to make assets for PZ, like the shelfs or something, or maybe long blunt or short blunt weapons, then do i need to know coding? and from where should i start to make these? i purchased the game last week.., i am an 3D Environment Artist, but wanted to know how can i make stuffs..
any tutorials or guidance should work ig..
it always is until i clean the code ๐
that should help you get started
ohh okay, thanks, i will check it out
Wait what?!
Wizardry
nah, just picked apart the rendering system - I still don't know why that list needs a define of 4
well the spawning location is working
but the zombies dont move to the player
god dang it it worked when i tried b4 adding it to the mod
....
do u mean with >4 it won't work?
you can add as many as you want
is it a minimum of 4?
it's an empty array
How many tile variation is it that you need exactly
but the java sets it size to 4
I worked on this in august
I recall it refusing to work
i know it's an empty array, but if won't work with any values less than 4, it could be that it's just representing a word (4 bytes)
not a "word" as in the language sense, but a word as in... the programming sense
ah
most values in the engine are going to be 32 bits, and there's 8 bits to a byte
so 32/8 = 4
just a guess though, I don't know if that's actually what's going on in that case
so the first 4 are maybe an id of sorts?
cause you can add onto it
as many sprites as you want
could be, yeah. does the java version assign a type to it?
that'd be telling. if it's an int, or an array of 4 bytes, then you're probably right that it's an ID
if it's a string that'll be weird - because that'd be an array of 4 characters most likely, and I can't think of any reason you'd have a 4-length string in there. but who knows
still weird that it'd pass that way instead of just using the type directly though. maybe something to do with allocation, idk
if (!StringUtils.isNullOrWhitespace(var3)) {
if (var1.AttachedAnimSprite == null) {
var1.AttachedAnimSprite = new ArrayList(4);
}
IsoSprite var11 = IsoSpriteManager.instance.getSprite(var3);
var11.name = var3;
IsoSpriteInstance var12 = IsoSpriteInstance.get(var11);
if (var7 > 0.0F) {
var12.tintr = var4;
var12.tintg = var5;
var12.tintb = var6;
var12.alpha = var7;
}
var12.bCopyTargetAlpha = false;
var12.bMultiplyObjectAlpha = true;
var1.AttachedAnimSprite.add(var12);
}
trying to remember how my water pipes mod is working
this is where I got it from
public void updateTileOverlaySprite(IsoObject var1) {
if (var1 != null) {
IsoGridSquare var2 = var1.getSquare();
if (var2 != null) {
String var3 = null;
float var4 = -1.0F;
float var5 = -1.0F;
float var6 = -1.0F;
float var7 = -1.0F;
if (var1.sprite != null && var1.sprite.name != null) {
TileOverlays.TileOverlay var8 = (TileOverlays.TileOverlay)overlayMap.get(var1.sprite.name);
if (var8 != null) {
String var9 = "other";
if (var2.getRoom() != null) {
var9 = var2.getRoom().getName();
}
TileOverlays.TileOverlayEntry var10 = var8.pickRandom(var9, var2);
if (var10 == null) {
var10 = var8.pickRandom("other", var2);
}
if (var10 != null) {
if (var10.usage.bTableTop && this.hasObjectOnTop(var1)) {
return;
}
var3 = var10.pickRandom(var2.x, var2.y, var2.z);
if (var10.usage.alpha >= 0.0F) {
var6 = 1.0F;
var5 = 1.0F;
var4 = 1.0F;
var7 = var10.usage.alpha;
}
}
}
}
if (!StringUtils.isNullOrWhitespace(var3) && !GameServer.bServer && Texture.getSharedTexture(var3) == null) {
var3 = null;
}
...
}
}
}
it seems to use this field and give it a list of 4 entries
often
if you use add() on an array[4] and it's empty does it fill 1 or 5?
r u talking about bytes
meanwhile in tis: hmmm, I think 4 sprites will be enough
int var4 = this.AttachedAnimSprite.size() > 255 ? 255 : this.AttachedAnimSprite.size();
if (var4 != 1) {
var1.put((byte)var4);
}
uses it's size as a byte
yup there's the byte type I was assuming was there, although it's still a little vague where that goes exactly. I'd say that's the case though
what's the thing it's casting to byte there, var4?
oh wait it's defined there i'm blind

so either 255 or the size, whichever is larger
I don't really understand bytes - if I can keep adding more sprites how does the list's length work as a byte?
it is like a hash - that a certain combination of sprites makes the same byte or?
it's basically saying the maximum size of the list is the size of byte
which is 255
so you can have 255 sprites, max
smaller?
ok
too little 
that's just for 1 object
for one object
you can have as many objects on the tile you want friend
I discussed sth here before, regarding picking a random item from a json file and using it in my script. I was told it's a bad way, especially wen it comes to translating those items, and that I already have the built-in method, translations. So, my question is, assuming I have a JSON file that consists of something like:
{
"stories": [
{
"title": "Story 1",
"content": "Story 1 Content"
},
{
"title": "Story 2",
"content": "Story 2 Content"
},
{
"title": "Story 3",
"content": "Story 3 Content"
},
{
"title": "Story 4",
"content": "Story 4 Content"
}
]
}```
How do I use such form in the translations files, to be able to pick one random item from it?
It looks like blood uses this system?
floor grime does too
i thought objects were limited to one per tile?
as does erosion to some extent
yeah they're attached sprites, the map uses them extensively. basically anything that uses the "Overlay" tile property
how do u will to translate it..
I think there's a limit on mapobjects but I can see with my inspector there's multiple isoObjects on the same tile usually 2-3
oh yeah, IsoObject is just anything
@quasi kernel didnt you make a farming framework? Can you share link so can add to the compiled stuff thx
the player is an IsoObject technically
as are sprites
you could technically attach a sprite to a sprite ???
in this case, it's attached sprites - which apply to map tiles, more or less
you can't attach these to just anything
oh
well that's exactly what I am asking about. How do I transform that "form" to a something usable in the translations, is it at all possible?
public void updateTileOverlaySprite(IsoObject var1) { ?
they're specifically for the map tiles (although maybe you could attach them to other stuff? I don't know why you'd want to, but maybe you could find a way to do it)
there's a lot of map objects you can place together
could be - I've mostly worked with them in the context of the map binaries and mapping tools, haven't looked at the code related to them other than when the binaries are parsed
if he will response to u can u share it me too? mb will something useful for my mod for irrigate plants and etc
depends on what you mean by map objects. the "Map Object" proper can only have one per tile, i.e. IsoGenerator
in json use id from translated file
because like, I can have the translations file in the way of:
Stories_EN = {
Stories_Story1 = "Content 1",
Stories_Story2 = "Content 2",
}```
How do I pick from them randomly? How do I adjust that to have a title for each one?
oh
maybe I don't understand why we mix map objects and attached anim sprites
because they're two different things
you said map objects
right, but we're talking about attached sprites via tile overlays
Sure man
the attachedSprites thing is under IsoObjects
not true, you can have multiple walls, crates, etc
none of which are Map Objects
I'd be inclined to think you can add overlay to mapobjects or maybe anything
let me try to add an overlay to myself
I don't understand you. mentioned a generator

These an animated sprite thing on the docs right
I always thought it was used for campfire, tv, water smoke
campfire is a mapobject too
yup
I think furniture are as well(?)
You have a lost of these things right
so are walls, crates, etc
not as far as I'm aware
nope
walls are not unless player built
yes
walls most definitely are not
it certainly feels like 2 systems cobbled together
you can only have one on each tile, but I don't believe they derive from the mapobject class or whatever properties that make them into the proper mapobject
this again, are you talking about global objects maybe?

there's a global list called mapobjects
yeah it's weird
i haven't looked at them in a hot minute so I couldn't tell you the details off the top of my head
but more or less - to get back to the original thing - tile properties determine what can/can't be placed in certain arrangements
overlays = attachedSprite = get placed on the tile, in a layer arrangement
I'm not even sure if we talk about map or world here.
you can have any number of sprites on a tile up to 255, but there can only be one "floor" at the base, and it has to have a floor tile property
and mapobjects manipulate the properties too I recall
I think that's what they're essence is(?)
walls/floors are tiles
their sprites get structured together to give the tile it's property
Only java mapobjects I see, is the one similar to events. That triggers funtions.
Questionn
Theres a thing called remove everything but floor
but you can also slap a mapobject like a door on it and the tile will read it from what I recall (?)
nah, tile properties are defined in the... well, tile properties. it's a whole binary that's basically a config for each sprite.
What does it do exactly like does it delete zeds items corpse or are we talking abt just tiles
sprites definitely have their own properties that match tile's though
I recall that from the biome code
that's likely in the context of tile sprites, for the map. it'd remove any attached sprites or other tiles on each layer except for 0 (the floor)
those are one and the same, more or less - I've seen tile and sprite used interchangably
Cool
You make the whole place clean like that
So what if
getCell()
Then do that
I think it's amalgamated
It will remove everything will it remove floors above
they're referred to as flags
the way I tend to think of it is that the sprite is just the base image, cut from the spritesheet. the "tile" would include that sprite, as well as the tile properties that are associated with that sprite, to form the tile object
and yeah tile properties are mostly flags
there's a few that are actual strings and such, but like 90% of them are flags
Pretty logical
So everything you see that involves tiles are tileobj? Or not all
isoSprite carries tile properties
Is there
if instanceof(obj, "IsoTileObject") then
putting them together gives the tile the combination of their properties
I doubt
you can just do typeof() I'm pretty sure, or maybe type() i forget
i don't recall
the sprites are added to the square
I think what we are discussing right now is something any mapper should know
Crater is a mapper
IsoGridSquare
a tile is the map part, not world part. In-game they are isoObjects, etc
But everything else are considered isoObj right
okay I think I figured out the confusion - "tile" is more or less a term used in the mapping tools' code, so I'm accidentally confusing everyone
pretty sure chuck is right that they're just IsoSprite in the game though
local specialOverrideExceptions = {"IsoCurtain","IsoDoor","IsoWindow","IsoBarricade","IsoLightSwitch"}
---Vanilla has a getFloor but it causes layering issues if there's objects over the floor - like walls
---@param isoGridSquare IsoGridSquare
local function ifFlagTypeGetObject(isoGridSquare, isoFlagType)
local isoObjects = isoGridSquare:getObjects()
local objWithFlagFound
local lastSpriteObject
if isoFlagType == IsoFlagType.solidfloor and isoGridSquare:getProperties():Is("BlocksPlacement") then return end
for i=0, isoObjects:size()-1 do
---@type IsoObject
local isoObj = isoObjects:get(i)
if isoObj then
local isoObjSprite = isoObj:getSprite()
local isoObjSpriteName = isoObjSprite:getName()
if isoObjSprite and isoObjSpriteName then
if isoObj:getType()==IsoObjectType.wall and string.find(isoObjSpriteName, "roofs") then
else
if isoObjSprite:getProperties():Is(isoFlagType) then
objWithFlagFound = true
lastSpriteObject = i
end
if objWithFlagFound then
if (not isoGridSquare:getProperties():Is("IsMoveAble")) then
lastSpriteObject = i
end
for _,type in pairs(specialOverrideExceptions) do
if instanceof(isoObj, type) then
lastSpriteObject = i
end
end
end
end
end
end
end
if objWithFlagFound and lastSpriteObject then
return isoObjects:get(lastSpriteObject)
end
end
yeah tileobject is not real thing in-game
Other part of that biome code
the game does use "tile" in a bunch of function names but it's likely a later-dev term
this was to... uh... grab the last sprite layer but avoid certain issues with layering
Then im also confused about thumpables
I thought thump are those with hp
But then light swwitch are also thump
thumpables are the closest to match 'mapobjects' in java
to clear things up a bit: it goes IsoCell->IsoChunk->IsoGridSquare->IsoSprite
there's only 1 IsoGridSquare at each coordinate on the map, on each vertical Z level
Map obj are those with globals right? I missed this part earlier maybe i should read again
Why are we adding new names (mapobjects)?
but yeah Chuck that's good, I was starting to suspect mapobjects were a Lua thing
I believe mapobjects referenced = thumpables
they're a lua thing (MOGenerator)
yeah same LOL
MapObjects is a system similar to events
Of someone could write all the iso
stop confusing people
mapbject events?
yeah, you set a spritename and a function and it gets called from java
Reason why mentioned global was cuz i saw s panel with global objects and it links to campfire traps and water barrel
I don't follow- what does it do?
calls your function
I'm on mobile so bear with me.
MapObjects.OnLoadWithSprite("sprite",myFunc,5)
I feel like i'm being mandela effected but I guess it wasn't mapobjects but 'worldobjects' ?
Lua refers to IsoXYZ as worldobjects
when the game load an object with spritename "sprite" it will call myFunc with the object as argument.
also not all IsoXYZ that goes on the world are thumpable
IsoGenerator isn't - not sure if light switch would be
public class IsoLightSwitch extends IsoObject { it's not
thump = can be thumped lol
things loaded from map aren't usually thumpable. There's not such option to set either(?).
Placing objects has that option.
map tiles have properties for that
it's how counters and walls work
Nurver made countertops hoppable for instance
those are not thumpable though when they load from map?
they're not IsoThumpable but they have thumpabale flags iirc
not same thing
What's the way to make your mod easily translatable? i.e. How do you use the lua/shared/Translate/[language code]/*.txt files
I see they're stringtables. But I can't find any of the keys anywhere, if I look at mods that use them. Like looking at the More Skill Books mod, it has keys in those txt files like DisplayName_Sneaking_for_Beginners and the MoreDescriptionForMoodles has like... Moodles_endurance_desc_lvl1 but those keys don't appear to be present anywhere in the mod's other files. I assumed maybe they're dynamically generated so I searched for things like _desc_ to try and find that but no dice. So! I am here to ask for one (1) halp.
I was tying to bridge the lua term (which I misrecalled) to the java terminology
there isn't really a class for "worldobjects" other than just IsoObject
Hi! About what discussion here?
getText(Ui_Something)
look for getText, it's how you get translated strings. Things that are auto translated follow different logics sometimes.
Aha, thank you both
example: HaloTextHelper.addTextWithArrow(playerChar, getText("UI_trait_"..TWETraitsTable[MyTrait]), true, HaloTextHelper.getColorGreen())
yeah, they all derive from IsoObject (but then again, what doesn't? lol)
the _ disappears ?
oh actually, I should clarify: IsoCell, IsoChunk, etc. are not IsoObject
they're just normal Java objects
It's the symbol for italics in Discord
I am just trying to get the terminology straight. So people like me don't get more confused than they need to be, and maybe explain something.
and it will replace that with the text
I guess the current discussion is about what lua refers to as 'worldobjects' and how they relate to IsoDoor and those specific classes
the context menu pulls all the isoObjects I believe
Is there any set naming scheme for the *.txt files in the Translate folders?
so "worldobjects" are just IsoObjects in the world... lol
yup there is
EN for english, etc
if I use my inspect tool
Or can they be whatever? And the name for the object in that file, since it appears to be like ...
Going back to the MoreDescriptionForMoodles, theirs is Moodles_EN = { ... stringtable ...}
i think its on the modding wiki
shows the isobojects on each tile under context menu
Oh, no I know that part, I mean about the .txt files though
pls no "mapobjects" I asked already and you have no clear definition for that.
the name or the content of the files?
Well, both, really.
sorry worldobjects*
the files on the wiki theres a table with all the languages
idk why I can swear it was called mapobjects in lua....
the files its usually ( EN for example )
UI_optionscreen_binding_STATSPZ = "Twitch Game Stats",
UI_TwitchInGameWindow_status = "Ingame Stats Window",
UI_Zkills = "Zombie Kills",
UI_AliveFor ="Time Alive",
UI_optionscreen_binding_STATSPZToggle = "Game Window Key",
UI_TwitchStatsTitle = "Game Stats"
}```
It just makes harder to explain things and confuses people ๐ฆ
inside the UI_EN you use the naming you want... thats just from one of my mods
the file i have for PTBR
UI_optionscreen_binding_STATSPZ = "Twitch Game Stats",
UI_TwitchInGameWindow_status = "Janela de Stats no jogo",
UI_Zkills = "Zombie Mortos",
UI_AliveFor ="Tempo Vivo",
UI_TwitchStatsTitle = "Game Stats"
}```
Oh I started using it for shops
ah that's probably where I got the term from baked into my brain
But I can name the text files whatever? And the name of that table whatever?
Like, a name of MyMod_EN.txt is fine? And the name of the table in the mod, you have UI_EN there, is that important?
Or does the java just load every .txt file in this folder, and parse the table out of it regardless of name?
Is it important that the table have a specific name? Like the UI_PTBR? Or could you have used UI_Whatever, as long as you were consistent
If you mean WorldContextMenu, then here how they choose:
what's the shortcut for en mass text replace
Oh I see. I should probably get the filenames and table names from: https://github.com/TheIndieStone/ProjectZomboidTranslations
ctrl+shift+H
if you mean within the file, just ctrl+H
yup thats why i said to check the modding wiki
is there a reason why the createhordefromto() doesnt work in mp?
it's ok to call things anything you want but for explaining it's best to use common terms. So if it has a well defined name already, use that to communicate.
CTRL + r
I made a documentary of my journey of self discovery
Apologies for the pausing - my brain was turning gears when I realized when and why I made the mistake
well I'm going to run, have fun
(this is the use case I mentioned to you btw, Aiteron - createHordeFromTo directly calls the native n_spawnhorde)
when using emmylua to type path it auto compelted WorldObjects at one point
and it stuck ever since 

i tried another solution but for some reason it doesnt work all the time
yeah. I talked to Aiteron about getting docs for the native C/C++ libraries, based on that use case
(and a few others, but yeah)
the wall of code i posted b4

