#mod_development
1 messages ยท Page 122 of 1
aside from not being dark mode i dont see anything else wrong with it
Sounds like me being 30 y.o.
shout out and thank you to @ancient grail and @sour island for the continued support ! โค๏ธ (and the others ive missed ofc)
Anyone know how to have the character twoHand an item ... I have him equip a barbell as 2 handed, they fill both slots. but in my custom animation he still has it linked to 1 hand only...
it will only like to the main hand if you set it to 2 handed.
you have to make sure the animation uses the item right\
so its making sure the animation is pixel perfect ?
Do any of y'all know how one might increase the hair growth speed?
i would LOVE for you to be able to actually attach items to hands.but it dont do that
Wondering where I could find the code for it
Well , Foook ๐ this gonna be fun xD its like slightly off from the anim.-_-
lol it sucks. sooo bad.
kinda why i am taking a break from the carry mod.
that and it's down to things that would be quite difficult to redo.
is it wrong when i know why something doesnt work but stall for time to charge more because the guy is a douche who thinks he knows everything?
๐
specially when he makes me work on the weekend ...
tbh im following the procedures he told me to be the reason of the problem... which they arent
Hi @pulsar heath , i think this should help you out ๐
If (customer.IsDouche)
bill.rate = bill.rate * 1.5:
End
๐
you're a car mechanic ?
its an app, to manage subs in a media group i made like 10 years ago
was hired by my "replacement" after i left the company
xD wow , kinda funny
i tend not to stay more than 4 years in the same place
it gets boring and i dont like boring stuff
Also stopped me in dual wielding animations. @cunning kestrel
Got so tedious
Felt like the equivalent of needing to reset joypad focus every time I press a button on joypad
talking about tedious... still need to finish the GUI for the integration app
the code is done... but the gui... i hate coding gui's
the IK animations thing... i just attached the hands to the item.
If implementing gamepad support were as unnecessarily tedious as animating weapon motions, I never would've bothered lol
i know it's not GOOD, but it worked.
lol i know. the postal truck has the GOOFIEST error.
did this aswel, but this doesnt make it match up with the second hand though ๐
and i can't figure out what it is.
thats tied to game time, dunno if there is a way to manipulate game time on just a player or object
what error does it have?
YUP
welcome to MY hell.
Try it with another car?
so the problem is on the car object itself
perhaps the script for the mail truck
have you tried with only vanila cars?
ah looks fun
No worries!
hmmm the state of the window is overwritting the state of the door
what makes no sense is why is just says screw this and changes what animation is used
but ONLY if you exit the vehicle with the window down
What finger print is doing is decorating the exposed method
hmm through some checks for the door state and window state
grabbing the provided params and changing the text provided to include the coroutine stack
and see what you get
which is how the base game gets info for stack traces - how it shows file names, functions and lines
the most logical thing i see is that when the window is open the door object that contains the window becomes the window
technically finger print could include file name too - but I thought that'd make it less readable
The coroutine stack is what I'm interested in, I need to be able to get a mod name from the currently running file.
Well, running context moreso.
that's what this does
Is there anything I'd need to do to fetch the mod name specifically or is it just a few code edits?
Like I don't mind any of the other data
Only interested in the mod name.
Assuming it'll even work for what I'm thinking about doing-
well almost xD
Getting there!
local coroutine = getCurrentCoroutine()
local count = getCallframeTop(coroutine)
local modID
for i= count - 1, 0, -1 do
local o = getCoroutineCallframeStack(coroutine,i)
if o ~= nil then
local modFileFunctionLine = KahluaUtil.rawTostring2(o)
if modFileFunctionLine then
local modFile = modFileFunctionLine:match(".* | MOD: (.*)")
if modFile and modFile~="<THIS VERY MOD>" then
modID = modFile
end
end
end
end
This is what I do for finger print
getting it to line up in the main hand is the thing. then it's just make the offhand follow.
inserting this into a function should call on the call stack
@faint jewel make a print to the console everytime you open the door with the result for getPassengerDoor findWindow isopen
maybe that will give a clue of why it happens
this only returns the last modID though
and ignores the last one which is fingerPrint
it has NO lua.
only scripting?
I do have a question, though. What mod do you figure it would read from in a metatable context?
you should add some lua to track the issues at least
and i think youll probably need to use some lua code to prevent that from happening
I used the decompiled code and looking around how the f11 screen works
vehicle mods only need lua for distribution.
I'm wanting to convert farmingconf.props and similar tables into metatables so I can "hook in" when data is added / changed.
Idea behind it is I can automate scraping data from farming mods and just cram it all into one large data set.
oh
do you have the mod on the workshop already? ill have a look and mess around with lua to try and figure out whats happening and maybe provide a fix using lua
it is not yet
can you zip it and send it to me?
I need to know what mod the specific run context is in though, because otherwise I'm unsure if this'll work.
lunch break i can have some fun trying to help you
Unless there's some fancy way to determine what the currently loading mod is.
This is only needed on initial startup when the mods are loading, nothing else.
You need to confirm the loading mod is a specific mod?
im lazy detecting running mods... i do it the bad way and look for a global the mod creates
I need to try and dynamically determine what mod is currently changing the table data so I can assign it a place in the dictionary appropriately
there is always a global somwhere ๐
thats what i did with my stats mod... to check if killcount is installed and enabled
@LuaMethod(
name = "toggleModActive",
global = true
)
public static void toggleModActive(ChooseGameInfo.Mod var0, boolean var1) {
String var2 = var0.getDir();
if (!StringUtils.isNullOrWhitespace(var0.getId())) {
var2 = var0.getId();
}
ActiveMods.getById("default").setModActive(var2, var1);
}
and it runs fine... and dynamicly changes the dataset used in the stats if the mod is loaded

I would assume the UI calls on it
Only thing is, would this be a problem in multiplayer?
What exactly are you trying to do?
dont think so, since the player is forced to use the same mods the server has
I need to detect changing to farmingconf.props / sprites and the like to try and "preserve" data in between farming mods.
The problem is that farming mods like Soul Filchers and Mo Crops implement the same crops.
I feel like we've spoken about this ...
This is for item scripts I presume?
You mean item scripts as in the funny item creation via the scripts folder stuff?
I mean, the crops being overwritten and the issue lies in items behaving funny?
The items technically work fine, I found a solution to that in my patch.
It just overwrites the seed data too when it changed crop data.
..which means you can get seeds for a crop you can't plant with said seeds.
This was addressed by associating different seeds with the same end crop in manual data entry, but I want to get away from that method if at all possible.
I'm not familiar enough with the farming system to know how seeds work - I would presume the seed items have an intended plant in script? or does it just operate off name?
More like the plants have an intended seed.
Farming data has a seed name variable that it relies on.
The actual item itself isn't that interesting.
I could plant freaking dog leashes for all I care, as long as the plant requires it.
What file are these crop seed definitions?
farmingconf.lua I think?
Something along those lines.
I'm not at my computer at this exact moment but I can get on if need be
It could be vegetableconf
I just know it's something like that on the server side.
farming_vegetableconf.props["Strawberry plant"].vegetableName = "farming.Strewberrie";
farming_vegetableconf.props["Strawberry plant"].seedName = "farming.StrewberrieSeed";
so each mod does this?
You could create a function with a require for each mod
setting the target as a require
I thought about that, only issue I have with it is getting people to actually follow instructions.
Oop wait nvn
You changed the funny text
No i mean, in your lua I think
require soul's
store information from list
require mo farm
store information for list
I don't think that would address the issue unfortunately.
They're all running off the same table and the data is stored exclusively in the table.
Once the data is overwritten - likely from load order or something similar between farming mods - it's gone.
Unless each individual farming mod made global stuff for me to use, which would be agonizing to set up with everyone, it isn't possible.
If you can get your mod to load first using !
you could use requires to handhold the load order
Unless I'm not caffeinated enough
It sounds like it would work in theory
Still easier than manual data entry
That solves the mod origin issue too
this was for the patch project right?
Mhm!
snake, soul, mo farm?
More than that now-
4K+ lines of manual data entry. Not doing more of it.
Snake, Soul, Mo Farm, GMH, More common seed types, That's it, I'm weaving, Xnertot, Farming Coffee, etc
You could create a function to compare the list before and after requires -- if your intention is to modify "Corn" to "CornSoul" or something
Unless you want to pick and choose which plants get used
for specific plants?
If the same plant falls under different farm names, I set them to the same so they can "find each other" in code and get each other's seed data.
Otherwise, I generally leave it alone.
I.E, "Corn" and "Corn2"
to clarify, lets say you prefer soul's corn - you want that to be 'the' corn but if you prefer snake's peas then etc
ah
There's a sandbox var for determining what order is used.
oh
All of the other mods have technically already loaded, I just use the data at that point.
Since it's all manually inputted, I just go "ok get sf data"
"no sf data? mo crops data"
And so on.
It's more efficient than that, but that's just a rundown.
What I'm wanting to do at the end of the day is get that valuable farming_vegetableconf.props data in between farming mods automatically.
Your require method could work, it's just a matter of if require still still work if a file isn't present or not.
Though I don't suppose that really matters, I can still check if the mods are enabled anyways.
It'd probably be safer to use your method instead of full automation anyhow since it prevents unsupported mods from screwing crap up.
hmm good point...
I can still automate dumping the data, just not automate the in-between mod collection.
progress so far.
any Input feedback ?
No idea what an .avi is so I dunno what to recommend lol
the 3d sprite render will make that look that much better
i dont quite follow, is this something i can do, or thats in the PZ pipeline ?
pz pipeline
Finn, I'm gonna try your require method later today, THANK YOU.
if I understand correctly it will make the model's leg render behind the bench where appropriate
This is gonna save me SO MUCH TIME.
ever since the devs made that example video the sprite issues are more glaring
Might still need specific install instructions but whatever, you win some you lose some.
Requires would have to go in a specific order so meh
It's a solution - an easy to digest one at that - so I'm not too worried.
good luck let us know
ah gotcha, but yeah that my mod progess... both linked into the fitness system (including fatigue) and optional exp modifier, looking at level / regularity, etc
yeah its messed up on the wrong angle...
i kinda showed the best outcome ....
nothing to be done im afraid. Right ?
well the head should be lower
player X/Y can be floating - you may need to apply a different value depending on direction
in order to use the same animation - if the tile isn't centered in a way that works inline with the model
Can I call different animation depending on the direction though ?
Oh nvm change player location on different direction,i see hmm...
Is there a way to change forage bonuses while editing or making a new occupation?
Anyone know if getActivatedMods() returns in mod load order?
ฤฑ need help guys
this channel is for help in making mods, mod support is about mod user support, not dev support.
ha okey
so you should ask questions here if you're making a mod
I made a texture mod, but I have a problem with the .pack file and I can't run the mod.
I had problems with my normal tests. But when I shared it to steam, the mod did not work.
hm its not spawning ingame
i mean
not like being ingame
Hello, what may be the reason for two mods to be uncompatible
๐ญ
I made two clothing mods, both of them work when they're activated on their own
but I can only see the items of one of them if I activate both at the same time
I don't do clothing mods, but intuitively it sounds like you're loading them too late in the launch sequence, or you're accidentally adding them to vanilla base set of clothes and updating it with the additions in both mods, thus not incorporating the changes from the other.
I would look at when other clothing mods that do play nicely together add their clothes
By subbing and exploring their code
@tepid dawn
Ohhh, what you say makes sense
I'll try that
I didn't quite understand the "loading too late" part but I guess I understand additions to the base game
look thru log file and see what is getting overridden by both mods?
E.g., when I insert new options via the Mod Options mod and submit them, it will trigger a particular instancing event... if I do that OnGameStart instead of during file loading, that event causes all other mods that would normally have loaded their Mod Options after mine to be unloaded essentially.
If something you're doing reinitializes the clothing tables indirectly, then a late addition could cause overwrites of other additions.
Does it have something with modules in item scripts txt?
because I'm almost a complete beginner, I used "module Base {" when declaring items
but I see that other mods use "module CustomName { imports{Base}" kind of approach
Idk for sure because I do not add clothing, but when I added my book items, I did it like this:
module Meditation
{
imports
{
Base
}
item Neiye
{
DisplayCategory = Meditation,
NumberOfPages = 420,
Weight = 0.5,
Type = Literature,
DisplayName = Neiye,
Tooltip = Tooltip_YogaLessons,
DisappearOnUse = FALSE,
Icon = MeditationBook,
StaticModel = MeditationBookOpen,
WorldStaticModel = MeditationBookClosed,
}
item MasteringYoga
{
DisplayCategory = Meditation,
NumberOfPages = 420,
Weight = 0.5,
Type = Literature,
DisplayName = Mastering Yoga,
Tooltip = Tooltip_YogaLessons,
DisappearOnUse = FALSE,
Icon = MeditationBook,
StaticModel = MeditationBookOpen,
WorldStaticModel = MeditationBookClosed,
}
item MandukyaUpanishad
{
DisplayCategory = Meditation,
NumberOfPages = 420,
Weight = 0.5,
Type = Literature,
DisplayName = Mandukya Upanishad,
Tooltip = Tooltip_YogaLessons,
DisappearOnUse = FALSE,
Icon = MeditationBook,
StaticModel = MeditationBookOpen,
WorldStaticModel = MeditationBookClosed,
}
item ZenMotorcycleMaintenance
{
DisplayCategory = Meditation,
NumberOfPages = 420,
Weight = 0.5,
Type = Literature,
DisplayName = Zen and the Art of Motorcycle Maintenance,
Tooltip = Tooltip_YogaLessons,
DisappearOnUse = FALSE,
Icon = MeditationBook,
StaticModel = MeditationBookOpen,
WorldStaticModel = MeditationBookClosed,
}
model MeditationBookOpen
{
mesh = Book,
texture = WorldItems/MeditationBook,
}
model MeditationBookClosed
{
mesh = WorldItems/BookClosed,
texture = WorldItems/MeditationBook,
scale = 0.38,
}
}
That's exactly like how other people did it.
Thanks for sharing, I'll edit my txt and see if it works
Yeah I would recommend using your own Module name and importing Base if you didn't. That worked for me
And the name of the file may need -items.txt, idk for sure (please correct me if I'm wrong, anyone who knows).
Oh that last part made me find something important
both of my mod scripts used the same name before "_items.txt"
maybe thats why one is overriding the other one
Yeah, i dont know which one fixed it but I can see both of them. Thank you @thick karma
This is what did it
You actually must use different names
If the same filename gets loaded in the same directory it will overwrite prior ones.
e.g., if one of your mods has mods/MyMod/media/lua/client/foo.bar and the other has mods/MyOtherMod/media/lua/client/foo.bar, from the game's PoV, those are both just media/lua/client/foo.bar
And they overwrite each other.
You can avoid this with internal folder naming
media/lua/client/MyMod/foo.bar and media/lua/client/MyOtherMod/foo.bar
Those won't conflict
Or you can just use different filenames
^ why I mentioned looking thru the log file in debug it says what and when it does and if ya see two mods same name same file....
thank you also, but i thought asking opinions here would be easier lol
local onlineUsers = getOnlinePlayers()
for i=0, onlineUsers:size()-1 do
local playerNum = onlineUsers:get(i)
local playerObj = getSpecificPlayer(playerNum)
print(playerObj)
end
Trying to retrieve the playerObj for all connected players on a server. Using this simple code but returns an error. Not sure what I am doing wrong
Anyone wanna give me some feedback on this instructional example for an upcoming framework I plan to release alongside Aza's upcoming NPC mod?
-- (LINE 1) A very simple skeleton without connections between parts.
local Example = {}
-- Container for all Pattern Explanation dialogues.
Example.PatternExplanation = {}
-- Stand-Alone Conversation Example Skeleton; No Linking of Dialogues.
Example.PatternExplanation.standAlone = {
id = "Name of this Encounter", -- Spaces are entirely optional in your ids; they're just strings.
survivor = "Survivor Name",
-- The response - options - outcome pattern below is recursive. This means that
-- if you want to add a branch at a deeper level of your dialogue, you can simply copy
-- everything from line 15 to line 39 below (inclusive), and simply paste it inside
-- any outcome table in a dialogue tree (e.g., on line 26 or line 37 below)
response = "", -- (LINE 15) Note: "response" will refer to the NPC speaking; "option" is shorthand for what the player may say.
[1] = {
option = "",
intention = "Friendly", -- You may associate this response with any intent string.
rapport = 10, -- Options can cause player to build rapport with the NPC.
impacts = { pain = -1, anger = 1}, -- Options can affect player's feelings. Values are normalized from -1 to 1.
command = exampleCommand,
-- exampleCommand above doesn't actually exist, but you could create a
-- function with this or any other name, and write that name here.
arguments = {}, -- This option will call exampleCommand(player, survivorName, arguments)
outcome = {
-- response, etc. (LINE 26) (This is where recursion into deeper levels can begin.)
}
},
[1] = {
option = "",
intention = "Friendly",
rapport = 10,
impacts = { pain = -1, anger = 1},
command = exampleCommand,
arguments = {},
outcome = {
-- response, etc. (LINE 37)
}
}--, (LINE 15) Note: You would need the commented-out comma after "--" if you wanted to add more player reply options.
-- . . . et cetera. I would not recommend more than 5 options per branch.
-- A 5-wide branch 5-levels deep will require 5^5 = 3125 unique endpoints. That is a lot of writing.
-- It will be much easier write many levels of dialogue if there are fewer branches per level.
-- If your options are verbose (2-3 lines on 4x font), only 5-6 will on the screen.
-- If your options are concise (1 line on 4x font), you can get away with maybe 10 options on screen.
-- Don't forget to test how your responses and options look in 4x font for better accessibility!
}
(Will likely need to be viewed in actual editor to look right)
formatted fine this side
Fair enough, I just figured some of the long lines might look awkward in Disc
on a phone maybe but /code does a good job at wrapping just be long. but on a halfscreen on this rig looks good.
Cool nice
Well... do you think you could follow this structure to build your own basic custom NPC dialogue? Any explanations too confusing?
(I have a framework for running branching dialogues on this structure built.)
personally yes, but as a whole no issue it explains it well just for me 'skeleton' throws me off
I just used "skeleton" because it is not fully filled out
But maybe another word would be more well-known for that.
Idk
template I guess
call exactly what a {} is?
Afternoon folks. I've created a new object script for a new tile, but I can't see it in the Necroforge list. Any quick troubleshooting starter points?
{} is a Lua table. @frank lintel
just call it that then to avoid confusion.
nvm silly mistake figured it out
I knew what it was and what ya were doing but being new to lua and modding for PZ just threw me off a bit
-- (LINE 1) A Lua table used as a module (a container) for the other elements in this example.
local Example = {}
-- Lua table used as a container for all Pattern Explanation dialogues.
Example.PatternExplanation = {}
-- Stand-Alone Conversation Example Template; No Linking of Dialogues. Also a Lua table.
Example.PatternExplanation.standAlone = {
? @frank lintel
Clearer?
-- Stand-Alone Conversation Example Template; No Linking of Dialogues. Also a Lua table. (Code below makes extensive use of nested tables).
appreciate the feedback
I figure this framework will likely be used by people who are NOT Lua experts
So, I need that feedback
Ideally I want anyone who has any clue about modding to find it pretty easy to fill it out
Without eliminating features
never touched it before honestly dont even know why they using it still given they already coding in java but... I offered the feedback cuz a newbie pov it seemed was what ya were looking for
You mean why would someone write an NPC dialogue framework when NPCs are coming?
no why they using lua... 
exactly why? java the native game lang why the change but thats not really a topic for debate here nor trying to.
I am not sure; I suspect perhaps it seemed easier to maintain the security of core code that contains sensitive user data... or maybe they just had a lot of Lua experience and decided half the game would be more easily written in Lua than Java.
I honestly do not have an answer for you at all, though I would be curious to know the real one.
shrugs not knowing either. "Im migrating from doing modding in MC and craftbukkit/bukkit/spigot so unlearning java for lua is not gonna be fun."
Fair. For what it's worth, if you keep an open mind, I think you'll find that some of its unique features are very useful
Mixed-data tables are very easy to whip up in Lua compared to Java.
And OOP can be simulated.
Such that ultimately using the instances of classes will look very similar to how it looks in Java.
oh just ppl trying to explain how they are even different types of programming languages makes my brain 
Pro-tip, (index + 1) % numIndexes becomes (index % numIndexes) + 1 in Lua tables that use (1, ... size) for indexes.
Im jusst old so ingrained burned in syntax is just hard AF to undo.
Haha for sure.
I started down my coding road with C in '86
Are java mods illegal, what's stopping you personally?
how to load it?
Hi, i have a quick and probably dumb question:
Is there an easy way to get a player object from a username? I had an idea to grab all online players and just search each one until i found the one with a matching username, but I wanted to check that it was necessary before i do it.
Olipro wrote a program for that @frank lintel
But you will need to get your end users to install it
thats the limiter right there
Exactly
Hence many of us don't use it
Despite it being very cool
I think Blair may be about to enlighten us @frank lintel
He is a pro at TIS
Also, if you are using modded Java for a game, any problems with your server or game are absolutely out of The Indie Stone's hands; please don't come to us for tech support or help if you are using a modded Java as that is far beyond any point where we could help someone.
Voids all warranties etc.
oh no that wasnt the topic
Totally fair.
It is for me ๐
just didnt know why Lua over using Java since it using it already
Not only have I answered my own question, i also found a function that I WROTE that does this exact thing. This is why you dont code for 12 hours straight
if I cant do it natively then its not getting done (for me)
Is there an official answer for players to know on this one, Sir Blair?
youre not alone
I have no idea. It's just the way it is.
Also I just want to stay completely out of, and completely uninvolved with, java modding and any associated headaches.
i had some issues "adapting" to lua
and what i couldnt solve with lua
i solved it with c# by making an app to interact with my mod
so the mod is only a listener, and the app does the hard work
Haha nice.
I only mentioned this because a mod Im trying to debug some reason has a java attack.class file in it which I was like o.O
So that's how you did Twitch Integration?
the lua only decodes a json string that the app sends to the mod
Veeeeeeeery rarely to get a free thng maybe
and based on that executes some simple functions
all the heavy logic is done by the app
now im making a neutral version of the app
?
so that if anyone wants to use it with their mods just need to do a few clicks
in the app, setup the json that it sends and parse the json on the mod side
hmm I think I need to see your app to really follow
Not clear on how clicking mods is relevant to twitch integration...
clicking mods?
what i mean is this: you have a mod you want to integrate with anything
"if they want to use it with their mods, just need to do a few clicks." Wdym use it with their mods?
so the app has a menu that allows you to config what is sent to the mod
the actual mod only parses the results and executes the code needed for the result received
Ohhh... So it's basically a framework for handling external signals within a mod
That would be great for everyone
works with twitch api, youtube api, discord api and steam api
I wouldn't necessarily have plans for, but no doubt a ton of people would
Hey @fast galleon - thanks for the advice yesterday - I got the add/remove both working afterwards.
only need to finish the gui... eventualy
done the guy to work with my mod, but need to make the "neutral"
there any good refs for gui stuff that one thing def wanna look at.
Mang I've been watching Aza whip up a fresh GUI in Bzl and they're not my pics to show you but I gotta say, it's impressive how fast you can build out a GUI in that app.
have a look in the simple ui api mod in the workshop
If you hate doing it manually.
im using winforms for most of it and user controls
How complex will your GUI be?
the only thing thats dynamic is the user controls
well it gotta handle ultrawide and doublewide displays ^_^
That's trivial... but what it the UI gonna do?
which I clearly not seeing done well so far by modders
It affects which example I will send you.
I have example that do this well
But I don't the level of complexity you require
I've seen a java mod that says to drag and drop files, does that work with all classes or only vanilla overwrites?
im done with the games UI... i almost went mad just making a simple thing like me stats mod
Wookiee Gamepad Support features fairly complex examples that do "too much" as the kids like to say @frank lintel
Trying to get a custom tile ingame, getting the Warning: Moveable not valid error. Any ideas?
honestly Im first going after vanilla ones
I added gamepad support to Trading UI and fixed UI scaling issues while I was there, e.g.
You can read that to see how.
at this point how I see it I gotta learn how to do it manually...
you finished the gamepad support mod @thick karma ?
Oh it'll never be finished but I have added PlayStation button support, Switch button support, ISTradingUI support, ISSafehouseUI support, ISFactionUI support, Aquatsar shortcut improvements, gamepad inventory and loot repositioning / saving, gamepad shortcuts for sorting inventory and loot, and probably other stuff I'm forgetting. @pulsar heath
damn... thats a lot of work
I should really post a simple example of a gamepad supported UI framework...
I may do that in the next few days
Just a matter of deleting a bunch of stuff from existing code without breaking anything
lol โค๏ธ for noticing
Oh, scrolling shortcuts... we can hold triggers down while pressing D-Pad to scroll faster in various contexts @pulsar heath
kind of a big deal with all the long lists in this game
i know its a lot of work... i almost went mad sorting through the UI handling in the game...
Doesn't work everywhere but it's nice where it does (e.g., inventory and loot)
if a simple mod as mine was a lot of work... i can only imagine the amount with something like that
I went pretty hard on it lmao
Good morning.
good afternoon kind sir
Are occupations' (mainly foraging) bonuses possible to edit or create with lua?
yes they are
you can either alter the bonuses directly
or using perks
etc
and you can do that in lua
or just modify the value itself directly
Blimey, custom tile creation isn't particularly straight forward is it?
hey, maybe you know this.
I've seen a java mod that says to drag and drop files, does that work with all classes or only vanilla overwrites?
Does item:DoParam("Param = Value") also work for template parts? I'm trying to write a mod that will pull vehicle storage/trunk names from a file and set their "ConditionAffectsCapacity" property to "False" (edit: typo)
#mapping is usually where people discuss new tiles, what issue do you have?
Working on improving my parser this morning for ZedScript.
to add "moveable" to player inventory
#mod_development message
item Mov_OfficeChair
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = default,
Weight = 0.5,
DisplayName = Black Office Chair,
WorldObjectSprite = furniture_seating_indoor_01_50,
}
^for debug Item List
The following code is being run serverside:
for i=0, onlineUsers:size()-1 do
local player = onlineUsers:get(i)
print(player)
end```
The following code is being run clientside:
```lua
RestartAlert.checkModData = function(this)
print(this)
end
Events.OnPlayerUpdate.Add(RestartAlert.checkModData)```
Why is the player object from the first function and the second function different?
even though its the same player (since the server has only one player online)
I really liked that my new parser was less than 90 lines of code but now I'll have to follow the same rules that PZ has for parsing ZedScript.
I think its because the server's representation of a player object is different from the client's representation of the same player. Is there a way to get the same object both client wise and server wise?
when you print userdata or table it usually prints the "memory location" as somebody (anonymous) called it
it is the same player, just different strings representations
but is there a way to get the same representation on both functions?
for print purposes?
I am setting moddata for the player from serverside, and I want to retrieve it from client side
but it's not working since both representations are different so its like I am setting on one player from the serverside and then attempting to retrieve it on another player clientside, while its technically the same player
not sure that works from server since it's handled client side, that would be the problem, not the string you print in console
well i was able to set moddata for the player from server side and then retrieve it from the same function serverside, but that's not what I am after sooo ye
alternative way, send command. Maybe somebody else has better advice
hmm will look into commands i guess
for reference.
Serverside code which is being executed using EveryTenMinutes event:
function RestartAlert.CheckServerRestartTime()
--some lengty stuff
if content then
local onlineUsers = getOnlinePlayers()
for i=0, onlineUsers:size()-1 do
local player = onlineUsers:get(i)
player:getModData().restartAlert_alert = content
print("MODDATA HAS BEEN SET FOR: " .. tostring(player))
end
end
end```
Clientside Code which is being executed using OnPlayerUpdate event:
```lua
RestartAlert.checkModData = function(this)
--irrelevant stuff
if elapsed >= 10000 then
print(this:getModData().restartAlert_alert)
print("MODDATA RETRIEVED FOR " .. this)
end
end```
how to add the ability for a message to be sent to /all after an action has been performed?
I tried this but it gave an error when it tried running in game SendMessageToAllPlayers(character:getDisplayName() .. " test message")
any smart person know how to fix this ?
lol, when you push yourself into the bench exercise
is the player standing where the feet are planted in that animation?
you'll need to make them stand on the eastern tile of that bench and then offset them in the animation i imagine
otherwise the clipping is unavoidable (pending juicy changes mentioned in the previous blog post)
was thinking about this... kinda messy work-around though ..
๐คทโโ๏ธ
maybe there's a way to set the front tile to be on the same layer as the carpet? idk, it would be super messy as well
you'd need custom tile defs
processGeneralMessage(str)
Would this be the correct way to implement a client command?
local Commands = {}
function Commands.showRestartUI(content)
local myUI = MyUI:new(content)
myUI:initialise()
myUI:addToUIManager()
end
local function OnClientCommand(module, command, player, args)
if module == 'RestartAlert' then
Commands[command](args[1])
end
end
Events.OnClientCommand.Add(OnClientCommand)```
```lua
if content then
local onlineUsers = getOnlinePlayers()
for i=0, onlineUsers:size()-1 do
local player = onlineUsers:get(i)
sendClientCommand(player, 'RestartAlert', 'showRestartUI', {content})
end
end```
I'm not sure if the usage of sendClientCommand in this context is correct
if you use sendServerCommand from server with no player object, it should send it to everybody
Since trying to add just โbatteryโ uses only 1 unit of its 100000 units
Just set it to 100000?
I believe I need to consequently change the first part of the code where I define the client command?
That didnโt workโฆ
so if i put that into a line as processGeneralMessage("test message")
It will say "test message" to the /all channel from that player?
Yes, it should
suggestions on how I can do this: getCell():getGridSquare(x, y, z):RemoveTileObject(getCell():getGridSquare(x, y, z):getObjects():get(1)) but target the tile object by name?
as opposed to grabbing the object by reference
Anyone know how to use up the battery when making a recipe?
Ah, you do destroy battery
go through all objects checking sprite name for match, you can use getTextureName function to get sprite name
thanks again @fast galleon !
be careful with nils here getCell():getGridSquare(x, y, z)
I'm passing hard references so nils shouldn't be an issue
if you're doing this client side then you can use ISMoveableSpriteProps:findOnSquare( _square, _spriteName )
So I made a thrown home alarm with timer, but every time it hits something, it disappears and doesnโt make any noise
Itโs made the same way as the NoiseTrapTriggered Noise Generator in newitems
Ahh thanks, that'd be why. I'm just trying to acquaint myself with getting a new custom furniture tile in, followed some tutorials on YouTube and reverse engineered a couple of mods, but don't seem to be having much joy. I'll take this over to there though, thanks for getting back to me ๐
Update... It works now. If you soil your pants in the game... A message is sent to the discord server letting everyone know you just poo'd your pants
Shame
how do i find the modding tools
can you try to add the tile to your inventory with this? In case that's the problem...
getPlayer():getInventory():AddItem('Moveables.Moveable'):ReadFromWorldSprite('furniture_seating_indoor_03_17'), change the sprite name.
Thanks, sprite name - is that the name of the sprite within the pack?
replying here in case they are allergic to code there
(the one I can get from the packviewer)
yeah
Ok, so it adds 'Moveable' to my inventory, but it doesn't actually show or place anything when I try to place it in world
Just highlights the target floor tile as usual
does getSprite("insert sprite name here") from console work? print(getSprite("furniture_seating_indoor_03_17"))
are there any errors?
No errors, there's a LOG general and a zombie.iso.sprite text output
Oooookaaayyy.. 6 hours later.
My rewrite for a raw string parser for ZedScript files is somewhat working now.
It tokenizes assignment lines as single tokens and takes into account commas possibly stacking for empty statements that are ignored.
Tokens are parsed by scope. E.G: module, sound, recipe, etc.
So this one should work.
I could parse out property->value statements as separate tokens however I think my parser code further in will be cleaner doing this.
@quasi geode
So, I made a version of Arsenal26 so I could lower spawn values, I updated the mod, now my game is saying workshop item version is different or something like that when I host
Could someone assist me with that?
Okay so i was toying with this idea just before my computer exploded (trying to find replacement motherboard level exploded)-
How hard would it be to mod the pz medical system to act like the med system from the Rim?
Things like tend quality and medical skill increasing bonuses?
Cause i got some ideas about it just wondering how feasible it is
Does the self:forceComplete() command for TฤฑmedActions prevent the action from being cancelled? I couldn't find explanation for this command.
forceComplete will complete the TimedAction, regardless of how much time it has left. Its perform function will be called.
It's not easy)
oh i see thank you
To add onto what Aiteron said - you'd be better off starting from the ground level and making your own systems
The vanilla injuries are tied to fields 1:1 with timers
good evening, i've never modded games, but i have the basics of OOP down, and basic programming knowledge in general. Where should i start, if i want to learn how to make some simple mods?
Start by thinking of an idea you want to implement (i.e. "I want the game to have ___") and then start looking at other mods that do similar things to learn how they function
There is https://discord.com/channels/136501320340209664/1070852229654917180 and https://discord.com/channels/136501320340209664/1070858800501891172 as modding resources
call me insane but i'd like to try to make some basic NPCs
i'll look into it
There is "Superb Survivors" on the Workshop, they're currently looking for help
yeah i've tried it
there are basically no working NPC mods left
couldn't find a way to fix it either
the devs can't even make working NPCs, that's why they're leaving it off until Build 48 or something hahaha
this is a dumb question but what's so hard about it? Both project Humanoid and Superb worked decently until the latest builds, except for the stutters
It's reimplementing everything that a player character can do, but with an artificial intelligence. It is simply horrendous tedium, on top of the bugfixing
i'll probably look into Superb, basically everything works except for melees
You could start with making scripted NPCs, that's what previous versions of PZ had
as in ones that do a particular thing
yeah if i'm going to make something from scratch i obviously can't start big
and don't forget your artificial intelligence is running in *lua*
there's probably going to be an horrendous amounth of math involved in the Ai
lua banter be like:
๐คฎ ๐คฎ ๐คฎ ๐คฎ ๐คฎ ๐คฎ
WHY is --- LIEK ----???
wich is what worries me
i honestly think lua is really really good but its performance limitations don't lend well to ai
the amount of math you have to do can be mitigated if you leave everything else constant, i.e. an NPC doesn't have to worry about food, looking for other NPCs or players, because you made it to just spawn on the map, walk around and shoot zombies, and either die or disappear after a certain amount of time
once you start actually making the NPC a part of the world, is when every little detail leaves blocks of code
time to make a vehicle spawn mod for the first time, to better understand why my other mod doesn't work as its supposed to ๐
I wish it was client side - unfortunately I'm doing this server side to simulate our traders moving from place to place during the server's uptime cycle
Is there a way to detect if a mod is enabled to not add an item to the distribution code?
This is what I tried and it did not like that to say the least
if (!isModActive(getID():contains("FarmingTime"))) then
table.insert(SuburbsDistributions.SeedBag.items, "MCM.CornBagSeed");
table.insert(SuburbsDistributions.SeedBag.items, 20);
end
I was testing superb today it was actually working
still trying to track down exactly what is causing the 'Exception thrown java.lang.IllegalStateException at UIManager.update line:685' error
I think my problem is lua not liking the not modifier
use not condition instead of !condition
my bad it does but I think it has to be done after all the logic is done. ie !(A and B) atleast the examples Im seeing give it this way
i don't think there is a ! operator at all
this page Im reading shows one for logical operators but precedence order on a not is R2L not L2R according to this also.
if (isModActive(getId():contains("FarmingTime"))) then
else
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.CornBagSeed");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 20);
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.LettuceBagSeed");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 20);
end
This responds with
STACK TRACE
-----------------------------------------
function: MCM-Distributions.lua -- file: MCM-Distributions.lua line # 43 | MOD: 'Mo Crops
Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException
Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException:
Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: at MCM-Distributions.lua:43
does getId not have a contains
i think you want if not getActivatedMods():contains("FarmingTime") then
is getId() a string outpout ... beat me to it was just gonna say use 'contains'
I'll give that a try
and albion you might be right I gotta look at more sites cuz the popout examples all use not but the one example on the main page uses ! what the heck?
excellent thanks guys
contains did the trick?
Switching it back the way I had it, but adding the else statement worked
I tried using the every other language way of checking for false before
which got lua confused
now with the else it works exactly as i wanted
lua has some unique syntax etc Im on the official lua.org site now looking to see if ! even is a legit operator.
and nope they dont according to Lua 5.0 manual its typed out and/or/not so ? : ! functions dont exist
also 0 = true ^_^
yeah, if 0 evaluates to true, but if 0 == true evaluates to false
they're both true but they're not equal
like it already has something written in it when it spawns? that can't be done with item scripts alone, needs lua
@drifting ore if you look at an existing item in the zomboid files you'll see how it hooks a function into play from a lua file - you can just look at that function then and attempt to replicate it for your own item to make changes - I wouldn't be able to tell you the files off hand without looking - I learned about this stuff by trying to update Hydrocraft. As for the picture question - I know with the UI elements you can make custom frames/windows - I've yet to get my head around how though
If you look at mods like Snake's Gourmet revolution I know it uses instances of custom images in UI frames that you may be able to look at as reference.
pretty quiet in here for a saturday night lol
https://steamcommunity.com/sharedfiles/filedetails/?id=2938785592
This is now absolutely hilarious! I have it capable of hooking into Discord as long as it is connected to the server and announce to everyone.
lol nice. I recommend inserting a link to the original mod for referenceability
like so:
I modified the [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1436878551]original Defecation mod[/url] from nater
I added it on the description
Its mostly just a way to have fun with my server as I have the discord connected to game chat. I imagine most people will not be able to fully appreciate that part of it. But they will still enjoy the 3 better sounds and text changes at least.
the meme factor is more than enough. A super elaborate mod likely won't get the same amount of views and coverage as a "sex 2.0" funny mod. If you care about that kind of stuff, that is
I edited all of the military vehicle spawn distributions I can think of, and standardized it under KI5's vehicles, as they are the most feature-rich and polished:
https://steamcommunity.com/sharedfiles/filedetails/?id=2939143319
So I decided to make my own music collection mod for Zomboid that was lore friendly
there's 722 songs ranging from all sorts of genres from 1962 to 1993 for those interested, I haven't properly tested it myself though since I have the files locally personally but let me know if it works if you do end up using it :)
https://steamcommunity.com/sharedfiles/filedetails/?id=2939178280
tracklist info is in the description of the mod
just letting you know though it's 5.0GB's so it's kinda beefy
duudeee this is how you spawn a moveable that doesnt have a script item? thnx alot
Thats a good code snippet to yoink
I made my own for sprites. I should link it somewhere, since I personally have no use for it
is there a function that i can use to block xp gain from a book in certain cases?
or what i would call in regards to book xp boost
sure, just skip the add xp multiplier step
thanks i'll try this
mmm... what's wrong with my logic here:
function vPlace(square,sprite)
if square:getObjects():get(0) == nil then
print("DEBUG: Why no print?")
end
...
I don't know where to begin...
LOL
print the if check (square:getObjects():get(0)) and you'll see for start
squares almost never have no objects
an array throws errors when you try to get an out of bounds element (?)
the missing end is probably cropped out
oh it is - I chopped the rest of the code out
as I'm just trying to figure out how to do a check to see if a square is empty or not
what do you consider empty, do walls count? what about items e.g nails?
should only be a ground tile, nothing else.
Going to attempt to dump the get(0) to print now though and see if I can figure anything out from there.
I guess you could check size then if objs:size == 1 then
I still want to understand how get() will work though; as I intend to iterate thru the square's objects afterwards
thanks for the advise @fast galleon - going to go do some debugging
mrm.. except square:getObjects():get(0) doesn't print to console...
wtf.
that would be true when no objects are there, no floors either
Okay - let me refocus my efforts here; how can I ENSURE I get a print to console/logs, even if it's a bad value - anyway to address that @fast galleon ?
If you get like a swuare above you and unare outside
Then yeah thats empty
Try error()
Hi tags polt almost every other msg ๐
Nope i was wrong
Only twice
The scren just scolled up cuz phone buh
Bug
I used to think all squares have floors, but now I remember that's no true. Not all squares have an square object btw.
if you function executes and you have an unconditional print then it will print
no print means the function isn't called
function def gets called - cause if I take my print + the square object reference out, and let the rest of the code run, it has no issues.
or you can get an error stack if you try print something that erros
If I give any supposed vehicle, item, recipe, or anything in the game a string in the translation files, but those entities don't exist (either missing or not enabled from a certain mod), will the game handle the new strings without issue and simply never use them? I can check really quickly with my own mods, but i wanted to know if anyone has had experience with translation files.
when a translation isn't found, they game uses the given string
I know, but what about the other way around?
If u want you can disect this code i wrote
The function gets the highest z
But i have a version for prints only
Highest z that has floor
ah, you can translate as much as you want no errors will happen from extra translations
It returns nil if theres no floor
So here's the original code in that function that works:
local isoObject = IsoObject.new(square:getCell(), square, sprite);
square:getObjects():add(isoObject);
square:RecalcProperties();
The code above will add objects to a square without issue every time it runs; when I try and print or error anything I'm working with in regards to square:getObjects():get(0) to debug and check to see if the square is empty BEFORE the adding is done, it fails but I can't get error output...
Neat, okay thanks for confirming
What are you. Looking for .. floor or obj?
I want to make sure the object I'm about to place (in this case "sprite") isn't already placed on that square.
I have that function too but im afk
Check out my bear trap mod
will do.
Tho it does check for abunch of stuff too
Not just the tile itself
You can just select which one u want to remove basically its a checker function that checks bunch of stuff
Like if player is blocked by a wall
If theres something there
Is there a floor
Can you see it
Stuff like that
Hope u find what u need frkm that function
could this be a cached function issue? are you exiting to main menu?
I wrote it when people said you cam stack the traps
And i realized i forgot to do a check
Yes - exiting to main menu after each code change for testing...
Dpends on the lua files content you can always try the reload button
To save time . Just need to know what reloads and what doesnt
Like on game start events
are you testing in sp?
MP. As this is server side generation
What mod are u making
ok so that would never appear in your console log
Right - would appear in server debug log right?
yeah
Cause nothing shows up there either ๐
You must be looking at the wrong directory
Nope - cause other functions I can throw print statements from no issue... can confirm looking at server log output.
Is there a way to run OS command inside lua files (because os or io tables are not available). For example call curl command when sever starts?
yeah - if I just use the original addition code I posted above, and toss a print in there, print will work no problem and I'll get output in server log
Yesh if you are just solving the the tile placement then no need to further focus on the log
sorry for all the stupid questions, is your new unconditional print unique - something you can search for?
i only know os.time
Yes - i tag all my prints with "DEBUG-X1, DEBUG-X2, etc.
Not sure if theres somthing else
os.execute would be nice ๐
How exactly do you tag em
ah you got that already?
print("DEBUG-X1 :"..addCodeHereIfNeeded)
O dont think so. No... I might be wrong tho
yes, if I do this:
function vPlace(square,sprite)
print("DEBUG-X1: Placing sprite");
local isoObject = IsoObject.new(square:getCell(), square, sprite);
square:getObjects():add(isoObject);
square:RecalcProperties();
end
that works
Right...
Why not just make a moveable
lol... okay
Save yourself the trouble
So I'm trying to take our existing vendor setup which uses tile+UI interactions for a shop, and have those vendors "move" on boot
Not possible
moveable is an inventory type though
why not? If I can check to see if my tilesprite is present I can just delete it
You need a player present for that to work unless u expensively force load a grid
you want me to just paste my functional code file for you to look at?
cause it works.
Been using it for months.
Sure and if it works the. U mumight have solve something alot of modders failed to do
I doubt it seeing as I butchered this code together from other modders code :p
On top of my head i know probably 4-5 modders who wanted to spawn obj without a. Player there on that gridcell
Like server spawns it .
do you have experience with loading chunk?
I'm rethinking my options for v42
original non-wip code that works right there
I saw couple of codes i have really tried
Cuz i dont want to tbh
Yeh he used loadgridsquare that will work
Expensive but yeah ..
I failed to mention without using loadgridsquare sorry
The server that we host our game on can handle it so I don't really care about the resource clog
Cuz some servers cant handle it even if u optimize the code
Like baricaded world
A very cool mod but the method
Nice
barricaded world - and trash + corpses - were two of my inspirations for this.
Since thats the sotuation . Imean if yourenot doing the mod for general public then theres no reason why you shouldnt use that
Good job btw
Looks amazing
right.. so anyway, what I'm trying to achieve is have it run the placement on boot everytime (that I can do easy enough) what I can't do is have it check to see if I've already placed the vendor on that square
if I have, I want to remove it
then I'm going to add a randomizer to only POTENTIALLY spawn said vendor
to emulate them "travelling"
Search for the sledge function
Right
I have a suggestion
Instead of teleporting them why not make them chance encounters
Like they just disapear and comes back from time to time
that's the intention
but I'm going to use the same grids each time
so one day a vendor might be at the race way; next he might not be - but eventually he will come back there
You can use a radius check near a player if they are xlose to the obj then do the thing
erm... okay that's a bit beyond me at this point LOL
I need some advice. I have a mod that has a crap ton of mods that all do the same thing but for different vehicle mods. I just learned that I can combine all of them into one nice AIO mod. But, it isn't finished and I'm still making more translation files to cover more vehicles. Should I merge all of them now, or continue making separate mods until I finish and then merge? For reference, my mod is "KI5's Vehicles - Lore-Friendly Names"
also if it becomes a radius check based on player - would the vendors be instanced to players then vs the server? I don't want vendors vanishing when another player approaches, or only being visible to one player...
any of them used in a mod?
Nooe just snippets
I think authentic z had it and it says konijima wrote it for peach
Iirc
Good morning. Fired up to resume work on my parser for ZedScript today.
@scenic cradlehttps://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#zomboids-lua-component
see how to loop the arraylist
thanks Polt - I'll give that a read later... taking a break for now, frustrations are at a high
I wonder how many global objects are equivalent to force loading a chunk, imagine adding object every hour to random position so that something happens when chunk is loaded
Anyone know if it is possible for an item to have two world static models and if so how I would go about doing it?
hi i was wondering has anyone made a mod yet that makes alternators work in vehicles so the batteries charge when you have the vehicle on?
if not might be a good mod to make although i know nothing of making mods so it may be alot of work im not sure
Isn't this vanilla?
not that im aware of no
actually should be very easy to do.
ah i confused it with the car battery it's my fault
make a new triggerable event to the car base that would add in power to the battery power when its running.
i wish i knew how to do that but sadly im too smooth brained to attemt it
actually might give it a shot and try and make it myself but I bet someone would beat me to it.
dude if you made it ill bet it would be popular
or girl sorry didnt mean to assume
all good and my half century old brain dont care I call everyone dude pretty much cuz ppl get bent if I just use babe now it seems.
actually think I pretty much just say 'sup now to avoid all that.. but yeah moment you mentioned it I was like oooh thats a good idea.
i have another idea too i always wanted but again too smooth brained to try
it shouldnt be hard to do I could just look thru the 'god' mode code of a cheat mod to see how the event handling is done... Im totally new to the modding let alone lua. I did all my modding in MC years ago.
like first person to make a mod lets you pick up arrows you shoot :P
it would be pretty cool if that was something that could be done
also i play the deaf trait alot and one thing that bothered me bad was heli events while deaf it bothers me so much you can see things like the moon but there is no visual indicator for tha choppa
how do you see the moon?
like a little icon or even a light on the side of the screen would be the best
there is an icon on the top right of the screen which shows the moons status
whether its full or crescent you can see that
far as I know chopper event totally randoml
it can be depending on settings yes
yeah but think those are just starting/day start restrictions not an exact like 'start day 30' thing
but really in reality even if you are deaf you can still look up and see a chopper in the sky i just thought it would be nice to have a indicator of some kind that a chopper was in the area
I dont think its intended to ever really be seen since it just randomly flies about till it f's off its like a news chopper circling the area or something
and one last idea i had was the chatbox in multiplayer servers sometimes that box is just in the way and if you close it you miss messages meant for you a light on the side when a new message comes through would be amazing
true i just figured that if there was an audio indication of the chopper that it also made sense you can see it too but its a minor request its nothing that i consider a nuisance or anything
so if its not intended i mean i get it
a pro in the modding community might know if its possible to track the audio sources for direction since it does I believe get pushed into directional audio
or if there anything that gives it a location so you could do that
oh it dont even have to be that great in detail just a light or something to indicate its in the air would be nice
or a negative moodlet even
well just adding an icon if the chopper event fired off could be something to look into
right i mean it makes sense that a deaf person cant hear a car alarm or a house alarm but being hard of hearing myself i can still even feel the vibrations of a heli going overhead
btw never really noticed or looked but do house alarms stop working when power dies?
no they are battery powered like a battery backup kicks in
like infinite age cuz thats bull and non-existent
yeah those batteries never deplete tho it seems
another idea... ๐คฃ
hmm wonder if when the power goes off is preset on world gen I know its pretty much random but wonder once you make the world when it does is choose not just an random odds chance if it does that day or not...
this way could have a date when power goes down then add in a decay death for the alarms
yeah that sounds viable but i dont know anything about modding so i have no clue how tough it would be to do
i know some people seemingly know exactly when the power will go out so there is a way to do that although again i dont know how they know but i witnessed ppl being spot on when the utilities will shut off
when ya make the world you can define how long power/water so there settings for it, believe you can even make it so never happens and never shuts off
well in that case then it sounds like it can be worked out
anyways those are my ideas i hope someone finds them useful
keep [Recipe.GetItemTypes.Hammer],
I'm guessing this is a method call for an ingredient in recipe in ZedScript.
Recipe.GetItemTypes.Hammer is a Lua function
is there a way to get player's safehouse without having to loop through all the safehouse?
...
Templates in ZedScript.. Oh man..
(Quietly deletes /media/scripts/vehicles/)
"So how about them vehicle scripts?" .. "What are those?"
How do I check if a helicopter is active?
tempting idea. about to throw my parser at this folder too. I've been saving it for last 
LexerError: [4581:41] :: Illegal line in 'Base.GlassTumbler': ,
Heheh
item GlassTumbler
{
DisplayCategory = WaterContainer,,
Type = Normal,
DisplayName = Tumbler,
It's good to know that my lexer is working as intended.
mines turned into a fullblown error checker. logging overwritten entries, duplicate key / value pairs, incorrect data types, and validating any references to other blocks in the scripts... anywhere a string points to another thing in a script or file (ie: checking a item's model entry exists, and that model entry points to a existing .fbx etc)
just need to do vehicles then onto the .xml's
Hmm ok. Yeah I'll need to work with vehicles. I didn't think I'd need to be doing nested objects like in templates.
My lexer should also be a linter. That's been my approach.
My non-location rendered JSON is nearly instantaneous. My location rendered JSON takes a little bit of time. I decided to write a cursor calculator approach to prevent desyncing from seeking in certain situations.
I could write good, but rigid code that speeds up locations being passed however that's basically debugging stuff.
locations are presented during errors though.
Going to skip rewriting my AST parser and work towards getting the desired JSON result..
I mainly did that for both fun and research / learning how to make an AST.
This language is too rigid / specific for an abstract tree.
still havent coded in a json converter, might have to do that after i take my whining dog for her walk
We can compare our results once we both finish our JSON converters.
I need a ZedScript > JSON and JSON > ZedScript solution before I begin working on my application.
Something I'll need to go through for my exporter that I hope will be fixed in b42 is the properties that are case-sensitive.
Besides mod_data, I'd expect property names to be PascalCased, however to be read without case-sensitivity. 
BTW I'm performing checks on if property objects are not in their respective parent object's definition type.
So if clip is inside of model it'll throw.
EOF checks are in-place as well.
The big issue I have when it comes to consistency in ZedScript is that every category for definitions does not contain any whitespace.. except template vehicle.
Going to guess there's a string.toLowerCase().startsWith("template vehicle") check somewhere in the script Java code.. =/
It appears to accept one or more whitespace characters between the two words (although none of the vanilla scripts have any more than 1, from my quick glance)
What's the end goal here?
so I have a mod that adds dakimakuras. all of them have an image on both sides. I want players to be able to choose which side is displayed when placed. so far the only idea I have it making a duplicate of the item for the other side but my mod already consists of duplicating the same item muliple times for different texture varients since weapons can't have multiple textures.
so my 30 items would go up to 60 just so you can show off the other side
Oof.
Yeah.
That's what I was gonna suggest.
Sorry
Lmao
lol well thanks anyways
quietly hides
build 41 can't come soon enough. latest blog post says things like weapons will be able to have multiple texture optuions like cars can now
that would slim my mod down a bunch
and if the devs opened the placement option up for modders that would fix my flipping issue. Honestly if it's possibly I will lay down some cash right now to get an advance placement mod made
@hot patrol Build 42*. Also, shot in the dark . . . have you tried this?
I'm thinking shift r to rotate one way alt r for the other axis and then maybe arrow keys to move up and down
can't say I have. ouside of copying the base game and other mods I can't code for crap so idk what that even is
i'm working blind and dumb
I see. It's in Class InventoryItem here: https://zomboid-javadoc.com/41.78/zombie/inventory/InventoryItem.html#setWorldTexture(java.lang.String)
Javadoc Project Zomboid Modding API declaration: package: zombie.inventory, class: InventoryItem
I.e., if you store the inventory item object as, e.g., item, you may be able to call item:setWorldTexture("WorldObjectTextureName") and it might do a thing
I do not know, haven't tried it.
i'd be surprised
hmmm
chuck wanted to do something like this but couldn't, i'd be surprised if it was that easy and he missed it
I mean these are the items in question. I think changing texture should be enough if that would work
these are how the items are textured
and yes, that's what you think
all I would need to do it swap the imaged so that if fits the model correctly
i'd try it but I don't know lua

Haha time to learn. ๐
i need this spiffete pillow pls
im down bad
@hot patrol
local Example = {}
Example.onFillInventoryObjectContextMenu = function(playerIndex, contextMenu, items)
items = ISInventoryPane.getActualItems(items)
local player = getSpecificPlayer(playerIndex)
for index, item in ipairs(items) do
if item:getFullType() == "YourModule.YourItemName" then -- Guessing a bit here.
item:setWorldTexture("TheTextureNameYouWant")
break
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(Example.onFillInventoryObjectContextMenu)
return Example
You could try this.
Need to create textures for the models if they are not using textures yet
Presumably
what does baseRange and customTag mean
No idea on customTag, but I think the baseRange is probably measured in tiles from which the sound can be heard or somehow related to that.
I'll try this If I can figure out how to add it. You are totally right about me needing to learn this. Thinking about buying lessons at some point.
could I just write nil for customTag
Potential flaw to this would be I would need a unique function for every unique item.
Not necessarily. You could actually just make a generic function that takes one string as input and returns another.
And then just activate that function on every texture that exists in inventory.
And design it to simply return the same texture if an alternate doesn't exist in a table you made.
Yeah, presumably that would be fine. Or "", since it's a String. Guessing an empty String would be harmless.
you can use "default", "whisper", "shout", "radio"
does it have something to do with zombies hearing
I don't think so
k
I mean when you shout, it then leads to this but this doesn't cause any hearing
kk then
Do you know if Say(..., "shout") has behavior identical to SayShout()? I ask because I notice that SayShout(aThing) can be seen by other online players, whereas Say(aThing) cannot.
If I could make colorful shout text that is also visible online, it would be cool to know that.
the strings above do that
they change behaviour slightly
but Say can be used with one string or all the vars mentioned above
the final function is: private void ProcessSay
Wym by "in white"?
r,g,b = 1,1,1
I mean more specifically than that lol
The shout chat is hardcoded to not accept colors in the overhead speech bubbles afaik
Say code does different things depending on whisper/shout etc
In order to get say() working I MP for cnd speech I used a command
Woops meant green, i.e. default color.
Yeah fair. I just went with making my Say a SayShout. I know, I'm a bum.
Not all that important to what you're saying, but the speech bubble color differs per player (there's an option in settings to modify it under Multiplayer)
I didn't know about the option until recently either. I was adding that feature to my mod & then came across sendPersonalColor and was like ???
...I spent all night and day finishing the updates to this mod. 2,000 lines of painstakingly spliced strings (even with macros) https://steamcommunity.com/sharedfiles/filedetails/?id=2925239963
Now I have to do it all again just to merge them into one megamod ๐ฎโ๐จ
woah
My first render of my improved JSON parser:
There we go. =)
Time to convert things over.
...took a break at being frustrated by my code to go be frustrated with frozen pipes; ultimately decided the frustrating code is a better time.
fuck yea i got it working
enjoy
722 songs
:)
@prisma imp ^
got it working ayy
theres so many cassettes in containers now though lmao
probably because theres a lot of music added
lol
gotta catch em all
Happy to hear it!
Man, i hope it doesn't mess up the spawn drops with hundreds of cassettes
i will admit
i kinda wish there wasnt as many cassettes in some of the things lol
i wish you could adjust the rate
mfteotw has to use custom spawning logic to get around this
Imagine getting Rick Rolled in project zomboid
haha
its there
every banger
i do have songs after 1993 aswell but i wanted to stick to the lore
Technically you can. I think True Music makes the cassettes into individual items? If not, you can at least modify the "cassette" category in the procedural distribution injectors
That's a lot of songs
in the custom sandbox settings?
In the mod files. Lua code & txt script files
ah
yea i cant find any lua file that has anything about spawn rates
If you would like some help with tweaking the spawn rates for your mod, I can DM you what I'm referring to and explain them
It would be under lua\server iirc, not at PC rn
Alrighty, I'll get on that soon, ttyl ๐
yep
DMed
you can fix the commonality by changing the rarities in ur own distribution file but
this is so much easier
spawn in blind boxes basically
oh wow this is p neat
awesome, i'll give both options a try for sure
but if this makes it easier then i'll give this a shot aswell
the way ibrrus wrote the distribution example makes it a pain to tweak
they spawn in the same places
ah ok
just less frequent
yeah
the example for dist in true music has hardcoded values for each song even tho they are the same value
i wish he'd written the script to use a variable at the top or smth
then it'd be so easy
whenever i write distribution files for N things of a type
i always make the rarity a value then make the entries use rarity / #items
that way if i add more items they stay the same rarity
i also use loops instead of manually writing a line for each
easier
but mostly i just wish he'd put the value in a variable 
if anyone here wants to do in-house mod dev on an RP server with hardcore gameplay hmu i could really use other devs, it's just me and sporadically a friend of mine when he's available
i think in notepad++ you can change a ton of values that are the same at the same time
makes it faster
like what kind of mod dev ๐ง

