#mod_development

1 messages ยท Page 130 of 1

frank lintel
#

stares...

sour island
#

You can technically

#

You can parse scripts in Lua as a string if you really hate scripts

frank lintel
#

sorry I was just watching a video on YT and seen that face when the ? was asked and I just lost it

sour island
#

you can also define items specifically I believe

glass basalt
#

i just need to define an InventoryItem to replace one that is in a vehicle

#

for example: there is a "metal" trunk barrier that separates the interior of a Humvee from the trunk. I want to replace it with a "net" trunk barrier that can used instead

#

i could just give the player the item but i need this to work server-side

#

nvm, i don't want to do it anymore

sour island
#

the mod?

glass basalt
#

the removing and adding of the item i was referring to

#

misunderstood what it was

humble oriole
#

So, I'm removing items from an inventory, and they get removed from the container, but after a few server ticks if any players that didn't start the timed action that removes the items opens the inventory, the items come back, then they come back for all players. So they're not actually getting removed. Has anyone seen that before?

sour island
#

You have to use removeFromServer

#

Just dealt with it

#

There's a whole slew of shit you have to do to properly remove an item

humble oriole
sour island
#

If you check around the transferTimedActions you'll see them

#

You may need to check it's not in the player first

humble oriole
#
biowastecontainer:removeItemOnServer(item)
biowastecontainer:requestSync()

ISInventoryPage.renderDirty = true```
#

and on the server side I'm running isohbg:sendObjectChange("containers")

sour island
#

Haven't used that one before

humble oriole
#

it may not be necessary

sour island
#

My issue was with removing items from containers and players returning to the chunk later and the item would be there

#

So it sounds similiar

humble oriole
#

yea, it's probably the same

sour island
#

I also made it so the item has to be within the player to do the function too

#

Atleast for some behaviors

humble oriole
#

oof, I didn't even think of that, I'm having the player put the item(s) in a container and they're doing a timed action

sour island
#

Could be done from the floor?

humble oriole
#

you're saying to transfer the items to the floor and remove them there?

winter coral
#

Can anyone help me with some hair modding ?

sour island
open drum
#

Hello fellows I am trying to learn more about ModData

sour island
#

You can also force a transfer if one of these is the case

humble oriole
#

it happens when from player inventory

sour island
#

That's good then

open drum
#

could anyone help me where I can learn more about ModData???

#

I tried to find it on Forum but no info comes about it

#

I want to see how datas are stored in it

#

and whether the data is stored infinitely

#

Since I now many mods store their data such as "player money, level, etc" in it

#

I want to open it up to see what is being stored and how data is being processed

#

does opening ModData . class show all the mod datas that is being stored currently in dedicated server?

humble oriole
open drum
#

i would just use onclientcommand event

#

to remove items from players inventory

#

if that's what you are trying to do

humble oriole
#

nope, that's easy, trying to remove items from a world container

rancid panther
#

back. time to continue trying to get the immunity chance to work

open drum
#

sounds difficult

rancid panther
#

i got a lot of help from ppl here. now i am just applying their advice and also seeing what works

open drum
#

Do you use ModData as well in ur mod?

rancid panther
#

yes that is what im trying to do

#

trying to use ModData to make sure players only get tested once for immunity

open drum
#

Can you explain how ModData work?

#

like how do people you it? or how can I edit what's in ModData? since i can just open the file

#

and edit it

rancid panther
#

i have no idea. i am a novice modder

bronze yoke
#

moddata is a table that saves - it has no other special properties

rancid panther
#

i use function(playerIndex, player) and then do the thing

bronze yoke
#

the two types of moddata are object moddata and global moddata:
object moddata exists on most IsoObjects and you can get it using object:getModData()
global moddata is sorted by key instead of object, you can get it using ModData.getOrCreate("key")

rancid panther
#

do i need to put my events in a certain order? when i added new events im trying to work with it makes bitten trait not appear in the traits list

#

should i put them in order by when they should happen in the actual game?

open drum
rancid panther
#

or does it just mean i made a mistake in the rest of the code

open drum
#

how would I retreave their datas?

#

just use loop and getModData()?

bronze yoke
#

yeah, you'd have to check the mod for what the table structure is exactly, but something like local money = player:getModData().money

open drum
#

i see...

#

and the data that are stored in the list is infinit till altered ?

bronze yoke
#

yes, it never expires or anything

open drum
#

and does it have any .txt file or .class where i can open it externally?

bronze yoke
#

global moddata is stored in a separate file but it's not human readable afaik

open drum
#

i see

bronze yoke
#

i'm not sure where object moddata is stored but probably with the objects themselves, however that is done - so very unlikely to be human readable

#

i think there's a debug tool for examining global moddata though

open drum
#

ugh.. how much i wish i could just open its file and see all the data stored in it...

#

a mod called "online trade" saves players trading items and money in a mod data

#

but ther's no simple way to remove the items from the player uploaded items

#

so i was trying to understand how mod data work to see if I can just wipe out the player uploaded item data

#

from the moddata

#

thanks Albion, ill try to Loop and see if I can start something from there

rancid panther
#

can i start an if statement with if not?

bronze yoke
#

yes

ancient grail
#

@humble oriole ```lua
item:getContainer():removeItemOnServer(item);

or 
```lua
item:getContainer():DoRemoveItem(item);
#

i think

bronze yoke
#

they're already using that

ancient grail
#

ow ok

rancid panther
#

oh wow i was using else if but changing it to elseif made the trait visible again

humble oriole
#
                        if isClient() then
                            biowastecontainer:removeItemOnServer(item)
                        end

                        biowastecontainer:DoRemoveItem(item)

                        if item:getWorldItem() ~= nil then
                            item:getWorldItem():getSquare():transmitRemoveItemFromSquare(item:getWorldItem());
                            item:getWorldItem():removeFromWorld()
                            item:getWorldItem():removeFromSquare()
                            item:getWorldItem():setSquare(nil)
                            return
                        end```
#

found the last half of that in a debug script

rancid panther
#

i should just test from here before doing anything else then

bronze yoke
#

if it's spaced, you need two ends

#

if it's spaced you're essentially writing```lua
if condition then
--code
else
if condition then
-- code
end
end

rancid panther
#

ah

#

so with elseif, it is like an "otherwise" statement

humble oriole
rancid panther
#

oh wait

#

or i actually just needed the second end

#

i see

#

but elseif can be used without it

bronze yoke
#

using elseif is usually better

humble oriole
#

it's more common as well

bronze yoke
#

when you use else if you're creating two new scopes, which usually isn't what you want

rancid panther
#

i see

#

does this work? also is this the right way to do local player support?

bronze yoke
#

if you're passing playerIndex and player into that function then it probably isn't needed

rancid panther
#

oh

#

so only local functions?

bronze yoke
#

i'm guessing this on OnCreatePlayer

rancid panther
#

yea

bronze yoke
#

for that OnCreatePlayer tells us which player is being created, so we don't need to grab all four players for it

rancid panther
#

okay

bronze yoke
#

if it was EveryTenMinutes or something, that doesn't pass a player so we'd loop through all four players

rancid panther
#

so i can remove that for my bitten trait as well

humble oriole
#

After further testing, it's this guy that's making the sync happen correctly biowastecontainer:setDrawDirty(true)

bronze yoke
#

really?? i thought that was just a ui thing

humble oriole
#

to be clear, this didn't work ISInventoryPage.renderDirty = true

open drum
#

do .modData store boolean as well?

#

or only string and numbers?

bronze yoke
#

yes, any lua type except functions and objects

open drum
#

gotcha thanks

open drum
#

How do i get server time using getSeverTime()??? What is the proper way to call its function?

#

I know the function is in GameTime . class

#

So i thlught just typing getServerTime() would return long number but debug shows i tried to call a nil

open drum
#

I tried a= getGameTime()
Print(a)
And this produced nil error

#

Would just doing directly in print make diff?

#

I guess trying wouldnt hurt haha

bronze yoke
#

GameTime.getInstance():getServerTime()

open drum
#

Wow... why is gametine.getintance()? While spawnzombienow is using .instance??

bronze yoke
#

i don't really get why, but GameTime.instance gives you a buggy instance

#

even though GameTime.getInstance() should do exactly the same thing

wooden lodge
#

Sup my brothers, how does one make the "unboxing" spawn more than one of the dollar bills randomly?

local WalletL={"Base.5DollarBill", "Base.5DollarBill", "Base.5DollarBill", "Base.5DollarBill", "Base.5DollarBill", "Base.10DollarBill", "Base.10DollarBill", "Base.10DollarBill", "Base.20DollarBill", "Base.50DollarBill", "Base.100DollarBill",}

Wallet = function(items, result, player)
    player:getInventory():AddItem(WalletL[ZombRand(0, #WalletL)+1])
end
#

(And yes, there's multiple entries of the same note to make them more common)

open drum
rancid panther
#
TomaroTrait.newSubject = function(playerIndex, player)
    if not player:getModData().tested then
        if player:HasTrait("Immune") then
            player:getModData().tested = true
        elseif player:HasTrait("Bitten") then
            player:getModData().tested = true
        else
            player:getModData().tested = false
        end
    end
end

using this information, can i use if player:getModData().tested = false to do something to the player and then set it to true?

#

i'll try coming back to it later with a new angle

ancient grail
bronze yoke
#

wdym

ancient grail
#

Clock

#

Sorry typo

rancid panther
#

at least i was able to make the bandage spawn on the player for my other trait

ancient grail
#

Like time zone

#

Of the client

bronze yoke
#

os.date if it is available in pz

#

a lot of the os lib isn't but os.time is

ancient grail
#

Cool hope he sees this

worthy pendant
#

Hi there! Very new to modding in that I've downloaded them and used them in game, but never made my own. I would like to change that ๐Ÿ˜› So where do i start? I have my idea for my first simple mod I want to make, but where would be best to go and learn? Any and all help is appreciated and cheers in advanced โค๏ธ

rancid panther
#

read pins in this channel
also in User/Zomboid/mods there is an examplemod folder that you can use to help set up your mod folder

#

also look at other mods and have an idea of what you want to do

worthy pendant
#

look at other mods, like just in general?

rancid panther
#

look at a mod similar to what you want to do

#

i wanted to make a mod that added traits with items, so i looked at banjo's item kit traits

#

for example

worthy pendant
#

so if i wanted to do something that added a small inventory, i'd look at backpacks for example?

rancid panther
#

if it is for a bag, yea

#

a small inventory within your player inventory?

worthy pendant
#

ye, kinda ๐Ÿ˜›

#

I want to add pockets to pants ๐Ÿ™‚ its a nothing burger of a first mod, but I wanted to try something i thought would be simple.

rancid panther
#

try looking at mods that add pockets to things too

#

there are also some mods that add a bag within a bag such as smokin joe's rucksacks

worthy pendant
#

I'll look into that! Cheers ๐Ÿ˜„

fast galleon
#

vests with pockets by PA

worthy pendant
#

thank you! ๐Ÿ˜„

ancient grail
#

is there a way to check if an event is running

rancid panther
#

omg i think i figured it out

#

inb4 i hit another wall

glass basalt
rancid panther
#

true

#

that's how i've been figuring out if my shit works

#

(as of today)

#

is there a way to change the status of ModData back to a certain state?

#

for example, my thing when it tests if ur immune, it does player:getModData().tested = true

#

i wanna test it multiple times in a row but it only works when player:getModData().tested = false

#

oh okay i got it

#

IT WORKS!!!!

#

AHAHAHAHAHA

#

now to make it take time to find out if you are immune

open drum
#

by the way GameTime.getInstance():getServerTime() also shows nil error

open drum
rancid panther
open drum
#

GameTime.Instance:getDay()

rancid panther
#

now im gonna do some work to separate them so i can have the test happen at every hour while still letting immunity work instantly

open drum
#

interesting

rancid panther
#

i'll try to understand making it skip hours later

#

so i could make it a 5 hour wait after being bitten for example

open drum
#

GameTime():getIntance():getDay() no good either

#

GameTime.getIntance():getDay()

#

is this tsarzones mod conflict?

fast galleon
#

@humble oriole
have you tried the global command before, to send the server items to clients?
sendItemsInContainer(IsoObject,ItemContainer)?

*doesn't look good for syncing

humble oriole
#

I haven't, I saw it, but I didn't know what it did. I restructured my code doing most of the work on the client side and setting the container to dirty which seems to have fixed it

fast galleon
#

if it works, don't mess with it

humble oriole
#

It worked in testing, we'll see what it does on the live server, 4am on the east coast so most people have logged for the night

rancid panther
#

ok it wasnt working so i reverted to something that works for now

#

how can i make two of my own trait mods compatible with each other without requiring the other?

#

can i do this?
since i already have it contained within the bitten trait? or would it cause an error if a player isnt using a mod with that data?

#

or would it just return a nil and then ignore it

#

okay well it at least works while in the same file

fast galleon
#

player:getModData().tested is compatible with all mods, but also not compatible in the sense that tested could be anything that a mod considers to be a valid tested value

#

it's too generic

rancid panther
#

okay i will change it to something less generic

#

but thanks for also verifying that it would be compatible

rancid panther
#

okay now i added something so it will give you the immunity trait if you are already bitten and not infected, but you havent been tested for immunity yet

#

and at first it was causing 6-12 errors every time i tried to reset the test data to false and remove the trait, but now i can reset the status of a player without causing any errors at all

open drum
#
function ISZoneDisplay:updateData()
    local gameTime = self.gameTime;
    local climateManager = self.climateManager;
    local season = climateManager:getSeason();
    
    
    self.timeOfDay = gameTime:getTimeOfDay();
    print(self.timeOfDay)
#

i found this in vanilla

rancid panther
#

nice work

open drum
#

they use gameTime

#

but still

#

gameTime:getTimeOfDay()

#

is bringing me nil

#

Well...

#

GameTime:getInstance():getNightsSurvived()

#

This worked

#

GameTime:getInstance():getServerTime() but this doesnt

#

so.. i guess the return value of getServerTime() is diff.

fast galleon
open drum
#

maybe i need to study more about static..

rancid panther
#

can i make it so a function takes time before it continues?

#

like a wait 1 second or 1 hour

open drum
#

i think so

#

it returns server time in long numbers

#

like that number after Server

#

so i guess one can record its number and use it to one's taste

rancid panther
#

got an issue now

#

the player body is not infected at the exact time they are bitten, so it makes them immune if i try to give them immunity if they have an uninfected bite

#

could be solved by adding time between the check, but idk how to do that

#

i want to keep this, but the player is considered not infected since it happens so quickly

#

i also tried with just checking if any body parts are infected

wheat kraken
rancid panther
#

i tried those events but it makes the function not work at all

#

so i cant do that until i learn how to separate the immunity check from removeinfection

#

i guess i can put a pin on it and just not have existing immunity compatibility for now

wheat kraken
#

to be able to work in different moment, continues from where i stopped, i used an instance approach

#

check the firetrail.lua, maybe can help you to call and keep state

#

to the nexts ticks

rancid panther
#

kk thanks

#

it is kinda late and my neck hurts so i should take a break

wheat kraken
#

i suppose that the function didnt works, because was not saving the previous state, that was not trivial when i was trying to do this

rancid panther
#

my code is probably full of flaws so it is understandable if u dont have the same issues as i

wheat kraken
#

to me happens easily to be a new state (empty) when triggering the mod code later

rancid panther
#

i might add some separate mod data that is able to operate on timed intervals instead

wheat kraken
#

true

#

that can be done too

rancid panther
#

and then plug those into the immunity test instead

wheat kraken
#

but, moddata dont work with objects

#

i read some of this

rancid panther
#

like the player?

wheat kraken
#

only primitive values

rancid panther
#

mine is related to the player

#

if they are bitten and they are not infected, then can't i add mod data to create an override the same way i have a bitten trait add player data that says they are bitten?

wheat kraken
rancid panther
#

ah

#

but i was able to store bitten information under the function for the bitten trait

#

or is it because it was done OnCreatePlayer?

#

would not be able to do the same if i wanted something similar for EveryHours?

#

well anyway, i will try tomorrow or something. thanks!

wheat kraken
rancid panther
#

i'll probably end up trying it anyways

#

i've attempted much more sacreligious things with my code

chrome egret
#

Muchas gracias

viral notch
rancid panther
#

updated to have 2 versions! spiffo

chrome egret
#

With valueTranslation being used in that way, does it make sense that the "translation" field could be omitted?

chrome egret
#

As well as

public String getTranslatedName() {
            String var10000 = this.translation == null ? this.getShortName() : this.translation;
            return Translator.getText("Sandbox_" + var10000);
        }
frank elbow
#

Yeah, the translation field is used for the sandbox option name on the sandbox options screen

ancient grail
#

I love how you drop it with spoiler and shiz

ancient grail
rancid panther
#

thank you!

fast galleon
#

Did you figure out the ItemPicker reset? @ancient grail

ancient grail
#

Havent started with that.. we still have bunch of queue

wheat kraken
#

there is an easy way to show text on screen? like display fps does?

ancient grail
#

OnPostDraw i belive ? I forgot wait let me check

#

On post ui draw

#

@wheat kraken

ancient grail
rancid panther
#

they way i have my trait now, it does all the checking within the immunity trait function

i could probably make an event for all of it to happen outside of the trait function, add a wait period, then create mod data for true or false immunity. and then use only the mod data to deliver the message

ancient grail
rancid panther
#

that sounds like a p sick idea actually, but i'll have to put a raincheck on that for now

ancient grail
#

Will increase the likeliness of players wanting to use that proffession

#

Sure

rancid panther
#

then it would only require something like if player:getModData().immunityConfirmation == true then
or if false

ancient grail
#

Its hard to do i bet

rancid panther
#

i dont know anything about modding with skills, so im focusing on what i can do atm

#

still havent even bothered with my own sandbox options

#

but honestly, checking if another player is immune sounds like the highest incentive for first aid i've heard.

worldly olive
#

That would require something like:
Click on other player
Click on context menu for check
Walk to other player
Face the other player
Do a TimedAction to make it beautiful
After TimedAction is finished you can display a message of infected or not infected

rancid panther
#

yea and all while operating within my own immunity trait's parameters

worldly olive
#

But you wouldn't just need to check what you mentioned above?
if player:getModData().immunityConfirmation == true then
or if false

#

That can be done in the perform of the timedaction

rancid panther
#

but that might be another reason why i should try using ModData instead of putting all my if-then conditions together

#

yea

#

if i do it that way, i think it would actually be great for many reasons

inland trellis
#

I'm working on custom animations, they are working but the movement speed of the player seems timed to the animation in some way. Some of the animations are incredible slow and the walk animation freezes the player in place.

Anyone have any ideas? I've been stuck on this for days and can't proceed.

cryCat

rancid panther
#

could be easier to implement new features as well as for other ppl to add their own mod compatibility

#

thanks for the brilliant ideas!

#

i havent tried anything outside of traits and occupations yet but it sounds like a great venture

worldly olive
#

A while ago I was doing a code to interact with trees and be able to get branches from them. The code sequence seems pretty similar, instead of checking if it is an IsoTree what you're clicking it should check for an IsoGameCharacter I think.

rancid panther
#

i see

worldly olive
#

I'm in my working PC so I don't have the code here but later if you ping me I can give it to you and you see if it works for you

rancid panther
#

i was actually thinking of doing things with the health panel anyways

#

that could be on the list of things i can do

#

ok thanks! i am actually going to bed but i like brainstorming

#

i'll take your recommendations to heart tho!

#

going from the most basic immunity trait mod with no extra features to a fully fleshed out mod with all kinds of complex features

rustic garnet
chrome egret
#

The script parser seems a little clunky since it apparently requires a trailing comma on the end of a property definition (at least for options)

#

i.e.

option ItemSearcher.SearchMode
{
    type = enum,
    default = 1,
    numValues = 3,
    page = PZISTitle,
    valueTranslation = PZISSearchModeOptionValues,
    translation = PZISSearchMode, -- trailing comma required!
}
wheat kraken
#

there is a way to know if user click the pause button? there is SpeedControlsHandler.lua for key inputs only

where is the onclick lua for it? and for joypad too

solved:

local spcontrol = UIManager.getSpeedControls()
local isPaused = spcontrol and spcontrol:getCurrentGameSpeed() == 0
meager dawn
#

Hey !
I'm looking for a way to bind "/say" command and i wonder if i need to tweak my game's folder to do so?

#

Like... When i press "L" key, my char say "Hello !" Without opening the tchat, do you have any info about that?

#

Ping me for answers, i don't have notification on

frank lintel
#

Okay serious question, if there something in any of the java code that can be improved. there anyone/where it can be submitted to? ie like a git pull request..

tame mulch
frank lintel
#

if that means PZMath etc if I see something I'd like to offer to do so for like review. yes I wouldnt mind doing so.

tame mulch
frank lintel
#

okies, would you have a link that would be the right forum. only asking havent looked at them yet.

tame mulch
frank lintel
#

tyvm

red tiger
#

I shelved its release because project-priority was overtaken by things you see me mention in here periodically.

frank lintel
#

I was more just looking for a place to offer improvements to whats there if I come across them just didnt know where to offer it at.

royal rose
#

If pz is written in Java, would be possible to write mods in kotlin?

red tiger
inland trellis
tame mulch
ancient grail
#

it actualy governs position

inland trellis
#

I hate that^

#

A lot

#

Spent 3 days ;-;

ancient grail
#

you can just translate the move ment or just keep it still

#

also the xml is what actually controls the whole behavior

#

meaning you have the raw file setup but will still be subjected to changes made by the xml file calling it

inland trellis
#

I have an XML configured, but I was just staying completely still when I should be moving, and moving when I shouldn't be

#

I was totally lost

ancient grail
#

i suggest you take peek at how masking animations work... the thing is called aim with torch left hand or something like that

#

but the character isnt actually aiming at all

#

its just the left arm which is being manipulated so in short your animation file isnt really doomed you just lack 1 more step

ancient grail
inland trellis
ancient grail
inland trellis
#

Nah, I have a group of guys counting on me lmao

ancient grail
#

share the mod link when youre done ๐Ÿ™‚

inland trellis
#

Absolutely

#

It's going to be a hilariously fun addition if I can get it working to our expectations

#

lmao

cunning canyon
steep cloak
#

Mhm, been a blast working on it over the last few weeks :)

More to come in the future!

lunar carbon
#

question, how i can use the full WaterPot in a recipe without changing it for Pot when use all water?

ancient grail
#

๐Ÿซก

#

ooops typo let me correct that

nimble spoke
#

Hey, good to see you got that working

boreal garnet
#

i need help in adjusting the rarity of items from a mod cattofingies

#

i have no prior experience with modding PZ

glass basalt
#

in the mod files, go to media\lua\server\items\ and look for a distributions file or something like that

boreal garnet
#

already found it

glass basalt
#

send it here and I can divide all of the spawn rates in half

#

to get a feel

boreal garnet
#

into the chat?

glass basalt
#

yeah just drop it

boreal garnet
glass basalt
#

alr gimme a min

boreal garnet
#

would be cool if you could teach me what numbers to edit bunnydance

glass basalt
#

alr

#

you are editing the actual numbers

#

currently i am dividing them by two

boreal garnet
#

do the numbers have to add up to something?

glass basalt
#

no, it is simply a weight on the "roll" the item gets

#

basically 100 is 100% and 1 is 1%, but they are not actually percentages, and work relatively

#

a loot table with only one item that is like 0.0001 will still spawn that item every time

boreal garnet
#

oh i see. i might actually run with the halved rarity too

#

since i was gonna reduce it anyway

glass basalt
#

reducing it in half is always a good start

boreal garnet
#

are you gonna finish it or do i do it myself eyepeek

glass basalt
#

im like 40% of the way through atm

boreal garnet
#

oh cool.
can you teach me how i can make it a "patch" unlisted workshop thingie?

glass basalt
#

that was the next thing I was gonna ask you

#

yeah

boreal garnet
#

u a cool guy flushed_cool

#

thanks for your time

glass basalt
#

you give me a reason to procrastinate on my own mod ๐Ÿคฃ

glass basalt
#

to make a patch, go to C:\Users\YourUserName\Zomboid\Workshop

#

and copy the ModTemplate folder, and name the copy whatever you want

boreal garnet
#

done

glass basalt
#

go into the new folder you made and go to media

#

also rename the second ModTemplate folder to something else

#

in Contents

boreal garnet
#

done and done

glass basalt
#

delete everything in media. you don't need it

#

make new folders like this: media\lua\server\items\

#

you are basically copying the folder structure of the Umaboid mod

#

to double check, are the Umaboid distributions in items? sometimes mods don't do that

boreal garnet
#

they are in Items, yes

glass basalt
#

okay good

#

now put the new lua file into items

#

what you are basically doing is replacing the entire file that Umaboid uses for your own

#

in mod.info, you need a require line to safeguard the mod from running before umaboid itself

#

lemme find the mod id, brb

#

okay, in mod.info, add this line above description:
require=UmaBoid

#

that is the mod id of the umaboid mod you linked

#

now you can change whatever you want in mod.info, maybe add an authors=Souv line, and you are ready to upload the mod thru the game

boreal garnet
#

i see nikohyper

#

may i ping you if any questions arise?

glass basalt
#

it is also ready for you to use in-game, you don't need to upload the mod and subscribe to use it

#

sure

#

i recommend testing it out before you upload. maybe it is still spawning too much

#

now, back to text editing Tsar's translation files...

wheat kraken
#

hey, you from the future, if you are looking a boolean to be true when climbing over fence, you are looking for this

character:isCurrentState(ClimbOverFenceState.instance())

character:isStrafing() --aiming and walking
wheat kraken
rancid panther
#

lol. nice

#

is the zombies getting close to you a limitation of the program or intentional? cuz it would be kinda badass to swing an axe at a zombie in slow mo

fast galleon
wheat kraken
fast galleon
#

you can make tables?
*found it

red tiger
#

Steam has their own markdown.

wheat kraken
cunning canyon
#

How much of a pain is it to add new fonts to project zomboid? I want to experiment with some both in typical UI panels and in the Map

viral notch
red tiger
#

Look up "AngelFont"

#

The UI draw API doesn't support custom fonts however the font object you load can be called and drawn manually onto the screen.

#

This is something I suggested to @tame mulch To add API support for UI draw calls.

#

Since I've seen this brought up multiple times in the past month or two, I'll spend tomorrow making a guide for doing this.

cunning canyon
#

This is very helpful info, please ping me when you've got the guide ready!

#

So for putting custom font on a map, i'd be good to go, if I wanted to put it on a UI panel, I'd need to manually draw the images and lay them out and handle any kerning etc my self?

#

Is that about right?

rancid panther
#

would be cool to kill zombies in comic sans

cunning canyon
#

Nevermind, don't tell us how to do it, it's been ruined

glass basalt
#

Riko Prushka has released quite a few font mods, I'd look at those

tawdry solar
#

hey i have an issue with my mod

#

it doesnt spawn ingame

#

but its in the lootpool

#

the item is ingame too

fast galleon
#

I've been trying to see how much slower a coroutine is and it seems to have unnoticeable effect. I'm going through an ordered table and doing a) everything in the same function, b) use closures, c) use coroutines.

*increasing table objects vs loops shows coroutine disadvantage.

glass basalt
glass basalt
tawdry solar
#

this is the same system another modder told me about

#

it works fine for him

glass basalt
#

local containerData = ProceduralDistributions.list[containerName]

#

table.insert(containerData.items, itemName)

tawdry solar
#

hm?

glass basalt
#

follow this format

tawdry solar
#

why that one though

#

if it works the same for another modder why doesnt it work for me

fast galleon
glass basalt
#

because it is not ["list"], it is .list

glass basalt
rancid panther
#

can i make immunity a 0% chance using zombrand by doing if ZombRand(99) <= 0 then ?

fast galleon
glass basalt
#

in Kahlua?

fast galleon
#

Lua, Kahlua

tawdry solar
#

if it hadnt work it would be brought up in his commetns

glass basalt
#

well then I am not sure why your item doesn't appear

#

What is the module of your item?

tawdry solar
glass basalt
#

Roundmeal will work if it is Base.Roundmeal

tawdry solar
#

i havnt worked on it in like a month

#

where do i find modual

glass basalt
#

where you defined the roundmeal item

tawdry solar
glass basalt
#

yeah do MM_roundmeal.Roundmeal

tawdry solar
#

so that was the issue?

glass basalt
#

maybe

#

test it

glass basalt
#

Does anyone know how the game assigns a color to a vehicle when it spawns?

#

Or where, specifically.

tawdry solar
#

wym

#

@glass basalt

glass basalt
# tawdry solar hm?

roudmealtexture
Double check that your icon is named the same, in case you are having issues with it

tawdry solar
#

oh damn

glass basalt
#

ah well at least its working ๐Ÿ˜‚

tawdry solar
#

i actually havnt tested it yet

#

ill get back to you if it does/doesnt

#

@glass basalt it spawns now

#

but changing the icon name fucked it up

glass basalt
tawdry solar
#

there both the same

glass basalt
#

ah no, you don't need item_ in the script file

#

that is for the PNG file only

tawdry solar
#

mhm

#

ty

glass basalt
#

what I meant by typo is that it should be roundmealtexture, not roudmealtexture

#

or better yet roundmealicon if you want to follow naming conventions

ancient grail
#

mortart mod WIP spotter animation

tawdry solar
ancient grail
#

mortar mod Exploding animated tiles

ancient grail
tawdry solar
#

like your spotting smth

#

did you make the rpg mod btw?

#

sprites look similar

#

for explotion

ancient grail
#

yeah thats not yet implemented.. the animations for the character fkd up for some reason idk wwhy but atleast the tiles work

ancient grail
tawdry solar
#

it looks good tho

tawdry solar
ancient grail
#

but i made these tilesheet digipainted it

tawdry solar
#

thats why it looked similar

ancient grail
#

imade a photoshopbrush long ago that makes fire effects easy to do so i used it

tawdry solar
#

oh thats cool

#

improved the icon

#

it used to be a shitty shitstain of a picture

#

is there a way i can add crafting recipies to like cut it in half

glass basalt
#

you'd need to add another item that is essentially "half" of that

tawdry solar
#

im gonna do that

#

im coding a new item rn

glass basalt
#

but since it is food you can technically already do that. you just eat half, but it remains one item

tawdry solar
#

i dont want to cut it in half

#

i want to add new items to it like a stir fry

glass basalt
#

you could add it to the recipe that makes stir fry, if that's what you want to do

tawdry solar
#

thats what ill do

glass basalt
rancid panther
#

does if not player:getModData().immuneTested then mean if .immuneTested is false, or if it is nil?

#

would it be better to do if player:getModData().immuneTested ~= nil

ancient grail
glass basalt
tawdry solar
#

time to do the stressfull part

#

modeling

tawdry solar
#

i mean i wouldnt want somone using my mod

#

for there own mod

glass basalt
#

It requires the mods it edits though

rancid panther
#

can i use mod data to set an integer?

glass basalt
#

iirc mod data is just a table. you can set anything in there

rancid panther
#

so the same way i did true or false, i could set it to 0? and then when the event occurs again, it can increase by 1?

bronze yoke
#

moddata is literally just a table that saves, not sure why everyone expects it to have crazy properties

#

anything you can do with a table you can do with moddata

tawdry solar
#

this is the best im gonna get for a jar when im tired

rancid panther
#

i dont know coding at all. i am just taking information bit by bit

glass basalt
#

its the solution to attaching information to an object, as opposed to using global variables or your own object

tawdry solar
#

i dont think it looks half bad tbh

glass basalt
tawdry solar
glass basalt
#

it doesn't matter, the game handles everything for you

tawdry solar
#

i just used cylenders

#

ill decimate it

ancient grail
rancid panther
#

i will just make something and then i'll ask if it makes sense

glass basalt
#

that do be how we learn, I ask dumb questions all the time

tawdry solar
#

we do all start somwhere

#

i had no clue how to code like 6 weeks ago

#

and now from a really sleep deprived night

#

i can sort of code

bronze yoke
#

i think the java method to grab it throws people off, but moddata is a completely normal lua table

glass basalt
#

would scanning the moddata off of an object and printing it be a smart idea or will it flood the console

bronze yoke
#

i doubt any one object would have a crazy amount of moddata

tawdry solar
#

@glass basalt is this better?

glass basalt
tawdry solar
#

thanks man

#

time to line it up

bronze yoke
#

so that should be fine

#

if you have a lot of mods players might have a bit but not too scary of an amount

rancid panther
#

can i make something be true/false but also have a number value at the same time?

#

so i dont need to make a bunch of labels for starting the testing process and then during the testing process?

glass basalt
#

not a normal variable. either use two or make an object

bronze yoke
#

i'm not sure what you mean by that

glass basalt
#

like myThing["bool"] & myThing["num"]
for a table

rancid panther
#

immuneTested = false
immuneTesting = 0

bronze yoke
#

you can test things like if player:getModData().immuneTesting == 0 then

glass basalt
#

yeah just change immune into a table and have tested and testing as two parts

#

that too

rancid panther
#

ohh so immune.Tested and immune.Testing?

glass basalt
#

if you want, but like what albion said, use as little variables as possible, check for the variable itself

rancid panther
#

i see

glass basalt
#

just quality of life and cleaner

rancid panther
#

cuz i need both for different things (i think)

glass basalt
#

unless you need to store like a boolean outside of a function, i'd use only one there

bronze yoke
#

if they're separate entirely then yeah you need both

frank elbow
rancid panther
#

i need immuneTested so that it stores information if a character is immune or not
and i need immuneTesting so that it will tick every hour until it reaches a certain stage that it can trigger to complete the test

ancient grail
#

If you use

if not var then
Its going to check for false or nil
So thats better than actually using ==
Unless u want to look for false or nil specifically

rancid panther
#

i think for that particular situation i would want nil

bronze yoke
#

seems better to keep them separate then

rancid panther
#

ok

#

i will show what i have when i finish something

tawdry solar
#

how do you texture glass lmao

#

best i got

ancient grail
#

Just opacity

frank elbow
#

#modeling people may know better? I couldn't tell you

tawdry solar
#

ah alr

tawdry solar
#

or am i too tiered to understand if that was directed at me

ancient grail
#

Decrease opacity on the png of your UV output

#

It was dw

tawdry solar
#

oh ok

tawdry solar
#

are

#

ware

#

or blender

ancient grail
#

But omar is 100 right
You will get better answer from modelling asking modeller than here asking coders

tawdry solar
#

alr

#

my model is invisable

#

oh nvm

#

the modu was wrong

#

hm

#

still invisible

#

ahh

#

this is pissing me off

rancid panther
#

in debug?

tawdry solar
#

no

#

the worldmodle

#

model

rancid panther
#

my bad, yeah i read some more context

tawdry solar
#

its all the same

#

fuck discord autocrop

rancid panther
#

true

nova socket
#

Question for million bux: How do you guy serialize and store data about specific vehicles on the map?
My trouble is that I somehow need to have control over vehicles regardless if they are currently loaded into some square or not

#

setVariable/getVariable is a permanent thing for objects?

#

Anyways still trying to figure the optimal way to even return vehicles when they load

#

That's the biggest issue so far.

bronze yoke
#

i think the init lua function on parts is called every time they load

nova socket
#

Is that event or?

#

OnSGlobalObjectSystemInit ?

bronze yoke
#

no, the lua functions the part scripts point to

#

like oncreate functions for recipes if you are familiar with that

hollow lodge
nova socket
#

Recipes is abstract thing and onCreate is an event called within that layer

#

When vehicle is an IsoObject? that has to be constructed, but alas reliable way to create one is call /addvehicle from server that doesn't return the vehicle itself, as example.

#

I can create vehicle, but I don't see any proper event or hook on how to return and serialize one.

#

Probably have to create some event listener myself, loop vehicles and check the list size for changes I dunno

bronze yoke
#

if you just want them on creation hook Vehicles.Create.Engine

#

but if you need it every time they load you need an Init function, there isn't one for engine in vanilla but another part's might work

sour island
#

Vehicles are one of the systems in desperate need of more exposing and more events triggers

bronze yoke
#

the exact part is irrelevant - i just go for engines since every vehicle has exactly one and they can't be removed or anything

rancid panther
#

does EveryHours work in lua/shared?

#

even when i make something as basic as a print statement it doesnt do anything

#

with EveryHours, EveryTenMinutes etc

#

i think im misunderstanding the concept of the event as a whole

bronze yoke
#

it should

rancid panther
#

at the end i have Events.EveryTenMinutes.Add(testingProcess)

true vault
#

Question
Any way to accurately detect what kind of grass is being targeted when a player uses the Remove Grass action?
Specifically, need to be able to differentiate between long, medium, short grass 'clumps' being removed.

small topaz
#

Does anyone knows whether adding the modifiers like "(Cooked)", "(Fresh)", "(Rotten)" etc. to food is controlled somewhere via lua code? I am trying to add a new modifier into brackets but all I am able to do up to now is this:

#

Would prefer if the "Poisonous" is in the same brackets as the other modifiers.

nova socket
bronze yoke
ancient grail
true vault
bronze yoke
#

in vanilla those tags get added during the java Food getName() method, so this is the best way of replicating that

#

some names get swapped during a lua function (like mushrooms being renamed to poisonous mushroom) but you can't hook into it easily (changing the name before that function does nothing, changing it after causes problems) so even if you're doing that i would recommend doing it this way

rancid panther
#

okay it now works with EveryTenMinutes

#

now i gotta make the results work again

true vault
rancid panther
#

okay! now i just need to squash errors!

#

im getting an error whenever i try to undo the results, which didnt happen before

ancient grail
#

Or you can write a function that copy to your clipboard

#

Just dont forget that tile sheets array starts with0 and always have _ added to the sheets name

Sample my tilesheets name

Mortar

So the first sprite would be
Mortar_0

#

Thats the left thing on the sheet

#

Goodluck

pine yacht
#

Hey! New to PZ modding and ive read through a lot of things on the pzwiki Modding page and I'm a little bit confused atm. A lot of it has different sometimes conflicting info, some havent been updated in a really long time and some link to interesting but seemingly abandoned Java modding projects like Storm which if they still work I assume wont with B42 anyways if nobody is maintaining.

Is there a good single source that will get me started with fundamentals and also some of the more advanced possibilities of modding in PZ that is current? Been just reading through existing mods and base code so far.

#

Bonus points if it covers best practices and project structuring/build tools and such

rancid panther
#

reversing effects errors are now SQUISHED

#

now i gotta make sure it actually works when i change it to everyhours

ancient grail
#

@pine yacht

ancient grail
pine yacht
#

Thats still the same big list of stuff I was talking about. I see it links to the Fenris guide specifically which I was reading and it seemed solid

ancient grail
#

Fenris is up to date

#

His is very active and has recently got employed by TIS

pine yacht
#

Okay thanks yeah, maybe conflicting info was the wrong way to put it, except the stuff about Java and that Storm project, idk if thats still anything

rancid panther
#

works

pine yacht
#

It was just an overwhelming amount of sources that all phrased stuff differently

ancient grail
#

The wiki is up to date
Aiteron updated it . Like a huge update.

rancid panther
#

players have to wait 5 hours until they know if they are immune or not

ancient grail
#

Then just go for the next bigger thing

rancid panther
#

now i wanna add something that will make them increase stress while they are waiting for results

pine yacht
#

Yeah I'm not new to modding in general, I guess just used to the resources being organized a different way or somethin idk

#

thanks though the fenris one definitely seems like the one ill reference back to

true vault
#

@ancient grail right, right.

I actually have the action outputting the sprite name to console at the moment, so I'm not worried about getting the name; I'm moreso just looking at the names going: "these are not logically named at all" lolz

The names come out to e_newgrass_1_x with as you said x indicating their position on the tilesheet. They're just... all mixed together aha

pine yacht
#

and the tools

true vault
#

๐Ÿ˜“

ancient grail
#

Its ill-advised to try and do big or complex stuff first time around cuz you wont know for sure if what youre doing is working or not . But this is just general advise. Im mean i only said this cause you mentioned "overwhelming amount of sources"
Phrased diffrently..

In the past
our problem was lack of documentation..

Frustrated to know where we can find stuff
Now its gathered and alot of people made guides and tools
Everything is alot easier i bet

ancient grail
pine yacht
#

oh yeah, I'm not making anything big off the start. Just that I expect to get comfortable pretty fast and obviously have bigger sights than just an item or two

#

im still new to the community ๐Ÿ™‚ maybe with experience

true vault
#

Between the Java docs, the wiki for the modding section, and Daddy Dirkie Dirks YouTube vids, it's been.. okayish learning, IMHO

pine yacht
#

oh yeah, lots of info available. my main thing was some is updated last 2-4 years ago so I wanted to double check

#

some of the forum posts etc

bronze yoke
#

the java modding scene is very small, you won't be able to find much help there

pine yacht
#

I definitely am disappointed about the lack of Java modding, but it def seems not worth the hassle trying to get in to it

bronze yoke
#

this server is one of the biggest resources for modding really

pine yacht
#

mmhm I figured it might be

true vault
#

Fun thing; age of information is somewhat irrelevant to accuracy. I've looked up stuff even in this Discord and tried it, even though t answer was from like 2016... and it worked haha... others from like not even a year ago, sometimes don't.

pine yacht
#

when i first played zomboid it was pretty different, just came back recently that was mainly why i wasnt sure how much would be accurate

#

but you are right

#

a lot of info is good for years no problem

true vault
#

...it also doesn't help that sometimes the things I'm looking up aren't even something anyone has done since like 2013

bronze yoke
#

there's a fair bit of pervasive misinformation, so it's possible some of the stuff you tried just never worked LOL

true vault
#

General consensus though is that it isn't possible.

#

And yet, here I am, doin the impossible I guess ๐Ÿ˜›

bronze yoke
#

how are you doing that? loadgridsquare?

pine yacht
#

my outlook on modding is that nothing is impossible

true vault
#

mhm, alongside the squares ModData to check if that square was already processed or not

pine yacht
#

just depends how much work u wanna do

true vault
#

Thereby reducing the overhead by running that check first

bronze yoke
#

the reason i often claim that that's impossible is because most people mean to literally place the objects as a one-and-done thing when the map loads, which just isn't possible

wide oar
#

Question.

true vault
#

Yeah, that's true enough; though I wonder if that'll change with the b42 updates

wide oar
#

if i have a bunch of materials that have no texture and are just colors, would that work in zomboid or would i need to create textures for zomboid to use

bronze yoke
#

most things that are impossible are possible to fake

true vault
#

The colours are your texture layer; you would export that layer with the colours as a png, and use that as the texture in the model definition.

wide oar
#

no pngs, no dds, nothing

#

Wtf would i do with that, given that Zomboid requires a .png to be named and specified (its location) to be used as a texture?

wide oar
#

How do i export all of them at once into one png XD

true vault
#

Well, I'm guessing that answer will be based on how your particular app you're using handles exporting layers.

Roughly speaking, you would combine them into one layer in whatever way your app allows that, and export that one layer.

#

I can't guide much more than that though; the few models I've made are either edits of existing ones, or, very simple ones where I only used one layer with a solid colour in the first place (stack of five stones for example).

That discussion might be better suited for #modeling

#

Def more people that know modeling there >.>

Dunno how many of them check this channel lolz

ancient grail
wide oar
true vault
ancient grail
#

You can if you make em

ancient grail
#

Im not a modeller sorry idk tbh
I just know that thats the process but i havent done it

true vault
#

Well crap... there's 90 different tiles in the newgrass tilesheet...

rancid panther
#

can i have some personal opinions about the panic, stress, fake infection levels, and the % of immunity and time it takes to get results?

#

i'll also probably do sandbox options for it in the future

#

and also organization. how does it look in terms of that?

glass basalt
#

I have no clue how far this is gonna fly, but we'll see

#

coming soon

rancid panther
#

pog

#

would be nice to add support for custom maps on the server version too

glass basalt
rancid panther
#

the server version is specifically for adding mods to a server

glass basalt
#

what boggles my mind is that the first time I made my changes - everything worked, magically

rancid panther
#

it's not super well made cuz u cant look at previews or use presets you made in the other version

#

so i have to cope by giving all the mods im gonna use in the server a tag so it is easy to copy the list

glass basalt
#

everything is locally stored, would be an extra PITA to transfer files automatically but it could've been all stored in Mod Manager for the server

glass basalt
rancid panther
#

oh ur right

#

i've been doing it the hard way all this time

true vault
#
LOG  : General     , 1678516075848> Grass Length: long
LOG  : General     , 1678516080081> Grass Length: long
LOG  : General     , 1678516083481> Grass Length: long
LOG  : General     , 1678516086830> Grass Length: medium
LOG  : General     , 1678516088614> Grass Length: medium
LOG  : General     , 1678516091714> Grass Length: medium
LOG  : General     , 1678516096464> Grass Length: medium
LOG  : General     , 1678516098599> Grass Length: medium
LOG  : General     , 1678516101123> Grass Length: short
LOG  : General     , 1678516106498> Grass Length: medium
LOG  : General     , 1678516108514> Grass Length: short
LOG  : General     , 1678516110615> Grass Length: short
LOG  : General     , 1678516113131> Grass Length: short
LOG  : General     , 1678516115631> Grass Length: short
LOG  : General     , 1678516117531> Grass Length: medium
LOG  : General     , 1678516159648> Grass Length: short
LOG  : General     , 1678516163314> Grass Length: medium
LOG  : General     , 1678516166262> Grass Length: medium
LOG  : General     , 1678516168348> Grass Length: short
LOG  : General     , 1678516170515> Grass Length: medium
LOG  : General     , 1678516172800> Grass Length: medium
LOG  : General     , 1678516175930> Grass Length: medium
LOG  : General     , 1678516178048> Grass Length: long
rancid panther
#

i have deleted so many saves of characters standing in a pool of blood

#

from testing, and breaking my immunity mod so many times

ancient grail
true vault
#

Literally a "harvest some grass" function, based on length of grass removed blobkaratefacepalm

ancient grail
#
function despawnGrass(rad)
    local pl = getPlayer()
    local x, y, z = pl:getX(), pl:getY(), pl:getZ() 
    for xDelta = -rad, rad do 
        for yDelta = -rad, rad do 
            local square =  pl:getCell():getGridSquare(x + xDelta, y + yDelta, z)
            for i=0, square:getObjects():size()-1 do
                local obj = square:getObjects():get(i)
                local args = { x = square:getX(), y = square:getY(), z = square:getZ() }
                sendClientCommand(getPlayer(), 'object', 'removeGrass', args)
            end
        end
    end
end
-- paste this code on debug console and it will despawn the grass around you configure the radius
--sample:
despawnGrass(5) 
#

It was this one

#

Wrote for our modding servers admin debug tools

rancid panther
#

surpassed 100 lines on my mod

big boy modder now

ancient grail
#

I thought u wre a girl ..

rancid panther
#

im non-binary. big boy is an expression

eternal garnet
#

Evolved into binary code

rancid panther
#

i am now binary ๐Ÿ˜‚

eternal garnet
#

๐Ÿ˜‚

glass basalt
rancid panther
#

im thinking next i can add something like a dialogue line for when the immunity test results are in

bronze yoke
#

player:Say("I'm immune!")

minor mauve
#

Hi guys, quick question, is there a way to ignore "BodyLocation"? im developing a mod that adds more cosmetics, and i want to make my own "BodyLocation" so i can prevent cosmetics to be worn at the same time but also made some compatible to be worn at the same time, hope somebody can help me!

rancid panther
#

other mods that want to add a bunch of cosmetics just use the Ring slots

rancid panther
#

or just a joke

bronze yoke
#

it is that simple

rancid panther
#

wow

#

will other ppl hear your character say it?

minor mauve
#

Thank you @rancid panther i'll use the ring slots

bronze yoke
#

i think Say is clientsided

rancid panther
#

ah

bronze yoke
#

it's what vanilla uses for stuff like the dialogue when you try to read a book you're too high level for

rancid panther
#

ah

#

i'll add that along with sandbox options next time i work on it then

minor mauve
bronze yoke
#

though if you want it to be translation friendly (even if you don't plan on translating it yourself, other people likely will) it's better to put it in a translation file, and use player:Say(getText("NameOfTranslationString"))

rancid panther
rancid panther
rancid panther
#

np!

ancient grail
fast galleon
wheat kraken
wheat kraken
#

in No Pause, Slow mo mod
about the slow mo turning off when zombie getting too close
(that causes the current incompatibility to melee fight in slow mo) i suppose that is a game limitation hardcoded or run a code in a place that i dont manage to find yet, to reset all game speed modifiers to default value

if someone knows a clue, hint to solve that incompatibility or change that behavior, let me know please (in any ways, dm me, respond this, comment, mention me...)

fast galleon
zinc nexus
fast galleon
thick karma
#

Do OnCreatePlayerand OnPlayerDeath fire on the server?

#

Or is one or both of these exclusive to client?

red tiger
red tiger
#

Also.. Good morning!

undone elbow
#

How to check that a player is invisible? I guess this should work...

local function isInvisible(player)
    return player:getAccessLevel() == "Admin" or player:isGhostMode()
end```
thick karma
#

Is there an easy command to get the number of days since the outbreak began?

ancient grail
#

Hey its star how are you

modern hamlet
#

Can someone point me a good direction to how does server respawn the items? I want to respawn items only in a selected area.

ancient grail
#

Where can we find the mechanics for throwables
Like what if i want to make the projectile go straight ?

ancient grail
#

Go debug chest . Its second to the last

#

Then right click on the icon

wheat kraken
undone elbow
#

Simple Status is not really mine, I'm just leeching credits.

wheat kraken
#

aah okay

#

@undone elbow are you still open to have excrementum reapplied in a new context? / code reused for new feature

undone elbow
#

I'm not sure what you means

wheat kraken
#

can i dm you?

#

i was planning to talk to you, after i watch the last of us

#

i think today is the day

rustic garnet
#

How do you guys intelissense with PZ? So you can se the functions and get the colors in the editor etc?

worldly olive
#

This is also a must

frank elbow
undone elbow
#

Thanks! I guess player:isInvisible() is the right function...

rancid panther
#

invisible is invisible to players

#

ghost mode is invisible to zombies

#

to my understanding

undone elbow
#

Ghost mode is for silence and going through objects. But in my tests toggling invisible mode doesn't work, and toggling ghost mode toggles invisible mode too.

#

I guess it's a kind of the game bug that may be fixed in the future.

rancid panther
#

there is a noclip mode separate from ghost mode

frank elbow
thick karma
#

But world age hours might help me generate an estimate

#

Thanks regardless

sour island
#

Oh I had to do this for EHE

#

Gametime has start month/day but you still have to grab the sandbox option info for "months since apoc" and do some math to get it accurate/supporting of that option

#

Let me grab the snippet

#
---Check how many days it has been since the start of the apocalypse; corrects for sandbox option "Months since Apoc"
---@return number Days since start of in-game apocalypse
function eHeli_getDaysSinceApoc()

    local monthsAfterApo = getSandboxOptions():getTimeSinceApo()-1
    --no months to count, go away
    if monthsAfterApo <= 0 then return 0 end

    local gameTime = getGameTime()
    local startYear = gameTime:getStartYear()
    --months of the year start at 0
    local apocStartMonth = (gameTime:getStartMonth()+1)-monthsAfterApo
    --roll the year back if apocStartMonth is negative
    if apocStartMonth <= 0 then
        apocStartMonth = 12+apocStartMonth
        startYear = startYear-1
    end
    local apocDays = 0
    --count each month at a time to get correct day count
    for month=0, monthsAfterApo do
        apocStartMonth = apocStartMonth+1
        --roll year forward if needed, reset month
        if apocStartMonth > 12 then
            apocStartMonth = 1
            startYear = startYear+1
        end
        --months of the year start at 0
        local daysInM = gameTime:daysInMonth(startYear, apocStartMonth-1)
        --if this is the first month being counted subtract starting day date
        if month==0 then
            daysInM = daysInM-gameTime:getStartDay()+1
        end
        apocDays = apocDays+daysInM
    end

    return apocDays
end

@thick karma

#

There's probbly a cleaner way to do the math part of it

#

using daysInMonth you also account for leap years and such (I believe), but more importantly months with 30/31/28 days

thick karma
winter coral
#

Does anyone know what grow reference is in the Hairstyles lua ?

worldly stone
#

we modified the procedural distribution to exclude an item. it does not appear in the list of possible items and yet it still spawns frequently. i only had to reroll the loot twice to get this item. what could be causing this?

wet sandal
#

Anyone got a flow chart for Timed Actions?

fast galleon
worldly stone
#

is there a solution?

dark wedge
# wet sandal Anyone got a flow chart for Timed Actions?

I'm assuming you're looking for the order of which things run. Not sure if there's a list out there, but here's my understanding of it.
After you new it and add it to the stack:
isValid() -> [begin() -> create()] -> isValidStart() -true-> waitToStart() -loop until true-> start() -> (while running - update() and animEvents() are called) -> perform()
There is also forceComplete() which will result in perform() being called regardless of time left
forceStop() will call stop(), stop() is also called when the action isn't able to complete after it has started for other reasons.
the begin() and create() probably shouldn't be touched, why i wrapped those in brackets.

#

hope that makes sense. ha

wet sandal
#

forceStop() will call stop()

#

Thank you, that exactly what I needed

#

So something like this: TimedAction flowchart

dark wedge
#

yup!

rancid panther
#

anyone know the translation naming format for when i want a player to say something?

rancid panther
#

when i did
player:Say(getText("UI_immunetrait_Messages_Immune"))
and changed that to say something in EN, it still made them just literally say "UI_immunetrait_Messages_Immune"

#

there must be some kinda naming conventions cuz sometimes not following the naming convention will end up with the file or translation not being used

vast nacelle
#

This is what I have for one of my mods.
self.character:Say(getText("IGUI_PlayerText_FSDissectEureka" .. (ZombRand(3)+1)), 0.55, 0.55, 0.55, UIFont.Dialogue, 0, "default");

#

The ZombRand is just to select between IGUI_PlayerText_FSDissectEureka1, 2, and 3

rancid panther
#

what is ur local definition for self.character

vast nacelle
#

This is in a timed action, so it's just the player object

rancid panther
#

ah

#

i'll try IGUI_PlayerText then

#

or was it something that didnt matter for you? what does your translation file look like?

vast nacelle
#

IG_UI_EN.txt:

    IGUI_PlayerText_FSDissectEureka1 = "Hmm, I see...",
    IGUI_PlayerText_FSDissectEureka2 = "Thank you for your contribution to science.",
    IGUI_PlayerText_FSDissectEureka3 = "Your death wasn't in vain.",
}```
rancid panther
#

Hmm, I see...

#

Thank you for your contribution to modding.

small topaz
#

when defining a new item, is it possible to give it an empty space as a display name in it's script.txt entry?

wet sandal
#

I've never tried but you could try a non-breaking space

#

dang, dsicord ate it

#

No clue if it'll work

fast galleon
frank lintel
#

that moment you get a 3% gain in execution speed and wonder if its even worth it.

rancid panther
#

i might try an alternative approach to the immunity thing

frank lintel
#

as in immune to Z?

rancid panther
#

yes in my mod

frank lintel
#

cheat mod I use basically just has it on a constant event curing ya

#

not that Im saying thats good either..... drunk

rancid panther
#

i made it so they are technically not immune until after they wait for the results of a bite

#

but i could make it so they are already immune the whole time but won't know until they are bitten

#

for immersive reasons

frank lintel
#

me I'd look see if making an event when they bit if that was possible

#

then ya can work it from there.

rancid panther
#

i already made a working mod that does this all, but you gain immunity 8 hours after the bite, rather than on spawn

#

meaning that even if you would have ended up immune, if u die before the results, you will become a zombie
and you also have infection symptoms the whole time, meaning that once you become immune u lose the symptoms and the infection

frank lintel
#

well makes sense immunitt isnt something instant

rancid panther
#

hmm ur right

#

the other thing was that it would be easier to implement a doctor test if they already have a hidden immunity tag

sour quest
# wet sandal

Does there happen to be more reference sheets like this? As someone who is new to PZ modding I think this would be a great help!

wet sandal
#

Not that I know of, I made that jsut now while working on a mod

rancid panther
#

when/if i were to add that

frank lintel
#

dunno how much of a help but on that front check out superb they got a healthcheck thing you can do to the NPCs

rancid panther
#

thx

#

im just airing out my thinking process

vast nacelle
frank lintel
#

all good I been digging in .class's

wet sandal
sour quest
wet sandal
#

Ye I'll share!

meager lion
#

Does anyone know of a way to detect when/what a player is eating?

vast nacelle
plucky fjord
#

I'd like to find a way to create a mod for zomboid where I can create random events like the car crashes, random tents on the side of the road n shit but idk where to learn how to do that from

#

would that be done through mapping?

small topaz
#

Is it possible to change a script.txt parameter for a single item of that type? For example, for a specific food item which is already in game, I would like to change the script value
IsCookable = TRUE
to
IsCookable = False
without affecting all other items of that type? One idea would be trying to use smth like item:doParam(string) but this command seems only be defined for the class "item" and not for "InventoryItem".

bronze yoke
#

InventoryItem:setIsCookable(false)

#

there's no doparam equivalent and some rare values are just read directly from the Item but most things have a setter

#

i wouldn't expect a lot of stuff like this to be persistent though

small topaz
small topaz
glass basalt
#

I'm having an issue embedding images into the Steam Workshop mod page description, specifically the mod permissions images with Spiffo. Does anyone have an updated version of what the embed should be?

#

all of my embedded images appear as broken images (the broken image icon specifically)

#

it seems that image embeds have to be from tenor or imgur. That's so stupid

#

or not. I'm so confused

glass basalt
old crescent
#

Hello, what line of script does spawning percentage customization in mods

old crescent
#

in LUA?

glass basalt
#

in \media\lua\server\ for items and \media\lua\shared\ for vehicles

#

\items\ if it is items and \vehicles\ if it is vehicles nvm

old crescent
#

I delete all the script?

#

I want to make the book not spawnable in the world

glass basalt
#

yes, but I recommend putting --[[ at the top of the file and ]] at the bottom to comment them out (makes them useless)

#

you still need the file to exist if you are making a patch

old crescent
#

like this ?

glass basalt
#

yes

old crescent
#

got it thanks.

chrome egret
glass basalt
undone elbow
#

How to play anim not in action?

#

And not by using emote.

small topaz
frank lintel
runic creek
#

how would I get a list of all the safehouses on the map and who owns them

true vault
#

Can anyone confirm if the devs have in fact stated they plan to add archery to the base game?
I'd rather not spend too much time on working on parts of the mod I'm doing now. if I can skip archery-related stuff and have them do most of the work instead :p

bronze yoke
#

i don't know if they've explicitly stated it but it'd seem like a really silly omission with b42's goals

true vault
#

I mean, that's a fair point.

#

Welp, I'll adapt one of the existing mods for now for my purposes, and drop archery support entirely once they have it in the base game; or alter it if needed, when that drops.

glass basalt
wide oar
#

question

#

how do you get custom gun sounds to work

#

i have these all set up but it seems to be ignoring only the fire sound

#

on a side note, its transparent, but only on one side. this isnt the case in blender, so im not sure whats happening here. does anyone know a fix for that, as well?

#

the game seems to be ignoringa ll my custom souinds

#

i dont understand why???

#

i made a gun mod a while ago and the sounds on that one work, so i genuinely dont understand why it would be deciding to ignore my gun sounds. >-<

rancid panther
#

i rewrote my mod so players are now immune or not immune on spawn, but they will be fake infected if they are bitten, until they examine the bite for long enough

#

when i get time i can create an actual action to make them examine the bite rather than just standing there for 4 hours waiting

wide oar
#

k i fixed transparency

#

was a texture size error

#

now does ANYONE know why the sounds aren't working? ._.

#

for reference

#

thats what it should sound like

#

and then this is what it does sound like: ^

#

that and it seems to error when i shoot zombies

#

but they still die

#

so theres the two things i need answers too ๐Ÿ˜ญ