#mod_development

1 messages · Page 75 of 1

gaunt cargo
#

Woah what

#

Wait wait I have the drop down menu for the water shutoff and electricity shut off

thick karma
#

Not sure what dropdown menu you mean

gaunt cargo
#

How were you able to manually override them, like specifically say when it’s going to go out?

gaunt cargo
#

Other options are 0-2 months, 0-6 months, etc…

#

And that’s it, I’m not able to manually manage them.

thick karma
#

Really? I don't think I've modded this... I wonder if your game needs an update? Or my game... doesn't need whatever update you got?

#

So under Sandbox > World > Electricity Shutoff, you see a dropdown?

#

I know you probably just said that but I am doing a sanity check

#

To make sure I actually understand you

#

Sort of mind boggling

gaunt cargo
#

Yes, when I go into my settings on Sandbox for a singleplayer world, I get the drop down menu that says 0-30 days, etc…

thick karma
#

Ohhhhhhhhh

gaunt cargo
#

Is it only available setting for Multiplayer servers or something?

thick karma
#

My screenshot is Multiplayer

gaunt cargo
#

Ah

thick karma
#

That's so fuckin weird they do it differently

#

And the opposite of smart

#

Whatever that is

#

Idr

gaunt cargo
#

Check on a singleplayer

thick karma
#

But the opposite of smart

gaunt cargo
thick karma
#

I am actually getting sucked into a game now... but you can check Host settings under Multiplayer to confirm what I'm guessing here

gaunt cargo
#

I’m on my bed waiting to sleep, ‘cause I gotta wake up at 4:00

thick karma
#

haha word

gaunt cargo
#

But, that’s weird if that IS the way it works

#

Honestly

thick karma
#

Wouldn't be the weirdest thing I've seen in this game

gaunt cargo
#

Besides, my computer is in my backpack for the trip, so…

thick karma
#

Lot of very questionable organizational decisions were made in programming PZ

gaunt cargo
#

Where can we put suggestions like these?

thick karma
#

Well first you take off your pants...

gaunt cargo
thick karma
#

I mean they have a suggestions forum, I made a suggestion there once... 3 months later my suggestion is a mod I made and they haven't added my request

gaunt cargo
#

I wouldn’t mind it if this was a mod

#

Singleplayer be able to select WHEN the water goes out.
Kind of annoying it’s an option only for MP.

thick karma
#

I might be able to find a way but I'm not sure. I would have to inspect that table and how its data gets used.

#

In the meantime, you could always host multiplayer... nobody can join if you don't invite them

#

And nobody sees your server if it isn't added by IP to their list (or public dedicated).

gaunt cargo
#

True, but I can escape death whenever I want, and I know my ass is gonna want to, so…

thick karma
#

Wdym by escape death whenever you want?

gaunt cargo
#

God mode

thick karma
#

Ahhhhhhhhhhhhh

gaunt cargo
#

Become Invisible

thick karma
#

Install my Jumper mod haha

#

Teleport to safety if stuff gets hectic.

gaunt cargo
#

Lmao

thick karma
#

Not invincible but I mean if you can't activate a context menu before they eat you, you probably couldn't activate God mode in time either.

abstract wave
#

I've got a few TV-Shows that I thought were pretty fun to make, took me ages back then, though.. here's an example episode:

[img=music] ... CRAZY ... [img=music]
[img=music] ... CARL ... [img=music]
The one-stop chop-shop!
Welcome back to Crazy Carl! Your one and only mechanic TV show!
Today we'll be talking about how to swap your headlights!
First, find your trusty screwdriver! I call mine.. Trusted screwdriver.
*Beer Can Opening*
Next, pop the hood and simply screw each bulb till they are out, simple!
*Screwdriver Sounds*
Now.. screw in the new ones, or old, doesn't matter, this is a demonstration!
But, remember, only do this once per day on the same car, everything else would be silly!
You can also change the battery and radio with the very same screwdriver
Doing so will channel your inner mechanic in no time!
But you don't have to stop here, oh no.
Just go to your neighbor and do it again on his car! HAHA!
Next time we'll look into changing your tires!
[img=music] ... CRAZY ... [img=music]
[img=music] ... CARL ... [img=music]

I was playing around with Chatgpt though, and asked it to come up with an episode based on a few examples, and it came up with this.

[img=music] ... CRAZY ... [img=music]
[img=music] ... CARL ... [img=music]
The one-stop chop-shop!
Welcome back to Crazy Carl! Your one and only mechanic TV show!
Today we'll be talking about how to fix a car that's making strange noises.
First things first, grab a wrench, a hammer, and some duct tape.
Hammering and Wrenching Sounds
If the car is making a grinding noise, simply hit it with the hammer until the noise stops.
If it's making a squealing noise, wrap some duct tape around the offending part.
And voila, problem solved!
But wait, there's more! If your car is completely broken down, simply push it off a cliff and buy a new one.
It's the Crazy Carl way!
Next time, we'll be talking about how to give your car a stylish paint job using a can of spray paint and a lawnmower.
[img=music] ... CRAZY ... [img=music]
[img=music] ... CARL ... [img=music]

.. scary, but funny. Thought i'd share.

gaunt cargo
#

But yeah, a Water and Electricity shutoff setting for SP as a mod or official would be greay

thick karma
#

Then you would also get good at activating teleport via context menu 😉

#

It's literally a right-click away at all times

gaunt cargo
#

True

thick karma
#

Not saying you can't activate God mode fast... just saying, however fast you can be, you can probably activate Jumper faster.

ancient grail
#

Imean anytime ubcan configure it

thick karma
#

Jumper lets you save TP locations by name and category to your context menu for quickly teleporting all over the map

#

@gaunt cargo

#

FYI

thick karma
#

You can also bring buddies if you ever do decide to play online

ancient grail
#

@thick karma wanna play

gaunt cargo
#

True

ancient grail
#

?

thick karma
#

@ancient grail Yes but I am about to play DKO with a friend for awhile.

gaunt cargo
#

A mod for SP like that would still be fine. Anyway, Happy New Year and goodnight!

sour island
#

I made a thing

ancient grail
# gaunt cargo Wdym?

Theres a button that says host
If u do that then u would have a locally hosted server
That will let u configure sandbox anytime. For sp u cant

ancient grail
gaunt cargo
sour island
#

button for the debug tool set

#

got side tracked again cause of skill recovery journal

#

but I finished this guy - thought he came out great

ancient grail
#

it does , it looks awsome

#

useful for the community mod youre doing too

#

anyways... anyone know which lua file contains the vehicle spawn

#

imean the auto world spawn thing

slender halo
#

Hello, I want to create a poster mod, but I don't know what to do with the .pack and .tiles files, I don't understand English much so I couldn't find a guide, if you could help me I would be very grateful.

ancient grail
#

you need to learn how to make tiles

slender halo
#

okay, thanks.

hot patrol
#

Are there any mods to remove the poison symbol on food? I notice there is a sandbox option for water but nothing else

ancient grail
drifting ore
#

question... i know noobish but maybe can help me understand overall what makes the most sense. if function is global, it would make sense for me to just use that global function instead of creating a local function that does the exact same thing, right?

#

or will it still be faster or more efficient to just use a local function anyways pretty much no matter what

jagged ingot
#

Based on your design, use the global one. It isn't more or less efficient performance-wise.

drifting ore
#

that was my main concern so ty

#

in my case just items

jagged ingot
#

I'd avoid poisoning the global table when planning code.

drifting ore
#

yea someone gave me the ole proper etiquette on not using globals or overwriting

#

but as long as i require another script. i can utilize that local function, correct?

#

sorry for such basic question also. this is my last 🙂

jagged ingot
#

local will be isolated to a visibility scope.

drifting ore
#

oh

jagged ingot
#

You can reference by requiring either the file or the table it is inside via module require assignment.

drifting stump
drifting ore
#

awesome thank you.

#

i see

jagged ingot
#

(Is trying to push people in here towards using modules)

drifting stump
#

modules are the way

drifting ore
#

makes sense to me

#

why would people not utilize it in the first place?

drifting stump
#

skill issue for lack of better term

drifting ore
#

i see lol im familiar with it in the workplace 😛

#

damn so fast of responses. thank you again

jagged ingot
#

PIpeWrench operates entirely on modules.

drifting ore
#

working on making a craftable lightsiwtch tile for my first real mod 🙂

#

i looked at it but became overwhelmed as a newer person to coding

#

i saw you chatting about it last week or so and was interested. but once i have the basics down of a few languages i should be able to absorb the typescript thing

jagged ingot
#

Don't worry: I'm a broken record here.

drifting ore
#

lololl

jagged ingot
#

Not many people know that they have that option. 🙂

lusty marsh
#

damn this error has handsunhappy

sour island
#

Anyone familiar with Star's fix view XP mod - 'When you see "+75%", that actually means "x4" i.e. "+300%".' What does he mean by this?

ancient grail
bronze yoke
#

25%+75% = 100%, which is 4x the default... it's a dreadfully misleading part of the ui

sour island
#

ah - but his UI displays ... 'x 6.64' which I think is incorrectmore confusing?

#

6.64 get's displayed for 1.66 or 3+ starting skill (125% I think on the vanilla UI)

#

1.66/.25 = 6.64

#

Idk maybe I'm tired - been getting comments all day with people doing math lol

jagged ingot
#

Numbers. Lots of them.

#

Hey @sour island Want to see some simple rain FX API I rewrote recently?

winter thunder
#

When using set/getHunger(), would something like
player:setHunger(player:getHunger() + 0.5)

make the player hungrier, or less hungry?

jagged ingot
#

It's a drag-n-drop mod.

sour island
#

I saw Skiz's title scene using it - looks great

#

Is it the same texture as vanilla?

jagged ingot
#

No. I render this entirely from scratch in realtime.

sour island
#

😮

jagged ingot
#

My demo shows the full rotation of it.

#

It's a particle emitter technically..

#

It has settings like spread, angle (radians), color, alpha, drawing box, etc.

#

I can toss it in here if you want to check it out. 🙂

sharp dome
#

Does anyone know the mod where you can upgrade backpacks, in the crafting menu you have an option to craft water slot, weapon slot, bedroll slot

jagged ingot
#

I'm thinking of expanding on it to include polygon bounds and modularity so people can write their own physics.

sharp dome
#

I used to have it but forgot the name of it after I reset my subscribed

sharp dome
#

Thanks

winter thunder
#

np

sharp dome
#

I know it wasn't authenticZ or attach weapons to back

jagged ingot
sharp dome
#

Knew**

jagged ingot
#

It's funny to see it working with particles live with PZ running.

winter thunder
#

Because I am not sure if hunger is keeping track of how hungry the character is, or if it is how full they are, by default -

#

stat by default is set to public float hunger = 0.0F;

jagged ingot
#

Huh.. They're playing Daft Punk in the Starbucks I'm at.

#

I need to take a look and see if I can exploit some methods in the Texture class with ISUI render code.

dim hill
#

smdh @sour island being so damn active updating his mods making me have to restart my server

#

||thank you for the updates :D||

sour island
#

Np, say, did you have a bug where the character kept saying 'nothing to add' over and over?

jagged ingot
#

Haha

dim hill
#

I don't actually get to test much 😂

#

Not a flex, I just play very carefully hahaha

jagged ingot
#

Maybe my reload script could be useful.

dim hill
#

giv now

jagged ingot
#

It's more for server-exclusive content buuuuut yeah.

dim hill
#

GIV

jagged ingot
#

It has that side-effect / feature.

dim hill
#

oh lol

#

I wonder if there's a mod that automatically restarts the server occasionally

jagged ingot
#

It's a dynamic loader that handles server-side scripts which can be a part of a mod's code.

jagged ingot
#

Those exist.

#

People here will know em. I don't.

dim hill
#

I'm not familiar

sour island
#

I know a guy, if you dont mind me passing your name to him

jagged ingot
#

When I get a Workshop item popular again, I'm going to schedule updates to be at a very specific time a week.

ancient grail
#

chuck, i just updated the container unlock and turned it into time action. it wasnt that hard after all. all this time i was afraid of metatables

sour island
#

👍

#

There's a timedAction API although I never used it

ancient grail
#

where?

#

i think i might have seen that but i guess it confused me even more that time lol

sour island
#

I don't see it appear on workshop - either way timed actions aren't that hard to work with

jagged ingot
#

hahahahahaha

#

So today in JS I just wrote local var = .. and didn't notice.

#

Yesterday morning I typed this instead of self in Lua.

winter thunder
jagged ingot
#

I'd like to know the sweet spot time to do it.

#

It'd be nice to have a conformity on that time.

#

We all know how ugly servers get when updates happen at random times.

terse locust
sour island
#

@faint jewel

#

hmm

#

what's the iso object

#

seems to be outside 🤔

lusty marsh
#

Are there any errors that wouldn't produce an error message? like on the java side or something like that?

faint jewel
#

ooooh wassat?

sour island
#

fixing up AUD

#

made the modData tool have a submenu instead

#

added cars + more descriptive option names

faint jewel
#

and does it show vehicluar mod data?

sour island
#

should

faint jewel
#

I can test if need be?

sour island
#

the isoObjects were just part of the map I guess lol

#

its the grime

bronze yoke
#

yeah, there's usually a couple on every square

sour island
#

I was using custom name for furniture

#

as the spritenames can be a bit messy

sour island
#

obviously, heavily WIP

#

for now I'm leaving the debug tools as a sub mod

#

My plan is to refactor the way buttons are handled for the tools to make adding more easier

ancient grail
sour island
#

addOptionTop(

#

there's also one to add after or before another option by name

ancient grail
sour island
#

media/lua/client/ISUI/ISContextMenu.lua has all of them

ancient grail
# sour island

this is exactly what i did too.. i used the getType as part of the context name

sour island
#

?

bronze yoke
#

you can also give an index or use the prefill events

sour island
#

and add suboptions

bronze yoke
#

giving an index is a bit naive though unless you're grabbing it from something

ancient grail
#

not sure any more

sour island
#

Just realized I don't have bodies showing up

ancient grail
#

yep getType()

sour island
#

probably need to add a 'if else' option

#

that'd return their object type in terms of wall/floor etc

#

or their sprite's type

faint jewel
#

how do you do a check if another mod is installed?

#

do what?

sour island
#

to check if another mod is active?

faint jewel
#

okay so how do i check if 10yl is loaded?

sour island
#

you use it's modID and getactiveMods

bronze yoke
#

if getActivatedMods():contains('ModId') then is the most simple way to do this

sour island
#

Yes, my example was part of my 'load these other mods first' thing

#

Use what he wrote instead

ancient grail
#
Mod ID: 10YL_ALL
Mod ID: 10YL_HIGH
Mod ID: 10YL_LOW
Mod ID: 10YL_MAPS
Mod ID: 10YL_MEDIUM
Mod ID: 10YL_VH
sour island
#

You'll need to do all of them

ancient grail
#

here are the mod ids so you would have to or or or or

sour island
#

that's a pain lol

ancient grail
#
if getActivatedMods():contains('10YL_ALL') then print('skizot is king of 10 yrs later all') end
elseif getActivatedMods():contains('10YL_HIGH')  then print('skizot is king of 10 yrs later high') end
bronze yoke
#

might just be faster to use a table and a loop at that point

thick karma
sour island
#

bodies are apart of a gridsquare's getMovingObjects right?

ancient grail
#

yes

#
getStaticMovingObjects
#
                    elseif self.itemType:isSelected(2) then
                        for i=0, sq:getStaticMovingObjects():size()-1 do
                            if instanceof(sq:getStaticMovingObjects():get(i), "IsoDeadBody") then
                                local item = sq:getStaticMovingObjects():get(i)
                                table.insert(itemBuffer, { it = item, square = sq })
                            end
                        end
                    end
sour island
#

oh static

#

there's a get staticMovingobjects and getDeadBodys

#

odd

ancient grail
#
    if not body and v:getSquare() and v:getSquare():getDeadBody() then
        body = v:getSquare():getDeadBody();
    end
#
    if instanceof(v, "IsoDeadBody") then
        body = v;
    end
#

weird

sour island
#

?

ancient grail
#

ISWorldObjectContextMenu

sour island
#

yeah that returns the first

#

adds a s at the end it returns a list

ancient grail
#

but why wont it return body iny first place

faint jewel
ancient grail
#

ask the author

eternal garnet
#

Always pays to have the option

faint jewel
#

ugh. but adding 10yl to my mower is rough

faint jewel
#

i DO Plan to make a version of the mower that is a push mower.

#

one day in the FAR FAR future.

winter thunder
#

Anyone know if it is possible to modify the speed of reading?

late hound
faint jewel
#

sigh.

sour island
#

deadbodys copy the player's modData 😮

winter thunder
#

Other than that- Currently struggling to find out if I can change the players movement speed, combat speed, general speeds of timed action completion, stuff like that

I have found variables in the java that seem to change some of those things, but none of which are very clearly defined :(

sour island
#

you can hijack timed actions easily as it's in Lua

winter thunder
#

Word, I figured as much. Just wasnt certain, I havent looked into the timed actions aspect much. Still working on the other variables

sour island
#

Just make sure you overwrite properly

bronze yoke
#

if you plan to touch reading, be ready for incompatibilities with a million different mods you've never heard of before

sour island
#

CDDA hardoverwrites vanilla functions

#

added it it my 'please stop' list

#
require "TimedActions/ISReadABook"

local crossRefMods = {
    ["CatsWalkWhileReadMod"]="ReadFasterWhenSitting",
    ["CatsReadMod"]="ReadFasterWhenSitting",
    ["CatsReadMod(slower)"]="ReadFasterWhenSitting",
    ["SnakeUtilsPack"]="tooltip",
    ["nicocokoSpeedReading"]="TimedActions/NSRReadABook",
    ["CDDAReading"]="TimedActions/ISReadABook",
}
local loadedModIDs = {}
local activeModIDs = getActivatedMods()
for i=1, activeModIDs:size() do
    local modID = activeModIDs:get(i-1)
    if crossRefMods[modID] and not loadedModIDs[modID] then
        require (crossRefMods[modID])
        loadedModIDs[modID] = true
    end
end
winter thunder
#

yeah- I just wasnt sure if there was any sort of core variable I could interact with

bronze yoke
#

my mod actually worked with cdda except that it also *removes* functions and one of mine called one of the vanilla ones

sour island
#

it removes parts of the timed action?

bronze yoke
#

yeah, a couple functions related to the xp boost and stuff

sour island
#

oooh yeah

#

that's literally the entire mod

bronze yoke
#

they aren't needed anymore of course but that was an annoying one

faint jewel
#
local function 10ylRunning()
    if getActivatedMods():contains('10YL_HIGH')  then 
        print('10YL_HIGH is enabled.')
        return true;
    elseif getActivatedMods():contains('10YL_MEDIUM')  then 
        print('10YL_MEDIUM is enabled.')
        return true;        
    elseif getActivatedMods():contains('10YL_LOW')  then 
        print('10YL_LOW is enabled.')
        return true;
    else
        return false;
    end
end
``` that should do it for a boolean check right?
bronze yoke
#

function name can't start with a number

faint jewel
#

local function TylRunning()

#

😛

sour island
#
local function bIs10YLActive()
    local activeMods = getActivatedMods()
    return activeMods:contains('10YL_HIGH') or activeMods:contains('10YL_MEDIUM') or activeMods():contains('10YL_LOW') or false
end
faint jewel
#

you little code monkies you.

sour island
#

you could also for loop

#

return autobreaks (?)

#
local function bIs10YLActive()
    local activeMods = getActivatedMods()
    local modIDs = {"10YL_HIGH","10YL_MEDIUM","10YL_LOW"}

    for _,mod in pairs(modIDs) do
        if activeMods:contains(mod) then
            return true
        end
    end
    
    return false
end
#

I prefer keeping stuff in lists so I can change it more easily later

bronze yoke
#

yeah that's how i'd do it

#

just writing out a bunch of ors/an if tree can be kind of fatiguing

autumn garnet
sour island
#

Hey Dane, long time no see!

autumn garnet
#

I gave versions rather than the sandbox options because there were some problems with the servers, the sandbox options were only taken into account on a cell or I don't know what weird operation it was

#

Hey ! Happy new year 😄

#

the version with 10YL_Maps is to activate the maps 10 years later with unique buildings, more trees etc because I did not randomly generate the trees as with the overlays, I did the mapping by hand thanks on the reverse of the card by Alree

#

The 10YL_vehicles version allows to have a 100% spawnrate for vehicles creating traffic jams and the angle of the vehicles is random

sour island
#
local modDataContextClasses ={
    ["IsoDeadBody"] = function(object) return object:getOutfitName() end,
    ["IsoPlayer"] = function(object) return object:getUsername(true) end,
    ["IsoZombie"] = function(object) return object:getOutfitName() end,
    ["BaseVehicle"] = function(object) return object:getScript():getName() end,
}


local function fillModDataContextMenu(array,contextMenu)
    for i=0,array:size()-1 do
        local object = array:get(i)
        local optionAdded = false
        for type,func in pairs(modDataContextClasses) do
            if instanceof(object, type) then
                local optionName = func(object)
                if optionName then optionName = ": "..optionName end
                contextMenu:addOption(type..(optionName or ""), object, showModData)
                optionAdded = true
            end
        end

        if not optionAdded then contextMenu:addOption(tostring(object:getClass()), object, showModData) end
    end
end
#

tried a new technique

bronze yoke
#

ooh that's clever

sour island
#

a little wasteful as StaticMoving vs Moving don't overlap but I hate copy pasting

faint jewel
#
                    if GrassBush:getProperties() and GrassBush:getProperties():Is(IsoFlagType.canBeCut) then
                        --print("Bush!")
                        square:transmitRemoveItemFromSquare(GrassBush)
                        if not GrassBush:getModData().soundbreak then
                            GrassBush:getModData().soundbreak = 1
                            vehicle:playSound("VehicleHitTree")
                            Blade:setCondition(BladeHealth - HitDmg)
                        end                                
                    end
``` this is my normal method.
#

it's because it's not reading it as enabled.

winter thunder
#

Anyone know if the variables in defines.lua (the ZomboidGlobals) are updated onTick?

faint jewel
#

so i've made that mower that will end the world!

sour island
#

good

#

that'll show that damn grass

winter thunder
#

good. Yes.

#

as it should be

drifting ore
#

Can anyone help me please? I have a model of a gun and a sound for it, I need to change the default m4 to the one I chose

winter thunder
#

You can use a lua file to swap the model and sound of the base m4 to yours

drifting ore
#

Need it for my new video

faint jewel
drifting ore
faint jewel
#

updating my mower to work with 10yl

#

fixed it. yay!

#

the mower will now mow 10yl grass

autumn garnet
#

10YL Killer haha

#

Good job 😄

drifting ore
faint jewel
#

i's been the biggest ask for the mower.

drifting ore
#

where do I find models files in the game folder?

faint jewel
#

lawn mower simulator with 10yl is so soothing.

rancid tendon
#
option MFTEOTWC.stackQuantity
{
  type = integer,
  min = 10,
  max = 25,
  default = 5,
  page = MFTEOTWC,
  translation = MFTEOTWC_stackQuantity,
}```
#

does anyone see anything wrong with this?

#

for some reason having this sandbox setting in my mod causes a crash to desktop when loading lua but im staring at it and cant figure out what might be wrong with it

#

the implementation of it also looks just fine as far as i can tell; i have it implemented literally identically to two other perfectly functional implementations of the same setting and code for exactly the same purpose

#

but its just this specific one that is breaking and i cannot find a fucking difference

#

for instance

#

    local currentItemList = {}
    for i=1,#itemList do
        currentItemList[i] = itemList[i]
    end

    for i = 1,1 * SandboxVars.MFTEOTWC.stackQuantity do -- change the second number to how many you want
        local chosenItem = table.remove(currentItemList, ZombRand(#currentItemList)+1)
        player:getInventory():AddItem(chosenItem)
    end
end```

```Recipe.OnCreate.ItemStackVinyl = function(items, result, player)

    local currentItemList = {}
    for i=1,#itemList do
        currentItemList[i] = itemList[i]
    end

    for i = 1,1 * SandboxVars.MFTEOTWC.stackQuantity do -- change the second number to how many you want
        local chosenItem = table.remove(currentItemList, ZombRand(#currentItemList)+1)
        player:getInventory():AddItem(chosenItem)
    end
end```
#

here's where it's implemented

#

    local currentItemList = {}
    for i=1,#itemList do
        currentItemList[i] = itemList[i]
    end

    for i = 1,1 * SandboxVars.MFTEOTWC.cacheQuantity do -- change the second number to how many you want
        local chosenItem = table.remove(currentItemList, ZombRand(#currentItemList)+1)
        player:getInventory():AddItem(chosenItem)
    end
end```
#

and here's an identical, functioning version that works just fine

bronze yoke
#

maybe a non-unicode character snuck in

rancid tendon
#

i copied the entire thing directly from the functioning ones

#

except for typing in the few characters required to change it from cache to stack in the sandbox settings and in here

#

and i dont see a space where a non-unicode character could be there

#
{
  type = integer,
  min = 5,
  max = 100,
  default = 50,
  page = MFTEOTWC,
  translation = MFTEOTWC_cacheQuantity,
}```
#

heres the functioning sandbox option as well

#

... oh mygod.

#

no i did not.

#

i see what it is. ive been looking at text all day nonstop and i didnt even see

#

min = 10,
max = 25,
default = 5,

#

there is. a problem here.

#

im the dumbest person on earth

bronze yoke
#

😔

#

it's always something silly like that

winter thunder
#

So- does anyone know if the rates of certain effects are changed by the length of a day?

bronze yoke
#

that's very vague!

winter thunder
#

Like hunger

#

Sorry

bronze yoke
#

yeah

winter thunder
#

LMFAO

#

And shit... Is there an easy way to set that as a multiplier for some stuff?

Like- I am setting effects to happen on every minute to tweak player stats, but I want to make sure that the values still work for different game speeds

winter thunder
#

I calculated the rates using the global definitions for the rates, but I think they run on tick... So without knowing the relative speed of the game, I can only check them based on a set value of game time length

thick karma
#

Given that the stats aren't even normalized the same way... my suspicion is that it probably depends on the stat

#

But idk

winter thunder
#
--[[
Stat max values:
    Hunger = 0-1
        - Defaults to 0.0
        - Base     = Increases @ 0.03 / min irl
        - Exercise = Increases @ 0.07 / min irl

    Thirst = 0-1
        - Defaults to 0.0
        - Reduced @ 0.0288 / min irl

    Endurance = 0-1
        - Defaults to 1.0
        - Running    = Decreases @ 0.1872 / min irl
        - Sprinting  = Decreases @ 1.638 / min irl
        - 'Immobile' = Increases @ 0.1116 / min irl

    Fatigue = 0-1
        - Increases @ 0.1242

    Stress = 0-1
        - Defaults to 0.0
        - Decreases @ 0.108 / min irl

    Boredom = 0-100
        - Defaults to 0.0
        - Increases @ 3.6 / min irl
        - Decreases @ 138.6 / min irl

    Unhappiness = 0-100
        - Defaults to 0.0
        - Increases @ 1.8 / min irl

    Temperature = 30.0 C - 41.0 C
]]--
#

3,600 ticks / minute. So assuming a 2 hour length of day these are the rates

#

😭

bronze yoke
winter thunder
#

Just found these

#

Lmfao

bronze yoke
#

thank you project zomboid

winter thunder
#

Super happy this is hard coded

#

lmfao

bronze yoke
#

i've been endlessly curious about why that second one exists

winter thunder
#

It seriously takes longer to type out

#

lol

lone cipher
#

im having trouble joining my friend

#

we have all the same mods

#

but when i try to join it says mod (mod template not installed) even though we have mod template

winter thunder
#

Can I add parameters to the functions in my lua events?

Like- If the function I am calling can take a variable, could I do event.---.add.exampleFunction(x)?

fast galleon
#

I usually keep anything I'll need in a local var and check that in the function. You can't remove the function if you add it like in opt a.

winter thunder
#

I see what you mean

#

I basically just want to have the ability to negate my function lol. That way I can have the same function run to do the opposite effect

#

But its all good, I know a way around it i think

ancient grail
#

event.someevent.Add(function() print("do the whole function here") end)

faint jewel
faint jewel
#

bruh. i still need to be taught lol.

#

there is fuckery involved on a level that is scary.

#

i would LOVE for an ingame or WYSIWYG ui editor.

uncut meteor
#

Hello does the server folder replicate the code for other users i'm having issues with players not seeing the same zed type with cdda mod
the original author put the code inside shared folder.

fast galleon
#

wow, every time I realise there's more info to be found in this guide

uncut meteor
#

thank you

thick karma
# winter thunder Just found these

Any luck setting these? I tried...

    getGameTime():setNight(0)
    getGameTime():setNightTint(0)

OnTick and OnPostUIDraw and got nothin, despite tracking the variables increasing from 0 to 1 as night reaches its darkest.

fast galleon
#

what is this for?
btw, changing climate controls works best from admin settings, SP seems bugged or something

thick karma
#

Hallucinogenic effects

#

Real-time modification of perceptions of the player that contradict server reality.

#

Brandon is working on a drug mod of sorts.

#

@fast galleon

fast galleon
#

ah, you probably don't want climate controls then, but something like the search effects

thick karma
#

I looked at that as well... He is aware of that option but for reasons I haven't requested he still seems interested in night strength management, which I am assuming from context is related to the same goals he's been pursuing.

#

Tbh I am also interested in night strength management separately

#

I would like to greatly reduce darkness at night as part of a mod

#

Without any weird nightvision effect

#

I would also like to be able to reduce darkness of locations that are out of line-of-sight (but visited before).

fast galleon
#

I second that, would be nice to have white nights in summer

thick karma
#

Yeah I have dumped some hours already trying to find something

#

There are a couple things in ClimateManager that very slightly let me adjust darkness levels but I can't seem to access the key that primarily determines just how dark things get overall at night

#

And I have no idea where to find the code that darkens the unseen.

fast galleon
#

this.setExposed(ClimateMoon.class);

thick karma
#

ClimateMoon you think??

#

Weird name...

#

I noticed it but didn't think it sounded right

#

Will read it more closely

#

Not sure about that

fast galleon
#

I would imagine it's what's affecting night strength

thick karma
#

Seems to explicitly control phases of the moon

#

May influence night strength but it's not the primary thing

#

Very small class

#

But so many options, some accessed uniquely

#

taking time to try things

ancient grail
fast galleon
#

seems like night is multiplied by moon phase

#

and affecting night is easier than the moon

#

the RenderSettings seems to be per player, it's where I saw the multiply. gotta go

  • I guess it's all about the climate, so test with climate debug tools as mentioned earlier.
drifting stump
#

when you add a function to an event you are simply registering it to run when triggered

#

all the parameters passed on the trigger will go to that function

agile vigil
#

Am I not understanding how require works in .lua?

I have a file MutiesDiary.lua in lua/client/ and another file MutieDiaryExperienceTracking.lua in the same directory.

I use require "MutiesDiary" at the top of the second file, but it somehow doesn't get respected, and ends up loading MutiesDiaryExperienceTracking first. 😦

fast galleon
thick karma
#

Wait I just noticed you wrote it two ways

#

Which way is it? Muties or MutieDiary?

#

P sure MutieDiary would load before MutiesAnthing fwiw so a subtle difference could explain it

agile vigil
#

MutiesDiary, every time, it's not the spelling. I just seem to have a bug in MutiesDiary.

sour island
#

Is it directly in /client/ or is there a folder after?

#

Require needs to include folders after client/server/shared/

agile vigil
#

It's directly in client.

#

I have a bug in MutiesDiary, unrelated to require.

#

And fixed, I had a trailing ; after a function name and that caused issues. Woopsie.

#

I wish Lua syntax errors automatically opened the debug ui D:

drifting ore
#

when i set a recipe to NeedToBeLearn:true people without reading the recipe still have access too it

solid dawn
#

I have a question folks. Is it possible to make spawn points exclusive to a trait? I'm running my own server and next season I want to have 3 groups of Settlers, Raiders and Nomads. Each of them will have a custom Faction HQ (I will create a custom map for this) and I want people to be only able to spawn there if they have the appropiate Settler/Raider/Nomad trait selected

#

I also want these traits to unlock custom clothing in the character creation and give an experience boost to certain skills (but no skill points only the boost). I know you can do this with occupations but is it also possible with traits?

molten cobalt
#

Would that be like getDawn() ?

Would I need to somehow store that info it gets to use it in the rest of my code so it can be the reference point for the triggering of the effect?

drifting ore
#

nvm. i just wasnt putting a , at the end of the line

fast galleon
agile vigil
#

I'll have to make a third-party patch to the Night Combat XP mod that does this.

fast galleon
#

hm, wonder how often I should update this too. All it does is change an icon in the UI.

agile vigil
#

Could set it to the every 10 minutes event?

winged musk
#

hey does anyone here do commissions for clothing mods?

faint jewel
#

what are you after?

solid dawn
fast galleon
sour island
#

Isn't there already mods designed around professions? Can't imagine the jump is that hard.

upper helm
#

has anybody made any mods re. radio stations, ie. adding new stations to frequencies, changing transcripts, etc?

solid dawn
#

Then I'll do it myself I guess

vast veldt
#

Hi, does anyone know if the API offers any persistent, globally unique ID for a player at the server side? I've tried getPlayerNum() and getOnlineID() but they appear to return values that aren't unique amongst the players (i.e. two players can have the same value).

sour island
vast veldt
#

Thank you - Whilst I do have the steam ID, currently I have to get this from the client side using getCurrentUserSteamID(), so I'd be completely trusting the client with providing this value accurately... more challenging is that the Steam ID is too long for the LUA number type, so it loses precision (which means two players could have the same value, if the Steam IDs were similar up to around the last 3 digits).

#

The value doesn't need to be per life though, just per user.

sturdy salmon
drifting stump
#

two players cant have the same because well its a server account

vast veldt
#

Yeah, if username is the only thing that's confidently unique, I'll base it around this - I was looking for a numeric type as the table I'm keeping state in for each player is numerically indexed (and needs to be for some of the later functions that work on it to operate correctly), but I can create a map from username to my own persistent index and use this - was just wondering if anything was already provided that behaved like this save re-inventing the wheel / duplicating functionality if it's already there.

drifting stump
#

weird and youre probably not taking advantage of tables but you could use sqlid

vast veldt
#

Is this the ID from the player database? I was just looking into how I might read from that (Something like https://zomboid-javadoc.com/41.78/zombie/network/DBResult.html ?), if you happened to have a pointer on how to get that, it would be very useful!

drifting stump
#

you shouldnt need to use the db and dont think that class is exposed to lua

ancient grail
#

what exacly are you trying to achieve?

vast veldt
#

The table I'm updating requires a unique index for each player - later behaviour requires that the index is numeric. If username is the only value that behaves like this (persistent and unique to a player), I'll map a map between username and index value, was just hoping the server had a unique numeric value for each player to hand.

#

i.e. PlayerNum / OnlineID felt like they might be this but they didn't seem to actually be unique amongst the players when testing.

drifting stump
#

playernum is for splitscreen

vast veldt
drifting stump
#

and why are you indexing numerically

#

you could map it to username

vast veldt
# drifting stump and why are you indexing numerically

The LUA table is later converted into XML - the XML processor determines the tag structure based on the key type, so if it's not numeric, it will use the actual key name in the XML tag, which is undesirable. I could rewrite the XML processor, but it works really well otherwise so I'd prefer not to add a workaround there, but preserve the numeric keys upstream in the player data.

vast veldt
ancient grail
#

then just use moddata or global moddata and give em your own serialcode

vast veldt
#

I've not yet used moddata, but assume it is somewhere I can attach persistent values/data to players and/or other objects?

bronze yoke
#

sqlid is the kind of thing you're looking for

vast veldt
#

So long as it's numeric, and doesn't get re-used amongst players, it'll do what I need.

drifting stump
#

you need to use reflection but someone mentioned it only works in debug mode

bronze yoke
#

iirc setting only works in debug

drifting stump
#

im barely ever out of debug so not sure on the behavior

sour island
#

you can read but not write afaik

vast veldt
#

Read should be sufficient for what I need, though I've not performed reflection in this environment before, anyone have an idea how it's performed?

sour island
drifting stump
#

well then youre good getting the sqlid though i would still do a custom mapping for better performance

#

you have to go through all the fields until you find the one youre looking for

sour island
#

Oh yeah for sure - might as well dump it into modData after

#

I kind of wish the hardware information was more accessible as a means to create a hardwareID

drifting stump
#

mapping name to id is just faster than iterating through fields

#

also keep in mind modData attached to a player is local and does not get synced

neon bronze
#

How can you check if an item is stackable or not? I tried to call CanStack() but it breaks on that call

nocturne dagger
#

is there any reason to why this happens?

#

editing the file directory in file explorer to models_X/Vehicles/Vehicles_96CivicSi doesn't change much

fast galleon
#

@neon bronze
what is an example of stackable obj?

fast galleon
neon bronze
nocturne dagger
neon bronze
#

But i looked into the java code and CanStack just always return false

nocturne dagger
#

do i have to put it like this

fast galleon
#

ah, never added a vehicle myself

nocturne dagger
#

tried it before and i had the same problem

#

i think this is actually the solution to this

#

thank god you mentioned it or else i would've gone crazy

#

IT WORKSSS

fast galleon
#

All inventory items can appear as a stack in inventory page.

*some clips have canstack=false in script though, which would set IsAimedFirearm to false? 🤔

vast nacelle
#

Is there a way to specify the RGB of a tint-able piece of clothing in a zombie outfit in clothing.xml?

dull moss
#

what does VERSION = 1, do in sandbox-optionx.txt btw?

fast galleon
dull moss
#

version of what

#

mod?

drifting stump
#

items themselves dont actually stack

fast galleon
dull moss
#

I see

vast veldt
#

I've been reviewing https://pzwiki.net/wiki/Modding:Lua_Event to see if I can find an event that appears on the server side for when a player connects and disconnects - the events OnConnected / OnDisconnect don't seem to fire at the server side however. Are there any events that might do so?

drifting ore
#

Hi guys, sorry if I'm not allowed to ask this here, what do we do to see which lua events get triggered upon doing a certain action? Like, I'm trying to find out how to get an event when you open a container

dull moss
dull moss
#

am I right in my understanding that

    if player:HasTrait("HeartyAppitite") then
        modData.StartingTraits.HeartyAppetite = true;
    end
    modData.StartingTraits.HeartyAppetite = modData.StartingTraits.HeartyAppetite or false;

would net same result as

modData.StartingTraits.HeartyAppetite = modData.StartingTraits.HeartyAppetite or player:HasTrait("HeartyAppitite");
#

should work, right?

agile vigil
# vast veldt Read should be sufficient for what I need, though I've not performed reflection ...

I also have a pair of methods for getting values out of a class field if you want something ready-made.

function getClassFieldByName(obj, name)
    for i = 0, getNumClassFields(obj) - 1 do
        ---@type Field
        local field = getClassField(obj, i);
        local fieldName = tostring(field);
        if luautils.stringEnds(fieldName, "." .. name) then
            return field;
        end
    end
    return nil;
end

function getClassFieldValueByName(obj, name)
    local field = getClassFieldByName(obj, name);
    if field then
        return getClassFieldVal(obj, field);
    end
    return nil;
end
#

Use like:

local wheel = getClassFieldValueByName(part, "wheel");
agile vigil
#

Unless modData.StartingTraits.HeartyAppetite is true and HasTrait returns false.

dull moss
#

cheers

vast nacelle
#

The mini-mobs of zombies that have a survivor zombie with a military backpack in the center, is that survivor zombie's outfit selected in lua or is that done java side?

vast nacelle
#

Thanks

drifting stump
dull moss
drifting stump
#

But if they dont have it anymore then they dont have it

dull moss
#

yes but i need to know if they had it

#

Describing conditions on which you lose/gain traits in here would take a lot of text, so just check goolge sheets for details (link in mod workshop page description). Affected traits that can be gained/lost dynamically: High/Low Thirst, Light Eater/Hearty Appetite, Thick/Thin Skinned, Slow/Fast Healer.<br>IMPORTANT: if you pick any of these traits in character creation they will be permanent on your character, both negative and positive.

#

last line

#

🙂

agile vigil
dull moss
#

i just initialize my modData OnCreatePlayer

agile vigil
#

So you could just do as Browser8 suggests there? Rather than re-setting every time 😉

dull moss
#

it doesn't re-set

ancient grail
#

Are you trying to change weight? I know how to do that if u are

dull moss
#

if there's already value\

agile vigil
# dull moss it wouldn't work

No, I mean, if you're doing OnCreatePlayer, and that's only run once. Why bother with anything that might be complicated to read later? Just do the simple direct approach Browser8 suggests. The code is only executed once per player created, so your ModData will remain the same throughout the playthrough.

dull moss
#

onCreatePlayer is ran every time player loads in

ancient grail
agile vigil
#

Now that explains it 😄

drifting stump
#

Traits are saved even so no need for that can just check if the player has it and do your thing if so

dull moss
#

I already did what I need

drifting stump
#

Yes if the player currently has it then he has it after a reconnect

dull moss
#

...

agile vigil
#

The intent is to let the player keep experiencing effects even if the trait is lost through other means.

ancient grail
#

Im not following u but i think i may have the codes on one of my mod

dull moss
#

Lemme grind it down for you

ancient grail
#

If your are trying to asign tempporart traits

#

Temporary*

agile vigil
#

The problem has already been solved laugh

dull moss
#

Yes

ancient grail
#

Cool

#

Sorry if i was lagging ly slow

dull moss
#

But I wanna explain why modData.StartingTraits.HeartyAppetite = player:hasTrait("HeartyAppetite") won't work

If I remove HeartyAppetite trait from player, next time he loads in, your line would say that modData.StartingTraits.HeartyAppetite = false. Would that be correct?

drifting stump
#

Indeed

dull moss
drifting stump
#

If you want it to still work why did you remove it then

dull moss
#

I don't need it to still work

#

I need to check if it's permanent or not

#

to see IF i can remove it

#

"IMPORTANT: if you pick any of these traits in character creation they will be permanent on your character, both negative and positive."

agile vigil
dull moss
agile vigil
#

No.

#

That line of code will evaluate to false or player:HasTrait("HeartyAppitite") when player:HasTrait("HeartyAppitite") = false.

#

Which means you'll be setting it to HasTrait and walk right into the issue with Bowser's approach.

dull moss
#

yes? If modData.StartingTraits.HeartyAppetite exists, leave it be. if it doesn't - set it to player:HasTrait("HeartyAppitite")

agile vigil
#

That's not what that means.

dull moss
#

yes it is?

agile vigil
#

It means if modData.StartingTraits.HeartyAppetite evaluates to true, afaik, when working with booleans?

#

Or rather, you're working with booleans, so it'll be one large boolean expression rather than an assignment of either A or B.

drifting stump
#

You are still overwriting the variable

dull moss
#

cmon ppl

#

didnt want to type it out so sent to ai

drifting stump
#

Just test it ingame then

agile vigil
drifting stump
#

Dont start with it

#

Then gain it

agile vigil
#

Here it states that

A useful Lua idiom is x = x or v, which is equivalent to
if not x then x = v end

drifting stump
#

Remove it

agile vigil
#

Which is not what you're looking for, since your x is a boolean.

drifting stump
#

You will have overwritten the initial value

agile vigil
#

i.e., it sets x to a default value v when x is not set (provided that x is not set to false).

drifting stump
#
local test = false
test = test or true
print(test)
#

run this and youll understand

dull moss
#

literally

#

created char with fasthealer,

#

removed via debug

#

reloaded

#

what are you talking about guys

drifting stump
#

create without

dull moss
#

dafuq

#

what is this bullshit man KekW

#

fuck me I hoped I won't have to do fucking 10 if statements in my moddata lua

#

thanks for heads up

#

@drifting stump @agile vigil

ancient grail
dull moss
#

what do you mean?

#

oh

#

I get it

#

ye that's better

ancient grail
#

U said you need to make multiple ifs statements

dull moss
#

Will do that

#

yeye

#

just get that shit in function that returns stuff

#

smort

ancient grail
#

So u can just put it on a single function and jist call that function so u .... Ow ok

dull moss
terse locust
#

Anyone know how the skill recovery journal 100% works? I tried using it but I barely got my levels back and im a lil confused

drifting stump
#

@sour island

terse locust
#

Wait is that the guy who made the mod?

ancient grail
#

Ye people dont much about mod authors i guess. So i bet puting authors name on the mod itself is the effective form of publicity/advertisment

ruby urchin
terse locust
#

He seems away right now, anybody else knowledgeable in the mod?

ancient grail
#

Its just been updated im not familiar with the changes .. what is it u want to ask

terse locust
#

Well I had like level 7 axe or something, Wrote in the journal with 100% retention, and when I picked it back up after death I'm level 3. While transcribing the journal it also said that I only written like 240 xp in it.

#

Maybe I think its something that its not?

#

I thought it'd just give me most if not all the levels back

ancient grail
#

Yeah the old data is gone i think he revamp the journal go to the mod page he wrote stuff there im sure

terse locust
#

I've read it like 15 times but Idk

#

The main thing to look at is

ancient grail
#

Maybe the last part

#

In progress probably ment current

#

Idk

#

Thats my guess

terse locust
#

I mean I think that that would indicate if I was close to level 8 that It would round down to 7

#

bc im not level 8 yet

ancient grail
#

Is this your server having problem with the thing? Just announce the mod got updated

terse locust
#

Its a singleplayer

ancient grail
#

Ah well just run debug nd give yourselef the level

terse locust
#

How do I do that?

ancient grail
#

U can open the player stats maybe

#

From the debug cheat options

terse locust
#

I'm not sure how to get there is that a mod? Or

ancient grail
#
         function PerkLevelup(player, perkType)
    local perkLevel = player:getPerkLevel(perkType);
    if perkLevel < 10 then
        player:LevelPerk(perkType, false);
        player:getXp():setXPToLevel(perkType, player:getPerkLevel(perkType));
        SyncXp(player)
    end 
    end
function getGodPerks()
    for i = 0, 10 do 
    PerkLevelup(getPlayer(), Perks.Reloading);
    PerkLevelup(getPlayer(), Perks.Aiming);
    PerkLevelup(getPlayer(), Perks.Nimble);    
    PerkLevelup(getPlayer(), Perks.Sprinting);    
    PerkLevelup(getPlayer(), Perks.Sneak);    
    PerkLevelup(getPlayer(), Perks.Lightfoot);    
    PerkLevelup(getPlayer(), Perks.Maintenance);
    PerkLevelup(getPlayer(), Perks.Blunt);
    PerkLevelup(getPlayer(), Perks.LongBlade);
    PerkLevelup(getPlayer(), Perks.SmallBlade);
    PerkLevelup(getPlayer(), Perks.SmallBlunt);
    PerkLevelup(getPlayer(), Perks.Axe);
    PerkLevelup(getPlayer(), Perks.Spear);    
    PerkLevelup(getPlayer(), Perks.Electricity);    
    PerkLevelup(getPlayer(), Perks.MetalWelding);    
    PerkLevelup(getPlayer(), Perks.Mechanics);    
    PerkLevelup(getPlayer(), Perks.Woodwork);
    PerkLevelup(getPlayer(), Perks.Tailoring);    
    PerkLevelup(getPlayer(), Perks.Doctor);    
    PerkLevelup(getPlayer(), Perks.Cooking);    
    PerkLevelup(getPlayer(), Perks.Farming);    
    PerkLevelup(getPlayer(), Perks.Fishing);    
    PerkLevelup(getPlayer(), Perks.Trapping);    
    PerkLevelup(getPlayer(), Perks.Fitness);
    PerkLevelup(getPlayer(), Perks.Strength);
    end
end

getGodPerks()
#

here paste this on debug

terse locust
#

What is that?

#

Is my screen meant to look like this

#

oh wait

#

i think I got in the actual game

ancient grail
#

Just paste it on the debug then press enter

#

On the lua console

#

Press f11 i think

#

Theres a mod conflict on your setup maybe

#

Yes untick the checkbox on the top left ish

#

Damn left my cigarrete to type that code its gone when i came back 😂

terse locust
#

I think yeah I got my levels back, but I feel like this is super cheaty and I wanna figure out the actual mod yk?

#

@sour island if you see this please read up real quick and lmk what u think

#

Thanks @ancient grail I gtg tho

thick karma
#

Am I crazy or is item below simply nil?

    -- walk to
    if JoypadState.players[player+1] == nil and not playerObj:getVehicle() then
        if test == true then return true; end
        context:addOption(getText("ContextMenu_Walk_to"), worldobjects, ISWorldObjectContextMenu.onWalkTo, item, player);
    end

From ISWorldObjectContextMenu.lua in createMenu.

sour island
#

The update may require you to craft a new journal - and to use that new one and the old one, side by side until you die.

#

I wrote something to carry over the old method into the new - but people are also getting confused.

sour island
#

I probably need to redo the sandbox handling as non set variables are nil -- so I should've made it behave like the old style if nil not default 🧠

#

People also don't seem to be aware of bonus XP multipliers :/

#

Or read any changelogs

terse locust
#

Oh hi! I just checked back. So @sour island I didn't exactly pick up what your saying sorry!

#

You're saying there was an update or something?

robust jetty
#

Any way to know x and y of ui?

ruby urchin
robust jetty
#

what is ui.instance?

bleak prairie
#

are there docs i can look at for lua support? im trying to grasp what everything is lol

sour island
#

That may explain issues with less than expected results. Both can be toggled on with sandbox.

terse locust
#

Which then I just need to test the settings

ancient grail
#

he wont have access to sandbox

quartz badge
#

im trying to host with true music and all its required addons and my server gets stuck on "initializing"

#

without the mods the server starts fine

ancient grail
quartz badge
#

thanks\

thick karma
thick karma
quartz badge
#

its like 10 mods

thick karma
#

Mmmmm suspicious

quartz badge
#

is it because true music addons are like 300 megabytes each

thick karma
#

DM me the 10 mods if you want that's not hard to test

quartz badge
#

this is my collection

thick karma
#

I see that's possible

quartz badge
#

should i just wait it out? the max i waited was like 4 minutes

thick karma
#

Possibly, yeah, it could take more than that if it's a ton of stuff to load, depending on PC

quartz badge
#

i have a really good pc

winter thunder
# quartz badge i have a really good pc

Not just pc, but also internet speeds and stuff. I’ve had similar issues on first time loads- I would also try opening a solo map first, then closing it and joining your server. Idk why but I have noticed that helps cut down on the timing of things since it preloads a lot of the files

plucky sluice
#

From a playerObj how can you know the way the player is currently facing? I wan to know id a player is going upstair or downstair

dull moss
#

Glytch u still here?

winter thunder
#

Anyone know if it’s possible to have traits locked to only be selectable for specific professions?

Like, say I took a profession like unemployed. I want to give the player the option to select a new trait, but ONLY for that profession

#

So it’s not tied intrinsically to the profession, but instead costs points as an additional player option

bronze yoke
#

i think something like that was being worked on for profession framework?

vast nacelle
#

Don't think you can do that directly, but you could add a "NotUnemployed" trait to every other profession and make that trait exclusive to your profession-limited one.

#

Though its a bit ugly in the UI, especially if you are adding a bunch of profession-limited traits to various professions.

winter thunder
#

Yeah, but it’s the opposite from what i see. Like- it makes specific traits not selectable for a profession. Which would work, but would mean I would need to account for every single profession separately 😭

winter thunder
quasi geode
sour island
dim hill
#

Hey, anyone familiar with The Workshop?

What's the name of the workbench you can make in the crafting menu to start using the thing?

keen swan
#

Anyone know if theres a mod that lets alll the origins craft the bombs and noisemaker that engineer can make

ancient grail
dull moss
#

yo

#

so that or deal

#

it only doesnt work if 2nd option is false?

#

or if it's boolean?

#

or what's the deal 😄

bronze yoke
#

using or to make a default value?

#

that doesn't work if the first option (the existing value) is/can be false

dull moss
#

oh

ancient grail
dull moss
#

so 1st one can't be boolean

ancient grail
#

Ye or only needs to check 1 in order to do the function

dull moss
#

How the hell does it know that it can be boolean though, when you create variable you don't specify that it's boolean, does it check the 2nd option and then goes like "oh ye it's boolean"?

lusty marsh
ancient grail
#

Can you repost your code

bronze yoke
#

it's nothing to do with it being boolean

dull moss
#

modData.StartingTraits.LightEater = modData.StartingTraits.LightEater or player:HasTrait("LightEater");

bronze yoke
#

or returns the first half if the first half evaluates to true, otherwise it returns the second half

ancient grail
bronze yoke
#

and false of course doesn't evaluate to true so it doesn't work

dull moss
ancient grail
#

Put a
local on that to help with the length

dull moss
#

I do that in code that works with those, I want them to be grouped nicely in my moddata lua

#

ignore mid part I haven't redone it yet KekW

lusty marsh
ancient grail
dull moss
#

do you want to swap out modData.StartingTraits for local var?

#

and/or sleep system

#

I'll do it myself in a bit, atm busy with writing up workshop text 🙂

plucky oxide
#

Hi! Anyone know anything about coffee?

I added a new customMug (like the spiffo mug with another logo), so the empty item and a HotDrinkCustomMug version, these items work well. The problem is that I can't get the option to make the hot drink with a right click on the item. So I added a new evolvedrecipe for my mug but I have no recipe display.

I couldn't find a mod that used a new item in an existing recipe. Does anyone know how to point me in the right direction?

ancient grail
#
local sTrait = modData.StartingTraits
local st = {}

st[1] = "HearthyAppetite"
st[2] = "LightEater"
st[3] = "LowThirst"
st[4] = "SlowHealer"

for k, v in pairs(st) do 
  if pl:HasTrait(st[1]) == sTrait[st[1]] then 
    print(sTrait[st[1]])
  end 
end

#

something like this im sorry if it doesnt work im not really sure how to write it lol

#

but just to give an idea if it could

#

but this is just polishing it and maybe somewhere along the line it would be easier to code the next parts

#

but if your code already works then might aswell use that

#

but the idea is to store the "HearthyAppetite" string to be able to easily just put that string when you ask the if questions later

#
local sTrait = modData()['StartingTraits']
local st = {}

st[1] = "HearthyAppetite"
st[2] = "LightEater"
st[3] = "LowThirst"
st[4] = "SlowHealer"

for i = 0, #st -1 do 
    if sTrait == st[i] and  pl:HasTrait(st[i]) then
    --dostuff
    break
    end
end
#

maybe thats better?

humble oriole
#

Can anyone point me in a direction as to why my mod data won't initialize on the server side for this object? I know it's somewhat impossible without looking at the code, but a direction to look would be nice 😭

ancient grail
#

transmitmoddata

#

i think

#
item:transmitModData()
dull moss
#

interesting

terse locust
#

aLSO @sour island i'M NOT SURE IF THIS IS A GLITCH (caps) but I randomly got 3 extra skill levels aiming even though I didnt have it.. I don't really mind just odd

ancient grail
#

again im not ssure if it will work but what this does is you can add all the traits easily to the table if the server adds other traits

humble oriole
# ancient grail ```lua item:transmitModData() ```

I have this on my server object definition.

    self:initNew()
    if SBioGasSystem.isValidModData(isoObject:getModData()) then
        self:noise("Valid Data")
        self:fromModData(isoObject:getModData())
    end
    self:saveData(true)
end```

```function SBioGas:saveData(transmit)
    local isoObject = self:getIsoObject()
    if not isoObject then return end
    self:toModData(isoObject:getModData())
    if transmit then
        isoObject:transmitModData()
    end
end```
ancient grail
#

it maxed out your stats

terse locust
#

Oh no

#

I didnt run it

ancient grail
#

is it sprite/texture related

humble oriole
#

no, just values that need to be updated hourly.

ancient grail
#

or you can refer to maybe farmin related lua

#
function ISFillGrave:changeSprite(square)
    for i=0,square:getSpecialObjects():size()-1 do
        local grave = square:getSpecialObjects():get(i)
        if grave:getName() == "EmptyGraves" then
            grave:getModData()["filled"] = true
            grave:transmitModData()
            local split = luautils.split(grave:getSprite():getName(), "_")
            local spriteName = "location_community_cemetary_01_" .. (split[5] + 8)
            grave:setSpriteFromName(spriteName)
            grave:transmitUpdatedSpriteToServer()
        end
    end
end
#

or maybe this? but remove the sprite part

#
function DebugContextMenu.setForceLockDoor(worldobjects, door, player)
    if not door:getModData().CustomLock then
        door:getModData().CustomLock = true
    else
        door:getModData().CustomLock = false
    end
    door:transmitModData()
end
#

heres another one
i think this onens better suited

#
transmitCompleteItemToServer

could also be this one .. ihavent tried what your doing but this what i seeon the vanilla

humble oriole
#

aight, thanks for the examples, I'll stare at it some more until it works haha

rain shard
#

Hey guys, I got a question. If I am broadcasting a message to the chatbox, is there a way to make it in a local range rather than globally to the server?

rain shard
#

wait is that something utilized in processSayMessage or am I using the wrong function?

ancient grail
#

ah ok

#

i thought it was just a general question

rain shard
#

No sorry lol, I should've specified more.

ancient grail
#

check out ISChat:onCommandEntered()

#

ISChat.lua

rain shard
#

Ty, this was driving me insane hopefully this is it

ancient grail
#

this might also be useful

rain shard
#

Hrm. I'll stare at it, because right now I have it like processSayMessage("Sorry, you can't do that unless you're an admin!") if a command is entered but maybe I'm approaching this wrong

#

Oh, nevermind. I'm just dumb, it's just a large range and not global.

#

Thank you for the help, I might try to refactor this with this though.

winter thunder
#

If I am putting functions in a table, can I add parameters to the functions? Or do they have to be listed without ()

bronze yoke
#

they have to be listed without ()

#

if you use () you're not passing a reference to the function, you're calling it and passing the return value

ancient grail
weak sierra
#

there is not, at present, i will add it to the list of stuff to do when i next revisit the mod to fix some other stuff.

terse locust
#

What your guyses opinion on advanced trajectory

ancient grail
winter thunder
bronze yoke
#

it was pass that as an argument

winter thunder
#

What do you mean?

bronze yoke
#

like drugData.sideEffect(false) passes false as the first argument

#

a function is a function, it doesn't matter how exactly you're accessing it

sour island
#

Ye - see my last snippet

winter thunder
#

Like, it will pass that to the function that is in the table?

bronze yoke
#

yeah

sour island
winter thunder
#

oh, hell yeah

sour island
#

You can use the key to access a function that is a value

#

And pass arguments to it just fine

#

Helps cut down on copy pasting as you can manipulate the key using [""]

winter thunder
#

beautiful! I am trying to find a way to use a single identifier, so it will know the specific function to call based

#

Like- I am tying the category of the drug in its table to various different variables. So that will make the whole thing really straightforward

#

if x then just checks to see if a variable exists, right?

sour island
#

Exists and not false

winter thunder
#

so like, this:

        if drugData.baseEffects then
            drugData.baseEffects(drugMultiplier)
        return
        end

Would check to see if that table instance exists, then run the function

sour island
#

x~=nil if you need false to pass

#

Yep but drugData is modData?

#

You can't store a function in modData afaik - and probably shouldn't

winter thunder
#
local x = item:getModData().DrugID
    local drugData = DrugInfo:getDrugInfo(x)

Nah, I have a lua table. So, I put the name of the table instance in the modData of the item

sour island
#

Ah ok 👍

winter thunder
#

The funciton I am currently using takes the drug category and the reference for the table info from my main function as seen above. Idea is that I can run this function with just the category of drug or with the specific info from the item. This would let me run the function both tied to my OnEat function trigger, as well as independently using just the Drugs Category.

local function DrugsInPlayerSystem(drugCat, drugData)

The reason I am running the above if statement is basically just to see if this exists, if not, it will run the basic function defined by the category. But I would prefer to not reference multiple tables if I dont need to, so that is my fallback option

rain shard
#

Is there a way to edit the queue join time? AKA not process 1 user every 30s and shortening that time itself? Is there somewhere to reference that?

dull moss
#

@ancient grail smthing like this?


local function checkStartingTrait(startingTraits, player, trait)
    if startingTraits[trait] == nil then
        startingTraits.HeartyAppetite = player:HasTrait(trait);
    end
end

local function createModData(playerIndex, player)
    -- stuff here
    checkStartingTrait(startingTraits, player, "HeartyAppitite")
end
```?
#

oh forgot return

#

oh wait its not needed

ancient grail
#

ow wow nice

dull moss
#

there

ancient grail
#

es somethign like that is better

dull moss
#

now fun part

#

cuz of typos in game

#

i have to provide special case for 2 of those

ancient grail
#

huh

dull moss
#

cuz I refuse to have variables with typos in my code

ancient grail
#

ye but your are referring to the vanilla syntax so

dull moss
#

ye but

ancient grail
#

no buts

#

lol

dull moss
#

no, look

ancient grail
#

kidding

dull moss
#

if I pass checkStartingTrait(startingTraits, player, "HeartyAppitite")

#

it'll create startingTraits.HeartyAppitite

#

Appitite

#

Good grammar

#

as I said before

#

spellcheck is new feature

ancient grail
#

anyone knows how deactivate an entire lua file

#

without overwritting it

#

cuz its already an overwrite of something

#

its overwritting the vanilla stuff so id like todisable it so i can overwrite the vanilla

dull moss
#

overwrite wars

signal falcon
#

anyone know a mod similar to skill recovery journal mod?

dull moss
#

Why'd you need anything that's similar to perfection when you can have perfection

signal falcon
#

the mod is currently not working, the author is working on hotfixes rn

ancient grail
#

wow chuck is really in demand

#

the mod actually works idk why people think otherwise read the description iguess it will explain alot

dull moss
#

Nah Chuck actually updated it and broke some stuff from the looks of it

signal falcon
#

i know it works, ive been using it for a while

dark wedge
# ancient grail anyone knows how deactivate an entire lua file

If what your checking for is defined at startup, you can just return . For example, I have this at the top of a file in one of my mods:
if getActivatedMods():contains('ClothingActionsRM') then return end
Just literally at the top of the file outside of all functions. Will just return and stop processing the file if true.

ancient grail
#

no cuz this will just prevent my lua to run

#

cuz its asking if this mod is active and iknoow it is cuz i required it

#

then return so meaning my lua wont run

#

i tried overwritting the file already but mine gets loaded first so it overwrittes mine

dark wedge
#

Oh, you're attempting to disable a lua file in another mod or something? You can just try to override it later. As in, if it does it on initial mod load, you do it OnGameBoot. If they do it OnGameBoot, you do it OnGameStart. etc

ancient grail
#

how exactly

#

the thing is this

#

im using chucks container api

drifting ore
#

Can anyone help me please? I have a model of a gun and a sound for it, I need to change the default m4 to the one I chose

ancient grail
#

and the only problem now for me is he replaced the ISInventoryTransferAction:isValid()

#

i weant to revert it to vanilla

ancient grail
#

add the sound

#
module Base  {
  
 sound ATMCash {  category = Improvised, clip { file = media/sound/ATM_sfx.ogg,  }  }
}
#

like that

#

or just make it base

dark wedge
# ancient grail i weant to revert it to vanilla

Ok, looking at that mod it overrides the function when mods are loaded. So you could just do:

local ISInventoryTransferAction_isValid = ISInventoryTransferAction.isValid
function ISInventoryTransferAction:isValid()
...Put the vanilla code here...
end
end)```
Since that mod gets to it first and overrides the table, not sure how else to restore that than override again later and just restore the vanilla code.
bronze yoke
#

you could override his file, but load order can be a pain with that

ancient grail
#

copy the script fiole of the vanilla but change some stuff

bronze yoke
#

you could make sure your file loads first, save the original function, require his file, then reset the function to the one you saved

dark wedge
bronze yoke
#

then you'd only overwrite his mod and no others

ancient grail
#

it wont work like this i think

#

cuz self trigger function should have the names right

#

i thinkl

#

syntax error

#

function ISInventoryTransferAction:isValid()
ISInventoryTransferAction_copy()
end

function ISInventoryTransferAction_copy()
--paste vanilla func
end
#

this could work i think

dark wedge
#

I'm not sure I follow. The syntax is correct, you are just overwriting the isValid method on the ISInventoryTransferAction table on Game Start instead of when Lua files are read

bronze yoke
#

i was thinking like this:

local old_isValid = ISInventoryTransferAction.isValid
require 'other_file.lua'
ISInventoryTransferAction.isValid = old_isValid
#

your mod has to load first though

ancient grail
#

i rarely see stuff that calls a function within a function u sure this will work

#

cuz its hightlighted red on my ide

#

function() function ISInventoryTransferAction:isValid()

#

i know this works

#

ive seen it done but i dont think i can pull it off on this

dark wedge
#

Here is an example from a mod i have published using this method. works 100%

dull moss
#

dafuq

dark wedge
#

The rest of my ISInventoryPage:update() function is then called after the base

bronze yoke
#

i thought we were trying to undo what another mod has done?

dull moss
#

ok my mod is pretty much done, just waiting for my mod image and gonna finish documentation and prob gonna release tomorrow hypers

#

depends if i'll get my mod picture today or not KekW

ancient grail
dull moss
#

waiting for fren to provide happychamp

dark wedge
ancient grail
#

this is how chuck overwritten the thing

#

can i used your solution with that

bronze yoke
#

yeah, as long as your mod runs first, that should work

ancient grail
#

and just have it ignore the lua and get the parts i needed from it by copying it

#

idk if that will work cuz i require it

#

meaning its gona run first always

#

like in the mod info

bronze yoke
#

that doesn't affect load order

ancient grail
#

was it mod info not sure

#

the steam require

#

ow ok

ancient grail
#

wait you know what this might actually work

#

i just forgot to remove the last end function so it highlighted red earlier

dark wedge
#

Ah! I have to just stare at VSCode sometimes until I see issues. ha. It's not pretty, but should work for you

ancient grail
#

dude you are friken

#

ow man

#

you nailed it

#

omg!!!

#

i dont have to wait fopr chuck to wake up and clean the api,. he can just continue to fix the journal and i still required his mod

#

win win

#

thnx alot @dark wedge

#

i will never have doubts about what your saying ever! lol at first it didnt think it would work .,. but your method is better than how others overwrite things

#

where did you learn that

dark wedge
#

Through necessity. lol. Some modders don't run the underlying functions and just spin their own, which breaks the chain. Just overriding it later in the process makes it work.

#

No criticism there! I admit its necessary sometimes. Just have to work around it when it is a thing. Ha

ancient grail
dark wedge
ancient grail
#

autodesk maya cant handle x files

dark wedge
#

I love me some blender. but i'm stuck using that fragMOTION app for now. through a windows vm. ha. only old blender can handle .x files, and i couldn't get that to work. i used the vanilla animations as my base, so i have to use an application that reads those ".x"

#

its to the point where i just edit the raw files to copy animations because its faster. i hate it, but it works

ancient grail
#

Sounds like hardcore stuff

agile vigil
#

Trying my hand at using classes in Lua and I'm genuinely not sure what I'm doing wrong.

I've made a minimal class:

require "MutiesDiary"

---@class MutiesDiary.Player
MutiesDiary.Player = {};
MutiesDiary.Player.Type = "MutiesDiary.Player";
---@field player IsoPlayer | IsoGameCharacter | IsoObject

---@param self MutiesDiary.Player
---@return boolean
function MutiesDiary.Player:canRead(self)
    return not self.player:getCharacterTraits():isIlliterate();
end

---@param player IsoPlayer
---@return MutiesDiary.Player
function MutiesDiary.Player:new(player)
    local object = {};
    setmetatable(object, self);
    self.__index = self;

    self.player = player;

    return object;
end

And then I call it with

    local player = MutiesDiary.Player:new(character);
    if not player:canRead() then return false end

elsewhere, but despite the :new() method being run perfectly, and self working fine in there, as soon as I return object I end up with a blank table scratch

agile vigil
#

Oh, you don't put self in the argument list for your class functions 🙂

drifting ore
#

@faint jewel Do you know if trailers from W900 Semi-Truck mod need a special parking zone to be spawned in?

faint jewel
#

not that i know of?

drifting ore
#

While testing my map and various mods, I have never seen any trailers to be spawned anywhere hmmm.

fast galleon
fast galleon
#

you either do obj.func(self) or obj:func()

agile vigil
#

Yeah it was all I did wrong.

#

Everything working after that.

fast galleon
#

@agile vigil

agile vigil
#

I see.

jaunty marten
#

assign values to new table not to self cuz self in new function still just a MutiesDiary.Player

agile vigil
jaunty marten