#mod_development

1 messages · Page 1 of 1 (latest)

frosty falcon
#

It’s usually the opposite, provide something and people will look, don’t and they won’t

shadow geyser
#

I mean, I watch this channel solely to provide help where I can and to simultaneously learn what I can from others. I can't speak for others, but I'm not about to go out of my way to track down your mod just to be able to see it just to figure out whether or not I can help, and when I don't even know what your mod is and therefore have any interest in it.

sour island
#

If the car is vanishing even in SP it's probably triggering a failsafe if not causing it to rubberband away

#

Have you tried lowering that amount?

open abyss
#

i'll be back soon, when i'm back, will unhide the mod and link it, alright? (Sorry for late reply, i dove into a rabbit hole of the concept of converting trucks and busses into homes, and i'm honestly inspired. Would love to have such a home 😄 )

lyric cairn
#

Having a little issue here with item positions when they're dropped

#

My sword seems to not want to rotate on itself but rotates around a center, kind of like the moon around the earth

#

Anybody ever had this happen to them?

#

I'd like to forcefully move the mesh in blender so it goes to the correct location but then it won't sit right in the hands of the character

winter bolt
#

try changing the origin of the mesh maybe?

lyric cairn
#

Moving the origin seems to mess up the grip fo the weapon, and it also still helicopters around when I rotate in place mode

#

but thanks for the suggestion

winter bolt
#

oh that's strange

#

it might be due to the model script file then I think

lyric cairn
#

I've solved my problem, there's actually an ingame editor for managing item placements

#

now the sword still rotates SLIGHTLY strange but much much better

grim rose
#

i tried understanding this

ending up with this ```lua
function squished2(items, result, player)
player:getBodyDamage():setStress​(player:getBodyDamage():getStress() + 40);
player:getBodyDamage():setPanic​(player:getBodyDamage():getPanic() + 40);
end

somehow it doesn't work
shadow geyser
#

can't find your message anymore, but I think there might also be an issue with having 2 oncreates defined. I dont think you can do that. you could just call one of them from inside the other function

sour island
#

Taking a whack at making everything a weapon but not directly using scripts wish me luck

grim rose
#

something seems wrong with .lua file i made

#

with fuction squished 2

shadow geyser
#

setstress doesn't belong to there. set stress belongs to a stats object, while getbodydamage() gives you bodydamage object. you would need to find the correct function to give you the stats object

grim rose
#

oh okay, thanks

untold dew
#

Hello, I'm looking to see if anyone has a mod list recommended for MP bushcraft survival - farming, fishing, living off land.

autumn temple
#

@jagged ingot ya I still had issues getting the audio replacement to work so I just scrapped the whole thing lol

#

way out of my league on that one

willow estuary
#

The game engine is not designed for infinite weight items, and I'd recommend not using them.

grim rose
#

so i managed to fix it

#

i am getting current stress stat from game

#

as setting it as number

#
function squished2(items, result, player)
    local stats = player:getStats();
    local currentStress = stats:getStress();
    stats:setStress(currentStress + .15);
end```
open abyss
#

Back

open abyss
grim rose
sour island
#

Probably better off reading through the java to see if there's any hard limits

#

although I too like to break stuff

#

The game no longer registers "normal" items in debug

drifting ore
#

Iirc Nil functions the same as absolute 0 and in a lot of use cases makes it not apply

#

An issue is that an infinitely usable backpack will break the UI or saving

#

Since it'll be insanely large hashes

sour island
#

setting it to nil|null will most likely trigger failsafes

#

or break any math related to it

willow estuary
#

At this rate we might need to hardcode the game so infinite weight items/over capacity containers aren't possible and don't break saves etc. 😄

sour island
#

not to mention when the Java looks for an int/float type it will get null instead

grim rose
#

just do it cleaver way

#

just spamm those zeros 100000000000000000

sour island
#

He tried that and it breaks vehicles

#

Not sure why you don't just look at what god mode does and disable the burden of carrying shit

#

instead of hitting the items leverage points - just tap into onplayerupdate

open abyss
#

Maybe instead of limit (hardcode wise) the weight of items, instead just say that <any> container/inventory can only store 5000 different stacks of items max (the amount of same item would only count if multiple stacks are made) (Maybe 5000 stacks is to much, just an example) That would stop save corruption with inf-weight items, no?

#

So each stack, be it 50, 1 or 47, that would count 3 towards the 5k hard limit...

sour island
#

why?

open abyss
#

If to many items breaks saves, this method would counter that

#

a soft-fix if you will

#

sure the game have lots of items, but i doubt people will hit 5000 different stacks in one container anyways, at least not in normal play

sour island
#

But the only way to get that many items would be to allow for negative weight items to work

#

which would take time to debug edge cases that shouldn't even occur

#

100% weight reduction might work tho

open abyss
#

even if it's 99.99%, it would still be one heck of a great backpack XD

wraith root
#

Overweight containers break saves when programming them, or when you store items in game and overload a container?

#

If the latter, that's a bit alarming as it's very easy to go over a container's limit

willow estuary
#

Yes, that's why I recommend people don't use over capacity containers.
They also seem to mess up vehicle physics.

carmine vale
#

anyone have a good modlist they could share with me i cant really compile a good list of mods without getting errors

open abyss
#

again, a limit to stacks would mitigate this a great deal. Weight in static (non-moving) containers should not really be a problem. if it is. something is messed up with the code overall...

sour island
#

the game doesn't really have stacks

#

that's all visual

#

the limit is done with weight

open abyss
sour island
#

I've only ever heard of overweight containers losing items from vehicles - and that was a while ago

#

usually because the trunk item took damage and lowered it's capacity but the items inside stayed

open abyss
#

I can understand you'd want a limit to players/vehicles/backpacks inventories, as they are physically dynamic, but for a box or closet, a limit to how many items it can store, rather then by weight would cut most issues down (i assume)

sour island
#

kind of arbitrary tbh

#

the issues of lost items also occurred before they polished up the save system

open abyss
#

eh... i would say i'm among the very few players that not only hoards, but use mods that makes my game appear more like a semi-creative mode. So storage becomes important 😛

sour island
#

idk if @willow estuary's experiences are recent or not

#

from a save integrity perspective, hard limiting based on type count or a weight limit is arbitrary - the limit is whatever doesn't break the game

#

and again - not likely to break

open abyss
drifting ore
#

Save files can corrupt easily if the storage data is gigantic

#

I imagine the inventories are saved using a hash

#

Or atleast, I'd hope so because storing individual data points in a table seems extremely heavy on save file size

sour island
#

they parse specific data that is mutable afaik

#

the issue of negative weighted items only becomes a problem for vehicles because it ties weight to physics

drifting ore
#

Inb4 we find out they use Sass and its the 90s again

open abyss
#

Gonna update my -100000 inventory item to only -100 (if people need more "space" they can just make more. This should NOT cause vehicles to go flying into the universe each time such an item is placed inside... 😛

sour island
#

idk specifics, but the last time they changed save formats dropped file size by alot

sour island
#

Then you can place them inside the cars eitherway

drifting ore
#

Correction not Sass

open abyss
#

I will, but gonna give the -100 a try first, just to see how the vehicles behave...

drifting ore
#

Sass is for CSS

#

My webdev brain is broken

open abyss
#

Chuck, you good with modding?

#

I ask, cause i REALLY wish to make my pills work correctly x.x

#

right now, they are a food item. and with food items, you can't eat all you want. Eventually, your char's belly is stuffed.

#

but Medicine in the game works differently, you can eat all you like.

drifting ore
#

Wouldn't a solution to the backpack issue be applying a trait when its worn

#

Its kinda ass backwards

#

But it would work, no?

open abyss
#

Most of my mod is learned from looking at other mods and base game's code. However. Medicine confuses the ever loving f*** outta me

#

The weight issue most likely will be solved once i replace my -100 weight item with a spiffo backpack with 100% weight reduction 😉

#

Once i got the medicine done, i can consider my mod done.

sour island
#

Pretty sure medicine is it's own type of thing

#

medicine in large is very rigid / limited scope

#

probably overdue for an overhaul

open abyss
#

maybe, yeah...

#

afk-ish, gonna go experiment with the -100 weight feature

#

used to be -100000 which clearly is to much of a reduction, lol

sour island
#
public void JustTookPill(InventoryItem var1) {
      if ("PillsBeta".equals(var1.getType())) {
         if (this.getParentChar() != null && this.getParentChar().getStats().Drunkenness > 10.0F) {
            this.getParentChar().BetaBlockers(0.15F);
         } else {
            this.getParentChar().BetaBlockers(0.3F);
         }

         var1.Use();
      } else if ("PillsAntiDep".equals(var1.getType())) {
         if (this.getParentChar() != null && this.getParentChar().getStats().Drunkenness > 10.0F) {
            this.getParentChar().BetaAntiDepress(0.15F);
         } else {
            this.getParentChar().BetaAntiDepress(0.3F);
         }

         var1.Use();
      } else if ("PillsSleepingTablets".equals(var1.getType())) {
         var1.Use();
         this.getParentChar().SleepingTablet(0.1F);
         if (this.getParentChar() instanceof IsoPlayer) {
            ((IsoPlayer)this.getParentChar()).setSleepingPillsTaken(((IsoPlayer)this.getParentChar()).getSleepingPillsTaken() + 1);
         }
      } else if ("Pills".equals(var1.getType())) {
         var1.Use();
         if (this.getParentChar() != null && this.getParentChar().getStats().Drunkenness > 10.0F) {
            this.getParentChar().PainMeds(0.15F);
         } else {
            this.getParentChar().PainMeds(0.45F);
         }
      } else if ("PillsVitamins".equals(var1.getType())) {
         var1.Use();
         Stats var10000;
         if (this.getParentChar() != null && this.getParentChar().getStats().Drunkenness > 10.0F) {
            var10000 = this.getParentChar().getStats();
            var10000.fatigue += var1.getFatigueChange() / 2.0F;
         } else {
            var10000 = this.getParentChar().getStats();
            var10000.fatigue += var1.getFatigueChange();
         }
      }

   }
#

looks to be entirely java side

#

hopefully the wonderful work being done on liquids gets done on medicines/blood

#

medicine could probably be handled entirely as a food item tbh

open abyss
#
    {
        Weight                =    0,
        StressChange        =    -200,
        UnhappyChange        =    -200,
        BoredomChange        =    -200,
        DisplayName            =    Funny Pills,
        Icon                =    AGCMFunnyPills,
        Tooltip             =   Tooltip_AGCMFunnyPills,
        StaticModel         =       PillBottle,
        WorldStaticModel    =       Vitamins_Ground,
        UseDelta            =        0.05,
        Type                =        Drainable,
        DisplayCategory     =       FirstAid,
        UseWhileEquipped    =        FALSE,
    }```
My "funny pills"
full socket
#

So how do you peak inside the java source, are you using a decompiler ?

sour island
#

you can open the files with windows - but for better searching I decompiled it yeah

full socket
#

I want to see how the inventory UI is put together so I can add a extra tab to it. Its beginning to annoy me I cant sort by weight.

sour island
#

that's done in Lua - so no need to decompile

full socket
#

Not had a chance to learn PZ modding, this is just me getting into it

sour island
#

but I'd recommend getting an IDE so you're not just browsing files on a hunch

#

I use IntelliJ

full socket
#

Yeah got the community version of IDEA.

#

Which lua plugin do you use? Using EmmyLua but not sure if its the best

sour island
#

That's what I use

autumn temple
#

oops

#

did that wrong my b

sour island
autumn temple
#

so I tried to make a custom car skin, and it says my car just does not exist???

#
    
    {
        mesh = vehicles/Vehicles_LuxuryCar,
        shader = vehicle_multiuv,
        invertX = FALSE,
        scale = 0.01,
    }

    vehicle MadokaItasha

    {
        mechanicType = 3,
        offRoadEfficiency = 0.8,
        engineRepairLevel = 6,
        playerDamageProtection = 0.8,
        engineRPMType = firebird,

        model
        {
            file = Vehicles_LuxuryCar,
            scale = 1.8200,
            offset = 0.0000 0.2473 0.0000,
        }

        spawnOffsetY = 0.12999995,

        skin
        {
            texture = Vehicles/vehicle_MadokaMagica,
        }

        textureMask = Vehicles/vehicle_MadokaMagica_mask,
        textureLights = Vehicles/vehicle_MadokaMagica_lights,
        textureDamage1Overlay = Vehicles/Veh_Blood_Mask,
        textureDamage2Overlay = Vehicles/Veh_Blood_Hvy,
        textureDamage1Shell = Vehicles/Veh_Damage1,
        textureDamage2Shell = Vehicles/Veh_Damage2,
        textureRust = Vehicles/Veh_Rust,```
#

this is just the part of code I changed from the file ^

full socket
sour island
#

This will decompile the java and annotate it all for Lua

autumn temple
#

and I get this error when trying to look at my car ingame
WARN : General , 1658504891771> VehicleType.initNormal> vehicle type "Base.MadokaItasha" doesn't exist

sour island
#

also allowing you to use ctrlshiftF and ctrlN to find phrases or filenames throughout

sour island
full socket
#

Perfect thanks 🙂

sour island
#

You'd probably want to look in InventoryPane or InventoryPage

full socket
#
self.typeHeader = ISResizableButton:new(self.column3-1, 0, self.column4 - self.column3 + 1, self.headerHgt, getText("IGUI_invpanel_Category"), self, ISInventoryPane.sortByType);
self.typeHeader.borderColor.a = 0.2;
self.typeHeader.anchorRight = true;
self.typeHeader.minimumWidth = 100
self.typeHeader.resizeLeft = true
self.typeHeader.onresize = { ISInventoryPane.onResizeColumn, self, self.typeHeader }
self.typeHeader:initialise();
self:addChild(self.typeHeader);
sour island
#

hmm might be easy enough to do - seems like it would auto adjust sizes

#

I hate messing with UI

full socket
#

Nope it looks like its manually rendered, no generic definitions.

sour island
#

self.typeHeader.minimumWidth = 100 seems promising

full socket
#

Cant just slap a new header on this with text, gotta modify the rendering code sad

sour island
#

oh well yeah

#

unfortunately alot of the UI stuff could do with alot more partitioning/APIs

#

you're probably going to have to overwrite the entire function

#

unless there's a .addHeader lol

full socket
#

I was hoping for ```cs
var columnDef = new ColumnDefinition()
columnDef.Render = ...
panel.Columns.Add(columnDef)

#

Better roll up those sleeves. So how should I go about this as it seems I need to replace a function, is there a code cave method to do this or will I need to overwrite the file?

autumn temple
sour island
autumn temple
#

then I have this for the mechanical overlay lua

sour island
#

Unless UI classes are more finicky than I know - this should safely overwrite the function

full socket
#

function ISInventoryPane:renderdetails(doDragged) is where we render the item contents
local itemName = item:getName(); line 2327 onwards is the item name
if item:getJobDelta() > 0 then line 2369 onwards is the category name
Not sure what a job delta is.

#

I will have to override both createChildren and renderdetails

#

renderdetails is about 400 lines. Been awhile since I had to dig deep into code like this, 😄

sour island
#

render details would list weight values I assume?

full socket
#

Oh crap your right. I'll just have to override it and start putting dummy text into it to see if it's correct.

#

The only issue is this will also kill support for other mods if they screw with this file.

sour island
#
require "ISUI/ISInventoryPane"

local ISInventoryPane_createChildren = ISInventoryPane.createChildren
function ISInventoryPane:createChildren()
    ---do stuff before
    ISInventoryPane_createChildren(self)
    ---do stuff after

    self.weightHeader = ISResizableButton:new(self.column3-1, 0, self.column4 - self.column3 + 1, self.headerHgt, "weight", self, ISInventoryPane.sortByType);
    self.weightHeader.borderColor.a = 0.2;
    self.weightHeader.anchorRight = true;
    self.weightHeader.minimumWidth = 100
    self.weightHeader.resizeLeft = true
    self.weightHeader.onresize = { ISInventoryPane.onResizeColumn, self, self.weightHeader }
    self.weightHeader:initialise();
    self:addChild(self.weightHeader);
end```
#

it's super broken due to the fact you have two columns trying to anchor right

full socket
#

The widths are all calculated at time of item render. It doesn't use the button as a reference it seems

#

Is there anyway to reload Lua at runtime or will I have to restart each time ?

sour island
#

changed the lua since I didn't notice the object is being referenced - now it's weightHeader

#

I think -debug in launch options adds a reloadingfunction

#

if not Aiteron wrote AUD which has it

full socket
#

Your a legend, thanks 😄

sour island
#

Don't know if that will help with UI as it's initilized

#

np

#

and yeah seems like you may have to hard overwrite render details

#

or you could leave weight details off - as you can now sort by weight

#

🤷‍♂️

full socket
#

I'll just override it, make it a proof of concept.

sour island
#
ISInventoryPane:sortByWeight(_isAscending)
#

wth

full socket
#

Discord crashes ofc when I make a spelling mistake.

sour island
#

the vanilla game has weight sorting

#

just unused afaik

full socket
#

I want to add 2 columns, W and SW just to filter by weight and stack weight.

sour island
#

well the first one is basically already done if you can figure out how to anchor center

delicate rock
#

hello! havent even start playing the game yet, but would you recommend any mods that must have to improve the game?

#

or just play without mods first

sour island
#

lmao

#

although displaying it would still be a thing you can do

#

Honestly never use those buttons - had no clue

open abyss
#

Okay, so my Backpack works flawlessly, However... It's inventory icon is a questionmark

#

I did make a custom inventory icon, but apparently i messed up?

#

i'll keep working on the backpack...

#

but it seems to work just fine

sour island
#

you have to use a specific format for item icons

#

filename = Item_x script Icon = x

#

generating normal items to weapons works great but then I have no way to formulate how to derive sounds that isn't as much work as hand tailoring them

#

going to just consolidate this as testUnit for my old vanilla weapons mod

open abyss
#
    {
        DisplayCategory = Bag,
        WeightReduction    = 100,
        Weight            = 1,
        Type            = Container,
        Capacity        = 100000,
        DisplayName        = Strange Back Bag,
        IconsForTexture = AGCMBackpack,
        CanBeEquipped   = Back,
        OpenSound       = OpenBag,
        CloseSound      = CloseBag,
        PutInSound      = PutItemInBag,
        ClothingItem    = Bag_SchoolBag,
        BloodLocation   = Bag,
        RunSpeedModifier    = 1.25,
        AttachmentReplacement   = Bag,
        ReplaceInSecondHand     = Bag_Schoolbag_LHand holdingbagleft,
        ReplaceInPrimaryHand    = Bag_Schoolbag_RHand holdingbagright,
        WorldStaticModel        = SchoolBag_Ground,
    }```My backpack
No clue why inventory icon won't show
#

it uses same code as base game, except ofc for the reduction and such...
The item works, but not it's icon

sour island
#

you dont have Icon

open abyss
#

x.x

#

... i do now 😉

sour island
#

change IconsForTexture to Icon

open abyss
#

done

#

Okay, so now i only have one problem left: The dreaded Medicine.

#

want to convert this: item AGCMFunnyPills { Weight = 0, StressChange = -200, UnhappyChange = -200, BoredomChange = -200, DisplayName = Funny Pills, Icon = AGCMFunnyPills, Tooltip = Tooltip_AGCMFunnyPills, StaticModel = PillBottle, WorldStaticModel = Vitamins_Ground, UseDelta = 0.05, Type = Drainable, DisplayCategory = FirstAid, UseWhileEquipped = FALSE, } into a medicine item, and i havent had any luck trying to make a custom item thus far...

#

game treats it only as an "object"

#

last question (currently)
How many storage containers can you wear? (I know of the backpack/duffelbag)

#

nvm, the wiki answered my question... forgot about the wiki

sour island
#

there's mods that add alot more bags

#

there isn't really a limit persay

open abyss
#

well, as far as i see, there is only 3... I mean slots...
Fanny pack front & back, and a backpack or similar..
3 extra storage containers on the player beyond their standard inventory

#

so yeah, a couple more items to add to my mod 😛

#

actually, most of these scripts are in .txt format, for some reason.
Are they actually just lua?
I'm just wondering how to make comments...

thorn cipher
#

Hey all

#

Trying to get two items to be given when I open a box

#

but I only get the first one (twinkies)

#

and not the TWBOpened (twinkies box open)

#

Any ideas? Thanks

open abyss
viral notch
#

ok im out of logic thinking my brain out from window.....
What The Hell just happen

viral notch
thorn cipher
open abyss
#

what the hoot?

#

are you tking random damage too?

viral notch
#

no just random colors in random places ....

#

and there nothing works expect shell texture ...

open abyss
#

well, thanks for making me chuckle due to that random driving, on a more serious note, i honestly have no clue as to what goes on... i would hazard a guess and claim that there is a bug in the texture handling? maybe shadows breaking??

#

okay, lol what the hoot? the ending... looks like some kind of overlay texture being applied, and it just goes bananas

#

back in old NES 2D games, you could get to these weird out of bounds areas where everything goes weird. Looks like you got a car that partially goes out of bounds with it's own textures 😄

#

isen't that texture layer meant for shine effect for cars?

viral notch
#

idk

shadow geyser
open abyss
#

damn

#

Alright, thanks

open abyss
#

double dash, or slash or???

viral notch
#

nvm

open abyss
#

no i meant, i like to make comments in my files to seperate sections and such

#

As silly as some might think it, i just like to do it...

viral notch
#

--

#

-- some random comment

open abyss
#

-- Monkey see, monkey do 😉

#

thanks

viral notch
#

lua is too much simply you need to every line make -- for comment due there are no comment block ...

#
-- aiming while moving, gain nimble xp (move faster in aiming mode)
    if player:isAiming() and xpUpdate.randXp() then
        xp:AddXP(Perks.Nimble, 1);
    end
    -- if you're walking with a lot of stuff, you may gain in Strength
    -- but who know how it will work in game...
    if player:getInventoryWeight() > player:getMaxWeight() * 0.5 then
        if xpUpdate.randXp() then
            xp:AddXP(Perks.Strength, 2);
        end
    end
open abyss
#

on another note. In the DebugLog file, i get this:
[22-07-22 19:59:48.939] WARN : Recipe , 1658512788939> RecipeManager.resolveItemModuleDotType> WARNING: module "AGCMCheatItemsRecipes" may have forgot to import module Base.
If i ask it to import, the game darn nearly dies... sooo should i just ignore? it's not exactly an error, and the mod works regardless...

shadow geyser
# thorn cipher

you should use an Oncreate to give the other item. the oncreate would just reference a function that is run, and gives the player the item.

viral notch
drifting stump
viral notch
open abyss
#

gotcha, ignor i shall

viral notch
#

my knowledge is from 2008 xD

shadow geyser
open abyss
#

use ` not '

#

this or this

#

fdsffsd

viral notch
#

in txt you don't have something like comment

#

all is plain text

open abyss
#

it's design layout loosk very XML or LUA or something

#

might be .txt, but formatting looks very... familar

shadow geyser
#

pretty sure an item definition in zomboid will get messed up, if you have random text in there that will mess up the processing

shadow geyser
#

even the lua is just plain text as well

viral notch
#

why not use python xD

#

and all will be more complicated

full ocean
#

Any evil dead fans in the modding community?

open abyss
#

okay, ran into a weird bug with my new fannybags...
If i double click them, they appear as if being worn, but just appear, but if i rightclikc them i can tell it to wear either on front or back as per normal... anyone got a clue?

#

want me to post the code for the items?
I guess i messed something up...

#

woah... okay, yeah, i didn't notice, but it tosses errors at me when i just double click the item

open abyss
#

No one can help me get my Fannypacks to work?

shadow geyser
#

you gotta actually post stuff if you want help

#

like the fanny pack. if you want help to check your item, post it here so people can actually see it. and if you are getting an error. just post the error you are getting

open abyss
#

alrighty

#
    {
        DisplayCategory     = Bag,
        WeightReduction        =    100,
        ClothingItemExtra       = AGCMFannyPackBack,
        ClothingItemExtraOption = FannyPack_WearBack,
        clothingExtraSubmenu    = FannyPack_WearFront,
        Weight                =    1,
        Type            =    Container,
        Capacity    =    100000,
        DisplayName    =    Belly Pack (Front),
        Icon        =    AGCMFannyPackF,
        OpenSound   =   OpenBag,
        CloseSound  =   CloseBag,
        PutInSound  =   PutItemInBag,
        BodyLocation    = FannyPackFront,
        ClothingItem    = Bag_FannyPackFront,
        CanBeEquipped       = FannyPackFront,
        WorldStaticModel    = FannyPack_Ground,
    }
    
    item AGCMFannyPackBack
    {
        DisplayCategory     = Bag,
        WeightReduction     =    100,
        ClothingItemExtra       = AGCMFannyPackFront,
        ClothingItemExtraOption = FannyPack_WearFront,
        clothingExtraSubmenu    = FannyPack_WearBack,
        Weight              =    1,
        Type            =    Container,
        Capacity    =    100000,
        DisplayName    =    Butt Pack (Back),
        Icon        =    AGCMFannyPackB,
        OpenSound   =   OpenBag,
        CloseSound  =   CloseBag,
        PutInSound  =   PutItemInBag,
        BodyLocation    = FannyPackBack,
        ClothingItem    = Bag_FannyPackBack,
        CanBeEquipped       = FannyPackBack,
        WorldStaticModel    = FannyPack_Ground,
    }```
The items in question

the error:
```-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 20:39:15.419] ERROR: General     , 1658515155419> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getVisual of non-table: null at KahluaThread.tableget line:1689..
[22-07-22 20:39:15.419] ERROR: General     , 1658515155419> DebugLogStream.printException> Stack trace:.
[22-07-22 20:39:15.422] LOG  : General     , 1658515155422> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 20:39:15.424] LOG  : General     , 1658515155424> bugged action, cleared queue     ISClothingExtraAction.
[22-07-22 20:45:25.001] LOG  : General     , 1658515525001> -------------------------------------------------------------
attempted index: getVisual of non-table: null.
[22-07-22 20:45:25.001] LOG  : General     , 1658515525001> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 20:45:25.002] ERROR: General     , 1658515525002> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getVisual of non-table: null at KahluaThread.tableget line:1689..
[22-07-22 20:45:25.002] ERROR: General     , 1658515525002> DebugLogStream.printException> Stack trace:.
[22-07-22 20:45:25.005] LOG  : General     , 1658515525005> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 20:45:25.007] LOG  : General     , 1658515525007> bugged action, cleared queue     ISClothingExtraAction.

I dunno what to do... Confused...

#

the error happens when i double click, like you normally would to quickly wear an item.
And then the item vanishes

#

deleted from inventory and world

shadow geyser
open abyss
#

weird, it's fine with my backpack... but sure, why not

#
attempted index: getVisual of non-table: null.
[22-07-22 21:14:31.336] LOG  : General     , 1658517271336> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 21:14:31.336] ERROR: General     , 1658517271336> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getVisual of non-table: null at KahluaThread.tableget line:1689..
[22-07-22 21:14:31.337] ERROR: General     , 1658517271337> DebugLogStream.printException> Stack trace:.
[22-07-22 21:14:31.340] LOG  : General     , 1658517271340> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createItem -- file: ISClothingExtraAction.lua line # 75
function: perform -- file: ISClothingExtraAction.lua line # 52.
[22-07-22 21:14:31.341] LOG  : General     , 1658517271341> bugged action, cleared queue     ISClothingExtraAction.```Still the same error...
Changed the weight down to just 1, so it's like default Fannypacks...
charred hemlock
#

so can craftable furniture like lets say cabinets, be given the effects of refrigerators? so you can plug them in and use them with a generator? asking this because im looking to see if i cant help robot add refrigerated and icebox cellars to hydrocraft continued

#

and like a big firepit for large food cooking that has the same effects from a charcoal bbq

thin hornet
#

try adding the module name in

ClothingItemExtra       = MyMod.AGCMFannyPackFront,
#

not sure but could be that

open abyss
#

Not sure how... the import thing?

sand tinsel
#

Anyone know if the meth mod works or if it is buggy

thin hornet
#
 item AGCMFannyPackFront
    {
        DisplayCategory     = Bag,
        WeightReduction        =    100,
        ClothingItemExtra       = AGCMFannyPackBack,   <------ here   like      MyModuleName.AGCMFannyPackBack
        ClothingItemExtraOption = FannyPack_WearBack,
        clothingExtraSubmenu    = FannyPack_WearFront,
        Weight                =    1,
        Type            =    Container,
        Capacity    =    100000,
        DisplayName    =    Belly Pack (Front),
        Icon        =    AGCMFannyPackF,
        OpenSound   =   OpenBag,
        CloseSound  =   CloseBag,
        PutInSound  =   PutItemInBag,
        BodyLocation    = FannyPackFront,
        ClothingItem    = Bag_FannyPackFront,
        CanBeEquipped       = FannyPackFront,
        WorldStaticModel    = FannyPack_Ground,
    }
#

The same module name used at the top of that file

jagged ingot
#

I should get back to making that script thingy. haha

#

I can see that technicality be confusing for many people.

thin hornet
#

Idk if that would prevent that kind of mistake tho

#

cause Base.items doesnt need the module name at the start but modded items neeeds it

jagged ingot
#

Oh if you write your UI code to, you can yeah.

#

Force it & export it. Make it convenient.

thin hornet
#

cause ItemFactory.createItem will default to Base

jagged ingot
#

Sounds like a short-term benefit but a possible issue down the road with human error.

thin hornet
#

its not that bad, in fact if you make a mod you should mostly specify your module name

#

since you could have item with the same name but different module name

jagged ingot
#

(I'm on the side of explicitly typing the module)

thin hornet
#

like Base.Axe and MyMod.Axe

#

createitem("Axe") = base

jagged ingot
#

Ah. That could be built into a command like how Minecraft does it.

#

minecraft:stone

#

/give player stone

thin hornet
#

well i think it must have been added later for mod support

#

anyhow thats just how it is

thin hornet
#

😄

sour island
#

I'm messing with vanilla weapons and tweaking vanilla scripts with scriptmanager - does that stuff have to be in shared?

#

locking out my MP server

jagged ingot
#

You can check if you're executing code from the shared directory via isClient() and isServer() so I don't see why trying that would hurt.

sour island
#

it's an old mod of mine - runs fine in client/

jagged ingot
#

IIRC the server runs and calls ScriptManager.

sour island
#

hm

#

I'll test it out

#

im guessing the clients and servers items don't match and it throws a fit

jagged ingot
thin hornet
thorn cipher
#

Just released this! Thanks @thin hornet and @grim rose for your help and guidance

thin hornet
#

Twinkies!

daring zinc
#

Hey, how can I disable a vanilla trait?

thin hornet
daring zinc
#

Not too sure if setRemoveInMP is a reasonable way to go around it though, feels hacky if there's a better way to actually remove it from the list

thin hornet
#

In your server do you use any other mod that effect traits?

daring zinc
#

Nope

#

Are you aiming for TraitFactory.Reset()?

thin hornet
#

Also im going to show you but i suggest you make your mod unlisted so that people dont use it cause that will most likely break with other trait mods lol

daring zinc
#

Sure :P

thin hornet
#

create a file in media\lua\shared\NPCs\CustomMainCreationMethods.lua
add this to it:

Events.OnGameBoot.Remove(BaseGameCharacterDetails.DoTraits);
BaseGameCharacterDetails.DoTraits = function()
  -- addTrait here

  -- setMutualExclusive here

  -- keep this at the end
  TraitFactory.sortList();
  local traitList = TraitFactory.getTraits()
  for i=1,traitList:size() do
    local trait = traitList:get(i-1)
    BaseGameCharacterDetails.SetTraitDescription(trait)
  end
end
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoTraits);

Look at \media\lua\shared\NPCs\MainCreationMethods.lua to take what you want.

#

I am not responsible if this break your game 😛

daring zinc
#

No problem, thanks :D

thin hornet
#

nah but youll get error if something is wrong and you can fix it

daring zinc
#

Yeah just wasn't sure how the list of traits was being populated in the first place

#

Thanks dude :D

thin hornet
#

If dont know if you have to adjust the professions too

daring zinc
#

Makes me wonder though, since I see ZombiesZoneDefinition.lua over there - is zombie spawning managed through Lua?

thin hornet
#

definition yeah

autumn temple
charred hemlock
#

anybody here know how to copy the abilities of one item in code to another?

#

such as an ice box, for a powered freeze cellar, where it has to be plugged into the generator, and has the ability to freeze things in it

#

the idea being both the icebox and the cellar are furniture you craft

drifting ore
jagged ingot
drifting ore
jagged ingot
#

Oh ok

drifting ore
# jagged ingot Oh ok

I'm not saying the entire music list because is a long description but if you wanna i can send it xd

jagged ingot
#

Oh no it's fine. I was simply curious.

#

🙂

drifting ore
#

Like BF 2142 Outfits

jagged ingot
#

All good. It's good to start with less complex mods.

noble pumice
#

How would I write it to add 2 items to the "ReplaceOnUse" Line?

#

I've tried ReplaceOnUse = Item1;Item2,

#

Dont seem to work though

sour island
#

ReplaceOnUse is a 1:1 afaik

#

You'd want to look at any onuse Lua calls instead of you want multiple items

noble pumice
#

Right so i'm hella new to modding just tryna make a couple items for my server what does that mean in english lmao?

shadow flower
#

Does anyone have any expertise in localization, I'm trying to put in french and its not working at all.
this is one of the files i have for my mod french in this case.
I have Russian, Spanish, and English working fine with the exact same layout, but french just seems to hate me

(ignore the missing characters, thats just because i don't have the french language pack installed)

shadow flower
#

where do you set it to that encoding?

thin hornet
#

what text editor are you using

shadow flower
#

ms code

#

but I have notepad++ in my vm

thin hornet
#

otherwise Shift+Control+P and type encoding

#

you can also set the default encoding in your editor settings

shadow flower
#

Would that work with polish and german as wwell?

thin hornet
#

i do not know exactly

shadow flower
#

no luck

thin hornet
#

even after chaning the encoding youll have to retype the text correctly

shadow flower
#

ah okay i'll give that a try, thanks

#

apparently copying the text still has a broken format

thin hornet
shadow flower
#

I know i had this issue with russian, but it gave unreadable text

#

it didn't give english like it is now

shadow flower
#

ahh, im dumb

#

I forgot to unsubscribe from my workshop item lol

opaque ocean
#

So... based on user-experience, it's pretty clear there's some kind of cap, or soft cap, to how many zombies are allowed to be active on a server. Once too many zombies gather in one place some of them "phase out", only to pop back into existence once the area calms down a bit resource-wise.

This happens on any server seemingly, seen it on 4gb ded-ram servers, and seen it on a 64gb server multiple times.

Anyone happen to have poked around about this issue/limitation before to see if there's a way to change when this starts happening server-side?

even just pointing towards where this is handled in the server code would be a big help!

shadow geyser
opaque ocean
#

@shadow geyser also, while you're here, any word on fixing Hydro's irrigation system? had a lot of people complaining on the server that they just straight up don't work.

#

that or a server-function bypass for the infinite log pile, since .71 broke it so it doesn't let players change weight values since that's handled client side as is.

shadow geyser
#

huh, didn't know about the log pile thing. will take a look. and not yet on the irrigation thing. lifes been busy

opaque ocean
# shadow geyser huh, didn't know about the log pile thing. will take a look. and not yet on the ...

all good, just asking out of curiosity since one of our players brought irrigation up again today.

basically the infinite log pile's lua is all in the client folder from what I saw. .71 removed a lot of client permissions on servers, so it does give logs to players and players can craft them... but they can't change weight values on it or some other stuff (prob doesn't let them remove the item at 0 weight either), so as it is... it is literally an "infinite" log pile.

#

issue won't be repeatable on an admin/debug mode account if you're gonna test it, since those bypass .71 client permission restrictions on servers

#

if you want an example of a bypass, there's a vehicle dismantling mod we use that has a bypass mod on the workshop, essentially just names a function in the server lua folder and uses that function on the client lua rather than the base-game remove function.

#

might have had a line about letting clients use the function too, been a while since I looked at it.

shadow geyser
open abyss
#

Okay, finally back, and i lost track of what i had to do yesterday.
Something about Importing the mod or what not, because my custom fannypacks apparently don't create the correct object or what ever...

I'm not sure how to do this import module thing, i'd love to know tho, so that my mods will work right.

shadow geyser
#

from what I remember, someone was suggesting to you to provide the full path for the item in the clothingItemExtra. you can infer it from the file, but the easiest way to confirm it is probably ingame. in the debug menu. you should be able to get the full name of the item which will be something.youritem

bleak grotto
#

Hello there

I want to automatically publish the number of zombies killed by the time in the game on discord.

How can I do that

open abyss
open abyss
open abyss
#

... um... Mooo?

bleak grotto
#

?

#

There is a log where it writes the perk information. It also says how long it lived in this log file.

I think you can get information from this file. It doesn't just say how many zombies were killed.

midnight mica
#

anyone know how to get english translation from a diff language client? my perk log is a bit unreadable lol
[22-07-22 06:41:37.475] [Avax][6084x5310x1] gained Skill** [烹飪][5].**
[22-07-22 08:45:02.406] [Avax][7319x6488] gained Skill [木工][5].
[22-07-22 09:13:46.234] [Snowman][7927x8747] gained Skill [Mechanics][6].

I am using the Perkfactory.Perk:getName() function

winter bolt
#

apparently theres an unused version of the padded jacket texture? the second image is the one that's actually used

craggy furnace
#

there is more than just that one

winter bolt
#

yeah i've noticed a lot of the old textures that were in preview stuff from years ago but this one looks more recent

#

it uses the current artstyle and is in the same folder as the current jacket textures

harsh flame
#

Any way to stop big splotches of dirt appearing on your character even at just 1 dirtiness? Would it be possible to only start showing the grime texture after a certain threshold?

fiery pecan
#

oh my

#

I have narrowed my STR issue to one thing: Sending the updated vehicle to the client. I'm not sure how I'd do that. Any ideas on what I'd use to transmit the updated vehicle?

autumn sparrow
#

This is a really dumb question: is there a way to change which clothes a new character on a server spawns with?

sour island
thin hornet
sour island
#
local VanillaWeaponsExpanded = {

    ["Base.Plunger"] = {
        ["HitFloorSound"] = "PlungerPop",
        ["SwingAnim"] = "Stab",
    },
#
local function expandWeapons()
    local SM = getScriptManager()
    local allItems = SM:getAllItems()

    local expandedWeaponsText
    local leftOverNormalsText

    for i=0, allItems:size()-1 do
        ---@type Item
        local itemScript = allItems:get(i)
        local iModuleDotType = itemScript:getFullName() -- module.Type

        local expandedWeaponInfo = VanillaWeaponsExpanded[iModuleDotType]

        if expandedWeaponInfo then
            for param,data in pairs(expandedWeaponInfo) do
                itemScript:DoParam(param.." = "..data)
            end
            expandedWeaponsText = expandedWeaponsText or "   Applied On:\n"
            expandedWeaponsText = expandedWeaponsText.."    "..itemScript:getFullName()..", \n"
        else
            if tostring(itemScript:getType()) == "Normal" then
                leftOverNormalsText = leftOverNormalsText or "   Normal Types Remaining:\n"
                leftOverNormalsText = leftOverNormalsText.."    "..itemScript:getFullName()..", \n"
            end
        end
    end

    if getDebug() then
        local debugText = "Vanilla Weapons Expanded:"
        if expandedWeaponsText then debugText = debugText..expandedWeaponsText end
        if leftOverNormalsText then debugText = debugText..leftOverNormalsText end
        print(debugText)
    end
end
expandWeapons()
#

When put in client/server the game can't host - just terminates with no errors.

#

Works as expected in shared tho - and always works in SP

thin hornet
#

ah okay you are editing script item

sour island
#

Refactoring an old mod that makes more items weapons, yeah

#

Just wanted to update the solution, in case someone ctrl+f's "scriptmanager

thin hornet
#

if i remember item tweaker is in shared

#

cause how could it work in mp otherwise

sour island
#

The old version of this mod actually used item tweaker - probably should have checked lol

thin hornet
#

always though its weird cause clients loads all 3 directory client/server & shared.

#

but server never loads clients which is logical

fiery pecan
#

oh my

thin hornet
#

for client to load server directory is understandable for single player

sour island
#

I figured server would be the ideal place but it might be triggering some anticheat

thin hornet
#

my cat robbed my desktop chair so i need a brake

sour island
#

hmmm

thin hornet
#

Hmm

#

Maybe clients are loaded on the server too ... not quite sure about that one tho.

#

ill have to mess around with prints and see what happens

sour island
#

he runs the main core function onboot

#

that may be the difference

#

Honestly, I would have used itemtweaker but I disliked the format of using a function for each param

#

probably could just make a wrapper that pulls my table 🤔

thin hornet
#

no point in doing that if your script works.

#

Item tweak is just a wrapper for doparam in the end

sour island
#

fair/true

#

I also wanted to print what items where changed and what's left over - keeps me on track lol

thin hornet
#

Neat

sour island
#

I could download a bunch of mods and get their item types this way too

thin hornet
#

Im messing in unity until stable is updated then im going into an update frenzy

#

will sync all my updates in the same minute.

sour island
#

that'll be fun for the steam comments

thin hornet
#

Im thinking to eventually set that git action from community api to update each of my mods

fiery pecan
#

so uhh, the 2 masters of MP code. I have a question for ya?

sour island
#

Are you going to auto auth the 2fa?

thin hornet
#

Ill have to check that out

sour island
fiery pecan
#

I've got code that sends a client command, and the command runs setScriptName(Name) on the server side. Only issue with it? I'm unable to figure out how to send the changes to the client.

sour island
#

You can send data back using server commands

fiery pecan
#

oh?

thin hornet
#

sendServerCommand

fiery pecan
#

alr

#

got an example?

thin hornet
#

Events.OnServerCommand.Add()

fiery pecan
#

and what would I do on the client side once the client receives the command?

sour island
#

Events.OnServerCommand.Add(onCommand)--/server/ to client
Events.OnClientCommand.Add(onCommand)--/client/ to server

thin hornet
sour island
#

I keep those comments on at all times

#

always get it mixed up

fiery pecan
#

k

thin hornet
#

check this repo it will probably help, there is also example mod in the readme

fiery pecan
#

but what would I send in the server command?

thin hornet
#

what do you wanna send to the clients?

sour island
#

depends what you're doing

fiery pecan
#

just the updated vehicle data

#

as in

sour island
#

oh

#

there's a special command for that

fiery pecan
#

server receives command from client to "trigger" changing the vehicle script

#

server changes vehicle script

sour island
#

wait changing script?

fiery pecan
#

I'm lost at sending the updated vehicle data to client

#

setScriptName(vehicle name), yes

sour island
#

to convert 1 type of vehicle to another?

fiery pecan
#

if I tp away and come back, the car changes

#

yes

sour island
#

if you're trying to replace it entirely wouldn't overwriting the script work?

fiery pecan
#

not that simple

#

as like

#

I need to do that per XY range

sour island
#

Oh, you want certain vehicles to be from specific departments - you made the multi department response cars right?

fiery pecan
#

yes

#

but my limitation is reloading the car without things breaking

sour island
#

I don't suppose the spawn distribution tables are that advance?

fiery pecan
#

won't work

#

because the vanilla blockade, for example...

#

hardcoded to use vanilla cars

#

but the current system for this works, buuuut

#

on servers, and only in a server setting. The doors bug out

#

as in the console gets this nasty null error, and the doors are unable to be locked/unlocked

sour island
#
local function onCommand(_module, _command, _dataA, _dataB)
    --serverside
    if _module == "sendLooper" then
        if _command == "ping" then
            --print("--sendLooper:ping -- ".._dataB.command)
            sendServerCommand("sendLooper", _dataB.command, _dataB)
        end
    end
end
Events.OnClientCommand.Add(onCommand)--/client/ to server
#

basically you can bounce commands from server/clients

fiery pecan
#

won't that cause lag?

sour island
#

you could have a command fire off a client -> server -> to all clients

#

but I dont get why it wouldn't just be applying to all clients when they get close to the vehicle

fiery pecan
#

it does

sour island
fiery pecan
#

ah

sour island
#

so you're issue isn't really syncing clients - it's saving the change on the server

fiery pecan
#

so here's the function that triggers when the client fires off the trigger

function Commands.setVehicleChange(player, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        vehicle:setScriptName(args.script)
        print("Deez Nutz!")
    end
end```
sour island
#

How/when are you applying the change anyway? Onload?

fiery pecan
#

everyOneMinute

#

it's gotta be dynamic

sour island
#

are you preventing it from reapplying?

fiery pecan
#

yes

#

if GetVehicleScript == "Base.CarLightsPolice" or GetVehicleScript == "Base.PickUpVanLightsPolice" or GetVehicleScript == "Base.85vicsheriff" or GetVehicleScript == "Base.87capricePD" or GetVehicleScript == "Base.91blazerpd" or GetVehicleScript == "Base.92crownvicPD" then Plus if it's in the XY range

sour island
#

what happens if you prevent it from reapplying

fiery pecan
#

it'll ignore the car

sour island
#

by that I mean you're storing which cars got changed already

fiery pecan
#

oh

sour island
#

you aren't?

fiery pecan
#

no need to store the car

#

because I'm changing the script

sour island
#

I was curious why it doesn't reapply when you come back to it

fiery pecan
#

and it only applies to those with the script

#

am I being confusing again?

sour island
#

rather than once a minute I would look into square load

#

just don't put any prints in any main part of the code

#

it will lag your game

fiery pecan
#

the error is it only "refreshes" the car once you come back to it. It doesn't "refresh" until then

#

alr

#

OnSquareLoad?

sour island
#

Events.LoadGridsquare.Add()

fiery pecan
#

ah

sour island
#

and I have something to help cause I don't think there's a way to grab cars hold on

#
---@param square IsoGridSquare
---@param returnFirst boolean
---@return table|BaseVehicle table of BaseVehicles or just 1 BaseVehicle
function getVehiclesIntersecting(square, returnFirst)
    local vehicles = getCell():getVehicles()
    local intersectingVehicles = {}
    for v=0, vehicles:size()-1 do
        ---@type BaseVehicle
        local vehicle = vehicles:get(v)
        if vehicle:isIntersectingSquare(square:getX(),square:getY(),square:getZ()) then
            if returnFirst then
                return vehicle
            end
            table.insert(intersectingVehicles, vehicle)
        end
    end

    if #intersectingVehicles==1 then
        return intersectingVehicles[1]
    end

    return intersectingVehicles
end
#

vanilla only has getVehicleIntersecting as a boolean

#

wrote this for EHE shooting at cars

fiery pecan
#

ah

sour island
#

you'd have to for loop the return or rip this apart to just apply

fiery pecan
#
local GetVehicles = getWorld():getCell():getVehicles();

                if GetVehicles ~= nil then
                    for i=0, GetVehicles:size()-1 do
                        GetVehicle = GetVehicles:get(i);
                        GetVehicleX = GetVehicle:getX();
                        GetVehicleY = GetVehicle:getY();
                        GetVehicleScript = GetVehicle:getScriptName();```
#

there's what I use

sour island
#

also it sometimes returns a single car

#

hmm

#

the issue with that is you probably don't want to scan the entire cell's worth of cars every time a new square is loaded

fiery pecan
#

yeah

sour island
#

and sometimes you don't actually load the entire cell

#

cause of chunks and stuff

fiery pecan
#

yeah

sour island
#

kind of a pickle I guess

fiery pecan
#

indeed it is

sour island
#

they need some lua events for oncreate for cars and items

fiery pecan
#

yep

sour island
#

so the cars turn back to their normal selves only in MP?

fiery pecan
#

no

#

with code A. It'll work, but the cars don't save the change to the server. As in leaving and coming back to the car it'll be the old vanilla car, and rerun the change. Plus doors tend to break. As in you won't be able to lock/unlock em. And it'll blast about "part = null"

sour island
#

that happens even in SP?

fiery pecan
#

no it doesn't

#

only on the server

#

code B. doesn't have that door issue, but the darn car won't update. As in it'll stay a vanilla car until you leave and come back

sour island
#

so you need the server to setScript onclients

fiery pecan
#

I think so

fiery pecan
sour island
#

is the one a minute code firing from inside client / shared / server?

fiery pecan
#

once a minute fires from client

#

then sends a client command

#

which then a file in server handles the script change

sour island
#

hm

#

have you tried running scriptReloaded() after setscript?

fiery pecan
#

so that leads to code A

#

where the doors end up bugging out

sour island
#

that's another issue to deal with

#

does scriptReloaded fix the issue of having to leave and come back?

fiery pecan
#

yes

sour island
#

I thought code B didn't have a doors issue though

fiery pecan
#

well

#

code B doesn't have scriptReloaded() because it seems to do nothing

sour island
#

it's used in debug:

function ISVehicleMenu.onDebugSetScript(playerObj, vehicle, scriptName)
    vehicle:setScriptName(scriptName)
    vehicle:scriptReloaded()
fiery pecan
#

hmmm

#
                            if GetVehicleX >= Riverside[1] and GetVehicleX <= Riverside[2] and GetVehicleY >= Riverside[3] and GetVehicleY <= Riverside[4] then
                                if str_rsresult == RSPDCar[1] then
                                    GetVehicle:setScriptName(RSPDCar[1]);
                                    GetVehicle:scriptReloaded();
                                    --GetVehicle:setScriptName(RSPDCar[1]);
                                elseif str_rsresult == RSPDCar[2] then
                                    GetVehicle:setScriptName(RSPDCar[2]);
                                    GetVehicle:scriptReloaded();
                                    --GetVehicle:setScriptName(RSPDCar[2]);
                                elseif str_rsresult == RSPDCar[3] then
                                    GetVehicle:setScriptName(RSPDCar[3]);
                                    GetVehicle:scriptReloaded();
                                    --GetVehicle:setScriptName(RSPDCar[3]);
                                end
    end
sour island
#

maybe the reloaded can be run for the clients as to avoid the issue with code A?

fiery pecan
#

oh?

#

let's see

#

this game man

#

"Let me take 84 years to load a SP world"

#

lol

#

no dice

thin hornet
fiery pecan
#

it is at no zeds. My PC's just trash. Lol

thin hornet
sour island
#

you sent it as a command within your other command?

#

Also @thin hornet figured out an even better way to handle my overhaul - ```lua
local WeaponProfiles = {
["SmallStab"] = {
["MaxRange"] = "0.8",
["MinAngle"] = "0.65",
["Type"] = "Weapon",
},
}

local VanillaWeaponsExpanded = {

["Base.CarvingFork"] = {
    ["wep_profile"]="SmallStab",
},

["Base.Toothbrush"] = {
    ["wep_profile"] = "SmallStab",
    ["MinDamage"] = "0",
    ["MaxDamage"] = "0",
},

}

#

taking the technique used for EHE presets hehe

#
        local expandedWeaponInfo = VanillaWeaponsExpanded[iModuleDotType]
        if expandedWeaponInfo then
            local weaponProfileID = expandedWeaponInfo["wep_profile"]
            if weaponProfileID then
                for param,data in pairs(WeaponProfiles[weaponProfileID]) do
                    if not expandedWeaponInfo[param] then
                        itemScript:DoParam(param.." = "..data)
                    end
                end
            end

            for param,data in pairs(expandedWeaponInfo) do
                if param ~= "wep_profile" then
                    itemScript:DoParam(param.." = "..data)
                end
            end
sour island
cosmic condor
#

cooking is hard

sour island
#

I wonder if I could grab the models and modify them in realtime

#

would be a slog to edit them by hand :\

#

although it may be unavoidable given not every item will work with rotating it the same way

fiery pecan
#

on the server file: lua local args = { vehicle = vehicle:getId() } sendServerCommand('str', 'vehicleReload', args)
And in the client_Receive file:

function Commands.vehicleReload(vehicle, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        --vehicle:setScriptName(args.script)
        vehicle:scriptReloaded()
        --vehicle:transmitUpdatedSprite()
        print("Deez Cows!")
    end
end```
drifting ore
#

Would it be possible to create some sort of bot that can be in PZ as an admin, stood next to a HAM radio, that broadcasts music via a PZ account over the radio? Like have it scan the PZ console for youtube links that will allow the players to jump on the frequency and 'request' songs via the radio that que the bot to play it via a virtual mic input to the HAM Radio?

sour island
fiery pecan
#

yes

sour island
#

it's printing the message I assume

fiery pecan
#

yes

sour island
#

strange, and setting script above scriptreload in client side doesn't change anything?

#

what about trying to set and reload the script on both sides?

fiery pecan
#

That's Code A.

sour island
#

Applied On: Base.Bowl, Base.WineEmpty2, Base.Tweezers, Base.Teacup, Base.MugRed, Base.PopBottleEmpty, Base.TreeBranch, Base.Corkscrew, Base.Plunger, Base.Chopsticks, Base.Dart, Base.Saw, Base.BeerEmpty, Base.LugWrench, Base.Mugl, Base.PercedWood, Base.PlateFancy, Base.PaintbucketEmpty, Base.MugWhite, Base.BucketEmpty, Base.MugSpiffo, Base.CarvingFork, Base.Pot, Base.GlassWine, Base.EmptyJar, Base.ModernCarMuffler1, Base.ModernCarMuffler2, Base.ModernCarMuffler3, Base.WineEmpty, Base.PlateBlue, Base.GlassTumbler, Base.WoodenStick, Base.WhiskeyEmpty, Base.WaterBottleEmpty, Base.PlasticCup, Base.BleachEmpty, Base.Kettle, Base.PlateOrange, Base.Toothbrush, Base.Plate, Base.GardenSaw, Base.KnittingNeedles, Base.EmptyPetrolCan, Base.NormalCarMuffler2, Base.NormalCarMuffler3, Base.NormalCarMuffler1, camping.TentPeg, farming.RemouladeEmpty, farming.WateredCan, farming.GardeningSprayEmpty, farming.MayonnaiseEmpty,

cosmic condor
#

Is there any contact lens mod?

#

I may create one if it does not exist

thin hornet
# fiery pecan sorry I'm LATE, but yeah

-- Server Side

-- Server Side
local function onClientCommand(module, command, player, args)
    if module ~= "MyModName" then return; end

    if command == "vehicleReload" then
        local vehicle = getVehicleById(args.vehicleId)
        if vehicle then
            vehicle:scriptReloaded(); -- reload on server side
            print("Vehicle id " + tostring(args.vehicleId) + " reload!");
            sendServerCommand('MyModName', command, args); -- send the change back to all players
        end
    end
end
Events.OnClientCommand.Add(onClientCommand);

-- Client Side

-- Client Side
local function onServerCommand(module, command, args)
    if module ~= "MyModName" then return; end

    if command == "vehicleReload" then
        local vehicle = getVehicleById(args.vehicleId)
        if vehicle then
            vehicle:scriptReloaded(); -- reload in this client
            print("Vehicle id " + tostring(args.vehicleId) + " reload!");
        end
    end
end
Events.OnServerCommand.Add(onServerCommand);

-- Client function to reload vehicle for everyone
function reloadVehicle(vehicle)
    local args = { vehicle = vehicle:getId() };
    sendClientCommand('MyModName', 'vehicleReload', args); -- send command to server
end
fiery pecan
#

alright, 2 questions for that

#
  1. Where does setScriptName come in?
  2. Won't that right there reload the vehicle every tick?
viral notch
#

squint week 2. started continue fighting with random working textures on cars

thin hornet
fiery pecan
#

well

fiery pecan
#

I've got code on the client that if a car meets criteria (is the right scriptName within XY), it sends a client command.
Which then the server runs setScriptName(Name).
Where I'm lost is transmitting the change to the clients

#

as in, so you don't have to leave/unload the cell and come back for the changes to apply

thin hornet
#

setScriptName changes the vehicle?

fiery pecan
#

yes

#

but

#

clients won't see it

#

until they leave the area and come back

#

Sorry if I'm being confusing

thin hornet
#

No its okay

#

i think i get it

fiery pecan
#

alr

#

hey, thanks for helping regardless

viral notch
#

created detailed car for GTA5 is more easier than make working textures for cars here...
have created 4 models here and all works self just have problem with textures.... that is pain as hell

thin hornet
# fiery pecan hey, thanks for helping regardless
-- Server Side
local function onClientCommand(module, command, player, args)
    if module ~= "MyModName" then return; end

    if command == "setVehicleScript" then
        local vehicle = getVehicleById(args.vehicleId)
        if vehicle then
            vehicle:setScriptName(args.scriptName);
            vehicle:scriptReloaded();
            print("Vehicle id " .. tostring(args.vehicleId) .. " set script to " .. args.scriptName ..  "!");
            sendServerCommand('MyModName', command, args);
        end
    end
end
Events.OnClientCommand.Add(onClientCommand);
-- Client Side
local function onServerCommand(module, command, args)
    if module ~= "MyModName" then return; end

    if command == "setVehicleScript" then
        local vehicle = getVehicleById(args.vehicleId)
        if vehicle then
            vehicle:setScriptName(args.scriptName);
            vehicle:scriptReloaded();
            print("Vehicle id " .. tostring(args.vehicleId) .. " set script to " .. args.scriptName ..  "!");
        end
    end
end
Events.OnServerCommand.Add(onServerCommand);

function setVehicleScript(vehicle, scriptName)
    local args = { vehicle = vehicle:getId(), scriptName = scriptName };
    sendServerCommand('MyModName', 'setVehicleScript', args);
end

Then just use:
setVehicleScript(vehicle, newScriptName)

#

this should do it on the server and then on each client regardless

fiery pecan
#

ok

thin hornet
#

sorry have to edit i keep making mistake lol

fiery pecan
#

lol

#

so wait, in my main code. Which triggers the whole thing

#

I'd use setVehicleScript(vehicle, newScriptName) ?

#

or do I use sendClientCommand?

thin hornet
#

Yeah but you can set that function as a local and place it in the script that will call

fiery pecan
#

ah

thin hornet
#

So when does this get triggered

fiery pecan
#

everyOneMinute

#

for reasons

thin hornet
#

ouff

#

ok why?

#

hehe

fiery pecan
#

quite simply because I don't know a better way?

thin hornet
#

haha

fiery pecan
#

it currently scans the cell for cars, and if a car in the list meets the criteria, it'll run the code for that car

#

and anything beyond every minute just isn't dynamic enough

thin hornet
#

so it loop all car in a cell every in-game minutes

fiery pecan
#

kind of

#

yeah

thin hornet
#

lets try to find a more optimized way

fiery pecan
#

I could shove modData on the cars scanned?

#

maybe

#

but let's at least get the system working first. LOL

thin hornet
#

well one thing you could do is

#
local ticks, previousCell = 0, nil;

local function onTick()
  ticks = ticks + 1;  
  if ticks < 10 then return; end
  ticks = 0;
  -- So we run only once every 10 ticks
  
  local currentCell = getCell();
  if previousCell ~= currentCell then
    previousCell = currentCell;
    -- Do you stuff here only if we changed cell
  end
end

Events.OnTick.Add(onTick);
fiery pecan
#

oh?

thin hornet
#

well so this way it would only check the cars in a cell once
and if you change cell it would check again for that new cell

fiery pecan
#

ah

thin hornet
#

And only one player need to do it cause the server/client comand we made will change it for everyone logically in that cell.

#

And those that enter that cell later will receive the server version of that car

fiery pecan
#

also

#

your ping pong isn't causing the car to update

thin hornet
#

and doing it will OnTick will prevent run the function too fast or too slow depending of the timescale of the game

fiery pecan
#

alright

thin hornet
#

it isnt, ok never done that before so no idea why but maybe something we can find in the source

fiery pecan
#

so the code goes in the "do stuff here if changed cell" part of that?

thin hornet
#

yeah the code keep track of the last cell scanned and will only scan again if the player changes cell

fiery pecan
#

ah

thin hornet
#

did you ever get a car changed with a code?

fiery pecan
#

yes

#

but

thin hornet
#

what was it

fiery pecan
#

the doors would bug out

noble pumice
#

Anyone know how to get replaceonuse to giveback 2 items?

fiery pecan
#
                                    GetVehicle:setScriptName(JCSDCar[3]);
                                    GetVehicle:scriptReloaded();
                                    GetVehicle:setScriptName(JCSDCar[3]);```
It's in there twice because somehow the car wouldn't save to the server otherwise.
#

but by "doors would bug out" Basically if you interacted with or tried to lock the doors/trunk, it'd blast a "silent error" in the log. Something to do with a "null door". Plus it wouldn't let the lock/unlock action finish

thin hornet
#

are we even suposed to change a vehicle this way

#

how about deleting and adding a new one?

fiery pecan
#

Then keys would be lying on the ground?

#

I'm not against that idea. Just the whole "linked keys" dilemma

thin hornet
#

that stuff should happen only to unowned/undriven car right?

fiery pecan
#

but don't keys have a chance to spawn around cars/on zeds?

thin hornet
#

yeah

fiery pecan
#

Is it possible to remove those?

thin hornet
#

vehicle:trySpawnKey() from the server

fiery pecan
#

no like

#
if key():isOnGround() and key():isLinkedToXCar() then
  removeKey()
end```
thin hornet
#

ah like removing the previous key if one was there

fiery pecan
#

ye

#

here's the door error btw
java.lang.NullPointerException: Cannot invoke "zombie.vehicles.VehicleDoor.load(java.nio.ByteBuffer, int)" because the return value of "zombie.vehicles.VehiclePart.getDoor()" is null.

thin hornet
#

do you have more of the error stack?

fiery pecan
#

gonna have to shove this into a file

#

too large

thin hornet
#

Well we can know if a car has spawned a by using
vehicle:getKeySpawned() == true

fiery pecan
thin hornet
#

mhm

#

and we can set the key to the new vehicle using
vehicle:setKeyId(125415)

fiery pecan
#

oh?

#

what do the numbers mean?

thin hornet
#

So basically we get the current key number, we delete vehicle, we spawn a vehicle and set the key id to the previous one

fiery pecan
#

alr

#

soooo, how do I delete car, spawn new car, and set key ID to new car's ID?

thin hornet
#

question is, can we spawn a vehicle

#

lol

fiery pecan
#

ye

#

I think?

#

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

thin hornet
#

yeah no we wont be able to

#

Would be great if the server could send admin command anonymously

#

without an actual admin on

fiery pecan
#
                local command = string.format("/addvehicle %s", tostring(self:getVehicle()))
                SendCommandToServer(command)
            else
                addVehicle(tostring(self:getVehicle()))
            end```
thin hornet
#

since server is pretty much admin itself

#

exactly

#

SendCommandToServer can only be sent from client (admin) to server

#

its different from SendClientCommand

fiery pecan
#

yeah, but

#

look at the "else" part of that?

thin hornet
#

also this is the java script that spawn a vehicle

BaseVehicle var8 = new BaseVehicle(IsoWorld.instance.CurrentCell);
var8.setScriptName(var1);
var8.setX((float)var4 - 1.0F);
var8.setY((float)var5 - 0.1F);
var8.setZ((float)var6 + 0.2F);
if (IsoChunk.doSpawnedVehiclesInInvalidPosition(var8)) {
    var8.setSquare(var9);
    var8.square.chunk.vehicles.add(var8);
    var8.chunk = var8.square.chunk;
    var8.addToWorld();
    VehiclesDB2.instance.addVehicle(var8);
    return "Vehicle spawned";
} else {
    return "ERROR: I can not spawn the vehicle. Invalid position. Try to change position.";
}
fiery pecan
#

hmm

thin hornet
#

we do not have access to add the vehicle to the vehicle db

#

otherwise we could do similar to this command on the server

fiery pecan
#

ah

thin hornet
#

problem with SendCommandToServer is that its only available on GameClient

fiery pecan
#

after looking at addToWorld() I got an idea

#

what if instead of scriptReloaded, we somehow unload and reload the vehicle?

thin hornet
#

wait a sec

#

there is a addVehicle global

fiery pecan
#

let's see

thin hornet
#

addVehicle(String scriptName)

fiery pecan
#

yeah

#

public static BaseVehicle addVehicle​(java.lang.String string)

#

in globalObject

thin hornet
#

try it from the server side tho

fiery pecan
#

the addVehicle?

#

don't I have to remove the old one first?

thin hornet
#

lets check to delete a vehicle

fiery pecan
#

k

#

ummm

#

DERP

thin hornet
#

vehicle:permanentlyRemove()

fiery pecan
#

ah, thnx

thin hornet
#

you have to call those two

#

from the server

vehicle:removeFromWorld()
vehicle:permanentlyRemove()
fiery pecan
#

alr, wish me luck

barren cloak
#

Hi everyone, first time here :3

#

Quick question, I did a revamp version of the Riverside map artwork (I plan to redo the rest too). I have a question about how to make mods in the near future so people can add these if they want them in their game. Should I ask that kind of info here?

thin hornet
#
local keyId = oldVehicle:getKeyId();
local x, y, z = oldVehicle:getX(), oldVehicle:getY(), oldVehicle:getZ();
oldVehicle:removeFromWorld();
oldVehicle:permanentlyRemove();

local vehicle = addVehicle(scriptName);
vehicle:setX(x);
vehicle:setY(y);
vehicle:setZ(z);
vehicle:setKeyId(keyId);
fiery pecan
#

?

#

on the server?

thin hornet
#

yeah on client it would probably not work

fiery pecan
#

k

thin hornet
fiery pecan
#

gosh. I sure love it when my integrated server decides it wants to take 84 years to boot 🙂

thin hornet
#

You can also reload existing script without restarting

fiery pecan
#

on the server?

thin hornet
#

yeah

fiery pecan
#

how? LUL

thin hornet
#

loll

fiery pecan
#

the F11 menu?

thin hornet
#

in your chat box type:
/reloadlua server/mymod/scriptToReload.lua

fiery pecan
#

ah

thin hornet
fiery pecan
#

"unexpected symbol near /"

thin hornet
#

try this in your server console

#

reloadlua server/MyModName/MyScript.lua

#

without the /

fiery pecan
#

there is none

thin hornet
#

oh you using host button?

fiery pecan
#

it's a hosted/integrated server

#

yeah

thin hornet
#

okay you can also setup a local dedi to test

fiery pecan
#

eh

thin hornet
#

start much faster

fiery pecan
#

just used the f11 menu

thin hornet
fiery pecan
#

but tbh

#

hmmm

thin hornet
#

grab that software and i can help you out setting up

fiery pecan
#

already got it downloaded. LUL

thin hornet
#

good

#

C:\Program Files (x86)\Steam\steamapps\common\Project Zomboid Dedicated Server

fiery pecan
#

k?

thin hornet
#

create a shortcut of StartServer64.bat

#

drag it into your Zomboid folder

#

for quick access

#

you will have to delete the db

#

and stop using the host

#

cause host will change the admin user

fiery pecan
#

sooo

#

what's the db?

thin hornet
#

so basically delete C:\Users\Konijima\Zomboid\db\servertest.db

#

you can use the host to set your settings

barren cloak
thin hornet
#

after deleting try to run the shortcut

fiery pecan
#

and how would I add mods?

thin hornet
#

you can use the Host button to change your servertest config

fiery pecan
#

ah

thin hornet
#

but just start the server using the shortcut

#

first try it will boot up and eventually ask twice for a new admin password

fiery pecan
#

It's crashing due to a failed download

thin hornet
#

then you need to add it to your server list using admin and the password

fiery pecan
#
LOG  : General     , 1658625713849> 228,902,853> Workshop: DownloadPending GetItemState()=NeedsUpdate|DownloadPending ID=1510950729```
#

Assertion Failed: Illegal termination of worker thread 'CFileWriterThread'

thin hornet
thin hornet
#

well go in host button, click delete player and delete world

#

delete that db file

#

make sure you have servertest config

#

you can edit the bat file to change the ram use me i use only 2g cause my shitty laptop -Xms2g -Xmx2g

fiery pecan
#

ah

thin hornet
fiery pecan
#

Also the vehicle isn't removing

thin hornet
#

when you crossline your text does it mean that it the statement is not valid anymore?

fiery pecan
#

nah

thin hornet
#

xD

fiery pecan
#

I use it for emphasis/offtopic

thin hornet
#

ah for me it kinda cancel it

fiery pecan
#

server's still crashing

thin hornet
#

ah shit

#

i used to have trouble at first but now it just works

fiery pecan
#

I'll just stick with the integrated

thin hornet
#

yeah i supose

fiery pecan
#

ain't got time for that shite. Lol

thin hornet
#

looll

#

try to set it up later, its life changing

fiery pecan
#

-- Server Side
local function onClientCommand(module, command, player, args)
    if module ~= "STR" then return; end

    if command == "setVehicleScript" then
        local vehicle = getVehicleById(args.vehicleId)
        if vehicle then
            local keyId = oldVehicle:getKeyId();
            local x, y, z = oldVehicle:getX(), oldVehicle:getY(), oldVehicle:getZ();
            oldVehicle:removeFromWorld();
            oldVehicle:permanentlyRemove();

            local avehicle = addVehicle(scriptName);
            avehicle:setX(x);
            avehicle:setY(y);
            avehicle:setZ(z);
            avehicle:setKeyId(keyId);
            --vehicle:scriptReloaded();
            print("Deez");
            --sendServerCommand('STR', command, args);
        end
    end
end
Events.OnClientCommand.Add(onClientCommand);```
#
if vehicle:meetsRequirements() then

                                    local args = { vehicle = GetVehicle:getId(), script = "Base.85crownvic_rosewoodpolice" }
                                    sendClientCommand(player, 'STR', 'setVehicleChange', args)```
thin hornet
fiery pecan
#

yes

#

that's my version of vehicle

thin hornet
#

what is that

#

oh

#

lol

#

ok it looked like a function to me sorry

fiery pecan
#

it okie

#

lol

#

also

#

I'm big dumb dumb

#

look at the client command sent. LOL

thin hornet
#

dont need the player

#

sendClientCommand('STR', 'setVehicleChange', args)

fiery pecan
#

alr

thin hornet
#

did Deez print into the coop-console.txt?

fiery pecan
#

yeah

thin hornet
#

i bet if you come back the car might be there

#

maybe something about transmitting that didnt work

fiery pecan
#

wait no

#

DERP

fiery pecan
#

I was sending the wrong command

#

trying it now

thin hornet
#

oh yeah

#

i missed that one

#

lol

fiery pecan
#

lol

#

also totally didn't just get a GTA:Online ad on Twitch.... Why are they still milking that game?!!?

thin hornet
#

coz R* $$$$$$$

barren cloak
thin hornet
#

yeah that file is only a reference for you to make your mod

#

you dont edit that file

barren cloak
#

Well I guess I had to read a full guide about how to make a mod first haha

thin hornet
#

Find a mod that does what you want if it exist and check its structure

#

otherwise you also have default template in your zomboid directory
C:\Users\Konijima\Zomboid\mods\examplemod for quick testing locally
C:\Users\Konijima\Zomboid\Workshop\ModTemplate for workshop publishable

#

But still a guide would help you much better lol

#

If i get some time soon ill try to make my own guide for complete starter

fiery pecan
#

welp

#

seems the client command isn't triggering

barren cloak
fiery pecan
#

good news and bad news, @thin hornet
It removed the car, but didn't place a new one?

thin hornet
#

well thats a first

fiery pecan
#

hmm

#

ah, there's errors about the setX, setY stuff

thin hornet
#

well actually you can remove stuff related to setZ

#

but what error was it

fiery pecan
#

"setX is null"

#

ah, seems addVehicle() needs a case of BaseVehicle, not a script

thin hornet
#

ah

#

its seem that addVehicle try to use the player to place the vehicle

#
var2.setX(IsoPlayer.getInstance().getX());
var2.setY(IsoPlayer.getInstance().getY());
#

which would mean its a client function

#

even tho it doesnt check for server or client

fiery pecan
#

ah

thin hornet
#

could try addVehicleDebug

#

addVehicleDebug(String scriptName, IsoDirections direction, Integer skinIndex, IsoGridSquare square)

fiery pecan
#

hmm

#

won't that only work in debug mode?

thin hornet
#

addVehicleDebug(scriptName, nil, nil, square)

fiery pecan
#

and what would square be?

thin hornet
#

well all it does is set it to no rust, no damage

#

lol

#

but it doesnt check for debug mode

fiery pecan
#

ah

thin hornet
#
local keyId = oldVehicle:getKeyId();
local x, y, z = oldVehicle:getX(), oldVehicle:getY(), oldVehicle:getZ();
local rust = oldVehicle:getRust();
oldVehicle:removeFromWorld();
oldVehicle:permanentlyRemove();

local square = getSquare(x, y, z);

local vehicle = addVehicleDebug(scriptName, nil, nil, square);
vehicle:setKeyId(keyId);
vehicle:setRust(rust);
-- probably need to set part condition here
#

vehicle:setGeneralPartCondition(1.3, 10.0)

fiery pecan
#

errr

fiery pecan
#

am backies

fiery pecan
thin hornet
#

neat

fiery pecan
#

oh, and the key's not transferring ownership

wraith root
#

What is the API or library to use for PZ ?

muted barn
#

I'm trying to upload a mod and it keeps saying "Your mod is missing a mod.info file" while the file is right there

#

Nevermind, I got it

hardy bane
#

for the recipe mod is there way to get more than one item for result? and is there place I can look at for ongivexp for all skills list

thin hornet
hardy bane
charred hemlock
#

anybody know how to copy the abilities of one thing like a fridge to another buildable piece of furniture from the same build menu? such as lets say a refrigerated cellar

drifting ore
#

Anyone know how hard it'd be to make a mod that makes food respond to the ambient temperature?

#

So you can store it outside during winter like in the long dark

charred hemlock
#

i feel like thats a good basegame suggestion, you may want to consider making a forum post about that, outdoors temperature affect on food, for possible preservation of fish you catch in winter or something

drifting ore
#

Alright I'll might try suggesting it here

tidal bear
#

Is there someone who would make a Hairbow mod I'd love to have one in some RP stuff?

latent orchid
#

When working with UI, should self:drawRectBorder work automatically? In my case, it seems to do nothing. Comparing vanilla code.
Example I'm using: self:drawRectBorder(10, 10, xOffset, yOffset, 1.0, 1.0, 1.0, 1.0) for an ISCollapsableWindow:derive object

open abyss
#

Can sandbox presets be shared with mods? (I havent seen it happen, so don't even know if possible)

open abyss
#

how do i make recipes that does not require anything to craft?
I have a few info-type items i want the player to be able to make, but with no cost.

#

the closest i have is this:

    {
        keep [Recipe.GetItemTypes.RipClothing_Cotton]/[Recipe.GetItemTypes.RipSheets],
       
        Result:AGCMFrayBerries,
        Sound:Hammering,
        Time:10.0,
        Category:AGCM 1,
    }```That is as close to a free recipe as i can get.
#

just wondering if there is a more direct way?

sour island
#

try keyring?

#

If you wanted something more seamless you could drop a nameless object in player's inventories to act as a catalyst

open abyss
thin hornet
#

How about just making custom context menu?

#
Conjuring >
   Fray Berries

You would add a tag to all item that can be conjured or what ever you do.
Then you would find all script item that has the tag and add them to a sub-context of Conjuring option.
Then you would add a custom TimedAction that is triggered by the selected option and pass in the selected item type to the timed action and add it on perform.

#

That could give you more freedom if skills or special condition are required to be met, even tho recipe have most of this

sour island
#

Wouldn't that add more context menu options everywhere?

thin hornet
#

could restrain it with more conditions

#

but i dont know what is the end goal so im just suggesting

sour island
#

I know I just really dislike the right-click-context menus lol

#

he could add it to the Q radial menu

thin hornet
#

True

#

A custom radial

sour island
#

Conjure > options

#

if #options==1 only show the 1

#

etc

thin hornet
#

what is conjuring, isnt it like calling for spirits and demon?

#

and isnt Fray Berry a person?

sour island
#

I don't know if he wants to imply magic - but conjuring just means out of thin air

shadow geyser
#

if it is just information, it might make more sense to just create a menu for it that opens with a keypress

cosmic condor
#

Poltergeist

thin hornet
#

Or just a conjuring book that has a context menu

#

or a parchment

sour island
#

Based on his other mods/ideas I think he just wants a free way to get food

thin hornet
#

Make it cost mana

shadow geyser
#

using a recipe to give you information, while it works, is kind of obscure. and if you use a UI popup, you can do stuff like having tabs for different info and stuff, rather than having to try to organize the info with different recipes

thin hornet
#

Then a mix of it all

  • A conjuring book
  • A custom context menu on the item to open a UI
  • A UI with all the conjuring info
  • Potentially a radial menu if the book is inventory
#

Or something like old school cheat codes.
Left, Right, Left, Right, Up, Down, X, Y

#

or something like a demonic spell written into the chat that triggers the conjuring at the cost of health point 👹

#

why not find all the dragon balls and make a wish

sour island
#

I actually always liked the medieval fantasy world set in a far off modern apoc

#

could be an interesting overhaul for PZ

open abyss
#

Yes, conjuring is to call forth from nothing. or spawning or what ever... I just wanted the recipe to have a "title" of sorts 😛

#

No need ot think to deeply about what i call the recipe.
Fray Berry is berries that are VERY fatty. Custom food item.

#

Made them for the heck of it

#

My mod is called "AGCM" (Another Generic Cheat Mod) 😛

#

surprisingly, despite this mod, i personally find the game quite hard regardless 😛

fiery pecan
#

am awake

open abyss
#

welcome back to the land of the aware

fiery pecan
#

heh

#

well anyways, Konijima, that thing we got "working" last night? It's not saving the vehicle's direction?

thin hornet
fiery pecan
#

alright. Noted

#

but it seems there's no getVehicleDirection() though?

#

aaaaand I'm dummz

#

getDir()

thin hornet
#

getAngleX, getAngleY, getAngleZ, setAngles(float x, float y, float z)

fiery pecan
#

that did nothing

#

anyways. public IsoDirections getDir()

sour island
#

if getdir isn't working, I'm not positive but I think you can't send objects over commands

thin hornet
#

ah

#

newVehicle:setDir(oldVehicle:getDir());

#

in his case it would just be

local oldDir = oldVehicle:getDir();

local newVehicle = addDebugVehicle("", oldDir, nil, square)
sour island
#

Just define olddir before you remove it? hehe

thin hornet
#

yeah thats not the whole code

#

hes grabbing the info from the old car then he removes it and add a new one and assign the old prop to it

#

somehow act as a way of replacing a vehicle by an other. since setScriptName() and scriptReloaded() didnt seem to work

#

im going to birthday party all day, have a good one yall