#mod_development

1 messages ยท Page 519 of 1

tribal marsh
#

VS Code is nice - but people hate Michaelsoft

drifting stump
#

vs code is way too overkill

tribal marsh
#

its the only editor I have that has Copilot

drifting stump
#

my issue with vs code is how heavy it is

#

its in between a text editor and a real ide

tribal marsh
#

True, but its mostly just text editor. I have VS2022 for applications development, I wish that app wasnt so heavy

drifting stump
#

same but it do be a real ide with a lot of features

tribal marsh
#

Even if it doesn't install with the correct dependencies sometimes...

#

I had an issue with it where it didnt know where to get packages from on a clean install

#

so to utilize getPlayer:

local PID = player:getPlayer("username").."."..player:getPlayer("OnlineID")
drifting stump
#

nope

tribal marsh
#

I don't really know what getPlayer returns >.>

drifting stump
#

getPlayer()

#

all you need

#

it returns ISOPlayer

tribal marsh
#

so, it just returns the object

bitter frigate
#

it gets the player from the client right?

tribal marsh
#

is ISOPlayer.SaveFileName unique per player character?

drifting stump
#

its client side code so yes

bitter frigate
#

my mod keeps breaking on SugarValue = SugarValue - (ISF*10) (which is meant to decrease SugarValue) and i don't know why. any help would be appreciated!

function Diabetes.ISF()
     ISF = 25 -- a placeholder until I can figure out how to randomize ISF per run
end

function Diabetes.OnEat_OneUnit(food, player, percent)
    local script = food:getScriptItem() -- i assume this grabs the syringe (and everything else) from the script items.txt
    SugarValue = SugarValue - (ISF*1)
    -- One unit syringe
end

function Diabetes.OnEat_FiveUnit(food, player, percent)
    local script = food:getScriptItem()
    SugarValue = SugarValue - (ISF*10)
    -- Five unit syringe --temportarily 10 units
end
drifting stump
#

i dont see an ISF variable declared

#

assuming its declared outside of this snippet

#

@bitter frigate is it declared somewhere else or is Diabetes.ISF() it

bitter frigate
drifting stump
#

well it is

#

but within that scope

#

though it shouldnt matter since its not a local if it ran once it should be left as a global

#

which you should be careful not to bloat the global name space

bitter frigate
#

i mean yes obviously it'll be a pain and labor-intensive to sort out LATER but like. that's the grind

drifting stump
#

just get in the habit of declaring everything as local

#

and think do i need this globally

#

which is almost always no

#

im guessing the error its throwing is something to do with nil so i think you didnt run Diabetes.ISF() to set the global

bitter frigate
#

but in a case like ISF and SugarValue where i'm using it ALL OVER THE GODDAMN PLACE is it an acceptable amount of bloat?

bitter frigate
drifting stump
#

well they dont need to be global

#

do you need to access them from another file

bitter frigate
#

probably not. i hadn't realized global was for inter-file variables.

#

...i apparently already made it local. i don't remember doing that but HEY

tribal marsh
#

This look correct?

local playerObject = player:getPlayer()
if !modData.exists(playerObject.SaveFileName()) then
    modData.create(playerObject.SaveFileName())
end
local PlayerNetWorth = modData.get(playerObject.SaveFileName())

edit: Why did I try to c# this....

drifting ore
tribal marsh
#

ZombRand() only generates integers correct?

#

How do I generate a double?

#

Or... it looks like it is double actually...

#

Weird, i've never seen it generate numbers with decimals... am i missing something?

tribal marsh
#

Take local getMoney = ZombRand(1,2) This only gives me a 1 or 2, no decimals from what I've seen

sour island
drifting ore
#

nope XD

#

where did you get the woman image XD

drifting ore
bitter frigate
#

i've moved on to trying to get carbohydrates to work for me and come to the troubling conclusion that there's no simple way to tie a function to carb counts without going Deeper. so. my solution to not being able to get carb counts on their own is to take the difference between the carb count of a player before and after they eat, divide that by their insulin:carb ratio, then multiply that by their ISF and finally add that to their SugarValue. i know i'll be using nut:getCarbohydrates to make those caluclations. trouble is, i don't actually know how to grab the data before eating OR the data after eating FOR calculations. any help?

terse matrix
#

Can you guys make a mod where your health bar slowly goes down until 60 years have passed and you die of old age?

tribal marsh
#

Sounds easy, if I could figure out how modData tables work

nova oriole
#

someone use skill recovery journal mod?

tribal marsh
#

What about it?

tribal marsh
#

Well, "Can" is different from "Will" - No promises lol

tribal marsh
#

Yeah I have no idea how moddata works. The only documentation only ever has things like Function is Function without any examples so

#

Would anyone be willing to do a one on one with me so I can figure out the nuances and were to get the information I need?

hollow shadow
sour island
sour island
hollow shadow
#

this is fine

undone crag
#

What posters?

sour island
undone crag
#

:o

drifting ore
#

lmao XD

sour island
#

Shes an actual hand model

#

this was a close runner up

tribal marsh
#

I find it hilarious you "South Park Canadian"d it

sour island
#

makes it more expressive

tribal marsh
#

Someone tell me if this is structurally sound, I'm very lost:

function Recipe.OnCreate.CountMoney(items, result, player)
    local luck = ZombRand(0,55)
    if player:HasTrait("Lucky") then
        luck = luck + 4
        if luck > 55 then
            luck = 55
        end
    end
    local getMoney = 0.00
    local OldPlayerNetWorth = player:getModData().Networth
    if luck == 55 then
        getMoney = ZombRand(2500,7500)*0.01
        player:Say("Awesome! $"..tostring(getMoney).."!")
    end
    if luck <= 10 then
        getMoney = ZombRand(1,80)*0.01
        player:Say("$"..tostring(getMoney)..".")
    end
    if luck <= 30 and luck >= 11 then
        getMoney = ZombRand(100,200)*0.01
        player:Say("$"..tostring(getMoney)..".")
    end
    if luck <= 45 and luck >= 31 then
        getMoney = ZombRand(400,800)*0.01
        player:Say("$"..tostring(getMoney)..", cool.")
    end
    if luck <= 50  and luck >= 46 then
        getMoney = ZombRand(1000,1500)*0.01
        player:Say("$"..tostring(getMoney)..", nice.")
    end
    if luck <= 54  and luck >= 51 then
        getMoney = ZombRand(1800,2500)*0.01
        player:Say("$"..tostring(getMoney).." sweet!")
    end
    local NewPlayerNetWorth = OldPlayerNetWorth + getMoney
    player:getModData().NetWorth = NewPlayerNetWorth

end
undone crag
#

What is luck?

tribal marsh
#

a randomly generated int from 1 - 55

#

somehow that didnt make it into my snippit

#

The main thing i'm trying to figure out is if player:getModData().NetWorth works

undone crag
#

Is it a global variable?

#

That was a lot of lag.

#

My old message suddenly appeared for some reason after not appearing.

tribal marsh
#

Above question was about luck correct? i've edited the original code block

#

Its local

undone crag
#

Yes it was. I entered it before you answered.

#

You use of getModData seems fine to me.

#

Oh

#

You use differing capitalisation.

tribal marsh
#

Oh, i see that. Good catch

#

But is that seriously how that works?

#

What defines "NetWorth"? I understand lua isnt really object oriented but java is. Does this information just get created on the fly?

undone crag
#

OldPlayerNetWorth will be nil if player:getModData().Networth is not defined.

#

you could do

local OldPlayerNetWorth = player:getModData().Networth or 0
tribal marsh
#

So effectively player:getModData().NetWorth = someValue defines it.

#

Its not limited to some exclusive type somewhere?

#

if so, player:getModData().NetWorth is global, and keeps the data until logout? Sorry, there's alot of things I'm not so sure about.

undone crag
#

The data is kept saved in the save files, except for java object references, I think.

tribal marsh
#

If that's the case, even better!

thin hornet
#

oh man the next update is exciting

pure ermine
#

yes

#

basically npcs lite

opal wind
#

i wish they add a bow & arrow before npcs ๐Ÿ˜›

pure ermine
#

its the hunting system and reworked ranged weapons including bows

#

which will feature animals

#

they admitted people might be able to use it to reverse engineer the npc human system

opal wind
#

they are adding the hunting system on the next update too?

pure ermine
#

the hunting system IS the next update

#

"t may be the initial build still contains hunting and wild animals, they ARE NPCs after all. It may be they drop into a subsequent build or later on in the unstable beta cycle, its not clear yet for reasons weโ€™ll discuss in a bit. But the next BIG thing will be NPCs and weโ€™ll have a dedicated team working toward this goal going forward."

bitter frigate
#

ok i've done more thinking and i can now articulate that i want to write a function that stores a dynamic number's value (in this case nut:getCarbohydrate) and then checks that same dynamic number some period of time later without dumping the previously stored value, but i'm still at a loss for how to accomplish this. if anybody has any advice or relevant tutorials i'd devour them

cursive escarp
#

Is there any mods that allows building or fixing the vanilla windows/doors on houses?

tribal marsh
#

@bitter frigate From my conversation above I've figured out how to store data in objects - use that to accomplish your needs.

Unless I'm misunderstanding

undone crag
#

anger what do you want to do that for?

bitter frigate
tribal marsh
#

I just tested it, persists through logouts and is attached to the player

#

So you could do something like:
player:getModData().BloodSugar = value

bitter frigate
# undone crag anger what do you want to do that for?

there's not a good way to identify how many carbs were in a food that was just eaten, so i'm trying to calculate the difference between the carb value before you eat and after you eat, to get the actual carb count of what you ate. i think i need to use nut:getCarbohydrates to accomplish this, but i dont know how to store the value and then, some period of time later, check it against the new value of the same variable

serene wing
#

Anyway to go into creative mode to check all the items are working?

bitter frigate
tribal marsh
bitter frigate
serene wing
#

Does the cheat menu work in mp Im just trying to check if all the modded items are working on my mp server

tribal marsh
#

Yes

undone crag
tribal marsh
#

although, why not just use admin

serene wing
#

Well how do I enter creative mode with admin?

tribal marsh
#

setuseraccess \your username\ admin

serene wing
#

I only have the godmode and invis

#

Do i type that in chat?

tribal marsh
#

your server console

serene wing
#

how do i open it?

tribal marsh
#

Your server dedicated or hosted?

serene wing
#

hosted

tribal marsh
#

So in that case, you need to add yourself as admin for your local server

#

should be in C:\Users[username]\Zomboid

#

its somewhere in there

serene wing
#

mk

#

btw

#

Is it common when starting a world/server to see a few errors or?

bitter frigate
tribal marsh
#

Depending on your mods maybe... could be checking for other mods existing and not catching the error when it doesnt

#

maybe check your console.txt

#

see if its important

undone crag
#

Is it because of it depending on how much of the food the player ate?

#

Oh for some reason I thought you did not have a function to get the carbohydrate for anything D:

tribal marsh
#

can you check the percentage of how much was eaten? then you can just do math

bitter frigate
bitter frigate
tribal marsh
#

does player: have a value that stores current carbs?

undone crag
#

I'm not sure on the reason but this should tell the carbohydrate change.

do
local ISEatFoodAction_perform = ISEatFoodAction.perform
function ISEatFoodAction:perform()
    local carbohydrate_before = self.character:getCarbohydrates()
    ISEatFoodAction_perform (self);
    local carbohydrate_after = self.character:getCarbohydrates()
end
end
#

ps fixed spelling mistake and another thing

bitter frigate
bitter frigate
undone crag
#
do
--stuff
end

There is just to avoid that local variable ISEatFoodAction_perform being visible in functions defined below it.

#

What that code does is make a variable ISEatFoodAction_perform referring to the original function, then it makes a new function of the same name as the original, replacing the contents of that name, with a new function. The new function runs the original function.
(Farewell)

drifting stump
serene wing
#

The grenade launcher in the paw mod isnt working anyone know why?

tribal marsh
#

Is there a math.floor function in kahlua?

bitter frigate
tribal marsh
#

Hmm....

cold igloo
#

its my first time modding
anyone has a collection to share?

bitter frigate
#

something in the last section of my mod is throwing everything off, YET AGAIN. if i have to play more comma whac a mole i'm gonna CRY i thought i was SAFE

-------------------------------------------------------------------------------------------------
-- raises blood sugar on carbohydrates ----------------------------------------------------------

function Diabetes.EatCarbs()
    do
        local ISEatFoodAction_perform = ISEatFoodAction.perform
            function ISEatFoodAction:perform()
            local carbohydrate_before = self.character:getCarbohydrates()
            ISEatFoodAction_perform (self);
            local carbohydrate_after = self.character:getCarbohydrates()
        end
    end

    local carbs = carbohydrate_after - carbohydrate_before
    local SugarValue = SugarValue + (carbs / RATIO * ISF)

end

Events.EveryTenMinutes.Add(Diabetes.EatCarbs)
tribal marsh
#

I am so VERY confused by ZombRand()

#

95% of the time it outputs a integer (eg 9, 25, 60)

#

but that other 5% the output is 22.000000000000000000000012

snow path
#

Anyone have a spawn file template?

weary matrix
#

4K+ subscribers in 48hours + a few hours, guess people are happy with the new mod ๐Ÿ˜…

tribal marsh
#

I subbed to it.

#

its handy

#

this is hella frustrating though:

weary matrix
#

not 100% sure pz kahlua has string.format though

tribal marsh
#

it has math.floor and math.ceil

#

i've tried methods with those with no luck

#

but lets try the string.format

opal wind
#

hey guys i made a radio as an attachment, i wonder if there is a way to keep the radio ON when its not equiped on primary?

#
item Wiz_SentaiHelmet_Chip_Radio
    {
        DisplayCategory     = Communications,
        Type                = Radio,
        Icon                = Wiz_Chip2,
        Weight              = 0.1,
        DisplayName            = Sentai Helmet Chip Attachment (Radio),
        UseDelta            = 0.005, 
        DisappearOnUse        = FALSE,
        TwoWay                = FALSE,
        UseWhileEquipped    = FALSE,
        IsPortable            = TRUE,
        IsTelevision        = FALSE,
        BaseVolumeRange        = 10,
        MinChannel            = 88000,
        MaxChannel            = 108000,
        TransmitRange        = 0,
        MicRange            = 0,
        UsesBattery            = TRUE,
        IsHighTier            = FALSE,        
        AttachmentType         = Wiz_AttachRadio,
        WorldStaticModel    = Wiz_chip_ground_radio,
        Tooltip             = Tooltip_item_Radio,
    }```
tribal marsh
#

string.format("%.2f", amount) works. I just have to tonumber() when i want to do math.

#

a bit frustrating but at least it works

weary matrix
willow estuary
#

You can disable radios turning off when not held in-hand via lua, but they won't transmit or receive when not-in-hand, even if they are on.

tribal marsh
#

Well, the result is said aloud, then its added to the total, then stored

#

so i'd have to convert twice

opal wind
tribal marsh
#

Any way to add a text element to this panel of the UI?

#

Under "Zombies Killed"

willow estuary
# opal wind this is dictate by type = radio i assume? isnt there a way to create a new type=...

Changing the type wouldn't enable it. It's a deliberate hard coding in the java files for PZ that inventory items cannot receive or transmit radio messages unless equipped in a hand.
Might be possible to create a whole new system in lua to piggyback the radio system, and peek the contents etc, and use that to communicate messages to not-proper radios. But it wouldn't be a simple newbie project by far?
I don't like that state of affairs, but that's just it's how it is?
Also, new item types, akin to "Food", "Weapon", "Container", "Radio" aren't something that can be made without modifying the PZ java.

grizzled grove
tribal marsh
#

\media\lua\client\ISUI\ISInfoContainer.lua maybe?

#

Ehh, this file is pretty cryptic to me

opal wind
#

what happens if i set this to TRUE?

#

UseWhileEquipped = FALSE,

shut valley
#

i think this is it

tribal marsh
#

Sure seems like it

grizzled grove
#

seems like a good example to work from

willow estuary
#

From radio/devices/DeviceData.class, "why inventory item radios will not work for broadcasting or receiving transmissions unless they are held in a hand"

       if (isoPlayer.getPrimaryHandItem() == radio) {
          byteBufferWriter.putByte((byte)1);
        } else if (isoPlayer.getSecondaryHandItem() == radio) {
          byteBufferWriter.putByte((byte)2);
        } else {
          byteBufferWriter.putByte((byte)0);
        } 
undone crag
#

It also referrs to the variables RATIO and ISF which you may or may not have made global variables elsewhere. Finally, even if the final line in the function worked, it is just creating a local variable called SugarValue which will not overwrite a global variable by the same name.

bitter frigate
undone crag
#

local variables are just variables visible within the scope. If you just put local hello = 1337 at the top line of your lua file, each function in the file will be able to do print(hello) and it will print 1337. Other lua files can not access that variable (unless you do something). If you instead put local hello = 1337 in the middle of your code, only the functions below it will be able to use the variable, because the local variable only existed after that point. If you create a local variable in a function, then after the function finished running it deletes the local variable (Unless there is a way of getting around that but I will ignore that).

#

Instead of hooking that code onto ISEatFoodAction:perform every time the ten minutes event runs, which will make that function gradually bigger and bigger with each ten minutes thing, you could do it just like all the other functions and only have it run that code when the lua is loaded by the game.

#

Something like this would do something (with RATIO and ISF added).

-------------------------------------------------------------------------------------------------
-- raises blood sugar on carbohydrates ----------------------------------------------------------

do
    local ISEatFoodAction_perform = ISEatFoodAction.perform
    function ISEatFoodAction:perform()
        local carbohydrate_before = self.character:getCarbohydrates()
        ISEatFoodAction_perform (self)
        local carbohydrate_after = self.character:getCarbohydrates()
        local carbs = carbohydrate_after - carbohydrate_before
        SugarValue = SugarValue + (carbs / RATIO * ISF)
        print("SugarValue", SugarValue)
        self.character:Say("SugarValue" .. tostring(SugarValue))
    end
end

function Diabetes.EatCarbs()


end

Events.EveryTenMinutes.Add(Diabetes.EatCarbs)
bitter frigate
#

so if i move everything under the IsEatFoodAction:perform() function i eliminate the need to have function Diabetes.EatCarbs(), right? since the function is already getting called when i want it to (IsEatFoodAction) and DOING what i want it to (increasing SugarValue by carbs/ RATIO * ISF. adding in Diabetes.EatCarbs() would only serve to create a NEW function, right?

#

i mean i'll find out when i next run the game but i'm hopeful my understanding is sound

undone crag
#

Maybe.

small topaz
#

hi! is it possible to define custom lua events? so far, i tried adding the command 'triggerEvent("MyCustomEvent", self.character)' to the code where the event should be triggered. This works without throwing an error. However, when I try to call a function during this new event via 'Events.MyCustomEvent.Add(myTestFunction)' I get an error essentially stating sth like 'Exception thrown java.lang.RuntimeException: attempted index: Add of non-table: null at KahluaThread.tableget'. thanks for any help! (to give more context: i try to do stuff when the character starts the situp animation as well as when the character does "sit on ground" but didn't find any predefined events for this.)

tribal marsh
#

Anyone know what this corresponds to:

quasi geode
small topaz
# quasi geode `LuaEventManager.AddEvent("MyCustomEvent")`

many thanks!!!! you always seem to know what's going on very fast!! any hints where i should add your line of code "LuaEventManager.AddEvent..."? can i just do this in the same function where i use the "triggerEvent(...)" command?

bitter frigate
quasi geode
small topaz
#

thanks!!!

#

omg! works so smooth! many thanks again!!

quasi geode
bitter frigate
undone crag
#

D:

tribal marsh
#

dont worry anon, you are also a hero

small topaz
# quasi geode before `Events.MyCustomEvent.Add(myTestFunction)`

is there also a way to assign parameters to the event? for example, if i trigger it via "triggerEvent" and i have a variable "data" there. can i tell the function "myTestFuntion" when it is called via "Events.MyCustomEvent.Add(myTestFunction)" that it should use "data"?

tribal marsh
#

Definitely more knowledgeable than me xD

quasi geode
small topaz
#

many thanks! just tried it and found out by myself that you can append some (up to 5 i think) objects in the triggerEvent command. makes things so much easier!

cold burrow
#

I just trying to learn how to use that library with methods.

quasi geode
#

ya it supports a few args

undone crag
#

(it was D: about me not checking if getCarbohydrates could be run on an isoplayer)

bitter frigate
# undone crag D:

YOU'RE MY HERO TOO ANON in a major way i just didn't want to make you uncomfortable iwhrqwiorhq

cosmic plaza
#

Looking for a Chatbox mod to add titles and colors into my servers chat! Does anyone have any suggestions? I have tried looking into making one but im no code writer lol

drifting ore
#

fallout mod when

drifting ore
#

sooo

#

my mod isnt working

#

and i cant figure out why

#
require "Definitions/SLEO_AttachedWeaponDefinitions"

print ("AttachedWeaponDefinitions:"..tostring(AttachedWeaponDefinitions))

print("AttachedWeaponDefinitions.LongGunOnBack:"..tostring(LongGunOnBack))

if AttachedWeaponDefinitions.LongGunOnBack then AttachedWeaponDefinitions.LongGunOnBack.weapons = {} end

if AttachedWeaponDefinitions.PoliceHandGun then AttachedWeaponDefinitions.PoliceHandGun.weapons = {} end
#

its just this line of code

#

and it doesnt activate

#

for whatever reason

#

im trying to remove this weapon table

#

-- For Specific Outfits --

-- assault rifle on back
AttachedWeaponDefinitions.LongGunOnBack = {
    id = "LongGunOnBack",
    chance = 30,
    outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
    weaponLocation =  {"Rifle On Back"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.AssaultRifle",
        "Base.AssaultRifle2",
        "Base.Shotgun",
    },
}```
#

weapons

#

it should remove it

#

iunno why it isnt

small topaz
#

is there a good way to artificially delay the execution of a specific lua funtion for a few seconds? i am trying to "synchronize" the execution of a certain function i wrote with a certain vanilla animation. the function in question is called via an event trigger (ie "triggerEvent("MyCustomEvent")" and Events.MyCustomEvent.Add(myFunction)").

#

i know that there is a certain lua function called os.clock() but i am not sure if it is a good idea to use it in a mod...

#

or is it safe to use stuff like os.clock() or luasocket in a mod?

#

Only workaround which only uses pz stuff I found so far would be using Event.OnTick somehow but not sure if that is a good idea.

#

ok... luasocket doesn't seem to work in pz code...

opal wind
tribal marsh
#

os.* isnt implemented in kahlua afaik

willow estuary
small topaz
#

a related question: is there a way to get the current game "tick"? i mean those "ticks" which are used in the lua event Events.OnTick.

opal wind
#

what about colored lights? is there a way to make a custom flashlight with it?

lapis scroll
#

Should this be the correct way to load in a new value for an existing distribution table? I'm not getting an error but it doesn't feel like it's being overwritten

SuburbsDistributions["all"]["inventorymale"].items["Base.Cigarettes"] = 3
snow path
#

Hello, I have a few problems with my mod. First, I am able to spawn my modded firearm, but unable to find it in its supposed natural spawns like police armories, gun shops etc.

Next is the fact that it still shows the vanilla shotgun model whenever I have it equipped.

Lastly, is with the audio, all of it became muted when I added some new audio files to it.

#

Do you know how to fix this?

snow path
#

Yes, they all are.

drifting ore
#

if you send me a zip i can take a look

#

and then tell you what it is

opal wind
#

hey guys, i notice i set this on my robocop gun to fire 3 shots at 1 time, but its not working, nor the clip is spending 3 at time, it spend only one, what im missing here?

#

ProjectileCount = 3,

thin hornet
#

Anyone figured a way to prevent opening door with the keyboard shortcut >?
The keyboard shortcut "E" doesnt use the TimedAction as it seem to be hardcoded into the java.
So basically we can prevent opening door/window from clickhandler, joypad and context menu, but all this is useless cause the E key will just open it anyway.
Temp solution disabling the keybind for interact when i need to.

cold burrow
opal wind
#

will do

#

thanks

drifting ore
#

so anyone figured it out?

#

i cant remove this table for the life of me

#
require "Definitions/SLEO_AttachedWeaponDefinitions"

print ("AttachedWeaponDefinitions:"..tostring(AttachedWeaponDefinitions))

print("AttachedWeaponDefinitions.LongGunOnBack:"..tostring(LongGunOnBack))

if AttachedWeaponDefinitions.LongGunOnBack then AttachedWeaponDefinitions.LongGunOnBack.weapons = {} end

if AttachedWeaponDefinitions.PoliceHandGun then AttachedWeaponDefinitions.PoliceHandGun.weapons = {} end
#

current code

#

i want to remove this code

#

-- For Specific Outfits --

-- assault rifle on back
AttachedWeaponDefinitions.LongGunOnBack = {
    id = "LongGunOnBack",
    chance = 30,
    outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
    weaponLocation =  {"Rifle On Back"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.AssaultRifle",
        "Base.AssaultRifle2",
        "Base.Shotgun",
    },
}```
#

the weapons part

#

i thought of trying this ```table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);

table.remove(AttachedWeaponDefinitions["PoliceHandGun"].weapons,1);
table.remove(AttachedWeaponDefinitions["PoliceHandGun"].weapons,1); ```

#

just remove the first part of the table 3 times over

#

help?

dense fable
#

what's the mod called that integrates with the twitch chat?

odd notch
#

is there a simple way to get the variables an item has? e.g. MaxRange, etc

#

as in, the variable names

drifting stump
#

@odd notch

#

fixed some values i forgot to remove a java keyword which doesnt matter for this purpose

odd notch
#

ahhh thanks

#

i'm trying to find the generator's range variable

#

assuming it exists

#

and isnt hardcoded java

drifting stump
#

from what i know generators are mostly hardcoded

odd notch
drifting stump
#

let me look at generators

bronze arch
#

Hey ya'll, any guides out there for updating a mod to make item placeable? Or where in teh game's files I can look for the logic to figure it out myself? TIA

drifting stump
#

@odd notch

private static final int GENERATOR_RADIUS = 20;
#

and final means it cant be changed

odd notch
#

is that in the IsoGenerator class?

drifting stump
#

yes

odd notch
#

thank u browser8

drifting stump
#

np

lavish pine
#

how can I get which item the player is using? after searching in the isoPlayer fields, I found nothing

drifting stump
bronze arch
#

item Book
{
DisplayCategory = Literature,
Weight = 0.5,
Type = Literature,
UnhappyChange = -40,
DisplayName = Book,
StressChange = -40,
Icon = Book,
BoredomChange = -50,
StaticModel = Book,
WorldStaticModel = BookClosedGround,
}

Anyone know what folder I can find for example "book" icon?

#

I can find the model and texture but the icon isn't apparent

drifting stump
#

probably in the pack files

bronze arch
fair frost
#

Remaked Riverside Livery

lavish pine
#

how can I find a function by its name? Manually search for it in the lua folder or is there some way faster and easier?

drifting stump
#

my text editor lets me search a whole folder

lavish pine
bronze arch
#

Did TIS release documentation on how to implement the new "Place item" feature ?

#

I want to be able to update my mod to place things

drifting stump
lavish pine
#

if I overwrite the basic items, will they spawn as usual

bronze arch
#

is this correct syntax?

#

table.insert(Distributions.motelroom.sidetable.items"Item,500")

#

loads of examples online of procedural table syntax but I'm trying to add items to the regular distributions file

bronze arch
#

table.insert(Distributions.motelroom.sidetable.items, "Item")
table.insert(Distributions.motelroom.sidetable.items, 500)

Tried this and it threw an error on start

#

sidetable of non-table: Null

frank elbow
#

The error means that Distributions.motelroom was nil; not at my computer to check at the moment, did you mean to use the procedural distributions table?

steady zenith
#

Which one of you has loaded cjosn

bronze arch
#

@frank elbow motelroom sidetable does not have proc dist = yes

motelroom = {
--removed nonsense
sidetable = {
rolls = 1,
items = {
"Book", 200,
},

#

so do I have to use that new distribution merge system?

steady zenith
bronze arch
frank elbow
#

Is the table still Distributions? Again, not at my computer to check so sorry if this is unhelpful

bronze arch
steady zenith
frank elbow
bronze arch
# frank elbow Oh, gotcha

Which is what I'm trying to solve, I don't know how to alter loot tables for NON procdist lists in the distributions.lua

frank elbow
#

Hopefully someone else can help you, I won't be at my PC for a minute

bronze arch
#

@no worries mate thanks for checkin in anyways

ashen star
#

is it possible to make a battery last forever (or at least practically forever)? I tried to change the delta use value, but it seems that there is a minimum consumption regardless.

undone heron
#

its cause each item has it's own use value for the battery

#

so you would need to change each item

ashen star
#

I also changed the delta of the electronic items, but not matter how small I make it it seems there is a minimum consumption rate

small topaz
#

I am currently searching for a command which returns information about fitness animations the player is performing. There is the command getAnimationStateName() and this works very good for various animations like running or sitting. However, during a fitness animation, this function only returns "fitness" but not which specific exercise is performed (for example situps, squats etc.). Any ideas how to get more detailed info about the specific type of the exercise performed by the player?

bitter frigate
#

does anybody know where to find where ClockAssets or any of the files it contains are referenced in the code? it's a folder in media\ui obviously, but that doesn't help me figure out how the clock actually displays numbers

rain pumice
#

Player:getBodyDamage():getBodyPart()

#

is there a way to make getbodypart get everything?

#

without having to input all the data into a table

#

lol

bronze arch
#

Can anyone link me to how to make an item placeable as a 3d model in the world?

#

I have no idea what the difference between staticmodel and worldstaticmodel

bitter frigate
rain pumice
#

then it doesnt exist

#

sad life

nimble spoke
mint sphinx
bronze arch
#

@nimble spoke it's for a book, so if I only have worldstatic model then will the read animation still play?

#

even still the book is invisible while I read and when I try to place item it uses the 2d icon on the ground

nimble spoke
nimble spoke
mint sphinx
nimble spoke
bronze arch
#

@nimble spoke I copy/pasted the Book.X file from the main game files into my mods modelsX folder

#

then referenced it from tehre

#

I also have the tecture for it in WorldItems in textures

#

I'm pretty much copying another mod off the workshop but theirs is for soda cans

nimble spoke
#

if you even need it to have a unique world model

#

the item script does not reference a model file directly, it references a model script, and that script references a model file and texture

bronze arch
#

@nimble spoke I think I got it, I mixed something up somewhere

#

thanks a lot mate

#

is there official documentation to figure this stuff out or is it just the blind leading the even more blind?

#

yo wtf

#

BIG BOOK

#

that's with the FBX model

#

and reading it, it's still invisible

cold burrow
bronze arch
#

@cold burrow literally copy/pasted the vanilla model from WorldItems folder

#

just reading

nimble spoke
cold burrow
nimble spoke
nimble spoke
tribal marsh
#

isoplayer:setMaxWeightBase(value) doesn't seem to actually set maxWeight.

LOG  : General     , 1643991739777> Updated weight to: 8.092015
LOG  : General     , 1643991739992> Rolling 2 for luck
LOG  : General     , 1643991739992> Player's NetWorth: 184.20 -- PlayerMaxWeight: 8 Adding Weight: 0.0921
LOG  : General     , 1643991739992> Updated weight to: 8.0921
LOG  : General     , 1643991740210> Rolling 15 for luck
LOG  : General     , 1643991740210> Player's NetWorth: 186.03 -- PlayerMaxWeight: 8 Adding Weight: 0.093015
LOG  : General     , 1643991740210> Updated weight to: 8.093015
LOG  : General     , 1643991740252> Player's NetWorth: 186.03 -- PlayerMaxWeight: 8
LOG  : General     , 1643991740429> Rolling 50 for luck
LOG  : General     , 1643991740431> Player's NetWorth: 198.48 -- PlayerMaxWeight: 8 Adding Weight: 0.09924
LOG  : General     , 1643991740432> Updated weight to: 8.09924

I have a value NetWorth * 0.0005 to get the weight to add, but BaseWeight isnt changing

bronze arch
#

These are the scripts

#

the book item from the game itself uses this

nimble spoke
#

you don't really need your own mesh if you simply retextured the existing model

bronze arch
#

so I can take out mesh = bookbible

nimble spoke
#

yeah, you can use the original model in there

bronze arch
#

bookbible is just a renamed Book.fbx

#

so I don't need that line at all?

#

fair enough

nimble spoke
#

you need the line, but you point to Book

tribal marsh
#

Still define the mesh

bronze arch
#

ah ok

#

any idea where BookCLosedGround is? Can't seem to find it

nimble spoke
#

probably inside the WorldItems folder

tribal marsh
#

Anyone have any insight on isoplayer.setMaxWeightBase()?

bronze arch
#

you mentioned something about scale value?

bitter frigate
#

i want to have making an item trigger something - is there no way to do that until OnCreate is implemented?

tribal marsh
#

Uhh

#

You absolutely can

#

as far as I can tell, I do it alot

bitter frigate
#

would you mind sharing how you usually do that?

tribal marsh
#
function Recipe.OnCreate.<someFunct>(items, result, player)
        (your code)
end```

module <moduleName>
{
imports
{
Base
}
recipe <recipename>
{
Wallet/Wallet2/Wallet3/Wallet4,

    Result:EmptyWallet,
    RemoveResultItem:true,
    OnCreate:Recipe.OnCreate.<someFunct>,
    
}

}

nimble spoke
bitter frigate
tribal marsh
#

Its been working for me, so I guess yes

bitter frigate
#

alright cool! i saw it was a planned thing in the upcoming patch so i assumed it wasn't working yet. thank you!!

bronze arch
#

@nimble spoke I see what you mean now, thanks again for you time

nimble spoke
fair frost
bronze arch
#

@nimble spoke Any idea why suddenly when reading other books besides my mod book, the thing is giant as fuck
Also the book, when being read, is facing straight up, i assume as PZ swaps Z and Y coords

#

but surely that shouldn't be happening with stock mesh?

nimble spoke
bronze arch
#

@nimble spoke Do you recommend any way of testing to see if a custom item has distributed into the world

#

other than walking about and checking containers

nimble spoke
neat storm
#

if i wanted to modify or swap out the zombie and scare sounds, how would i go about that?

tribal marsh
#

then: C:\Users[username]\Zomboid\Workshop[modname]\ - set up your workshop mod here

#

make sure your mod structure matches the original game folder structure

#

your mod will overwrite filenames

#

(this is all a guess, someone correct me if i'm wrong)

neat storm
#

i'll keep this in mind. it sounds similar to kenshi modding

faint jewel
#

i need a weapon that is a squirt bottle of holy water.

drifting ore
#

Hi, I published a mod two days ago, and I'm very happy with the acceptance so far, my expectation has been exceeded.
It was my first mod, something very simple, but I loved the feeling of seeing people subscribing to it.
Thanks to everyone who helped me, especially @drifting ore, who helped me when I got stuck, and was about to give up the task.

bronze arch
#

anyone have any ideas why my custom book isn't spawning anywhere? I can cheat it into my inventory no problem

drifting ore
#

100?

bitter frigate
bronze arch
#

but idk how to remove things from the spawn lists, only add them

bronze arch
drifting ore
#

Isn't it 0 to 1?

bronze arch
nimble spoke
#

and where did that function by the end came from?

bronze arch
nimble spoke
#

ohhhh really?

#

all that could be done just like you did for the previous lines

#

with the lines removed your item should spawn

willow estuary
#

Last bit is kinda no bueno, in that it would completely overwrite the motel room side table distro entry so it would just spawn the bibles and nothing else, but I gather it's the intent.

#

You would do it just like all the entries above it to have it spawn there w/o wiping the motel room occupied sidetable entry

bronze arch
#

@willow estuary the only thing that spawns in those side tables is books so I want to replace them totally

#

Can you give me an example of how to write a line like that?

#

Because I can't figure out how to do it for object that aren't procedural

willow estuary
#
require 'Items/SuburbsDistributions'

table.insert(SuburbsDistributions.motelroomoccupied.sidetable.items, "CokeBaggie")
table.insert(SuburbsDistributions.motelroomoccupied.sidetable.items, 1)
table.insert(SuburbsDistributions.motelroomoccupied.sidetable.items, "pa_CokeBrick2")
table.insert(SuburbsDistributions.motelroomoccupied.sidetable.items, 0.01)
bitter frigate
#

im probably missing something really simple but how exactly would you use multiple units of a drainable in a recipe? i assume it's possible because the crafting menu specifies "1 unit" is being used

willow estuary
#
    recipe Lay Out Four Lines
    {
    CokeBaggie=8,
    Mirror,
    keep CreditCard/HuntingKnife,    
    Result:MirrorWith4Lines,
        Time:250,
    Sound:AddItemInRecipe,
    Prop1:Source=3,
    Prop2:Source=2,
    }
bitter frigate
bronze arch
#

I'll give that a go later Blair thanks

drifting stump
bronze arch
#

@drifting stump I'm guessing then I should use it to "merge" the original loot pool and the new one I introduce yeah?

drifting stump
#

use table.insert

#

not table = {new stuff}

weary matrix
#

is there a way to have access to the list of all spawned zombies on the full map, not just the current map chunk?

#

I'd like to get an idea about number of zombies per map chunk or something like that

drifting ore
#

I just got a DMCA takedown on one of my workshop published items

weary matrix
drifting ore
#

Someone elseโ€™s mod that I modified

#

And gave credit to in the descriptionโ€ฆ.

weary matrix
#

did you ask permission?

drifting ore
#

What an ass

weary matrix
#

well no? ๐Ÿ˜‚

drifting ore
#

What?

#

I changed shit why does it matter?

weary matrix
#

giving credit in the description does not allow you to steal code?

drifting ore
#

steal code

weary matrix
#

well that's what you did

drifting ore
#

Itโ€™s literally two fucking lines that add recipes

#

And I added two more

#

And kept everything else the same

weary matrix
#

but then you distributed code that is not yours?

drifting ore
#

It was on the steam workshop itโ€™s not like heโ€™s going to loose money

#

Manz wasnโ€™t selling it

weary matrix
#

think of it as a book, you take a book, add two lines and publish it under your name, does that feel OK?

drifting ore
#

Thatโ€™s dumb

weary matrix
#

does not matter if he was selling it or not

#

no it's not dumb

#

it's very similar to what you did

drifting ore
#

So if I took napoleons autobiography

#

And added extensive commentary to it and publish it

#

Napoleon can sue me?

weary matrix
#

well that's dumb, because napoleon is dead

bitter frigate
drifting ore
#

Whatever I have his personal address now because of the email I got lmao

weary matrix
#

you should learn about copyright I guess

willow estuary
drifting ore
#

A point

#

Would you really want some random person on the internet to have your address?

#

Over a workshop item that isnโ€™t even six lines of code

#

That you arenโ€™t even selling

willow estuary
#

There's a threatening tone to your statements that is probably contrary to the intent of this discord's rules.

drifting ore
#

And being accredited to in the item

#

Donโ€™t put words in my mouth

weary matrix
drifting ore
#

If I wanted to be malicious Iโ€™d just dox him

#

But weโ€™re not here doing that are we?

weary matrix
#

hopefully not

iron salmon
#

Dunno, you even mentioning that gives off weird vibes for sure, though.

drifting ore
#

Whatever copywrite law in the United States needs a nerf

iron salmon
#

Even outside of that you're not even covered by Steam's Subscriber Agreement

#

There's obviously an aspect of how realistic a claim is. If something is two lines of code and you add to more to it, I don't know, not much of a case there though it depends on the lines of code. Not many ways to add a recipe, for example.
Up to Steam to decide in any case.
Just saying that giving credit does not give anyone carte blanche to modify the UGC of other users.

tribal marsh
#

Obviously the correct choice was to create a mod that requires the original, not edit the original.

iron salmon
#

Aye

willow estuary
drifting ore
#

Whatever he canโ€™t dmca me if I upload it privately right?

#

Itโ€™s only for my friends and I anyways

weary matrix
#

oh my

tribal marsh
#

... just write it the correct way

drifting ore
#

Itโ€™s not copywrite if Iโ€™m not publishing anything

#

Publicly

drifting ore
#

Itโ€™s a miracle I figured out how to make it itโ€™s own Thing

#

Modifying text pads is my specialty

tribal marsh
#

Recipes are very easy to add into this game. There's no Lua involved if the recipe is simple

leaden notch
#

no offense, but that kind of ignorance is what gets people in all sorts of trouble

weary matrix
iron salmon
#

And no need for insults.

drifting ore
#

Whatever I donโ€™t think he can strike me if I make it private, this guy is going to have to live with three people using a modified version of his mod that adds like two recipes

#

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

iron salmon
#

In that case I wouldn't be too loud about it at a place where a bunch of mod authors reside, who would have every right to be upset about people copying their work without permission.

Sure, most might not care about some randos using a modified version, but it didn't sound like you had it set to private from the get go?

Wouldn't mouth off about it, for sure ๐Ÿ™‚

#

Kinda just picked the worst possible place to complain about it LUL

iron salmon
#

It's not about if I'm personally ok with that, it's about if there is anything an author can feasibly do that would prevent anyone from modifying their work and using that modified work among their group of friends, like people have been doing forever.

weary matrix
#

I see

iron salmon
#

Uploading that modified work to the workshop privately? The author would likely never find out and I don't see why they'd really care in that case.

#

If that mod is uploaded publicly for everyone, and the author did not give permission? Doesn't really matter if there's credit given or not. That shouldn't fly.

drifting ore
#

Code copyright is basically a gray area anyways in US copyright law.

#

Even changing the names of functions is enough to void any copyright protections

sharp fulcrum
#

But speaking plainly: why would a modder be forced to send a person his full personal data because that person took his code and put it in a modpack, for example? There's packs out there with 50+ mods in it and nobody reports it via DMCA because they don't want to get doxxed. They clearly violate TIS rules for mods and steam subscriber agreement, yet stay up for months.

drifting ore
#

But steam itself has their own rules in the EULA

#

And EULAs/TOS are technically a contractual agreement

willow estuary
#

Well, if someone doesn't want to go the DMCA route they can also report a mod and include their explanation regarding it being an unauthorized re-upload of their material in the report field.

drifting ore
sharp fulcrum
#

Yes, and those reports are what stays active for months. Not DMCA.

drifting ore
#

You can't fight a DMCA without using your own personal info anyways lol

sharp fulcrum
drifting ore
#

Literally

#

Heโ€™s lucky Iโ€™m not a malicious person

#

I mean

#

I am going to call him a dork in steam though

#

You can't really do much with a name

weary matrix
iron salmon
iron salmon
drifting ore
#

I think a better question is did the dude go through the effort of downloading your mod edit and checking the code?

#

Didnโ€™t come here for sympathy, not what I used the internet for

#

Came here for advice

#

And with my advice I am going to upload it privately

#

Thanks to said advice

#

Or did he just see it was an edit in the description and then DMCA

#

Anyways thanks boys

iron salmon
#

Toodles

drifting ore
#

Because realistically its probably the latter

iron salmon
#

Feel like mine was too

drifting ore
#

I mean, modification of material for personal usage is protected by most creative commons licenses

#

No idea what steam ensures their workshop content under

weary matrix
drifting ore
#

I think if anyone is modifying a mod for private usage they should send it to their friends as raw .zip files and not reupload it to the workshop lol

iron salmon
#

This some weird sort of game we're playing?
I just feel like it's a gotcha question when what I said was not controversial at all, so why dance in a circle?

#

Intend is hard to interpret through text, but getting weird vibes here lol

weary matrix
iron salmon
#

If someone modifies another modders work and never uploads it to the workshop or does so privately, and never makes it publicly accessible, it's certainly a different situation than uploading modified work with credit but without permission?

#

Same thing with people learning how to make video games. They might flatout copy another game use assets that aren't theirs, but not distribute it except in order to use it with some few friends.

drifting ore
weary matrix
#

@drifting ore feel free to block me I honestly don't care

weary matrix
iron salmon
#

I think it has to be accepted that one scenario is entirely unpreventable though, which is my point. There is nothing that can be done to prevent someone from downloading a mod and modifying it for their own personal use.

weary matrix
tribal marsh
#

Well, thats stepping into out of scope territory

#

Thats not nasKo's job really, to enforce law on someone elses intellectual property

iron salmon
#

How about you take it down a notch. We don't even know the mod in question.
And no, I am not going to ban someone from the Discord for making a mod that is a modification of someone elses, after saying they will cease distributing that mod without the authors permission AND after the author made it clear they do not want it distributed. Despite them being a bit of an asshole about it and coming here to complain about it and post something that could be taken as a thinly veiled threat.

drifting ore
#

My opinion:

Take someone else's code, and make small tweaks to release something very similar and compete with the original, NOT COOL!

Copy parts of code, and solutions from different authors, to do something totally different, and that won't compete in the same segment, COOL.

iron salmon
#

I came here, monitored the situation and intervened how I saw fit. If you have an issue with how this was handled, you're entitled to that opinion and if you find ways to come off less confrontational I'm certainly willing to learn how this situation can be handled better.
If you think this was already worth a ban, I don't agree right now but I'm open to find out how someone admitting to modify someone elses work for personal use should be a bannable offense.

formal stone
#

Man I didnโ€™t know this was okay in this discord?

#

Good points @weary matrix crazy the guys even hinting at using his address against him

#

Modders shouldnโ€™t have to worry about their personal details for doing what is right

iron salmon
#

I agree, which why I intervened after seeing that line.

drifting ore
#

Please stop pinging me

#

I just come here for questions

iron salmon
#

Just block and move on then, he clearly won't stop

#

And you're better off putting distance between you and this convo as well because you're on thin ice already after the thinly veiled threat.

undone crag
burnt current
#

I just want to ask for a rundown or if there was a tutorial somewhere on how to merge mods for personal use lol

undone crag
#

It looks like part of it is not putting in public on steam workshop :d

burnt current
#

Kek. Nw it'd just be unlisted I just want me and my friends not to lose another server we put a few hours in because one of our 50 mods updated

deft marsh
#

It's getting heated in here

burnt current
#

That's why I took off my jacket

nimble spoke
#

name prefixes that tell you where they come from whenever possible

burnt current
#

Thank you for the advice I'll be sure to do that

tribal marsh
#

I would suggest, on your dedicated server, removing the workshop IDs so the mods dont update. for each client, move the workshop mods to the local mods folder and unsubscribe from everything. No versions will change and you dont have to worry about updates.

sharp fulcrum
#

Or be radical and ask for permission first.

#

That's the part most people seem to forget.

nimble spoke
#

Yeah, when in doubt ask first, and be prepared since the answer can be a big no

tribal marsh
#

You can always write your own mod launcher that downloads from the host site

burnt current
#

That assumes I know how to code

tribal marsh
#

Powershell is pretty easy! maybe its time to learn how to script haha

sharp fulcrum
#

I think what most people have a problem with is the helplessness. If somebody reuploads your stuff without your consent you can't do anything without leaving yourself open for attacks. Either go with DCMA and risk getting doxxed or use the useless report feature on steam.

#

So ask for permission at least, before repacking the work of others.

burnt current
#

For personal use?

sharp fulcrum
#

Always. Have respect for the work modders put into their work.

fallow crescent
#

no because that's entirely unreasonable and if the guy above hadnt stupidly uploaded his mod as public he would have not done anything wrong

#

this is not different from me downloading blairs or peachs or sharks mods to learn what he did and then adapt that shit for my own personal use that I never shared with a single soul

undone crag
#

Maybe the morality could depend on who made the mod. It seems some people want people not to use their code for personal use or with friends. Some people also are fine with it even if they are not asked. Oh maybe that is why people say to ask.

sharp fulcrum
#

A modpack is a repack, not change or adaptation.

burnt current
#

That I am doing for my own server that's not public

fallow crescent
#

exactly as long as you don't have the modpack set to public it is still personal use and none of the mod authors would find out

#

as soon as you start to put your server public your an asshole though and should certainly have permission first

#

I had one mod years ago and people would constantly ask for support on it using an outdated as fuck version

#

have not uploaded a mod for public use since then because idk how you people deal with that lol

#

your going insane i cant imagine anything different

sharp fulcrum
#

Mostly with a preemptively placed statement on repacking and stuff.

fallow crescent
#

like the usual minecraft modpacks

#

but this was years ago mind and the game was not as popular

ionic galleon
#

tbh if the game had a proper modding api with support for patching in a simple format for both script an lua as well as a java api and a mod versioning system then i would be like sure, takedown everything. but when you go to something rimworld, at least there you don't have an excuse of it being hard or sometimes not possible because the total lack of mod support on the dev's end.

once a system for patching scripts is added that can allow multiple mods to modify the same thing then I would say you should take a hardline approach on this.

also regarding repacking, well if the mod support mp and a modder updates 6 times a day well, in rimworld if i update 2 times i get backlash and unsubs let alone what happens here where with a decent list a server can have to restart every 20 minutes. It's not entirely the modder fault since that should be handled by both steam and indiestone but they don't so give people an alternative to packing if you update too often or tbh in any other community you would lose all your subs.

fallow crescent
#

with the numbers of some popular mods these days no way i wouldn't of packed my shit and never looked back if I imagine getting x100 as many support questions from people using outdated versions

proven light
#

lol anyone have any idea what could cause this? that is the new car wheel i made and its also somehow spinning???

marsh beacon
#

Its so wierd people are willing to disrespect mod authors and at the same time use their mods

tribal marsh
#

Oh my

burnt current
#

I'll just go figure it out myself thanks anyway

fallow crescent
proven light
fallow crescent
#

my ark server suffered from the same issue

quasi geode
bitter frigate
ionic galleon
burnt current
proven light
ionic galleon
#

a proper patching system allows you to order patches by giving priorities, check for possible patches on something so you can warn the user and even do inline patching

burnt current
#

I literally just wanted to play with my friends

ionic galleon
#

let alone the fact that scripts can be patched that easily by multiple mods

grizzled grove
ionic galleon
#

also there is a solution for the update issue and it is rather simple, a simple button that create a local copy of mods but tbh the game can't even handle 2 folders with the same name so it's not going to happen

tribal marsh
#

for function Recipe.OnCreate.myFunction(items, result, player) what is "items"? Can I make a recipe require a corpse and use that as targeting for eg items:getModData().someData?

#

If no, how would I target a corpse and add modData to it?

willow estuary
ionic galleon
#

tbh the fact that people don't realize how modding in pz is kinda unfriendly because the lack of api and tools to do stuff like patch ordering, checking for patches, inline patching and more. until then i think the barrier to entry is higher than what it is said to be.

tribal marsh
#

What would context.x and context.y be

#

well... I guess context

willow estuary
#

the mouse position on screen I believe?

tribal marsh
#

So (player, mouse coords where context menu was open, the Object in the world to interact with, test(?))

proven light
#

still not sure why it was spinning ๐Ÿค”

tribal marsh
proven light
#

lmao

sharp fulcrum
#

Player, context menu instance, list of objects connected to the click

willow estuary
tribal marsh
willow estuary
#

It's a game changer alright ๐Ÿ˜„

willow estuary
nimble spoke
proven light
#

(my first pz mod so excuse the noobity)

white quest
#

hi

#

i made a helmet mod

#

but

#

sth like this happened

#

what might be a cause?

#

on the ground it looks ok, face down but ok

#

w8, got an idea

tribal marsh
autumn torrent
#

Does anybody know how to apply changes to sandbox settings while in-game? I need something similar to how the zombies, when using the day/night active setting, change their behavior in real-time.

white quest
#

now its big boii

drifting ore
#

Metaverse

white quest
#

ffs

willow estuary
# autumn torrent Does anybody know how to apply changes to sandbox settings while in-game? I need...
    local gTime = getGameTime()
    local hour = gTime:getTimeOfDay()
    local night = gTime:getNight()
    local climate = getClimateManager()
    local sun = climate:getDayLightStrength()
    local light = climate:getGlobalLightIntensity()
    local fog = climate:getFogIntensity()    
    if night == 1 or fog > 0.5 then
        getSandboxOptions():set("ZombieLore.Memory",1)
        getSandboxOptions():set("ZombieLore.Sight",1)
        getSandboxOptions():set("ZombieLore.Hearing",1)
    elseif night > 0 or fog > 0 or light < 0.5 then
        getSandboxOptions():set("ZombieLore.Memory",1)
        getSandboxOptions():set("ZombieLore.Sight",1)
        getSandboxOptions():set("ZombieLore.Hearing",2)    
    elseif (hour < 12 and hour > 15) or light < 0.6 or sun < 0.85 then 
        getSandboxOptions():set("ZombieLore.Memory",2)
        getSandboxOptions():set("ZombieLore.Sight",2)
        getSandboxOptions():set("ZombieLore.Hearing",2)
    else
        getSandboxOptions():set("ZombieLore.Memory",3)
        getSandboxOptions():set("ZombieLore.Sight",3)
        getSandboxOptions():set("ZombieLore.Hearing",3)            
    end
ivory cradle
#

Does editing the _Ground clothing models work dynamically like the regular models? Can I overwrite the fbx for the ground model, tab back to PZ, then make adjustments in blender without reloading PZ?

white quest
ivory cradle
#

Hmm, for some reason my ground model isn't changing anything even when I scale it up super high ๐Ÿค”

autumn torrent
willow estuary
bitter frigate
#

I don't think i'm using OnCreate correctly. would anyone mind explaining what i'm doing wrong here? the creation of TeststripDRY is meant to trigger the player saying their current SugarValue, but it's throwing an error. if it's (items, result, player), how would i go about fixing it?

function Diabetes.OnCreate_TeststripDRY(items, result, player)
    self.character:Say("My blood sugar is " .. tostring(SugarValue))
    -- read blood sugar
end
proven light
#

does anyone know the name of the mod that gives you a drivable wheelchair and mobility scooter?

white quest
#

we are getting there

bitter frigate
white quest
proven light
#

thank you!

white quest
#

1 cm at the time

#

is there a way to easily change origin point in blender?

#

aka the little orange dot

tribal marsh
#

Note the OnCreate.TeststripDRY instead of _

#

Also, Recipe instead of diabetes

bitter frigate
ivory cradle
#

I deleted the ground model & the game is still using it, so I have no idea what's going on at this point @_@

white quest
#

Jesus Christ'

opal wind
#

lol

white quest
#

w8

#

i will import player model

#

and align my helmet to it

opal wind
#

why, in Gods name, are you using .x to make a helmet?:

#

dude really

#

use .fbx

#

and the avatar as reference

#

stop torturing u self lol

white quest
#

its .fbx, wdym?\

#

yup, avatar time

opal wind
white quest
#

why not?

ivory cradle
opal wind
#

then you are doing wrong

ivory cradle
#

๐Ÿคท

opal wind
#

you dont mesh hat/helmet .fbx like that, its position is all wrong

ivory cradle
#

I just need to lay flat on the ground :C

opal wind
#

you are doing wrong dude

white quest
#

ok buddy

opal wind
#

i mean that picture is def not a .fbx

ivory cradle
opal wind
# white quest ok buddy

you actually have to enter the game and look the position, i bet you are doing not only one but 2 things wrong, and i dont see the point of you posting it here, get an advice and act smart about it

ivory cradle
#

I'm confused

opal wind
#

yes and you are modeling a .fbx as .x

#

again, doing wrong, thats why u keep having to correct the position

opal wind
# ivory cradle

is this picture here, this is not how you mesh a Skinned .fbx, unless you are doing a Static .fbx, witch i dont even know why

#

is your helmet static?

ivory cradle
#

I just did the static because I couldn't get the skinned to work

#

Yeah

opal wind
#

ugh

#

well than my first argument stay; why torture u self lol

#

static is outdated

#

for cloth

#

just make skinned, you can use the avatar as reference

#

your work will be x10 times faster and better

white quest
#

give us quick guide on making the skinned one pls

white quest
opal wind
#

grab the avatars here

#

then just put the helmet on thier heads, seletec the mesh and attach 1.0 to Bip_Head01

#

thats it

white quest
#

k

opal wind
#

export the .fbx

#

you guys know how to give the head weight?

#

its pretty easy

#

grab your helmet mesh, select the vertices, unselect it then join the meshes with the avatar; separate again (this will give any mesh/model the vertex groups), in your case delete all them except for the Bip_Head, then select the helmet mesh on edit mode, click on the Bip_Head and select 'attach'

#

believe me, its totally worth to learn this guys, you will thank me on the next helmet you make

ivory cradle
#

I'll do my best ๐Ÿ‘

opal wind
#

you will learn it fast im sure of it

#

its much easier than static

ivory cradle
#

I will return with the results, pinkie promise :pinkieshouldbeanemote:

opal wind
#

is this was my server he would get BAN + criminal charge if possible too

#

but since its not... mving on...

fallow crescent
#

stealing

#

the guy gave credit he just didn't have permission and once the author dmcad he came here to shit on the author but eventually made his version private for personal use which was what he should have done to begin with

#

he also said the mod was just two lines of code

#

if that's all it takes to rustle your jimmies boy am i glad your not in charge

undone crag
# ionic galleon a proper patching system allows you to order patches by giving priorities, check...

Perhaps someone could make a mod like that. "Mod Loader API". Something like

Hooked_Functions = {}

function PatchFunction_After(function_to_patch, function_to_add, priority)
  Hooked_Functions[function_to_patch] = Hooked_Functions[function_to_patch] or {}
  table.insert(Hooked_Functions[function_to_patch], {function_to_add, priority})
  -- some other things
end

And also hook this mod's function onto each function being patched, and when the patched function is run, run the hooked functions in a certain order. One set of functions before the function and one set after it.

fallow crescent
#

we don't know if the mod author contacted him first. from the story we can doubt that though.
if it relly was just two lines of code to add a recipe as he claimed yall are getting riled up over nothing its embarassing to see

opal wind
#

im not 'riled', i just said what i think.. you on the other hand might be defending a thief without know.. ๐Ÿ™‚

proven light
#

he didnt really DMCA him though right?

tribal marsh
#

Alright, we should drop it honestly

undone crag
# tribal marsh for `function Recipe.OnCreate.myFunction(items, result, player)` what is "items"...

It's a java array
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md

Unlike a Lua table list, our the first entry in the Java List is index 0 (not 1), and ipairs will no longer work, nor will # to get the size, or [] to get the value at a specified index. For this we need to use the methods in Java's List class :size() and :get()

for index=0, known:size() -1 do
print(index, known:get(index))
end

GitHub

Guide to modding various aspects of Project Zomboid - Zomboid-Modding-Guide/README.md at master ยท FWolfe/Zomboid-Modding-Guide

fallow crescent
#

he was dmcad according to him yes

proven light
#

i dont believe him

fallow crescent
#

weird take but ok

proven light
#

? lol

#

by DMCA i mean DMCA takedown notice

#

aka a legal notice

#

for a zomboid mod

#

yeah right

tribal marsh
#

Guys dont call the angry cartoon raccoon in here - we'll be punished.

fallow crescent
#

not sure if you misinterpret what it takes to send a dmca but several people have gotten dmca takedown noticed from zomboid modders

proven light
#

who sends it?

fallow crescent
#

it is essentially the only recourse they have to combat people stealing mods or using them in modpacks etc

proven light
#

the individual?

fallow crescent
#

your just filling out a form that is literally all

#

it takes 5 minutes

#

steam has a form for it not sure why youd doubt that part of the story

proven light
#

never heard of DMCAing workshop items

#

this is new to me

#

so does steam take down the item?

fallow crescent
#

not new plenty of people complained on steam about getting dmcad by modders recently too

willow estuary
#

I've recieved a DMCA notice for a minor mod that was all original code on steam. Nothing ever came of it, and I have no idea what the deal was? But DMCA takedowns of zomboid mods does happen.

proven light
#

oh so steam doesn't actually enforce it then?

fallow crescent
#

and in my opinion i think many of those cases were legit since it was essentially reuploading someone elses mod

proven light
#

well then yeah its just smoke

brittle jewel
#

I DMCA'd someone who uploaded their own version of Defecation without any permission and it was gone within 2 days.

fallow crescent
#

steam does take action against those

willow estuary
fallow crescent
#

not always but they do evidently

proven light
#

oh ok

fallow crescent
#

so to be clear the discussion on here was about someone at first uploading a mod for everyone to download that added "two lines" to a mod that was already just "two lines" and just recipes

#

if that is truthful then making that mod private was really all it took

opal wind
#

bs stop defending thieves Temi

fallow crescent
#

from that point on and from the persons description there were going to only use it for them personally

white quest
fallow crescent
#

are you being dumb on purpose stop trying to claim i defend a thief

white quest
#

Gobless

opal wind
#

nice kappi

fallow crescent
#

its fucking personal use as soon as they stop publishing the mod

white quest
#

This skeleton thingy works

opal wind
fallow crescent
#

modders make use of "personal use" all the time learning how to mod

#

you being one of them

opal wind
#

you are not polite

fallow crescent
#

sorry i used strong words

#

don't make false accusations then

opal wind
#

i dont care about you or you sorrying or your defending criminals, just watch your mouth here

#

dont curse

fallow crescent
#

lmao

#

this guy serious

opal wind
#

lol

fallow crescent
#

cant be

#

pure comedy

opal wind
#

are you cursing more?

#

or are u done? fall mouth

fallow crescent
#

so petty

#

laughable

#

doodoohead

proven light
#

someone should make a vscode plugin for the pz scripting language whatever it is called

#

some autocompletes and snippets would be cool

#

(not talking about lua)

opal wind
#

this is worth a ban

#

imo

iron salmon
#

You two are such childs

opal wind
#

where are this server moderators

#

i wonder

iron salmon
#

Just stop that shit

#

Both of you

#

jfc feels like a babysitter in here

opal wind
#

what rule i broke here??

left plank
#

wow it's like there are moderators here

opal wind
#

Temi is cursing to much dude wtf

#

u guys deal with your cattle im done

left plank
#

do we have a rule against cursing?

#

you're both taking this so far into an argument

iron salmon
#

No rule against cursing and that can't really be your idea of defusing a situation ๐Ÿ˜„

#

Riling someone up even more like nobody is allowed to curse, come on.

opal wind
#

this server is a disgrace nasko, you dont even punish thieves

iron salmon
#

Also the thief defender claim.

#

Right

#

Plenty of other servers for you.

white quest
#

i think i need to attach more bones

#

brcause this happens when i walk lol

dry chasm
opal wind
# white quest

u just need to select the mesh on edit mode and the attach to Bip_Head

opal wind
iron salmon
#

breaking Discord ToS then

opal wind
iron salmon
#

Neither the game nor the server are for 10 year olds and we have never banned people for cursing, so you're off base there.

opal wind
#

i helped a lot of people since i got here, dont give me this BS just because i complain about cursing

#

i dotn want you to ban anybody

iron salmon
#

I wanted to stop you from carrying on a petty argument

#

sorry

#

seemed like it to me

opal wind
#

i want just a SMALL piece of respect from you, since i didnt do shit

iron salmon
#

I got a wrong impression then, in the heat of the moment

opal wind
#

u did!

white quest
#

ok, done

opal wind
#

i was just defending people and trying to help

iron salmon
#

To me it seemed like a petty argument with two people riling up each other unnecessarily, derailing the channel.

#

I just wanted that to stop, that's all.

#

So rock on

opal wind
#

no reason to call me 'kid' and tell me to get off just because i made 1 simple cursing complain, its my right

#

ok then

opal wind
# white quest

you can DM me anytime you want i can guide you with more details if you want let me know

#

in case you need

rain pumice
opal wind
#

Sup big J

#

dude that picture on your avatar, is that the necronomicon?

#

@rain pumicepokes

opal wind
#

lol

rain pumice
#

LOL

#

It's god from solo levelling

undone crag
#

o_o

opal wind
#

hum it does look like the necromicon cover lol

#

does it bite? lol

last grove
#

Does anyone know of a mod that adds an item to every zombie that can be collected such as a Sample?

opal wind
#

no but that is not hard to do, if its just an item i mean

last grove
#

define not hard?

opal wind
#

well like, you can create the item, and make it spawn on 100% on zombies, i did not get into spawning yet but its not hard from what i saw

#

what this 'sample' would do?

last grove
#

its for an Rp server, Players would hand them to the Gov faction for a reward

opal wind
#

cool

#

i like that mechanic

#

my mod you buy things too, trading itens for money

last grove
#

Yeah, we have an economy build around Currency Variety as materials would be more relavant then fiat currency, just need a way to circulate some more cash in the economy

opal wind
#

im glad your server is working fine..

last grove
#

aye, i do enough fire fighting to keep it together sometimes

bitter frigate
# tribal marsh ```lua function Recipe.OnCreate.TeststripDRY(items, result, player) player:Say...

doing either or both of these causes the whole mod to break spectacularly, so i don't think they're quite the problem? i have plenty of _s in function names and i've never had a problem before - i think it just matters that the function in the Recipe file matches the function called in the other stuff in the client folder, and it's constant in my work. if that isn't the case i have a much bigger problem on my hands ๐Ÿ˜ฌ

round zenith
quartz badge
#

im in debug mode, what does the "FakeDead" flag for zombies mean

#

I knock them over once and they die instantly but its not like they get back up

autumn torrent
willow estuary
#

Also, my code example only modifies the global zombie parameters? If you're trying to affect stuff like sprinting or door opening, it's not gonna be applicable?

autumn torrent
white hatch
#

How can I add a model to the game? I mean what folders do I create? and all that

round zenith
opal wind
willow estuary
# autumn torrent I'm not sure what you mean. The code works (as intended?) but just doesn't updat...

Here, I'm gonna provide the code that I use in it's entirety in case it's any help? It sounds like you might not have your code in a function?

function NightZeds()
    local gTime = getGameTime()
    local hour = gTime:getTimeOfDay()
    local night = gTime:getNight()
    local climate = getClimateManager()
    local sun = climate:getDayLightStrength()
    local light = climate:getGlobalLightIntensity()
    local fog = climate:getFogIntensity()
    
    if night == 1 or fog > 0.5 then
        getSandboxOptions():set("ZombieLore.Memory",1)
        getSandboxOptions():set("ZombieLore.Sight",1)
        getSandboxOptions():set("ZombieLore.Hearing",1)
    elseif night > 0 or fog > 0 or light < 0.5 then
        getSandboxOptions():set("ZombieLore.Memory",1)
        getSandboxOptions():set("ZombieLore.Sight",1)
        getSandboxOptions():set("ZombieLore.Hearing",2)    
    elseif (hour < 12 and hour > 15) or light < 0.6 or sun < 0.85 then 
        getSandboxOptions():set("ZombieLore.Memory",2)
        getSandboxOptions():set("ZombieLore.Sight",2)
        getSandboxOptions():set("ZombieLore.Hearing",2)
    else
        getSandboxOptions():set("ZombieLore.Memory",3)
        getSandboxOptions():set("ZombieLore.Sight",3)
        getSandboxOptions():set("ZombieLore.Hearing",3)            
    end
end

Events.EveryTenMinutes.Add(NightZeds)
slim tangle
#

newbie here

autumn torrent
# willow estuary Here, I'm gonna provide the code that I use in it's entirety in case it's any he...

I do have my code in a function that is called using the EveryHours event to determine whether to change the sandbox settings or not. I have print statements that showed me that the sandbox settings were being updated. The code works fine, but I need a way to reload the sandbox settings while the player is still playing the game. Your code updates the sandbox settings while the player is playing the game, yes, but it has no effect on zombie behavior because the sandbox settings are not reloaded, if that makes sense. Those sandbox setting changes would only appear after the save is reloaded.

slim tangle
#

is it hard or no support to make mod with java

#

i know how to code in java

#

lua makes my mind not good ?

willow estuary
autumn torrent
nimble spoke
slim tangle
#

one of you mod car mechanics and paint it black

#

both written in lua

#

the thing is i cant read the all things lua

#

my idea before make a drifting mod using ur Vehicle Tweaker API

willow estuary
slim tangle
#

how do i find any documantion on lua api or such things

autumn torrent
slim tangle
#

i can read java documentions. lua isnt my best yet

willow estuary
slim tangle
slim tangle
#

all of you

slim tangle
#

the game does wonderfull gripping already

#

idk i t just an idea

willow estuary
# autumn torrent That's perfectly understandable

One thing that occurs to me is that how zombies are handled, code wise, changed a fair bit with 41.65 because of changes they made to the zombie code to optimize them for MP? I mean, I'm basically making excuses here but it's a hypothesis ๐Ÿ˜„

autumn torrent
ivory cradle
#

Have I done this correctly? I can't tell if things are attached/parented properly

nimble spoke
slim tangle
#

Ur api was goingto help with removing speed limit

opal wind
#

the hole helmet needs to be red on it

quartz badge
#

Where do you find the current sounds

#

in the files\

ivory cradle
opal wind
#

also when you drop you need a ground model or it will just display the icon texture on the ground

ivory cradle
ivory cradle
#

Do you need to set up your axis in a weird way for the export for it to face the right way up?

opal wind
#

the ground model?

ivory cradle
#

No, that's the equipped version lol

opal wind
#

ah lol

#

yeah i just DM you what u need to do, if you still have this problem, open my helmet model and take a look

#

but the model you sent me have correct positions, did you fix that 'static' entry on the .xml?

ivory cradle
#

Aww yeah :D!

wanton cosmos
#

has AnimZed come out yet?
B41's stable..

#

..and the editor that people use now is absolutely not beginner friendly

late hound
wanton cosmos
#

holy crap

#

what happened

opal wind
#

hey guys i notice the game already have a gun flashlight, but i dont think it works does it? i mean it turn On?

ivory cradle
#

Is there a line similar to <m_HatCategory>nohair</m_HatCategory>
that hides feet? Also, are boots that go above the ankles viable?

opal wind
#

yes

#

u can hide feets with masks

#
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel>media\models_X\Skinned\Clothes\Wiz_GokuBoots.fbx</m_MaleModel>
    <m_FemaleModel>media\models_X\Skinned\Clothes\Wiz_GokuBoots.fbx</m_FemaleModel>
    <m_GUID>bca25d8f-5d3f-4082-ab57-45822dad4672</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_Masks>8</m_Masks>                                 ---       / Hide Feet
    <m_Masks>10</m_Masks>
    <textureChoices>Clothes\shoes_socks_textres\Wiz_GokuBoots</textureChoices>
</clothingItem>
ivory cradle
#

Ah, I see! Thank you so much ๐Ÿ™‚

opal wind
#

np ๐Ÿ™‚

#

im trying to make a light attachment to guns here (flashlight) but its much more difficult than make a light attachment for clothing ๐Ÿ˜ฎ

ivory cradle
#

I wonder if you could turn it on/off with the radial menu

opal wind
#

yeah you can with shortcuts

#

keys

#

i was able to make it attach to the gun i wanted but the model of the flashlight is not showing

#

plus only work on my hand not attached, i prb did many wrong things i was just messing around

ivory cradle
#

I completely forgot I could select faces in blender. I'm assigning vertex groups to the feet and calves and was trying to pinpoint every little vertex drunk

opal wind
#

lmao

#

i use faces a lot, but i never worked with edges

#

faces are good to select parts of the avatar and duplicate them to make some clothing

drifting ore
#

A useful tip for doing weird selections

#

You can use UV Maps

#

For selecting islands

#

IE cntrl+L select 1 vert and it selects every connected vert until it finds a seam

#

Its pretty useful if you're lazy lol

lavish citrus
#

anyone know the /additem commands for brita armour stuff?

hidden compass
#

In DEBUG mode, I can see the value ("codes" in attached screenshot), but I get an error when retrieving the value.

I tries "line:getCodes()" then ...
-> Exception thrown java.lang.RuntimeException: attempted index: getCodes of non-table: zombie.radio.media.MediaData$MediaLineData@587617c5 at KahluaThread.tableget line:1689...

I tried "line.codes" then ...
-> Exception thrown java.lang.RuntimeException: attempted index: codes of non-table: zombie.radio.media.MediaData$MediaLineData@688e060 at KahluaThread.tableget line:1689...

Does anyone have any ideas?
Since MediaLineData is an inner class of MediaData, is there a special statement that needs to be made in such a case?

indigo kiln
#

Hey. I've been having problems with my first car mod.
After jumping through all the hoops a have this ingame:
No visible ingame model (wheels are fine tho)
and wrong scale (i will eventually figure this one out)

F7 debug menu shows black outline of the vehicle. Is this a texture or a model problem?
I've seen this exact issue in the guide i'm using but it wasnt solved there.
Any help please?

cold burrow
lavish citrus
#

where are those folders located at

royal ridge
#

Is there a global mod data that sits on the server side rather then a client ?

cold burrow