#mod_development
1 messages ยท Page 120 of 1
XD
@quasi kernel Idk if I can help or if my mod helped - but I tap into when item is rendered in the inventory and apply changes - there I also add it to a list as a key so it doesn't get reprocessed.
u can create ur own function for safe houses, just copy nonpvpzone from source and implement in lua, there's same logic
Ive done both checkers already thnx
How do I update a mod I've uploaded to the workshop?
I've tried sending an update twice over the last 14 or so hours and nothing has appeared on the modpage...
unless you're using the x,y,z for something else you can simplify all of that to local sqObj = getPlayer():getSquare()
Nevermind I'm an idiot and was thinking my local folder to edit mod files in is not the workshop folder on my c: drive lol
Attempting to use the knockout function for a storm mod,
i'm unsure of how to write a timer to force a wakeup
function timer:onFire()
local player = getPlayer()
if player and not player:isIndoors() then
player:knockOut()
end
end
``` :/ this is all i have so far
any one able to point me in the right direction :p
i don't see a knockOut() method
isIndoors() doesn't exist either, i'm not sure where you're getting these from?
it used to be on the wiki, seemed to still work
here is the current link for it but https://pzwiki.net/wiki/IsoPlayer_isIndoors
for the isIndoors()
if i remember correctly its a boolean method that returns true if the player is indoors and false if they are outdoors
actually not even sure this works but i swear someone else was using it in another storm mod to can find it here in a min
i've never seen pages like these, you should use the javadoc instead https://projectzomboid.com/modding/
package index
for an isIndoors() you can just invert player:isOutside()
o ya i use that too
but hmm, ok so is there something you know of that can replace the knockOut() method?
knockOut is it sleeping or actual knockout
i'm not really sure what that's supposed to do
im just trying to have the effect of the players screen going black essentially, so I guess the sleep function could work
method* fml
So if he is outside he goes to sleep?
where did u find it then? there's empty page
roflanebalo
i'm not an expert but maybe by getting the current weather and if its what you want make the player sleep check if player is already sleeping return nothing , and try using events as a timer there is one for each minute ingame,ten,Hours,Days. or OnChangeWeather Triggered when the weather is changing.
so does anyone have any interest on making the mini portable cassette player like Walkman WM -FX20/41?
like the walkman thats already in game?
but its disc
yeah
im not a modder so im not forcing everyone to get on it but it sure would be nice to have like the last time i ask about ODST armor mod ๐
like for true music? they just added a walkman
oh they did?
a few weeks ago if i remember
lovelyy thank you!~
Will a custom animation xml that matches a vanilla xml overwrite it?
Yes. Animation files that have the same path/name as vanilla ones will overwrite.
Cool
Hello... Does anyone know where the metal sheet and bar window barricade health is in the files? I've looked all throughout media/ and can't find
I'm trying to buff their health
@quasi kernel Hey can I DM you?
Oh yeah, go right ahead.
Are my DMs closed or somethin? If so, friend me rq
@thick karma
Nah just asking
Don wana be friends ei?
@ancient grail I meant no re. cosmic's DMs being closed. I was just making sure it was not going to be annoying.
heres one of the ways help server with their stucked vehicle
https://imgur.com/dM7hCuV
local vehicle = getPlayer():getVehicle()
vehicle:flipUpright();
vehicle:setAngles(ZombRand(0,6), ZombRand(0,6), ZombRand(0,6))
vehicle:setPhysicsActive(true)
there are debug UIs for doing that
besides this way needs too much actions
lol finally tomorrow when i get up and finish bug testing it will be alive!
Alright. I have now created a "cache" for all of the data that I need for the weapon damage and have changed the damage calculations to use this cache. Its soooooo much faster now. I also have changed up how I'm gathering targets. Went to go try it out and....
At least I know the damage stuff is actually working.
LOL
Looking for a guy, who could do some custom occupations to our server
Once the custom occupation have been chosen, player will get the ability to choose more clothing in character creation menu. We also need to remove all the vanilla occupations
What are the differences between OnCreatePlayer, OnCreateSurvivor and OnCreateLivingCharacter?
Anyone know if its possible to make custom attack animations for modded weapons? I want to make a new heavy attack animations for the sledgehammer type scrap weapons
iirc theres a parameter for specifying attack animation so yes
yep, but how would i create a new one?
A custom attack animation that doesnt exist in vanilla
Think they are remains from old code need to check the differences. They might also get use with npcs
That unfortunately i cant tell you its not my area
darn
Arent there animation xml files?
Yep, but i only know how to replace existing ones. not add new ones :c
Can you paste the content of one in chat
?
Im not home so cant look at them myself
hmm im gonna look into the brutal handiwork mod, it seems to add a new unarmed attack
also does anyone know where i can find the new vanilla melee sound files?
is there a specific resolution limit for the poster.png?
or can it be any picture?
I like the head bob. You should keep it 
is there any way to get real life time?
I am trying to make it so that a function is executed as a specific time of the day (irl) daily in a server
Say, if I want to call Recipe.GetItemTypes.CanOpener() in my Lua... How can I instantiate a new empty ArrayList to pass to that function?
~~oncreate is the main output function (sometimes the oncreate is used not only to generate item but also to interact with stuff since this is an easy function to setup)
ontest is a bool to show or hide the context, (an example would be if your hand is injured you cant do the function, or if youre taking meds you can check if youre sick)
onperform affects the result(like food you cook goes thru a logic that returns various results such as overcook)~~
damn i read that wrong
oncreate survicor and livingcharacter are mostly used for NPC functions
onCreatePlayer is well when you create your character
Oh, so only OnCreatePlayer can be used for a player?
Because my mod has OnCreatePlayer as an event and it for some reason also activates when you load in an existing game with a living character when the player character is technically created now
lmao
Best test ever
I kinda want to request this become a feature, just with a new animation
I still need to create a bunch of ArrayLists...
There is no walkie talkie tag, but there is also nothing stopping modders from adding whatever tags they want/need to items.
something like THE_SCRIPT_ITEM:getTags():Add("YOUR_NEW_TAG") should work; it's in the new items tag documentation.
From almost a year ago? Don't have a link offhand.
Would you happen to know if it's possible to make an instance on an ArrayList from Lua?
Oh, I'm not a detail guy; I can't answer any technical questions offhand, it's all "beep boop 1010101 sorcery" to my two brain cells; I just do low level handyman shit.
Ah, a shae
ArrayList.new(), I believe
it can't be that simple...
You're right, I lied. Your first step is to solve the P versus NP problem ||(this is not serious, the above should work)||
I need to run Recipe.GetItemTypes.*() a few times, and it takes an ArrayList as an argument... to fill it
but why
Autopatcher for recipes
but if youre trying to get the items you could just call on the script manager
and use for example getItemsTag
getItemsByType will return the same stuff as Recipe.GetItemTypes?
function Recipe.GetItemTypes.CanOpener(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("CanOpener"))
end
you could just call
getScriptManager():getItemsTag("CanOpener")

Right, you're telling me to reimplement these functions in my code
no im telling you to use the exact same functionality those functions use to reduce the number of calls
Okay... But for things like SharpKnife, I'll have to do
scriptItems:addAll(getScriptManager():getItemsTag("SharpKnife"))
addExistingItemType(scriptItems, "FlintKnife")
addExistingItemType(scriptItems, "HuntingKnife")
addExistingItemType(scriptItems, "KitchenKnife")
addExistingItemType(scriptItems, "Machete")
Are you adding eveything on a single table
addExistingItemType just check for duplicates
No, I will have several tables, this is why I need to make new ones
I dont get it but ok
i really dont see what youre going for there
I need to patch modded recipes that were written before the whole tag system was made... Like, if a different mod adds a new welding mask, my mod will fix recipes hardcoded to only the vanilla mask
But in that case wouldn't you just need to add the tag to the item and that's it?
So first, I'm trying to get the list of items for each of the types
The tag will automatically be detected and applied
So you want to compare the new list after its nodded with your copied original list
YOu only need to add it to the specific item
IT's not that the item isn't tagged. The recipes aren't written to use item tags
Oooh ok ok, got it now
And I'm trying to fix it
Well, in Lua, the recipe source is already an arrayList. Can only swap the contents
Im still lost but i have good faith he will follow through
Best of luck it sounds unnecesary but you seem to know what youre doing
...Maybe I should just shove the recipe source into the functions and call it a day
doSource("[Recipe.GetItemTypes.SharpKnife]")
What I get is that instead of having something like:
keep [Recipe.GetItemTypes.SharpKnife],
keep [Recipe.GetItemTypes.ChopTree],
Log,
The recipes are like:
Keep Axe/HandAxe
Keep HuntingKnife/KitchenKnife
Log
wait, is that what doSource does?
Whats doSource?! Wizardy unlocked
basically doParam for recipes
That makes this so simple
Hell yez thats mighty useful
No caching, just editing the recipe like it;s a frickin file
U might want ro add katana btw
Here

that's outside the scope of the mod
which older mod are you referring to?
I don't know which older mod, I'm working with 500 mods at once
I saw some car mods tho
But doesn't that replace the whole source tho
ughh try getSource():clear() before
No, no, I need to like... Replace only a single... Source Item in there?
if I want to set it with DoSource, I'll have to extract the rest of the source first, won't I?
you can FindIndexOf then getSource():remove(index)
and DoSource adds onto the array of sources?
or findSource("ItemType") then getSource():remove(SourceObject)
if what you said is true then yes
Hmm, from what it seems, DoSource does append to the array
So I do need to delete the old faulty line... Which is the trigger source for me, so no worries
hey guys, finally got into making my first mod. want to know if this simple recipe is correctly coded
module Store
{
imports {
Base
}
recipe Craft Money
{
SheetPaper2;1,
Result:Money=10,
CanBeDoneFromFloor:true,
Time:25.0,
Category:Shop,
}
}
Okay so i need help with my spawnpoints.lua
what are the names for all the professions? as I am having issues with my revamped mod spawning in other places not the ones in the lua.
unemployed
fireofficer
policeofficer
parkranger
constructionworker
securityguard
carpenter
burglar
chef
repairman
farmer
fisherman
doctor
veteran
nurse
lumberjack
fitnessInstructor
burgerflipper
electrician
engineer
metalworker
mechanics
Good morning.
so mechanics not mechanic?
that didnt work can someone dm me and see my lua what is going on is weird
Probably better luck just posting the relevant bits here
Anyone know where i can find the new sound files for melee weapons?
im assuming they are hidden somewhere
is it one of these? how do i open these 
Can anyone help me determine what these errors mean and how I can fix it? I got it when I was adding clothing options to an item I was making. I think it is tied to them having the same display name but from I can tell the hoodie works the same way
Here i am again asking about tweaking... sorry XDD Whats the best and safest way to modify vehicle characteristics without an overwrite or vehicletweaker? is there any kind of doparam script type for vehicles? on this style i meanlocal vehicle = scriptManager.instance:getVehicle("Base.Van") if vehicle then vehicle:DoParam("engineLoudness = 80") end
u shud really ccut the error out of the log and post it alone
u'll get more people to read it
good point but I did figure it out
You just have to find the actual error
How do I make a recipte return you 2 items as the result?
the error had to do with how I did my recipe. I undid the change and it fixed it
function YourFunctionName(items, result, player)
local inv = getPlayer():getInventory()
inv:AddItem("Base.Crowbar")
inv:AddItem("Base.Apple")
end
I think I might be able to figure that out. thank you. also You had talk,ed to me about this before but how do I have it tranfer condition to the new item?
in my case I am taking a weapon and turning it into clothing and then a recipe to undo it
and turn it back into a weapon
you need to store the specific param to a moddata on the result item
and when you convert back then transfer it back to the thing
Can I get an example? 
also where would something like this go in the lua area?
yep
client server or shared?
Howdy, I'm just dipping my toe into the PZ modding scene. I've scanned over the wiki's modding section, but I was wondering if there was a user friendly guide on getting a simple basic mod started to familiarise myself with the debug environment and mod directory structure?
i just had the most fucked up workshop upload experience
a few days ago i updated a script.. yesterday i uploaded a copy of the mod the script is in, and it worked, the new content was there, and there's an error in the script from a few days ago
i go to look at the script
and it's an ancient copy from before those updates
Best advice i can do is: reverse engineer like crazy, doc is scarce but is being built in a solid way; also don't fear asking
but it's IN THE FOLDER I JUST UPLOADED FROM
but in the workshop copy it's current
i may have reverted the script inadvertantly
but why did it not upload that..
madness
workshop momento
Cheers, I've started having a play about with it through trial and error, getting some crazy errors in debug mode and not quite sure what's going on ๐ - such is the way with modding I guess!
the live copy should have had no syntax error
had that happening to me with stellaris on wednesdays/thursdays
but been old
wost days for updating
but it was new copy w/ error
that my workshop folder did not have
blows my mind
cant even trust the upload button now
server
Does somebody knows where to check the annotated maps code? I would like to confirm if they spawn forever or after certain time they stop appearing
Gotcha. How do I determine where these things go in the future? I'm sure it's self explanatory but if it isn't copy pasting and making minor tweaks I am genuinely clueless
look for anything related to "stash"
check the threads for guides
you will hear various opinions on this subject matter but its just how modders organize the thing
They really need to make those more noticeable
So in reality you could just plop them right in the lua folder then? I figured these things needed to have proper file structure
theads are new to us the option just prettymuch opened less than a month ago
no
from sir fenris guide
media/lua/shared/
Used for lua scripts shared by client and server-side logic. These are the first Lua scripts that get loaded.
media/lua/client/
Used for client-side scripts. UI elements, context menus timed actions and the like. These get loaded after any 'shared' lua scripts.
media/lua/server/
Used for server-side scripts. Item spawning, core farming, weather and other server-side events. These only get loaded when the game is actually started (loading a save, starting a server, etc).```
there are more explanation by other modders i just happen to saw this first . we all should read the materials . they are valuable
oh, does client loads first than server? ๐ฎ
So I have another question. For my mod I can craft a weapon item into a clothing item and then turn it back. Now I am going to make it so the condition transfers over but here is another issue. Is it possible for that weapon to store patch and blood location data in case I craft the weapon back into a clothing item?
if you guys see some guides thats not yet there kindly share and post it
Or should I just make the clothing no repairable and dodge the issue all together
Blood saving on the texture between the two would be nice but is a lesser concern
if your purpose is to learn then do nt give up if your puropose is to add to the mod cuz people wanted it to be that way thats up to your discretion
is there in item options something like icon scale?
I'm willing to learn and would like to be able to do it but I'm concerned it isn't possible since weapons can't take patches
im not that knowledgable when it comes to UI related stuff just ask again later when the comss more active
you can add your own thing
like give it property and do some stuf with it
if you look at the lucky plushie mod
check the item
it has a moddata
i mean something not as self UI icon but when item dont have ground model then on ground will be placed resized icon of that item... then there is option to resize it ?
do we have here any ui spec?
Bit of a newb question, what's the best way to debug a mod when you get the little error prompt's in the bottom right?
error maginfier
Thanks, that a handy tool ti diagnose your own mod dev?
chucks
Sorry, chucks?
Ahh gotcha, yeah, got it up and running, thanks ๐
Is there a place within the game directory that I can find the name of the base objects? Trying to figure out why its returning nil on
if not player:hasItemType("Screwdriver") - (assume Screwdriver isn't the right name for a screwdriver obj by that error)
are you running in debug mode?
I'm not, I did try - but couldn't work out for the life of me how to navigate it/get into a save to debug in runtime. The workshop add-in Glytch3r suggested seemed to give me the error clarification though
i really recommend using debug mode, it gives you a lua console and you can examine memory at the time of an error or a breakpoint and stuff like that
I'll give it another whirl, is the debug UI meant to permanently stay up, or is it toggleable?
oh hang on, it's behaving now
Not sure what the first try was all about!
What mod is this going to be for?
I like that you dont have to exit the game to reload the lua, that's a great modding feature tonnes of other games are lacking
dpends on the case
aa gun mod with cusotm animation
assume object scripts and such need a reload?
if youre function runs on events like postdistrib
or oncreatecharacter stuff like that
you would have to restart everytime
Gotcha
then tell me one of them can help me with resize that ground icon?
what are you talking about the "alot" was directed to demeggy i already told you i dont know
I will say that if it's an item you can assign the item to scripts and overwrite it
you have to make sure everything matches and you have to redo model folder and file also
but i dont think you can scale up
only down
i guess it would depend on what it is also, i think icon can scale so much. you will tell if it dont work because it will start to discolor
Burryaga might know but not sure if its for icon afaik its draw or something.
Is there a list of functions somewhere that I can refer to?
you just need the icons extracted from the pack to do it is all
yeah that what i need
drop mod to workshop folder then go to game and hit mods and upload mod
which workshop folder
username/zomboid/workshop
wait how you got specialist role if you dont know how to upload mod ?
good question
also not everyone who is specialist are modders
sems be fair but then what the roles are for ?
withone im
where is faq for roles (and state of msg) ?
i don't know, but most vets know
ask them in the main chat
that is false info
if look upper
honestly does it matter
yes
better with blade than with hammer
haha
you get xp once a min per message, so if you send 1 message and 10 messages in 1 minute, it will have the same effect
if that's your mindset then i think your icon in discord is the least of your worries
nah that was just questioned from start how the roles works and how to have more than one of them
well i hope you get it and help many people along the way ๐
without that i help ppl ;D
good stuff man
so blair is writing an story...

maybe some tutorial how to scale icons on ground

with that what you said can be problem due there is none model for that (ground one) so game put force not scaled icon on ground as replace of model
so in game you got 32x32 icon on ground (and that i want to resize like to make it smaller without making separated model)
my preview is a png but when i try to upload the mod it says the preview pic format is unreadable
post it here
big boi
okay try THAT one
also, image sizes work best when in powers of 2
632 is not. lol
512 is the closest so that's what i made it.

oh COME ON
OH FFS
i had less trouble modding fallout
let's hope for the best
alr
it's uploaded
now time to find it in the workshop
wait what
oh my GOD
they just make sure it's not something SUPER offensive.
Anyway to make my debug scenario appear first in the list of debug scenarios? Also any existing way to quickly reload a scenario from within game, so I don't have to go back to the main menu and click it again?
yes scrolling is too much work
So writing a proper lexer for ZedScript allows me to also conveniently provide a linter for ZedScript. Yay.
I could provide info for lexical errors as such:
LexicalError: /media/scripts/a_script.txt:53:4 Unexpected '}'
Something like this would allow modders to quickly check their scripts for syntax errors.
it's been like 20 mins, i still can't share my mod? wtf
it probably had an error code uploading you missed
probably
how do i check
upload again
fair enough
if it didnt work before it most likey wont again
it will be sneaky also
will act like it was good and seem like it, but will end with an error code instead of saying complete
yea i'd think so for sure
not sure. thats weird
don't got the mental capacity for that
is it set to private?
if thats it... LOL
This may be a stupid question, but assuming that i have a IsoDoor object, how do i open it?
sorry I just keep getting same questions on steam every day, even though it's all there in description

can controllers users use combobox?
what are most accessible menu ui elements for controllers?
hm, should walking on nails be dangerous
or some of the regular items block movement
Only if barefoot and running
Or falling
When I create a new perk, it is different from the exp levels I set, and when I add exp, it is not added as much as the whole number I added, I wonder why?
all xp gain is quartered for characters with no starting skill, and level boundaries are 1.5x
ohh okay thank you
There are several fairly accessible methods; the ISScrollingListBox has built-in support, ISModalDialog can return you to your prior focus pretty easily, ISPanelJoypad is the standard base for fancy joypad-friendly UIs... what are you trying to do?
Anyone have any idea why uniquerecipe's might not be working?
uniquerecipe TEST
{
BaseRecipeItem:Base.PiePrep,
Item:farming.Strewberrie,
Item:farming.Strewberrie,
Item:Base.CannedMilkOpen,
Item:Base.CannedMilkOpen,
Hapiness:30,
Boredom:30,
}
This is my code but when I test it in game I just get https://i.imgur.com/6KUizXK.png
I've based my code off of the base game's example in uniquerecipes.txt
but even sneakers would not be safe irl
are we to assume your horrid spelling of strawberries in on purpose?
yes
that is actually the game's spelling ๐
it hurt my soul to learn that the id was actually that
True.
I know from personal experience.
I tried again with BaseRecipeItem being Base.PieWholeRawSweet which is the item ID of the pie preparation when it's turned into a sweet pie but still no luck.
i'm not sure if this is the issue here, but i actually remember someone's item was being refused because the name was something like test
this is a very bad copy paste
?
you got like 4/11 lines right
Care to elaborate?
evolvedrecipe Sandwich
{
BaseItem:BreadSlices,
MaxItems:4,
ResultItem:Sandwich,
Name:Make Sandwich,
}
lol
Actually drinking
My sorry body can code best when buzzed tho.
ยฏ_(ใ)_/ยฏ
export abstract class Lexer {
abstract onNext(data: LexerData): void;
}
export type LexerCursor = {
row: number;
column: number;
};
export type LexerData = {
/** All tokens generated are stored here. */
tokens: LexerToken[];
token: LexerToken;
start: LexerCursor;
current: LexerCursor;
};
export type LexerToken = {
loc: { start: LexerCursor; stop: LexerCursor };
value: string;
};
you spell hapiness wrong also
i did check to see if game spells it that way and i dont see it
Bored. Going to stream it why tf not
it does for unique recipes
lol wtf
lmao
jesus fuck someone needs to learn to spell. imagine trying to troubleshoot somethign with shit spelling
a lot of the developers aren't native english speakers
i guess im not familiar how coding works with non native english speakers
is everything always in english only?
I'd assume so?
the syntax for that threw me off from the start
i get that. just no way any translator would get that spelling wrong. but i'm guessing they are just coding in english from start to finish which would make sense. didn't consider it
I didn't really pay attention to the spelling because I just Ctrl+C and Ctrl+V.
Not sure what I did but now the base game code isn't working
can't make a 'This Cake is a Lie' cake for some reason now
it didn't get it to work for me, but i think you might need BaseRecipeItem:Base.PieWholeRawSweet,
shouldn't the base for this be a pie instead? ~ sleepy guy
I've tried with Base.PiePrep and Base.PieWholeRawSweet. None seem to work.
don't include module in BaseRecipeItem
BaseRecipeItem:PieWholeRawSweet,
the check for if a uniquerecipe applies doesn't account for module at all and including it will cause it to always fail
it compares PieWholeRawSweet and Base.PieWholeRawSweet, and obviously they aren't the same, so it doesn't work
i didn't test it on your exact recipe so i can't say if that's the only problem, but it is definitely one thing stopping it from working
Ok well It didn't work but that could be related to the base game unique recipes not working either.
It would seem using module Base doesn't work so I'm gonna try my own module.
what i currently have
{
uniquerecipe Epic Strawberry Pie
{
BaseRecipeItem:PieWholeRawSweet,
Item:farming.Strewberrie,
Item:farming.Strewberrie,
Item:Base.CannedMilkOpen,
Item:Base.CannedMilkOpen,
Hapiness:30,
Boredom:30,
}
}``` seems to break the vanilla uniquerecipes
wait the fuck
I break vanilla but my stuff works?
is the file named the same?
damn u right
it is
didn't think about that
It was originally different but i made it the same when I was trying to fix it
I have been up very log long like you and I'm just butchering everything
Is there an easy way to remove some experience from a skill and prevent it from going negative values, or should I set it back to 0 and then add the new desired total experience?
Or if you have a suggestion for a mod that makes us lose some skill points over time, I can review it.
Thank you @bronze yoke. That worked. Oddly though, you must have module Base and you can't have a different module that imports Base not sure if I just lack an understanding of how all this works or It's just a weird quirk.
i didn't check the code for anything like that, but it wouldn't shock me
most of the newer features don't support modules other than base correctly
damn that's weird, hope it's not the same for build 42 or my 5000 lines of recipe code is totally screwed.
hello if you read this and know what you're doing in regard to PZ modding please respond to this message
what's up?
do you know where the metal barricade (metal sheet and metal bar) health amounts are in the files?
Ive looked everywhere and can't find them
In progress writing Lexer for ZedScript. So far so good.
do you mean debug item spawner?
it's just programmed wrong, modded icons will never show up in there
-- remove some xp from total
local totalXP = playerXP:getXP(Perks.Religion) - randomExpAmount
-- get a value between min-max limits of the perk, 0 and 1500,
totalXP = math.max(math.min(totalXP, 1500), 0)
-- reset perk's level to 0 and clear all exp from it
player:level0(Perks.Religion)
playerXP:setXPToLevel(Perks.Religion, 0)
-- add new calculated xp to perk
playerXP:AddXP(Perks.Religion, (totalXP * 4))
Is there a better way than this one to remove some exp from a skill because it plays level up sound and shows +1 for the skill ๐
unfair
I just wrote a basic lexer for ZedScript that is 90 lines long.
Wow.
A clean lexer implementation \o/

local character = getPlayer()
local perk = Perks.Religion
local perk_level = character:getPerkLevel(perk)
local exp_obj = character:getXp()
local total_perk_exp = exp_obj:getXP(perk)
local exp_sub = 1000
if exp_sub > total_exp - perk:getTotalXpForLevel(perk_level) then
character:LoseLevel(perk)
end
exp_obj:AddXP(perk, -exp_sub)
yay! thank you, i achieved what i wanted to
Hello everyone ๐ Can some awesome people help me? I created this tile, and managed to get it running in-game, what I want to know now is:
- How can I make it a recipe so people can craft it?
- How can I create menus so people can interact with it when pressing right click, via context menu or radial menu?
I'd appreciate it a lot!
It's been a few days since I started making mods, so I don't know the answer to the 1st question but for the 2nd question, you can look at this mod. It checks if you click on a piano and shows its content https://steamcommunity.com/sharedfiles/filedetails/?id=2465017864&searchtext=piano
I love you 3000, let me check it out ๐
Do you have to rig armor after you make it in blender? Are there tutorials for how to make them work on the characters and implement it into the game?
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
ironically i was working on this today as well. 170 lines, but more blanks, and this was designed to mirror the java originally, basically a drop-in-replacement as far as the lua is concerned. file handling and object creation handled elsewhere.
How much performance/overhead does EveryOneMinute have on the game
obviously that would depend on what you are doing with it ๐
i use it for testing all the time for random things and it's not noticeable. it's def not as bad as loadgridsquare
even though that is still comparing apples to oranges i suppose ahaha
i wouldn't worry about it much; if you get bad lag from EveryOneMinute it's probably not the event that's the problem
what kind of answer do you expect to hear? hz or bites? 
depends on what are u doing in this event
by itself it do nothing
welp, i deleted my mod from the workshop so i can upload it again, then this happend
mine doesn't have the public option there

welp, doesn't matter anyways, the mod is broken
Could just set it in the mod.infoworkshop.txt file to public.. though if the workshop doesn't give you the option, it may ignore that
you're thinking of the workshop.txt
Yes, that lolz
I'll take a look tomorrow. Can't see the code on mobile. Good stuff though.
I'll need to follow the same rules for how to tokenize ZedScript.
bitten trait has gotten some fans already
i guess mine is popular in servers
since the numbers make no sense...
almost 3x more subs than visitors
I got one that's gonna be pretty easy if i can get the time crap to read right.
and @red tiger i followed your advice and added a way to pass lua code to my mod from the app
kinda buggy still
but it works... 80% of the time ๐
probably something wrong when deserializing the json on the lua side
tell me what % of players would intentionally install a trait that makes you start the game bitten
it's a dumb mod ofc most ppl wouldnt actually use it
the fact that anyone is using it at all is enough to make me proud
Hi there, does anyone know how I can get rid of all vanilla recipes? Trying to make a medieval overhaul mod and need to get rid of all the vanilla recipes
it will be used for when they have cure mods
if you scroll up a bit browser mentioned a doparam but recipe version
context menu codes. i us AUD as reference

basically yeah, but in reality most ppl dont wanna start bitten or have a cure
Uhm?
and it's also a standalone mod for 1 trait which is part of the unreleased mod with many added occupations and traits in it
but i still made it for fun
is there an already implemented method to generate an id for an object?
found one made by Aiteron
You're right to be happy that anyone is benefitting from your mod. That comment to which you were responding was totally unnecessary.
Congrats
Your mod is a niche modโmost people don't want to begin the game bitten. Subscription rate means nothing on a mod like that.
if it's fun to make who cares
IsoObjects getID() should already be unique and technically save
is that a static method?
Otherwise you can generate one using an exposed method (I think it's getUUID())
or is that just to get the ID from an already existing object?
I forget what static means in Java - but if you mean if it saves I believe so - at least for inventory items I tested it on
Static means that you do not instantiate it
A static thing is accessed the way it's made, e.g., a Math class would commonly be static, because you don't need to create an object to perform many mathematical operations.
Oh damn
- youโd need to define the tile as a moveable in a .txt file and the call it as a result in a crafting recipe
- You need to hook on the context menu with the Event OnPreFillWorldObjectContextMenu (or OnFillWorldObjectContextMene but i prefer the former)
Thats how i did for my mod with exactly those isssues
Makes it so injuries simply never get better - bleeding can be stopped while bandaged, that's it
All it does is grab the highest value the injury timers were, and reapplies it.
I might have to rename it to "No Healing Challenge" or something
That sounds like a good name
Yeah
It's more brutal than that, if you trip or get scratched it just stays there forever
You can bandage it to cover it but then you have to keep changing them out
Also your health never goes back up
๐
Anyone know if there's a file I can view that dictates how the scripts work? Trying to figure out everything I can do with uniquerecipes.
It's a system that works with the evolved recipes.
Basically if you put certain items together it'll give bonus's and change the name
I don't think so.
Recipes are easy, add a text file that looks like this into the scripts folder of your mod.
The '/' between metalbar and metalpipe means you can use either of them to make the recipe.
Separate every necessary item with a new line
Is there any lower level info out there on vehicle stats? Such as how the gear ratios are calculated (since there's no final drive), what units the values are, so forth.
I'm wondering to some extent how the game engine would cope with using more realistic values for engine force, gear ratios and mass. I assume the suspension and wheel friction would also need touching as a result of it.
But I have not found any info on what the values are based on, what units they are, how exactly they influence the game (it may not act the same way as irl)
@young edge you look at this stuff?
https://zomboid-javadoc.com/41.65/zombie/core/physics/CarController.html
Javadoc Project Zomboid Modding API declaration: package: zombie.core.physics, class: CarController
I haven't yet. Will do in just a second
Hmm. Those are the functions and structure, but not the actual values themselves
Javadoc Project Zomboid Modding API declaration: package: zombie.vehicles, class: BaseVehicle
maybe you want this class? and the classes it extends?
Happiness with two p's?
That's pretty cool. Glad to help you with your project concepts.
@quasi geode Have you tested your parser against all item categories?
I decided to revisit my tokenizer because of how different recipes is (And also how horrible my code was for that)
It's like that in the actual code.
yeah sorry I was just reading further up and seeing that
Why use this? The official JavaDocs are updated. Use https://projectzomboid.com/modding/zombie/vehicles/BaseVehicle.html
declaration: package: zombie.vehicles, class: BaseVehicle
My only problem is that unique recipes doesn't work with spices.
It doesn't register it under Item because it's not under 'Contains:` in game.
mostly. its basically part of a 1-for-1 port of the java code I wrote years back, just spent yesterday bringing it back to life and cleaning it up. Basically atm the only thing i havent tested it on recently is vehicles
Hmm ok thanks for letting me know. My tokenizer is very simple however I don't have one parser working in my solution. I arbitrate to contextualized AST data and then the JSON result.
I wrote in location data for a future linter.
I don't know how exactly the format can be in terms of bracing vs spacing requirements etc.
So that'll need to be known for a linter to be made and be consistent with the language specifications.
=/
All my current lexer does is detect words as tokens, terminating on either spaces or \n.
this doesnt really do anything with the results atm except load them into python objects. but then, options lol. its valid reading key / value types from json templates so does some data type conversion from str and error checking
Does the game have a way of cleaning up panels that are invisible, no longer on the manager, and no longer assigned to any Lua variables? If not, what is a good way to fundamentally destroy an ISPanelJoypad in both Lua and Java when I'm done with it?
I'll need to know things like if in recipe, Stick=1;.. can be Stick = 1 ; ..
or module Base{ instead of ```module Base
{
..
no idea, havent dug into the UI system really
ya, thats why i just ported the java code pretty much exactly. save the hassle of potential parsing inconsistencies
No biggie... I don't think these panels could ever realistically cause a memory issue by nature but you never know... I figure you would have to open a whooooole lot of them, since they seem fairly data-light
It'd be simple for the Java one since everything is initially handled as strings and are parsed when loaded.
A lot of the work in my current design is early detection of data types for assignments and hard-coding those types into objects that has all the pre-defined properties as fields.
Here's the item category "Weapon": https://github.com/asledgehammer/ZedScriptParser/blob/main/src/api/item/WeaponItem.ts
i cheated. had it parse, any new key/value pair a block it would write the key and its value into a json file. the json went through 4 basic regex's so its "weight": "float", etc
It's not cheating. You're doing what the Java code does like you said.
see thats exactly how mine was before, all hardcoded
The reason I hard-code it is because it's literally the rules in the language for these reserved properties.
It also helps someone who may use the API.
It's only what, 600ish properties?
Just a little bit of arthritis medication and some typing and then it'll be done until updates to the language are made.
Also, what's the situation with this scripting language's name? Will it be ok to keep using "ZedScript" as a placeholder? I plan to publish my work to npmjs when it's ready.
Thanks for getting back to me so soon and providing your Python example.
https://github.com/FWolfe/pyZomboid/blob/master/zomboid/scripting/objects/item.py
lol, the old version i did ages ago
I dont know if it has a actual name
When speaking with Aiteron about this, we agreed on a placeholder name "ZedScript" until another name is made official. (Or that one is)
personally I like it. any json variation could be labelled UnZedScript ๐
Haha. I like that. It's creative.
Yeah. My only concern is publishing under a name that is then incorrect if another name takes its place.
I see. You didn't split up into sub-categories for items.
ya no idea there. I'm officially clueless on that one
i vote ZedScript
All good. I'm cautious, not expecting. <3
good name for it
naw the parser doesnt define between item types really, not until its actually spawning instances of InventoryItem
I will use my ZedScript solution to then write my visual application for managing scripts.
its simple java garbage collection, if no object references it then it gets disposed of
but ya, that was the old variant for items. simplified it now dont need it all hardcoded and complex
much easier to work with XD
Hello to all
i'm creating a custom profession using the profession framework
i want to add to inventory a piece of paper with a custom text on it, i tried different approach but nothing appear to work, i can have in inventory the piece of paper / notebook but not able to set a custom text in it, any idea?
Cool thank you for confirming this. I wasn't sure if maybe in the Java side of the game there was a Java variable holding my panel data.
I understand if no variables reference data, Java collects garbage, but I wasn't sure how the game stored references to my Lua tables in Java
Esp half-java stuff like panels
Up to what you use it for. In my case it'll be easier to handle hard-coded properties when presenting them in a GUI.
That include UIElement inits and such
If you don't need to know all of that for what you do then your parser works.
ya the hardcoded variant was for parsing scripts and executing the good chunks of the lua in python (up to the main menu, and all the code i needed to error check and test ORGM)
now i just need a basic parser without all the lua compat so doesnt need to be complex
Huh.. That sounds like a complex project.
Hahah I'm saying this while writing a 1:1 transpiler for Lua to Typescript.
I almost want to think that you've tried Jython at some point.
not as much as you think. lol. it was pretty hacked together. lots of duct tape. the lua / python was seemless though, lupa library
oooh a library I don't know.
I havent messed with Jython. and Lupa is awesome
I paused my transpiler because I felt that what I'm doing with the scripts right now is a more immediate help to modders than upgrading PipeWrench.
Most of the questions I see in here are people who are lost in the technicalities of scripting. =/
Let me know if this parser needs something to support another project or help out with some other tool. =)
not sure where its going yet. currently directing it towards bug hunting lol
If I could suggest one thing for the b42 schema for ZedScript, use null instead of empty strings with commas.
or nil to familiarize with Lua.
I believe I saw some of that empty string with commas when defining sounds.
hrm ya i spotted some yesterday too
There's a def without a , before a } and a ,, that I interpreted originally as a syntax error.
Replacing ,, with , fixed it for my parser.
Explicit nils or unsets would help show what's going on to readers.
For non-programmers, none might be good.
, isnt needed before } If i'm remebering right (sorry its been a few years since i really looked at all this) files arent split by newlines at all (they get stripped), key value pairs are inside any block are split by , which is why the last entry in a block before } doesnt need it.
,, just feeds it a extra blank key/value, which doesnt conform so it gets tossed
i really should double check though, as i said its been a while since i really looked and my memory is crap.
All good and no rush.
I can write in a check to handle those situations.
this is a code-side reference, not a technical reference.
It doesn't show whether the sound is input as decibel, the engine power is measured in hp, etc. etc.
currently theres no way to import existing animations into blender right?
No but you can import and export using fragMOTION if you're desperate. @hollow shadow
im not that desperate :<
Lmao
I think honestly rebuilding the neutral state in Blender and working from there using the IK Template is easiest
And obviously that's a headache
But it's better than frag...
I might need to move the priority up for my planned attempt to fix the importer for blender. =/
Ummm is getModData not a global?
I saw it in GlobalObject but it's not working from the debug console
If you COULD get .X importing properly into Blender, that would be super clutch lmao. End the reign of fragmotive terror.
ModData.getOrCreate(string)
Mmmmmmm ty
I actually had the some exact question, so to clarify, it's global? so I shouldn't get the mod data of a player and assume that it will be a different object for each player?
The mod data of the player is bound to the player. For my purposes, I want the global one.
got it
I think i was using a global one earlier by using the time object or something silly, glad to know there is a less hacky way to do it
I wrote the blender scripts for the legacy format in 2015. =]
actually while i'm here. is the IsoPlayer unique to each account on a server or unique to a character?
Online ID IIRC
Does that mean each time you connect you get a new IsoPlayer?
An object? Yes.
I may start adding some of these answers to the wiki lmao, so i hope you don't mind the clarifying question
I guess, is there some unique identifier on the IsoPlayer that is shared accross play sessions
There should be a transient ID. Probably username
got it thanks
Do I need ModData.transmit("ModDataModule") at the end?
steamid 
Obv won't work for non-steam
Username is unique to the account logged in

what will happen if nicknames are same? 
You use the username which is unique in the SQLite db file.
idk how pirate version is working 
Hi! Do you also want to make it so that your character has a start weapon attached as in the mod you mentioned as an example? Or do you just want to put the item in the player's inventory? (the later is easier than the former)
You don't have to break non-steam compatibility to simply identify user accounts. =/
How do i make a trait unremovable from a profession?
Evening. I've been following the comprehensive step by step on getting a model from Blender to the game, but I'm just curious before I begin, is there a way of ensuring you've got a relatively close scale before going ahead? Can we import existing models to base scale on?
I'M NOT SURE but as I know there's scale parameter exactly in pz scripts
better to ask in #modeling
Ah, whoops - thanks! My bad
np 
basic Lua API question since I'm working on the wiki. Basically all interactions with Lua API objects (like IsoPlayer) will be through function calls yeah? I can't remember if I ever get or set fields from those objects or not.
This is done by the code profession:addFreeTrait("yourTraitHere"). In order to achieve this without buggy behavior, it is the best idea if you first make a new version of the trait you want to assign (a "fake version" of it). Then, when game starts, remove the fake version and exchange it with the actual trait.
Here is also a minimal code example giving you an idea how this can be realized (in case you are wondering). But code is NOT tested and may NOT work properly! Just a rough idea I made up in my head.
and you still need to add profession:addFreeTrait("FakeOutdoorsman") to your profession ofc....
Heya @cunning canyon (Apologies for the ping) - also, hello everyone else o/
Could I DM you regarding an inquiry about Save our Station?
It's a bit of an odd one, so it's probably better suited for DM (and also to not bury other conversations)
go for it
I've created a simple clone of the wardrobe as a tester object whilst I experiment with modding, just wondering how I can spawn it in via the debug menu?
which one is better?
an autoban function for server specific mods
so that we dont worry about forgeting to ban whenever we wipe
Events.OnGameStart.Add(function()
if (getCore():getDebug() or isAdmin()) then
SendCommandToServer("/banid \"" .. 7656119946686483 .. "\"");
SendCommandToServer("/banid \"" .. 76561198103847778 .. "\"");
SendCommandToServer("/banid \"" .. 76561198373590963 .. "\"");
SendCommandToServer("/banid \"" .. 76561199466864843 .. "\"");
SendCommandToServer("/banid \"" .. 76561199257636303 .. "\"");
end
end)
or
Events.OnServerStarted.Add(function()
if (getCore():getDebug() or isAdmin()) then
SendCommandToServer("/banid \"" .. 7656119946686483 .. "\"");
SendCommandToServer("/banid \"" .. 76561198103847778 .. "\"");
SendCommandToServer("/banid \"" .. 76561198373590963 .. "\"");
SendCommandToServer("/banid \"" .. 76561199466864843 .. "\"");
SendCommandToServer("/banid \"" .. 76561199257636303 .. "\"");
end
end)
and it should go to server right?
woops no
client
a tile?
use the tile picker
brush tool
good idea
but why not jsut remove the traits
It's a custom model item using the container type
so its a bag
its a clothing
so you need xml files
why didn't u just use server ban function?
I literally copied the wardrobe object script and changed a few parameters assuming that would do the job?
how
i dunno that works
where
im not familiar with the wordrobe you are talking about
is that vanilla
Aye, standard wardrobe. I see it in the items list now, think I borked the script for the file somehow. The object's got a missing symbol over it though, so I assume it's missing a texture or something
me too but it should be somewhere otherwise how client command works then he-he
welp if this works then i dont need to refactor for just something that isnt really special
hey vishnya you know abt this wordrobe thing his talking about
wooops his gone
doesn't my code removes the trait from player? maybe I forgot smth....
local vanilla_DoTraits = BaseGameCharacterDetails.DoTraits
function BaseGameCharacterDetails.DoTraits(...)
vanilla_DoTraits(...)
TraitFactory.addTrait("FakeAdrenalineJunkie", getText("UI_trait_adrenalinejunkie"), 0, getText("UI_trait_adrenalinejunkiedesc"), true)
TraitFactory.setMutualExclusive("FakeAdrenalineJunkie", "AdrenalineJunkie")
end
function SwapTraits(player)
if player:HasTrait("FakeAdrenalineJunkie") then
player:getTraits():remove("FakeAdrenalineJunkie")
player:getTraits():add("AdrenalineJunkie")
end
end
Events.OnNewGame.Add(SwapTraits)
local pilot = ProfessionFactory.addProfession("pilot", getText("UI_prof_pilot"), "profession_pilot2", -6);
pilot:addFreeTrait("FakeAdrenalineJunkie");
pilot:addXPBoost(Perks.Fitness, 2)
pilot:addXPBoost(Perks.Sprinting, 3)
pilot:addXPBoost(Perks.Aiming, 2)
pilot:addXPBoost(Perks.Nimble, 2)```
is this how it should look?
Oh boy, I must be an idiot. I've just realised that furniture objects in the game are sprites; it's only world items like weapons, clothes and the likes that are models ๐คฆ
in the next update they will look 3d, but they said they will still remain as 2d tiles
Ah that's good to know, thanks
ah yes texture mapping. looking forward to it
I don't suppose there's any handy links or tutorials on custom sprite creation is there? I can't find anything to do with it, nor texturepacks. Essentially I'd like to reverse engineer a piece of furniture like that Jukebox. I've figured out how to create the object, and can that I need to reference a sprite, but beyond that, I'm stumped
Wish I had time today to work on my parser. =(
https://theindiestone.com/forums/index.php?/topic/8790-custom-texture-packs-and-tile-definitions/
https://theindiestone.com/forums/index.php?/topic/25706-custom-tile-templates/
Custom .pack files If you have custom map tiles, you will need to create a .pack file containing those tiles for the game to load. This can be done using the "Create .pack file..." command, found in the Tools menu in TileZed. Place your tilesets into a directory, then click the + button to add th...
Floor Tile Template: The red square tile is the base, brown blending tiles are for dirt/sandy blends while the green ones are for grassy blends. Difference is subtle and probably doesn't matter too much though. Each tile is 128x256, so these would go with the 2x textures. Example: Spoiler Wall Ti...
Many thanks!
u can check more guides here
https://rentry.co/BluesModClues
u r welcome 
Oh those links are very handy!
it does but you also added anew one .. so why not jsut remove it?\
So today I discovered that a whole bunch of people are now being taught the terms upper camel case and lower camel case instead of PascalCase and camelCase... Does anyone have any sources on when this began? Is this just differences in international convention or new programmers using words in a sloppy way or what?
I guess this makes me ancient.
I'm over here working on lexical analysis and these guys are like "Plus the strings!"
Not sure I follow what you are implying
Makes it sound like newer programmers are doing it.
PascalCase is not camelCase so it's even more strange to hear it like this.
Oh. I mean did anyone talk that way 20 years ago? It seems like a terrible move if it's a new development given that it makes "camel case" a worthless phrase by itself and makes me have to use more words to convey the same idea, but I am obviously a wookiee so don't mind me
I personally couldn't tell you because 20 years ago I was a mapper and not a programmer when modding games.
I am seeing MULTIPLE articles online trying to convince people that it's fine to call ThisVariable camel case and I am just sitting here like how in the what in the why.
Stop reading those publishers. If they can get this wrong, I'd be concerned about more serious news.
Dude it's becoming pervasive. I saw it adopted as the convention for some in development app as well
I mean not one I would use but still
I just started looking and I'm finding it everywhere. I feel like I'm taking crazy pills.
Call it out.
I'd correct people. If they get mad, I'll ask them to reflect on what's more important to them and how saying this can hurt others who may be going through education.
Bro okay ignore the dev if you want but the dark background is from Python's PEP8 documentation.
At that level there is nothing to correct, they're choosing this convention consciously
SCREAMING_SNAKE_CASE
xD
snake_case
PascalCase camelCase
In Python it almost makes sense (ignoring historical convention) because it's snake_case or CamelCase and they don't recommend camelCase for anything
If that's the case with the dev, they're still wrong at the end of the day.
Ultimately word meanings are just convention. If the entire planet agrees that camel case is now a category of cases instead of a specific case, it becomes so for all practical purposes
But I am trying to nail down when this happened
I only just found this out thanks to you posting it.
No idea when it happened, but I've definitely heard all of those terms for a long while
Hearing the terms is not the confusion here, Omar
I'm referring to your original message
I think it's silly to willfully lie to people until it becomes practiced and agreed truth. This is engineering.
Okay got it
Sure, and I think most people would find your hypothetical agreeable, but you are begging the question of whether it is lying or independently evolving differences of opinion
No. It's being silly. That's my take.
If someone genuinely believes that camel case appropriately describes a word with a "hump" in front, it may be silly, but it's also not lying.
And if a whole society believes it, it's language
Language is often silly
It tells me that whoever is saying it doesn't know what they're talking about.
does anyone know some Event for when an item it's placed down but it's not a tile type?
Yeah? I'm still looking at this as an engineering problem.
Google Books Ngram Viewer.
If it makes you feel any better, the clearer terms are winning (but this suggests the upper & lower terms have been around for some time)
I mean, yes, we use the same sounds for utterly different things and we use a range of conventions and spellings that conflict with one another because ultimately we spell on the basis of favored historical spellings (not all mind you, and not local to any particular point in time)
So yes language is often silly, definitions are often silly
But they persist nevertheless
AS EARLY AS 1999?
Thanks for that Omar you actually blew my mind I didn't think to do that
I just naively searched for some etymological research on this
I am a bit obsessive about etymology...
Unfortunately that data is def limited, I expected to see usage (of the more popular terms) further back
Probably because I took 5 years of Latin when I was a younger lad and got carried away
Fair
Still revealing
I can't believe those term have been around 23 years minimum
How absurd.
I'm going to say this and close this conversation. I'm looking at it from an engineering perspective, not a linguistics perspective.
For sure, I hear you, and I agree that it's an inferior distinction in the sense that it wastes development time.
I don't love it, I just tend to be flexible and let people talk how they talk
Language is total chaos... History + convention = wtf is even going on.
I actually DID "correct" someone earlier before investigating and stumbling down this rabbit hole
oh my god who cares
Camelcase verse snakecase, its really not worth arguing about, just improve your code readability and annotate your work to help yourself and any other possible contributors.
Could someone please tell me how it's possible to make all zombies spawn naked? DM me because I will most likely miss a response here. Thank you so much in advance, you'd be a huge help.
is there a way to disable recipes if a mod is loaded that isn't just setting them hidden?
Accepted conventions do improve code readability. Also, we're not discussing camel case vs. snake case above... I was trying to identify origins of people calling ThisVariable "CamelCase".
just stop, move on
lol I had, you replied so I replied to you.
im trying to import the character model to blender for reference, where is Male_Body_Redo.fbx found?
thx man
Fwiw I thought the topic was interesting. The linguistic perspective basically boils down to prescriptivism vs descriptivism. I tend to agree that it doesn't really matter, though, as long as there's consistency within a project
any tips on opening an fbx in blender? Do I need to download something first?
I haven't used Blender, but a quick search suggests File > Import > FBX should do the trick
tried that, maybe the files closed or something, still looking it up
fbx works in blender not sure if there is a bad version for it. hate that about blender
love it but all the versioning craperino
reading the chat i reach only one conclusion
python so disregard everything
itf thats it im going to laugh but im reinstalling blender right now
plus it was having trouble finding it in the import method, and wouldnt find it when opening a new file
was starting to wonder if I needed to download Autodesk or something
lol what Autodesk isn't involved with Blender
idk, just reading up on it and coming into terms I dont understand
each to their own but i cant take a python programmer seriously
I just understand how to make shapes (Barely)
ยฏ_(ใ)_/ยฏ
that was the problem 
I recommend watching YT tutorials and doing what they did, its how I learned 3d modeling under 60 days
does that mean I have to make everything to that scale? Or do I scale up the Male Body Model?
I hear you, I do, but... it's still one of the biggest languages in the world now, and I fear it is going to have its way with us all.
the thing is its not a big language for actual programmers
Haha I hear you.
its used as scripting language and easy to pick for other fields
like science
its big outside software engineering
I'm more allergic to programming language elitism than I am to peanuts
Every language has its purpose (including esoteric ones, just look at code golf)
Im surious, Im afraid to mess this up.
@thick karma also on the camel case thing we are fucked
๐ญ
ieee recognizes it as CamelCase
Oh yeah it's truly over.
"I care," I begin to say, before instantaneously being reduced to nothingness
lets move to #modeling, I don't want to read this chat anymore
๐คฃ
Let's take this to #modeling so Peach doesn't miss anything important. @drifting stump @frank elbow
lol I'm obviously kidding.
too busy circle jerking about how bad python is
Haha you don't enjoy being told exactly when you need to indent, eh?
Could always move it to #general_chat instead, since the discussion is only loosely related to modding
No I'm honestly done I was only joking on the way to bigger and better things lol
Meant nothing by it at all
we all pretty chill here i've noticed so don't take me too overly seriously!
But, f.r., I don't think #general_chat is trying to discuss the technical details and linguistics of naming conventions in programming.
lol
I think this was... probably as well as that line of questioning was ever going to go.
Peach is right, ultimately... (almost) nobody cares
In the spirit of switching back to talking about modding proper... progress!
u making a quest system?
Working on a branching conversations dialogue panel for Aza
neat
It works 100%
And can load convos from files
Trying to make it flexible
(already gamepad supported obviously)
Are the emotion/tone indicators part of the lines, or a separate property? I'm assuming the former bc of the colon after [Hostile]
Looks neat
I think I'm gonna add the ability to associate a command string with a player response option
Part of the lines actually.
It's example text from Aza herself
sorry to bother but has any one had an issue that they make a recipe code and everything its fine with it but you cant craft it in game? Like everything shows up but when i go to click "craft one" its still dark
It's not required
im trying to get a function to be executed every 1 min after the server restarts. is this the correct way to do it? I've been testing it on a hosted server and doesn't seem to work, so not sure if its entirely wrong or if it works only for dedicated servers
RestartAlert = RestartAlert or {}
-- This function checks the current time and displays a message on the player's screen
-- if the server restart time is approaching.
function RestartAlert.CheckServerRestartTime()
--Code removed due to discord's character limit, plus pretty irrelevant to the problem
end
-- Define a function that will be called when the server starts
function RestartAlert.OnServerStarted()
-- Add an event to the event manager to check the server restart time every minute
local timer = LuaEventManager():AddEvent(function()
RestartAlert.CheckServerRestartTime()
end, 60000) -- Check the time every minute
end
-- Add the RestartAlert.OnServerStart function to the server start event
Events.OnServerStarted.Add(RestartAlert.OnServerStarted)```
The files are formatted like so:
# Hey, I am starting a convo with you.
## Oh, hello there.
## I don't want to have a convo with you!
### Why not?
#### Because!
## ... (Remain Silent)
# Oi, I am a different person starting a different convo with you.
## Oh, gee, wow.
### I think they get it.
What is getEventManager?
oops forgot to change it's supposed to be LuaEventManager
Initially thought it was getEventManager
even then, a simple
-- Define a function that will be called when the server starts
function RestartAlert.OnServerStarted()
while(true) do
print("test")
end
end
-- Add the RestartAlert.OnServerStart function to the server start event
Events.OnServerStarted.Add(RestartAlert.OnServerStarted)```
Doesn't seem to be working on a hosted server
Looks like OnServerStarted is triggered only after the UDP engine is set up, so I believe you're right that it wouldn't run for hosted (not certain, though)
Okay, so assuming im using this for a dedicated server. Would this be the correct way to set up a timed function?
I don't think so. AddEvent doesn't accept those functions as far as I can see
If you're trying to do something on a timer my initial though is that you'd utilize one of the Every~ events (or OnTick, but for something that doesn't require that precision that's not too necessary imo), whichever one is frequent enough for your use case
is there an "every" event that is repeated every irl 1 min?
i never worked with every events actually so not sure what they are
Those events are based on ingame time. I'm referring to EveryDays, EveryHours, EveryOneMinute, and EveryTenMinutes
i guess its not very workable with since if I use EveryOneMinute, for example, its bound to be less than an irl minute
You can keep track of the elapsed time by storing an initial time & comparing to it using getTimeInMillis (or a similar one that's in seconds, I believe? Unsure what it's called off the top of my head)
IsFood() why is this in uppercase omg
ugh i'll see if I can make it work. Thanks nonetheless
gettimestamp is in seconds i believe also if im not forgetful
list food?
ah my bad, it's an i not an l
how would i make the player eat food once i find a valid consumable item?
ISInventoryPaneContextMenu.onEatItems({item}, 1, self.player);
thanks
"doesn't work"
https://tenor.com/en-GB/view/uno-reverse-card-gif-24856155
The perfect Uno Reverse Card animated GIF for your conversation. Discover and share the best GIFs on Tenor.
now just add a marker into the syntax that denotes a function to call and the sky's the limit
Exactly the plan
I'm gonna add a spot for a command string
And then people can listen for the command
And whatever
[Command: commandString] perhaps
Optionally in the option text
Anywhere
yeah, a context value and the dialog string
on which note, localisation strings
the dialog tree should be able to consist purely of localisation vars
I'm not clear on what that entails but right now I can only read a text file written in English... if you have good ideas for reworking the algo I am open to it but I might not be smart enough to understand them from crumbs alone lol
I think just being able to treat a string as something intended to be an argument to getText would suffice, with some way to specify that in the syntax
Working with this for now @calm depot
WookieeDialogues.load = function(responses, dialogues, base)
base = base or 0
if not responses or #responses < 1 then return end
-- BS.reveal(responses)
local line, level = responses[1]:gsub("#", "")
Table.remove(responses, 1)
if level ~= 1 then return end -- Bad File Format
local nextIndex = #dialogues + 1
local nextEntry = { response = line }
Table.insert(
dialogues,
nextIndex,
nextEntry
)
if #responses < 1 then return end -- File complete; no options on final response.
local remaining = {}
-- for each #:
for index, value in ipairs(responses) do
line, level = responses[index]:gsub("#", "")
if level == 1 then
remaining = Table.subtable(responses, index)
break -- Response Complete.
elseif level == 2 then
nextEntry[#nextEntry + 1] = {}
nextEntry[#nextEntry].option = line
-- nextEntry[#nextEntry].command = next line maybe (future plan)
elseif level == 3 then
local lastLevelThree = index
local validTarget = lastLevelThree + 1 <= #responses
local nextLine, nextLevel = false, false
if validTarget then
nextLine, nextLevel = responses[lastLevelThree + 1]:gsub("#", "")
end
local time = 0
local timeout = 100000
while validTarget and nextLevel > 2 and time < timeout do
if time == 99999 then
print("I think I am stuck here. :(")
print(validTarget)
print(nextLevel)
print(nextLine)
end
time = time + 1
lastLevelThree = lastLevelThree + 1
validTarget = lastLevelThree + 1 <= #responses
nextLine, nextLevel = false, false
if validTarget then
nextLine, nextLevel = responses[lastLevelThree + 1]:gsub("#", "")
end
end
nextEntry[#nextEntry].result = {}
local rawSubset = Table.subtable(responses, index, lastLevelThree)
print("Raw Subset")
print(rawSubset[1])
for each, row in ipairs(rawSubset) do
rawSubset[each] = row:sub(3)
end
WookieeDialogues.load(rawSubset, nextEntry[#nextEntry].result, base + 2)
index = lastLevelThree
end
end
if #remaining > 0 then
WookieeDialogues.load(remaining, dialogues, base)
end
end
(Condensed, sorry all.)
Looks like your gsub calls will eat octothorpe characters in positions other than the start (too)
Good point.
Hmmm
I could require a space.
To break between the # and the rest of the stuff
"^#+"?
Nice catch.
I would, though there is a pure-lua implementation of a JSON parser ๐
Just turn a JSON into a table instead you mean?
that's exactly what it does, yes
Would that be inherently more compatible with other languages?
I used it for PAYDAY2 config
I'd imagine it'd work fine on PZ too
it means that people can run their config through a linter to validate basic JSON syntax
then all you have to worry about is making sure the tree structure is correct
I think there's value in having a simple syntax for dialogue or anything string-heavy, but JSON would def make it easy to extend with whatever
Yeah I'm not sure which would be best tbh.

