#mod_development

1 messages ยท Page 511 of 1

quasi geode
#

this is essentially a stripped version of the code orgm used to read/write the settings .ini file

#

kahlua doesnt have the io.* module

willow estuary
#

Just a fun tangent here, but the earlier code I posted, that loads functions from a text file, was something I was interested in a means for servers to have server specific quest/puzzle/progression mechanics functions that would be unavailable for rascal players to solve via peeping the server mod files ๐Ÿ˜‰

wind stratus
#

any1 willing to take a look at my collection and tell me which mod specifically isnt functioning?

frank elbow
spiral plover
#

This could definitely come in handy for my competitive server leaderboards system

willow estuary
quasi geode
#

no io.* or os.* or math.random...theres probably a few more i'm forgetting

wind stratus
#

@willow estuary ah gotcha, sorry bout that didnt see that one

willow estuary
#

Yeah, no sweat. It's a new channel anyways and all? ๐Ÿ‘

spiral plover
#

Aha! I've figured it out!

#

The client and the server's radio frequency is different

#

it is being made, but the client's information isn't in sync

#

I looked into the server's logs and it listed a frequency so I tuned into that one and it was there

#

Now, does anyone know any functions to grab the server's specific info?

#

Yeah, the issue is the sandbox variable info and the server info aren't in sync..

valid terrace
#

MOD SUGGESTION: Cars have lighters in them 1993. Every single car came with a car lighter.

spiral plover
#

@sour island I know you were mentioning issues with servers and clients not having syncing variables for EHE, did you find a reliable method to grab stuff from the server to send to the clients?

#

In my case, the radio frequency is mismatched between the client and the server, and while if the client can find it they can tune in, but I can't grab it for checks

quasi geode
spiral plover
#

Do you have an example/link?

#

I was just looking at that for EHE but couldn't quite understand how the module/command stuff work

quasi geode
#

uh not a clean one? its probably in like 7 different places scattered through the files. might beable to clean it up a bit though

#

will take a few minutes

spiral plover
#

That's all good, if you're willing to clean it up to show that would be awesome but I can keep poking around otherwise

#

@quasi geode Really what I need to know is a basic flow, so theoretically if I want to fetch the server's variable stored in gametime for example, I would do a OnClientCommand when the player connects, which is just the client asking the server to respond. I'd then do something like sendServerCommand which goes to a OnServerCommand function, where it gets gametime moddata (presumable only from the server?) and returns it via triggering another function or something?

quasi geode
#

well, its not exactly cleaned up, but i isolated the code at any rate:

-- Client side:
--[[- Triggered by the OnTick Event.

Requests the ORGM.Settings table from the server.

This is only triggered on the first tick, it seems sendClientCommand will not
properly trigger OnGameStart (GameClient.bIngame is false?).
Removes itself from the event queue after.

Credits to Dr_Cox1911 for the OnTick trick in his CoxisReloadSync mod.

]]
Callbacks.requestSettings = function(ticks)
    if ticks and ticks > 0 then return end
    if isClient() then
        ORGM.log(ORGM.INFO, "Requesting Settings from server")
        sendClientCommand(getPlayer(), 'orgm', 'requestSettings', ORGM.Settings)
    end
    Events.OnTick.Remove(Callbacks.requestSettings)
end

CommandHandler.updateSettings = function(args)
    if not Client.PreviousSettings then
        Client.PreviousSettings = {}
        for key, value in pairs(ORGM.Settings) do Client.PreviousSettings[key] = value end
    end

    for key, value in pairs(args) do
        ORGM.log(ORGM.DEBUG, "Server Setting "..tostring(key).."="..tostring(value))
        ORGM.Settings[key] = value
    end

    Events.OnMainMenuEnter.Remove(Callbacks.restoreSettings) -- functions to restore original settings
    Events.OnMainMenuEnter.Add(Callbacks.restoreSettings)
end


Events.OnServerCommand.Add(Callbacks.serverCommand)
Events.OnTick.Add(Callbacks.requestSettings)
#

------ server side
CommandHandler.requestSettings = function(player, args)
    ORGM.log(ORGM.INFO, "Sending Settings to ".. (player and player:getUsername() or ""))
    sendServerCommand('orgm', 'updateSettings', ORGM.Settings)
end

Callbacks.clientCommand = function(module, command, player, args)
    if not isServer() then return end
    if module ~= "orgm" then return end
    ORGM.log(ORGM.INFO, "Server got ClientCommand "..tostring(command))
    if CommandHandler[command] then CommandHandler[command](player, args) end
end


Events.OnClientCommand.Add(Callbacks.clientCommand)
peak raven
#

How could I Check if a mod is loaded to add compatibility without requiring the mod in question to be loaded?

quasi geode
#

ofc theres tables and such in there that are defined elsewhere

spiral plover
#

Of course, okay, and i just found the documentation for sendServerCommand and sendClientCommand which helps clarify it a bit

quasi geode
peak raven
#

Thanks a million! I knew there was a way, I just couldn't find it

spiral plover
#

This makes pretty decent sense, okay thank you @quasi geode , I'll mess around with this for a while I should be able to get it to work..

quasi geode
#

theres alot of extra fluff in that code snippit you'll probably want to remove (or not) stuff for restoring client settings on leaving the server etc

spiral plover
#

Yeah I see that with the onmainmenuenter etc

sour island
#

I do what Fenris posted.

#

You should be able to parse a table over as a single argument - if you needed that space.

spiral plover
#

Hmm, alright, makes sense. Seems im on the right track then

sour island
#

I actually have to rewrite EHE a bit, as I'm kind of leveraging off the players lol. My suggestion would be to run an event on server start - then use the commands to pull from the server.

spiral plover
#

Yeah that sounds like a good idea, alright I'll do that

#

Gotta keep some server security in there lol

sour island
#

If I understand what process will be the event and variable have to be in \server\

#

Then when players connect or if the frequency is changed you send a servercommand which hits all connected players.

spiral plover
#

Yeah and then that will sync up all the player's frequencies to match, and I can also do that with the mission index so all the players share the same progress in the missions

#

all that data is already stored in \server\ so thats no problem

sour island
#

you could make use of the globalmodData

#

But I think you'd have to make sure it's the server's I think

spiral plover
#

I am using global mod data for a bunch of stuff already, but there are issues such as verifying it's the servers

peak raven
#

Now I'm pretty good at breaking things but this error is a new one

#

Error [Redacted] I guess lol

spiral plover
#

Lmao what on earth did you do

peak raven
#

I tried to add to a table that doesnt exist

#

I'm trying to add my worldsprite tile to the list of tiles that work as beds in true actions... but I can't seem to figure out the right method

mortal widget
#

is there a mod that lets me destroy cars?

sacred gulch
#

does anyone know how to be able to find out which workshop mod needs to be updated instead of me unsubscribing and resubscribing manually 1 by 1?

peak raven
#

it will tell you the mod id of the mod normally then you can figure out its name from your mods folder.

vale pike
#

can someone explain why i have to verify every time i want to host a server

#

i play and as soon as i stop hosting the server i have to verify my files because it says version number different from server

rustic drum
#

where is the PZ mod folder located and how do I delete all mods to start fresh?

sour island
#

Report logs to the github issue when it doesn't fix the issues - then he can cover those bases

#

Will delete installation folders afaik, redownload mods throwing errors, etc

drifting ore
#

Any idea why I get an error receiveObjectModData: index=-1 is invalid x,y,z=12069,7147,0. ?

drifting ore
#

For what I understand for now, it come from player:transmitModData()

#

I can't see anywhere else where this error can come from

weary matrix
#

how are you getting the data you're transmitting?

drifting ore
#

I use it at different place so not sure where it come from exactly

#

But I'm surprised, I don't use a number as index for the table I'm using

weary matrix
drifting ore
#

I know, but I really have no idea where it could come from ๐Ÿ˜…

weary matrix
#

well add prints etc to your mod, to pinpoint the code responsible for this message

drifting ore
#

It's append every update

weary matrix
#

what are you adding to the player modData?

drifting ore
#

The problem is that I can't check, it only seems to append online

#

A table TOC with other Tables and variables in it

weary matrix
#

what kind of variables? Only pure lua types are allowed, you can't transmit java objects for instance

drifting ore
#

Oooooooooooooooooooooo

#

That it

#

A variable is the item equip

#

That's why it doesn't save it in solo when I quit the game and relaunch it.

weary matrix
#

in that case you can just substitute the item with a table, add the relevant fields you need, and when getting back the data you just instantiate a new item using the fields in your table

#

I do that in my spear traps mod if you want to check

drifting ore
#

Yeah that's exactly what I was thinking, thx. I should be able to do this, I just need a float

#

Anyway I was just thinking of changing this system because I use the item only to bring out its water resistance value so just save the value itself gonna be beter

weary matrix
lament latch
#

Hey folks, I want to get started making 3d models and clothing for project zomboid, I am having a hard time finding the right documentation for that. What would be the best place to start looking? My apologies if this question got asked already

#

Oh nvm, I found a pinned message that might help me.

timber smelt
#

Hi is Ritas weapon mod broken rn? It didnt work on my multiplayer server

drifting ore
winter bolt
#

oh lmao that same person asked me that as well

drifting ore
gilded hawk
violet shale
#

If there is already time speedup in multiplayer via sleeping, isn't there a way to piggyback on that mechanic and allow speedup in general?

gilded hawk
#

Do we have any vscode intellisense for PZB? think360

weary matrix
#

@winter bolt @drifting ore @gilded hawk thanks for your feedback ๐Ÿ™‚

weary matrix
violet shale
#

Sleeping in multiplayer with the "Sleep allowed" option enabled speeds up time if every single player is sleeping.

#

It's what we use to get through dark nights and rainy days.

weary matrix
#

oh that kind of sleeping

violet shale
#

Sleep as a requirement however is still disabled as sleep need is a pain in the ass.

#

I was thinking if there was a mod to take advantage of that we could have speed-up possible in multiplayer.

weary matrix
drifting ore
#

If it doesn't already exist, a great work around for MP sleep might be something like "resting" where you can lay down on the ground and replenish all the stuff like you get from sleeping normally just at a faster rate?

#

As a mod, obviously

violet shale
#

Sleep as a need by default is not enabled in MP

#

We didn't know that going in

#

But it was nice

drifting ore
#

Unsure how that mod works functionally

weary matrix
#

@drifting ore it's artificially removing fatigue every in-game minute or so, making your night much shorter but you still have to sleep now and then, so it's keeping the same game mechanic as single player mode

#

so instead of waiting 30 minutes real-time or so, it only takes 1/2 minutes depending on your settings

drifting ore
#

Sounds about what I had in my head

#

Makes sense that other people had similar ideas

#

I haven't really messed around with MP at all yet

#

But I imagine for now a lot of hotfixes for stuff that MP breaks is going to be creative mods like that

weary matrix
#

indeed

tacit ermine
weary matrix
#

@tacit ermine I think you're missing my point

tacit ermine
#

I don't think I did but feel free to elaborate

rich wagon
#

hey all, i'm having an issue with a firearm i made

#

for some reason it lacks a lot of stats and can't be equipped, as seen on the pictures

#

on the first picture, the m4 is basically a generic item more than a weapon, it lacks a lot of options the firearms on the second picture have

#

you cannot see but if i right click on the m4, it doesn't say "equip both hands" or anything similar

weary matrix
tacit ermine
#

yes

rich wagon
#

Also i can't place the m4 like a weapon i can only drop it and it shows the icon on the ground

gilded hawk
#

How do I add a new line in localization files? think360

UI_EN = {
    UI_trait_BritishFoodFan = "British Food fan",
    UI_trait_BritishFoodFan_desc = "On consumption of food -90% on all food happines/sadness effects",
    UI_trait_ItalianFoodEnjoyer = "Italian Food Enjoyer",
    UI_trait_ItalianFoodEnjoyer_desc = "On consumption of food +100% Increase happiness on food with positive happiness\n\nAnd +50% Increase sadness on food with negative happiness",

I tried the \n\n\ but does not work

drifting ore
#

try <br>

gilded hawk
gaunt matrix
#

Is there any support on making custom creatures in the world yet?

gilded hawk
#

@quasi geode You might be interested in knowing of a bug I noticed with ProfessionFrameworkB41Patch

I have 2 traits set on exclude each other

ProfessionFramework.addTrait('BritishFoodFan', {
    icon = "trait_BritishFoodFan",
    name = "UI_trait_BritishFoodFan",
    description = "UI_trait_BritishFoodFan_desc",
    exclude = { "ItalianFoodEnjoyer" },
    cost = 1,
})

ProfessionFramework.addTrait('ItalianFoodEnjoyer', {
    icon = "trait_ItalianFoodEnjoyer",
    name = "UI_trait_ItalianFoodEnjoyer",
    description = "UI_trait_ItalianFoodEnjoyer_desc",
    exclude = { "BritishFoodFan" },
    cost = -2,
})

When I do this and I select a trait, by adding and removing them I can clone them in the Available Traits view

I solved this by setting the exclude on only a single trait

violet shale
#

bri'ish innit

gilded hawk
#

I even added the nice icons

violet shale
#

bri ish food being a positive

gilded hawk
#

it's a joke mod, but I had a long discussion about food with a girl im dating in the UK and god the difference of food mindset is insane compared to my italian mindset

gilded hawk
#

๐Ÿ‡ฌ๐Ÿ‡ง On consumption of food -90% on all food happines/sadness effects
๐Ÿ‡ฎ๐Ÿ‡น On consumption of food +100% Increase happiness on food with positive happiness<br>And +50% Increase sadness on food with negative happiness

violet shale
#

i eat raw pasta like nobodies business

gilded hawk
#

About pasta im so fucking confused why even after cooking it I get negative happines, like wtf O.o

violet shale
#

needs accompanyments

#

boiled plain pasta

#

vs pasta with oil and salt

gilded hawk
#

oh okay understood

#

I didn't even knew I can add accompanyments

#

With the italian traits dog food makes you instantly depressed

#

I wanted to make the traits cost 0 since it's more of a personal taste then anything else

#

but the brit trait is pretty damn good

timber smelt
#

Is Britas weapon mod just broken rn or just me?

low yarrow
#

It might missing some important tags if you created a weapon entry from scratch

#

For example just copy the whole M14 and adjust it so it fits to your own weapon:

rich wagon
#

i just replaced the entire script with the one from the vanilla m16 and nothing changes

#

maybe it's the model ?

#

i'll re-export it as fbx

#

still nothing... weirdly enough when I quit the game and relaunch it, the item disappears

#

like it's not in my inventory

rocky lynx
noble zinc
#

DROPKICK MOD

tame eagle
#

question what happens when map mods update?

drifting ore
#

hey everyone i was looking for a way to add make up at game start

#

so maybe i can make my tattoos selectable at char creation

violet shale
rocky lynx
weary matrix
#

I'm trying to add a custom profession, so I just call ProfessionFactory.addProfession from OnGameBoot event. It works fine when you create your character from main menu, but when your character die and you click "New Character" my custom profession is missing. Any clue how to fix that?

mint sphinx
#

hmm but you not really gameboot the 2nd time

rocky lynx
slow graniteBOT
#
Gourge#5511 has been muted for 1 day

Reason: Spamming

[unmute]

weary matrix
#

@rocky lynx found a better way than what you propose but still it feels like a bug

#

but that means all mods that add professions probably have the same bug

quasi geode
quasi geode
gilded hawk
quasi geode
#

OnGameBoot is one of the points the PF starts to add them into the ProfessionFactory, so its likely your events are going to run out of order

weary matrix
#

@quasi geode when would you call it?

left plank
#

ummm????

#

proof?

quasi geode
#

just call it normally when the file is parsed.

left plank
#

evidence?

weary matrix
quasi geode
left plank
#

how is Gourge and Glocktopus the same word

weary matrix
#

just the G and the o I guess

left plank
#

in the future please take a bitmore precaution before defaming someone like that lmao

#

just a big claim is all

weary matrix
#

@left plank I will, again I'm sorry

gilded hawk
weary matrix
#

@left plank should I delete my message about it?

left plank
#

Sure

quasi geode
#

if both PF versions are running at the same time, one is going to override the other, and probably double up on the even calling...if one loads a mod adds profs and traits, then the second PF loads it will probably remove all the custom profs already added...if that unofficial patch takes precedence then new features such as clothing and spawn points wont work

left plank
#

probably for the best

weary matrix
#

done

gilded hawk
#

Is there no such thing as a load order in zomboid? So that you can ensure the PF loads after PFb41p?

weary matrix
#

no it just loads everything and then execute the code

#

@quasi geode that doesn't address my issue ๐Ÿ˜…

quasi geode
#

its annoying i'm probably going to have to add extra code to handle this stupid unofficial patch. whole thing could have been avoided if instead of uploading the whole damn mod he just uploaded a single file with ProfessionFramework.Traits.Hypercondriac2 = nil

#

respawning a new character? in solo or mp?

quasi geode
weary matrix
#

because clicking NEW CHARACTER will call ProfessionFactory.Reset()

quasi geode
#

no, it doesnt need to. PF overrides the function vanilla uses to define the default professions

weary matrix
#

you must be doing something else

weary matrix
#

so I guess I did the same, I just hooked BaseGameCharacterDetails.DoProfessions

quasi geode
weary matrix
#

haha โค๏ธ

quasi geode
#

๐Ÿคฆโ€โ™‚๏ธ

weary matrix
#

@quasi geode enjoy your coffee! ๐Ÿ˜„

drifting ore
#

Is there an id for each player? Which changes only on death and stays the same when the server restarts?

weary matrix
#

@quasi geode also in my case creating the job directly from global context would not work because my job has a custom trait that needs to be mutually exclusive with all other traits. But the traits list is empty when you do it from global context

weary matrix
drifting ore
#

I found getSteamID(), should work

#

But it only works on steam, it sucks

weary matrix
#

@drifting ore yeah I was going to suggest using getCurrentSteamID

#

@drifting ore what about using the player username?

drifting ore
#

But the username can change during the game no ? @weary matrix

dreamy linden
#

so i have been looking a bit around some mods and the mod api. im not finding what i am looking for. how would someone go about to make a mod so that when you press a key it will make a sound ?

drifting ore
willow estuary
dreamy linden
#

cool thanks

#

now i need to figure out what key is what number. hmm

#

ah cool

willow estuary
dreamy linden
#

hmm seems like it is not working...

#

uh what is that mop thing lol

willow estuary
#

Oh here's a an image with all the key codes as well

dreamy linden
#

ah thanks

#

ill try again

#

hmm . is there some sort of debug tools ?

#

it says error 1 when i boot up the game

#

im pressing the right key but no sound is playing

#

hmm error 1 is not that descriptive

#

ok found the debug mod, the console does not show anything when i press the button so either the mod is not loading right or the key is not being read right

drifting ore
dreamy linden
#

jupp

mint sphinx
#

@dreamy linden how you integrations with controller with your mod? ^^

mint sphinx
#

i edit the misstyped word

dreamy linden
#

i still dont understand, sorry

mint sphinx
#

you make some custome keys option into your mod right ?

dreamy linden
#

im trying to use the F key to activate the sound yes

mint sphinx
#

and how would people there playing the game with a controller be able to use the f key ? ^^

#

they have like a joystick ^^

dreamy linden
#

well they would press it

#

oooh

#

ye. it does not even work with a keyboard soo

#

one step at the time

#

no controller support yet

mint sphinx
#

fair ^^

#

@weary matrix also will work on the code now and send you the git link after..

drifting ore
frank helm
#

can anyone made a stone/concrete oven ? or let build an old oven

lapis stump
#

how does the game calculate which body parts are hit ?

weary matrix
#

@drifting ore isn't this different from the username you use when logging to the server?

drifting ore
#

@weary matrix What do you mean ?

#

The name you choose at the right with a password to connect ?

dreamy linden
#

hmm. still not working

weary matrix
#

not sure you can change that while in-game

drifting ore
#

Mmmm so what setUsername() do ?

dreamy linden
#

well this is not helpful at all lol

tacit ermine
#

Keyboard contains a bunch of constants

dreamy linden
#

i just need the right number for the key tho :\

tacit ermine
mint sphinx
#

also love when you join a server where multiple mods use the same key :p

dreamy linden
tacit ermine
#

i.e.

if keyPressed == Keyboard.KEY_F1 then
   ...
end
dreamy linden
#

not the onketpressed?

tacit ermine
#

?

dreamy linden
#

2 sec here is my code so far. ignore the sound name

    if (key == KEY_F) then getPlayer():getEmitter():playSound("mods/fartMod/media/sound/poo3.mp3") end
end


Events.OnKeyPressed.Add(onKeyPressed);
tacit ermine
#

just make that Keyboard.KEY_F

willow estuary
#

๐Ÿ˜„

dreamy linden
#

ok lets try

#

hmm still not working ..

willow estuary
#

It sounds to me like the issue isn't with the code itself, but that the file might now be loading?

tacit ermine
#

is the code ever ran at all?

dreamy linden
#

its an regular mp3 file

dreamy linden
tacit ermine
#

put print(key) in it

dreamy linden
#

this is my first pz mod

lofty flume
#

Hey guys. Just questio. Is there any mod that allow you to crouch and lie down/crawl? I already have true actions on server and AuthenticAnimations are not suitable. Any help appreciated. Thx

tacit ermine
#

or print("key is " .. key) so you can easily search for it

willow estuary
#

Your code is in a .lua file, right?

print("FART CODE LOADING!")
function onKeyPressed(key)
    print("Key is pressed " .. tostring(key))
    if (key == KEY_F) then getPlayer():getEmitter():playSound("mods/fartMod/media/sound/poo3.mp3") end
end


Events.OnKeyPressed.Add(onKeyPressed);
print("FART CODE LOADED!")
dreamy linden
#

ye

willow estuary
#

But put some print statements like my example in the code, and then in console.txt it can help evaluate if the file is loading or the code is running etc?

dreamy linden
#

will do

willow estuary
#

Good luck and thank you for your service.... ....farting mod guy.

dreamy linden
#

lol

#

ok so in the consode it says its loading the mod but there is nothing being printed in the console.txt file from the print lines

#

strange

#

LOG : Mod , 1642270421055> loading fartMod

tacit ermine
#

what's inside your mod folder?

willow estuary
#

It sounds like either your file isn't in the right location in the mod folder, or there's an error with it's formatting that is preventing the file from loading?

dreamy linden
tacit ermine
#

and what's the path to your script within that?

dreamy linden
tacit ermine
#

and you've went in-game with the mod enabled, not just on the main menu?

dreamy linden
#

jupp.

#

i can try a new save game

#

nope still noting

hidden rampart
#

Need some help finding the lua for stuff like meds to base custom meds off, can't find where the code is, if it is even in the PZ directory

undone heron
#

are custom passive skills fixed yet? last I checked if you marked a skill as passive with the system indiestone set up, it will still start at 0 like every other skill.

dreamy linden
willow estuary
#

Okay, not such a big deal, I think the messages will be higher up in the console.txt, but you know that your code is working to some degree? ๐Ÿ™‚

#

The next step is making a sound script for your sound.

dreamy linden
willow estuary
#

Try changing your code to

if (key == KEY_F) then getPlayer():getEmitter():playSound("GainExperienceLevel") end

and see if that works for you?

#

I'm not sure if it's always necessary, but all things considered, it's for the best to set up scripts for any custom sounds you have in a mod?

dreamy linden
#

changing the line to

 if (key == 33) then getPlayer():getEmitter():playSound("mods/fartMod/media/sound/poo3.mp3") end 
```made it print this
willow estuary
#

There you go ๐Ÿ™‚

dreamy linden
#

now i just need to figure out why that path is wrong

willow estuary
#

Okay, also, even if the sound works without a script, it will still send a WARN: message to the console about adding new one?
Which would be no big deal, but people will contact you to report that as a bug?

A lot of these sort of "This part of the mod actually works but still generates a warn message" console messages pop up in tech and mod support, when they're unrelated to people's issues?

dreamy linden
#

oh so it needs to be an OGG or an WAV file ?

#

hmm

willow estuary
#

Not sure if mp3 works or not, but this is how I format my scripts for .ogg files?

    sound Scissors
    {
        category = Player,
        clip
        {
            file = media/sound/Scissors.ogg,
        }
    }

But this might work, if mp3s work with PZ?

    sound poo3
    {
        category = Player,
        clip
        {
            file = media/sound/poo3.mp3,
        }
    }
dreamy linden
dreamy linden
#

in the scripts folder?

willow estuary
#

Yeah, and it needs to be formatted like the other sctipts .txt files

#
module Base
{
    sound Scissors
    {
        category = Player,
        clip
        {
            file = media/sound/Scissors.ogg,
        }
    }
}
drifting ore
# dreamy linden in the scripts folder?

an exemple of on of my mod

module base {

    sound Cut_sound {
        category = TOC, 
        loop = true,
        is3D = true,
        clip { 
          file = media/sound/Cut_sound.ogg, 
          distanceMax = 3,
          volume = 1.0,
        }
    }
}
dreamy linden
#
    sound poo3
    {
        category = Player,
        clip
        {
            file = media/sound/poo3.wav,
        }
    }
}```
#

and i saved that as sounds_player.txt in the scripts folder

willow estuary
dreamy linden
#

ah

lofty flume
#

Hey guys. Just question. Is there any mod that allow you to crouch and lie down/crawl? I already have true actions on server and AuthenticAnimations are not suitable. Any help appreciated. Thx

dreamy linden
willow estuary
#

You're getting there, it's just the formatting now ๐Ÿ™‚

dreamy linden
#

it works!

#

HAHAHAHAHA

#

thanks

willow estuary
#

Right on!

dreamy linden
#

ok now the next one would be to clean it up then to make it so that it shuffle between a set of random fart sounds

willow estuary
#

Okay, random sounds, gimme 1 second

willow estuary
dreamy linden
#

ah so you just call the FemaleZombieCombined and it will pull one from the list `?

willow estuary
dreamy linden
#

sweet

#

thanks a bunch !

willow estuary
#

Yeah, no problem ๐Ÿ™‚

dreamy linden
#

does this mod work in multiplayer btw?

#

or do you have to do other stuff for that to work ?

drifting ore
#

My mod get a lot of that error and I can't get why:
LOG : General , 1642272503421> 525โ€ฏ797โ€ฏ995> receiveObjectModData: index=-1 is invalid x,y,z=8535,11256,0

#

An idea ? All mu modData is float and bool

small topaz
#

Hi there! I am currently trying to figure out how the "require" command in lua works and how to use it to overwrite specific functions from the vanilla code. More precisely, I have a code for a mod which should overwrite several functions from the vanilla file "CharacterCreationMain.lua" (located in the vanilla directory /media/lua/client/OptionScreens). If I just add the command 'require "CharacterCreationMain" ' to the top of my code, it doesn't work and produces an error. However, if I replace my mod lua-file and with a copy of the whole CharacterCreationMain.lua where I replaced the specific functions which I'd like to overwrite, everything works fine. Any ideas what I am doing wrong?

willow estuary
small topaz
willow estuary
#

Or in a subdirectory of the vanilla directory.

small topaz
#

hmm... ok.... so, require "OptionScreens/CharacterCreationMain" still doesn't work for me....

#

maybe it is a problem that there is another vanilla lua which refers to CharacterCreationMain.lua? in vanilla, the files CharacterCreationMain.lua and CharacterCreationHeader.lua are both in lua/client/OptionScreens and both luas contain references to each other? might this be causing problems?

willow estuary
#

I've never had any problems with multiple requires/references, but in theory if you set something up where two files required each other I could see that causing problems?

small topaz
#

for the naming conventions in my modded lua file: how do i name the fucntions i want to overwrite? say i want to overwrite the function "CharacterCreationMain:create()" from the vanilla lua, do i have to declare the new function (in the new lua) as "function CharacterCreationMain:create()" or simply as "function create()"? currently using the first variant.

small topaz
#

Just saw that the errors are probably due to the fact that I messed up some stuff in my code. With a simplified version, I was able to run everything without errors exactly in the way as Blair Algol suggested. Thanks for that!

mint sphinx
#

how is it again to get the loot to spawn in crates again ?

small topaz
#

for the stuff about overwriting vanilla functions and using "require"... again found out that all this seems not to work as easy as it should. it somehow seems to depend on the function. for example, I tried to "overwrite" the function CharacterCreationMain:createChestTypeBtn() by simply copying its vanilla code to a new lua file in my mod and still get an error although i did not change anything on the code.... could it be that there is some extra stuff you need take care of when overwriting vanilla functions and that simply putting a "require "[vanilla lua code]" in the header is not always sufficient?

mint sphinx
#

code example ?

spark plank
#

anyone managed to spawn bots? They'd help me debug stuff ^^

#

(like, honestly. not even pretinding.)

#

if that's not possible, whats the easiest way of spawning more than one process of the game to test mp mods?

small topaz
cold burrow
#

Any way to change 1 item property without copy-paste whole item? Like only MinDamage for weapon.
Maybe with lua?

quasi geode
#

require is mostly redundant in pz files. its use it lua is:

  1. to load a file that many not normally be loaded (pz is going to load all lua files anyways, so this reason is not needed)
  2. to ensure a file is loaded before the rest of the file doing the require (this is sometimes useful, but vanilla pz files will load before your mod one anyways, so also not needed)
  3. to catch a return value from the file being required (vanilla pz files dont generally return values. tables they create like CharacterCreationMain get placed in the global namespace, no need to require to access them)
mint sphinx
quasi geode
#

i dont use either when accessing vanilla files lol....i may use require on my mod files, as those are probably going to return a local table instead of global namespace pollution

mint sphinx
#

that true. and also mod files you dont know which order they load into the game either

drifting ore
#

biker bois

quasi geode
#

they load in alphabetical order

#

load order of mod files is easy to predict without require

small topaz
#

ohhh... might it be necessary to include local variables? the original file has two defined via "local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)" and "local FONT_HGT_MEDIUM = getTextManager():getFontHeight(UIFont.Medium)".

quasi geode
#

uh ya if your accessing those variable in your code

small topaz
#

Ahhh!! this also seems to solve the issue!

small topaz
#

so, let's hope that all the local variables are defined in the head of the vanilla file. otherwise it will get messy since the CharacterCreationMain is quite long and i have to overwrite a lot of stuff from it...

small topaz
#

or is this already somehow part of vanilla right now? looks decent!

drifting ore
#

its already out there

small topaz
drifting ore
#

it detects the custom locations i made

#

we could work it together if you want

small topaz
#

i did it in a way such that the tattoos are not displayed in the clothing section and i am currently polishing the code for that screen a bit. but it is already fully functionable.

#

although i don't have any good tattoo skins yet...

small topaz
#

good work! didn't know that it existed!

#

i'll have a look at it!

drifting ore
#

sure

#

its been out there for a while

small topaz
# drifting ore sure

your tattoos look really good! depending on the body location, that's not so easy in my experience. you need to be very careful about that and have a good understanding of how the texture pngs are "wrapped around" the 3d character models.

drifting ore
#

i got a ref extracted from blender

#

besides the transparency adds some halo to them that make it look like they have white outline

#

makes me go crazy

#

also the mapping is a mess

#

tbh if i get to make a new model ill do it

#

with better mapping

small topaz
drifting ore
#

but i use maya for modeling cuz i have a problem extracting fbx

small topaz
drifting ore
#

but its good

small topaz
#

but i am a linux user. so gimp is probably the only really good option i have... ๐Ÿ˜‰

drifting ore
#

good ol days XD

drifting ore
#

๐Ÿ˜‚

#

idk if it can use SVGs tho

#

vector graphics

#

would make it look much better

#

i read it XD

small topaz
# drifting ore we could work it together if you want

that's a nice idea! although the mod i am working on will not only include tattoos (and i am not sure i'll ever be able to finish it ๐Ÿ˜‰ ). even in case we keep our mods separate, in case you like the customisation screen from my screenshot, feel free to use it for your mod. i am always happy to share the stuff i did. ๐Ÿ™‚

#

ya... i just reacted to your wrong message XD

#

wanted to react to your "we could work together..." and not the other line

drifting ore
#

idk if i can make it work for MP

drifting ore
#

๐Ÿ‘€

#

i am also welling to provide help in regards of your mod if you need

small topaz
# drifting ore besides competition is gonna be fun

ya.... i am not into competiion stuff... i'd just like to make mods out of a "good" idea which might add something nice to the game. ... and modding is a nice way to beat time during the pandemic. ๐Ÿ˜‰

small topaz
#

Dms?

potent root
#

Question about the sandbox-options.txt
Mods can add this file to add configurable values they show up in the sandbox configuration for Solo and in the admin panel on a server setup.
But in a server if you want to configure this values befor the server starting for the first time where you add the values? in the SandboxBars? what is the format?

thin hornet
#
ModName {
  prop = value,
}
potent root
#

awesome

#

thanks a lot

thin hornet
#

thats for server cause SP is just

ModName.prop = value

which maybe does the same thing idk

weary matrix
#

any clue how to detect first time connection to server?

thin hornet
#

Maybe save the players username into a file to compare if that player ever connected before

#

otherwise seriously have no idea. I would have expected OnConnect etc to work but havent got any luck.

mint sphinx
drifting ore
#

last one done

weary matrix
mint sphinx
dim heart
drifting ore
#

its perament

#

unless you peal it off with acid

weary matrix
dim heart
#

What job is it that you're adding?

weary matrix
#

a "Returned" job, so that when you die, if you select that job, it will respawn your character perk levels, boosts etc

drifting ore
weary matrix
#

if you don't select the job then you just start a new character as usual

drifting ore
#

very primitive way but works

dim heart
#

Damn that sounds like a kinda cool concept

weary matrix
#

and it's persistent! It's attached to your steam ID on the server

dim heart
#

That would be great for servers, especially considering the amount of time you have to spend reading books because you can't fast forward

drifting ore
#

but wouldn't that put the game out of balance ?

dim heart
#

It's more of an alternate playstyle imo

#

It's not something you would use for every playthrough, but it would be a neat option for casual players or those who are learning the game still, it would also be on my modslist if I played mp

mint sphinx
weary matrix
#

the guy who wanted the mod tried many and none were good enough to him

weary matrix
dim heart
dim heart
weary matrix
#

๐Ÿ˜„

drifting ore
#

gj man

weary matrix
#

thx

drifting ore
#

wait people pay money for mods

#

ia live in a cave XD

mint sphinx
mint sphinx
weary matrix
weary matrix
mint sphinx
# drifting ore wait people pay money for mods

was someone ask for a mod and wanted to pay in steam card yester day it was a modeling person who didnt knew how to code so yea sometime people do buy/hire for an extra feature in your mod ^^ but rare after my knowlagde might be wrong

drifting ore
#

๐Ÿค”

zealous peak
#

howdy. This is not a request for help with modding as much as it is in understanding an already existing mod

#

I got fed up with the fucking zupeprcarts mod not having comments nor a discussion page explaining where we are supposed to find them. After several games without finding one, I decided to look into the files.

#

The image above seems to determine the rarity, as well as the loot tables where these items are supposed to appear.

#

First, I'd like to understand the numbers. I'd guess the numbers on every second row determine the rarity. I'd like to understand what does a value of one mean. What does that rarity stand for

#

second, would be understandig the locations. I always start in rosewood. According to the wiki, the supermarket there is part of the gigamart chain, but I can't find a single cart or trolley even with abundant survival gear loot setting (according to another file, this item is survival gear)

spark plank
#

is there a flat map I can load to avoid loading times when testing mods ?

#

*not avoid, lower

weary matrix
frank elbow
#

Was just about to say I found a forum post that says the same

zealous peak
#

well, that sounds like bs. The zombie apocalypse has just started and everybody went there to get carts and trolleys AND I can't find a single cart left in the world among all the zombies I killed? Even my ass smells better than these odds

#

Most grateful. Guess I just need to change those settings then

weary matrix
mint sphinx
#

and lootspawn to extreamly high aswell ^^

zealous peak
#

Sounds like good odds. If it works, I may just set it to 100/75. I mean, besides the supermarket at rosewood, which other locations indicated on that code do I have? There aren't any tool stores, I believe

#

btw, how do these chances work with loot rarity multiplier?

frank elbow
#

Rather than being for particular locations, I think those are loot tables which are used in various locations. I wouldn't know what they correspond to, though

zealous peak
#

well, according to the wiki, the gigamart one is quivalent to the big chain supermarket. It has the image of rosewood's one

#

The others, I got no idea. The janitor thing may be those shelves with cleaning materials, I suppose

thorny portal
#

yup, that's what I was afraid of ๐Ÿ˜• boo, I'll try probing, maybe I can get it to output something useful, thank you very much!

zealous peak
#

alright, it's confirmed then

#

The issue with this mod is that the trolleys and carts are set to spawn at a rate of 0.5 to 1%

#

since the supermarket at rosewood doesn't seem to have a gigamart tools shelf, I'd be fucked. Would just have to keep checking all janitor shelvces in the hopes of getting a trolley, like the 1/200 chance that happened to me before

#

and since you can't find them spawned in the world nor inside zombies, that makes it all the worse

#

so, I either bumb everything to 100 and end up with way too many useless trolleys and carts unless I learn enough to make it compatible with a recycling mod (and also get 3 troleys inside each janitor's shelf) or soemhow learn how to add them as a spawnable item inside zombies

#

on my last playthrough with 0.4 population, I had to kill over 200 zombies before I was fucked by the respawn because I didn't know which were the bounds of a cell. 1/200 chance would be more than enough

#

I guess this is too much of a bother, but I suppose none here would be able to teach me how to add the troleys/carts to the loot tables of paw loot?

#

or if possible, give me a link for the game's loot tables and what they handle. These items having a chance of spawning at tool sheds and so would balance it a bit

thin hornet
#

Guys i'm trying to make Russian translation file with notepad++ but when i change the encoding to window-1257 it keep turning back to utf-8
am i missing something

lapis stump
#

had same problem when i made translations for my mod

thin hornet
#

@lapis stump so this checkbox unchecked

lapis stump
#

yep thats what I did i found the issue on a github page

thin hornet
#

ok thanks will try that

#

@lapis stump now it default it to ANSI upon reopening

lapis stump
#

hm yep same issue as you maybe my translation is still broken

thin hornet
#

When i open a RU file from the game encoding is ok, but when i make that file myself it just revert lol

#

ok so there is this setting here too

zealous peak
#

yo. so, it's late here and I'm gonna sleep soon, but I was just wondering: from what I udnerstand of coding, seems like you need to indicate an item from the game for a mod where you use it. I wonder, if I wanna use an item from another mod, what is the hange done to the path? May I request somebody to post the structure of such path, please?

#

btw, does itemzed still work for this game's version?

lapis stump
languid narwhal
#

is there a way to modify a vanilla trait multiplier for a character that already has it?

zealous wing
#

Tweaking model sizes in-game one at a time almost makes you wish for a zombie apocalypse. ๐Ÿ˜›

weary matrix
#

any clue why this is not giving the player 50 XP for fishing, but rather like 12.5?

getPlayer():getXp():AddXP(PerkFactory.getPerkFromName("Fishing"), 50)```
#

guess I need a multiplier but not sure where to find it

languid narwhal
#

I think so, I'm new to PZ. I'm a SW dev, but I'm trying to figure out how much work this is going to be :)

weary matrix
#

I guess you could add a multipler for the perl to the player directly?

languid narwhal
#

so if I have an existing char on a MP server, and I want that trait's perk or penalty to be slightly more or less, I"m trying to figure that out

tacit ermine
#

you can use AddXPNoMultiplier(perk, xp) instead

languid narwhal
#

thanks. I'm going to try to play around with this a bit. just getting started.

weary matrix
tacit ermine
#

sandbox options XP multiplier?

weary matrix
#

apocalypse

tacit ermine
#

hm

#
if ((Integer)var13.getValue() == 0 && !this.isSkillExcludedFromSpeedReduction((PerkFactory.Perk)var13.getKey())) {
    var10 *= 0.25F;
}
#

is what causes it

weary matrix
#

haha

#

wtf ๐Ÿ˜‚

tacit ermine
#

var13 is an entry from the XP boost map

#

I don't really understand why that code's there

weary matrix
#

well if I add a x4 multiplier it gives the correct value but...

#

works for level1, 2 and 3 at least

tacit ermine
#

if the XP boost has a multiplier of 0 and the skill isn't excluded from speed reduction, reduce the XP value to a 1/4th?

#

that seems quite arbitrary

weary matrix
#

totally

#

man that code base is a mess

tacit ermine
#

it looks like it needs to have an XP boost entry with a value of 1 and then it'll use the full value

weary matrix
#

hmm

tacit ermine
#
 } else if ((Integer)var13.getValue() == 1) {
     var10 = (float)((double)var10 * 1.0D);
 }
#

unless of course it's sprinting, where 1 really means 1.25...

} else if ((Integer)var13.getValue() == 1 && var13.getKey() == PerkFactory.Perks.Sprinting) {
    var10 = (float)((double)var10 * 1.25D);
}
weary matrix
#

hmm so should I try to set the multiplier in the hashmap returned by getMultiplierMap()?

tacit ermine
#

those entries are from getXPBoostMap()

weary matrix
#

addXpMultiplierโ€‹ is for adding perk boost (like when you read books)

tacit ermine
#

which is similar I suppose, but for professions

#

maybe that'll work, I don't really understand why this code is the way it is

weary matrix
#

I'm tempted to just add a x4 multiplier, would probably be ok in my case since I do it only for a fresh character

drifting ore
#

can someone do a mod

#

that when you are fighting you get doom music

weary matrix
#

hmm in fact only problem is for the extra xp you have for current level

#

guess I should just drop it and problem solved

#

otherwise I can simply use setXPToLevel()

plucky pollen
#

iv made a mod that makes some changes to base items not replaces just changes / new items was wondering if anyone good at making item mods could dm me and would take a look at it to make sure its all good and help with making a small fix to one part of it..

iv tested it in SP and i dont get any errors but would like a fresh pair of eyes to ๐Ÿ˜›

lunar abyss
#

Does anyone know about a mod that makes look even rarer? I tried playing on extremely rare but I still keep coming across large amounts of items/food

twilit hornet
#

Any mods that allow players to lock built doors? (other than the front and back doors of a home? Can't find one on the workshop). Thanks in advance

small topaz
#

hi there! does anyone knows whether there is a command to color clothing items even "AllowRandomTint" option in their .xml file is set to false? if it is set to true, coloring can be done via item:getVisual():setTint(color) but if it is set to false, this command seems to have no effect.

thorny portal
#

I wonder how expensive it would be on cpu time to look at every tile in a loaded cell at a particular time of day and check if it has a type (gravel) and a tree, and if so remove the tree...

small topaz
#

does anyone knows where this error can come from: attempted index: setTint of non-table: null. found this in the console.txt. seems to be related to some code: local myColor = ImmutableColor.new(1, 0, 0, 1)
if myColor then
item:getVisual():setTint(myColor)
end

#

at least the console says the error occurs at the line with the command item:getVisual():setTint(myColor).

#

what is really strange here is that the error occurs only sometimes. can run the game without any errors for 5 times and then, if try to enable the mod in question for the 6th times, it produces the error and breacks.

#

for context, i am currently trying to mod the interface in the character customisation screen. thereby working with the code from CharacterCreationMain.lua and CharacterCreationHeader.lua (both in lua/client/OptionScreens).

#

what really makes me crazy is that exactly the same code i made sometimes works and sometimes not. seems like random to me....

frank elbow
#

The error means that the result of item:getVisual() was null. Couldn't tell you why, but verifying that the result is a table should help avoid it

#

Which you can do using the type function

small topaz
#

ah ok.... that is at least something. thanks!

#

type function? what is the syntax?

frank elbow
#

type(someVariable)

#

If it's a table, the result would be 'table', but zomboid may use the 'userdata' type, dunno. Either way, you could debug it by printing the value of item:getVisual() & type(item:getVisual()) and seeing what's happening

small topaz
#

how can i print this?

frank elbow
#

print(...) where ... = one of those expressions, or both separated by a comma (presumably, at least. I'm not a modder, just assuming based on Lua knowledge that hopefully mostly applies)

sour island
#

Anyone know if there's a writing animation?

small topaz
#

so, could i just put print(...) in the right place in my code and then it will be printed if i start project zomboid? and where will it be printed to?

frank elbow
#

You'll see it in console.txt

small topaz
#

ok. i'll try. thanks!

frank elbow
#

To be clear, the ... was a placeholder which should be replaced by an expression

small topaz
#

yes. understand that! ๐Ÿ˜‰

frank elbow
#

Okeydoke, just making sure ๐Ÿ˜„ have fun

small topaz
#

thx!

quasi geode
frank elbow
#

So, the type function is overridden somewhere? And/or it's a table with a metatable (can't remember if there's a magic method for overriding that)? Interesting

quasi geode
#

ah well its not standard lua, its kahlua. the interpreter is written completely in java

#

so it does break some of the standard rules

frank elbow
#

Huh, I'll need to do some research to know what the heck is happening in kahlua

#

Thank you again, wise wolf ๐Ÿ™

sour island
#

you can do tostring() to safely print stuff that can't be concated.

#

you'd end up with tablex12335 etc but you'd know it's atleast a table

thin hornet
#

userdata simply mean it's a java object

small topaz
#

cannot find any printed output in my consol.txt....

quasi geode
#
print("type is " .. type(getScriptManager()))
LOG  : General     , 1642309466871> type is userdata
#

could have sworn it didnt, but its been years since i checked and i'm going senile in my old age lol

frank elbow
#

No worries, good to know either way. Although considering the above error was "null" rather than "nil", I wonder if the null type would also be userdata (i.e., is it java null rather than Lua nil)

frank elbow
quasi geode
#

naw that one it will autoconvert java's null and lua's nil

frank elbow
#

That's a relief, seems like it'd be a headache otherwise

thin hornet
#

Look at how to kick a player, then check when that player connect, if it part of a custom ban list, kick it.
Server can save text file, you can load that file when server start. Make yourself some UI to add remove player from the list.

small topaz
frank elbow
#

Did you add prints around any code that's guaranteed to execute? Idk why they wouldn't show up if so

#

But then again I only assumed prints would be added to console.txt along with other output; I could be totally off ๐Ÿ˜…

small topaz
#

ah ok.... now i see the printed stuff!

#

btw, here is console.txt of the error

thin hornet
small topaz
#

the main error seems to be in line 1305 in myCharacterCreation.lua. that's where i've included the line "print(type(item:getVisual()))"

thin hornet
frank elbow
#

I assume the one after "HERE COMES OUTPUT" is the actual value? If so, that means item:getVisual() did return nil

#

Again, dunno why, but you could check for nil & handle that case

thin hornet
#

it didnt return nil, it threw an error (i think)

frank elbow
#

The call after it caused the error, I believe (see 1931 in the log)

small topaz
thin hornet
#
print("HERE COMES OUTPUT");
print(type(item:getVisual())) -- throws
thin hornet
#

again do you have a snippet to understand what item is

frank elbow
#

There's a nil on the line after that output, though

small topaz
#

and before: print("HERE COMES OUTPUT");
print(item:getVisual())

thin hornet
#

oh

frank elbow
#

I think seeing a snippet would def be helpful like Konijima is saying

thin hornet
#

xD yeah

quasi geode
#

it looks like it fired twice once returning the nil...then a second time which threw

small topaz
#

local item = InventoryItemFactory.CreateItem(itemType)

#

a few line before

quasi geode
#

whatever was in item that seccond time had no :getVisual() method

frank elbow
#

If the code is the same as it was way above, setTint is being called on the result of getVisual

#

item:getVisual():setTint(...)

small topaz
#

here is the code which produces the error:

frank elbow
#

Ah, or getVisual is misspelled the second time

quasi geode
#

that would do it XD

small topaz
#

if've used similar constructions over and over again in my code and it always worked flawlessly. just in this case

thin hornet
#

maybe also store the visual and check if its nil

local visual = item:getVisual();
if visual then

end
small topaz
#

i'll try!

gaunt meteor
#

is there anyway to modify infection rate on mp server?

small topaz
thin hornet
small topaz
# thin hornet Did the visual change (or at least what you try to achieve works) ?

seems so. up to now, i didn't get an error. problem is that before, the error seemed to occur randomly. i enabled and loaded the mod 5 times and every thing worked fine and then, for the 6th time i got an error during the mod loading which crashed the game. and all that with exactly the same code! really do not understand how that could have happened...

thin hornet
small topaz
stable flame
#

Is there a recipe line that excludes your favorited items?

small topaz
#

so, what exatly is this "item:getVisual()". i think it should be sth like the color of a clothing item...?

thin hornet
#

ZombRand(0, #items)+1
if you have 5 item and ZombRand return 5 then you try to access 6 which doesn't exist.
But again you check under in a condition so that should really be that.

#

also ZombRand always confuse me with the last number being inclusive or exclusive

quasi geode
#

last number is excluded in zombrand

thin hornet
small topaz
thin hornet
#

yeah its excluded then you are ok

#

but maybe that should be if its excluded
ZombRand(1, #items+1)
otherwise the last index would never get called
so if there is 5 items, giving 5 as last param would return max 4

small topaz
thin hornet
#

ok nevermind im just mixed up

#

lol

#

thats not the problem anyway

#

so you ask what is getVisual() it returns the ItemVisual instance of the item.
which contains those properties.
if you have access to the java source code you can browse all its functions

small topaz
#

btw, what this function does is the following: if you hit the random button in the character customisation screen, your character gets a random outfit and the above function (which i modified a bit) is exactly the function which is responsible for that

thin hornet
small topaz
#

so, the case where my problems occurs is when the getVisual() is applied to new items i created. they are just clothing items but grouped under new "bodylocations" i created for them...

torn root
#

Oh crud has anyone gotten to me in regards to requests for mods?

small topaz
#

but since they are clothing items with proper bodylocations, the should have Visual instances

marble folio
#

Made a Quick guide to myself on How to Add custom XP and the Perks name and thought I'd share it here if anyone needs it
(I have no idea how it works tough spiffo , I just know that THIS way worked for me)

drifting ore
#

does anyone know how to make the spawn points appear on a dedicated server keep spawning in single city

opal spoke
potent root
#

Hi guys maybe you can help me with a problem I am trying to spawn an item on the player inventory
player:getInventory():AddItem(item);

#

seems it does not work. no error either

#

player is an IsoPlayer

thin hornet
#

what is item equal to

potent root
#

I think the problem is that I am doing so in the OnPlayerDeath event and it might be to late for spawning in the player invetory

thin hornet
#

string or InventoryItem

potent root
#

local item = InventoryItemFactory.CreateItem('Token.DeathToken');

thin hornet
#

ah

potent root
#

I want to spawn it the dead player inventory when he dies

#

but seems the game engine does not like that

#

any idea?

thin hornet
#

not sure but onDeath is called from the isoplayer so it should still be an IsoPlayer at that moment, but could be a corpse too.

potent root
#

if I replace the add item line with this it works

#

player:getSquare():AddWorldInventoryItem(item, 0,0,0);

abstract raptor
#

how do I use an emitter

potent root
#

it spawns in the ground

#

so player:getSquare resolves fine

#

the weird thing is that the other one does not raise any error

#

so may be some short of race condition

thin hornet
#

@potent root

#

it's technically still a player at that moment but im probably wrong

#

trying to find the moment it become a corpse

thin hornet
potent root
#

that is intereesting that means the AddItem call is somehow not working

lunar abyss
#

I kinda wanna try making my first "mod" that would just change up the sound of the alarm on the digital alarm watch. Would anyone have any recommendations on where i could learn to do that?

potent root
#

@lunar abyss sorry I do n ot have any experience with emitters

thin hornet
potent root
#

that makes sense

abstract raptor
potent root
#

but interestingly in the code you pastes it drops hand items right before calling the event

#

that makes me think the corpse may not be created yet

thin hornet
# abstract raptor Yes

What kind of sound you need to play?
A sound in the world space or a sound emitting from a character or a UI sound or ...?

abstract raptor
#

A sound emitting from a character

#

... for now

#

But I also intend on gettin playable instruments working again

#

I have a bunch of voice acting that a couple people did

#

It allowed the player to talk or make taunts with a voice

#

But now it's rather obsolete

thin hornet
# abstract raptor A sound emitting from a character
local audio = 0; -- playSound will return a number so we store here to stop later
local character = getPlayer(); -- get the current player

-- Play the sound from the character
audio = character:getEmitter():playSound("MySoundName");

-- Stop the sound
if audio  ~= 0 and character:getEmitter():isPlaying(audio) then
  character:stopOrTriggerSound(audio);
end

in scripts/mysounds.txt

module Base {

    sound MySoundName
    {
        category = Voice, loop = false, is3D = true,
        clip { file = media/sound/MySoundName.ogg, distanceMax = 10, volume = 1.0, }
    }
}
abstract raptor
#

๐Ÿค”

#

Cool now I just need to bind this to the Q hold menu

stable flame
#

Anyone have an idea how exactly does an items "status" change it's use? (ex: an item is favorited so it can't be dropped, or a tshirt is equipped and wont be included in the Rip clothes). Is there a function for it as i haven't seen any in the vanilla scripts.

round kiln
#

where can i find the code for the search mode/foraging item chance?

thin hornet
round kiln
#

thankies again

thin hornet
round kiln
#

im assuming months is which month it will appear, bonus month is when there will be more, and malus month is less of it? in the foraging code

thin hornet
#
--[[--======== getMonthBonus ========--
    @param _itemDef - itemDef
    @param _month - (optional) month to check

    Returns month bonus total for itemDef as percent
]]--```
round kiln
#

huh

thin hornet
#

return a percentage

round kiln
#

what does that mean?

thin hornet
#

it loop through the item definition and get the bonus value and the malus value based on the current month, then it add them together and divide it by 100 to return the bonus in a percentage format.

#

anothing place you can see the usage of getMonthBonus

#

when it populate the loot table

potent root
#

nah I tried three different versions of addItem and none seem to work I think the corpse may be there already

thin hornet
#

if it show before or after your own log

#
   public void becomeCorpse() {
      if (Core.bDebug) {
         DebugLog.log(DebugType.Death, String.format("%s.BecomeCorpse id=%d", this.getClass().getSimpleName(), this.getOnlineID()));
      }

      this.Kill(this.getAttackedBy());
      this.setOnDeathDone(true);
   }
potent root
#

good idea

#

ty

drifting ore
#

So you just have NPCs screaming taunts at you as they shoot you

abstract raptor
#

No I want it to be a vocalizer

thin hornet
# round kiln huh
months        --months when the item can be found
bonusMonths   --months when the item is more common (must be in months)
malusMonths   --months when the item is less common (must be in months)
round kiln
#

ah, thats what i thought too, but i wasnt that sure, now i know for sure

thin hornet
#

and months are like so { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }

round kiln
thin hornet
#

xD

potent root
#

this is the stack

#

at zombie.characters.IsoPlayer.OnDeath(IsoPlayer.java:7753)
at zombie.characters.IsoGameCharacter.DoDeath(IsoGameCharacter.java:1501)
at zombie.characters.IsoGameCharacter.DoDeath(IsoGameCharacter.java:1495)
at zombie.characters.IsoPlayer.Kill(IsoPlayer.java:9630)
at zombie.characters.IsoGameCharacter.becomeCorpse(IsoGameCharacter.java:16435)
at zombie.characters.IsoPlayer.becomeCorpse(IsoPlayer.java:9647)
at zombie.ai.states.PlayerOnGroundState.becomeCorpse(PlayerOnGroundState.java:47)
at zombie.ai.states.PlayerOnGroundState.execute(PlayerOnGroundState.java:29)

#

so ti seems the becomeCorpse comes febore the onDeath

#

seems I either need to hook somewere else or I need to find a way to get the corpse

thin hornet
#

well im not even sure that the corpse is a different object
i never played with this yet im just browsing the source as we speak

#

if you find a dead player and press F2 in debug mode and select the square with the player corpse. what info does it give about the corspe on that square?

potent root
#

let me check

thin hornet
#

cause becomeCorpse only kill the character and complete the death process.

#

i dont see no transformation into a different object such as "corpse"

potent root
#

corpse = zombie.iso.objects.IsoDeadBody@xxxxx

#

IsoDeadBody is the only thing I see

thin hornet
#

ooh

#

right ok

potent root
#

I think the key is going to be in one of this three

#

at zombie.characters.IsoGameCharacter.becomeCorpse(IsoGameCharacter.java:16435)
at zombie.characters.IsoPlayer.becomeCorpse(IsoPlayer.java:9647)
at zombie.ai.states.PlayerOnGroundState.becomeCorpse(PlayerOnGroundState.java:47)

#

I need to get the code decompiled ๐Ÿ˜„

#

any tutorial or guidance on it?

junior flame
#

I'm fried right now. How might I calculate how many uses of water the player has available in their inventory?

thin hornet
#

@junior flame

For a single drainable item:
TotalUses = 1 / item:getUseDelta()
RemainingUses = item:getUsedDelta() / item:getUseDelta()

So loop inventory items
Increment a variable with the RemainingUses of each water item

use item:getRemainingUses()

local totalWaterUseAvailable = 0;
for i = 0, items:size() - 1 do
  local item = items:get(i);
  if instanceof(item, "DrainableComboItem") and item:canStoreWater() and item:isWaterSource() then
    totalWaterUseAvailable = totalWaterUseAvailable + item:getRemainingUses();
  end
end
hollow shadow
stable flame
junior flame
thin hornet
#

Yeah rest well buddy
Fresh mind always work better

grizzled grove
zenith smelt
#

Sorry for pinging on a old topic, but does moddata save between server logins?
I'm using the worse searching mod that makes it so that player has to do an action before seeing what's in a container and it doesn't save between logging in and out

#

Is there a workaround or any way I can debug if this mod is broken or does moddata not save?

#

Server console? Like RCON?

twin root
#

Hey, recently i decided to make few mods for myself and my friends (mainly some tailoring changes, so it's easier to level up), i decided to take a look at game's code, found the right files, and started editing, uploaded item to workshop (Marked as private or friends only idk, because i don't want to just upload someone's else's work like that, plus that's just for myself), now, it works in singleplayer, but whenever i try to start a server, it automatically closes itself after few seconds, so my question is, how do i make it work in multiplayer? i read few guides, etc but i can't figure it out and my coding skills suck, i would be grateful for any kind of help

hollow shadow
#

How do i make an item change its model when attached on the back weapon slot

undone crag
#

(replying to djvirus)
Lua. :d

hollow shadow
# undone crag (replying to djvirus) Lua. :d

function Client.setUpShield(player,shield)
    local player = getPlayer();
    local playerModData = Client.getModData(player);
    local weaponModData = Client.getModData(shield);
    
    
    if player:getSecondaryHandItem() ~= shield then
        Client.SetshieldModel(player, shield, 0);
    end
end


function Client.SetshieldModel(player, item, number)
    if Client.getModData(item).modelVariantNumber ~= number then
        local itemFullType = item:getFullType();
        if number == 0 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType());
        elseif number == 1 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType() .. "Held");
        end
        player:resetEquippedHandsModels();
        Client.getModData(item).modelVariantNumber = number;
    end
end```
#

i edited someones code and this what i made and it dont work xD

undone crag
#

<_<
Client.getModData looks like a function from somewhere in the code. because you are not using playerModData or weaponModData maybe you could remove it. Do you have a table called Client defined elsewhere?

hollow shadow
#

well the original is 1280 lines of code but i can try to search

#

no idea what these do btw

undone crag
#

You could do it like this

local Client = {}
function Client.setUpShield(player,shield)
    local player = getPlayer();
    
    
    if player:getSecondaryHandItem() ~= shield then
        Client.SetshieldModel(player, shield, 0);
    end
end

or like this

function djvirus_setUpShield(player,shield)
    local player = getPlayer();
    
    
    if player:getSecondaryHandItem() ~= shield then
        djvirus_SetshieldModel(player, shield, 0);
    end
end
#

or maybe

djvirus_shields = {}
function djvirus_shields.setUpShield(player,shield)
    local player = getPlayer();
    
    
    if player:getSecondaryHandItem() ~= shield then
        djvirus_shields.SetshieldModel(player, shield, 0);
    end
end
hollow shadow
#

goal is to make the shield change its model when its equiped in the secondary slot

#

so the original model on the back slot can be changed to look fine

undone crag
#

In Client.SetshieldModel it's using Client.getModData(item) which should be another function somewhere in the code so if it's missing that it's going to fail.

#

The functions are starting with Client. which only works if somewhere above that, it createsa Lua table called Client somewhere like Client = {} or local Client = {}. A name like Client might ideally be local because if two mods did Client = {} then one mod would overwrite the other and glitch it.
If you make it a local table with local Client = {} then it means another Lua file can't use it normally.

hollow shadow
#

thats the original code

#

I know that it makes it so the model of an item changes when you have it in your hands.

undone crag
#
djvirus_shields = {}

function djvirus_shields.getModData(thing)
    if thing:getModData().djvirus_shields == nil then thing:getModData().djvirus_shields = {} end
    return thing:getModData().djvirus_shields
end

function djvirus_shields.setUpShield(player,shield)
    if player:getSecondaryHandItem() == shield then
        djvirus_shields.SetshieldModel(player, shield, 1);
    else
        djvirus_shields.SetshieldModel(player, shield, 0);
    end
end


function djvirus_shields.SetshieldModel(player, item, number)
    if djvirus_shields.getModData(item).modelVariantNumber ~= number then
        local itemFullType = item:getFullType();
        if number == 0 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType());
        elseif number == 1 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType() .. "Held");
        end
        player:resetEquippedHandsModels();
        djvirus_shields.getModData(item).modelVariantNumber = number;
    end
end

Maybe this will work.

#

You would also need some code to call djvirus_shields.setUpShield when the character puts it on his back or grasps it.

hollow shadow
undone crag
#

The file has a . before Held while the Lua does not.

zenith smelt
#

Does moddata save when relogging from server

hollow shadow
undone crag
#

You have a . in the model name that should not be there, or you lack a . in the Lua file that should be there. Oh actually it looks for models in \scripts so this may not matter if the model name in \scripts does not have a ..

#

I was mistaken because I forgot about that the model names Lua uses are decided in a txt file. It may be fine.

#

This may work to get the function to run when your character grasps it with the left hand.

function djvirus_shields.OnEquipSecondary(player,item)
    if item and item:getType() == "your_djvirus_shield" then
        djvirus_shields.setUpShield(player, item)
    end
end

Events.OnEquipSecondary.Add(djvirus_shields.OnEquipSecondary)
#

Are you wanting a special model for when the shield is held, or for when it is on the back?

hollow shadow
hollow shadow
drifting ore
#

So letโ€™s say I know how to edit some recipes for some items

#

And thatโ€™s all I really want out of what Iโ€™m making

undone crag
drifting ore
#

How do I upload it to the steam workshop?

#

Iโ€™ve just been editing the game files

hollow shadow
undone crag
hollow shadow
#


--***************************************************
--**            Yeeeeeeaaaaaa boiiiii              **
--***************************************************

djvirus_shields = {}

function djvirus_shields.getModData(thing)
    if thing:getModData().djvirus_shields == nil then thing:getModData().djvirus_shields = {} end
    return thing:getModData().djvirus_shields
end

function djvirus_shields.setUpShield(player,shield)
    if player:getSecondaryHandItem() == shield then
        djvirus_shields.SetshieldModel(player, shield, 1);
    else
        djvirus_shields.SetshieldModel(player, shield, 0);
    end
end


function djvirus_shields.SetshieldModel(player, item, number)
    if djvirus_shields.getModData(item).modelVariantNumber ~= number then
        local itemFullType = item:getFullType();
        if number == 0 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType());
        elseif number == 1 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType() .. "Held");
        end
        player:resetEquippedHandsModels();
        djvirus_shields.getModData(item).modelVariantNumber = number;
    end
end


Client.RichTextPanel = ISRichTextPanel:new(0, 16, 375, 455);
Client.RichTextPanel:initialise();
Client.RichTextPanel.autosetheight = false;
Client.RichTextPanel:ignoreHeightChange();

Events.OnNewGame.Add(Client.onNewGame);
Events.OnFillInventoryObjectContextMenu.Add(Client.OnFillMenu);
Events.OnLoad.Add(Client.OnLoad);
Events.OnPlayerUpdate.Add(Client.onPlayerUpdate);
Events.OnEquipSecondary.Add(Client.OnEquipSecondary);
Events.OnEquipSecondary.Add(Client.OnEquipSecondary);
Events.OnGameBoot.Add(Client.OnGameBoot);```
drifting ore
#

Oh

hollow shadow
#

this is what i got rn, some events might be too much idk

drifting ore
#

Does anyone know if you can find any of the things you need for electrical recipes through search mode?

#

Iโ€™m 90 percent sure shit like the tv remote is just retardedly hard to find and it my own skill issue

undone crag
#

It's not enough to make the model change when it is put on the back yet. This is just for a special held model. Functionally it will be similar.

hollow shadow
#

i just want it to have a different model when its either on back or held

undone crag
#
--***************************************************
--**            Yeeeeeeaaaaaa boiiiii              **
--***************************************************

djvirus_shields = {}
djvirus_shields.Shields = {"CarDoorShield1"}

function djvirus_shields.getModData(thing)
    if thing:getModData().djvirus_shields == nil then thing:getModData().djvirus_shields = {} end
    return thing:getModData().djvirus_shields
end

function djvirus_shields.setUpShield(player,shield)
    if player:getSecondaryHandItem() == shield then
        djvirus_shields.SetshieldModel(player, shield, 1);
    else
        djvirus_shields.SetshieldModel(player, shield, 0);
    end
end


function djvirus_shields.SetshieldModel(player, item, number)
    if djvirus_shields.getModData(item).modelVariantNumber ~= number then
        local itemFullType = item:getFullType();
        if number == 0 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType());
        elseif number == 1 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType() .. "Held");
        end
        player:resetEquippedHandsModels();
        djvirus_shields.getModData(item).modelVariantNumber = number;
    end
end

function djvirus_shields.OnEquipSecondary(player, item)
    local inventory = player:getInventory();
    local shields = {};
    for i,shieldType in pairs(djvirus_shields.Shields) do
        local items = inventory:getItemsFromFullType(shieldType);
        if items ~= nil and (not items:isEmpty()) then
            for j = 1, items:size() do
                table.insert(shields, shield);
            end
        end
    end
    for i,shield in ipairs(shields) do
         djvirus_shields.setUpShield(player, shield)
    end
end

Events.OnEquipSecondary.Add(djvirus_shields.OnEquipSecondary)
#

Maybe this will work idk it might not

hollow shadow
#

thx ill try it

drifting ore
#

Hi guys, i'm trying to replicate a video where a guy shows how to create my own pop soda, but i think the distributions.lua changed from the version he was showing on video. There was a lot more of non-procedural item distribution, how can i approach now with almost everything being procedural?

#

How come I can't see my workshop item in the game menu?

undone crag
#

What did happen instead?

hollow shadow
#

well it still uses the same model

#

the one on the back and the one on the secondary slot have the same model

undone crag
undone crag
# hollow shadow the one on the back and the one on the secondary slot have the same model

You could add "print" things to different bits of the code like this

function djvirus_shields.SetshieldModel(player, item, number)
    print("Running SetshieldModel ", item, number)
    if djvirus_shields.getModData(item).modelVariantNumber ~= number then
        local itemFullType = item:getFullType();
        if number == 0 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType());
        elseif number == 1 then
            item:setWeaponSprite("CarDoorShield1." .. item:getType() .. "Held");
        end
        player:resetEquippedHandsModels();
        djvirus_shields.getModData(item).modelVariantNumber = number;
    end
end
#

And then check the console to see what it says

hollow shadow
#

i think ill just try to do it without coding

#

maybe it will work

undone crag
#

.-.

hollow shadow
#

ill make a shield holster which gives you a slot on the back

undone crag
#

You could use the default back slot, with a specific position for the shield?

hollow shadow
undone crag
#

o

hollow shadow
#

its a pain in the ass but it will eventualy work lol

drifting ore
#

Alright i figure out, i saw one project at github that used this method, i believe this will work without breaking any mods for anyone that want to create items and add to loot tables just do this

#

For the finding the exact tables that i want to add i just serched the type of material that already exist(pop in this case) in ProceduralDistribution.lua

#

Hope this help anyone that is doing the same thing

stable flame
#

I have a weird issue with modded recipes, if i favorite a tool needed it disappears from the required items list like i don't have it. The vanilla recipes don't suffer from this issue, and it seems to occur only for the first item in the recipe.

mint sphinx
#

anyone know how to make a groupBox sandbox setting ? and have and example on it ?

drifting ore
mint sphinx
#

that just look like single tab option and not really a groupbox :/

lapis stump
mint sphinx
drifting ore
#

oh, i see

mint sphinx
drifting ore
#

My first mod lol(the model is a bit strange i don't know why)

#

This soda is the most delicious soda here in brazil, so i could not play the game without it, now i'm fine ThinkAboutIt

zealous peak
#

yo

#

Is there a wayยซ, with dfebug menu or some mod, to see a container's name?

#

I mean, the name as it is listed on the procedural distribution document

mighty solstice
#

Yo! im trying to add britas and gunfighter arsenal to my mp server but cant seem to find arsenal ID folder 2297098490

#

any ideas?

zealous peak
#

C:\Program Files (x86)\Steam\steamapps\workshop\content\108600

#

@mighty solstice the di seems to be correct. Maybe you went to the wrong folder?

sour island
#

Just got this log from another user, modder who wrote this debug message, why?

tulip valve
#

In my experience the console logs arnt very useful lol

mint sphinx
#

@sour island dobyiu know how to make a groupBox setting in the sandbox menu? I only know how to make a new tab and make setting for each of them not for a box setting

sour island
mint sphinx
marble folio
marble folio
zealous peak
#

sorry for repeating a question, but is there any way of, when accessing a container in the game, to see it's name as it appears in the procedural distribution file?

hidden estuary
#

anyone knows how to kill the player?

local function skill_issue()
    local stats = player:getStats()
    stats:setOverallBodyHealth(-101)
end```
#

I tried setHealth(0), nothing

#

I tried setOverallBodyHealth(0), also nothing

#

and the -101 same result

#

I'm trying so hard to reduce the player's health but so far got nothing

uncut meteor
#

try this maybe player:getBodyDamage():setOverallBodyHealth()

hidden estuary
#

will try

thin hornet
hidden estuary
#

that was me

#

I said I was using thirst

weary matrix
hidden estuary
#

but would much rather just relate to health

hidden estuary
hidden estuary
#

thats funny, the getBodyDamage makes the character count as Deceased for a tick before going back to normal

#

no death actually happens

smoky sentinel
#

does anyone know how the stripclub zone is referred to in the game files?
Can't find it to be mentioned anywhere so I don't even know how there's special zombies spawning there.
This seems to be wrong:
table.insert(ZombiesZoneDefinition.Stripclub,

late hound
#

its because the strip club zombies are spawned in by a special java story event iirc

#

sometimes you would get just the bunny girls, other times you get the cowboys

sour island
hidden estuary
#

I've wanted to set a health drain at first so I was looking for ways to actually damage the player that isn't adding an injury to a body part, but yeah, I'm not finding the right stuff for that

lapis stump
#

does anyone know which lua script creates the aiming cursor ?

weary matrix
#

Any clue how to iterate a Java HashMap from Lua? Or getting the list of keys in the HashMap? Problem is the Set class is not exposed to Lua

grim ridge
#

is there a mod that allows you to carry two weapons on your back? like 1 axe and 1 crowbar

weary matrix
zealous peak
#

yo

#

i wanna add the trolleys and shopping carts from the zupercarts mod so they can be smelted in the blacksmithing mod.

#

I asked the creator of the blacksmith mod and it told me that all I have to do is add a metal value to the items, so I opened the file for the carts and trolley's porperties and added the metal weight as it appears in the blacksmit mod.

#

Could somebody tell me if this would be correct?

zenith smelt
#

How do I create a map?

#

I mean code map

drifting ore
hidden estuary
#

can you make an example of what the code would look like?

willow estuary
cold burrow
willow estuary
willow estuary
#

np! ๐Ÿค™

hidden rampart
#

Anyone know where the lua for stuff like painkillers, bandages etc is stored? i've only been able to find the animation code and not the actual 'apply meds' code if that makes sense

zenith smelt
#

Is there a way to get a unique ID for every item?

zenith smelt
#

Yeah, but is there one that I can get in-game?

#

Do items and thigns have it already set up?

drifting ore
#

and yes the do have it pre made

next hazel
#

how do i check if the object/tile is water? like the water tiles

drifting ore
next hazel
#

to add something to the context menu when use on water

hollow shadow
#

thats weird, i cant see all the pins

#

only like 10 of them and they are old

quasi geode
#
The Modding Section of the PZ Wiki: https://pzwiki.net/wiki/Modding
This is where link to modding resources should be posted by the community.
Most of the pinned posts were migrated here; if a pinned post is missing, it's here now.
hollow shadow
#

._.

dreamy linden
hollow shadow
#

@winter bolt sry to bother but did you but since you did clothing before, do you know why i get errors when i hover over my item after doing using "setexclusive" in extrabodylocations?

#
group:setExclusive("ShieldSlot", "Back")```
winter bolt
#

i'm not sure, i've never really messed with that stuff in body locations

willow estuary
hollow shadow
#

hmm, its an item that gives an attachment slot tho

willow estuary
#

It's a clothing class item, right?

hollow shadow
#
    {
        Type = Clothing,
        DisplayName = Sword Sheath,
        ClothingItem = SwordSheath,
        BodyLocation = SwordSheath,
        Icon = SwordSheath,
        Weight = 0.1,
        AttachmentsProvided = SwordSheath,
        Tooltip = Tooltip_SwordSheath,    
        DisplayCategory = Accessory,
    }
    item ShieldBelt
    {
        Type = Clothing,
        DisplayName = Shield Belt,
        ClothingItem = ShieldBelt,
        BodyLocation = ShieldSlot,
        Icon = SwordSheath,
        Weight = 0.1,
        AttachmentsProvided = ShieldSlot,
        Tooltip = Tooltip_ShieldBelt,    
        DisplayCategory = Accessory,
    }```
#

should i remove the tooltips?

plucky pollen
#

iv made the lap pillar you can craft be able to connect to the power grid.. but im having a slight issue with it

willow estuary
# hollow shadow ```item SwordSheath { Type = Clothing, DisplayName = Sword S...

Nah, this is because the procedurally generated tool tips about armor value are being broken comparing clothing vs container?
This is custom lua I use to work around the issue; it doesn't work in all circumstances, but it might for you? Otherwise maybe try giving those custom items the Back BodyLocation instead, while also using this code, and see if that resolves the issue?

require "ISUI/ISToolTipInv"

local old_ISToolTipInv_render = ISToolTipInv.render

function ISToolTipInv:render()
    local item = self.item
    local player = getPlayer()
    if item
    and instanceof( item, "Clothing")
    and item:getBodyLocation()
    and  player:getWornItem(item:getBodyLocation())
    and instanceof(  player:getWornItem(item:getBodyLocation()), "InventoryContainer")
    then
        return false 
    end
    old_ISToolTipInv_render(self)
end
dreamy linden
#

how can i find the sounds that the game uses ?

willow estuary
dreamy linden
#

ah thanks

hollow shadow
willow estuary
hollow shadow
dreamy linden
#

fast mod

#

good

willow estuary
hollow shadow
willow estuary
#

Oh! You have custom tooltip text for your item? Sorry, yeah, my solution would probably break that ๐Ÿ˜

hollow shadow
#

wait ill try again after removing it

willow estuary
#

My code also may be out of date?

hollow shadow
#

ah still dont work ;-;

willow estuary
#

You're still getting errors? Try it with the body location changed to Back for that item + spawning in a new instance of that item?

hollow shadow
willow estuary
plucky pollen
#

Iv made the lamp post you can craft connect to the power grid and not need a battery can use battery still Was wondering how to get it to show on generator and actually draw power from it so it increases fuel consumption i also have an issue where when the generator is turned off the light stays on for 15 / 20 seconds and has to be manually turned on when generator re-started.. anyone able to help?

willow estuary
# hollow shadow still get an error :I

Yeah, sorry, I use that code in concert with my suite of custom mod stuff, so it works in that context?
Here, maybe try this, then you can check the console output and see if the file with the code is loading and when it is, and is not, being triggered by searching the console.txt?

require "ISUI/ISToolTipInv"
print("Loading Custom ToolTip Override Code")
local old_ISToolTipInv_render = ISToolTipInv.render
function ISToolTipInv:render()
    local item = self.item
    local player = getPlayer()
    if item and instanceof( item, "Clothing") and item:getBodyLocation() and  player:getWornItem(item:getBodyLocation())
    and instanceof(  player:getWornItem(item:getBodyLocation()), "InventoryContainer") then
        print("Overriding Vanilla ToolTip")
        return false 
    end
    print("Using Vanilla ToolTip")
    old_ISToolTipInv_render(self)
end
hollow shadow
#

ok somehow that fixed the toolbelt but not the shield or sword belt

willow estuary
hollow shadow
#

"Using Vanilla ToolTip" showed up alot of times

cold burrow
#

Hm, any lua method to remove item completely from a game? ๐Ÿค”
Also, where you getting all this methods? Any lib? :)

hollow shadow
#

"Loading Custom ToolTip Override Code" showed up once

#

"Overriding Vanilla ToolTip" didnt show up at all

willow estuary
#

Yeah, it will do that. You can comment out that part with -- if it gets annoying flooding the console.txt?

hollow shadow
willow estuary
hollow shadow
#

yeah thats where ive been looking*

willow estuary
#

Well, at least we got somewhere with this? ๐Ÿ™‚

hollow shadow
willow estuary
#

It's a pretty primitive brute force solution TBH ๐Ÿ˜„

hollow shadow
#

yeah its alot better than errors tho. and since its a late game item, it probably wont cause too much problem xd

willow estuary
cold burrow
#

Blair Algol, can i get your attention just for a second please? :)
#mod_development message

Don't want to bore you with ping.