#mod_development

1 messages ยท Page 137 of 1

drifting ore
#

pretty sure you can play any game with a stick using it. just have to set it up and calibrate

frank lintel
#

doesnt exist you'd have to use an emulator

drifting ore
#

ds4windows. i meant. i think it is a controller emulator

#

but i used a stick before....

frank lintel
#

yeah I dont use emulators...

drifting ore
#

maybe it wasn't ds4

#

it's been so damn long lol

frank lintel
#

thats like me trying to remember all this stuff Im trying to do now when I did it for MC.

drifting ore
#

haha

#

so true lol

frank lintel
#

seriously like If I could remember all the stuff we were doing back then now I would be prob already done in making a git hosted zdoc-lua

drifting ore
#

i do feel you. i took a small break from pz modding to get back into gta/fivem mapping and boy it took a min to get back into it

#

even just starting with tools needed

frank lintel
#

thats why Im looking at maybe trying to make this where I plant my feet and helping the community

#

but I'd also have to ask the head cheeses if its okay to post that publically dont wanna run into another craftbukkit fiasco

hot patrol
#

when using profession framework to start a player with a certain outfit. how do I make that outfit persist on respawn? It seems like it only works with that 1st character of the world.

sour island
#

Sounds like theyre doing something with createPlayer

hot patrol
#

I used another mod as a reference and this is where the outfit is OnNewGame = function(player, square, profession) local player = getPlayer() local Hat = player:getInventory():AddItem("Base.Hat_Fedora") local Jacket = player:getInventory():AddItem("Base.JacketLong_Random") local Shorts = player:getInventory():AddItem("Shorts_CamoGreenLong") local Hands = player:getInventory():AddItem("Base.Gloves_FingerlessGloves") player:setClothingItem_Head(Hat) player:setClothingItem_Torso(Jacket) player:setClothingItem_Legs(Shorts) player:setClothingItem_Feet(Hands) end,

sour island
#

What event is it adding to?

hot patrol
#

idk. I think it just makes it so those clothing items spawn on the character when it spawns in. The clothing didn't appear in the character creator.

#

this is the full code

#
ProfessionFramework.addTrait('Blade', {
    name = "UI_trait_Blade",
    description = "Whilst others were out partying you were studying the blade. Now it is finally time to show off the results of your training.",
    profession = true,
    xp = {
        [Perks.LongBlade] = 2,
    },
    inventory = {
        ["Base.Katana"] = 1,
    },        
})

ProfessionFramework.addProfession('Weeb', {
    name = "Weeb",
    description = "anime obsessed degenerate.",
    icon = "proff_Weeb",
    cost = 4,
    xp = {
        [Perks.Fitness] = -2,
        [Perks.Strength] = -2,
    },
    traits = {"Blade"},
    inventory = {
        ["Base.Dakimakura1"] = 1,
    },
    OnNewGame = function(player, square, profession)
    local player = getPlayer()
    local Hat = player:getInventory():AddItem("Base.Hat_Fedora")
    local Jacket = player:getInventory():AddItem("Base.JacketLong_Random")
    local Shorts = player:getInventory():AddItem("Shorts_CamoGreenLong")
    local Hands = player:getInventory():AddItem("Base.Gloves_FingerlessGloves")
    player:setClothingItem_Head(Hat)
    player:setClothingItem_Torso(Jacket)
    player:setClothingItem_Legs(Shorts)
    player:setClothingItem_Feet(Hands)
    end,

})
rancid panther
rancid panther
#

i think i showed u how clothing was defined before

#

it needs its own outfit definitions file

hot patrol
#

does it? these are vanilla outfits. Everything is working on the initial spawn. it's just on new character that it fails

rancid panther
#

look in the README file on profession framework and it says exactly where outfits are defined

#

yeah, it's how lumberjack etc get custom starting clothes

rancid panther
#

yea

hot patrol
#

I'm not seeing anything about needing a seperate outfit definition file. I do see that with prof framework you can use this. clothing = { Tshirt = {"Base.Tshirt_Profession_RangerBrown", "Base.Tshirt_Profession_RangerGreen"}, Pants = {"Base.Trousers_Ranger"}, but would this work with clothing not available in the character creator like leather jackets?

rancid panther
#

in profession framework it puts them conveniently in one place but it is possible without

#

and you can do it with any clothing

#

not just vanilla, and not just default

#

i let players pick eyepatches, jackets, etc

hot patrol
#

well i'm using framework. I couldn't figure out vanilla and this is just easier. I got it all working already minus the outfit on respawn

rancid panther
#

ah, with framework it is possible then

#

u need to find the clothing scripts to see the locations and names and stuff

#

i gtg but hope that helps

hot patrol
#

thanks ๐Ÿ™‚

rancid panther
#

there's a jacket definition for example

#

and leather jacket is probably Base.Jacket_LeatherJacket or something like that

drifting ore
#

Hey guys, I wanna make a mod pack for a server I am gonna start

#

How do I do that?

ancient grail
#

What server?

#

@drifting ore

#

Share link of server

drifting ore
#

I mean like

#

host

#

Like ima use the games host thingy

#

I just wanna put all the mods I want

#

into one thing

#

so I don't accidentally mess it up

#

me and a few friends of mine are doing a NG rp

ancient grail
#

Ok 1st dont.
We modders worked hard for our mods only to be packed maybe unless youre solo wnd u make it unlisted

But the thing is you should ask permission from every author of each mod

drifting ore
#

and I wanna put all the mods for it into one mod

drifting ore
#

just for me and a couple friends

#

I am not gonna post it as my own

ancient grail
#

The. Why not just sub kn each of em

#

Why create a pack?

drifting ore
#

because i've tried that

ancient grail
#

If its local anyways

drifting ore
#

and it always doesn't work

#

i dunno why

ancient grail
#

Imea. Local hosted

drifting ore
#

yea

ancient grail
#

And packing it into one mod would work? It wont

drifting ore
#

oh

#

then how do i fix it not working

ancient grail
#

You just have to make em download it like update it and all that

drifting ore
#

p a i n

ancient grail
#

Also #mod_support would help getting that to work
But modpacks are generally frawned upon

#

You could do a collection

drifting ore
ancient grail
#

That way everyone would just download from that list ๐Ÿ™‚

drifting ore
ancient grail
#

Im not sure how to do it but ill try and see how

drifting ore
#

i'll go to youtube and see

#

ohh i see now

#

ty

ancient grail
#

Here

#

@drifting ore

hot patrol
#

So if a profession has a special trait applied to it can the profession itself not have a description?

#

it seems like no matter what I do it doesn't work and sometimes even breaks the trait name for some reason

#

also if anybody knows how I can make a character start with a weapon with a set condition using Profession framework please let me know. I was told to make an event but idk what that means or how

neon bronze
#

OnNewGame comes to mind to me

#

or OnCreatePlayer

hot patrol
neon bronze
#

OnCreatePlayer maybe

hot patrol
#

ok. but what would it look like for a weapn that is nearly broken?

#

I know how to get it in the inventory but not set the condition

neon bronze
#

weapon:setCondition(int)

hot patrol
# neon bronze weapon:setCondition(int)

I'm going to go out on a limb and just assume this is being done very wrong. ```ProfessionFramework.addTrait('Blade', {
name = "UI_trait_Blade",
description = "UI_trait_BladeDesc",
profession = true,
xp = {
[Perks.LongBlade] = 2,
},
inventory = {
["Base.Katana"] = 1,
},
OnCreatePlayer = function(playerIndex, player)
local player = player:getInventory():AddItem("Base.Katana)
weapon:setCondition(3)

})```

neon bronze
#

OnCreatePlayer is something else and does not go into ProfessionFramework

#

its an Event

#

Events.OnCreatePlayer.Add(your func here) is usually the syntax events are used

bronze yoke
#

it does go into profession framework actually

hot patrol
neon bronze
#

it can?

#

i never used it tbh

#

do you want to give a char a gun and set it to a specific condition with a specific trait?

hot patrol
#

a katana but yes

#

you choose that trait and you get a katana at start but it is nearly broken because mall katana

bronze yoke
#

oh my bad actually, oncreateplayer isn't one of the supported events in profession framework

#

it wouldn't actually make that much sense for it to be now that i'm thinking about it

#

they tend to use onGameStart for this

#

or, OnNewGame would be better

hot patrol
neon bronze
#
function spawnKatana(playerindex, player)
  if player:hasTrait(your_trait) then
    local inv = player:getInventory()
    local katana = inv:addItem("Base.Katana") --or whatever its called
    katana:setCondition(your number here)
  end
end

Events.OnCreatePlayer.Add(spawnKatana)

I think thats how you could do it maybe

bronze yoke
#

this would give you a katana every time you load in

neon bronze
#

hmm true

#

does onNewGame trigger when you make new char?

hot patrol
#
    name = "UI_trait_Blade",
    description = "UI_trait_BladeDesc",
    profession = true,
    xp = {
        [Perks.LongBlade] = 2,
    },
    inventory = {
        ["Base.Katana"] = 1,
    },        
})```
bronze yoke
#
OnNewGame = function(player)
    local weapon = player:getInventory():getFirstType("Base.Katana")
    weapon:setCondition(3)
end
hot patrol
#

which sucks for MP

bronze yoke
#

i've heard it fires every time a character is first created

hot patrol
#

not with the mod I used as a reference. it uses that to apply an outfit but it only worked with the first character

#

after that I had to leave the whole save and create a character there

bronze yoke
#

hmm, then the oncreateplayer approach is better

#

just need to use some moddata to track if it's already happened

neon bronze
#

technically if you want to you could write a bool to the char's moddata to check if he needs a new katana or not

#

there is a OnPlayerDeath Event

hot patrol
#

gonna be real with yall. I'm lost

#

but I appreciate it

#

๐Ÿ˜…

neon bronze
# hot patrol but I appreciate it
function spawnKatana(playerindex, player)
  if player:getModData().spawn then
    player:getModData().spawn = nil
    local katana = player:getInventory():getFirstType("Base.Katana")
    katana:setCondition(3)
  end
end

function respawnKatana(player)
  if not player:getModData().spawn then player:getModData().spawn = true end
end

Events.OnPlayerDeath.Add(respawnKatana)
Events.OnCreatePlayer.Add(spawnKatana)

Try this maybe

sour island
#

If you know how to use modData all you have to do is store a variable in there

#

Doesn't have to even be a boolean as you can check if it's there or not

bronze yoke
#

this won't work

#

moddata doesn't carry over between characters

hot patrol
rancid panther
sour island
#

I skimmed the convo a bit -- what's the point of adding a katana on death?

bronze yoke
#

and it wouldn't be triggered on the first character, and generally seems like an overcomplicated way to do this?

sour island
#

You don't want it to trigger on the first character?

bronze yoke
#

no, it's a criticism

sour island
#

Ooh, sorry

neon bronze
#

oh yea im stupid

#

i see it now

hot patrol
autumn garnet
#

    function spawnKatana(playerindex, player)
        if player:getHoursSurvived() == 0.000 then
            local katana = player:getInventory():getFirstType("Base.Katana")
            katana:setCondition(3)
        end
    end

Events.OnCreatePlayer.Add(spawnKatana)```
neon bronze
#

gotta be the other way around

sour island
bronze yoke
#
function spawnKatana(playerindex, player)
  if not player:getModData().katanaSpawned then
    local katana = player:getInventory():getFirstType("Base.Katana")
    katana:setCondition(3)
    player:getModData().katanaSpawned = true
  end
end

Events.OnCreatePlayer.Add(spawnKatana)
hot patrol
#

so if you respawn with that trait again you get another borken sword

sour island
#

Respawning is a new character

#

ModData doesn't carry over -- so you would get a new one

#

There is an issue using OnCreatePlayer in MP tho

hot patrol
#

oof

autumn garnet
#

If you want the katana to be in the inventory when the player has just created a new character, you have to put a condition to know the number of hours he survived.

sour island
#

May have been fixed by now

#

Oh that could work too

bronze yoke
#

that's a good idea

hot patrol
#

ok so which of those should I use?

sour island
#

But would be less secure than modData

#

Days survived is a float so you could check it against 0.01

#

But I would prefer a boolean in modData

bronze yoke
#

yeah, i'd caution against checking floats against exact values

neon bronze
#

would comparison be better?

#

i mean >

bronze yoke
#

something like < 0.01 as chuck was suggesting

hot patrol
rancid panther
#

this rainoa person is my mod's biggest supporter

neon bronze
#

i had one comment on mine and it was a bug report : (

hot patrol
rancid panther
#

poggies

hot patrol
#

looking good in my fingerless gloves and fedora.

rancid panther
#

im hoping to get any reports of mod incompatibilities so i can make sure my mod works as sufficiently as possible

drifting ore
#

can someone help me with my mod ive been on it for 2 days and nothing seems to add my costum recipes

hot patrol
#

@rancid panther btw do you know if professions with exclusive traits can't have their own description? I have a description set for my prof but all it shows it the trait name. I tried to fix it and all I managed to do was break the trait name.

#

the trait description works

humble oriole
#

This is how we do it,


Events.OnNewGame.Add(function(player, square)
  local map = { "APAMisc.Map_FoldCoffee","APAMisc.Map_FoldCrumple","APAMisc.Map_FoldCrumpleCoffee","APAMisc.Map_FoldCrumpleCoffeeDirt","APAMisc.Map_FoldCrumpleDirt }
  player:getInventory():AddItem(map[ZombRand(1,#map+1)])

end)```
red tiger
#

I want VSCode to allow me to populate an event template as an action.

#

(Types 'event' & sees 'New Event Hook' or something)

rancid panther
red tiger
#
Events['Event'].Add(function(params)
end);
red tiger
#

A feature like that would be epic.

rancid panther
red tiger
#

Ok back to work.

drifting ore
#

i guess no one knows

hot patrol
rancid panther
#

you have to add a description

#

in profession framework you need to put it in your UI_EN.txt translation file

#

UI_prof_ProfName = "blabla",
UI_profdesc_ProfName = "blabla",

drifting ore
#

here is my code and its not showing up in game so yeah ill go off or not but if someone can help me
its not showing up in game with the mod enabled

module MKSHR+ {

imports {
Base,
}

recipe Craft Makeshift Axe {
UnusableMetal=3,
WoodenStick=2,
SheetRope=1,
keep HammerStone,
Result:Axe,
Sound:Hammering,
Time:200.0,
SkillRequired:MetalWelding=0,
Category:Welding,
}

recipe Craft Makeshift Propane Torch {
UnusableMetal=8,
WoodenStick=2,
SheetRope=1,
PopEmpty=1,
Result:Blowtorch,
Sound:Hammering,
Time:200.0,
SkillRequired:MetalWelding=0,
Category:Welding,
}

recipe Scrap Pop Can to metal {
PopEmpty=1,
Result:UnusableMetal=2,
Sound:Hammering,
Time:20.0,
SkillRequired:MetalWelding=0,
Category:Welding,
}

recipe Craft Tissue {
RippedSheets=3,
Result:Tissue,
Sound:Hammering,
Time:10.0,
SkillRequired:Health=0,
Category:Health,
}

recipe Craft Bandage {
RippedSheets=2,
Tissue=4,
Result:Tissue=2,
Sound:Hammering,
Time:20.0,
SkillRequired:Health=0,
Category:Health,
}

recipe Craft AdhesiveTape {
RippedSheets=8,
LemonGrass=2,
Result:AdhesiveTape,
Sound:Hammering,
Time:50.0,
SkillRequired:Health=1,
Category:Health,
}

recipe Craft Bandaid {
AdhesiveTape=1,
Bandage=1,
Result:Bandaid,
Sound:Hammering,
Time:50.0,
SkillRequired:Health=1,
Category:Health,
}
}

hot patrol
#
    UI_prof_Weeb = "Weeb",
    UI_prof_WeebDesc = "Never had a job, dwells inside of their mothers basement, has never felt the touch of a woman and collects the most degenerate material known to man. Some would say your way of life makes being undead preferable.",
    UI_trait_Blade = "Studied the Blade",
    UI_trait_BladeDesc ="Whilst others were out partying you were studying the blade. Now the time has finally come to show them all the results of your training.",
}```
rancid panther
#

Weebdesc

hot patrol
#
ProfessionFramework.addTrait('Blade', {
    name = "UI_trait_Blade",
    description = "UI_trait_BladeDesc",
    profession = true,
    xp = {
        [Perks.LongBlade] = 2,
    },
    inventory = {
        ["Base.Katana"] = 1,
    },        
})

ProfessionFramework.addProfession('Weeb', {
    name = "UI_prof_Weeb",
    description = "UI_prof_WeebDesc",
    icon = "proff_Weeb",
    cost = 4,
    xp = {
        [Perks.Fitness] = -2,
        [Perks.Strength] = -2,
    },
    traits = {"Blade"},
    inventory = {
        ["Base.Dakimakura1"] = 1,
    },
    clothing = {
        Hat = {"Base.Hat_Fedora"},
        Jacket = {"Base.JacketLong_Random"},
        Hands = {"Base.Gloves_FingerlessGloves"},
        Shoes = {"Base.Shoes_ArmyBoots"},
        Pants = {"Base.Shorts_CamoGreenLong"},
    },
})
rancid panther
#

lowercase

#

o wait

#

profdesc_Weeb

hot patrol
#

so like this and then also change the translate txt? ProfessionFramework.addProfession('Weeb', { name = "UI_prof_Weeb", description = "UI_profdesc_Weeb", icon = "proff_Weeb", cost = 4, xp = { [Perks.Fitness] = -2, [Perks.Strength] = -2, }, traits = {"Blade"}, inventory = { ["Base.Dakimakura1"] = 1, }, clothing = { Hat = {"Base.Hat_Fedora"}, Jacket = {"Base.JacketLong_Random"}, Hands = {"Base.Gloves_FingerlessGloves"}, Shoes = {"Base.Shoes_ArmyBoots"}, Pants = {"Base.Shorts_CamoGreenLong"}, },

rancid panther
#

i dont think with profession framework you add a description tag for professions

#

maybe not even in vanilla

bronze yoke
#

where is the file + what is it called?

drifting ore
#

yeah i removed tose

#

wym

rancid panther
#

but yea that's how it should be written

bronze yoke
#

the script file

#

when they completely don't show up it's usually because it's in the wrong place or missing the extension or something

drifting ore
#

in the scripts folder

#

of my media

bronze yoke
#

media/scripts/file.txt?

drifting ore
#

yes

#

but is the code correct?
like the popempty stuff?

hot patrol
#

and report back

bronze yoke
#

for skill required Health should be Doctor but i don't think that would make the entire file stop showing up

rancid panther
#

adding things that dont exist in my mod always makes the file disappear in debug file list

drifting ore
#

yeah but even with one

#

like even with the right skills

#

still doesnt work i tried that

#

and the import i remove?

#

ok

bronze yoke
#

you can keep the import but it's redundant if you're already module base

drifting ore
#

so i can remove it?

bronze yoke
#

yeah

drifting ore
#

so its just module base without the block or how should it be placed?

#

what about the semi colon after module base

bronze yoke
#

semicolon?

drifting ore
#

{

bronze yoke
#

it doesn't need to be inline

drifting ore
#

so what other stuff to troubleshoot

#

WHAT

bronze yoke
#

sounds like it's definitely an issue with the file structure then

drifting ore
#

it wasnt showing the recipes

#

can you give me the one you use

neon bronze
#

Are you puting the file in the correct folder?

drifting ore
#

yeah

neon bronze
#

Maybe missed a bracket somewhere?

drifting ore
#

"C:\Users\myname\Zomboid\Workshop\MakeshiftItems\Contents\mods\MakeShiftItems\media\scripts\Makeshiftitemsrecipes.lua"

bronze yoke
#

.txt

drifting ore
#

its not lua

bronze yoke
#

not .lua

drifting ore
#

wtf

neon bronze
#

.lua?

drifting ore
#

i put it as txt

#

watdafuq

#

but in notepad++ it says txt

drifting ore
#

im so fucking confused

hot patrol
#

a life saver

#

though I am getting one error

#

gotta find that out

drifting ore
#

lets see if it works now people of discord gpt useless

#

real

#

wait

#

the

#

bandages dont work

#

why

#

and why does the propane torch not have image

#

yeah tissue etc

#

like the medical ones

#

oh wait im so stupid

#

different category

#

yeah i copied ur code

#

yeah

#

i tought i fixed that

#

but i guess not

#

why does the propane torch not work like the image?

#

but it does recognise it as propane torch

vast nacelle
#

Probably should be Result:BlowTorch with a capital 'T'

keen silo
abstract raptor
#

Good job! @keen silo

keen silo
#

thanks ๐Ÿ˜

wheat kraken
#

if im at triggered event
Events.OnServerCommand
then do call my own command

what is the best practice to get current client player?

just getPlayer()
IsoPlayer:getPlayerByOnlineID(IsoPlayer:getOnlineID())
getSpecificPlayer(0) <- this one

frank lintel
#

derp just posted wrong channel... lol

Expected to find missing API page for path zombie/modding/ActiveMods
Expected to find missing API page for path zombie/iso/sprite/IsoSpriteGrid
Expected to find missing API page for path zombie/chat/ChatMessage
Expected to find missing API page for path zombie/randomizedWorld/randomizedBuilding/RBBasic
Expected to find missing API page for path zombie/ai/states/FitnessState
Expected to find missing API page for path zombie/globalObjects/CGlobalObjectSystem
Expected to find missing API page for path zombie/ui/UI3DModel
... ```  Got a list now for things to look for first. ![drunk](https://cdn.discordapp.com/emojis/721361533271146537.webp?size=128 "drunk")
hot patrol
#

anyone know how I can get a profession to spawn you with a random item from an array list?

bronze yoke
#
local items = {"Base.Apple","Base.Banana"}

local onCreatePlayer = function(_playerIndex, player)
    local item = items[ZombRand(#items)+1]
    player:getInventory():AddItem(item)
end

Events.OnCreatePlayer.Add(onCreatePlayer)
hot patrol
# bronze yoke ```lua local items = {"Base.Apple","Base.Banana"} local onCreatePlayer = functi...

would this work with an array list my mod already uses? this is it. ```
-- Add Weapons Items Here for each Item variant
DakimakuraWeapons = ArrayList.new()

DakimakuraWeapons:add("Dakimakura1")
DakimakuraWeapons:add("Dakimakura2")
DakimakuraWeapons:add("Dakimakura3")
DakimakuraWeapons:add("Dakimakura4")
DakimakuraWeapons:add("Dakimakura5")
DakimakuraWeapons:add("Dakimakura6")
DakimakuraWeapons:add("Dakimakura7")
DakimakuraWeapons:add("Dakimakura8")
DakimakuraWeapons:add("Dakimakura9")
DakimakuraWeapons:add("Dakimakura10")
DakimakuraWeapons:add("Dakimakura11")
DakimakuraWeapons:add("Dakimakura12")
DakimakuraWeapons:add("Dakimakura13")
DakimakuraWeapons:add("Dakimakura14")
DakimakuraWeapons:add("Dakimakura15")
DakimakuraWeapons:add("Dakimakura16")
DakimakuraWeapons:add("Dakimakura17")
DakimakuraWeapons:add("Dakimakura18")
DakimakuraWeapons:add("Dakimakura19")
DakimakuraWeapons:add("Dakimakura20")
DakimakuraWeapons:add("Dakimakura21")
DakimakuraWeapons:add("Dakimakura22")
DakimakuraWeapons:add("Dakimakura23")
DakimakuraWeapons:add("Dakimakura24")
DakimakuraWeapons:add("Dakimakura25")
DakimakuraWeapons:add("Dakimakura26")
DakimakuraWeapons:add("Dakimakura27")
DakimakuraWeapons:add("Dakimakura28")
DakimakuraWeapons:add("Dakimakura29")
DakimakuraWeapons:add("Dakimakura30")

return DakimakuraWeapons

scarlet wigeon
#

hi, im still new to lua, and i cant figure out the correct syntax for my item's distribution
may i ask for an example ?

bronze yoke
hot patrol
#

it's also tied into addons that people make for my mod

#

so it's just easier if the profession spawns items from that

fast galleon
# scarlet wigeon hi, im still new to lua, and i cant figure out the correct syntax for my item's ...
scarlet wigeon
#

works like a charm, i was to noob to understand it was what i needed when i searched ๐Ÿ™‚

clever spruce
#

do any of you know of a mod that adds, as part of it's other features, a sort of condition bar to bags in the inventory hotbar that changes color based on the fill level of said bag?

clever spruce
#

I asked there and noone knew thus far, so I figured I might ask here and possibly get an answeer.

#

I apologize for asking in the wrong channel.

fast galleon
#

I seem to cause errors to mods that use Global ModData by doing something like:

    local function doOnce()
        Events.OnInitGlobalModData.Remove(doOnce)

    end
    Events.OnInitGlobalModData.Add(doOnce)
#

and nobody can track me

#

took me a few reloads to find myself

#

posting in case I remember for next time, not first time I do this

ancient grail
#

What basically you inititialize the removed the event . Without doing anything? Weird

fast galleon
#

obviously there's more code after that

ancient grail
#

Ah i see

crystal canyon
#

Where can I find information on modding pz? I want to add a simple carpentry recipe for the tall fences the often separate houses

ancient grail
#

Check threads

crystal canyon
#

Thank you so much Poltergeist!

red tiger
#

I have a massive headache & am sore / tired.. but I want to mod.

#

#>__>

ancient grail
crystal canyon
#

You're good as long as you're not feeling queasyqueasy

red tiger
#

Not until the sun sets.

ancient grail
red tiger
#

I'm also upset because I keep delaying the post for the forums for my VSCode extension for PZ modding scripts.

#

Too tired from work.

ancient grail
#

Looking forward to that

red tiger
#

I mean.. It's up and live for people to use it but man.. Writing a post feels like too much work.

ancient grail
#

Thats for txt right?

red tiger
#

Yeah. Only syntax highlighting is live atm.

#

I got to the finish line on the first sprint goal and now I'm dead.

ancient grail
#

Still useful . Wait live?
Whats it called im gona install now

frank elbow
# fast galleon I seem to cause errors to mods that use Global ModData by doing something like: ...

Was it an index out of bounds error? I think this should probably be a bug reportโ€”I wondered why this would be problematic & checked the decompiled code and I can see why it could cause problems (edit: actually, wait, no I don't. What was the error?) (another parenthesized edit to clarify and make this message even longer: it seems like the only thing that would happen is that it'd skip others' events once) (yet another edit: oh. I see why that would be a problem for an OnInit handler)

ancient grail
red tiger
#

Look up "ZedScript" in the Extensions marketplace.

ancient grail
red tiger
#

I had to code it in 100% Regex.

#

Took 2 weeks of spare time.

ancient grail
red tiger
#

Looks like this.

frank elbow
ancient grail
#

If im modifying something that doesnt have setter getter naturally then only doparam will work

And yeah i tried this. It didnt work

frank elbow
#

What's the something?

red tiger
ancient grail
#

Like static models

ancient grail
#

Theres now setStatic

red tiger
# frank elbow Nice logo

I retrofitted it from an older logo design candidate for a PZ server in the mid to late 2010's for ZedScript.

#

Thanks.

#

I design all my media.

ancient grail
#

But i know next build they will allow clithing to change texture so tht theres no need to create 4 different items which js the same item
Like hood down and hood up
Cap front cap backwards

tiny wolf
#

Hello everybody
I'm creating my first mod which add new items to the game.
I want to add this items to the loot table but i saw that there are differents ways to do this
In the DistributionProcedural file, i can put :

**table.insert(ProceduralDistributions["list"]["ArmySurplusOutfit"].items, "JacketFlecktarnGreen.JacketFlecktarnGreen");
table.insert(ProceduralDistributions["list"]["ArmySurplusOutfit"].items, 6);
table.insert(ProceduralDistributions["list"]["BedroomSideTable "].items, "JacketFlecktarnGreen.JacketFlecktarnGreen");
table.insert(ProceduralDistributions["list"]["BedroomSideTable "].items, 1); **

OR
**
local targets = {ArmySurplusOutfit = 6, BedroomSideTable = 1, }
local item = "JacketFlecktarnGreen.JacketFlecktarnGreen"

for k,v in pairs(targets) do
local items = list[k].items
table.insert(items, item)
table.insert(items, v)
end
**

I want to do the better thing to the game to make my mod optimized and easy to change. Which solution do you think i must choose ? ๐Ÿ˜ฎ
Thank you everybody โค๏ธ

ancient grail
#

Its the same

#

The other one is manual input
The second one iterates a table to insert

tiny wolf
#

why items have got this format : item.item ? can i use it better than my jacketflecktarngreen.jacketflecktarngreen ?

glass basalt
#

the format is module.item

ancient grail
#

Its items.item
The items is the table you insert and item is what you insert
You can name it anything

tiny wolf
#

Oh ok Thank you, i see where is the table you're mentioning, thank you guys !

#

Anyway, in few weeks i'll publish a new Twitch Integration Mod which let viewers play with there streamer

#

Viewers can :

  • buy a survivor (an avatar linked with the twitch account ID) with channel points ;
  • Send survivor into raid to get stuff ;
  • Receive Xp Points which let him upgrade his skills
  • Find stuff which spawn into the streamer base to help him
#

I'm using this big mod (we're a team of 4 working on it since 2 months) on my twitch channel everyday and it will be publish in April.
If you want to see it or something, don't hesitate to come ๐Ÿ™‚ and of course i'll give the link into this discord for all streamers who want to use it

glass basalt
#

If in the in-game console, I type getPlayer():isOutside(), will it execute the lua statement or not?

#

need to check certain flags for the player and tiles

bronze yoke
#

what do you mean?

#

are you asking if the lua console is a lua console?

glass basalt
#

yes stressed

#

didn't see that the input field is literally titled "Lua Command Line"
at least now I can test lua without rebooting everytime

wheat kraken
#

today i started my transport services inc, it is a realistic fast travel mod to zomboid, works SP and MP, you can ask to stop a bus to specific destination, and the 6 people that enters on bus/van, go with you to destination, it cost some money, im planning to do wallet fund compatibility with atm mod, you can even invite your buddies to your home by using last pos

im planning to record using with full group, you can send yours or we can make it together too, in the future it will be an uber option too, with trip paid by distance too soon (it is more easy to do then the bus thing)

Realistic bus fast travel - Reifel Transitio Rides (RTR) v1.0
https://steamcommunity.com/sharedfiles/filedetails/?id=2949835600

glass basalt
#

is there a way to register a custom event trigger?

#

i need one mod to do something exactly when another mod says its ready

bronze yoke
#

like this

glass basalt
#

does AddEvent have any additional params?

#

ah shoot I could just check the docs

#

it does not. ๐Ÿ‘

wise lion
#

hey hey people, im trying to make a mod which removes the sunday driver trait from the player after having driven for a while. When I use the OnPlayerUpdate event it works but when I try and use EveryTenMinutes it freaks out over player:isdriving. Is there a singular player update line im missing?

#

was going to link the everytenminutes to a counter that when hitting a certain point removes the trait

cosmic condor
wet sandal
rancid panther
#

i love tile inventory

wet sandal
#

Same lol

rancid panther
#

i wish more games used them, but every time i see it it's a pleasant surprise

#

that ui looks a lot neater than the current most popular clothing ui

small topaz
#

How do I iterate through all containers the player has equipped? (like backpacks worn on back, bags equipped in hands etc.)

open drum
#
local function addContext(playerID, context, items)
    local playerObj = getSpecificPlayer(playerID)
    for _, v in ipairs(items) do
        
    local item = v
       if item:getDisplayName() == "QuestItem" then
        context:addOption(getText("READ"), item, NEXTSTAGE, playerObj)
       end

    end

end  

#

guys, I am trying to loop through a player's inventory
and if an item with display item name "QuestItem" is found, I want to give it a context menu "Read" when right clicked
is that correct way to do so?

bronze yoke
#

otherwise, manually

open drum
#

Lol somehow i asked the similar question Razab was asking

#

XD

small topaz
# bronze yoke otherwise, manually

Ok. Have some ideas how this will work out manually. Do you know how to check whether an item is actually a container? (I would then simply check body locations and hands for equipped items and whether they are containers...)

small topaz
bronze yoke
#

i think instanceof(item, "InventoryContainer")

open drum
#

i believe thre's a function that checks if an item is in player's inventory.. so i think u can use that or find a function that checks if an item is in certain container

small topaz
open drum
#

also to add context menu, i just have to use the context:addOption ???

#

not sure if that function is inherited to all items automatically..

small topaz
red tiger
rancid panther
#

i have it on steam just cuz of the nostalgia

glass basalt
#

God, I have no idea why these functions I have added to an event are not firing

#

In a different file, a debug and a sound function ARE working

#

in this file, it doesn't even give me a log

#

and now I moved the function code to instead execute immediately and it gets even MORE strange

#

christ

ancient grail
bronze yoke
#

is it by chance ongameboot in the server folder?

glass basalt
#

no, it's my own custom event

#

I will continue dabbling with it until I show this mess

ancient grail
#

How did you declare it

#

Lua manager

#

?

glass basalt
#

yes

#

the event itself is working just fine

#

it's just these stupid timed actions not working as intended in the Java code

ancient grail
#

Is it on the same lua file

glass basalt
#

no

ancient grail
#

Weird

glass basalt
#

i made an init file for creating the event

#

and the event triggers in one timed action

ancient grail
#

Is that how vanillla does it

#

Maybe youre not suppose to

glass basalt
#

for clothing unequip yeah

ancient grail
#

Ahhh....

#

Thags usefull

glass basalt
#

ill do something else to fix these timed actions

ancient grail
#

I hate timed actions

glass basalt
#

okay, what the fuck. Now you're telling me that another part of my code is now not working all of a sudden?
absolute bullshit, I'm done modding for tonight

#

"yeah, we simply won't transform the item, even though its happening somewhere else entirely from where you were making changes"

#

I wish everyone here a very nice modding sesh apart from this crap I've been having lol

steel cargo
#

First person mod in project zombiod

late hound
rancid panther
#

just buy dayZ lol

drifting ore
#

Hmm, im planning to create a mod can change the tailoring material, i mean now we only use leather, denim and cloth to patch holes, i want to create and use rare material for more protection. But i don see any script or lua about that. Any suggest for this idea?

fading horizon
#

ill take a look and see if i can find a relevant file real quick

drifting ore
#

yah please, i try to find whole yesterday in searching file, internet but dont find any clue about it :(( Only thing i found is some strip.png :v

fading horizon
#

holy shit

#

just finally figured out my mod after being unable to do it all day yesterday

#

spent all day reading lua documentation because i knew nothing about lua

#

at long last ive done it

#

i struggled with replacing / adding to a vanilla function but I think i finally got it

#
ISEatFoodAction.new = function(self, character, item, percentage)
    local isClove = item:getType()
    local o = base_eat(self,character, item, percentage)
    --print(o.maxTime)
    if isClove == "CloveCigarettes" then o.maxTime = 2000 end
    --print(o.maxTime)
    --print("DONE")
    return o
end```
#

can someone please check and tell me if this is an okay way to accomplish adding to a vanilla function

#

i don't want to mess anything up, replace any files, or cause conflict with other mods

#

but i think this should be okay from my research?

#

@drifting oreI think i found something relevant

#

media\lua\shared\Definitions\ClothingRecipesDefinitions.lua

#
ClothingRecipesDefinitions = {};

ClothingRecipesDefinitions["Sheet"] = {materials="Base.RippedSheets:4" }
--ClothingRecipesDefinitions["Belt2"] = {materials="Base.LeatherStrips:1"}


ClothingRecipesDefinitions["FabricType"] = {}
ClothingRecipesDefinitions["FabricType"]["Cotton"] = {};
ClothingRecipesDefinitions["FabricType"]["Cotton"].material = "Base.RippedSheets";

ClothingRecipesDefinitions["FabricType"]["Denim"] = {};
ClothingRecipesDefinitions["FabricType"]["Denim"].material = "Base.DenimStrips";
-- ClothingRecipesDefinitions["FabricType"]["Denim"].tools = "Base.Scissors"; -- commented out as they are unused; recipe code handles this
ClothingRecipesDefinitions["FabricType"]["Denim"].noSheetRope = true;

ClothingRecipesDefinitions["FabricType"]["Leather"] = {}
ClothingRecipesDefinitions["FabricType"]["Leather"].material = "Base.LeatherStrips";
-- ClothingRecipesDefinitions["FabricType"]["Leather"].tools = "Base.Scissors"; -- commented out as they are unused; recipe code handles this
ClothingRecipesDefinitions["FabricType"]["Leather"].noSheetRope = true;```
rancid panther
drifting ore
#

Oh thankyou, iโ€™ll check it later when i come home

fading horizon
#
require "TimedActions/ISEatFoodAction"

local base_eat = ISEatFoodAction.new --make a copy of the vanilla function

ISEatFoodAction.new = function(self, character, item, percentage)             --override vanilla function
    local isClove = item:getType()                                             -- variable containing item type, which is "CloveCigarettes"
    local o = base_eat(self,character, item, percentage)                     --let vanilla new function run to create the "o" object
    if isClove == "CloveCigarettes" then o.maxTime = 2000 end                 -- if the item is a clove cigarette, make the use time longer because cloves burn slow
    return o                                                                 -- returns the o object so that the rest of the vanilla functions can perform
end```
#

this is the full code and the comments of what it does

#

nothing else

#

i'm very new to this

rancid panther
#

ah, you have a script that already calls the timed actions automatically?

#

i see

fading horizon
#

no this is all i have

#

its just adding into the vanilla function of isEatFoodAction.new

rancid panther
#

o i c

#

that's what i meant

fading horizon
#

oh okay

rancid panther
#

the script called it automatically

fading horizon
#

sorry, i'm still trying to wrap my head around all this

#

i'm just happy I finally got it working

rancid panther
#

yay!

fading horizon
#

something as simple as changing that took me a long time

#

but i was starting with no knowledge

rancid panther
#

it's okay tho, the less i learn, the less likely i am to lose hours of sleep over my mod again

fading horizon
#

now for the real fun part of learning blender and 3d modeling so i can make models

#

but models for cigarettes and a box of cigarettes should be easy

#

just a box and a cylinder

rancid panther
#

u could probably get away with a single cigarette as the 3d model

#

since the item itself is a single cig

fading horizon
rancid panther
#

unless u made it a drainable item, but im assuming u used similar code to the cigarette

fading horizon
#

you're not wrong

rancid panther
#

oh wow an emote drawn by one of my fav artists. i see them everywhere

fading horizon
#

however, it could be neat if I made a new item that's a carton containing a number of cigarettes

rancid panther
#

you could do that as well

fading horizon
#

hmm

#

for now I think ill do the single cigarette, upload it to the workshop, and then make a cigarette pack in an update

rancid panther
#

sapph's cooking has candy cigarettes that are a drainable item instead of 1 cigarette each time

fading horizon
#

is it possible to have a recipe with no item requirements

rancid panther
#

i dont think so

fading horizon
#

because if so I could just make it a recipe item that destroys on use and gives 12 cigarettes

rancid panther
#

oh yea you can do that

#

that's just a single item requirement

fading horizon
#

oh itself as a requirement

#

right

#

makes sense

rancid panther
#

look at script for "open sack of potatoes" etc

#

they all do stuff like that

fading horizon
#

i wish project zomboid had a "cool" moodle or level

#

so smoking a clove cigarette makes you less cool

#

lmao

rancid panther
#

lol

#

Rizz ๐Ÿ”ป

fading horizon
#

well this is not what i intended

#

worlds largest smokie

ancient grail
#

@abstract raptor look lava

#

Hehe

#

Smoke that you die

shadow trench
#

where do i get started with learning to make a mod?

#

i'd like to create a mod that allows blades to be sharpened with a whetstone

frank elbow
#

There are resources for learning in the pins and threads of this channel + the wiki

fast galleon
shadow trench
#

awesome, but it's a bit confusing. are there any specifics that i should look for to 'repair' an item?

#

so far i was able to modify the durability of a weapon, and it works well

chrome egret
# fading horizon can someone please check and tell me if this is an okay way to accomplish adding...

Yes, this is fine. You're effectively doing what Fenris_Wolf recommends in this guide: https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#overwriting-vanilla-code

GitHub

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

torn igloo
#

is the global moddata at client side independent from global moddata at server side?

fast galleon
#

same table, manual sync required.

#

though generally any obj is not exactly same

buoyant osprey
#

Where should I start when adding stuff like custom radio/tv

fading horizon
#

as in a new item or a new channel

#

does this cigarette look too big

#

or is it okay

buoyant osprey
drifting ore
fading horizon
#

man it was a pain in the ass

#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\TimedActions\ISRepairClothing.lua

#

also in there is ISRemovePatch.lua which you may need if you're adding new material

#
require "TimedActions/ISBaseTimedAction"

ISRepairClothing = ISBaseTimedAction:derive("ISRepairClothing");

function ISRepairClothing:isValid()
    return self.character:getInventory():contains(self.clothing) and
        self.character:getInventory():contains(self.fabric) and
        self.character:getInventory():contains(self.needle) and
        self.character:getInventory():contains(self.thread) and
        (self.clothing:getPatchType(self.part) == nil)
end

function ISRepairClothing:update()
    
end

function ISRepairClothing:start()
    self:setActionAnim(CharacterActionAnims.Craft);
end

function ISRepairClothing:stop()
    ISBaseTimedAction.stop(self);
end

function ISRepairClothing:perform()
    self.clothing:addPatch(self.character, self.part, self.fabric);
    self.character:resetModel();
    self.character:getInventory():Remove(self.fabric);
    self.thread:Use();
    
    self.character:getXp():AddXP(Perks.Tailoring, ZombRand(1, 3));

    triggerEvent("OnClothingUpdated", self.character)

    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self);
end

function ISRepairClothing:new(character, clothing, part, fabric, thread, needle)
    local o = {}
    setmetatable(o, self)
    self.__index = self
    o.character = character;
    o.clothing = clothing;
    o.part = part;
    o.fabric = fabric;
    o.thread = thread;
    o.needle = needle;
    o.stopOnWalk = true;
    o.stopOnRun = true;
    o.maxTime = 150 - (character:getPerkLevel(Perks.Tailoring) * 6);
    if o.character:isTimedActionInstant() then o.maxTime = 1; end
    return o;
end````
#

file contents

#

so basically you would define your new patches in media\lua\shared\Definitions\ClothingRecipesDefinitions.lua

then you would patch ISRepairClothing:newto check if one of your new patches is the item being applied

#

(i think)

drifting ore
#

hmm, i'll try the ClothingRecipeDef first, but still not find the protection value. Just like i want to create a new fabric type, so it should have new protection value

fading horizon
#

found it @drifting ore

#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\newItems.txt

#
    {
        DisplayCategory = Material,
        CanBandage    =    TRUE,
        Weight    =    0.05,
        AlwaysWelcomeGift    =    TRUE,
        Type    =    Normal,
        DisplayName    =    Leather Strips,
        ReplaceOnUse    =   LeatherStripsDirty,
        Icon    =    LeatherStrips,
        BandagePower    =   2,
        Tooltip = Tooltip_RippedSheets,
        FabricType = Leather,
        WorldStaticModel = LeatherStrips,
    }```
drifting ore
#

new item?

fading horizon
#

bandage power

#

i think

#

so you would define it with that

drifting ore
#

feel not true, it for the bandage i think?

fading horizon
#

perhaps

#

worth a shot, at least

drifting ore
#

just like, fast heal when use leather strip

fading horizon
#

maybe they use the same variable

#

but ill keep searching

#

just trying to provide anything i can โค๏ธ

drifting ore
#

yah, it's not

#

this is the sterilized sheet

fading horizon
#

damn

drifting ore
#

it also have bandage power

fading horizon
#

smart way to debug that though

drifting ore
#

so it's not the value i found

#

hmm, dont know how to use that

#

already turn on it but dont know how the dabug work :V

fading horizon
#

nah i was just saying that was a smart way to test that variable

#

to see if it really was the protection value

coral rapids
#

Hey guys you got any idea why my icon wont show up?

items.txt =
module BamsAlarmMod
{
imports
{
Base
}
item HomemadeAlarm
{
Type = Normal,
DisplayName = Homemade Alarm,
Icon = Item_Alarm,
Weight = 1
}
}

name=Bams Homemade Alarm
id=BamsHomemadeAlarm
description=This homemade Alarm created by a Speaker some Wires and 2 Batteries will lure any Zombie that is nearby away from you!

#

Hey guys you got any idea why my icon wont show up?

items.txt =

module BamsAlarmMod
{
imports
{
Base
}
item HomemadeAlarm
{
Type = Normal,
DisplayName = Homemade Alarm,
Icon = Item_Alarm,
Weight = 1
}
}

mod.info =

name=Bams Homemade Alarm
id=BamsHomemadeAlarm
description=This homemade Alarm created by a Speaker some Wires and 2 Batteries will lure any Zombie that is nearby away from you!

#

icon format is .png

#

32x32

fading horizon
#

in textures/Item_Alarm.png?

coral rapids
#

yup

fading horizon
#

you also need a comma after Weight = 1

coral rapids
#

oh for real? ๐Ÿ˜„

fading horizon
#

i believe so

coral rapids
#

hold on

fading horizon
#

i just read that somewhere

#

idk where though

#

maybe i'm wrong, still new to this

coral rapids
#

nah that isnt it :/

drifting ore
#

yah, not the value :((

#

this fking thing, that's why dont see so much mod about tailoring

fading horizon
coral rapids
#

sure

fading horizon
#

this is it

#

i didn't see the item_

#

but that's deffo the issue

drifting ore
#

yah, searching for the whole workshop and really a little mod about tailoring

#

hmm? My role change :V?

coral rapids
#

media -> scripts -> items.txt
textures -> Item_Alarm.png
mod.info

#

hold on

drifting ore
#

hmm, found some about it on wiki

coral rapids
#

nope still wont work sadly

drifting ore
#

does anyone got any idea about file has this class?

coral rapids
#

oh i see

#

yea it worked thanks mate โค๏ธ

fading horizon
#

but legit i'm stumped

#

searching the wiki, files, googling, etc

#

you picked a tough one lol

drifting ore
#

haha really hard

fading horizon
#

how do i make it so theres no "all" option?

drifting ore
#

hmm new cigar?

fading horizon
#

yeah

#

clove cigarettes

drifting ore
#

i see the image of item on ground, i think u should reduce a little

fading horizon
#

you think?

drifting ore
#

the size, maybe a little is better, or maybe im wrong cuz i often use the 3d model

#

oh

#

look gud with that

red tiger
shadow trench
#
module RepairKatana
{
    imports
    {
        Base
    }

    fixing Fix Katana
    {
        Require : Katana,    
       
        Fixer    : Whetstone = 1,
    }
}
#

how can i keep the whetstone after the repair?

#

im assuming this will delete the item after repairing?

shadow trench
#

awesome!!!!!!!!!!!!!!!!!!!!!!

#

thanks a whole bunch!!!!

#

eh, but it still doesn't address the items not being removed

red tiger
#

The guide fails to mention that:

Fixer : Woodglue=2; Woodwork=2,

The 2nd entry is a skill and level.

#

I'm not sure how that's calculated tbh.

#

ZedScript is cryptic and band-aid'd to hell.

#

It might be units of the item?

shadow trench
#

sigh

#

i wonder if its just not possible

#

maybe i could just make the item a drainable

#

and slowly reduce it's use

fading horizon
#

is there a "disable all" option in mod manager

#

i can't find one

#

but i'm really tired

#

and i don't feel like manually disabling 400 mods

jaunty marten
fading horizon
#

tyvm

fading horizon
#
-- ["list"]["inventorymale"]
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "gothCigs.CloveCigarettes");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 100);

-- ["list"]["inventoryfemale"]
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "gothCigs.CloveCigarettes");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 100);
#

this should make it so my item spawns on zombies every time, right?

#

i'm trying to test my distribution but I can't get the item to spawn

fading horizon
#

oh nevermind I was using the mod ID instead of the module ID before the item name

ancient grail
neon bronze
#

Can you do that with items aswell?

fading horizon
#

got my item distribution working and with that my mod is complete

#

now i just have to make the steam workshop and preview images

#

hype

quaint crescent
red tiger
#

@jaunty marten Hey. Spending some time today working on implementing my tokenizer in my vscode extension.

#

For the largest files, I've gotten the time down from ~2.0 seconds (Horrible) to ~0.02 seconds (Better).

#

This was due to cursor data being calculated from 0->offset in my char tokenizer.

#

Implemented a cache for it. dsaKEKW

wet sandal
#

Gotta go fast!

red tiger
#

With my lexer / tokenizer in place for the extension, that means development on auto-complete suggestions, a formatter, and a linter is now possible.

vast jasper
#

im not a coder so its going to be a hot minute to find out what im doing with these ntm i have at most 80 more of these to make and do their stats

#

the initial release is going to be these four and wont be anything like what they will be when "project fallout" is released

#

im hoping i can get who ever modeled "Project Fallout: Scientific Armoury" to make some power armor paints

#

but atm they are just going to give mechanics skill

sour island
#

If you want to avoid some tedium you could look at how I handled Named literature @vast jasper

#

I used Base.Book and a list of 3000 titles and authors + a bunch of colored icons to randomly seed names and colors.

vast jasper
#

๐Ÿ˜‚ yeah i should look into something like that

#

atm when they are read they turn into one of the vanilla auto magazines

red tiger
#

All recipe properties are case-sensitive.

weak sierra
red tiger
#

โ˜๏ธ

red tiger
#

@tame mulch

#

This is the phase where I start integrating your documentation.

ancient grail
#

@weak sierra nyahahha
U like the idea?

red tiger
#

ZedScript auto-complete is now becoming a reality. :D

#

In-editor documentation too.

ancient grail
red tiger
ancient grail
weak sierra
ancient grail
#

Esp if i add a jumpscare when it moves

red tiger
#

A little worried about really long code blocks in documentation buuut this does work.

#

I just laid out the implementation to be incredibly easy to add to.

#

So all scopes inside of module can be worked on and populated with documentation and auto-fill.

#

An idea I had was gathering up a list of all item objects and serving them as completion suggestions for recipes.

#

My full tokenizer is simplified and added to this extension as well.

#

I'll run through and do Recipe's options today and then fill in as I go forward in the following days.

#

I laid out the design of this feature for the extension in order to give the opportunity for modders to submit documentation if they wish to help with the process.

#

I don't expect anyone to do this because in the 10 years I've modded PZ this hasn't happened when I did.

#

xD

chrome egret
#

Your plugin is looking slick as hell, Jab

red tiger
#

One more screenshot before I pause for the day:

chrome egret
#

What's the compat on this bad boy?

#

Just restarted for updates and still can't install it

red tiger
#

I use the latest VSCode installation.

chrome egret
#

Can you check your version right quick?

red tiger
#

I'm going AFK for a while. Caught me at the last moment.

#

Sure.

#
Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: Yes
#

(This is my very first VSCode extension so anything that should be obvious isn't to me =( )

chrome egret
#

Had to restart one more time to get to 1.76.2, but now it installs.

#

Not sure if there's a hard dependency or something could be made more permissive with it.

red tiger
#

Yeah.

#

If you have insight feel free to DM me or join my server & say something or make an issue with the fix.

#

pull-request too?

#

lol

chrome egret
#

First

#

I don't have the fix for you unfortunately, you're one VSCode extension ahead of me in experience ๐Ÿ˜‰

red tiger
#

No worries.

#

Will take a look into when I can.

chrome egret
#

I can't say whether that's required for what you're using.

chrome egret
# chrome egret Looks like you have it locked to 1.76.0 and up: https://github.com/asledgehammer...

Interestingly, your devDependencies only take a dependency on the vscode types exposed with 1.73.0 and up, so perhaps version can at least be cranked down that far? https://github.com/asledgehammer/ZedScript-VSCode/blob/main/package.json#L34

GitHub

A third-party VSCode extension for supporting ZedScript files. - ZedScript-VSCode/package.json at main ยท asledgehammer/ZedScript-VSCode

chilly flint
#

hey, can anyone give me a guide on how to change a model of a gun?

fading horizon
#

Am i allowed to use real product images such as this for my workshop preview image

#

idk the workshop guidelines / rules

craggy bridge
#

i had an idea for a mod and wanted some pointers as to which wiki pages would be the most informative for my concept.
i want to make a very fleshed out bagel-making mod.
and i would like to allow for baking them with dough, toasting them, cutting them, and spreading stuff like jam, peanut butter, and more, onto them.
any assistance would be lovely!
oh and btw i already have a fair amount of coding experience so i can most likely figure any of that out myself, i just need to know what game specific info would be useful

fading horizon
#

i'd recommend looking at another cooking mod likes sapphs cooking to see how they laid out their recipes / definitions / lua

ancient grail
#

@craggy bridge

rancid panther
fading horizon
#

@rancid panther

#

what about if i remove the brand name

#

like this

#

would that avoid copyright?

rancid panther
#

i just learned about fair use in my class recently

#

it could be considered transformative, but i dont think the company will care regardless of what you do

#

i would say removing branding is good enough if you wanna go that route

#

maybe give it a pz-esque name too

#

kinda like how the boots mod calls Adidas "Adimas" and how modded vehicles use funny names too

fading horizon
#

mod doesn't reference the name at all actually

#

it's just "clove cigarettes"

#

so name isn't an issue

#

ill try it without the brand name and see if i get any kickback

#

only my second mod so i'm trying to be careful. I don't wanna mess anything up or get in trouble

#

bc i'm having a lot of fun learning how to make mods

eager pollen
#

making a car mod rn and wondering if it's normal that the entire vehicule (including the grey sections ( when you remove a part) are reflective.. I'm guessing it's not but can't seem to find what I did wrong..

red tiger
#

@chrome egret I went ahead and moved the version for vscode.

#

Let me know if this works.

#

I just bounced two issues on GitHub at once heh.

#

One involving code not touched for over 7 months.

chrome egret
#

I haven't run npm i at all, btw. It borked directly from the extension install

red tiger
#

Oh..

#

Fixing rn.

chrome egret
#

Once you determine the minimum version you think you can support, I was planning on downloading an old portable VS Code to test.

red tiger
#

@chrome egret Give the new version to validate & verify for about 8 minutes and try installing 41.78.19

chrome egret
red tiger
#

1.63.0

#

Oh heck

#

I just realized..

#

I only updated the TypeScript package.

chrome egret
#

Yeah, I think your latest change was only to devDependencies

#

But you left the engine version the same

red tiger
#

Yes. I'm editing this.

#

Okay. Expect another 8 or so minutes @chrome egret

#

Should be live.

glass basalt
#

Is anyone here a timed action guru, god, or deity? Because I need divine power to solve a very simple issue, in which reinventing the wheel 3 different ways did not solve apparently

frank rivet
#

Is there a mod out there that shows missing dependencies for a downloaded mod?

chrome egret
chrome egret
# red tiger Should be live.

It does appear to let me install with the portable 1.63.2 version I downloaded, but I do think it's broken somehow.

#

I presume that if it were working I would get some autocompletion help with this input, since it's similar to the example you showed:

recipe Do A Badass Thing
{
    On
}
#

Not getting IntelliSense with the newer VS Code version, but I do at least see syntactical highlighting, and it's not giving an error about the ServiceWorker registration:

red tiger
#

VSCode is very update-friendly.

#

Here.. one sec.

glass basalt
#

At the beginning of the game, my mod queues a timed action to happen immediately

#

There is another mod that queues other timed actions before my timed action, but I don't want that

#

so I have made an event that triggers when my timed action finishes, to call the other mod's code to queue its timed actions

#

but all sorts of shit happens and I can't make heads or tails

#

this is still the rough gist. it is a very complicated operation in the code lol

glass basalt
#

you could try searching through all of the files for anything that uses getActivatedMods(), but some mods directly use things from other mods without checking if they are enabled

#

in summary you just need to look at the code

red tiger
#

This is the packaged mod.

#

Try running it.

#

I think you can locally use it.

versed viper
#

SO this is out of the blue and nobody asked, but I want to bring attention to this for anybody paying attention:
https://discord.com/channels/136501320340209664/1088608788006830112

I have seen a lot of mods now that don't get parsed properly by the native PZ Linux client, and it's because of carriage returns in their files that have been written on DOS systems and can't be properly read by UNIX systems.

#

Pay attention to hidden characters :^)

red tiger
#

You mean \r\n?

#

Yeah it's something that the client needs to check for and handle.

boreal ginkgo
#

๐ŸŒŠ I just started writing mods for pz. Any testing tools y'all recommend? It's a bit of an ick to re-run the game over and over :p

versed viper
boreal ginkgo
#

Like a developer mode or something?

red tiger
red tiger
#

Would suck to see that swallowed up here.

boreal ginkgo
#

Thx for the quick response btw!

red tiger
#

Properties

#

First tab

#

advanced users line

versed viper
red tiger
#

I run PZ from Batch files personally.

chrome egret
eager pollen
#

Made a simple car mod, everything works fine, except I'm unable to get the bloodUI to show up on them.. could somebody point me in the right direction?
I've seen the the veh_blood_mask in the game files so my guess is I have to make one for my models. But where do I link it? The in-game car script use them as overlaydamage01 and 02, but when I do that the car gets bloody if the parts have low condition..

boreal ginkgo
red tiger
#

You can do the same thing with shell script unless you're using a Mac IIRC.

boreal ginkgo
red tiger
glass basalt
#

Insurgent auto-equips the weapon on your character and it happens before my parachute action

#

I am trying to make it auto-equip afterwards but it's not working, even if I comment out the code entirely weird shit still happens

#

need to sit back down and actually comb through it again. yesterday was a disaster because I also had college assignments and no real free time

fading horizon
#

[url=http://theindiestone.com/forums/index.php/topic/2530-mod-permissions/?p=36477][img]https://projectzomboid.com/images/MODS_02.png[/img]Website link[/url]

#

does anyone know why this image wouldn't be loading

#

for some reason the url image does not load

#

however [img]https://i.imgur.com/2RKJkHw.jpeg[/img] will load

#

in the steam workshop item description

fast galleon
#

how do the safehouses work exactly?

small topaz
# craggy bridge i had an idea for a mod and wanted some pointers as to which wiki pages would be...

I think most of the stuff you want to do can be realized by using appropriate script.txt definitions for your new items as well recipes and evolved recipes. What could be a thing is allowing to toast them because afaik there isn't any vanilla system allowing toasting (or am I worng? are there even toasters in game??). This might require some additional coding work.

As a starting point, I would just check the vanilla recipe.txt's to get an idea what is going on. They can be be found in media/scripts folder.

craggy bridge
#

id honestly be fine with just using the existing cooked system to represent toasted bagels

#

would i be able to make the uncooked bagels still be healthy to eat and not be bad like uncooked meat, or is uncooked food by itself unhealthy

#

like is uncooked food dangerous no matter what

#

also thanks for the descriptive help breakdance

small topaz
fading horizon
#

just published my new mod. Finally got it working

#

hope somebody likes it

fading horizon
#

what's the best way to contact a mod author for permission?

#

i tried going to their steam page but there's no message option

#

leaving a comment on their profile seems weird

#

no github

#

searched this discord but didn't find someone that could be them

#

author hasn't commented or updated the mod since January either

#

all i want to do is use some of their distribution.lua

#

mod page doesn't list permissions so i guess its credit where do?

hidden jungle
#

all modding for PZ is open source. just credit them if you feel the need too

fading horizon
#

ill be changing all the spawn rates I just don't want to have to copy / dig through all the spawn locations

#

so idk if credit is even needed then?

#

its not specialized spawn locations

#

just general stuff

hidden jungle
#

probably not, people look at other mods for "how did they do that" all the time

open drum
#

dear respectful coders, could someone help me on what to iterate if I want to find a "dead zombie" on the floor???

#

do getGridSquare() has its container inherited?

hidden jungle
#

i believe zombie corpses are considered loot containers. i know you can get all of the nearby players loot containers but i don't remember how

open drum
#

what i want to do is to bring up a context menu "inspect" when I right click on a dead zombie on floor

#

So i guessed that i need to get all the dead zombie on the position a mouse right clicked

hidden jungle
#
for _,Container in ipairs(loot.backpacks) do
    local Inv = Container.inventory
    if Inv:getType() == "???" then
        
    end
end```
open drum
#

then bring up the context menu

#

then perform the funtion , end remove the zombie below the set x y z

open drum
fading horizon
#

theres a zombie corpse autopsy mod

#

it adds an autopsy context menu to a corpse

#

you could check that out and see how they did it

hidden jungle
#

^

fading horizon
#

it should be very similar

open drum
fading horizon
#

searching now

open drum
#

ty

fading horizon
#

might be the vaccine mod

hidden jungle
fading horizon
#

but i'm not sure

#

so give me a sec

open drum
open drum
#

is all the containers: including box, zombie inventories, drawers all saved in

#

loot.backpack table?

hidden jungle
#

honestly so am i, that code is from AutoMechanics originally, it works for my mod.
I never messed around with it to get specifics on what loot vs loot.backpacks is

fading horizon
#

im not a sir but ty

fading horizon
#

but yeah i think that's a good place to start

open drum
fading horizon
#

no worries!

#

oh wow my role just ranked up

#

i'm cool now

#

literally just published my mod and i'm already going to start working on v2 because i'm bored

#

i don't even want to play the game anymore ; just make mods for it

red tiger
#

Going to try to continue work on my vscode extension before sleep.

bronze yoke
#

mods are still the property of their creators

#

the modding tos even makes sure to reinforce this, though it'd be true either way

red tiger
#

Let people know what you allow them to do with your work.

fading horizon
#

you do that by adding This mod's permissions fall under TIS's policy....etc to the mod page right

red tiger
frank lintel
#

jabs Jab

hidden jungle
#

way i see it, modding and writing code is just knowledge and information. anyone could know HOW to write that code. just because one person wrote it doesnt mean that nobody else is allowed too

red tiger
bronze yoke
#

i usually include a license file in the mod's root directory, as well as a 'go read the license file' notice in each file

frank lintel
#

its okay I just decided to open the attack.class today and my brain just went...

red tiger
#

I went.. crazy.

frank lintel
#

think lost time counts under that

red tiger
frank lintel
#

long as you arent writing methods called like setIsEnabled()

frank lintel
#

oh please tell me you didnt join the dark side

eager pollen
#

still trying to figure out how to add the blood overlay on cars..
in the game file they used Damage1Overlay but that doesn't work for me for some reason. any one familiar with this?

red tiger
#

Yuup. I'm in the stage where I get to show off my work the most.

#

Auto-complete suggestions.

frank lintel
#

well till ya get that going in IJ wont help me

red tiger
#

If you can't use something as silly and lightweight as VSCode..

#

xD

frank lintel
#

I just dont like it. its right behind VS2019

red tiger
#

God.. Screw Visual Studio though.

#

I have to use VS for work.

#

VSCode is my escape from that.

frank lintel
#

if VS would just straight up compile C out of the box I'd have less complaints

frank lintel
#

C and ASM for life

red tiger
#

I dunno tho.. people would kill for formatting, auto-completing, and syntax highlighting for ZedScript. =P

frank lintel
#

then lets see fortran 77 and 88 pascal, cobol/jcl...java

#

I think its a good tool

red tiger
#

Heheh

#

I get ya

frank lintel
#

make it commandlineable...

open drum
red tiger
#

See people are asking for this

red tiger
bronze yoke
#

i think it's great, i just don't want to use two ides for one project (and my projects are usually very light on scripts anyway)

red tiger
#

I work on both PipeWrench and ZedScript in VSCode.

red tiger
#

It's haaard

#

I'd need help.

frank lintel
#

why Im trying to give you a proper suggestion

red tiger
#

I wrote a tokenizer so someone can complete this for me.

open drum
#

wow, is pipewrench and zedscript a plugin for VSCode ?

red tiger
open drum
#

ah

red tiger
#

I use VSCode mainly so it kind of fancies that environment.

#

I had to do a fix for someone today with PipeWrench. =(

#

Pesky replaceAll missing from conventional JavaScript libraries.

frank lintel
#

if I can get kahlua to compile Im seriously tempted at making a decompile/etc toolset and not hide it behind gradle

red tiger
#

Hahahaha

frank lintel
#

wut?

red tiger
#

(Did some private upgrades to Kahlua in the past)

frank lintel
#

talking about zlib etc the whole source/class/annotation thing

red tiger
#

Ah ok.

#

I upgraded their Reflection API code.

#

They're using JDK 1.6 API.

#

Good ole MethodPointer to the rescue..

frank lintel
#

I havent run into any issues decompiling to 17

bronze yoke
#

yeah, i've never used gradle before and it was a real obstacle in getting that stuff working

red tiger
#

Gradle's a good fight.

#

Especially with KotlinScript.

frank lintel
#

its easy to use, problem is what its doing is totally invisible all you seeing is the output/result

bronze yoke
#

and it basically prohibits me from making any source alterations because i don't understand the whole plugin system

red tiger
#

I have examples of both for setting up PZ projects in my org's repo.

#

Gradle GroovyScript & KotlinScript.

#

And maven too.

frank lintel
#

now if ya got what it does on github or something so ppl can see and improve it okay fine... sadly atm thats not the case

red tiger
#

But I do.. IIRC.

frank lintel
#

huh wut?

red tiger
#

Here.. I'll even post ones from a private repo.

#

<3

bronze yoke
#

i was trying to rewrite it a little to make it use vsc lua style annotations instead of emmylua back when i was still using vsc but the whole gradle process obfuscated it too much for me

red tiger
#

Sorry but some projects are special.. =P

frank lintel
#

? unless its capsid not gonna help

red tiger
#

capsid again..

frank lintel
#

like I said the library crapper

red tiger
#

Party pooper.

#

I need to write guides though.

#

People need to know this stuff.

#

I went through many many hours of suffering to get working some of this stuff.

#

I even wrote a layered gradle project where some code sits in a private repo while the rest is public.

frank lintel
#

1 sec

red tiger
#

It's so I don't release PZ code. :D

#

But dw, I'm a old fck too. I played in ASM debuggers as a kid.

#

That world is crazy.

frank lintel
#

grrr it removed them again... my IJ I added every single libjar etc from the main game folder as a external library and finally stuff started looking like it knew what to do

fading horizon
#

what's the difference between defining a recipe and it's results like this

Recipe Open
    {
        destroy ClovePack,
        Result:CloveCigarettes=20,
        Time: 10.0,
    }```

vs setting an oncreate function that adds items like this 
```lua
function Recipe.OnCreate.OpenBoxOfJars(items, result, player)
    player:getInventory():AddItems("Base.JarLid", 6);
end```
#

or are they just two methods of doing the same thing?

glass basalt
#

you could theoretically have a recipe that idk spawns zombies or other wack stuff

#

you would just need Result:Recipe.OnCreate.OpenClovePack or something similar

#

time to fix this stupid mod again, hold me back

small topaz
#

Question about the official game mechanics: If food gets rotten, hunger value is decreased. Are the nutritional values like calories and stuff also decreased?

#

a bit difficult to find out quickly because when changing age of food in debug mode, the game behaves a bit strangely. So not sure if the results in debug mode are really showing how it is supposed to be during normal game play.

red tiger
#

Got an auto-completion with 2 steps, one being all skills and 2nd being all levels.

#

Wrote an API function variable that can override normal auto-completion generation for properties.

#

SkillRequired fit the bill for such an override. =)

#

Could make it so that Lua methods could pre-fill to make typing / organizing easier.

fading horizon
#

i saw your comment on my mod on the workshop, much appreciated โค๏ธ

glass basalt
#

๐Ÿ˜

fading horizon
# red tiger

you're really busting your ass on this and making significant progress each day and ive been here less than a week

#

great job honestly

red tiger
#

It's nothing to do with the vscode extension. That research led to this extension.

#

I plan to write a preprocessor language and a compiler for it to compile to ZedScript.

#

Before that happens I need to master ZedScript.

#

By the end of this month, you should be able to do quite a bit with ZedScript in VSCode. =)

fading horizon
#

it will definitely be making my journey to learning how to mod zomboid / use lua a bit easier

red tiger
fading horizon
#

i don't even know what that is honestly

red tiger
#

Then don't bother with it lol.

fading horizon
#

im experienced with making websites

#

html, css, js

#

that kinda stuff

red tiger
#

TypeScript is superset JavaScript.

#

It's a language designed to compile to JS however it can be compiled to others such as Lua.

fading horizon
#

interesting