#mod_development

1 messages Β· Page 486 of 1

nimble spoke
#

postbox is for the boxes in front of houses. I've been using that one since build 40 without problems

undone elbow
#

How to change mod loading order using Lua?

sour island
#

Shouldn't as we use the old emitter system - what sounds are you referring to?

sour island
undone elbow
#

Basic mod order is set in mods/default.txt.

sour island
#

Oh?

undone elbow
#

I'd like to know how to change it using Lua.

sour island
#

Ahh

#

That would be a great ability for players and some modders

#

There's a file writing function

undone elbow
#

That function has access to Lua folder only.

#

Or am I wrong?

sour island
#

Let me double check my config thing

#
local configFile = "media/config/"..modId..".config"		local fileReader = getModFileReader(modId, configFile, false)		if fileReader then
#

I use this for writing config files -- I mostly took apart and modified config stuff in sandbox+

#

But if media/ is stated then you could probably write in the same directory that media is inside

#

Which I think is contents?

#

But this would be the mod's folder... Idk if it can reach the game's

undone elbow
#

I think it's C:\Users\user\Zomboid\Lua

#

Your "media/config/" should be there...

weary matrix
#

Hi, I made my own spritesheet and loaded it in the game through my mod. How can I draw my new tiles from Lua?

sour island
#

Also isn't it media/lua

swift shadow
#

Could be something else as well, I still need to do further testing.

#

Sorry for the late reply, was afk.

#

Huh, testing it further with only EHE that doesn't seem to be the issue. My apologies then for the trouble.

sour island
#

No worries - if EHE does cause issues even with other mods I'd be curious to check out any fixes.

dry chasm
# undone elbow How to change mod loading order using Lua?

just a guess, though you may be able to do that via

local currentGameMods = ActiveMods.getById("currentGame"):getMods(); -- or "default"
local myModIndex = currentGameMods:indexOf("myModID");
if myModIndex < currentGameMods:size()-1 then
  local item = currentGameMods:remove(myModIndex);
  currentGameMods:add(item);
  manipulateSavefile(saveFolder, "WriteModsDotTxt") -- get saveFolder somehow from somewhere for current save or inject into ModSelector? unsure.
  -- if default then:
  -- saveModsFile() -- ?
end

Infos for "example" taken from ProjectZomboid\media\lua\client\OptionsScreens\ModSelector.lua

frail brook
#

Hi, everyone. I'm looking for partner who is good with coding / scripting in PZ and can help with this, idk how to describe it... module based weapons mod ?! Where the "real" gun is only receiver and all other parts are only added as "mods" and then ...on top of them... the attachments as well.

sour island
#

Is that not how the guns already work?

frail brook
#

and idk if it's even possible to do in PZ, I almost lost all of my scripting knowledge in PZ after almost half a year brake. If you are interested, please DM me.

radiant ginkgo
frail brook
radiant ginkgo
frail brook
radiant ginkgo
frail brook
sour island
#

There are weapon attachments actually

frail brook
sour island
#

I know it goes upto 6 types, I'm not sure if you can add more types

#

Barrels and stocks too

frail brook
#

can you mount attachment (supressor) on top of attachment (barrel) ?

sour island
#

Depends if you can add more attachment types to weapons

#

I wanted to look into this for combining melee weapons

craggy furnace
#

yes you can

#

you just attach it adjacent

#

blackbeard has a tutorial

sour island
#

Are you stuck to the 6 types that are listed under weapon's variables?

craggy furnace
#

1 sec

frail brook
#

the problem is there are 6 ( one base) essential weapon parts to just build vanilla weapon without laser/flashlight, sights , rails, grips and etc.

craggy furnace
#

blackbeard has bits and pieces

#

he has more or less the read out

frail brook
# craggy furnace blackbeard has bits and pieces

Thanks, I will check it out. But, I do have really hard time to get back into PZ scripting since I'm also busy with other project. That's why I'm looking for partner who has experience with it. I just didn't want to my idea and models to go waste. There are tons of helmets, food and armor ( I couldn't really figure out clothing) that I made for pz but never finalized it.

weary matrix
#

When I add a tile to a square like this:

        local sq = grave:getSquare()
        local name = 'spear_traps_01_8'
        local tile = IsoObject.new(sq, name)                                                         
        sq:AddTileObject(tile)
#

how to get a reference to this tile so I can remove it later using sq:RemoveTileObject(tile)

#

I tried to create a new IsoObject with same square and same name, then to remove that object but it's not working

#

I could keep my own reference, but that wouldn't work when you quit and reload your game

kind surge
# weary matrix how to get a reference to this tile so I can remove it later using `sq:RemoveTil...

If you can get a reference to the square at the time you want to remove it, you can call square:getObjects() to get a table of IsoObjects associated with that square. You can then iterate over the list of objects to look for the one you want. If you're using a custom tile name it may show up as the value of isoObect:getName() or isoObject:getSpriteName() or isoObject:getSprite():getSpriteName(). Or at least, that's been my one experience attempting something similar recently.

weary matrix
#

@kind surge I tried to use square:getObjects(), but when I iterate and print obj:getName() or obj:getSprite() or obj:getSpriteName() they all return nil except for the base object on top of which I add my own tile. In my case the base object is ISEmptyGraves

#

do I have to call something like tile:setName() or tile:setSprite() maybe?

#

mind to share your code? πŸ˜„

kind surge
weary matrix
#

@kind surge thx, let me try that

kind surge
marsh cosmos
#

One question for the right understanding. For example, if I wanna create a simple new item with a crafting recipe, do I have to create a new files that are written in the items and recipes schema or do I have to write the information in the existing files?

#

I have 0 experience and this question might be stupid.

craggy furnace
rancid barn
#

oh no

thin hornet
zealous wing
#

So, is there a way to implement a working freezer as part of a vehicle? E.g., say I wanted to make a refrigerated truck with a freezer where the truck bed goes.

craggy furnace
#

yes

zealous wing
#

Say, like, an Ice Cream Truck?

zealous wing
#

Neat.

#

By the way:

craggy furnace
#

noice

#

go nuts with it

#

we dont mind lol

zealous wing
#

πŸ˜„

craggy furnace
#

just credit chuck is all i ask

zealous wing
#

Yiss

#

Hmm, so I extracted the code and applied it to the van above, but I can't quite grox out how to get it to freeze and not fridge. thought it was a matter of temperature at first, but it seems not? Also thought I could change the type from"fridge" to "freezer" but that didn't do anything either:

IceCreamTruckFreezer = {}
IceCreamTruckFreezer.Create = {}
IceCreamTruckFreezer.Init = {}
IceCreamTruckFreezer.Update = {}

function IceCreamTruckFreezer.Create.Fridge(vehicle, part)
    local invItem = VehicleUtils.createPartInventoryItem(part);
    part:getItemContainer():setType("freezer")
    part:getItemContainer():setActive(true)
end

function IceCreamTruckFreezer.Init.Freezer(vehicle, part)
    if vehicle:getBatteryCharge() > 0.1 then
        part:getItemContainer():setCustomTemperature(-1.0)
    else        
        part:getItemContainer():setCustomTemperature(1.0)
    end
end
#
function IceCreamTruckFreezer.Update.Freezer(vehicle, part, elapsedMinutes)
    local temp = part:getItemContainer():getTemprature()
    --print("IceCreamTruckFreezer.Update temp:"..temp)
    local tempMin = -1.0
    local tempMax = 1.0
    if vehicle:getBatteryCharge() > 0.0 then
        if temp < tempMin then
            part:getItemContainer():setCustomTemperature(tempMin)
        elseif temp > tempMin then
            part:getItemContainer():setCustomTemperature(temp - elapsedMinutes / 20)
        end
        --uses 50% of battery charge in 24 hours if the fridge would store items with 150 weight when the engine is not running (but only if items are in the container)
        if not vehicle:isEngineRunning() and part:getItemContainer():getContentsWeight() > 0.0 then
            local energyConsumption = 0.5 * (part:getItemContainer():getContentsWeight() / 150) --scales the energy energy consumption with the weight of the items in the trunk
            VehicleUtils.chargeBattery(vehicle, -energyConsumption / (60 * 24) * elapsedMinutes )
        end
    else
        if temp < tempMax then
            part:getItemContainer():setCustomTemperature(temp + elapsedMinutes / 20)
        elseif temp >= tempMax then
            part:getItemContainer():setCustomTemperature(tempMax)
        end
    end
end
#

Thoughts? I'm worse at lua than I am at modeling, and the documentation I have for PZ doesn't mention refrigeration at all. πŸ˜›

pearl prism
#

Just a scratch on the paint πŸ˜†

dawn lynx
zealous wing
#

lol, I didn't even notice that.

quasi prism
#

you know what mod would be great for zomboid?

#

an scp 3008 mod

autumn sierra
#

true

#

sadly it would be very hard to make because infinite maps aren't possible as of rn

#

so unless someone made an absolutely MASSIVE world then it wouldnt be feasible

#

but i agree it would be a really fun mod

proud fern
autumn sierra
#

true

#

so yes its possible

#

and that repetitive scenery of furniture would make it seem infinite

undone elbow
#

How to insert a string to the list of strings?

#
list:add(str) -- adds to the end only
marsh cosmos
#

@thin hornet perfect, thank you

undone elbow
#

Works like a charm.

zealous wing
#

Almost done with my ice cream mod. just need to do some final touch ups and some QoL stuff.

viscid ivy
#

Heya! I'm having some trouble with a mod I am making where I am trying to simplify engine parts and engine repair

#

To put it simply, I'm trying to make it so 20 condition = 1 part. 1 part = +20% repair.

#

I am having trouble figuring out what I did wrong, I've modded lua before with Factorio and Paradox games but the syntax here is new to me

#
function ISTakeEngineParts.perform()
    ISBasedTimedAction.perform(self)
    self.item:setJobDelta(0)
    local cond = self.part:getCondition();
    local skill = self.character:getPerkLevel(Perks.Mechanics) - self.vehicle:getScript():getEngineRepairLevel();
    local partsGained = math.floor(getEngineRepairLevel / 20)
    local args = { vehicle = self.vehicle:getId(), skillLevel = skill }
    getPlayer():getInventory():AddItems("EngineParts", partsGained)
    self.character:getXp():AddXP(Perks.Mechanics, (partsGained * 3);
end
dawn lynx
viscid ivy
#

Thank-you!

#

I'll test it out

viscid ivy
#
    ISBasedTimedAction.perform(self)
    self.item:setJobDelta(0)
    local cond = self.part:getCondition();
    local skill = self.character:getPerkLevel(Perks.Mechanics) - self.vehicle:getScript():getEngineRepairLevel();
    local partsGained = math.floor(self.vehicle:getScript():getEngineRepairLevel() / 20);
    local args = { vehicle = self.vehicle:getId(), skillLevel = skill }
    self.part:setCondition(0.0);
    local inventory = getPlayer():getInventory():AddItems("EngineParts", partsGained);
    self.character:getXp():AddXP(Perks.Mechanics, partsGained * 3);
end```
#

Didn't work

#

We made progress, though

#

The bar now fills up and completes, but it still produces no parts and doesn't dismantle the engine

dawn lynx
viscid ivy
#

Like this?

dawn lynx
#

Might be easier to find in console if you add some new lines before/after it (print("\n\n\nParts Gained: " .. partsGained .. "\n\n\n"))

viscid ivy
#

Ack
It didn't print in the console for some reason

#

I did find this though

#
ERROR: General     , 1635248367010> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: perform of non-table: null```
#

Right beneath function: perform -- file: ISTakeEngineParts.lua line # 31

#

I want to say thank-you very much for helping and also sorry about all the trouble

undone elbow
#
function ISTakeEngineParts:perform()
#

(fixed)

#

not dot but colon

#

@viscid ivy

viscid ivy
#

Oh dangit

#

Still doesn't work

#

But still, progress

pearl prism
old harbor
#

no it didn't work

#

but thanks anyway

kind surge
zealous wing
dry chasm
# undone elbow How to insert a string to the list of strings?

assuming by the call that it's an ArrayList instead of a table:

list:add(index, str) -- arg 1(number) being the index you want to shove the second arg into
-- will move everything from that index one further and your second arg will now occupy that index in arg 1
pearl prism
#

Does anyone know how I can change gasoline for water for this?

rancid barn
#

I just came up with a mod idea: Bigfoot

pearl prism
#

OMG guys

#

My horse mod is getting so cool

pearl prism
hot patrol
#

idk man the filbuster one looks a lot more realistic.

#

nah but that looks amazing

errant meteor
long meadow
#

Aaron on a horse

grizzled grove
#

that's amazing!

tame mulch
#

hi all! I have a problem with an NPC that I don’t know how to solve more efficiently. NPCs move around the global map along points of interest. These points are represented in the form of a graph. In total, 1000+ points are needed for the entire map. Arranging manually is about 10+ hours. Anyone have any ideas on how to automatically detect these points?

turbid canopy
#

Stupid idea which you've likely already determined but - can AI get an index of loot spawn categories and maybe prioritize ticking 'each' box (then have it weighed against Zombie Spawn + Previously visited checks? (eg: They won't bash their head against a high density zombie area just to get the loot and they'll need to find new pastures once t hey've previously searched an area?)

#

If the map has zombie heatzones + loot tables + cells for areas I'd imagine there is some floating game data you might be able to tap into for navigation
Bearing in mind I got no idea how it works in game data but
You could seperate the map maybe into 'sectors' made up of a number of Cells - the NPCs will try and explore those sectors in an expanding perimeter from say - their location and then base - periodically they could then also perform 'deep' forays to areas of the map (closest to furthest) based upon loot tables to try meet certain needs - if heat zone is too hot - they will withdraw, mark the sector as 'searched' and try another location

#

If that is even remotely viable my thinking is that in reality - People are likely to set up base - and upon setting up their safe zone they're going to have two basic priorities - knowing whats immediately around them - and securing that zone and going out for very specific needs/goods - thus two search types
People are also likely to bug out unless extremely desperate if a situation looks a little too risky, especially if there is theoretically plenty other pastures to explore

grizzled grove
vast quiver
#

Is there such a mod that lets you plaster and/or paint brick walls? My main base is the big warehouse in Muldraugh and there's so much paint stored there and I can't use it haha

hot patrol
#

how can I get zomboid models into blender?

nimble spoke
vast quiver
#

@nimble spoke Oh awesome! I'll check it out, even if it means demolishing a section of pre-made brick and rebuilding it just so I can paint it haha

drifting ore
#

it’s possible to make that ? It would be so nice.

undone crag
#

I thought it was a real screenshot ree

drifting ore
#

Noo πŸ₯²

wet dune
#

Is it possible to replace the zombie animations?

nimble spoke
wet dune
nimble spoke
#

or change the animation xml files that point to the model/anim file

wet dune
#

with a .x?

nimble spoke
#

I think so yeah, but some guys here have been experimenting with FBX, don't know what the result was

wet dune
#

how do I convert fbx to .x?

dawn shuttle
# wet dune how do I convert fbx to .x?

A free way to do this is to download an old version of blender, 2.70 (You can download it here: https://download.blender.org/release/)
Then you follow these steps on how to enable .x import/export (and I believe save as .x but not 100% sure).
https://blender.stackexchange.com/questions/8740/how-do-i-export-an-obj-to-an-x-file

hot patrol
#

are there any good tutorials on making melee weapons? I spent pretty much the whole day on and off trying to get mine to work and it just isn't happening. I can't get the model to be the right size or properly position it for on the ground and on my person.

weary matrix
#

sometimes it fails to convert some models though

#

but isn't zomboid handling .fbx now?

#

I can see a lot of .fbx models in media/models_X/WorldItems/ and in media/models_X/vehicles/

#

@hot patrol if you find one that works, please share! πŸ˜…

hot patrol
#

I've looked but sadly it seems evereything is for either guns or clothing

weary matrix
#

indeed

#

but guns should be the same I think, no?

hot patrol
#

if they are then I'm doing something wrong

weary matrix
#

@hot patrol are you able to see your 3d model at all in the game?

hot patrol
#

yes

weary matrix
#

so it's just a matter of sizing and positioning?

hot patrol
#

yep

#

I got the pose very cle when in the hand but it was totaly broken when on my back or the ground

#

so I think my method was not the right one

weary matrix
#

I tried to make my own melee weapon too, but I wasn't able to go as far as you for now

#

mine was just not showing on screen

#

but I was able to make my own sweatshirt though! πŸ˜„

hot patrol
#

it could have just been so big it didn't render. that happened to me

nimble spoke
#

If it looks right in hand but not on the ground you need the world attachment in the model script. Check a model from a weapon with similar orientation and copy those values for your model

#

as for the back attachment there are lots of options, you're probably using one that is meant for a different model orientation

hot patrol
#

my question is how should i be exporting the model? The way I got it to fit in the players have was by orientating it in a janky way via blender

#

Is that the proper way?

#

when I imported the wood plank which is what I am using as a base it is just stood straight up and is much larger than my model but when I went off that is was giant

#

I know for guns placing you model similarly to how the devs have the vanilla ones works (at least in what I watched)

dawn lynx
#
local function removeWeight()
    local items = getAllItems()
    local sz = items:size()
    for i = sz-1,0,-1 do
        local item = items:get(i)

        if string.find(item:getTypeString(), "Container") then
            item:DoParam("Capacity = 999999")
            item:DoParam("WeightReduction = 100")
        end
    end
end

Events.OnPreMapLoad.Add(removeWeight)
```Info: I have this in the shared folder. It works fine in single player, however, in multiplayer the capacity is only increased on containers I spawn in - even on brand new worlds.

Any reason why this would be happening and any suggestions on how to fix it?? Thank you
weary matrix
#

@dawn lynx have you tried to move that code to lua/server instead?

dawn lynx
#

Don't think it'll make a difference tho as everything else works but worth a shot anyways

weary matrix
#

@dawn lynx I'm not sure but isn't server for multiplayer stuff?

dawn lynx
#

It is - yeah, but shared gets loaded on singleplayer and multiplayer

weary matrix
#

ah ok

lean jay
#

Anyone know which file the random events are in? I'm wanting to check out the code for them.

royal ridge
#

Do you mean meta events?

low yarrow
thin hornet
#

did anyone ever encounter such a bug?
when reloading my script
Events.OnPreFillWorldObjectContextMenu.Add
doesnt call when i right click after
no error nothing
i print before = it show, i print right in it too = doesnt show

print('test 1')
    Events.OnPreFillWorldObjectContextMenu.Add(function(player, context, worldobjects, test)
        print('test 2')
#

it work when i first load the game, if i reload the script then i just get the print(test 1)

hot patrol
thin hornet
#

whoa never encountered such fuckery

#
Events.OnInitGlobalModData.Add(function()
    print("OnInitGlobalModData")
    --instance:initGlobalModData()
end)

Events.OnPreFillWorldObjectContextMenu.Add(function(...)
    print("OnPreFillWorldObjectContextMenu")
    --instance:onPreFillWorldObjectContextMenu(...)
end)

Events.EveryOneMinute.Add(function()
    print("EveryOneMinute")
    --instance:everyOneMinute()
end)

When i reload script and right click: it print EveryOneMinute

#

it's as if the events are switched but that make no sense

#

it might seem like i have to set OnInitGlobalModData after all other event but i could be wrong

fluid lion
#

Who create mod USS Barack Obama?

thin hornet
#

Okay faulty clearly is Events.EveryOneMinutes|EveryTenMinutes.Add(function() if i just comment out this one, every work upon script reload.....
nevermind i have no idea what is going on

thin hornet
#
Events.EveryOneMinute.Add(function()
    print("EveryOneMinute")
end)

Events.OnPreFillWorldObjectContextMenu.Add(function(player, context, worldobjects, test)
    print("OnPreFillWorldObjectContextMenu")
end)

Somebody load this script, test it and reload the script and test it again the event will be all messed up
EveryOneMinute will print OnPreFillWorldObjectContextMenu
OnPreFillWorldObjectContextMenu will still print OnPreFillWorldObjectContextMenu
It's so random but it could be just me or a real bug

drifting ore
# drifting ore

I forgot to say but … I can pay whoever will create this mod for the whole community.

#

this is probably one of the mods that I want the most and that will make me say that this game is the best I could have played in my whole life :’)

hot patrol
#

I'm hardly knowledgeable enough to say with much confidence but I don't thing something like that is possible to mod. I imagine you would need to rewrite entire elements of the UI.

low yarrow
#

And nope. Attached to the hand

#

If you haven't already imported the character model you should get the model which is pinned in the modeling channel

hot patrol
#

I do have it I will try that when I get a chance.

#

Thanks for the help.

thin hornet
#

Any reason my audio is not looping correctly in the game, it stop before starting again

hot patrol
harsh prairie
weary matrix
#

Hi, any clue what mod is adding a green outline around the zombie(s) you're targeting?

#

I frequently see this in live streams

drifting ore
#

thats in the options menu

weary matrix
#

oh nice, let me check

cobalt steeple
#

Quick question how can you edit perks in code

dawn shuttle
#

Under display, you can choose to have none, range, or range+melee

pearl prism
weary matrix
#

Found it! Thank you @drifting ore @dawn shuttle and @pearl prism

weary matrix
#

@rocky otter No clue about whether the mods are working, but about your save file ,you can just backup your Zomboid/Saves folder in case something wrong happens

nimble spoke
#

if they do what they say there and just that there shouldn't be any problems

#

looks like just some more recipes

weary matrix
#

Yesterday I played a bit with rifles. I was wondering, is there a way to use your rifle as a melee weapon?

#

at some point I was out of ammo with some zombies really close to me, I had to put away my rifle to get a melee weapon

#

felt awkward πŸ˜…

fallow bridge
#

You can push with them

weary matrix
#

@fallow bridge ah nice

#

totally missed that

#

but no way to use the cross?

fallow bridge
#

Cross?

#

Oh!

#

No

#

And pushing doesn’t deal damage

weary matrix
#

yeah like using the part you put against your shoulder when you shoot

fallow bridge
#

It just keeps them away and can push them to the ground

weary matrix
#

still good to know, thank you

weary matrix
#

is it possible to change what's happening when you double click an item in your inventory? Like for example if I double click on a book, nothing happens, I would like to make my character to read the book when I double click it

#

also for keys, like if I double click a key, I want it to go straight to my keyring

dry chasm
#

or rather the ISInventoryPane:doContextualDblClick in line # 914

weary matrix
#

@dry chasm thanks I will check

dry chasm
# weary matrix <@!308663375418884096> thanks I will check
local origDblClickFnc = ISInventoryPane.doContextualDblClick;
function ISInventoryPane:doContextualDblClick(item, ...)
    local playerObj = getSpecificPlayer(self.player);
    if instanceof(item, "Literature") then
        -- initiate the reading part
    end
    if instanceof(item, "Key") then
        -- now check keyRing container, instanceof(obj, "KeyRing")? unsure
        -- do stuff with it afterwards
    end
    return origDblClickFnc(self, item, ...);
end

as example

weary matrix
#

@dry chasm oh that looks promising πŸ˜„

low yarrow
weary matrix
#

I guess I should call origDblClickFnc only when the item is not litterature and not a key?

#

or well it shoulnd't matter since those are doing nothing anyway

dry chasm
weary matrix
#

indeed

low yarrow
#

As far as i remember you can export the weapon to your mod folders and see directly ingame a change after a few seconds. So its relative easy to adjust the offset.

rare patrol
#

Anyone familiar on how to hot wire on better lock picking mod? I select one bottom wire then randomly select the top wires. Is this correct?

dawn shuttle
rare patrol
dawn shuttle
#

np!

weary matrix
#

what's the difference between getPlayer() and getSpecificPlayer()?

dry chasm
#

IIRC getPlayer() gives you the last player instance of the client? (so 2nd player if 2 player split screen?)
with getSpecificPlayer and passing the playerID in, you get the object of the player? πŸ€” unsure on how exactly but yea.
In some cases, events or similar you get the id and not the object i believe

#

haven't meddled with that yet though, so other people may have more experience and can fill it out some more πŸ˜‚

rose notch
#

Is it possible to add variants to existing clothing? Ie i make a texture and then add its ability to spawn?

weary matrix
#

@rose notch I know you can make your own variants, and what would be the point if you couldn't add it to spawn?

#

When you call getPlayer():getInventory():getItemsFromCategory("Container"), it returns an arrylist of InventoryItem, but this class has no method to add items to it. So I guess I need to get an ItemContainer instance (this one has a method addItem). So how do I get an ItemContainer instance from an InventoryItem that is a container?

agile coral
#

I believe you do item:getContainer() to get the ItemContainer from an InventoryItem

rose notch
#

I dunno, i made some textures

#

I guess i need to add them to something

weary matrix
#

@agile coral that would return the container in which the item is stored

#

aaah got it !

#

You have to call item:getInventory():addItem(theItemToAdd)

rose notch
#

This i guess

weary matrix
#

@dry chasm works like a charm, thanks!

#

My only problem now, is it only works from the player inventory panel, but not from the looting panel

hot patrol
nimble spoke
rose notch
#

I worked it out in the end

#

Now i need to make it

north ledge
#

what use is there to those ceramic and titanium armor plates in the safehouses?

dawn shuttle
#

Anyone knows of a mod that does something along the lines of item auto drop off in containers?

hot patrol
#

I finally did it

#

apparently using a wood pland in blender to allign the model was a bad ideo

#

tried the bat and boom

#

I might cry

worldly olive
#

3D items were either the worst thing to be added to the game or the best... πŸ˜‚

hot patrol
#

the best

#

100%

#

ok now I just need to fix the placement position bot that is easier

#

only problem is

rose notch
#

Some more

errant meteor
#

@sour island sorry to bother but I heard you found out a way to add custom moods, how much work would that require to do?

sour island
#

I think that was a misunderstanding

#

if mood's enum hasn't been opened up via a .txt or exposed differently you can't add to it

#

same for what was previously skills and sandboxOptions

errant meteor
#

kk thx

sour island
#

you could try pinging Nasko

errant meteor
#

That modding wish list must be big lol

thick lance
#

Is there a mod similar to that already?

dawn lynx
#

Is there a way to retrieve how a function was called? Like what event called it as an example

dawn lynx
#

I supposed I can just pass a string through the function as an argument

undone elbow
royal ridge
#

Is there a guide or something on how to add a tab to the menu options and make it work?

undone elbow
royal ridge
#

I suppose it depends on the mod, and if it had a lot of configuration options.

undone elbow
royal ridge
#

ill take a look, thanks

drifting ore
#

Any updates on the walking dead modded map?

#

If anyone knows

hollow oyster
#

Hey guys! I have a genuine question, does anybody knows how to retexture clothes or has some kind of a guide that might come in handy?

rancid barn
royal ridge
#

how can I spawn a car into the world is there a command?

rancid barn
#

You can use the cheat menu mod

royal ridge
#

I am making a scenario and want to spawn a car for the player

dim geode
#

And you can also set ur launch options to debug mode

pearl prism
#

If you want to create a place on the map that can spawn cars this is easier to ask the "mapping" guys

royal ridge
#

Ill have a look at cheat menu and see wgat they use

oak cipher
#

@candid sonnet

#

Sent you a friend request - would like to inquire about something! I saw your Pancit Canton mod hahah!

vestal umbra
#

Do any of you guys know how to get all the Windows from an IsoRoom instance?

#

It says that you should be able to call getWindows() on an IsoRoom instance, but to my knowledge I am not receiving anything.

#

The "[]" represents what should be an ArrayList of IsoWindow.

#

It's not like there's no windows either; you can see two of them here.

#

But the ArrayLists are just empty.

weary matrix
#
exotic ember
#

does zupercart work?

true kernel
sour island
#

Have you tried using size() to see their lengths

vestal umbra
#
local allWindowsForCurrentIsoRoom = currentIsoRoom:getWindows(); print(allWindowsForCurrentIsoRoom)

            for i = 0, allWindowsForCurrentIsoRoom:size()-1 do
                print("We have reached window number #" .. i) -- Debug Message

                ---@type IsoWindow
                local currentWindow = allWindowsForCurrentIsoRoom:get(i)
                currentWindow:removeSheet()
                currentWindow:addSheet()
            end
#

As far as I'm aware, this is a pretty standard way of going about it.

sour island
#

Interesting

#

I would double check that the windows array is actually used.

vestal umbra
#
public ArrayList<IsoWindow> getWindows() {
        return this.Windows;
}
sour island
#

Hm

vestal umbra
#

That's the method in IsoRoom

#

so, I would imagine it will return me the Windows ArrayList that belongs to that IsoRoom

#

of which I have 3.

#

I see the windows, but apparently the IsoRooms do not have any actual windows.

sour island
#

I had a similar issue with a list never being used

#

I think it was a cell's buildings list always being empty

vestal umbra
#

Is it something I should report to the devs?

sour island
#

It may just be vestigial code

vestal umbra
#

Yeah, if that was my codebase I would like to know so I could remove it

#

It would be very confusing to create an instance of a class and call a method that essentially does nothing.

sour island
#

I don't even know what the purpose/difference IsoRoom and RoomDef are

vestal umbra
#

πŸ€·β€β™‚οΈ

sour island
#

Double check the uses of .Windows

#

Could be only used in specific contexts

#

Like open windows

vestal umbra
#

that I can check.

#

I just opened a window and ran the code; still empty.

sour island
#

You'd have to check the uses in the java files

#

That was just an educated guess

#

Does RoomDef have anything related to windows?

vestal umbra
#

It has an ArrayList of RoomRect and another ArrayList of MetaObject

#

I don't know if Window inherits from either of those in some way

#

but still, I feel like the method getWindows() should get all the windows for that instance.

sour island
#

I agree

kind surge
#

Your only way around may be to use the room's getTileList method to get all of the IsoGridSquares within that room, and then use the IsoGridSquare's getWindow methods.

vestal umbra
#

I'm going to talk to Nasko first or maybe a dev.

sour island
#

I'm still curious what the hell the windows list is being used for if it's empty

vestal umbra
#

I feel like reporting this would be worth more than trying to redneck a way around it.

#

But thank you for the suggestion, that might work too.

sour island
#

Maybe it's player built structure logic?

vestal umbra
#

I dunno, all I know is that it's confusing

kind surge
#

Well there's no code to add anything to the Windows ArrayList within IsoRoom. So if it's used, it would need to be a child class.

vestal umbra
#

I would imagine that the instance of the room is made and filled elsewhere.

#

windows included.

kind surge
#

Oh, yeah, I guess since getWindows returns a reference to the ArrayList, things can be added to it outside of the IsoRoom class

vestal umbra
#

If we had all the code, we could check the usages of it

#

or set a data breakpoint

#

show me the YUMMY WINDOWS

kind surge
#

Searching the zombie directory for getWindows returns only the IsoRoom.class file. No references to it in the media/lua directory either

vestal umbra
#

My friend told me to check the lightswitch array. It does return stuff

#

so I am going to assume that the getWindows() method is broken.

sour island
#

Probably no longer used

#

Rip

vestal umbra
#

Show those windows some love.

sour island
#

Do windows have a building reference?

#

Like get building?

#

You have getcurrentbuilding for players

#

I have an isoRange function that grabs swathes of gridSquares fractally

vestal umbra
#

I am checking its methods and properties

sour island
#

You could brute force it

#

All tiles within a range of 50 that contain windows -- if window's building == player's : do your thing

vestal umbra
#

Yeah, I mean there has to be a way to do it

#

otherwise, they couldn't do it

sour island
#

Well they don't ever need to grab all windows

#

So they don't need it

kind surge
#

IsoGridSquare has a few different getWindow<x> methods. So whether you use the IsoRoom.getTileList method or a brute force search you should be able to query each square for the windows nearby.

#

And IsoWindow extends IsoObject, so yes, it has a reference to the square it's on.

sour island
#

Oh yeah that's true -- you have the rooms - tilelist would be ideal

#

I doubt it would be that much faster if they have a proper getter -- and I doubt they're inclined to fix it which would require them to set the windows.

#

Iirc I saw something called "calculate windows"

vestal umbra
#

I don't care much for performance with this.

#

It will have minimum impact.

sour island
#

What does calculate windows do? tired

vestal umbra
#

πŸ€·β€β™‚οΈ

sour island
#

Rabbit hole

vestal umbra
#
local currentIsoRoom = currentRoom:getIsoRoom();
local tileList = currentIsoRoom:getTileList(); print(tileList);
#

The tileList is also empty.

dry chasm
# vestal umbra I don't care much for performance with this.

did a quick test:

local p = getPlayer(); -- player
local sq = p:getSquare(); -- player square
local r = sq:getRoom(); -- room

local sqs = r:getSquares(); -- room's squares
for i=0, sqs:size()-1 do -- iterating all squares of the room
    local csq = sqs:get(i); -- current square of iteration
    local winN = csq:getWindowTo(csq:getN()); -- get window between current and north
    local winE = csq:getWindowTo(csq:getE()); -- get window between current and east
    local winS = csq:getWindowTo(csq:getS()); -- get window between current and south
    local winW = csq:getWindowTo(csq:getW()); -- get window between current and west
    if winN then print(winN); end
    if winS then print(winS); end
    if winE then print(winE); end
    if winW then print(winW); end
end
vestal umbra
#

Thank you, I'm going to try this

#

where did you find the getSquare(); method? I can't see it in the IsoPlayer class

dry chasm
#

inherited from IsoMovingObject

#

alternatively: local o = ObjectViewer:new(0,0, 500, 500, getPlayer());o:initialise();o:addToUIManager();
(keep in mind that it also lists non-exposed functions IIRC)

vestal umbra
#

What is o

dry chasm
#
local o = ObjectViewer:new(0,0, 500, 500, getPlayer()); -- new objectViewer (part of Debug Window in F11 usually)
o:initialise(); -- initialise
o:addToUIManager(); -- add to UI
vestal umbra
#

I'm sorry, I don't understand what that does.

dry chasm
#

just a window that lists contents of the object you pass as the last argument.

vestal umbra
#

Oh, so you can inspect it in the debug menu?

dry chasm
vestal umbra
#

Oh that is cool.

dry chasm
# vestal umbra Oh that is cool.

Actually, my bad, it doesn't seem to include inherited functions like from IsoMovingObject πŸ˜“ sorry (or I'm blind, unsure)

vestal umbra
#

Well I can grab all the windows.

#

or at least, all the windows from my current room

#

I want to try and add sheets to them.

vestal umbra
#

I can find windows, but addSheet() and removeSheet() don't seem to do anything.

#

though I did see that you need to pass in a character.

sour island
#

getSquare comes from IsoObject iirc

dawn shuttle
#

Anyone made a Lua debugger work on vscode? I'd be nice to have breakpoints/watch

wraith kraken
#

I keep crashing while driving my autotsar bus

function: WeaponAltLoadToggle -- file: GunFighter_02Function.lua line # 1009

ERROR: General , 1635463034012> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getPrimaryHandItem of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1635463034012> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getPrimaryHandItem of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:88)
at zombie.input.GameKeyboard.update(GameKeyboard.java:65)
at zombie.GameWindow.logic(GameWindow.java:236)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:726)
at zombie.GameWindow.run_ez(GameWindow.java:628)
at zombie.GameWindow.mainThread(GameWindow.java:471)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1635463034013> -----------------------------------------
STACK TRACE

function: WeaponAltLoadToggle -- file: GunFighter_02Function.lua line # 1009

#

anyone?

dry chasm
# wraith kraken anyone?

"GunFighter_02Function.lua line # 1009"
Does that Gun Fighter mod have any kind of hotkeys? Is it that one that only works for specific weapons for custom functionality?
If it is, try avoiding pressing the keys while driving? Aside of that, no clue of the mod 🀷 sorry, but from the error,
I doubt the issue is only with autotsar cars, but rather all cars? As the error seem to happen on another mod, unless that file
is part of autotsar, but no clue on my end.

weary matrix
#

@wraith kraken any clue where does that file come from? GunFighter_02Function.lua

#

I don't have it in my Zomboid media folder

dry chasm
#

On description page of Arsenal(26) GunFighter Mod , seems that was the mod i was thinking of in regards to limitation to only certain weapons.
Unless weapon script is formatted within certain parameters and contains certain required information, some features of this mod [WILL NOT WORK]

weary matrix
#

ah it's from a mod

#

@wraith kraken try to disable this mod

#

problem should go away

wraith kraken
weary matrix
#

yes

wraith kraken
#

I disabled it but it still crashes

weary matrix
#

same crash?

wraith kraken
#

yep

weary matrix
#

same saved game?

wraith kraken
#

while driving my bus, but it took longer to crash

wraith kraken
weary matrix
#

@wraith kraken try a new game

dry chasm
dry chasm
#

no clue what the issue is then, as that file shouldn't load anymore if it's not in the modlist πŸ€·β€β™‚οΈ

weary matrix
#

if it crashes on that file I think it means it's still enabled somehow

wraith kraken
weary matrix
#

not sure if you can disable a mod for an existing saved game

wraith kraken
dry chasm
#

you can, hence i asked (though can cause issues)

weary matrix
#

oh ok

wraith kraken
#

sorry for spam but thats my mod list

weary matrix
#

wow, how many mods do you have? πŸ˜‚

dry chasm
#

instead of pressing continue:
Press load, choose the save, bottom on more/change mods unsure how that was called and exact procedure but yea

#

you can change "savegame activated mods" that way

wraith kraken
wraith kraken
#

is it normal for fps to drop while driving?

dry chasm
#

with that many mods, highly possible?

#

but it all depends on what the mod/s do, so... yea

#

though, in all honesty, if you disabled the mod and still receive the same error - about the same file line # 1009, then either another mod has a file with that name which was the actual culprit - or it isn't deactivated for the current savegame you tried on... aside of that, i can't think of another possibility atm πŸ‘€

weary matrix
#

I think so too

dry chasm
wraith kraken
#

seems like it doesnt crash anymore

#

all good

#

thanks guys

#

i guess ill disable those mods until it gets fixed

hot patrol
#

does anbody know what the clothing rip sound is called in the game files?

dry chasm
#

ClothesRipping

hot patrol
#

thank you

hot patrol
#

oh god now I need to do the lua

#

lord help me

undone crag
#

Step 1: Learn Lua
Step 2: Have Lua

#

You're welcome.

hot patrol
#

anyone know what the pushbackmod means in the weapon scripting? Somone suggestion I make the pillow have a high knock back chance and I wanted to do that

#

it was set to 3 and I put it to 10 but I don't notice any difference

hot patrol
#

anyone know if there is a way to create map stories?

zealous wing
#

Hopefully I can release my Ice Cream Mod this weekend. I want to do a playtest or two to see how items spawn and fix any bug I might have missed. I also plan to release an update for my Ramen Mod that gives static world models for all the ramen items.

After that, the long and laborious process of giving static world models to all my other mods. I suppose AAApoc would be first among them...

weary matrix
#

@hot patrol oh, I've just seen you implemented the Pillow armor we talked about πŸ˜„

hot patrol
#

That was all Micheal. He saw your idea and liked it so much he asked me if he could do the model for it. So I have to thank the both of you for that. :)

sour island
hot patrol
#

I have no clue what that means so I assume that I don't have the know how to accomplish it.

#

Unfortunate since I wanted my dakimakura to only spawn on special "neckbeard" zombies or in a story like this

pulsar briar
#

Alright, Im trying to troubleshoot Authentic Animations. I installed it just recently however it is not working and the Q key causes an error, also my Escape key is not functioning. Does anyone have a fix or something that I did wrong?

weary matrix
#

any clue what could trigger this error?

SEVERE: null
java.lang.NullPointerException: Cannot invoke "zombie.core.properties.PropertyContainer.Is(zombie.iso.SpriteDetails.IsoFlagType)" because the return value of "zombie.iso.IsoObject.getProperties()" is null
    at zombie.iso.IsoGridSquare.renderFloorInternal(IsoGridSquare.java:7101)
    at zombie.iso.IsoGridSquare.renderFloor(IsoGridSquare.java:6979)
    at zombie.iso.IsoCell.performRenderTiles(IsoCell.java:901)
    at zombie.iso.IsoCell.renderTilesInternal(IsoCell.java:587)
    at zombie.util.lambda.Invokers$Params2$CallbackStackItem.run(Invokers.java:91)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.lambda$invokeAndMeasure$1(AbstractPerformanceProfileProbe.java:91)
    at zombie.util.lambda.Stacks$Params4$CallbackStackItem.invoke(Stacks.java:286)
#

more specifically why woud getProperties() return null?

vestal umbra
#
public PropertyContainer getProperties() {
        return this.sprite == null ? null : this.sprite.getProperties();
}```
There is no sprite.
#

This is getProperties from the IsoObject class.

#

If (this.sprite == null) is true, it will return null. If (this.sprite == null) is false it will return this.sprite.getProperties();

#

The IsoObject class has a property:
public IsoSprite sprite;

#

That is probably null for you.

weary matrix
#

@vestal umbra thx let me check

cobalt steeple
#

Where are the perk codes stored

#

The code that determines how perks work

vestal umbra
#

I believe you are looking for the PerkFactory class.

#

build/classes/zomboid/zombie/characters/skills/PerkFactory.class

full ridge
#

Hey guys... so I installed some mods in my game for the first time.. now when my character goes to run he starts slowly limping. Any idea what mod might do that or is it something else?

#

Mods I'm running
Arsenal 26
Britas
Cheat menu
Lock picking
Minimal display
Mod options
Mod template
prepper starter kit
Raven creek
Raven creek loot map
Tactical weapons

cobalt steeple
weary matrix
#

@vestal umbra thanks, your explanation helped me fixed my bug πŸ™‚

vestal umbra
#

Nice! Glad to hear it!

weary matrix
#

any clue how to add custom settings to the sandbox?

royal ridge
#

MySandBox mod or something, I used it and it worked

#

This one

weary matrix
#

@royal ridge awesome, thx ❀️

hot patrol
#

is there a guide on making custom zombies? I want to make a neckbeard guy who spawn with my mod weapon

weary matrix
#

@royal ridge so it's just about setting SandboxVars.MyMod.MyCustomOption = myValue?

#

nevermind, now I got it πŸ˜„

#

I want to add an option so you can decide whether the spear traps will kill the player if he walks on a spear trap

#

Should I put this in the page "Character", or "Sadisitic AI Director", or in my own page, like "Spear Traps"

#

the latter feels a bit overkill for a single option

vestal umbra
#

Make a tab called Traps

#

And add it in under a section called "spear traps"

weary matrix
#

@vestal umbra that seem overkill for a single option no?

vestal umbra
#

What about your future options

weary matrix
#

for now I put it under Sadisitic AI Director, I think it's a good place πŸ˜„

vestal umbra
#

What if you add more traps

weary matrix
#

if I have some more, then I'll make my own page

vestal umbra
#

And more options for traps

#

I wouldve made a new page even for one option. It is very likely that you will get more options.

weary matrix
#

πŸ˜„

#

@vestal umbra I'll follow your advice if it happens, but I really don't see any other option to add

#

and I don't plan on adding new kind of traps

#

spear traps were painful enough to develop πŸ˜‚

#

still some issues to fix

vestal umbra
weary matrix
#

@vestal umbra woud you give it a try?

vestal umbra
#

The spear trap?

weary matrix
#

yes

#

@vestal umbra I guess you're right about users asking more options, and if I can do it I will, but after thinking about it, I think the option "Spear Traps Kill Player" is really meant to be in Sadistic AI Director

vestal umbra
#

It's up to you as to where you would put it.

weary matrix
#

cause it's really a sadistic option πŸ˜‚

vestal umbra
#

I'm going to pass on trying them out for now, I'm still working on my own mod.

weary matrix
#

no worries

vestal umbra
#

I'm nearly done, just have to find the correct event to hook my mod into.

weary matrix
#

@vestal umbra what mod are you developing?

vestal umbra
#

It's a mod called "Wait My Ass"

#

The first time you spawn into the world, the house that you spawned in has all of its doors and windows covered with sheets. The windows have a random number of barricades on them as well.

#

I always thought it was weird that you spawn after the start of the apocalypse but seemingly did nothing to defend yourself

weary matrix
#

do you add a hammer and nails in your inventory at the start?

vestal umbra
#

No, there is no barricades on the doors.

#

Only on the windows.

weary matrix
#

yeah but if your character was able to barricade windows, it means he had a hammer and nails, no?

#

so maybe he used all his nails, but he should still have a hammer IMHO

vestal umbra
#

Maybe I will add that later

weary matrix
#

or at least in a container in the house

vestal umbra
#

but I'm going to leave it out for now.

#

I'd like to get this first version of the mod working.

weary matrix
#

sure

#

now I have to find out how to give injuries to my character

#

for when he walks on a grave with no spears

#

or maybe only when he's running, not sure

warped night
#

Giving a hammer and nails is OP

hot patrol
#

I made some lua files for my mod and now I keep getting a black screen when I try to load in

#

can anyone take a look at what I did wrong?

vestal umbra
#

cat.outfit is wrong @hot patrol

hot patrol
#

I spelt neckbeard wrong

#

just spotted that

vestal umbra
#

You're also not closing your "

hot patrol
#

yep

#

hopefully that fixes it

#

thank you

vestal umbra
#

I'm also not sure if the weapons array should have a comma

#

Json would fail on that. I dont know how Lua handles it.

hot patrol
#

Pretty sure I followed the vanilla to a T there but if I still have issues I will recheck it

vestal umbra
#

Ok

hot patrol
#

still broken but the weapon seems right

hot patrol
#

So I fixed a bunch of errors I ended up finding and i'm fairly certain it is the way it should be now but I still get the black screen. Can anyone spot something wrong with the outfit maybe? the intructions were less clear on this one. https://i.imgur.com/xhwo4js.png

weary matrix
#

about the extra comma, for Lua it's OK, but for JSON it would be a syntax error

hot patrol
#

how are you supposed to get the GUID here? The guide I followed never specified so I literally just randomly generated one online. Could that be my problem? https://i.imgur.com/qxu01pr.png

weary matrix
#

@hot patrol theoretically it could, but considering the range of possibilities you have as much chances of this happening than winning the lottery twice in a row

#

if you ever get in trouble, just change it and that's it

hot patrol
#

wait so I did do that right?

#

randomly generate one?

weary matrix
#

yes

hot patrol
#

nice

#

then I doubt that is the issue

weary matrix
#

only "smarter way" would have been to check UUID of all zomboid code and mods but that would probably be painful

hot patrol
#

there must be something else wrong with my code that i'm not seeing. I did fix a lot already

weary matrix
#

@hot patrol what problem do you have?

hot patrol
#

when I load the game I just get a black screen and the music keeps going

weary matrix
#

nothing in console.txt?

hot patrol
#

I know it is something with the lua since it is all I added

#

no errors

#

or crashes

#

just the black screen

weary matrix
#

@hot patrol does it happen when you start a game, or you can't even see the main menu options?

hot patrol
#

when I try to load into my save

#

I hit continue, it loads the lua and black screens

weary matrix
#

have you tried to start a new game?

hot patrol
#

not yet

#

didn't think it would help

#

I will now

weary matrix
#

well sometimes some data can get corrupted, especially if you got crash etc. It's worth trying to be sure it's not this kind of problem

hot patrol
#

Can't even start a new save with the mod

weary matrix
#

do you have your code published somewhere?

hot patrol
#

auto black screen

#

I can upload it here or dm it to you

weary matrix
#

sure

#

do it here so other people can try to help

hot patrol
#

everything I've added

#

once those were added it broke

weary matrix
#

try to comment every lines in the last file you posted and start a game

#

@hot patrol is that the full content of your mod?

hot patrol
#

that is just me trying to make a special zombie outfit to spawn my item

#

everything else is tested and works

weary matrix
#

like this:

--ZombiesZoneDefinition.Default = {};

--table.insert(ZombiesZoneDefinition.Default,{name = "Neckbeard", chance=0.2, gender="male"});```
#

then start a game and see if you still get a blackscreen

hot patrol
#

nope

#

still nothing

vestal umbra
#

Does anyone here know of an event that I could hook into after initial creation? I tried OnCreatePlayer but it doesn't seem to work.

#

I want to modify windows and doors for the first time a player is created.

weary matrix
#

@hot patrol Mind to zip your whole mod and upload it here? so I can try to load it and see if I can troubleshoot the issue

hot patrol
#

So long as nobody steals my gold aPES_LulLaugh

#

yea no problem

weary matrix
#

hehe

hot patrol
#

beware this is all slop. a 5 year olds finger painting

weary matrix
#

@hot patrol All right I get a black screen too

#

but I can see this in console.txt:

-----------------------------------------
function: AttachedWeaponDefinitions.lua -- file: AttachedWeaponDefinitions.lua line # 11

LOG  : General     , 1635534766517> attempted index of non-table
hot patrol
#

like 11 is literally the end of it

#

what could be wrong there?

#

should the } not be there?

weary matrix
#

@hot patrol I think the problem is AttachedWeaponDefinitions does not exist or is not a table

#

@hot patrol no line 11 is just the end of your statement, so it gives that line

#

problem is actually at first line I think

hot patrol
#

yea but that is in the vanilla files and this guide says it is how you get zombies to spawn with weapons https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/

#

wrong one

#
weary matrix
#

i was about to ask πŸ˜‚

hot patrol
#

yea the first guide I linked will be the next mission I take on lol

weary matrix
#

@hot patrol try to add this before everything else:
AttachedWeaponDefinitions = AttachedWeaponDefinitions or {};

#

it seems to fix the bug for me, but now I get another bug in HairOutfitDefinitions.lua

hot patrol
#

lol

#

still black screen for me but maybe It fixed the first problem like you say

#

I will check

#

yep

#

hairoutfit

#

I'm adding the same start bit on there to

#

bet that will fix it

#

HairOutfitDefinitions = HairOutfitDefinitions or {};

exotic ember
#

anyone know if the propane trucks actually work in fillibusters?

#

propane or fuel or whatever

#

Or if the zupercart mod works for that matter

weary matrix
#

@hot patrol try this: ```HairOutfitDefinitions = HairOutfitDefinitions or {};
HairOutfitDefinitions.haircutOutfitDefinition = HairOutfitDefinitions.haircutOutfiDefinition or {};

#

before the table.insert bit

hot patrol
#

doing that now

#

fixed

#

thanks a ton

weary matrix
#

@hot patrol you also need this: ZombiesZoneDefinition = ZombiesZoneDefinition or {}

hot patrol
#

yep

#

added that as well

weary matrix
#

and then I get the loading screen

dry chasm
#
require "Definitions/HairOutfitDefinitions"
hot patrol
#

after seeing the attached weapon error I figured that was it

#

so I premtivly added it to them all

weary matrix
#

πŸ‘

hot patrol
#

hmmm

#

I don't see my zombie in the spawner tho

#

well damn

dry chasm
#

cat.haircut = "Picard:50;PonyTail:50";
i do not see any haircutDefinition with either of those?

#

maybe needed? πŸ€·β€β™‚οΈ

#

also require the file for the best

hot patrol
#

they are somewhere else

dry chasm
#

as when yours loads before the original, it will just be overwritten

hot patrol
#

I saw them

#

lemme see

#

they are in hairstyles

#

the xml

#

hairdefinitions are just the zombie outfits in game

#

none of them use those styles

weary matrix
#

@vestal umbra have you tried OnGameStart?

vestal umbra
#

It wouldn't work for what I want.

weary matrix
#

it should be called just after the game has finished loading or starting

vestal umbra
#

I want the mod to trigger one time only after character creation

#

I believe this would trigger it everytime you reload a save.

weary matrix
#

indeed, but you can store a boolean somewhere so you know you don't have to do it again

#

like: someObject:getModData()['initialized'] = true and then in your function you just check for that value

#

if true, do nothing, otherwise do your stuff

#

@vestal umbra wouldn't that work?

vestal umbra
#

Yes that is a good idea.

weary matrix
#

cool

vestal umbra
#

I don't know how to do that yet, but I did consider a boolean.

hot patrol
#

can anyone think of a reason why my zombie outfit doesn't show up in the debug zombie spawner?

#

i'm stumped

vestal umbra
#

How would the boolean keep its value across an entire save?

weary matrix
#

@vestal umbra I suppose you could do something like this:
getPlayer():getModData()['initialized'] = true

#

the content of ModData is reloaded on game load

#

assuming you put lua primitive types in there, like integers, booleans, or tables

vestal umbra
#

I'm going into a Dead by Daylight match now but I will try it later.

weary matrix
#

ok, let me know when/if you succeed

hot patrol
#

know what it means?

sharp crystal
#

How difficult would be to make a mod which would show the weight permanently? Like without to click on main inventory to see it?

weary matrix
#

not very hard

#

@hot patrol looks like a syntax error in your XML file

#

@hot patrol are you sure this is valid syntax? --fedora--

#

does not look like valid XML

#

try this instead maybe: <!-- fedora -->

#

that's a comment in XML format

#

@sharp crystal how do you want to display this information?

hot patrol
#

@weary matrix shurutsue figured it out. I have just about everything working noiw

teal rampart
#

hello, is it possible to modify the rate of change of endurance per tick, or does all this happen behidn the scenes and is not modifiable by using lua?

#

getEnduranceChange() seems to merely pertain to the one time benefit some item can give

#

I reckon calculating the Ξ”Endurance between ticks and setting Endurance with every other tick to counteract the endurance change as performed by the engine behind the scenes might be not the best solution

#

Basically, I'd like to implement a more realistic asthma inhaler that doesn't just give a "bump" once

weary matrix
#

@hot patrol sweet!

hot patrol
#

kinda sweet. It's all there but the outfit isn't loading

#

very nice

weary matrix
#

I tried to make it balanced

#

so for example unless you change sandbox settings, you die too if you walk over the trap πŸ˜„

hot patrol
#

that's how it goes when you walk on the pointy bits

weary matrix
#

indeed

hot patrol
teal rampart
#

that pit needs some cover for camouflage

weary matrix
#

@teal rampart you mean for multiplayer?

teal rampart
#

ya

#

to be extra nasty

hot patrol
#

ooo

teal rampart
#

πŸ™‚

hot patrol
#

sneaky

weary matrix
#

I've thought about it

#

will think about it when we have multiplayer with version 41+

teal rampart
#

ayup. it's still a bit off... it was just my first thought when i saw it πŸ™‚

weary matrix
#

right now the multiplayer part is so boring I'm not sure I want to spend any more time on it πŸ˜‚

teal rampart
#

i guess grabbing some bushes and replanting them around the pit should be enough

#

for starters πŸ™‚

weary matrix
#

can we grab bush and plant them already?

teal rampart
#

im not sure, lol

weary matrix
#

hehe

#

shouldn't be too hard anyway

teal rampart
#

But nice mod. Do you plan on adding any other traps

vestal umbra
#

@weary matrix Okay I can work on this boolean now. What is the concept of it?

#

chuck explained it briefly to me, but do you just kinda like store a boolean inside of an object?

vestal umbra
#

Oh nice dude!

#

I didn't even see that

weary matrix
#

@vestal umbra yeah everything you put in modData is saved and restored when you load a game

#

doesn't work to store Java objects though

vestal umbra
#
local player = getPlayer();
    local hasModBeenRan = player:getModData().HasModBeenRan;

    if hasModBeenRan == nil then return; end
```\
#

could I do this?

#

provided that I set player:getModData().HasModBeenRan = true later

weary matrix
#

@vestal umbra yes looks good, except I would change your check like this: if hasModBeenRan == true then return

vestal umbra
#

Fair.

weary matrix
#

you can set it to true just after that last line BTW

vestal umbra
#

I'm gonna set it to true after it's fully ran

#

at the end.

#
player:getModData().HasModBeenRan = true;
#

like this, right?

weary matrix
#

yes

vestal umbra
#

cool!

#

Thank you

weary matrix
#

I use array notation, but that should work too

vestal umbra
#

you're just calling the value of the property at the end of the day

weary matrix
#

You're welcome! I hope it will work πŸ™‚

weary matrix
#

@proud fern @dry chasm thank you guys πŸ˜…

dry chasm
#

like 1h or something

weary matrix
#

especially you @dry chasm, I would never be done by now without your help πŸ˜‰

vestal umbra
#

once and only once per save.

vestal umbra
#

well, once and only once per character really

#

so saving the boolean on the player would be even better

#

I imagine that a new player would also mean that it creates a new boolean.

dry chasm
vestal umbra
#

You can hook into the hour event

dry chasm
#

no no

dim geode
#

Mod idea-expansion of expanded heli events that includes hostile military NPC’s and possibly a hostile heli that shoots at u

dry chasm
#

i meant

#

onGameStart

#

but checking the players survived time

#

not every hour

vestal umbra
#

Oh yeah but the issue is

#

onGameStart does not run my code.

#

I think the hook is too early for my code to run.

dry chasm
#

mhmm could be

#

though do you use player:stuff or getPlayer():stuff?

#

onGameStart does not provide the player arg IIRC

teal rampart
#

is there anything between "EveryTenMinutes" and "onTick" to register an event on?

vestal umbra
#

player:stuff

hot patrol
#

is anyone proficient in custom zombie outfits?

vestal umbra
#

I got it to work; just a reminder to everyone here:
If you call to an event, you have to pass in all the parameters that that event uses. If you do not do this, the event will not trigger.

#

Which, in my opinion, defeats the purpose of the event.

dry chasm
#

πŸ€” If you just want your function ran when an event triggers, you do not need to use all arguments provided.
If you however do wish to trigger an event, then yes.

vestal umbra
#

Okay, but why then did my function not trigger when I hooked it to OnKeyPressed

#

even though I pressed keys

#

Oh wait, it's because you want to trigger the event.

#

I understand.

vestal umbra
weary matrix
#

@vestal umbra congrats mate! Will give it a try now

vestal umbra
#

Sweet, it is intended to work for a new safe but it will work on your current save too

#

it will just add sheets and barricades to the home that you logged off in.

drifting ore
#

what if we made zombeis edible

weary matrix
#

@drifting ore would you eat zombie flesh? πŸ˜‚

#

I would not even try

drifting ore
#

depends

#

zombie human then no

#

but I might be more eager to eat zombie pig, if well cooked

weary matrix
#

@vestal umbra seems to be working OK πŸ™‚

vestal umbra
#

Sweet. I know there is a bug still @weary matrix

#

Certain doors are not provided with sheets. Apparently doors to the south and west are not part of the tileSet

weary matrix
#

@vestal umbra maybe try to increase the square scanning area by one

#

Just tried a new game with Zombie speed = sprinters, but I end up with 100% sprinters, no slow zombie at all, is that normal?

#

when I watch zomboid streams I can see some are sprinters, but most zombies are not

vestal umbra
#

Because currently, I am retrieving the tileset of the house

weary matrix
#

@vestal umbra can you show me the code you use to retrieve the tiles?

vestal umbra
#

I'll DM you it

weary matrix
#

sure

dawn lynx
sour island
weary matrix
#

Hi @sour island, do you play with sprinters by any chance?

sour island
#

play with, no

#

make them in mods yes

weary matrix
#

@sour island when I set zombie speed = sprinters, all the zombies are sprinters

#

is that normal?

sour island
#

um?

#

like in sandbox?

weary matrix
#

I was expecting to get only a few sprinters

#

yes

sour island
#

I know vanilla has a random one but the % is high

#

there's a mod called config zombies and another called sandbox+ that lets you customize it more

#

warning tho sandbox+ breaks with other mods that use the main menu

weary matrix
#

aah good to know will look into it

#

i don't use other mods that change the main menu so I should be fine hopefully

#
Mix zombie speeds any way you want.``` ❀️
#

thx @sour island I think that will do

#

damn I installed sandbox+ but I get no extra options in sandbox settings

dawn shuttle
#

Do IsoObject store a unique ID (that's also persistent after saving/loading)?

weary matrix
#

@dawn shuttle maybe try keyId, I'm not sure though

#

otherwise the class is serializable so IIRC it means it should have a unique ID

#

ah nevermind, the serializable field is unique per class, not per instance

dawn shuttle
#

and keyId wasn't unique

#

sadly 😦

weary matrix
#

what are you trying to achieve?

tall pivot
#

Hey guys, I have 0 scripting experience whatsoever but I'm looking to create a super simple mod in which metalworking and mechanics skill can be used to craft reinforced car parts. I'm planning to just copy-paste and alter vanilla assets, but I'm having a difficult time finding the assets to rip.

dawn shuttle
#

So that object is queryable from the client's selection

weary matrix
#

@dawn shuttle I know Lua is able to write files, but not sure about the Lua shipped with Zomboid, it's a special one

#

@dawn shuttle what kind of object?

dawn shuttle
#

I did see getModData() but I wasn't able to figure out a way to achiev that

dry chasm
weary matrix
#

@tall pivot which assets are you looking for?

#

@sick palm ah, good to know I've been wondering

dawn shuttle
#

I saw writing/reading np yeah, it's the pesky ID that is causing me issues

dawn shuttle
weary matrix
#

@dawn shuttle depending on the kind of object, maybe you can just save the fields of interest and recreate the item when you need it?

tall pivot
#

I'm looking for all three breeds (standard, sport, and heavy) variations of tires, windows, hood/trunk lids, and doors.

#

I'm trying to find the sprites/textures for each as well as the defined values to copy and alter.

dry chasm
# dawn shuttle Specifically Containers

overall unsure on ability to reference an item without its position or similar (like via an id or something), though storing it's square position somewhere is a possibility and then checking that square for said object.

dawn shuttle
#

I was able to use setName(string) which permanently changed the name. If I knew that would not cause an issue I'd just generate a UUID and job done lol

dry chasm
dawn shuttle
#

it does

dry chasm
#

then i guess it just depends on what exactly you want to achieve. Like, just when interacting with it? Or also when away from it automatically?

dawn shuttle
dawn shuttle
dry chasm
#

so the ini file part is.... for some reason.
If it's supposed to just be for that save, you can set moddata

#

alternatively, if you need a file written and all

#

you can set part of the mod data, example:

ContainerID = 1,
MyData = {
  something = 5,
  somethingElse = "Hello
}

store it in an ini file (for whatever reason? Debugging?)
And load this file upon world load or something

dawn shuttle
#

I did try playing around moddata but was not successful

dry chasm
#

and when interacting with the object, you can compare ini and moddata

dawn shuttle
#

Do you have a moddata example?

dry chasm
#
local mdata = item:getModData();
mdata.Something = "This is some string";
mdata.Data = {
  "This is a table, filled by index with strings",
  "very useful, maybe?",
}

-- later on

local mdata = item:getModData();
if mdata and mdata.Something and mdata.Data then
  for _,v in ipairs(mdata.Data) do
    print(v);
  end
end
#

probably a bad example, but yeah.

dawn shuttle
#

I'll give that a go! Merci beaucoup @dry chasm and @weary matrix (Also congrats on your first mod!)

dry chasm
#

Good luck!

weary matrix
#

thx, and good luck @dawn shuttle

#

@tall pivot have you checked the tilesets?

#

the .pack files

#

I'm not sure it's there

tall pivot
#

No, I literally have no idea what I'm doing but I'm starting to somewhat understand.

#

What filepath can I find tilesets in?

weary matrix
#

@tall pivot mmn maybe try to find a mod that does something similar with cars, to see how it's done

tall pivot
#

That's a good idea, I could find a standalone vehicle mod like M911 and reverse engineer it

weary matrix
#

@tall pivot they should be in media/texturepacks

#

@tall pivot TileZed

#

once you install it and configure it properly you should have access to most tiles

tall pivot
#

Thanks.

weary matrix
#

night all!

teal rampart
#

night co

tall pivot
#

Does anyone know where I can find the values for vehicle parts in vanilla files?

#

In what folder can I find values for hoods, windows, and tires?

#

i.e. health and weight

dawn shuttle
tall pivot
#

Thanks a bunch.

dawn shuttle
#

np!

#

I'd suggest either downloading notepad++ or vs code. Both of these software has a search that allows you to find keywords in multiple files in a directory

tall pivot
#

I have both, haha

dawn shuttle
#

really helps when you are digging in \media

#

good stuff πŸ˜‰

tall pivot
#

VS code is much easier on the eyes

dawn shuttle
#

both configurable, but dark mode vs code is A+

tall pivot
#

Wait, is repairing vehicle items vanilla now? I'm still using a mod for that lmao

dawn shuttle
#

certain parts you can repair in vanilla like trunk/trunk Lid. Most is find replacement parts, macgyver lol

tall pivot
#

Jeff, do you know what these stats mean?

#

Doesn't matter.

#

Things are starting to make sense to me!!!

dawn shuttle
#

great feeling

tall pivot
#

Yeah, definitely.

#

Especially considering I'm a level 0 noob with everything coding.

tall pivot
#

@dawn shuttle where can I find icons?

#

Sorry for ping.

dawn shuttle
#

np for ping

dawn shuttle
tall pivot
#

Thank you.

#

I'm actually looking for inventory icons, maybe I can check inventory then.

#

Nope, media>inventory only has two magazine pngs LOL

dry chasm
#

texturepacks, UI and UI2 IIRC

#

is where item icons are located

tall pivot
#

Thank you :)

#

What software will allow me to view .pack files?

dawn shuttle
#

achieved what I was trying to do btw @dry chasm πŸ™‚

dry chasm
dawn shuttle
#

getModData was the way to go

dry chasm
#

ah!

tall pivot
#

What inspires y'all to make mods?

dry chasm
#

imagination

tall pivot
#

For me at the moment, I'm implementing what I want in my playthroughs

dawn shuttle
#

mildly bugged by the fact X or Y is not in the game

dry chasm
#

coordinates? they are πŸ‘€

tall pivot
#

lmaooo

dawn shuttle
dry chasm
#

or as an answer related to What inspires y'all to make mods?

dawn shuttle
#

yes lol

dry chasm
#

ok

#

sorry πŸ˜‚

teal rampart
#

i have an asthmatic character and he is in dire need of an inhaler

dawn shuttle
#

no worries πŸ˜›

tall pivot
#

someone code this man an inhaler

teal rampart
#

so i need to mod one in since the other mods no longer supply inhalers

#

ive fixed the code of PZ Med

dawn shuttle
#

oh cool I'm recruit now reporting for duty

teal rampart
#

and i can inhale! :p

dawn shuttle
#

yay living!

teal rampart
#

i just don't like the mechanism... i want it to be a bit more realistic

tall pivot
#

wow this is so cool

#

I don't know how to code for shit

#

but I can comb through and alter values

teal rampart
#

but i'm a dabbling noob and trying to properly register my functions on events

tall pivot
#

this opens so many doors, I can go revive dead mods on Workshop

teal rampart
#

also... the API does not quite provide the function i need so i need to do something "hackish"... and I'm not sure how that will work out

#

I just modmod and try to add a few things. Sadly, I'm an eternal greenhorn programmer, but oh well

tall pivot
#

MODDING IS FUN

#

dopamine moment