#mod_development

1 messages Β· Page 175 of 1

novel barn
#

I'm basically rewriting the logic to fill bags with dirt, gravel, or sand. This specific bit is a helper function to determine if a particular container is a drainable type that can hold one of those three.

autumn temple
#

is anyone able to show me how I should lay out a recipe that uses a custom animation?

novel barn
#

I'm essentially trying to make it so all vanilla bags can also hold dirt, gravel, or sand

#

because it pisses me off when I have 5 duffel bags but no sacks and I want to get a safe farm set up

#

I might cry if you tell me it exists because I scoured the workshop and didn't find anything like it

fast galleon
#

You can use this mod to do it, check the script edits file where I add it to some vanilla items.

novel barn
#

Thanks! I will! For now I'm going to call it a night though because tomorrow I'm probably going to rip out everything I've done so far. Thank you both so much! Good night!

bronze yoke
#

gn!

novel barn
#

(the time wasn't wasted. It was a great learning opportunity! However I'd prefer to write good code from example rather than the spagetti I was writing)

fast galleon
#

You can ping me if you have issues / need something changed.

#

gn

novel barn
#

Will do πŸ™‡ πŸ™‡β€β™‚οΈ πŸ™‡β€β™€οΈ

#
Edits.Items = {
  ["Dirtbag"] = {
          Tags = { _DirtContainer = true },
      },

It's all the things I wondered if I could do... answered.

autumn temple
#

GraniCry I cant figure this out, errors arent really telling me anything either

autumn temple
#

as mentioned earlier im trying to apply a custom animation to a crafting recipe, but when I do it instead of my animation playing, my character just raises their hand to the sky like the falling animation.

#

tried to see if I can fix it myself and somehow made my guy dab

#

it says I need a PerformingAction but I have no idea how to implement that

#

cant find anything from googling it

#

I got it to no longer give me that error, but it still doesnt play the animation when asked.

fast galleon
#

is the animation set up to work with timed actions? (xml file)

autumn temple
#

I think so?

#

(is clueless)

fast galleon
#

so when you say custom animation, you mean a vanilla animation?

autumn temple
#

custom animation

#

made in blender

#

I used the tutorial which just shows me how to get it so I can play the animation through a keybind. but I cant figure out how to get it to work as a PerformingAction

fast galleon
#

take a look at the xml files in AnimSets/player/actions

dark wedge
# autumn temple I used the tutorial which just shows me how to get it so I can play the animatio...

Take a look at the file in the base game: media/AnimSets/player/actions/SawLog.xml
This is a good example of a "custom" animation for a crafting recipe. You will see that there is the condition for the animation:

    <m_Name>PerformingAction</m_Name>
    <m_Type>STRING</m_Type>
    <m_StringValue>SawLog</m_StringValue>
</m_Conditions>```
So, create your own xml file similar to this one (make sure to put it in the same folder structure in your mod), and use your own condition value like:
```<m_Conditions>
    <m_Name>PerformingAction</m_Name>
    <m_Type>STRING</m_Type>
    <m_StringValue>MyCondition</m_StringValue>
</m_Conditions>```
In your recipe, then set the `AnimNode` to your condition value:
```AnimNode:MyCondition,```
tropic hedge
#

Hello everyone,

The transmission client/server is working perfectly, i can extract the data from the table. I would like know if is possible to retrieve ONLY the value from getTotalKills(username, value) method

I want to retrieve the public server-side method getTotalKills(username, value) from this mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2857273296 located in the file media/server/Server.lua .

Thank you

side client

client/MyDebug.lua 


require("Server") -- this is mod Ashen MP Ranking 

local function onServerResponse(module, command, args)
    print("onServerResponse")
    print(args)

    print("-----------------------------------")
    print(args.ladder.zKillsTot[1][1])
    print("-----------------------------------")

end

local function sendServerRequest()
    print("sendServerRequest")
    local player = getPlayer()
    local module = "AshenMPRanking"
    local command = "PlayerData"
    local username = player:getUsername()
    local dbg

    sendClientCommand(player, module, command, {username})
end

local function onCustomUIKeyPressed(key)
    sendServerRequest()
end

Events.OnCustomUIKeyPressed.Add(onCustomUIKeyPressed)
Events.OnServerCommand.Add(onServerResponse)


----------------------------------------------------------------


side server
server/MyDebugServer.lua 


-----@param player -- getplayer()
-----@param module -- AshenMPRanking
-----@param command -- "PlayerData"
-----@param args  -- userName - getPlayer:use
local function handleClientRequest(player, module, command, username )
    local totalKills = getTotalKills(username, nil)
    sendServerCommand(module, command, { totalKills })
end

Events.OnClientCommand.Add(handleClientRequest)

fast galleon
autumn temple
#

but it doesnt go over any of the code stuff just actual animations and rigging

#

kadgbrasdlkbg agakdsjgbasdkfgbadsfgbnasdfg

#

its still not playing the animation

dark wedge
autumn temple
#

yes it does

dark wedge
dark wedge
# autumn temple yes it does

Cool. So, where did you put the xml file that you created? In your mod, it HAS to be in: media/AnimSets/player/actions/whatever.xml

autumn temple
#

ya its in that file locaiton

dark wedge
#

Also, did you restart the game after making it? Like, actually close and re-open the game? it won't load new files

autumn temple
#

yup

#

ive restarted dozens of times

dark wedge
#

what's the contents of your xml file

autumn temple
#

I just copied some vanilla code, i forgot which one it was exactly

#

then I had the IsTestfile is my AnimNode

dark wedge
#

In that action, set: <m_AnimName>Bob_IdleSawLog</m_AnimName>
In your recipe, set: AnimNode:IsTestfile
Does it play the Saw Log animation on your recipe? If so, then its the name of your Animation.

autumn temple
#

it does

#

so its the m_AnimName thats fucking things up thinkEgg

dark wedge
#

Seems like it. At least you got the rest setup and you know the issue. Just be sure that the m_AnimName is set to whatever the animation's name actually is

autumn temple
#

so m_AnimName should be the files name?

#

ooooh wait I see it now

#

im stupid, that should be the animation files name

#

I changed the animation fbx file name to Bazinga just to test

dark wedge
#

not necessarily. it just so happens that the base game names all animations with their file names (if that's where you're getting that assumption). it will be the name you set for the animation itself in blender or fragmotion or whatever you used. You also need to ensure that your animation is in media/anims_X/Bob/

#

Possibly if you don't set a name then it just uses the file name, if that's working for you. But i definitely have animations playing that have a different file name. ha

autumn temple
#

so in blender I would go to the nonlinear animation and set the animation name to what I want the m_AnimName?

dark wedge
#

correct

autumn temple
#

ok so I see that it did work. but its only applying some of the animation not all. like only the arms are animated instead of the whole body

#

but that probably has to deal with my exporting the file wrong

dark wedge
#

Yea, there is no blending in your action file so it should be applying to the whole model.

#

Still, forward progress is good

autumn temple
#

ye, i should get some sleep. later i will figure out why its not applying the whole animation only parts

#

I wanted to go to bed two hours ago but i just wanted to try and finish this first πŸ’€

dark wedge
#

same. i just finished my proof of concept for a "drop in" replacement for the context menu so its a radial now:

autumn temple
#

oooo nice

dark wedge
#

was easier than i thought, but needs a lot of work. i have it limited to only 8 things currently because the build menu created hundreds of entries. ha.

neon bronze
#

This does seem like a mod that would pop off

dark wedge
#

and eh, if it doesn't take off then oh well. I'm having fun, and that's all that matters imo. πŸ™‚

#

lmao. misread that, further proof i need to sleep.

neon bronze
#

I prefer this one over the current one already

dark wedge
#

We'll see what happens here. I should be working on so many other things.

fast galleon
mellow frigate
#

Hello there, anyone knows where is handled the difference between long key pressed Vs quick key pressed (e.g. for window climb Vs open/close) ?

fast galleon
mild venture
zinc pilot
lilac flower
#

Currently making a mod to place the police deputy hat on the back, I noticed that whenever my character puts on any clothes which are torn, the hat's texture becomes a flat grey. Anyone knows what is going on?

mellow frigate
#

Hello, I'm using an invalid animName on purpose (it gives an ok result for zombiesturning) are there side effects to expect in addition to the warning log ? <m_AnimName>invalidOnPurpose</m_AnimName>``````WARN : General , 1687793980874> AnimationPlayer.play> Anim Clip not found: invalidOnPurpose

steep onyx
#

So, if I wanted to make a mod that replaced in game text how would I do that?

mellow frigate
steep onyx
#

I’m changing Health UI text

mellow frigate
#

it depends on what you wanna do. you can either change lua for Health UI or find the text you wanna change from the text files under media\lua\shared\Translate\EN\ and add the same file to your mod with your changed text (you do not need to duplicate all unchanged text)

quartz tree
#

I am not a mod developer but I'm looking to commission one to make some vehicles for me. If anyone is willing please DM me

tulip atlas
#

Hello, one of mod creators let me make a mirror version of his mod with some small patches.
I copied this mod without changing anything, uploaded it on steam workshop on private just to test it

#

and this copied version of original mod just doesnt work, i dont understand why

#

it has different IDs

autumn temple
#

@dark wedgethank you for all the help too 6 hours ago

mellow frigate
tulip atlas
#

okay, done. Now it works on single player

#

but cant use it on local hosted server, it stops at (NormalTermination)

#

LOG : General , 1687801213896> SERVER: info@coop mode enabled
LOG : General , 1687801213896> SERVER: status@UI_ServerStatus_Initialising
LOG : General , 1687801233328> SERVER: src\public\tier1\interface.h (265) : m_pModule
LOG : Network , 1687801233329> [CoopMaster] Unknown message incoming from the slave server: src\public\tier1\interface.h (265) : m_pModule
LOG : General , 1687801233329> SERVER: process-status@terminated
LOG : Network , 1687801255907> [26-06-23 19:40:55.907] > ZNet: workshop item 1635082819 is not installed
LOG : Network , 1687801255909> [26-06-23 19:40:55.909] > ZNet: workshop item 1423496473 is not installed
LOG : Network , 1687801255910> [26-06-23 19:40:55.910] > ZNet: workshop item 498455406 is not installed
LOG : Network , 1687801255916> [26-06-23 19:40:55.916] > ZNet: workshop item 2802932924 is not installed

#

thats the only thing that appeared in console.txt

#

i tried to run it with my mod only, these 4 mentioned at the bottom are some random old mods i dont even have

mellow frigate
#

Afaik, your problem is related to multiplayer server use, not to modding.

bronze yoke
#

if your mod is private, the server can't download it

#

needs to be unlisted

tulip atlas
#

Oh god that so obvious, thanks I'm gonna try this

winter thunder
#

Hey, looking to force the player to fall down for a set amount of time. Anyone know how to force the player into that sort of state?

#

Alright- I think that a timed action would be the best, but I have never actually coded my own timed action so πŸ˜…

autumn temple
#

for some reason the game just refuses to recognize my IGUI_EN

bronze yoke
#

the filename should be IG_UI_EN

autumn temple
#

:v

#

thanks...

#

I had it as IG_GUI_EN

winter thunder
#

It really do be like that sometimes... The amount of headache I have caused myself by missing one character somewhere is insane lol

bronze yoke
#

that one bugs me because of the inconsistency

#

it should either be IGUI or IG_UI, not both

red tiger
#

This game doesn't have consistency with naming conventions.. not even the API.

winter thunder
#

My personal fav is when there are typos in the naming of things

red tiger
#

Sometimes I'm calling methods with C# PascalCase names and sometimes I'm calling snake_case functions..

bronze yoke
#

the typos are just because a lot of TIS aren't native english speakers

#

(probably)

red tiger
#

colour is not a typ0.

bronze yoke
#

i've given in and started using american spelling in my apis

bronze yoke
#

complicating things further doesn't really help as it turns out πŸ˜…

red tiger
sour island
#

There's a typo in the perks names that I always found wholesome

#

Passiv

#

too cool for the letter E

#

or maybe too passive 🧠

autumn temple
#

the E is too aggressive

mild venture
#

Sometimes they name the method with a small letter, sometimes with a capital letter. Sometimes it starts as CamelCase, but in the middle of the method name the new words are in lowercase. Umbrella really helps in this situation πŸ™‚

mellow frigate
#

getX() is part of IsoObject, I want to store localy getX for an IsoPlayer instance (inherits from IsoObject in Java), should I write local isoPlayer_base = __classmetatables[IsoPlayer.class].__index local getX = isoPlayer_base.getX or local isoObject_base = __classmetatables[IsoObject.class].__index local getX = isoObject_base.getX before calling local x = getX(isoPlayerInstance) ? @jaunty marten

crystal oar
#

is there an event for when an item enters a player's inventory?

crystal oar
#

ah so that is to say there isn't one in vanilla?

mild venture
#

I want to make hook at Commands.remove (server\Vehicles\VehicleCommands.lua:551), but Commands is in local scope and file not exported anyting. Is there any way to inject my code into this function?

#

i need to get keyId of vehicle before that was removed

bronze yoke
#

you can add your own command listener and get that data from the args

mild venture
bronze yoke
#

add your command listener from the shared folder so it executes before the vanilla listener gets added

bronze yoke
#

otherwise you could hook BaseVehicle.permanentlyRemove

tawdry solar
#

how would somone make custom radio messages

mellow frigate
#

vanilla painting action refers "Painting" sound. I do not find such any Painting.ogg under media/sound. Where should I look for to get it ?

bronze yoke
#
    sound Painting
    {
        category = Player,
        clip
        {
            event = Character/Survival/Carpentry/Painting,
        }
    }
#

this means it's from fmod

#

if it's too new to be in the loose files then you have to extract the soundbanks

mellow frigate
#

I won't ask

novel barn
#

I have a few quick theory questions if anyone doesn't mind. I have a mod that is going to behave very similarly to another, which means I'm probably going to copy a lot of functions over for my own.
1.** Is it possible** to require the functions from the first mod so that I don't have to rewrite them? I'll only rewrite them if the mod is absent?

if getActivatedMods():contains("SomeCleverMod") == true then
    --require the file to gain access to the necessary functions
else
    --write the functions myself since the mod isn't present
end
  1. If it is possible, is there any performance reason to do this? Or should I just duplicate the functions and not worry about it?
    As I'm thinking about this I'm starting to feel like it's probably not a good idea to do this. If SomeCleverMod changes then my mod will probably implode when the when the two mods are enabled together.
ornate parrot
#

So, I want to make a pretty simple mod that removes some items from another mod

#

and upload that to the workshop, but i don't wanna just have that mod be a reupload of that mod just with some items missing

#

How would i go about making a mod that patches the other mod by removing some of the items from it

bronze yoke
#

the best way to write lua is with modules, which have the best support for this, but the majority of mods don't use them - some of them use a global table instead which is just as good for your purposes, but if they're completely local you'll have to duplicate

ornate parrot
#

Hmm, ok

#

so what you're saying is like, using global tables to stop those items from spawning/being obtained?

bronze yoke
#

i was actually continuing my response to collide but the answer to your question is similar

ornate parrot
#

my bad

quick haven
#

Trying to make a clothing mod but the model keeps breaking, is there any way to fix this?

ornate parrot
#

The reason why is because I want to use this on a server

#

or have it be able to be used on a server and said server has a mod that allows you to pick almost any clothing when you spawn in

#

if I were to just take the items off the loot table they would still be able to be obtained through character creation

#

hence my issue

bronze yoke
ornate parrot
#

ohhhh ok

bronze yoke
#

there's an OBSOLETE parameter for items, but i don't think it works as well as it does for recipes...?

#

i should check that, if that works it'd be even better to just make a new script that marks those items as obsolete and nothing else

ornate parrot
#

alright

#

how would I go about that then?

#

I don't got experience with modding unfortunately

#

but I assume you find the mod file and edit the script from there, then just upload the item script which will override the original mod?

bronze yoke
#

i had a quick look and it looks like OBSOLETE will stop it from spawning anywhere, but i don't think it'll stop it from showing up in the clothing selection unless the mod you're talking about specifically adds that

ornate parrot
#

well, I'll take what I can get

novel barn
#

@ornate parrot this might be a little hacky, but would it be sufficient for you to just overwrite the items you don't want to be items you do? Or is it necessary that the items be completely gone? For instance if the main mod in question has crocs as a type of shoe and you want that gone, would it be enough if crocs were actually just regular trainers. The full item name would still be crocs, but you could change the display name, model, etc to be trainers.

ornate parrot
#

I'm mostly trying to remove the extra clothing the mod adds and keep the shoes

novel barn
#

I suggest pursuing what Albion suggests first though. She's far more knowledgeable and will most likely be able to get you the best results.

ornate parrot
#

also keeping very few clothes as well but mainly only the riot gear

bronze yoke
#

so the way i'd do this: if two mods have the same filename in the same directory, only the file from the mod latest in the load order will be loaded - if your mod requires the other mod, i think it forces it to be later, so just copy their script with the same name and path, and remove the parts you don't want

#

i'd like to see a cleaner solution to this since file overrides are generally frowned upon but i've never come across needing to remove an item wholesale before

ornate parrot
#

as I said I'd also be fine if it stopped them from spawning

#

since right now I don't have a server nor do I use those clothes in singleplayer when I spawn in so

bronze yoke
#

in that case, a lua script like this:

local item = ScriptManager.instance:getItem("Module.Item")
if item then
    item:DoParam("OBSOLETE = true")
end
```would be able to stop the item from spawning
ornate parrot
#

alright

#

now how would I apply that to certian items?

bronze yoke
#

you'd just need to swap out the "Module.Item" with the full type of the item (usually something like "MyMod.MyItem" or "Base.MyItem")

ornate parrot
#

Hold on I'm trying to find that

autumn temple
#

so I assume this is a code thing. but I am trying to get my custom animation to loop for if someones going to be crafting a large quantity of items. but when I enable <m_Looped> it for some reason speeds up my animation to a comical degree

#

does anyone know why it speeds up?

#

I assume its beacuse of these? but when I remove them the animation actually gets faster

#

nah speedscale doesnt seem to slow it down

primal remnant
#

If you guys haven't read or learned anything about "Behavior Trees", I found an awesome article that was recommended by ChatGPT. If you don't know what I'm talking about, Behavior Trees are what make NPC's possible, dynamic, and engaging.

While I wasn't looking specifically for something related to Project Zomboid, that is where the author made his inroads to the subject. The primary complain he had about online tutorials is that while they explained the topic, they failed to demonstrate the subject matter in any useful context. So he did it with PZ.

I think maybe ChatGPT remembered that I ask many questions about LUA and Modding for PZ and gave me relevant article, OR it's just a happy coincidence. No telling, but if you want to check it out, it's titled "Behavior trees for AI: How they work" by Chris Simpson. I'm reading it for free on gamedeloper.com. Unreal Engine also has some good documentation and exaples of Behavior Trees and AI. I think this will be very important as NPC's are introduced the game.

autumn temple
#

so I guess I cant loop my animation at all because of the broken speed. since SpeedScale doesnt seem to do anything when loop is applied.

sour island
odd fjord
#

is there a way to pop up a message everytime a player picks up a specific item?

mellow frigate
mild venture
winter thunder
#

Anyone willing to help me out with something? I'm not quite sure how to go about applying it

#

Basically want to force the player to fall/collapse, for some amount of time

#

I was thinking of using a timed action, but I am not sure if that would be the best way to handle it

winter thunder
#

Or, would I be able to just force the player into the PlayerFallDownState, and then exit that state after

median prairie
#

Apologies for interrupting.

Is it currently possible to add a second chat tab, similar to the admin tab?

bronze yoke
#

i've heard that it is, but that's it's surprisingly complex for what should be simple

winter thunder
median prairie
#

Thank you so very much! Really helpful. Much love.

Additionally, I'm looking to commission said chat tab code function ($$$).
DM if interested.

grizzled goblet
#

Hello! I wanted to ask if getCell():getOnlinePlayers() is the right call to get playerobjects in the current cell?
currently use getCell():getZombieList() for zombies

bronze yoke
#

just getOnlinePlayers()

grizzled goblet
#

hmm don't know what I'm doing wrong 😦 but it gave me a stacktrace error
java.lang.RuntimeException: Object tried to call nil in CheckPnZ

    local PlayerList = getOnlinePlayers()
    if PlayerList ~= nil then
        for i = 0, PlayerList:size() - 1 do
            local player = PlayerList:get(i)
            if player then
                square = player:getCurrentSquare()

I also tried out getSurvivorList() but doesn't seem to work

bronze yoke
#

which line does it point to?

grizzled goblet
#

local PlayerList = getOnlinePlayers()

grizzled goblet
#

Okay Pascal Case got me ded stressed

autumn temple
#

I got a curiosity at 2am bruh

#

is it possible to like, create your own moodle?

#

and has anyone ever done it?

pseudo flame
#

Would be insane

bronze yoke
#

there's a lot of custom moodle mods

#

none i know of are very popular though

autumn temple
# bronze yoke there's a lot of custom moodle mods

huh I will look into them because it is an interesting concept though having it as an individual mod probably is why they arent popular. I see the idea being better for a larger more complex mod with a moodle that relates to it. like a smoking overhaul mod having a custom smoking moodle and ect. not just the moodle and release.

#

It's very complicated and hard to get custom moodles to work too because the base game already has all the important moods. So there should not be a need to add more.

ornate parrot
#

How would I go about making a mod that replaces a texture?

#

I made a small edit to the skinny version of the suit pants and want to try uploading it

shrewd violet
#

42k items in all my mods

#

How that game even load

mild venture
fringe heart
#

I wrote the code
everything works
, but
I'm doing random spawn of things
, it turned
out that 98 items need to be written to each container (250 pieces)
, this is 24750 lines of code
+-
Is there any way to simplify the process? Or write a program that will do it for me or something else?

odd fjord
#

does the OnFillContainer event apply to a player's inventory?

bronze yoke
#

no

bronze yoke
#

stuff like the inventory never gets loot spawned

odd fjord
#

is there an event that triggers after the player inventory is updated? like, if an item gets added to the player's inventory

#

i've looked at the wiki but i cant seem to find one

bronze yoke
#

no

odd fjord
#

welp, that sucks

bronze yoke
#

you can hook the inventory transfer action instead

odd fjord
#

i cant seem to find that in the lua events section of the wiki

neon bronze
#

Its not an event but hooking into an existing function

odd fjord
#

this is getting a bit too complicated for me, so i guess i gotta put a hold on this HAHAHA

#

thanks for the help!

void osprey
#

I'm kinda interested in modmaking but I probably want to wait until Build 42 for anything serious, right? Is it possible to create a new skill, or are the skills pretty hardcoded vis-a-vis the menu UI?

neon bronze
#

Its possible to make a new skill appear in the ui + b42 seems like a long time away from releasing

bronze yoke
#

adding a skill to the ui is pretty simple, it's probably the actual implementation of the skill that'll be more complex

#

there's a script format for skills

void osprey
#

I'm thinking my skill will be more like carpentry/metalworking where it's more of a construction check number versus like aiming or fitness.

#

There doesn't happen to be a guide on this anywhere, is there? I haven't seen any mods that add new skills.

neon bronze
#

There is that piano mod that has a functioning trait added in

autumn temple
#

Ya I was looking into making a Moodle without having to rely on the framework but couldn't get it to work so I scrapped all I did last night lol

mellow frigate
#

In addition to less work, you'll also get compatibility with existing mods using the framework. But this is not working for Splitscreen players.

autumn temple
#

Ya, frameworks do make things a lot easier, but I feel like having a list of mandatory mods needed just for yours to work is bad UX. But it takes a lot of skill and is usually a waste of time to try and not use them.

red tiger
#

It'd be nice if I could get frameworks to write EmmyLua typings.

#

Either that or typings can be done third-party.

abstract raptor
#

Anyone know how you snap an item to a surface?

ornate parrot
#

I want to create a mod that replaces the suit pants texture

#

I tried doing that last night but it simply didn't replace the texture

#

so I'm unsure how to go about that

autumn temple
#

I am brainstorming how I want to do this custom moodle and I have no idea how to do any of it cuz its my first time messing with stuff like this

#

so my idea is to have a stat that accumulates over time, sort of like Boredom. and then I can assign that new stat to certain books or actions to reduce it.

#

does anyone know of any resources related to creating a custom stat like that?

robust briar
#

Can anyone explain what each of the following are on IsoMovingObject, or at least which should be used to absolutely position something in the world?

  • x,y,z
  • Lx, Ly, Lz
  • Nx, Ny
  • Limpuslex, Limpulsey
bronze yoke
#

x,y,z

#

i know the l-x,y,z needs to be set to teleport players but i don't think it's necessary for any other objects...?

robust briar
bronze yoke
#

ohh @mild venture knows something about this

robust briar
#

Trying to solve the "too many vehicles in one area" lag issue on a big server. Making a "parking/reclaim" system for vehicles.

bronze yoke
#

they were trying to teleport vehicles too, i don't think anything i pointed them towards worked but i think they did get it working in the end...?

#

the reason the usual method doesn't work on vehicles is because their position belongs to the physics engine

robust briar
#

idea was to TP the vehicles to the other side of the river, and give the player a claim slip. Then they can come back to the "teller" and get their car back.

bronze yoke
#

you probably won't be able to teleport them to an unloaded area

robust briar
#

I already have a way to load unloaded chunks on server

robust briar
mild venture
ornate parrot
#

hey albion do you know how to replace a base game texture via an insallable mod?

#

I tried making one last night but I didn't quite figure it out all the way

bronze yoke
#

i think if the filepath in a mod matches the vanilla one's it'll load yours instead

ornate parrot
mild venture
true vault
ornate parrot
#

I did

robust briar
# bronze yoke oh?

I have a ghost account which can receive servercommands to be teleported to where I need.

bronze yoke
# ornate parrot

your filepath doesn't match, my one is in textures\Clothes\SuitTrousers and yours is in textures\SuitTrousers

ornate parrot
#

hmm, ok

robust briar
mild venture
robust briar
#

This is why i love modding. We are all just building and learning from each other

ornate parrot
#

It didn't work for some reason

#

That's so weird this should've worked

#

wait nbm

#

nvm

#

it's clothes not clothing

#

IT WORKS I FINALLY FIXED IT

bronze yoke
#

yay!

ornate parrot
#

that part of the suit pants annoyed me so insanely much it's unreal

mild venture
ornate parrot
#

Original vs. fixed

mild venture
#

Oh, nice. Looks better

autumn temple
#

where in the vanilla code can I view how character stats are made? I want to try to make a new one for my mod.

ornate parrot
#

That shit annoyed me so much

#

I'm glad I was able to fix it

#

now I can actually use the skinny version of the pants in peace

#

anyways I'll also fix the other 2 suit pants

#

army pants and white suit pants

bronze yoke
#

there's nothing mindblowing in there

ornate parrot
#

Now

#

I've got 1 question

#

How would I fix it for modded pants?

#

I.E Small Town First Responders

autumn temple
bronze yoke
#

you can't really replicate the way they do it

#

just creating a moddata table with myStat = 0 would literally be reimplementing what that class does

bronze yoke
ornate parrot
#

Huh?

#

nothing, I was gonna do the same thing I did to the other suit pants though

#

taking off the black line on the top so that way the skinny version don't look weird

autumn temple
#

if there is a resource that would assist me in trying to create a new stat id go with that, if not then i will just figure it out with the vanilla stuff

bronze yoke
#

i didn't look closely before, yeah that's weird as hell

ornate parrot
bronze yoke
#

the belt buckle is way too far from the top of the trousers

#

it definitely happens with stfr textures too? i might bring it up with them

ornate parrot
#

I mean

#

it's not a fault on their part

#

it's more of a thing that was part of the OG suit pants texture that came with PZ that nobody really noticed until it was pointed out

bronze yoke
#

well of course, but if it's an easy fix and we all agree it's better and should be done

ornate parrot
#

and we've all been using those same suit pants textures

#

if they wanna make that fix they can, it saves me time from adding it onto my mod lol

bronze yoke
#

as for doing it with an external patch, it's just the same method, except you need to ensure your mod loads after theirs

#

i think mods that require another mod in their modinfo load after that mod in singleplayer, for servers though the load order is up to the host

ornate parrot
#

I'll check it in a bit

#

rn I wanna try making the mod so it looks good on the workshop

bronze yoke
#

i'm not too familiar with ensuring the load order of mods as i primarily work with lua which has simpler solutions for that

ornate parrot
#

Either way

#

it's unfortunate

#

most annoying and infuriating thing ever when you finally notice it

bronze yoke
#

i'm probably going to have to install that mod when you've released it

ornate parrot
#

It'll be released pretty soon dw

#

only affects the skinny version of all kinds of suit pants

bronze yoke
#

luckily i haven't been able to spot anywhere in stfr that runs into that issue

#

maybe one of the texture artists spotted it already or we just haven't reskinned the item with the issue

ornate parrot
#

oh good

ornate parrot
#

and I haven't found the skinny variants for the stfr pants yet

autumn temple
bronze yoke
#

yeah, i'm not sure we have any? but as always i'm not the assets guy

autumn temple
#

@left plank SOS

ornate parrot
#

if they were ever to add skinny variants then yes you would see it

tame mulch
#

<@&671452400221159444>

late bolt
#

Thanks, deleting the rest

left plank
#

Sorry missed that

lost slate
#

slowpokes

autumn temple
#

does this seem relevtively close to creating a custom stat?

bronze yoke
#

the Stats object is hardcoded, you can't just add custom stats

autumn temple
#

thats stinky

#

whole basis of my plans was revolving around just that

bronze yoke
#
local modData = player:getModData()
modData.myMod = modData.myMod or {}
myMod.myStat = 0
```this sort of thing is the easiest way to make a custom stat
autumn temple
autumn temple
sour island
#

embedding a scrolling list within a scrolling list has been so painful lol

ornate parrot
#

@bronze yoke

#

just finished it

bronze yoke
#

nice!

#

it's actually crazy how stupid the original looks once you notice

ornate parrot
#

ikr

tame mulch
ornate parrot
#

@bronze yoke hey, sorry to bother you, but I want to make something of a reskin mod that adds new variants/colors to a pre-existing item

#

basically, different colors for leather jackets

#

basically just a brown and red version of the leather jacket

tame mulch
sour island
#

I wanted it to appear this way actually πŸ˜…

#

Personal preference of course - I think if the list scrolled as well as the interior one things would get confusing

#

I have the interior one pass it's scroll events to the other one

ornate parrot
#

Fellas I've got a question

#

for a red leather jacket

#

which one looks better

sour island
ornate parrot
#

I wanna try making several leather jacket reskins

fringe heart
#

Hello, we are creating a mod for random appearance in containers. There is a problem, in some containers the items are not displayed, some items are displayed and some are not, what is the reason for this?

ornate parrot
#

or adding different colors to the leather jacket

#

2 more colors

#

idk how to do that tho

bronze yoke
ornate parrot
#

how?

#

i don't know what doparam is

#

I'd also hope it's still compatible with Spongie's Clothing

bronze yoke
#

the different texture options are declared in the item script right? you probably have to use lua to add onto them

ornate parrot
#

oh ok

#

I don't know how I'd go about that though considering I don't have any expereince with lua

lusty karma
#

guys i never remember, when i save some translation files (ln my case French files that has "special" characters like Γ ,Γ© etc..) do i have to save them in ANSI ? UTF 8 ? other ? to make them appear correctly in the game

neon bronze
#

I think utf8

lusty karma
#

Oh yeah i just looked others FR translation files i had in others mods folders and yeah, seems like it is UTF 8, thanks

sour island
#

Going to use this with the debug tools to add an editing interface for modData and hopefully fields, Soonβ„’

sharp minnow
#

Hello everyone, I'm trying to create a way to spawn furniture in game. I started out using setTileObject but I was able to run through that. While investigating setThumpable I came across ISSimplefurniture which appeared to be a magical function that just did it all.

So i'm trying to create 5 boxes in a line - i've gotten this far but when I run this code the game gets stuck in a horrible horrible loop - it errors out on every line of ISSimplefurniture. am I just doing something stupid with the sprites?

The errors seem to start with line15 of ISSimplefurniture (buildUtil.setInfo(self.javaObject, self);)

  print("5boxes");
  local sqX = 150
  local sqY = 70
  local sqZ = 0
  local size = 5
  local cell = getCell()
  for x = sqX - size, sqX + 1 do
          conceptsquare = getSquare(x, sqY, sqZ);
          print(conceptsquare);          
          conceptsquare:ClearTileObjectsExceptFloor();
          ISSimpleFurniture:create(x,sqY,sqZ,'furniture_storage_02_17','furniture_storage_02_18');
          print("ObjectAdded");
  end
end```
#

Any help would be amazing, especially if it's something simple / stupid that I'm doing. I know I could probably get more efficient with the location, but this is for a PoC and my plan is to optimise later.

sour island
#

you're forcing a string into where a boolean should be

#
ISSimpleFurniture:create(x, y, z, north, sprite)
bronze yoke
#

IsoThumpable(IsoCell cell, IsoGridSquare gridSquare, String sprite, boolean north, se.krka.kahlua.vm.KahluaTable table)

sharp minnow
#

NORTH

#

I thought North was the north version of the sprite

#

not a boolean

#

thank you

sour island
#

I think there's something that does use string in that position

bronze yoke
#

there's another constructor that takes two strings, yeah

sour island
#

I think IsoObjects?

bronze yoke
#

this oneIsoThumpable(IsoCell cell, IsoGridSquare gridSquare, String closedSprite, String openSprite, boolean north, se.krka.kahlua.vm.KahluaTable table)

sour island
#

ah

west marsh
#

Howdy - how difficult would it be to spawn in notebooks with prewritten text in specific containers, possibly in modded locations / spawn a specific zombie with specific loot in a building? I haven't tried modding but I'm working on a challenge

sour island
#

it recognizes howdy too?

#

hola

#

racism

west marsh
#

Lmao

sour island
#

I do some similar stuff in NamedLiterature

sharp minnow
#

So, maybe another stupid question, so how should I know if the boolean should be true or false in this instance? If what I want to spawn is facing that direction?

sour island
#

That mod applies a title to the object, changes their stats, etc - you could add prefilled stuff. IF you're trying to make some sort of predetermined events, that would take more work.

west marsh
west marsh
bronze yoke
#

you could use OnFillContainer or LoadGridsquare, check if the container/square meets the conditions, then spawn a specific item and then mess with its properties

west marsh
dark wedge
#

Making some good progress with my radial context menu replacement. It now can be a drop-in replacement for all context menus, I have submenus working (currently only right-click to "go back"), and it should be compatible with all mods as I'm just hooking into what already exists. Its worked so far on everything I've tried it with at least. That said, if a mod wants a custom icon in the radial, they'll have to set it via a new function. Still needs some work (especially icons), but its definitely coming along.

sharp minnow
# sour island ```lua ISSimpleFurniture:create(x, y, z, north, sprite) ```

@bronze yoke - thank you both for your advice.

I set it to false, but i'm still getting the same errors. I'm not sure what I'm meant to set the Boolean 'North' to, but I figure False is better than nothing.

When the game loads it goes into error overdrive until I close it, the screen is black and the errors are all to do with lighting. So maybe I'm referencing an object that doesn't exist?

    local sqY = 70
    local sqZ = 0
    local size = 5
    local cell = getCell()
    for x = sqX - size, sqX + 1 do
            conceptsquare = getSquare(x, sqY, sqZ);
            print(conceptsquare);          
            conceptsquare:ClearTileObjectsExceptFloor();
            ISSimpleFurniture:create(x,sqY,sqZ,false,'furniture_storage_02_17');
            print("ObjectAdded");
    end```
bronze yoke
#

i'm not sure if you're using ISSimpleFurniture correctly

#

create looks like an instance method

#

it inherits from ISBuildingObject which is usually used for the build cursor

#

yeah, i think you'd need to do something like

furniture = ISSimpleFurniture:new(name, sprite, northSprite)
furniture:create(x,sqY,sqZ,false,'furniture_storage_02_17')
#

you might want to just copy some of the stuff create does since it seems like using the ISSimpleFurniture class is a roundabout way of doing things

sour island
#

What does the error say?

bronze yoke
#

you're sort of creating a building cursor and then immediately making it activate

#

i forgot i'd already created objects from lua before, here's an example of how i did it```lua
local crate = IsoObject.new(freeSquare, 'furniture_storage_02_17', 'furniture_storage_02_18')
freeSquare:AddTileObject(crate)

#

freeSquare being your IsoGridSquare of course

#

iirc the second sprite name there is a mistake and the second string is just a name for the object

sharp minnow
sharp minnow
bronze yoke
#

it's kind of frustrating there's no obvious way to do basic things like... create an object LOL

sharp minnow
#

Yeah! I might have a go with the ISsimplefurniture:new at some point but alas.

mild venture
sharp minnow
dark wedge
# mild venture Is there a way to remove an item from the radial menu?

For a regular radial, I think you can use RadialMenuAPI for that (haven't tried it, but iirc this is one of the features). For my context menu radials, it works the same as the current context menu stuff where you can just move stuff around. I don't build the radial until it's ready, so you can move stuff around.

mild venture
sour island
#

@tame mulch πŸ˜„

#

Any recommendations on functionality?

tame mulch
sour island
#

ooh, any sneak peaks? (I won't tell)

tame mulch
sour island
#

This is for custom areas people may need to refer to - in this case it's for zones that will spawn mining nodes

#

Once it's more stable I'll be repackaging it to work as an API

#

Can be used for another idea someone had where zombies behave differently in certain areas

bronze yoke
#

damn, i wrote something like this for stfr but i never thought of writing an editor

sour island
#

stfr?

#

Well the alternative would be to have people edit lua files and save to them

#

Also I didn't really look at vanilla zones per say - but I could alter it to do so

bronze yoke
#

small town first responders

sour island
#

I wasn't sure if those can be edited and saved

bronze yoke
#

it's just some zones for the purpose of spawning e.g. rosewood uniform police in rosewood

lusty karma
#

Guys again a quick question about how translation files work. I play with game in French so i try when possible to get all my mods in French. But wanted to know, for example when the game can't find the French translation for a string (example an item name) (lets imagine i forgot to translate a string), it will always display the English translation instead right?

abstract raptor
#
elseif tileToItemList[spr] then
                    sledgeDestroy(obj)
                    obj:getSquare():transmitRemoveItemFromSquare(obj)
                    local count = tileToItemList[spr].count
                    for j = 1, count do
                        local hasContainer = false
                        -- add item to a container if there is one
                        local objs = square:getObjects()
                        for k = 0, objs:size() - 1 do
                            local o = objs:get(k)
                            local c = o:getContainer()
                            if c and c:getType() ~= "counter" then
                                hasContainer = true
                                -- Add items to the container
                                c:AddItem(tileToItemList[spr].item, 1)
                            end
                        end
                        if not hasContainer then
                            local surfaceOffset = obj:getSurfaceOffset()
                            local random_x = ZombRand(-5, 5)
                            local random_y = ZombRand(-5, 5)
                            square:AddWorldInventoryItem(tileToItemList[spr].item, random_x / 10, random_y / 10, (0 + surfaceOffset), 1)
                        end
                    end
                    table.insert(objectsToRemove, obj) -- Add the object to the removal table```
#

I DID IT

autumn garnet
wet sandal
#

Any that stays English at that point is probably hard-coded in the Lua

bronze yoke
lusty karma
#

learnt that trick when i was translating mods for Stalker Anomaly

autumn garnet
#

But do this in your mod.. not directly in the main mod

#

So after when you load ur mods, you call the translation mod at the end and it's will overwrite all translation file

bronze yoke
#

also, if the developer was lazy, item names might sometimes be specified in the script instead of a translation file - i think translation files should still work for those but you'll need to work out the translation string's name yourself

lusty karma
#

oh btw you sure about ANSI as encoding?

autumn garnet
#

Yes :)

lusty karma
#

i asked earler, and seems like for French its better to use UTF cuz it has special characters

#

like Γ  Γ© Γ¨ etc

autumn garnet
#

You can try to use UTF-8 🀣 you will see what happens with special characters

bronze yoke
#

the wiki says they use ISO-8859-1

lusty karma
#

lol ok ^^

#

I'll go for Ansi then :p

#

thanks for answers !

#

omg lol just realized who i was talking to ^^'. Yeah ok i think you know what you're talking about :p

#

i dont see other french that often on the official PZ discord :p (sry for off topic, i stop there ^^)

tribal bane
#

Does a mod exist to lock spawn regions based on how many players picked that region so far? If so what is it, and if not would that even be possible?

jaunty marten
winter thunder
#

Has anyone here used / know of a mod that uses the changeState function?

#

I want to make sure I am using it correctly

#

This is how it is written in the docs. So, assumedly I would need to put the state into the parentheses of the function

#

In the actual 'State' class, this is what it looks like

#

Would I just put the name of the subclass itself into that funciton? i.e. -> player:changeState(PlayerFallDownState)

bronze yoke
#

player:changeState(PlayerFallDownState.instance())

winter thunder
#

I love you

#

Thank you so much

#

This has been driving me up a wall

#

lmfao

verbal yew
#

guys, how to eclipse two zombie state (if they crawling and if they already run anim?)

zReDontSetZombiesOnFire = {}

function zReDontSetZombiesOnFire.OnUpdate(zombie) --, apply
    if not zombie or zombie:isDead() or not zombie:isOnFire() then
        return
    else
        zombie:setWalkType("sprint1")    
    end
end

--Events.EveryOneMinute.Add(zReDontSetZombiesOnFire.OnUpdate)
Events.OnZombieUpdate.Add(zReDontSetZombiesOnFire.OnUpdate)
winter thunder
#

@verbal yew What is it you are trying to do? Seems like the goal is to make zombies sprint while on fire?

verbal yew
winter thunder
#

No you are alright. I understand what you are trying to do here. I will look through some of the javadocs rq and see if there is anything I can recommend

verbal yew
#

thanks ^^'

novel barn
#

By any chance is this publicly available either through the workshop or on github? I'd love to leverage this for some things I'm working on.

verbal yew
winter thunder
verbal yew
#
    return not zombie:isKnockedDown()
        and zombie:getCrawlerType() == 0
        and not zombie:wasFakeDead()
end

function zReDontSetZombiesOnFire.OnUpdate(zombie) --, apply
    if not zombie or zombie:isDead() or not zombie:isOnFire() or (zombie:isCrawling() and zReDontSetZombiesOnFire.shouldBeStanding(zombie)) then
        return
    else
        zombie:setWalkType("sprint1")    
    end
end```
autumn temple
#

so ive been reading up on stuff to learn lua more. and I have a few questions

#

when people reference "myMod", what exaclty do I even put there?

#

I see dozens of people using that as like a generic placeholder, but I cant figure out what information youre actually suppose to fill in for that

verbal yew
#

what do you mean?

autumn temple
#

like an example im looking at now "module myMod" or these two picture examples

autumn temple
#

Ive seen people even in this chat use that as example code, and I just cant figure out what to put there

bronze yoke
#

it should just be the name of your mod

#

i recommend doing things with modules instead of globals

#

the syntax is very similar but you avoid polluting the global namespace and the performance is better

verbal yew
#

got damn i feel like dumb...
if i knocked zombie, how to be return here:

    return 
        not zombie:isKnockedDown()
        and zombie:getCrawlerType() == 0
        and not zombie:wasFakeDead()
end``` ?
bronze yoke
# bronze yoke i recommend doing things with modules instead of globals
-------------------------------------
-- lua/shared/MyMod/MyModule.lua
-------------------------------------
local myModule = {}
myModule.foo = "bar"

function myModule.myFunc() end

return myModule
-------------------------------------
-- lua/shared/MyMod/AnotherFile.lua
-------------------------------------
local myModule = require "MyMod/MyModule"

myModule.myFunc()
print(myModule.foo)
#

you keep everything in that local myModule table (or whatever you name your module) and return it at the end, then you can require it if you want to use it in another file

wet sandal
winter thunder
#

What is the code to pull the current sandbox choice for something, I want to pull zombie speed

#

SandboxVars.ZombieLore.Speed?

#

So, I think that this would accomplish what you were trying to do. @verbal yew

    ```lua

local defaultSpeed = SandboxVars.ZombieLore.Speed

function ZombiesOnFireBad(zombie)
if zombie:isOnFire() == true && zombie:isAlive() == true then
getSandboxOptions():set("ZombieLore.Speed", 1)
zombie:makeInactive(true)
zombie:makeInactive(false)
getSandboxOptions():set("ZombieLore.Speed", defaultSpeed)
end
end

Events.OnZombieUpdate.Add(ZombiesOnFireBad)

fast galleon
#

@tame mulch
There are quite a few changes for sandbox options in v42. Will there be support to make scheduled changes and push them to clients from server?

fast galleon
winter thunder
# winter thunder So, I think that this would accomplish what you were trying to do. <@28729641354...

I have no clue if it'll work, mind you. I borrowed the concept of how to make the zombies sprint from this mod https://steamcommunity.com/sharedfiles/filedetails/?id=2797104510&searchtext=sprinter.

It seemed to be the closest thing I could easily find to emulate what you are trying to do. Basically, you change the world setting, forcefully make the zombie braindead, un-lobotomize it. and that should force it to follow the newly updated world settings. Then you set it back to the original lore speed.

Allows you to not need to worry about the type of zombie, because it will just make any living zombie that is currently on fire into a sprinter. Meaning that even the crawlers should be fine to be updated

winter thunder
#

Or maybe 3

fast galleon
winter thunder
verbal yew
#

stuff like
zombie:getModData():SPEED_SPRINTER=1

winter thunder
#

@fast galleon You happen to know of any good way to purposefully knock a player on the ground for a set amount of time? πŸ₯Ί πŸ™

bronze yoke
#

idk how to time it but setBumpType, setBumped and stuff is used for knocking players over

fast galleon
#

no, I can show you "sleeping zombie" for 1 minute

winter thunder
#

The timer side is really easy, I just dont know anything about messing with animations / player states

fast galleon
#

for example the zombies use a reanimateTimer value, so they don't get up while the player is standing on them.

winter thunder
#

Yeah, I have been working on and off on a drug mod. So I am trying to set up a point where if the player OD's, they will fall to the ground, be unable to move or otherwise do anything, and then stand back up while undergoing some pretty big negatives.

I have all of it down EXCEPT how to get them on the ground for awhile... πŸ˜…

fast galleon
#

these are for zombies, maybe some will apply to players πŸ€”

            local zombie = zedList:get(i)

            --zombie:setKnockedDown(true)
            --zombie:setStaggerBack(true)
            zombie:setHitReaction("Floor") --string Floor, FenceWindow, HitReaction, EndDeath, ""
            --zombie:setPlayerAttackPosition("") --string BEHIND, ""
            --zombie:setHitForce(0.001)
            --zombie:reportEvent("wasHit")

            zombie:setFallOnFront(true)
            --zombie:setCanWalk(false)
            --zombie:setOnFloor(true)

bronze yoke
#

well my concern with the bump type stuff is that it already has a set time

#

i'm not sure you can cleanly stop it at the right time

verbal yew
#

hmm, how to possible set cooldown on function when they has KeyPressed Event?

bronze yoke
#

save timestamp of last successful attempt and compare the current timestamp

autumn temple
#

what weird ass math is causing this lol

#

I tell it to raise in only increments of 0.1 then it suddenly goes into 99999999999999999999

#

and it always only does it after 0.7. no matter how I try to edit it

bronze yoke
#

it's just a precision error

#

as long as you use floats you're going to see those, usually you can just ignore them

autumn temple
#

alright

#

ive been using if's to control how high it can build up to

#

idk if its optimal but it works

fast galleon
#

you could use integers for consistency, say 0 to 100

bronze yoke
#

you can use modData.TestStat = math.min(math.max(modData.TestStat, 0), 100)

autumn temple
bronze yoke
#

math.max returns the highest number out of its arguments, math.min returns the lowest, if you put them together it's a clamping function

fast galleon
#

as Vishnya says, it's more optimal to use if

bronze yoke
#

is that right?

fast galleon
#

seems to be

autumn temple
fast galleon
#
if modData.TestStat < 0 then modData.TestStat = 0 elseif modData.TestStat > 1 then modData.TestStat = 1 end
autumn temple
#

but i couldnt find the exact stuff anymore so I just went into if's

autumn temple
fast galleon
bronze yoke
#

oh my god that is way fucking faster what the hell

#

9-10x faster from my testing

autumn temple
#

pogslime pog knowledge

wicked plinth
#

gonna get around to making my big weapon pack

#

if it's gonna be attachment oriented, do i have all the attachments on the gun model itself or are they attached through other means

autumn temple
#

i need to eventually finish my weapon pack

wicked plinth
#

do i need to segment and separate every aspect of the attachments itself

void mortar
#

Could someone explain the exact chances of getting a thread to drop for a given Tailoring level? Roughly how much of a chance increase is it per level? I've gathered that the game pulls a random number of up to seven, and if your Tailoring+1 is high enough you can get a thread. I think the number of thread you get is based on how many body parts the given clothing covers, but I'm not sure.

#

I don't actually know the specifics of ZombRand. Does it go from 0-7, or 1-7?

#

Looking through some old messages, it seems ZombRand would actually output something like 0-6? Would this mean you're guaranteed to get a thread at Tailoring level 5?

#

I still don't get this part

local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i=1,10-max do
            thread:Use();
mild venture
fringe heart
#

hello everyone, I added a mod that makes random spawn items a little more items and it stopped working. What is the reason?

#

before

#

after

low crest
#

Hello there! Im looking for some help regarding Generators. Im making a mod which adds a modified version of a generator with extended range
Im willing to pay for help and or a lesson on how to do this

verbal yew
#

guys, your help :P

#
    local zReChance = 0
    local zReIsDoctor = self.character:getDescriptor():getProfession() == "profession_doctor2"
    if zReDoctor <= 8 then
        zReChance = 0
    elseif zReDoctor = 9 then 
        zReChance = 10
    else -- zReDoctor = 10
        zReChance = 15
    end
    local zReTotalChance = 25 + zReChance + (zReIsDoctor and 100 or 0)    -- 25% + chance from aid skill```
#

is the formula used correctly?

#

for zReIsDoctor stuff

pulsar rock
#

Is it for the vaccine mod?

#

Because you'd actually have to be a virologist (or at least have a foundation in biology/biochemistry/microbiology) to work on vaccines - rather than be a doctor.

It's generally a master degree after you get a bachelor degree in one of those 3 bio degrees.

#

You could add a new skill and professions for it?

#

My own question:

Do zombie stats apply per-zombie? So, would it be possible to randomly make some zombies smarter / stronger / faster?

mellow frigate
# sour island <@460779707797995521> πŸ˜„

I probably arive after the war, but there is code to handle scrolling inside scrolling in ISScrollingListBox:prerender() -- This is to handle this listbox being inside a scrolling parent. if self.parent and self.parent:getScrollChildren() then stencilX = self.javaObject:clampToParentX(self:getAbsoluteX() + stencilX) - self:getAbsoluteX() stencilX2 = self.javaObject:clampToParentX(self:getAbsoluteX() + stencilX2) - self:getAbsoluteX() stencilY = self.javaObject:clampToParentY(self:getAbsoluteY() + stencilY) - self:getAbsoluteY() stencilY2 = self.javaObject:clampToParentY(self:getAbsoluteY() + stencilY2) - self:getAbsoluteY() end self:setStencilRect(stencilX, stencilY, stencilX2 - stencilX, stencilY2 - stencilY)

#

--- other topic --

#

Is there a way to get modded item icon in the item list ? this has bothered me for too long.

#

The icon is missing next to the name for Metal Spear

neon bronze
#

Dont think so i think its a bug with the list in vanilla

#

So far i seen none of the modded items ever had an icon even if it was correctly implemented

mellow frigate
neon bronze
#

Maybe debug one is its own?

#

Unless you mean it then ive no idea

#

It does bother me aswell might check it out later aswell

wet sandal
#

The viewer is directly looking up the textures instead of reading from the item object.

mellow frigate
wet sandal
#

Would be a nice little thing to have fixed.

drifting ore
verbal yew
mellow frigate
#

@wet sandal @neon bronze So those icons must be in texture packs to work in vanilla. afaik there is not more Item_<Name>.png in PZ directories. I am tempted to fallback (except for moveable) to getTexture('media/textures/Item_'..item:getIcon()..'.png') but this is only because I used to put my items icons in that folder. It wil not work for other mods. Any preference for loose Item_ICON.png fodler ?

verbal yew
neon bronze
mellow frigate
verbal yew
neon bronze
#

I am stupid and misread it

wet sandal
#

I just replaced the code (Line 370 - 379) with this and it seems to work fine

#
 local texture = item.item:getNormalTexture()
    if texture then
        self:drawTextureScaledAspect2(texture, self.columns[2].size + iconX, y + (self.itemheight - iconSize) / 2, iconSize, iconSize,  1, 1, 1, 1);
    end
#

Forget the icon bit

red tiger
#

It's good to see modders with good knowledge on UI API.

wet sandal
#

Thats a lot better with mods like Brita's

#

I just directly editted the vanilla file, so I don't have anything proper to share

red tiger
#

I might swap active projects and work on the HTML render engine stuff I did back in Christmas time last year.

#

=D

#

UI is sounding more fun again.

neon bronze
#

It always sounds fun but when you start coding it it becomes a pain again

red tiger
#

Nah.. Not this one. If you want a demo of a cat pic on your main menu I can throw you a compiled mod zip file of the prototype.

#

Haha

#

Woops that was the compiled file

wet sandal
#

Caught one bit that said:
((((((

#

Thats a lot of brackets

red tiger
red tiger
wet sandal
#

Ah, that makes more sense.

red tiger
#

I'm a document goblin.

pulsar rock
red tiger
#

What started that project was me asking how to simplify implementing RadialMenus.

#
<radialmenu>
  <item>..</item>
</radialmenu>
``` (Or something similar)
#

Anyways, Still nice stuff @wet sandal

verbal yew
red tiger
#

@jaunty marten I bet you'd like to hear me resume that project. xP

#

I think it's about time I stop neglecting that.

fast galleon
#

@red tiger love it

mellow frigate
#

@neon bronze @wet sandal Feel free to use that snippet. I consider it is not worth a dedicated mod and put it in Tchernolib in next update. ```require "ISUI/AdminPanel/ISItemsListTable"

if ISItemsListTable.isModdedIconPatched then return end

local lcl = {}
lcl.item_base = __classmetatables[Item.class].__index
lcl.item_getIcon = lcl.item_base.getIcon
lcl.item_getIconsForTexture = lcl.item_base.getIconsForTexture
lcl.item_getNormalTexture = lcl.item_base.getNormalTexture
lcl.item_getCategory = lcl.item_base.getTypeString

lcl.iconSize = getTextManager():getFontHeight(UIFont.Small)

local vanilla_ISItemsListTable_drawDatas = ISItemsListTable.drawDatas
function ISItemsListTable:drawDatas(y, item, alt)
local returnValue = vanilla_ISItemsListTable_drawDatas(self,y,item,alt)

------- hidden
if y + self:getYScroll() + self.itemheight < 0 or y + self:getYScroll() >= self.height then
return returnValue
end
------- vanilla did the job ?
local icon = nil
local iconsForTestures = lcl.item_getIconsForTexture(item.item)
if iconsForTestures and not iconsForTestures:isEmpty() then
icon = iconsForTestures:get(0)
else
icon = lcl.item_getIcon(item.item)
end
local vanillaFoundTexture = false
if icon then
local texture = getTexture("Item_" .. icon)
if texture then
vanillaFoundTexture = true
end
end

if not vanillaFoundTexture and lcl.item_getCategory(item.item) ~= 'Moveable' then
    local texture = lcl.item_getNormalTexture(item.item)--thx to Notloc
    if texture then
        local iconX = 4
        local xoffset = 10;
        self:drawTextureScaledAspect2(texture, self.columns[2].size + iconX, y + (self.itemheight - lcl.iconSize) / 2, lcl.iconSize, lcl.iconSize,  1, 1, 1, 1);
    end
end
return returnValue

end
ISItemsListTable.isModdedIconPatched = true

dull moss
#

moodle framework 10/10

red tiger
#

Glad it's helping.

abstract raptor
#

ey anyone can help me figure out how to spawn something ON THE GROUND if there is no surface that works?

#
                    elseif tileToItemList[x_spr] then
                        sledgeDestroy(x_obj)
                        x_obj:getSquare():transmitRemoveItemFromSquare(x_obj)
                        local count = tileToItemList[x_spr].count
                        for j = 1, count do
                            local hasContainer = false
                            -- add item to a container if there is one
                            local objs = square:getObjects()
                            for k = 0, objs:size() - 1 do
                                local o = objs:get(k)
                                local c = o:getContainer()
                                if c and c:getType() ~= "counter" then
                                    hasContainer = true
                                    -- Add items to the container
                                    c:AddItem(tileToItemList[x_spr].item, 1)
                                end
                            end
                            if not hasContainer then
                                for l = 0, objs:size() - 1 do
                                    local surf_object = square:getObjects():get(l)
                                    if surf_object and surf_object:getProperties():getSurface() and surf_object:getProperties():getSurface() > 0 then
                                        local surfaceOffset = surf_object:getProperties():getSurface()
                                        local random_x = ZombRand(0, 5)
                                        local random_y = ZombRand(0, 5)
                                        square:AddWorldInventoryItem(tileToItemList[x_spr].item, random_x / 25, random_y / 25, (0 + (surfaceOffset / 192)), 1)
                                end
                            end
                        end```
silk hemlock
#

How do I get the player current square? player:getCurrentSquare() is always returning nil on a OnPlayerUpdate hook.

bronze yoke
#

player:getSquare()

silk hemlock
#

Tried that, also nil.

red tiger
#

Do you have the current player object?

silk hemlock
#

Don't you get that from the onplayerupdate hook?

red tiger
#

Does that send the player object or player integer ID?

bronze yoke
#

it sends the object

red tiger
#

Strange. No it should not return nil.

#

I wonder if you try to refetch the player through the ID stored in that object.

#

See what you get then.

#
local player = ...;
local player2 = getPlayerByOnlineID(player:getOnlineID());
bronze yoke
#

you should use getSpecificPlayer and getPlayerNum, onlineids aren't assigned in singleplayer

red tiger
#

nil for a square is saying something is very wrong. Either your object is in an illegal state or that you're not calling what you think.

red tiger
#

Thanks.

sharp minnow
#

Hey @bronze yoke - thanks for the code / time yesterday. I played around with it and managed to get it to work by doing this:

local conceptsquare = getSquare(155,70,0);
    conceptsquare:ClearTileObjectsExceptFloor();
    print("Object Clear");
    local object = ISSimpleFurniture:new("cardboardbox","furniture_storage_02_17","furniture_storage_02_18");
    object:create(conceptsquare:getX(), conceptsquare:getY(), conceptsquare:getZ(), false, "furniture_storage_02_17");
knotty saffron
#

what is the function to set/get sickness on a player?

#

found it with discord search, getPlayer():getStats():setSickness(#)

bronze yoke
#

you can't actually set sickness with that

#

the game recalculates your sickness every frame, so whatever you do will be overwritten

#

use foodsickness instead

sharp minnow
# sharp minnow Hey <@119473430289448961> - thanks for the code / time yesterday. I played arou...

I figured though if I wanted to actually do what I wanted, it was going to take me ages to work with ISSimpleFurniture as it didn't create a container. My thought was to redo ISSimpleFurniture and a few others to try to get what I needed, but it looks like i'm creating new objects from scratch. I was wondering if anyone knew how to just copy and paste an existing piece of furniture or an existing ISOObject. I can't quite work it out from the docs.

silk hemlock
red tiger
faint nexus
#

xP

deft plaza
#

yesterday I tried looking at what was the problem I couldnt see it not sure what to look for I may be missing a line or something

#

oh almost forgot item is not showing up in spawn menu so its not there

#

I tried looking at my first weapon mod I could not see it

bronze yoke
#

item base instead of module base

deft plaza
#

its supposed to be module base

#

right?

deft plaza
#

fixed it but no item still

void mortar
#

What's the actual range of ZombRand? Like, if I did ZombRand(7), would that be 0-7, 1-7, 0-6, or 1-6?

knotty saffron
bronze yoke
#

you might be sick from infection or fakeinfection

knotty saffron
#

even if super immune?

#

any way to get around that?

tacit plover
tawdry solar
#

Stun baton seems really cool mN

#

Man

bronze yoke
knotty saffron
#

what about corpses

bronze yoke
#

they add to food sickness

#

let me check that actually, i glanced over it yesterday

#

yes, that's correct

sharp minnow
#

Anyone got any tips on where to look for cloning an object and placing it elsewhere?

Would IsoObjectPicker be the right code, or is that more for selecting an object and adding items to it?

knotty saffron
bronze yoke
#

if the character is actually infected, setting their infection level to 0 doesn't work (the game also recalculates that every frame)

#

otherwise yeah could be a mod, every ingame minute shouldn't be long enough to see queasy pop up again

stark torrent
#

Would there be anyway to change the servers sandbox settings via a lua script? Sorry I'm a bit new to Kahlua and understanding how the imports or methods would work here.

knotty saffron
#

wacky stuff

#

but it was a good introduction to modding for me

earnest minnow
#

looking through media/scripts/vehicles/vehicle_suv.txt right now.
Where is the weight of the Franklin All-Terrain defined? I know it is 85 but I don't see this file defining a TruckBed which the other vehicles do

verbal yew
#

Guys, how to intergrate recipes, like this



function ISReadABook:perform(...)
    if self.item:getFullType() == "Base.NutritionistMagazine" then
        local characterMetaTable = getmetatable(self.character)
        local originalReadLiterature = characterMetaTable.__index.ReadLiterature
        characterMetaTable.__index.ReadLiterature = function(character, ...)
                local traits = character:getTraits()
                if not traits:contains("Nutritionist") then
                    traits:add("Nutritionist")
                end
            end
        local result = originalISReadABookPerform(self, ...)
        characterMetaTable.__index.ReadLiterature = originalReadLiterature
        return result
    end
    return originalISReadABookPerform(self, ...)
end``` but not for trait, need add recipes
novel barn
#

I'm hung up on an event if anyone has a moment. I'm using Events.OnCreatePlayer to do something to the player once they load in. However in my experience Events.OnCreatePlayer is only triggering when the player has already been created and is loading into the game a second time. When I create the character originally, nothing happens. When I exit and reload my action to the player happens 100% of the time. Does anyone know what's going on? Or does anyone know of an event that fires after the character is in, but before the player gains control? Thanks in advance!

Edit: in case it helps clarify what I'm doing. I'm attempting to remove the player's inventory which I can do with getPlayer():getInventory():removeAllItems(). This only works when the character has already loaded in. Perhaps because the clothes haven't been equipped yet?

bronze yoke
#

it should fire even on the first time

verbal yew
#

Events.OnGameStart.Add?

bronze yoke
#

don't use getPlayer(), OnCreatePlayer passes the player object

#

the object might not be added to the list getPlayer uses yet, and it'll cause your code to clear player 1's inventory every time a splitscreen character spawns

verbal yew
#

hmmm

#

try Events.OnCreateLivingCharacter.Add

deft plaza
#

this may be very off topic but it is about a mod

#

but wow its my first mod

bronze yoke
#

OnCreateLivingCharacter will fire during character creation

deft plaza
#

anyway thank you guys for all the modding help

bronze yoke
#

like on the main menu while customising them

verbal yew
#

Events.OnGameBoot.Add?

bronze yoke
#

no, that fires on the main menu

novel barn
#

OnGameBoot fires before OnCreatePlayer I was thinking of OnGameStart

verbal yew
#

OnPlayerUpdate ?! xD

bronze yoke
#
Events.OnCreatePlayer.Add(function(index, player)
    player:getInventory():removeAllItems()
end)
verbal yew
#

What is the difference between OnGameStart and OnGameBoot?

bronze yoke
#

ongameboot fires on the main menu when the game has finished loading it

novel barn
#

boot is what takes you to the main menu, start is when you gain control of a survivor

verbal yew
#

thanks

novel barn
bronze yoke
#

you're calling the function and passing the return value instead of passing the function reference

#

Events.OnCreatePlayer.Add(runTests)

novel barn
#

I still enter fully clothed when I first start a new game. Is there a chance the character is assigned a starting outfit AFTER OnCreatePlayer?

#

However that's a really good point about not using getPlayer()! Thank you!

bronze yoke
#

is the clothing actually in your inventory? maybe the wornitems hasn't updated

novel barn
#

My leading assumption is that it hasn't. It isn't terribly important for me to remove the clothes. I'm mostly just experimenting with equipping and removing things to better understand ItemContainer

#

While I wait for Notloc's testing UI I'm writing my own super hacky unit tests

#

Thank you so much for the help! I think I'm going to sleep on this.

bronze yoke
#

yeah, i had a quick look but i don't see any indication that clothing should be added after the event (the event turns out to not even be part of the player creation process stressed) so i think it's just wornitems, the object that stores the appearance, not being notified of the items being removed

novel barn
#

I'll double check the player inventory then. Maybe I've been just quitting out after seeing my character clothed.

bronze yoke
#

yeah, i haven't tested it myself so i could always be wrong

novel barn
#

I did notice last night that everything but the player's backpack and shoes had been removed even though the inventory was empty.

bronze yoke
#

i think burryaga actually had an issue to do with messing with clothing on creation too but i don't remember how that turned out

novel barn
#

the backpack is a whole different story. My character keeps getting one somehow...

#

I'll dig back through the history and see if I find anything revolutionary

#

You're right! Inventory is empty but the character is fully dressed. It's wornitems not getting updated. πŸ€”

bronze yoke
#

player:getWornItems():clear() might work

novel barn
#

testing now

#

I say it every time, but you're a dang magician. Thank you again! That worked perfectly!

bronze yoke
#

nice!

novel barn
#

I can hopefully sleep soundly now, not worrying about what I'm doing wrong. Good night @bronze yoke! @verbal yew thank you for helping as well! Good night to you both. πŸ™‚

bronze yoke
#

gn!

drifting ore
#

where's the docs on moodles?

#

or at least, where can i find their code

pine gulch
#

Is there a way to replace a weapon with an item upon breaking?

wet sandal
#

My test framework can now track function coverage

#

No ui yet

verbal yew
#

bruh

#

what's problem?

dark wedge
#

What's the error?

dark wedge
#

I've been staring at this for a minute and I don't see anything, it should work.Is that actually line 403 in your code? Sometimes the source viewer is a bit behind if you make changes and didn't restart

verbal yew
#

yep, it 403 line

#

i think it's because perform in craft

#

Those. I can't count the skill level while crafting

#
        CmpSyringeWithPlainVaccine=1,
        CmpTestTubeWithRareBlood/MatRareBlood=2,
        CmpTestTubeWithAntibodies=3,
        CmpFlaskWithSodiumHypochlorite=1,
        keep Paintbrush,
        destroy NotebookVaccineStart=1,
        Result:LabFlaskDirty=1,
        Sound:Mixing_B,
        Time:400.0,
        Category:Vaccine,
        CanBeDoneFromFloor:False,
        SkillRequired:Doctor=2,
        NeedToBeLearn:True,
        OnTest:LabRecipes_IsNearChemistrySet,
        OnCreate:LabRecipes_UpgradeVaccine2,
        OnGiveXP:LabRecipes_GiveXP_Doctor_5,
}``` OnCreate:LabRecipes_UpgradeVaccine2,
odd notch
#

probably replace your player reference with getPlayer()

#

just glancing here

verbal yew
odd notch
#

either getPlayer() or getSpecificPlayer(0) yes

#

one of the two will work

verbal yew
#

min

#

nope, not work

#

hmmm, I'll try work-arounded

#

pre function with global param for
Events.LevelPerk.Add(LevelPerk)

dark wedge
#

idk what to tell you, something else is wrong. It is absolutely giving you the player object that you should be able to pull from. I made this change in lua/server/recipecode.lua

    local jar = items:get(0);
    local aged = jar:getAge() / jar:getOffAgeMax();

    result:setAge(result:getOffAgeMax() * aged);

    player:getInventory():AddItem("Base.EmptyJar");
    print("TEST: " .. tostring(player:getPerkLevel(Perks.Doctor))) -- HERE

--    print("you're new food have age " .. result:getAge());
end```
Opened a Jar of Cabbage, and:
odd notch
#

He didn't add it to the Recipe object

#

that's his problem lol

#

function should be Recipe.OnCreate.LabRecipes_UpgradeVaccine2 not LabRecipes_UpgradeVaccine2

#

also jesus what are these comments

#

remove all of this

#

why is this here

verbal yew
verbal yew
#

xD

odd notch
#

is it in server lua?

#

upload the file here

verbal yew
# odd notch function should be Recipe.OnCreate.LabRecipes_UpgradeVaccine2 not LabRecipes_Upg...

what difference?

    local inv = player:getInventory();
    for i = 0, items:size()-1 do
        if string.find(items:get(i):getType(),"CmpTestTubeWith") then
            inv:AddItem("LabItems.LabTestTubeDirty");
        elseif string.find(items:get(i):getType(),"CmpSyringeReusable") then
            inv:AddItem("LabItems.LabSyringeReusableUsed");
        end--if
    end--for
    
    -- local zReDoctor = getSpecificPlayer(0):getPerkLevel(Perks.Doctor)    -- upgrade on 2 lvl
    local zReIsDoctor = player:getDescriptor():getProfession() == "profession_doctor2"
    local zReChance = 0
    --[[if zReDoctor <= 2 then
        zReChance = 0
    elseif zReDoctor == 3 then 
        zReChance = 5
    elseif zReDoctor == 4 then 
        zReChance = 15
    elseif zReDoctor == 5 then 
        zReChance = 25
    elseif zReDoctor == 6 then 
        zReChance = 30
    elseif zReDoctor == 7 then 
        zReChance = 35
    elseif zReDoctor == 8 then 
        zReChance = 35
    elseif zReDoctor == 9 then 
        zReChance = 35
    else -- zReDoctor == 10
        zReChance = 35
    end ]]--
    local zReTotalChance = 0 + zReChance + (zReIsDoctor and 100 or 0)    --
    
    if zReTotalChance >= ZombRand(1, 100) then
            inv:AddItem("LabBooks.NotebookVaccine2");
        else
            inv:AddItem("LabBooks.NotebookVaccineStart");
    end--if
end--function```
old method work fine, in new just can't check First Aid skill level
odd notch
#

good luck my friend that is some intense spaghetti

#

i'd rewrite the whole mod

verbal yew
#

I don’t know why, the whole staff works...

#

not considering my current attempt to add logic to item drop chance after craft

dark wedge
#

You might want to verify your game files or something. because your code works for me

verbal yew
#

function should be Recipe.OnCreate.LabRecipes_UpgradeVaccine2 not LabRecipes_UpgradeVaccine2

okey... trying it...

dark wedge
#

I copied the function LabRecipes_UpgradeVaccine2 into lua/server/recipecode.lua with:

    ...all the same....
    
     local zReDoctor = player:getPerkLevel(Perks.Doctor)    -- upgrade on 2 lvl
     print("HELLO: " .. tostring(zReDoctor))
...```
and set:
```    recipe Open Jar of Tomatoes
    {
        CannedTomato,

        Result:farming.Tomato=5,
        Time:30.0,
        OnCreate:LabRecipes_UpgradeVaccine2,
        Category:Cooking,
        OnGiveXP:Recipe.OnGiveXP.None,
    }```
And I got "HELLO: 2" as the output as expected.
verbal yew
dark wedge
#

it doesn't matter. as long as it exists. the devs just did that for organization

odd notch
#

making random new global funcs is bad practice imo, ...but taking a look at that file it's a gigantic dumpster fire.

#

i wont touch that with a 10ft pole sorry my love

verbal yew
#

lol)

verbal yew
#

i think i solved the problem

#

threw all the mathematical calculations before the add items in inv

sharp minnow
#

When I was trying to solve a problem the other night, cursing at the screen when I eventually realised I'd made a simple mistake. My partner asked if it was actually fun what I was doing. I said no and yes. This can be so painful, but the rewards are so sweet when you get to see what you've made, in the game and working.

sacred socket
#

Best way i'd describe this feeling is like having indigestion to then finally being able to pass it. Or waking up in good health after having a major hedache the night prior.

steel locust
#

Is it possible to change the display name of a skill/perk without changing all references to it? Like, is the name that shows up in the UI changeable separately from the name used in references to it in code?

#

I want to change "Electricity" to show up as something like "Tinkering", but without going through all references to the Electricity skill in vanilla/modded code.

tardy wren
#

IGUI_perks_Electricity = "Electrical", in /media/lua/shared/Translate/EN/IG_UI_EN.txt

steel locust
tardy wren
#

Not a problem

autumn temple
#

I really wish I can see what code isnt working

red tiger
#

This is highly discouraged because it can produce results like this.

#

Run the game using a batch file provided to show the console so you can read the error regardless of the state of the game loading.

drifting ore
#

Hey, how can i inflict some of the effects of fever and sickness onto the player? i don't want them to die. i haven't found the documentation on moodles anywhere

bronze yoke
#

set their foodsickness

drifting ore
#

No let me rephrase, i want to get some of the effects of foodsickness, but not all of them, especially not the chance of death part at high foodsickness.

bronze yoke
#

the strength of the player's sickness moodle is taken from whichever is highest of food sickness, infection, and fake infection

#

there's no other way to make the player sick

drifting ore
#

is there no way to change healing speed, and carry capacity?

bronze yoke
#

i've heard carry capacity is annoying but it's not something i've looked into myself

#

everyone i've seen wanting to change the healing rate ends up just adding/subtracting health every tick

drifting ore
#

i see, thank you for your help

#

how about fatigue drain?

bronze yoke
#

probably the same method

autumn temple
dark wedge
#

All I wanted to do was change some colors for how the radial renders. Long story short, I ended up just making a new one in Lua so I could. tired

grizzled lintel
#

does anyone know if it's possible to enter a town and it turn on pvp? just think pvp zones/cities would be cool

pulsar rock
scarlet cosmos
#

https://youtu.be/7gwZRL9rNmI

Is it possible to make the character (when entering their inventory) do what Joel does in TLOU?

This is a guide for crafting and upgrading in The Last of Us on PS3. This guide will also get you the ' Let's Gear Up ' Trophy.

Links:

01:51 Crafting:

To craft an item you need resources including, rags, alcohol, explosives, sugar and binding you also need a recipe to craft for example to be able to craft a bomb you are given the recipe by Bi...

β–Ά Play video
red tiger
#

Letting you guys know that I have a currently unreleased vscode extension called PZ-Wallet that I will release soon.

The extension allows people to build templates & snippets to use when modding Project Zomboid.

pulsar rock
#

I'd love to test and provide feedback if that could be possible.

red tiger
pulsar rock
#

Especially since I've got some larger scope mods planned. Some on-the-fly examples / templates would come in handy when figuring out certain aspects of it.

dark wedge
red tiger
pulsar rock
dark wedge
#

Plus, I will make a small API for it so that radials work like context menus (i.e. easy reordering, adding/removal, built-in pagination, easy radial submenus, etc). You'll be able to set your own color on a slice, and more and whatnot

mild venture
#

Does anyone know how to stop the zoom changes while scrolling inside my panel? upd: solved

tardy basin
#

complete novice here, does anyone know where I should start on making a weapon rebalance mod?

#

just editing stats

deft plaza
#

Hey @red tiger is it possible for you to make zedscript correct a wrong script or scan if something is wrong I don't know how that stuff works so I'm asking you?

red tiger
deft plaza
deft plaza
#

alright.

lament sphinx
#

hey folks, I've recently started fiddling around with modding and for the life of me... I can't figure out how to edit item tool tips when you hover over them on the inventory pane
I think I found the place where the tooltip is rendered in lua (ISToolTipInv:render()), but I don't exactly know how to add stuff to the object tooltip.
E.g. I want to add a new progress bar to weapons and possibly some custom text.
Does anyone have any knowledge around this bit? It seems like I'm missing something obvious πŸ˜…

abstract raptor
hidden jungle
#

how do you detect when the context menu is opened?
more specifically opened on an inventory item?

#

found what i was looking for, someone posted here about it a while ago

#

Inventory Context Menu

function(player, context, items)
Events.OnFillInventoryObjectContextMenu.Add(function);```
robust briar
#

OKay, another instance of losing my mind.

I am setting up a special case of loot on zombies, and in the OnZombieDead event I am trying to add an item to the zombie to be dropped. Currently, I am doing:

local realItem = InventoryItemFactory.CreateItem("Base.AssaultRifle") -- just for example
zombie:addItemToSpawnAtDeath(realItem)

And that isn't working. So I tried to use zombie:getInventory():AddItem("...") and that didn't work. I looked at the java, and..

if (this.shouldDoInventory()) {
    this.DoZombieInventory();
 }

 LuaEventManager.triggerEvent("OnZombieDead", this);

It appears Inventory is done before the OnZombieDead event, so I tried to call DoZombieInventory as well, but that doesn't seem to make a difference. Does anyone know how to add an item to be dropped on the corpse from lua?

hidden jungle
#

you can do it the way MoreTraits does it.
that mod checks what containers are near the player and uses the container type to determine what it should do.

#

@robust briar

robust briar
#

Hmmm

#

Seems a bit hacky

hidden jungle
#
function ContainerEvents(_iSInventoryPage, _state)
    local page = _iSInventoryPage;
    local state = _state;
    if state == "end" then
        local player = getPlayer();
        DoStuffWithInventory(page, state, player);
    end
end
function DoStuffWithInventory(page, state, player)
      for i,v in ipairs(Page.backpacks) do
          if v.inventory:getParent() then
              if instanceof(v.inventory:getParent(), "IsoDeadBody") and v.inventory:getParent():getContainer() then
                  --we have a body
              end
          end
      end
end
Events.OnRefreshInventoryWindowContainers.Add(ContainerEvents);
#

that might work, i just quickly copied the important stuff from More Traits' file by hand

robust briar
#

Yeah, I mean that would work, but then it going to put the special drop on any random zombie corpse

hidden jungle
#

then make it more specific

robust briar
#

So, need to log the XY of the death, then send that to client, then have client find the corpse in the tile, and plop the weapon in it..

#

or something like that

bronze yoke
#

calling additem after death should work

#

i've done this before

#

the zombie's inventory object is passed to the corpse when it gets created so anything you put in there should carry over

red tiger
robust briar
verbal yew
bronze yoke
robust briar
#

Server is fireing the event alright lol. I am doing it on server, and it is running.

#

I see my debug prints

bronze yoke
#

in multiplayer?

robust briar
#

yup

bronze yoke
#

in the server log and not in the in-game console?

robust briar
#

I have at the top of the file

#

if isClient() then return end

#

correct, in the debug-server log

bronze yoke
#

hmm i'd better correct that then

robust briar
#

but I think

#

its not synced

bronze yoke
#

the client might still be authoritative of the inventory yeah

robust briar
#

like zombie dies on client, does all its loot there, and just

#

tells the server about it

#

this makes things... not great for me

bronze yoke
#

the shouldDoInventory check indicates that only one client from many that could call that method should actually fill the inventory

robust briar
#

cause I need to track the last time globally a zombie got the special loot, so I was using ModData.. and I HATE the client side global moddata sync

#

its sooo.. terrible

#

sucks it up, and starts typing all the boilerplate for global moddata hell

bronze yoke
#

you can tell the server to update it with a client command instead

#

no need to sync stuff only one side needs

robust briar
#

well, every client needs to know last time as well

#

so they know if they are allowed to spawn the special loot

#

could also run into a situation where it doesn't sync in time 😒

#

if two people kill a zombie at the exact same moment

verbal yew
#

    if not zombie:getOutfitName() then return false end
    local inv = zombie:getInventory();
        if 10 >= ZombRand (1, 100) then
          inv:AddItems("Base.Spoon", 1);
    end
end

Events.OnZombieDead.Add(CheckDrops);
#

on server

bronze yoke
#

you can send a server command when it flips

#

generally not a fan of syncing moddata so i tend to think in commands

robust briar
#

on server

#

in MP

robust briar
bronze yoke
#

i use moddata exclusively for information that should be persistent, and it rarely makes sense for both the server and the client to need to save the same information

robust briar
#

this is that unfortunate case

#

cause I need globally, all clients to agree

#

on when the last time special loot was dropped

#

and it needs to persist

#

for like

#

DAYS

#

across reboots

bronze yoke
#

well only the server needs to save it

robust briar
#

Yeah, but every client needs that data, and needs to know when it changes

#

OHH I SEE

bronze yoke
#

the general idea to me is that clients keep a bool that they request the state of when joining and the server sends a command to update it when it changes

robust briar
#

don't sync it

#

with moddata

#

yeah I do that for another mod

#

meh, probably about the same amount of work

#

ty for the info

bronze yoke
#

ty for the info that onzombiedead is not client specific

verbal yew
#

how to put a counter in a function?
like u do same stuff two times, second step should be one param + 5 for example

bronze yoke
#

for loop?

verbal yew
#

for each player separately

verbal yew
# bronze yoke for loop?

Well, like I want to do a thing.
I have a vaccine that has a 30% chance to give trit.

If it didn’t prok, for example, and you use it again, then the chance is already higher, by 5% for example.

drifting ore
#

Hi, is there a way to save a variable after exiting the game? i.e not have it reset to its default value after relogging/re-launching the game

bronze yoke
#

if the variable is supposed to be relevant to a specific object you can get that object's moddata table with object:getModData()

#

if it's not really attached to a specific object then you can get a global moddata table with ModData.getOrCreate("MyUniqueKey")

drifting ore
#

its tied to a player's modded moodle

bronze yoke
#

in both cases moddata is just a lua table that saves

#

either along with the object or along with the world

#

in this case i'd recommend player moddata

drifting ore
#

lua makes this so much harder πŸ˜…

verbal yew
#
            local SayVARIANT = ""
            local SayTOTAL = ""
            SayVARIANT = ZombRand(1, 4)
            SayTOTAL = tostring(SayNOTRESULT.."_"..SayVARIANT)
            self.character:Say(getText("SayTOTAL"));```
#

IGUI_EN= {
IGUI_zReVaccineNotResult_1 = "Nah",
IGUI_zReVaccineNotResult_2 = "Nope",
IGUI_zReVaccineNotResult_3 = "No",
IGUI_zReVaccineNotResult_4 = "Empty",
}

#

should work?

bronze yoke
#

ZombRand(1, 5) because the second value is not inclusive

verbal yew
#

not understood...

#

ou

bronze yoke
#

if you do ZombRand(1, 4) the possible values are 1, 2, 3

verbal yew
#

it's mean 1 2 3 4

#

yeh

#

understood

#

thanks

verbal yew
bronze yoke
#

it's only 1 thing after the concatenation anyway, but i think the tostring is not needed anyway

verbal yew
#

it's for future plan.
For sound shout mod.

i need 3 stuff:
gender, shout or whisper, variant

#

tostring(gender.."_"..shout.."_"..variant)

#

it's be work?

bronze yoke
#

yes, by the time the tostring is called it's already concatenated it into one object

#

but the concatenation will ensure it's a string anyway so tostring isn't needed

bronze yoke
#

e.g. in your code, SayNOTRESULT.."_"..SayVARIANT will become IGUI_zReVaccineNotResult_3 , that can't be represented as anything but a string anyway

verbal yew
#

okey, i think i get it

#

thanks ^^'

drifting ore
bronze yoke
#

the second value is exclusive

drifting ore
#

but the first isnt

bronze yoke
#

the first is inclusive

drifting ore
#

thats cursed

bronze yoke
#

this is pretty much the standard syntax for rng functions

drifting ore
#

idk its cursed

#

i hate it

bronze yoke
#

i've always assumed the reasoning is because ZombRand(4) can return 4 different values

drifting ore
#

why did they do it like that

bronze yoke
#

it has a lot of convenient implications

drifting ore
#

it has a lot of weird vibes unhappy

mild venture
distant crow
#

I have not even played this game yet I already have a mod idea 🫑

#

You use Lua to mod this, right? So my ComputerCraft skills should carry over

fast galleon