#mod_development

1 messages ยท Page 182 of 1

covert carbon
#

I will see if I can help you on that problem you talked about earlier

sage magnet
#

yay

covert carbon
#

I will warn you I don't deal with textures and stuff

#

so I might not be too much of help

#

I will still see what I can do tho

sage magnet
crystal terrace
#

I put together a resource based on whatever I picked up. Maybe you'd like to check it out, it's specifically for adding items to pz.

hollow lodge
#

i want an item to spawn on a certain group of zombies, where should I start?

crystal terrace
#

Which item?

hollow lodge
#

I have the outift already written in the zombiezonesdefinition, and the item is of my own

crystal terrace
#

Checkout procedural distribution file, it has all the lists for different zeds and what to spawn on em

hollow lodge
#

isn't that just for containers?

crystal terrace
#

You add your item to whatever list you want

crystal terrace
hollow lodge
#

Im looking at other mods, that have loot on zeds

#

says something abt suburbsdistributions

#

-- Zombie

table.insert(SuburbsDistributions["all"]["inventorymale"].items, "MoksFoods.MoksSkittles");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 0.02);

bronze yoke
#

suburbsdistributions is proceduraldistributions, the table is registered under both names

hollow lodge
#

I have designed some outfits for the player and zeds, but strangely, there's an item that doesnt appear when choosing the outfit on the character creation page, so I'm wondering if I can have this clothing item spawn on zeds another way

crystal terrace
#

wait i think i might be wrong on this

#

ah

tawny pendant
#

can someone explain what's going on here? I know it has to do with the context menu, but Im not sure what I did to break it. Context, I added recipes for a trade mod so I can have more trades/the trades that I want. and now it's giving me this error every time I right click on a radio or cash. anyone able to tell me what I need to do to fix it?

function: addDynamicalContextMenu -- file: ISInventoryPaneContextMenu.lua line # 2781 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 699 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla.
[18-07-23 15:32:28.350] ERROR: General , 1689719548350> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getTexture of non-table: null at KahluaThread.tableget line:1689..
[18-07-23 15:32:28.350] ERROR: General , 1689719548350> DebugLogStream.printException> Stack trace:.
[18-07-23 15:32:28.351] LOG : General , 1689719548351> -----------------------------------------

hollow lodge
unique roost
#

question

#

is it possible to mod the intro screen to play a sound when "These are the end times" pops up?

#

Please ping me for responses

crystal terrace
#

i think this is the only way how they are spawning items on zeds, it's a nested inside all category

hollow lodge
#

mmmh

#

so it's quite impossible

#

thanks anyway

crystal terrace
#

on clothing yes but to spawn an item on zed that's possible

autumn garnet
#

Hey :) do you know how to use "burntTile" from https://zomboid-javadoc.com/41.78/zombie/iso/sprite/IsoSprite.html#burntTile
to ensure that it has the same name of the tile to avoid that it is burned ,
it is not an isoFlagType so impossible to do: ```lua


debug = {}

debug.OnObjectLeftMouseButtonDown = function(object, x, y)

print(object:getSprite():getName()) -- tyl_pnj_0 for example
print(object:getProperties())
print(object:getProperties():Set("PickUpLevel",tostring(1),false))

local sprite = IsoSpriteManager.instance:getSprite(object:getSprite():getName())
local props = sprite:getProperties()

print(sprite:getName())
print(props)

props:Set("burntTile","tyl_pnj_0") -- doesn't work not isoFlagType
-- or 
props:Set("burntTile",tostring(object:getSprite():getName()))

end

Events.OnObjectLeftMouseButtonDown.Add(debug.OnObjectLeftMouseButtonDown)

bronze yoke
#

if there's no setter it's not possible

#

fields can be read directly with some weird code but writing to them isn't possible outside of debug mode

autumn garnet
#

Ah :( thank you... well we will have to overwrite the file newtiledefinitions.tiles

uneven mauve
#

Sorry but what is lootzed?

bronze yoke
#

it's something you can turn on in the debug cheats menu, while it's active you can right click on a container's icon to open a menu that'll show you its distribution tables and true item spawn chances

turbid crypt
#

I noticed the evolved recipe bit and wanted to see if I could poke at that so I stole these two from scripts/evolvedrecipes.txt

#

What does the :4 mean on the evolved recipe line in the cocacola item?

#

(it's a copy from popbottle)

bronze yoke
#

it uses 4 hunger from the item

turbid crypt
#

Oh ๐Ÿ‘€

sleek hull
#

How do other mods keep their sandbox options formatted nicely? I'm attempting to add them to one of my mods, and I've got them showing, but they always format to "Sandbox_ComfySleeping" instead of just "ComfySleeping"

Format in sandbox-options.txt seems to be the exact same as other mods with sandbox options..?

bronze yoke
#

you need a translation file

sleek hull
#

Thx, I'll take a peek at some translation files from other mods and take another crack at it

uneven mauve
sleek hull
ancient grail
ancient grail
ancient grail
bronze yoke
#

you're right clicking right? oh and i don't think it enables until you close the cheat menu after ticking it

covert carbon
#

I can't fully grasp what isogamecharacter is or what it does. Could somebody explain it for me?

tawny pendant
ancient grail
#

I think its your module

gilded hawk
#

Inside ISInventoryTransferAction:transferItem does anyone know if there is a way to see if the item was moved inside a tile container?

Like, I know I can check if it's a vehicle by doing this instanceof(self.destContainer:getParent(), "BaseVehicle") but how do I check if it is a tile?

ancient grail
#

Items are

Base.Apple

CustomMod.CustomItem

#

Yours is

Game Buddies.Item

#

Theres a space

tawny pendant
#

okay, so to fix it, I would just get rid of the space then?

ancient grail
#

Ye

tawny pendant
#

cool

ancient grail
tawny pendant
#

yeah Im just editing dingo's trade mod (revised) so Im working off of someone else's work lol

turbid crypt
#

Is there anything special to how I put an evolved recipe in? I can't seem to make my cocacola able to be poured into a cup

#

EvolvedRecipe = CokeCup:4;CokeCup2:4,** already made that change

gilded hawk
unique roost
tawny pendant
# ancient grail <:nice:1124299457081659433>

Iโ€™m sorry, but can I ask you to show me which space I need to remove in the code? I have a feeling I have to do this multiple times across all the files from the original mod Iโ€™m editing but Iโ€™m not entirely sure which space or spaces I need to remove

tawny pendant
#

Ah okay, so it should look like, Trade.guns, or something along that line then?

ancient grail
#

Yes

#

But you dont have to put the trade
On every entry

#

You just declare it once

tawny pendant
#

So just replace module with a trade and remove the spaces then. Got it. Thanks for the help!

ancient grail
#

I mean you made it
Buddies Guns

You can just
BuddiesGun

tawny pendant
#

Ah okay got it

ancient grail
#

Or you can keep that base
Cuz you only wrote recipes

bronze yoke
#

using base is bad practice

ancient grail
#

There are no items on the txt

#

Just recipe

tawny pendant
#

Iโ€™m just editing the work of two previous people for my own entertainment. So im just winging it lol

bronze yoke
#

recipes don't suffer from conflicts as badly as items but they still do

elfin stump
#

Does anyone have a reference to a good way to connect a timed action to an object so that you can 1) right click on it in your inventory and then 2) click a context menu item and 3) call a function from that click? I was trying out the Events.OnFillInventoryObjectContextMenu.Add() event but it seems to trigger on any right click in the inventory (when the context populates), I would like to have it only trigger on a certain item, but I don't have a reference to what was clicked on when using that event. I also am not quite sure how to actually fire a function from the click on the context menu. - Any guides or anything out there?

bronze yoke
#

the event passes a table of selected items, you want to check if your item is in that table (or if it's the first entry, depending on how exactly you want it to be have)

elfin stump
#

is that table the second variable called "context"?

bronze yoke
#

it should be the third, 'items'

#

if you're looking at the wiki it might not be named the same way

#

but only the order matters anyway

elfin stump
#

ok cool, they are calling it worldObjects, I will give that a shot

covert carbon
#
    local player = getPlayer()
    local chancetodie = ZombRand(6)
    if chancetodie == 5 then
        local bodydamage = player:getBodyDamage();
        local b = bodydamage.getBodyPart(Head);
        b:setDeepWounded(true);
    end
end```
It says that the line with ```local b = bodydamage.getBodyPart(Head);``` made an error. "Expected a method but got a function" any ideas?
tawny pendant
#

So what, I should just get rid of the

Imports
{
Base

Bits then?

elfin stump
#

how about actually clicking on the button that was added? Do you know how to call a function from that selection choice after it has been added to the context?

bronze yoke
#

you should keep the import, what glytch3r is suggesting is to put your recipes into the base module directly which is really bad practice

sage magnet
#

It's me again, I managed to fix the icon but it has weird colors. How can I fix that ?

bronze yoke
#

is your item configured to have different colours? it's probably tinting the icon because of that

sage magnet
#

Well idk I haven't written anything about that

#

I need to disable it I guess

sage magnet
#

lol

bronze yoke
#

in your screenshot, even the 'missing icon' icon is tinted red

#

so i think that's probably it

sage magnet
#

Ok I will try to fix that but I have an other issue

#

There is still no item description

bronze yoke
#

i think that means the clothing xml is missing or has an error

#

that's not really my area unfortunately

sage magnet
#

Oh ok I tought it was only to show it on the caracter/on the ground

tawny pendant
#

still giving me this error

function: addDynamicalContextMenu -- file: ISInventoryPaneContextMenu.lua line # 2781 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 699 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla.
[18-07-23 18:06:07.264] ERROR: General , 1689728767264> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getTexture of non-table: null at KahluaThread.tableget line:1689..
[18-07-23 18:06:07.264] ERROR: General , 1689728767264> DebugLogStream.printException> Stack trace:.
[18-07-23 18:06:07.265] LOG : General , 1689728767265> -----------------------------------------
STACK TRACE

bronze yoke
#

i'm not sure it is the module's fault, iirc the game doesn't really do any checking of module names and anything is technically valid (if bad practice)

#

usually when that happens it means an item that doesn't exist is being referenced by a recipe

#

usually a typo

elfin stump
#

Sweet got it, I just had some parameters switched around on the item there that was causing me trouble. I learned something from the fact it did not throw an error so thats a win.

bronze yoke
#

sometimes it's an error in the item script but your mod doesn't have any custom items right?

tawny pendant
#

nope, I know it's referencing from Brita's weapon and armor mods, but I don't remember it adding anything

ancient grail
bronze yoke
#

i think this error only occurs for the result item

#

so the error is in one of those

tawny pendant
#

oh great so now I have to go dig up both brita mods' item lists and check all the recipes the mod adds lmao

bronze yoke
#

have you imported the brita module? or used the full type in the reference?

tawny pendant
#

as far as I can tell brita just uses Base lol

bronze yoke
#

oh yeah...

sage magnet
#

If I need a UUID for my item, do I just choose randomly ?

bronze yoke
#

yeah, you can generate one online

sage magnet
#

Ok thanks

covert carbon
#

setBulletLodged(true);
So I know that BulletLodged isnt the correct term, but what is? For example
setDeepWounded(true);
would work

bronze yoke
#

setHaveBullet(boolean haveBullet, int doctorLevel)

tawny pendant
#

I think I found the broken entry, the original mod adds in a recipe to trade money for a glock 17, but as far as I can tell from the two item lists Brita included with their mod, the G17 is not an actual item.

bronze yoke
tawny pendant
bronze yoke
#

if you're in debug mode you might be able to see the name of the erroring item in the debugger

tawny pendant
#

ill give it a shot

trim mist
#

Anyone have a math brain? I need some help with a problem that's been haunting me for a while

bronze yoke
#

i've been writing some weird algorithms recently, hit me

tawny pendant
#

so it highlighted this line

#

a wider screenshot if that helps

bronze yoke
covert carbon
#

the website says this is how you set up "setHaveBullet"
public void setHaveBullet(boolean haveBullet, int doctorLevel)

b:setHaveBullet(haveBullet(true), 0)
Would this work?

bronze yoke
#

it would just be b:setHaveBullet(true, 0)

covert carbon
#

yippee

#

thank you

#

Btw sorry I have been asking so many questions

tawny pendant
#

I found it, it's this Bag_Smersh_Vest, this is not an item. the item it's referencing is actually, Rig_Smersh

#

my head hurts now

trim mist
#

These are two seperate tooltips: both are affected by the same trait.
The problem here is, the boredom and happiness isn't getting worse when the food is worse for a player. it gets better
it gets better in both cases

    local newFoodHungerChange = (foodHungerChange + (foodHungerChange * statModifier));
    local newFoodThirstChange = (foodThirstChange + (foodThirstChange * statModifier));
    local newFoodEndChange = (foodEndChange + (foodEndChange * statModifier));
    local newFoodStressChange = (foodStressChange + (foodStressChange * statModifier));
    local newFoodBoredomChange = (foodBoredomChange + (foodBoredomChange * statModifier));
    local newFoodUnhappyChange = (foodUnhappyChange + (foodUnhappyChange * statModifier));
    local newFoodCalories = (foodCalories + (foodCalories * statModifier));
``` here's how I calculate these new values
"good" stat modifiers are positive decimals, "bad" stat modifiers are negatives
#

(sorry, just wanted to get my explanation in as few messages as possible)

bronze yoke
#

when the unhappy change is already negative, you're multiplying it by e.g. -0.2, which makes it positive again

sage magnet
#

Yay my gloves are working ๐Ÿฅณ

nimble yarrow
#

does lua have math.absolute?

trim mist
#

it do

bronze yoke
#

you can multiply the stat modifier by -1 when the base value is less than zero

tawny pendant
bronze yoke
#

e.g. i reimplemented math.min and found it to be ~11 times faster

#

since most of the common ones are very simple i recommend just writing the logic yourself

#

in the statsapi repo there's a file that reimplements the ones i've had to use so far, it might be nice to reimplement the whole math library like that

tawny pendant
#

this freakin file is the issue, its referencing the old version of Brita's Armor pack. im not gonna fix it, I don't even care about these recipes, so guess who's just gonna delete it and see if that fixes the error Im having

nimble yarrow
#

is it possible to overwrite a mod's modoptions? you can't 'replace the file', as new options will just get stacked under the previous set of ints, bools, strings, etc

bronze yoke
#

do you mean sandbox options or the mod options mod?

nimble yarrow
#

sorry, sandbox options

bronze yoke
#

hmm, honestly unsure, it'd probably have to be done through lua rather than something more elegant

covert carbon
#

So my code works and it makes my character both get shot and bleed, but they got shot in their left hand rather than the head.

    local player = getPlayer()
    local chancetodie = ZombRand(6)
    if chancetodie == 5 then
        local bodydamage = player:getBodyDamage();
        local b = bodydamage:getBodyPart(Head);
        b:setHaveBullet(true, 0);
        b:generateBleeding();
        print ("You should be shot in the head now")
    end
end```
bronze yoke
#

try local b = bodydamage:getBodyPart(BodyPartType.Head);

covert carbon
#

thx

#

player:setOverallBodyHealth(5) I feel like im missing something

#

well I am bc the game says its an error

bronze yoke
#

that method is on BodyDamage

#

but it doesn't matter, that setter doesn't actually work

#

the overallbodyhealth gets recalculated every frame by the java, so changing it from lua doesn't really do anything

covert carbon
#

so. What am I supposed to do to make my health go down?

bronze yoke
#

you can do something like

local bodyDamage = player:getBodyDamage()
bodyDamage:ReduceGeneralHealth(95)
covert carbon
#

I am confused on the purpose of floats and booleans, what do they do?

#

I've probably used them in the past and just don't know it

bronze yoke
#

booleans are true/false, floats are decimal numbers (as opposed to integers which are numbers without decimals)

#

it's a bit weird to use since lua doesn't have types in the same way java does but kahlua generally converts things forgivingly

cobalt fiber
#

Yo albion, I gave up on the idea of using VSCode after taking a peek on IntelliJ.
Oh boy I fell in love with it

#

i'm with a bit of trouble in setting up my environment,

#

and was thinking if maybe you could help ๐Ÿ˜…

bronze yoke
#

sure, what issue are you facing?

cobalt fiber
#

well, a few...

covert carbon
#

ruh roh

cobalt fiber
#

I've noted them here

#

So, my questions are:

  1. The PZEventStubs typings are not working at all. I've set Umbrella as a Global Library on my project. Candle and PZLuaStubs are working fine, just the events are not.
  2. I have a utils file that stores some functions I use through out the mod, is there a way I can set these functions to auto-complete (ctrl+space) on other files too?
  3. Can IntelliJ identify what object is in a variable to get it's methods? eg.
    getPlayer(): <-- shows only methods available in IsoPlayer
#

forgot to say, some questions are related to umbrella

bronze yoke
#

hmm you're not the first person to face that first issue, but we never worked it out before either

#

3 implies to me that candle isn't working either

cobalt fiber
#

yeah, when I do IsoPlayer. it only shows it's variables, not it's methods

#

atributes*

bronze yoke
#

yeah, in that case you'd be accessing the static

#

but getPlayer() isn't suggesting the instance methods? that's weird

cobalt fiber
trim mist
#

@bronze yoke , thank you. This has been frustrating me for.... months now lol

cobalt fiber
#

Only these are suggested

bronze yoke
#

are you using the emmylua plugin?

cobalt fiber
#

Is it this version?

#

I donwloaded directly in the markedplace

bronze yoke
#

should be good then...

#

mine seems to have a different version though

cobalt fiber
#

what I did was open my media folder as a project andUmbrella folder as a External Library (or Global)

#

tried a lot of different things but none of them worked =/

#

i'll try to get that version

bronze yoke
#

yeah, that should be perfect

#

i wonder why mine seems to be older, it's not offering me to update or anything

cobalt fiber
#

Maybe the IntelliJ version?

#

I use the community edition

#

donwloaded it yesterday

#

I'll try a reinstall in emmylua

bronze yoke
#

hmm yeah, i do use the professional version or whatever they call it

cobalt fiber
#

well, reinstalled it and didn't work ๐Ÿ˜ฆ

#

I don't know if there is a way to get that older version is it?

vagrant valley
#

Which attachment corresponds to holding items?

bronze yoke
#

i'll see if it lets me install the community edition at the same time and i'll see if i see the same problems

cobalt fiber
#

uh okay

#

I don't want to give you any extra work moley

#

I've broke my head a lot last night with this, was about to accept it

bronze yoke
#

well if it turns out umbrella doesn't work on community edition that's a pretty huge issue to me, nobody involved wants it to be paywalled

cobalt fiber
#

Oh...

#

but that is very weird isn't it?

#

after all isn't emmylua that is working behind the scenes

bronze yoke
#

honestly your screenshots don't even look like my ide so maybe the difference is larger than i think

cobalt fiber
#

I enabled it to see if it changes something

#

Before enabling, was not working either

covert carbon
#

I need an opinion on my russian roulette game. I have it set to where if the person shoots themself, they have a few seconds of life before their lodged bullet wound kills them. However, if they have a high enough first aid skill, and they have all proper medical supplies on them, they can heal themselfs a split second before they die. Should I keep it like this or should losing the russian roulette game be a guarunteed death for all?

bronze yoke
#

it seems like my version of ultimate is fairly outdated actually, i thought it had an auto update

#

but umbrella has worked for a lot of people so i'm not sure that should be causing it

#

yeah, it doesn't work for me in community either

cobalt fiber
#

yeah. very weird
maybe their version also is outdated?

#

Did you manage to get the Community edition installed and also not worked?

bronze yoke
#

yeah

cobalt fiber
#

so yeah that relieves me

#

I didn't do something stupid

#

but makes me kinda sad ๐Ÿ˜ฆ

#

Hope it's not something very hard or difficult to solve

crystal oar
cobalt fiber
#

Looks like it took a lot of work to get it going, just to get randomly stopped by a update

bronze yoke
#

does this version of emmylua even have autocomplete for standard lib?

cobalt fiber
#

what do you mean? like, Lua's own functions?

bronze yoke
#

yeah, i'm not getting any

#

it seems to give up after one 'layer'

#

it can point me to math/table/even stuff like Events etc but it won't point me to the functions inside them

cobalt fiber
#

me neither

#

Uhhh I see where you are getting

#

like, it can find a table, but not what is INSIDE it, right?

#

makes sense

#

Also makes sense with the autocomplete with my own functions is not working

bronze yoke
#

as far as i can tell newer emmylua versions literally just do not function properly

#

it might be caused by some big idea changes or something

cobalt fiber
#

yeah, tried a lot here and got nothing

bronze yoke
#

it seems like a newer idea version redid how the intellisense works and they're struggling to catch up

cobalt fiber
#

So, even if I got your version of emmylua, will probably not work too

#

because my idea is too new

bronze yoke
#

yeah, you'd need a 2022 build it seems like

cobalt fiber
#

hmmm, I'll try to get around with it

#

maybe I can download that version somewhere

#

will this I have a utils file that stores some functions I use through out the mod, is there a way I can set these functions to auto-complete (ctrl+space) on other files too? also work if I have the working version?

#

or I have to do some trickery

bronze yoke
#

that should work by default

cobalt fiber
#

okay

#

found a 2022.3 build, I'll try it and see if it works

#

i'll feedback here later

#

Thanks in advice anyway ๐Ÿ˜‰
Was very helpful

#

sorry for all the work stressed

bronze yoke
#

as much as it pains me i'll have to start recommending people to use vscodium instead unhappy

hollow current
#

Good day to you people :)
I'm using OnFillWorldObjectContextMenu event to check for a certain world object in case it was right clicked, and I set some of its moddata accordingly. I just found out this moddata isn't saved, so once you restart the game, said moddata are gone. Any idea what's causing it and what other approach should I use?

bronze yoke
#

that shouldn't be stressed

#

that's kind of the whole point of moddata

covert carbon
hollow current
bronze yoke
#

oh, it is

#

you can't store objects in moddata, objects are inherently not persistent

#

no objects or functions

hollow current
#

sooo what's a good way to temporarily remove an object from a user's inventory and "add it to the worlditem stored info", and be able to retrieve it later?

bronze yoke
#

i'm not sure if there is one, maybe you could create an inaccessible container for the item...?

#

otherwise you'd be stuck serialising every field of the object and then reconstructing it

hollow current
#

Ugh seems like a lot of extra unnecessary work. Will try to think of another approach to do what I am trying to do

covert carbon
#

I just doubled the size of my code without testing it

#

time to see the error count

cobalt fiber
#

@bronze yoke IT"S WORKING YEAAAAHHH

#

really thanks for the help

#

I installed build 2022.3

bronze yoke
#

let's gooo

reef portal
#

noice

cobalt fiber
#

Now you can recommend it again to people instead of VSCode drunk

cobalt fiber
#

If other people want

bronze yoke
#

i'll note that down

covert carbon
#

we ballin

reef portal
#

what are the major benefits of intellij over vscode?

covert carbon
#

what is vscode and intellij?

reef portal
#

I'll try installing the older version + emmylua to get the typings goings but

#

they are ides

bronze yoke
#

i just find jetbrains ides a lot more comfortable and powerful

#

it also helps being in a java ide when you're going through the java

#

the tradeoff is that emmylua is not nearly as good as vscode's lua extension

covert carbon
#

do I seperate my numbers with "or" or do I use ","

#

if deathroutes == 0,1,2,3,4,5,6,7,8,9 then

#

or
if deathroutes == 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 then

bronze yoke
#

if deathroutes == 0 or deathroutes == 1 or deathroutes == 2 etc drunk

covert carbon
bronze yoke
#

you can simplify it a bit with a lookup table```lua
local allowedDeathroutes = {[0] = true, [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, [9] = true}

if allowedDeathroutes[deathroutes] then

#

it also runs a bit faster

covert carbon
#

Im still confused on the timed action only popping up for when you right click certain items

#

I have ISInventoryPaneContextMenu.lua opened

#

I skimmed over it and I am trying to make it work but the code confuses me

hollow current
bronze yoke
#

that can't be right

hollow current
#
function Frogshire.addFrog(player, frog, frogshire)
    local playerObj = getSpecificPlayer(player)
    local invent = playerObj:getInventory()

    if Frogshire.getSex(frog) == "Male" then
        local maleFrogIsTamed = Frogshire.isTamed(frog)
        local maleFrogName = frog:getName()
        local maleFrogSex = Frogshire.getSex(frog)
        local maleFrogDateFound = Frogshire.getDateFound(frog)
        local maleFrogLastFed = frog:getModData().Frogshire_lastFed
        local maleFrogLastTameAttempt = frog:getModData().Frogshire_lastTameAttempt

        frogshire:getModData().Frogshire_maleFrogExists = true

        frogshire:getModData().Frogshire_maleFrogIsTamed = maleFrogIsTamed
        frogshire:getModData().Frogshire_maleFrogName = maleFrogName
        frogshire:getModData().Frogshire_maleFrogSex = maleFrogSex
        frogshire:getModData().Frogshire_maleFrogDateFound = maleFrogDateFound
        frogshire:getModData().Frogshire_maleFrogLastFed = maleFrogLastFed
        frogshire:getModData().Frogshire_maleFrogLastTameAttempt = maleFrogLastTameAttempt
    else
        --Same snippet but for females. Removed due to character limit
    end

    invent:Remove(frog)
end```
#
if frogshire:getModData().Frogshire_maleFrogExists then
  removeMaleFrogOption = subMenu:addOption("Remove Male Frog", player, Frogshire.removeMaleFrog, frogshire)
else
  addMaleFrogOption = subMenu:addOption("Add Male Frog", player, Frogshire.addFrog, maleFrog, frogshire)
  if not canAddMaleFrog then
    addMaleFrogOption.notAvailable = true
  end
end```
#

so, I add male frog, go to main menu and load the world again, I don't have the prompt to remove the frog, and instead a prompt to add a new one

covert carbon
#

So would I have to copy the entire ISInventoryPaneContextMenu.lua file to make my context menu only work for specific items?

bronze yoke
#

no, you can just use the OnFillInventoryObjectContextMenu event

covert carbon
#

alright that finishes most of the coding

#

how do you make animations for zomboid?

#

I actually have experience in animation and editing so this should hopefully be good for me

crystal oar
covert carbon
#

I'm still trying to nail down the OnFillInventoryObjectContextMenu

#

Somehow my file just got deleted

#

nvm I got it back

#
    roulettecontext
end```
#

So that is my script

#

and zomboid says it expects a "=" near the "end"

#

any idea why?

hollow current
#

That should be an easier way to do it

covert carbon
#

thank you

hollow current
#

you can name your function whatever, doesn't have to be in same exact way as I provided

#

My pleasure :)

covert carbon
#

where it says myMod.myFunction

#

do I have to replace that for my code

hollow current
#

yes. In my function I name it Frogshire.InventoryContextMenu = function(player, context, items)

#

but it can be anything, like just myFunction

#

I just prefer the first approach because it gives me more freedom in case I need to use the function somewhere else, and I kinda got used to it. Just, in case you decide to use it, make sure to initialise the table

covert carbon
#

So could it look like this


ISWorldObjectContextMenu.fetchSquares = {}

RussianRoulette.inventoryfulfilled = function(player, context, items)
  print("hello!")
end

Events.OnFillInventoryObjectContextMenu.Add(RussianRoulette.inventoryfulfilled);```
hollow current
#

Yes, but you'll have to initialise the RussianRoulette table

#
require 'ISUI/ISWorldObjectContextMenu'

RussianRoulette = RussianRoulette or {}

ISWorldObjectContextMenu.fetchSquares = {}

RussianRoulette.inventoryfulfilled = function(player, context, items)
  print("hello!")
end

Events.OnFillInventoryObjectContextMenu.Add(RussianRoulette.inventoryfulfilled);```
covert carbon
#

what table

#

Im sorry im just confused on the whole thing

hollow current
#

so assume your mod contains a lot of functions, and you may or may not want to use those functions across different files, or different variables, etc

#

in this case, you'd do a RussianRoulette = RussianRoulette or {} at the top of each file that your mod uses (and needs such functionality), and whenever you're adding a function, you define it as RussianRoulette.functionName, that way its saved in that table and can be easily called from elsewhere. You probably wouldn't need that with your event function but its a personal preference for me that I got used to it

covert carbon
#

That's actually pretty cool

bronze yoke
#

may as well use modules at that point

covert carbon
#

true

bronze yoke
#

they run faster and pollute less

covert carbon
#

But the issue is still there. I don't understand the proper way to use OnFillWorldObjectContextMenu

hollow current
#

OnFillWorldObjectContextMenu is basically an event that is called when the world right clicks somewhere in the world. When we want something to happen at that event, we define a function for it and add it to the event. So, suppose I want to print a test statement when a player right clicks on the world

RussianRoulette.myFunction = function(player, context, worldobjects, test)
  print("test)
end

Events.OnFillWorldObjectContextMenu.Add(RussianRoulette.myFunction);```
#

honestly speaking I am not sure what the test parameter does but its there in some vanilla code, and used in the function as if test then return ISWorldObjectContextMenu.setTest() end

#

but its irrelevant here so might as well just remove it

covert carbon
#

Oh wait a minute

#

I am talking about OnFillInventoryObjectContextMenu

#

I am sorry

#

I am trying to make it to where you right click an item you have and it gives you a context menu option

hollow current
#

haha its the same logic here, just replace the naming of event and parameters

covert carbon
#

I already have the context menu set up, I just want it to only appear when you click the proper item

hollow current
#
Frogshire.InventoryContextMenu = function(player, context, items)
    -- Iterate over the items and add a context menu option for each one
    for i, v in ipairs(items) do
        local item = v
        if not instanceof(v, "InventoryItem") then
            item = v.items[1]
        end

        -- Only add context menu options for Frogs
        if item:getType() == "Frog" then
          --rest of your code
#

that's a snippet from a mod im working on

#

just edit as needed

covert carbon
#

what do I fill the "context" parameter with? do I fill it with the context menu I set up?

hollow current
#

you can use context:addOption() function to add the menu you set up

covert carbon
#

how would i put multiple items in the "items" parameter

cobalt fiber
hollow current
#

for example

firstOption = context:addOption("First Option", parameterToPass1, functionToExecute, parameterToPass2)
secondOption = context:addOption("Second Option", parameterToPass1, functionToExecute, parameterToPass2)```
covert carbon
#

is that " ` " purposefully at the end of the first line?

hollow current
#

nope was a mistake, removed haha

bronze yoke
covert carbon
#

imma try out my own script rq

cobalt fiber
#

Hmm I see, that runs faster because it don't mess with the global environment right?

bronze yoke
#

yeah!

covert carbon
#

so like this @hollow current

local secondOption = context:addOption(player, roulettecontext, Revolver_Long)```
cobalt fiber
#

Cool!
I'll try to implement it on my files

#

I don't need to specify if it is in the client/server/shared folder?

hollow current
#

hmm not quite. You failed to define the text that'll show on the buttons

#

if I want a button that has a text of "Button 1", and when clicked, it calls "myFunction", and passes to it the parameters "player" and "frog", the code would be:

local firstOption = context:addOption("Button 1", player, myFunction, frog)```
covert carbon
#
local secondOption = context:addOption("Play Russian Roulette",player, roulettecontext, Revolver_Long)```
hollow current
#

yes looks alright, assuming the roulettecontext is a defined function that takes two parameters

covert carbon
#

how would I make it take two

hollow current
#
function roulettecontext(player, revolver)
  print(player)
  print(revolver)
end```
covert carbon
#

okay

hollow current
#

what exactly are you trying to do? Maybe I can assist you better

covert carbon
#

Im making a russian roulette mod. I have suceeded in making a context menu and a timed action that caused a person to die. My issue now is that I want the context menu option to only appear when right clicking on a revolver

hollow current
covert carbon
#

what is "i" and "v" in that code

#

would this work

    -- Iterate over the items and add a context menu option for each one
    for i, v in ipairs(items) do
        local item = v
        if not instanceof(v, Revolver_Short) then
            item = v.items[1]
        end

        -- Only add context menu options for Frogs
        if item:getType() == Revolver_Short then
          --rest of your code```
hollow current
#

the i represents the numeric index of the item (since we're looping over the items table)
v represents the actual item

covert carbon
#

so would my code work?

hollow current
#

and no this most likely won't work cause first:

if not instanceof(v, Revolver_Short) then

You should be checking for InventoryItem instance (or whatever instance the object you're looking for is, but most likely will be InventoryItem). It's not something unique for each item

bronze yoke
#

btw, ipairs is bad practice

#

it's just a for loop with overhead

covert carbon
#

albion can I ask something rq

hollow current
bronze yoke
#

just using a for loop

covert carbon
#

btw its getting late so im going to bed after this question

bronze yoke
#
for i = 1, #t do
    v = t[i]
end
```is the exact same as ipairs
#

but runs faster

#

with how slow kahlua stdlib is it can be more significant than you'd think

hollow current
#

I see. Idk why i got used to the ipairs practice, maybe some initial copy-pasting when i first started modding lol

covert carbon
#

earlier, you had said to use OnFillInventoryObjectContextMenu for what I wanted to do. I do not get how it works. I looked at it on the main site.

    -- Your code here
end

Events.OnFillInventoryObjectContextMenu.Add(OnFillInventoryObjectContextMenu)```
#

this is the example it gave

#

I do not understand the example

bronze yoke
#

yeah, the wiki is really just showing what an event looks like and not how to use this specific one

covert carbon
#

So how would I use OnFillInventoryObjectContextMenu to make my context menu appear when I right click a specific item

bronze yoke
#

the usual method is to check if your item is in items, then add your option to the context menu which they seem to have called table

covert carbon
#

Do you have an example of this I could use?

bronze yoke
#

i do but i can't get it right now unfortunately

covert carbon
#

๐Ÿ˜ฆ

#

understandable

#

I wont bug you about it lol

#

but quick question

#

am I required to use the parameters in OnFillInventoryObjectContextMenu?

#

Or can I just leave it as ()

late hound
#

Late reply, but feel free to message me with any questions that you may still have.

bronze yoke
#

you're not required

hollow current
#

my assumption is that worldobjects' "unique identifiers" are dynamic between each world restart

bronze yoke
#

ohh, is the world object a dropped inventory item??

#

i didn't know those behaved differently but i wouldn't've been so adamant that it should work if i knew that

hollow current
#

erm yes

#

my bad, should've probably clarified further haha

#

thanks for your attempt to help though. Much appreciated :)

tardy wren
#

I need a piece of code executed with a delay, for example 10 seconds. It's related to networking, and I want to avoid a race condition with the required data arriving after the trigger(sandbox options, patching a method that sends them to server and want to make sure I update my lua table with those AFTER they arrive at the server, not before)

turbid crypt
# covert carbon ๐Ÿ˜ฆ

If I can ask, what background do you have in coding various things? I'm trying to just be aware of how to work all the lua stuff because I'm aiming for a small server but I'm legit on the edge of my seat watching the russian roulette stuff shake out. I've got some crappy HTML experience and a close friend that's talked java into my ear for a few years, but nothing else

mild tundra
#

Core of my first mod is done, thanks for the helpp

#

Time to make it pretty

uneven mauve
slow graniteBOT
#
22gaugeweldablesteel has been warned

Reason: Bad word usage

uneven mauve
tranquil kindle
#

Is there a function to check how much rounds are in magazine?

vagrant valley
#

Weapon condition indicator

#

Or in vanilla you can hold R

tranquil kindle
#

No, i mean like code so i can get ammo count from magazine and use that for something i work on. My goal is to create recipe that as a result has magazine that is fully loaded already - for flamethrower so i dont have fire"bullets" in my inventory and have to reload that flamethrower tank each "fire bullet" at a time.

crystal terrace
#

is it possible to grab nearest door from player location?

#

in code

worthy sparrow
crystal terrace
#

Ty

worthy sparrow
crystal terrace
#

IsoObject is the cell right?

#

Or anything above the tile

worthy sparrow
#

if you have the cell you can do IsoObject(cell)

#

and you'll get the object

crystal terrace
#

But what exactly is object? Is it anything above tile or cell?

worthy sparrow
#

^ wrong link, corrected it

crystal terrace
#

Ty for the resources

worthy sparrow
#

IsoObject is like the base class for everything, furniture, containers, windows, doors ...

crystal terrace
#

Ah everything is an object

#

Should be enough to get started

worthy sparrow
#

yeah, and if you want just the door then you can do IsoDoor and pass IsoCell into it

crystal terrace
#

I'm assuming I can grab cell once I have the player.

worthy sparrow
#

not sure what you will get by getCell on player but worth trying

#

you can get player X,Y,Z then iterate in X-5, X-4, ...,X+4, X+5, same with Y and Z checking cells if they are doors

#

maybe there is a smarter way to do this

crystal terrace
#

aight

mild tundra
#

Probably should have asked this way earlier but how do I know what should be written where

sonic needle
#

those sure are words

mild tundra
#

Like, if I run door:setLocked(false) for a vehicle, should it be for the server, or client, or should i just throw it in shared

tepid dawn
#

because you'll need the server to know "that car" is locked

#

if you run it on client i'm not sure it will be locked for other ppl

cobalt fiber
#

I use it on client for example

#

The best way to figure things out really is testing drunk

tepid dawn
cobalt fiber
#

Yeah stressed

#

Asked albion that same question a few days ago, and she told me that there is even client side code on the server folder ๐Ÿคทโ€โ™‚๏ธ

covert carbon
#

I know that makes it hard to explain stuff to me but so far I would say i've come a long way with my code especially since it's my first time.

#

Looks like we are in the same situation

#

I did have an html class before and had to code a website but the class was crappy

mild tundra
covert carbon
#

What are ipairs?

#

Would this code work in checking my inventory for a revolver?

    if Revolver.isInPlayerInventory() then
        Add(roulettecontext)
    end
end```
nimble yarrow
#

@covert carbon i found a Russian roulette mod on the zomboid steam workshop, it might be worth subscribing, and taking a peek at, to see how it was done over there

covert carbon
#

I would but at that point it feels like im copying the mod

#

Im fine with looking at other mods unrelated to russian roulette

reef portal
covert carbon
#

What is isoplayer? I never fully understood it

reef portal
#

its like indie stones contanier for a player

#

its what they pass around for most of their events and functions related to player characters

#

you can call those methods using the : operator

covert carbon
#

alright thank you

nimble yarrow
#

There's something in programming called 'inheritance'.

for example, Animal -> Mammal -> Dog

It's the same for player. IsoObject -> IsoMovingObject -> IsoGameCharacter -> IsoLivingCharacter -> IsoPlayer

reef portal
#

you may need to mess with the code a bit to get it to work but that example should work otherwise lol

tawdry solar
#

how could i make a teleportation system to items like this

mellow frigate
tawdry solar
#

how could i

crystal terrace
#

quick questions how are all the different functions for any action are called? I see the function definition but not sure how it's being called upon

fast galleon
#

One is called from AnimEvents

#

a few from the action queue, but those are mostly inherited and never changed.

tawdry solar
#

in what

#

who the fuck ghost pinged me

bronze yoke
blazing mica
#

im trying to make an addon to true music, but the youtube video im following is out of date, since then the link on the true music steam page has changed from a google drive to a yandisk, anyone know if theres a way to find the original google drive?

gilded hawk
#

What is the simplest and mod-compatible way to add text to an item's tooltip?

crystal terrace
covert carbon
#

would if Revolver:isInPlayerInventory() then work?

vivid coral
#

Greetings! When editing the spawnpoint.lua files, do I have to specify occupation spawn points? I'd like the pool to be the same no matter what without having to copy and paste the list for each occupation

crystal terrace
#

could try and print in console

bronze yoke
#

i think it falls back to unemployed?

#

not exactly sure but the vanilla spawnpoints files don't list every occupation

#

so it must fallback to something

crystal terrace
vivid coral
#

good observation, i'll give that a try. ty albion!

bronze yoke
#

events are just triggers

crystal terrace
bronze yoke
#

sure

crystal terrace
#

wait nvm thats a stupid question

uneven mauve
covert carbon
#
    -- Add a context cption
    local option = context:addOption(getText("ContextMenu_Play_Russian_Roulette"), player, russianroulettegame)
end

function inventorycheckupx()
    if Revolver:isInPlayerInventory() then
        Add(roulettecontext)
    end
end``` Could someone tell me if I made a mistake with this?
fast galleon
covert carbon
#

The context menu option will no longer pop up even when my inventory does have a revolver

fast galleon
uneven mauve
neon bronze
covert carbon
#

what do you mean?

neon bronze
#

how does your second function know what Revolver is?

fast galleon
covert carbon
#

I thought that it was defined as Revolver in the item_weapons file

neon bronze
#

Revolver is a variable here

#

or atleast will be treated as such

#

a variable which has no value will cause you errors

crystal terrace
covert carbon
#

so how would I define Revolver as the revolver weapon?

neon bronze
#

i dont know if this ok but smth like this could work

local Revolver = InventoryItemFactory.CreateItem("Base.Revolver")
if Revolver:isInPlayerInvenory() then
  --here your code
#

given it will only check for the base game revolver

covert carbon
#

would local Revolver = Base.Revolver work?

fast galleon
fast galleon
#

Also scripts in multiple places have global functions that are called by name.

covert carbon
neon bronze
#

lua cant access stuff that is defined in the .txt script files

#

you'd need to pass it through certain constructors to get a reference to those items but not those items themselves

#

hence the InventoryItemFactory

covert carbon
#

Where can I find a doc for InventoryItemFactory? I know pz has a site for lot of its code, is it in there?

neon bronze
covert carbon
#

another bookmark in the endless series of bookmarks

crystal terrace
#

i was looking at actions when i asked that questions as most files were only declaration of all sorts of function and because i wanted to see if there's any file or whatever exactly calling these functions. Idk much about how stuff works so mostly just exploring to get somewhat idea of what moves what.

sage eagle
#

How hard would a mod that makes you get knocked out from car crashes be

unique roost
#

how can I mod the startup audio?

sage eagle
#

It wouldnโ€™t be for long

unique roost
#

where do I look and how do I start

bronze yoke
#

i don't think they're aiming to create an item

sage eagle
#

Check YouTube my man

#

As I was asking

unique roost
#

Looking thru pins

sage eagle
#

It seems like being knocked out for too long would result in zombies just killing you

#

But it would be funny to get knocked out long enough to get a near death experience

#

So again, how hard would it be to make players that experience car crashes get knocked out for an in game 5-10 minutes

#

Honestly if someone were to do that, it would be suitable for other injuries too

covert carbon
#

Does Add(roulettecontext) work when I want to execute my rouletteconext function?

sage eagle
#

Like when someone experiences a lot of pain, they can go into shock and, ultimately, pass out

fast galleon
#

sound fun

sage eagle
#

The mod idea?

#

Or are you talking to them

fast galleon
#

injuries that make you "knocked out" and status effects that make you dizzy.

#

Dizzy would walk in wrong direction, fall and perform weird actions ๐Ÿค”

timber crane
#

Are there still no mod yet to add npcs on MP? Really like the Superb Survivor but me and my brother plays together

sage eagle
#

I canโ€™t really develop mods but how long would something like that take you

bronze yoke
#

npcs can't be rendered in multiplayer

sage eagle
#

I wanna commission someone to make 2 mods I had ideas for

bronze yoke
#

it just can't be done right now

timber crane
sage eagle
#

@fast galleon do you take commissions

sage eagle
#

Damn

#

They only take PayPal

covert carbon
#

It's been three days of coding I might give up if this doesnt work

#

This look good? ```local function OnFillInventoryObjectContextMenu(playerIndex, Play_Russian_Roulette, items)
local roulettecontext = function(player, context, worldobjects, test)
-- Add a context cption
local option = context:addOption(getText("ContextMenu_Play_Russian_Roulette"), player, russianroulettegame)
end
end

Events.OnFillInventoryObjectContextMenu.Add(OnFillInventoryObjectContextMenu)
Events.OnFillInventoryObjectContextMenu.Add(roulettecontext)

gilded hawk
#

Is there an event for when the server fills a player owned container after a server restart?

covert carbon
#

Alright I will. Thank you

#

Honestly there is a lot of lua stuff I haven't learned yet. Probably good to start there

#

Does anybody reccomend anywhere I could learn java that would help with modding?

neon bronze
#

Java is not needed for modding pz

fast galleon
#

some functions you need here: getSpecificPlayer(playerIndex):getInventory() then you'll need to check if you have the specific item you want.

covert carbon
fast galleon
covert carbon
#

Thank you for all of this help

#

I'm probably going to take a break with modding so I can focus on actually learning some stuff from coding I missed

#

Probably return in a few days

hollow current
#
{
    recipe Make a Frogshire Pond
    {
        Stone=15,
        BucketWaterFull=2,

        Result:Frogshire,
        time:50.0,
        Sound:EmptyPan,
    }
}```

Any idea why this Recipe is created immediately?
#

also why isn't the BucketWaterFull being "used up" when the recipe is created, i didn't add the "keep" keyword o-o

sage eagle
#

@covert carbon is that a Russian roulette mod in the making?

covert carbon
#

Taking a break. I realized I am super underprepared to do coding so I am taking some lessons before I continue

#

Should be ready to come back to the mod in a week. Sorry to disappoint

sage eagle
#

Is this a personal idea or did someone ask you to make it

#

It sounds like a cool idea

#

Always wanted a way to bet in Project Zomboid

#

And this would be to ensure that no one โ€˜cheatsโ€™

covert carbon
#

It was a personal idea of mine

#

I liked to use zomboid mods and one day I was just "lets try it out"

hollow current
crystal terrace
hollow current
#

I double checked my cheats, and I have them turned off

crystal terrace
#

that happened with me when i set time to 5 units but doesnt seem to be like that in your case

fast galleon
#

@hollow current
Capitalization

hollow current
#

it was at 10 first, bumped to 50 and same result so idk

#

oh.

#

righttt

#

lol thanks

bronze yoke
#

recipes are the only case sensitive script format drunk

gilded hawk
crystal terrace
#

is IsoCell representing complete map? or just a small portion on it?

halcyon marlin
bronze yoke
#

it means it belongs to another client

#

zomboid's networking distributes control of the zombies between the clients to save server performance and to reduce perceived lag

#

zombies usually belong to the client they're currently targeting

halcyon marlin
#

thank you!

elfin stump
#

I have a context menu that comes from OnFillInventoryObjectContextMenu.Add that I have been able to get to behave how I want. When I click it I would like to run a function or a timed action (I am doing both for different things). Does anyone know the mechanics of connecting something like this to a context menu? It seems to me that the context menu itself is a table that might have somewhere to put that in the table itself, but I am unsure where. Any ideas or reference docs?

cobalt fiber
#

Thought that was a lag issue drunk

sage magnet
#

How can I add an item as loot from a zombie ? Are zombies in the ProceduralDistributions file ? I can't find them

cobalt fiber
#

the event you said is triggered when the user right-click something in the inventory panel

neon bronze
#

You just create a new timed action instance and then add it to the queue

#

Simple as that

elfin stump
elfin stump
cobalt fiber
#

function ISContextMenu:addOption(name, target, onSelect, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10)

#

this is from the ISContextMenu.lua file

elfin stump
#

Nice! Thanks, that is what I was looking for

#

onSelect then is the function you want to pass?

#

Ohh wait, no

neon bronze
#

Yes it is

cobalt fiber
#

when addind a option, the onSelect param is the function you want to execute

#

BE CAREFUL when setting up the function

elfin stump
#

Okay, let me double check here

neon bronze
#

Param2 and so on are the parameters you can pass on it

#

But you need atleast one

crystal terrace
cobalt fiber
#

because the first param that the function receive is the target param

#

then after is param1, param2 and so on

#

(I made that mistake myself drunk )

sage magnet
crystal terrace
#

should be something like "malezombieinventory"

sage magnet
#

Ctrl + F says there is no results for "zombie"

#

That's why I'm confused

crystal terrace
#

try male

sage magnet
#

no results for male and inventory

elfin stump
# neon bronze But you need atleast one

Okay so am I understanding right that you need to pass this 4 parameters instead of 3? name, target, function, firstParameter - I had been passing three, and the function is firing on the right click before clicking on the added option, is that because I am missing the parameter?

crystal terrace
#

let me check

elfin stump
cobalt fiber
sage magnet
cobalt fiber
#

I've never seem a option trigger instantly when you rightclick

elfin stump
#

Okay I will need to revisit my code. Right now the function passed into onSelect is firing on my right click in the inventory menu. Then when I click on the option in the context menu, nothing happens. There must be some issue with how I am calling it.

cobalt fiber
#

how you passed the function?

#

can you paste the line here?

crystal terrace
elfin stump
#

Events.OnFillInventoryObjectContextMenu.Add(functionHere) - is what I am using, then in that function I am running local option = tbl:addOption(getText("Action Name"), player, functionHere(player))

sage magnet
cobalt fiber
#

tbl:addOption(getText("Action Name"), player, functionHere(player)) here is the problem

#

you're passing functionHere(player)

#

should be functionHere

elfin stump
#

ahh yep thank you

crystal terrace
cobalt fiber
#

you need to send a pointer to the function

#

not call it

elfin stump
#

got it, yeah I have run into this one before in LUA I forget about that sometimes

cobalt fiber
#

when you put the () there, you are calling it

#

thats why it's running when you rightclick

cobalt fiber
elfin stump
#

So then the param1 param2 param3 is the send parameters to taht function since you cant (call it in here) right?

cobalt fiber
#

yes

elfin stump
#

In roblox actually haha

sage magnet
cobalt fiber
#

if your function is

funtion something(player, door)
end

you need to do addOption(optionName, player, something, door)

crystal terrace
#

i havent tried it but should work yes, dont forget to do require WorldItems/Distributions at top

sage magnet
#

ok thank you

crystal terrace
#

also try not to name your file same as vanilla

cobalt fiber
elfin stump
#

okay got it, I understand the flow now I think. I am going to spent some time on this. Thank you @cobalt fiber @neon bronze

cobalt fiber
#

you're welcome spiffo

sage magnet
elfin stump
fast summit
#

Not sure if anyone would be willing, I need someone to look over my lua script and help me figure out what's wrong with it ๐Ÿ˜ญ I've been STRUGGLING XD

sage magnet
#

I have to use the item name in the spawning option not the "clothingItem" thing right ?

fast summit
sage magnet
#

I use it actually but it's not set as defaut so rip

fast summit
#

aahh okay, lol

sage magnet
#

and I think you should send your LUA code so someone can look at it even if you're not there

vagrant valley
#

I use the regular notepad too

#

Cause im lazy

fast summit
fiery pecan
#

hello. It's me, the lurker.
So I've got a question: Is it possible to lock certain vehicle skins behind a sandbox option?


Events.OnInitGlobalModData.Add(function()
    if SandboxVars.STEV.VCars == true then
        ScriptManager.instance:getVehicle('CarNormal'):Load('CarNormal', '{skin {texture = vehicles/vehicle_rosewoodpolice,}}')
    end
end)

This seems to return a big fat "Texture not found!" in the log when I change the vehicle's skin to the added one (it gives me the option), but doesn't tell any info on what the unfound texture is.

vagrant valley
#

Is there a reason why putting the tag FishingSpear on a non spear weapon turns it into a regular fishing rod?

fast summit
#

So, I'm attempting to make a mod that, among other things, adds in several items in order to perform blood transfusions and blood draws that give/take health.

I would like to be able to give/take blood from other players and/or myself.

The main thing I'm struggling with at this time is getting my custom UI menu options to show up.

fast summit
snow path
#

What do you guys use for texturing UV Maps?

crystal terrace
#

there's GIMP

vagrant valley
#

If you're just doing basic painting you can do it in blender itself

crystal terrace
#

in order for me to get square, i need x and y coords. Is there a way to grab em maybe something related to player can help?

covert carbon
#

How do I run a script in notepad++ without using zomboid? I am testing out code but it isnt for zomboid

crystal terrace
covert carbon
#

Would it be any bad if I were to use an online IDE?

vagrant valley
#

Any IDEs will work

covert carbon
#

alright thank you spiffo

novel barn
#

I'm having issues creating a drainable item from a bag that has more than one texture choice. I have the bags as written below. When I add both in debug the dirt bag is missing an icon and when I try to drop it on the ground it throws an error: ISDropWorldItemAction.lua line # 62 (and # 67) attempted index: getWorldItem of non-table: null I think the game is struggling with my dirt bag having IconsForTexture Does anyone have ideas why this item fails but other new items without IconsForTexture work?

item Bag_Schoolbag
{
    DisplayCategory = Bag,
    WeightReduction    = 60,
    Weight = 1,
    Type = Container,
    Capacity = 15,
    DisplayName = School Bag,
    IconsForTexture = Backpack_Black;Backpack_Blue;Backpack_Spiffo,
    CanBeEquipped = Back,
    OpenSound   =   OpenBag,
    CloseSound   =   CloseBag,
    PutInSound   =   PutItemInBag,
    ClothingItem = Bag_SchoolBag,
    BloodLocation = Bag,
    RunSpeedModifier = 0.97,
    AttachmentReplacement = Bag,
    ReplaceInSecondHand = Bag_Schoolbag_LHand holdingbagleft,
    ReplaceInPrimaryHand = Bag_Schoolbag_RHand holdingbagright,
    WorldStaticModel = SchoolBag_Ground,
    SoundParameter = EquippedBaggageContainer SchoolBag,
    ReplaceTypes = "DirtSource Bag_Schoolbag_Dirt"
    Tags = _EmptySolidContainer,
}
item Bag_Schoolbag_Dirt
{
    DisplayCategory = Bag,
    Weight    = 1,
    Type = Drainable,
    UseDelta = 0.26667,
    DisplayName = School Bag of Dirt,
    IconsForTexture = Backpack_Black;Backpack_Blue;Backpack_Spiffo,
    RunSpeedModifier = 0.97,
    ReplaceOnDeplete = Bag_Schoolbag,
    ReplaceInSecondHand = Bag_Schoolbag_LHand holdingbagleft,
    ReplaceInPrimaryHand = Bag_Schoolbag_RHand holdingbagright,
    WorldStaticModel = SchoolBag_Ground,
    SoundParameter = EquippedBaggageContainer SchoolBag,
    Tags = _DirtContainer,
}```
rustic shale
#

Aah yes yes seรฑor Gravestench Oppenheimer yes yes it making sense yes yes

bronze yoke
#

getWorldItem of non-table: null usually means it's failing to find an item at some point

novel barn
#

yeah. ๐Ÿ˜ฆ I'm just not sure what I'm missing because the game clearly knows it exists. I know if I remove the IconsForTexture and just assign a standard Icon value it works.

#

But I can't figure out how the default multitextured bags work to replicate the behavior such as hiking bags, tinted duffle bags, and obviously this school bag.

fast summit
hollow current
#

I made a function and added it to the OnFillWorldObjectContextMenu event. Apparently, it works only in debug mode. Any idea why so or what may cause such behavior?

#

if instanceof(object, 'IsoWorldInventoryObject') then returns true in debug mode but not in "none debug mode"

Edit:
When right clicking the item in debug mode (an item dropped on ground), its detected as IsoWorldInventoryObject, however, when debug mode isn't enabled, its detected as just IsoObject. This is causing errors in my code logic

Edit2: as a matter of fact I don't think the item is being detected at all. IsoObject is being printed regardless of where I click

#

Any idea how to fix that?

neon bronze
#

Can you share your code here?

hollow current
#

ah right mb

#
Frogshire = Frogshire or {}

Frogshire.Pond = function(player, context, worldobjects)
    local frogshire
    local playerObj = getSpecificPlayer(player)
    local invent = playerObj:getInventory()

    for _, object in ipairs(worldobjects) do
        if instanceof(object, 'IsoWorldInventoryObject') then
                  --rest of code
end

Events.OnFillWorldObjectContextMenu.Add(Frogshire.Pond);
neon bronze
#

Well it does look correct to me

#

Are you sure you enable the mod when you load in?

hollow current
#

yes if I make it a simple print statement it gets printed in the console

#

the issue is that IsoWorldInventoryObject gets detected when im in debug mode

#

but if i login without debug mode and do exact same thing, its not detected

neon bronze
#

And player is an number?

hollow current
#

should be, but its irrelevant here. Both local playerObj and local invent were added for testing the issue but you can consider them not in the snippet of the code

neon bronze
#

What exactly are you trying to achieve with that snippet?

hollow current
#

I am trying to check if the player right clicks on a specific object that is dropped on the ground

#

the object is an item that is added by the mod

neon bronze
#

Cant really help you with that but it would maybe better to check their item type instead of checking whether they are an IsoWorldInventoryOnject

#

Almost all items on the floor are that so it would be redundant to check for that

hollow current
#

yes well, after I check for IsoWorldInventoryObject I check for its type, the issue is its not even being detected in worldobjects

#

if I loop through worldobjects and print each object, its not there

neon bronze
#

Maybe try right clicking around it? I know the cursor is a bit sensitive about it

hollow current
#

Tried that too

#

the game is just apparently not detecting any kind of IsoWorldInventoryObject-s at all

sonic needle
#

anyone know how to fix massive muzzle flash? search topic has something but instructions hugely unclear

#

and or move the damn muzzle flash?

#

which coord changes y Level?

fast summit
tranquil kindle
#

Should this remove all spawns of those items?

        RemoveItemFromDistribution(ProceduralDistributions.list, "308Clip",        nil, true);
        RemoveItemFromDistribution(ProceduralDistributions.list, "44Clip",        nil, true);
        RemoveItemFromDistribution(ProceduralDistributions.list, "45Clip",        nil, true);
        RemoveItemFromDistribution(ProceduralDistributions.list, "9mmClip",        nil, true);
coarse sinew
#

Has anyone found a solution for when you spawn a custom zombie on a server and they are deleted with the "removing stale zombie 5000 id=" log? I'm trying to fix Soul's Turning Time mod. In SP it works but on the server they are deleted.

mellow frigate
coarse sinew
#

They are spawned server-side, only that the mod is compatible with 41.73, and should be completely rewritten.

mellow frigate
crystal terrace
#

If anyone knows how to grab x and y coords of player? I wanna grab square grid in order to get hold of door or if there's any other way to grab nearest door?

neon bronze
#

:getX() and :getY()

crystal terrace
#

finally i was able to figure out player tile, might need to play with it further in order to grab a door if its there

#

Does anyone know diff b/w IsoChunk and IsoGridSquare?

drifting ore
solemn glade
#

does anyone know of a mod that increases the max level beyond 10 for any given skill?

primal spruce
#

Hey. Whenever build 42 comes out can someone make a black powder firearms mod? That would be super sick to craft and use.

crystal terrace
#

is this correct way to check if an object is not an instance of a class?

neon bronze
#

You need to put ~ infront of iinstanceof

crystal terrace
#

ah oki, ty

crystal terrace
neon bronze
#

Yes its the not operator in kahlua

bronze yoke
#

never found out why

#

doesn't seem to be any checks for it or anything, likely a bug

#

i solved it by getting the square from the first object that was found, and then looping through that square's object list

#
function ContextMenu.OnFillWorldObjectContextMenu(player, context, worldObjects, test)
    local objects = worldObjects[1] and worldObjects[1]:getSquare():getObjects()
    for i=0, objects:size()-1 do
        local object = objects:get(i)
```etc
crystal terrace
bronze yoke
#

you have to grab the squares manually

sage magnet
#

Is there a distribution list or something indicating what zombies can be wearing ? Cause I know where their inventory is, but it doesn't include their clothing.

bronze yoke
#

that's in the clothing xml

bronze yoke
#

~ doesn't have any meaning outside of ~=

neon bronze
#

I am actually stupid

crystal terrace
#

for functions we use functionName:methodName() but how do we get properties/fields of any objects? is there dot operator here as well

tranquil kindle
#

Hello. Could someone help with sandbox settings? I've made that If sandboxsetting box is checked , it removes vanila guns spawns

RemoveItemFromDistribution(Distributions[1], "Pistol",            nil, true);
and all other guns this way aswell
end

And it does work when creating save and playing untill you restart game, then it uses default setting (which is: sandboxsetting unchecked). Using mod to change sandbox settings they still are what they're supposed to, but as said above, they do use default settings, and turning them back on and off does nothing. Its my first time trying to those settings and im not sure what to do.

bronze yoke
#

keep in mind fields cannot be written to outside of debug mode

#

my api doesn't support it anyway but keep that in mind

crystal terrace
#

sweet, thanks

tame mulch
#

:))

crystal terrace
#

it's a feature๐Ÿ˜†

#

is this the correct way to use files from other mods?

neon bronze
#

Yea additionally you can store that in a variable to access some functions from that file

#

Im not 100% certain how exactly that works but you can do that

crystal terrace
#

ah oki got it

bronze yoke
#

that should be correct

#

in the case of my mod you don't need to store it since it doesn't return anything

#

it just needs to be required to ensure that it runs before your file does

crystal terrace
#

makes sense

#

for some reasons it's not updating the northEastSquare even tho you can see in the object stack it's there and on the right hand side is how i tried to access it.

mellow frigate
crystal terrace
#

oh wait might have to restart then i think

mellow frigate
crystal terrace
#

yes im using their mod called AccessibleFields

dark wedge
crystal terrace
#

wow that should work, let me try

#

it works, today has been very productive. And yall been a lot of help, without any insight it almost feels like you're in the dark. Appreciate it๐Ÿ˜„

fast summit
#

Does this look correct for creating a custom context menu option? Or am I v dumb.

*the indentation on this is messed up, but itโ€™s correct on my pc. This is just how my phone decided to indent it.

crystal terrace
#

Also if you do paste try to wrap it inside a pair of three backticks(`),makes it nice and easy to look at ๐Ÿ˜„

fast summit
#

Lmao itโ€™s still all indented wrong ๐Ÿ˜‚

fast summit
sage magnet
#

How do I change zombie clothing ? I know I need to use both clothing.xml and fileGuidTable.xml but that's about it

crystal terrace
#

calling functions without brackets works fine in lua right?

bronze yoke
#

without brackets?

crystal terrace
#

like functionName() or functionName both works?

bronze yoke
#

functionName() calls the function, functionName passes the reference to the function

#

there is a niche case where functions that take one string argument and nothing else can be called as functionName "foo"

crystal terrace
#

ah oki so not cool unless there's one arg

bronze yoke
#

and it has to be a string

#

and it can't be a variable either... it's very niche

#
print "bar" -- this works

local bar = "bar"
print bar -- this doesn't
crystal terrace
#

best to avoid it then until im comfortable with lua

bronze yoke
#

yeah, probably best practice overall to not randomly have different syntax

#

i like using it for requires but that's it

fast summit
#

Okay, I'm home from work and on my pc now. Also, it still requires ISUI/IScontextMenu, it's just up at the very top of the full script

    if not targetPlayer or not targetPlayer:isPlayer() then
        print("Invalid target player")
        return
    end


    if not transfuserInv:contains("FBGEmptyBloodBag")
        or not transfuserInv:contains("FBGiv")
        or not transfuserInv:contains("FBGivTubing") then
--        print("You need an empty blood pack, a 20g IV needle, and IV tubing to perform the blood draw")
        return
    end

    local option = contextMenu:addOption("Perform blood draw", transfuser, function()
        PerformBloodDraw(targetPlayer)
    end)
end

-- Function to show the context menu option for the blood transfusion action
function ShowTransfuseBloodContextMenu(targetPlayer)
    if not targetPlayer or not targetPlayer:isPlayer() then
        print("Invalid target player")
        return
    end


    if not transfuserInv:contains("FBGFullBloodBag")
        or not transfuserInv:contains("FBGiv")
        or not transfuserInv:contains("FBGivTubing") then
--        print("You need a full blood pack, a 20g IV needle, and IV tubing to perform the blood draw")
        return
    end

    local option = contextMenu:addOption("Perform transfusion", transfuser, function()
        PerformTransfusion(targetPlayer)
    end)
end

Events.OnFillWorldObjectContextMenu.Add(function(_player, context, worldobjects)
    if instanceof(worldobjects, "IsoPlayer") then
        local player = getSpecificPlayer(worldobjects);
        if player and player:isAlive() then
            ShowBloodDrawContextMenu(player)
            ShowTransfuseBloodContextMenu(player)
        end
    end
end)

local player = getSpecificPlayer(_player)
if player and player:isAlive() then
        AddContextMenuOptions(player)
end```
crystal terrace
#

omg idk why my file that was supposed to load along iwth client files has disappeared, didnt change much folder is still there and mod is active. Except some changes inside the lua file.ded

terse oyster
#

How would I go about making custom double doors? Would it be along the same guide line as dirk's tutorials or is there a certain way to do it?

crystal terrace
#

might be too exhausted to see what i changed, worked earlier but not anymore.

bronze yoke
#

where does Player come from?

crystal terrace
#

didnt change anything in this one

#

maybe the save is corrupted or something, ill load another one.

#

yep

#

loaded another save and it worked

#

ripped apart all of the functions i wrote, it's always the restart no sometimes you just have to press the button and pray to lord xd

crystal terrace
#

Doors built by players don't fall into isoDoor? im able to destroy already exisitng doors but not much luck with the ones i built

cobalt fiber
#

For "Gate" doors built by the player it is at least

crystal terrace
#

like this?

#

oh i forgot to call it properly i think

#

ill take a break and work on this later

drifting ore
rustic shale
# dusky sleet What?

You're Senor mister Gravestench Oppenheimer right? aka senor Fring, aka Senor Salamanca, aka senor taco, aka senor burrito, ...

covert carbon
#

How do you get the player index? would this not work?
local playerIndex = player:getPlayerIndex()

bronze yoke
#

player:getPlayerNum()

covert carbon
bronze yoke
#

player is nil

#

check where you're getting it from is in scope

covert carbon
#

how would I do that

crystal terrace
#

is there a way to find out what object is this? it's just throwing bunch of errors in my code

crystal terrace
covert carbon
#

The function gets called before my player spawns in the game. Good catch, I will fix that

sleek magnet
#

Does PZ care if a localization is declared but is never used?

bronze yoke
#

no

sleek magnet
#

Cool ty

#

Follow up, is there anything like https://pzwiki.net/wiki/Scripts_guide that goes into more detail about what the translation system supports? Or do you think I'd have to crack open the game's jar to figure that out? All I know is that it supports <br> , I don't know if the modules can have any logic or other markdowns.

bronze yoke
#

i'm not sure if i've seen anything like that, maybe there'd be more information on the translation github repo or in the translation channel in this discord

sleek magnet
#

Thanks, I'll check those out!

bronze yoke
#

i think <BR> creates a bigger newline, and there's also <LINE> which i think literally creates a line...?

#

and then you can use %1, %2, etc if you need something to be inserted into the string

reef portal
sleek magnet
#

Oh wait, never mind.

reef portal
#

ye its not much loool

#

as to actual mark down, you may have to experiment or look at base translations

bronze yoke
#

i don't think i'd've ever worked out <BR> and <br> did different things

sleek magnet
#

I tried looking at a few mods that were translation key pair heavy, like More Descript Traits, but seems like they only utilize br

#

I'm hoping I can color the font somehow. Its gotta be possible because the text renders blue for mod names.

bronze yoke
#

oh yeah i've done that before, let me check how that's done

#

<RED>

#

i'll try and find where these are defined

#

trying to work out what colours are supported would be a nightmare

reef portal
#

yeah

sleek magnet
#

I wouldn't mind whipping up a wiki page and passing it over to Aiteron to add to their guides. Already so much useful information there.

reef portal
#

Red is listed

#

try some other wierder ones, like <LIME> or <Lime>

bronze yoke
#

i was begining to suspect that

#

i don't see anywhere that e.g. <RED> is hardcoded

reef portal
#

theres some lua code called ISUI/ISColorPicker but idk if that is relevant

#

yeah dead end

bronze yoke
#

i honestly don't even know where to start to look for this

#

i was hoping it'd be hardcoded literals since they're easy to find

#

it doesn't seem like the Colors class is involved

#

unless all ui goes through the chat code since that's the only place it's used

reef portal
#

I wonder if Badonn knows

#

weren't they trying to add custom colors on world init, and also doing stuff with tool tips?

bronze yoke
#

i found a whole bunch of clearly related literals in there

#

and nowhere else

reef portal
#

oh

bronze yoke
#

actually it seems to be working backwards, this can generate those tags

reef portal
#

i see

bronze yoke
#

it implies the existence of a <SIZE:num> and an <RGB:r,g,b> (i think i've seen this one before)

trim mist
#

I have been summoned

reef portal
#

Hey Badonn, weren't you trying to do stuff with tooltips and custom colors? we're trying to figure out some localization tag stuff, have you delved into that at all?

#

tho maybe it might've been solved by albion

trim mist
#

I was trying to do stuff with tooltips and custom colors! Dunno about localization tags though, i've not heard that term

reef portal
#

its for different languages/translations

trim mist
#

I actually completed and finished that tooltip rewrite. Thanks @bronze yoke @sour island

reef portal
#

noice

bronze yoke
#

oh it's lua, i found it

#

i was mostly looking around java ๐Ÿ˜…

trim mist
bronze yoke
#

<LINE>, <BR>, <H1>, <H2>, <TEXT>, <CENTRE>, <LEFT>, <RIGHT>, <PUSHRGB:r,g,b>, <POPRGB>, <RGB:r,g,b>, <RED>, <ORANGE>, <GREEN>, <SIZE:small/medium/large>, <IMAGE:? this one looks complicated>, <IMAGECENTRE:? also complicated>, <INDENT:num>, <JOYPAD:complicated :(>, <SETX:num>, <SPACE>

#

when i have a bit more energy to research the specifics i'll write them up as a guide on github

fast summit
bronze yoke
#

i didn't have this issue when i did something similar

#

one issue i did find was that you have to click on the square the player is on, but about half of the player model is going to be hovering over another square because of how tall it is, which doesn't work, so i think i had it search multiple squares

trim mist
#

I need to use a server host to do some beta testing of my mod--anyone know of cheap and quality hosts?

sleek magnet
reef portal
#

check out albions post there\

frank elbow
sleek magnet
#

I imagine Joypad:button is for like "Press ๐ŸŸฆ to eat"

#

So that localization will pull the emojis for the controllers in translating

frank elbow
#

Yeah, shows an image just like the IMAGE one (but of buttons)

sleek magnet
#

I'm curious what the difference between <PUSHRGB:r,g,b>, and <RGB:r,g,b> is

frank elbow
#

PUSHRGB pushes a color onto a stack, which can be popped with POPRGB

bronze yoke
#

oh i see, key is handled separately from the others

frank elbow
#

So it'll only apply to the text between those commands

#

I became unfortunately very familiar with that file while doing chat stuff

sleek magnet
#

Thank you all, this is super helpful.

#

Mods going to be literally 1 line of code but hey, gotta start somewhere.

granite ginkgo
#

Greetings guys, do you have any idea on how to make a script that only allows you to enter a vehicle only if you have a specific item in your inventory? And where should I put this script?

ancient grail
granite ginkgo
#

@ancient grailAnd the lua file would go in the client folder,right?

ancient grail
#

Yes

granite ginkgo
#

thanks!

proper crater
hollow current
#

any idea what the test parameter is here?

myFunction = function(player, context, worldobjects, test)

    if test then return ISWorldObjectContextMenu.setTest() end

end```
#

and what is setTest()

hoary widget
#

Is it possible to give vehicles custom animations? (not asking how to animate or model, just if it's possible and how i'd go about coding it

granite ginkgo
#

Tto get the seat the player is sitting on,should I use onSwitchVehicleSeat?

silent night
#

Hi, quick question.
I want to view .pack file, make changes and repack as mod.
TileZed 32 / 64 is not responding when i am trying to view ui2 pack.
There is any another way to do that nowdays?

worthy sparrow
worthy sparrow
#

Not sure if thats the correct one, thats the lates I have downloaded and it works

silent night
#

@worthy sparrow thank u so much. I was using latest version from forum https://theindiestone.com/forums/index.php?/topic/35239-latest-tilezed-worlded-and-tilesets-april-7-2021/ that i found from og post about tile editing

The Indie Stone Forums

Tiles Tileset images For Windows TileZed + WorldEd 32-bit TileZed + WorldEd 64-bit The 32-bit version of WorldEd seems unable to load all the tilesets due to high memory usage, displaying ??? for some tiles. Linux TileZed + WorldEd 64-bit This was built on Ubuntu 20. TileZed changes: BuildingEd: ...

#

hmm i also thought that I will be able to edit default items icons from this app but it looks like nah.

worthy sparrow
# silent night <@400784396178948096> thank u so much. I was using latest version from forum ht...

no problem, I found that this one is the latest: https://theindiestone.com/forums/index.php?/topic/50425-latest-tilezed-worlded-and-tilesets-march-14-2022/, anyway i was struggling like you when i wanted to get all the item icons

The Indie Stone Forums

Tiles Tileset images These are the same tilesets released on February 16. For Windows TileZed + WorldEd 32-bit TileZed + WorldEd 64-bit The 32-bit version of WorldEd seems unable to load all the tilesets due to high memory usage, displaying ??? for some tiles. Linux TileZed + WorldEd 64-bit This ...

#

You would have to edit them in some external program, export them from the UI.pack and just modify individual ones, then .pack them together

hollow current
#

I am trying to play an animation in a timed action, like so:

self:setActionAnim("Bob_IdleLowSneak")

#

I think I might be doing something wrong cause it shows the "surrender" animation instead, any idea why's that?

silent night
#

@worthy sparrow ah yeah. Do you know maybe that I can use bigger images than 32x32 for items images to achive bigger resolution?

pseudo estuary
#

Anyone down to help me make a mod for a tiktok. Itโ€™s a animation mod and Iโ€™m new to making mods for PZ but I need tiktok content. We can chat and maybe do like a virtual smoke sesh while making it I had to call off work and have time to use later

#

Yo @mellow frigate no way ur here I love ur mods G if youโ€™re the dude Iโ€™m thinking of

mellow frigate
# hollow current I am trying to play an animation in a timed action, like so: ``self:setActionAn...

it defaults to surrender because Bob_IdleLowSneak is not an ActionAnim keyword, it is an animation. you need to use the PerformingAction trigger associated to the ActionAnim instead. look in the according xml file for what is in the place of 'TheValueYouAreLookingFor' <m_Conditions> <m_Name>PerformingAction</m_Name> <m_Type>STRING</m_Type> <m_StringValue>TheValueYouAreLookingFor</m_StringValue> </m_Conditions>

granite ginkgo
#

how to check players inventory for a welding torch?

hollow current
#
<?xml version="1.0" encoding="utf-8"?>
<animNode x_extends="sneakidle.xml">
    <m_Name>sneakIdleLow</m_Name>
    <m_AnimName>Bob_IdleLowSneak</m_AnimName>
    <m_BlendTime>0.40</m_BlendTime>
    <m_Conditions />
    <m_Conditions>
        <m_Name>nearWallCrouching</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>true</m_BoolValue>
    </m_Conditions>
    <m_2DBlends>
        <m_AnimName>Bob_IdleLowSneak</m_AnimName>
    </m_2DBlends>
    <m_2DBlends>
        <m_AnimName>Bob_IdleSneakLow_HBreathing</m_AnimName>
    </m_2DBlends>
    <m_2DBlends>
        <m_AnimName>Bob_IdleLowSneak</m_AnimName>
    </m_2DBlends>
    <m_Transitions>
        <m_Target>sneakWalkLow</m_Target>
    </m_Transitions>
    <m_Transitions />
    <m_Transitions>
        <m_blendInTime>0.3</m_blendInTime>
        <m_speedScale>1.3</m_speedScale>
    </m_Transitions>
    <m_Transitions />
    <m_Transitions />
    <m_Transitions />
    <m_Transitions />
</animNode>```
mellow frigate
hollow current
#

aaah I see. Thanks. Any guide that shows it? Never worked with anims before

mellow frigate
granite ginkgo
hollow current
mellow frigate
# hollow current aaah I see. Thanks. Any guide that shows it? Never worked with anims before

Note that there are 2 layers of animations (that I am aware of): layer 0 is used by java states code and modifies movements/lowerbody, layer 1 is used by AnimAction (~=TimedActions) and modifies the upperbody. You can use a trick for AnimAction to modify the movement/lowerbody, add the following lines at the end of the actions/file.xml: <m_SubStateBoneWeights> <boneName>Dummy01</boneName> </m_SubStateBoneWeights> <m_SubStateBoneWeights> <boneName>Translation_Data</boneName> </m_SubStateBoneWeights>

#

if you want your character to really sneak though, you may wanna use the java state machine instead of TimedActions.

hollow current
#

I am honestly just trying to activate the sneak idle animation during a timed action

#

and the player wouldn't even be expected to be moving through the action, he'd just be idle on that animation till the timed action is over and he'll revert back to normal

#

For context, this is the result I am trying to achieve during a timed action, to give the implication that the player is interaction with that "pond"

#

although in the pic I am crouched using normal crouch method, C

mellow frigate
#

There is already an vanilla AnimAction for low interaction, reuse it

hollow current
#

hmm which one is that?

mellow frigate
#

one has a low parameter

unreal tinsel
#

Thanks for many fun mods :3

mellow frigate
worthy sparrow
hollow current
worthy sparrow
#

Any idea how i can attach 3d object into UI element? like when you see your character in the Info panel

#

I got the item but i have no idea how to put it in the UI

mellow frigate
mellow frigate
hollow current
#

Alright, thanks once again for your help. Really appreciate it :)

granite ginkgo
worthy sparrow
mellow frigate