#mod_development

1 messages ยท Page 155 of 1

fading horizon
#

but nothing inside it will lol

#

i couldn't find the issue so i'm playing No Mans Sky instead

ancient grail
#

how did you find it if you dont see error\

fading horizon
#

started a new game

#

found a vape on a zombie

#

context worked fine

#

transferred to inv

ancient grail
#

cool

fading horizon
#

didnt check it for a while

#

went to check it to use it and the context text was gone

#

spawned new vapes, also gone

#

reloaded save, still gone

fast galleon
#

I got this, which fixed itself after I went and opened the mod list from main menu ๐Ÿค”

fading horizon
#

that sometimes happens if it's the first item in the inventory

#

i'm honestly not sure how to fix it

primal remnant
#

We were just looking at that GnomeBars code this evening. Is it posted on the workshop yet @fading horizon ? I'm off to bed for the night. Finally got the schedule right but I'm back to being an old person ๐Ÿ˜

fading horizon
#

yes its on the workshop

#

ill link it one sec

fading horizon
#

weird thing is that no user has ever reported this issue

#

so idk

#

just booted a new game and same issue

upper lynx
#

Anyone?

fast galleon
upper lynx
#

It doesn't show up in the normal area though, I didn't make it a burnt one

#

Not intentionally anyway

fast galleon
#

If you share the vehicle script maybe somebody will notice something wrong about it.

upper lynx
#

I'll try get that file

blazing pond
#

this gonna be the dog in b42?

ancient grail
blazing pond
#

unfortunate

#

skeletons make great dogs

north junco
#

I was inspired by the WoW quest voice mod thing. You guys seen it? Basically AI-generated voices to accompany quest text in WoW. Imagine something similar in Zomboid; auto-generated voices for characters whenever you type out something they say. That'd add so much for immersion.

#

So, in theory, someone types "Hello" in multiplayer, for example. The character would have a few invisible tags (chosen at character creation, or tied to pers) describing the voice, such as "male", "young","raspy voice" and similar, and the mod would follow those tags to generate a fitting voice. We could literally hear that "Hello" in an appropriate voice.

dull moss
#

Hey, so I have my moddata being initialized by separate lua, and at the end of it I have this

Events.OnCreatePlayer.Remove(createModData);
Events.OnCreatePlayer.Add(createModData);

but I'm getting reports that if you die and try to create new character it throws errors (errors are in other luas on lines that use moddata, therefore it's not initialized)

I thought it'd fire when new character is created?

bronze yoke
#

it does

dull moss
#
Steps:
1. Create the first character in a new save;
2. Do nothing and be killed by zombies immediately;
3. Create a new character in same world;
4. Report errors in the lower right corner after customizing character but before spawn.
bronze yoke
#

-before spawn

#

oncreateplayer isn't going to fire before you create the player

dull moss
#

hm

#

well everyminute/every10minutes fire before player is created

#

cuz it errors

#

yea idk

#

anyone got any ideas how to fix? NotLikeDis

bronze yoke
#

is it only lines to do with moddata that are erroring? you'd expect anything that tries to use the player to error if that's the issue

dull moss
#

yes, for example, here's stripped down code, throws null error at modData.FoodSicknessWeathered = modData.FoodSicknessWeathered + foodSicknessStrength;

local function foodSicknessTraits()
    local player = getPlayer();
    local foodSicknessStrength = player:getBodyDamage():getFoodSicknessLevel() / 100;
    if debug() then print("ETW Logger: foodSicknessStrength="..foodSicknessStrength) end
    local modData = player:getModData().EvolvingTraitsWorld;
    modData.FoodSicknessWeathered = modData.FoodSicknessWeathered + foodSicknessStrength;
    if player:HasTrait("WeakStomach") and modData.FoodSicknessWeathered >= SBvars.FoodSicknessSystemCounter / 2 then
        player:getTraits():remove("WeakStomach");
        if notification() == true then HaloTextHelper.addTextWithArrow(player, getText("UI_trait_WeakStomach"), false, HaloTextHelper.getColorGreen()) end
    elseif not player:HasTrait("IronGut") and modData.FoodSicknessWeathered >= SBvars.FoodSicknessSystemCounter then
        player:getTraits():add("IronGut");
        if notification() == true then HaloTextHelper.addTextWithArrow(player, getText("UI_trait_IronGut"), true, HaloTextHelper.getColorGreen()) end
        Events.EveryOneMinute.Remove(foodSicknessTraits);
    end
end

local function initializeEvents(playerIndex, player)
    Events.EveryOneMinute.Remove(foodSicknessTraits)
    if SBvars.FoodSicknessSystem == true and not player:HasTrait("IronGut") then Events.EveryOneMinute.Add(foodSicknessTraits) end
end

Events.OnCreatePlayer.Remove(initializeEvents);
Events.OnCreatePlayer.Add(initializeEvents);

and a bunch of other similar errors, all say that my moddata table is null

#

ok what happens

#

is that after you die but before you spawn it catches a moment where it runs all that code. Moddata is getting initialized but a second later, right when you spawn

#

i think if i clear my events when player dies it should fix it, if there is such event

open drum
#

hey guys

#

wher's the best place to ask question about clothing modding

#

im having a problem with applying a texture

#

i think you guys would find funny as well ๐Ÿ™‚

dull moss
#

if problem is code-wise then prob here

open drum
#

but can't figure out how to fix it

#

can't tell whether it's code problem

dull moss
open drum
#

maybe i should go to modeling ?

dull moss
#

Just hand around, someone may help you. Idk textures so can't help

open drum
#

ok, thanks for the suggesting

#

suggetioni*

fast galleon
dull moss
#

already fixed

#

but ty

#

fixed by removing my events on player death btw

#

since they are added when player is created anyway

neon bronze
#

how can i get a list of active mods?

ancient grail
#

You can modify my code for adding mods
This js one way of how you can get the list

ancient grail
neon bronze
#

do you know how to do that also in sp? I get a blank list even though i have 3 mods on rn

bronze yoke
#

if you're trying to see if a specific mod is loaded you can then use :contains("ModID")

neon bronze
#

swear to god i knew there was a a call like getActivatedMods couldnt find it though

#

but thank you albion

neon bronze
bronze yoke
#

yeah

neon bronze
#

i guess it has to be the mod name in the mod.info then

bronze yoke
#

you can technically loop through activated mods and use getModInfoByID(id) to get the mod object and then :getName() on that

#

but i'm not really sure there's a particular reason to use names anyway

sour island
#

get active mods is a thing

#

Server options may have a use here too

#

They also include all the other options

neon bronze
#

well i used the id, the number, but it said it does not include that even though i got the modid from steam but when i used the name of the mod it did say its included

sour island
#

You use the ID as in modinfo

#

You able to parse through, I think it's an array

bronze yoke
#

yeah, not the workshop id

neon bronze
#

yea getActivatedMods is an java array

#

but i figured it out already

#

the thing is im tryint to pass my mod on advanced trajectory since it kinda overwrites the normal shooting and my mod need the OnWeaponHit event

sour island
#
local loadedModIDs = {} 
 local activeModIDs = getActivatedMods() 
 for i=1, activeModIDs:size() do 
         local modID = activeModIDs:get(i-1) 
         if crossRefMods[modID] and not loadedModIDs[modID] then 
                 require (crossRefMods[modID]) 
                 loadedModIDs[modID] = true 
         end 
 end
#

I do this to grab files that cause problems and load them first

#

Also so I don't have to keep calling the function and parsing through

ebon apex
#

1 - how can I pass the same inventory_items to the read_all_maps function via context:addOption as in the maps_context function
2 - and also another question - how can you read a map without calling up a window about what is drawn on it? well, that is, just call the function and after that the map that is in my pocket will be displayed in the main map

local function read_all_maps(items)
    print("-------------------------------------------------------------")
    for key, value in pairs(items) do
        print(value)
    end
end

local function maps_context(player, context, world_objects)
    
    local inventory_items = ISInventoryPane.getActualItems(world_objects)
    local find_map = false
    
    for key, value in pairs(inventory_items) do
        if string.find(value:getFullType(), "Map") ~= nil then
            find_map = true
        end
    end
    
    if find_map then
        context:addOption("ohhhhh yeeaaaaa", world_objects, read_all_maps)
    end
end

Events.OnFillInventoryObjectContextMenu.Add(maps_context)```
knotty abyss
#

Hello. Someone knows how can I change the size of the rectangle interface in map ISUI ? I need to extend the size of the rectangle to be able to see the hidden content ... I believe it is in this file but I don't know where to change it exactly. If anyone knows and can help I appreciate it!

Maybe here ?? Idk ..

    ISPanelJoypad.render(self)
    if self.selectedSymbol then
        self:drawRectBorder(self.selectedSymbol.x - 1, self.selectedSymbol.y - 1, self.selectedSymbol.width + 1, self.selectedSymbol.height + 1, 1, 1, 1, 1)
    end
    if self.joyfocus then
        self:drawRectBorder(2, 2, self:getWidth()-2*2, self:getHeight()-2*2, 1.0, 1.0, 1.0, 1.0);
        self:drawRectBorder(3, 3, self:getWidth()-3*2, self:getHeight()-3*2, 1.0, 1.0, 1.0, 1.0);
    end
end```
#

I need to extend down rectangule of map symbols unhappy

primal remnant
#

Hey guys, I'm beating my head against the wall on adding a delay/timer to my lua script.
I can make the game AddGeneralHealth with ease, but I would like for it to happen several times over a set period of time. Any tips on where to begin looking?

dusty wigeon
#

anyone here know how to do traits, professions, and perks?

magic edge
#

new modder. Is there a way to quickly reload a mod without restarting the game?

bronze yoke
#

you can reload lua files from the f11 menu or just have the mod disabled on your main menu so it reloads lua every time you load the save you're testing on

abstract pine
#

Anyone here know why a tile with the "can be hit by car" property and a damaged sprite would work in single player but not multiplayer? No matter what I've tried on the tile properties, I can't for the life of me get a couple of tiles to properly be damaged on impact in MP, they are just driven right through for some reason even though all other tiles work fine.

fading horizon
#

now you can equip a backpack with my satchel as well as wear it on the front

frank elbow
#

The event that's the most suitable varies depending on your use case

#

That's the only way as far as I'm aware, anywayโ€”as always, I'd love to hear that there's a better way

low basin
#

So I have attempted to create a storage mod allowing the building of a couple variations of pallets without using lua (due to skill issues.) This has resulted in a few additional issues. 1: When using the result format Moveables.Tilesheet# the objects appear with the default icon and "Moveables" as the display name. 2: Items are not able to be removed once placed and must be sledgehammered. 3: Replacing the result with the item name corrects #1 but #2 still applies. 4:The IBC container when using the Moveables.ect format shows a water capacity when placed but cannot be refilled, however if changed to the item name it no longer displays this information or acts as a water container when placed. #2 also still applies to this container.
Is there a guide for what I am attempting to do somewhere that I have been unable to locate?

echo fiber
#

need a bit of help here, so this function is called when a recipe is used, i have it on another line where it works when you take the battery out of the vape it maintains its delta from the vape to the battery but when you go and put the battery back into the vape it gives a full delta, the recipe for removing the battery only has one item in the recipe but the code for this one has two items in the recipe and it cant find out what one to call so it skips and gives a full delta, is there a way i can have the get/set usedDelta to call a specific item its self? the if item:getModule() == "VapeMod" and (item:getFullType() == "VapeMod.VapeBattery") then is only checking if you have it not using it ๐Ÿ˜ฆ

primal remnant
echo fiber
#

@bronze yoke im slowly learning XD

#

i saw you typing haha

bronze yoke
#

glad you got it!

echo fiber
echo fiber
frank elbow
#

It really depends on what you need

bronze yoke
#

ontick is usually the most useful but everyoneminute can be useful if the effect is slow and you don't care about having perfectly consistent timing

echo fiber
bronze yoke
#

you can use GameTime's getMultiplier() to get a delta

#

the implementation of this kind of thing is usually pretty manual and annoying

mellow frigate
#

Hi, in a MP mod, on server side, I wanna get info on a random grid square of the map that is very likely not to be loaded. How can I get the info ? Alternatively, how can I force part of the map to be loaded on the server side when no player i closeby ?

bronze yoke
#

you can't

#

if it's not unreasonable to do so cache the data while it's loaded

echo fiber
#

@bronze yoke sorry for the ping but wanted to see if you knew the answer to this, that item that gets added threw the function is there a way to set that items delta to the item used in the recipe?

bronze yoke
#

char:getInventory():AddItem(type, useDelta)

#

also if you're checking fulltype you don't need to check the module, module is in the fulltype anyway

echo fiber
#

so like char:getInventory():AddItems("VapeMod.GreenVapeBurnt", useDelta) ?

bronze yoke
#

AddItem not AddItems

echo fiber
#

o?

#

but so that is correct besides that

bronze yoke
#

in place of useDelta use item:getUsedDelta()

echo fiber
#

okay so more like this

#

or am i still messing it up it XD

bronze yoke
#

looks right to me!

echo fiber
mellow frigate
bronze yoke
#

LoadGridsquare event

echo fiber
viscid drum
#

so i'm having trouble getting my mod to use the model and texture i have for my pen. I've copied the vanilla pen model and altered the texture, but it won't use the model and texture I have in the mod.

#

It works for the cooler I did, but for whatever reason its not working for the pen. I used the same template as the vanilla items with some altered stats. I'm not sure what I'm doing wrong.

astral dune
#

I've been asked to get back into modding PZ, so I've been going through my code from before and it appears I have forgotten lua

ancient grail
#

Oh no

astral dune
#

suddenly a lot less resistant to the idea of that Typescript precompiler thing that one guy was working on. I'll have to have a look for it

fast galleon
#

I've just renamed everything but it seems to work still, I plan to finish it in the next days to test with the solar panels mod. Maybe you'll find it useful too.

#

I'm not sure about loading existing parts of map. I have script to load map that is used as default for that square. If you need access to squares data of unloaded parts, it's usually done with global data / global objects.

timber river
#

I heard someone has or had worked on a discord bot for some server interactions... has anyone coded one that can interact with rcon or the server directly in a way that would allow users to initiate a server restart without intervention from the server owner? For mod updates and such

magic edge
#

Hey, I'm trying to modify food tooltips. I'm trying to wrap around the ISInventoryPaneContextMenu.addEatTooltip method like so:

local base_tooltip = ISInventoryPaneContextMenu.addEatTooltip

function ISInventoryPaneContextMenu:addEatTooltip(option, items, percent)
    print("custom addEatTooltip called")
    base_tooltip(option, items, percent)
end

It's never printing to console. The other functions in the same file are working correctly. Is this the wrong method to wrap?

fast galleon
#

also it's declared as

ISInventoryPaneContextMenu.addEatTooltip = function(option, items, percent)

which means you would have wrong parameters in the example above.

magic edge
#

that function is just dead code? Where are inventory tooltips created?

robust briar
bronze yoke
#

i doubt the game keeps track of this

#

you can keep track of it yourself but it won't work with old saves

sour island
ancient grail
red tiger
upper lynx
#

Can anyone help me with this?

wild sand
#

Hello. I had a problem with uploading a mod to the workshop for the game Zomboid Project. Please help me solve this problem. screenshot of the error.

ancient grail
#

i dont understand why its going back lol

nimble spoke
viscid drum
#

is there anything wrong with my item script? still can't figure out why this model isn't displaying :/

fast galleon
#

Are there any good cannibal mods, I might need to chop Zeds into meat chunks.
What I actually need is a way to make compost from corpses, I think somebody already made a mod like that.

Do you know a mod I can suggest for this?

snow egret
#

I am trying to make a new category to "AttachmentType" to be able to change the location on the back of a weapon of my mod, I add it to the back list in my respective file "ISHotbarAttachDefinition.lua" and in "AttachedLocation.lua" add the definition of modelAttachement group, in the "ISHotbar.lua" file I know that I have to add the functions to add the item, I tried adding part of the code, all the code, tried to see if the NoirsAttachment mod helped me understand what to do, but it is beyond my understanding can someone tell me what i did wrong and what to do to make it work?

merry storm
#

Hi,im trying to get all items in the game but it keeps returning a nil everytime. I have seen many examples of people doing it and they just use this, but when i do it, i get a nil. Any ideas?

local allItems = getScriptManager():getAllItems()
print(allItems[4])
neon bronze
#

Its a java array

#

Youโ€™d need to do allItems:get(4)

merry storm
#

ohhhhhhh, im such an idiot. And i already did on others parts too....

#

Thank you!! ๐Ÿ˜„

ancient grail
# merry storm Hi,im trying to get all items in the game but it keeps returning a nil everytime...
#

i know youre asking for the code but just wanted to share this .. ive been collecting arrays

#

feel free to modify it and add to its. its for the whole community

merry storm
#

Thats actually really helpful! Thank you for this

ancient grail
spiral tiger
#

Hi, I wanted to ask if there is any project or just a tool that could render the current server map and live display the players on it on the web? Kind of like the dynmap in Minecraft.

upper lynx
#

Anyone who has done car mods before please could you help me out? I'm really bad with this ๐Ÿ˜…

sour island
# spiral tiger Hi, I wanted to ask if there is any project or just a tool that could render the...

Not that I know of - but there's a few people here that might know how to go about it.

Not going to ping them, but you can try DMing: M3ss, Dane

What I imagine would be the best way to go about it would be to have the server print a text file of locations periodically and have the website pulling it's data from the text file.

The discord stuff is also a possible route -- but I don't know how well scoped it is or isn't.

sour island
#

That's basically a teleport, no?

#

Also laughing at the model size declaring the shadow size

#

Cars do that too

sour island
neon bronze
#

What directory path does GetModFileWriter use?

sour island
#

The mods' installation folder

#

Speaking of which... Steam is not able to scrub files properly if the files aren't part of the download.

#

You're probably better using the other file writer function

neon bronze
#

The other file writer?

sour island
#

Which places it in the Lua folder of the cache

neon bronze
#

Is it just GetFileWriter?

sour island
#

I think it's just refered to as FileWriter

ancient grail
#

Its not doing any tp

#

And for now its bound to shove

sour island
#

So the the slide back is part of the animation?

ancient grail
#

But will change it
Should make it fun to play with like how levitate mod feels

sour island
#

Shove is not a bad place to have it

ancient grail
sour island
#

Makes sense although I'd suggest holding the key to prep a jump

#

Like a charge

ancient grail
#

Or maybe its just how i teanslated the body too
O should have just translated the translate bone

neon bronze
sour island
#

Like the arguments?

neon bronze
#

Yea

ancient grail
#

Iwas thinking of crawlong walk
Sprint is leaping
Sneak his grabbing the ceiling

#

But needs checker if there floor above

neon bronze
#

Im trying to access an existing file but i think my pathing is wrong

#

Im trying through mod_name/media/folder and in there is my .txt

sour island
#

getModFileWriter(modId, configSavePath, true, false)

neon bronze
#

Shouldnt modid be the name of the file you trying to access?

sour island
#

You're thinking of requires

#

(which im not even sure why that argument is called modID)

#

Here the modID should be your mods ID as found in modINFO

neon bronze
#

And the config path starts of in media or before that?

sour island
#

The save path is inside the mods install folder - I forget if there's an added directory

#

May or may not be media

#

May be outside of contents

neon bronze
#

Iโ€™ll try with both

sour island
#

You don't have to add media or the beginning

#

Start with what you want it to go to

#

It will dump into the directory

neon bronze
#

Well i did one before media and it did read the file correctly

ancient grail
#

The getmodwriter reader
Access files that are on the lua folder of the server not the media lua

#

It doesnt access the files that comes with the mod

neon bronze
#

Well i pointed it towards a custom folder

ancient grail
#

Its only to manage cache

sour island
#

There's two writers

ancient grail
#

Ah didnt know that

neon bronze
#

i think the other one is GetWriter is the one for the vanilla

ancient grail
#

I havent tried that

sour island
#

Also, I just wanted to clarify, you don't need to start the path like "C:/username" etc

#

It starts in the mod directory

ancient grail
#

Root

#

Yeah

sour island
#

Or if you're using the other writer, in the Lua directory of the cache

neon bronze
#

Did not use it either

ancient grail
#

Not root wait

sour island
#

Just checking, as I think there's a language barrier

ancient grail
#

Iforgot the term

#

Im dum

#

Index?

#

Whatever

sour island
#

Root is applicable I think

ancient grail
#

Yey

neon bronze
#

Does it append the changes on file:close()?

#

I dont get it to actually write it in there

#

Ok nvm i found the issue

#

I was just stupid

sour island
#

Man... I'm about to just start slapping tooltips all over character creation for Skill Recovery Journal

sour island
#

Would also be eliminating the [ More ] button at the bottom

drifting ore
#

looks noice

sour island
#

Just getting tired of people asking me why my mod doesnt work cause they don't actually have it enabled on their on-going game

drifting ore
#

can you make as tooltip that lets you know that you are now seeing your game main menu and are not on your desktop anymore?

sour island
#

hm?

#

Not sure if that's meant as a joke against the players - but I don't really fault them for not knowing there's a mod menu for each save

#

Most people just hit continue

#

I'd probably remove the continue button as all it does it load the latest save

#

Sorry gamers ๐Ÿ™

drifting ore
#

Not even that, they might not even know they are in-game

sour island
#

Not sure what you mean tbh

drifting ore
#

one day you will, and then you chuckle quietly in your bed, but you won't elaborate to anyone

fierce hedge
#

"players are idiots, and you should treat them like it"

drifting ore
#

you said that!

fierce hedge
drifting ore
#

most of the time I am as well, its easier that way

sour island
#

I'd say it's 50/50 in this case

#

Most people who use my mod are new players

#

I get at least 1 comment a day about this

#

At that point I'd say, yes they aren't looking hard enough around, but at the same time -- going through Load > More... > Mods when they always just hit Continue is also not that intuitive.

#

Plus if they just keep creating characters on the same save - I'm sure they've never ran into some mod's content cause they're not actually enabled drunk

drifting ore
#

but I get them, most come from hard day of work/school, power up the PC, click PZ next next next and gaming time, no time or will to read or do anything else that is not pure entertainment

fierce hedge
#

tbh it happens to everyone, I spent the past 20 minutes losing my mind, forgetting that lua is 1 indexed and java is 0 indexed.

nimble spoke
sour island
#

Wasn't aware of that tbh

#

Explains the lack of mod profiles

#

The same way traits and sandbox can have profiles accessed in the process of setting it up

nimble spoke
#

It was a pain, specially for modders working on different projects in different saves

sour island
#

I can imagine, I still have issues trying to play the game ๐Ÿ˜…

#

Fortunately, using an alternative cache for development helps starting play

#

But going back I still have to unsub from my mods

#

The times I've had to boot up a server several times cause of a file conflict

#

Or forgot to unsub and scratched my head in confusion

viscid drum
#

sorry is it too blurry? didn't want to spam chat by copying the whole thing

neon bronze
#

you could have easily copy pasted it here if you put it after 3 "`"

neon bronze
viscid drum
#

tysm, i'll try that, and sorry, I'm not super familiar with discord commands

sour island
#

```
CODE
```

fast galleon
sour island
#

hm?

viscid drum
neon bronze
#

hm?

sour island
#

Try it out, if you put a language after the first ``` you can color-code it

viscid drum
#
module TheyKnewMoreTest
{
    model MysteriousCooler_ground
    {
        mesh = WorldItems/Cooler_Ground,
        texture = Clothes/Bag/TheyKnewMore_Cooler,
    scale = 0.4,
    }
    model TactPen
    {
    mesh = weapons/1handed/TactPen,
    
    attachment world
    {
    offset = -0.0050 0.0600 0.0000,
    rotate = 0.0000 0.0000 0.0000,
    }
    }
}
#

changing it to TactPen didn't fix it

neon bronze
#

what about that attachment?

viscid drum
#

this was copied from the vanilla pen script

neon bronze
#

for my model i didnt had any attachments

#

i think they use .x models so maybe thats why they have it

#

do you use .fbx models?

viscid drum
#

yeah, I copied the .x model

neon bronze
#

i would just make a .fbx model

#

or try without the attachment

viscid drum
#

i'll try removing the attachment, is there an easy way to convert the .x to .fbx?

#

cooler works perfectly fine, just this pen wont work

neon bronze
#

is the cooler a .x model?

viscid drum
#

its .fbx

neon bronze
#

try giving your pen a texture it could be invisible without texture

viscid drum
#
module TheyKnewMoreTest
{
    model MysteriousCooler_ground
    {
        mesh = WorldItems/Cooler_Ground,
        texture = Clothes/Bag/TheyKnewMore_Cooler,
    scale = 0.4,
    }
    model TactPen
    {
    mesh = weapons/1handed/TactPen,
    texture = textures/weapons/TactPen,
    }
}
#

something about the .x file is just being stubborn. If I leave the script exactly like the vanilla script, it'll use the vanilla pen. If I try to path it to the model/texture in my module, it simply doesn't work

neon bronze
#

model/texture?

viscid drum
#

models_X/weapons/1handed/TactPen.X

#

textures/weapons/TactPen.PNG

#

the model is copied straight from vanilla but renamed, texture has just been the vanilla one but recolored black

neon bronze
#

Do you havr both of the folders in the media folder?

viscid drum
#

yes

neon bronze
#

.x have textures imprinted in them i believe

#

Atleast they reference them so maybe thats why

#

Try making that .x model into fbx

#

And then place it there instead

viscid drum
#

that probably explains why im having so many issues........is there an easy way to convert?

neon bronze
#

I think there are some converters online

viscid drum
#

k, i'll do that, tysm again!

scarlet zinc
#

Hey people, where/which variable do you get in game clock data form? I remember that there should be like having a few of them, I really need the one with counting in game world minutes to make my mod works.

#

I've try getdate but it doesn't seem working, can't pull out minute data into a new variable.

sour island
scarlet zinc
#

So is it getgametime(minute)

#

Or was it getgametime(). minute?

bronze yoke
#

getGameTime():getMinutes()

sour island
#

There's a lot of functions - some of them are as old as the game, so their names may not match current behavior.

#

Also if you want player's survive time that's a different thing.

scarlet zinc
#

I was thinking of getting current time of in game world, I was thinking about doing a variable that copy the in game world time data into my mod and checking if the minutes of every hour reached at 0,15,30,45, would run my custom function.

#

Not survival total time or gameplay session time.

sour island
#

I think getMinutes is the clock minutes

bronze yoke
#

you can use everyoneminute to query it every minute

scarlet zinc
#

I do want to sync in the timedata in my mod to somewhat near the base game though. But I guess if everyoneminute would do......

sour island
#

You can specify which minutes fire the event using

local interval = minute % 15 == 0
#

This would fire it on 15 min intervals

scarlet zinc
#

Oh thanks.

#

But wasn't 0 to 59? If given count to 60, wouldn't 0 and 60 be both firing?

sour island
#

shouldn't matter - the for loop in this case is a test example

#

all you'd need is to add a function to the every minute event

#

and include this before what you add lua if minute % 15 ~= 0 then return end

scarlet zinc
#

Oh, right, my bad.

sour island
#

minute being getGameTime():getMinutes or whatever it is

golden apex
#

Is it appropriate to try to hire someone to make a mod for me in here? ๐Ÿ‘€ I have no idea what Iโ€™m doing when it comes to lua but I need a simple mod made for my stream

#

I want a mod that will bind some keys to input specific admin commands.
INSERT = will give me a bag of chips and a water
HOME = will give me me a meat cleaver
PAGEUP = will give me a revolver with 6 bullets
DELETE = will spawn 1 zombie at my location
END = will spawn 5 zombies on my location
PAGEDOWN = will spawn 15 zombies on my location
If anyone can help me make this or point me in the right direction for some tutorials Iโ€™d be forever greatful

neon bronze
#

How soon do you need it?

golden apex
neon bronze
#

is it for a server? i assume since you say those are specific admin commands

golden apex
neon bronze
#

also with zombie on your location do you mean it like right on top of you or somewhere around you?

golden apex
neon bronze
#

i could cook up smth in a short while and give it to you if you want to test it

neon bronze
golden apex
neon bronze
#

ahh i work on a laptop and dont have those

#

you wouldnt mind mappin them somewhere else maybe?

golden apex
golden apex
neon bronze
#

yea sure

ancient grail
#

local toClear = {
'Base.Apple',
'Base.Orange', 
'MOD1.GreatestSwordEver',
'Base.Sledgehammer',
}
function clearDistrib(item)
    RemoveItemFromDistribution(Distributions[1], item, nil, true);
    RemoveItemFromDistribution(SuburbsDistributions, item, nil, true);
    --RemoveItemFromDistribution(VehicleDistributions, item, nil, true);
    RemoveItemFromDistribution(ProceduralDistributions.list, item, nil, true)
end
Events.OnPostDistributionMerge.Add(function() 
    if not isClient() then
        for i = 0, #toClear -1 do 
            local item = toClear:get(i)
            clearDistrib(item)
        end
    end
end)```
#

will something like this work

bronze yoke
#

i recommend not using RemoveItemFromDistribution

#

it's extremely slow

#

it doesn't matter too much if you just have a few items but it scales horribly

ancient grail
#

What do i use ?

bronze yoke
#

for a mod i'm finishing up i put the items into a lookup table and then crawl the distributions table and check every item against the lookup table and remove it if there's a match

ancient grail
#

So is that an api?

#

We will require it

bronze yoke
#

no but i might make an api/another mod out of it

sour island
#

The issue with RemoveItemFromDistribution is that the argument should be a list of types

bronze yoke
#

i think it should put everything you put into it into a list and only operate on the table once during distributions merge or something

sour island
#

yeah

#

could just forloop the argument and generate a temporary table of type=true, so you can parse faster too

bronze yoke
#

yeah, that's part of my implementation

sour island
#

if temporarytable[type] then bam

#

๐Ÿ‘

bronze yoke
#

iirc it also iterates by 1 and has some weird handling for the spawn chances (since distributions are item, chance, item, chance) instead of just iterating by 2 and removing both

sour island
#

oof

fast galleon
#

@ancient grailyou can see how True Music Containers does it.

sour island
#

it doesn't use table.remove does it?

ancient grail
bronze yoke
#

it does use table.remove but i'm not sure what would be better in that case

bronze yoke
#

i tried niling them and then cleaning it up afterwards but in my implementation at least that turned out to be a lot slower

#

so i use table.remove too

sour island
bronze yoke
#

yeah, that's what i went for since i heard the same thing but the performance was a fair bit worse

sour island
#

shouldn't be - it should just be 2 separate for loops

bronze yoke
#

my guess is that java is so much faster than lua that unless the data set is really large it's slower to clean it up in lua than to let table.remove redundantly do it multiple times

sour island
#

Alternative to table.remove snippet (incomplete)

local function compressTableOfNils(tbl) 
         local n = #tbl 
         --prepare new index for tbl
         local newIndex = 0 
         --iterate through and overwrite nil entries 
         for i=1, n do 
                 if tbl[i]~=nil then 
                         newIndex = newIndex+1 
                         tbl[newIndex]=tbl[i] 
                 end 
         end 
  
         --overwrite rest of entries to nil based on newIndex 
         for i=newIndex+1, n do tbl[i]=nil end 
 end
#

changed table argument to tbl to avoid issues with the table

#

supposedly this is faster than table.remove ๐Ÿ˜…

bronze yoke
#

i agree with the logic that it should be but it just didn't seem that way in my testing

sour island
#

Only works for numeric keyed tables

bronze yoke
#

it might be that it just happens to be slower with the way the items i was removing were spread throughout the distributions

#

and is usually faster or something

sour island
#

could also be a kahlua thing

bronze yoke
#

i imagine if you remove only one item from a table that table.remove would always be faster for example

ancient grail
#

@sour island so the thing abt the clothing thing
Your ways will work right it wont turn them to naked zed

#

O was also thinking of making em zedDmg

sour island
#

It is the zombie outfit - so no

ancient grail
#

O believe that will work too

#

No as in no it wont work or no ot wont turn to naked zed lol

sour island
#

It won't make them naked

ancient grail
#

Ok

#

Accepting the proj now

merry storm
#

Any idea why here i can use getDisplayCategory but when i use getCategory its crashes?

local allItems = getScriptManager():getAllItems()
        local weaponItems = {}
        local ammoItems = {}
        local magItems = {}
        local weaponsPartItems = {}
        for i = 0, allItems:size() - 1 do
            local item = allItems:get(i)
            print(item)
            if not item:getObsolete() and not item:isHidden() then
                if item:getCategory() == "Weapons" then
                    table.insert(weaponItems, item:getFullName())
                end
                if item:getDisplayCategory() == "Ammo" then
                    table.insert(ammoItems, item:getFullName())
                end
                if item:getDisplayCategory() == "GunMag" then
                    table.insert(magItems, item:getFullName())
                end
                if item:getDisplayCategory() == "WeaponPart" then
                    table.insert(weaponsPartItems, item:getFullName())
                end
            end
        end
bronze yoke
#

there is no getCategory method of Item

ancient grail
#

isFirearm
isFood

#

Iirc

merry storm
#

So i cant retrieve the category from an item? wow

#

i think i should use isFirearm intead then as Glytch3r said

ancient grail
#

isHandWeapon
isRanged
IsClothing
Stuff like that but i moght be wrong witht he syntax

#

Just check it on the context menu lua

#

Thats where you will get all of em

merry storm
sour island
#

the item you are "getting" is the script item

#

not inventoryItem

#

the methods for each are not always named the same

#

InventoryItem has getDisplayCategory and getCategory
Item has getDisplayCategory as well actually

#

Item has getCategories instead which is an array, this is because items (InventoryItems) can have multiple categories, but they get compressed into a string iirc

ancient grail
#

Shouldnt rely solely on categ anyways

sour island
#

display category is also translated between languages I believe - so using that might be unpredictable

ancient grail
#

Yes in the lua folder
I believe its in client folder

merry storm
#

i see.. now it makes sense

ancient grail
#

Search for onfillinventory

#

Blahblah

#

Its the event for context menu

#

There are 2 types one handles the world obj the tiles and another for inventory
You should look at the inventory

merry storm
#

i only found IsWeapon() to get the same as i was looking for. I hope that works

#

Didn't work neither... Sometimes i got stuck in what seems the most "simple" things

#

nvm, that method is for inventoryitems too

#

Do you guys know if i can use something like getWeaponSprite() so if i get something in return that means its a weapon?

ancient grail
#

So you good?

#

Just to check if its a weapon?

merry storm
ancient grail
#

You dont need to check for sprite

merry storm
ancient grail
#

Have you looked at the vanilla lua file?

#

Files*

#

U should

#

Ah wait

#

I have that on our server

#

We have a library of debug tools

#

Links in the description

#

Imean profile

merry storm
ancient grail
#

I was wrong

#

But ill wrote it for you

merry storm
#

That link says "no access"

sour island
#

@bronze yoke

local test, token = {}, "abc"..10

function test.buildTestlist()
   local count, testList = 0, {}
   for i=1, 49000 do
      local rand = "abc"..math.random(1,10)
      if rand == token then count = count+1 end
      testList[i] = rand
   end
   print("count:", count)
   return testList
end

function test.compressTableOfNils(tbl) local n = #tbl local newIndex = 0 for i=1, n do if tbl[i]~=nil then newIndex = newIndex+1 tbl[newIndex]=tbl[i] end end for i=newIndex+1, n do tbl[i]=nil end end


function test.run(func)
   local _Start = os.time()
   local product = test[func]()
   local _Timing = os.time()-_Start
   print(func, _Timing.." ms","\n")
   return product
end

test.list = test.run("buildTestlist")

function test.copyList()
   if not test.list then print("ERROR: no test.list") return end
   local u = {} for k,v in pairs(test.list) do u[k] = v end
   return u
end

function test.tableRemove()
   local tempList = test.copyList()
   local tempListLen = #tempList
   for k,v in pairs(tempList) do if v==token then table.remove(tempList, k) end end
   print("pre:",tempListLen," -"..tempListLen-#tempList)
end

function test.tableNil()
   local tempList = test.copyList()
   local tempListLen = #tempList
   for k,v in pairs(tempList) do if v==token then tempList[k]=nil end end
   test.compressTableOfNils(tempList)
   print("pre:",tempListLen," -"..tempListLen-#tempList)
end

test.run("tableRemove")
test.run("tableNil")
#
count:    4939
buildTestlist    0 ms    

pre:    49000     -4470
tableRemove    1 ms    

pre:    49000     -4939
tableNil    0 ms    

#

I didn't figure out how to properly copy a table it seems, but nil is slightly faster

#

however, given the structure of distributions and such, there could be an inverse effect

#

+kahlua might translate the lua in a way that avoids the 'table.remove' thing

ancient grail
sour island
#

Probably not significant enough of an impact, perhaps all the drama on forums were exaggerated idk

bronze yoke
#

most performance debates are pretty minor anyway, i've been agonising over code that take 0.04 seconds during loading time

sour island
#

๐Ÿ˜…

bronze yoke
#

(although 0.04 would be very bad during gameplay!)

sour island
#

I'm pretty sure that's what the tooltip/crafting menu lag is from

#

been working on this:

#

p happy with it

fast galleon
#

how bad is it, to use versions based on date e.g. 23.5.1 or 23.05.01

#

I just threw that on the name so I could distinguish which version threw errors at some point. It went straight from 0 to 23 ๐Ÿ™‚

sour island
#

I do that lol

#

used to use arbitrary numbers and arbitrary reasons to do sub versions

#

but the date of update + hotfix number is sufficient

#

never thought of the year first though, that's interesting

#

could do hour (and if needed .minute) for hotfixes ๐Ÿค”

#

I wonder if there's a github action that can write into a lua file

#

would be useful for the community thing

drifting stump
#

by the end of this month i will finally have enough time for modding again

fast galleon
daring hearth
#

guys i m trying to make an audio mod, it would replace msot of the zombie sounds, i have got a folder full of wav files, al with correct names so that they ll work properly...... I NEED TO TRANSFORM THESE WAV FILES INTO A .BANK FILE, help

#

I used Fmod to unpack the game .bank files and understand the layout

drifting stump
#

as for the performance issues with the crafting menu its several things

#

it rebuilds the entire ui and recipe list every time you open it

#

the vanilla rendering function of scrolling lists is horrible

#

searching and sorting is also not well implemented

fading horizon
#

is there a way to force the character to sit on the ground?

#

I have an idea for a mod where the user consumes and item and it knocks them on their butt and they have to sit down

ancient grail
#

Im afk but yet there is

#

Try looking for the context menu

fading horizon
#

good idea, ty

#

||ketamine mod time||

ancient grail
fading horizon
#

ive actually been playing games for once instead of just making mods

#

for the first time in like a month

#

(ive been modding no mans sky instead)

#

lol

ancient grail
#

Made a heroin and meth mod

fading horizon
#

you used the sitting zombie anim for the heroin injection right?

#

i think i remember you sayying that

ancient grail
#

The heroin makes players stay on the ground for certain time
Meth adds temporary traits

#

Ahhh yes

fading horizon
#

i kinda want to combine that and also look at the immersive overlays mod to see if i could make them have a cool overlay

ancient grail
#

Hey how are you udderly saw you typing

fading horizon
#

like taking lsd will cause a glow on the screen or something idk

sour island
#

which one of you

#

๐Ÿ˜…

bronze yoke
#

what's actually in the project these days?

sour island
#

Just debug tools still

#

but I polished up the github page, steamworkshop, and figured out the upload actions

#

will update every friday and anytime a branch with 'hotfix' in it's name is pushed

#

so theoretically, the mod can be anything the maintainers allow

#

Going to be adding more ideas as I go

fast galleon
#

Did you figure out how to make it public or do you do that manually?

sour island
#

I enabled 2fa made it public then disabled it

#

hopefully my house of cards don't fall

#

The options to spoof through 2FA don't look ideal

#

There's probably a valid way to do it with steam API but I cba

#

If this breaks I'll look into it

#

We have lift off

primal remnant
# sour island This would fire it on 15 min intervals

I was reading over your comment earlier regarding "local interval = minute % 15 == 0"

Basically something that could iterate several times over the span of one hour. What I'm not understanding is the update. If I call a function and it has a do while loop in it, do I need any other code to make it continue to run or is it really just that easy?

local gameMinutes = getGameTime():getGameMinutes()
local i = 0

while i < 5 do
  if gameMinutes % 15 == 0 then
     print("minutes :", gameMinutes)
     i = i + 1
  end
  gameMinutes = getGameTime():getGameMinutes()
end

My next question is more about overhead: Is this something I could get away with in PZ or am I looking at bogging down the computers resources with a while loop that could last up to an hour? Time Complexity is not my strong suite. MY CODE MUST BE BORG-LEVEL EFFICIENT!

bronze yoke
#

this won't work because your entire function runs in the same game frame

#

if you want to do something over time you need to attach a function to an event so it gets called repeatedly, in the 15 minute example you'd likely attach it to EveryOneMinute

#

if you do a while loop like this the game will crash because the game minutes won't ever change in the same frame, and the loop will never end so it can't advance to the next frame

primal remnant
#

I see. I think "attach a function to an event so it gets called repeatedly" is the part I'm failing to understand.

Are we talking about Events.EveryOneMinute(), or something akin to that?

#

If there's a mod you can think of that actually does this, I can scan the code to figure it out.

bronze yoke
#

yeah, something like this```lua
local function checkTime()
if getGameTime():getMinutes() % 15 then
-- do something every 15 minutes
end
end

Events.EveryOneMinute.Add(checkTime)

#

EveryOneMinute will call your function every in-game minute, and your function then checks the minute to determine if it's a multiple of 15 or not

primal remnant
#

OH! I've seen this! How much overhead will this introduce? Are there a lot of functions getting called?

sour island
#

assuming getMinutes() is in fact the of hour minutes

sour island
primal remnant
#

So don't use Events.Tick.Add(MyStuff)

sour island
#

I'm saying don't worry about it

primal remnant
#

Ok lol

bronze yoke
#

you can definitely write bad code that lags the game, but it won't generally be because of using a spammy event (though avoid them if it's easy to)

sour island
#

EveryOneMinute is triggered in Tick, it's actually doing something similar with counting seconds passed

#

There's also a EveryTenMinutes event

#

if 15 is negotiable

primal remnant
#

Now lets say I do that addition of an event. Can I have the function remove the event at a certain point?

local function checkTime()
    if getGameTime():getMinutes() % 15 then
        -- do something every 15 minutes
    end
end

Events.EveryOneMinute.Add(checkTime)
Events.EveryOneMinute.Murder(checkTime)

Maybe introduce a function that checks every ten minutes and then removes the checkTime event?
I'm assuming there's no rule to using Events.EveryOneMinute.Slay(checkTime) inside a function.

bronze yoke
#

yeah, you can Remove() them from the event

primal remnant
#

local Murder = "Remove"
Events.EveryOneMinute.Murder(checkTime)

I like dis one better.

#

Thank you both for the assist. I think I can probably figure it out from here with minimal face into wall smashing.

nimble spoke
#

Do worry about what you add to these fast events. It isn't hard to throw a dart in the workshop and hit a popular mod that causes performance loss due to these things

primal remnant
#

@nimble spoke

#

And yes indeed. I'm going to try and use comparison values.
Get the game time, and then do a check about an hour later to see if the time increased enough.

nimble spoke
#

That is easy to do

primal remnant
#

I was hoping to help a friend out with a stim mod that would gradually increase health, but I'm thinking I'll adjust the healthFromFood or some other such health restoration value and then change it back after a time.

bronze yoke
#

one thing i'll caution about removing functions from events is that if you remove a function from an event while that event handler is executing (the most common case of this being the function you added to the event removes itself) it causes issues

#

it usually doesn't really matter if it's an event that gets spammed like ontick but if it's something that only gets called once or every now and then it can cause difficult to diagnose compatibility issues

primal remnant
#

I should maybe do a % check that gets a different value?
Have the event add when gameMinutes % 15 == 0, and then remove when gameMinutes % 15 == 3, for example.

bronze yoke
#

it's still going to be happening during the handling of EveryOneMinute either way

primal remnant
#

Good point.

nimble spoke
primal remnant
#
  1. Check to see if an event should be "active". Add event if so. Avoid using the EveryOneMinute to eliminate removing an active function.
  2. Let event run and then use a check to see if it should be removed. When it returns true, remove the event at an interval that can never overlap.

Would I find the Event.EveryOneMinute file in the media\lua folder or the java code?

bronze yoke
#

events are java

red tiger
#

Hmmm... Not really feeling like modding PZ much these days.

#

Going to see if I can at least get this VSCode extension to a point where I want it.

trim mist
#

Hey y'all, so you know this guide to decompiling PZ? (https://github.com/Konijima/PZ-Libraries) Decompiling it was failing with the error

Unable to find method 
''org.gradle.api.tasks.JavaExec io.pzstorm.capsid.zomboid.task.ZomboidVersionTask.setMain(java.lang.String)'' 'org.gradle.api.tasks.JavaExec io.pzstorm.capsid.zomboid.task.ZomboidVersionTask.setMain(java.lang.String)'

and modifying the gradle-wrapper.properties file with distribution URL fixed it for me:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-rc-1-all.zip

#

Gradle 8.0 seems to mess with it

timber river
red tiger
#

I've modded PZ for 10 years and I haven't used any of these guides.

#

Use fernflower CLI or use IntelliJ IDEA's wrapper plugin for it.

#

(Coming from the guy who has the most released Java patches and most time spent modding the Java side in PZ)

bronze yoke
#

the tools the guide points you to are supposed to do some automatic annotation stuff, but i'm starting to question if they're actually any good

red tiger
#

I'd argue otherwise, even with a close friend making one of the guides.

#

It's not useful if your goal is to read into the Java alone.

#

Along with my documentation in PipeWrench, TIS has updated their official JavaDocs, rendering the vast majority of decompile purposes void.

#

If you simply need to know what's going on, import the .class files as a packaged zip file renamed to .jar and double-click the class in the library tree for it when referenced in a IntelliJ IDEA project.

#

Automation here is redundant.

bronze yoke
#

i'm not sure why but it fails on some lua files (and i think java files? but not as sure about that one) so you end up working with incomplete libraries

red tiger
#

Even then it's not needed by 95%+ of the time.

#

I know how to fix this issue yeah, but that's because I'm on the fringe with Java work for PZ.

bronze yoke
#

the type documentation is the only benefit i'm seeing - though inheritance isn't implemented so it's limited in usefulness

red tiger
#

There's use beyond documentation.. when you use TS to code.. Nothing much past that if only referencing.

#

Intellisense is a ride.

bronze yoke
#

yeah, i'm still not yet willing to switch to typescript but i might drop the libraries if i'm going to spend all my time crawling the javadoc and the source anyway

red tiger
#

If I had one benefit to suggest as a reason to switch, it'd be compiler-time errors.

#

Migrating a major build might show this feature the best.

#

API changes would render b41 code broken.. Finding and fixing these errors would take a bit of time manually.

#

Compiler errors shows them right away. Fixing them would be referring to the intellisense present as well.

#

I'd be working on improving PipeWrench right now if I wasn't working on the VSCode extension for ZedScript.

#

That takes precedence since the majority of modding is scripts.

#

It's also fun to note that I am the only support for ZedScript as of right now.

bronze yoke
#

i often forget that, with my experience being so code heavy

red tiger
#

With a functioning support extension in VSCode, all you'd need to do is point people that direction instead of redundantly answering the same question every so often.

bronze yoke
#

honestly all you need to do is get it to check commas and it'll solve 80% of the issues posted here

red tiger
#

Working on the linter.

#

I had to throw a thousand or so lines of code from the first attempt however the 2nd attempt seems promising

#

The fun thing about the linter is instead of only defining what is valid syntax, I have to check for all invalid syntax situations, or as many as I can.

#

In this linter I:

  • Remove all whitespace, newline, and comment tokens to only have syntactic and phrased tokens.
  • Define rulesets for scopes
  • Define rulesets for properties
  • Define patterns for properties
  • Define the patterns for scopes
#

Working on the extension has helped me understand how to implement full language support for IDEs and rich text editors.

#

Crazy.

#

The good thing is that ~75 or so people are using the extension right now. Hopefully it'll help solve problems for people before they come here.

#

=)

#

I'm surprised that up until this point there have been no attempts (no known attempts), to address this issue of no support for scripts in IDEs and rich text editors.

red tiger
#

{}

#

I check for that and commas

magic edge
#

I'm trying to alter the unhappiness/boredom of different foods dependent on a trait. My current approach is like so:

local base_tooltip_render = ISToolTipInv.render

function ISToolTipInv:render()
    local origUnhappyChange = self.item:getUnhappyChange()
    local origBoredomChange = self.item:getBoredomChange()
    
    if self.item:IsFood() then
        if getPlayer():getTraits():contains("example") then
            self.item:setUnhappyChange(1000)
            self.item:setBoredomChange(1000)
        end
    end
    
    -- Call original function
    base_tooltip_render(self)    

    -- Reset item
    self.item:setUnhappyChange(origUnhappyChange)
    self.item:setBoredomChange(origBoredomChange)
end

I have a similar wrapper around ISEatFoodAction:perform. This mostly works, but there's a lot of subtle bugs and I keep running into specific food items where there's some discrepancy between getUnhappyChange and the real value so it causes the value to shift continuously every time ISToolTipInv:render is called. Is there a better way to do what I'm trying to do?

bronze yoke
#

is this value shift some minor decimal thing or more significant than that? i'm not sure if you're describing some java->lua conversion inaccuracy or an actual bug

magic edge
#

signif climb toward negative numbers. it's like during the reset lines it overcorrects

bronze yoke
#

and this only happens for certain items? that's really strange

magic edge
#

my actually code is a bit messier than the example I gave. might be a bug hiding in plain sight. that aside, is wrapping those two functions generally the right way to accomplish what I'm trying to?

bronze yoke
#

yeah, that's usually the only way

#

changing the actual stats of the item is unfortunate but doesn't seem avoidable here

#

my guess is the bug is in part of the code you didn't include, or it's haunted

foggy lion
#

Hello ๐Ÿ‘‹

I'm interested in making an add-on pack for the Ellie's Tattoo mod. These instructions are included in the mod files. It looks fairly straightforward, buuuuut I have no background whatsoever in coding or modding, so I'm not actually sure what these instructions are telling me.

Could anyone point me toward somewhere I could go/someone I could talk to/something I could read to give me some very basic understanding of how to get started with this?

modern hamlet
#
ISTimedActionQueue.clear(player)

Does this force to cancel the currently playing action? If not, How can I force it to cancel if there is an action playing?

gaunt meteor
#

the guid you generate you use for each tattoo, keep the same guid of that tattoo across the XML and lua files

#

anyway..

#

Im trying to get a mod working to create "zones" of no zombie spawn.

    local zData = zombie:getModData()
    local square = zombie:getSquare()
    
    local NoZedSq = isNoZedSquare(square)
    if NoZedSq == true then
        zombie:removeFromWorld()
        zombie:removeFromSquare()
    end
end

Events.OnZombieUpdate.Add(onZombieUpdate)

^ this is a bad method im hoping for some tips. currently the zone creation works, but the zombies inside the zone just flash in/out of the game

#

I dont neccesarily need to remove zombies, I just need the zone to stop respawn of the zombie

#

(while still respawning zombies as normal, outside of the defined zone)

#

maybe if there is a way to get the zone to count as "seen"? Because I have it set to no zombies on seen chunk

ancient grail
#

I have e an idea for an api but not sure if its worth it or if actually is useful
The idea is to add a checkr that sees if its lagging idk how exactly but maybe the fps since thats expose afaik

Then if it's lagging then dont run the function

if isLagging() then return end ```
#

Maybe useful for loops that only does visuals

red tiger
#

No API like this for lag will ever work optimally and the implementation wouldn't make sense.

ancient grail
#

It would if im making every zed skin change ontick as an animation
So basically the skin is animated

red tiger
#
local timeThen;
local timeNow;

function onTick()
    -- Calculate Delta.
    timeNow = getTimestampMs();
    timeDelta = math.ceil(timeNow - timeThen);
    checkLag(timeDelta);
    timeThen = timeNow;
end

function checkLag(timeDelta)
   if delta >= 1000 then
      -- If greater than one second (1000ms), handle. 
   end
end
#

Simply saying there's lag with a boolean-implementation will never be enough.

#

Use integer-based delta timestamps.

#

What I would suggest is that PZ's Java code would send the delta to the function so you won't need to calculate it.

#

This is how you'd do it.

sour island
#

As like an added return?

#

return ..., funcRunTime

red tiger
#

more like:

Events.OnTickEvenPaused.Add(function(timeDelta)
  -- ...
end);
sour island
#

os.clock isn't exposed right?

red tiger
#

os.clock doesn't exist in Kahlua IIRC.

sour island
#

Was it removed or is it cause PZ uses an older Lua?

red tiger
#

You can get the UNIX timestamp value from the PZ API.

sour island
#

Oh nice

red tiger
sour island
#

I wonder how difficult it would be to recreate the Lua testbed within PZ

red tiger
#

getTimestampMs()

red tiger
#

They have a very modified copy of Kahlua2.

#

The engine itself can be optimized, quite a bit actually..

#

It was developed during the JDK 1.6 era.

sour island
#

I mean, I can't speak to TIS' priorities but Im sure updating the Lua is in there somewhere

red tiger
#

I have an archived fork of Kahlua2 where I updated the reflection invocation calls with some benchmarks...

#

But that was JDK 1.7 / 1.8 optimizations. We're at Java 18 ATM.

sour island
#

Isn't 1.7/1.8 = 17/18?

red tiger
#

No.

#

There are 10 major versions between 1.8 and 18.

#

Java 18 is also 1.18.

#

I also believe that around JDK 1.9 the major versioning standards changed.

#

A lot of people still use JDK 1.8 because Oracle's licensing for using java for commercial products changed around 1.9 / 10.

#

I wonder if it changed again after.

sour island
#

O

#

I guess I misunderstood JDKs versioning pretty bad

red tiger
#

My knowledge might be dated.

#

That's how I remember it.

sour island
#

I have no clue lol

#

I've used Java 1.8 and JDK 18 in the intelliJ library compiler

#

And was told it's interchangeable but maybe they meant compatability wise

red tiger
#

IIRC TIS's Kahlua2 fork has serialization / deserialization & enum changes.

sour island
#

New mod idea: Make a battle royale mode utilizing steam remote play / co-op to create a match of 100 teams of 4.

upbeat spindle
#

anyone who has any idea on how to make a custom mug (i.e. make an entirely new item entry, not just a reskin on spiffomug) and make it have all the same features as a normal mug?
i can't for the freaking life of me figure out how to make the evolvedrecipe -thing for beverages work

sour island
#

That's one of the pitfalls of the current script system -- buuut, if there are tags for Mugs the recipes might use those.

upbeat spindle
#

so the answer is "no, coffee isn't possible for custom mugs, unless i dedicate 2+++ weeks to rewriting entire zomboid recipe system" ?

sour island
#

Do mugs have a 'Tags=' ?

upbeat spindle
#

They do. Coffeemaker.

#

I took the vanilla mug itemscript and tried just replacing the models in it, but I'm missing something somewhere.

sour island
#

Youd have to post what you have

upbeat spindle
#

item MugCustom { DisplayCategory = Cooking, Weight = 0.2, CanStoreWater = TRUE, Type = Normal, DisplayName = Empty Custom TestMug, ReplaceOnUseOn = WaterSource-WaterMugCustom, Icon = MugCustom, RainFactor = 0.2, Tooltip = Tooltip_item_RainFromGround, StaticModel = MugCustom, WorldStaticModel = MugCustom, Tags = CoffeeMaker, }

sour island
#

They are apparently looking into variants to items next few updates though

#

What's the recipe for coffee?

upbeat spindle
#

hold on

After defining in a similar manner also water etc filled versions, I also include this line to the same script.txt file

#

evolvedrecipe HotDrinkCustom { BaseItem:WaterMugCustom, MaxItems:3, ResultItem:HotDrinkMugCustom, Cookable:true, AddIngredientIfCooked:true, AddIngredientSound:AddItemInBeverage, Name:Prepare Beverage, CanAddSpicesEmpty:true, }

#

Both of the abovementioned snippets are verbatim, one-to-one, taken from the basegame mug files, with just some name replacements here and there to point to the custom mug

sour island
#

The worst case scenario is you'll have to add a script for each state the mug and coffee can be in

upbeat spindle
#

Yes, I'm already having mental damage from that thought

red tiger
#
Hello, world!
sour island
#

Can you post the vanilla scripts too?

#

What is the result that is occuring?

upbeat spindle
#

what result?

sour island
#

Like what is happening with your mod

upbeat spindle
#

I get mugs that work fine in terms of filling them with water and showing the custom models properly, as well as drinking the water -- tooltips work fine, all that is missing that i'm aware of is the recipe to make a beverage

sour island
#

There is an old recipe called hotCuppa

#

That I hope is now depreciated

upbeat spindle
#

For your comparison, the basegame mugl:

item Mugl { DisplayCategory = Cooking, Weight = 0.2, CanStoreWater = TRUE, Type = Normal, DisplayName = Empty Cyan Mug, ReplaceOnUseOn = WaterSource-WaterMug, Icon = Mugl, RainFactor = 0.2, Tooltip = Tooltip_item_RainFromGround, StaticModel = Mug, WorldStaticModel = Mug, Tags = CoffeeMaker, }

sour island
#

But it may not be

upbeat spindle
#

So is the evolvedrecipe blablabla just nonsense distraction, or not? ๐Ÿค”

sour island
#

That might be used for teas

#

Have you tried heating your mug of water in the microwave?

upbeat spindle
#

No, for I am trying to make this goddamn survivor pour some coffee from the goddamn coffee-item into the mug, which works fine for basegame mugs even if the water is cold

#

(all the goddamns are sourced from my frustration at this code, dont take it personally please)

sour island
#

What does the item turn into when you add coffee to the base game mug

#

It may be the hotCuppa item still

upbeat spindle
#

HMM, now we're talking, this one I don't remember verifying -- wait a sec

sour island
#

The recipes and crafting are part of one of the next big update - so hopefully the tags system and evolve recipes get broader scopes

upbeat spindle
#

nope, no hot cuppas

#

looks like the evolvedrecipe -stuff to me

#

!!

#

A-HAA

#

Is this the source

#

item Coffee2 { DisplayName = Coffee, DisplayCategory = Food, Type = Food, Weight = 1, Icon = InstantCoffee, ** EvolvedRecipe = HotDrink:5;HotDrinkRed:5;HotDrinkWhite:5;HotDrinkSpiffo:5;HotDrinkTea:5,** FoodType = Coffee, Packaged = TRUE, FatigueChange = -50, HungerChange = -30, ThirstChange = 60, UnhappyChange = 20, Calories = 2, Carbohydrates = 0, Lipids = 0, Proteins = 1, WorldStaticModel = Coffee, }

#

Do I actually need to change the freaking coffee -item whenever i add a mug :D:D:D

#

What the fudge is the tag even there for

sour island
#

I assume it's one of the oldest recipes, and probably one of the first evolved recipe

#

So yes, you'd have to use scriptManager to modify it safely

#

Unfortunate

#

Or you could create a secondary Coffee item

#

With evolved recipe pointing to yours ๐Ÿ˜…

tawdry solar
#

could somone please help me with my code

#

ive been tryna fix it for a week or 2

#

and noone could help

frank elbow
#

Do you have a more specific question?

upbeat spindle
#

What's a scriptManager

tawdry solar
#

like the item

frank elbow
#

Doesn't spawn, or doesn't appear in the item table in debug either?

frank elbow
#

Have you checked console.txt

tawdry solar
#

i havnt started dist yet

tawdry solar
frank elbow
#

I believe it's in your User folder within a subfolder called Zomboid

#

It's a text file called console.txt

tawdry solar
#

alrightt

#

what am i looking ofr

frank elbow
#

Errors

#

You can try searching for "error"

tawdry solar
#

needa start the game first

frank elbow
#

If you don't see anything relevant, a good next step is posting your item script here so people can see whether there's anything off

tawdry solar
#

no error

#

do i post my code

nimble spoke
#

@upbeat spindle Right now you would need to create a new evolved recipe that uses your item, then add it to all ingredients for that evolved recipe, but as Chuck said b42 may bring changes so it isn't the best of times to work on that idea

#

Evolved recipe system doesn't use the tags

upbeat spindle
#

no can do, the mug demands to be made

#

and i must suffer

#

how does one change entries in basegame scripts?

tawdry solar
#

shit anyone remember the size of icons?

upbeat spindle
#

i.e. items_food.txt , if I want to replace the coffee2 definition here -- is it even doable

upbeat spindle
nimble spoke
tawdry solar
nimble spoke
sour island
#

Whoops discord didn't update

upbeat spindle
#

Hmm, so mmmmaybe something like this?

local scriptItem = ScriptManager.instance:getItem("Base.Coffee2")
if scriptItem then
    scriptItem:DoParam("EvolvedRecipe = HotDrink:5;HotDrinkRed:5;HotDrinkWhite:5;HotDrinkSpiffo:5;HotDrinkTea:5;[CUSTOM MUG RESIPPY HERE]")
end
sour island
#

Oh, I didn't evolved recipes don't use tags

#

That'd explain it

#

Do evolved recipes offer anything more than the tag system?

upbeat spindle
#

evolvedrecipe HotDrinkCustom
{
BaseItem:WaterMugCustom,
MaxItems:3,
ResultItem:HotDrinkMugCustom,
Cookable:true,
AddIngredientIfCooked:true,
AddIngredientSound:AddItemInBeverage,
Name:Prepare Beverage,
CanAddSpicesEmpty:true,
}

sour island
#

Seems like tags and onCreate() are more versatile

bronze yoke
bronze yoke
upbeat spindle
#

I.e.
local scriptItem = ScriptManager.instance:getItem("Base.Coffee2")
if scriptItem then
scriptItem:DoParam("EvolvedRecipe = [CUSTOM MUG RESIPPY HERE]")
end

?

bronze yoke
#

yeah

upbeat spindle
#

Okey, so each parameter definition in basegame files adds a separate entry per each input separated by semicolons ( ; )

bronze yoke
#

EvolvedRecipe isn't actually a property that is stored on the item, it's handled as soon as the game reads the script/doparam, so you won't overwrite anything from vanilla by doing that

upbeat spindle
#

Surprisingly the entire frigging game crashes when I try to edit Coffee2 by replacing all of it via script that is almost entirely equal to the basegame coffee :-D

#

::::::---DDDD

#

So it looks like that aint an option

#

DoParams it shall be, hope this works

sour island
#

Or similiar

bronze yoke
#

evolved recipes work pretty well for the whole 'build your own sandwich' stuff but they basically never make sense outside of food (and were never meant to)

upbeat spindle
#

I want evolvedrecipes for gasoline and sugar

nimble spoke
upbeat spindle
#

nnnope, but this time it didn't crash the entire game either

#

should i have a specific name for the script lua -file for this to work ๐Ÿค”

nimble spoke
#

No specific name, but you should place your file inside the shared folder

upbeat spindle
#

ahaaa my file was accidentally .txt

#

yeah, ty, its in shared ๐Ÿ‘

patent lichen
#

Anyone here familiar with the exercise fatigue system?

upbeat spindle
#

grkngrkhmn so what else does the luafile need than these lines

local scriptItem = ScriptManager.instance:getItem("Base.Coffee2")
if scriptItem then
    scriptItem:DoParam("EvolvedRecipe = HotDrinkMugCustom:5")
end
#

I'm like 15000% sure that this is an improper way of adding this recipe there

sharp flint
#

jokes on you, im 15001 sure!

bronze yoke
#

that seems correct

upbeat spindle
#

theres no jokes only violence pain

#

how goddamn hard can it be to teach a goddamn survivor to open a goddamn instant goddamn coffee can and pour it into a goddamn mug that aint red or cyan

bronze yoke
#

oh great news! evolved recipes only work in the base module tired

upbeat spindle
#

:::::::::::D

nimble spoke
#

Did you create that evolved recipe? Sorry if I missed that part

bronze yoke
#

if your evolved recipe isn't in base you'll have to move it there

upbeat spindle
#

guess where my evolvedrecipe aint ::::D

#

in the base :::D

#

thanks a ton!

sour island
#

You should also not overwrite the param like that

bronze yoke
#

it doesn't overwrite

#

EvolvedRecipe is not saved

#

it's acted upon immediately when the parameter is read

sour island
#

Oh?

bronze yoke
#

when it reads that parameter it adds itself to the recipes' items list

#

so evolved recipes work backwards... backwards

sour island
#

Was the timeline: recipes, evolved recipes, tags?

#

Feels like a fork of the code

upbeat spindle
#

allright ---- now even the basegame mug aint working

#

i'm starting to wish for a lobotomy

bronze yoke
#

what does the error say?

upbeat spindle
#

"15" "16" "17"

#

where do these errors even go ๐Ÿค”

bronze yoke
#

if you're in debug mode they go into an ingame console

#

otherwise console.txt

upbeat spindle
#

Hmmm... am I using wromg itemdefinitions after all

#

something null pointer, I'm starting to think I've been misled by "hot drink" -items

#

no, it cant be, basegame evolvedrecipes point to hot drink -items pain

sour island
#

What is the actual error?

#

Null pointer just means you're trying to access something null

#

Also I wrote a mod 'errorMagnifier' that makes the errors a bit easier to copy paste

upbeat spindle
#

to me it seems like this is a symptom of something else than the resultitem not being defined: it breaks also the basegame items

#

Unless the recipe searches only for the base module for the items, and doesnt find all of them there

#

I'm gonna punch a wall if this is the solution

bronze yoke
#

it just keeps the item's name as a string at this point so that shouldn't be it

upbeat spindle
#

Moving the newly added recipes and mugs to the base-module fixed the basegame mug, but not the custom mug :D

#

:D:D:D:D:D:D

#

im gonna punch a wall anyways

#

do i need separate files for custom evolvedrecipes?

#

i'm entering all these in a single file now

ancient grail
#

``

--this is how you do discord lua codeblock

``
@upbeat spindle

bronze yoke
#

it shouldn't really matter how your scripts are distributed

upbeat spindle
#

good.

nimble spoke
upbeat spindle
#

is it possible that my character doesnt know the recipe for some frigging reason?

nimble spoke
#

not possible

upbeat spindle
#

yeah, it isnt: debug-mode set all recipes known doesnt fix it

nimble spoke
#

if the vanilla mug recipes are not working you probably broke the ingredients or the evolved recipes themsevles

upbeat spindle
#

the vanilla mug recipes are working

sour island
#

I feel like tags have been around just not really used

upbeat spindle
#

is there a length limit in item / recipe names that break it?

bronze yoke
#

the problem is tags are least useful to tis in comparison to anyone else

nimble spoke
sour island
#

I feel like it scales just as well for TIS

golden apex
#

this works in debug mode but i cant get it to work in normal single player not in debug mode?

sour island
#

There's still a few mechanic UI stuff that's hard locked but otherwise it checks for tags

golden apex
#

what is the regular player referred to as in reference to player:getAccessLevel()?

bronze yoke
#

None iirc

nimble spoke
neon bronze
golden apex
#

well a guy in here made it for me but it wasnt working as inteded and i didnt wanna bug him anymore so i was trying to edit it

#

oh thats him right there lol

#

it works perfectly in debug mode in singleplayer i just need to remove that restriction

neon bronze
#

i figure its something with the sendToServerCommand

nimble spoke
neon bronze
#

whats the string for the accesslevel if you are admin?

#

is it administrator?

#

i looked at the java code and those were the lines

nimble spoke
#

yes but you said it isn't working in single player, in that mode you will not have admin access and that is the issue

neon bronze
#

no it works in sp

#

it doesnt in mp

golden apex
#

it only works in sp in debug mode

sour island
#

Are you guys admins

neon bronze
#

well it should be only accessible for admins

sour island
#

That was not what I asked lol

bronze yoke
#

it should be accessible either way if you're in debug mode

neon bronze
#

that too

red tiger
#

PZ needs an interactive GUI for recipe progress.

#

Would love a journey / progress tree map.

upbeat spindle
#

"it cant be that hard to add one mug into the game"

#

oh past me, you sweet summer idiot

sour island
#

That's a very specific case tbh

#

Unlucky for you

neon bronze
#

we'll try with ```lua
if isAdmin() or getAccessLevel() == "moderator" or isDebugEnabled() then

upbeat spindle
#

how the fuck is it possible that there is no way to make custom items link to evolvedrecipes :D:D

red tiger
#

Thought getAccessLevel() is now numeric.

nimble spoke
bronze yoke
#

nope, still string

neon bronze
#

is it?

#

i though it'd give you a string

red tiger
#

Lemme check.

neon bronze
#

pretty sure it does

red tiger
#

It's internally a byte.

#

It's a string. (For the API call)

sour island
#

It returns a string

#

Global access level expects lowercase

#

Players expects proper case

neon bronze
#

man.

upbeat spindle
#

looks like i have to fucking hardcode an entirely unique recipe using only my specific item, in a way that bypasses the basegame evolvedrecipe mechanics completely :DS:AD;FG

nimble spoke
upbeat spindle
#

well please enlighten me how this working evolved recipe is not working when it is copypasted from basegame evolved recipes for the mugs, with relevant itemnames changed appropriately and also the relevant "put this in the mug" -items edited

#

i cant for the life of me figure out what there is hidden anymore

bronze yoke
#

if it's in base did you import your module/use the full type for your custom items?

upbeat spindle
#

i moved my items to basemodule

nimble spoke
#

Keep in mind that adding your own evolved recipe includes providing translation entries for a few things, at least in EN which is the language used in case there's no entry for the language you're using at the moment

upbeat spindle
#

w h a t

#

where do you people read this stuff from

#

thats a step forward, thanksssss

bronze yoke
#

surely it still works without them

upbeat spindle
#

maybe it works but it doesnt get updated to the UI

#

next thing to figure is where are these translations ๐Ÿค”

nimble spoke
#

media/lua/shared/Translate/EN/

upbeat spindle
#

ty!

#

literally the one folder i crossed out in my mind because "how can it be a lua script instead of an .xml or .txt" ๐Ÿคฆโ€โ™‚๏ธ

bronze yoke
#

just wait until you find out what file type they are in the lua folder

upbeat spindle
#

EvolvedRecipeName_EN = { EvolvedRecipeName_Base.CannedBologneseOpen = "Canned Bolognese", EvolvedRecipeName_Base.CannedCarrotsOpen = "Canned Carrots", EvolvedRecipeName_Base.CannedChiliOpen = "Canned Chili", EvolvedRecipeName_Base.CannedCornOpen = "Canned Corn", EvolvedRecipeName_Base.CannedCornedBeefOpen = "Canned Corned Beef", EvolvedRecipeName_Base.CannedPeasOpen = "Canned Peas", EvolvedRecipeName_Base.CannedPotatoOpen = "Canned Potato", EvolvedRecipeName_Base.CannedSardinesOpen = "Canned Sardines", EvolvedRecipeName_Base.CannedTomatoOpen = "Canned Tomato", EvolvedRecipeName_Base.Teabag2 = "Tea", }
Aha.

#

Even the basegame evolvedrecipes arent in the obvious file, but instead some goddamn canned foods

red tiger
#

xD

upbeat spindle
#

googling on proper custom evolvedrecipes bring basically nothing, "yayyy"~

nimble spoke
#

check Recipes_EN

#

and ContextMenu_EN

upbeat spindle
#

!!!!!

#

ContextMenu_EvolvedRecipe_HotDrink = "Beverage",
ContextMenu_EvolvedRecipe_HotDrinkRed = "Beverage",
ContextMenu_EvolvedRecipe_HotDrinkWhite = "Beverage",
ContextMenu_EvolvedRecipe_HotDrinkSpiffo = "Beverage",

#

<3

#

<3<3<3

#

still not working :::D

#

after adding the appropriate line to this file, that is

drifting ore
#

How can I make a code recognise a weapons attachment?

#

``
local scoped = 0;
local inv = player:getInventory();
local weapon = inv:getFirstTypeRecurse("VarmintRifle");
local attachment = weapon:getAttachmentType("x8Scope");
if attachment then
scoped = 5;
end
print(scoped)

``

upbeat spindle
#

... :D I went and downloaded some cooking time -mod, and looked through it, didnt figure out what the frick am I still missing, thought I should ask the modder for pointers

#

And lo and behold if it isnt "Soul Filcher's Cooking Time"

#

I guess I'm beyond help then

#

didnt imagine a simple fucking mug would turn out to require a phd in zomboid programming

#

Okay so SoulFilcher also modifies coffee. Via DoParam:
manager:getItem("Base.Coffee2"):DoParam("EvolvedRecipe".." = ".."HotDrink:5;HotDrinkRed:5;HotDrinkWhite:5;HotDrinkSpiffo:5;HotDrinkTea:5;Muffin:5");

What if I edited my own DoParam to match this exact syntax...

bronze yoke
#

is that exactly how it's written? there shouldn't be any difference between concatenating three hardcoded strings and just using one, except performance

upbeat spindle
#

some shorthands and a function definition above it:

local manager = ScriptManager.instance

function SFCook_Tweaks()

manager:getItem("Base.Coffee2"):DoParam("EvolvedRecipe".." = ".."HotDrink:5;HotDrinkRed:5;HotDrinkWhite:5;HotDrinkSpiffo:5;HotDrinkTea:5;Muffin:5");

edgy sparrow
#

hi guys, im looking for an exemple of lua code that make the x8 scope, even attach to a m16, wont give the m16 any bonus

upbeat spindle
#

aaaand also in the end of the file:
end

Events.OnGameBoot.Add(SFCook_Tweaks)

nimble spoke
nimble spoke
upbeat spindle
#

Yeah, I'm now pivoting to trying to do this exactly as you did in your mod!

bronze yoke
#

events usually shouldn't matter for script edits since scripts are loaded before lua anyway, so nothing scripts can usually do should be unavailable at lua load - but it's worth a try

nimble spoke
upbeat spindle
#

the thing i'm worrying is that your coffee edit involves a basegame item, muffin, whereas i'm trying to smush a custom item into the evolvedrecipes

#

!!!!

#

!!!!!!

#

UAAAAAAAAAA

#

party time

#

!!!!!!!!!!!!!

#

\o/ \o/ \o/ \o/\o/ \o/\o/ \o/\o/ \o/\o/ \o/

#

after eight (8) excruciating hours, the mug is DONE

#

thanks to everyone who helped, my crumbling sanity needed each and everyone of you

#

praised be soulfilcher who made the resippy mod

nimble spoke
#

๐Ÿ‘

upbeat spindle
#

the solution indeed was to insert a function, in which the DoParam blablabla is handled, to Events.OnGameBoot

sour island
#

Nice

#

Since evolved recipes are handled so differently maybe they can't be handled preboot or in Lua execution

drifting ore
bronze yoke
#

getWeaponPart takes a string argument

topaz maple
#

Hey everyone. Need some help figuring out how to create a .pack file. Whenever I try to create one, TileZed is giving me an "error creating .pack file" ( couldn't pack ..)
If anyone can help I would greatly appreciate it. Thank you

drifting ore
topaz maple
#

Yes I saw one of his video, was following but when it came to the files under ".tiles files" he already had files there that I don't have so I thought I might be missing something

peak fractal
#

Heyo... 2D/3D artist/game dev here; long time PZ player, but looking to get into modding some cool things. Looks like I gotta spent some time going over all the guides, hey. ๐Ÿ˜…

#

Going over what people say, and what I read, I'm gathering there's a lot of inside quirks and behaviors that only experience can teach.

upbeat spindle
#

the .tiles -files are unnecessary for making .pack -files, or at least I havent needed it

#

Maybe your chosen folder includes some files that are not properly defined? Try perhaps putting a basegame spritesheet into the folder, and only that, and then try packing it

strange saddle
#

anyone here that is willing too make a mod with me ill pay of course if its not too pircy XD

topaz maple
#

so this is what I get everytime I try to create it so I think you might be right. My tiles might not be properly defined

topaz maple
upbeat spindle
#

Besides that, I've no idea.

topaz maple
upbeat spindle
#

Cheers, gl!

lone nest
#

Hello everyone! I'm trying to get into PZ modding and learning LUA along the way.

My 1st objective is to figure out the best way to debug things in PZ.

#

^ I couldn't find the number to keys on the wiki, so I created it on github.

#

My question is, how can I create a text file via the PZ LUA or Java API?

I am getting quite lost in console.txt and would prefer writing logs to mod-specific text file for debugging purposes.

neon bronze
#
local file = getModFileWriter("player_coords_online", "/media/players/player_coords.txt" , true, true)
file:write("Hello World\r\n")
file:close()
#

thats how you can write to a file that is in media/player/ through lua

#

that is an example taking from my mod where i use it

lone nest
#

@neon bronze thanks! I am going try it locally now

neon bronze
#

1st is the mod id, second is the path, 3rd is i dunno, 4th is if appends to the file if false it'll overwrite it

#

also it will create the pathing if it doesnt exist together with the file

#

come to thing of it you could repackage probably a mod like that

sour island
#

Good good, modders starting out using GitHub

ancient grail
lone nest
#

Yeah, LUA is a PITA so far... I'm trying to figure out try-catch blocks so bad code aren't executed and an error is written to a text log file instead.

#

that being said, does pcall() actually work?

bronze yoke
neon bronze
#

Thats true

lone nest
#

it's good enough for my purpose currently, I don't intend to ship the debugger output / logs with what I'm planning.