#mod_development

1 messages ยท Page 119 of 1

thick karma
#

left that step out

#

UI_EN goes inside a .txt of the same name... all translation files seem to work that way.

#

The translation file shares the name of the table inside of it

true vault
#

Just as a visual example:

#

Oh, yeah, Burryaga already basically said that... carry on lolz

abstract raptor
#

I hope now that I'm finally past this I can get to work on constructing the UI for my Radio Survivors haha

#

behold the context menu works as expected uwu

thick karma
ancient grail
#

Ow hi @abstract raptor idk why the bottomless pit didnt show on my end. So i had just create own tile

thick karma
#

Do you mind a quick DM?

drifting ore
#

check threads

true vault
#

Your best bet is finding a mod similar to what you are trying to do, and learning from it as an example.

drifting ore
#

yea that is really true

true vault
#

lmfao... welp, from one error to another one... I cannot win today

function: create -- file: ISIndesctructibleBuild.lua line # 17 | MOD: Mining Mod
function: checkForMines -- file: medievaloid_minespawner.lua line # 40 | MOD: Medievaloid

ERROR: General     , 1676871804593> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.iso.IsoGridSquare.getCell()" because "this.square" is null at IsoThumpable.getInsideSquare line:2005.
ERROR: General     , 1676871804593> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "zombie.iso.IsoGridSquare.getCell()" because "this.square" is null

I think it's time to step away for a moment

abstract raptor
merry quail
#

someone please help

drifting ore
#

your type

#

i literally have no idea but i'm guessing it's overriding it because of the type being food? try another type and see if it still does it

merry quail
#

do i need to delete it or just change it to pills or something

drifting ore
#

no no

#

type is required for sure

#

it is how the item is treated. that may not be it tbh. i'm looking quick

#

i'm pretty sure food can still be first aid.

#

just never really thought about how it would be displayed as a perishable

merry quail
#

i am getting it working with spiffo radial menu mod, i guess the type will affect whether it works or not

drifting ore
#

example of how immersive medical looks
so it doesn't seem off from yours

merry quail
#

This mod has some things that don't seem to work

drifting ore
#

i dont think you need foodtype also if you arent delcaring it lol

#

well what im looking at works

#

i'm using a fully functioning version so not sure what one you are referencing

#

can i ask what weird copy paste is that spacing from?

#

always hard to tell when things dont look right when it's a mess like that. maybe someone else can more easily spot in it

merry quail
#

Does the better sorting mod affect my sorting?

drifting ore
#

yes

#

it relabels display categories

#

i wouldn't assume that would have much to do with your issue atm though.

#

i could be wrong though. haha never say never when it comes to reasons why having issues LOL

merry quail
#

are you owner of immersive medicine

drifting ore
#

no lol

#

zombie fix and lightswitch electrician. soon to be lightswitch overhaul! or something like that ahahah

merry quail
#

so I have to delete all the redundant

#

and leave the same part as the mod above?

drifting ore
#

sorry working on my mod atm.. your script didn't seem wrong.im just not sure how the display category works with perishable items and categories offf the top of my head

gusty wharf
#

wtf ChatGPT can code zomboid mods

#

and use the vars

bronze yoke
#

it's not very good at it

gusty wharf
#

I know but it seems to be able to make basic stuff

bronze yoke
#

it often relies on completely made up stuff and generally doesn't actually understand anything pz related, even if it does get it roughly right

#

like it'll call a bunch of functions that just don't exist

drifting ore
#

yea it's prolly fun to mess around with but literally everyone that first figures out ai chat bots potential, proclaims its greatness, just like it's the first time all over again ๐Ÿ˜„

#

if you are a good at using the language it will be very helpful but i can tell you that half the conversations it has are semi incoherent... while its possible it could make something that works on the first try, it will always be primitive and not truly functional and require knowledge beyond just knowing how to code

#

if you trained the model on the entire api of zomboid and all the quirks and it knew everything that was exposed. another convo

gusty wharf
#

I asked it to improve my code a bit, original is this

local function maxSkills()
    local player = getPlayer()
    for i=0, PerkFactory.PerkList:size() -1 do
        local perk = PerkFactory.PerkList:get(i)
        player:level0(perk)
        player:getXp():setXPToLevel(perk, 0)
        for x = 1, 10 do
            player:LevelPerk(perk)
        end
    end
end
Events.OnCreatePlayer.Add(maxSkills)```

ChatGPT changed it a bit to this

```lua
local function maxSkills()
    local player = getPlayer()
    for i = 0, PerkFactory.PerkList:size() - 1 do
        local perk = PerkFactory.PerkList:get(i)
        player:level0(perk)
        player:getXp():setXPToLevel(perk, 0)
        local desiredLevel = 10
        for x = 1, desiredLevel do
            local currentLevel = player:getPerkLevel(perk)
            if currentLevel >= desiredLevel then
                break
            end
            player:LevelPerk(perk)
        end
    end
end
Events.OnCreatePlayer.Add(maxSkills)
drifting ore
#

thats like asking it to do math though. kinda diff imo

#

i use it as a calculator for complex formulas all the time

#

it's insane

gusty wharf
#

Yeah imagine if ChatGPT had access to latest news, internet

drifting ore
#

it does on bing lol

#

apparently its sad and lonely

bronze yoke
#

isn't this worse?

drifting ore
#

LOL

bronze yoke
#

the stuff it added doesn't do anything, it's just slightly slower

drifting ore
#

verbose for sure

gusty wharf
drifting ore
#

albion you are a smarty pants. any chance you know the best event for updating recipe via scriptmanager?

#

i tried ongameboot and its too early i guess or something

bronze yoke
#

using sandbox options?

drifting ore
#

when i use oneveryminute or w/e it works

#

yes

bronze yoke
#

OnInitGlobalModData

drifting ore
#

that will work still for recipe? lol dammit

#

for some reason i thought it wouldnt work or didnt

#

i'll try it. haha second time you've told me that maybe third ๐Ÿ˜„

#

dunno why i would think it would be diff tyty

ancient grail
barren junco
#

a cannibal trait im working on

#

thoughts about the icon?

#

its a hearty heart i drew

#

its going to give you 8 points (its actually a sort of negative trait)
you can only eat human meat, AKA corpses

rancid panther
#

it looks good!

#

humans and zombies?

barren junco
#

yes

rancid panther
#

it would be interesting if you can only eat human players for it to be only viable in pvp or with npcs

barren junco
#

definitely an interesting concept, perhaphs a server where cannibalism is the only method to get food

rancid panther
#

sounds cool tho! looking forward it

barren junco
#

thanks :D

#

its actually pretty advanced by this point

uncut meteor
# barren junco

Looks good need to delete corpse Just after, and dont make the corpse give you more food than normal food items otherwise its to op.
all though if the trait cost more than others its okay if its op.

rancid panther
#

i wanna make a mod that lets you become admin without enabling god mode automatically. any ideas where to start?

barren junco
#

also different traits affect illness chances, base chance is 40 if corpse was a zombie

barren junco
rancid panther
#

basically by default, whenever you do /setaccesslevel [name] Admin, god mode is automatically checked, but i wanna make all those unchecked by default

barren junco
#

you could try patching the method

#

the lua syntax is as follows

barren junco
#
local originalMethod = Class.Method

local function patchedMethod()
{
    -- prefix code ...

    originalMethod()

    -- postfix code ...
}

Class.Method = patchedMethod
barren junco
rancid panther
#

oh! thanks! that is super helpful

barren junco
#

np man

#

check the lua cheatsheet as well

#

very useful

rancid panther
#

thank thank

gusty wharf
#

Are there any vars that could be useful in making a learn all ||(even these occupation exclusive ones)|| recipes mod? I tried to find some but I don't think there's any that'd easily allow to get all the recipes.

drifting ore
#

is there any way to add some clothing to the character creation menu? I know, there is a server option, that allow players to pick any clothing, but I don't want then to pick ANY, I want them to pick something from the list I gave

barren junco
#

for example this ones

rancid panther
#

yeah it p much has every recipe in there besides magazine exclusive ones

#

r u trying to make a trait or a magazine that teaches them all? or something?

gusty wharf
gusty wharf
rancid panther
#

u can just make it cost 1 and give everyone 1 free trait point

#

try looking at a mod that alters a player on spawn rather than trait mods

barren junco
#

hmm thats interesting, perhaps you should check this out:
characterCreationMain.lua in PZ/media/lua/client/optionscreens

gusty wharf
barren junco
#

it seems to have some useful clothing thingos

rancid panther
#

you can see how they made something work for all players when the mod is enabled

#

and then also use ur knowledge of how to give players recipes

deft falcon
rancid panther
#

when i have 1 free trait point i'd rather not take a trait at all

deft falcon
#

make it a +100 negative trait

#

and set starting bonus to -100

deft falcon
rancid panther
#

i reverse too much

deft falcon
#

skill lack

rancid panther
#

lacking skill

gusty wharf
#

Hey, just wondering. Is looking at other mods that can do a similar thing and then fixing your own by understanding on how the other one works (without fully copying and pasting the code) alright? I looked on how the Cheat Menu max skills feature works and I improved mine a bit without fully copying the code.

rancid panther
#

that's how i made the start of my immune trait before asking for feedback

#

i looked at several dif mods tho

gusty wharf
rancid panther
#

you can copy off my homework but change it up a bit so the teacher doesnt suspect anything

#

i dont make the rules of coding etiquette, but it's like math. if you want to do a certain thing, there is a certain way to do it (most of the time). no way around it

gusty wharf
#

I didn't really copy it off. There weren't any other ways to code these 2 lines anyway.

rancid panther
#

ik it was just a joke

gusty wharf
#

but yeah it inspired me kinda

rancid panther
#

what is the code anyways?

gusty wharf
#
local function maxSkills()
    local player = getPlayer()
    for i=0, PerkFactory.PerkList:size() -1 do
        local perk = PerkFactory.PerkList:get(i)
        player:level0(perk)
        player:getXp():setXPToLevel(perk, 0)
        for x = 1, 10 do
            player:LevelPerk(perk)
        end
    end
end
Events.OnCreatePlayer.Add(maxSkills)```
#

the level0 and getXp():setXPToLevel() part, I added it just in case the levels would somehow go above 10 if that's even possible. Cheat Menu does a similar thing

rancid panther
#

ah. i think no more skillless survivors also has a check for that

#

since it literally can grant u too many levels

deft falcon
#

theoretically speaking

#

you both guys could do a same thing

#

you just decided to get some help

gusty wharf
deft falcon
#

no

zinc pilot
#

that's the best way to learn imo

#

or at least understand how stuff works a little bit better

cunning kestrel
#

Hey, I need some help with an animation(set) not triggering in a specific scenario...

  • from random location he will walk toward object face it and do the animations.
  • but if i then cancel and re-activate the action (via context menu) it does not trigger the animation. (unless i move him 1 step from this location)
  • but it does trigger the action (which is then buggy cause the animation sets dont provide/read the var updates)
#

If highly unlikely this scenario would ever happen but still ... would like to understand whats happening

rancid panther
#

time for another 4 am mod update

#

i have not learned my lesson

pulsar heath
#

lol dont worry its not 4am here so

thick karma
# gusty wharf So it'd be fine to post that mod on the workshop even if it includes one or two ...

If the modder doesn't explicitly ask you not to use their code, it's pretty much fair game as long as you don't pretend you are its original author and try to steal subs by cheaply reposting their code in a virtually unedited state. However, some mods will post an image that tells you not to use their code, e.g.:
Redistribution of this mod without explicit permission from the original creator is prohibited under any circumstances. This includes, but not limited to, uploading these mods to the Steam Workshop or any other site, distribution as part of another mod or modpack, and distribution of modified versions.
If I see something like that, I often don't even read their code, because I don't want to get a good programming idea from them that they can accuse me of stealing.

pulsar heath
#

i had some issues with a few copy cats

#

dont mind ppl using my code and updating it for their own use

#

but a copy paste with a new name... that i cannot allow

#

so i dmced about 11 mods so far

rancid panther
#

btw, i found a pretty easy way to store your mods when you are not updating them so it wont have problems with being subscribed to it on workshop

#

i just added another folder within the workshop folder and just put my mods inside that so it doesnt read them

pulsar heath
#

i have 2 dirs for pz... one for playing another for developing so i dont mix things up

rancid panther
#

and take them out every time i need to update it, since i need to be subscribed to my mods when hosting on mp

modern dirge
gusty wharf
rancid panther
#

yea i have a backup one that i edit while the other stays the same, in case i mess something up

gusty wharf
#

and I think they use similar code

#

or the same one in some instances

pulsar heath
thick karma
#

Then as long as Cheat Menu is not in fact an unscrupulous derivative of Cheat Menu RB, I would use Cheat Menu for advice and ignore Cheat Menu RB entirely.

pulsar heath
#

thats the best way to do things, ask for permission and credit the original author of the code

thick karma
#

@gusty wharf

#

(Also, yes, asking the author is a best first step.)

pulsar heath
#

cheat menu is older than cheat menu rb

gusty wharf
pulsar heath
#

its the "original" mod

gusty wharf
thick karma
pulsar heath
#

i use it a lot for debuging

#

that lua window interpreter is very usefull

#

now im trying to make a whitelist for use with the integration, im a lazy coder so ill ignore the split screen mode of the game and use the steam id as a unique identifier for the players with access ๐Ÿ˜„

cunning kestrel
#

subscribe...

#

then look for the mod ID

#

Hey, I need some help with an animation(set) not triggering in a specific scenario...

  • from random location he will walk toward object face it and do the animations.
  • but if i then cancel and re-activate the action (via context menu) it does not trigger the animation. (unless i move him 1 step from this location)
  • but it does trigger the action (which is then buggy cause the animation sets dont provide/read the var updates)
cunning kestrel
#

well thats horrifying

modern dirge
#

if you cant beat them join them

thick karma
#

Lol I want to eat zombies like this.

cunning kestrel
#

anyone know how to solve this ? (odd part is this goes away if an vanilla exercise has been done once.)

viral notch
#

hey where can found functions for radio and channels?

frank elbow
cunning kestrel
ancient grail
#

is it possible to teleport zeds"?

frank elbow
viral notch
#

๐Ÿ™„

cunning kestrel
gusty wharf
#

Are there any .lua files that are related to recipes, and also the recipe magazines?

modern dirge
cunning kestrel
thick karma
#

Did you check its new/create/initialise?

#

@cunning kestrel

cunning kestrel
#

but i dont understand how opening a UI sets a backend var to calculate endurance/exp etc

thick karma
#

I meant FitnessUI's new/create/init... If opening that ui makes your character exercise correctly again, something in it's creation functions may be responsible

red tiger
#

Good morning.

thick karma
#

If onClick creates a new FitnessUI or initialises one, I would check those functions

red tiger
#

I plan to get weapons and weapon-parts fully parsed today.

cunning kestrel
red tiger
#

Am very excited to see results of parsing ZedScript as JSON. :)

#

Wondering if I should wait to write a ZedScript writer until 42..

#

Could do both but not sure if it will be useful.

quasi geode
# cunning kestrel well yeah. im looking but it doesnt make sense ..

this.currentExe is a field in the java Fitness.class. Its reporting its not set likely because you failed to call fitness:setCurrentExercise(type) prior. this is called in IsFitnessAction:new() (the timed action initialization)

o.fitness:setCurrentExercise(exeData.type);
#
    /**
     * Sets the current exercise being performed.
     * <p>
     * Called from {@code lua/client/timedactions/ISFitnessAction.lua}
     * @param type the string name of the exercise type as defined in {@code media/lua/shared/Definitions/FitnessExercises.lua}
     */
cunning kestrel
quasi geode
#

ya that manual attempt is no good if your trying it like that (since o likely doesnt exist)

#

as well as exeData, both of those are variables from the timed action code

cunning kestrel
#

yes, got that. what i dont get is how why is FitnessUI passed though ?

quasi geode
#

getPlayer():getFitness():setCurrentExercise("squats")
if you want to test from the lua console

cunning kestrel
#

i did it this way before. while it sets the variable it doesnt work for reading our currentExe.type

modern hamlet
#

Hi, i want to add new diseases to eating certain foods like vanilla mushroom and berry. How can i check what character eats? Or inorder to do that do I have to override all those foods? If so, could you show me how to do it? Also, if I override these items, will the recipes using these items be corrupted? thanks in advance spiffo

thick karma
#

That has an example of a safe decoration of the eat function

#

You could check what you're eating differently in that function and do something different than the mod does

#

The mod just talks when you eat as a simple example

cunning kestrel
stable flame
#

is there a way to use the On.Create to set any amount of several items of the recipe in a lua function?
for example we have item1/item2/item3.../item10 and if 3 of the items are present, the recipe continues, as opposed to having 3 of the exact id like normal recipes work

red tiger
#

Hahaha I just realized something.. I could add a ZedScript library to PipeWrench. People could generate items from their own Lua code.

#

That'd be hella crazy.

#

Like building RPG items.

#

I'm guessing that's already possible without it though.

#

DoParam() etc.

cunning kestrel
thick karma
#

Congrats, that looked like a headache, I took a few minutes glancing at it earlier. @cunning kestrel

cunning kestrel
#

question: what happens when 2 files require override/extend the same class.methode ?

thick karma
#

If they both override the same class.method, the last definition loaded will persist.

#

If they both extend the same class.method via decoration, the decorations will play out in order.

stiff cedar
#

hi guys, im new in modding pz, how can i debug items when i change a property in .txt whitout restart game ?

cunning kestrel
cunning kestrel
# thick karma If they both override the same class.method, the last definition loaded will per...

So I just tested this. and both seem to run Somehow ๐Ÿ˜›

require "TimedActions/ISFitnessAction"
  function ISFitnessAction:stop()
        print("stop")
    FWOEndOfAction(self);
    default_stop(self)
end
require "TimedActions/ISFitnessAction"
function ISFitnessAction:stop()    
    print("stop life")
    currentExercise = nil
    default_stop(self)
    self.character:setVariable("ExerciseEnded", true);
end

explain this magic

drifting ore
#

howdy, i was curious if anyone knows how to add a starter inventory to a base game backround? im trying to implement something i made without having to use profession framework for the thing to be used. the wierd bit is it works with the framework, and thus could/should work with base game if converted, bit i have no clue how to convert it to not need the framework.

#

has anyone had any experience or info on such?

thick karma
#

Maybe the object gets defined at different points in the game's execution @cunning kestrel

thick karma
#

I suspect if you tried to create a new ISFitnessAction from the debug console and then stopped it, only 1 of those versions would be visible from debug console

#

AFAIK it's impossible for both to be accessed through the same function call; you would have to do something like add both versions to an event and trigger the event to trigger both versions in a single command.

#

If the tests are being called from 2 different files, that would explain things a bit. The first file is relying on a prior definition.

#

@cunning kestrel

cunning kestrel
#

those are my thoughts aswel but its a single action that started the call though ...

drifting ore
#

this is the current code i have, it uses the professions framework thing, but i have no clue how to get it to not need that dependency. aka, im trying to, in this case/example, convert the unemployed backround to start with the skills/gear as seen in this

cunning kestrel
drifting ore
#

darn. even if i was going to convert/overwrite the base game proffession instead of putting a new one in?

#

i had thought that something like uihotbar or whatever would let me add a holster with a gun, like what some guy named ras did, but other than that, i had/have no clue what to do to get a filled medkit ect

#

and yes, i have been looking at other peoples code to learn from. it seems in theory doable, aka, changing base game starts, but the issue i have is inventory based, ect

#

the idea im having is to replace police start with a better inventory/skills for it

#

i assume if i added a new thing, the framework would need to be reverse engineered ect

cunning kestrel
#

overriding shouldn't be necessary that being said, havent dug into that aspect yet so...

#

so like a spawn kit linked to a trait ?

drifting ore
#

no, its supposed to be linked to the backround, such as, hypothtically, security officer starts with a gun, or police officer too, or doctor with a customized medical kit, ect

#

if trait would be needed to get it to do that, i might try that later on

cunning kestrel
#

oh yeah yeah i ment background profession. yes .

drifting ore
#

for the example from learning, here is what i found with a thing called raz's proffessions, aka, the hotbar concept. in this example, he took a base game thing, and added a holster thats got a gun, so i wasassuming its a viable idea.

#

so far im trying to figure out how to add to a current backround, not add a new one like before

#

since it seems in theory simpler

cunning kestrel
#

i mean a start kit exists so cant be that insane to link into that ...

drifting ore
#

i hope so

#

however, im curious, how would i do such a thing? does anyone have any idea on how to even code it? or such. i have no clue where to start

#

i know the base game starter kit is for all backrounds

#

im trying to make one thats for a single backround, and possibly change them all later

cunning kestrel
drifting stump
#

simply creating them on file execution might be fine but still not sure

red tiger
drifting ore
drifting stump
#

issue with that is the item could only be created on the first tick since thats when commands are first usable

#

at that point youd already have mismatched world dictionaries

#

as for generating on execution iirc scripts are loaded first so it all depends when the dictionary check is performed

sour island
#

For anyone with sub-mods related to EHE the update is public now. I think this only applies to @pulsar heath and @fiery pecan.

#

Worth mentioning Twitch Integration works in MP now, and the instability and 'sounds getting stuck' in MP issue should be addressed.

pulsar heath
#

ok, will update my mod if needed ๐Ÿ™‚ thx for the heads up @sour island

red tiger
#

EatType = ForbiddenFruit

#

I genuinely didn't know that this was categorized as food. Holy heck.

gusty wharf
#

Hey guys, for some reason this code in my mod causes for the health panel to open, not sure why

local function maxSkills()
    local player = getPlayer()
    for i=0, PerkFactory.PerkList:size() -1 do
        local perk = PerkFactory.PerkList:get(i)
        player:level0(perk)
        player:getXp():setXPToLevel(perk, 0)
        for x = 1, 10 do
            player:LevelPerk(perk)
        end
    end
end
Events.OnCreatePlayer.Add(maxSkills)```
thick karma
#

How exactly do you know?

#

(The results of that exact function seem like they would be hard to determine)

#

(in game)

#

(since you can't call it directly and I believe it gets called before you press start)

red tiger
#

Hmm concern. I think the field alcoholic is assigned by ComboItem's alcohol property and FoodItem's alcoholic property.

#

Going to split these definitions for their item category but can be a problem in PZ's script engine.

thick karma
#

@gusty wharf You should post your whole file. I'm not sure that chunk explains it

gusty wharf
calm depot
#

is it actually necessary to call both level0 and setXPToLevel?

gusty wharf
calm depot
#

by clicking on them?

gusty wharf
calm depot
#

that just sounds like the skills screen UI needs to refresh, not that clicking on it is actually doing anything

#

hm, or you discovered some dormant, unused functionality

#

in any case though, there is a debug screen for levelling up skills - I'd just do whatever that button does

thick karma
cunning kestrel
#

@gusty wharf One note here setLevel doesnt provide "exp" any other system that looks at xp gain will not function of of it

gusty wharf
calm depot
#

actually, there's setPerkLevelDebug - that will allow you to skip straight to whatever you want

gusty wharf
cunning kestrel
calm depot
#

only worked sometimes?

viral notch
#

how to make checking simple script ?
like check if on vehicle is attached expl front bumper or hood etc
then allow to attach some different addon

calm depot
#

by writing code

thick karma
#

@gusty wharf Your code works and Idk what's opening health panel, but not that.

viral notch
#

yeah but im not lua thing

gusty wharf
calm depot
#

that sounds... odd

gusty wharf
thick karma
#

Clearly another mod you have running is triggering health panel to open

#

And it's not one of the 300+ I have running.

calm depot
#

if you're writing any mod and you've turned on stuff that isn't going to be a dependency for what you're creating, you're making a horrible mistake.

gusty wharf
#

I'll restart the game

calm depot
#

wait, you've been changing the code and just reloading the file?

gusty wharf
calm depot
#

it depends entirely on how your code is written

#

in your case, you should not do that

#

the reload feature is actually a "re-execute this file"

#

whatever happened to the lua state from the previous time it executed will remain

#

so, any events that are hooked up, for example, will still be running, too

gusty wharf
#

Alright I'll remember this

calm depot
#

quitting to the main menu is sufficient for ensuring a fresh load of all lua

#

the only time it makes semantic sense to use reload is if your code takes care of cleaning out any pre-existing hooks or if it simply redefines a function without storing the old version (or, again, you have code explicitly written to detect that you're re-executing)

thick karma
#

@gusty wharf In your specific example, if you want to experiment with reloading your file live, you need to make your function global for testing purposes like so:

JxP = {}
function JxP.maxSkills()
    local player = getPlayer()
    for i=0, PerkFactory.PerkList:size() -1 do
        local perk = PerkFactory.PerkList:get(i)
        player:level0(perk)
        player:getXp():setXPToLevel(perk, 0)
        for x = 1, 10 do
            player:LevelPerk(perk)
        end
    end
end

And then use the debug console to call JxP.maxSkills() after reloading to see what it does.

#

(JxP table not required but modules like that are good practice imo)

calm depot
#

I usually separate it into a loader file and the main payload

#

then you don't need a global

#

(your payload file can return the function)

#

but for anything related to overriding game functions, which tends to be the bulk of what I do, I quit to menu, it avoids a whole class of bugs you can end up creating for yourself by trying to rely on reload

thick karma
#

That works, but one advantage to using global modules for testing is that you can individually swap out virtually any function on the command line in a quick copy-paste. For me, it's a faster way to experiment.

#

Because ultimately when I write a new version of a function I am in VS Code, not in game.

fiery pecan
thick karma
#

So I enter the game with the function ready to go... if I can just copy it, and paste it in debug when I return to game, it's slightly faster than opening F11 to do it

#

(Unless it's added to an event and you're testing its behavior on the event, but even then reloading it is easier because you can just copy-paste the new event into your terminal like so:)

Events.OnStuff.Remove(oldGlobal)

oldGlobal = function()
  -- Boom
end

Events.OnStuff.Add(oldGlobal)
#

You can drop this little snippet in debug console and try various functions on the event you're testing quickly.

#

shrug

#

to each their own of course

gusty wharf
thick karma
#

(But the above trick won't work if oldGlobal is local because Remove won't remove the right function if the function isn't accessible from debug.)

thick karma
calm depot
#

the table is just a table that happens to be addressable from the global scope, the language doesn't care

thick karma
#

@gusty wharf

#

If I have 20 functions and they're all in my main module, I can instantly make them all global or all local by editing 1 line.

#

shrug

calm depot
#

minimise what is global, if you can expose stuff through a return then you minimise the chance of any sort of pollution

#

...or people doing stupid things to your mod from their mod

thick karma
#

Right, ultimately, turning your stuff into local at the end is recommended practice for anything that doesn't need to be global (such as overrides of vanilla things that are global already)

#

But a module will make that easy to do

gusty wharf
#

that's what setPerkLevelDebug does for some reason

ancient grail
drifting stump
#

i am so proud

#

people actively encouraging and teaching modules

#

only took me a year to get the point across ๐Ÿฅฒ

ancient grail
#

Teach me senpai browser

calm depot
#

a true module would be across a setfenv boundary, it's just a global-scope table, don't get too ahead of yourself ๐Ÿ˜›

red tiger
#

I'm almost done implementing item properties for ZedScript.

barren junco
red tiger
#

I probably won't publish my parser on npmjs until an official name is announced for the format.

barren junco
#

What is it that you are making exactly?

red tiger
#

My personal goal? Write software that uses UI to modify, create, and template definitions for ZedScript.

barren junco
#

Hey isnโ€™t that cool

#

So basically a UI to create recipes, items, etc

#

To facilitate the process instead of using raw JSON right?

red tiger
#

It's there for anyone who wants to use it for their own purposes.

#

(Both the AST JSON and the simplified JSON)

barren junco
#

I would personally use it, if it does not have any limitations or implications ofc

#

Sounds like a good tool to have!

gusty wharf
#

Hey, I'm trying to do learn all recipes mod, wondering if I'm doing it correctly (it's kinda similar to the max skills thing)

function allRecipes()
    local player = getPlayer()
    for i=0, getAllRecipe():size() -1 do
        local everyRecipe = getAllRecipe():get(i)
        player:getKnownRecipes(everyRecipe)
Events.OnCreatePlayer.Add(allRecipes)```
Are there any things I did wrong and should add/change? It doesn't seem to work and I have no idea what to add
bronze yoke
#

getKnownRecipes returns a list of recipes, it doesn't add the recipes you give it

barren junco
#

You can use #getAllRecipe() instead of :size() I think

#

The โ€˜#โ€™ symbol returns a lists size

bronze yoke
#

you're missing some ends, it would be better to pull the list into the local space instead of grabbing it from java every time, the function is getAllRecipes() not getAllRecipe(), and that returns recipe objects whereas the player's recipe list wants string names

barren junco
#

Oh that is interesting

bronze yoke
barren junco
#

I see

#

Is there any object or list with all recipes available in string form?

red tiger
#

Huh.. so UseWhileEquipped is a generic item property... however Drainable items has UseWhileUnequipped.

#

Only one Drainable uses this property.

bronze yoke
#

i'm guessing something closer to this would work:

function allRecipes()
    local player = getPlayer()
    local knownRecipes = player:getKnownRecipes() -- see below
    local recipes = getAllRecipes() -- saves the recipe list into a local variable, otherwise we have to access it every loop, and accessing java is very slow
    for i=0, recipes:size()-1 do
        local recipe = recipes:get(i)
        knownRecipes.add(recipe:getOriginalname())
    end
end
Events.OnCreatePlayer.Add(allRecipes)
barren junco
#

Oh so indexing through Java lists is zero indexed

#

I thought it would be 1 indexed too

bronze yoke
#

something to note is that OnCreatePlayer passes the player object created; if you tweaked the function declaration to be like thislua function allRecipes(_index, player) and removed the local player = getPlayer() line, the code would look a bit nicer and it would work in splitscreen (which is not really a priority LOL but it's nice)

barren junco
#

Since we are in lua

bronze yoke
#

the api doesn't have anything nice like that really

barren junco
#

Hey albion whatโ€™s your experience background, you seem to know what you are doing

bronze yoke
#

i've just been modding since the start of last year

barren junco
#

Noice

bronze yoke
#

i've seen other games lets you use 1 indexed for the main language in lua, as well as letting you loop through their structures using pairs and stuff, and generally just letting you use lua syntax for the game's core language objects when possible, but kahlua doesn't really have anything like that so we're stuck with calling java functions and playing by java rules

barren junco
#

Yeah I noticed

#

We are basically getting Java objects with specific metatables right?

#

Iโ€™ve noticed that some methods return userdata and others do return Java objects

bronze yoke
#

do you get an error?

gusty wharf
#

Yeah

barren junco
#

What is it exactly

gusty wharf
barren junco
#

Do you know about konijimaโ€™s environment creation method?

#

With it, you can check all of the gameโ€™s source code in a single place

red tiger
#

=(

quasi geode
# gusty wharf this opened up

knownRecipes.add(recipe:getOriginalname()) should probably be knownRecipes:add(recipe:getOriginalname())
use : not .

red tiger
#

I told Konijima that I'd update one of his libraries.. I still haven't.

#

I'm a horrible friend.

barren junco
#

Lol

red tiger
#

He was a central figure here as a modder.

ancient grail
#

He initated the community api proj. Made guides for alot of stuff including how setup environment and how to decompile java.
He also made lots of templates for new modders to use

#

Mostly lua stuff

#

Scripts are txt

ancient grail
#

Have you atleast read the vanilla? Thats all you need to get you started
Also check the guides on the thread

#

He doesnt have a weapon mod. Thats a diffrent line of modding . He works more of the backbone side

zinc pilot
#

is there a way to convert local mouse coordinates to global ones?

#

got it, just use OnObjectLeftMouseButtonDown

gusty wharf
#

@bronze yoke @fast galleon Hey, I finished making the mod and since you both helped me and gave me some code, could I post the mod on the workshop?

red tiger
#

Just finished items parsing for ZedScript.

#

This is every item in PZ vanilla with all properties.

red tiger
#

(Pre-documentation)

#

The largest hurdle of this parser project is items and now that's done besides improvements & fixes.

rancid panther
#

did u try go to the ProjectZomboid/media/scripts folder? might be helpful if you haven't

#

there is a weapons file in there

#

actually a whole folder iirc, with all the weapon scripts and sounds

red tiger
#

I'll need someone or myself to comb through and double-check all item properties in the parser when time is had.

#

Once the parser is done I can move onto writing a exporter.

#

Then the GUI app.

#

=)

modern hamlet
#
-- Food Diseases
MHD = {}
MHD.ISInventoryPaneContextMenu = {}
MHD.ISInventoryPaneContextMenu.onEatItems = ISInventoryPaneContextMenu.onEatItems

ISInventoryPaneContextMenu.onEatItems = function(items, percentage, playerIndex)

    print("Starting to eat...")
    
    ----
    local playerObj = getSpecificPlayer(playerIndex)
    playerObj:Say("Itadakimasu!")
    ----
    print("Items check...")
    if items then
        print("Done!")
    else
        print("Failed!")
    end
    
    print("Food check...")
    if instanceof(items[1], "Food") then
        print("Done!")
    else
        print("Failed!")
    end
    ----
    
    if items and instanceof(items[1], "Food") then

        local player = getSpecificPlayer(playerIndex)

        local currentUnhappiness = player:getBodyDamage():getUnhappynessLevel()

        player:getBodyDamage():setUnhappynessLevel(math.max(currentUnhappiness - 3, 0))

        player:Say("???")

    end
    
    -- default eat function
    MHD.ISInventoryPaneContextMenu.onEatItems(items, percentage, playerIndex)
end

return MHD

What am I missing here?

barren junco
jaunty marten
red tiger
barren junco
#

Ah sad

#

All modders eventually grow up :(

#

And modding is non profit

#

Usually, at least

#

I used to mod 24/7 when I was younger as well

#

Now I do it to practice certain languages to get a job

modern hamlet
red tiger
barren junco
#

I did generalize

#

I would be a kid as well

red tiger
#

I could finish my JSON parser today if I put more time into it.

barren junco
#

That is odd

small quail
barren junco
#

Iโ€™m thinking maybe integer overflow?

#

Investigate about it @small quail, you might be able to get some answers

drifting ore
#

Hey guys, sorry for dropping in the middle of your convo but, I've been checking a lot of different mods but I can't seem to find anything related to specific zombie amount and what type of zombie various small buildings/Area's should have/include with custom behavior such as sprinters defending gunstores or Louisville Prison and Police station, I had a question regarding this - is this thing even feasible modding wise to create? I have no prior Lua scripting experience but I'm considering to learn to make something I feel is missing in the modding community.

barren junco
#

Hey that sounds like a good modding concept

#

Im not sure if zed spawn locations can be modified like that

#

But perhaps reverse engineering how the sandbox option โ€œzombie populationโ€ works might give us some info

#

Zombie population has 2 options
Uniform or urban if Iโ€™m not mistaken

#

Maybe Iโ€™m getting the option name wrong, but it was something similar

#

The fact that this option exists means that the game has a way to control zed population

gusty wharf
drifting ore
barren junco
gusty wharf
# drifting ore Will check it out!

If making a mod like that from the ground up would be too hard for you, you can try modifying that mod, but if you want to upload/distribute it somewhere you need to ask the original creator for permission.

gusty wharf
#

Does anyone know where the 2D images or icons of items in the inventory are located?

drifting ore
#

I think I do, have you checked the \steamapps\common\ProjectZomboid\media folder?

#

Lemme see if I can narrow it down and find it

#

They might be compiled into a .pack file

gusty wharf
#

I'll get the ones I want from the wiki then, thanks though

drifting ore
#

i'm running into a really weird issue atm. for south and east facing world sprites when i and slightly off the sprite model. i still get the regular context menu options that i would get if if it were unmodded by lua.
example screenshot when i right click just to the left of the world sprite

#

it should look like this, and when i click on the sprite itself it works normally. not sure why it's giving me az context menu option from a range around the south and east facing sprites

#

same sprite same location same everything, the only difference is when i click just slightly off the sprite on only south and east facing sprites... i get what would be the non modded context menu

ancient grail
#

Use vanilla

drifting ore
#

anyone ever ran into this before?

#

what you mean?

ancient grail
#

Refer to vanilla

drifting ore
#

oh them haha ๐Ÿ˜„

#

im trying to make my clothing mod spongies open jackets compatable, can anyone help me?

ancient grail
drifting ore
ancient grail
barren junco
drifting ore
#

so trying to make a clothing mod compatable with spongies open jackets is now modeling?

#

im not modeling anything and i am bad at blender

barren junco
#

Skill issue ๐Ÿคทโ€โ™‚๏ธ

drifting ore
#

your statement does not help

barren junco
#

Just try though, you can get better

#

Oh I was just giving you a hard time, sorry if it was mean

drifting ore
#

what you said was practically destructive critisism

barren junco
#

Oh no donโ€™t take it that way

#

What I mean is, we are all bad at everything at some point

#

If you have the time and will, practice some modeling!

drifting ore
#

i came here for information on how to make any generic clothing mod compatable with spongies clothing

#

this is not modeling ๐Ÿ’€

ancient grail
barren junco
barren junco
#

I mean, itโ€™s just the xml configuration of your model

drifting ore
barren junco
#

Oh Iโ€™ve done some modeling in the past

#

Blender and some Minecraft models

ancient grail
#

Anyways how did open jacket thing work exactly i havent seen the mod

#

I know it but havent checked the code

drifting ore
ancient grail
#

Without looking at the code maybe its just 2 clothing type that uses oncreate recipe to swap the first one to the second mode

Just aslong as you send the condition and the holes and everything to the second clothing cuz basicallly hou delete the first oen and replace

#

Thats an idea but not saying thats what he did on his mod

But this is what i did for the bag hider mod

drifting ore
#

i took nightscales rick grimes sheriff outfit and recolored it the way i like it, but i need know or figure out how to make it compatable with spongies open jackets

ancient grail
#

Ehhhh ammm
Did you ask permission tho?

drifting ore
#

of course i asked

#

he said yeah because he doesnt have the time to edit the outfit and what not, so i took it in my own hands and did it for myself because if its one thing ive learned is that you have to do it yourself because nobody else will do it for you

ancient grail
ancient grail
# drifting ore

From the top again. U want that mod tl be compatible or similar to different mod right or is it the same mod?

In any case have you checked out how they did it?

barren junco
#

What are you making exactly?

drifting ore
drifting ore
barren junco
#

Only the uniform?

drifting ore
#

yes

barren junco
#

It is an event that is called whenever you right click an item in your inventory

#

And if the item you clicked is the jacket, you can add an option to close it or open it

#

And ofc change the jacket model correspondingly

barren junco
#

Nice

drifting ore
barren junco
#

Oooh wonderful

ancient grail
# drifting ore

Do an extra checks for the faces
Maybe its how you filtered the context menu
What exactly did you use to determine its a light switch,?

barren junco
drifting ore
#

i dont know how to program lua

barren junco
#

Oh okay

ancient grail
# drifting ore

Hmm its an outer clothing piece and not tuck in i think
So just remove it?

drifting ore
#

i am good at gimp though, i can retexture stuff but thats about it

#
    for _,v in ipairs(worldobjects) do
        local square = v:getSquare()
        if square and sq == nil then
            sq = square
        end
        local sprLight = v:getSprite()
        local sprSwitch = sprLight:getProperties():Val("CustomName") == "Switch"
        if not sprSwitch then return end
ancient grail
drifting ore
#

oooo good idea

#

i will tyty

ancient grail
drifting ore
#

i have severe ocd when colors are supposed to match

#

the pants being darker than the hat under the light but it seems perfect under no light

ancient grail
drifting ore
#

but the fact that i dont know where to start is the real problem

#

with at least trying to add the ability to open and close the jacket as well as tucking in and tucking out the trousers

ancient grail
#

Yeah if you enjoy it you might try and make an entire clothing mod from scratch

barren junco
#

@drifting ore learning lua would be an excellent first step

drifting ore
#

i do enjoy it, but my problem is that i dont know where to begin

barren junco
#

Lua is a very very simple language

#

Well you got the internet, you can check out documentation

#

Search for YouTube tutorials

#

Read the official lua website

#

Check out a website called lua cheatsheet

ancient grail
#

Anyways you are giving almost no info for me to help out. Idk how to help. Try first to learn how the xml works . Tinkering it for starters to see what params are important

drifting ore
#

specifically for project zomboid? or will it be just a random game with totally different lua and me accidentally copying that into project zomboid thinking its going to work

drifting ore
ancient grail
drifting ore
#

yeah already got that up

ancient grail
#

Just check the hypen

When mever you see a guid
Its suppose to be unoque

#

Ok then good

drifting ore
#

but i dont understand what a guid does

ancient grail
#

Mmmm
Think of it as a unique identifier

drifting ore
#

what is it supposed to do? what does it mean? these are the things i need to know to successfully create a mod

#

so i randomly generate a guid and then add it to

ancient grail
#

Reason for this is clothes are named mmmmm generic ish

drifting ore
#

but you are talking to a level 0 complete noob

ancient grail
#

So theres definitely lot of room for conflict
The guid prevents that

deft falcon
#

thank god i did roblox studio it let me start pz modding easily bc both use lua

ancient grail
#

Hi again fajdek how r u

barren junco
#

@drifting ore send me a DM, Iโ€™ll show you where to get started

deft falcon
#

i feel good bc those gym goer abusers from more traits r gonna get a nerf soon and i already feel the comments incoming ๐Ÿ˜ˆ

ancient grail
#

Have you check to see what conflicts your mod from sapphs mod? The thing i asked you before.

deft falcon
#

oh i completely forgot

#

ill check tomorrow

ancient grail
#

Pls and thank you

deft falcon
#

what function/line caused issues?

#

if it told that

ancient grail
#

Ill check the screenshot

red tiger
#

My parsed uber JSON is now 80K lines lol

#

Oh heck. Recipe defs are wild.

#

I think that I'm going to skip those for now. xD

#

The syntax for recipes is very different from everything else in ZedScript.

quasi geode
red tiger
quasi geode
#

i havent. but i've done the whole script parser thing (in python though)

red tiger
#

Going to modify my AST parser to have an expression to compile all destroys, etc. into one array.

#

My AST JSON is a way to remove all the crazy from the script so I can walk through the JSON instead of the raw text to fully parse.

#

Recipes broken but here's my current uber JSON:

gusty wharf
#

Hey guys, is a mod that basically just modifies the base game files allowed? In this case it's a mod that disables the trait point limit.

frank elbow
#

Yes, there are quite a few mods that do that. If by modifies you mean overwrites a base game file (by including a file with the same path & name) with a copy of it with modifications, though, I urge you to think about whether there's a way to do it without doing so

#

Overriding only the functions you need > doing that. It's less prone to breaking between versions, and if it does break it should be simpler to fix

gusty wharf
frank elbow
#

I'm unfamiliar with the file you're referencing, but I'll provide a hypothetical example. Let's say there's an ISWhatever with behavior you want to modify. In particular, you want to change the ISWhatever.doThing function to do something slightly different. Instead of overwriting the entire file, you could do something like:

-- a reference to the existing doThing, if you need to call it in your override
local _doThing = ISWhatever.doThing

function ISWhatever.doThing()
     -- overridden behavior here
end
#

I neglected to reply, @gusty wharf

gusty wharf
#

Thanks

drifting ore
#

so weird man. driving me batty

#

can't release like this lol

#

hmmm might go back to the tiles themselves and look. i'm stumped though

#

actually there must be another condition i need to cover gonna look around vanilla. any suggestions are welcome, if you know the best way for me to detect the sprite on the wall. there is 8 diff sprites i'm doing by custom name, and direction offset atm.

    local sq
    for _, v in ipairs(worldobjects) do
        local square = v:getSquare()
        if square and sq == nil then
            sq = square
        end
        local sprProp = v:getSprite():getProperties()
        local sprDirs = {"Noffset", "Soffset", "Woffset", "Eoffset"}
            for _, sprDir in ipairs(sprDirs) do
                if sprProp:Is(sprDir) ~= nil then
                    local sprSwitch = sprProp:Val("CustomName") == "Switch"
                    if not sprSwitch then return end
#

it's detecting them. but only when the tiles are facing south or east it allows you just just click on the outside of the tile and obtain a completely different context menu but for the exact same tile. if i rclick directly on the tile object itself, it performs as expected

#

example screenshots. you can always tell my context menus because they have icons attached to them
#mod_development message

#

yea i can literally click anywhere on the entire square anyywhere. it must be another condition im missing

#

clicking by floor

drifting stump
red tiger
#

It's literally an Uber compilation of all pz ZedScript

drifting stump
#

well all vanilla scripts are still 1.83mb

drifting ore
#

im having a bit of trouble with my mod can anyone help

red tiger
drifting stump
#

i guess some websites have larger payloads than that

red tiger
#

Definitely not for the web lol

drifting stump
#

yes for the web

red tiger
#

I wrote the parser so I can write a electron app for ZedScript

sour nova
#
--higher level books worth more procedurally
            elseif(thecat == "SkillBook") then
                local bookPriceBase = 5.00;
                -- struggling to grab the decimal from the name???
                local bookLevel = string.match(itemName, "%d"); --little trickery to grab the number
                if (bookLevel ~= null) then
                    print("bookName: " .. itemName ..", parsed #: " .. bookLevel );
                    bookLevel = tonumber(bookLevel);
                    newprice = bookPriceBase*bookLevel;
                else newprice = bookPriceBase; end;
                --]]

why is newprice always 0 ? my debug print shows i'm correctly parsing the booklevel from the string

drifting ore
#

help plzif getActivatedMods():contains("ItemTweakerAPIExtraClothingAddon") then
require("ItemTweaker_ExtraClothingOptions");
else return end

local function ModifyParamsFromOriginalItem(originalItemName, newItemName, resistanceModifier)
local originalItem = ScriptManager.instance:getItem(originalItemName);
local newItem = ScriptManager.instance:getItem(newItemName);

if ((not originalItem) or (not newItem)) then return end;

if resistanceModifier then 
    -- modify resistance
    TweakItem(newItemName, "Insulation", originalItem:getInsulation()*resistanceModifier);
    TweakItem(newItemName, "WindResistance", originalItem:getWindresist()*resistanceModifier);
    TweakItem(newItemName, "WaterResistance", originalItem:getWaterresist()*resistanceModifier);
end;

end

--Automates the adding of context menus
local function AddNewExtraItem(originalItem, newItem, originalContextMenu, newContextMenu, resistanceModifier)

ItemTweaker.AddOrReplaceClothingOption(originalItem, newItem, newContextMenu);
ItemTweaker.AddOrReplaceClothingOption(newItem, originalItem, originalContextMenu);

TweakItem(originalItem, "clothingExtraSubmenu", originalContextMenu);
TweakItem(newItem, "clothingExtraSubmenu", newContextMenu);


ModifyParamsFromOriginalItem(originalItem, newItem, resistanceModifier);

end

function Add4WayExtraItem(item1, item2, item3, item4, context1, context2, context3, context4, resistanceModifier)
AddNewExtraItem(item1, item2, context1, context2);
AddNewExtraItem(item2, item3, context2, context3, resistanceModifier);
AddNewExtraItem(item1, item4, context1, context4, resistanceModifier);
AddNewExtraItem(item2, item4, context2, context4);
AddNewExtraItem(item1, item3, context1, context3);
AddNewExtraItem(item4, item3, context4, context3);

end

-- trousers tucked
AddNewExtraItem("Trousers", "Trousers_Police_SheriffTUCK", "TuckOut", "TuckIn", 1);

sour nova
#

^ surround your post with -triple ` to turn it into a codeblock

drifting ore
#

can you help me please?

#

it asks me to have discord nitro to send code blocks too

gusty wharf
#

Does a trait still retain its features even if you change its name in MainCreationMethods.lua?

#

for example from
TraitFactory.addTrait("Cook2", getText("UI_trait_Cook"), 4, getText("UI_trait_Cook2Desc"), false);
to
TraitFactory.addTrait("Cook2", getText("UI_trait_Cook2"), 4, getText("UI_trait_Cook2Desc"), false);

#

I'm trying to experiment with the seemingly unused ones

#

and make them able to be chosen

#

even if it presumably does the same thing

sour nova
jaunty marten
sour nova
jaunty marten
subtle gyro
#

Hey everyone. I'm a 3D artist and I want to do stuff. Anyone needs help? I can do 3D modeling and animation

thick karma
#

Hopefully you can imagine the consequences of that.

real sierra
#

sometimes these hips do lie ๐Ÿ™‚

thick karma
#

If we could rebind prop bones to our hands, create an animation, and then rebind the prop bones back to our pelvis, is there some fancy way to leave the movement data alone on that final step, such that the movement is based on the hand position but the bone remains technically attached to the pelvis on export for compatibility?

subtle gyro
thick karma
#

Really? @dark wedge and @ancient grail and I would love to know. We have been manually moving and rotating hand items and it is hell.

#

I have to work in a few minutes but if you don't mind DMing me I might try to get you in a group chat about this

subtle gyro
#

Just, like, make a new object (like a Empty), add a constraint to follow the hand, and add a constraint on the weapon bone to follow the empty? Something like that should work shouldn't it?

thick karma
#

I am not an animator. I have only recently learned to animate for this game. I am not an expert in playing with the settings of an animation and having things come out right. Also, the only software in which most of us know how to edit and export .X files is fragMOTION (and the game's vanilla animations are mostly .X files).

#

Which is not exactly the most brilliant software I've ever seen

#

Maybe it has that ability but I wouldn't be surprised if a lot of advanced tools are missing

gusty wharf
#

There's one that allows to import it

thick karma
#

If I could properly import and export the .X files using Blender, finding tutorials to do other things would be infinitely easier

gusty wharf
#

I found an exporter but it's for Blender 2.8

subtle gyro
#

I'm under the impression you can actually not have to work with those curses .X files. A friend of mine is working with .fbx animations, said it works. Maybe .X is old code from before a rework?!

gusty wharf
#

I have a somewhat different suggestion. Maybe try exporting in Blender to a format that both fragMOTION and Blender support, then import it to fragMOTION and export it to .X . I think I did some stuff like that a couple times and it worked. Not really sure if it'll work with this but there's a chance it will

gusty wharf
#

people are also saying that it's better to use .fbx than .X

#

if making something

thick karma
#

I mean .fbx animations DO work but the vanilla animations are all .X, so we need to import them at least... Or manually redesign poses, which generally doesn't lead to perfect matches for me.

subtle gyro
#

If you do import the .X file, you will have to work with that skeleton, though. Which for me was a nightmare

thick karma
#

I guess if there is another way to handle the props well in Blender maybe it would be worth it. Approximating an initial pose once would probably be easier than what I've been doing to move props around.

gusty wharf
#

What software did the devs use for these animations?

#

By the way seems like the Blender addon can't import animation .X files .

dark wedge
#

All the .x tools for Blender are either really old, or just don't handle .X animations correctly, unfortunately

subtle gyro
#

What do you mean? You are animating on fragMotion?

dark wedge
#

Have to when your making a change to a vanilla animation. It's the only thing that can read/write .X animations properly

#

Making my own from scratch, then sure Blender and fbx is the way to go

subtle gyro
#

I see

#

How about exporting it to something Blender can read? Doesn't it work?

#

I did have a lot of issues and didn't manage yet to export anything to the game. All those conversions and stuff, and also I'm not a coding guy so I don't even know how I would test if it works

dark wedge
#

There is a guide in the #modeling pins about importing the animation into blender by converting it into Half-Life source model data, but then the export from blender is always wrong for me among a bunch of other stuff with that method during the workflow. Maybe it's just me, but I couldn't get good results from that

gusty wharf
#

so still broken

#

.smd works

#

but without animation at least for me

dark wedge
gusty wharf
subtle gyro
#

This is just in case you want to get the default vanilla animation as base for something new, right?

thick karma
#

Correct

#

@subtle gyro

subtle gyro
#

So, you don't need to convert it back to .X after your changes

#

I mean, that part of the process you guys must know much better than me

thick karma
#

Possibly not, but I don't know anyone who has posted any reliable technique for converting .X to .fbx in Blender and then getting that fbx into the game

dark wedge
#

You can export as fbx if you're working in Blender.

#

No need to go back to .X I would think

subtle gyro
#

Yeah, I can't say much

#

All I know is Blender stuff

#

I have both .fbx and .X characters here, but as I said, I didn't manage to make a mod that puts my stuff back in the game

#

That's why I'm here, I offer help in the animation process, you guys do the script ๐Ÿ™‚

gilded hawk
#

OMFG I Did just read the thursdoid news and theywill be adding OnZombieCreate ๐Ÿ˜ป

quasi geode
gilded hawk
#

It's good enough knowing I will get it at some point. It's even better cause it mean I can do other stuff before b42 instead of making 10 mods per week lol.
And the onchunkloaded event will make it so easier for me to implement the airstrike mod. Good times

red tiger
#

Attempting to parse recipes now. =)

#

Looking at your guide too funnily enough..

quasi geode
#

i really need to put some more work into that thing & get it up to date at least

red tiger
#

Taking a look at the code moreso.

#

So each line is a source instance and should be handled separately.

#

But all sources are options.

#

one of each required to satisfy the requirements.

#

I think I have it now.

red tiger
#

xD Same energy.

quasi geode
#

ah, point of note for your parser (something i remembered looking at my python version)
dealing with recipes # NOTE ALL THESE KEYS ARE ACTUALLY CASE_SENSITIVE

thorny charm
#

is there a way to fix this. I cant seem to figure it out. lol

red tiger
#

There's very wild parse code.

#

Some code doesn't even trim-check for whitespace. =/

#

All my json tags use camelCase. They can be transformed back to whatever when exported back to the original txt format.

#

Will b42's take on ZedScript do non-case-sensitive checks on all tags?

quasi geode
#

it will if i remember to fix that lol (i'm going to have to make a note) its all very inconsistent.

red tiger
#

I won't be that guy.. but

#

Yeah I really hope you do.

#

Rooting for ya on that task.

#

Life is easier when checking a lower-cased string

#

=)

#

Also don't worry, I already expect to do major refactoring when 42's code is live.

quasi geode
#

easy enough fix. and should be done since the inconsistency can lead to pointless and inaccurate bug reports. but i'm done for the day so it gets to go on the todo list XD

red tiger
#

As long as it's on the radar.

quasi geode
#

its been on my radar for uh...3 years now at least ๐Ÿคฃ

red tiger
#

I'll work with you if the need arises. Again the app I'm working toward will be to help people with working on ZedScripts without dealing without these silly technicalities.

#

It's been on my TODO list for 9 months now.

#

It's worth it.

quasi geode
#

lol ya.. the inconsistency is real. just relooked at the recipe parser. apparently the case-sensitive comment only applies to some of the properties. some of them are case insensitive ๐Ÿคจ

red tiger
#

Yup.

#

This applies to general item properties too.

#

Some string values are trimmed while others aren't.

#

Leads to whitespace issues if not careful.

quasi geode
#

pretty sure Item.class converts it all to lower before checking but i'd have to relook

red tiger
#

mmmmm Not in the load method.

#

var 3 and var 4 aren't checked the same throughout.

#

DoParam

thick karma
#

@quasi geode Do y'all have an official policy about player playerIndex playerNum character playerObj usage out of curiosity? Is there a direction in which those practices are consciously moving? Just curious because if such a standard were being adopted I would want to start preparing my code appropriately...

quasi geode
#

ah nope it doesnt go lower case (looking at DoParam)

red tiger
#

Yeah. I didn't use the code as a reference for basic params. I wrote a customProperty sub-object for each category and weeded out the options that way.

#

Used switch tables with shadowed super calls to basically the equivalent of a DoParam setup..

quasi geode
red tiger
#

I'm all for the revoluti- I mean breaking compatability for mods by cleaning up the API.

#

After 10 years of buildup, it's time.

#

People'll be mad either way.

thick karma
#

Understandable, I was only wondering. I suspect I am not alone in the occasional headache manually figuring out whether player is actually a player or just an index.

quasi geode
#

pretty sure we're going to break a pile of mods anyways (always seems to be the case), especially due to a number of the changes / new features

thick karma
#

Well good luck to us all

red tiger
#
export type RecipeAction = 'destroy' | 'keep';

export type RecipeConstructor = {
    sources: RecipeSourceExpression[];
    body: AssignmentStatement[];
};

export type RecipeSourceExpression = {
    items: string[];
    action: RecipeAction;
};
quasi kernel
#

Im expecting my magnet fishing mod to break when B42 comes out but I'm not the slightest bit upset.

#

Just means I can have fun integrating it into an even more fleshed out fishing system.

quasi geode
#

yep i'm sure any fishing mod is going to break lol, its quite the change there. havent had time to play with the new system myself but looks neat

thick karma
#

Haha I just hope that any UIs updated either add their own gamepad support or don't break mine but I know what my hope is worth historically

#

And it's not a lot lol (in life not @ Zomboid, I'm new here)

quasi geode
#

no idea on that one, UI = not my area

thick karma
#

Fair enough

ancient grail
ancient grail
ancient grail
ancient grail
quasi geode
ancient grail
#

Ow ok thnx ..

red tiger
#

Parsing recipes in AST now.

dark wedge
ancient grail
#

๐Ÿ˜ฎโ€๐Ÿ’จ

rain iron
#

I wish there was an easier way to extract x file animations

ancient grail
#

Anyone knows how to check of a square is part of a safehouse

#

Anyone has a snippet or idea where rhis is written

rain iron
#

does anyone know a way to keep the position between animations in sync?

#

it's an timed action disguising itself as an emote, with an initial starting anim + looping anim.
Is there a bone that is responsible for indicating actual player position or something

red tiger
#

Recipes might have me rewrite my initial parser code.

#

The syntax is so wacky.

#

I split up = which messes up with recipe sources.

#

Really wanted to finish my parser today. =(

digital moon
#

I'm having the darndest time trying to figure out how to create a container that only accepts certain items. I've tried to look up the code for the clothing rack in the vanilla game because I heard it only accepts clothing - but I am unable to find it. Any suggestions would be appreciated

true vault
#

Oh wow, and ZedCreated too..

I swear, all y'all devs are catering right to what I'm looking for >.>

thick karma
#

Or you'll slide around

rain iron
#

iirc, I think when I retargeted the animation I didn't retarget the translation bip

#

so it stays in place during anim

#

I believe the loop falling animation isn't also off-center if that is related

thick karma
#

Afaik, if you created the loop animation using the end of the original animation, you would not move unless the translation bip is wrong.

#

When I made Meditation I had to make a transition and a loop just like yours

#

And my character would slide around until I zeroed that bip

rain iron
#

I see, I'll take a look at your mod to see how it works.

wet ridge
#

Hi all.

GPU needed for dedicated server?

thick karma
#

@rain iron I deleted all translation data on this and left it in its original state from the blender template:

#

That completely fixed any sliding of the form that was not visible in Blender.

rain iron
#

I see I'll try that on my end.

thick karma
#

I found it very easy to accidentally drag select and move that Translation Data object when I was editing. I would always manually unselect it after I realized the problem.

#

PSA for anyone adding gamepad support... if you decorate getBestAButtonAction, getBestBButtonAction, or any of the other getBest actions, do not forget if self.aPrompt then return end in the code below!

local Example = {}

Example.patchButtonPromptsForA = function()
    Example.ISButtonPrompt = {
        getBestAButtonAction = ISButtonPrompt.getBestAButtonAction
    }

    function ISButtonPrompt:getBestAButtonAction(direction)
        local player = getSpecificPlayer(self.player)

        if conditionsForHighPriorityPrompt() then
            self:setAPrompt(getText("YOURTRANSLATION"), YOURFUNCTION, param1, param2, param3, param4) 
            return
        end

        Example.ISButtonPrompt.getBestAButtonAction(self, direction)

        -- Do not change the prompt if you already found the one you want.
        if self.aPrompt then return end

        if conditionsForLowPriorityPrompt() then
            self:setAPrompt(getText("YOURTRANSLATION"), YOURFUNCTION, param1, param2, param3, param4) 
            return
        end
    end
end

Events.OnGameStart.Add(Example.patchButtonPromptsForA)

return Example

This prevents you from overriding actions you did not intend to override, e.g., if the Open Door prompt is already set and your decoration may be relevant when we are near a door, you may not want to overwrite the bound self.aPrompt and corresponding function, because you'll stop us from opening doors whenever your condition is active. (Real-life example: Aquatsar overwrites our door-opening when we are running because it fails to check self.aPrompt before setting its own prompt.)

#

@tame mulch If I threw the above example on the Wiki, would it be appropriate for the Beginner section?

#

(Alternatively, feel free to stick it wherever it's appropriate.)

rare wigeon
#

Hey, I can't understand how to properly make moveable furniture. I created tile properties file, .pack file and added a script. But for some reason I can't pick up my stuff, and script only shows icon, name and type. How can I fix it?

thick karma
#

(@ anyone paying attention who may have grabbed code quickly, I fixed a forgotten class name and switched the whole module name to Example above shortly after posting it.)

thick karma
#

@gilded hawk Ay I see you lurkin... How's that automatic workshop / mod.info editor comin along!?

gilded hawk
#

Actually I finished it in November

#

@thick karma

thick karma
#

Oh cool! Does it also do the mod.info file somehow? Or was it always for the workshop.txt alone? I don't recall.

gilded hawk
#

The mod.info file does not really need an editor since it only takes plain text

thick karma
#

Behold:

-- mod.info
name=Meditation
poster=poster.png
id=Meditation
description= <RGB:0.7,0.7,0.7> This mod brings meditation to Project Zomboid! <LINE>  <LINE> Use meditation to rest, relax, and recover, or become invisible to zombies by channeling your unity with everything around you! <LINE>  <LINE> Meditation comes with a trait called "Yogi" that gives a +1 bonus to Lightfoot (making yogis move a bit quieter). All of the other effects of this mod are locked to players with this trait by default; however, in sandbox options, you may allow everyone to meditate exactly as yogis do! <LINE>  <LINE> By default, the option to Meditate will appear as an extra choice in the world context menu (the right-click menu); again, this will only appear for yogis unless the aforementioned sandbox setting is selected. For those who would prefer to always sit this way, there is an option in  <RGB:1.0,0.6,0.0> Mod Options  <RGB:0.7,0.7,0.7> that allows players to override the behavior of the vanilla "Sit on ground" option. <LINE>  <LINE> Meditation also includes a unique animation! This animation can be disabled using Mod Options after joining a server. This animation will override the vanilla sitting animation by default for anyone who can meditate; if you prefer requiring players to activate this animation via Mod Options, there is a sandbox option for turning the animation off by default. <LINE>  <LINE> The act of meditating offers a range of possible benefits that can be toggled or adjusted in sandbox options: <LINE>  <LINE> 1. Become invisible to zombies (SEE WARNINGS BELOW). <LINE> 2. Recover endurance as though you have activated the vanilla resting mechanic. <LINE> 3. Recover physical health (in terms of hunger, thirst, and fatigue) and ignore pain. <LINE> 4. Recover emotional health (in terms of fear, panic, stress, anger, boredom, and happiness). <LINE> 5. Enable dedication effects in sandbox options to base restoration rates on player habits! <LINE>  <LINE> ... et cetera
require=modoptions
#

It is MORE of a cluster to make mod.info look nice, however, it CAN be done

#

Colors and line breaks.

gilded hawk
#

Oh wow

thick karma
#

Oh yes

gilded hawk
#

Dayum man. well. I might consider adding support for it, but atm I'm busy with another project

thick karma
#

โค๏ธ

#

No pressure

#

But you WOULD be a legend

#

Food for thought: you could let users set color variables and automatically convert [h] tags to RGB:R,G,B tags

#

I think that would be super user friendly and awesome personally.

gilded hawk
#

Maybe, I will probably remake the app anyway to work with Lexical, but I dunno. We'll see

gusty wharf
#

What's the difference between OnCreatePlayer() and OnCharacterCreate()?

thick karma
#

Where are you reading OnCharacterCreate()?

#

They may be phasing that out, idk

#

I don't see it on the wiki's list of Events

gusty wharf
thick karma
#

Also, it's OnCreatePlayer

#

Additionally, there is OnCreateSurvivor. That may be something related to incoming NPC stuff. Idk.

gusty wharf
#

Ah alright I forgot lol

gusty wharf
little iron
#

Hey guys is there anyone accepting commissions here?
Also, as a blind guess, how much a commission for a headgear would cost?

thick karma
#

@ancient grail is basically always accepting commissions afaik; might be a thing he could do.

ancient grail
little iron
cinder frost
#

Anyone know the code to create a UI tab (seen in the crafting and character info menu)? I've been scouring the native code and even some mods that feature it but I think I'm a bit dull in trying to isolate it

red tiger
#

Good morning.

ancient grail
#

Anyone knows how to check if a floor has a valid floor tile ? I cant remember where i saw the syntax

jaunty marten
little iron
robust briar
#

Hello friends. Is there a way in one mod to disable the recipe of another mod?

#

I would assume I need to make an overriding script.. just not sure what I would put in there to out-right disable another mods recipe

ancient grail
jaunty marten
ancient grail
robust briar
#

Ohhh super smart

#

TY my friend

stone garden
#

hello im back

#

anyone want hear my mod idea?

#

soo an mod idea that i got is an mod that after death you can create an new character or become an ghost and haunt your friends my idea is based on minecraft requiem mod

#

and you can take control of an zombie

uneven nova
#

Hi everyone! im trying to get some clothes I made into game I have it all working but for some reason when blood splatters on my character it just makes that part of the mesh invisible instead of applying the blood texture to it. I tried making my own masks based on the UVs I have setup and copying colours from another mask but it doesn't seem to work. How does the blood get applied to the character?

cunning kestrel
#

Either me or the game is drunk. Help why doesnt it find/read this table/var
self.exercises:getOptionData(1)

uneven nova
ancient grail
#

i didnt need to check for floor after all

jaunty marten
shadow bough
ancient grail
#

nice thnx

stone garden
jaunty marten
jaunty marten
stone garden
#

and you have to infect your friends

jaunty marten
shadow bough
#

but with the zombie virus eating you brains, you dont know how to drive and you dont know to loot stuff

#

I guess the setting do give Zs the ability to navigate doors and such, so that is reasonable to have that ability as a Z no matter the settings

jaunty marten
ancient grail
#

Omg so my passion mod is similar to your idea that you have been pushing ?
All this time
?
Omg we should abort the mod

ancient grail
# jaunty marten <:shiz:736249320667480135>

Cuz me and @zinc pilot are doing a mod on the side
Its called reanimation
It lets you control your zed counterpart and disable everything that normal players can do
Like access stash and your screen os blank you dont have access to ui
The animations are half way done
We still have a long way to go
With the dragdown and such
Currenly our biggest hurdle is how do make the zed not follow us while still remaining visible
Ghost and invisibility is tied together

#

Its already mp compat

shadow bough
#

@ancient grail Thats awesome. Are the Zs that follow trying to attack the player Z?

vivid linden
ancient grail
#

We already have the code that disables moodle

#

Sorta like godmod ish

#

And the insta spawn as zed code

#

Id say we are almost half way thru

shadow bough
#

@ancient grail can you guys use a variation of the "Zombie Camouflage" mod. the sections for zombie detection, lowered to zero and the timer to infinite.
I know there is more to it than that, but just a thought.

acoustic dust
#

i wanna make a shop mod that uses the crafting menu.

#

how hard is that to achieve?

cinder frost
ancient grail
#
function SPH_matrix:draw9x9(x, y, nw, n, ne, w, at, e, sw, s, se)
    local side = 20
    self:drawRect(x, y, side * 3, side * 3, 1.0, 0.5, 0.5, 0.5)
    self:draw9x9aux(x, y, -1, -1, nw)
    self:draw9x9aux(x, y, 0, -1, n)
    self:draw9x9aux(x, y, 1, -1, ne)
    self:draw9x9aux(x, y, -1, 0, w)
    self:draw9x9aux(x, y, 0, 0, at)
    self:draw9x9aux(x, y, 1, 0, e)
    self:draw9x9aux(x, y, -1, 1, sw)
    self:draw9x9aux(x, y, 0, 1, s)
    self:draw9x9aux(x, y, 1, 1, se)
end

i wonder what this does?

drifting ore
#

thats for UI?

#

to draw a large shape * it seems

#

is this used somewhere? im bad at math but it doesn't add up lol

drifting stump
#

what in the fuck is that from

acoustic dust
quasi kernel
#

I'd say it's going pretty well.

bronze yoke
#

LOL

quasi kernel
#

Wait until you find "Dead Rat Type Heavy-Duty"

acoustic dust
#

ah yes, improvised bottle silencer from dead rat

#

seems correct

quasi kernel
#

Yes yes

acoustic dust
#

indeed

quasi kernel
#

Dead Rat (Wet)

#

I need to fix it not working on stuff like backpacks and stuff, but that's about it.

#

Namely the icons.

acoustic dust
#

keep it up ๐Ÿ‘

quasi kernel
#

@sour island Hey, you've made a literature mod right? Could I get some assistance with changing up icons dynamically?

#

Actually wait I can just use your mod for ref

#

Apologies

jaunty marten
quasi kernel
#

I need to prevent items with the multi-icons from doing the multi-icons

#

I wish to change their icons exclusively to the dead rat.

#

So stuff like chips, clothes, etc seem to be dodging the system.

drifting ore
#

I tried adding the spongies open jackets framework to my currently developing clothing mod, I have added the lua and other special thing needed for the mod to fully function with spongies open jackets (opening, closing, tucking in pants etc) but when I added this, upon launching project zomboid, the whole game freezes as it says โ€œloading luaโ€ and then after a minute or two the game closes itself. What did I do wrong? Can anyone help me on this situation?

vivid linden
acoustic dust
#

where can i find a recipe script template mod?

ancient grail
quasi kernel
acoustic dust
ancient grail
#

you can use vanilla as reference

#

i dont think theres a reference

#

imean template

acoustic dust
#

oh, i see what you meant

#

alr

#

will do

quasi kernel
#

Is there a way to get rid of an inventory item's tint?

red tiger
#

I'm considering writing a lexer for ZedScript instead of my cheap regex / tokenizer tricks.

#

=/

#

Hit an annoying wall with how I parse ZedScript with recipes changing it up.

quasi kernel
#

hard to tell, but no more weird tinting!

thorny charm
#

Did anyone make a mod that changed the pins on the map or it there a way to create something so based on what the building type is it give it an icon on the map. Think of a map like GTA V. Has icons for the building types

drifting ore
#

you can use mods that let you draw on map, but i dont think you can add anything to the hard map without some serious modding

quasi kernel
#

This is by far the worst mod I've ever developed.

fast galleon
#

do you sleep on a rat?

quasi kernel
#

Depends, do you have a rat to sleep on?

jaunty marten
#

change each game texture to rat omegalul

grizzled forge
#

make every item a dead rat not just food

quasi kernel
jaunty marten
quasi kernel
#

heavy duty dead rat

grizzled forge
#

oh I thought it only changed food my bad

fast galleon
#

what if you drop the items on the ground, can you see the actual item? I see you can "wear" rat?

jaunty marten
# fast galleon what if you drop the items on the ground, can you see the actual item? I see you...
local icons = item:getIconsForTexture()
if icons then
    print(tostring(icons:size()))
    for iconIndex = icons:size() - 1, -1, -1 do
        icons:remove(iconIndex)
    end

    icons:add(tostring(MassRatConverter.ratRef:getIcon()))
end
--item:setIcon(ratRef:getIcon())
item:setSpriteName(MassRatConverter.ratRef:getSpriteName())
item:setDisplayName(MassRatConverter.ratRef:getDisplayName())
item:DoParam("Icon = "..tostring(MassRatConverter.ratRef:getIcon()))
--item:DoParam("DisplayName = "..tostring(ratRef:getDisplayName()))
item:DoParam("DisplayCategory = "..tostring(MassRatConverter.ratRef:getDisplayCategory()))
item:DoParam("CustomEatSound = "..tostring(MassRatConverter.ratRef:getCustomEatSound()))
item:DoParam("StaticModel = "..tostring(MassRatConverter.ratRef:getStaticModel()))
item:DoParam("WorldStaticModel = "..tostring(MassRatConverter.ratRef:getStaticModel()))
quasi kernel
#

Stuff in your hands may appear normal, may not, really depends.

fast galleon
#

I'm sure I'm gonna see rats tonight when I sleep...

quasi kernel
#

tbh no idea why the -1 end index works but I dont question it

fast galleon
quasi kernel
#

It erroring?

#

Cuz it doesn't really do anything on my end, it just kinda exists.

fast galleon
#

no errors, just does nothing since you don't use get

quasi kernel
fast galleon
#

my thought is that loop does nothing because it doesn't work with indexes, but maybe I'm wrong

quasi kernel
#

Code seems redundant anyhow, too lazy to clean it up despite having just released the mod.

fast galleon
#

I assumed you tested it and needed it

red tiger
#

Am thinking about a map & mod idea from a couple years ago that I had about combining nuclear fallout with PZ and making a map of Fukushima.

#

One day..

#

Have yet to try STALKER mods for PZ.

molten raft
#

hey guys! does anyone know where can i find the file that describes the propane BBQ? i can't find the items.txt file that describes it, it only found the mov_redBBQ which it's the charcoal one, but i don't know how the game spawns them.

ancient grail
#

@red tiger you know how to determine if a square is safehouse or non pvp zone?
i you might know cuz of faction with friends

drifting ore
#

i'm honestly surprised that code i gave you doesn't do it

#

there is only two methods i see for getting it

#

one is based on the tiles themselves. i wonder if it requires a loop to check for other things also

jaunty marten
#

getNonPvpZone

#

checked source, it looks fine

#

what's the problem with that?

tame mulch
ancient grail
#
local x,y,z = getPlayer():getX(), getPlayer():getY(), getPlayer():getZ() 
local sqObj = getCell():getOrCreateGridSquare(x,y,z);
print(SafeHouse.getSafeHouse(sqObj))
drifting ore
#

did it not pull anything?

#

ohhh i see

#

nice

#

perfection

#

today may just be the day i finally release this lol.........

#

bug testing was a @#$%#