#mod_development

1 messages ยท Page 157 of 1

wet sandal
#

Anyone know if its possible to make the game reload textures without a restart?'

#

Really annoying making UI pixel art and slowly trying colors ๐Ÿ˜†

red tiger
wet sandal
red tiger
#

I could be absolutely wrong.

ancient grail
#

Nope idk..

#

I only know you can change them with doparam but thats not helpful at all to your situation

#

And you can scale it

#

Ah wait sorry ui
I thought item
Hmm i think burryaga has something related to this

wet sandal
#

Its not a big deal, just a workflow optimization for the future

cloud plaza
#

any way to give a player fully loaded magazines for guns?

#

or does it have to be ammo + magazine separately

ancient grail
#

Yes

cloud plaza
#

yes to which one

ancient grail
#

If you have a gun equipped on primary hand
This will fill up its ammo

local pr = getPlayer():getPrimaryHandItem() 
if pr and  pr:isRanged() then 
    local mag = nil
    local gun = getPlayer():getPrimaryHandItem() 
    if  gun:getMagazineType() then 
        mag = InventoryItemFactory.CreateItem(gun:getMagazineType())
        mag:setCurrentAmmoCount(gun:getMaxAmmo())
        getPlayer():getInventory():AddItem(mag)
        if not gun:isContainsClip() then  
            ISTimedActionQueue.add(ISInsertMagazine:new(getPlayer(), gun, mag))
        end
    else
        gun:setCurrentAmmoCount(gun:getMaxAmmo());
    end
    getPlayer():getPrimaryHandItem():setRoundChambered(true) 
end
#

Posted on team orbit discord
Debug code library
For server admins to easily setup events

#

Since its tedious to look for magazine pair
For bunch of guns you need for events

cloud plaza
#

this still looks like you're queueing up the "insert bullets in magazine" action though right?

#

i want to make a scenario where u start out with a bunch of loaded magazines but it seems like there's no way around having to actually load the mags in-game

#

scripted or non scripted

ancient grail
#

Nah try it

#

If you just need the mag
You can reverse engineer this
Just take the syntax
Saves you time looking for stuff
Everything for that function u need
Written there

Except maybe which mag
You need to replace the getMagazineType()

vast palm
#

...he wants to SPAWN with magazines already fully loaded

ancient grail
#

Ye

#

Hold on

vast palm
#

when you spawn into the game you have nothing equipped in primary

#

so that script doesn't work for what he wants

red tiger
#

.. I think you're confusing this modder.

ancient grail
#

Sending another snippet thats not what you need but has what you need

#

Ahh am i

#

Sorrry

#

Im on mobile i cant fix the code

red tiger
#

If you have an answer and would like to present an example, clearly explain it or let someone else help.

#

You certainly confused the heck out of me.

#

lol

vast palm
#

lol

wet sandal
#
function InsurgentWeaponUtil.addMag(player, magName)
    local mag = player:getInventory():AddItem(magName)
    mag:setCurrentAmmoCount(mag:getMaxAmmo())
    return mag
end

function InsurgentWeaponUtil.equipAndFullyLoadWeapon(player, weapon, magName)
    local mag = InsurgentWeaponUtil.addMag(player, magName)
    mag:setCurrentAmmoCount(mag:getMaxAmmo() + 1)

    InsurgentWeaponUtil.equipWeapon(player, weapon)
    ISTimedActionQueue.add(ISInsertMagazine:new(player, weapon, mag))
end
#

What do i type for syntax highlight again?

#

Thats how insurgent does it

#

We also chamber a bullet into the gun

red tiger
#
```lua
..
#

It's fun to markdown in Discord

#
print("Hello, World!");
#

Pin that msg and reference it so I can stop making the same image over and over.

#

lol

ancient grail
#

``

--lua codeblock for discord

``

wet sandal
#

Do not fear the man who has practice how to reload 1000 different guns

ancient grail
#

Cuz his saying image

vast palm
#

...what?

wet sandal
#

Fear the man who has practiced how to reload guns 1000 different ways

#

Oh i thought you meant everyone posting the reload implementations

vast palm
#

he was asking a mod to pin the method to write code blocks into discord he posted

sour island
#

I thought workshop mechanics could pin

vast palm
#

okay, whoever capable

sour island
#

I may not be capable of pinning but I can ping

sour island
ancient grail
vast palm
#

great, delete a post that requires other posts to be deleted in order to not mess with the flow of the conversation

ancient grail
#

@wet sandal

ancient grail
sour island
#

you can include an additional argument to timed actions to make the time 0 I believe

ancient grail
#

Apologies for ruining the flow of conversation

sour island
#

that should eliminate any clumsiness with actions loading up

vast palm
#

I had to delete mine too because of it

#

wait, someone asked about making timed actions 0?

ancient grail
#

It will point to.deleted msg anyways

vast palm
#

what will point to them

#

you deleted an image that wasn't replied to, causing my comment after it to be directed at something else entirely =P that's dangerous

sour island
#

I had to scroll up to see what was going on - and it shows someone wanting a loaded gun ready to go on player load in - someone provided a snippet to do so, but the gun was being loaded in timed actions and they expressed concern over it being a timed action.

vast palm
#

that snippet wasn't the code of the modder asking

#

he just wants his starter kit to have loaded mags

sour island
#

o

vast palm
#

yes, this.

sour island
#

he could use the same snippet to figure out how to trigger the load bullets in action though

faint jewel
#

what in the blue hell is going on in here.

sour island
#

also I'm surprised this hasn't come up as an issue before tbh

vast palm
#

yea, but wouldn't it just make more sense to figure out how to spawn in a magazine already loaded, than a roundabout way of adding a new timed action of 0 speed?

sour island
#

NotLoc's snippet does this

ancient grail
#

I mentioned im on mobile
I just took what snippet i had closest to it

vast palm
#

oh, I didn't even -see- Noc's snipper

#

but doesn't this just spawn a magazine and load it into the gun?

#

he wanted multiple mags

sour island
#

The first function is just magazines

vast palm
#

oh okay, so those don't trigger at the same time. right

#

been a long time since I've actively done stuff

sour island
#

2nd calls the first - which is good practice, as the first is useful outright

vast palm
cloud plaza
#

lol

#

i didnt expect this much conversation around this question

#

thank you to all though

turbid gale
#

I dunno if I'm going insane, but it seems like the Events.OnPreFillInventoryObjectContextMenu hook isn't actually giving me the player?

#

it should give player, context, and items

red tiger
#

Looks like a player ID

turbid gale
#

:o

#

brain = flat

#

you're right, it would be nil if it didn't exist

#

this is what your brain looks like on embedded, I'm used to 00 or FF being empty

red tiger
#

Either it's wrong or the PZWiki is wrong.

turbid gale
#

PZWiki says it gives an isoPlayer

nimble spoke
#

I don't think any of the context events use isoplayer

turbid gale
#

๐Ÿค”

red tiger
#
local playerObj = getSpecificPlayer(player)
turbid gale
#

yup, figured that out right quick

red tiger
#
triggerEvent("OnPreFillInventoryObjectContextMenu", player, context, items);
turbid gale
#

now I have other terrible bugs causing issues

sour island
#

yeah sometimes player = playerID

#

usually its playerObj if it's the isoplayer

red tiger
#

There's no naming conventions in PZ's codebase.

#

Or none are properly enforced.

sour island
#

can't argue with the 2nd point, but they do follow some patterns... sometimes

turbid gale
#

my favorite is randomly multiplying and dividing by 2

#

trying to figure out how crit works for guns was hell because... it's everywhere

nimble spoke
#

Yes usually playerObj is the isoplayer, most notable exception I think is ISMenuContextInventory.lua that defines playerObj but then saves it as self.player and player id is self.playerNum

tawdry moss
#

is it possible to have a weapon use a drainable object like a gas can for ammo instead of regular magazines?

sour island
turbid gale
#

Defined stat exists of range increase per level for a gun. This number is actually just halved

#

that's the only one I remember 100%

#

same thing with the aiming perk crit modifier

#

if the gun script says 10, it's actually 5

#

tests ingame in debug mode confirm both

sour island
#

oh there's some weird stuff like that

#

it's to support old scripts I guess

turbid gale
#

which is... annoying

sour island
#

I ran into an issue with I think stress modifiers on books being scripted to be -10, but actually -100 on the inventoryItem lol

nimble spoke
sour island
#

It might be more work to try and jerry rig the gun system to do what you want

bronze yoke
#

the wiki is wrong, but those pages are autogenerated and my pull request hasn't been noticed

red tiger
tawdry moss
sour island
#

Half my time modding is spent deciding if I should/could warp the vanilla system to do what I want or just build something from the ground up and leverage it in like a jenga block

#

There's event for weapon swing

#

you could create your own gun system so to speak

gilded hawk
#

Does anyone know which code removes and adds bandages from the player model?

sour island
#

Otherwise you'll need to make a magazine for the flamethrower to take

tawdry moss
#

i tried having the mag be gas cans, the ammo itself be gas cans, neither even let me load the thing.

the next best thing i can think of is my own custom fuel tank item that technically has ammo but the ammo just constantly updates to be the number of uses left

sour island
#

Why couldn't you load the gas can as a magazine?

tawdry moss
#

guns seem to only accept items with type "normal" as ammo or mags, and gas cans have "drainable"

sour island
#

Also the approach for a gas-can magazine would be to not have an ammo item for it - and instead have it use a recipe or custom timed action to refuel it

#

Don't make it drainable

#

that part isn't the mechanic you want to lean on

tawdry moss
#

ill add a custom fuel item and set it to be type normal see if anything changes

nimble spoke
#

you could add your own context menu, that uses the drainable and reloads the weapon

sour island
#

^

#

or if you intend this to be a rare item, just have the magazines assumed to be full when found and use modData to simulate them draining

gilded hawk
tawdry moss
#

i plan on it being craftable only

sour island
nimble spoke
ancient grail
gilded hawk
# nimble spoke What exactly do you mean by handling?

How does the game equip and unequip the items in these 3 categories?

group:setMultiItem("Bandage", true)
group:setMultiItem("Wound", true)
group:setMultiItem("ZedDmg", true)

I was trying to make a clothing can can be stacked in the same BodyLocation, but once I equip it, even if I unequip it, it stays on my character model

vast palm
#

can a syntax even be reset?

ancient grail
#

Ill let you know if i see what im trying to refer i totally forgot .
Oh also time action might want to check that

#

There yeah but i only to reset everything idk how to remove just one thing
In my case zed dmg for the skins im using

#

This is also my roadblock now

ancient grail
#

Theres another one

#

Its what i used for vampire mod

#

And another roadblock of mine is that i cant use attach or equip syntax to zeds idk why

gilded hawk
#
--   -- player:getWornItems():clear() -- This unequips all clothing the player is wearing :-|
-- getPlayer():getHumanVisual():clear() -- this randomizes the body, skin, and hair and similiar
ancient grail
#

I thiught it was the same as for humans

#

Theres a dorandom outfit thing

sour island
#

These are all the uses of ZedDmg

#

Seems like it's using it as a keyword for more specific things

#

also this comment -- don't add the ZedDmg category, they are just equipped models

red tiger
#

Yaaaaayy.. Cryptic and undocumented objects..

gilded hawk
#

Yeah I saw that too

sour island
#

there's a few mods that accidentally make zeddmg visible

#

you'll see it sometimes as body.damage (?)

red tiger
gilded hawk
#

Oh wait

#
 public void setItem(String var1, InventoryItem var2) {
      this.group.checkValid(var1);
      int var3;
      if (!this.group.isMultiItem(var1)) {
         var3 = this.indexOf(var1);
         if (var3 != -1) {
            this.items.remove(var3);
         }
      }
#

I think I can remove and add these items, if I manually call the remove and add functions in java\characters\WornItems\WornItems.java

sour island
#

Idk if you mentioned - but what are you trying to do? like end goal

gilded hawk
#

It's related to my transmog mod.

I'm making a clothing item, that uses a BodyLocation set as MultiItem
eg:

group:getOrCreateLocation("Bandage")
group:setMultiItem("Bandage", true)
sour island
#

So it looks differently depending on the location it's placed?

gilded hawk
#

So, that I can use a single bodylocation for all my transmog items.

#

I have around 1K script items, and I'm trying to have all of them in the in a single body location, it would make it easier to manage

nocturne canyon
#

WHAT

sour island
#

Also Idk if this helps but you can create your own custom bodyLocation for items

#

and the item can be equipped there

gilded hawk
sour island
#

uhhh

gilded hawk
gilded hawk
# gilded hawk See

These 2 items have the same bodylocation, and I can't unequip them ๐Ÿ˜ฆ

sour island
#

You're equipping them using standard equipping methods?

gilded hawk
#

Yep

#

Also, script items for reference

  item TransmogItem_0
    {
      DisplayCategory = Transmog,
      Weight    =    0,
      Type    =    Clothing,
      Cosmetic = TRUE,
      DisplayName    =    TransmogItem_0,
      Icon    =    Belt,
      BodyLocation = TransmogLocation,
      ClothingItem = TransmogItem_0,
      WorldStaticModel = TShirt_Ground,
    }

    item TransmogItem_1
    {
      DisplayCategory = Transmog,
      Weight    =    0,
      Type    =    Clothing,
      Cosmetic = TRUE,
      DisplayName    =    TransmogItem_1,
      Icon    =    Belt,
      BodyLocation = TransmogLocation,
      ClothingItem = TransmogItem_1,
      WorldStaticModel = TShirt_Ground,
    }
sour island
#

If they're under the same location how are they not unequipping the other?

gilded hawk
#

it's because I set the bodylocation to multi item

#
group:setMultiItem("TransmogLocation", true)
sour island
#

ah

#

let me check something

gilded hawk
#

Sure take your time

#

I have this note in my code

--   -- player:getWornItems():clear() -- This unequips all clothing the player is wearing :-|

Maybe I can make a custom unequip button

sour island
#

In the debug ouput does it say anything about a timed action failing? invalid?

gilded hawk
#

No logs

sour island
#

wouldnt be an error

gilded hawk
#

There notthing printed in the console at all, no error, no logs

sour island
#
    elseif self.item:IsClothing() then
        self:setActionAnim("WearClothing");
        local location = self.item:getBodyLocation()
        self:setAnimVariable("WearClothingLocation", WearClothingAnimations[location] or "")
        self.character:reportEvent("EventWearClothing");

This is under function ISUnequipAction:start()

#

perhaps you can overwrite it to check for transmog items first, and if not throw it back to the original

gilded hawk
#

But where is the code that actually removes the item from the player model?

sour island
#

I believe that's handled in the player's update

#

I think what's probably going on is the game never intended to handle something like this and the old item is getting scuffed

cinder kindle
#

Hello, is there anyone here who want to be my savior ded
Thanks for every answer if you think you have an answer

Edit : I checked everything and every links, still doesn't work

#

While I wait for my answer I will dig this channel spiffo

sour island
#
self.character:setWornItem(self.item:getBodyLocation(), self.item);
#

ISWearClothing.lua

#

You should be able to unequip 1 though

#

like putting on 1 and taking off 1

#

it then calls the OnClothingUpdated event which has the isoplayer as the arugment

gilded hawk
#

Yeah I saw that

#

but it's still odd, that it still does not remove the clothing

sour island
#

could try

#
   public ItemVisual removeBodyVisualFromItemType(String var1) {
      for(int var2 = 0; var2 < this.bodyVisuals.size(); ++var2) {
         ItemVisual var3 = (ItemVisual)this.bodyVisuals.get(var2);
         if (var3.getItemType().equals(var1)) {
            this.bodyVisuals.remove(var2);
            return var3;
         }
      }

      return null;
   }
#

it's from humanvisual

#

so you'll need to grab that object from isoplayer

#

you're in luck it's exposed

gilded hawk
#

It might actually work

#

I'll try

red tiger
#

๐Ÿธ Cheers for slow progress on mods.

#

lol

#

God knows I've come to a crawl on my projects lately.

gilded hawk
#

Dude I haven't modded a game in like 4 months now

#

Depression is a bitch to deal with

gilded hawk
timber river
sour island
#

ISWear is to wear it

#

function ISUnequipAction is to unwear

gilded hawk
#

Ah okay

#

Makese sense

#

I might have a fix then

sour island
#

I was curious where it could be overwriting the item if there was a list of worn items

#

but I don't think that was the issue

gilded hawk
#

IM SO FUCKING GOOOOOOOOD

#

AAAAAAAAAAAAAAAAA

#

And I'm half asleep

#

I still know how to moooooooood

#

๐ŸŽ‰

#
local old_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
  old_ISUnequipAction_perform(self)
  -- code
  if self.item:getCategory() ~= "Clothing" then
    return
  end

  if self.item:getBodyLocation() ~= "TransmogLocation" then
    return
  end

  local wornItems = self.character:getWornItems()
  wornItems:remove(self.item)
end

#

Now it's possible to harness the setMultiItem BodyLocations

gilded hawk
sour island
#

Makes sense

#

Might be able to cut the for loop if you use remove(self.item)

gilded hawk
#

lmao i'm blind

#

I should not code while I'm half-a asleep

sour island
#

I'm also half asleep

#

I was trying to figure out how or why that looked off -- you're looking for and comparing the self.item

gilded hawk
sour island
#

No I mean -- you can just call remove(self.item) ?

gilded hawk
#

๐Ÿ‘€

#

Actually

#

Yes

sour island
#

I've been stretched at work ๐Ÿ˜ฆ

#

need to sleep but I have a mod commission to work on

gilded hawk
#

Dude sleeping it's a bit more important then commissions. Sleep now, and wake up a bit earlier tomorrow

#

Atleast you can code with 100% of your brain active

sour island
#

I have work tomorrow too

#

Still waiting for these zomboid mod sub money to kick in

#

any day now

gilded hawk
#

Just don't overdo it mate, cause you risk burnout like that, and it's not a good experience

red tiger
#

I write tools.

thin hornet
red tiger
#

I am building a vscode extension for the scripting format for PZ.

#

I'm currently in the linter phase that'll follow up with formatting.

gilded hawk
red tiger
#

It is in the marketplace and operational.

gilded hawk
red tiger
#

I remember.

thin hornet
#

Time for some advertisement...

PZPW

Unleash your creativity and elevate your Project Zomboid modding experience to new heights with pzpw!

Crafted specifically for mod enthusiasts and developers alike, pzpw is a remarkable tool that allows you to write your Project Zomboid mods in JavaScript or TypeScript. This groundbreaking utility is not just about writing mods - it's about enhancing your coding experience and transforming the way you create.

One of the standout features of pzpw is the built-in auto-complete/intellisense for both Java and Lua. Imagine having the power to write cleaner, faster, and more efficient code - and that's exactly what you get with pzpw. No more second-guessing your code or spending countless hours debugging. With auto-complete and intellisense, you're able to focus more on creating and less on the tedious aspects of coding.

With pzpw, mod writing becomes a seamless, professional process. Your code will not only be more organized, but also more readable, maintainable, and adaptable. It makes modding accessible, enjoyable, and rewarding.

The best part? pzpw is FREE! Yes, you heard that right! This powerful tool is available at no cost! It's our way of giving back to the modding community, empowering developers to create better, more engaging mods.

So why wait? Step up your modding game with pzpw today! Dive into the world of JavaScript/TypeScript modding, and experience the joy of creating in a whole new way! You won't look back. Transform your Project Zomboid modding journey now with pzpw!

https://github.com/Konijima/pzpw/wiki/Tutorial:-Creating-Project-Zomboid-mods-using-PZPW

red tiger
#

I'm doing the exact thing for PZ @gilded hawk

#

Also am first for ever supporting the format.

gilded hawk
thin hornet
#

Pipewrench is the core, mine is an utility tools that wrap everything you need to use pipewrench

gilded hawk
#

Oh wow

#

That's cool!

#

Shit I might actually convert my transmog mod to use typescript then

thin hornet
#

it allow to create a mod project in one command, then it allow to manage your project (which can contain multiple mods) into one place, it compiles it, and copy it directly into your Zomboid/mods or Zomboid/workshop directory ready to test in game.

gilded hawk
#

How do you do stuff like this in TS? Including overriding the return? ๐Ÿค”

local old_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
  old_ISUnequipAction_perform(self)
  -- code
cinder kindle
thin hornet
#

You have auto-complete and suggestion for everything from mod.info (which is handled into pzpw-config.json to Java and Lua intelisense

#

you can use hookInto utility function to hook into existing functions

#

you can also access the _G global object

gilded hawk
#

Can you do both pre and post hooks? ๐Ÿค”

thin hornet
#

inside the hook you call the original

#

so you choose what is before or after

gilded hawk
#

Ah okay that's very nice

cinder kindle
#

let's go for the next step of the tutorial, double click on createRunConfigurations ๐Ÿ˜†
...
๐Ÿ—ฟ

gilded hawk
#

I have to be honest this is very cool, I'll give it a shot tomorrow, cause right now I'm just too tired ๐Ÿ˜ด

thin hornet
#

That is an old example of hooking into an Action.

import { ISTakePillAction, IsoPlayer, InventoryItem } from "PipeWrench"
import { hookInto } from "PipeWrench-Utils"

// Hook into ISTakePillAction:new
hookInto("ISTakePillAction:new", (_new: Function, self: ISTakePillAction, character: IsoPlayer, item: InventoryItem, time: number) => {
    const obj = _new(self, character, item, time) as ISTakePillAction

    obj.maxTime = 300 // change action properties here

    return obj
})

// Hook into ISTakePillAction:perform
hookInto("ISTakePillAction:perform", (_perform: Function, self: ISTakePillAction) => {
    const player = self.character as IsoPlayer
    const item = self.item as InventoryItem

    player.Say(`I took a ${item.getDisplayName()}!`)

    return _perform(self)
})
cinder kindle
#

aaaand nope
false hope.

#

@thin hornet can I use you as a joker for this one since I follow your tutorial ? It would really help me ๐Ÿ˜

tawdry moss
#

also is it possible to have a flashlight with a different light color, like an oragne/yellow light instead of pure white?

sour island
#

not easily

cinder kindle
thin hornet
#

it could be the version of java that is installed or many other thing, could be outdated too, pzstorm is abandonware i believe (or at least last time i saw)

thin hornet
cinder kindle
thin hornet
#

It a good language to learn in the modern world of today yeah

#

It similar to lua in many aspect

cinder kindle
#

I know basics

thin hornet
#

do you know some java or c# for example?

#

object oriented language with hard types

cinder kindle
#

I know more of javascript that I know in Java ๐Ÿ˜Ž ๐Ÿ’ง

thin hornet
#

Well that good anyway

#

Alll these language look alike in syntax

thin hornet
#

Then research typescript and javascript, maybe ask chat gpt to teach you or something.

cinder kindle
thin hornet
#

pzpw is really simple, in less than 4 commands you are ready and set

#

then you can test around typescript and compile and run in the game, then modify, compile again, and restart the modified script in game

#

the goal of my capsid tutorial was to get intelisense in lua to mod pz right?
well pzpw offer all that intelisense built-in in a much less effort setup

cinder kindle
#

I will check that, thanks again for your time, that was a good joker ๐Ÿ„โ€โ™‚๏ธ

mellow frigate
thin hornet
#

Yeah just restart the script as you would with lua

#

pipewrench just transpile typescript into lua in the end.

#

me and a contributor are working actively on making the compiling process much faster and smoother

cinder kindle
#

I am cursed to get errors for no specific reasons unhappy

cinder kindle
thin hornet
#

i dont see the node_modules directory

#

run npm install in your console from within your project directory

#

pzpw new should have installed it but not sure what happened here

thin hornet
#

huh

#

are you using proxy or vpn or something?

cinder kindle
#

nope

thin hornet
#

what version or nodejs ?

node -v```
cinder kindle
#

version of your tutorial, the recommended, let me check for you

thin hornet
#

what was the output in your terminal when you used the command pzpw new

cinder kindle
thin hornet
#

seems like a npm related bug

#

maybe reinstall node and npm

cinder kindle
#

I am playing all this in hardcore mode I haven't even started

thin hornet
#

lol

#

Challenges after challenges

tawdry moss
#

Are animated textures a thing or is that not possible in PZ

nimble spoke
ancient grail
tawdry moss
#

Can weapons have animated textures?

faint jewel
#

le sigh, this is gonna be fuin.

cloud plaza
#

when does Events.OnPlayerUpdate fire? is this checked every tick of the game? is this checked upon user input?

limber lily
#

hello I am creating a new class in the game but I need to find the file that manages the choice of profession interface to be able to choose it. Does anyone know where this file could be and what its name would be?

turbid gale
#

try looking at profession framework on the workshop and using it as a dependency. I'm pretty sure it does all the heavy lifting so you can easily add new professions.

limber lily
#

ok thanks i m gonna try that but if someone know the file i m talking about

thin hornet
tawdry moss
#

how can i check if the player is wearing gloves? im doing a thing that involves fire and i want a risk of burns if the player isnt wearing hand protection

cinder kindle
# cinder kindle

Doing a sleepless night to fix this.
Fixed first problem yet but still have issues with @asledgehammer error

limber lily
#

Does anyone have the name of the file?

sage python
#

hi

#

i extracted the game's sound banks but couldn't find the smoking sound files

#

where are they located?

tawdry moss
lone nest
#

anyway, it looks very promising!

sage python
#

lol surprire?

sage python
#

hmm

#

there's no working vehicle sound mods on the workshop

#

is that a sign that it's very difficult?

#

cause i'm trying to do that

faint jewel
#

it's actually not been done.

#

feel free to try!

cinder kindle
#

LET'S GOOO I MADE IT ๐Ÿค
@thin hornet

limber lily
#

Sorry to be so insistent but i really need the file that manages the choice of profession interface. I m making a big mod with many addons

fast galleon
sage python
#

is there a way to make a mod reload its scripts after you change it instead of painfully closing and reopening the game?

#

also can you make a sound louder by making its multipler larger than 1? like 1.5f or 2f? or is 1 the maximum

#

and the sounds i changed are muted

#

great

#
{
    sound VehicleDoorOpenStandard
    {
        category = Vehicle,
        clip
        {
            file = media/sound/vehicle_door_open_1.wav,
        }
    }
       sound VehicleDoorCloseStandard
    {
        category = Vehicle,
        clip
        {
            file = media/sound/vehicle_door_close_1.wav,
        }
    }
}```
#

can someone tell me why the sound is muted?

#

am i missing something here

limber lily
#

no problem in that code

#

your problem is somewhere else

lapis lava
#

what texture maps do zomboid models support having

#

and does that include normal and emission

sage python
#

no it's not the car mod i had affecting it

#

hmm

tardy wren
sage python
#

so since my door opening/closing sounds are muted

#

i'm guessing my mod is working, but the sound is too quiet or something

#

maybe the radius is 0?

#

do i have to give it a sound radius?

#

maybe the audio doesn't fit?

#

ok apparently it has to be
sound VehicleDoorOpen
not
sound VehicleDoorOpenStandard

cloud plaza
#

so I created a new trait called "test". Here's how it looks:

--trineTraitCreator.lua
require('NPCs/MainCreationMethods');

local function Loader()
    local test = TraitFactory.addTrait("test","Test",1,"Some text",false,false)
end
Events.OnGameBoot.Add(Loader);

and now I am trying to implement the following logic here

--trineTraitMain.lua
function GiveTest(player)
    local Inventory = player:getInventory()
    if Player:HasTrait("test") then
        for i = 0,10,1 do
            AddLoadedMagazine(player, "Base.9mmClip")
        end
    end
end

function AddLoadedMagazine(player, magName)
    local Inventory = player:getInventory()
    local mag = Inventory:AddItem(magName)
    mag:setCurrentAmmoCount(mag:getMaxAmmo())
    Inventory:addItemOnServer(mag)
    return mag
end

Events.OnNewGame.Add(GiveTest)

However it doesn't seem to recognize that the player has the "test" trait. Am I missing something here?

#

I'm testing this by launching a solo game with just my mod and selecting this "test" trait

neon bronze
cloud plaza
#

oh im actually an idiot lmao

#

i did not notice the casing

bronze yoke
sage python
#

also my mod is working

#

for some reason, same exact code

bronze yoke
#

if you have your mod disabled on the main menu then it'll be reloaded every time you load your test save

sage python
#

yeah i've figured it out thanks

fast galleon
#

IsoSpriteGrid works only with Moveables, is there a similar system to easily get all objects of something you want to be built only?

#

I like it because you can grab all objects through java. I'll try to make one myself, hopefully it won't trigger any side effects.

sage python
#

it was surprisingly easy to make

#

how come there's no such mod

#

i think car door opening/closing sound being annoying and loud is a popular opinion

cinder kindle
thin hornet
#

If you come from a Lua background, there will certainly be new concepts to learn in JavaScript. However, the basic principles of programming remain the same, and your experience with Lua will definitely help you to understand JavaScript.

cinder kindle
sour island
#

That methodology pains me everytime I see it - idk why

cinder kindle
#

I am the greatest noob of all times. period.

sour island
#

It's not you, it's just the way that's established

#

Imo it's very simple to use two inserts but it could be cleaner/harder to screw up if it was a function

#

Messing up the distros is a pretty easy thing to do

bronze yoke
#

especially with a lot of mods using hundreds of lines of these

#

most of my mods do things heavily programmatically so it's no good for me but i wonder if the distribution merge thing would be more useful for most people

#

i've barely seen any mods use it

sour island
#

Distromerge merges the tables but if one person copypastes a table insert out of order it will cook the rest of it

#

Even just a function that inserts within it but uses two arguments would be easier

#

Another idea for the community proj

cinder kindle
sour island
#

No it's technically fine/correct, it's just ugly/prone to accidents ๐Ÿ˜…

#

And it's the standard thrown around

#
function addItemToDistro(distroAddress, itemType, spawnChance)
   table.insert(distroAddress, itemType)
   table.insert(distroAddress, spawnChance)
end

Probably over-egineering it, but it's also a baby-gate for those that may need it.

bronze yoke
#

that's usually what i do

#

it's just a lot less ugly

neon bronze
#

Its certainly better than seeing 500 table.inserts

sour island
#

Hopefully during the summer I can work on all the pending issues on commProj

#

And maybe pick up a comrade or two ๐Ÿ‘‰๐Ÿ‘ˆ

#

Damn I lost my emote using the hammer and scythe sprites

autumn garnet
# cinder kindle I am the greatest noob of all times. **period**.

if it's can help you ```lua
require 'Items/SuburbsDistributions'
require 'Items/ProceduralDistributions'

local LootRarity2 = {}
LootRarity2.Common = 15
LootRarity2.Uncommon = 8
LootRarity2.Rare = 2
LootRarity2.VeryRare = 0.5
LootRarity2.ExtraRare = 0.01

local suburbsDistribution = {

all = {
    inventoryfemale = {
        items = {
            "Needle", LootRarity2.ExtraRare,
            "Gum", LootRarity2.VeryRare,
            "Cricket", LootRarity2.Rare,
            "Paperclip", LootRarity2.Uncommon,
        }
    },
    inventorymale = {
        items = {
            "Needle", LootRarity2.ExtraRare,
            "Gum", LootRarity2.VeryRare,
            "Cricket", LootRarity2.Rare,
            "Paperclip", LootRarity2.Uncommon,
        }
    },

},

Bag_BigHikingBag = {
    items = {
        "TinnedBeans", LootRarity2.ExtraRare,
        "Paperclip", LootRarity2.Uncommon,
    },
},

Bag_NormalHikingBag = {
    items = {
        "TinnedBeans", LootRarity2.ExtraRare,
        "Paperclip", LootRarity2.Uncommon,
    },
},

Bag_DuffelBag = {
    items = {
        "TinnedBeans", LootRarity2.ExtraRare,
        "Paperclip", LootRarity2.Uncommon,
    },
},

Bag_SurvivorBag = {
    items = {
        "TinnedBeans", LootRarity2.VeryRare,
        "Paperclip", LootRarity2.Uncommon,
    },
},

}

for location, data in pairs(suburbsDistribution.all) do
for _, value in ipairs(data.items) do
table.insert(SuburbsDistributions['all'][location].items, value);
end
end

#

in : \lua\server\Items

autumn garnet
#

in LootRarity, you can add what you want : LootRarity2.ExtraRare3 = 0.003 and after you just need to add

#

"TinnedBeans", LootRarity2.ExtraRare3,

#

you can check with LootZed the %

bronze yoke
#

you should make the lootrarity2 table local

autumn garnet
#

edited thanks ๐Ÿ™‚

sour island
#

That's a good system for scaling

#

1 point to change rather than dozens

sage python
#

oh my god

#

i accidently hit this button

#

and now all my sounds are back to vanilla

#

is there a way for me to activate my modded sounds again?

#

without restarting

#

cause i'm hosting for my friends and it will take too long to restart

red tiger
#

You can try loading them back in manually but it'd probably cause issues.

sage python
#

yeah i am forced to restart anyway since

red tiger
#

Sounds like an actual bug.

timber river
timber river
sage python
#

lol

sour island
#

There used to be a panel for adjusting all sounds even modded, unscripted were added in real time to a general tab.

#

Was that ever fixed/readded?

sage python
#

i'm surprised that they can't join just because i reloaded vanilla sounds

sour island
#

It was broken with the sound update -- I looked into it but it was a java sided issue -- something to do with juggling the sound onto a test player if I recall(?)

#

Oh it's causing a checksum?

tiny forum
#

How do I change the link to an image that opens when I consult a document/map?

sour island
#

Hey Lore ๐Ÿ‘‹

sour island
tiny forum
tiny forum
#

I am working on the translation of Save our station

#

There is a diagnostic manual that when you read it, it opens up an image

#

Since the image is in English, I would like to change it to another one

sour island
#

I'm not sure it can be if it uses the maps system - EHE has a similar problem with flyers

#

Do vanilla maps get translated?

tiny forum
#

It uses the same animations as when you open a map in the game

#

Is there no way then to say, "Hey, use this image instead of that one"?

sour island
#

Not sure, but most likely yes if the process isn't handled by java

tiny forum
#

Okay, and how do I know that?

sage python
#

wait what

#

my friends are having an issue

#

with a mod i made

#

i gave them the files but it says doesn't match?

tiny forum
sage python
#

nvm

sour island
sage python
#

i gave them the WIP version lol

#

my bad

tiny forum
drifting ore
#

How does clothes modeling work for PZ?

mellow frigate
#

Hi, is it me or there is no more Weapon jamming in B41.78.16 ?

turbid gale
#

I've had weapons jam plenty in my testing last night

mellow frigate
#

What weapon are you using ?

turbid gale
#

semi-autos

mellow frigate
#

modded ?

turbid gale
#

pump actions and bolt actions, while they do technically jam, they instantly clear

#

because the character automatically racks after every shot

#

modded, yeah as I was testing what I was working on

#

and none the jam chances there were insane

#

I was testing if my folding stock script preserved jams, which required a jam

mellow frigate
#

can you give me a name of a Vanilla semi-auto weapon ?

turbid gale
#

M16, M14

mellow frigate
#

thx

turbid gale
#

M9, M1911, DE Pistol

mellow frigate
#

well I'm surprised I did not achieve any jam with the 9mm in 100+ shots

turbid gale
#

it's also condition based

#

from my experience a 100% condition firearm won't jam

#

a 10% or 20% will jam a lot

mellow frigate
#

I was at 10% condition all test long

turbid gale
#

no clue

#

I do want to dig around the firearm java and figure out exactly how jamming works

mellow frigate
#

the M16 jammed at 36 rounds ๐Ÿ™‚

#

jamming is lua stimulated ๐Ÿ™‚ thanx for the weapon cues

limber lily
#

hello I am creating a new class in the game but I need to find the file that manages the choice of profession interface to be able to choose it. Does anyone know where this file could be and what its name would be?

fast galleon
#

The main files would be ProffesionFactory and MainCreationMethods.lua .

mellow frigate
#

Can I force a reload of a texture ?

primal remnant
#

I'm missing something obvious. My model isn't displaying in game; just the icon.

#

Icon is is in the textures folder with Item_ prefix. Texture is in the Texture/Worlditems folder. Model is in the modelx_x/WorldItems folder. I can't see what I missed, lol.

Edit: As @neon bronze suggested, I switched up my naming convention due to lack of caffeine. WorldStaticModel was incorrectly named.

neon bronze
#

shouldnt it be BF_Rubber_Scrap?

#

yes but you defined the model as BF_Rubber_Scrap

#

so far i know you need to call it in WorldStaticModel as that, BF_Rubber_Scrap

primal remnant
#

OH

visual turret
#

So, I was editing 1 of brittas grip attachment in blender and when I exported the model .x it did not appear on weapon and only showed as attached to weapon

#

Was there something I did wrong during export process?

primal remnant
#

"it did not appear on weapon and only showed as attached to weapon" Elaborate on this please.

neon bronze
#

did it only appear on the weapon when you put it down?

visual turret
neon bronze
#

yea i think(?) there is a definition for attachements in the weapons model script

#

like their offset

#
        {
            offset = 0.0000 0.4700 0.0300,
            rotate = -180.0000 0.0000 -180.0000,
        }```
#

thats for the vanilla shotgun and its choketube attachement

visual turret
#

ok yeah because I change the position in blender

neon bronze
#

maybe tinker with that for your brittas weapon that you change

visual turret
#

Ok and I noticed the kb memory of the model was 2 lower than the original after exported it in blender

nimble spoke
# drifting ore How does clothes modeling work for PZ?

Many clothing items are simply a texture applied on top of the others, some are a simple model that gets attached to the character's model, like hats or glasses, the more complicated ones are clothes that need to be animated, like jackets. For those you need to use a converted player base model as a base

twilit rune
#

Hi there! I'm trying to set up spawns for the vehicle without using vehicle distribution zones. It's almost ready, but has one annoying and not desired feature. It has chance rolling to decide whether it's gonna spawn or not. The problem is that chance rolling each time anyone get to this cell / square resulting that vehicle will eventually be spawned. Any suggestions how to prevent that and make it roll chance only 1 time?

mellow frigate
#

Pif ! Paf ! Boom !

#

Bang !

fast galleon
#

Can you make one for Zombies that are not visible behind Walls because of IsoMetric view? Like a thump sound when they are breaking the wall, or when you first notice them ๐Ÿค”

ancient grail
cinder kindle
lone nest
primal remnant
#

I can use "Result: BF_Scrap_Rubber=3, " to get an item from a recipe. Can I use the "/" to get more than one result item in the same way that I can have multiple ingredients for the recipe?
Alternatively, can I use result twice?

neon bronze
drifting ore
#

For clothes like jackets

neon bronze
#

You probably reference the jacket vanilla model but give it your custom texture

drifting ore
#

Nah but for making a new model

nimble spoke
nimble spoke
primal remnant
#

@nimble spoke I've gotten the general idea already, but I was hoping I wouldnt need an entirely different Recipe.OnCreate for it. Guess there's no easy way to use recipe for multiple result items. Now I've got to figure out the lua function part. WOO!

cloud plaza
#

anyone have an example for how I can include "Desensitized" as part of my custom trait? I've been looking at the JobTraits mod but all it does is add "Desensitized" to the TraitFactory.

Essentially I am creating a trait "Special Forces" which gives stat bonuses (easy enough) as well as a full loadout upon spawn (figured out). But I also want my "Special Forces" trait to give the player "Desensitized".

I'm thinking on PlayerUpdate I could keep resetting the panic level back to 0 but I'm wondering if there's a much easier way to do this that I'm missing

lone nest
cloud plaza
#

nope. I want to do this within my mod without a dependency on an external mod

lone nest
#

you can download it and look at the mod code - i'd advise against copying it.

#

That mod has customized traits and occupations, the workshop id is 2907683021, which you can then find in your steam folder
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\2907683021

neon bronze
#

Actually anyone knows where the getFileWriter points to?

ancient grail
#

hi does anyone know how to remove specific zeddmg and not all of em
cuz the way im doing it is


    player:clearWornItems()
    player:resetModel()

here is how i toggle it
https://imgur.com/SnaIIN1

#

and it removes all of the clothing
but i just want to remove the zeddmg which is what i used to mask the player
(to make it look like his under water )
this is why i need it
but i dont want to remove every clothing
if theres anyone who might know the syntax pls share
ive been trying to find this the whole day
https://imgur.com/ml3o68X

#

function SWIM.wear()
    local player = getPlayer()
    local item = 'Base.SWIMmask'
    if item then
        local inv = player:getInventory() 
        local equip = inv:AddItem(item);
        player:setWornItem(equip:getBodyLocation(), equip);
    end    
end

function SWIM.strip()
    local player = getPlayer()
    player:clearWornItems()
    player:resetModel()
    sendVisual(player);
    triggerEvent("OnClothingUpdated", player)
    ISInventoryPage.renderDirty = true;
end

function SWIM.isMask(player)
    local wornItems = player:getWornItems()
    for i=1,wornItems:size() do
        local item = wornItems:get(i-1):getItem()
        if item:getName() == "Base.SWIMmask" then 
            print(item:getName())
            ---getPlayer():getInventory():Remove("Base.SWIMmask");
            return true
        end
    end
    return false
end

function SWIM.toggleWear()
    local player = getPlayer()
    if SWIM.isMask(player) then 
        SWIM.strip()
        getPlayer():getModData()['isSwimming']=false
    else
        SWIM.wear()
        getPlayer():getModData()['isSwimming']=true
    end
    print('isSwimming')
    print(getPlayer():getModData()['isSwimming'])
end

#
    {
        DisplayCategory = ZedDmg,
        Type = Clothing,
        ClothingItem = SWIMmask,
        BodyLocation = ZedDmg,
        WorldRender = FALSE,
    }
mystic vessel
wet sandal
#

Tfw your disorganized

#

Iconography added after that gif was recorded

cloud plaza
#

attache case mod? ๐Ÿ‘€

wet sandal
#

Pretty much

cloud plaza
#

are you able to rotate items

wet sandal
#

Aiming for the tarkov inventory system

cloud plaza
#

or no

wet sandal
#

Yea

#

And popup windows

#

Bags in bags

#

Etc

cloud plaza
#

thats p cool

tawdry moss
#

so im making a sword that has 2 different modes, functionally the 2 modes work flawlessly, but id like a visual indicator of which mode the sword is currently in. I'm using vanilla models for now and will have different custom models for it later.

the goal is to have the sword swap models based on the current mode but it isnt changing. its staying at the default model.

#

okay its recognizing the modes when i place it on the ground but its not changing when im actively holding it

lone nest
#

Ah, I was wondering when or if someone would try and make a Axe-Shovel survival tool... Chop wood and Dig Furrows with a single tool would be neat.

tawdry moss
#

that shouldnt even need a special lua file cuz that function is in the script tags of the weapon

hot patrol
ancient grail
hot patrol
ancient grail
#

Sapph is back from taking a break.
So you should hear from her soon
Thats all

hot patrol
#

Nice, Thanks for the heads up. ๐Ÿ™‚

drifting ore
# wet sandal

As a tarkov player, to show me this and not let me play, is trying to hurt me ๐Ÿ˜ฆ

#

and yes, I have read that it is about to, that there are problems with the anticheat.

wet sandal
hot patrol
#

speaking of which any news on susceptible if you don't mind me asking?

wet sandal
#

I watched a video about how zombies spawn inside buildings and based on that I need to rework how the air is modelled

#

It's not a huge amount of work, but I'm trying to bash Inventory Tetris out first

wet sandal
hot patrol
#

can't wait. Good luck ๐Ÿ™‚

tawdry moss
bronze yoke
tawdry moss
#

ill try that

ancient grail
#

Its reload

#

When we made the nitrogun i had to make an animation that basocally swapped the sprite via anim set

ancient grail
#

I dont think its possible via lua

#

Oh its possible? Nice

tawdry moss
#

player:resetEquippedHandsModels();

#

shisse

ancient grail
#

How did you change it?

tawdry moss
ancient grail
#

Nice

tawdry moss
ancient grail
#

Nice

tawdry moss
#

its in an onPlayerUpdate function atm so i will need to change that for optimization

#

but i can do that on my own

ancient grail
#

Whats isactivated? Like flashlight?

tawdry moss
#

not strictly for flashlights, just anything with a toggle. i dont know of anything outside of the base game that uses it and isnt a flashlight though

#

if you have it applied to a weapon and have said weapon equipped to hotbar, pressing the key to take it out also activates the item. to get around this i made it so having it holstered removes the "canBeActivated" attribute and makes it so you can draw it as usual. you still have to holster it the manual way, but while its in your hand you can press the hotbar key to toggle it which is a really neat system

#

im making the shishkebab from fallout 3/nv/4, a fire sword that sets enemies on fire, and since fire is super destructive in this game i wanted to have the option for not having it not spread fire.
theres also a pretty solid ammo system, made with a lot of help from Chuckleberry Finn, and the sword is refillable with gas cans.

still need to make the crafting recipe for it

#

i also want to add a chance of burning your hand if you swing it without wearing any protection. my initial plan was checking insulation but i cant figure out how to get insulation of a specific body part

ancient grail
tawdry moss
#

ill send you the files for it once i get something more refined

#

effect im going for is if the right hand has insufficient insulation, the character has a chance to burn their hand. every time this code runs the conditional throws an error, and i cant see what it is

bronze yoke
#

ohh

#

my bad

#

i've never seen someone use the part constructor like this

#

bodydamage doesn't have a fromindex method, were you thinking of BodyPartType? but either way i think that entire section is just trying to do character:getBodyDamage():getBodyPart(BodyPartType.Hand_R)

tawdry moss
#

that must be it

grand yarrow
#

Ok I'm fairly new to modding pz and I have no idea what's causing it but a bunch of items from the base game seem to disappear from the game when I load the mod I'm working on

#

I'm trying to make an item that lets you craft tools into other tools.
For the most part it's working but it somehow removes the saw, hand saw, needle, and the trowel

#

only things I've added are one item and a bunch of recipes

grand yarrow
#

I removed all mentions of them in the recipes and they are back in the game, So clearly something from the recipes causing it.
I'm gonna try rewriting those parts but I still have no idea why it was doing it.

#

nevermind I forgot to turn the mod back on
They're still gone

#

no mention of them at all in the mod

bronze yoke
#

does your mod overwrite any vanilla files?

grand yarrow
#

I don't see any reason it would

quasi kernel
#

i arose from the dead specifically to make a mod someone mentioned like once lol

#

was originally using highlights but those are a tad laggy

fast galleon
#

nice

eternal hazel
#

Catboy character mod when

#

Like the furry mod

faint jewel
quasi kernel
#

Sure

#

(Also turns out the generator range is a lot larger so I had to use a formula to compensate, 20 units in a marker is NOT 20 tiles)

#

@faint jewel just in case lol

faint jewel
#

well the outer ring seems awfully thick. maybe have it do a gradient fade

quasi kernel
#

I can investigate, just dunno what the full capabilities of markers are

#

Though I may need to tweak a few other things first, it likes to linger around if you pick up the generator with the menu open

odd notch
#

anyone know a way to remove an element from a UI on demand?

fast galleon
#

I think you can get similar effect by hiding them

odd notch
thin hornet
gilded hawk
#

Did Dislaik delete his client-server guide from steam?

neon bronze
#

Thats what i used and jt worked

#

Doesnt work on children though

#

By children i mean panels that are popping up through buttons

gilded hawk
thin hornet
gilded hawk
thin hornet
#

We need to form a search n rescue team, #OpFindDislaik

timber river
#

What kinda mods did he do?

gilded hawk
#

He made a lot of big mods

timber river
#

Like?

ancient grail
ancient grail
gilded hawk
#

Ohhhh, I understand

thin hornet
#

๐Ÿ˜ฆ

ancient grail
#

Huge lost..

gilded hawk
#

Yeah...

ancient grail
# timber river What kinda mods did he do?

His library is amazing
But i never once understood how to use it

He made the dogs mod,
Skateboard, motorcycle,
But thats not his biggest contribution

It was the guides he made
Animation, clothing guides

gilded hawk
ancient grail
timber river
#

Wonder what he meant by too toxic

gilded hawk
#

I have been modding for 10 years now, and the amount of assholes you have to deal with is absurd

#

Especially when you have to deal with entitled little shits

#

It's not for everyone

timber river
#

I quit Arma 3 specifically because that community is so toxic though ๐Ÿ˜‚ but like... Actually toxic, the modders of that game are legit some of the worst people in existence.

I just really haven't seen the same level here. Idk, seems like a lot more chill scene than other games

gilded hawk
#

Eh it depends

#

Anyway, people can be assholes, and not everyone can be bothered to deal with this shit

#

And you also have to deal with obtuse and room temperature IQ users. Like even I got really really pissed #mod_development message

sour island
#

The number of times I typed

for on-going saves you have to go through the "load" menu, then "more", and then "change mods"...

gilded hawk
#

People just don't read, and this pissed me off

sour island
#

That's another issue yeah, I'd say 8/10 it's a "I took a breath and gave up, help me"

#

The easier it is to navigate the menus though the less ... I wouldn't even call it troubleshooting

#

But the less modders have to do it

#

Also if your projects are a mess on the comments, I moved to GitHub discussions

#

Much more pleasant experience

sour island
#

He never made a question as far as I know.

#

Any form of deterrence will shave off a lot of comments/reports but the ones left over are probably 10x more useful

#

This is the fake comment section btw

#

It's a hyperlink to the repo's issues page ๐Ÿ˜…

gilded hawk
#

That's genious

#

It's actually so SMART

#

I need it now lol

sour island
#

Steam is too bare bones - you can do so much more with GitHub

gilded hawk
#

Yeah, agree

sour island
#

I toss up all my projects there. I set up a mod-template repo-template for team orbit, and honestly wish I thought of that sooner

gilded hawk
#

Also, my transmog mod v4 is surprisingly working ๐Ÿค”

sour island
#

V4??

gilded hawk
#

v1 is the first version I made
v2 is my attempt to have it working for MP too, but it was a bit of mess and confusing
V3 I never released it because it was too experimental and required changes to the java files ๐Ÿ˜…
So, now I'm at v4 to try and make this work SP and MP once and for all

sour island
#

What was I helping you with like a day ago? V2?

gilded hawk
#

Nope, I was still working on v4

#

I have been working on v4 for the last 2-3 days now

sour island
#

Ah, I guess the poster says 2.0

#

Have you tried firing commands to apply the same effects on each client side?

gilded hawk
#

I'm still working on it

#

Does anyone know what code dictates if the hair are squished by the hat or not?

#

I wonder if it's dictated by the m_HatCategory in the xml ๐Ÿค”

sour island
#

If one of the hair guys is still around they might be able to help

#

people more inclined to be in modeling may know as well

nimble spoke
gilded hawk
nimble spoke
gilded hawk
jovial urchin
#

Hmmm... I think this doughnut is too large for my taste.
I started today learning how to mod PZ today, but I didn't expect 0.1 units in Blender to be the size of a massive house in-game with scale unspecified (scale=0.4 in the image).
Am I doing something wrong?

sage python
#

hmm

#

i'm having a weird issue where the mod i made, enabled on my server

#

isn't working for others

#

only me

timber river
sage python
#

it's a mod that replace car door opening/closing sound

#

only i can hear the change despite it being enabled on the server

sour island
#

There was even some vanilla items that were not scaled down when the world items were first added

sour island
timber river
sage python
#

hmm

#

nobody knows what's causing the issue?

jovial urchin
sour island
#

Most people just scale it down in the model script I believe

#

I wonder if there's a performance hit for that

sage python
red tiger
#

Good morning.

sage python
#

hello there

#

would be nice if you could tell me why i'm having this issue

red tiger
#

I wouldn't know. Sorry.

sage python
red tiger
#

If you wait a bit maybe someone will be around who might.

#

I'm still waking up.

timber river
sage python
#

it's a small mod i made for myself

#

but i have given the mod to my friends

#

and have it enabled on my server

red tiger
#

Oh then that might be it.

#

Yeah your game sees it because it's not on the other players' computer.

sage python
#

it is on their computer

#

can i send my mod here

timber river
# sage python it is on their computer

Yea no, that just aint gonna work.

Publish it to the workshop as unlisted and add it to your modid and workshopid settings lines. Then give it a try. If it still doesn't work we'll discuss further but it should work

sage python
#

why does it work for me tho

timber river
#

magic

jovial urchin
# sour island I wonder if there's a performance hit for that

Some optimization could be done with cutting down how many bytes one use for variables, but I don't think modders have the power to influence that trough models or mod files. Thereby, I also dont think scaling down has any performance hit, at least not after the item is already loaded. Still just a guess from me though.

And btw, found the perfect combo for my model sizes (see image): Scale to 0.4 in model script, scale to 0.01 when exporting model. Result: Properly sized doughnut (more accuratelly smultring in this instance).

red tiger
#

TIS can spend ~15 minutes introducing packaged primitives and primitive collection wrappers to Lua.

jovial urchin
red tiger
#

You don't have a choice on what size in bytes your numeric values uses, byte or float.

timber river
#

Say I have a client side mod, the lua files are in the client folder.

If I move them all to the shared folder... does that mean it is now a file that sends data to the server while also working on the client?

frank elbow
#

The folder you put the files in dictates what order the files load & what can be required (that is, client from client and shared, server from server and shared). If my memory isn't failing me, client files don't execute on the server, but everything else (including stuff in server) executes on both client and server

sour island
#

This may clear up how they interact

red tiger
#

I understand what Chuck is saying. I spent years optimizing several codebases for these exact issues.

timber river
#

ah gotcha, understood. I'm trying to understand why nested containers acts the way it does on servers (doesn't send inventory updates to the server)

red tiger
#

I've also been inside of PZ's Java & Lua codebase for over a few thousand hours. =/

#

A lot of improvements can be made not only with choice of data types. A giant optimization for runtime calculations of PZ would be moving from a decimal-based chunk solution for the map to a power of two chunk solution.

sour island
#

for example Remove() from containers is clientside and I guess expecting it to be in the player's inventory
but now there's a removefromserver function that in vanilla lua checks that it's not in players inventory

#

both are called in actions alongside eachother

red tiger
#

A fun side project would be to copy the PZ folder twice and modify one of them to use a map system based in pow2.

#

Benchmarking it would be fun.

ancient grail
jovial urchin
ancient grail
ancient grail
jovial urchin
ancient grail
#

Its not obvious

quasi kernel
#

i was originally planning to have some overlaps set up, but for V1 this will likely do.

#

(client can only really accurately track one generator because of how the UI is set up)

mellow frigate
#

you can use this if you prefer precision to beauty getIsoMarkers():addCircleIsoMarker(sq, r,g,b,alpha)

quasi kernel
#

does addCircleIsoMarker support radius properly?

mellow frigate
#

yes it does self.circleMarker:setPos(zone.x, zone.y, 0)
self.circleMarker:setSize(zone.ray)

quasi kernel
#

I see

mellow frigate
#

very similar to getWorldMarkers():addGridSquareMarker but ugly and precise

quasi kernel
#

The slight offset doesn't seem to be a huge issue on this scale thankfully, at least not from what it seems like

#

It lines up pretty well with the 20 tile radius

#

I may still look into the other implementation though, thank you for the heads-up.

mellow frigate
#

from memory the worst offset is on bottom or top of the screen

#

you can set boss at the same time to compare ๐Ÿ˜‰

#

both

wet sandal
#

Unplayable

#

Tfw you randomly access the random access memory

naive osprey
#

wow

#

Yo, just recently started learning LUA, I almost finished the add on mod but I'm missing one detail please help, what needs to be fixed so that an item that can be moved can be used with recipes.

--LOG -- RecipeManager -> Unable to create a recipe for this moveable item: Antiserum.LabSpectrometer.

ornate field
#

How do I flip the models, because I tried to do it in blender, but it didn't work

jovial urchin
#

Saw a sword mod that has a couple of rotation axis and such at 180deg. Maybe you can add this under your model (where you define mesh and texture) and use it to move the knife about as you need. I haven't tried anything such before, but it may work.

jovial urchin
ornate field
#

z

jovial urchin
#

Dont know

#

And in Blender, it may work if you rotate the mesh in edit mode, and not rotate in object mode, if that was what you where doing.

ornate field
#

Thanks man

timber river
#

For testing purposes, is it possible to add mods manually to a server without them being on the workshop?

wet sandal
#

Yea, I keep all my inprogress mods in the User/Zomboid/Workshop folder

#

Should be able to setup the server settings in game with the mod there

timber river
#

and just add them via mod id, forget the steam id?

wet sandal
#

Exactly, just skip the workshop bit

timber river
#

nice

#

thx

wet sandal
#

Got the stress test scenario for refreshing the grid down from 78ms to 5ms cherrypie

sour island
#

Nice difference

twilit rune
#

Hi there. I would be happy if an axperienced coder could look at this error and code and help me with fixing it.

Briefly speaking, after testing in Single Player and making sure that all works as supposed, I came to uploading update to workshop, however the results were not positive and I recieved multiple reports that the update was game breaking.

It might be a silly mistake, but in the current condition and moment, I am struggling to find a solution and test it on server. Thank you for your help .

function: spawnHelicopters -- file: UHSpawnHeli.lua line # 354 | MOD: UH 60 Helicopter SP/MP I V 2.0.
[07-05-23 00:13:56.950] ERROR: General , 1683407636950> 69 285 772> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getModData of non-table: null at KahluaThread.tableget line:1689..
[07-05-23 00:13:56.951] ERROR: General , 1683407636951> 69 285 772> DebugLogStream.printException> Stack trace:.
[07-05-23 00:13:56.953] LOG : General , 1683407636953> 69 285 774> -----------------------------------------
STACK TRACE
function: spawnHelicopters -- file: UHSpawnHeli.lua line # 354 | MOD: UH 60 Helicopter SP/MP I V 2.0.
[07-05-23 00:13:56.954] LOG : General , 1683407636954> 69 285 775> -------------------------------------------------------------
attempted index: getModData of non-table: null. ```
#

The code itself starting from line 352:

            local pl = getPlayer()
            if pl:getModData()["TriedHeliSpawn"] == nil then
                pl:getModData()["TriedHeliSpawn"] = {}
            end 
        
            -- Chance
            for i, p in ipairs(Heli_spawn_points) do
                if p.x == square:getX() and p.y == square:getY() and pl:getModData()["TriedHeliSpawn"][i] == nil then
                    pl:getModData()["TriedHeliSpawn"][i] = true
                    if ZombRandFloat(0, 1) < p.chance then
                        if pl:getModData()["SpawnedHeli"] == nil then
                            pl:getModData()["SpawnedHeli"] = {}
                        end
                        pl:getModData()["SpawnedHeli"][i] = true
                        spawnHeli(p.x, p.y)
                    end
                end
            end
        end
wet sandal
#

getPlayer() is returning nil

#

Perhaps a check to guard against it running as the server, as the server wouldn't have a player to return for getPlayer()

timber river
#

So this is kinda fun... you know how you can rename duffel bags in the base game?

It's not a fully MP compatible feature stressed if you rename something while it's not in your inventory (like in the trunk of a car) those changes won't be seen by the server unless the OG player puts the bag in their inventory. If the server restarts before that happens it'll revert to default

nimble spoke
naive osprey
ornate field
#

So after couple hours of trial and error.... It still is like this

#

Tried rotating it in blender, and attachments. Nothing worked

dusk arch
#

Would anyone have advice on how to write a patch mod to remove modded items from spawning? I specifically want to remove the skill books that another mod adds to the game. Normally I would just edit the distribution file of the mod locally, but I'm looking at running a server and so need a better solution.

bronze yoke
#

the easiest way is to just do what you're already doing but override their file in your mod

#

if a file with the same name and directory exists in multiple mods only the one with the latest load order will be loaded

thin hornet
#

there are lua functions to remove item from distribution too

#

make a mod that simply remove the item and load it after

mellow frigate
#

Has someone modelised or precisely described the Cell Vs Chunk Vs Mapload systems ?

thin hornet
bronze yoke
# mellow frigate Has someone modelised or precisely described the Cell Vs Chunk Vs Mapload system...

cell: the currently loaded area centered around the local player(s), size varies based on resolution; not related to 'mapping cells' which are 300x300 areas
chunk: 10x10 areas - the cell is always an integer number of chunks, a chunk is never 'half loaded'
mapload: are you referring to the OnPreMapLoad/OnPostMapLoad events? those are called before and after the cell object is first created when the game is loading

#

as far as i've been able to tell 'mapping cells' just straight up don't exist ingame

mellow frigate
bronze yoke
#

yeah, it's a very common confusion

mellow frigate
#

Also what happens to map objects (and zombies) when they leave the cell ? (when the cell leaves them). I see they are still available when the cell comes back later

bronze yoke
#

i honestly have no idea, i assumed they were unloaded immediately so you probably know more than me in that regard

viscid drum
#

So I'm trying to make a wallet thats like the keyring, but holds money. Does the keyring have some special code to make it show up as a container in the players inventory automatically?

thin hornet
#

distant objects are unloaded

mellow frigate
viscid drum
#

ty, i'll check it out

mellow frigate
viscid drum
#

was common bags the mod name?

thin hornet
#

loaded only when needed

#

things like food that rots are special code that probably use timestamps to compare and advance their rotten state for example

#

but as the food item is unload it doesnt exist anymore so it is not rotting unless you come back 3 days later, game loads it and compare the timestamp to update it rotten state

sour island
#

Yep, it's the setAge() function

thin hornet
#

its a theory i didnt check the source for what im saying

sour island
#

Generators technically do the same thing when you leave their cell

#

The only reason it does a loop in cell is for the noise checks

#

Otherwise it would also only ever update when you check it

mellow frigate
viscid drum
#

ah ok, ty

#

so can you only set it by category, or can you set it for exact items?

#

sorry for so many questions

mellow frigate
# viscid drum ah ok, ty

more precisely, for your wallet, you can add in the script AcceptItemFunction=MyFunction and implement function MyFunction(container,item)

bronze yoke
#

you can write a function to make it filter items by whatever you want

mellow frigate
#

in that function return true if the item is the one you want

mellow frigate
thin hornet
#

the power is written into squares

#

generator updates nearby square for the electricity value

sour island
#

There was a big bug with generators - I think if you came back quick enough from out of the cell the fuel wasn't spent

mellow frigate
# thin hornet the power is written into squares

so if I leave my generator zone when he is nearly depleted and comes back 1 month later and wake up my fridge before the generator, the food will be considered fresh. If I wake up my generator before my fridge, the food will be rotten ?!

#

I'll change my base layout immediately ๐Ÿ˜„

thin hornet
#

honestly its misterious how things works lol

mellow frigate
thin hornet
viscid drum
#

ty, I was looking at the luaexample in the vanilla folder trying to figure this out

thin hornet
#

i had an unreleased mod with all money and wallet things just like you want to do. Pennies, Dimes etc

#

not sure where that is now

viscid drum
#

yeah the one on the workshop wasn't working for me because i think they copied the itemapi code and slapped it in their module. I was trying to make something simple just for the credit cards and money in the game.

#

turns out trying to just copy the keyring item script didn't work out lol ๐Ÿ˜ฆ

thin hornet
#

yeah editing base wallets is a pain

#

had a lot of trouble getting wallets to work

#

at some point my player were just not using them cause of random bugs where they lost their money etc

#

So i made custom wallets and removed base wallets

#

you could use ReplaceItemInDistribution to replace them if you end up making custom(using same texture and models) one, but this would also remove existing(prior to installing that mod) wallet in save games

viscid drum
#

tysm, I got them accepting only money and credit cards now

#

now i just gotta get them working in the player inventory

thin hornet
#

you mean like without equipping them in hands?

viscid drum
#

yeah

thin hornet
#

check in media\lua\client\ISUI\ISInventoryPage.lua line 1343

lone nest
#

OK, I am curious, at what point is a mod considered "abandoned"?

dusk arch
viscid drum
thin hornet
# lone nest OK, I am curious, at what point is a mod considered "abandoned"?

There isn't a universally agreed-upon definition for when a mod is considered "abandoned." However, a mod can generally be considered abandoned if it meets some or all of the following criteria:

- Lack of updates: The mod hasn't received any updates or bug fixes for an extended period, which could be anywhere from several months to years.
- Unresponsive developer(s): The mod author(s) or team is no longer responding to user inquiries, bug reports, or feedback on their official channels (e.g., forums, websites, social media).
- Incompatibility with newer game versions: The mod is no longer compatible with the latest version(s) of the game it was created for, and the developer(s) have not provided any updates to address this issue.
- Declared abandonment: The mod author(s) or team has explicitly stated that they will no longer support or develop the mod.
- Disappearance of the mod from official channels: The mod has been removed from its official hosting platform(s) by the author(s) or team, without any indication of plans to re-upload or continue development.

It's important to note that the perception of abandonment can vary among the community, and sometimes, mod authors may resume work on a mod after a long hiatus. In other cases, abandoned mods may be picked up by other developers or modding teams and given new life.

lone nest
#

I've been trying to follow-through and get clarity, even email TIS (no response though >_<)

thin hornet
#

Contact the mod author and ask the community. It's usually common sense but also the community may know about the mod author if he disapeared etc

lone nest
#

Also, for more context...
Mod in question: https://steamcommunity.com/sharedfiles/filedetails/?id=1905148104

I have been working to update that since I found it on the steam workshop, but it has not been updated for over 3 months.
There have been a ton of issues with the mod reported by the mod users and the author has not responded to any of them.
However, there are some functioning stuff that got me interested enough to update it on my own and run it locally for my own use.

I reached out to the current author, who has been non-committal about letting me updating it... and unclear about me distributing it on the workshop.
Current Author is "loosing drive" to update
https://steamcommunity.com/workshop/filedetails/discussion/1905148104/3823036151085423787/#c3823036783902626787

My permission request thread
https://steamcommunity.com/workshop/filedetails/discussion/1905148104/3823036151095293803/

The other (previous) author permitted the go ahead using the current author's mod as a base.
https://github.com/DartVonRyuu/SuperiorSurvivors_Revisited/discussions/52#discussioncomment-5738269

#

Removing the embeds...

sour island
#

So it would be a rollback effectively

thin hornet
mellow frigate
thin hornet
#

so create a server/MyMod_AcceptFunction.lua file and add your function in it, make sure to prefix your function too, so it doesnt conflict with other mods

viscid drum
# mellow frigate How do you add code here ?
-- This is based off media\lua\server\Items\AcceptItemFunction.lua

WAcceptItemFunction = WAcceptItemFunction or {}

function WAcceptItemFunction.Wallet(container, item)
    local itemName = item:getFullType()
        return itemName == "Base.CreditCard" or itemName == "Base.Money" or itemName == "Base.SheetPaper2"
end
#

thats what mine looks like and it works

mellow frigate
bronze yoke
#

```lua
-- code
```

viscid drum
#

oh sorry ๐Ÿ˜ฆ

lone nest
#

3 tilde marks (left of 1) i think

mellow frigate
#

'''lua -- code '''

viscid drum
#

it was smudged out on the keyboard :S

bronze yoke
#

` not '

mellow frigate
#

lua --code

#

thx

thin hornet
#

then in your script.txt you would use:

...
AcceptItemFunction = AcceptItemFunction.Wallet
...
#

there are two way to limit container item:
OnlyAcceptCategory
AcceptItemFunction

mellow frigate
bronze yoke
#

from what i've heard there's already multiple continuation projects for superb survivors

lone nest
#

... in fact, are you the author of "CharacterSave"?

lone nest
#

right, the author apparently had a "required" import of your mod that I had to remove, turns out he never credited you... so uh, I guess i'll apologize on his behalf.

mellow frigate
#

the former was initiated long before the later.

#

and topics looks very different

lone nest
#

Don't ask me, I saw it in the code

#

and I was wondering why it was required

#

and since I found out it wasn't actually used anywhere, I removed it in my own update

bronze yoke
#

if it's required but not used it was probably to enforce load order

mellow frigate
#

yeah so it was only a require failed warning in the console log. not a dependency

bronze yoke
#

and i don't think a require call is really something you need to credit someone for ๐Ÿ˜… (if it's not actually then using the code it's requiring)

viscid drum
#

hrm, so i must be doing something wrong, i have this in the lua > client folder

#
    local it = playerObj:getInventory():getItems()
    for i = 0, it:size()-1 do
        local item = it:get(i)
        if item:getCategory() == "Container" and playerObj:isEquipped(item) or item:getFullType() == "Base.Wallet" or item:getFullType() == "Base.Wallet2" or item:getFullType() == "Base.Wallet3" or item:getFullType() == "Base.Wallet4" then
                -- found a container, so create a button for it...
                containerButton = self:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
                if(item:getVisual() and item:getClothingItem()) then
                    local tint = item:getVisual():getTint(item:getClothingItem());
                    containerButton:setTextureRGBA(tint:getRedFloat(), tint:getGreenFloat(), tint:getBlueFloat(), 1.0);
                end
mellow frigate
lone nest
mellow frigate
lone nest
#

Yeah, IMO, the author overgrew what it should have been doing.

viscid drum
sour island
#

You'd be better off asking Aiteron for his project tbh

#

or permission to continue a fork of it

#

SuperbSurvivors is not written very cleanly, and when Nolan returned he smushed all the codebases together quickly

#

So you have many many hands and very little QA

#
  • it is old
thin hornet
#

let me try something to show you

lone nest
sour island
#

He never uploaded it afaik and he never "finished" it

cinder kindle
#

My mod doesn't work with PZPW but work when I create all files manually. What is the problem ? (I don't know if it is well explained)

sour island
#

He has a discord server - but he was hired on -- he's the same Aiteron in red at the top

lone nest
#

Ah... then he must be working on that for build 42/43...

sour island
#

Someone uploaded it to the workshop - gross

#

I don't see his server so I guess he closed it

lone nest
#

Ooof.

cinder kindle
lone nest
#

all i wanted were some npcs to guard the base with a rifle and maybe automate some farming work.

sour island
#

try dming him ๐Ÿคทโ€โ™‚๏ธ

#

I'm not sure if he wants it continued

thin hornet
thin hornet
# viscid drum hrm, so i must be doing something wrong, i have this in the lua > client folder

try adding this to your client script:

Events.OnRefreshInventoryWindowContainers.Add(function(_self, event)
    if event ~= 'begin' then
        return;
    end

    local playerObj = getSpecificPlayer(_self.player)
    if _self.onCharacter then
        local it = playerObj:getInventory():getItems()
        for i = 0, it:size()-1 do
            local item = it:get(i)
            local fullType = item:getFullType()
            local isWallet = fullType == "ModuleName.Wallet1" or fullType == "ModuleName.Wallet2"
            if item:getCategory() == "Container" and isWallet then
                -- found a container, so create a button for it...
                containerButton = _self:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
                if(item:getVisual() and item:getClothingItem()) then
                    local tint = item:getVisual():getTint(item:getClothingItem());
                    containerButton:setTextureRGBA(tint:getRedFloat(), tint:getGreenFloat(), tint:getBlueFloat(), 1.0);
                end
            end
        end
    end
end);
sour island
#

Idk if this was the latest pass or not

lone nest
#

Yeah, over 2 years ago at a glance.

cinder kindle
#

I am the greatest noob, you all are just imitations

thin hornet
#

remember after publishing the mod to the workshop it will assign an ID, add that id to your pzpw-config.json so that it generate the correct stuff after

cinder kindle
thin hornet
#

Well you can even try asking chat gpt but otherwise just ask here lol

lone nest
# sour island https://github.com/aiteron/NPC

Thanks! I don't know if I'll use that or ask to use it; but the code itself is definitely easier to read than what I had to work with in SS...
it's definitely something I can try referring to if I ran into an issue.

sour island
cinder kindle
thin hornet
#

Honestly idk what is a stupid question, try researching and if you dont find ask here.

cinder kindle
#

yep I think I will learn more how to find the answer by myself before asking here jaques_beaver ๐Ÿค

lone nest
#

ChatGPT won't help much with PZ-specific LUA... but it can help you automate some functions generation.