#mod_development

1 messages ยท Page 257 of 1

bronze yoke
#

yeah

clever coyote
#

Hey lads, sorry to be a pest but I'm in the midst of putting a very small mod together to fix an item spawn. I'm not particularly techy so I'm doing this by editing an existing mod, and I think I've got most of it down, I just need some confirmation on the last few bits if that's okay.

limber onyx
#

working with loot tables?

clever coyote
#

Aye, that's the one. Lemme grab a screenshot real quick.

limber onyx
#

you can type Back tick twice in discrod to paste code (`)

clever coyote
#

This is the stage I'm at right now. I've done the top paragraph (changing the item to spawn and the spawn locations), but the paragraphs below that are completely foreign to me. I don't know if I need to change them or delete them or whatever.

#

Ooh, noted. I'll do that next time, cheers for the heads up.

limber onyx
#

what are the items you want to spawn?

clever coyote
#

Just the gray hunting vest. I'm trying to set it to spawn with the same conditions as the other 3 hunting vests in the game.

#

the LocalTargets are all the normal overworld spawn locations, with the same rarity.

bronze yoke
#

i'd delete these sections, they don't seem relevant to what you're doing

#

also after DeskGeneric = 3, you need a } to close the targets table

clever coyote
#

Ah, that makes sense. Thanks! For my own knowledge, what do those highlighted areas do?

bronze yoke
#

the first one is an easter egg from the bic pen mod i assume you got this from, it has a somewhat low chance to spawn an insanely overpowered bic pen sword

#

the first part of the second one spawns items in zombie inventories and a couple other odd containers, and the later part spawns items inside of bags

clever coyote
bronze yoke
#

yeah (though 0.01 it's not really as rare it sounds stressed)

clever coyote
#

I figured they weren't percentile chances haha

#

What does the top part of the second paragraph do, if you don't mind me asking? Anything I need to change there?

bronze yoke
#

you don't need to change anything - it goes through the targets table, finds the container based on the name you gave, and then adds the item to that container with that chance

clever coyote
#

I think I getcha. So the top paragraph designates spawn locations, and the second actually spawns them?

bronze yoke
#

yep!

clever coyote
#

Right! So all I need to do now is upload it to the workshop and hope for the best. Fingers crossed!

#

Thanks Albion - I really have no idea how this works xD

#

Okay, having a minor issue. In order to upload to the workshop I require a mod.info file. Can I make that manually?

bronze yoke
#

yeah, it's plain text

#

it should be something like```
id=MyModID
name=My Mod

clever coyote
#

Albion, you have no idea how happy it makes me to see this one item in game after two fucking years of searching

astral geode
#

There should be an example mod you can copy and replace with your info

clever coyote
#

I made liberal use of the example mod, it was very helpful for getting the directories right! Really glad they included that haha

#

Would fixing more items be as simple as adding another paragraph and doing the same thing?

#

As far as I recall, there's quite a few items nestled in the code that don't have allocated spawn locations yet. I don't think I've ever seen a raccoon hat.

uneven jay
#

ello how do i make a players entire body heat up/cool down with a crafting recipe i couldnt figure it out for some reason

bright fog
uneven jay
#

how would i do that? i know lua but not how it works with pz

#

ik a bit of fivem lua if that helps?

bright fog
#

no idea

uneven jay
#

ok

bright fog
uneven jay
#

whats this

bright fog
#

What you'll need to learn how to heat up the character

#

I don't remember what you have to use to trigger lua functions from scripts so can't help with that part

uneven jay
#

ok

#

i dont really know pz lua either so idk how i would trigger it with a craft

#

just gotta leave the idea for some other day i guess

#

thanks for helping

bright fog
#

What are you trying to do exactly ?

uneven jay
uneven jay
#

uh

#

whats this

bright fog
#

This kind of thing ?

uneven jay
#

uh well not exactly but the same mechanic ig?

#

i didnt wanna heat up the player to benefit them

#

it was more of a blacksmithing thingy

bright fog
#

I see

uneven jay
#

since u hit hammer need heat to soften metal and stuff

bright fog
#

Yeah you'd have to trigger a lua function

uneven jay
#

yeah i get that part

bright fog
#
recipe Open Box of Dust Masks
    {
        destroy DustmaskBox,
        Result:Hat_DustMask=10,
        Time:5.0,
        Category:Misc,
        Sound:PutItemInBag,
        OnCreate:OpenDustmaskBox
    }
#
function OpenDustmaskBox(items, result, player)
    player:getInventory():AddItems("Susceptible.EmptyDustmaskBox",1);
end
#

OnCreate

#

And the name of the global function

uneven jay
#

ah

#

alr

#

well ill try

#

thank u for telling me

fossil salmon
#

Okay, now that i have my e-girl bathwater item mostly made, how do I export the 3d object from blender (with textures) in a way that zomboid understands?

buoyant dragonBOT
grizzled fulcrum
#

oop I did not expect it to do that here, I thought it was going to be a client-side message, ignore me and above

spice portal
#

Hello. Ehhh... could I have some help? I'm trying to get the script to make the SlowDown effect modifier only work if the "walking only" option is activated. Apparently, if I remove the "--" from the functions I made, the script stops working.

drifting ore
#

check the error log

#

it says where exactly script crashed and for what reason

#

if there's no error, you might have a logical condition conflict which makes your function return early either way and prevents the code from executing

grizzled fulcrum
ancient grail
dawn portal
ancient grail
#

Yes I've heard that sprinter does this but its been along time since i played the game i dont remember them doing it

so i wanted to know when you get slowed down

grizzled fulcrum
#

fun tip of the day: if something iterates over your inventory, don't execute that code every tick! big laggy

drifting ore
#

depends on what you do exactly

#

i hazard a guess that doing items:get(i) is a fair bit less CPU-intensive than getPlayer():getInventory():getItems():get(i)

#

also inventories tend not to change at completely random points in time so normally you can latch to some kind of event or function rather than running this every frame

grizzled fulcrum
#

what is items here

grizzled fulcrum
#

anything is possible I guess

#

Even though the loop through the inventory costs basically double the rendering of the ui element

drifting ore
opal horizon
#

Does anyone know why the game is giving me this error?

night masonBOT
drifting ore
#

you can use "UI_EN.txt"

#

or i guess UI_RU.txt in your case

grizzled fulcrum
#

but it is the same thing if you use it the same way!

drifting ore
#

it performs the same function, but it takes longer to execute

#

the arraylist containing items never changes in your loop, but you execute a command to re-fetch it every time anyway

#

rule #1 of code optimization: don't run the code

#

if you can arrive at the same result without running the code, then don't run it

drifting ore
opal horizon
drifting ore
#

If you have a unique mod ID then you can use that as a second prefix. That's a good way to make sure that your UI strings don't produce data collisions.

opal horizon
opal horizon
#

@drifting ore everything works through the original file, but through the mod files it produces a mess of letters

drifting ore
#

your editor probably defaulted to CP1251

opal horizon
drifting ore
#

huh, yeah, apparently it needs to be the other way around

#

so the file needs to be saved with CP1251

opal horizon
#

in notepad++ it is impossible to recode a file to cp1251 etc.

drifting ore
#

the game apparently uses old 8 bit encodings for most languages, utf-8 for chinese and utf-16 for korean

#

so it supports all of the options but only uses a specific encoding for a given language

grizzled fulcrum
#

I think that is the same as CP1251

drifting ore
#

it's how microsoft notepad calls it

#

or i guess microsoft in general

#

it invented a whole bunch of 8 bit code pages, but then renamed some of them from CP#### to Windows####

opal horizon
#

this is an option for reading and not for converting, it seems

opal horizon
opal horizon
nocturne swift
#

Hi, how can I add IsoTree on square? is this possible?
I add isoobject but it can't be cut

bright fog
#

It doesn't properly act as a tree

#

Sadly it requires a java mod to do so

unreal pewter
#

does anyone know any random reasons this could be happening? no loot will generate in any wardrobes of any kind

#

i have added some items to loot distribution pools, but i havent touched wardrobes at all, so im very confused\

bright fog
unreal pewter
#

the lines?

#

there are 382 of them so ill send some i guess

#

an example

bright fog
#

Just show a sample of it, or send the file

unreal pewter
bright fog
#

Why are your parsing itemJackPicker ?

unreal pewter
bright fog
#

When is that function running ?

bright fog
#

No one does that

unreal pewter
bright fog
#

And I'm not sure it's a good idea tho idk exactly what it does

bright fog
unreal pewter
#

the loot is properly being added to loot pools

#

the loot is being added just fine

bright fog
#

Add a print within the function and check console to see if loot is properly added

unreal pewter
#

im just not sure why wardrobes specifically arent generating

unreal pewter
#

ive been testing it for a while

bright fog
unreal pewter
#

yep

#

hold on i wanna test something

bright fog
#

Remove your parsing thing

#

No one does that shit

unreal pewter
#

maybe all loot pools EXCEPT ones ive messed with arent working?

nocturne swift
# bright fog Sadly it requires a java mod to do so

I understand that probably a method for isotree.new is needed, I was hoping that it would be possible to convert isoobject to isotree...
I'm trying to make a tool for filling voids, it works with grass, but there's a problem with trees.
in theory i can add a check for spritename validity to the tree cutting for isoobject, but i'm afraid it might affect performance

upd. If anyone is interested, I did it. I used the ISBrushToolTileCursor:create method

unreal pewter
bright fog
unreal pewter
#

i did

bright fog
#

All were broken ?

unreal pewter
#

yea

#

wait i might be confused

bright fog
#

Yea remove your parse thing

unreal pewter
#

what do you mean other container types

bright fog
#

Literally idk where you got that thing from lmao

#

But I have never seen anyone use that

unreal pewter
#

i checked some kitchen cabinets and stuff

bright fog
#

I myself have never used it

unreal pewter
#

bc i havent touched them at all

#

those were working fine, i think

bright fog
#

Yeah I wouldn't be surprised if it's that parse then

fleet bridge
#

If you are on admin mode, you can right click the container and Refill the container

unreal pewter
#

yea thats what i was doing

fleet bridge
#

also

#

in lootzed - the bottom right corner is for a specific container

unreal pewter
#

yea

bright fog
#

They know

unreal pewter
#

i know all about lootzed

#

ive been working on this mod for a month or so, so ive at least picked up the very basics of how to troubleshoot in this game

fleet bridge
#

if you added it into the distro and it shows up in container then cycling refill should eventually populate it

#

unless the chance is really small, it might take like 200 clicks

bright fog
#

Again, the problem is not there I think

unreal pewter
#

yeah no the issue is nothing is spawning from some distribution tables that i havent messed with at all

bright fog
#

It highly sounds like it's their ItemPickerJava.parse()

unreal pewter
bright fog
#

Just remove the parse thing already

unreal pewter
#

i did

#

still not working

#

ill search Wardrobe in the console, doubt thatll show anything though

bright fog
#

What's that for

ProjectGurashi.LootableMapRemoval = function()
    for i = #ProceduralDistributions.list[MapDistributions].items-1, 1, -2 do
        if ProceduralDistributions.list[MapDistributions].items[i] == MapsToRemove then
            table.remove(ProceduralDistributions.list[MapDistributions].items, i+1)
            table.remove(ProceduralDistributions.list[MapDistributions].items, i)
        end
    end
end
#

You remove items with that

unreal pewter
#

i didnt get it working so i commented it out

fleet bridge
#

do you even add it to WardrobeMan?

unreal pewter
bright fog
#

Well it's not commented out

#

On the file version you gave

#

It's not commented

unreal pewter
#

im stupid

bright fog
#

tho idk how that would remove every containers, if you said none work

unreal pewter
#

doubt thats doing it but ill try doing that

bright fog
#

You removed all the parse ?

unreal pewter
#

yes

#

ill test it again after commenting that out

#

sec

fleet bridge
#

in the file you linked, when i search wardrobe i do not see anything

unreal pewter
fleet bridge
#

unless you have it on another file

bright fog
#

Reload your game, just in case

unreal pewter
#

im not trying to add items to wardrobes

#

the issue is vanilla game loot will not spawn in wardrobes

#

absolutely nothing is spawning in wardrobes

fleet bridge
#

err

#

whats your max roll value set to

unreal pewter
#

for what?

coarse sinew
#

Have you tried another wardrobe? Not the same one you tried on before. Or rather create another world.

unreal pewter
#

this is like day 3 of trying to figure this out

#

but im stupid so idk how to fix it

#

testing something now

unreal pewter
#

yeah, still nothing @bright fog

#

i have an idea tho

#
    table.insert(SuburbsDistributions.all.Bag_Satchel.items, 8)```
#

when i had this in any function, it would completely break the function so it just wouldnt work

bright fog
#

all

unreal pewter
#

i wonder if any of this could randomly be causing it

    table.insert(SuburbsDistributions.all.inventoryfemale.items, 1)

    table.insert(SuburbsDistributions.all.inventorymale.items, "ProjectGurashi.BrokenMobilePhone")
    table.insert(SuburbsDistributions.all.inventorymale.items, 1)

    table.insert(SuburbsDistributions.all.Bag_Satchel.items, "ProjectGurashi.BrokenMobilePhone")
    table.insert(SuburbsDistributions.all.Bag_Satchel.items, 8)```
bright fog
#

I highly doubt it

unreal pewter
#

me too but

#

ive been surprised many times

bright fog
#

Tbf idk, I'm not enough familiar with problems related to loot spawn that could be causing that

#

Are you reloading your mod ?

unreal pewter
#

yea

bright fog
#

And you don't have the workshop version downloaded ?

#

If you have it on the Workshop already

unreal pewter
#

theres no version uploaded to the workshop

bright fog
#

No duplicates anywhere ?

unreal pewter
#

nope

#

all other changes i make work fine

#

its gotta be something wrong in that file

#

just to make sure though ill comment out the entire file and test if loot spawns

bright fog
#

You sure 100% your functions are running when they should ?

unreal pewter
#

like 90% sure?

bright fog
#

Did you test on a fresh map ?

unreal pewter
#

not yet

bright fog
#

Do it

unreal pewter
#

uh well

#

i completely removed this entire file from my code

#

and its still not spawning loot

bright fog
#

What is the rest of your mod ?

#

Are you using other mods ?

unreal pewter
#

adding a couple items, and a map

unreal pewter
#

but its a cheat menu mod and custom tiles

bright fog
#

Use your mod in standalone

fleet bridge
#

is there no loot spawning, like at all?

#

in any container?

unreal pewter
#

just not in wardrobes

#

other things are working fine

fleet bridge
#

๐Ÿค”

bright fog
#

Is your loot removal code still active ?

unreal pewter
#

nope

#

i disabled the entire file and it still doesnt spawn loot in wardrobes

bright fog
#

You sure ? Reloaded game ? New save ?

unreal pewter
#

yes

#

i am so confused

bright fog
fleet bridge
#

load a new game with no mods

bright fog
#

What is the rest of your mod ?

fleet bridge
#

and see what happens lol

unreal pewter
bright fog
#

Wait so that container is on your standalone map ?

unreal pewter
#

so, the mod includes custom tiles, items, like 2 recipes, a single item model (im lazy), and thats about it

unreal pewter
fleet bridge
#

in your standalone map, you need to do a few extra things to make stuff spawn iirc

#

you should ask in mapping discord

unreal pewter
#

this is like the 4th month ive been working on this map

#

its been working fine until like 5 days ago

fleet bridge
#

did wardrobe spawn stuff previously/

#

oh

unreal pewter
#

im not sure whats wrong now

fleet bridge
#

revert to last week's work and work forwards from there ๐Ÿค” hard to debug

unreal pewter
#

if the week old backup even has that working

#

i just noticed this happening

#

it might have been an issue for longer and i never noticed it

fleet bridge
#

i mean, its just one wardrobe...

unreal pewter
#

its happening in all wardrobes

fleet bridge
#

then its probably something that changed between now and a week ago, just gotta isolate it out if thats the case

unreal pewter
#

and honestly it might just be related to just like

fleet bridge
#

i dont see a reason in your code that wardrobe would be affected though

unreal pewter
#

certain loot pools just not working at all

#

im not sure

bronze yoke
unreal pewter
#

there might just be an issue with my game itself

bronze yoke
#

it is absolutely not the cause of your problems and removing it will actually cause your distributions to stop working if you don't move it to an earlier event

fleet bridge
bronze yoke
#

it's an issue if you add your distributions late, which they do

#

the main reason you would want to add them late is so that sandbox options are available

fleet bridge
#

what are the consequences of adding it, say, on PreDistributionMerge

bronze yoke
#

that's fine, i think only PostDistributionMerge onwards is too late

fleet bridge
#

ah, yea i do all of mine on predistribution

#

so i was worried ๐Ÿ˜‚

unreal pewter
#

what the fuck

unreal pewter
#

i changed to a different sandbox preset and it works

#

????????

bright fog
#

Did you fuck up your loot settings in one ?

unreal pewter
#

my mod has no sandbox settings

#

i saw loot spawn and my jaw was genuinely just hanging open

#

i love modding this game sometimes

#

by default i was on a setting where guns and ammo wont spawn

coarse sinew
unreal pewter
#

the loot setting for them was set to none in sandbox settings

#

apparently this caused everything in a loot pool that has a gun to not spawn at all

#

genuinely what

unreal pewter
#

which is just weird because like

#

in LootZed it showed guns with a 0% spawn rate

#

so it DID change their spawn weight to just be 0

#

it must be some bug or something

bright fog
#

Game told you fuck you

unreal pewter
#

well . now not sure what to do

tulip valve
#
    if player:HasTrait("fast") then
    if (player:isSprinting() == true or player:IsRunning() == true) then
            SpeedFramework.SetPlayerSpeed(player, 2.0)
        end
    end
end
Events.OnPlayerMove.Add(Quick);```

I'm having problems with this code, the speed buff gets applied but I still have it if I walk or go in combat stance and then goes away after 10 seconds or so. I want the extra speed to turn off the moment the player stops running or sprinting
unreal pewter
#

the map is set in japan where theres pretty extreme gun control laws so i had set it to default in apocalypse to have gun spawn rates at "none" in sandbox settings

fleet bridge
bright fog
bronze yoke
#

predistribution is too early

bright fog
#

So you don't update it uselessly

#

And don't override other mods speed boosts

#

Tho idk how the framework works

bronze yoke
#

there's no way to use sandbox options for items without using that method to re-parse the sandbox options, the default parsing always happens before sandbox options are loaded

tulip valve
bright fog
#

You'll force set it to 1

#

But if another mod tries to set it

grizzled fulcrum
bright fog
#

You'll override it

bronze yoke
#

this can be annoying in testing because there is an exception where when creating a new singleplayer game, your sandbox options *are* available early because you just set them, but in all subsequent launches of that save they won't be

tulip valve
#

Is there another way then?

bright fog
#

Like I said, idk how the framework works

tulip valve
#

yeah me neither

#

I suppose I should ask the author

grizzled fulcrum
nocturne swift
bright fog
#

I know there is a problem somewhere with these, I don't remember what exactly

tulip valve
#

nil will deactivate. according to the author, maybe I should use that instead of 1.0

tulip valve
#

ah

bright fog
#

You'll force it to nil

coarse sinew
# bright fog Is it animated ?

It's not the animation that doesn't work, it's that the other tree saplings won't grow, or for example, they won't be covered in snow, they won't wither in the fall.

ancient grail
nocturne swift
bright fog
#

I always forget what the exact issue is, but yes it's this

nocturne swift
#

Iโ€™ll work on this, the main thing is that I was able to get an object of type isotree, for me this is a victory, I tried to figure out how to do this for several hours, thanks everyone)

bright fog
#

yea like I mentioned, requires a java mod

grizzled fulcrum
#

every time I think about Java mods I just get sad that we can't do them, its kind of a cycle

nocturne swift
spice portal
#

It seems as if the game is in โ€œdefaultโ€ (talking about sprinters).

river perch
#

hi again, any idea on how to fix this issue?

#

the item list doesnt show up at all

bright fog
river perch
#

these are the errors i get

bright fog
#

What is your mod doing

river perch
#

so i made a gun, with textures and everything, but i also wanted to make a book in order to craft said gun

#

ive got no clue what im doing wrong

limber onyx
#

Hi guys. Thanks for the help yesterday. I almost got my mod ready. There's only one pending issue.
I was unable to use the lua file to hide the recipes added by a mod (Since I couldn't modify them, @bronze yoke suggested to mark them as hidden but I must have messed up because the recipies are still there)

#

Can you help me review the code to find out where I screwed up?

#

``Events.OnGameBoot.Add(function()

local recipes = ScriptManage.instance:getAllRecipes()
for i = 0, recipes:size()-1 do
local recipe = recipes:get(i)
if recipe:getFullType() == "Susceptible.Open Box of Face Masks" then
recipe:setIsHidden(true)
end
if recipe:getFullType() == "Susceptible.Put Face Masks in Box" then
recipe:setIsHidden(true)
end
if recipe:getFullType() == "Susceptible.Open Box of Dust Masks" then
recipe:setIsHidden(true)
end
if recipe:getFullType() == "Susceptible.Put Face Masks in Box" then
recipe:setIsHidden(true)
end
end``

#

(Sorry in advance if I don't reply quickly, something came up. We can check this later, sorry to interrupt you all)

river perch
bronze yoke
#

sniped...

bright fog
#

:3

bronze yoke
#

this is what i deserve for doing it to shurutsue all the time

bright fog
limber onyx
#

@bronze yoke Thanks mate!

low radish
#

hey yall, im making a mod that changes the pizza system so that pizzas with different ingredients will have different sprites and names

#

so instead of getting a pizza called Sausage Pepperoni Pizza and its just a pepperoni pizza sprite, you get Meat Lover's Pizza and its a custom sprite of a meaty pizza

#

ive got a very basic framework for the code but i have no idea how to hook it into the game and make the mod do the pizza particulation

bright fog
stiff hedge
#

Howdy yall! Lua question.
Is there a known or proper way to store/serialize items and their state into a modData table?

I would like to serialize an items state and support save/load and replication. Any pointers?

bronze yoke
#

sorry for such a short and disappointing answer but... no

stiff hedge
#

oof ._.

bronze yoke
#

there's no better method than manually saving all the relevant properties of the item into the table and then creating a new item and manually applying all of those properties to load it

stiff hedge
#

Daaaaaaamn. That makes sense though. I was trying to make headway with byte buffers but couldn't get it to stick. Thanks so much for your advice. I'm pretty new to Lua.

Second question, are the InventoryItem** getters + items mod data sufficient to record all of the items state? Or is it sort of mostly good and I need to make some design concessions to support the shortcoming?

bronze yoke
#

to my knowledge it should be fine, just tedious

stiff hedge
#

I'll take tedious. Thanks so much Albion! ๐Ÿซก

bright fog
bronze yoke
#

if you're trying to store it in mod data you probably want it to be persistent and then anything that relies on an object won't work

bright fog
#

True

stiff hedge
# bright fog I guess cloning an item won't work ?

As a third question actually, is there a good method for cloning runtime items? ๐Ÿ˜ฎ

My hack that I came up with was incredibly silly and if theres an item:clone method i'd love to know about it

river perch
#

well, I got a new issue now, I got the initial one to get resolved, but now when I try to craft the gun, the craft option remains grayed out

stiff hedge
#

The hack that I came up with was to send an object refrence of InventoryItem via sendClientCommand to the server, then on the server make a new item from that same type, and copy the new items ID to the sent item, then try and store it

Thats how I was "cloning" items for storage into my moddata table - but they don't serialize xD So its a goofy concept in general. But if theres a better way to do it I'd be curious to know it, but it's not needed per-se for my mod ๐Ÿ™‚

#

For context, this is for a marketplace economy / auction house addon I'm building so that players can list items for sale on a public marketplace.

But idealy, I want to store the full state of any given item so that players can buy half eaten food, customized firearms, etc ๐Ÿ™‚

spice portal
#

Does the "player:isMoving" function work when the player is walking?

bronze yoke
#

no, weirdly it only returns true if the player is using the 'walk to' thing when you right click a square

#

use player:isPlayerMoving() instead

spice portal
#

I see, thanks

limber onyx
#

Hey guys. After many attempts I just could not disable or replace the recipes I needed, guess I'll just have to put instructions to replace a file manually

#

Does folder path structure matter when you want to override a mod's recipe script?

dry chasm
bronze yoke
#

no, ScriptManager.instance doesn't require any mods

dry chasm
bronze yoke
#

public static fields are already accessible

#

accessible fields allows you to access instance fields (regardless of other modifiers)

dry chasm
#

alright, I definitely stand corrected, didn't know that spiffo

grizzled fulcrum
#

What is the difference between that and getScriptManager()? or do people prefer it because it removes the extra function call that seemingly does the same thing..

dry chasm
#

Probably because of one less function call.

limber onyx
#

It's strange that I can replace the vanilla recipies effortlessly, even for multiple items. Override: True, works just fine

#

but then I do that with a module that isn't Base it suddenly breaks

#

When a mod adds a module, all recipes and items are ModModule.Item yes?
Or it gets assigned into the Base module?

bronze yoke
#

'assume' because in theory it has to be either querying java state or syncing it to lua or else the statics would get out of date and the latter seems more difficult

#

i guess in this case it's final anyway, maybe it's only final fields and therefore not in need of any querying/syncing - i've only really made use of stuff that would be final anyway

grizzled fulcrum
#

nice to know

covert crane
#

Hello everyone, I'm working on developing a mod. But the game still crashes randomly when I test it. Unfortunately the error message doesn't give me ANY clue (in any case I don't see any link with my code).

Do you have any idea what type of error this could be causing?

I dissected my code from A to Z, I deleted and put back elements and files. but nothing to do, I still have the same error. ๐Ÿ˜ญ

here is the error in question:

drifting ore
#

i seem to remember having an identical issue

covert crane
#

for more information, this crash happens even when I don't take any action

drifting ore
#

yes when zombies attack a door or a window, this crash triggers, which happens very fast

#

this happened to me when I was messing with items, or inventory

#

i can't recall exactly what was the cause, but the remedy was to simply fix malformed code

covert crane
#

Really strange, I don't have any interaction with zombies in my mod.

#

moreover my inventory does not contain any objects from my mod

#

thanks

drifting ore
#

as long as the object exists in the game the problem can manifest

covert crane
#

ok

#

I'm going to test by temporarily deleting all my moded items, thanks for the info

drifting ore
#

ah yes the doorknob

#

when a door is destroyed, a doorknob is created in the java code. If the game can't find this item, it will crash.

covert crane
#

The problem comes from one of my items, thank you I finally have a clue

thick gust
#

any way (through lua) to force a translation file to be selected?

grizzled fulcrum
thick gust
#

i already have the translation and everything done!! i just need a way for it to get forcefully loaded whenever the player picks a specific trait
lua is preferable but if i need to learn to mod in java too i can do that

#

@grizzled fulcrum

dull moss
thick gust
#

its not just the shouting that gets replaced

dull moss
#

Ah

#

Then idk

thick gust
#

and i need it to not affect english translation too

grizzled fulcrum
#

?

thick gust
#

yes! that

grizzled fulcrum
#

Although I am confused that you want to make a new language for it since you could do it much easier if you just used each respective language (and also the fact that some languages have different ways to express pet sounds like barking/woof/dog sound in Japanese is not latin "woof" but ใƒฏใƒณใƒฏใƒณ), but if you really want to go this route then I will have to check if it's possible to load it from Lua, just give me a minute or two.

#

Also what method did you use to add the language to the selection? If you overwrote any, that might cause a problem instead of adding it like Translator.addLanguageToList()

grizzled fulcrum
#

I meant the Lua code you used to get it into the selector (to add it to the list)

#

Or did you just replace the translation name of the language from an already existing one (bad)?

thick gust
#

i dont think i used any code?? i just have it in the translate folder

grizzled fulcrum
#

I thought the game manually adds each language, but maybe it detects it from the translation folder? I am unsure, but I will check to see how it does it

dry chasm
grizzled fulcrum
#

It does load it from language.txt the more you know

sand parcel
dry chasm
#

yeah, but forcing to a different language.... i don't think that's the ideal approach for a mod

grizzled fulcrum
#

I mean yes you would have to do this for all language files, but I think it is worth the hassle imo

#

removes the whole lua reloading aspect of it all

dry chasm
sand parcel
#

this might be the solid solution im looking for, and gives me opportunities to expand if i want to hire translators

#

for other languages

grizzled fulcrum
#

and if you plan on changing other translations too, just depends on your use case

dry chasm
grizzled fulcrum
#

I feel like there should be a hooking/function patching library to prevent these conflicts, but even with one, most people would likely not use it

dry chasm
grizzled fulcrum
#

what is "patching everything" btw I am confused?

sand parcel
#

my translation doesnt change EVERYTHING, just some lines (barking, item names, character talking text)

dry chasm
#

If you want to change the shouts, you'd still have to patch (decorate) the shouting function to include your custom shouts and skip the vanilla ones.
If you then also want to translate other stuff (items and whatnot) you'd have to patch(decorate) the functions that get those.
In which case, patching the "getText" method would be an easier approach, in comparison to going for every single function where it may attempt to access that

grizzled fulcrum
#

Items don't have translation strings?

#

or do you mean where it's like item:getName() and it doesn't return the getText or something

dry chasm
#

they do, but if you do want to change their text based on trait, you'd likely have to patch where it attempts to get them, so it requests for a different one.

grizzled fulcrum
#

if only there was a mod that does something like that ๐Ÿ˜‰

dry chasm
#

mh?

grizzled fulcrum
#

I don't like self-advertisement though but I was working on a proof of concept that works (with some quirks)

#

as usual I kinda pushed it to the number 2 slot in the queue in my brain because a server owner requested a mod and I for some reason just keep ignoring mods I have to work on

#

mod id is AoqiaDynamicTranslationsAPI on workshop

#

gotta fix some bugs yet and an issue with hooking getText is coming back to haunt me related to the vanilla game too but it's the best I can think of right now

dry chasm
#

so this does take the approach of patching the getText as I mentioned ๐Ÿ˜…

grizzled fulcrum
#

like probably the biggest issue I've ran into since I last worked on it a couple weeks ago was that since I cache the translations and the game doesn't explicitly call my API to update the specific translation, it asks for it again expecting a different translation but doesn't get it (have to look more into it)

grizzled fulcrum
#

I feel like patching methods in lua shouldn't be done on a whim and just that getText hook alone has already caused some issues with other mods and even the vanilla game, so I am very hesitant to respond with that as an answer

sand parcel
grizzled fulcrum
#

and also the fact that getText is called a lot nearly every UI render call so I have to optimise the living hell out of it (working on that on my local build)
I sound pretentious as fuck but I really really mean it, going on a patching spree like some mods do can break stuff and why would you patch something if you don't need to??

grizzled fulcrum
#

I've only ever saw that with SandboxEN translation

sand parcel
dry chasm
sand parcel
#

@grizzled fulcrum btw, i love these thumbnail images they're so cool

grizzled fulcrum
#

also art isnt my expertise so I just mainly slap some random thingy as a picture lol

grizzled fulcrum
#

Also I didn't mean to indicate that patching getText would be a "patching spree" but that other mods I saw in the past have done it

dry chasm
#

that's what I meant

grizzled fulcrum
#

that is one of the reasons why I made this proof of concept api mod, because I wanted to change UI elements dynamically based on outside factors like traits, health status etc to add spice to the UI

#

but then the moodle UI is in Java so I had to rewrite that, never got around to publishing it though

#

my plan was to rewrite all UIs in the game, but then university started...

#

I mean most of the mod anyway is cache trickery and trying to make the user feel like it changed (even though technically it didn't) so it's not that crazy

red tiger
#

Also I plan on it

grizzled fulcrum
#

I think I will ditch it though, because I am not good with UI stuff at all and also because I want to rewrite the lighting dlls and that will take more of my time than the UI I think so I have to choose which one to do

young edge
grizzled fulcrum
#

computer science ;-;

#

although I kinda hate it because it brings me away from the things I want to do like modding

#

and instead of using my break to catch up with some of the work I am using it to work on mods lol

young edge
#

Yea, I gave up on compsci. I study English now Prayge
Turned out the things I liked doing as a hobby weren't cut out as a job

drifting ore
#

university is a scam

#

your one and only reason to go there should be the desire to become a scientist

#

besides getting science knowledge, you learn absolutely nothing, and you get a piece of paper that certifies that you in fact learned absolutely nothing of practical use. Except places like law firms, people can hardly care less.

grizzled fulcrum
#

Most jobs if not all that I've looked at require a bachelors of CS minimum

#

letalone any actual language experience which those are usually 5 years experience and stuff like that

drifting ore
#

if you're a nobody from the street then a bachelor's CS means you are marginally more qualified than the next random person

grizzled fulcrum
#

even though I might meet the language experience, they still want a degree

drifting ore
#

what actually matters is your ability to do your job, and CS degree has absolutely nothing to do with it

grizzled fulcrum
#

the hiring managers I've found didn't really care about language experience though which is annoying and is why I feel like I have to study to get some sort of qualification

drifting ore
#

if the company you're applying to doesn't cares about practical experience and wants a degree instead, you shouldn't apply there

young edge
#

university is a scam for way different reasons than that

#

but yes, the job market is also a joke

drifting ore
#

the one and only question the people who'd actually have a say in hiring you ask, is what's the extent of your practical abilities

young edge
#

shitty companies do, probs

#

(which in fairness is a lot of them)

drifting ore
#

FAANG will not consider having a CS degree to be a hireworthy mark on your resume

#

they look for the projects you worked on

young edge
#

Ah yes. The projects that you got hired to work on from nothing

grizzled fulcrum
young edge
#

also that

grizzled fulcrum
#

Of course you need more than that, but their resume filter thingies literally just decline your application if it doesn't meet the minimums they ask for

drifting ore
#

This is only true if you're a nobody from the street with zero credentials of any kind.

#

In this case, and this case alone, CS degree has great weight.

young edge
#

I don't mean to offend but on what basis do you say this, exactly?

grizzled fulcrum
young edge
#

because to me it sounds like you're talking out of your butt

drifting ore
young edge
#

Your blatant ignorance aside

drifting ore
#

Mate

young edge
#

it's more that degrees are a basic requirement these days

#

not something that unlocks great prospects

drifting ore
#

Not being able to find a job with a CS degree is close to #1 complaint of people with a CS degree.

young edge
#

yes

grizzled fulcrum
#

Most if not all companies not even exclusive to FAANG use algorithms to sort through applicants to filter through the raw amount of applications. These will nearly always decline your application if you do not meet at least the minimum requirements for that job. It sucks but it's what they do, and I can't really meet a bachelors in CS or higher plus 8 years of experience whilst being a person who just obtained their CS degree and no years of experience in professional software development environment.

young edge
#

and the people without one can't even bother to complain about it

grizzled fulcrum
#

^ exactly because they in 99% of cases wont get their application in front of hiring managers

#

This is all to add onto the current state of hiring not just in software engineer jobs but literally every job

grizzled fulcrum
drifting ore
# young edge it's more that degrees are a basic requirement these days

that's not true my man. The basic requirement is, always has been, and will be for all forseeable future - being fit for the job. The fact that you learned a bunch of boolean algebra doesn't mean you can support a legacy backend. Again, if you have no credentials whatsoever, then it's an indication that you at least didn't fail some extremely basic programming lessons, some youtube tutorial tier stuff. If you have the credentials, some practical experience in some company, then nobody even looks at hte degree.

young edge
#

What exactly do you work as? And on what do you base all of that

grizzled fulcrum
drifting ore
#

It's a collective experience of 100% of professional coders I know, with my brief professional career - myself including.

#

I don't even have a flippin degree.

#

I'm a certified marine vessel engine technican.

grizzled fulcrum
#

The hiring managers don't even give an ounce of thought of the basic requirements of the job because they only look at resumes who meet the basic requirements already

#

well I guess this applies less to startups since they're usually more lax but for FAANG it's like 200%

#

I mean hell, there are companies and degrees dedicated to educating people on how the application filtering algorithms that are used work. I know because I was required to take such courses that were mandatory, and it's annoying because they weren't even that useful except 'something something you need the minimum requirements something something' and "don't use these keywords in your resume" and that was it.

drifting ore
#

A degree is not a requirement. Experience is a requirement. If you gonna pay however much your tuition costs + learn all the stuff that has nothing to do with the job as a programmer whatsoever, purely for the sake of networking at uni, then it works all the same. But at that point you're conflating the degree and what you did while getting the degree.

grizzled fulcrum
#

Posted 2 days ago, Microsoft asking for software engineers.

#

Required literally means required

drifting ore
#

see that line at the bottom?

grizzled fulcrum
drifting ore
#

they specfically say they don't care about the degree

grizzled fulcrum
#

You know what a broke college student who just completed a CS degree has? It's definitely not experience

drifting ore
#

as long as you're a competent coder, it's a fair game

grizzled fulcrum
#

And they want 6+ years engineering experience

drifting ore
grizzled fulcrum
#

Like I could say "technically since I've been programming since I was 10 I technically have 8 years of experience" but would that be feasible?? Most likely not

drifting ore
#

yeah well i've been drawing since I was 10 and I have less chance of getting admitted into an art school than that one austrian painter

#

length of time alone here isn't indication, nobody knows what you actually did

grizzled fulcrum
drifting ore
#

let's back up. How old are you, and how far are you into education?

#

Actually the age part isn't important, it's implied.

grizzled fulcrum
#

Yes, and I'm like 5 subjects in

drifting ore
#

I mean how many years.

grizzled fulcrum
#

which is not a lot but I've been told it's not far from the main path

#

lol years

drifting ore
#

yes years. How many years have you been studying at the uni this far?

grizzled fulcrum
#

I haven't got that far, I've probably only been at it for a year or something like that

#

out of 2 or 3, however long it is

drifting ore
#

Is it correct to say that you mainly form your opinions on this subject based off of assumptions about how things are and will be, and how you were told about it by people like yourself? Is it correct to assume that you don't talk to people who are right about to get their degree, who have gotten it 10, 20 years ago?

grizzled fulcrum
drifting ore
#

based off of assumptions about how things are and will be

I.e. you don't actually know for a fact, you're just really sure of it.

grizzled fulcrum
drifting ore
#

Ok, did they mention the importance of things like internships and networking? Particularly those who got a job as a programmer at some point.

grizzled fulcrum
grizzled fulcrum
drifting ore
#

What I'm getting at is that you might be missing the forest for the trees. Internship = practical experience at a real company. Networking = knowing people who can say a good word for you to the right person.

grizzled fulcrum
#

I am speaking purely for myself here when I say that I have a really slim chance already at getting a job, so this CS degree is basically my only option

grizzled fulcrum
#

like no hiring manager is going to give a fuck if I come in saying hey here's my resume, I don't meet the minimum requirements for the job but, well, I have some C++ projects on my computer and did some lua for a game once!

drifting ore
#

you said it in a self deprecating manner but that's how it is indeed. You've got no accomplishment of importance to your name.

grizzled fulcrum
#

the only thing I can think of somehow getting networking is if I create a project that gets enough attention, but it seems more difficult to do nowadays considering everything I think of is already created, and in a better manner too.

drifting ore
#

Word of mouth is not a thing, come on.

#

Let me put it another way. Networking = nepotism.

grizzled fulcrum
#

it's not as important as it used to be, but the amount of people who get jobs purely from seeing their work is a lot

#

like a guy who made cheats for Counter Strike getting a job at Epic Games, like who teh fuck? (or some cheat developers getting jobs developing anticheats (riot vanguard comes to mind) directly because they worked on a cheat)

drifting ore
#

If the guy can make working cheats for CS clearly he has a lot of skill and dedication.

grizzled fulcrum
#

-_- how

#

it's not the hardest thing in the book seriously

drifting ore
#

well think about it

grizzled fulcrum
#

most of it is boilerplate

drifting ore
#

he reverse engineered a protected game and evaded detection for quite a long time

grizzled fulcrum
#

the hardest part is keeping up with the anticheat updating

grizzled fulcrum
floral shore
#

has anyone trifled with downsizing playermodels/player rigs ingame before? wondering if that's even plausible

drifting ore
#

well in any case; I don't have a psychology degree but I did learn about it in the uni (it was a waste of time like everything else but I can do a parlor trick, watch this).

you might be suffering from a fair world fallacy. Like if you work hard, you will be rewarded. And the people who you find underserving, shouldn't be. That's not a thing.

grizzled fulcrum
#

ok this is getting really off topic lol I will stop but it was a nice ramble

drifting ore
#

yeah i guess. As a closing statement, a friendly reminder that nowdays people with CS degree are a dime a dozen.

#

my personal advice is to swerve into a law school

spice portal
#

@drifting ore How can I prevent the "walking" function from interfering with the "running" function?

drifting ore
#

oh wait you made them as numbers

#

I think your problem has more to do with the fact that you only set the player slow factor on game start

spice portal
drifting ore
#

and there's a pretty good chance that at that point in time the player is not moving at all so nothing happens

#

i think the event you're looking for is OnPlayerMove

spice portal
#

In fact the values โ€‹โ€‹do work, but the only thing that doesn't work is the "walking" function set to 0 while "running" has a value of 100.

The "running" function set to 0 and walking 100 works

drifting ore
#

oh i misread that, you are already using OnPlayerUpdate which is also fine

#

well both of these functions activate on the same frame. One of them always sets the walking modifier if the player is moving at all. If that function executes second, its effect overrides that of the running function.

#
    player:setSlowFactor(0.5 * (SandboxVars.MSZ.ModifierWhileRunning / 100))
elseif player:isPlayerMoving() then 
    player:setSlowFactor(0.5 * (SandboxVars.MSZ.ModifierWhileWalking / 100))
end```
#

you might need to set it like this

#

since neither the original nor this variant do anything if the player isn't moving, you can put it in OnPlayerMove callback and remove the walking check.

spice portal
#

I see, thanks, I'll try to reprogram the code to see if I have any luck.

dawn portal
silk pike
#

Hello everyone!
I need support...
I'm creating a mod that modifies the zombie infection.
With the help of chatGPT I'm building it
The mod should modify the zombie infection in this way:
It will no longer be like in the vanilla game with the classic % of infection, and therefore I would like the bite to no longer be a death sentence (100% chance of infection)
I would like the infection to arrive only after a certain number of wounds suffered by the zombies. 100% must be reached in a counter and each wound will have a different percentage
At the moment I have only created this part of the code to eliminate the vanilla infection (the mod checks every hour if there is infection and removes it)
in the testing phase I noticed however that if I suffer a bite the mod removes the zombie infection which however after a while reappears... until it leads to the death of the character.
Where am I going wrong??? if anyone has ideas to suggest they are welcome!!!
below I leave the code I created

-- RemoveInfection.lua

local function removeZombieInfection(player)
local bodyDamage = player:getBodyDamage()
if bodyDamage:isInfected() then
bodyDamage:setInfected(false)
bodyDamage:setInfectionLevel(0)

    -- Fai dire al personaggio una frase
    player:Say("Mi sento meglio, l'infezione รจ scomparsa!")

    -- Debug: stampa un messaggio nella console
    print("Infezione zombie rimossa per " .. player:getDisplayName())
end

end

local function onEveryHour()
local player = getPlayer()
if player then
removeZombieInfection(player)
end
end

Events.EveryHours.Add(onEveryHour)

drifting ore
#

i think that's just normal wound infection, not zombie virus

bronze yoke
#

no, it's zombie infection

#

the reason it reappears is because you remove the infection from the overall character, but not from the actual bodypart, so when it checks for infected bodyparts it re-infects the character

#

try adding this after removing the infection```lua
local bodyParts = bodyDamage:getBodyParts()
for i = 0, bodyParts:size()-1 do
local bodyPart = bodyParts:get(i)
bodyPart:SetInfected(false)
end

silk pike
#

As soon as I change the code I'll try it and let you know

limber onyx
#

Hi guys. Is it possible to import 2 or more modules into a single script file or that causes errors?

#

example:

module ModModule { imports { Base ModModule }

bronze yoke
#

separate them with commas

limber onyx
#

thx

#

I've been searching the workshop for mods that modify the recipes from other mods, they just seem to add the Override,true, line at the end of each recipe. It's strange it didn't work in my case. I'll keep trying a few more things before I go for the ol' reliable "Hey, original author, can I upload a standalone version of your mod with my changes?" lol

muted garnet
#

Is there a method to change the chance of a character falling and is there a method to change the chance of knocking a zombie to the ground?

bright fog
#

You can however stagger manually the zombie and can stop the zombie from getting staggered by attacks, so you could stagger based on your own chances

muted garnet
#

then in that case is there a way to customize character falls? I think with ZombRand you can increase the chance of being knocked down, is it possible to do the same with a chance of falling or is there a method to instantly get up from the ground?

#

do you mean hitreaction?

#

hmm, thanks, I'll try this idea

bright fog
#

I'm not aware of any method which allows you to increase the chance of falling, if you find that tho I'm interested out of curiosity

#

And for getting up instantly, I think you might be able to but not sure

muted garnet
#

I think trying to implement this through hitreaction would be a good idea

muted garnet
#

when a zombie is close, we speed up the animation of getting up

bright fog
#

Yea that can be done

main swan
#

Hi all, I'm using a mod on a dedicated server that requires chunks to be loaded client side to work. If I run a client on the server always connected as admin, would that prevent me from playing the game using the same Steam ID on my personal PC?

bronze yoke
#

yeah

main swan
#

Is there any other way to have a proxy user connected to the server?

quiet fulcrum
#

how can I get a deadBody object from an ID (i.e if I'm passing the id via sentClientCommand)?

local corpseID = body:getObjectID() -- This is fine and gets a short ID like 30230

local corpse = IsoDeadBody:getDeadBody(corpseID) -- This is throwing an exception with MethodArguments.assertValid
bronze yoke
#

you can't i'm afraid

#

dead body ids are shorts and kahlua doesn't pass shorts to methods correctly, throwing that exception

#

if you want to identify the same object between different game instances send the object square's x,y,z and the object index

quiet fulcrum
bronze yoke
#

use body:getObjectIndex() to get the index, and to get the object from it use:```lua
local square = getSquare(x, y, z)

-- if square is nil then that square isn't currently loaded on this instance, usually this is expected and fine
if not square then return end

local body = square:getObjects():get(index)

quiet fulcrum
#

is there anyway to make an IsoPlayer appear 'dead'? I can stop movement with character:setBlockMovement(true) but how can I make the animation/model stance lie on the ground?

quiet fulcrum
ancient grail
#

you would have to make one up

#

custom

quiet fulcrum
#

there isn't one already for just being flat on the ground?

ancient grail
#

im afk rn i cant check
but you can
go to the animsset folder

#

player

quiet fulcrum
#

so like Zombie_Death? I would just character:setVariable("Zombie_Death", true) or something?

#

that was in media\AnimSets\player\death

ancient grail
#

my internet sucks i cant view the image
anyways theres a also a dragdown version
dont use the dragdown
it will kill your player locally

#

if youre playin mp
other players will think your alive
which will lead to bugs

#

oh thats not a variable thats an anim file

quiet fulcrum
#

the image was of media\AnimSets\player\death\default.xml which had a <m_AnimName>Zombie_Death

ancient grail
#

AnimName is what you name the the x / fbx files

#

just do time action or emote

#

or hitreaction
just specify your own var

#

these are the 3 ways you can set animations

quiet fulcrum
#

sorry, I'm quite lost with all this. Is there a guide for dummies on anims and variables somewhere?

ancient grail
#

nope
animation is one of the least documented areas of pz modding

#

i learned it by looking at the animsets
thats about it really

quiet fulcrum
#

I feel it should be fairly simple as far as anims go though, as I'd just like to use the preexisting anim for a dead body, or a tripped over/fallen character

ancient grail
#

yeah wish it was that simple

muted garnet
#

I copied original zombie and player Animsets and trying to use zombie Animset with player Animset "Loot", cuz my character does a zombie Animset while standing, please help me to understand what's wrong:

Loot xml file

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>ZombieLoot</m_Name>
    <m_AnimName>Bob_IdleLooting_Low</m_AnimName>
    <m_Looped>false</m_Looped>
    <m_deferredBoneAxis>Y</m_deferredBoneAxis>
    <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
    <m_SpeedScale>0.80</m_SpeedScale>
    <m_BlendTime>0.40</m_BlendTime>
    <m_Conditions>
        <m_Name>PerformingAction</m_Name>
        <m_Type>STRING</m_Type>
        <m_StringValue>ZombieLoot</m_StringValue>
    </m_Conditions>
    <m_Conditions>
        <m_Name>sitonground</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>false</m_BoolValue>
    </m_Conditions>
    <m_SubStateBoneWeights>
        <boneName>Dummy01</boneName>
    </m_SubStateBoneWeights>
    <m_SubStateBoneWeights>
        <boneName>Translation_Data</boneName>
    </m_SubStateBoneWeights>
    <m_Events>
        <m_EventName>SetVariable</m_EventName>
        <m_Time>End</m_Time>
        <m_ParameterValue>ZombieEatingStarted=true</m_ParameterValue>
    </m_Events>
</animNode>

Zombie eating xml file

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>Zombieeating</m_Name>
    <m_AnimName>Zombie_IdleEating</m_AnimName>
    <m_deferredBoneAxis>Y</m_deferredBoneAxis>
    <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
    <m_SpeedScale>EatSpeed</m_SpeedScale>
    <m_BlendTime>0.50</m_BlendTime>
    <m_Conditions>
        <m_Name>ZombieEatingStarted</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>true</m_BoolValue>
    </m_Conditions>
</animNode>

lua timed action, start():

self:setActionAnim("ZombieLoot")
grizzled fulcrum
#

what happens when you try to do the action?

muted garnet
#

Is the zombie animation different when played by the player?

grizzled fulcrum
grizzled fulcrum
muted garnet
#

Cuz when I tried to apply animation without looting animation, using only zombie animations, the player didn't sit on the ground as it should be

grizzled fulcrum
#

I think that the zombie eating animation wont trigger just by the condition alone

#

You have the condition as ZombieEatingStarted must be true to start the animation, but you don't start it anywhere

#

if you do in your lua action, add this function:

function MyAction:animEvent(event, parameter)
    if event == "ZombieEatingStarted" then
        self:setActionAnim("Zombieeating")
    end
end
#

Maybe it will work

#

Also change MyAction to your action name too

#

Or maybe you can add a transition xml instead of the lua code above, idk how it works fully since I never did animation outside of 1 anim, but there are transition xml files that the game uses

#

eg look in media/actiongroups/player/*

muted garnet
#

and also, could it be that self:setActionAnim("ZombieLoot") takes the place of the animation and until the current action is finished it will be impossible to use another animation?

grizzled fulcrum
grizzled fulcrum
#

Or I will just show here:

#

So it transitions to media/actiongroups/player/actions when IsPerformingAnAction is true and when isTurning is false

#

I think asSubstate might be a substate of the current timed action (what you want)

#

I think it would be easier to visualise media/actiongroups/player/sitonground/timedActionsTransitions.xml

#

An edited version of the above file mentioned:

<transitions x_include="../defaultTimedActionsTransitions.xml">
    <transition>
        <transitionTo>Zombieeating</transitionTo>
        <asSubstate>true</asSubstate>
        <conditions>
            <eventOccurred>ZombieEatingStarted</eventOccurred>
        </conditions>
    </transition>
</transitions>
#

As I said, this is only speculation as I've never done any of this stuff, just going off of what the base game does

#

So maybe if you put the above file in say media/actiongroups/player/ZombieLoot/timedActionsTransitions.xml and then that will maybe transition to the Zombieeating action, then you (maybe optional) have a file in media/actiongroups/player/Zombieeating/timedActionsTransitions.xml that has this:

<transitions x_include="../defaultTransitions.xml">
    <transition>
        <transitionTo>idle</transitionTo>
        <conditions>
            <isTrue>ZombieEatingFinished</isTrue>
        </conditions>
    </transition>
</transitions>
#

the above second possibly optional xml requires Zombieeating action xml to set ZombieEatingFinished, but maybe it will go back to idle without this xml???

muted garnet
#

thanks for this option and detailed explanation, I will try it a little later when I am free and will let you know the result

quiet rain
#

I'm having a funky issue with implementing sandbox vars.

I've added a sandbox-options.txt file
At the top of my lua file I have a

local foo = SandboxVars.foo.bar

along with a

print(foo)

in my custom function.

But for some reason even if the boolean is set to true, once in game the function returns false. The sandbox vars don't have their non-default variables picked up.
Oddly if I reload the lua file once in game, it does correctly register it as being true. Anyone an idea what could cause this?

worthy pawn
#

Any idea why the context menu looks like this?

    {
        DisplayCategory = Clothing,
        Type = Clothing,
        DisplayName = Military Rhodesian Brushstroke Pants,
        ClothingItem = HNDLBR_Trousers_RhodesianBrushstroke,
        ClothingItemExtra = HNDLBR_Trousers_RhodesianBrushstroke_Tucked,
        ClothingItemExtraOption = Tuck Pants,
        BodyLocation = Pants,
        Icon = HNDLBR_Trousers_Brushstroke,
        BloodLocation = Trousers,
        Insulation = 0.5,
        WindResistance = 0.3,
        WaterResistance = 0.3,
        FabricType = Cotton,
        WorldStaticModel = LongShorts_Ground,
    }
    
    item HNDLBR_Trousers_RhodesianBrushstroke_Tucked
    {
        DisplayCategory = Clothing,
        Type = Clothing,
        DisplayName = Military Rhodesian Brushstroke Pants,
        ClothingItem = HNDLBR_Trousers_RhodesianBrushstroke_Tucked,
        ClothingItemExtra = HNDLBR_Trousers_RhodesianBrushstroke,
        ClothingItemExtraOption = Untuck Pants,
        BodyLocation = Pants,
        Icon = HNDLBR_Trousers_Brushstroke,
        BloodLocation = Trousers,
        Insulation = 0.5,
        WindResistance = 0.3,
        WaterResistance = 0.3,
        FabricType = Cotton,
        WorldStaticModel = LongShorts_Ground,
    }    ```
bronze yoke
#

wait until OnInitGlobalModData to cache the value (or don't cache it at all)

grizzled fulcrum
#

Like so:

ContextMenu_EN = {
    ContextMenu_UntuckPants = "Untuck Pants",
}
#

and change ClothingItemExtraOption to UntuckPants

#

no space

#

and do it for your item too, people will thank you ๐Ÿ˜„
like this:

// in item script
DisplayName = RhodesianBrushstroke,

and in the translation file here: media/lua/shared/translate/EN/IG_UI_EN.txt:

IGUI_EN = {
    IGUI_ModuleName_RhodesianBrushstroke = "Military Rhodesian Brushstroke Pants",
}
#

change ModuleName to your item script's module (should be your mod id you set in mod.info file)

worthy pawn
#

Can I ask the benifit of using the ModuleName?

drifting ore
#

the purpose is solely to prevent data collisions

#

It's the highlander kind of deal - there can only be one.

grizzled fulcrum
#

@worthy pawn (i forgot to reply lol)
Well for creating display name translations, you literally need the module name of the item script. if you do not use it, the translation will not work.

This functions unlike other translation keys which do not require the module name to be in the key, but I do it anyway to prevent accidentally overriding other people's translations. and its good to use the module name as your mod id, its so bad when people have their mod id as JimsTreeMod and then have all their items defined in the TreeMod module or similar, as its just less uniform and more annoying overall (personal experience on this last one).

oh and btw I'm already in bed so I can't check this but its either the part in display name that judges the key name or the item script key itself, I think its the first one but I can't remember. what I mean:

// item script
ClothingItemExtraOption = ABCDEF,
ContextMenu_ABCDEF = "See how the names are linked implicitly?",

Oh and the same goes for the item name translation too like:

module MyMod
{
    item MyItem
    {
        DisplayName = ABCDEF,
    }
}
IGUI_EN = {
    IGUI_MyMod_ABCDEF = "Implicit relations between stuff for everyone!",
}

sorry I'm so all over the place, but another reason to use module YourModule is so you don't have to prefix items with your mod name because it will already be prefixed similarly to how vanilla items are prefixed. like item is basically MyModule.MyItem and for vanilla module is Base. Everyone seems to like just shoving all their items and recipes in Base module, but then how do you decide which is vanilla game and which is your mod? (From a technical standpoint, not user)

stoic kayak
#

Via lua, how might I get a toilet, sink, etc. water amount?

#

I have the isoObject rn

grizzled fulcrum
#

I usually pair it with other checks like so:

if obj:hasWater() and obj:isTaintedWater() == false then
    -- do stuff
end
worthy pawn
limber onyx
#

Hi guys.

If I want a certain part of a mod to be installed manually. Will it suffice to put it in a folder with a different name that isn't part of the usual mod structure?

#

I just don't want this specific folder from the mod to be isntalled by the game when you activate it

red tiger
#

Unless this is a patch of some sort.

#

(Something I do a lot of)

limber onyx
#

nah, its just a script

#

I wanted to tweak some recipes added by antoher mod, but it's not working so I gotta let subscribers know that this part must be installed manually by replacing files

mystic vessel
#

Good evening guys, I need a little help
I made this code where when executing crafting
crafting clothing loses insulation
However, when equipping it, the game gives an error, (but it still has zero insulation)
However, when re-entering the save, the original clothing data returned, what do I need to add for it to save?

sudden kestrel
#

wondering if theres a way to make it choose from multiple .wavs so that the death sound is random

#

I don't normally do coding or anything I just make maps but it would be nice to not listen to the same sound everytime I kill a character

quiet fulcrum
#

is there an event that fires when a player takes damage from a zombie? It seems OnPlayerGetDamage only fires when bleeding/infections/etc and not when the zombie actually hits

bronze yoke
#

no

#

don't question why the zombie game doesn't have events for basic actions relating to zombies

quiet fulcrum
#

oh if only this was a C# game and moddable with Harmony

#

I'm trying to avoid character death, or at least catch it before they die. Hooking into OnPlayerDeath is too late as it already wipes a bunch of character info. Hooking into OnPlayerUpdate or OnPlayerGetDamage is don't work as they come too early before the damage is applied so I can't really restore health in time

ancient grail
#

can anyone confirm my theory

does
IsoZombie:setNoTeeth(true)
means it will not cause bite damages ?

ancient grail
ancient grail
final tundra
#

Hello there dear friends and zombies. Is there any up to date vehicle modding tutorial? The only I can find are from 4-6 years ago.

grizzled fulcrum
# worthy pawn Oh lord. This makes so much sense... and now I have the potential for a hundred ...

@worthy pawn
If you use visual studio code, you can select multiple lines in one spot by holding alt and click a spot and drag downwards ๐Ÿ˜„
Oh and I cooked a little regex replace for your translations if needed. It will only replace translation keys that do NOT have 2 underscores (there's no way to tell what is a module name and what isn't)

^(\s*)([^\W_]+)_([^\W_]+)(\s*=\s*".*",\s*)$

and replace it's matches with:

$1$2_YourModuleName_$3$4

but i'd recommend using alt click drag thing instead of this regex

#

or middle mouse button works the same I think

grizzled fulcrum
#

Some of the models for these vehicles can be found here: \media\models_X\vehicles

final tundra
quiet fulcrum
#

where in the lua or java code does MoodleType.Dead get applied when dead?

stoic kayak
grizzled fulcrum
# quiet fulcrum where in the lua or java code does `MoodleType.Dead` get applied when dead?

MoodleType.Dead gets checked when Moodle.Update() is called. All moodles are applied to a player when the player is created, but they just have the levels set to 0 initially.
MoodleType.Dead will change in level in Moodle.Update() when the Moodle class parent (IsoPlayer usually) is dead.
The game's Java code (I changed the var name to make it easier to understand) in Moodle.Update() is:

if (this.Type == MoodleType.Dead) {
    level = 0;
    if (this.Parent.isDead()) {
        level = 4;
        if (!this.Parent.getBodyDamage().IsFakeInfected() && this.Parent.getBodyDamage().getInfectionLevel() >= 0.001F) {
            level = 0;
        }
    }

    if (level != this.getLevel()) {
        this.SetLevel(level);
        shouldUpdate = true;
    }
}
stoic kayak
#

So, been a minute since I look at java, and the fact it's looking at 2 languages isn't helping my understanding xD
How would I- or, can I- link into and monitor when an error happens?

grizzled fulcrum
#

wat

#

idk what you mean

#

the console shows the errors I guess?

stoic kayak
#

I wanna make a quick thing that I can open when not in debug mode, that grabs any lua errors.
Unless ya can open console outside of booting the game in debug mode already?

#

(Note: mine would be just to monitor, no input to run code)

#

Errors I'm looking for are just the ones that trigger the red box in the bottom right.

#

Mine would listen to errors, but otherwise would only display stuff specifically sent to the "console"

quiet fulcrum
grizzled fulcrum
dry chasm
# stoic kayak I wanna make a quick thing that I can open when not in debug mode, that grabs an...

The console.txt is written as things happen.
-# If you want something like a "live" update while not in debug and not having to constantly manually reopen it, you could write a batch file which checks if the file exists and is locked and print the contents as they appear.
-# You could then filter by content of what you get for the errors.
-# It's a very very strange way to do so, but it can work. (Just not sure it's worth all the hassle there...)
Would probably just be simpler and easier to use a mod like errorMagnifier from Chuck:
https://steamcommunity.com/workshop/filedetails/?id=2896041179
Atleast if I do understand the question correctly in the first place spiffo

grizzled fulcrum
#

There is a program I use called klogg that live updates files like log files. It's super helpful and I actually found out about it because someone else here posted a screenshot with it on their desktop.

stiff hedge
#

Is there a Lua method to just set a patch on a given inventory item clothing article? I see that the clothing class has:

addPatchโ€‹(IsoGameCharacter gameCharacter, BloodBodyPartType bloodBodyPartType, InventoryItem inventoryItem)

But I'm struggling to understand why I would need a character? I just want to set Arm, to leather patched, with X bite/scratch defence etc

grizzled fulcrum
#

You don't need to change %username% as it's an environment variable that represents the currently logged in user (you)

#

echo %username% in cmd ๐Ÿ˜„

grizzled fulcrum
#

If you are calling this on client (doesn't matter if so) then you can just pass getPlayer() to the first param.

stoic kayak
sudden kestrel
#

im not really a coder snd on top of that definitely not javascript so whats wrong here besides everything

sudden kestrel
#

I dont code

grizzled fulcrum
#

Scripts in pz are not javascript, they are ZedScript which is some weird amalgamation of a scripting language

sudden kestrel
#

could i literally just list multiple different clips and it would choose from them

grizzled fulcrum
#

You should look at how the game does it in pzinstall\media\scripts\sounds_player.txt

merry citrus
#

hi guys, im new to modding pz, i dont know much about coding and modeling, recently i make this mod and dont know what wrong with it, the gun is invisible in the game, can some one help me ?

grizzled fulcrum
#

Your mod has a space in it's id, I've never seen that before ๐Ÿ˜ฎ

merry citrus
#

I haven't uploaded it to steam yet, I just made it this evening

sudden kestrel
#

this is what im thinking

grizzled fulcrum
#

They are the exact same, they will just override each other. I am assuming you are trying to replace PlayerDied sound in the vanilla game?

#

I know you can play sounds randomly from Lua but I don't know from this

sudden kestrel
#

yeah replacing the default im gonna see what happens although I wouldnt be doubted it just plays both

#

or neither

#

what im gonna test

stoic kayak
#

Made some simple code as an easier test, since I don't need the custom console thing anymore xD
Run it from cheat menu's lua editor and it sets all items in range to be really high water amount.

local range = 3

local squares = {}
local sqr = getPlayer():getSquare()
local cell = getWorld():getCell()--:getGridSquare()
local oX,oY,oZ = sqr:getX(),sqr:getY(),sqr:getZ()
for x = oX-range,oX+range do
    for y = oY-range,oY+range do
        table.insert(squares,cell:getGridSquare(x,y,oZ))
    end
end
local tbl = {}
for _,sq in pairs(squares) do
    if sq == nil then return false; end
    local sqObjs = sq:getObjects();
    local sqSize = sqObjs:size();
    for i = sqSize-1, 0, -1 do -- enumerate square objects and pack them into a table
        local obj = sqObjs:get(i);
        table.insert(tbl, obj)
    end
end
for _,obj in pairs(tbl) do
    if(obj:getWaterMax()>0)then
        local oldAmount = obj:getWaterAmount()
        obj:setWaterAmount(10000000)
        print("setting object "..obj:getObjectName() .. " from "..oldAmount.." to ".. obj:getWaterAmount().." water.")
    end
end```
grizzled fulcrum
sudden kestrel
#

crying in zedscript

grizzled fulcrum
#

I have an idea

#

but first remove the spaces from your file names and convert them to ogg

stoic kayak
grizzled fulcrum
#

yes

grizzled fulcrum
stoic kayak
#

it doesn't mind the last item having a ,?

grizzled fulcrum
#

it is needed

stoic kayak
#

ahhh noted

#

I'm not doing that rn, but noted xP

grizzled fulcrum
#

for zed script, all statements' lines must end with a comma

stoic kayak
#

uh- now how do I add stuff to the context menu xD

sudden kestrel
grizzled fulcrum
#

btw citrus is your sound a music??

#

doesn't matter much I think but there's just diff functions for playing music and sound so I've never tested the difference

sudden kestrel
#

yeah

grizzled fulcrum
#

But anyway, in your sound script, you can do this to disable the vanilla death sound (is always played from Java code no matter what):

module Base {
    sound PlayerDied {
        category = Player,
        clip {
        }
    }
}

or if that doesn't work:

module Base {
    sound PlayerDied {
        category = Player,
        clip {
            event = Game/GameOver,
            volume = 0.0,
        }
    }
}

and then in a lua file in your_mod\media\lua\client\your_mod.lua have

local Events = Events
local SoundManager = SoundManager
local ZombRand = ZombRand

--- @type Callback_OnPlayerDeath
local function on_death(player)
    local files = { "Barracuda.wav", "Everything_She_Wants.wav" }
    local file = ZombRand(1, #files)
    
    SoundManager.instance:playMusic(files[file])
end

Events.OnPlayerDeath.Add(on_death)
merry citrus
grizzled fulcrum
merry citrus
sudden kestrel
#

ill try yours instead

grizzled fulcrum
grizzled fulcrum
#

yeah what mp3 files not supported ;-; (I won't question it, if it somehow worked then so be it)

sudden kestrel
#

trust me the sound of pluh def worked

#

got me killed a few times

#

rn im just trying to remember how to put the mod into zomboid I have some other ones so im just gonna put it in the same place and hope it works lol last time I made a mod it was a small map like a year ago

grizzled fulcrum
# stoic kayak Made some simple code as an easier test, since I don't need the custom console t...

You can simplify it to

local range = 3
local player = getPlayer()
local player_sq = player:getSquare()
local cell = getCell()
local x, y, z = player_sq:getX(), player_sq:getY(), player_sq:getZ()

local squares = {}
for i = x - range, x + range do
    for j = y - range, y + range do
        squares[#squares + 1] = cell:getGridSquare(i, j, z)
    end
end

local tbl = {}
for i = 1, #squares do
    local sq = squares[i]
    if sq == nil then return false end

    local objs = sq:getObjects()
    local sz = objs:size()
    for j = sz - 1, 0, -1 do
        local obj = objs:get(j)
        tbl[#tbl + 1] = obj
    end
end

for i = 1, #tbl do
    local obj = tbl[i]

    if (obj:getWaterMax() > 0) then
        local old = obj:getWaterAmount()
        obj:setWaterAmount(10000000)
    end
end
#

it is more lines, but is much faster than previously
some optimisations to note:

  • using local variables as much as possible (you already do this well :D)
  • looping through tables using i and size of table instead of ipairs and pairs as these two iterators are very slow
  • instead of using table.insert, manually insert by indexing size + 1, table.insert is very slow
    pretty much it
sudden kestrel
#

idk why you cant hear the clip but trust

grizzled fulcrum
#

the more you know

sudden kestrel
#

I assume it works with mp3 too but maybe longer files wont work and who knows what happens when you add more then 2

#

but the rest of my day is now adding songs to random death

#

only thing is I wish I could fade them in slowly lmao

grizzled fulcrum
#

you could do that manually using audacity or literally any audio software

sudden kestrel
#

yea thats what im gonna end up doing

#

I was talking about a function but I doubt the halfbreed java has it

#

simple work around

#

use death sounds from other games like dark souls or minecraft

stoic kayak
#

Is clickedSquare where ever the context menu was clicked at?

#

function RCHT_WorldContextMenu(player, context, worldobjects, test)
    --local playerObj = getSpecificPlayer(player)

    local pipingOption = context:addOption("Creative refill", worldobjects, RCHT_RefillWater)
end

Events.OnFillWorldObjectContextMenu.Add(RCHT_WorldContextMenu)

(I copied the add option line from another mod x3)

#

Basically, I heard that this would be called, currently, no matter where ya clicked. I only want it if ya click on a world tile.

grizzled fulcrum
#

Everywhere you click is technically clicking on world tiles

stoic kayak
#

so- how would I only do it if directly on a world tile? not inventory or something

grizzled fulcrum
#

I assume you want it to only add the option if they click on a water source?

stoic kayak
#

no, creative refill will get all water holding items in range of the clicked square, and set their water.

#

Oh, I could make it so it's in range of the square, but to start it ya need to click on a water storage item-

#

Well, still, how to get the object/square under the cursor? :P

#

oh, the example thing I saw was "OnFillInventory" not world object

grizzled fulcrum
#

By water holding items you mean IsoObjects or WorldItems?

stoic kayak
#

IsoObjects

#

But the fact they are using invenotry clears up the fact they are saying "It'll happen everywhere" x3

#

err

#

hard to explain, but was confused

#

now makes sense

grizzled fulcrum
#

this is tricky

#

If you want to loop through tiles every click, you wouldn't want to do it when clicking anywhere because that would create unneeded lag

#

like you mentioned, I think the best bet is if they click on a tile with an object that already holds water

stoic kayak
#

ye, though, how to do that now x3

grizzled fulcrum
stoic kayak
#

Nah, to check if there's a valid object below the cursor-

grizzled fulcrum
#

but i would change it actually

stoic kayak
#
 for _, worldObj in ipairs(worldobjects) do
    if instanceof(worldObj, 'IsoLightSwitch') then

something like this? (Code snippet from building menu)

grizzled fulcrum
#

yep

stoic kayak
#

ah ok

grizzled fulcrum
#

but once you have the obj break out of the loop

stoic kayak
#

was thinkign that, but was curious if a better way to check for them.

#

And ye

stoic kayak
#

hmm- ipairs? or can I do what ya suggested before, here?

grizzled fulcrum
#

doo not

stoic kayak
#

number loop not good in this case?

grizzled fulcrum
#

yes

bright fog
grizzled fulcrum
#

no it is good

stoic kayak
#

Huh?

analog breach
#

does anyone know/could help me make a right click ui?

stoic kayak
#

right click ui?

#

context menu option?

analog breach
#

I want to make a mod on "train metalworking" like the "train carpentry" mod.

bright fog
#

Context menu ?

analog breach
stoic kayak
#

right click and the thing that opens is a context menu.

grizzled fulcrum
stoic kayak
#

Not just for PZ, but for anything.
Like it ya select text in discord and right click it, it has "copy" "cut" etc

grizzled fulcrum
#

sorry typing on phone so its a challenge

stoic kayak
grizzled fulcrum
#

not sure

#

maybe you could also do a water amount check as well

stoic kayak
#

Ye, that was why before I was checking for max amount

grizzled fulcrum
#

but you get the point

analog breach
#

Does anyone know how to make a context menu?

grizzled fulcrum
#

its the same as ipairs contextually, but much faster than calling ipairs func

stoic kayak
analog breach
grizzled fulcrum
stoic kayak
grizzled fulcrum
#

Do you want to add an option to a menu? Is it just for clothing, or is it more complex? etc

analog breach
grizzled fulcrum
#

is the metal and item or an object?

analog breach
#

An item

grizzled fulcrum
#

I mod the game more than play it so I am not familiar with all the different items

analog breach
#

Like for instance "sheet metal"

#

or "scrap metal"

grizzled fulcrum
# analog breach An item

So you need to add an event that gets called when the player right clicks an item in their inventory. I will show how to do this but I'm on my phone so it's going to take a bit longer to write out

analog breach
#

ohh not in inventory.

#

when its on the ground

grizzled fulcrum
#

you mean world item?

analog breach
#

If thats what it is

grizzled fulcrum
#

ok that's pretty similar tho

analog breach
#

Lmfao I need to get a mod folder

#

I dont even have one yet

#

What I mean. Is start the MODS folder

stoic kayak
#

if I exit out of a save with the mod loaded, to the main menu where mod isn't loaded, and then re-enter the save, will it update the mod files ๐Ÿค”

#

(Retorical, but I am trying it rn)

grizzled fulcrum
#

ok I'm going type it on my computer when I get back, because mobile is pain

analog breach
#

aoqia

#

if I were to send a .zip file would you be able to tell me if my directory is messed up?

#

Ive only made 2 mods so far so I barely even know how to get the directory right ๐Ÿ˜ญ

bronze yoke
# merry citrus is this right

the folder should be called models_x not model_x and you should be able to reference it using the path *after* that and without the extension (e.g. if your model is media/models_x/weapons/firearm/FalloutShotgun.fbx, you should write mesh = weapons/firearm/FalloutShotgun )

grizzled fulcrum
stoic kayak
#

hmm- it's quite laggy to open context menu now- is this just a coincidince or is it my for loop-

#

I don't know

grizzled fulcrum
#

also ratchet turns out hasWater is just the equivalent of

return this.getWaterAmount() > 0;
``` anyway
grizzled fulcrum
unreal skiff
#

I have been watching Fear the Walking Dead recently and I just happen to really love season one where there Zombie Apcolopyse is only getting started and we get to witness the fall of Los Angeles as it slowly drifts into chaos. It seems that I'm not alone in this either as many people enjoy watching films and shows where they showcase societal collapse.

With that being said and with regards to Build 42 coming with NPCs, do you think a mod could ever exist where NPCs could be added to the game with scripted scenarios? Such as NPC store workers and people walking around Louisville going about their day?

I would personally call it, "The Last Fourth of July" or something like that. Where the game starts on July 4th and as you begin the game, society hasn't fallen yet.. All you hear is radio transmisions and rumors around Knox County in scripted dialogue from NPC encounters and then on July 6th the infection begins to really take hold on the entire district.

Would a mod like this be at all possible?

bronze yoke
#

probably? we don't really have any special knowledge on what a feature that's still likely several years out is going to be like

grizzled fulcrum
#

I think it's hard to say because we don't know what b42 has in store for us yet

unreal skiff
#

So a guy can dream? ๐Ÿ˜…

grizzled fulcrum
#

pretty much

unreal skiff
#

This happens to be one of the few games that can allow for such a simulation. I can't name any particular games in the survival genre that have zombies and have a world that allows you to enter every building and decorate and customize as much as this one.

But I feel the developers should consider expanding the tools we can access to build out these worlds.

We already have RP servers that totally negate the zombie stuff and serve as Sim City life RPs...

mortal heart
#

how do you change the name of a item

grizzled fulcrum
#

Of course discord uploaded my message too, just delete the first two lines lol and the last line

analog breach
#

this is for the context menu?

grizzled fulcrum
#

yes

#

You have to change some stuf though

analog breach
#

I understand like 1/5 of what im seeing

grizzled fulcrum
#

I don't usually just write code for people like this, but basically the things you need to add yourself as homework is

analog breach
#

yeah I really appreciate it

grizzled fulcrum
#

You need to change Base.MetalObject (search for it) to the item name

#

There's some example translations (search for YourMod) that you can use as a baseline of how to add translation

#

You need to put what ever you want in your_function, that function will get called when the player clicks on the option

analog breach
#

would I have to add that for multiple items?

grizzled fulcrum
#

add what

#

this script will handle all the items you right click, but where I put the check for Base.MetalObject you need to change that to whatever items you want to check

analog breach
#

ok.

#

I want that to be every metal item

grizzled fulcrum
#

so like if obj:getType() == "Base.SomeItem" or obj:getType() == "Base.AnotherItem" then

#

I don't know how many metal items there are so you're probably going to have to put a couple there

analog breach
#

Shit I forgot about that

#

The whole obj:gettype

#

I forgot everything is categorized

grizzled fulcrum
#

oh and also change the second param name of your_function from player_idx to player because I forgot I just pass the player object directly

#

that is something I've always questioned, which is faster? Passing player_idx and then calling getSpecificPlayer(idx) every time or just passing player object?

bronze yoke
#

the latter

grizzled fulcrum
#

hey albion, is Candle manually maintained if you know? or does jab have a script for it

bronze yoke
#

it's generated by a big scary java program he wrote

grizzled fulcrum
#

oh my god its in the readme am I blind the answer is YES

#

I swear I read it up and down like 4 times

#

wait no im just stupid, he didn't open source it

#

because I was wondering why there are exposed classes that aren't listed in Candle, so when I try to get type information it does not work

bronze yoke
#

what classes would those be? i wasn't aware of issues like that

grizzled fulcrum
#

I've only come across the "primitive" classes like Integer, Double, Float, Void (although void is completely pointless to expose lol)

#

I will search through all of them really quick to see what ones are and aren't and give a full list

#

it seems his compiler checks Integer, but doesn't generate typings

#

unless this is intended

bronze yoke
#

there is an oddity with kahlua where even lua primitives have a metatable which i don't think we can represent, but accessing them as classes should be fine