#mod_development

1 messages ยท Page 481 of 1

echo sky
#

oh whoops, wasn't scrolled

winged phoenix
#

yeah, i figured out what was happening

#

and now i've made a big damn spreadsheet and have made a tool to quickly let pillow fix this shit by me mostly just going through and grabbing matching spawns and listing their line number (and the fix if i get around to it)

#

cos like

#

okay at this point, am i an altruism masochist or something?

#

lmfao

#

looks like not all the coords are even from the professions file

#

so it'll be other spawns from other parts of the mod

echo sky
#

I think its a complex solution to a simple problem lol

winged phoenix
#

true, but there's a greater than 0.00% chance it'll help pillow

#

so i'm dumb enough to try it

lapis wedge
#

hello everyone, could someone give advice? just started out whit britta's, arsenal 26, (https://steamcommunity.com/workshop/filedetails/?id=2587063527) actually theese mods, and the problem is that i cant make any metalworking, it looks like some things missing from loot distribution, and i cant find any solution for that. made couple options, to have proper items spawns, like DIXIE EP TOOLS no success... Anyone had issue ?

Steam Workshop: Project Zomboid. These are the mods being used in our Season 6 play through of Build 41

echo sky
#

Britas distros are borked RN

#

Also that modpack is FULL of mods that are way out of date and have known issues

bold cobalt
#

@lapis wedge yeah Brittas is being updated and is not ready

willow estuary
#

Also, and this is just my opinion, with how PZ is in this state where build 41 is changing significantly every couple of weeks or months, breaking many mods, using mod collections is a mistake.

People should just not make or use them until build 41 is stable. Period.

Aside from the stability issue people will just jam collections willy nilly into their games without paying any attention to what mods thay are adding or what they do.

This has become evident here, in tech support, and reddit. That people are adding all the mods in a collection, no matter how out of date or broken they are, without evaluating the individual mods in the least.

People regularly have no idea what is Vanilla, what is mod, what mods they have active in their games, or what those mods are intended to do.

sour island
#

Perhaps there are solutions to this problem

#

if the problem is even that severe to begin with

little vessel
#

Such as?
Just curious.

dim chasm
#

how do you shoot the grenade launcher under a gun rail ?

willow estuary
#

How to Have Items Spawn on the Corpses of Zombies Wearing Specific Outfits

require 'Items/Distributions'

SuburbsDistributions.all.Outfit_Police = SuburbsDistributions.all.Outfit_Police or {rolls = 1,items = {},junk= {rolls =1, items={}}} 
        
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, "Base.BlairsBestItem")
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, 100)

quiet rampart
#

how does the outfit system work? does it pull from local building/room definitions? Be cool seeing a hospital and hundred(s) of zombies in the area wearing only the patient gowns.

#

I know it's probably more likely to spawn them near things like that, I've seen them near crashed ambulance stories etc but turning the 'weight' up would be cool

willow estuary
#

Yes, but I'm not the guy for the fancy technical explanations? I just play with the lego pieces until it works myself.

#

The answers are in ProjectZomboid\media\lua\shared\NPCs\ZombiesZoneDefinition.lua

short shell
#

@quiet rampart clothing on zombies will depend on the zone assigned to the area while making the map. Much like foraging zones. You can assign them for military, police, fire..etc

quiet rampart
#

Zombies having zone based settings too could be interesting, Blair I know you have the labs alpha complex mod, an underground facility with strict sprinter zombies in patient gowns would be an interesting endgame challenge.

short shell
#

I just looked into map making and the changes a few hours ago. I plan to update the how to make a map tutorial and include that in it

quiet rampart
#

I take it zombie definitions (speed, toughness) based on zone are off the table from the current systems? I know some mods tinker with randomness in zombie stats.

#

Could make zombie soldiers tougher due to some botched inoculation, so you could scale game difficulty up in military zones.

#

all kinds of stuff I guess.

tight lotus
#

Is there a combustible lemon mod?

#

if not, then get to work and stop dissapointing cave johnson

late hound
full bramble
#

question regarding skills: is 10 hardcoded as the max level?

little vessel
echo sky
#

<@&671452400221159444>

lost slate
#

๐Ÿ‘

ruby urchin
#

Uhgg shit, I wanted get nitro

deep loom
#

hi there, so I was using a cigarette mod which was probably outdated, wouldn't allow me to open "canned food"

#

which is weird but some people already experienced this

#

disabling the cigarette mod however seems to have deleted cigarettes from the game

#

which is a problem since I got the smoker trait

#

can anyone suggest any workaround?

timid saffron
#

I am working on a mod. I need to know how to retain some keyboard functionality while having a textbox opened. Currently my character is stuck in one place when the console is open. I could use someone with some experience in LuA help me with this.

#

Not sure if it will pan out but I'm trying to allow for a speech to text function in the game. So far I kind of have it working. It's certainly usable for meBut full keyboard control while using speech-to-Text would be amazing thanks in advance!

#

Well so everyone here gets a spiffo for all the great mods!

#

I realize this question may be rather random

distant tusk
#

Hi hi! I might be mentally challenged or just stupid, but for some reason trying to overwrite two items makes one work and the other one stay the same, been modding for a while and this game is the first one that has this kind of weird behavior, please, let me know what is the problem, I wanna learn so I can create something I'm proud of!

#

Here you have the "code"

#

And here is the problem

#

Just to be clear, normal coal is perfectly modified, but charcoal doesn't wanna change.

#

Hit me in my DM's if you can help me please! I barely enter servers ;-,

ruby urchin
#

Instead of creating an existing item, better modify it

#

You just want change the weight?

distant tusk
#

In this case, the weight is part of what I want to do

#

The problem is, I modified both coal and charcoal

#

And only one is actually getting modified

#

Idk why

ruby urchin
#

that's the problem, you're creating a item that already exists and probably some variables aren't changing

distant tusk
#

Yeah, the plan is to overwrite the current items

dry chasm
#

The difference is you've overwritten charcoal and coal, instead of modifying.
Additionally, I do see a * on the file name on the tab, sure you saved the change?
And last but not least, which I can just recommend:
#mod_development message

distant tusk
#

It bogles my mind tho, that one changes and the other keeps the same code, this is so weird, not even 7dtd was this complicated, and that one was one of it's own

ruby urchin
#

I think that is the wrong way to overwrite, wait me a second, I finish a guide and I will make a code for that, isn't really hard

dry chasm
distant tusk
#

Preexisting items keep the old data and new ones get the new one, I fiddled for an hour or so before coming

#

Tried new save, same problem

#

It's late af, Imma hit the bed, @ruby urchin hit my dm's i'll answer your as soon as I wake before I go to work
Thanks for your time guys! I hope I can make it out with your halp! ๐Ÿ–ค

halcyon marlin
#

i just got back from the weekend and im resuming work on this mod. i know you guys told me how to do it from a lua file but i feel like there is just something wrong with mine even when i am running it from a script. the stunstick sounds so weird, like it is bouncing between my speakers, but the rest of the sounds in game are very clear and the source in game is obvious

#

i am wondering if anyone has an explanation for this behavior. the only thing i am doing is calling the sound from a script on the item.

halcyon marlin
#

i have been toying with lua and trying to figure out the api for about an hour

#

i am wondering the difference between SoundEngine and SoundManager? which is better for playing soundfx on the fly?

#

and also what class has access to music? I could not get getSoundManager():StopMusic(); to work

ruby urchin
halcyon marlin
#

does anyone know the fastest/easiest way to get access to the player, or does anyone know what class getPlayer() is in? i am seeing this method in other snippets of code but i cant find it in IsoPlayer or anything

#

well it turns out getPlayer() does return an IsoPlayer, but i don't think IsoPlayer has a field for IsoGridSquare, so I am wondering if there is any other way to play a sound in a certain spot that doesnt require an IsoGridSquare argument

willow estuary
#
local square = getPlayer():getSquare()
halcyon marlin
#

dang, thank you

willow estuary
#

You're going to get better results looking at the actual lua code of PZ + mods in an investigatory fashion than whatever that is IMO?

halcyon marlin
#

i have been using examples to figure out what i need to access and then searching the api for what i can do with what i learned

#

i have gotten the sound to generate in the world, now i just need to make it happen when i hit a zombie with the stunstick

willow estuary
#

Ah okay, nvm then, I though you were just navigating just by the ape or whatever.

halcyon marlin
#

(the same goes with all the events, not just OnWeaponSwing)

dry chasm
halcyon marlin
#

shiiiit ok

dry chasm
#

Events.OnWeaponSwing.Add(playStunSound())
should hence turn into:
Events.OnWeaponSwing.Add(playStunSound)

halcyon marlin
#

and so does that make playStunSound run every time the player swings a weapon?

dry chasm
#

so long as the event exists and is run, yes, it should

halcyon marlin
#

cool ok thank you

#

i feel like this is not all that i have to do

#

the wiki page says that there are parameters for the event?

dry chasm
#

yes, parameter 1 is the attacker, parameter 2 is the weapon according to the wiki

#

and of course, you need a function with the name playStunSound

halcyon marlin
#

i am confused as to where the parameters are going?

dry chasm
#

example:

function customWeaponSwings(attacker, weapon)
  -- your code here, you can use the variabels attacker and weapon now, as they get passed into your function in this order, whenever
  -- someone swings a weapon after you add it to the event
end
Events.OnWeaponSwing.Add(customWeaponSwings)
halcyon marlin
#

so OnWeaponSwing will run customWeaponSwings() and pass it the attacker as the player and the weapon as the player's weapon?

dry chasm
#

right

halcyon marlin
#

hm ok, thank you, that makes more sense. i am going to experiment with this

dry chasm
#

though, keep in mind to define the names of the parameters in your function as in the example above (how you name them however, is up to you - the clearer you name them, the easier it'll be to edit later

halcyon marlin
#

is the weapon parameter going to allow this to work? halflife.StunBaton is the id for the item in the script

#

actually i can check the api for HandWeapon

ruby urchin
dry chasm
#

Depends on the events though

#

some events do not get any parameters sent

halcyon marlin
#

are the items that modders define in scripts IsoWorldInventoryObjects?

ruby urchin
#

Yeah jaja, I think I wasted time on some things

#

3d items droped

dry chasm
halcyon marlin
#

hm, so how could i identify if the weapon is a specific script item?

dry chasm
#

i think it's :getFullType()

#

should IIRC return something like Base.Needle or something, so the module dot originalItemName

halcyon marlin
#

yep works perfectly

#

on a sidenote, is there a way to put comment lines in the .txt script files? i feel like i should comment that the sound is going to be handled in a lua file just so i dont forget later

dry chasm
#

alternatively, but most likely unnecessary, you could probably do something like :getScriptItem():getFullName() or something

#

/* defines the start of a comment and */ defines the end of a comment to my knowledge

#

or // for single line comments (unsure here though)

halcyon marlin
#

thanks that worked

#

is a zombie an IsoGameCharacter?

dry chasm
#

(taken from wiki the info) based on the passed parameter of the event OnZombieUpdate being an IsoZombie, i guess IsoZombie would be the type of object a zombie would be? ๐Ÿคทโ€โ™‚๏ธ

halcyon marlin
#

i was thinking more for OnWeaponHitCharacter? i want the swing sound to play for the OnWeaponSwing, but another one for the OnWeaponHitCharacter

dry chasm
#

Good question, trial and error i guess?

halcyon marlin
#

oh shoot, IsoZombie inherits from IsoGameCharacter according to the api

#

i think this should work

dry chasm
#

guess the player itself isn't IsoGameCharacter then either

halcyon marlin
#

actually i think they both inherit from IsoGameCharacter

dry chasm
#

would make sense

halcyon marlin
#

i wonder what the point of making IsoLivingCharacter even is

#

actually probably for npcs

halcyon marlin
#

it has been a long night, but i did finally get the sounds to generate in world space and i have learned a lot. thanks everyone

undone elbow
#

I'm curious if pcall() is slowing down the game speed and causing lags? It's a kind of "try..catch" to run some lua code in sandbox.

dry chasm
#

I know I suggested that myself - so I could just as well do it myself... but let me know of the result! I'm curious now as well ๐Ÿ˜…

undone elbow
#

It's strange, but pcall is even faster a bit.

#
test_tm(freeze) -- 1.134 secs avg
test_tm(function() pcall(freeze) end) -- 1.112 secs avg
#

test_tm - is my function as well as freeze

dry chasm
#

quick question, how can i relatively easily limit a float (i believe) to a certain number of decimals?

undone elbow
#
round(x,2) -- 2 decimals i guess
dry chasm
#

oh sweet, even shorter than what i just found out now!
string.format("%0.2f", x)
thanks

#

I... might've just ... slightly overdone the testing on my end... 100.000 tests of each 400.000 calculations seperated by 100.000 in a simple for loop and 100.000 via a function call... the game seems frozen cough cough let's hope it still runs it all and isn't literally stuck because of something ๐Ÿ˜…

undone elbow
#

It was better to start from 1.000, and then increase this number if test finished too fast.

#

I did so)

dry chasm
#

just thought 100.000 runs would be a good count to get averages from ๐Ÿ˜…

undone elbow
#

If X number of tests takes 0.5 sec and you want to wait 20 seconds, you need X*40 tests, obviously. ๐Ÿ™‚

#

But if X number of tests takes forever, you can only wait and pray ๐Ÿ™‚

dry chasm
#

well, each test did take around 0.02 alone (for both) with, via simple single calls with pcall being slightly slower, though that all could've been due to other things happening as well, hence i just thought crank it right up ๐Ÿ˜‚

#

Atleast i now know to... well, limit myself.
Time to turn on the tv, get something to drink and come back a while later.

dry chasm
#

alright, canceled and shortened to 10.000 after i accidentally caused the game to crash.
Result:
Larger function, with a lot of calculations and all: Pretty much the same in speed (very very slightly slower)
Smaller functions, with something that could be a one-liner: Took more than double the time.
Test / elapsed:
Function call with 100.000 Calculations in a for loop: Average of 0.02 seconds | pcall: average of 0.02 seconds
100.000 function calls with calculations: Average of 0.04 seconds | pcall: average of 0.09 seconds

#

As such, atleast on my end, it seems that pcall doesn't really affect the speed all too much, especially not if it actually does some bigger workload, though shouldn't really be used for one-liners.

plucky nova
#

what happened to the kentucky carnage weapon pack?

craggy furnace
#

its private

plucky nova
#

oh, since when?

#

wait why is it private now?

craggy furnace
plucky nova
#

oh, cool!

craggy furnace
#

i redid every model, added more weapons, added new icons, and redid distributions

#

i am just tweaking now and i have more projects that need to be dealt with that have more priority

#

did you want to screw with it?

craggy furnace
#

someone without a girlfriend

drifting ore
craggy furnace
#

in all seriousness they are probably not in this channel

#

what did you want to know?

drifting ore
#

i wanted to know if i can edit it

craggy furnace
#

its not hard to do

#

start with the vanilla body texture then edit it

drifting ore
#

like do i need some kind of permission or something

craggy furnace
#

all its doing is overwriting those textures

drifting ore
#

if no i already did my edits

craggy furnace
#

ask them

#

directly on steam

drifting ore
#

how

#

?

#

๐Ÿ‘€

craggy furnace
#

its on the right of the mod

#

find the profile picture

#

then click

hollow shadow
#

Cant you register on steam for free xd?

drifting ore
#

iam using free steam account

drifting ore
distant tusk
hollow shadow
#

was like 6 months ago

#

im trying to google where it says that u need to pay 10$ to have friends on steam lmao

hollow shadow
hollow shadow
#

Dont you have project zomboid on steam to use the workshop?

drifting ore
#

I just joined and someone got exposed

little vessel
#

To be fair, I do have a steam account and I do not have Zomboid on it. I have it on GOG. I do have other games.

dry chasm
hollow shadow
#

it does

drifting ore
#

pz

willow estuary
#

Troops of Apocalypse

shrewd grove
#

i see that plague doctor mask.

#

cant hide it from view that easy.

willow estuary
#

"Scavids", doing a post apocalypse zombies jam. Like Geared Zombies, but with trashy wasteland warrior zeds.

drifting ore
#

like people gather up thinking they can fend of the zeds and they get geared and all just to fail

#

does this count as a mod ?

#

no?

ruby urchin
#

yes

little vessel
willow estuary
errant meteor
worldly olive
#

Hi!
Does the ZombRand generates a random number between a given minimum and maximum value, right? for example: ZombRand(0, 100)
I want to confirm, because I have seen it with only one parameter too and I don't really get that one ๐Ÿค”

#

I assume the one parameter is exactly as this:
local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.

But would like to confirm why use ZombRand instead of math.random

ruby urchin
#

both act as a random number, but ZombRand returns a class Rand and goes through a process called CellularAutomatonRNG I thinkg both perform the same function but by different process(? idk

sour island
#

Math.random isn't exposed or is locked up somehow in PZ

#

ZombRand(10) = 10 numbers starting from 0, so 0-9

#

Providing a minimum and maximum I believe counts from min to max or max-1 -- I'd have to check.

sour island
worldly olive
#

Oooh, nice to know that it exclude the last digit. Thank you for the explanation ๐Ÿ™‚

sour island
#

Np, you can do a test by running math.rand 1000+ times and count the results to confirm.

#

I'm not 100% sure why math.random is locked out

#

All of the other math functions are exposed fine as far as I know.

errant meteor
#

Is it possible to make a character blackout aka fall asleep "forced"

#

it is a feature for this drink, I want to add in PZ

sour island
#

If it's exposed yes, but would not work right for MP

errant meteor
#

Maybe a extremely sleepy effect would have to do

plucky nova
#

i feel like a dumbass
i thought ibrrus and aiteron were the same person

halcyon marlin
#

Don't drink the water. They put something in it to make you forget. I don't even remember how I got here.

strange kiln
#

luv halflife

drifting ore
#

the cheese

fallow bridge
#

Literally has like NOTHING IN IT?

sour island
#

Wish I still had nitro to attach my "kick me" emoji.

echo sky
worldly olive
#

Hi! is there a limitation in the amount of modData that I can use in the player? ๐Ÿค”

tame mulch
#

You can use also global ModData. Sometimes player moddata bugs

worldly olive
#

How's that? Because I need that each player has it uniques values to manage certain things

#

Is that possible with the global?

errant meteor
#

@tame mulch Hey man I have see you have been a little on the downlow for your NPC mod, is everything ok with it?

drifting ore
#

what's the mod ID something related to steam?

tame mulch
errant meteor
#

sweet

sour island
worldly olive
#

When you mentioned that the moddata bugs, what you mean? I'm using like 10 different moddata, and they all work perfect, I added one more exactly the same as always and it simply doesn't work ๐Ÿค”

#

I'm doing my test with only my mod

sour island
#

ModData can't save objects - but other than that it should NOT very easily bug.

worldly olive
#

-- INITIALIZATION FOR SMOKER TRAIT
if player:getModData().DTdaysSinceLastSmoke ~= nil then
return
else
player:getModData().DTdaysSinceLastSmoke = 0;
end

I mean, it is exactly the same code and that one works, but this one doesn't

-- INITIALIZATION FOR ALCOHOLIC TRAIT
if player:getModData().DThoursSinceLastDrink ~= nil then
return
else
player:getModData().DThoursSinceLastDrink = 0;
end

#

When I try to use it in my function it simply throws a null like if it wasn't ever initialized

sour island
#

Which part is failing though?

#

The nil check or the setting

worldly olive
#

As per the error, the initialization itself, because later on I try to use that value player:getModData().DThoursSinceLastDrink and basically the lua error is something like is not defined

#

player:getModData().DThoursSinceLastDrink = player:getModData().DThoursSinceLastDrink + 1;

This is failing inside the function, but it is supposed that that moddata was initialized in the OnPlayerCreation so it should be ready to be used in the function

sour island
#

Question why is it checking if the value is not nothing then setting?

#

You could do:

Value = Value or 0
worldly olive
#

Because I only need that it initialise once, then the value will change depending on certain things but I don't it to be initialised always

sour island
#

Completing eliminating the nil check but I'm not sure if that'd fix your problem with the error.

worldly olive
#

I'm using the nil check for other 9 modData and it does works, it has been always like that. The problem is in this new one ๐Ÿค”

sour island
#

And your sure it's in the initializing and not the other functions?

worldly olive
#

As you can see, this is the initialisation for the whole mod. All the modData works except for the latest two that are new.

#

And I'm using the same logic ๐Ÿค”

sour island
#

Could it be that the other functions where you check these are running before it's initialized?

worldly olive
#

Events.EveryHours.Add(alcoholicTrait);
Events.OnDawn.Add(alcoholicTraitAbstinence);

I assume that those function shouldn't run before the OnCreatePlayer. Anyway in case that could be the issue, it should fail once, not everyhour ๐Ÿค”

sour island
#

Do you have the modData.DTDays since and not some Hours?

#

Could be trying to check something mislabeled.

worldly olive
#

My concern is why it does work for all other modData but for this fails, if it fails for everything then something with the code is wrong but... I just don't get it ๐Ÿ˜‚

sour island
#

Try adding:

If not X then print("error FUNC") end
#

Where X I'd the value and FUNC is the function name

#

To where you are checking for the trait

#

That will print where ever it can't define the modData value

#

Sometimes you have to hamfist debugging cause your brain is ignoring a typo somewhere

#

I've spent like 30 minutes before looking for an error and it was a missing ,

worldly olive
#

Which value? the modData?

#

It should go in the OnCreatePlayer?

drifting ore
#

when i put 1 in weight does it mean 1 kilo or lbs ?

ruby urchin
#

I thing 1.0

drifting ore
#

iam sry iam new to this whole modding idea

#

so 1.0 means 1 lbs?

ruby urchin
#

It is not specified, do not give importance

sour island
#

Your basically checking where it's used and confirming if it's actually defined

#

You said it spits an error every hour so it could be inside the hourly function

worldly olive
#

Got it, will check

drifting ore
fallow bridge
drifting ore
#

0.017

worldly olive
#

Ok I don't f get it... I added that to debug but now it started to work? like I can't debug because it is working...?

#

I didn't even change the code ๐Ÿ˜ฌ

#

I fucking love and hate modding at the same time... seems like it works now... I don't know why

echo sky
drifting ore
#

so when i make an item do i put all the items in 1 block

#

or just put each item in its own block

#

this doesn't explain item types

#

how can you make a mic item like the lipstick and the eyeshadow items ?

fallow bridge
#

And considering aiterons also making a NPC mod I thought he got the two people confused

#

So I was askin

drifting ore
#

"WorldStaticModel = item" <<< what does this do

agile coral
#

Sets the 3D model for when the item is in the game world (on the ground or placed on a table/counter/etc)

#

StaticModel is when the player is holding the 3D model (like when you drink a soda)

drifting ore
#

what about the "metal value = item"

agile coral
#

Metal scrap value when melting it down for blacksmithing

drifting ore
#

" MakeUpType = lips " is this restricted to lips face and eyes?

agile coral
#

It looks like the options are FullFace, Eyes, EyesShadow, Lips

drifting ore
#

cab i add a 5th option some how ?

agile coral
#

It looks like you can, yes. The file you'll want to check out is at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\shared\Definitions\MakeUpDefinitions.lua

#

It lets you define a category, then define the individual textures for it.

#

All of the current makeup textures are at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\textures\Body\MakeUp

worldly olive
#

The event "OnDawn" does run on an specific hour in the morning? does somebody knows?

drifting ore
#

โค๏ธ

agile coral
drifting ore
#

cat.avatarYOffset = 0; is for up and down right

#

and the x variant is for left and right?

#

what if i wanna rotate tho

agile coral
#

That's what I would assume. You might not be able to, otherwise you can see if cat.avatarZOffset does anything. I'd try setting it to 0.5 or 0.25 and see if it spins it or if you just get an error

drifting ore
agile coral
#

Did a little red box pop up in the bottom right corner of the game window? If not, then it shouldn't be broken

drifting ore
#

ill reopen the game and check

drifting ore
agile coral
#

Hmm, what does the file/folder structure of the mod files look like?

#

Should be something like this:

drifting ore
#

its media containing the folders and lua containing more folders

#

inside the media

#

media/lua/shared/definitions

#

etc

drifting ore
# agile coral

i managed to enable it i just needed to remove the definition file

agile coral
#

Hmm, it might not like the avatarZOffset then. If you just get rid of that line, does it still break?

drifting ore
#

lemme try

drifting ore
#

Quick question: can you access an inventory that is part of an object that isn't currently loaded?

agile coral
#

Looks like that's not an available option then. So you probably can't flip/rotate them

agile coral
drifting ore
#

you cant make 2 makeups overlap right?

#

@agile coral

agile coral
# drifting ore different part of map

I'm not sure if the game will reject it after a specific distance away or not, but getWorld():getCell():getGridSquare(X, Y, Z) will target a square at the given X,Y,Z coordinates, and then you can get all objects on that square with :getObjects()

agile coral
drifting ore
drifting ore
#

i really apricate you helping us valrix your a blessing

agile coral
# drifting ore Yeah, maybe it will reject it... I meant if you store the reference to a specifi...

Hmm, I'm not sure if you can store an object reference in moddata, so it would only last until quit. But if that will suffice, then you should be able to just keep the object:getInventory()/object:getItemContainer() somewhere and use that until you exit the game. Otherwise you have to store the X,Y,Z and object:getObjectIndex() to fetch it from the map. I've had to do this for a mod I'm making that makes coolers work after putting a coldpack inside

agile coral
#
QoLES.watchCoolers = function(square, item, player)
    if item:getType() == "Cooler" then
        local watched = ModData.getOrCreate("QoLES_Coolers");
        table.insert(watched, square:getX().."_"..square:getY().."_"..square:getZ());
        ModData.add("QoLES_Coolers", watched);
    end
end
QoLES.unwatchCoolers = function(square, item, player)
    local watched = ModData.get("QoLES_Coolers");
    local id = square:getX().."_"..square:getY().."_"..square:getZ();
    for k,v in pairs(watched) do
        if v == id then
            watched[k] = nil;
            ModData.add("QoLES_Coolers", watched);
            return;
        end
    end
end
QoLES.transferWatch = function(item, source, destination, player)
    if item:getType() ~= "Cooler" then return end
    local watched = ModData.get("QoLES_Coolers");
    if destination:getType() == "floor" then
        -- object is being dropped, watch the square
        local parent = source:getParent();
        QoLES.watchCoolers(getWorld():getCell():getGridSquare(parent:getX(), parent:getY(), parent:getZ()), item, player);
    else
        -- object is being grabbed, unwatch the square if no more coolers
        local parent = item:getContainer():getParent();
        QoLES.unwatchCoolers(getWorld():getCell():getGridSquare(parent:getX(), parent:getY(), parent:getZ()), item, player);
    end
end
drifting ore
agile coral
drifting ore
#

i figured it out

agile coral
drifting ore
#

reading the code the eyeshadow tool has 2 catalogs 1 for eyes and 1 for eyeshadows under the eyeshadow tool

#

maybe if i make a tattoo needle ill have to sub catalog the tattoos into each body part

drifting ore
#

like arms legs torso and back 4 is enough for a start

agile coral
#

Interesting, can't wait to see what you come up with!

agile coral
drifting ore
#

and then

#

also

#

they are all in makeup type body but each has there own category

agile coral
#

Ayy nice

drifting ore
#

you know makeup isn't permeant

#

so basically anything you add will be removed in the next wash

#

F

#

i only want you to be able to remove it when you use the lactic acid that ill add to the game along with the needle and inks

#

also you need the ink and mirror to use the needle

#

and i have 0 idea how to do that

agile coral
#

You can remove the MetalValue line if it's not going to be melted down for blacksmithing. And I don't think items can be used to define use for makeup.

#

To prevent your desired makeup from being removed on wash you could probably modify ISWashYourself:perform() to remove all makeup that isn't considered a tattoo

#
function ISWashYourself:perform()
    self:stopSound()
    local visual = self.character:getHumanVisual()
    local waterUsed = 0
    for i=1,BloodBodyPartType.MAX:index() do
        local part = BloodBodyPartType.FromIndex(i-1)
        if self:washPart(visual, part) then
            waterUsed = waterUsed + 1
            if waterUsed >= self.sink:getWaterAmount() then
                break
            end
        end
    end
    self.character:resetModelNextFrame();
    triggerEvent("OnClothingUpdated", self.character)

    -- remove makeup
    self:removeAllMakeup()

    ISTakeWaterAction.SendTakeWaterCommand(self.character, self.sink, waterUsed)

    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self);
end
drifting ore
agile coral
#

I have a file in my client\TimedActions folder that contains my overrides. For yours it'd probably look a bit like this:

#
-- Create a global object to prevent re-patching the same file
if not SharedModData then SharedModData = {} end
-- Override the WashYourself timed action
if not SharedModData.isWashYourselfPatched then
    SharedModData.isWashYourselfPatched = true;
    ISWashYourself.oldPerform = ISWashYourself.perform;
    function ISWashYourself:perform()
        self:stopSound()
        local visual = self.character:getHumanVisual()
        local waterUsed = 0
        for i=1,BloodBodyPartType.MAX:index() do
            local part = BloodBodyPartType.FromIndex(i-1)
            if self:washPart(visual, part) then
                waterUsed = waterUsed + 1
                if waterUsed >= self.sink:getWaterAmount() then
                    break
                end
            end
        end
        self.character:resetModelNextFrame();
        triggerEvent("OnClothingUpdated", self.character)

        -- remove makeup
        local item = self.character:getWornItem("MakeUp_FullFace");
        if item.name ~= "EllieTat1" then
            self:removeMakeup(item);
        end
        item = self.character:getWornItem("MakeUp_Eyes");
        self:removeMakeup(item);
        item = self.character:getWornItem("MakeUp_EyesShadow");
        self:removeMakeup(item);
        item = self.character:getWornItem("MakeUp_Lips");
        self:removeMakeup(item);

        ISTakeWaterAction.SendTakeWaterCommand(self.character, self.sink, waterUsed)

        -- needed to remove from queue / start next.
        ISBaseTimedAction.perform(self);
    end
end
drifting ore
#

it just removes face eyes and lips make up ?

agile coral
#

The above does the same as the original, I just pulled the insides of the removeAllMakeup() function out so you can specify which ones not to remove. I'll touch up the above a bit to explain what I mean

drifting ore
#

if i am correct i should make it "makeup_body" and change the self: remove makeup to something else

#

or should i specify each part on its own as torso arms legs and back

agile coral
#

Since when washing it only cleans these 4 locations, anything that isn't on that spot should never get removed when washing

#

So as long as they're not added to FullFace, Eyes, EyesShadow or Lips, then they should be permanent. Otherwise you'll need to do like the above and filter out things you don't want washed away

drifting ore
#

oh good so i don't need to edit it

#

noice

agile coral
#

Yeah, if you only attach to places like the Back, Arms, Legs, etc then those will stay

drifting ore
#

by default you need a mirror to use the needle

#

idk if its a good idea to make a recipe that fills the needle with ink so you can use it

#

since you can't restrict the player from using it if they don't have it

agile coral
#

For that you'd want to make the needle a Drainable item. Then you can have a recipe to use the ink and refill the needle

#
item Yoyo
{
    Weight            = 0.2,
    Type            = Drainable,
    UseDelta        = 0.02,
    UseWhileEquipped    = true,
    ReplaceOnDeplete    = BrokenYoyo,
    DisplayName        = Yoyo,
    Icon            = Yoyo,
    WorldStaticModel    = Yoyo,
}
#

Here's a modded Yoyo that I have in a mod

#

The important parts are 'Type = Drainable' and 'UseDelta = 0.02'

#

The UseDelta is a division of 1, so this setting allows for 50 uses before it breaks and turns into a BrokenYoyo

drifting ore
agile coral
#
module ElliesTattooParlor {
    imports {
        Base
    }

    item TattooNeedle
    {
        Type                = Drainable,
        DisplayName         = Tattoo Needle,
        Icon                = TattooNeedle01,
        UseDelta            = 0.1,
        Weight                = 0.01,
        WorldStaticModel    = TattooNeedle_W,
        StaticModel            = TattooNeedle_S,
    }

    item InkBoxes
    {
        Type                = Normal,
        DisplayName            = Ink Boxes,
        Icon                = InkBoxes01,
        Weight                = 0.5,
        WorldStaticModel    = InkBoxes_W,
        StaticModel            = InkBoxes_S,
    }

    item LacticAcid
    {
        Type                = Normal,
        DisplayName            = Lactic Acid,
        Icon                = LacticAcid01,
        Weight                = 0.1,
        WorldStaticModel    = LacticAcid_W,
        StaticModel            = LacticAcid_S,
    }
}
drifting ore
#

since the the needle is drainable i should do the same for the acid and ink

agile coral
#

Only if you want to use a part of them instead of all of it at once

drifting ore
agile coral
#

Yeah that should work

#

and then to refill it

#
module ElliesTattooParlor
{
    imports
    {
        Base
    }

    recipe Fill Tattoo Needle
    {
       EmptyTattooNeedle,
       TattoosInkBox=1,

       Result:FilledTattooNeedle,
       Time:80.0,
    }
}
#

And you can replace the 1 with however many uses you want to spend to refill it

#

and time is in ticks, which are about 1/30th of a second

drifting ore
#

i am really learning a ton here ty really

agile coral
#

Awesome, I'm glad to be of help

drifting ore
#

so if i put 2 that means i can use the ink box to refill 2 times

agile coral
#

It would mean 5 uses. Since you have the UseDelta for the ink at 0.1, that means it has 10 uses. (1/0.1 = 10) If the recipe says it takes 2 uses, then it spends 0.2 each time. 1/0.2=5

drifting ore
#

iam sure i set up the ink to 0.5

#

and uses to 1

#

means it will use half of the ink to fill 1 needle

agile coral
#

Yep, the bottle has 2 uses and the recipe uses 1, so 50% each time

drifting ore
#

and then the filled needle can be used up to 5 times?

agile coral
#

20 seconds might be a bit long though

drifting ore
#

30 secs

#

i can nerf it down but

agile coral
#

600/30=20s

drifting ore
#

it does take long

agile coral
#

every 90 is 1 in-game minute, just for reference

drifting ore
#

oh so its not an irl tick ok XD

#

my bad

agile coral
#

oh yeah, PZ considers a tick to be about 1/30th of a second, give or take

#

at least according the their TimedActions

drifting ore
#

now you need to fill the needle then use it when its empty it will be changed to the empty ver of it

#

which is a drainable

#

or should i just make it normal

agile coral
#

It should just be normal since the recipe is just a complete refill

drifting ore
#

i must credit you when this mod is done

agile coral
#

If you were only refilling part of it then you'd only have the needle and wouldn't need an empty one, but you'd have to change the way it was refilled to use a TimedAction. Much like when water is being transferred between containers.

#

Haha, thanks, I appreciate that

drifting ore
#

aha no need to go all complicated then

#

its good as is maybe in future updates if i plan to do so ... which might not be needed really

agile coral
#

Nice, it's a cool mod idea

drifting ore
#

i just like tattoos tbh and i really did find a few to none going for them

#

i even tried to replace my char textures a few times for it

agile coral
#

Looks like it sorta worked for ya, but the mod would definitely make it easier

drifting ore
#

oh wait how am i gonna test this

#

iam sure these items won't spawn

agile coral
#

They'll need to be added to distribution tables

drifting ore
#

the tutorial covers those no ?

agile coral
#

Blair pinned an example page on how new distributions work

drifting ore
#

F

#

ill be back after i understand that

agile coral
#

The new additions make it quite a bit more complicated since you can now specify specific tiles and rooms to spawn things in, so don't feel bad if it takes a bit to understand it. Pretty sure nobody here fully understands it yet lol

drifting ore
#

lmao

#

@agile coral can't i just add my items same way the vanilla game handles it

errant meteor
#

Anyone how many different first aid animations there, and where I could see them?

agile coral
agile coral
#

and the models for them

drifting ore
#

but i can't find it anywhere

dry chasm
# agile coral ```lua -- Create a global object to prevent re-patching the same file if not Sha...

Hey, didn't read everything, just flew over all those messages a bit, but wouldn't it be better to inject it in this way?

if not SharedModData then SharedModData = {} end
if not SharedModData.isWashYourselfPatched then
  SharedModData.isWashYourselfPatched = true
  ISWashYourself.oldRemoveMakeup = ISWashYourself.removeMakeup
  function ISWashYourself:removeMakeup(item)
    if item and item.name ~= "EllieTat1" then
      return self:oldRemoveMakeup(item)
    end
  end
end

That way, possible future changes to the original removeMakeup function will still take effect, while it'd ignore the tattoo?

agile coral
agile coral
drifting ore
#

flipped the whole tables up side down nothing

agile coral
#

I have a way of checking the room type while in-game, one min while I check that location

errant meteor
agile coral
# drifting ore how ?? -debug ?

Yeah, and the mod I'm working on has a container check to help with distribution. It looks like it counts as part of the aesthetic table

drifting ore
#

so what i should do now copy the distributions from the base game and add my items to it ?

agile coral
#

You inject your loot into the existing loot tables

drifting ore
#

how so ?

#

just add there names to the code ?

agile coral
#

There's an example in the pinned messages from Blair, but I can probably whip up a custom example in a few minutes

drifting ore
#

i read they example

#

its kind of hard to comprehend as Blair was quite frustrated while writing it XD

agile coral
#

Scratch that, got another idea

errant meteor
#

@craggy furnace how would someone go about adding in modded items to your supply drops from EHE?

agile coral
#

@drifting ore Alright here's what I got for ya

#
require "Items/SuburbsDistributions";
require "Items/ProceduralDistributions";

-- Add your table to possible spawn tables
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.EmptyTattooNeedle")
table.insert(ProceduralDistributions.list.SalonCounter.items, 2);
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.TattoosInkBox")
table.insert(ProceduralDistributions.list.SalonCounter.items, 8);
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.LacticAcid")
table.insert(ProceduralDistributions.list.SalonCounter.items, 6);

-- SalonCounter = {
--     rolls = 4,
--     items = {
--         "BathTowel", 10,
--         "BathTowel", 10,
--         "Comb", 8,
--         "Hairspray", 6,
--         "Hairspray", 6,
--         "Hairgel", 2,
--         "Razor", 4,
--         "Scissors", 8,
--     },
--     junk = {
--         rolls = 1,
--         items = {
--             "HairDyeBlonde", 2,
--             "HairDyeBlack", 2,
--             "HairDyeGinger", 2,
--             "HairDyeLightBrown", 2,
--             "HairDyeBlue", 1,
--             "HairDyeGreen", 1,
--             "HairDyeRed", 1,
--             "HairDyeYellow", 1,
--             "HairDyeWhite", 1,
--         }
--     }
-- }
drifting ore
#

and really it will be stealing if i just take the code

agile coral
#

DistributeTo is just a helper for adding items to the tables without having to do two table.insert() calls, then the other lines add your items to the game's distribution tables. That way when it adds items to containers your stuff has a chance to spawn

halcyon marlin
halcyon marlin
#

do you know what i am talking about? i can show you how to do it if you have never done it before

drifting ore
halcyon marlin
#

๐Ÿ‘

agile coral
#

I changed it to just use the most basic functions. That's the most simple way you can do what you need without breaking any other spawning

#

For testing you can bump the numbers to 100 or more

drifting ore
#

now i kinda understand it

#

so i just add the place of spwan the module.item

peak briar
#

hey simple question, or at least it was supposed to be simple, how do i add more mods to an existing save? i was told that i need to place them in the save file, the only thing i found in the save file was a .txt referencing the mods, so i placed the extra mod names in the text, but nothing happened.

drifting ore
#

gn ill keep doing the mod tomorrow

fluid dove
#

would it be possible for me to make a mod that changes the drop rate of katanas, and could I make it so they are more likely to spawn in police stations

#

i think ogrm did something like this in the past

undone crag
#

Yes

fluid dove
#

nice

ruby urchin
#

Anyone know how make the equivalent of Thread.Sleep() ?

dry chasm
#

Or is the goal simply to have something like a timer, to do something in specific intervals, or with a specific delay? o.o

nimble spoke
ruby urchin
#

Basically, I need make triggerEvent until get a variable

dry chasm
# ruby urchin Basically, I need make `triggerEvent` until get a variable

You could probably add a function onto the OnTick Event (Events.OnTick.Add(functionName)) and the function:

local delay = 100; -- replace 100 with the delay expected
local nextAction = os.time() + delay;
function myFunction()
  if os.time() >= nextAction then
    -- your tasks
    if ValueReceived then
      Events.OnTick.Remove(myFunction);
    end
    -- Refresh the next action time
    nextAction = os.time() + delay;
  end
end

Events.OnTick.Add(myFunction);

or something?

#

Probably can be done better, so this should just serve as an idea to solve the issue. If i misunderstood something, sorry ๐Ÿ˜…

#

Not sure though wether or not the onTick event runs when game is in a paused state

split prairie
#

hey lads

#

im playing with the better lock picking mod

#

but i cant lockpick vehicles at all for some reason

#

it doesnt show up on rightclick of v menu

drifting ore
#

Could somebody link me the discord to cherbourg?

ruby urchin
#

Finally

#
LuaEventManager.AddEvent("OnTest")

LuaEventManager.triggerEvent("OnTest", "something")

local Test = function(a)

    print(a)
end

Events.OnTest.Add(Test)
dry chasm
# ruby urchin Finally

Wait wait, your question was regarding a custom event and not a timed action itself?
If so, I apologize for having misunderstood it that much ๐Ÿ˜“

worldly olive
#

wait a minute, is it possible to create custom events?!

dry chasm
worldly olive
#

Damn... that would have helped a while ago ๐Ÿ˜‚ well for sure I will make use of it

ruby urchin
dry chasm
worldly olive
#

So you can use the Trigger your event whenever you want.
I assume the Events has to be created when the game launches or something like that so they are ready to be used later

ruby urchin
# dry chasm Oh, so both? Meaning i didn't get it all wrong! Good ๐Ÿ˜‚

I modified it a bit, I did a script ideal for a framework
FRAMEWORK.lua (Framework mod example)

DiS = {}
DiS.Test = "Testito from ZAD"


LuaEventManager.AddEvent("getSharedObject")


Events.getSharedObject.Add(function(cb)
    cb(DiS)
end)

anything.lua (a random mod)

local Dislaik = nil

Events.OnTick.Add(function()
    if Dislaik == nil then
        LuaEventManager.triggerEvent("getSharedObject", function(obj) Dislaik = obj end)
    else
        Events.OnTick.Remove(self)
    end
end)

print(Dislaik.Test) -- Returns: "Testito from ZAD"
dry chasm
#

Uncertain on what it'd be useful for (I might just be missing some imagination, sorry), but gj! ๐Ÿ‘

ruby urchin
#

Assuming the mods are loaded alphabetically (info obtained from the forum) with this technique you don't need to worry about that nor of generic variables that cause conflicts with other mods (obviusly you still need use local), you can shared data from mod to mod (need new functions for that)

dry chasm
#

So, the idea is for it to check if a certain mod is loaded of sorts?

ruby urchin
#

Basically, waits for the data to be loaded

dry chasm
#

But, in case of requirement of another mod existing, you can use require, to my knowledge, even for modded files, which should (in theory) ensure that their global variables and such are loaded before it executes one's own.
While it would provide a possible way of sharing data with less chance of incompatibility due to global variable naming and such, most mods'll probably try to get the data instantly and act on it, instead of delayed (even if it's just one more tick, for example.)
Atleast, from what i imagine the most common incompatibility issues arise from injection into functions and doing stuff (possibly even completely overwriting it without ever again running the original) or due to naming fashion of variables, which get overwritten due to two mods using something similar, but naming it the same. ๐Ÿค”
(and well, items and such as well, but that's less on the lua side i guess, unless it's in regards to lua item tweaks)

#

I might currently be on a whole different thought train though, so I apologize if I'm completely wrong ๐Ÿ˜‚

ruby urchin
#

If I'm not wrong, require() just load the mod\file.lua again right?

dry chasm
#

no no

#

require causes a certain file to load, however, it will not load a file again, even if you have 2 different files with require "modFile"

#

similar to lua's "doFile", with the exception that it won't load the file again (to avoid duplicates)

#

Not entirely sure if it accepts files from mods though, but i would guess it does.

ruby urchin
#

I mean, what happens if I have a mod, and the initial data of a variable was changed, if I make a call that mod/file.lua with require, what do i get? The initial data or the data changed?

#

btw, I think the version of lua who uses the game is old lmao

dry chasm
#

well, it's kahlua to be exact to my knowledge, so not "actual" lua

ruby urchin
#

I thought so, there are functions in the documents that are not in the game

dry chasm
#

But if you have require for a certain mod file, you just ensure that the variables are defined from that other mod. (local variables will still be unaccessable)
so if there are any changes to them, you'll have them on the other side as well

#

hm? Functions that do not exist?

ruby urchin
#

sorry, I'm sleeping

dry chasm
#

all good, im tired as well ๐Ÿ˜‚

ruby urchin
#

Ok, I will test require, I haven't used it yet, I completely forgot that environment variables don't apply here

#

Well, now another aesthetic snippet
..\media\lua\client.blablabla.lua

local loadConfigFile = function(path)
    local readFile = getModFileReader("DCPbyDislaik", path, false)
    local code = ""
    if readFile then
        while true do
            local scanLine = readFile:readLine()

            if scanLine ~= nil then
                if code == "" then
                    code = code .. scanLine
                else
                    code = code .. "\n" .. scanLine
                end
            else
                break
            end

        end
    end

    return loadstring("return function() local " .. code .. " return Config end")()()
end

local config = loadConfigFile("Config.lua")
print(config.Test) --Returns "This is a testito"

..\media\Config.lua

Config = {}
Config.Test = "This is a testito"
dry chasm
#

that's... confusing... ๐Ÿ˜‚

ruby urchin
#

Yeah, clean code is not one of my strong points unhappy

dry chasm
#

it's clean enough. Though using lua as a config is in my own opinion kind of confusing

#

though, I don't have any points that speak against it, so do not worry about it ๐Ÿ˜‚

royal ridge
#

Is there anything like Events.OnCellLoad.Add()

dry chasm
#

According to pzwiki, there's also

Events.LoadGridsquare -...
Events.ReuseGridsquare -...
Events.OnFillContainer -...
Events.OnMapLoadCreateIsoObject -...
Events.OnPostMapLoad -...
Events.OnSpawnRegionsLoaded -...
Events.OnSeeNewRoom -...
Events.OnTileRemoved -...
Events.OnGridBurnt -...
Events.OnPostFloorSquareDraw -...
Events.OnPostFloorLayerDraw -...
Events.OnPostTileDraw -...
Events.OnPostWallSquareDraw -...

But wether they actually exist or not(or not anymore) i don't know ๐Ÿค” (also might've overlooked some, not sure)

royal ridge
#

thanks

dry chasm
# royal ridge thanks

Headsup, careful with print() in Events.LoadGridsquare.Add(...)
froze for several minutes, so i terminated the process and changed it to just count a variable up. After finishing loading it had 38181 Gridsquare's loaded, roughly 2k more after a few steps

royal ridge
#

yea it would load print for every grid square it loads haha'

dry chasm
#

just had to realize the amount that's loaded at once... ๐Ÿ˜‚

drifting ore
#

welp time to try and test out the thang

dry chasm
#

thang?

drifting ore
#

yep the thang

#

the new thang

drifting ore
#

yusssssssssssss

#

and they empty one works too

dry chasm
#

Ayy! Congrats! ๐Ÿ˜

royal ridge
#

is there anyway to make a timer?

#

like have a function be called every 5 seconds?

dry chasm
#
Events.OnTick
Events.OnTickEvenPaused
Events.EveryTenMinutes
Events.EveryDays
Events.EveryHours
onyx hollow
#

how hard is map making?

drifting ore
dry chasm
#

I can try atleast

drifting ore
#

now you have the needle brush ink acid

#

the empty ones aren't usable

#

and the filled ones are usable for make up

#

how can i make it drain each time i use a make up ?

#

@dry chasm

#

i know these items drain when you drink etc. but make up was always a normal item

dry chasm
#

Hmm... never used makeup before and never did a drainable item before.
Though, how's it acting at the moment? Does it just "disappear" instead of "draining" (using parts of it)?

drifting ore
#

so i can't really tell if it will disappear or stay

dry chasm
#

So the first hurdle would be to make it useable, right?

drifting ore
#

i am new to modding and programming in general

#

but yes looks like we need to make it work first

dry chasm
#

Now, for the beginning you could have it possibly add "normal" makeup, instead of custom tattoos, for that i'd suggest making a backup of your file there first and then treat the needle (if it's intended to only use the needle that is) as that makeup item

#

so, i would guess the "MakeUpType" should change to something already existing, so instead of Body, it'd be FullFace or something

#

Then you could test and see if it uses it up bit by bit, or just doesn't use up any of it, or if it completely uses the item up, instead of just a part of it

drifting ore
#

i could try yea

#

sec

dry chasm
#

Take your time ๐Ÿ˜…

drifting ore
#

so i commented out the body in definitions

#

and will change the item to lips for example

dry chasm
#

๐Ÿค” ? You mean you change the needle's "MakeUpType" to lips or something? Then yes (just ensure you keep most of the file somehow save to easily revert any changes - best done by saving the file in another location - preferrably with an indicator in file name to ease the work needed to find the correct one when you have a need to revert changes)
Especially when new to modding, I can't stress enough on how useful backups can be.

drifting ore
#

many thanks

#

ok so i did it but still

dry chasm
#

Still doesn't show any options?

drifting ore
dry chasm
#

just to ensure, how's the item looking now?

item FilledTattooNeedle{
  Type              = Drainable,
  UseDelta          = 0.2,
  ReplaceOnDeplete  = EmptyTattooNeedle,
  DisplayName       = Filled Tattoo Needle,
  Icon              = FilledTattooNeedle01,
  MakeUpType        = Lips,
  Weight            = 0.01,
  WorldStaticModel  = FilledTattooNeedle_W,
  StaticModel       = FilledTattooNeedle_S,
}
#

like so?

drifting ore
#

yes it is the same

#

item FilledTattooNeedle
{
Type = Drainable,
UseDelta = 0.2,
ReplaceOnDeplete = EmptyTattooNeedle,
DisplayName = Filled Tattoo Needle,
Icon = FilledTattooNeedle01,
MakeUpType = Lips,
Weight = 0.01,
WorldStaticModel = FilledTattooNeedle_W,
StaticModel = FilledTattooNeedle_S,
}

dry chasm
#

just to ensure though, a normal lipstick does show the option, right?

drifting ore
#

sec

drifting ore
#

normal one isn't working

dry chasm
#

hmm

#

ok, it does work on my side

#

do you have anything that overwrites original functions?

drifting ore
#

yea definitions i removed it and trying it out

dry chasm
#

Oh wait, you removed the normal Makeup definitions?

drifting ore
#

no

#

i made another one in my mod

#

so it can overwrite the base one

dry chasm
#

wouldn't it be better to add onto the base one, instead of overwriting?

drifting ore
#

it works yea

drifting ore
#

i could copy the base one and edit on it

#

sadly it doesn't drain or disappear after you use it

dry chasm
#
require "Definitions/MakeUpDefinitions"

-- adding a new category:
local customCategory = {
  name = "Body",
  avatarZoom = 10,       -- Unsure how it's exactly used, possibly zoom on character model to see it better?
  avatarYOffset = -0.30, -- Probably similar to above, just offset to the height
  avatarXOffset = 0.00,  -- can be left out if not necessary
  category = "Body"
};
MakeUpDefinitions.categories["Body"] = customCategory;

-- adding a new Makeup:
local customMakeup = {
  name = "TattooFullBody1",      -- Just the tattoo name? Probably usable with Translation?
  category = "Body",             -- Category the makeup is supposed to be for
  item = "ModModule.TattooItem", -- the item referring to the tattoo, not the one needed to apply the tattoo (not the needle)
  makeuptypes = {
    All = true,                  -- No clue, not used makeup enough to understand it.
  },
};
table.insert(MakeUpDefinitions.makeup, customMakeup);

Possibly?

echo sky
dry chasm
#

oops

drifting ore
#

insert yea

dry chasm
#

good catch

drifting ore
#

was checking the parameters on the wiki to see if there is one that can make me drain on make up

#

but no nothing there

late hound
dry chasm
late hound
#

You can use that to zoom in on any region of the character.

drifting ore
#

so when making definitions for a mod i just use the base code and edit on it

#

then add it to my mod folder?

dry chasm
# drifting ore was checking the parameters on the wiki to see if there is one that can make me ...

You could probably inject onto the onApplyMakeup method of ISMakeUpUI

local originalOnApplyMakeUp = ISMakeUpUI.onApplyMakeUp; -- either this
-- local ISMakeUpUI.originalOnApplyMakeUp = ISMakeUpUI.onApplyMakeUp; -- or this
function ISMakeUpUI:onApplyMakeUp()
  if self.item:getFullName() == "ElliesTattooParlor.FilledTattooNeedle" then -- check if the item used for the makeup is infact your needle
    self.item:Use() -- unsure here, like i said, never made or did anything modwise with drainables ^^'
  end
  return originalOnApplyMakeup(self) -- either this
  -- return self:originalOnApplyMakeUp() -- or this
end
dry chasm
# drifting ore so when making definitions for a mod i just use the base code and edit on it

no no, as it's just variables (tables) you can just expand on them straight away without having to overwrite them like in my example above (unless i made a mistake)
the local variables are just for the file you're currently in and beneath both local variables in the example above, we add the local variable onto the original definitions
MakeUpDefinitions.categories["Body"] = customCategory; is so to speak the same as MakeUpDefinitions.categories.Body = customCategory;
as MakeUpDefinitions.categories already exists due to the original definitions file, we just add your category definition onto it in the same fashion the original one expands it (in this case, might be changed in the future though, who knows)

As for the other one, it uses a table like a list, instead of like an object.
The difference here is that an object can have named properties (or variables for simplified matters)
while a "list" can be iterated with numbers, if you wish to have a slightly more detailed explanation I can try my best (though i may just link this here for starters)
https://www.lua.org/pil/1.html

drifting ore
#

but won't it trigger each time i open the ui?

dry chasm
#

the onApplyMakeUp? It will only trigger once you hit the "Apply" button, if available

drifting ore
#

great

drifting ore
#

@dry chasm

#

like this

dry chasm
#

wait, have you just copied the whole file over into your own? ๐Ÿ‘€

drifting ore
blissful copper
#

Sorry to interrupt, is the steam workshop broken for someone else? the discussion sections within the mod pages are gone for me, and the mods don't display dependencies/required items.

dry chasm
sour island
#

Workshop is also hosted on its own server and it's not very stable at times

blissful copper
#

Yeah, I checked Arsenal26's gunfighter mod since I know that mod has dependencies and has an active discussion section for bug finding and seems like they are having the same issue.

drifting ore
#

anyone knows a way to add a body location under the bandages ?

#

like this but i don't wanna edit the base file as i want it as a mod

cyan drum
#

So are most clothes (basically everything except hats, jackets, skirts, and dresses) just textures mapped on to the body?

vapid lantern
#

Did they change the way clothing was coded into the game, I was trying to add clothing recipes, but it stops the crafting menu from working(I might just be stupid tbh)

vapid lantern
#

ok I compared my code with another mods code and I still have no idea what I did wrong

late hound
drifting ore
#

Hi all, bit new and trying to figure out how to properly handle a system i'm making for special zombies, I can see a zombieUpdate event which I'm assuming is just a processing event, but is there any way to do something to a zombie on its creation?

drifting ore
#

has anyone noticed the discussion tab on mods in the workshop has disappeared?

drifting ore
#

yes

nimble spoke
#

update history is gone too

errant meteor
drifting ore
#

What happened?

errant meteor
#

update history is gone on steam mods

drifting ore
#

Weird

drifting ore
#

is steam bugged? or did an update happen that they didnt tell us about?

#

wait did the entire discustion tab of steam disappear too?

#

no but the search engine isnt working

#

nvm didnt have enough terms for it to work with xux'

drifting ore
#

the tabs are back now >.>
weird....

drifting ore
#

probably someone is missing with stuff on the server side

#

oof

late hound
#

Probably was maintenance related. If they wanted to permanently remove them, they would have created an announcement about it.

ruby urchin
pine tree
#

cranks up military spawn rate to 100%

strange kiln
errant meteor
strange kiln
#

next we need a fallout map

#

๐Ÿ‘€

strange kiln
#

how many flavors?

errant meteor
#

10+

#

All models are 3D and quantum has some life saver combat effects

#

Drink one and you are back in fighting shape

errant meteor
strange kiln
errant meteor
#

Still stimpacks that will aid in healing

#

Well should be easy to make a model for fallout stimpacks if the code is done

#

Might consider it

wide inlet
errant meteor
candid sonnet
#

hallo newbie here, evolvedrecipe is for starting cooking right (e.g. Prepare Stew)? and recipe is just for the normal crafting menu? thanks

nimble spoke
candid sonnet
#

wait, does itemtweaker ammend or replace? of course it replaces duh sorry for the stupid question

nimble spoke
#

hhmmm I should probably write a function so that multiple mods can override that value with no conflicts

candid sonnet
#

Yea just adding your items to the evolved recipe param would be better. Can't think of any solution out the top of my head tho tired . Thanks a lot for the help!

craggy furnace
drifting ore
#

Is it possible to spawn particle effects? I know it's possible to do smoke by spawning grenade effects but I was curious what else is possible

little vessel
craggy furnace
little vessel
craggy furnace
#

some of find a large bulk of our time redoing that over and over lol

#

iirc on the top of my head the only stuff that resets is xml, models, and (i think?) lua

little vessel
#

I did that for a long time before finding out f11 could be used to reload stuff.

grizzled grove
#

i'm only learning about this ๐Ÿ˜ฎ

craggy furnace
drifting ore
#

Anyone know the name of the mod where you can spawn with food?

#

It's like preparedness or something like that

craggy furnace
#

you mean like dwarf fortress stuff?

#

start with an axe, food, medicine, etc?

little vessel
dry chasm
# craggy furnace iirc on the top of my head the only stuff that resets is xml, models, and (i thi...

Lua can be reloaded via the debug's F11 menu if necessary. Though, it can cause issues depending on what and when one reloads.
For example a file that just adds on to variable would just add unnecessary duplicates to it, so the original file defining those should be reloaded first and such.
Alternatively, when "injecting" into other functions and one has an error there for example, that too would require the original to be reloaded first, then the modded file.
Then there's also the possibility of adding on to non-lua defined stuff, reloading those files doesn't help either.
So once issues come up, it's best to go back to main menu and just reload all lua/mods or even better yet, completely restart the game for those issues (to ensure it's all run nicely). So yea, restarting's still a good thing for lua as well, depending on what exactly one works on ๐Ÿ˜…

little vessel
craggy furnace
drifting ore
#

I found it

#

It was apart of the "More Traits" mod.

grizzled grove
#

i mostly do mapping/sprites, map stuff always needs a new game anyway, but i'll have to check reloading for sprites or tile properties when i can

craggy furnace
#

i just learned that (some) scripts actually do reload?

#

bizarre

delicate steppe
#

Can some please make a mod to bring back 360 degrees shooting from a vehicle with a window open... miss it so much lol

echo leaf
#

Bit of a dark art if you've already explored the area in question, but if you've never explored the area you want to add the map to then its actually really easy!

#

I wrote it down somewhere...

#

"If you've found a new map that you'd like to add to an ongoing playthrough please follow the following steps:

  1. Subscribe to new map mod(s).
  2. Enable the new map mod(s) on an existing save (Save A).
  3. Create a new game with the same map mod(s) enabled (Save B).
  4. Quit back to main menu.
  5. Find Save B's files (usually located in C:\Users\USERNAME\Zomboid\Saves) and copy and replace 'map_ver.bin' to Save A's file location (backup original).
  6. Load Save A.
  7. ???
  8. Profit.

Removing maps or clearing an area where you'd like to add a map (in the case you've already traveled to the area before adding the map) can be done similarly, however every cell ('map_XXX_YYY' and chunkdata_XX_YY) associated with that map mod needs to also be deleted (which can be quite an arduous task to figure out exactly which those are). I recommend using the PZ Map website to help identify the coordinates if you choose to undertake this task (https://map.projectzomboid.com/).

Also, you can update the games settings mid-save by following the same process for the map_sand.bin file."

grizzled grove
#

yeah, not fast at all when you're wanting to test small changes, but thanks

echo leaf
#

Oh definitely not for quick QA testing

grizzled grove
#

that's helpful stuff otherwise!

echo leaf
#

But, possible none the less ๐Ÿ˜„

#

Thanks for your tiles btw

drifting ore
#

work in progress

#

now you can add tattoos to your character

#

soon tm

west crystal
#

cool

rough birch
#

Does anyone know which event to check when the player performs an attack on a zombie, is it possible to make attack animations with which event I make animations?

drifting ore
#

wait what is the left arm location on this texture

drifting ore
#

its ok i got it

pine tree
#

I have no idea if this would work or not

#

and if so how do I make it so that it drains batteries?

#

Does anyone know where I can find Recipe.OnTest.TorchBatteryInsert?

#

Or maybe I can just use that for the videogame?

#

this is what im going with

candid sonnet
# pine tree Does anyone know where I can find Recipe.OnTest.TorchBatteryInsert?
-- Return true if recipe is valid, false otherwise
function Recipe.OnTest.TorchBatteryInsert(sourceItem, result)
    if sourceItem:getType() == "Torch" or sourceItem:getType() == "HandTorch" or sourceItem:getType() == "Rubberducky2" then
        return sourceItem:getUsedDelta() == 0; -- Only allow the battery inserting if the flashlight has no battery left in it.
    end
    return true -- the battery
end```

lua\server\recipecode.lua
agile coral
#
-- Return true if recipe is valid, false otherwise
function Recipe.OnTest.TorchBatteryInsert(sourceItem, result)
    if sourceItem:getType() == "Torch" or sourceItem:getType() == "HandTorch" or sourceItem:getType() == "Rubberducky2" then
        return sourceItem:getUsedDelta() == 0; -- Only allow the battery inserting if the flashlight has no battery left in it.
    end
    return true -- the battery
end

-- When creating item in result box of crafting panel.
function Recipe.OnCreate.TorchBatteryInsert(items, result, player)
  for i=0, items:size()-1 do
    -- we found the battery, we change his used delta according to the battery
    if items:get(i):getType() == "Battery" then
        result:setUsedDelta(items:get(i):getUsedDelta());
    end
  end
end
#

Looks like the Recipe.OnCreate.TorchBatteryInsert is what you want

candid sonnet
#

I suggest you copy this function and make one for your mod rather than making a new copy of recipecode.lua and altering it SataniaThumbsUp

pine tree
#

Yeah I agree, Im definitely not advanced enough to doing that

candid sonnet
#

just make a lua file on lua\server\ then add your function to it. The recipe.txt file can find it as long as it's global

agile coral
#

Here's how I do it in one of my mods

pine tree
#

Umm this might be dumb but I can use notepad++ to edit those lua files right?

candid sonnet
#

yup!

pine tree
#

sweet

candid sonnet
#

idk if you get syntax highlighting but it should work even in normal Notepad

pine tree
#

Couldnt I just edit recipecode directly?

candid sonnet
pine tree
candid sonnet
#

It's best practice to just make a lua file containing the function for your own needs

pine tree
#

I have zero training in Lua, just a basic general programming class

#

But I understand that

candid sonnet
#

Yea it is daunting at first but you'll get the hang of it

agile coral
#

Also making the money stack weight change as you gain more money

dire oracle
drifting ore
#

guys are you ready for the tattoo poll vote closes in 24h

errant meteor
#

marine raiders boi

agile coral
#

luckily it'll be just as easy to add new tattoos as it is to make clothes once the mod is released

errant meteor
drifting ore
agile coral
#

hehe

drifting ore
#

but dw if i see your vote ill leave eyes on it

pine tree
#

Okay, so everythings looking good, battery goes in, battery goes out. neat. but now it looks like this recipe duplicates the videogame everytime i go to play

candid sonnet
#

hello question on recipes, is it possible to add multiple outputs in the script file? or are we just stuck with just spawning it through lua? would like to see the output through the crafting menu tho

pine tree
#

sorry thats not the recipe

#

this is, idk why it duplicates the item when i go to use this recipe

agile coral
#

What does the code for your OnCreate event look like?

candid sonnet
#

I think you need to have destroy VideoGame

agile coral
#

Ahh, yeah that's what is missing

candid sonnet
#
recipe Play Video Game
{
  destroy VideoGame,
  Result:VideoGame,
...
#

idk kinda janky but i think that works

nimble spoke
#

why not make it a timed action?

candid sonnet
#

yea makes more sense that way

pine tree
#

Isnt it already timed?

drifting ore
#

i have added more options also you can check https://www.pitbulltattoothailand.com/tattoo-knowledge/top-10-tattoo-styles/ before you post your vote just in case you wanna better understand what your looking for https://www.poll-maker.com/poll3916683xf2A1241A-124 vote end in 11 pm eu time tomorrow

Best Tattoo Studio in Phuket Thailand - Pitbull Tattoo Phuket

โž‰ Learn more about the different tattoo styles. โ– No matter if youโ€™re looking for traditional tattoos or modern art โž™ Find your style

pine tree
#

So while you guys are right about destroy videogame, now the battery level doesnt save and just makes it so it has full battery everytime i use it ๐Ÿ˜ซ

candid sonnet
pine tree
#

do you know an example of a base timed action?

candid sonnet
#

check luaexamples\testtimed.lua

pine tree
#

thank you!

candid sonnet
#

but i think it's outdated, not sure tho

#

that's a good lua exercise too

agile coral
#

Feel free to copy it so you can change it for your use

candid sonnet
#

My food mod is nearly done, what translations are mostly used?

nimble spoke
#

russian and chinese

drifting ore
#

would you be interested in

agile coral
#

There are a lot of Russian players, so definitely that. There's also some Chinese, Spanish, and Portuguese

nimble spoke
candid sonnet
#

aighty thanks!

agile coral
#

"The tattoo trends of the 90s were heavily dictated by popular celebrities of the decade. The barbed-wire arm band became hugely popular thanks to Pam Anderson; both men and women flocked to get tattoos to match the Baywatch beauty.

We canโ€™t forget the classic 90s tattoo fads โ€“ sun tattoos, Chinese letters, and tribal designs were massively popular during the 1990s. Upper arm tattoos were big during this decade.

You werenโ€™t anybody in the 1990s if your tattoo didnโ€™t match one of these super trendy fads; if the Spice Girls did it, you knew it was cool."

#

Sounds like we'll need the obligatory "MOM" tat

drifting ore
agile coral
#

lol

lean marsh
#

is it possible to create an armor and some sort of upgrade for it? I know a bit of modeling but I have no idea if it's possible to do something like that

candid sonnet
#

Any guides for 3d item models? forgot i needed to make those

errant meteor
#

pins

candid sonnet
#

Clothing workflow is the same as 3d items?

#

OOH i see it now, thanks

pine tree
#

Alright I give up, timed actions is way beyond my skill level

agile coral
#

what are the things you need it to do?

pine tree
#

decrease unhappiness by 10, decrease boredom by 10, drain battery by 20% per use, time to use should be 300

#

and obviously no uses when battery is 0

unborn fable
#

How do I reference items that aren't in Base inside of a custom script? I have a trait mod that adds new traits and inventory items to traits but I don't know how to import items from, say, camping into it so that I can reference them without generating errors. I'm apparently not great at LUA.

#

I was trying to do a big update to my Embark mod but hit this quite embarrassing barrier when I realized all my camping derived items were spewing errors. ๐Ÿ˜ซ

agile coral
#
require "TimedActions/ISBaseTimedAction";

QoLESPlayAction = ISBaseTimedAction:derive("PlayGameAction");

function PlayGameAction:isValid()
    return self.character ~= nil and self.item ~= nil and self.item:getUsedDelta() > 0 and (self.bodyDamage:getBoredomLevel() > 0 or self.bodyDamage:getUnhappynessLevel() > 0);
end

function PlayGameAction:update()
    self.item:setJobDelta(self:getJobDelta());
end

function PlayGameAction:start()
    self.item:setJobDelta(0.0);
end

function PlayGameAction:stop()
    self.item:setJobDelta(0.0);
    ISBaseTimedAction.stop(self);
end

function PlayGameAction:perform()
    -- Reduce uses
    self.item:Use();

    -- Change mood
    self.bodyDamage:setBoredomLevel(math.max(self.bodyDamage:getBoredomLevel() - 10, 0));
    self.bodyDamage:setUnhappynessLevel(math.max(self.bodyDamage:getUnhappynessLevel() - 10, 0));

    -- needed to remove from queue / start next.
    self.item:setJobDelta(0.0);
    ISBaseTimedAction.perform(self);
end

function PlayGameAction:new(item, character)
    local o = ISBaseTimedAction.new(self, character);
    setmetatable(o, self);
    self.__index = self;
    o.stopOnWalk = false;
    o.stopOnRun = true;
    o.character = character;
    o.bodyDamage = character:getBodyDamage();
    o.item = item;
    o.maxTime = 300; -- Time until the action finishes (in ticks; ~30/sec)
    return o;
end
#

300 ticks, drops each by 10 and does one use for 20%

pine tree
agile coral
#

save that as a file in your mod's lua/client/TimedActions folder

#

then you can call it with PlayGameAction:new(item, player)

pine tree
#

and that would go under the item VideoGame?

candid sonnet
#

You can add PlayGameAction:new() to your OnCreate function

#

and I assume you pass through the item & player variables

#

oh wait

#

sorry dont mind me that was wrong

pine tree
#

So not OnCreate?

#

That was my best guess

candid sonnet
#

no, since you are not using a recipe

agile coral
#

that'll get you banned my guy

solar prawn
#

really?

#

dang

#

nvm

#

alr

agile coral
#

it's not ready for MP, so they're very against anyone trying to mod or hack it in

solar prawn
#

ah

#

even though theres

#

multiple

#

documents on how

#

lol

agile coral
#

they're going to break your game in one way or another each update, so no point really

solar prawn
#

true

agile coral
#

no hard date, but the latest blog posts make it sound like it's going well so far

solar prawn
#

good

fallow bridge
agile coral
# pine tree So not OnCreate?

Here's how you can make it work by creating a new context menu item with the option to "Play Video Game" and will start the timed action as long as it has uses

#
MyMod.createMenu = function(_player, context, items)
    if #items ~= 1 then return end

    local item = items[1];
    if type(item) == "table" then
        -- We jump over the dummy item that is contained in the item-table.
        item = item.items[1];
    end

    if instanceof(item, "InventoryItem") then
        local player = getSpecificPlayer(_player);
        if item:getType() == "VideoGame" then
            context:addOption("Play Video Game", item, MyMod.playGame, player);
        end
    end
end

MyMod.playGame = function(game, player)
    PlayGameAction:new(game, player)
end

Events.OnPreFillInventoryObjectContextMenu.Add(MyMod.createMenu);
#

You'll want to change "MyMod" to whatever your mod's module ID is of course

#

And that file gets saved to lua/client/UI in your mod folders

pine tree
#

Brilliant man, you solved all my questions, I'm gonna finish this thing tonight!

agile coral
#

Awesome, hope it works how you want it!

true crown
#

How do I check when right clicking the world if it's a zombie I'm clicking at?

#
  • a dead zombie
#

oh

#

got it

unborn fable
#

require('camping'); require('farming');

Is this correct for accessing non-Base items using inv.additem?

agile coral
#

inv:addItem("Module.itemName")

#

Where Module is your mod ID

pine tree
#

the mod ID is the 3 letter ID right?

#

this id? @agile coral

pine tree
#

Also I think that UI file should put in the client/context, right?

#

or the ISUI probably

candid sonnet
#
Added optional vehicle.passenger.showPassenger=true|false parameter for iBrRus.

poggers can't wait for tsar's motorcycles and bikes

pine tree
drifting ore
#

Are the old sound files (before the soundworks update) still in the game files?

fringe oxide
#

MODDING

  • Added optional vehicle.passenger.showPassenger=true|false parameter for iBrRus.
    When true, the player model isn't hidden when entering, exiting or sitting in that particular seat.
#

Motorcycles

#

Ye

pine tree
#

can sit in a car

#

cant sit in a chair

fallow bridge
pine tree
#

Cars with no roofs

dire oracle
agile coral
candid sonnet
#

Are vehicle gas tanks always on the left side?

#

ok I think vanilla vehicles are always on the left and Filibuster has some on the right. Kinda annoying. Time to make a fuel indicator mod.

sturdy coral
#

is there a mod to make portable coolers that workings?
make it more balanced by have to find ice pack to keep food fresh and the cooler has small volume only so 5 kg of food maximum
it would be cool so i can ride around my car and i am not sad when my egg sandwich is rotten

sturdy coral
#

thank you so much

candid sonnet
#

np

sturdy coral
#

will save my egg sandwich too

unborn fable
# agile coral inv:addItem("Module.itemName")

Hm, but if I do like inv.AddItem("camping.CampingTentKit"); for example, it results in an error message and I'm not sure why. All items from Base work though (like Base.Sheet, etc). I mean, I guess I can try again, maybe I'm making some kind of spelling/capitalization mistake.

candid sonnet
#

hi does anyone know which color is XYZ tired

#

and does kahlua support vector3(x,y,z) or do i have to calculate distance manually tired

raven brook
#

Usually red X, green Y and blue Z

candid sonnet
drifting ore
#

There's a difference between the two, : supplies inv as the first argument :)

unborn fable
#

Sorry, to be clear that is what I'm doing. I made a mistake in my Discord message.

drifting ore
#

Ahh

#

What build are u on?

#

Oh wait nvm u said other things worked

unborn fable
#

I'm in IWBUMS

#

Yeah, base items all work, but stuff in the camping/farming category do not

drifting ore
#

hmm then I'm not sure personally. Sorry

candid sonnet
#

what error does it throw

unborn fable
#

(Why aren't all items just in base, the camping category is literally like 5 items... ๐Ÿ˜’ ) lol

dry chasm
unborn fable
#

Yeah, camping and farming modules should be all lowercase, right?

dry chasm
#

farming not sure, but on my quick test right now, camping is lowercase

#

and works on my end

unborn fable
#

Hm, so frustrating

dry chasm
#

so as example getPlayer():getInventory():AddItem("camping.CampingTentKit")
in the command console did work

#

alternatively, there's also the possibility, depending on when you try to add it, that for some reason the module hasn't loaded yet, which I can't imagine actually happening.

unborn fable
#

Yeah that seems pretty unlikely - my mod is a trait mod that adds items to your inventory when you finish character creation and load into the map during the black screen (which is also when the error pops) and those camping/farming items are the only ones that pop errors

dry chasm
#

what exactly is the error message?

unborn fable
#

Not very descriptive unfortunately, here's what's in the console.txt

#

function: initEmbarkItems -- file: EmbarkTraits.lua line # 97

#

But doesn't say what the issue is...?

dry chasm
#

is it an actual error throw, or a LOG : GENERAL ,x>ERROR: ItemContainer.AddItem: can't find...

#

aside from the location, shouldn't it throw more info?

unborn fable
#

Or, is this supposed to be the full error?

`LOG : General , 1633073838007> -----------------------------------------
STACK TRACE

Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@b4a69738
function: initEmbarkItems -- file: EmbarkTraits.lua line # 97`

dry chasm
#

<@&671452400221159444>

candid sonnet
#

wtf

dry chasm
#

don't click the link

candid sonnet
#

line 97 is the playerinventory.AddItem()?

unborn fable
#

Yeah it is

candid sonnet
#

oo im stumped also

#

wouldn't hurt to restart pz ๐Ÿ˜‰ i just had an error that wouldn't go away and it magically disappeared when I restarted

dry chasm
#

but you're sure other items do work?

unborn fable
#

100% sure

#

That's why I originally asked if I was supposed to like... "import" farming/camping into the script somehow... I feel a bit dumb, I've been doing C# coding for years but I'm shite at debugging lua

candid sonnet
#

kahlua on top of that, vanilla lua is easy to debug but slap lua on java and it gets blurry as hell

dry chasm
#

i haven't had any errors on my end yet that weren't informative ๐Ÿ˜‚
most of mine were like this:

unborn fable
#

Also my mod is quite popular and I feel bad that I'm too stupid to update it with this stuff I'm adding. lol

dry chasm
#

simply the "Object tried to call nil in console" type of issues is such a great help for example.

unborn fable
#

Hmm, yeah

candid sonnet
#

this was the guy that was bugging me for an hour until I restarted and it was gone lolol

unborn fable
#

Interesting... I mean, I can try restarting the game with the mod still loaded and see if that somehow jiggles it to work

#

I'd be pretty mad, but ๐Ÿ˜›

candid sonnet
#

sometimes it needs a lil slappin

dry chasm
#

if you hadn't done that yet at least once, you should... xD

dry chasm
candid sonnet
#

yea, doing it right now since it's been tested and works

unborn fable
#

Oh my god I'm going to hide myself for the rest of my life, I don't even want to say what the problem was

#

lol

dry chasm
unborn fable
#

So, I HAVE been using : like a good smart boy the whole time in the rest of the script, but as I said I am a C# programmer and... for that ONE line, I fell into the habit of using the . and so whoever pointed that out earlier, I really should have double checked the actual script

#

I think I need a coffee

dry chasm
#

you can continue using . in most cases, you'll just have to remember passing the object you call it from as the first parameter

drifting ore
dry chasm
#

Might not be the best solution, but if necessary i don't think that it'll cause issues

#

in definitions? as in lua/shared/Definitions?

drifting ore
#

yea

candid sonnet
#

YES that also bugged me yesterday lmao

drifting ore
#

i checked the console XD and dam that was funny

dry chasm
#

but... i do have comments in there?

candid sonnet
dry chasm
#

not sure where the problem should be, as it works on my ends with comments o.o

#

just to ensure though:
You don't mistake script comments with lua comments and the other way around right? o.o

candid sonnet
#

i use ctrl+/ on lua (vsc) and manual on scripts

dry chasm
#

not using vsc so no clue there. ๐Ÿ˜…

candid sonnet
#

where... are the images???

#

kinda spooky

dry chasm
#

probably inside a texture pack

candid sonnet
#

oh right, i remember seeing these with the zomboid logo