#mod_development

1 messages ยท Page 225 of 1

bronze yoke
#

yeah

#

even though it's in the lua folder it's not actually lua, and the game is hardcoded to check that path for them

somber marten
#

Ah ok

#

Can you confirm whether this is possible or not?

bronze yoke
#

yeah, should be fine

#

most mods only have english files anyway

somber marten
#

Ok cool

wicked crane
candid magnet
#

How would I mod the entire first season of two and a half Men into Pz?

reef cairn
#

what is the line of text for giving xp for metalworking

somber marten
#

How can I link the game to the modding thing Im doing? I am getting thousands of warnings of this type

bronze yoke
#

if you have git installed you can use the addon manager to download umbrella (in vscode, ctrl-shift-p -> lua: addon manager -> search for umbrella and enable)

somber marten
#

Oh my god thanks, that removed 90% of the warnings

#

I had forgotten to enable Umbrella, I just installed it -_-

reef cairn
#

ERROR: General , 1711069162014> 25,567,899,605> at zombie.scripting.objects.ScriptModule.getItem(ScriptModule.java:480) getting this error when loading up the server after updating my mod

#

any suggestions?

vestal pewter
#

Can the client transfer custom data to the server?

hot void
#

can someone explain to me how server commands work

hollow current
# vestal pewter Can the client transfer custom data to the server?

Yes. I assume you're referring to Global Moddata, so yea its possible. It's possible as well with normal Moddata tied to specific objects, but it has its own functions, depending on the case. There are multiple mentions of both types of data on the discord, so you'd find a lot of information on how to implement either by searching them

vestal pewter
hollow current
# hot void can someone explain to me how server commands work

You use server command when you want to send some kind of data or execute a function on a client, and the command is sent from the server. You do this using sendServerCommand(player, 'MyModule', 'MyCommand', argsTable). Example:

sendServerCommand(player, 'MyModule', 'MyCommand', { message = "Hello! This is sent to client!" })```

Not specifying the player will send the command to all connected clients.

You can define the command as follows:

```lua
local MyModuleServerCommands = {}

function MyModuleServerCommands.MyCommand(args)
    print(args.message)
end

local function OnServerCommand(module, command, args)
    if module == 'MyModule' then
        MyModuleServerCommands[command](args)
    end
end

Events.OnServerCommand.Add(OnServerCommand)
reef cairn
#

is this being written correctly?

#

recipe Make Duct Tape
{
LeatherStrips=5,
Woodglue=5,
ammomaker.ammomaker_RecPlastic,

  NearItem:forge,
  Result:DuctTape,
  Sound:PZ_FoodSwoosh,
  Time:200.0,
  Category:Cooking,
  OnGiveXP:Recipe.OnGiveXP.Cooking5,
}
hollow current
vestal pewter
#

I'm newbie in modding, sorry

#

I don't understand how entire game works

hollow current
#

I am not really sure about this regard, sorry, but generally you use global moddata when communicating between server/clients with data that isn't tied to a specific object.

hollow current
#

simply data that is used by the mod and isn't necessarily tied to an object (like a character/item/vehicle/etc)

hollow current
bronze yoke
#

it generally tends to lack libraries for file formats

vestal pewter
#

I want to make mod which lets u upload music on server and server will be transfer that audio to all clients

bronze yoke
#

i think you might be able to read the files and even send the data but i don't know if you'd be able to get the client to actually use it

#

i don't think there's anything exposed to lua that would allow you to load arbitrary sound data, and loading files is sandboxed to mod directories which you shouldn't write to or the checksum will fail

formal kraken
#

Hi everyone, I'm working on a mod that would allow player to do a backward step dodge , I made some progress on the scripting part, but I am shit animator with 0 animations skill. Is there someone skilled I can commission to make the animation for me?

reef cairn
#

trying to get this recipe to use the Forge from Crafting Enhanced Core. But it's not working

#

recipe Make Duct Tape
{
LeatherStrips=5,
Woodglue=5,
ammomaker_RecPlastic,

  NearItem:Forge,
  Result:DuctTape,
  Sound:PZ_FoodSwoosh,
  Time:200.0,
  Category:Cooking,
  OnGiveXP:Recipe.OnGiveXP.Cooking5,
}
#

any advice or do I need to import Crafting Enhanced Core?

somber marten
#

Where do I place a local mod in order to test it in game?

bronze yoke
#

on windows, %UserProfile%/Zomboid/mods/

somber marten
#

Ok, I added it, but it crashes and I have no idea where to look for the crash reason

#

It didnt crash with debug mode off, but it crashed when debug mode was on

bronze yoke
#

the game logs to Zomboid/console.txt

somber marten
#

Well I am really pissed off, a lot of stuff isnt working with my mod and I dont really know how to fix it or where to look for the errors

grizzled fulcrum
#

What is the purpose of BodyDamage for each player? I ask this because you can do playerObj:getMoodleLevel(moodleType), playerObj:getBodyDamage():getMoodleLevel(moodleType) and playerObj:getBodyDamage():getUnhappynessLevel() and from what I can see they do the exact same thing.

ornate sand
#

How in the world do I completely overwrite a vanilla gun?
I have it set as
module Base
{
item Pistol
and all that but even when I re-name it at the "DisplayName" spot and change it's models and textures, for some reason it still comes up as the "M9 Pistol".

neon bronze
#

Vanilla doesnt use the DisplayName in the script as its actual display name but the translation files in lua/shared/translations

ornate sand
#

Is that it? Holy moley I hope it is

bright fog
grizzled fulcrum
#

sorta makes sense

bronze yoke
#

BodyDamage does many things other than that

#

the redundant methods are just for convenience

#

there can also be cases where the method has moved and the redundant methods exist for backwards compatibility

mystic vessel
#

Good night/good morning guys
I wanted to know something, if it's possible.

What are the steps to ensure that a certain tile can only be built with a certain skill level?

coarse sinew
#

Crafting Enhanced Core doesn t have support for that

mystic vessel
coarse sinew
austere sequoia
#

where do I find the functions that make items remember stuff like durability when used for crafting? And can I make it remember more stuff, like magazin or ammo count for guns?

grizzled fable
#

in tile definition, what this is called location_shop_fossoil_01_14?? i need to use it for a check is it the TileName or CustomName?

#

what's the name of this properties? the name you see when you use brushtool to copy tiles

reef cairn
#

trying to get this script to give a small amount of metalworking xp

#

Result:ScrapMetal,
Time:30.0,
OnGiveXP:Recipe.OnGiveXP.Blacksmith1,
Category:Welding,
AnimNode:Disassemble,
CanBeDoneFromFloor:true,
Prop1:Screwdriver,
Prop2:CDplayer,
}

#

something im missing here?

austere sequoia
# verbal yew

ISCraftAction, should have thought of this. Thank you โค๏ธ

austere sequoia
reef cairn
#

I wanted it to keep the bowl but it doesn't even recognize the bowl in the in game recipe

#

have all of the items but won't actually craft it

austere sequoia
#

This stuff is managed in the lua (recipecode.lua on server). So if you want to add bowls in the recipe, they need an entry there

reef cairn
austere sequoia
#

They would, if they had a lua entry like the screwdriver or hammer has

reef cairn
#

ah okay so in my server recipexode.lua i need to add it in

austere sequoia
#

basically yes, but you dont really want to alter the vanilla lua files, especially not if you want to publish a mod (you can test stuff in there though, just dont forget to make copies of the original data)

reef cairn
austere sequoia
#

from your recipe? I would assume so

reef cairn
#

I also noticed in the recipecode that Woodglue is actually WoodGlue

#

addExistingItemType(scriptItems, "WoodGlue")

#

or does that even matter

austere sequoia
#

I am honestly not certain about this, but if you want to play safe, just write it with capital G

reef cairn
#

recipe Make Duct Tape
{
LeatherStrips=5,
Woodglue=5,
ammomaker_RecPlastic,
keep [Recipe.GetItemTypes.Paintbrush],

    NearItem:Forge,
    Result:DuctTape,
    AnimNode:Craft,
    CanBeDoneFromFloor:true,
    Time:80.0,
    Category:Cooking,
    OnGiveXP:Recipe.OnGiveXP.Cooking5,
    OnCreate:BSItem_OnCreate,
    NeedToBeLearn:false,
}
#

this one here im trying to make it so folks have to be near the forge for it to work

#

however it won't actually craft

austere sequoia
#

I dont think that paintbrush has an entry in recipecode either, so it does not work, just like the bowl

reef cairn
#

yea i put that in recently to try it

#

but that was still an issue prior

austere sequoia
#

what exactly is the issue?

reef cairn
#

so I was looking to make it use while near the Forge

#

which is a base item

#

but it dosn't work

austere sequoia
#

did it work before adding the Forge line?

reef cairn
#

I can remove and test

#

i appreciate the help

austere sequoia
#

Did it work?

reef cairn
#

I shouldn't have to import Base for it to work no?

#

server is restarting with udderly so will take a bit

#

ill let you know

austere sequoia
austere sequoia
#

The only use of "NearItem" I see on the vanilla scripts, is for the anvil. This stuff has not been introduced yet fully (or did I somehow miss like half the game? :D), plus the Anvil has an extra lua file describing it, so that might be why it is not working

reef cairn
#

hmmm

#

should i try that then?

#

because there is an anvil connected to it when it is built

#

I was copying the code from another mod to match

#

{
imports
{
Base,
}

/************************ Metal ************************/
recipe Cut In Metal pipe
{
SheetMetal=1,
NearItem:MetalCutter,
Result : MetalPipe=3,
Time : 80,
Category : MetalCutting,
Sound : weldingmachine,
CanBeDoneFromFloor : TRUE,
NeedToBeLearn: falsed,
}

#

but maybe they are using the code in their own scripts to pull from

austere sequoia
#

what mod is this?

reef cairn
#

Machines

austere sequoia
#

Yes, that one has lua for all the "NearItem"-Items

#

Did you test your mod together with machines?

reef cairn
#

Yea I have the mod in server

#

but I guess I need to import machines?

#

or maybe the Forge id is just worded different

austere sequoia
#

I have no clue, I am not that good with the lua stuff

reef cairn
#

ah looks like the idea for them is actually NearItem=Forge Table

#

I had just Forge

austere sequoia
#

Ah! ๐Ÿ˜„ That could be it!
nameID = "Forge Table",
Yes, that is what their lua says, I see it

reef cairn
#

now if that doesn't work ill try Importing MCH

austere sequoia
#

I would advise you to test your stuff in singleplayer, so you dont have to reload the server each time you make a tiny change

reef cairn
#

just load up the mods using the crafts and go from there

austere sequoia
#

In debug mode, you often dont even have to restart your game, just reload the lua ๐Ÿ™‚ very quick and easy (tends to not work if you add new files though, then it is restart time. changing existing files seems to work though)

reef cairn
#

dope ill try that

hot void
#

or does it just runs in the defult pz api?

#

i dont think i know anything about it really

hollow current
#

then whenever you want to use that command, you use the sendServerCommand snippet from anywhere in your code, as long as you're sure it's being run on server

hot void
#

perfect

#

so now i think its possibe to apply tattoos on people in a server somehow

hollow current
#

yea should be. Though something to keep in mind is that if you're manually setting them, just server commands won't be enough since the command originates from a client (an admin), so you will have to use a combination of both Client Commands and server commands

hot void
hollow current
#

Shouldn't be a problem then

hot void
hollow current
#

sure

steady lagoon
#

is anyone experiencing an issue in which your character becomes invisible while sprinting?

crisp rock
#

is it possible to generate new item types at runtime? say blue watermelons

woven wren
#

I'll go ahead and promote the last update for my submod for Lifestyle: Hobbies here

#

if it's in the wrong section I'll delete it

errant bluff
#

the game crashes when i equip my weapon any idea where to look?

formal kraken
bright fog
#

In export settings > armature > swap primary and secondary to respectively X and Y

formal kraken
#

It worked! thank you so much

bright fog
#

๐Ÿ‘Œ

small topaz
compact rampart
#

i managed to remove over 1000 vanilla items from spawning, however the bullets and ammo boxes still appear no matter what - any clue what might be the case?

formal kraken
mellow frigate
silk pike
#

Hello everyone and sorry for my bad English...
I'm now getting into mods that add recipes and I'm starting with simple things
I would like to create a recipe to make jam with 20 berry units.
I wanted to make it so that you could use different types of berries to create the jam.... but I'm stuck
Is there a command that can allow you to create this type of recipe???

Here's how I set up the recipe:
recipe Create Berry Jam
{
destroy EmptyJar,
destroy JarLid,
BerryGeneric1/BerryGeneric2/BerryGeneric3/BerryGeneric4/BerryGeneric5/WinterBerry/BeautyBerry= 30,
Sugar= 1,
WaterPot= 1,
CanBeDoneFromFloor:TRUE,

     SkillRequired:Cooking=1,
     OnGiveXP:Recipe.OnGiveXP.Cooking1,
     Time:2000.0,

Heat:-0.22,
AnimNode:Craft,
Category:Base,
}

errant bluff
#
ERROR: General     , 1711157789335> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "String.indexOf(int)" because "<parameter1>" is null at ScriptManager.getItemName line:193.
ERROR: General     , 1711157789335> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "String.indexOf(int)" because "<parameter1>" is null
    at zombie.scripting.ScriptManager.getItemName(ScriptManager.java:193)
    at zombie.core.skinnedmodel.ModelManager.addStaticForcedTex(ModelManager.java:1817)
    at zombie.core.skinnedmodel.ModelManager.addStatic(ModelManager.java:1812)
    at zombie.core.skinnedmodel.ModelManager.addEquippedModelInstance(ModelManager.java:1055)
    at zombie.core.skinnedmodel.ModelManager.DoCharacterModelEquipped(ModelManager.java:976)
    at zombie.core.skinnedmodel.ModelManager.ResetCharacterEquippedHands(ModelManager.java:842)
    at zombie.core.skinnedmodel.ModelManager.update(ModelManager.java:1254)
    at zombie.gameStates.IngameState.updateInternal(IngameState.java:1698)
    at zombie.gameStates.IngameState.update(IngameState.java:1333)
    at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
    at zombie.GameWindow.logic(GameWindow.java:298)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:765)
    at zombie.GameWindow.run_ez(GameWindow.java:681)
    at zombie.GameWindow.mainThread(GameWindow.java:495)
    at java.base/java.lang.Thread.run(Unknown Source)

I can't get my two-handed weapon to show, when I equip it in both hands, the game crashes.

hollow current
#

might need to have another look at it

bright fog
verbal yew
# silk pike Hello everyone and sorry for my bad English... I'm now getting into mods that ad...
recipe Create Berry Jam
{
destroy EmptyJar,
destroy JarLid,
BerryGeneric1/BerryGeneric2/BerryGeneric3/BerryGeneric4/BerryGeneric5/WinterBerry/BeautyBerry= 1,
Sugar= 1,
WaterPot= 1,

Result:BerryJam=1, /* result */
CanBeDoneFromFloor:TRUE,
SkillRequired:Cooking=1,
OnGiveXP:Recipe.OnGiveXP.Cooking1,
Time:2000.0,
Heat:-0.22,
AnimNode:Craft,
Category:Base,
OnTest:MyBerryJamLuaFuncOnTest,    /* here LUA FUNC for check, if false, then can't create */
OnCreate:MyBerryJamLuaFuncOnCreate,  /* here LUA FUNC when recipe done, we should remove another 29 count of berries (1 in recipe, 29 in invenotry) */
Tooltip:Tooltip_NeedTotalBerry30count, /* string for translate */
}
#
function MyBerryJamLuaFuncOnTest(item)
    if DO STUFF HERE then
       --Where we count the total number of all berries in the inventory, if not 30 then return false
      return false
    end
    return true -- if total number of berries == 30
end
#
function MyBerryJamLuaFuncOnCreate(items, result, player)
  --DO STUFF HERE with counter 29, where we remove 29 berries from player inventory
end
bronze yoke
#

don't use OnTest if you aren't testing the actual item, use OnCanPerform

#

massive waste of performance

cold whale
#

Hello pals! Do you know how to replicate the reduction of panic like the beta blockers but with a food item?

verbal yew
broken lake
#

Random question

Have recipe as

ScrapMetal=1, (or using just ScrapMetal)
keep <mymodtool>,

Result:Screws=10,
Time:100.0,
Category:Welding,

But yet the output for the recipe is somehow stuck on 50 and not 10? Using craft helper to view recipes it even shows as the wrong result number.

verbal yew
#

because Screws like item in scripts have string Count = 5

broken lake
#

Ah, so just make it 2.

#

Tyty!

austere sequoia
#

I guess for panic you will have no choice but adding new lua

bronze yoke
#

beta blockers are hardcoded

#

you can use an OnEat function to reduce the player's panic

#

you'll probably want to have a mechanism to do it over time like beta blockers do, instantly reducing the player's panic doesn't do much since it goes down pretty fast on its own and goes back up very quickly

cold whale
#

What I did is the following:

#

item ItemSampleFood
{
DisplayName = Bolillo,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = MakiBolillo,
FoodType = Bread,
Packaged = TRUE,
DaysFresh = 10,
DaysTotallyRotten = 6,
HungerChange = -15,
Calories = 120,
Carbohydrates = 20,
Lipids = 2,
Proteins = 4,
Tooltip = Tooltip_PillsBetablocker, --This to add the "reduces panic" text
OnEat = OnEat_Function,
CustomEatSound = EatingCrispy,
WorldStaticModel = ItemSampleStaticModel,

#

}

#

Where OnEat_Function is the following:

#

function OnEat_Function(food, character, percent)

local playerBody = character:getBodyDamage();
-- heal moodles and status
playerBody:setPanicReductionValue(01);

end

#

it reduces the Panic value, but it reduces it continuously, without stopping haha

#

how can I make it only over a small time frame? like for 20 in-game minutes or something like that ๐Ÿ˜ฆ

onyx sage
#

what should my files layout be like if im combining 2 mods into one?

verbal yew
# cold whale function OnEat_Function(food, character, percent) local playerBody = charac...
function newMyModedOnEat_Function(food, character, percent)  -- in your food onEat should be write this func
  local playerData = character:getModData().newMyModedReducedStatusTimer;

  if playerData == nil or playerData < 30 then  -- Where 30 - it's your count of event tick, here be Events.EveryHours.Add
    playerData = 30    -- 30 hours on this example
  end  -- when we eat food again - it's restore 30 to counter
end

function newMyModedHealthAdjust_Function()
  local player = getPlayer();
  local playerData = player::getModData().newMyModedReducedStatusTimer;
  local Body = player:getBodyDamage();    -- maybe player:getStats(), im not sure
  local zGetPanic = Body:getPanic(); 
  local zReducePanic = 0.012; -- your number of reduced here, every hour panic be reduced on 0.012 in this example
  local zReducedPanic = "";
  local zSetPanic = Body:setPanic();
  
  if playerData > 0 then
    zReducedPanic = zGetPanic - zReducePanic;
    if zReducedPanic < 0 then
      zReducedPanic = 0
    end
    zSetPanic = zReducedPanic;
    playerData = playerData - 1;    -- reduced counter every hour
  end
end

Events.EveryHours.Add(newMyModedHealthAdjust_Function)
#

something like this +-

#

not sure about getBodyDamage, with panic it's should be getStats() if im not wrong

errant bluff
# hollow current might need to have another look at it

items.txt

module CRMConsigneeOutfit
{
    imports
    {
        Base
    }
    item CRM_KillStick
    {
        DisplayCategory = Weapon,
        MaxRange    =    1.5,
    StaticModel = CRM_KillStick,
    WorldStaticModel = CRM_KillStick_Ground,
        MinAngle    =    0.8,
        Type    =    Weapon,
        MinimumSwingTime    =    2,
        KnockBackOnNoDeath    =    FALSE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    Improvised;Spear,
        ConditionLowerChanceOneIn    =    10,
        Weight    =    4.5,
        SplatNumber    =    1,
        PushBackMod    =    0.3,
        SubCategory    =    Spear,
        ConditionMax    =    7,
        MaxHitCount    =    2,
        DoorDamage    =    5,
        SwingAnim    =    Spear,
        DisplayName    =    Kill Stick,
        MinRange    =    1,
        SwingTime    =    2,
        KnockdownMod    =    0,
        SplatBloodOnNoDeath    =    FALSE,
        Icon    =    Base.Nightstick,
        RunAnim    =    Run_Weapon2,
        IdleAnim    =    Idle_Weapon2,
        TreeDamage  =   0,
        TwoHandWeapon = TRUE,
        CriticalChance    =    30,
        CritDmgMultiplier = 10,
        MinDamage    =    1.5,
        MaxDamage    =    2,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        BreakSound  =   SpearMacheteBreak,
        HitFloorSound    =    SpearMacheteHit,
        ImpactSound    =    SpearMacheteHit,
        DoorHitSound = SpearMacheteHit,
        HitSound    =    SpearMacheteHit,
        SwingSound    =    SpearMacheteSwing,
        SoundMap = SpearStab SpearMacheteStab,
    AttachmentType = Shovel,
    Tooltip = Tooltip_CRM_KillStick,
        }
}
#

meshes.txt

module CRMConsigneeOutfit
{
imports
    {
        Base
    }
    model CRM_KillStick
    {
        mesh = Weapons/2handed/CRM_KillStick,
        texture = Weapons/2handed/text_CRM_KillStick,
        attachment world
        {
            offset = 0.0000 0.2450 0.0000,
            rotate = 0.0000 0.0000 0.0000,
        }
    }

    model CRM_KillStick_Ground
    {
        mesh = WorldItems/Weapons/2handed/CRM_KillStick,
        texture = Weapons/2handed/text_CRM_KillStick,
        attachment world
        {
            offset = 0.0000 0.2450 0.0000,
            rotate = 0.0000 0.0000 0.0000,
        }
    }


}
#

I don't know if the modules are ok or if I have to leave them all in Base.
Although I have tried all possible combinations before and the game still crashes when equipping the weapon.

verbal yew
errant bluff
mellow frigate
cold whale
#

Does nightstick icon file name is Item_Nightstick?

errant bluff
cold whale
#

Item_ should be only in the png file. In your code you only need to put the name after the

#

_

#

Png file: Item_Nightstick

#

Icon= Nightstick

errant bluff
#

It is a problem with the object. In blender I have exported it applying the scale to 1 and also to 0.1 (as all the imported .x items come)

open drum
#

oh.. @sour island ... i just opened up your new errorFixifier mod.. and made me laugh...

#

upon reading your mod description, I couldn't help but to open up the .lua ...

#

and BAM....

#
engageEvent(month, data)... ```
hollow current
#

Maybe that's the issue?

errant bluff
#

DisplayName = Kill Stick,

open drum
#

yea that's what i was going to say

#

it does have

#

๐Ÿ˜›

hollow current
#

Ah missed it

#

Yea just do tchernobill's solution then

errant bluff
#

I really don't know what to do anymore, everything is fine in Blender. I export it with all the transformations applied. The path of the configuration is ok, it has to be some parameter. I've also checked the , and none of them are missing.

errant bluff
#

Because I won't have to put the Sprite with my custom model, will I? I mean what it uses is a .png image not the .fbx/.x model.

open drum
#

@errant bluff what's is the problem u r having again? i missed it

errant bluff
austere sequoia
neon bronze
#

Do you have WeaponSprite in your script?

austere sequoia
errant bluff
#

That was!

austere sequoia
desert kelp
#

Anyone know what lua function handles this texture? patches_<body_part>_<fabric_type>? Is it just on ISGarmentUI.lua?

desert kelp
#

patches<body_part><fabric_type> This format

#

I was hoping to get the invisible clothing patches as a sort of benefit for Tailor occupation instead of just replacing the patches' actual texture with blank image

#

But I just confused myself checking over between ISGarmentUI.lua and ISInventoryPaneContextMenu.lua

#

If you can give me any pointers, that would be great, thanks!

bright fog
#

uuuuhh

#

No idea

coarse sinew
desert kelp
#

oh man that sucks

cold whale
lunar ermine
#

im Trying to make a recepie that changes output depending on calories, result is LTSBitsMeat and the are spawned in but in the
OnCreate it cant find the LTSBits Meat the CakeSlice get spawned any idea for the reason?

    player:getInventory():AddItem("CakeSlice"); --vanilla
    player:getInventory():AddItem("LTSBitsMeat"); --From a different mod

update:
found the problem i neaded to add the module
player:getInventory():AddItem("DLTS.LTSBitsMeat");

errant bluff
#

Thank you all for your help!

compact dirge
#

Hey, I got a quick question, how can I find what ItemGUID it refers to which Item in the gamefiles ?

#

I've got a list of ItemGUID that I need to find what item they refers to

errant bluff
#

Now I have another problem. I have a face shield that has a transparent texture. What happens is that this transparency affects the mask. The beard disappears and the jacket also disappears in the area of the face shield.

#

Here you can see that it looks good, in the character info window but...

#

What looks good is the T-shirt under the jacket

#
<clothingItem>
    <m_MaleModel>media\models_X\Static\Clothes\M_CRM_ProtectorFaceShield.fbx</m_MaleModel>
    <m_FemaleModel>media\models_X\Static\Clothes\F_CRM_ProtectorFaceShield.fbx</m_FemaleModel>
    <m_GUID>14fef8bf-aacf-4939-b91a-6a3313331e0d</m_GUID>
    <m_Static>true</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone>Bip01_Head</m_AttachBone>
    <m_MasksFolder>media/textures/Clothes/Hat/Masks</m_MasksFolder>
    <textureChoices>clothes\hat\CRM_ProtectorFaceShield</textureChoices>
</clothingItem>
outer crypt
#

If I have the name of an item like "Base.ConcretePowder" is it possible to get the display name from that item in the script without creating the item? I know if I Add.Item("Base.ConcretePowder") and then do a getDisplayName() on it, I can get the name but trying not to spawn the items first.

bright fog
#

Not too sure about that

bronze yoke
rancid panther
#

Does anyone know how fuel pumps determine whether or not it has power running? My blackouts mod seems to have a problem with gas stations in particular

#

it seems that once the gas pump's value is stored, that particular pump will stay on forever

queen oasis
#

@rancid panther ISWorldObjectContextMenu.doFillMenu maybe, checks if there's electricity in "createMenu" first, look for "haveFuel" around line 1300, and adds it to the context menu.

#

doFillFuelMenu

rancid panther
#

thanks! that sounds like what i'm looking for

jade loom
#

does anyone know how the game remembers what contents are stored in e.g. containers and vehicles, as well as fuel contents, etc.

outer crypt
half maple
#

Hello, all. I have a quick question. Is it possible to override the interval in which Protein Boost works (without messing with Java)? The next question (if possible with Lua) would then be: what needs to be overriden?
Thanks.

copper abyss
#

So, I tried and tried again. I've watched innumerable lesson videos and endured hours upon hours of misery, but I still can't figure things out. The muzzleflash appears to be coming from the origin, however when I alter the origin to the tip of my model's barrel, the positioning in the hand changes, and I am unable to adjust it after that. How can I make my pistol's muzzleflash appear in the correct location?

images provided:
1: the current origin in blender
2: the current placement of the pistol in the players hand
3: Export settings
4: better view of model

#

(if anybody knows the fix to this please message me or reply.)

reef cairn
#

if I want to patch a recipe to change it from another mod in my own, do I need to import that mod to mine to overwrite it?

serene lichen
#

where i can find car models?

austere sequoia
uneven ore
#

Project Zomboid is Complaining about a "then" that should be near = on line 304, however there IS a "then" there, can someone help me?

if getmdplayer.IsTagged = true then

verbal yew
#

not =

#

==

uneven ore
#

Okay, got it

toxic narwhal
#

Hi guys,
I'm trying to make a custom profession and I want to force specific traits (Obese for example) when selecting the profession.
Now, when I use addFreeTrait("Obese") it does what I want but you are able to remove the Obese trait (with the side effect that you can get infinite points by exploiting it).

I tried looking at how the game does it with the 'Cook' trait, using Cook2 and setting it as mutuallyExclusive but I could not get that to work.

Can anyone give me some pointers?

verbal yew
#

should predetermine Obese trait

#

because Obese trait have param like points and pick/unpick

#

look into code, like trait from veteran

#

or u can look into SOTO mod, where be created custom traits for this situation (because veteran hardcoded, traits with weight i think too), Hea created custom trait - its swap on original after start, for working param

toxic narwhal
#

I can't quite see it now but I am indeed missing the swapping on creating the character. I will try some more tomorrow with this information, thanks a lot

formal kraken
#

Anyone knows at what rate does the game plays its animation? I'm having trouble setting a time duration for a 20 frames animation.

#

I was assuming 30 fps. So I set the timer to be 1/30 * 20 frames =667 ms and the animation is still janky in game

uneven ore
bronze yoke
#

that error likely means too many ends

formal kraken
#

I experimented with changing the blend timer and doesn't seem to help
<m_BlendTime>0.1</m_BlendTime>
<m_BlendOutTime>0.4</m_BlendOutTime>

bronze parcel
formal kraken
#

Thanks

#

Somehow it just never looks the same once the animation is played in game

bright fog
bronze parcel
# formal kraken Thanks

Hey pal I believe with time you will get better and there are people here to help if you ask.

bright fog
#

What I would suggest is more movement on the pelvis

#

The center of the body is too fix

#

Doesn't move enough

#

Just adding a bit of motion to it would accentuate that movement

formal kraken
#

Thanks for the advice. I'm gonna try it out.

bronze parcel
#

@formal kraken try the suggestion from @bright fog see if that helps with the animation.

bright fog
#

Find a reference video of backward dodging

bronze parcel
#

@bright fog Hey pal is that the first or second game ?

bright fog
#

hard to clearly see the animation tho that's the issue

formal kraken
errant bluff
#

Is there none in mixamo that can be used?

formal kraken
#

hmm interesting site

bright fog
#

oof so bad

verbal yew
# toxic narwhal I can't quite see it now but I am indeed missing the swapping on creating the ch...

i mean all traits has another category with personal param, like + or - free points, pickable.
some traits like personal for woodcutter or security or veteran without points (0) and unpickable.

in code its look like if u pick profession Veteran, its get u veteran trait - this trait 0 points and unpickable.

If i pick your custom profession - its get me Obese, but this trait has param like free points and pickable

#

then we need New trait like Obese2 and func with event OnCreateCharacter like if player has trait Obese2 then remove Obese2, add Obese
(or change player weight, not sure how work this trigger for Obese)

latent torrent
#

does anyone know why this doesnt work, it works when its under another traits function but cancels that trait out?

bright fog
#

When is that triggered ?

latent torrent
#

i dont know what you mean

bright fog
#

You function, when is it triggered ?

#

or by what

#

and when

verbal yew
#

not sure about how work this framework, maybe here should be event for launch this function...

latent torrent
#

i dont think my function is ever triggered, i dont know how to code just been trying to reverse engineer other peoples code for what i want

bright fog
#

the function you base this code from, when is it triggered ?

#

Did you check where it's referenced ?

verbal yew
latent torrent
#

i added this one if thats what you meant

#

ill try that one

verbal yew
#

why hermes?

#

your func called fastTrait

#

lol

bright fog
#

yeah

latent torrent
bright fog
#

Events trigger functions at specific timings called "Events"

latent torrent
#

also is there a fast way to test traits without having to go to main menu turn off a mod and reload lua

bright fog
#

In this case it would trigger your function every ticks, which isn't optimal

bright fog
#

debug menu yeah

verbal yew
#

F11 ingame

bright fog
#

Write "-debug" in the steam property for PZ

latent torrent
#

ok will do thanks

verbal yew
bright fog
#

yeah mines in french so he can't read it either

latent torrent
#

i got it

bright fog
#

yup

latent torrent
#

ok i got this but its progress

bright fog
#

it says line #49 of your code

#

So check there

latent torrent
#

if player:HasTrait("hermes") then

coarse sinew
#

If you used OnGameStart the player is not created at that event

bright fog
#

that's possibly yeah

latent torrent
#

is there a list of all the events?

#

that are used

coarse sinew
latent torrent
#

should i just try everytenminutes to see if its works?

bright fog
verbal yew
bright fog
#

Wait easier to read all the available events, what they do, what they use and example codes for them

bright fog
#

I think the player is created yeah

verbal yew
#

i'm not sure...

#

need albion xD

bright fog
verbal yew
#

this is events break my head...

bright fog
#

this one boots after gamestart

#

I can test it quickly wait

coarse sinew
bright fog
#

that was literally my point lmao

#

"this one boots after gamestart"

grizzled fulcrum
bright fog
#

OnGameStart does have the player created

grizzled fulcrum
#

you just answered my question and I didnt even type it -w-

bright fog
#
Events.OnGameStart.Add(
function()
    if getPlayer() then
        print("HELLO WORLD")
    end
end
)
LOG  : General     , 1711257694361> [TLOU_InfectedFork]     HELLO WORLD
#

bruh Spiffo

verbal yew
bright fog
#

Quick test since I was in-game with my mod

grizzled fulcrum
#

does spiffo bot eval lua code?

bright fog
#

seems like it

#

it's a message

#

So it checks it either way

verbal yew
#

hm hm hmmm

uneven ore
verbal yew
#

local player = getPlayer();

#

local getmdplayer = player:getModData();

bright fog
#

that could help, first off yeah

#

Don't make it global

#

tho not sure if that's the exact reason of the error

bronze yoke
#

you can't use getPlayer() outside of a function, that executes on the main menu before there is a player

#

so it will return nil

uneven ore
#

ill use on game boot

#

or smth similar

bright fog
uneven ore
latent torrent
#

ok i got it to work with EveryOneMinute

#

now to change it

bright fog
#

that most likely works, create a variable in file, initialize OnGameStart with your local file variable with getPlayer() and that should do the job

#

Interesting aspect I didn't consider, good to know for the future

bronze yoke
bright fog
verbal yew
#

local player = getPlayer()
same as playerObj?

#

i mean, don't need get player, u can just use playerObj, no?

grizzled fulcrum
bright fog
grizzled fulcrum
#

and yes you can just do player:getModData() everywhere but it is very messy (me no likey)

bright fog
#

Tho I didn't realized you changed it and it's not just a table anymore

bronze yoke
bright fog
#

oh

#

How convenient

bronze yoke
#

i'm planning to split hooks + script functions to another page at some point

#

since this page is very very long now ๐Ÿ˜…

bright fog
#

yeah github issue I feel like

latent torrent
#

so should i use OnLoad or OnGameStart

bright fog
#

This gives the use to working on the modding wiki even more

bright fog
#

OnGameStart does the job

latent torrent
#

ok thank you it works now

#

after like 3 hours of messing around

verbal yew
#

guys, guys!!!
local player = getPlayer()
same like playerObj?
getPlayer() == playerObj ?

bright fog
#

Not sure the github long list bother's people tho

bronze yoke
#

something like that could be added

#

but it would probably take the form of a table like the old format

bright fog
#

your old format or the wiki ?

bronze yoke
#

my old format

bright fog
#

I feel like the dark mode of github doesn't help reading in the case of your list

bright fog
grizzled fulcrum
#

is there anywhere explaining why using globals is bad? and at what point is it fatal? using 1 global, 5, 10?

bronze yoke
#

globals are slower and can cause mod conflicts

bright fog
#

fatal, idk

#

badly optimized, surely

verbal yew
#

coding moments xD

bright fog
#

Might be time for you to switch to vs code by now lol ?

verbal yew
bright fog
# bronze yoke

Reading through the side list, I feel like removing "Parameters" would possibly make it easier to read

verbal yew
#

I'm used to working in a notepad++

bright fog
#

And I'm never switching back

bronze yoke
bright fog
#

yeah I kind of guessed it

#

Through you could not make parameters a header perhaps ?

#

It then wouldn't show

bronze yoke
#

it'd make the script functions harder to read to have no heading for it, but i'm not hard set on the current format or anything

#

it'd be harder to distinguish returns and parameters

bright fog
#

would it ?

#

I mean, you could also make a cell in those table which says parameters or returns

#

Also the fact you have two distinct tables

#

(also I didn't knew there were Events with return values)

bronze yoke
#

these aren't events, they're just sharing a page right now

bright fog
#

ah nvm then

bronze yoke
#

it's sort of a generic container for function signatures referenced in scripts and stuff, i never found any documentation of them anywhere

#

umbrella will contain stubs for them in the next update too

bright fog
#

nice

frank elbow
#

I've used bolded text for similar purposes before. Could also try lower heading levels, dunno whether github's outline goes all the way to h6

bronze yoke
#

bold looks good, i'll change it to generate that later

#

probably when i get around to separating it into individual events/hooks/callbacks pages

grizzled fulcrum
#

idk something could be like this, just an idea though.

#

truth be told as long as it holds information I need I couldn't care how bad it looks

uneven ore
#

Sorry for all the posts in here, however, I wanna figure out how to play a sound, I used this

(

    local soundmg = getSoundManager();
    
    soundmg:PlaySound("soundThunder", false, 0);

)

open drum
#

guys

#

what is

#

ERROR: General , 1711274269656> 262,386,482> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: __lt not defined for operand at KahluaUtil.fail line:82.
ERROR: General , 1711274269656> 262,386,483> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: __lt not defined for operand

#

mean?

#

what's the __lt not defined for operand suppose to mean ?

bronze yoke
#

you're using a non-number in a < operation

open drum
#

oh

bronze yoke
#

usually this is something being nil unexpectedly

open drum
#

i see.. must b a nil then

#

since i pre-set it for 0

#

thanks ill try it again by putting exception

viral notch
#

Looking tor small script where can limit to Spawn selected vehicles with some parts
Someone know where to add that or how to create it?
Expl vehicle A will spawns 1/8 with doors and 7/8 will without

reef cairn
#

what is the difference between blacksmith and metalwelding xp?

bright fog
bright fog
#

Then that's most likely wrongly used

uneven ore
#

i've tried renaming the sound file to a lot of stuff

bright fog
#

renaming the sound file?

#

That's a custom sound ?

uneven ore
bright fog
#

Did you make a script for it ?

uneven ore
bright fog
#

Then you need to make a script file for your sound

uneven ore
#

Alright, ill figure out how

bright fog
#

just search for sound scripts in the script files of the game

jovial basin
#

Would a CCTV mod be possible in this game? Like to have a security cam for example outside your hideout that you could connect to a TV and then view? Viewing the camera would take you away from viewing your character and would switch to the live cam footage stream?

bright fog
#

That's an isometric game with only visuals from top

#

Even if it was possible, your camera view wouldn't make any sense lol

jovial basin
#

true

jovial basin
#

lol

formal kraken
#

I finally finished making the animation

jovial basin
# bright fog What would even be the POV of your camera ...?

so giving this a little more thought, what if the cam view is just a live image (camera view is not panning) of the area where the cam is set up? Much like we don't see how our character is actually seeing things, we see our character and everything around them, couldn't the cam footage not just show the area where the cam is set up, showing the cam itself and everything around it on screen?

bright fog
#

The issue is that I'm pretty sure camera view is hardcoded

jovial basin
#

You place a cam down, add power source, and adds that feed to your cam feeds

bright fog
jovial basin
bright fog
#

basically yeah I think

#

Would require someone to look deeper into it

#

I know one or two guy looked into cameras to remove the FOV effect for modding and recording purposes

jovial basin
#

ah I see

bright fog
#

idk if they found anything about being able to move the camera's position

#

And I have no knowledge in that field but what I heard is that this kind of stuff seems to be very hard to deal with, and possibly barely modable

#

With b42 it could change tho with the changes to FOV

jovial basin
#

ah very interesting

#

ty ๐Ÿ™‚

broken lake
#

after 2 days of fun work; finished my first zomboid mod and released it :3

wheat kraken
#

@nova socket can i pm you?

nova socket
wheat kraken
# nova socket For?

im modder from firetrail and wheelbarrow,

and im building a mod recommender in-game, to people discover passively,
people can add content via discord bot

and it be featured on the mod automatically


the ui part will take care about:
turn a modlist table (modname=shortdesc),
the data structure into visual, into a good ui

in the first, it will serve tier 0 (mods from 300 subs to 100k), and in the future will add others tiers to cover mainstreams and popular ones

are you interested to be co-creator?

bright fog
#

Also why don't you make something that automatically picks up mods to showcase ?

wheat kraken
bright fog
#

Or just don't show a description ?

#

Just show the name + cover of the mod

#

If the cover and name is clean and people are curious, they can check it out

wheat kraken
#

it will be not usable, many people will not know what the mod does, or their usefulness

#

its not possible to use image i think

bright fog
#

People don't read a small description for mods they see in the workshop

#

They read the name, check the cover and get curious about it

wheat kraken
#

look that

bright fog
#

Click on it, see what it does

bright fog
wheat kraken
#

on workshop works from #1 to #7 page

bright fog
#

Like bro, that's base statistics, that's completely normal to have this kind of stuff

#

Like really, this kind of behavior is normal

#

There's a bunch of people who don't play with 1000 mods like some of us and they just want some QOL mods, maybe clean and good quality mods that improve a little bit upon the features of the game

#

Add something easy and unique

#

Then you have the ones with huge mod list, that are interested by a lot of stuff, and that's a spectrum so it varies for everyone

#

I don't complain about the current popularity my mods have, in fact I think they are fairly know and they just keep growing

#

Like this is the mod

wheat kraken
#

my worry about fully automated is let pass mods that people didnt consider recommend to others

wheat kraken
#

and even if i do it,

i still will need a co-creator to make an ui that fits and looks great

bright fog
#

The system doesn't work on recommendations. Yes a mod can grow very quickly if everyone recommends a mod, but if you end up recommending every single mods on the workshop, there's no way everyone will look at them and use them that's my point

#

While showing off mods in-game to show new mods to others is a nice idea, I really think you should just present the 30 current popular mods of the week

#

The issue is that a bunch of people don't look further than the 9 mods on the main Workshop page

#

And you end up having smaller mods that don't get enough popularity bcs they just didn't reach those 9 slots

#

Once you reach those 9 slots, you're mod will explode in popularity

#

So what you would need to do is just show the mods further than those 9 slots to actually end up with a good system to promote medium mods that could pass under the radar

#

We were talking with PALSJ about it and how it didn't pick up on the workshop

#

The mod is very very clean and a lot of people would most likely like it and use it

#

But bcs it didn't reach those 9 slots, it didn't pick up enough attention and didn't get enough popularity

#

It would be this kind of stuff you want to showcase with a showcase mod

wheat kraken
#

are you considering, that is possible to cycle passively in-game?
(the mod itself can change to next item)

there is no need to limit to 30 most popular of week

bright fog
#

Let's say a player sees 5 mods on the menu page everytime he launches the game

wheat kraken
# bright fog Well, yeah, and no

the hard part to me (that i didnt solved proper) is to make people to understand what is that mod about, and fit small summary in game, and visual present data at in-game ui

bright fog
#

Everytime he launches the game that's 5 random new mods shown to him

#

If you show 30 most popular mods of the week, there's a good chance he'll see 90% of those during the week

#

If you show the 60 however, that's way way less

#

Half the chance of seeing every mods

#

And the issue is that within these 60, there's a good chunk of those who are just bad in quality and you don't want to show those

wheat kraken
nova socket
bronze yoke
#

it doesn't feel much like a spotlight if it's just showing what's already popular on the workshop

bright fog
wheat kraken
bright fog
wheat kraken
bright fog
#

They could pick up a lot more attention if they were shown a bit better to the public, only those who actively look at the mod page further than the top 9 will see those and help share them

bright fog
#

The system needs to be smart, like it would actually need to be a framework that players implement within their own mods, so it automatically activates the system once someone has that framework

#

If you end up with 100 mods having your framework and one of them is popular, people will use it and boom trigger the system to show popular mods of the week

nova socket
wheat kraken
bright fog
#

You're facing a big design issue: most of the player base will NOT download your mod because they don't have a use for it

#

If you add your mod within everyone's else mod, people will actually use it

#

And I'm not talking about a dependency to your mod to use mods others make, but like actually implement the code within their own mods

wheat kraken
#

?

bright fog
#

Your idea is great, promote a bit smaller mods, show them to the public, I love it

#

but there's really this issue that people will probably not download your mod

wheat kraken
#

i dont get it,
you are looking for achieve which final objective?

bright fog
#

guess I need to draw something so you understand

bronze yoke
#

i don't think bloatware is the solution

bright fog
#

I mean, considering it could be a single .lua file that everyone will share exactly the same, it would technically be a single .lua file for every single mods that implement it

#

(Also is it even possible to access outside lists of popular mods)

bronze yoke
#

i didn't see you say that, but that's even worse, stuff like that has been causing terrible issues for years ๐Ÿ˜…

bright fog
wheat kraken
# wheat kraken i dont get it, you are looking for achieve which final objective?

mine mod recommender, is seeking for, steps

have an options to people select tiers, (and maybe tags too),
im not seeking to start with full complete solution, mvp first, its is because of that, that im starting with tier 0 (from 300 to 100k)

and keep mod running, they will be able to discover something new at some point, passivelly

( just a metaphor, its is like an antivirus with receive new data update from time to time)

bright fog
#

That's what I do for example to check on new mods

bronze yoke
#

first i don't think you should sneak unwanted content into unrelated mods, it's annoying for the users, but second you will probably need to update it ever and having it in more than one mod basically guarantees this will not work

bright fog
#

yeah I agree with those points

bronze yoke
#

we had a lot of issues before because people would bundle item tweaker into their mods, a couple mods changed its api and caused all other mods using it to break when using those mods

bright fog
#

Yeah alright I agree with those points but what would you even suggest he does to actually have his mod spotlight be used ?

#

that's the issue, I can assure people will most likely not use your mod, it's bloating their mod lists for no reasons with something they could check outside of the game with 2 clicks

#

I will personally not add such a mod

bronze yoke
#

if it had a cleaner ui i think it'd be quite appealing

#

mod manager is very popular and that doesn't do anything you can't do already

bright fog
#

Like Dane did with his 10YL launcher

wheat kraken
bright fog
#

Custom launcher, that modifies the interface

#

That could definitely be appealing to others to use

#

Just do yours tbf, I gave you my ideas and my opinion on your concept, the issues with it and what to do to fix those

#

Just I'm telling you, it needs to be more than just a spotlight mod or it needs to be implement in other random mods to be used (which I agree with Albion, is really not great)

#

The menu mod could really be good

wheat kraken
bright fog
#

Make a framework that's the spotlight and create menu mods that use this framework with the mod spotlight

bright fog
#

Custom menu that's cool, people will actually use it

#

And like those new main menu style mods use a framework that adds new stuff to the menu with music

#

Could be the exact same concept but with mod spotlights

wheat kraken
# bronze yoke if it had a cleaner ui i think it'd be quite appealing

that is what i worry about, and looking for more skilled people

it will be a dream to get good ui people like mod manager, craft helper, mods that deal hard with ui
(braven, notloc, star, noctisfalco, Tchernobill, PePePePePeil, Champy...)

or just a small team for ui, or help on that, i dont think am able to do that, other than infra and scripting non ui

bright fog
#

Why do you just not learn how to use those ?

wheat kraken
#

@mellow frigate

wheat kraken
#

im backend developer

coarse sinew
wheat kraken
# coarse sinew The way I started the UI was to look in the base game and modify from there. BM ...

i do some of that too,

with dragon radar (it is item viewer from debug), radial menu, vhs in vehicles (its the radio window modified), rebalance yourself,

but we do not have something similar to reuse unfortunally, but thanks for pin point that (or if we do, comment and i can work on this, and a mod too)

but did you guys think that come up with good ui, we probably solve the short description by humans (i do a pool and people are more willing to use than collaborate with input)

wheat kraken
wheat kraken
bright fog
#

Those are definitely not good example lmao

#

but whatever do your thing

slow graniteBOT
#
a8ye has been warned

Reason: Bad word usage

robust briar
#

I deployed ChatGPT Powered Radio-Only NPCs on Wasteland RP's server! Currently using them as new-player tutorial NPCs to introduce our players to our hub-town, fast-travel system, and in-game currency and then also as lore drop NPCs which give bits of lore for our upcoming storylines and events. Figured I would share with you all some the technical things I had to overcome to get these working, and some of the guards I put in place to keep costs down.

The Interface

Seeing as from lua we can not make any web requests for the API calls to OpenAI, I had to resort to using an external program. But then I still had the issue of: The only interface to "outside" of PZ lua offers is FileReader and FileWriter. So, I designed a simple protocol around file reads and writes, basically using files as a crude API.

To implement this API on the PZ side I created two sets of "commands". OutCommands and InCommands, then a corresponding OutCommandWriter and InCommandParser. These handle taking lua objects and converting them into line delineated strings or from line delineated strings into lua objects. Finally, its all tied together with a FileMonitor which will watch a specific file in the lua directory, and when it has lines will read them in, pass them to the parser, then write back to that file with zero data (effectively resetting it). The out command writer will just write to files sequentially named 0.txt, 1.txt, .. etc.

On the custom app side of things, I do the inverse. I have a monitor which holds any commands it wants to send to PZ in a buffer. Once it sees that file is now zero size, it will batch write out any commands in buffer then wait until it gets zero'd out again. The reading commands from PZ is simple as it can just read each file in order then delete them.

This combined gives me a latency of about a 500ms, which is plenty good enough for conversational NPCs.

Triggering NPCS

In-game NPCs are triggered 3 ways. For new players they get triggered automatically. A message is sent to the player there is an NPC available for them to interact with. All they need to do is tune into a specific frequency on their radio. For lore, we leave notes in the world with a frequency available, then use an in-game UI to set which NPC we want to "listen" to that frequency. Finally, we can manually send an NPC to be available for a player, in which they behave like the new-player NPCs which show a message to the user to trigger them.

Keeping Costs Down

Obviously, running these NPCs costs us as OpenAI's ChatGPT API is not free. To keep costs down we have a couple safeguards. Each NPC has a hard coded limit to the number of messages back and forth it will send with a player. All "lore/world" NPCs limit each player to one conversation each, and finally we have a hard dollar amount cutoff. Our current costs per day to run these is about $2.00usd, with days with lots of lore drops coming closer to $5.00usd.

You can see the PZ mod code in our modpack here: https://gitlab.com/wasteland-rp/wastelandmodpack/-/tree/main/Contents/mods/WastelandGptNpcs/media/lua/server/GptNpcs This doesn't include the actual OpenAI program/interface or our actual NPC code, as that's something I am holding close to chest for the time being.

The images attached is my character (Josh Smith) having a conversation with our Tutorial NPC. Some of the other NPCs we have are: "Crazy Dan" - an old man who spouts conspiracy theories about the apocalypses and spreads rumors about our player factions; "Old Friend" - An NPC which reads our players character sheets, then invents a person who is an old friend of theirs to catch up; and "Isaac Hill" - A young guy who was robbed by our largest antag faction, and warns people to steer clear of them.

Anyways... enough rambling. Been working on this for months and just wanted to share some of the technical stuff with y'all. ๐Ÿค–

crystal oar
#

hey, i'm helping someone set up a server, and they got some errors that say Stack trace: se.krka.kahlua.vm.KahluaException: MasamuneDefinitions.lua:21: unexpected symbol near <eof> . so i looked at that file, and it looks like it's missing a close bracket ```AttachedWeaponDefinitions.MasamuneStomach = {
chance = 0.5,
weaponLocation = {"Stomach"},
bloodLocations = {"Torso_Lower","Back"},
addHoles = true,
daySurvived = 30,
weapons = {
"Base.Masamune",
},
}

AttachedWeaponDefinitions.MasamuneBack = {
chance = 0.5,
weaponLocation = {"Masamune in Back"},
bloodLocations = {"Back"},
addHoles = true,
daySurvived = 30,
weapons = {
"Base.Masamune",

},``` but i downloaded it just to make sure the file hadn't gotten edited or something and that sure is what it says.  i've never made a mod that added weapons to zombies, but is there supposed to be a close bracket there?
bronze yoke
#

yeah, there should be

vague hedge
#

If anyone wants custom recipes for their game, let me know.

dim mist
#

Is there a better lua console than the one which appears at the bottom left in debug mode? Like maybe a mod or something. Or if there is no replacement, is there a way to increase size of the standard one?

bright fog
bright fog
dim mist
slow graniteBOT
#
fknkinsley has been warned

Reason: Bad word usage

coarse sinew
# dim mist Is there a better lua console than the one which appears at the bottom left in d...

You can open PZ directly with the console, in the game directory is ProjectZomboid64ShowConsole.bat. It's easier to view than opening the file and reloading it each time it's updated. You can also add other parameters, such as debug and changing the cache directory.
At the end of line 7:

-cp %PZ_CLASSPATH% zombie.gameStates.MainScreenState -debug -cachedir=C:\Users\%username%\ZomboidDEV %1 %2

Change %username% with yours.

dim mist
drifting ore
#

What .bank file in the sounds folder contains EVERY Sound? I'm ripping some stuff and I'm curious where I can find it

bright fog
#

What sounds you want ?

#

Usually it's in media/sounds

#

You have a bunch of sounds there and for .bank files

#

It's media/sounds/banks/desktop

#

And I know a majority of the sounds are in ZombieSound

#

Like zombies sounds but not only, a lot of footstep stuff, attacks I guess and others

rich void
robust briar
faint mortar
#

Iโ€™m a very very rookie modder. I know jackshit about lua, my only mod was changing the intro script, but I wanna do something else. The OCP Gear mod has a gas mask in it. But, the mod is incompatible with Noirโ€™s Attachments. I found an addon that makes it compatible, but I still canโ€™t put the Rangerโ€™s Gas Mask on the utility slot. Can someone help me figure out how to do that?

errant bluff
#

The noise of a generator can attract zeds, and if the generator is in the middle of the street, unprotected and working, would zeds attack it to destroy it?

crisp rock
bright fog
rich void
# bright fog wait you could access information outside of a player's computer via mods ?

The mod does not read, only writes out, I use it for my mod territory warfare, people capture territory starting a king of the hill type event which lasts 20 minutes, when the event is completed, the winning faction, the timestamp and players involved are exported to a text file in CSV format, I then use a PHP script attached to a cronjob to take that data and implement it into a database, there are then cronjobs for alerting players via discord on the state of territory so everyone can keep track even if they're not in the game to see, I'll attach a few screen shots ๐Ÿ™‚

The hardest part was honestly taking that data and somehow managing to get an accurate output at the end of the week of who remained in control of each territory for the longest.

rich void
crisp rock
#

a simple way to capture server environment stuff and send it as strings to discord or even just a different process might be pretty useful

#

thx for the offer

#

not sure i have the time right now for it but if this week ends up looking alright then maybe

robust briar
#

you just need an external program on the other side to parse and generate those commands

crisp rock
#

yeah i've got to look into that

#

right now i really dont have a lot of insight into how pz dedicated servers work

robust briar
#

its basically just a headless PZ instance

crisp rock
#

still gotta get into the guts of it

#

not like i've tinkered with exporting data out of headful PZ instances

#

i'm gonna step away from the keyboard before i get too excited about this but yeah it should be fun

robust briar
#

haha

#

Its pretty easy honestly. Just write a file, read that file

rich void
#

Yeah with discord "integrations" stuff like this is very easy now, i'll stick the generic script i use in here for anyone to stumble upon in the future, just gotta make sure you have php and curl extension installed on your box and this will read a text file and shit out the contents for your discord integrations bot to speak out!

<?php

// Directory to search for the log file
$directory = '/home/pzserver/';

// Name of the log file to process
$logFileName = 'texttosend.txt';

// Discord webhook URL
$webhookUrl = 'https://discord.com/api/webhooks/yourdiscordintergrationboturl';

// Path to the specific log file
$logFilePath = $directory . $logFileName;

if (file_exists($logFilePath)) {
   
    $content = file_get_contents($logFilePath);

    
    if (!empty($content)) {
       
        $payload = json_encode([
            'content' => $content
        ]);

        $ch = curl_init($webhookUrl);
        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        curl_close($ch);

        if ($response === false) {
            echo 'Failed to send webhook request for log file: ' . $logFileName . PHP_EOL;
        } else {
            echo 'Webhook sent successfully for log file: ' . $logFileName . PHP_EOL;
        }
    } else {
        echo 'Log file is empty: ' . $logFileName . PHP_EOL;
    }

    unlink($logFilePath);
} else {
    echo 'Log file not found: ' . $logFileName . PHP_EOL;
}
#

but as gravy is saying, there's a multitude of ways you can acheive the same thing in multiple languages

crisp rock
#

im not sure how much i like the idea of using php and curl and webhooks

robust briar
#

I then use that data for our admin interface and player reports

#

Like, to generate these!

crisp rock
#

oh hell yeah

#

fancy

robust briar
#

And this

rich void
#

yeah this makes me look like a caveman in comparison hahah

crisp rock
#

i've got experience writing discord bots and parsers
now websites... not really but i'm working on that

#

but alright i gotta go for real lel

verbal yew
#

guys, what event i should use for zombie spawn distributions if i have sandbox options (they can be changed in game process)?

require 'NPCs/ZombiesZoneDefinition'
local function zReVAC2_SpawnRate()
    local specZombieSpawnChance = SandboxVars.zReV2.SpecZombieSpawnChance * 0.001;
    table.insert(ZombiesZoneDefinition.Default,{name = "zReVAC2_ZombieECO", chance= specZombieSpawnChance});
end
#

OnInitGlobalModData?

vast orchid
#

I'm trying to figure out how to change one of the stats that are generated in this recipe, (among others found in recipecode.lua); how would I go about doing that? Do I have to overwrite the function or can I just change a single stat-calculation's line?

function Recipe.OnCreate.CutFillet(items, result, player)
    local fillet = nil
    for i=0,items:size() - 1 do
        if items:get(i):getType() == "FishFillet" then
            fillet = items:get(i)
            break
        end
    end
    if fillet then
        local hunger = math.max(fillet:getBaseHunger(), fillet:getHungChange())
        fillet:setBaseHunger(hunger * 0.5)
        fillet:setHungChange(fillet:getBaseHunger())
        fillet:setActualWeight(fillet:getActualWeight() * 0.5)

        result:setBaseHunger(fillet:getBaseHunger())
        result:setHungChange(fillet:getBaseHunger())
        result:setActualWeight(fillet:getActualWeight())
        result:setWeight(result:getActualWeight())
        result:setCustomWeight(true)
        result:setCarbohydrates(fillet:getCarbohydrates());
        result:setLipids(fillet:getLipids());
        result:setProteins(fillet:getProteins());
        result:setCalories(fillet:getCalories());
    end
end
small topaz
#

Is there an event which is triggered after all mods have been loaded?

small topaz
#

Another question: is it possible to define a custom event?

small topaz
#

Any idea how I can get a list of all active mods? Could then simply check OnGameBoot which mods are counted as active. I tried several things with the command "getMod()" but this gave me always an "Object tried to call nil" error

small topaz
# mellow frigate getMods()

ah sorry, I meant "getMods()" (and not "getMod()") was just a typo... but this didn't work for me somehow when I use this OnGameBoot

mellow frigate
#

if I am wrong and the function is broken, getActivatedMods() may be of use.

small topaz
#

getActivatedMods() seems work fine for me!

#

However, the getMods() command does indeed result in Object tried to call nil error when I use it like this:

   local myList = getMods() -- console.txt shows the error occurs in this line

   if not myList:isEmpty() then
          print("TEST OUTPUT: bla")
   end
end

Events.OnGameBoot.Add(myTest)```

But anyway, the getActivatedMods() seems to be sufficient for me.
mellow frigate
#

Thanx ๐Ÿ™‚

small topaz
#

I am the one who has to thank you!

mellow frigate
gilded hawk
#

Is there an event for when a IsoContainer is placed?

faint mortar
#

hi, i'm trying to figure out how to make a mod that makes it so the ranger's gas mask from OCP Gear can be attached to the utility slots from Noir's Attachments. Can anyone help me?

fervent marlin
#

is

    local wornItems = playerObj:getWornItems();
    if not item then return end 

Not the correct method for checking if I'm wearing an item?

#

stressed There are like 15 different ways to check for an item and the list is not super informative as to what each of them do

small topaz
#

moreover, is your question how to check whether your characters wears a specific item or do you want to check whether they wear anything at all or are nude?

fervent marlin
#

I have the item defined above it, and I'm looking for that specific item.

small topaz
fervent marlin
#

Should I instead be using pl rather than playerObj

mystic vessel
#

actually nevermind, i got another questions guys

small topaz
fervent marlin
#
function PendantHappinessFunction()

    local pl = getPlayer(); 
    local wornItems = pl:getWornItems();
    if not item then return end 
    
    local getSad = pl:getBodyDamage():getUnhappynessLevel()
    local modifySad = getSad - SandboxVars.Pendant.Rate;
    local Sadness = (math.floor(getSad*100)/100)
    
        for i=0, #PendantItem do
            if item:getFullType() == PendantItem[i] then
    
         pl:getBodyDamage():setUnhappynessLevel(modifySad);
                if modifySad <= 0 then  pl:getBodyDamage():setUnhappynessLevel(0); end
                --local endurance = self.character:getStats():getEndurance() - 0.0001 * getGameTime():getMultiplier()
        --self.character:getStats():setEndurance(endurance);
    
            end
        end
    
    end
    Events.EveryOneMinute.Add(PendantHappinessFunction);```
#

I'm loosely hacking together this from some existing code as a test to see if I can make worn items apply effects

#

in this instance, it's just a pendant item that reduces unhappiness

#

but I keep getting hit with a problem when it gets to the actually checking for the item

#

There is a different mod that is for an item you hold in your hand and reduces your unhappiness, and the search code does this

    local pl = getPlayer(); 
    local item = pl:getSecondaryHandItem();
    if not item then return end 
#

But, just changing it to local item = pl:getWornItem(); throws an error

small topaz
fervent marlin
#

rj it doesn't have a value in the working code snipped from the other mod

#

but shouldn't this be declaring a local variable?

small topaz
fervent marlin
#

Is there a full index of those bodylocations?
Not listed on the wiki as far as I can find

small topaz
#

also note the difference between two commands you are working with: "pl:getWornItems()" with "s" at the end returns smth like a list of all items the player wears. "pl:getWornItem(bodyLocation)" without "s" returns the single the player is wearing at the location.

fervent marlin
#

An important distinction, good catch thank you

small topaz
fervent marlin
#

I'll go take a look and report back

small topaz
fervent marlin
#

It's going to be a necklace item called Timeless_Pendant

small topaz
#

A modded item I guess??

fervent marlin
#

it's being added by my test mod

#

I haven't touched lua since probably 2012 with Roblox development!

small topaz
# fervent marlin I haven't touched lua since probably 2012 with Roblox development!

Necklaces are typically worn on the body location "Necklace". So you could try

if item and item:getFullType() == "Base.Timeless_Pendant" then
       -- do something ...
else
      -- do something else
end```
Only works in case your Timelss_Pendant belongs to the "Base" module in its script.txt entry.  This entry also contain a field called "BodyLocation = ..." which tells you which body location it actually has. In the above code, you might then replace "Base." and "Necklace" with the correct values.
fervent marlin
#

It is in the Base module, so that's good

#

necklase should be it's display name? name in the module?

small topaz
fervent marlin
#

it's necklace

#

this one, specifically

small topaz
fervent marlin
#

I will try that

#

NOT HAPPY

small topaz
fervent marlin
#

    local pl = getPlayer(); 
    local item = pl:getWornItem("Necklace");
    if item and item:getFullType() == "Base.Pendant"
    then```
#

then there's the function to reduce unhappiness after that

small topaz
#

did you remove the lines

    if not item then return end```
and
```if item:getFullType() == PendantItem[i] then
...
end```
from your old code? Especially the second one will cause an error...
fervent marlin
#

yes

small topaz
#

can you post your new code?

fervent marlin
#

well, I didn't strip the if item getfulltype

#

I did add quotes to the Necklace type and that hasn't thrown an error yet

#
charmItem = {[1]="Base.Pendant"}
function CharmFunction()

    local pl = getPlayer(); 
    local item = pl:getWornItem("Necklace");
    if item and item:getFullType() == "Base.Pendant"
    then
    local getSad = pl:getBodyDamage():getUnhappynessLevel()
    local modifySad = getSad - SandboxVars.Charm.Rate;
    local Sadness = (math.floor(getSad*100)/100)
    
        for i=0, #charmItem do
            if item:getFullType() == charmItem[i] then
    
         pl:getBodyDamage():setUnhappynessLevel(modifySad);
                if modifySad <= 0 then  pl:getBodyDamage():setUnhappynessLevel(0); end
                --local endurance = self.character:getStats():getEndurance() - 0.0001 * getGameTime():getMultiplier()
        --self.character:getStats():setEndurance(endurance);
    
            end
        end
    end
    
    end
    Events.EveryOneMinute.Add(CharmFunction);```
small topaz
#

formatting is quite suboptimal because it is hard to see which "end" closes which "if" or which for-loop ๐Ÿ˜‰

fervent marlin
#

๐Ÿ˜‚ yeah I know hold on

small topaz
#

why are you using this:

      if item:getFullType() == charmItem[i] then```
#

???

fervent marlin
#

It was in the original working code, I'm honestly not sure its function

small topaz
#

not goodXD

#

in case you just want to reduce unhappiness when the item is worn, this is pbbly not needed anymore. Moreover the "charmItem" seems to be defined as a global variable which is not a good idea!

#

and why do you use "Base.Pendant" now and not "Base.Pendant_Timelss"?? This will in fact not throw an error but you have to use the item's script name to make it work

fervent marlin
#

It's called pendant

small topaz
#

ok

fervent marlin
#

I think the display name is Timeless pendant, which doesn't help for the scipt

small topaz
#

true

fervent marlin
#
charmItem = {[1]="Base.Pendant"}
function CharmFunction()

    local pl = getPlayer(); 
    local item = pl:getWornItem("Necklace");
    if item and item:getFullType() == "Base.Pendant"
    then
    local bodyDamage = player:getBodyDamage()
    bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10)
    bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 20)
    end
    
    Events.EveryOneMinute.Add(CharmFunction);
#

shortened and simplified the boredom and unhappiness stuff

#

bigger numbers also easier to test

small topaz
#

looks a bit better right now. but I would delete the first line "charmItem = ..." . and this is still a pain to read!! XD

maybe better this:

    local pl = getPlayer(); 
    local item = pl:getWornItem("Necklace");
    if item and item:getFullType() == "Base.Pendant" then
         local bodyDamage = player:getBodyDamage()
         bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10)
         bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 20)
    end
end
    
Events.EveryOneMinute.Add(CharmFunction)```

Think you forgot an "end" in your code
fervent marlin
#

doesn't like local bodydamage = player.getBodyDamage()

small topaz
#

and better to give your function a more unique name or in case you do not need this function at any other place, you can just make it local:
local function CharmFunction()

small topaz
#

cause "player" is not defined in your code

fervent marlin
#

mm true

#

should I move it up by the other local variables at the top?

#

Or should I only read for it once the function calls

fervent marlin
#

function
local pl = getplayer
local item
local bodydamage
if then statement

small topaz
#

bodydamage can stay in the if-condition if you do not need it elsewhere

#

main error in your code is because you use "player:getBodyDamage()" instead of "pl:getBodyDamage()"

fervent marlin
#

working ๐Ÿ‘

#

going to experiment a bit with these, thanks

small topaz
#

cool! And as I said, either give your function a more unique name or make it local. Has otherwise an increased chance to cause conflicts with other mods or even with the vanilla game.

fervent marlin
#

one last thing, is there anything special I need other than print ("message") to output to console?

mystic vessel
#

Good evening, everyone. Maybe someone experienced here can help me,

I am the creator of mod machines, and it uses the framework

"crafting enchanted core" by default, the framework does not have the function to require
"player skill" materials only

A friend of mine who understands a little more tried to add this to core, but without success.

can anybody help me?
Here below are the two main files
One is the core of the mod, and the other is the machine creation page
In this case, I'm trying to make the bench saw, carpentry skill 3 is required
What i can/should i do?

coarse sinew
#

Just replace your files with the ones from this archive.

final finch
#

Mod suggestion... Alarms don't trigger once the power is out? Or at least after a certain time peroid after that after the batteries for the alarm run out?

formal kraken
#

Alarms can be triggered after power is out?

small topaz
#

Hi everyone! iirc, there is a command which you can use in the new() function of a timed action which makes it so that the player cannot use the right-click aim cursor while the action is running. Problem is that I do not remember where I saw this command and what this command was. XD Does anyone happens to know what the command was? I think it was smth like
o.hideAimOutline = true
but not sure...

desert kelp
#

Does anyone have any video tutorial/guide for creating texturepacks? I am trying to expand Shops by adding new NPC textures, and I have defined the png files properly, like for the existing naming conventions, i followed npcshop_0, npcshop_1 .. and so on.

There's also the tiles file which I assume is 1:1 based on the image on the texturepack file, so I copied to make it count to 18 (which is the number of png files on the texturepack).

And I defined the sprite faces based on their png filename but when I try it in-game, it won't show

#

for some reason, it's working now with the latest texturepack but noninteractive, i'll just see how i can tweak this

grizzled fulcrum
#

I can't for the life of me find where item icon textures are stored in the game files, can anyone point me in the right direction?

grizzled fulcrum
#

There are no files under media/textures that are prefixed with Item_

desert kelp
#

If it's not there, it maybe on the texturepack

grizzled fulcrum
#

And I searched the whole ProjectZomboid directory for toothbrush icon but no avail

grizzled fulcrum
desert kelp
#

TileZed

grizzled fulcrum
#

ok ty

mystic vessel
#

If you want me to put a link to your steam or something like that you can send it here, you are a angel thank you so much

coarse sinew
mystic vessel
vast orchid
small topaz
#

How do I iterate through a KahluaTable? Is it the same as a lua table?

bronze yoke
#

kahlua is lua

small topaz
#

good to know XD

bright fog
#

There's some stuff you can't use but it's mostly the same yeah

fervent marlin
#

why would adding zombrand to my lua script make it stop appearing in the F11 debug menu?

#

I'm trying to tie a random effect to a zombrand

#

local checkRoll = zombRand (1, 5)
if checkRoll == 1 then (do thing)
elseif checkRoll == 2 then (do thing)
... etc ...
end
is this not the correct usage?

bronze yoke
#

ZombRand should be capitalised, and there shouldn't be a space between it and the opening bracket

#

so ZombRand(1,5)

fervent marlin
#

I do have that, in the actual code

#
function pendantFunction()
    
    local pl = getPlayer(); 
    local item = pl:getWornItem("Necklace");
    if item and item:getFullType() == "Base.Pendant" then
        print ("Found memorable necklace")
        local checkThought == ZombRand(1, 5)
            if checkThought == 1 then
                local bodyDamage = pl:getBodyDamage()
                bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 1)
                bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 2)
                print ("Small bonus")
            elseif checkThought == 2 then
                local bodyDamage = pl:getBodyDamage()
                bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 3)
                bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 5)
                print ("Medium bonus")
            elseif checkThought == 3 then
                local bodyDamage = pl:getBodyDamage()
                bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 5)
                bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 10)
                print ("strong bonus")
            elseif checkThought == 4 then
                local bodyDamage = pl:getBodyDamage()
                bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10)
                bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - 20)
                print ("very strong bonus")
        end
    end
    
Events.EveryTenMinutes.Add(pendantFunction);
bronze yoke
#

you're missing an end

fervent marlin
#

Am I? Notepad++ is not very helpful in keeping track of those

#

The individual elseifs don't need and end, right

#

until after the final one

bronze yoke
#

yeah

fervent marlin
#

It's still not showing up, unfortunately.

bronze yoke
#

local checkThought == ZombRand(1, 5) should use a single =

atomic elk
#

is it possible to access sandbox variables in the .txt scripts?

bronze yoke
#

no

bronze parcel
#

If anyone has a idea its best to just make it ?

near pilot
wheat kraken
#

hey dm me :) nice to meet same nationality

mystic vessel
mellow frigate
clear compass
#

If I wanted to add my own suit of armor so to speak how do I do it

coarse sinew
#

If, for example, you don't have another room above the stairs, the downstairs room is not "inside".

#

It's probably because there are those holes left in the ceiling for the stairs

#

But the problem with the corners is the most common.

mellow frigate
#

I have the exact opposite of you, with roof above all squares of the room except the stairs, My room is considered inside. The stairs are also considered part of the room and inside (even though there is no roof above my head when I'm on the stairs)

#

Stair inside even with no roof (room light + 22degree inside)

#

Just up the stairs I'm outside (no room lighting+19degree outside).

pure abyss
# mellow frigate Hello there, I uploaded a fix for the cases builders do not understand why their...

This is gold!

Suggestion: and about that weird transparency with player buildings? Can you create a mod to emulate the player bulding like the pre-existent buildings?

I'm talking about this: https://steamcommunity.com/app/108600/discussions/0/4290313152619615220/

Hey fellow survivors, Let's talk about building in Project Zomboid. Have you ever noticed the difference between the structures we build and the ones already in the game? There's a clear contrast: player-made structures have this transparency, allowing me to see whats is inside and outside my building, thats totally imersion breaking while the g...

mellow frigate
pure abyss
coarse sinew
# mellow frigate

Weird, but I know I was helping players fix the buildings they made on a server, and in some cases it was the stairs.

mellow frigate
small topaz
#

When players press a keyboard key, is there an easy way to distinguish between the case that the player keeps pressing it for a longer time and the case that the player only shortly tabs the key? For example, vanilla game seems to distinguish between shortly tabbing "E" for opening a window and holding "E" for a longer time to climb through a window.

mellow frigate
small topaz
#

Thanks for the reply. I agree that this is probably not super easy...

grizzled fulcrum
#

idk much but you can do event like Events.OnKeyPressed and Events.OnKeyKeepPressed

reef cairn
#

does this line of coding work?

#

AlcoholWipes=2/Disinfectant=2,

#

trying to make it so you can use either wipes or disinfectant for a recipe

#

recipe Make Empty Syringe
{

    BlowTorch=1,
    AlcoholWipes=2/Disinfectant=2,
    RecPlastic=2,
    Needle,
    
    Result:EmptySyringe
    NearItem:Laboratory Table,
    AnimNode:Craft,
    Time:400.0,
    Category:Health,
}
#

what the recipe looks like

small topaz
verbal yew
reef cairn
#

or won't allow click to start

verbal yew
#

u can't predetermine AlcoholWipes=3/Disinfectant=2, for example

reef cairn
#

ohhhh

#

okay

#

i see

small topaz
# grizzled fulcrum wdym by tabbed?

oh sorry... I mean that you press a key only for a short moment in time and not keep pressing it for a longer period. my English is not the best sometimes...

reef cairn
#

thank you @verbal yew

grizzled fulcrum
#

So you want like different hold times for different keybinds

small topaz
grizzled fulcrum
small topaz
#

ok... I'll try those and check what their exact difference is. this could help me...

grizzled fulcrum
#

I have no idea how you'd do it without modifying some of the java somehow since OnKeyKeepPressed only has an argument key and no duration

#

wait hold on

#

ISHotbar has a self.keyPressedMS that represents how long a key has been pressed for

#

like

(getTimestampMS() - self.keyPressedMS) > 500
austere sequoia
#

Hi! Does one of you know how to make guns remember stats (like ammo count) when used in a recipe (something simple like a new guncolor)? Or maybe knows of a mod that already does something like this, where I can see how it works? I unfortunately am not good enough at lua stuff to figure this out myself by looking at the game files

small topaz
small topaz
grizzled fulcrum
# small topaz maybe helpful for me... I'll check that out

So this is all in lua/client/Hotbar/ISHotbar.lua but
It registers OnKeyStartPressed event callback and sets the variable keyPressedMS to getTimestampMs()
Then it uses that keyPressedMs variable to calculate how long it's pressed for in the OnKeyKeepPressed event clalback.

I can only assume that getTimestampMs() gets the current time in miliseconds and by subtracting the old time with the new time, you will get difference

-- example

local keyPressedMs
function onKeyStartPressed(key)
    keyPressedMs = getTimestampMs()
end

function onKeyKeepPressed(key)
    local diff = (getTimestampMs() - keyPressedMs)
    if diff > 200 -- 200ms
        print("Held for more than 200ms!")
    end
end

Events.OnKeyStartPressed.Add(onKeyStartPressed)
Events.OnKeyKeepPressed.Add(onKeyKeepPressed)
austere sequoia
small topaz
#

requires lua coding though

austere sequoia
#

Plus I could not find a mod that already does something like this, where I could borrow codesnippets

grizzled fulcrum
#

why do yo uhave to verify game files? unless you are modifying original files which not recommended

small topaz
austere sequoia
grizzled fulcrum
#

well what are you trying to tell the game differently?

#

You can override what the game does in your own mod too

austere sequoia
grizzled fulcrum
#

the game files by IS will teach you 10x better than most mods I found

#

once I found a mod that executed somewhere between 150 and 200 table.insert copy pasted (not even in for loop) every hour in game

#

but indie stone will never let someone put that in their game xd

small topaz
austere sequoia
#

ok, then I will keep on trying

grizzled fulcrum
#

if you want more guidance, I'd suggest using vscode or a decent ide like jetbrains with lua extension and opening the steam ProjectZomboid/media/lua folder so you can just search all the files for some text

#

like if you need to know how to use OnCreate like above you can just search the game files for every instance that OnCreate is used

small topaz
# austere sequoia ok, then I will keep on trying

Some basic info for the OnCreate function: It must be put to the server folder. The Header typically looks like this
function Recipe.OnCreate.MyCustomFunction(items, result, player, ...)
Iirc, "items" is the list of ingredient items, "result" is the result of the recipe. So you just have to pick out your old gun from "items" and transfer all relevant stats from it to the new gun which will be in "result". Getting and transferring the stats will pbbly be done by using java commands.

austere sequoia
#

Thanks man! That helps a lot

small topaz
# austere sequoia Thanks man! That helps a lot

also important is that you tell your recipe txt script it should execute your OnCreate function. This should work by adding the line
OnCreate:Recipe.OnCreate.MyCustomFunction,
to the script

austere sequoia
small topaz
#

To further clarify stuff a bit more, here is a minmal example which will transfer the condition of the old gun to the new one:

     local oldGun = nil     
     for i=1,items:size() do
          local item = items:get(i-1)
          if item:getFullType() == "Base.YourOldGunsScriptName" then
                oldGun = item -- grab the old gun for further work
                break
          end
      end
      if oldGun then
            local condition = oldGun:getCondition()
            result:setCondition(condition)
      end       
end```

I made this example out of my head and did not test it but should be smth like this.
austere sequoia
#

That makes sense! If I see it correctly, it calls a specific gun, so each gun would need its own little function like that?

small topaz
austere sequoia
#

That will be fun! Thanks a lot โค๏ธ

small topaz
random minnow
#

any tutorial/guide to make a 3D objects?

#

for the "place item" option

sour island
#

Let people know what your pipedream idea for a mod was.

austere sequoia
grizzled fulcrum
#

What is the time field for TimedActions? I'd assume it's miliseconds but I am not so sure.

sour island
grizzled fulcrum
#

ty

austere sequoia
sour island
fading horizon
#

id like to ask everyone to be on the lookout for a modified version of my backpack flags mod that may appear on the workshop

#

somebody thinks they're "trolling" by releasing racist versions of my mod

#

here is a now deleted comment they also left on my profile

#

i'm not as active in the community anymore but I definitely don't want any of my mods associated with anything like this and would appreciate anyone elses assistance.

#

Or if anyone knows anything else I can do here, it would be appreciated.

bright fog
mellow frigate
fading horizon
mellow frigate
#

I also note: that same account is currently requesting PZ vanilla game support on my last mod..

hushed forge
#

hey huh

#

idk if i came to the right place to ask

#

but is it possible to script an item to be both Food and Drainable?

#

As in a food item that can be used as a drainable item in recipes?

vast orchid
hushed forge
#

hum

#

are there?

vast orchid
#

Wait a minute, most food items that are also ingredients are kinda like that, you can eat them whole, 1/2 or 1/4 and some part of their nutrition is used according to what is specified for each meal-type whenever it's used in cooking.

#

Can you give me an example to clarify what exactly you want to do?

mystic vessel
hushed forge
vast orchid
#

Do you mean just food recipes btw?

hushed forge
#

Yeah

#

It is meant to be like

#

Powdered milk

#

Eat it dry in a pinch

#

or mix it with water

#

I could get it into the game as a food item quite easily as it seems to be meant to

#

but i couldn't figure how to give it a drainable bar like, say, thread or towels

grizzled fulcrum
#

Maybe if this isn't possible you could make two items that look similar with same name for dry powder and powdered milk mixed with water

#

the powder+water will be a drainable and the powder itself will be a food?

hushed forge
#

I thought about i didn't want you to spend the whole bag in a single milk bottle y'know

#

And i dont think making like, individual itemf for each portion used would be the optimal way

vast orchid
#

Hmm, that may be possible, but I don't understand enough lua to help you with that.

hushed forge
#

that troublesome?

#

damn

vast orchid
#

Not that I'd know, but from reading through the files, using intermediate items is almost certainly going to be easier, if for no other reason than that you can use existing items, recipes etc. as a template.

#

Furthermore, I'm in need of assistance myself when it comes to the lua scripts.

#

I just can't get a recipe override to work at all.

hushed forge
#

oof

#

best of luck(and competent people because i aint lol)

vast orchid
#

Best of luck with your project too.

zenith igloo
#

I dont know if generic reporting works prob does. Never had such an issue

drifting ore
#

Queston, When it comes to the Scripts folder right, is it possable to add more folders in that directory? So it would go Scripts/Folder 1,Folder 2 and so fourth.

bright fog
#

It's even done by the base game

drifting ore
# bright fog Yes

ok cool, do i have to add anything to make that work or just make the folder and go nuts

nocturne pebble
#

Anyone know with the new update if switching to server side will make my server more laggy? I have about 40 people average daily and if it's gonna make server play laggier I wouldn't be happy about that

#

Talking about switching client actions to server side

lusty karma
#

Hey there, quick question, I want to edit the durability of weapons included in VFE Stalker. I found where to edit that (ConditionMax in the weapon .txt file), i just wanted to know, the changes will be applied to all weapons (even ones i already looted), or it will apply only to the new guns i find?

outer crypt
#

does anyone know if it is possible to add/change the CustomName and GroupName of a tile in Events.OnLoadedTileDefinitions.Add()? I have been able to change other properties of the tile but not these two, when attempted the tile changes to "Green Oven" every time. kinda funny actually...\

clear compass
#

does anyone have a good tuturial link since no one in this chat has the time to explain adding clothing and armor as mods. like making them

coarse sinew
outer crypt
visual island
#

looks fine in blendr ๐Ÿ˜ญ

outer crypt
#

I don't know much about the textures, but I did learn that if blender created a multilayer texture it won't work in PZ.

visual island
#

its like its still using the old 3d map on the exported model maybe?

#

texture is just a flat png made in photoshop

outer crypt
#

yeah, I found out that some 3d models use multiple flat files to make the full set of textures but PZ only uses one. Did not know this until I loaded the 3d model and some parts were missing. Looked similar to this issue you have in the photo. Evidently there is a way to force all the different texture layers into one flat that doesn't overlap, but it's beyond my abilities.

visual island
#

ill try copying to a blank doc

outer crypt
# visual island ill try copying to a blank doc

๐—ช๐—ฎ๐˜๐—ฐ๐—ต ๐˜๐—ต๐—ฒ ๐—ก๐—ฒ๐˜„ ๐—จ๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ๐—ฑ ๐—ง๐˜‚๐˜๐—ผ๐—ฟ๐—ถ๐—ฎ๐—น: โžก๏ธ https://youtu.be/eE7FedDW2AI

In this Blender tutorial, I will show you how to bake multiple materials to one texture map.

I forgot to mention in the tutorial: Before baking any texture maps that are not contributing to the base color, (Roughness, Metallic, Normal) You should set the image's color space to No...

โ–ถ Play video