#mod_development

1 messages ยท Page 244 of 1

compact warren
#

Daddy Dirkie dirks zomboid mapping tutorials

slow hound
#

also asking in mapping is better idea. some have idea here but not many

compact warren
#

it seems kinda

#

dead

#

but yeah maybe

slow hound
#

it is kinda dead. that's why i suggested the unofficial mapping discord

#

i will dm you the link

#

it's not dead there

compact warren
#

pretty cool

crisp fossil
#

I tried logging the character:getHealth but it always equates to 1 no matter the damage dealt to my character. Does it not return your current health? If it doesn't what is the correct way to do so? I just want to check if health is lesser than 50%

slow hound
#

this is just an example from vanilla. it looks like you may need to add a condition to make sure that current health doesn't equal to previous health and compare to that maybe? someone may have a better suggestion but overall something similar should do the trick to make sure it updates first. I think albion wrote that sometimes it returns the hp value before the damage is actually applied and calculated to the health overall, from the health value of the bodyparts

if self.chr:getBodyDamage():getHealth() ~= self.previousHealth then
        if self.previousHealth > self.chr:getBodyDamage():getHealth() then
            self.healthIconOscillatorLevel = 1;
        end
        self.previousHealth = self.chr:getBodyDamage():getHealth()
    end
#

@crisp fossil

#

not the best example but should hopefully make sense ๐Ÿ™‚

grizzled fulcrum
trail lotus
#

Well, anyone wanna make some money this summer on some commissions? Iโ€™ve got mods me and my partner jonny just canโ€™t get to as quickly and was looking to maybe sub out development of them to maybe some early coders with a little bit of skill or some advanced ones who just want to make a buck real quick. Iโ€™ve got maps of some mods that range in levels of difficulty and price. Itโ€™s not uncommon for me to spend 500usd+ on the right kind of mod. Currently feel free to pm me regarding it or ask in this chat I hate clogging it up cause normally you guys are having conversations we do have an active dev chat for modders we work with. Also side note the server contains zero Zombies and has a lot in common with something like FiveM/RedM/DarkRP so feel free to message me what your good at, UI, animation, Clothing, Art, modeling. And maybe we can work something out the main thing I need is UI work, a lot of the game is built around our custom UIโ€™s. I have 3 major mods currently in our scope of what we need done and like 2/3 medium ones and 1 small one of the top of my head. Thanks guys.

sleek hull
#

Is there a more 'conventional' or 'official' way to check if Events.OnCreatePlayer() is creating the player object for the first time vs loading in an existing character on the save?

Currently just checking if getPlayer():getHoursSurvived() > 0 which seems to work fine, but seems scuffed lol

rigid drift
#

Started working on an icon replacement mod for SMUI but I have a few other mods I've written down to try and mess with because I have a few that I really like but really really wish had proper icons, thought I'd share some and get some opinions ^^

civic tree
rigid drift
#

Before and afters. The bottom right I've never actually found in game but is a 'Gulf War Novelty', I ended up finding the exact Bart Simpson with a gun shirt (because of course) that the original was taken from but it was way too much detail to fit into the small icon, so I decided to get creative. At first I was going to do Spiffy ofc, but then decided since I'm working on a little radio / TV station mod I'd make up a new character for a PZ Simpsons-knockoff, and I based the design off of Pim from Smiling Friends since I was just watching it today ๐Ÿ˜…

rigid drift
#

Which will be the first mod I'll be replacing the icons of

#

Well there's a ton of icons in it, so I might do some and then start on a mod with a lot less items ^^

civic tree
rigid drift
#

Yeah its an odd name and an old mod, no worries lol. Sounds like some Fallout mod dedicated to fixing the menus or something.

small topaz
#

the pz wiki also has a page with a lua events and a brief description of them. just try google "pz wiki lua events" to find it.

sleek hull
# small topaz Events.OnNewGame is called when a new game starts afaik (not called when a game ...

Not quite what I need, it'd have to be an event that fires after creating a new character, regardless if it's in a new save or not. Events.OnNewGame only fires when a new world is initialized. Working on a mod that adds traits for starting injuries/challenge-esque scenarios, but to avoid applying said starting injury I need to know whether the created player object is new or has been in the world before.

On second thought I could also just remove the trait when the injuries get applied. Would probably be fine if Events.OnCreatePlayer() and checking getHoursSurvived() > 0 fails to suffice.

bronze yoke
#

OnNewGame is fired for new characters

sleek hull
# bronze yoke OnNewGame is fired for new characters

I know it's fired for new characters right when one is made via character creation, the issue I'm running into is it's also fired when the player object is loaded from a save it seems, unless what I tested was just wrong, which is also possible

bronze yoke
#

most often you would use OnCreatePlayer and use moddata to check if your code has already run, a usually intentional side effect of that is that it will run for existing characters created before the mod was added, if you don't want that getHoursSurvived is a solid approach

sleek hull
#

Think I'll continue with what I've got now then, haven't dabbled with ModData or anything yet as nothing I've wrote & published has particularly needed it for persistency. Just wanted to see what other ways I could try, as I thought getSurvivedHours() wasn't quite 0 on spawn for whatever reason, pretty sure I just had a >= where there should've been a > though.

grizzled fulcrum
bronze yoke
#

that's what i'd usually suggest, but if you want it to only run for *new* characters the moddata won't exist if you install the mod midgame

#

usually you actually want that behaviour so you can initialise things regardless, but for some cases you might really not want it

reef umbra
#

how would i randomly select a retail VHS and give it to my character?

#

replying to ask if you have figured out a way to do this or if someone has responded with an answer

#

cause i'm trying to do the same thing

#

well

#

a similar thing

#

trying to give myself 10 randomized retail vhs tapes

half remnant
reef umbra
#

ah\

#

thank you for your response

half remnant
#

No problem mate๐Ÿป

coarse sinew
# half remnant Nope, thats not possible from what I've seen. The VHS are randomly rolled from a...

It is possible. You can create random tapes and add them in the player's inventory.
For a random tape

---@type InventoryItem
local vhsTape = InventoryItemFactory.CreateItem('Base.VHS_Retail'); -- or 'Base.VHS_Home' or 'Base.VHS'
local mediaList = getZomboidRadio():getRecordedMedia():getAllMediaForCategory(vhsTape:getScriptItem():getRecordedMediaCat());
local mediaData = mediaList:get(ZombRand(mediaList:size()-1));
if mediaData == nil then
  vhsTape:setRecordedMediaIndexInteger(-1);
else
  vhsTape:setRecordedMediaData(mediaData);
end
getPlayer():getInventory():AddItem(vhsTape)

For a specific tape

---@type InventoryItem
local vhsTape = InventoryItemFactory.CreateItem('Base.VHS_Home'); -- or 'Base.VHS_Retail' or 'Base.VHS'
                             -- id                                       itemDisplayName                           spawning
local mediaData = MediaData.new("00a8b565-a566-44f3-b6d2-7a1ae2eafb0c", "RM_5929b5c4-1c65-4797-81b3-7963a55769c6", 0);
if mediaData == nil then
  vhsTape:setRecordedMediaIndexInteger(-1);
else
  vhsTape:setRecordedMediaData(mediaData);
end
getPlayer():getInventory():AddItem(vhsTape);
half remnant
reef umbra
#

thank you very much

#

can i yoink tat code

reef umbra
# coarse sinew It is possible. You can create random tapes and add them in the player's invento...

also how can i make code that makes it so i can eat every item? currently i have:


local function initLeadStomach()
    local player = getPlayer();
    TraitFactory.addTrait("leadstomach", getText("UI_trait_leadstomach"), 12, getText("UI_trait_leadstomach_desc"),false,false);
end
Events.OnGameBoot.Add(initLeadStomach)
local function makeItemEdible()
    local player = getPlayer();
    if player:HasTrait("LeadStomach") then
        for _, item  do
            if item:IsInPlayerInventory() && !item:IsFood() then
                item:setType("Food")
            end

        end
    end
end
Events.OnPlayerUpdate.Add(initLeadStomach)```
bright fog
#

You haven't applied the changes we already told you about in this code

#

Also you can make the code block in lua by doing

sour island
#

For _, item do is incorrect

bright fog
#

Yeah we already told him all that but he hasn't applied the changes yet

thick karma
hidden rock
#

How does one use OnConnectionStateChange? I don't know much but i can't seem to make it print anything so i guess it isn't being triggered?

severe locust
#

Ah well, I should probably have put my question here... I guess.
If I create a map mod and the spawnpoints.lua doesn't have spawn points for a certain occupation, what spawn point is chosen? Like for example in all base maps I can't find a spawn definition for electrician, but still I can spawn as one. So which spawn points does the game use? unemployed?

autumn pumice
#

guys anyone know how to fix that? trying to do some translation

hollow lodge
#

And paste the text again

half remnant
trim yacht
#

Is there any way to make a panel ignore mouse/keyboard interaction?

#

nm, I worked around it by making the parent panel 1x1 which seems to have accomplish what I was after

reef umbra
#

just for item do?

sour island
#

For is iterative, _ and item are variables being declared

#

Pairs() returns two sets of things

#

So you should have kept that

#

And given it an argument of a table

#

I think before you had no argument and got the error "need more arguments".

#

Also the table being the players items would make the isInPlayerInventory redundant. Side note, but I think that needs an argument too, to work.

reef umbra
#

im confused

#

what would i put in the table

sour island
#

In this case, it looks like your trying to iterate through the players inventory - so you'd actually not be using a table at all. Player inventory is an array I believe.

reef umbra
#

oh huh

sour island
#

You can see examples of this in the recipe.lua

reef umbra
#

alright

#

wait but i forgot how to use arrays lemme look it up

#

so im stupid how would i do this

echo lark
#

anyone know if its possible to use DoSource("[Recipe.GetItemTypes.SewingNeedle]")? im trying and it seems to be adding black digital watches instead of items with the SewingNeedle tag and im kind of confused now

frank elbow
# reef umbra so im stupid how would i do this

If I'm reading your intention correctly, you'd like the trait to allow the player to eat any item, right? Rather than setting the item type, it seems wiser to have handling to add a similar menu item for โ€œeatingโ€ non-foods that would just delete them & have whatever effects you're going for. You could only include that in the menu if the player has the trait

reef umbra
#

that seems very complicated

#

how would i do that

#

i don't even know how to do custom menu items like that

#

is it CustomContextMenu under InventoryItem or whatever?

#

sorry under Item

frank elbow
#

Setting things as food would be performed on the script, which is more complicated ๐Ÿ˜„ you can look at existing menu code to get an idea of how to add context menu items; unfortunately not home to provide more detail, but searching the code or other mods that add menu items for OnFillInventoryObjectContextMenu may be helpful

reef umbra
#

what mod would do that?

frank elbow
#

Any mod that adds something to a context menu

reef umbra
#

good point

#

can you give me an example

#

wait i know one

#

true music: jukebox

#

adds the context menu for operating the jukebox

frank elbow
#

I should clarify that you'd want something that adds an inventory context menu item; I'm assuming that one is a world object. The base true music mod might add some though

reef umbra
#

oh ok

#

ill find out

#

brb

#

back

#

i figured out that true music (the base mod) has the inventory context menu but i can't figure out how it works

civic tree
#

can i swap the model of vanilla backpacks?

austere sequoia
bright fog
#

Trying to add to a nil variable or some shit like that

#

Got to show us your code if you want better help bcs anything we can help you with is already said in that error

bronze yoke
#

there is no OnUseItem event

bright fog
#

Yeah

drifting ore
bright fog
#

Not sure what you're trying to do here

tawny pendant
#

ugh it's been a while since i last worked on making a zomboid mod, do I make the new mod folder in the Mods folder or the Workshop folder?

#

I completely forgot and I don't have old files to reference

austere sequoia
bronze yoke
#

you will eventually need to move to workshop to upload your mod, but you can work from either one

tawny pendant
#

ah okay thank you

austere sequoia
tawny pendant
#

tbh ive always found it easier to just copypasta the folder and edit the files as needed lol. at least for everything but the media folder which I end up purging lol

bright fog
#

Yeah that does the job

austere sequoia
tawny pendant
#

but yeah I'm looking to make a cooking QoL mod that allows you to make your own Baking Soda (and maybe other items related to cooking which can be a pain to find like yeast) without adding anything new besides intermediary items related to the crafting of the baking soda and yeast lol. I currently have one up on the workshop, but its old and I lost the files to it a while ago, so im starting from scratch as it seems that one had issues lol

austere sequoia
tawny pendant
#

i know, but also Id rather just start from scratch. just a preference lol

#

i'll still probably download it to peek through the old files, but it just feels better to work off a new mod file XD

austere sequoia
tawny pendant
#

lol

echo lark
#

anyone know how to remove a source item from a recipe? ive figured out how to add a source but not i need to remove the old source. trying to find all recipes with the source Needle to change it to [Recipe.GetItemTypes.SewingNeedle]

austere sequoia
echo lark
#

i meant with lua code sorry

#

i wana change all the recipes that just use needle to the method that pulls all items with the needle tag

bronze yoke
#

i think you can just remove it from the recipe's source arraylist

#

in your case it might be better to just edit the items in the existing source though

echo lark
#

well im trying to change all the recipes i have loaded on my server to accept the [Recipe.GetItemTypes.SewingNeedle] instead of just Base.Needle. cuz i made a new type of needle for my server and its not included in a bunch of recipes we have cuz the modders just used Base.Needle

#

so was trying to write a function to just replace all the base.needle in recipes with [Recipe.GetItemTypes.SewingNeedle]

#

which im not even sure you can inject [Recipe.GetItemTypes.SewingNeedle] into a source with lua. cuz i can get an item injected into the recipes but [Recipe.GetItemTypes.SewingNeedle] doesnt seem to want to work

bronze yoke
#

i'm unsure when those functions get processed, you might want to just call the function directly instead

#

those functions just add to the source's item arraylist when they get called so if you call it with that as an argument it's the same thing

tawny pendant
#

is it possible to make a recipe only accept a rotten version of a food item? im looking to make a recipe for yeast and im going to use the rotting mechanic as a stand in for fermentation, but obviously I don't wanna have the player be able to extract the yeast from the connoction as soon as its crafted (when it would still have the fresh label)

mellow frigate
tawny pendant
#

good to know, thanks! next question, how do I do that? like is there a page somewhere I can reference to see what I would need to write down?

mellow frigate
#

The keyword in steamapps\common\ProjectZomboid\media\scripts txt files is ReplaceOnRotten

tawny pendant
#

ah okay thank you

mellow frigate
#

it is used by various sorts of IceCream in vanilla

tawny pendant
#

oh yeah, when the ice cream becomes unfrozen for too long it becomes melted ice cream doesn't it

#

second question, how do I have something rot in less than a day? I want this thing to be fermented 1-2 hours mas, but im unsure if the measurement of time means I would need to convert from parts of an hour to a useable value or not

#

like I assume if I put down 0.5 in DaysFresh it would take 12 hours before it went stale

reef umbra
#

local function ISInventoryMenuElements.ContextEatNonFood()
    local self = ISMenuElement.new();
    self.invMenu = ISContextManager.getInstance().getInventoryMenu();

    function self.init()
    end

    function self.createMenu(_item)
        if getCore():getGameMode("Tutorial") then
            return;
        end

        if instanceof(object, "InventoryItem") then
            _item = object:GetItem()
            if _item then
                if _item:getContainer() == self.invMenu.player:getInventory() then
                    self.invMenu.context:addOptionOnTop(getText("IGUI_Eat_Item"), self.invMenu, self.openPanel, _item )
                end
            end
        end
    end

    function self.openPanel( _p, _item )
        ISRadioWindow.activate( _p.player, _item );
    end
    return self;
end```
#

this is my current code

#

im looking for what to replace ISRadioWindow with

bronze yoke
#

<@&671452400221159444> bitcoin miner

left plank
bronze yoke
#

it's on github so i just checked its source, it's just a bitcoin mining script

tawny pendant
#

is it possible to have an rotting time of less than a day? or is that just impossible

hidden rock
# coarse sinew <https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md#on...

I already checked that. This is what i have on client script:

local function OnConnectionStateChanged(state, message, place)
    print('MyMod: OnConnectionStateChanged triggered!!!')
    print("MyMod: OnConnectionStateChanged--> state: ",state," / message:  ",message)
end

if (isClient()) then
    Events.OnConnectionStateChanged.Add(OnConnectionStateChanged)
end

I also tried with OnCreatePlayer and it works and i can see the print in the console, but with the above i don't.

coarse sinew
hidden rock
honest shard
#

Hi, I've installed an old mod and when I try to spawn and item of that mod says that item "doesn't exist" and doesn't appear in the item list (admin panel) neither, but the mod is active. How can I fix this?

honest shard
#

It's because is unlisted or that I changed the original ID?

craggy furnace
coarse sinew
#

<@&671452400221159444>

late bolt
coarse sinew
sour island
#

Damn, that's like a 3rd one in 24 hours

sour island
#

Have you considered paid work?

sullen basin
#

Yeah these are good. As someone who's been paid for things, this is paid for things quality.

#

They're in the cortex command discord, not surprised haha.

tiny wolf
#

Hey guys
Do someone already succeed to hide a spawnpoint from the selection into the game please ?
I want to force the spawnpoint for my mod ๐Ÿ™‚

mellow frigate
tiny wolf
#

Gonna try thanks for the tip

safe silo
#

Looking for a way to lock a player in place as in no way at all for them to move. Gotten this far:

    local sq = player:getSquare()
    if sq then
        -- Set X, Y, Z
        player:setX(sq:getX())
        player:setY(sq:getY())
        player:setZ(sq:getZ())

        -- Set Lx, Ly, Lz
        player:setLx(sq:getX())
        player:setLy(sq:getY())
        player:setLz(sq:getZ())

        -- Set uninteractable
        player:setBlockMovement(true)
        player:setGhostMode(true)
        player:setInvisible(true)
        player:setInvincible(true)
    end

But I assume for it to work, it would need to be called OnTick which isn't recommended. Is there better alternatives?

fleet bridge
#

you can just set it to OnPlayerMove

#

so if the player stands still it doesnt trigger

safe silo
#

Oh that's true.. But wouldn't that needed to be called on the client? I can't use setInvisible etc. tmk on there. But perhaps send a msg to the server that player is trying to move and then do the above code?

bright fog
fast galleon
bright fog
#

setInvisible does run client side

safe silo
safe silo
bright fog
#

It's not the server that handles a player state

#

So anything that involves modifying a player is just done client side

#

I don't think the server can do it

safe silo
#

That seems to be current discovery too. Thank you

bold yoke
#

What programing language does project zomboid use?

bronze yoke
#

lua for modding

#

a lot of the engine and core systems are written in java

teal slate
#

Since apparently I make evil mods now

#

I like Into the Water, but my girlfriend raised some realism concerns with it, in that it'd be a terrible idea and might taint the water

#

it would be neat if dumping enough corpses reduced fishing yields and caused a chance of infection when drinking from sources in that map cell...

bold yoke
#

So it doesn't use a text file sorry

teal slate
#

I'm not sure if there's a way to save per-map-chunk stuff like that though

#

also I'm unsure if I could make water collected from it also have a chance to cause infection

fast galleon
#

It should be straight forward and doable with lua.

teal slate
#

hm, I'd have to check if water is part of the river or not though

bright fog
#

Might have something to help with that

#

The problem is that it generalizes "Seawater" to any water tile

#

So eh

teal slate
#

You cannot drink or fill containers at water tiles anymore.
Hm. That's sort of a dealbreaker.

bright fog
#

I mean, at least it's doable and easier than you think

teal slate
#

I think this mod works off of admin-defined zones, so I'd probably just have to do my own thing and mark specific map cells as being the river.

bright fog
#

Which wouldn't require the use of that mod

#

I mean idk

#

I think they don't define any fresh water tiles

#

@wicked crane can you give more detail on your mod ?

rigid drift
rigid drift
# sour island Have you considered paid work?

@sullen basin Thank you both!!! I don't actually consider myself an artist at all, just been a modder for so many games for so long that I've slid into it I guess, but if you think this sort of art is commission worthy then feel free to PM me and I'd be happy to discuss it ๐Ÿ™‚

craggy furnace
#

ill go ahead and just do the world reveal for the artwork while i am at it

rigid drift
#

Oh neat, big fan!! If you want any help with icons let me know ๐Ÿ™‚

craggy furnace
#

i thought about it, but there is simply too many items to actually do pixel art for really

#

currently clocked at about 463 articles of clothing

#

this isnt mentioning guns

rigid drift
#

Some is better than none I'd say, but more than fair ๐Ÿ™‚

craggy furnace
#

i am currently looking for a secondary programmer for a paid job, but at the moment thats about it

#

i wish pixel art could fill in more, but i just doubt it

rigid drift
#

I do know some code too ๐Ÿ˜‰ though probably not as much as you'd want

craggy furnace
#

that just depends on how familiar you are, really

rigid drift
#

Feel free to drop the details or PM them to me and I'll let you know

craggy furnace
#

currently looking for a good way similar to VFE to transition through weapon variations

#

that'd be the start but ultimately it just goes from there but whoever i find for it it'd be an on and off gig

wicked crane
# bright fog <@273910937227100162> can you give more detail on your mod ?

@teal slate

as stated in description:

Supported mods: Lost Province, Remnants of Kentucky

Add-on for Zone API that simulates Fresh and Salt water.
Turns all blends_natural_02 tiles to 'Seawater'.

You cannot drink or fill containers at water tiles anymore.
Create custom 'Fresh Water' zones using the admin Zone Editor.

Water Zones will work with other mods, you just won't have pre-defined Fresh water zones.

#

its for simulating sea water

bright fog
wicked crane
bronze yoke
#

kentucky is landlocked, it wouldn't make sense to use it on the default map anyway

bright fog
#

Aaaah

zenith spire
#

is there a way to make variables in scripts? I'm making my own custom weight mod and want to use variables to rapidly adjust items but the game crashes every time I test it out

bronze yoke
#

no

hollow wing
#

Im trrying to fix a mod thats halfbroken, how can I stop a item from spawning on zombies? (Modded item)

fleet bridge
#

Remove it from the distribution

signal storm
#

Unsure if this would be the correct place, but Iโ€™m looking for a mod creator to commission?

hollow wing
bronze yoke
#

it must add to distribution somewhere or it wouldn't spawn

sullen basin
rigid drift
#

My art has been way too scattershot for anything like that so far ๐Ÿ™‚ I used to run the mod The New Order: Last Days of Europe for HOI4 and I'm the current lead of the mod Godherja for CK3 which are my most known things

Hopefully you'll have plenty of examples from Zomboid mods sooner than later though! ๐Ÿ˜… thank you for the interest

sullen basin
#

Wouldn't hurt to have an artstation or something that lets you post and collate artworks. Yep, good luck on the mod front, I'm new myself. Just published my first one a few days ago.

fleet bridge
rigid drift
hollow wing
#

thats the funky part

fleet bridge
#

It must otherwise it wouldn't add. Are you have the right mod? What's it called?

austere sequoia
hallow knoll
#

Anybody knows how to get InventoryItem translated string? I mean translated name

austere sequoia
hollow wing
austere sequoia
austere sequoia
#

what bag do you consider op?

hollow wing
#

the mod adds two OP baga that shouldnt spawn at all

#

They should only be avaliable with cheat menu

#

The packpack and bac of holding

#

So far it only seems to be the packpack that spawns on zombies though

#

Beyond that from my testing yesterday I seem to hve fixed the other issues it had xd

austere sequoia
#

what was your mod called again?

austere sequoia
#

You could make your own actual clothing item and reference that in the item scripts

#

as in a clothing .xml with own guid and the guidtable. No need for new models or textures

#

where do your OP bags spawn (mostly)?

austere sequoia
hollow wing
#

Only zombies so far

austere sequoia
hollow wing
#

Alright, how do I do that?

austere sequoia
hollow wing
#

Thanks for the help man

austere sequoia
#

No problem ๐Ÿ™‚

hollow wing
austere sequoia
hollow wing
#

I use maya ๐Ÿ˜ฎ

austere sequoia
#

whatever gives you an .fbx that works for the game ๐Ÿ˜‰

austere sequoia
#

I just assumed blender, since its free and 99% of people here are using it

hollow wing
#

All good then lul

austere sequoia
hollow wing
#

I use maya cause its all I know ๐Ÿ˜›

#

industry standard or w/e

austere sequoia
#

check the pinned comments in #modeling , there you will find models of the male/female characters, so you have something to scale your models to

hollow wing
#

Cool thanks

midnight prism
#

how to make

#

music mods

#

especially cassetes

rigid drift
#

Download a music mod and open the files in it

#

And look at how they do it

coarse sinew
#

Or follow the tutorial on the mod page

hollow lodge
#

I what way

bold yoke
#

I'm working on a mod called outposts which would be outside of almost every city like a small quickly erected building with cages with some zombies in it a radio a small kitchen etc

echo lark
#

anyone know how to set a specific bleeding time/deep wound time? i can get the deepwound/bleeding to trigger but its timer is 0 seconds so as soon as you bandage it goes away. ive been trying varius methods of getbleeding time/setbleeding time and nothings working.

    local hasDeepWound = player:getBodyDamage():getBodyPart(Hand_L):deepWounded()
    local isbleeding = player:getBodyDamage():getBodyPart(Hand_L):bleeding()
  
    if not hasDeepWound then
      hand_l:AddDamage(10);
      hand_l:setBleeding(true);
      hand_1:getBleedingTime():setBleedingTime(300);
      hand_l:setDeepWounded(true);
      hand_1:getDeepWoundTime():setDeepWoundTime(300);
      player:SayShout("AAaagghh!!")```
thats the last thing i tried
trim marlin
#

Anyone know why my the trait im working on is not appearing on the trait selection page? :(


require('NPCs/MainCreationMethods');

Events.OnGameBoot.Add(Introvert)
MSTBaseGameCharacterDetails.DoTraits = function()
    local function initIntrovert()    
        local Introvert = TraitFactory.addTrait("Introvert", getText("UI_trait_introvert"), 2, getText("UI_traitdesc_Introvert"), false, false);

end```
bold yoke
#

Hey I can use some help with getting a mod I'm making to work now do I need Lua to start?

trim marlin
#

theres multiple options apart from Lua too

bold yoke
#

I'm using visual code studio @trim marlin

trim marlin
#

Which should be Lua in this case

bold yoke
#

For making a mod because I'm trying to follow the video and I have no idea as they already have everything signed up

trim marlin
#

I suggest you look at other mods and see how they do it

bold yoke
#

I'm trying to make a food mod but also crafting part of a mod

trim marlin
#

See how they're coded

#

It's the best way to learn

bold yoke
#

Well I was going to make it where you can make it yourself if they don't already have it in game basically where you take beef or anything like bacon cut into strips and then you have the ability to set your oven on low and then cook it over a long period Of time making jerky and then making an add-on for that mod where you can take the rotten stuff through and make it into something that's usable although it will the grade over time

bold yoke
trim marlin
bold yoke
#

No I mean this accessing the main game files to see how food is categorized and etc

#

My apologies

trim marlin
bold yoke
#

So there's no way of hanging on to mean files like food etc my apologies

#

@trim marlin

dense bison
#

I need some help with a code snippet for my Project Zomboid mod. How can I make it so that when the player's health drops below 15%, all wounds, fractures, bleeding, scratches, and bites on their body parts are instantly healed?

winter thunder
#

@bold yoke Are you trying to find the vanilla game files?

winter thunder
# dense bison I need some help with a code snippet for my Project Zomboid mod. How can I make ...

Well, there are plenty of ways that you can do that. Easiest would be to tie the function to a Lua event, something like OnPlayerUpdate, then check their health against your threshhold. If that check is true, then you run the list of things you'd need to update those different aspects. You'll find most of those things under BodyDamage in the Java Docs.

Here: https://www.projectzomboid.com/modding/zombie/characters/BodyDamage/BodyDamage.html

winter thunder
winter thunder
dense bison
#

I implemented a script to heal my character in Project Zomboid when their health drops below 15%, but it doesn't seem to be working. Did I do it correctly? Here's my code:

thick karma
#

Or :Saying it?

dense bison
#

No, I haven't tried printing anything yet. I'm new to coding and don't have much knowledge yet.

ashen copper
#

Say I wanted to put a barricade around a city or just along a defined path. What would be the best approach? Can ofc use the ingame brush tool, but that'll take quite a bit of time ๐Ÿ˜„

I want to cordon of certain cities and areas to build a progressing RP server.

night orbit
#

I see some weapons mods specify only a crit chance and no crit modifier, does that make the weapon not do extra crit damage or does it like use some kind of default modifer?

trim marlin
echo lark
# winter thunder Is there a reason why you alternate between Hand\_***l*** and Hand\_***1***? Se...

ah yeah that was a mistake. i didnt even noticed i did that lol. but i have tried various other methods since including this one

          hand_l:AddDamage(10);
          hand_l:setBleeding(true);
          hand_l:setBleedingTime(300);
          hand_l:setDeepWounded(true);
          hand_l:setDeepWoundTime(300);
          player:SayShout("AAaagghh!!")
        elseif hasDeepWound and not isbleeding then
          hand_l:setBleeding(true);
          hand_l:setBleedingTime(300)
        end
        end```
where its actual l and not 1. and that doesnt work either
bold yoke
#

Yes

austere sequoia
bold yoke
#

I'm trying to I went into the media folder which I still can't find as I'm going into the zomboid there's no media folder

austere sequoia
austere sequoia
bold yoke
#

thank you

austere sequoia
bold yoke
#

media then scripts?

austere sequoia
bold yoke
#

i can only chuse one

austere sequoia
bold yoke
#

would you like to see?

austere sequoia
# bold yoke would you like to see?

this should not be nescessary. click on the media folder. then click on the scripts folder inside it. there you will find "items_food.txt"

bold yoke
#

its not there

austere sequoia
#

the media folder?

bold yoke
#

The media folder is there it's just not showing it up

austere sequoia
#

ok dude, share me your screen

bold yoke
#

Okay I have a video chat up

#

dose alcohal count as food by the game files

fleet bridge
bold yoke
#

@austere sequoia thank you so much and also what went alcohol make classified as?

austere sequoia
bold yoke
#

thank you as im going to need that for part of my mod

austere sequoia
bold yoke
#

And when I work on a crafting recipe cuz I'm working on the item after it's done but I need help with the crafting making the item any thoughts

austere sequoia
bold yoke
#

Thank you

#

The reason why it's cuz if there's no way of making jerky and project zomboid I was going to add that as a recipe also something to use all that rotten food

#

And I already checked the file by the way thank you

austere sequoia
bold yoke
#

Darn it

austere sequoia
#

(doesnt mean you should not do yours!)

bold yoke
#

I was thinking maybe I could add my own version of the cannibalism mod or it takes more time but you learn first aid and cooking at the same time

grizzled fulcrum
#

I mean irl lol

bold yoke
#

And I was thinking that you can take whatever rotten food you might have and turn it into some type of drinkable beverage cuz I'm the type of player who wouldn't want to waste anything

austere sequoia
austere sequoia
bold yoke
#

Rotting fish can be turned into garam which is a Roman fish sauce and it would be good to if you can't get to a bar because the darn zombies are all in line waiting to get a drink

austere sequoia
bold yoke
#

I'm trying to make it so that there's a mod to get rid of all that waste

#

I don't think zombies would have two king of a smell but ears they would also when I make it do I put it into the main loop

austere sequoia
#

To be fair, composters exist, that turn rotten food into fertilizer and worms for fishing. plus on higher cooking levels you can use rotten ingredients without any harm. But having more to do with this stuff sounds nice!

bold yoke
#

Giving the player more ingredients to add to their food but I don't know how I should incorporate the beef jerky

#

How would I go about putting in a recipe for the jerky and then you just have to put it into a heat source for an hour or so and you got jerky it takes longer but you know what I mean for gameplay reasons?

#

So how should I go about the recipe do I need it in its own separate file?

teal slate
#

Is there an addon for Inventory Tetris that lets you put containers inside trash bags? I feel like of all containers, those should allow nesting...

grizzled fulcrum
bold yoke
#

Thank you but if I had to start off making my own for it because for the start of the crafting recipe you need salt and beef strips or bacon strips soap for the beef strips then you have to put it in the oven for an end game hour

#

My apologies

bold yoke
#

Darn

grizzled fulcrum
#

Is the way that moodles are displayed on-screen hard-coded in Java?? It seems there is no Lua component calling getText for moodles, and since it has to be getting the translations somehow I can only assume it's doing it by calling the proper Java method.

#

If so, it's weird how they have a UI that is Lua but then use Java too?

bold yoke
#

I was hoping I was on something but like most things somebody I was all right on it

austere sequoia
trim marlin
#

Quick question, if I made a mod changing the rarity of an items (for example dumbells) if I just made another file like this


ProceduralDistributions.list = {
    CrateFitnessWeights = {
        rolls = 4,
        items = {
            "DumbBell", 70,
            "DumbBell", 60,
            "BarBell", 60,
        },
        junk = {
            rolls = 1,
            items = {
                "Mov_FitnessContraption", 100,
            }
        }
    },
}```
#

would it automatically override the vanilla distribution for the dumbells?

vestal gyro
#

no that wouldnt work, let me get the correct code in just a second

#

table.insert(ProceduralDistributions["list"]["CrateFitnessWeights"].items, "Base.Mov_FitnessContraption");
table.insert(ProceduralDistributions["list"]["CrateFitnessWeights"].items, 1.00);
#

@trim marlinthis should work, the probability is a factor and I'm unsure how it works exactly, something to do with weight, someone else can probably explain it better than me but yeah if you have any other questions regarding this code lmk

#

this has to be in the lua/server folder btw

trim marlin
vestal gyro
#

once you got it down you can just copy and paste it and change the important stuff

bold yoke
#

working on a crafting resipy

crisp fossil
#

does itemScript:DoParam cant programmatically applied mid game?

trim marlin
#

does anyone know how to check if theres a simple to way to check if the players is outdoors or indoors?

#

So kinda like just a simple if PlayerObj:(IsIndoors)

mellow frigate
#

getCurrentSquare():isOutside()

trim marlin
mellow frigate
trim marlin
bold yoke
#

What would I need to do for a recipe that requires heat?

austere sequoia
#

Something like those lines, depending on what you actually want (in the item script of said fooditem):

    DangerousUncooked = TRUE,
    IsCookable = TRUE,
    MinutesToCook = 25,
    MinutesToBurn = 70,
#

@bold yoke

winter thunder
# bold yoke What would I need to do for a recipe that requires heat?

Also, based on some previous things that you mentioned. Iโ€™m pretty sure that changing the temp of an oven is just a multiplier effect on the โ€˜time to cookโ€™ & โ€˜time to burnโ€™ variables

There is probably a way to mess with that and make it work differently, but itโ€™d likely be very complicated

#

Wellโ€ฆ technically there are some trigger points you might be able to mess withโ€ฆ but Iโ€™m not sure the juice is worth the squeeze, depending on what you are trying to achieve

bold yoke
#

Thank you I'm sorry I'm trying to make it so that would take a long time cuz like I say I'm making a jerky mod but I also plan on somehow making it so that can ferment rotten food and alcohol for those who can't find any at any tavern and don't want to wait those potato seeds that they found or if they have one of those icebox fridges that they suddenly forget to put gas in their generator and loses all of its energy sorry

#

I thought that what might work because in a way it doesn't waste anything you can make Karen or fish sauce if you have salt and rotten fish or fish on the verge of spoiling

winter thunder
bold yoke
#

I know it seems complicated for a first mod project I'm not that type of player who wants to spend having all that rotten food around and not having a compost then and having basically nothing to calm me down cuz I'm a character that has to sleep outdoors to avoid being panicked etc

austere sequoia
bold yoke
#

I thought of a simple evolved recipe yeast the rotten material of your choosing in sugar for a liquor and just salt and fish for garume

austere sequoia
bold yoke
#

I understand it was supposed to be almost like a smoker or at least what could be like a smoker I can't fire doing things that humans have done for ages

winter thunder
# bold yoke I know it seems complicated for a first mod project I'm not that type of player ...

My first big mod project was a full drug mod with timed effects lmfao ๐Ÿ˜‚ It took me a LONG time to get something I was remotely happy with, it was a LOT of banging my head against the wall trying to understand what I needed to do.

If you are willing to take some recommendations. I would suggest starting with some basic recipes, get at least a bit comfortable with how they work. That gives you a lot of leeway, since youll know their limitations and understand what you can or cant do without having to immediately venture into the world of Lua haha

kind fossil
#

Hi! Asking a technical question here, has anyone been trying to mod the VOIP in PZ? I've been trying to improve it for months already but it's very scarce in documentation
Basically there are a few elements I would like to work on :

  • Stability (too many desyncs, mostly through walkies where you sometimes just don't hear a player if they haven't been loaded by your client)
  • Quality (it's very hard to listen with 5+ players scenes)
  • Variable range (whisper, talk, shout depending on an input)
    Do you know anything about what is doable or not?

Other question, has anyone been trying to externalize the VOIP to another service (TS, Mumble..)? I've been thinking of a system but there are a lot of elements that could be very hard to implement (walkies for example)

winter thunder
kind fossil
#

You think that would create more desyncs?

#

That's why i'm thinking that externalizing the VOIP to mumble would be a better solution

#

but there are so many issues to tackle with regarding this solution

#

walkies and you can't use any mods that use the microphone like zombies hear microphone

winter thunder
#

Yeah, I mean you could externalize it. I am sure there must be some sort of way to do it internally, but it would likely be very complicated. Which then in-turn adds a lot of bloat to the VOIP

kind fossil
#

Because my objective right now is making the VOIP less likely to desync

#

Or maybe it's possible to keep zombies hearing microphone while having the external VOIP

#

i have an idea

#

keeping the mic active on the server but block voip communication in the server

#

so the mic would still trigger from voice but there won't be communication

winter thunder
#

The biggest issue is that VOIP is not an instantaneous effect, it is continuous. It is really easy to mess with thew text chat, since once a message is fired, it is a single instant string to change. The VOIP is that continuous running chain of info that might be limited by PZ, the player's IRL equipment, internet connection in general, ping between the players, etc etc etc

kind fossil
#

true

#

bc right now it's killing our servers

#

we have so many issues where players can't hear each other

#

mostly through walkies

winter thunder
#

Is it an RP server?

kind fossil
#

yes

#

I think it's because the client doesn't load players that are not close enough from you

#

so in the walkie you will not hear their voice

#

if they are on the other side of the map, or even an other city

#

i have tested a few times during the server uptime and it confims my theory

#

admins for example are less likely to be concerned by this issue

#

because they teleport around during the session so they are most likely to be loaded by all clients

winter thunder
#

I mean, I would consider trying Text RP. Personally love it, I cant even fathom the thought of going to back to VOIP now haha

But I understand the frustration... I'm just not 100% that there will be a satisfying approach

kind fossil
#

We can't use text for this project unfortunately

#

it's one of the core components of the server :x

#

bc to outsource voip i was thinking of this framework :

#

create a mod that gets the coordinates of every players and update this data every tick in the server
with Mumble API we create a bridge with the mod and mumble that would locate mumble users according to the coordinates in the server

#

we could even add a 3rd coordinate in the voip!!

winter thunder
#

Though.... If it is just a matter of wanting to load the other clients, there are tons of ways to do that. If you can identify whatever is loading when the players are within close enough range of each other to 'render' them, then you should be able to just force the game to do that on its own

#

How many players...?

kind fossil
#

around 50

winter thunder
#

My friend

#

PLEASE

kind fossil
#

and they're getting more and more every season

winter thunder
#

PLEASE do not make an OnTick funciton that transmits data from 50 independent players ๐Ÿ˜ญ

kind fossil
#

yeah obviously haha

winter thunder
#

lmao

kind fossil
#

i was maybe thinking into having this mod player-side

#

so that the player's coordinate is sent to the server in a db

#

so the processing power is split among all players

winter thunder
#

Still, it'd be painful. Mods like immersive medicine are known to bog down clients do to the OnTick functions, even locally

kind fossil
#

yeah it's hard

#

maybe a solution would be to create a mod that load all clients together

#

so that we wouldn't have these desyncsq

winter thunder
#

Are people loading in and out regularly, or do they all play simultaneously

kind fossil
#

it's a session based server, it opens at a fixed hour and closes at a fixed hour
Players mostly login during the opening time however we have late players and also regular reconnections

#

so it really depends

winter thunder
#

Gotcha, yeah I feel like that is going to be difficult no matter what. The VOIP system was seemingly made in 2016 without significant(?) update since. May be wildly wrong on that tho lol

kind fossil
#

yeah that's one of the weakest point for PZ, i'm so sad to not see any love for VOIP

#

the only main update was the fix for walkies and radios which was a GAME CHANGER

#

but it's the only update we got in a few years basically

#

I would really have hoped to see some news about VOIP updates with the 42 updates

#

would be glad to see some when we will see a patch note, but don't have any expectations

#

Do you know if my theory is correct about the client not loading other players that spawned too far from them?

#

bc that could be a first step to find a solution

kind fossil
#

It's adding a KCP tunneling connection on top of the UDP used by PZ

#

if it works this would prevent desyncs

shrewd flame
#

Yooo I'm struggling with a mod i'm working on. I want to display text by a player until they remove it - halo title is too short and fades away and the on render stuff I cant get it to stop flickering

#

And randomly got this one time but have no clue what i did - it was something around trying to make the halo title stay above the player instead of fading away

ancient grail
shrewd flame
#

One sec!

#

And im all good dropping this for the sake of learning, I have a ton more ideas. Just got stuck on what i thought would be simple has me super stumped!

This has been my best version to build off of - simply right clicking, setting your title from the menu, being able to remove your title:

-- TitleAssignmentsMain.lua

-- Function to set the player's title
function SetTitle(title)
    local player = getPlayer()
    player:setDisplayName(title)
    player:Say("Title set to " .. title)
    print("DEBUG: Title set to " .. title)
end

-- Function to remove the player's title
function RemoveTitle()
    local player = getPlayer()
    player:setDisplayName(player:getUsername())
    player:Say("Title removed")

    print("DEBUG: Title removed")
end

-- Function to create the context menu options
function CreateContextMenu(player, context, worldobjects, test)
    local setTitleOption = context:addOption("Set Title", worldobjects, nil)
    local subMenu = context:getNew(context)
    context:addSubMenu(setTitleOption, subMenu)

    subMenu:addOption("Survivor", nil, function() SetTitle("Survivor") end)
    subMenu:addOption("Citizen", nil, function() SetTitle("Citizen") end)

    context:addOption("Remove Title", worldobjects, function() RemoveTitle() end)
    print("DEBUG: Context menu created")
end

-- Add the context menu option when the context menu is created
Events.OnFillWorldObjectContextMenu.Add(CreateContextMenu)
#

@ancient grail

grizzled fulcrum
#

Enclose the Lua code in these like this: ```lua
My Lua code
```

ancient grail
#

``

--code

``

#
-- TitleAssignmentsMain.lua

-- Function to set the player's title
function SetTitle(title)
    local player = getPlayer()
    player:setDisplayName(title)
    player:Say("Title set to " .. title)
    print("DEBUG: Title set to " .. title)
end

-- Function to remove the player's title
function RemoveTitle()
    local player = getPlayer()
    player:setDisplayName(player:getUsername())
    player:Say("Title removed")
    print("DEBUG: Title removed")
end

-- Function to create the context menu options
function CreateContextMenu(player, context, worldobjects, test)
    local setTitleOption = context:addOption("Set Title", worldobjects, nil)
    local subMenu = context:getNew(context)
    context:addSubMenu(setTitleOption, subMenu)

    subMenu:addOption("Survivor", nil, function() SetTitle("Survivor") end)
    subMenu:addOption("Citizen", nil, function() SetTitle("Citizen") end)

    context:addOption("Remove Title", worldobjects, function() RemoveTitle() end)
    print("DEBUG: Context menu created")
end

-- Add the context menu option when the context menu is created
Events.OnFillWorldObjectContextMenu.Add(CreateContextMenu)
#

im confused you want to change the name?

shrewd flame
#

No I just want to display another name that is seperate from the players name

#

Like I Malik set my title as Survivor so i'm Survivor Malik

ancient grail
#

for somereason it wont let me paste

ancient grail
#

this will continuosly print btw since outside the option

shrewd flame
#

I'm a amateur

#

This helpful, seriously. give me a sec

ancient grail
#

i cant seem to send my code for some reason sorry you have to type it out, or maybe ill try file

#

here ya go

#

whatsup with the emoji?

shrewd flame
#

I'm so hype you're being helpful! LOL tears of joy!

#

Testing it now

grizzled fulcrum
#

Hey, I just want to get an opinion for this proof of concept I've slapped together yesterday for a mod handling all things translations. Basically, my main goal was to change translations at runtime whenever getText is called. It works but only for translations that are used on the Lua side (TIS pls expose more stuff to lua in b42 or java modding ๐Ÿ™, or let us use ASSEMBLY OR SOMETHING). Would anyone actually use this/is it worth developing? I am asking this because most of the times I have made proof-of-concepts in the past, either it's a useless idea or there's already a better way to do it. My ultimate goal for this is to provide translations that can change dynamically in the game instead of static from the translation file, but I guess you could really achieve the same thing pretty easily on a per-mod basis (although it gets annoying when say making dynamic translations for a separate mod without this little helper mod)

shrewd flame
shrewd flame
ancient grail
shrewd flame
#

But that did it!!!!!

ancient grail
#
Events.OnGameStart.Add(function() 
    --everything here
end)
#

this will prevent it from running outside the game

shrewd flame
ancient grail
#

replace the

--everythinh

shrewd flame
#

One sec

#

Oh wait no i did that! - trying again

ancient grail
#

then i hav eno idea why its still showing then,, i really dont activate any mods and i test using the host button

shrewd flame
#

It was me

#

lololol

#

LETS GO @ancient grail !!!!!

inner tide
#

I'm having trouble compiling my game after making changes to a specific file. I need help resolving the errors that are occurring during the compilation process. I followed this tutorial to decompile https://github.com/Konijima/PZ-Libraries

shrewd flame
#

There's some free code, once again i dont care if people upload but at least shout out Glytch3r

inner tide
inner tide
ancient grail
ancient grail
inner tide
# ancient grail

what I'm trying to do is change a single value in the game files (a mod), but to do that I had to decompile the .class files to .java files. I've done that and changed the value i wanted, but now I have to compile it again to get the .class file to use as a mod on my game, and that's what I'm having trouble doing, compiling it again.

ancient grail
rare obsidian
#

I think im gonna look at game codes later today and see if you can add weight of containers on a tile added to vehicle weight

#

Would be so nice if theres a way to do that for furnitures but... probably good starting point for container weight first

#

Wood fuel idea... probably after 42 relez

crisp fossil
#

is it possible to change the AcceptItemFunction mid game?

grizzled fulcrum
#

I think I have misunderstood your goal. Can you provide some more info?

crisp fossil
#

I used to it like this scriptItem:DoParam("AcceptItemFunction = acceptItemOnly") on start, which works, but now I need to change it to scriptItem:DoParam("AcceptItemFunction = acceptAny") depends on my Mod Options

#

Btw I tried this command scriptItem:DoParam("DisplayName = Sample") and it doesn't work so I figured DoParam does not work mid game but I'm not entirely sure

grizzled fulcrum
#

You should look at how ItemTweakerAPI does it

#

Are there any sane people that use getText() on the server-side of lua? If so, why? I see the game does this too, but why would the server need to know translation data? Any info is good info!!!

crisp fossil
#

I does not work on ModOptions saving. I think it only works on this Events.OnGameBoot the TweakItem function adds your item to the TweakItemData which is altogether updated using DoParam during OnGameBoot

grizzled fulcrum
#

that would make sense as I only ever used TweakItem in OnGameBoot event

#

if you use DoParam like they did and it doesn't work, I have no idea how else to do it sorry

simple patio
#

hi so im making my own mod that depends on VFE and VFE case ejection and i havent completed it yet but ive tried loading it into the game and it gives me errors whenever i try to reload by pressing R, open map with M and i cant open the craft menu at all. Does anyone know what my issue is >.<

#

im new to modding if that helps ;-;

grizzled fulcrum
#

Can you share the console.txt file that is in your %UserProfile%\Zomboid folder?

#

That file holds the latest console log output so if you have played separate sessions in-between the time you had errors and now then it wouldn't hold any useful info though. (If this is the case, maybe you can try replicating the error in game and then posting the log file)

#

Also you probably want to run your game in debug mode whilst developing a mod (helps solve some errors better) among other useful features. To do that you can just specify the launch parameter -debug in Steam under Project Zomboid's game properties.

simple patio
#

this one?

grizzled fulcrum
#

ya

#

I have nothing exact but Super Survivors may have caused it, so disable that to test. Also there are a lot of errors relating to UIManager.update which implies that either the vanilla game's UI or one of your mods' UI is causing error a lot.
I'd recommend verifying your game files in Steam just in-case as some vanilla files are causing errors (doesn't mean it is the cause specifically)

#

please lmk if the errors come back after verifying your files

simple patio
#

i managed to get the item i added with the debug menu so thats a plus :D

grizzled fulcrum
#

yeah it's pretty helpful for testing mods

#

Also I am going to go on an unrelated rant (not about you) and say to everyone who prints debug stuff to the log: PUT A DEBUG MODE CHECK IN YOUR LOG FUNCTION FOR THE LOVE OF GOD

#

not every single regular user and the resulting person who has to read that log to potentially fix an error that a user had wants to see a message every tick saying "ontick" or something similar xd

simple patio
#

so when i press M its giving me an issue in client/ISUI/Maps/ISWorldMap.lua

grizzled fulcrum
#

yeah thats a vanilla lua file which is not usually where errors come from

#

thats why I said verify files first because sometimes it just does that idk

#

but errors in vanilla files can be caused by mods too, it's just that the stacktrace doesn't tell me where the error really originated from

#

the closest thing I got from the stacktrace was that super survivors created player data and an error in a vanilla file was caused because of that somehow

simple patio
#

ty for being so helpful im not the best at coding ๐Ÿ˜ญ

grizzled fulcrum
#

also btw I've seen someone fix vanilla lua errors by just deleting the vanilla lua folder (in C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media) and then verifying the files again

#

the folder you delete named Lua will download back when verifying the files, it's only that sometimes Steam is weird when handling files like workshop mods and even game files

simple patio
#

oh oki ill try that now verifying didnt fix it unhappy

grizzled fulcrum
#

though if you don't have a lot of mods enabled, you can always disable one by one and see which one causes it

simple patio
#

i think its mine cause it works fine without my mod :(

grizzled fulcrum
#

but if you have any mods changing the crafting ui or creating their own ui, one of those would probably be what causes these errors

grizzled fulcrum
simple patio
grizzled fulcrum
#

sned recipe pls

grizzled fulcrum
#

that would probably be why

simple patio
#

oki oki

grizzled fulcrum
#

I probably should have asked for your mod's purpose instead of assuming that you had no errors (which it is fine to have btw, everyone has to learn somehow)

simple patio
#

i have no idea if i did this right i basically looked at other recipes from the games file and worked off that

grizzled fulcrum
#

btw do you use an ide for editing code

#

if not (or you don't know what ide is) use visual studio code

#

it will save you 1 billion headaches (well not that much but it helps especially for writing lua)

simple patio
#

oki oki

#

i just looked on the mod wiki and it said use notepad++ ๐Ÿ˜ญ

grizzled fulcrum
#

but its better than notepad

#

notepad++ is alright too but thats so old school today, I used to use notepad++ back in like 2011 lol and im not even that old

#

its the equivalent of comparing like a nokia to an iphone kinda sorta not really but my point still stands

simple patio
#

oh oki

#

ty

#

im installign it now

grizzled fulcrum
#

are you planning on doing any lua related stuff?

simple patio
#

ummm all i really want to do is add a few items and crafting recipes

#

and animation if i need to

grizzled fulcrum
#

okok

#

I assume the Recipe.GetItemTypes.SharpKnife function you have exists?

#

like does your or another mod define that?

simple patio
#

ummm it was in the VFE recipes

grizzled fulcrum
#

im not actually quite sure whether you can reference to other mods' lua functions in your recipe

simple patio
#

ohhhhhh

grizzled fulcrum
#

so idk if you can or can't do that

simple patio
#

so do i re-write it with all the item types that can be used?

grizzled fulcrum
#

before you do anything though

#

is primer_powder a VFE mod item?

simple patio
#

no its my own

grizzled fulcrum
#

ok nvm

simple patio
#

wait sry the recipe.getitemtypes.sharpknife was in the game recipes

grizzled fulcrum
#

I think I've done like 2 recipes ever and I already forgot how I wrote them so I am trying to like recollect my skull

grizzled fulcrum
#

because I do lua more than recipe

simple patio
#

ahh

#

ive only ever done python ๐Ÿ˜ž

grizzled fulcrum
#

thats no excuse for me tho!!!

grizzled fulcrum
simple patio
#

do you think the issue is do do with using matches in the recipe?

#

like cause they have an amount reamining bar?

#

idk if that would cause an issue

grizzled fulcrum
#

you dont have a comma after the keep line

#

I really hope thats not the issue LOL

simple patio
grizzled fulcrum
#

this is why vscode can be sometimes useful

simple patio
#

if thats the issue i have no hope in finishing this mod ๐Ÿ˜ญ

grizzled fulcrum
#

dont say that, you're at a natural disadvantage already for using notepad lol

#

its like playing hard mode but for developers

#

and the comma after result to

simple patio
#

yeah i should have realised that

#

omg i didnt see that either ๐Ÿ˜ญ

grizzled fulcrum
#

it took me a while!!

#

other than that, the only two issues I think can be (and im not even sure of them) are: possibly using module base could do something wacky, or the weird indentation of the recipe

simple patio
#

oh oki oki

#

this is the only other script if this helps

grizzled fulcrum
#

to show you an example recipe from vanilla game:

recipe Make Stake
{
    TreeBranch,
    keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver,

    Result:Stake,
    Time:80.0,
    Category:Survivalist,
    OnGiveXP:Recipe.OnGiveXP.WoodWork5,
}
simple patio
#

THIS IS THE ONE I COPPIED

#

BASICALLY

grizzled fulcrum
#

loool

simple patio
#

๐Ÿ˜ญ

grizzled fulcrum
#

in vscode, I'd recommend the zedscript extension for recipes

#

on the left side bar you can find the extensions menu

#

once you install that, go to the bottom right of vscode and click "Plain Text" which is the file type that vscode detects and change it to zedscript

#

it wont change the actual file extension but it will change the highlighting and syntax checking stuff that vscode does

simple patio
#

oki i just did that tysm

grizzled fulcrum
#

also I did notice

#

your item has a space between it

#

use underscore or camelCase like item primerPowder or primer_powder

simple patio
#

omg

grizzled fulcrum
simple patio
#

i use primer_powder somewhere else

grizzled fulcrum
#

ya

#

that should hopefully be the end of your worries

simple patio
#

ill try it now tysm!!!

simple patio
#

IT WORKS

grizzled fulcrum
#

niceee

#

also make sure you have a definition for the static model in your models_items file too

#

the game does it like this:

model PaintTinGreen_Ground
{
    mesh = WorldItems/PaintTin,
    texture = WorldItems/PaintTinGreen,
    scale = 0.4,
}
simple patio
grizzled fulcrum
#

im using the green paint can model as example

young edge
simple patio
simple patio
grizzled fulcrum
#

IM NOT THAT OLD

young edge
grizzled fulcrum
#

i swear

young edge
simple patio
grizzled fulcrum
young edge
#

F...

#

Fine I'll just be old by myself Pain_Peko

grizzled fulcrum
#

just because I used the equivalent of "back in my day" lol

young edge
grizzled fulcrum
#

I think being old is an achievement kinda even if it might suck because you're constantly reminiscing on when you were a child

#

its like "congrats you haven't been hit by a bus" or somethihng

simple patio
#

im 16 so you guys are like

#

vintage

grizzled fulcrum
#

lol

simple patio
#

im teying to find a box of matches to test it

young edge
grizzled fulcrum
young edge
grizzled fulcrum
#

like you have to pay rent if you live on your own

empty stirrup
#

Hi

#

Boo

empty stirrup
#

Yes

simple patio
simple patio
#

you scared me

young edge
grizzled fulcrum
# simple patio once again ty so much!

no problemo, feel free to ask me anything thats hopefully not recipe related because I suck at recipe stuff but also im sure you'll be fine so long as you look at vanilla game stuff too

simple patio
#

WIOOOO

grizzled fulcrum
#

also has anyone reworked the different ui elements yet? like crafting, moodles, etc

#

I am planning on writing a UI for moodles so I don't have to deal with the hardcoded Java moodle ui and it's trash (and so it works with another mod I am working on)

#

but I'll probably have to do it eventually to other uis ๐Ÿ˜ฆ

grizzled fulcrum
grizzled fulcrum
#

it's

simple patio
grizzled fulcrum
#

whats the file name of the icon and where did you put it?

simple patio
#

its item_primerpowder

#

and its in the same mod folder but in a different section called textures

grizzled fulcrum
#

yourModFolder/media/textures right?

simple patio
#

yes

grizzled fulcrum
#

thats weird, it should work

#

make sure it's a PNG

simple patio
#

do i need .png at the end

grizzled fulcrum
#

I am not sure if the extension matters but I've only seen vanilla and other people use PNG

#

not there, no

simple patio
#

hmmm

grizzled fulcrum
#

I thought you might need to put it in a texture .pack file but I was testing with icons on my first mod and I did it exactly like how you are doing it

simple patio
#

does the item_ bit need a capital I?

grizzled fulcrum
#

Icon = Item_ToothbrushPink in the file and the file exists under mod_folder/media/textures/Item_ToothbrushPink.png

grizzled fulcrum
simple patio
#

oki oki

grizzled fulcrum
#

I'll be surprised if that is the issue but you can never know these days

#

sometimes it's like you think you have it figured out but no it's some random issue on the other side of your mod or something

young edge
grizzled fulcrum
#

I did see spiffUI which is interesting

#

but most moodle ui changes aren't actually rewrites of the original but just a retexture of the moodle icons

#

I need to redo the whole thing using Lua for me to get translations working the way I want them to

#

but it is fine and I don't think it will take much to do that so I am not worried

simple patio
#

didnt work but thats fine for now

grizzled fulcrum
#

oh wait I do have idea @simple patio

#

Remove item_ before the name of the texture in the item script file

#

so instead of Item = Item_SomeItem you have Item = SomeItem

simple patio
#

oki

grizzled fulcrum
#

sorry I dont know why my brain up and left

#

this is my calling to sleep, but I will respond on my phone if I am pinged lol

simple patio
simple patio
grizzled fulcrum
#

no you aren't its fine, I drank a bucket load of coffee when I woke up lol

grizzled fulcrum
#

so just put it Icon = primerpowder,

simple patio
#

ty!

grizzled fulcrum
#

โ˜•

simple patio
young edge
vestal gyro
trim marlin
#

attempted index of non-table on line 21... can anyone help?

neon bronze
#

I would drop the events. prefix to see if it works without it

drifting ore
#

hey guys, does anyone know how to add custom animations when doing a recipe? (or, well, how to make a custom action with a certain outcome with a custom animation)

sour widget
#

Good afternoon. I have a desire to make mods for this game, but I'm at a loss and don't know where to start. Can you tell me where is the best place to start on this path? Thank you in advance

tranquil kindle
# drifting ore hey guys, does anyone know how to add custom animations when doing a recipe? (or...

If we take a look at recipe "Saw logs" it has : "AnimNode:SawLog," So youre intrested in this line, add it to your recipe, then if you were to look at where this Anim is by searching ctrl F on pz folder it would lead you to ProjectZomboid\media\AnimSets\player\actions, but i belive aything from AnimSet should work, but i dont really remember to just to make sure you could copy file youre intrested in and put it in actions folder in your mod (As im not sure if recipes are tied only to actions folder)

tranquil kindle
#

Thats how you would use already existing animations from game.

#

You want to add animation (you did not state if custom one so i assumed vanila one). You add line "AnimNode: animation of your choosing" to recipe

#

And you can find those in media>Animsets

drifting ore
#

hmm

#

what if i make animations?

#

like... custom animations?

tranquil kindle
#

Then you need to save custom animation in anims_X > Bob and create own XML file in animsets

#

Rest is the same

drifting ore
# tranquil kindle Rest is the same

what about moodles? can we have moodles during a crafting recipe's time? (not when its finished but during the recipe, or upon activation of the recipe crafting)

tranquil kindle
#

I belive you could alter character stats with lua during crafting, unless you aim for custom moodle, then i have no idea since i've never touched those

drifting ore
#

interesting

#

well, thanks for the information nonetheless :D

wet sandal
#

Also you can ask the player object if its in a room directly
player:isInARoom()

You also should not check this against nil
isInARoom() returns a boolean, true or false, and neither of those equal nil, so that check will always be true.

oblique venture
#

anyone know if there is a way to reference a line guid from a recorded media file in lua. trying to make a vhs i created award exp for a custom skill i added to the game.

outer crypt
#

Does anyone know if there is a way to force a container's item list to update from the server to the clients?

lofty epoch
#

Does anybody know how I could potentially replace the gas mask's model with a custom model?

#

I personally find the S10 not fitting for the timeframe and loacation

#

Im wamt M40 :3

dry pier
#

Hello, I'm having some issue overriding the base game recipes. Is there something special I need to do? I've added the "obsolete:true,", and then added a new recipe with the same name with the "Override:true," and it doesn't seem to pick it up.

#

Also, is there a way to reload the script .txt files without restarting the game?

barren creek
#

Hello, everyone needs help.
You need to write a simple test code that will be in the skills menu ( PerkFactory) and write 2 skills can you help?

#

error:
function: addNewSkills -- file: YourModName.lua line # 6 | MOD: MyNewSkillsMod java.lang.RuntimeException: Object tried to call nil in addNewSkills at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980) at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812) at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66) at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139) at zombie.Lua.Event.trigger(Event.java:64) at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:65) at zombie.GameWindow.enter(GameWindow.java:753) at zombie.GameWindow.mainThread(GameWindow.java:491) at java.base/java.lang.Thread.run(Unknown Source)

wet sandal
#

Github copilot just informed me that I stole my own code and provided links to every single modpack on github that contains Equipment UI drunk

bright fog
#

Interesting to know Copilot does that

#

I've never used it

grizzled fulcrum
#

Since you define your function in events table and not global space

stone garden
#

hello fellow modders

trim marlin
#

Only thing I need help with now is making it so you get bored while outside... could anyone help?

rare obsidian
#

man i really dont like reading simple vars

#

0 context

#

not anymore i guess

grizzled fulcrum
#

what I'd do is in an EveryOneMinute event callback, check if the player is outside and then if they are add some boredom

#

if isOutside doesn't work for some reason I guess you could do player:getCurrentBuilding() == nil or something

trim marlin
#

Though I doubt I'll even get more than 10 downloads on my mod lol

grizzled fulcrum
#

if you want to increase boredom inbetween every in game minute, you could use OnTick event but I'd highly recommend NOT using it

#

if you want the boredom increase to be exponential you can do a lot of math stuff in Lua to calculate your new boredom value from your current one

trim marlin
grizzled fulcrum
#

it gets executed every in game tick. A tick iirc is usually one frame so onTick on the client end at 240 FPS is 240 times a second

#

where every in game minute is just one second irl I believe no matter your frame rate

#

I am probably wrong on some of that someone can correct me but that's what I believe, unless it's like minecraft where there is a static tick rate

#

tl;dr it's not worth the performance loss of constantly calling the functions to change boredom level in ontick event when you can do literally everything you would need for that in EveryOneMinute

rare obsidian
#

doesnt a lot of funny stuff happen when you have fluctuating framerates and then you tie stuff like that to the framerate

#

hmm

#

still a lot of simple vars. i guess its not perfect

grizzled fulcrum
#

but still even if it does say 60 ticks per second, you're running your code 60 times a second for no valid reason

#

in his case, updating boredom 60 times a second which has 0% purpose

rare obsidian
#

yeah i know most games usually tie it to physics

grizzled fulcrum
#

when you wonder why your mod isn't working and then you spend 30 minutes trying to debug only to realise you forgot to enable it panic

wet sandal
#

Literally me, but with the live workshop version vs the dev version

grizzled fulcrum
#

you should set up a cachedir with your pz so you dont have to juggle both

#

thats what I do

wet sandal
#

Whats that?

grizzled fulcrum
#

I have cachedir for development so my mod is a symbolic link to the repository and then my main game (in %UserProfile%\Zomboid) has my mods that I play with normally that I also subscribe to my mods too

grizzled fulcrum
#

So I have 2 technically, one is the default one that is used by everyone and the other is for dev and it's in C:\dev\Zomboid and thats where I put my mods when developing stuff

#

you can use launch param -cachedir=C:\dev\Zomboid like that

wet sandal
#

Interesting, but my mods are all in the Steam workshop folder, so changing the Zomboid directory wouldn't really help me.
If I used /Zomboid/mods/ though, this would be a great tip

trim marlin
#

Anyone know why the game is telling me I should put an additional "end" somewhere in here?

grizzled fulcrum
#

it's one keyword elseif

#

you're basically declaring a whole new if statement on that line with else if

#

and since else wants an end statement

#

Lua thinks you are doing this:

if blah then
    bodyDamage:blah
else
    if playerObj:hasTrait(blah) then
        blah
    end
-- no end here !!!
#

I hope that helps

trim marlin
grizzled fulcrum
#

if it helps you, it helps me!

analog hornet
#

i wish someone could make a mod for superb survivors to work in multiplayer

grizzled fulcrum
#

does anyone know if the prefix in the translation is required to come first before anything else??

#

example:

IG_UI_EN = {
    IGUI_health_Overall_Body_Status = "Overall Body Status",
    TESTING_IGUI_health_Overall_Body_Status = "Testttt",
}
#

it seems the game cannot find the test translation but it does with the former one.

#

nvm the prefix is infact required to come first

trim marlin
#

does anyone know the differences with PlayerObj, Player and Character?

grizzled fulcrum
#

you mean like

playerObj:doSomething()
player:doSomething()
character:doSomething()
```?
trim marlin
#

yeah

grizzled fulcrum
#

if so, they are just variable names and the class of the variable is a IsoPlayer

trim marlin
#

My game breaks when using PlayerObj and Character to use the :HasTrait("Example") and with Player it just doesnt work

grizzled fulcrum
trim marlin
#

Sorry ive just never had a coding class before and I just learn by people helping me or looking at others code

grizzled fulcrum
#

with this extension, it will show you like:

-- extension will show player variable as IsoPlayer
local player = getPlayer()

-- When you go to access player, it will show all it's methods like
player:[[highlighting will show here]]
grizzled fulcrum
#

if you know, that is

trim marlin
#

Ill just share the code I have for one of my traits real quick

#

I changed the if character just now to try and see if it worked instead of player

#

Though I just noticed the "local player = get player()" just now whoops

#

maybe I should change that too

grizzled fulcrum
#

character here should be showing an error, make sure you have Lua Language Server extension by sumneko and the umbrella I showed above (the link I linked to will explain how to install it with vscode)

#

wait do oyu have character as a variable outside of that function anywhere??

#

but it should be player:HasTrait("trait") anyway

#

Is there seriously no way to add my own translation files like translate/EN/TEST_EN.txt?

#

I tried and I can't get it to work so I assume not, but thats so dumb if I have to override the vanilla files just to add any translations

#

I guess I could just shove it all into UI_EN.txt but I really hate that

trim marlin
grizzled fulcrum
#

oh uh

#

if you already have it lmk

#

it's either git or for some reason node.js even though I don't have node.js and it works fine on my end lol

trim marlin
#

Did you ever get your issue figured out?

grizzled fulcrum
#

wat issue

grizzled fulcrum
#

no I don't think there's a way around it, so I just packed everything into one file

#

It's not like I have to look at the translations often thank god

grizzled fulcrum
#

ah project zomboid go and just hardcode everything grrrrrrr yet another UI I have to rework in Lua if I want to do anything productive :l

trim marlin
#

I hate how stupid coding makes me feel

#

I spend an entire 3 hours figuring out why my trait applied even though I didn't have it

#

It's because I forgot to check if the character actually had the trait

grizzled fulcrum
#

rip

#

it's like that a lot

grizzled fulcrum
jaunty isle
#
            local    maxRange = weapon:getMaxRange()
            local    scopeRange = scope:getMaxRange()
            local    scriptRange = scriptItem:getMaxRange()
            if    (isShotgun(weapon)) and (maxRange ~= scriptRange) then        -- NERF SHOTGUN RANGE
                weapon:setMaxRange(scriptRange)
                DebugSay(3,"Scope Disabled "..tostring(weapon:getMaxRange()))
        --    elseif    (not isShotgun(weapon)) and (maxRange < scriptRange) then    -- RETURN IF RIFLE
            elseif    (not isShotgun(weapon)) and (maxRange < scriptRange) and (weapon:getModData().Trajectory ~= "CQB") then    -- RETURN IF RIFLE, ADD CQB CHECK
                weapon:setMaxRange(scriptRange)
                DebugSay(3,"Scope Restored "..tostring(weapon:getMaxRange()))
            end
        elseif    (scope == nil) and (isShotgun(weapon)) then                -- RETURN SHOTGUN IF NO SCOPE
            local    maxRange = weapon:getMaxRange()
            local    scriptRange = scriptItem:getMaxRange()
            if    maxRange < scriptRange then
                WeaponReloadScript(44)
                DebugSay(3,"Reload Script")
            end
        end```

Hello guys, this one is from Gunfighter2.0, nerfing shotguns' range gain by scope.
but the problem is, when I attach choke and attach a dot sight on a shotgun, this script kills the range gain from choke.
so I'd like to modify this script in a reasonable way..
like, let the gain from choke maintained, and limiting range gain from scope to 1.
since full choke's range gain is 2, setting shotguns maxrange gain limit cap to 3 would be working I suppose?
the problem is  how to do it with this script.
since I know nothing about lua, can you help me out?
grizzled fulcrum
#

one sec

grizzled fulcrum
#

and choke increases range too?

jaunty isle
#

yup

#

so attaching only a choke works alright

#

but if I attach both, then due to this script, choke's range gain is deleted

#

I guess sights should rather increase aim speed and hitchance but it's gonna be too much of work to change all the numbers from every sight/scope in the mod

#

so I just wanna change the script and call it a day hahah

grizzled fulcrum
#

unironically this script doesnt use scopeRange anywhere in what you've posted so I assume either you didn't post the whole thing or they just left it in?

jaunty isle
# grizzled fulcrum unironically this script doesnt use scopeRange anywhere in what you've posted so...

I have no clue how the mod works
I tried to check those factors from attachments section
but it's like this

item Sight_MicroDot                                
{                                
Type = WeaponPart,                                
DisplayCategory = WeaponPart,                                
DisplayName = Trijicon RMR-2,                                
Icon = Sight_MicroDot,                                
Weight = 0.28,                                
WorldStaticModel = W_Sight_MicroDot,                                
WeightModifier = 0.28,                                
HitChanceModifier = 4,                                
MaxRangeModifier = 0.4,                                
AimingTimeModifier = 6,                                
ReloadTimeModifier = 4,                                
AngleModifier = -0.002
grizzled fulcrum
#

can you show the item for a choke too?

jaunty isle
#
item Choke_Full                                
{                                
Type = WeaponPart,                                
DisplayCategory = WeaponPart,                                
DisplayName = Choke (Full),                                
Icon = Choke_Full,                                
Weight = 0.05,                                
WorldStaticModel = W_Choke_Full,                                
WeightModifier = 0.05,                                
MaxRangeModifier = 2,        /* TIGHTER PATTERN            */            
AngleModifier = 0.05,        /* TIGHTER PATTERN            */            
DamageModifier = 0.5,                    
#

PartType = Canon,
Tooltip = Tooltip_Choke_Full,
MetalValue = 1,

#

missed this 3 lines

grizzled fulcrum
jaunty isle
#

sure!

grizzled fulcrum
#

It's only that context matters

jaunty isle
#

the script is located at 5744th line

#

oh wait, wrong file

grizzled fulcrum
#

that is same file lol

jaunty isle
#

so the previous one has changed script

#

which wouldnt work in-game most likely

grizzled fulcrum
#

o

#

chat gpt's not that good yet unfortunately

#

this mod has like 8000 lines in one file

#

I'd die if I wrote this myself

jaunty isle
#

yeah it def looks like a long work

grizzled fulcrum
#

it's not the contents of the file, it's that they put it all into one file ๐Ÿ’€

jaunty isle
#

eh hahah maybe they didnt want to make many .lua files? or
maybe they have been adding one by one and got massive in the end? not sure hahah

trim marlin
#

That way it fixes it for everyone else using it too

grizzled fulcrum
#

true that, I'll still write a fix real quick tho

jaunty isle
#

but on the steam workshop page, the comment section is closed and I can't see a way/page to report something or post a suggestions tho

grizzled fulcrum
#

can you try modifying the first weapon:setMaxRange(scriptRange) to something rediculous like weapon:setMaxRange(scriptRange + 100)

#

uhh idk the line number but it's like this:

jaunty isle
#

can I just put + 100 after the scriptrange like that?

grizzled fulcrum
#

sending ss because discord can't format code properly

grizzled fulcrum
#

it will give me a better idea of what the hell setting this range does and if the range is scriptRange+100 even after putting on attachment

#

because there is a scope attachment check at the start

#

but no choke attachment check anywhere

jaunty isle
#

okay I will check it in-game right away

#

hmm it does not change something

#

the shotgun's original range was 12, for the test
and after attaching a sight on it, the range became 10

#

ah actually
choke was attached before I attach a sight on it
so 10+2 -> 10

grizzled fulcrum
#

so the range doesn't change at all even if you use no attachments/only scope/only choke/scope and choke?

#

I mean it doesn't change like +100

#

although I think there is a range cap of 10 so that might be

jaunty isle
#

yeah it didnt change the value at all

#

so 10 is the original range of that gun

#

and due to the script(that we are trying to change)
it can't be over 10 even if I attach a choke which has +2 range, while having a sight attached on the shotgun

#

I suppose the shotgun range nerf script rollbacks the range

grizzled fulcrum
#

but can it go over 10 with a sight

#

?

jaunty isle
#

if it was not a shotgun, the sight's range modifier will be applied

#

and right now, with this shotgun, the script overrides another attachment's stat(choke)

#

while having a sight on it

grizzled fulcrum
#

can you go into gunfighter options and change the debug log level mode whatever they call it to debug or whatever the lowest levle is

jaunty isle
#

so just the shotgun, range = 10
shotgun w/ choke, range=12
shotgun w/ sight =10
shotgun w/ sight and choke =10

grizzled fulcrum
#

wait so the sight does nothing even on a shotgun?

#

that is inteded, I see

#

ok I understand

jaunty isle
#

yeah but the prob is it kills the gain from choke hahah

grizzled fulcrum
#

yes

jaunty isle
#

hmm I dunno what is debug log level mode..
should I start the game in a debug mode and take a look into gunfighter options?

grizzled fulcrum
#

probably not, it should be a dropdown in the options menu somewhere

#

idk what he calls it

#

like are there gunfire settings at all?

#

in your settings menu I think

#

wait do you have the name of the mod

#

ill just test it on my end real quick too

jaunty isle
#

I think I found it

#

for this, you can find 2 mods in workshop
Brita's weapon mod, Arsenal's gunfighter mod 2.0 I think

grizzled fulcrum
#

dw you dont have to do anything, ill do some test on my end and hopefully figure out what is going on

jaunty isle
dry pier
#

Evening, anyone know if you can reload the script .txt files without having to restart PZ?

grizzled fulcrum
#

go to menu: click reload lua, wait and go back into game

dry pier
#

Can you reload within the game?

#

Or do I have to drop back to the main menu and reset lua?

grizzled fulcrum
#

I believe so

dry pier
#

Thanks.

#

Ok, can we override base game recipes?

#

I've used the Override:true and Obsolete:true properties on the recipes, but they don't seem to stick.

grizzled fulcrum
#

can you share an example?

dry pier
#

Sure:

module Base
{
recipe Rip Clothing
{
[Recipe.GetItemTypes.RipClothing_Cotton],

    Result:RippedSheets,
    RemoveResultItem:true,
    InSameInventory:true,
    Sound:ClothesRipping,
    Time:100.0,
    AnimNode:RipSheets,
    OnCreate:Recipe.OnCreate.RipClothing,
    OnTest:Recipe.OnTest.IsNotWorn,
    Obsolete:true,
}

recipe Rip Clothing
{
    [Recipe.GetItemTypes.RipClothing_Denim],
    keep [Recipe.GetItemTypes.Scissors]/[Recipe.GetItemTypes.SharpKnife],

    Category:Survivalist,
    Result:DenimStrips,
    RemoveResultItem:true,
    InSameInventory:true,
    CanBeDoneFromFloor:true,
    Sound:ClothesRipping,
    Time:200.0,
    AnimNode:RipSheets,
    OnCreate:Recipe.OnCreate.RipClothing,
    OnTest:Recipe.OnTest.IsNotWorn,
    OnGiveXP:Recipe.OnGiveXP.Tailoring01,
    Override:true,
}

}

#

I'm just trying to remove the Base Rip Clothing as test.

#

I load this file, and xp action doesn't get set, nor do I see it in the different category.

grizzled fulcrum
#

oh you want to remove the rip clothing completely

#

or replace it with your own

dry pier
#

Correct.

#

I can get it to add the addxp via lua... but I'd rather just use a recipe than go the lua route.

#

Plus, I can't add new keeps via Lua from what I can tell.

grizzled fulcrum
#

if you are removing it completely, I will have to find out why
if you are trying to replace vanilla one with your own, remove Obselete

#

oh wait you have 2

#

only include your one and have override:true but not obselete

dry pier
#

Yeah, I've tried just using the second entry (the one with Override:true), but that doesn't work either.

grizzled fulcrum
#

huh

#

I will have to look at that more in a sec, rn im trying to fix another issue with someone else

#

@jaunty isle can you tell me how to attach teh sight/choke?

#

I must be doing it wrong lol

jaunty isle