#mod_development

1 messages ยท Page 173 of 1

tawny depot
#

I want to make a model but it's not working

#

I'd go to the workshop, download a mod that has a working custom model, and see how they did it

#

and then compare and contrast it with my mod to see what's wrong

deft plaza
#

oh I already have a model

tawny depot
#

right, but you said it's not showing up right?

deft plaza
#

right

tawny depot
#

so if you find a mod that has a working custom model you can see how they did it

#

if it's identical it's something wrong with the model file probably

deft plaza
#

well this is my second mod so I'm going off my last mod

#

because my last mod works

tawny depot
#

right, and comparing and contrasting with your current mod, how are the following things different

  1. Location of model declaration
  2. Model declaration
  3. Spawning model
#

check the context of all 3

#

see if it's identical

#

if it isn't see what's different and see if there's a problem along the way

#

otherwise it's probably something wrong with the model itself

deft plaza
#

when I drop it shows up as the icon

tawny depot
#

okay, and you've included your mesh file in the mod?

#

I'm not sure how model creation works I'm just debugging

deft plaza
#

I am confused about mesh and texture and stuff

#

like mesh is the model and texture is the 2d thing

tawny depot
#

like just on what they are?

deft plaza
#

yea

tawny depot
#

Okay so think about it like this right

#

one sec, is texture the icon?

#

Like there, is the texture you've set the icon for the actual item?

#

(just for my own context)

#

eg: Worlitems/CookieBoxFitted, is that the file for the icon

#

wait no

#

my bad

#

my misunderstanding

#

okay from the top lmao

deft plaza
#

the icon is item_CookieBoxImage

tawny depot
#

right, okay

tawdry solar
tawny depot
#

so a mesh is your typical understanding of a 3d model, the only caveat is that it does not store the actual colors/textures on it

#

so essentially you have a plain white model

#

these models typically have material data, these materials are associated with a "texture"

#

these materials grab parts of the texture and apply it to the surface of the mesh

deft plaza
#

oh okay

#

I know the actual model does not hold the stuff

tawny depot
#

right

deft plaza
#

okay

#

so here is what I did maybe its correct

tawny depot
#

is that an image?

deft plaza
#

png

tawny depot
#

so no

ornate grotto
deft plaza
#

oh wait I thought you meant

tawny depot
#

that would be the texture

bronze yoke
#

you need to point to the model in the mesh field

tawny depot
#

@bronze yoke what types of models does PZ use? Like extension

bronze yoke
#

multiple types of fbx and x

tawny depot
#

okay nice

#

@deft plaza so your "mesh" should be a .fbx file

deft plaza
#

got it

#

this is the fbx

deft plaza
#

I did WorldItems/CookieBoxModel

bronze yoke
#

you were showing the texture

deft plaza
#

fixed it I think

tawdry solar
#

this is just cookies?

#

can you add my fav cookie

tawny depot
#

so much trouble over cookies

tawdry solar
#

oats and rasins

deft plaza
tawny depot
tawdry solar
#

what

#

its good

#

nah

#

acc

#

rocky road is my fav

#

top 10 cookies oat tho

deft plaza
tawny depot
#

Having a weird issue with my LUA script

#
function slamDoor()
    print("Smash Window event")
    local player = getPlayer()
    local building = player:getBuilding();
    if (building ~= nil) then
        print("Smash Window: Player is in building")

        --- @type IsoWindow
        local randomWindow = building:getRandomFirstFloorWindow()
        randomWindow:smashWindow()
        print("Smashed Window")
    end
end
#

I am getting a nil value for randomWindow

#

but building is not nil

bronze yoke
#

does the building have a first floor window?

tawny depot
#

I believe so, let me send a sc

#

yep

#

it seems like this call isn't actually working

#

I'll see if I can print some info about the building

#

yeah this is strange

bronze yoke
#

try calling building:CalculateWindows() first

#

i don't think the windows list actually gets populated at all normally

deft plaza
#

alright I'm gonna check if it works

#

nope

red tiger
#

I think this channel needs some specific rules regarding asking for help.

  • Be clear about your issue and provide relevant information when asking. (Nicely)
  • Refusing to share mod code or content that lets others look deeper into issues shouldn't be repeated for the same problems with the same mods.

Posting this because I've seen an uptick in this rude behavior here lately. People don't get paid to help and volunteer it. I'm seeing this issue come up again and figured this would be worth discussing.

deft plaza
#

I was just saying

#

that was random

red tiger
#

If anything, a guideline on how to propose or ask questions / ask for help would really help keep things cleaner and more formal in here.

deft plaza
#

what is bro talking about

novel barn
#

@bronze yoke I figured out what I was doing wrong last night. (in about 3 minutes of course)...

I had this

function HaveEmptyItem()
    local playerInv = getPlayer():getInventory()
    local item = playerInv:getFirstEvalRecurse(predicateEmpty)
    if item then 
        print("found an empty `dirt` bag in player inv")
    else 
        print("no empty bag")
    end
    print("haveemptyitem run")
end

local function predicateEmpty(item)
    return item:hasTag("HoldDirt") and item:getInventory():isEmpty();
end

Events.OnPlayerAttackFinished.Add(HaveEmptyItem)```

the problem is that I needed to define my local copy of predicateEmpty before I called it... So I moved the local declaration up and it's working as expected. ๐Ÿ˜‘
bronze yoke
#

oh yeah, local functions don't get hoisted for some reason

novel barn
#

hoisting. I swear even when I figure my problems out you all teach me something new. I never knew hoisting was a thing in any language.

deft plaza
bronze yoke
tawdry solar
#

i was gonna tell him to come here to ask

bronze yoke
#

i was somewhat familiar with the concept but not the term for it

tawny depot
tawdry solar
#

you told him to go to to tutorial for guns

bronze yoke
tawny depot
#

yep tried that

#

same issue

#

sorry didnt' see that message

red tiger
tawny depot
#

same issue

red tiger
#

Is this in MP or SP?

tawny depot
#

SP

#

all client side

red tiger
#

Hmm

mellow frigate
#

Anyone here knows how to transform a fresh dead body into a skeletton old body ? (from a mod)

red tiger
#

It should be straightforward with client-side.

tawny depot
#

right that's what I was thinking

red tiger
#

Are you checking if the random window isn't smashed?

#

Print the object too.

#

Umbrella should also expose a few things.

tawny depot
#

so the issue isn't that the window is smashed

red tiger
#

Maybe the object needs to broadcast itself updating?

tawny depot
#

the actual randomWindow var is nil

#

in the stacktrace

tawdry solar
bronze yoke
deft plaza
red tiger
#

Yeah that's likely a defunct method. Either that or the first floor might not have any windows.

tawny depot
#

I see I see

tawdry solar
red tiger
#

There's an arraylist IIRC for windows in IsoBuilding.

tawny depot
#

yep!

#

getWindows() iirc

bronze yoke
#

the method is real and implemented and the first floor does have windows

red tiger
#

Do it the normal coder way.

bronze yoke
#

i think there's a non-obvious logic error in the method

mellow frigate
red tiger
#

All you need is a int range and a random instance.

tawny depot
#

yeah looking at the java sources the method does exist and has functionality

red tiger
#

@tawny depot I come from the "Assert everything" tribe in coding.

mellow frigate
#

yes null can be the result

red tiger
#

Saves me hours of debugging.

tawny depot
#

hahaha real

bronze yoke
#

maybe windows on the first floor don't actually have z 0 like the method expects

tawdry solar
#
     model bushcraft
                {
                mesh             = weapons/1handed/Bushcraft,
        texture          = weapons/1handed/Bushcraft,
          scale            = 0.01,
    
                attachment world
                {
                offset           = 0.0000 -0.1660 0.0070,
                        rotate   = -180.0000 0.0000 0.0000,
                }
}

@deft plaza this is what my item code ussally looks like

mellow frigate
#

Hey coolroo are you the one trolling newbies ?

red tiger
#

Those two seconds to perform an if check with error throwing saves lives.

deft plaza
red tiger
#

lol

bronze yoke
#

or maybe certain windows don't get added to the windows list

tawny depot
#

here's the implementation for the code

   public IsoWindow getRandomFirstFloorWindow() {
      windowchoices.clear();
      windowchoices.addAll(this.Windows);

      for(int var1 = 0; var1 < windowchoices.size(); ++var1) {
         if (((IsoWindow)windowchoices.get(var1)).getZ() > 0.0F) {
            windowchoices.remove(var1);
         }
      }

      if (!windowchoices.isEmpty()) {
         return (IsoWindow)windowchoices.get(Rand.Next(windowchoices.size()));
      } else {
         return null;
      }
   }
bronze yoke
#

i'm wondering if maybe certain facings don't get added to the building's list because they're technically on the outside squares

tawdry solar
fast galleon
#

depending where you live, first floor might be z 1

tawdry solar
#

it just broke when i pasted it

tawny depot
#

I think it is a z issue

red tiger
# tawdry solar

That is a format yes. An ancient one but is formatted. I can read that.

tawny depot
#

I'm gonna see if getWindows actually returns a list

tawdry solar
red tiger
#

That pasted code though terrified me.

tawny depot
#

actually shit no can't use getWindows

#

that's a room call

#

and I can't get all the rooms of a building ๐Ÿ˜ญ

red tiger
#

Here. I'll format it my way. I do inline but you can do allman bracing too. (CSharp uses allman, Java uses inline)

deft plaza
tawdry solar
tawdry solar
#

not for the model code atleast

deft plaza
#

dude

tawdry solar
deft plaza
#

for my other code it works

#

I

#

I'm so confused

tawdry solar
#

oh

#

wait

bronze yoke
#

oh my god you're not kidding, there is no method to get rooms from a building except getrandomroom

tawdry solar
#

yeah no

#

my mistake

deft plaza
#

isnt item always supposed to be there

bronze yoke
#

you might be able to grab the rooms vector with the weird field stuff?

tawdry solar
#

it thought it was just the model code

red tiger
#
model bushcraft {
  mesh = weapons/1handed/Bushcraft,
  texture = weapons/1handed/Bushcraft,
  scale = 0.01,    
  attachment world {
    offset = 0.0000 -0.1660 0.0070,
    rotate = -180.0000 0.0000 0.0000,
  }
}
tawdry solar
#

but im sleepy so i forgot

tawdry solar
tawny depot
#

any good info on how I can grab fields? Like what the process is to actually get those

red tiger
bronze yoke
#

it's a nightmare

red tiger
#

So, fun fact: I wrote the vscode extension.

#

I will finish the formatter to use inline and allman as two options.

deft plaza
tawdry solar
#

use my code as a baseline

tawny depot
red tiger
tawny depot
#

@red tiger which extension are you referring to?

bronze yoke
#

you have to loop through getClassField(object, index) from 0 to getNumClassFields(), doing tostring until you find the which index corresponds to the field you want, then getClassFieldVal(object, index)

red tiger
bronze yoke
#

you can hardcode the index but it might explode when the game updates

red tiger
#

Until there was my extension on the market, ZedScript never had any support from modern IDEs.

bronze yoke
#

so you'd have to posix it or generate the correct string to compare

tawny depot
#

atleast knowing I can do it is anice

red tiger
#

Imagine having Regex support in Lua..

#

Yeah pls

#

Please I need my Regex.

bronze yoke
#

iirc the tostring basically returns package.package.class NameOfTheField

red tiger
#

/(please|support|regex|kthx)/

bronze yoke
#

i guess the pattern could just be " fieldname$"

#

that's very simple actually

trim mist
#

Hey @bronze yoke, I have a function hooking question

local oldCCPOOMD = CharacterCreationProfession.onOptionMouseDown
CharacterCreationProfession.onOptionMouseDown = function(self)
    oldCCPOOMD(self);
    refreshTraitCosts();
end

Why does this run immediately after my mods load, and why does it give a

attempted index: onOptionMouseDown of non-table: null
```?
#

I know you and @novel barn have been collaborating a little bit on variable function costs. I'm trying to implement it in my code w/o bugs

bronze yoke
trim mist
#

lmao

bronze yoke
#

move your code to the client folder or put it behind OnGameBoot

red tiger
#

You can also do OnGameBoot and perform the operation then.

bronze yoke
trim mist
#

thank you both

red tiger
#

I entirely eliminated the need for Lua require for PipeWrench because it's so crazy and such a mess.

bronze yoke
#

it's shared -> client (if applicable) -> server, vanilla loads first then mods for each stage, and trying to force a file from another folder to load in an earlier stage does nothing

red tiger
#

PipeWrench literally re-inits itself using a custom event with padded code on rendered Lua.

#

Yeah. I've had problems with require basically forever. =/

#

Thanks for the info.

bronze yoke
#

i still don't really know quite how cross-folder requires behave, all i know is it's annoying

#

the client/shared/server folders that is

drifting ore
#

is only lua used for modding or can java be used too ?????

bronze yoke
#

java mods are not popular at all but yeah you can java mod

#

they require manual installation

deft plaza
#

I still don't see what's wrong with this code only thing I know is its showing the icon when dropped

bronze yoke
#

if you don't care about the parameters you can just grab and pass them with ...

deft plaza
#

well one code

bronze yoke
#

these need to match

tawny depot
# bronze yoke that's very simple actually

would something like this work?

-- Function to find the index of a specific field in a class and retrieve its value
function findFieldAndGetValue(object, fieldName)
    local numFields = getNumClassFields()
    
    for i = 0, numFields do
        local fieldStr = tostring(getClassField(object, i))
        local packageName, className, fieldNameStr = fieldStr:match("(%w+)%.(%w+)%s(.+)")
        
        if fieldNameStr == fieldName then
            return getClassFieldVal(object, i)
        end
    end
    
    return nil -- Field not found
end

-- Example usage
local object = -- Your object here
local fieldName = "NameOfTheField"

local fieldValue = findFieldAndGetValue(object, fieldName)
if fieldValue then
    print("Field value:", fieldValue)
else
    print("Field not found.")
end
deft plaza
bronze yoke
deft plaza
#

Should I change Model cookiebox to cookie box model

tawdry solar
bronze yoke
#

it doesn't matter which way around it is, they just need to match

bronze yoke
#

WorldStaticModel is you telling the game which model script you want to use, it needs to be the name of a model script

tawdry solar
#

his model script is inside the code

red tiger
#

I have physical deadzones in my brain from learning all of this for TS support.

bronze yoke
#

sometimes you can't require files from other folders though

#

and i'm not really sure what the rules are

#

things like 'what if there are files matching the path in multiple folders' need to be examined at some point too

red tiger
#

A rule for everyone in here is do not put anything other than constant, primitive values outside of an event wrapper. If the code isn't fired from an event, you're setting yourself up for grief and a lot of time figuring out this is the reason why.

tawny depot
#

@bronze yoke when I'm calling getClassField, what am I calling that on?

#

If I have a reference to ISOBuilding, it doesn't have a method with that name

#

so I imagine it's something different?

bronze yoke
#

wdym it doesn't have a method with that name?

#

what line is complaining?

tawny depot
bronze yoke
#

getClassField(building, index)

#

they're globals

tawny depot
#

ahhh I see

#

thank you

bronze yoke
#

wait, can you even tostring a field without debug mode stressed

tawny depot
#

nous allons voir

bronze yoke
#

fields are only exposed when debug is on, you can still pass the object itself but i don't know if it'll like tostring

#

you might be forced to hardcode it if so

tropic smelt
#

how to create clothing mods without melting my brain in the process?

tawny depot
#

that is a broad question

red tiger
tawny depot
#
public final Vector Windows

So this field is a vector, what is the equivalent lua type?

#

is it just vector?

#

I've seen a lot of Vector2 but this is just a straight vector

bronze yoke
#

vector

#

i did check when we were initially discussing it because i'd never seen it either, and it is exposed

tawny depot
#

Awesome! thanks

#

so this is odd lmao

#

When I load the windows, I get an object which is []

#

I call computeWindows() before

#

and this is in the console

ornate grotto
#

guys how do i make so player cant move and play animation

trim mist
red tiger
#

instance:method() === Class.method(instance)

sharp minnow
#

Does anyone know what isUseless is meant to do? I'm trying to make docile zombies based on a time bound set of rules, but i'm making an assumption about what isUseless does.

red tiger
#

Could be a defunct flag in IsoZombie.

mellow frigate
#

How to break the game (cannot start) 101 1/ Add a custom mod to your default start. 2/ In its sandbox options create a double parameter with a default value out of its min/max valid range. 3/ Realise how stupid I am.

trim mist
#

Yeah that was the very first error I had coming into here lol

red tiger
#

I wonder.. Would TIS get mad if I made a MCP but for PZ?

#

(Minecraft Coder Pack)

#

Asked myself this question for around 7 years but never asked it out loud)

red tiger
#

Basically is a decompiler that applies patches to that to make it compilable. When done, the coder pack compiles only the changes files and forms a patch.

red tiger
#

I've built a patcher like this in the past for other work so I'd know the way to make it.

#

Also was around the MCP devs back then and watched it be made.

#

I'd refuse to make it if I was handed a statement saying there'd be legal trouble for doing it, even though the method to make this is gray-zone territory modding.

#

:D

#

Like MCP had to make statements and IIRC a agreement thing when running MCP to not use it to pirate or maliciously cheat on SMP.

ornate grotto
#

does anyone know how to make like so your character cant move and it plays an animation

bronze yoke
#

that's the sort of thing i was hinting at in the sledgehammer server

red tiger
#

Haha oh

#

Yeah. I could easily make this a reality if this were high in demand.

bronze yoke
#

i think it's perfectly legal, but when you can't afford a lawyer, everything with even the weakest argument of copyright is illegal unhappy

ornate grotto
#

i want to make so player fakely dies and then gets up

fast galleon
ornate grotto
fast galleon
#

I don't think you have same self or self.character in your case

ornate grotto
#

wait there is a player and character and not just player?

ornate grotto
mild venture
#

Hi again! It looks like I've found a solution for teleporting the car. But I am faced with a new issue
getCell():getVehicles() shows only vehicles nearby player. How do I get vehicles from another cell? I have the coordinates

red tiger
#

Check all loaded cells.

#

If you need to check a coordinate with an unloaded cell, load it and check it.

ornate grotto
#

can anyone explain why my script dosent work

ornate grotto
#
                                        InfPla.setInfected(isoPlayer,true)
                    if InfPla.Verbose then print ('InfPla.updateInfected'..p2str(isoPlayer)); end
                InfPla:setActionAnim("MedicalCheck")
timer:Simple(3, function()
InfPla:setActionAnim("MedicalCheck")
                end)
                end)``` medical check is a placeholder anim
tawdry solar
#

maybe if we could see your script

#

ah

red tiger
#

I think you get active chunks from that object.

trim mist
#

:l i'm trying to organize my code, so I moved my event hooks into a new file under the client folder. I'm trying to reference to file and I don't understand what i'm doing wrong lol

#
local ATCreation = require("..shared/NPCs/AnthroTraitsMainCreationMethods")
ornate grotto
trim mist
#

i've also tried to make it a module

tawdry solar
trim mist
ornate grotto
red tiger
#
local world = getWorld();
local cell = world:getCell();
local wx, wy = 1000, 1000;
local chunk = cell:getChunk(wx, wy);
fast galleon
red tiger
#

I think that you're looking for chunks.

trim mist
fast galleon
trim mist
#

!! thank you--I hadn't thought of that

mild venture
mellow frigate
#

what Vanilla action is an infinite action ? (timer never ending)

tame mulch
ember crane
#

What is the id of the gas mask?
I tried Base.GasMask but it didn't work

tame mulch
#

Try "Base.Hat_GasMask"

tawdry solar
#

man i fucking love making mods

mellow frigate
ornate grotto
#

who can help me pls, my code for some reason dosent work timer:Simple(30, function() InfectedPlayer:setActionAnim("MedicalCheck") InfPla.setInfected(isoPlayer,true) if InfPla.Verbose then print ('InfPla.updateInfected'..p2str(isoPlayer)); end timer:Simple(3, function() end) end)

bronze yoke
#

isocell is a singleton representing the loaded area

#

the 300x300 mapping cells don't seem to be relevant to runtime

tawny depot
#

So it seems like window loading in buildings is completely unreliable

#

The windows list isn't filled it seems

ornate grotto
#

will anyone help me please

tawny depot
#

Help typically needs more context, not just this doesn't work

#

You should say what's happening, if you're getting an error post it

trim mist
#

entering the page seems fine. But also the code I'm running seems to not work

ember crane
ornate grotto
tawny depot
#

Breaks as in doesn't work?

#

Or breaks and throws an error?

#

Or does it just not do anything

ornate grotto
#

throws error

#

and animation dosent work

tawny depot
#

What does the error say?

ornate grotto
#

look at left down

drifting ore
#

Hey small quick question, i wanted to know if theres a way to extract the player 3d model into blender so i could create a few animations for it

tawny depot
#

Can you paste the line that throws the error?

#

It says line 50

ornate grotto
#

InfectedPlayer:setActionAnim("MedicalCheck")

tawny depot
#

Is InfectedPlayer the name of the variable?

#

Because I see InfPla

#

In other places in your script

ornate grotto
#

i made it infpla now

#

im actually editing a script btw

#

not making it from scratch

bronze yoke
tawny depot
ornate grotto
#

lets try get player ig

#

still dosent wrok

tawny depot
#

Are you reloading the Lua?

ornate grotto
#

yup

trim mist
drifting ore
trim mist
tawny depot
#

There's usually an error that gets posted above the screenshot you sent

#

Like java. ...

drifting ore
tawny depot
#

And then a message

drifting ore
#

plugins required?

bronze yoke
#

ya there's a lua plugin

drifting ore
#

ill have to check that out then

#

love intellij, my beloved

#

new ui is garbage tho

bronze yoke
#

jetbrains ides my beloved

tawny depot
#

IntelliJ is awesome for java & kotlin

drifting ore
tawny depot
#

Other than that, I typically stick to vscode

tawny depot
drifting ore
#

idk, i find it very odd. have only used it so far in mobile programming and im not a fan so far with my course.

tawny depot
#

Have you done much java?

drifting ore
#

in second semester java currently. i love it. most my class love JS, but i cant stand it

tawny depot
#

JavaScript is so bad

#

Second semester first year?

drifting ore
#

i think we just havent really been taught well with the kotlin/mobile. most of it we've just been instructed to follow along so i feel really confused with it

#

nah, 2nd year currently. we did python all first year

tawny depot
#

That'll do it

#

Idk Kotlin was nice when I used it

#

It's simpler java

#

Less boiler plate

#

Inferred types

drifting ore
#

maybe ill have to give it a shot in my free time. im not a fan of mobile programming either way, not what i want to do with my career

#

any good tips for getting into / learning lua? ive pondered trying modding. i look thru here every once in a while

tawny depot
#

Just don't want to spam here lmao

ornate grotto
tawny depot
tawny depot
mild venture
bronze yoke
#

you cannot get vehicles that are not in the cell, the objects do not exist

ornate grotto
mild venture
bronze yoke
#

there is only one cell

#

the cell is a singleton, it does not represent a fixed area, it represents the entire currently loaded area

#

you cannot force squares to load

mild venture
#

Thank you for explaining

bronze yoke
#

in mapping and i think in the save format there are also cells which are 300x300 areas but these don't seem to have any relevance to runtime

mild venture
#

But the cars are stored somewhere in the world. So somehow they can be accessed

bronze yoke
#

on the server they only exist when a player is near enough, and on the client they only exist when you are close enough

tawny depot
#

The player reference

mild venture
#

entry about vehicle

ornate grotto
tawny depot
#

Seems like it

#

Maybe try printing the player variable before the call

#

See if it's null

ornate grotto
#

it isnt null ig, it says fullname:(playername) or smthn like that

red tiger
#

Sorry. Leaving the office. Was in a meeting.

#

@mild venture

#

@tawny depot I kid you not I scrolled so far through the chat history to catch up and I spotted you saying kotlin and freaked out.

#

I'm like who tf is talking kotlin in pz chat?

#

xD

mild venture
# red tiger <@384771595828461578>

Do you have any idea how to get unloaded vehicles? I think i need load bytebuffer of IsoGridSquare using IsoGridSquare:load but i dont know how to get it before ๐Ÿ™‚

bronze yoke
#

you probably can't load unloaded squares

#

it's something a lot of people are very interested in and nobody has worked it out

#

it's best to write your code to expect things to be unloaded and cache data you might need

ember crane
#

What is the simple Holter's id name?

#

Base.SimpleHolster didn't worked

wet sandal
#

Base.HolsterSimple

ember crane
#

Thank you!

mellow frigate
#

Can I configure somewhere that my admin new character does not spawn aumatically with GodMod and Invisible ? flags ?

bronze yoke
#

no

mild venture
lone nest
#

Is there someone here on who knows and understands the TimedActions?
I am trying to figure out how to make an IsoPlayer run rather than walk.
If said person also knows how to do pathfinding, that's even better.

bronze yoke
#

i've done pathfinding

#

it's been a while so give me a second to look over the project that was in

mellow frigate
bronze yoke
#

ya you just use ISPathFindAction it looks like

#

i think there's some luautils to simplify it

#

you can extend the action if you need to modify the behaviour but most of it is handled java side

mellow frigate
#

luautils is only for adjacent squares

bronze yoke
#

in my usage i just needed to remove the ability to cancel it which luckily was lua side

lone nest
#

IsoPlayer:getPathFindBehavior2():update() seems to override the setRunning() flag

bronze yoke
#

it looks like player update resets the flag anyway

lone nest
bronze yoke
#

the player's update method, but that calls the event yeah

lone nest
#

Interesting... I wonder if I can toggle the flag continuously like that...

#

wonder what it will mean for the game performance though

bronze yoke
#

it's the same as ontick

#

setting one flag a tick should be harmless

lone nest
bronze yoke
#

it's the same except that it's only if they moved that tick

#

i think it's even called in the same method

#

ya, it is, but this is much better because this one is called after the flag gets reset

#

if you did it onplayerupdate it would actually be reset immediately afterwards

rancid panther
bronze yoke
#

oohhh that's fun

rancid panther
#

it's good with horror mods, and can create urgency before the permanent blackout in other types of runs

#

you can even customize it to be anywhere between a minor inconvenience to a sudden panic

bronze yoke
#

how frequent is it?

rancid panther
#

by default, 24 hours after a blackout you have a 10% chance of another blackout happening every hour

#

and blackouts last 30+ minutes, with a 25% chance of the blackout ending every 10 minutes

#

i actually recommend lower blackout chance and a really low recovery chance so you have infrequent long blackouts, but the default feels more comfortable for vanilla settings

bronze yoke
#

that sounds fun! have you considered perhaps an option to make them more frequent the closer it is to the power shutoff?

#

i was imagining it'd be fun if you started getting blackouts as a warning sign that it was coming

rancid panther
#

that would be cool. it sounds pretty doable, by just weighing the current date with the permanent date, but i havent worked on it in months. i just uploaded it so it doesnt remain abandoned forever

bronze yoke
#

well thank you for releasing it! i think i'll probably adopt it whenever i next actually play the game

rancid panther
#

that would be like a boolean option where if checked, then blackout chance just becomes (current date / shutoff date) or something right?

bronze yoke
#

yeah, i was imagining maybe having it ramp up or something instead of linear but it'd have to be seen how exactly it would work

rancid panther
#

probably would add a ^2 somewhere for that

#

im sure someone could be inspired by my code to make something similar but less scuffed

bronze yoke
#

when i have less projects i wouldn't mind taking a look at it

#

and maybe it works better as it is, i shouldn't be coming up with 'improvements' before i've even tried it ๐Ÿ˜…

rancid panther
#

who knows! i made it for use with perma night so it can be a bit scarier without having the power off at all times, cuz i like the ambient noises of electronics

#

so i never really tested it with normal settings

mild venture
#

how to construct java ByteBuffer from lua?

bronze yoke
#

not exposed

rancid panther
#

another cool thing about the mod is that the power turning on sound comes from the nearest building, so if you are lost in the forest but there is a building nearby, it could be a lifesaver

#

u can hear it faintly from like 30 tiles away

bronze yoke
#

ooohh that's fun

rancid panther
#

the odds of that happening are so slim tho. usually u already know there are buildings nearby if you are that close to one during a blackout

#

another idea i had originally, that i ended up not doing, was making light flickering stuff

bronze yoke
#

oooh yeah that'd make it so smooth

rancid panther
#

i cut it out so i could upload the mod as-is, but hopefully someone releases a mod that does that so i can recommend it as a pairing

bronze yoke
#

i'm a big fan of pitch black nights so being vulnerable to that even in city centres pre-shutoff would be fun

rancid panther
#

yep! i did add a flashlight trait for 1 point so those who take it wont be left completely in the dark

mild venture
# bronze yoke not exposed

Why do they expose methods that cannot be used? I'm already in a kind of frenzy. Not much more and goodbye zomboid cold

bronze yoke
#

the methods aren't deliberately exposed, they just happen to be public

rancid panther
#

oh another thing i wanted was a setting to make everything that produces light a little dimmer. that would go well with this in a horror-type run as well

bronze yoke
#

that sounds like an undertaking

rancid panther
#

flashlights, building lights, etc. they r a little too bright for horror sometimes

#

i havent played or modded the game in ages, so now im just putting my ideas out there

ancient grail
#

Stop figuring out the "why"
And start learning the "how"

#

You will then be able to understand they "why" i think

Well not eveything

For me xml still doesnt make sense

#

Its probably easier for me than for you cuz im already dumb

bronze yoke
#

pz isn't so crazy once you understand its structure

#

and sometimes you have to accept that some things just weren't made for modders

thin hornet
#

If that may be of any use to anyone, for translation/encoding.
.gitattributes

**/Translate/AR/*.txt encoding=windows-1252
**/Translate/CA/*.txt encoding=iso-8859-15
**/Translate/CH/*.txt encoding=utf-8
**/Translate/CN/*.txt encoding=utf-8
**/Translate/CS/*.txt encoding=windows-1250
**/Translate/DA/*.txt encoding=windows-1252
**/Translate/DE/*.txt encoding=windows-1252
**/Translate/EN/*.txt encoding=utf-8
**/Translate/ES/*.txt encoding=windows-1252
**/Translate/FI/*.txt encoding=windows-1252
**/Translate/FR/*.txt encoding=windows-1252
**/Translate/HU/*.txt encoding=windows-1250
**/Translate/ID/*.txt encoding=utf-8
**/Translate/IT/*.txt encoding=windows-1252
**/Translate/JP/*.txt encoding=utf-8
**/Translate/KO/*.txt encoding=utf-16
**/Translate/NL/*.txt encoding=windows-1252
**/Translate/NO/*.txt encoding=windows-1252
**/Translate/PH/*.txt encoding=utf-8
**/Translate/PL/*.txt encoding=windows-1250
**/Translate/PT/*.txt encoding=windows-1252
**/Translate/PTBR/*.txt encoding=windows-1252
**/Translate/RO/*.txt encoding=utf-8
**/Translate/RU/*.txt encoding=windows-1251
**/Translate/TH/*.txt encoding=utf-8
**/Translate/TR/*.txt encoding=windows-1254
**/Translate/UA/*.txt encoding=windows-1251
wet sandal
#

It would be awesome if there was a way to change a textures magFilter from lua (and I suppose minFIlter as well for completeness)

#

I see the method sitting there on TextureID locked in Java land ๐Ÿ˜ฆ

hollow current
#

I highly doubt that was the issue considering I was trying to test it on a server locally and I was unable to repro the issue, and setCustomName wasn't being used

ancient grail
bronze yoke
#

that was something i suggested when the issue was being discussed

#

i don't really understand why it saves without that flag being set, but if it ain't broke don't fix it

hollow current
#

while you guys are here I have another issue to be discussed

#

lemme send summarization which I already wrote up previously instead of having to write it up again

#

My mod adds a search button for sorting these items in the container according to search criteria based on how close the search term is to the items, for example, I have M4, AK47, 9mm ammo, duck, canned food in the container, and my search term is "cann", it'll iterate over all items in the container, and sort them according to how closely they match the search term, in this instance, it'll sort canned food as first. If there's 0% match with the rest of items, it'll sort them alphabetically.

Anyways that's all just technicalities. My mod was finished and tested and logic works perfectly fine
the current issue is if the container has too many items (which is kinda the point since the mod is only useful if there's a container with too many item), and you use the search function implemented by the mod, the game becomes awfully laggy.

It only gets fixed if you switch back to default sorting mode. I'm not sure if that's a logic issue/optimization issue due to the way I made the code or not

bronze yoke
#

if the game becomes laggy, does that mean you're sorting it every frame instead of just when the search term changes?

hollow current
#
ISInventoryPane.itemSortBySearchContainer = function(a, b)
    local sortedItems = ISInventoryPane.sortedItems
    local sortedIndex = {}

    -- Create a lookup table for the sorted items
    for i, item in ipairs(sortedItems) do
        sortedIndex[item:getName()] = i
    end

    -- Compare the positions of the items in the sorted table
    local aIndex = sortedIndex[a.name]
    local bIndex = sortedIndex[b.name]

    if aIndex and bIndex then
        return aIndex < bIndex
    elseif aIndex then
        return true
    elseif bIndex then
        return false
    else
        -- If both items are not in the sorted table, use the default sorting function
        return ISInventoryPane.itemSortByNameInc(a, b)
    end
end```

I believe this is the part where things get actually sorted
#

This is the whole code

#

now that I look at it I think it might make do with some more organisation tbh

bronze yoke
#

yeah i'm having a little trouble reading this

#

if it lags the game as long as it's active it seems very likely that it's sorting the container at all times

hollow current
#

I don't see or recall having anything in the code that makes the function being executed each frame

#

unless it is there by default in one the functions I am using

#
    self.itemSortFunc = ISInventoryPane.itemSortBySearchContainer```
#

maybe this idk

bronze yoke
#

well it's not really possible to cause lag on frames when your code isn't running, so...

hollow current
#

true

#

it wouldn't be caused by the tables being created would it? I've thought maybe because I am using too many tables or sth but idk I highly doubt it its just around 2/3 tables being created or used

bronze yoke
#

i can't spot it, maybe throw in some breakpoints?

#

or a print or something

#

there must be some part of the code that's running when it shouldn't be

lone nest
#

the character would run for 1 square then reverts to walking.

bronze yoke
#

was that with setting running on every playermove?

lone nest
#

Yeah

bronze yoke
#

that sucks

wet sandal
#

The only way I ever found to programatically control player speed while pathfinding was calling update on the pathfinder multiple times per frame drunk

lone nest
#

tbf, I'm trying to determine if its its an issue because of the isNPC() flag.

#

then again, I shouldn't push too hard on this cause come b42, I expect the stuff to be completely revamped.

#

I suppose, my last resort is simply to fake the "running" by adjusting the move speed multiplier...

jaunty marten
#

u need to fill it only single time when u add new item and after use it in it sort func

#

and extra question how much items do u have?

#

it can cause lags too and will need to use lazy fill

hollow current
#

I have a total of 50-something items in the container. Some items are stacks, so around 20-something unique items. I tried to add a print function to the code as follows:

for i, item in ipairs(sortedItems) do
        sortedIndex[item:getName()] = i
        print(i .. "\n")```
The console is literally spammed by numbers 1-51 being repeated countless times
bronze yoke
#

throw a breakpoint in there so you can see what is calling it all the time

#

i have a feeling this is a bad vanilla logic moment that is being made much worse by a more expensive sorting algorithm

hollow current
#

i guess its not being called all the time. Its just being called once (?)
the process isn't the same for a container of 3 items, it just prints
1
2
3
1
2
3

#

no hundreds of lines

hollow current
#

so i think i may have found something -- the sorting function is called each time you move around, even if its one step

#

probably explains why its so laggy when you're continously moving around the container

#

but looks normal when I just stand still

jaunty marten
#

what's event do u use?

bronze yoke
#

it's hooked into inventory functions

jaunty marten
hollow current
#

^

novel barn
#

Hi everyone ๐Ÿ˜ฆ I'm back on my bullshit and I'm stuck on something that has already been answered. If anyone is willing to take a look at what might be obvious it would be greatly appreciated. I'm following a template to intercept a function that Albion already provided here #mod_development message. I'm trying to do exactly what she suggested but I'm getting the following error on game startup. attempted index: GetEmptyItem of non-table. This fails on line 2 of the provided code.

This is all of my code. Right now literally all I'm trying to do is interrupt ISShovelGroundCursor.GetEmptyItem() to print a line and prove the original function still works as expected.

1 local old_SGC_GetEmptyItem = ISShovelGroundCursor.GetEmptyItem
2 ISShovelGroundCursor.GetEmptyItem = function(self, playerObj, groundType)
3    local oldValue = old_SGC_GetEmptyItem(self, playerObj, groundType)
4    print("attemping to intercept SGC.GetEmptyItem")
5    return oldValue
6 end

My leading theory is that the player doesn't even exist on game start, so of course there's no player table. However I get the same error in game with a valid character.
Thanks in advance to anyone who takes a look ๐Ÿ™‡โ€โ™‚๏ธ

fast galleon
#

Sorting is bad, if you have ~10000 items with same name, the item list viewer gets overflow error.

#truemusicaddons

novel barn
#

Yes!

fast galleon
#

Cursors are usually in server

novel barn
#

๐Ÿ˜ฎ I'll give that a shot!

fast galleon
#

So you need to delay the hook

#

or put it into server folder

lone nest
#

the floating point is what's killing it though from what I can tell; the pathfinding is precision to the thousandth(?) and a "run" animation is far less precise.

sharp minnow
jade chasm
#

hey guys. for distributions that aren't procedural like outfits, shotgun bags, caches, etc. does table.insert(Distributions.list.blahblah.items, "item") work?

humble imp
#

hi guys where can i find any modding documentation? i cant find a single video on youtube

#

cant find anything on google either

fast galleon
# humble imp hi guys where can i find any modding documentation? i cant find a single video o...

Hello, welcome to PZ mod development!
Here are some links with resources to get familiar with making mods for Project Zomboid.
https://pzwiki.net/wiki/Modding
https://github.com/FWolfe/Zomboid-Modding-Guide

GitHub

Guide to modding various aspects of Project Zomboid - GitHub - FWolfe/Zomboid-Modding-Guide: Guide to modding various aspects of Project Zomboid

humble imp
#

thx

fast galleon
jade chasm
fast galleon
#

If it has rolls and items it will work.

jade chasm
#

ok thanks

jade chasm
fast galleon
red tiger
#

Would be nice to make my own tutorial environment.

cinder oyster
#

hey is there any template for a flying vehicle

#

i want to make a jetpack

#

like the one from GTAO

#

like that

#

also, i made a melee weapon earlier and i cant seem to figure out how to get it to be positioned correctly in game. like the rotation is all fucked. could any one help me find the thing to tweak that?

cinder oyster
#

never mind my last msg

#

my stupid ahh was editing the files that weren't in the right folder

drifting ore
#

hey, does anyone know where the file is that defines what the different in-game pills do? i can't seem to find it.

bronze yoke
#

hardcoded in bodydamage

drifting ore
#

ah, figured. thanks.

wet sandal
#

Anyone know if anyone created a automated test framework of some sorts?
Getting anxiety everytime I update Inventory Tetris now...

drifting ore
mild venture
#

Hello! What does BaseVehicle:update method?

cinder oyster
#

also

#

i just uploaded my first ever mod

#

feelin proud of my garbage

lone nest
#

if you feel your work is trash, don't upload it

#

if you don't feel your work is trash, be prepared for other people to trash it because trashy people.

bronze yoke
#

if you're feeling proud then it's not garbage x3

wet sandal
#

They find every little issue.
Its best to ignore them, you'll drive yourself mad if you care too much.

lone nest
#

^

wet sandal
#

Or fix everything in a mad flurry of rage

lone nest
#

the ignorant fools don't understand how hard it is to work with PZ Events, never mind APIs

#

the better people learn to ask questions, which can be helpful and put another perspective on problems you ran/run into.

wet sandal
#

My own wish is that people could better differentiate between, "this mod is literally broken" and "Oh, I have a mod conflict"

wet sandal
lone nest
bronze yoke
#

it's the umbrella module i wrote

lone nest
#

I'm using Candle already

bronze yoke
#

as far as i know it's the only up to date event dataset, there's a text version linked in the readme if that's more your style

wet sandal
#

:V

#

I can have autocomplete

#

I looked at Jabs stuff before and somehow missed this completely

red tiger
#

I wrote the generator for Candle.

#

And PipeWrench.

lone nest
#

now hes gonna come out and flex

red tiger
#

I lurk..

bronze yoke
#

umbrella is huge for lua modding

red tiger
#

I'm present a lot more times than you'd think.

lone nest
bronze yoke
#

there's no overlap really, unless you mean umbrella when you say candle

lone nest
#

I only see candle in my VSCode

bronze yoke
#

Events is PZEventStubs

lone nest
#

Oh dang, thanks for clarifying

bronze yoke
#

umbrella is a collection of tools like this

red tiger
bronze yoke
#

if anyone finds any detail that would've been helpful to know about events let me know so i can add it to the dataset, or send a pull request

red tiger
#

I'm working on the application that allows patching PZ-Rosetta for additional documentation.

bronze yoke
#

it's more detailed than the wiki was, and a lot more up to date, but i still come across 'oh, it should really mention this' moments regularly

red tiger
#

This is an example of me patching PZ-Rosetta for ISUIElement:drawTexture():

lone nest
#

that overload

bronze yoke
#

i gotta convert it over to the rosetta schema at some point

red tiger
wet sandal
#

Holy cow. I get red underlines now.

#

This is magic.

#

Compilers aren't real

red tiger
#

Thankfully I can write JSON Schemas.

#

Works for both YML and JSON as schemas.

bronze yoke
#

honestly the one i saw already in rosetta looks fine, it does need me to go over some things again but added detail is always good

red tiger
#

Yeah. We're setting the standard for it.

#

I'm also setting the standard for ZedScript at the same time.

#

There's no official support for ZedScript from TIS so it's the closest thing we've got.

#

When I have software to easily patch Rosetta from a UI, modders should start jumping in and document what they know. (If they want to contribute)

#

Means we can handle ourselves with documenting for others to see through Umbrella.

bronze yoke
#

yeah, my hope is that the projects survive us

#

we've at least made it possible, which wasn't really the case with stuff like capsid

red tiger
#

It's not my biggest concern. The code is open, documented, and clean. My big concern is will it be used at all.

bronze yoke
#

they're growing in popularity

red tiger
#

I've built many solutions directly off of the concerned and complaints of people in here and other areas of the community over the past near decade. Most of them continued to bitch and not use the solutions given to them.

#

I'd rather focus on projects that people use.

wet sandal
#

Thats fair, regardless thank you for everything you've made.

red tiger
#

It's why I'm a shorter fuse than most.

wet sandal
#

I can't believe I haven't been using Umbrella.

#

Clown moment

red tiger
#

Modders can set the standards for modding just as much as the devs can. =)

#

I'm planning to walk through the entire ISUI codebase and self-document it.

bronze yoke
#

when the tool is in place i'll make a habit of documenting whatever i end up having to work out

red tiger
#

Awesome. That's the end-game for Umbrella. (My goal)

bronze yoke
#

i spend a lot of time crawling the source working out what methods actually do, might as well write it down for everyone else

red tiger
#

A self-improving tool.

mild venture
wet sandal
#

OnPlayerUpdate could potentially fire 4 times per tick

bronze yoke
#

yeah, it's per-player

#

i will try to clarify that

#

i gave it a pretty useless description originally

mild venture
#

Thanks for your work guys. It helps a lot

wet sandal
#

Not positive about that, probably might be worth clarifying the mp behaviour on the events as well.

bronze yoke
#

it's mentioned in there

wet sandal
#

Ah, sorry

bronze yoke
#

most events have client/server only tags

red tiger
#

You can always use commands.

bronze yoke
#

additionally in a lot of places i use the term 'local player'/occasionally 'local zombie' but i don't define what that means anywhere, there isn't really a place to unfortunately

#

local players are the 1-4 players on the specific client, not players from other clients who are in the loaded area, and local zombies are the zombies that this client has authority over (which is much harder to explain)

red tiger
#

Might be a good idea to write basic summaries with context with technical tips below.

mild venture
#

OnPlayerMove is fire when player drive a car?

#

or if player use teleport as admin?

bronze yoke
#

needs verification but i think it's specifically walking

#

i think it even fires if you're walking into a wall, you don't actually have to move

mild venture
#

I'll check it out soon. I will inform you about the results

trim mist
#

how cursed would it be if I wrapped my scripts in a

ScriptName = {
...
}
return ScriptName
#

?

#

I want to access functions from a different file but it's proving really difficult

#

or should I just make said function global?

bronze yoke
#

some people choose to do that, i think it's fine if you can accept your entire script being indented

red tiger
bronze yoke
mild venture
red tiger
#
local myModule = {};

-- ...

return myModule;
mild venture
#

exactly

trim mist
bronze yoke
#

ya, that's the usual method

trim mist
#

so I really have no idea how it's supposed to look

red tiger
bronze yoke
#

i saw someone who used fenv to sort of do it the way you're doing but imo just do it the normal way

red tiger
#

Always conform to industry standards.

bronze yoke
#

i got most of my lua knowledge from zomboid and it's always great finding out some massive optimisation or some trick that makes the code 100x prettier and it's just... a completely standard lua thing everyone does

trim mist
trim mist
mild venture
#

It seems to me that using as few global variables as possible is best practices for any language

red tiger
#

Using global like PZ is very cheap and prone to collisions, deep issues, etc.

#

requiring modules as variables keeps things clean.

#

It's basically namespaces.

bronze yoke
#

the world if lua variables were local by default

jaunty marten
red tiger
#

Because I wrote it as an example? xD

red tiger
mild venture
#

running, etc

red tiger
#

Might be learning Rust, @jaunty marten

#

Am getting impatient with Electron.. and all the tutorials out there being out of date.

tawdry solar
#

whats rust

mild venture
#

@bronze yoke ReuseGridsquare fires only when you exit from game? I can't catch this event when I move around the world. Maybe there is some other event fires when IsoCell or IsoGridSquare or BaseVehicle is unloaded?

jaunty marten
mild venture
tawdry solar
#

ah

mild venture
#

How do I catch an area unloading?

#

Preferably before it is unloaded

livid ingot
#

@wet sandal hey, it still errs for me when i start up the game and whenever i check for loot. im using search mode and gravity if that helps

red tiger
livid ingot
#

oh whoops

wet sandal
mild venture
#

Hm, cant find method to get coords for IsoPlayer, can anyone help?

bronze yoke
#

player:getX() :getY() :getZ()

mild venture
red tiger
#

tuple tuple tuple

#
local x, y, z = player:getX(), player:getY(), player:getZ();
mild venture
#

Is my theory correct that when "Events.LoadGridsquare" is triggered, then some other IsoGridSquare is unloaded?

trim mist
#

Is it weird to reference a mod in a portion of a module like this?

lone nest
trim mist
mild venture
#

this is self?

fast galleon
bronze yoke
#

and 'this' does not work, 'this' is usually 'self' in lua, but your function doesn't have a self anyway

mild venture
#

self must be arg or you must use syntax sugar -- ":"

fast galleon
#

you can always do local self = ... or local this = ...

red tiger
#

:func() === .func(self)

mild venture
red tiger
#

I said it for people in here who might not know.

#

I might be useless in here when people ask questions about implementing API but I know the rules of the language.

#

xD

fast galleon
#

any chance you made the guide, because I only the see the functions but there is no information about them

red tiger
#

Did you install the vscode extension `Lua Language Server"?

fast galleon
#

I use Intellij, so I need a guide for vscode to see if it's worth changing programs.

bronze yoke
#

emmylua is fully compatible

mild venture
#

in vscode its not working for me

fast galleon
#

But I reinstalled since there was an update and seem to get more information now, not sure if you updated something.

mild venture
bronze yoke
#

what information is missing?

fast galleon
red tiger
#

My default installation works so I'm not sure if this is due to changes to something I'm not aware of, such as limits to execution of tasks in extensions.

#

Do you have a weak computer?

#

This is all I can think of atm.

#

Either:

  • Your vscode is very out of date (Which is not an issue since it's so easy to update it)
  • You aren't loading the right extensions
  • Some setting is preventing fully loading the typings (Files too large?)
  • Something else
bronze yoke
#

this is what you should be seeing

mild venture
#

is it vscode? looks like idea

red tiger
#

This is what I see.

#

I have to let the Lua extension load all the typings first.

#

You can see it in the bottom-left when loading the project in VSCode.

mild venture
red tiger
#

Wish I could reproduce your situation so I can write a solution Q&A for it.

bronze yoke
#

there's no reason to use vscode's emmylua

red tiger
#

the LLS extension is way better but something is preventing your typings from loading fully.

bronze yoke
#

it's just worse than lua language server, but for intellij we don't have anything better

fast galleon
red tiger
bronze yoke
#

LOL

fast galleon
#

interesting, this now shows but getPlayer doesn't, it only says global now

bronze yoke
#

there is a fork that looks promising but when i tried it it refused to load umbrella whatsoever

red tiger
#

IDEA should support language server.

mild venture
red tiger
#

Could repackage LLS for IDEA.

fast galleon
#

hm, how do I stop a temporary patch from replacing annotations of the function

it finally made sense why it said prevFn ๐Ÿ˜…

#

adding it to _G seems to work

fast galleon
#

any tips how I would see information about the events?

red tiger
bronze yoke
#

just type Events. and it'll show a dropdown

#

you can see the event description by mousing over either the event name or the .add(), and the .add() will tell you the parameters

slow graniteBOT
#
EFE#3966 has been warned

Reason: Bad word usage

fast galleon
#

Same happens with a new project.

bronze yoke
fast galleon
#

In previous versions of Umbrella I got warnings about circular loops but I never tracked down the issue.

fast galleon
bronze yoke
#

idk! i don't really know what could be different between our setups

#

the setup is just 'download umbrella, add it as a library', it seems like you did that part right so i don't get why yours is behaving so differently

fast galleon
#

I have the file and can find the information, but there is no intelliSense ๐Ÿ˜ฆ

bronze yoke
#

are you using emmylua?

#

i was trying some forks the other day but the ones i tried completely refused it

fast galleon
#

yes

#

It also seems to work when I am checking the entry in the events file.

ember crane
#

How do I get an item's id from a mod?

fast galleon
# ember crane How do I get an item's id from a mod?

Either search in the script directory or find the item in the debug Item List, this will give you the type, for the full type you can right click the spawned item and there should be some debug buttons like edit.

ember crane
#

And what about the mod prefix?

#

The replacement for Base.

bronze yoke
#

that is in the full type

#

if you're looking in the script the module will be declared at the top of the file

ember crane
#

What software do I need to view all the code?

mellow frigate
#

Hello, what should I call from lua to activate the sound of the vanilla file "PZ_MaleZombieEating.wav"

lone nest
forest harbor
#

Hi guys, I'm trying to add a new "animation" when an object is equipped, I'm studying how the "Cuffs" mod does it and everything works good until I try to actually change the pose of the model in my custom one and export it in .fbx (the original file is fbx too). I get an **Anim Clip not found **Error so the problem should be how the file is exported. Somebody knows how to export it successfully? (I'm using blender)

bronze yoke
#

try asking in #modeling and check the pins in there

forest harbor
mellow frigate
red tiger
#

I want to work on my own PZ music again. =( Just reminded me of those feels...

turbid gale
#

Are contributors not allowed to update workshop items? Every time I try I get an error code of 8 and I'm at a complete loss as to what could be causing it.

bronze yoke
#

contributors are not allowed to update workshop items

turbid gale
#

damn this makes things a bit annoying. oh well.

bronze yoke
#

ya, steam does not really support multi-developer projects that well

red tiger
#

The only way to do it is unsecurely through GitHub actions on a repo.

mellow frigate
tawdry solar
#

Been doing some syntax today

#

Somone should make a mod that removes the stunlock when pvp

mellow frigate
#

@tame mulch is there a way to get informed in lua of an animation event ? I have hard time synchronizing my Player zombie Banging on a door animation with the sound and door animation effect.

mellow frigate
ancient grail
mellow frigate
#

it does not push the events

lone nest
#

I think events and actions are independent of each other.

mellow frigate
lone nest
#

whenremoveFromWorld() is called, does it also remove the object from the square? removeFromSquare()

red tiger
#

I wonder..

#

I wonder if I should stay up tonight.

#

And mod the shit out of this game.

#

@jaunty marten I'm liking Tauri so far. No issues.

#

Am using sass, typescript, and tauri.

deft plaza
#

I was gonna work on my mod again until it crashed my game

#

I guess I'll post my code

#

fingers crossed no one gets butthurt over it

tawny depot
#

oh my god

#

just found this in the source code

#

this function goes on for like 1k lines

#

which is almost entirely if else statements

deft plaza
#

hey coolroo may I ask and am I allowed to ask what your making

mellow frigate
deft plaza
deft plaza
mellow frigate
#

a ','

deft plaza
#

oh man

formal oasis
#

Hello, i've got a new problem if anyone is so inclined to help.

I'm looking for a way to store data to a specific item. Say you've got a gasmask, and you are recording + 1 for every ten minutes its worn, then is there a way to tie that recorded data to that specific gasmask? Not every instance of hat_gasmask, just that single one the player is wearing.

I am under the impression modData will do what I want here, im just not 100% sure how to go about it, since there isnt a lot of reading material about it

bronze sand
#

Learning about weapon stats
Can someone please explain how CriticalChance and ConditionLowerChanceOneIn work?
The Baseball Bat has a CriticalChance = 40, while the Spiked Baseball Bat has CriticalChance = 30
So which one is more likely to strike a critical hit?
Is a lower number better here?

bronze yoke
tame mulch
formal oasis
#

so ConditionLowerChanceOneIn = 15 is a 1 in 15 chance its condition gets lowered

bronze yoke
#

higher is better

formal oasis
bronze yoke
#

there's a lot of factors that affect critical chance so know that a crit chance of 30% doesn't mean you get crits as often as 30% on most characters

deft plaza
#

๐Ÿ™

#

hold up forgot protein

bronze yoke
#

you just have imports on its own

#

delete it or actually import something

deft plaza
#

what is import

tawny depot
bronze yoke
#

it lets you reference items from that module without using their full type

tawny depot
#

Essentially, you have a "haunted" level, this increases when you kill zombies, and decreases over time

bronze yoke
#

you usually only need to import things when you're making recipes

deft plaza
#

oh okay so no recipes for me

bronze yoke
#

delete the imports line and it might start working

tawny depot
#

the more haunted you are, the more likely a supernatural event is to take place, EG: Window smashes in the building you are in, door slams, etc...

deft plaza
#

okay

deft plaza
tawny depot
deft plaza
#

?

tawny depot
bronze yoke
#

the main ones i've seen are in the script loading methods so they're not *too* bad

#

it seems like it's more annoying to write and it does run slower but at least it's during load time

tame mulch
tawny depot
bronze yoke
#

given that it's primarily a load time thing the performance difference isn't that significant

deft plaza
#

how about you make some figure run across the screen or something

#

like a sprinter

tawny depot
#

instead of just at load time

rancid panther
#

dang.. apparently my blackouts mod does not work properly in multiplayer

bronze yoke
#

there's definitely some inappropriate usages but the big scary ones i've seen are in script loading methods

rancid panther
#

i guess it makes sense since it changes the shutoff date directly in order to get the actual blackout effect. that probably doesnt update real time in servers except for the host

deft plaza
#

okay guys we have a problem albion it stopped crashing but I try placing a model

bronze yoke
#

my only issue with it really is:

  1. why do you want to write your code like this, switch cases are prettier ๐Ÿฅบ
  2. the calling of trim every single time bugs me
deft plaza
#

and there is nothing there

tawny depot
#

I was thinking that

#

so many string operations

deft plaza
#

nothing is there I even selected the place option

rancid panther
#

maybe it is under the grass tile

deft plaza
#

maybe

bronze yoke
#

check if the model path is correct, otherwise it might be too big or too small

tawny depot
#

on the magnitude of 500, and keeping in mind this is called in a for loop which is a loop for a list of strings

bronze yoke
rancid panther
#

i am not working on modding anymore (at least for the forseeable future) so i wont be making a multiplayer fix for my mod anytime soon

bronze yoke
#

load times are quite good for me so i can't say it's a big deal but it is a little bothersome

rancid panther
#

oh well

#

maybe someone will play with the idea in the future and make a better mod

deft plaza
#

this is the mesh

#

you got to click on it

#

I'm not sure what to do

trim mist
#

I just made the most glorious commit message

bronze yoke
#

LOL

trim mist
#

also I just wanna shout out to @novel barn for helping me out with my trait sorting code, he was a huge help. Thank you!

novel barn
#

Glad I could help! I'm far stronger at testing things than writing them myself ๐Ÿ™‚

trim mist
#

Normally I hate QA people for that, but turns out when I'm invested in a project it's a huge help! Who knew!

deft plaza
#

okay what's wrong here I'm looking at blender stuff

trim mist
#

lmao

deft plaza
#

thanks I guess

tame mulch
deft plaza
#

Can you tell me how so I write it down for the morning

deft plaza
#

Thank you man

#

This is my second mod so

novel barn
#

Hey all! I've got what I hope is a simple question. I have the following override function:

local old_SGC_GetEmptyItem = ISShovelGroundCursor.GetEmptyItem
ISShovelGroundCursor.GetEmptyItem = function(playerObj, groundType)
    print("attempting to intercept SGC.GetEmptyItem")
    local oldValue = old_SGC_GetEmptyItem(playerObj, groundType)
    return oldValue
end

I set a breakpoint on the first line of the original ISShovelGroundCursor.GetEmptyItem() and somehow my print statement fires three times before the original function fires? Logically that doesn't make any sense at all to me. Does anyone have any ideas what might be going on?

bronze yoke
novel barn
#

Scratch that... I killed PZ, verified game files, and relaunched and now it's behaving. I'mma just sweep that problem under the rug and pretend I never saw it.

bronze yoke
#

LOL

novel barn
#

ยฏ_(ใƒ„)_/ยฏ

bronze yoke
#

sometimes the answer is simply 'it's haunted'

novel barn
#

yes

bronze sand
bronze yoke
#

i suppose it would, yes

novel barn
#

๐Ÿ™ˆ I've got one more question for the night if anyone feels like ghost hunting with me. The above function override seems to be "working" in the sense that it can carry on to call the original ISShovelGroundCursor.GetEmptyItem. I have a break point inside the original to look at the playerInv variable it writes. I want to see what is in my player's inventory in the debugger. However when I click on the playerInv object and then click on items, it appears to be empty? Maybe I'm misunderstanding how the debugger works?

My ultimate problem is that even though I'm not changing anything at all, somehow my inventory gets lost between the start of my override function and the oldValue it returns.

trim mist
#

So i've learned to take what the debug console says with a grain of salt. Especially after reloading my mod without restarting the whole game

#

sometimes it will say things are nil without them actually being nil

novel barn
#

I've been restarting so much ๐Ÿ™ƒ This is after a restart unfortunately.

trim mist
#

it won't display certain datatypes if I click on them, and then throw an error every action afterwards

#

i've had the former happen though before first restart

#

idk if lua is compiled or interpreted, but i think if a var gets declared but not used the game ignores it

#

alllllso depending on the datatype it might not error out and instead everything that it is, is in the name

#

that might be happening with the inv?

#

especially if you have "trainer" shoes lol