#mod_development

1 messages ยท Page 93 of 1

hot patrol
thick karma
#

I'm confused... Not sure why it would work sometimes and not others

hot patrol
#

welcome to my world

thick karma
#

When do you call the code that initializes the ArrayList?

#

Wait errors are reported during gameplay right?

hot patrol
#

this persone got the errors preloading the map. I've never noticed the error playing with it

thick karma
#

Okay then yeah when do you populate that arraylist?

hot patrol
#

I have no idea. Where would I look?

#

lol this is why I get mods commisioned now. I am not cut out for this

thick karma
#

When do you call this

#

That code is populating your arraylist

hot patrol
#

If I had to guess. Whenever you load in an area with a viable double bed that can spawn the item. That is what the spawn pillow code is supposed to do

thick karma
#

I meant in your code

#

Is that arraylist simply declared in a file?

hot patrol
hot patrol
thick karma
#

You init DakimakuraWeapons here: local DakimakuraWeapons = require("DakimakuraList")... that initializes it and pulls it into DakiArmor

lavish arch
#

How do I translate a mod that doesn't have the "translate" folder in lua>shared?

thick karma
#

Someone will need to go into the code and implement a translation file

thick karma
#

However this is not clarifying why it isn't loading for me... Are these files in the same mod folder?

hot patrol
#

yea

#

if not it would never work, no?

lavish arch
thick karma
#

Or other mods entirely

hot patrol
#

oh well they are in the same mod folder

#

and yea that makes sense since my mod allows addons from others

#

So no other ideas what might be causing the issue?

ancient grail
# hot patrol this is the array list
DakimakuraWeapons = {}
for i=1, 30 do
local item = ("Dakimakura"..i)
table.insert(DakimakuraWeapons,item)
end


just trying if i can do the table not sure if mine will work tho

sour island
#

doesn't really matter if he uses an array or table

#

although it doesn't seem like using an array offers any benefits here

hot patrol
sour island
#

you can do the same with a table

hot patrol
#

oh

sour island
#

Not a huge deal - just caught my eye as odd

#

that being said which line is causing issues? local item = ... ?

#

Are you able to recreate the error btw?

#

like personally?

hot patrol
#

this one

hot patrol
sour island
#

btw

#

size() needs to be size()-1 ?

#

wait nvm ZombRand doesnt include n

sour island
#

given you have the same mods as the guy

#

and try to do what he did with 'preloading'?

hot patrol
#

yea ive never even used a map preloader

sand harbor
#

Is there any easy way to set a vehicle's engine quality or loudness? I've only seen it done with the debug function which can only set quality to 100.

sour island
#

@jaunty marten I threw all the uielements under going my genericOpenPanel with these

local function genericRestoreLayout(self, name, layout)
    ISLayoutManager.DefaultRestoreWindow(self, layout)
end

local function genericSaveLayout(self, name, layout)
    ISLayoutManager.DefaultSaveWindow(self, layout)
    ISLayoutManager.SaveWindowVisible(self, layout)
end
#

Works like a charm, but I'm wondering would I be able to call on restore-layout to get them to be opened when the game boots?

#

Right now when you click on them they appear where you last moved them, even across sessions

hot patrol
#

@sour island I'm using the map loader the guy was using rn and so far no errors

#

so idk

sour island
#

yeah better to just ignore it tbh ๐Ÿ˜‰

#

'I was not able to replicate these errors'

#

also the line with and item should prevent the error

thorny garnet
#

Is there a quick guide on rewriting/altering vanilla Lua?

idle dawn
#

I'm trying to figure out how to instantiate and place in world a new IsoObject. ๐Ÿ˜

#

Reeeee

#

Been working on this for too long

red tiger
#

O/ @sour island

red tiger
#

Am legit buzzed ATM. Thought I'd stop by and see what people are up to modding wise.

thick karma
idle dawn
#

Been trying that methink.

#

Guessing that's not possible with lua?

thorny garnet
#

Say I'm trying to rewrite certain methods in ISFixGenerator.lua, I would copy/paste the original code into a file also called ISFixGenerator.lua (within lua\client), changing what I need - right? Or does this also need to be added to an event as well

thick karma
#

I'm not sure tbh haven't tried that with a simple IsoObject

#

I did it with a light source from javaside though and it worked fine

idle dawn
#

It's also hard to read the ingame debugger at times.

#

Spits out so much stuff.

thick karma
#

.new

idle dawn
#

I'll try that but I'm almost sure I did that already. Plus new is a method methink.

#

Or maybe it is a function.

#

hh

sour island
thick karma
#

:new passes the stuff before : as self. You cannot send IsoTrap as self to its own constructor in Java.

idle dawn
#

Right.

thick karma
#

IsoTrap has two constructors:

IsoTrap(HandWeapon weapon, IsoCell cell, IsoGridSquare sq)
IsoTrap(IsoCell cell)
idle dawn
#

I'm almost certian I traid but y

red tiger
idle dawn
#

Sorry I ran the debug scenario and instantly heard zombies. Grammar be damned.

sour island
# red tiger How are you?

Good, just chipping away at these debug tools. Mostly making vanilla UI behave more consistently ๐Ÿ˜… - and finding ways to refactor stuff to work with less lines of code

thick karma
idle dawn
#

Yeah.

sour island
#

Someone asked for a viewer for java fields - so I might work on that

thick karma
#

You can expand the error window in F11 menu FYI @idle dawn

#

You should send a screenshot of the error

red tiger
sour island
#

cough errorMagnifier cough

idle dawn
#

Let me try.

sour island
idle dawn
#

Something new is happening now with that change.

red tiger
#

Take that from someone who has to know when making the Typescript for PZ.

#

Yes

#

Static fields

thick karma
sour island
#

the getters are static fields? ๐Ÿค”

idle dawn
#

Breakpoint isn't being hit, but player+zombie becomes invisible. there is an error though.

thick karma
#

He's not linking you because he made it, but it is awesome

red tiger
#

Anything else requires a getter setter

idle dawn
#

Thank you so much

#

Like I said hard to actually see the real error.

sour island
#

you have breakpoints?

idle dawn
#

It's set to break on error.

thick karma
#

So you are not getting an exception?

#

If you have it set to break on error and the game throws an exception in -debug mode, it will pause...

idle dawn
#

exactly why I say it's weird.

rustic grove
#

for anyone coming by later, the answer is that MyUI.instance = o; ended up being the one that properly tracked the instance of the window to check :isVisible(), properly referenced the window, etc. Thanks again albion!

iron salmon
#

I didn't read up on the discussion and will do shortly in case there's a nuance I am missing.

But no, taking a commission is not against the TOS. The owner of a mod can absolutely give away ownership as they see fit.

2.4. Commercialisation. Unless any arrangements to the contrary have been made with us, mod creators cannot sell access to a mod and/or mod content. Mod creators are permitted to work on commissioned mods provided such mods are not sold. Please see section 4 of the Terms & Conditions for more information on this.

Selling mods means selling it to players, i.e. a modder telling ***players ***"want to use my mod? pay me".
What it doesn't mean is paying someone to make (and maintain) the mod.

sour island
#

๐Ÿ‘ There was some confusion regarding the 1:1 transaction being technically a private distribution

idle dawn
#

til modlist is in alphabetical order but lowercase is sorted under uppercase

#

reeeee

sour island
#

ye

#

chinese characters under that - but don't display

#

๐Ÿ˜„

#

That's why the older Change Sandbox Options appears at the end

thick karma
idle dawn
#

Yep

#

Also, the errorMagnifier isn't even showing up for it.

#

Shows in log.

thick karma
#

Want a real mindbork?

#

~ comes after everything but alphabetizes first in Windows explorer

#

It loads last (in alphabetical load sequences) and appears first

#

xP

red tiger
iron salmon
thick karma
#

When people in DND mode are typing, it looks so scary...

iron salmon
#

Impending DOOM

thick karma
#

nasKo's thoughts incoming in the color of a bloody battlefield

#

I don't know you but it just says fear you

idle dawn
#

I've no idea on this.

red tiger
#

Thanks for keeping the door open for rewarding works for modders that makes player's who are willing to reward said modder to make their improved experience with PZ possible.

#

Fucking win in my book.

#

That makes it worth continuing to work on PZ for me.

idle dawn
#

But it's too much and they're not showing up anywhere else.

sour island
#

So there's no error?

idle dawn
#

Recorded it, one sec.

#

See how the trees and zombies flicker out?

#

And any "errors" are showing up in the console.

#

Not in F11 or errorMagnifier.

sour island
#

that's odd

ancient grail
#

Nasko used to do freelance works which us why he knows the struggle and all that crap..

ancient grail
idle dawn
#

I usually make something easy when starting out modding.

#

Also I have a feeling I know what it is.

#

Even more funny @thick karma The game decides to do this after restarting a scenario without exiting the game.

#

One sec

#

Not doing it anymore. ๐Ÿ˜

#

It did a spooky: "Mod is causing the game to die check the console exit to windows"

#

There it is. Only happens when I change maps after the above happens.

#

In game bsod

#

lmao

thick karma
#

You should post console.txt

idle dawn
#
zombie:getSquare():AddTileObject(trap)
#

Removed that and problem stopped.

thick karma
#

Oh I have an idea. Maybe since you never assigned a sprite or anything to the trap you created, it bugs out when it tries animating it.

#

You're getting a missing sprite error in your console in that video

idle dawn
#
ERROR: General     , 1674530090714> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: can't create player at x,y,z=10596,8818,0 because the square is null at IsoWorld.init line:2799.
ERROR: General     , 1674530090715> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: can't create player at x,y,z=10596,8818,0 because the square is null
    at zombie.iso.IsoWorld.init(IsoWorld.java:2799)
    at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
    at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1674530090715> LuaEventManager: adding unknown event "OnPreUIDraw"
LOG  : General     , 1674530090716> LuaEventManager: adding unknown event "OnPostUIDraw"
LOG  : General     , 1674530094081> EXITDEBUG: Core.quit 1
LOG  : General     , 1674530094081> EXITDEBUG: Core.quit 3
LOG  : General     , 1674530094085> EXITDEBUG: Core.quit 4
#

There's that.

#

And yeah lemme try.

#

I'm assuming the isometric map code just got killed by my code.

#

And it hit the bucket on new load.

sour island
#

can't create player at x,y,z=10596,8818,0 because the square is null

idle dawn
#

That's nowhere near my code luckily, and it's happening when it starts a new map after the above video happens.

thick karma
#

You can't load into the game now?

idle dawn
#

I can if I restart the game entirely.

ancient grail
#

This might be dumb cuz im sure its nots possible but what the heck ill ask anyways

Theres the
instanceof(obj, 'isoSomething')

I was wondering if you can do the reverse

Like directly ask what isoobj is this

Instead of if its thiskind the

bronze yoke
#

iirc you can but only in debug

#

i might be misremembering that though, i never messed with the debug-only reflection stuff

ancient grail
#

Ow ok .. cuz i was wondering
Why most functions
Gather stuff then filters em

Instead of choosing what to gather

If that makes sense

sour island
#

you can do type(object) unless I'm misunderstanding the question/request

idle dawn
#

He's trying to do the equivalent of ObjType = type(obj) // returns "isoSomething"

#

From the above he posted.

#

It's not it though afaik

dark wedge
sour island
#

:getClass():getSimpleName()

#

gets 'IsoPlayer' from getPlayer():getClass():getSimpleName()

#

@ancient grail

bronze yoke
#

keep in mind this won't work outside of debug mode, so it's no good for anything except debug tools/testing

finite cedar
#

I'm trying to get the user to shout something & while it seems to display a message above their heads, it isn't in the shout text color + it doesn't seem to attract zombies, regardless of whether it is done via Say or SayShout

getPlayer():SayShout("This seems like the spot...")

#

Does anyone know the additional command that is necessary to attract zombies?

#

sorry for barging in like this I just had a quick question i'm sure someone's had to deal with before

bronze yoke
#

yeah, a couple of the reflection-y things are locked behind debug mode by the exposer

astral dune
#

calling Method objects or writing to Fields are debug only, is getClass() the problem here?

bronze yoke
#

i see code for exposing getName and getSimpleName only if debug mode is enabled

#

i imagine getClass() is always fine, but that none of its methods are exposed normally

#

(and those are the only two methods that are exposed even in debug mode)

sour island
#
            if (Core.bDebug) {
                try {
                    this.exposeMethod(Class.class, Class.class.getMethod("getName"), LuaManager.env);
                    this.exposeMethod(Class.class, Class.class.getMethod("getSimpleName"), LuaManager.env);
                } catch (NoSuchMethodException var3) {
                    var3.printStackTrace();
                }
            }
#

rip

#

I believe using tostring on an object returns the class name @ ref #

#

you could string manipulate it to remove everything after with the @

#

Might not look like it but this is what peak debugging looks like

#

All debug panels now undergo process that makes them save layout (position and if opened or not)

#

as well as changes their button behaviors to close open windows

#

going to make right clicking the button reset position and move onto another feature

#

if anyone has ideas feel free to share / post it on the github ๐Ÿ‘

idle dawn
#

Having one more small issue.

#

local trap = IsoTrap.new(null, zombie:getCell(), zombie:getSquare())

#

Where null is, I have to grab an instance of a HandWeapon.

#

While it literally doesn't matter where or what, without it it won't work.

I can use the other constructor that only needs that zombie:getCell() part but trying to move it in place with AddTileObject(trap) is throwing errors.

#

Let me try again now that I fixed things up.

finite cedar
#

no idea if this is in fact correct but it has the intended effect

idle dawn
#

God I

#

LOVE

#

This documentation

#

It's so detailed

#

N shit

#

I know exactly what n5 does.

#

Or what it is.

#

Probably volume.

#

Might also be able to do something like WorldSoundManager.instance.addSound(ObjectSource, X,Y,Z, Range, Volume)?

bronze yoke
idle dawn
#

Thanks for the assist guys. Understand this wacky modding better.

ancient grail
ancient grail
#

Thnx

ancient grail
idle dawn
#

One better way is to delay the explosion just slightly.

#

So it looks like it's chaining between all zombies, and not doing it all the time.

#

Too late to record that but will post it tomorrow.

ancient grail
#

Or like call a thunder from above then explode

idle dawn
#

overscope.

ancient grail
#

Nyahaha

idle dawn
#

That being said, ngl, I might make some "special" zombie mods or something.

#

Where there's a small chance to spawn some absolute gamers.

ancient grail
#

That will be nice

idle dawn
#

personally, the one above would have to glow red and sizzle or some shit.

ancient grail
#

Overscope

idle dawn
#

I need some visual indicator either way.

ancient grail
#

๐Ÿค”

idle dawn
#

And audio.

#

Else you get nuked around the corner.

ancient grail
#

The ground markers

#

Make em animate like large to small then boom

idle dawn
#

I saw some of the code and there's a few ways now that I know a lot of the java is accessible.

#

My issue is the lack of documentation, and the fact I have to flip flop between lua+java and dive into example code just to figure things out.

#

I genuinely might end up having to make my own.

#

To have a way to have everything in one.

#

Makes me also want to make a flamethrower.

#

Lmao

ancient grail
#

Most ssrver dont allow firespread tho

idle dawn
#

Because fire spread is OP for various reasons.

bronze yoke
#

honestly that sounds like a plus

#

flamethrower would be annoying as hell with fire spread

idle dawn
#

I don't know exactly how flame works.

#

But it's like a parasite. Every time it spreads, it attempts to split it's intensity to spread more.

#

The kicker is, you can simply just tweak the initial intensity.

#

And it shouldn't spread too much.

#

Other kicker?

#

Zombies that are lit on fire don't give a fuck.

#

And they take too little damage from it and it lasts so long.

#

They effectively are burning torches that simply set the ground on fire over and over with no ill regard.

#

That's my theory anyways.

drifting ore
#

pretty spot on

idle dawn
#

Nice.

#

Honestly, a mod or tweak to how long zombies are on fire for, (and damage to compensate), and maybe limiting intensity on the fire they spread themselves, might help.

#

Then some server variable to modify how much intensity lowers over time.

#

As long as zombie damage is consistent that would help wonders.

#

I'm actually not primarily a programmer, am a game designer. Have a degree and everything. Looking to join a studio atm actually.

#

So this sort of thing is quite literally my profession.

drifting ore
#

honestly. a lot of people focus on player related mods so it would be cool to see some zombie related ones. as much is there is some already. like the ideas

#

so many more good ideas to come to life yet

idle dawn
#

I've honestly wanted to focus on combat related ones. This game doesn't focus on combat, which is by design of course, but I had some brainstorming on another discord for a resident evil esque conversion.

#

I think the only two things were.

#

1: Like uhh... combat stance movespeed set minimum to nimble 4, and nimble affects some sort of dodge roll move.

#

2: Wesker runs around the map and if he finds you he immediately one shots you and "gibs" your body, all the items on you disappearing.

sour island
# ancient grail I see
tostring(OBJECT):match('[^.]+$'):match("(.-)@")
```This will pull apart the tostring for object's classes - dependent on how tostring is defined in java though
idle dawn
#

And his theme song plays if he is anywhere remotely around.

#

Neat.

#

Imagination on pop culture is always fun.

#

Feel free to @ me for anything fam. Night.

wet sandal
#

I made Inventory Tetris' UI much prettier and pixel perfect.

Just need to figure out an equipment UI now...

drifting ore
#

that looks good dude

humble oriole
#

Has anyone seen this before?

#

WARN : General , 1674539805377> 46,873,619> MeshAssetManager.loadCallback> Failed to load asset: AssetPath{ "WorldItems/natojerrycan" }

#
    {
        mesh = WorldItems/natojerrycan,
        texture = WorldItems/natojerrycan,
        scale = 1,
    }```
#
    {
        DisplayCategory = VehicleMaintenance,
        Weight    =    1.6,
        Type    =    Normal,
        DisplayName    =    Empty Nato Jerry Can,
        Icon    =    20L_nato_jerrycan,
        SurvivalGear = TRUE,
        WorldStaticModel = NatoJerryCan_Ground,
        Tags = EmptyPetrol,
        ReplaceTypes = PetrolSource NatoJerryCan,
    }```
#

Exception thrown java.util.concurrent.ExecutionException: java.io.IOException:

sour island
#

I'd take notes from neoscav

#

could even make those grids smaller

wet sandal
sour island
#

cool, but to clarify I meant the nxn

wet sandal
#

Oh like the grids themselves?

sour island
#

for more nuanced items, like bullets

#

yeah

wet sandal
#

Yea, they are definitely gonna shrink. I haven't finsihed stack support and equipped items still take space.
I'll shrink them once I resolve those problems.

sour island
#

In case you've never played neoscav

wet sandal
#

Micro grid

sour island
#

interesting

wet sandal
#
settings.TEXTURE_SIZE = 16;
settings.TEXTURE_PAD = 0;

Gonna have these in an options menu

#

Those are the micro settings lol, default is 32 / 4

dark wedge
#

Looks real nice. Will the available grid slots be hard-set for bags and whatnot, or will it dynamically grow as needed?

wet sandal
#

It will be set

#

I'm gonna see about making some bags "TARDIS"s, bigger on the inside.

#

Like, a medkit will be 2x2, but hold 5x5, but only take med items

#

Same idea for gun cases and stuff

#

To make this not a huge pain, double clicking a container will open a popup window for it, and you can drag and drop its items without needing to equip it

dark wedge
#

that makes sense. however, this might make looting very hard if bags are set in size, especially for the smaller items. the choice between keeping a paper clip or a pencil would become a real one. unless smaller items that just weigh about nothing are handled in a different way. like a "general pocket" or something

wet sandal
#

Without bags I don't want the player to be able to carry much. I guess the default pocket size can be a sandbox setting though.

dark wedge
#

i for sure support that part. I strongly dislike that we can go crazy on some zombies while "carrying" a few gallons of milk on our person. lol

wet sandal
#

Also the end goal has equipped items not taking up pocket space

#

So if you find, say a 4x4 item, you could equip it in your hands instead of a weapon.

#

So risk reward decisions if a player wants to be greedy

dark wedge
#

I definitely get that. However, there are a lot of just small items, especially if we include modded items, that are just really small but are useful. So, if i have a backpack that has 10 set slots but can carry 12 pounds, i can only put 10 small items in it that even if combined the items weigh a total of, say, 1 pound?

wet sandal
#

Good backpacks will probably be in the range of like 8x8

thick karma
# idle dawn I know exactly what n5 does.

I might have missed it, but in case nobody's explained this to you, the lack of doc and vaguely named variables is due to the fact that the code is decompiled. Not in its original state. Local variable names (e.g. param names) get lost.

idle dawn
#

O right

#

Compiling all of it in one page and place would help wonders imo.

#

Like I said might end up doing it.

dark wedge
#

I got you. I'll leave you to it then. ha

wet sandal
#

Its all future work, balancing the size of items and packs. But I'll make sure players can reasonably loot large amounts of small items. Its a valid concern.

#

Item stacking will probably play a roll too

dark wedge
#

item stacking will definitely help. possibly based on item weight or something, so you can stack 10 paper clips but only 2 cans of peas.

wet sandal
#

Ooooh

#

I was thinking, Stackable? Yes/No

#

Thats way better

thick karma
#

Does anyone have a guide for opening 16262 properly? P sure I tried following one but friend today told me he is still getting the warning about it being closed.

cosmic condor
#

do you have full control of your router?

thick karma
#

Yes

drifting ore
#

its udp

#

its always udp ๐Ÿ˜›

cosmic condor
#

Windows firewall / Antivirus Firewall / Router Port Forwarding with local IP check - what else?

drifting ore
#

i followed this and it worked np

#

made by devs

#

edit:Riko p much said it

vague hedge
#

Anyone got the id for the high visibility vest?

cosmic condor
vague hedge
thick karma
lilac ore
#

Hey folks, modding for the first time here. I was looking into doing a small balance change for my first mod, but it turns out it's a bit more difficult than I expected.

I was looking to increase the effectiveness of Spare Engine Parts when repairing an Engine. It fixes like 1% of the engine atm and I wanted to put a 10x modifier on that so they repair more.
I noticed that vehiclesfixing.txt doesn't actually contain the Engine fixing requirements, and I thought that'd be the place to make the change, but I'm clearly wrong.

Where is this particular bit of code handled? How would I go about finding it?

drifting ore
#

okay i give up, dont care if anyone makes fun of the code, is using sandboxVars fora value in a DoParam arg not possible?

local bookItem = ScriptManager.instance:getItem("Base.Lightswitches_fordummies")
local player = getPlayer()
local bookLevel = SandboxVars.Nipswitch.Booklevel
local skillLevel = bookItem:DoParam("SkillTrained = Electrical")
local isLevel = bookItem:DoParam("LvlSkillTrained = bookLevel")
local zapLevel = player:getPerkLevel(Perks.Electricity)
local correctLevel = zapLevel >= isLevel
function nipboxOptions()
    local pageLength = (60 * SandboxVars.Nipswitch.Pagelength)
    if bookItem then
        bookItem:DoParam("NumberOfPages = pageLength") else
        if pageLength == nil then
            pageLength = 8
        end
    end
#

was too lazy to cut out the locals from other functions

solar zodiac
#

Hey. Wanted to know if there's any documentation about the render engine out there.

drifting ore
#

there are some guides in general. one sec ill try to find big link

solar zodiac
#

Thanks

drifting ore
#

np

drifting ore
# solar zodiac Thanks

fenris and mr bounty guide are good starting points and the libraries also helps because you can search thru decompiled code

#

also not sure about how to make engine parts more effective, but the code for taking engine parts can net you more engine parts per mechanic level and condition level of engine

lilac ore
#

That's a good way to look at it - instead of making engine parts more effective, make them more common. I could increase the spawn rate, that seems like it'd be easy. The part about getting more engine parts when dismantling an engine may take some digging to find, but good idea. Thanks.

drifting ore
#
function ISTakeEngineParts:perform()
    ISBaseTimedAction.perform(self)
    self.item:setJobDelta(0)
    local cond = self.part:getCondition();
    local skill = self.character:getPerkLevel(Perks.Mechanics) - self.vehicle:getScript():getEngineRepairLevel();
    local condForPart = math.max(20 - (skill), 5);
    local args = { vehicle = self.vehicle:getId(), skillLevel = skill }
    sendClientCommand(self.character, 'vehicle', 'takeEngineParts', args)
ancient grail
#

Make lots of parts
Gears tube pipes shafts cylinder belt etc

drifting ore
#

please halp, how do i use a sandboxVar inside of a DoParam?

#

as the value

dark wedge
drifting ore
#

thats how i have it ๐Ÿ˜ฆ

dark wedge
#

er, game start

drifting ore
#
Nipswitch = Nipswitch or {};
Nipswitch.Commands = Nipswitch.Commands or {};

local bookItem = ScriptManager.instance:getItem("Base.Lightswitches_fordummies")
local player = getPlayer()
local bookLevel = SandboxVars.Nipswitch.Booklevel
local skillLevel = bookItem:DoParam("SkillTrained = Electrical")
local isLevel = bookItem:DoParam("LvlSkillTrained = bookLevel")
local zapLevel = player:getPerkLevel(Perks.Electricity)
local correctLevel = zapLevel >= isLevel
function nipboxOptions()
    local pageLength = (60 * SandboxVars.Nipswitch.Pagelength)
    if bookItem then
        bookItem:DoParam("NumberOfPages = pageLength") else
        if pageLength == nil then
            pageLength = 8
        end
    end
    local old_isValid = ISReadABook.isValid
    function ISReadABook:isValid()
        if bookItem and skillLevel and bookLevel >= zapLevel or player:getAlreadyReadBook():contains(player:getFullType()) then
            local txtRandom = ZombRand(3);
            if txtRandom == 0 then
                player:Say("You just don't get it...")
            elseif txtRandom == 1 then
                player:Say("You go cross-eyed when you try to read...")
            else
                player:Say("You feel like a complete potato...")
                return false
                player:forceStop()
            end
        elseif bookItem and skillLevel and bookLevel >= zapLevel then
            if bookLevel == nil then
                bookLevel = 8
            end
        end
    end
end
Events.OnGameBoot.Add(nipboxOptions)
#

don't mind the second function atm i'm not done lol but thats entire thing atm

ancient grail
drifting ore
#

as the value

dark wedge
#

you can do it during OnGameStart is what i meant. my bad

ancient grail
#

The problem is theres no event for when u click save on sandbox so you have to have another function that reloads the var

#

This is what @fast galleon and wre discussing

drifting ore
#

oh the hot update thingy

ancient grail
#

You can make it everyhr i guess

#

But you know doparam only changes future instances right

drifting ore
#

i thought it just updated the same value from scripts

#

if you remove

#

like if i have no page length for my book? i do have failsafe number in place in case it doesnt get the sandbox but im going to have to figure out that event

#

and apparentl DoParam

#

lets be real. im actually clueless about way more than that ๐Ÿ˜„

ancient grail
#
local script = getScriptManager():Find('Katana')
If ticks % 1 then
script:DoParam('Icon = apple')
end
if ticks % 3 then
script:DoParam('Icon = orange')
end
if ticks % 5 then
script:DoParam('Icon = potato)
end```
#

Not sure but this could work on tick
Make the icon animate

drifting ore
#

lol i just want to set a variable page length via sandbox options

#

so you can set from 10 seconds to 10 mins

ancient grail
#

Yeah i know i just remember wanting to do something like this

drifting ore
#

that icon thing would be trippy lol

ancient grail
#

Yeah haha

#

Should be used for weeds

#

Weeds item

#

Lol iterate all the items snd make their icons jumbled up by random any other icon ingame

#

Imagine how broken your invontory would be

#

Probably a good negative trait mod

#

Ow its not going to work cuz everyone else will be affected

#

So its just another way to break the game

drifting ore
#

also i am reading back and i only see mention of how DoParam just overwrites the value permanently?

#

same effect as item script

cosmic condor
#

yes, for new items after activated the mod

drifting ore
#

time to test again lol

#

oh shit i got it so it wont let it use the item haha

#

sick

#

never though i'd figure that one out

ancient grail
#

Figured what out

drifting ore
#

well nothing anymore lol...... it's borked atm

#

it wasn't allowing me to read the book via context menu tho

#

supposed to check Perks.Electricity and if it's less than or equal to the sandbox option, it's supposed to trigger

cosmic condor
wet sandal
#

Popout containers done!

jaunty marten
uncut meteor
# wet sandal Popout containers done!

possible for a key to close all inventory container or left clicking in nothing could possibly do that please.
Because to much containers to close x)

wet sandal
wet sandal
tight notch
#

niiiice

small topaz
#

Is there a way to see how many items of a given type are present on the map? Or is the loot distribution not generated when the world starts but instead somehow "dynamically", while the players are exploring?

ancient grail
#

im trying to use sendclientcommand to change the animation of the playerr and make it visible for other too
my question is on the anim xmls can i use integer as a condition
so like instead of using boolean ill just input integers that represent diffrent action

#

there its currently working as booolean but what if i have number of possible states

tame mulch
#
<m_Type>STRING</m_Type>
tame mulch
ancient grail
#

Thank you thank you

neon bronze
#

how can you craft a moveable through a recipe or rather what do i have to parse as the result?

faint jewel
wet sandal
#

I haven't made the bags huge on the outside yet because it would impact testing too much until I get the equipment ui done

faint jewel
#

well i get that, but technically, you could collect small bag and infitie loop them into each other and still have room in each bag for stuff.

#

that happened in another game i worked on.

#

my record was 237 small backpacks inside each other.

finite radish
neon bronze
#

Thanks but i already figured it out

#

No idea if its correct but it works

#

๐Ÿคทโ€โ™‚๏ธ

wet sandal
faint jewel
#

well like i said, it LOOKS great, and i hope you do get them working right ๐Ÿ™‚

#

just remember if users CAN abuse it, they WILL lol.

sudden mauve
#

When are yall gonna make the super ultra duppa omega incredibly amazingly rare loot chances mod? ๐Ÿ˜ค๐Ÿ˜ค๐Ÿ˜ค

neon bronze
#

super ultra rare loot mod
Just deletes distributions

wet sandal
#

Loot this, you filthy casual

ancient grail
sour island
#

Zombies drop 1 tin can each, and you have to craft your way up

ancient grail
#

Lol

#

Where have you seen people carrying tin cans .. like all of em

red tiger
#

An XML schema would be useful for editors like VSCode to let you know what's supposed to be in a tag.

ancient grail
#

Thank you sir jab

idle dawn
#

I might make an xml style spread sheet of documentation if I do end up going for that project.

#

So it can be turned into a vscode linter.

#

Which would make things so much easier.

#

vsextensions though uaaaaa

red tiger
sour island
#

Basically turn looting into grinding

#

Or better yet borrow the (please God change this) fraction system some furniture uses

#

Oh you found a sledgehammer? No it's sledgehammer (1/2), sucks you already found (1/2) and not (2/2).

#

This would be a pretty good April fool's mod ๐Ÿค”

vast nacelle
#

Everything is split in to multiple pieces.
You need an IKEA manual for each item and a turning tool to assemble them.

sour island
#

Truly a hard core experience, tarkov has nothing on this

bronze yoke
#

and to get around sandbox options not being loaded i would do it on OnInitGlobalModData, not game boot or anything

drifting ore
#

haha did fix that part but it still not working for some reason

#

it's okay to use it that way though? with a local keyword for the arguement?

#

with the sandbox option

bronze yoke
#

yeah you can do that, many of my mods do it

drifting ore
#

okay i figured. i'll try that and see. i couldnt get the page number to update also after a couple of restarts. ill use your method like i did for loot . even tho i changed the code a little the method you gave me works well

#

i got the spawn rate at min to be .001 and at max to be 68%

#

thats about as perfect as it gets id say

bronze yoke
#

OnInitGlobalModData is usually the best event for sandbox option stuff, it's called after sandbox options are loaded but before most things get set in stone

drifting ore
#

that itempicker thing was neat also

#

i saw it working its little magic

#

i love visual feedback lol

#

thank you also. appreciate. hoping to get all these options done today. i think doing recipe material amounts has to be easier than these options

#

is the goal of forceStop() to cancel timed action? seemed like it but using it was inconsistent for me . i'll keep messing around with it either way for now

#

it def is... i wonder why it's being weird for me. just wanted to test it to see if i can stop any timed action using it. got a couple ideas with random text

drifting ore
#

im still getting this callframe error for improper usage of LvlSkillTrained

local isLevel = bookItem:DoParam ("LvlSkillTrained = bookLevel")

local bookLevel = SandboxVars.Nipswitch.Booklevel which is an integer
isn't LvlSkillTrained the required level to use the book? or did i catch that wrong..

sour island
#

You're setting it to the string "bookLevel" that way

drifting ore
#

do i .. ? lol dammit im going to have to hit the lua manual

sour island
#

You'd want to concat the string with the intended value

drifting ore
#

ahhh alright

sour island
#

"variable = "..value

#

.. is like + for strings

#

You can concat strings and numbers onto strings

drifting ore
#

that makes sense. thank you man. here's hoping this is the light at the end

#

ooo

sour island
#

Can't use booleans without toString()

drifting ore
#

oh perfect im about to use a boolean here shortly too ty

#

really appreciate that insight

sour island
#

No problem

ancient grail
#

any idea how to add evolved items recipe using vanilla items

#

imean im currently speaking with saph and shes got this error and looking at her code ithink its cuz of the item tweaker

#

You can use doparam for evolve recipe right

sour island
#

doParam is exclusive to item scripts afaik

#

You can use recipe manager to manipulate recipes - I'm not sure about evolved

bronze yoke
#

evolved recipes are created from the item scripts

#

items define which recipes they go into, not the other way around - kind of weird

drifting ore
#

so if i wanted to use sandbox option to change the amount of each item to craft, i'd have to figure out a workaround through items?

#

page length working now also, whew

sour island
ancient grail
#

ayt so the thing is solved...
for discussion purposes heres what happened


--BaseItems
TweakItem("Base.Soysauce", "Tags", "Soysauce")

--Thermos
TweakItem("Coffee2", "EvolvedRecipe", "SapphCooking.ThermosBeverage:5")
TweakItem("Teabag2", "EvolvedRecipe", "SapphCooking.ThermosBeverage:5")
TweakItem("Sugar", "EvolvedRecipe", "SapphCooking.ThermosBeverage:1")
TweakItem("SugarBrown", "EvolvedRecipe", "SapphCooking.ThermosBeverage:1")
TweakItem("SugarPacket", "EvolvedRecipe", "SapphCooking.ThermosBeverage:1")
TweakItem("CocoaPowder", "EvolvedRecipe", "SapphCooking.ThermosBeverage:1")
TweakItem("CannedMilkOpen", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("Milk", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.AlmondMilk", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.PopbottlewithMilk", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.BottlewithMilk", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.ColaBottlewithMilk", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.ColaBottlewithProteinShake", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.BleachBottlewithProteinShake", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
TweakItem("SapphCooking.PopBottlewithProteinShake", "EvolvedRecipe", "SapphCooking.ThermosBeverage:2")
#

thats her original code

#
local Script = ScriptManager.instance:getItem("Base.RedRadish")
Script:DoParam("EvolvedRecipe = Soup:3;Stew:3;Stir fry Griddle Pan:3;Stir fry:3;Burger:3;Salad:3;Roasted Vegetables:3;YOURITEM:int")
#

we modified it
by doin this instead

#

sharing it here so other modders that encounter the need to modify evolved recipe can do this method

#

this is what i learned from the great albion
DoParam

drifting ore
#

this is exactly what i'm looking for so thank you

ancient grail
drifting ore
#

no worries! i'm working on a slew of sandbox options so it changes as the days go on lol

finite radish
#

has anyone tried reading binary with the BufferedReader returned by getFileReader()? kinda curious if the call from Lua would mangle it or not

#

i don't have a specific use case in mind, just curious

ancient grail
#

Sorta likr erosion

zinc pilot
#

hey, does anyone know how high is the overhead when having the -debug mode on?

ancient grail
#

Whats the overhead

zinc pilot
#

as in, how much it slows down things

drifting ore
#

Not much just for running in debug

#

If you are having performance issues. The difference between debug and not, will not be your fix

zinc pilot
#

it's mostly for benching to subtract the difference in a more meaningful way

drifting ore
#

Ahh fair enough. It shouldnโ€™t make a drastic difference

gritty remnant
#

Hey if I wanted to create a mod that teleports someone after they right click on an object to another location. How would i go about doing that?

zinc pilot
#

I mean, this isn't that drastic of a difference as I'm making out to be, but still

drifting ore
#

There are a few mods you can find as an example Wilson

#

Like bus ticket. Interiors. Basements

gritty remnant
jaunty marten
drifting ore
zinc pilot
#

and I can't really account for how and when a stutter because of something random will occur

zinc pilot
#

during normal gameplay, some stutters can occur even on vanilla, I guess when some stuff is not cached

gritty remnant
drifting ore
#

Itโ€™s map pao

zinc pilot
#

now I'm testing a mod that changes stuff during the generation of the world

drifting ore
#

Save chunks

zinc pilot
#

thank you

jaunty marten
drifting ore
#

Lol

jaunty marten
#

like this XD

zinc pilot
#

still, that's what I was asking, if debug added some overhead over it inducing more stutters

zinc pilot
drifting ore
drifting ore
#

it's well documented on its usage as well i just seen

jaunty marten
neon bronze
heady crystal
jaunty marten
heady crystal
#

Mein gott

#

Just.... why

jaunty marten
#

legacy code ha-ha

heady crystal
#

I am pretty sure that as bad as LUA is you can do a simple for loop

jaunty marten
#

it can be done by 1 line and 1 function

#

they have self created function perk:getTotalXpForLevel()

heady crystal
#

LMAO

jaunty marten
#

so just prev level exp = perk:getTotalXpForLevel(level - 1)

#

idk XD

heady crystal
#

ahahah

#

PZ moment

jaunty marten
dusk chasm
#

Not sure where to ask, post ignored in main channel. I'll try here.

Any opinions on best map mods that seems most balanced? Also crafting and item mods ? Looking for more depth..like mods that could add resource mining for metals like copper etc, smelting, manufacturing metal weapons.. or even mods that just add more weapon variety to loot tables?

heady crystal
#

I think Firearms B41 or something like this is well regarded as a mod that adds extra guns while being balanced

dusk chasm
#

Anything for melee?

#

Cousin will love that one. Heh.

jaunty marten
#

map/craft/crafting/tools/metalworking/firearms and etc

dusk chasm
#

Fair enough guess I'll just try a few random ones with good feedback. ๐Ÿ™

jaunty marten
#

๐Ÿ‘

finite radish
# dusk chasm Fair enough guess I'll just try a few random ones with good feedback. ๐Ÿ™

my process tends to go like this for a game I'm not familiar with:

  • find very popular, highly acclaimed mod that I think I'll like from the sounds of it, or that I've tried and know that I like
  • click the button that says "in X collections" on the right side
  • sort collections by popularity
  • pick through any number of collections to find mods that seem similar in quality or that seem like they create the kind of gameplay i wanna have

tl;dr someone has probably already done a lot of the heavy lifting for you in the form of a collection, just piggyback off of their efforts and tweak as needed

dusk chasm
#

@finite radish oooh thanks never knew about the collections button ๐Ÿ‘

sour island
#

Anything related to characters and or old enough has some less than ideal stuff - but if it works it works

#

I'm looking forward to the polish update

finite cedar
#

Does anyone know if zpopSpawnNow() respects all player's locations in a chunk

#

I know it safely spawns zombies inside a chunk around the person that called it in debug mode but I was just wondering if it will spawn zombies on other players by accident

jaunty marten
sour island
#

Yeah, there's a section in addXP that is a giant if or which could be if category = combat or = aiming instead it's if blade if blunt if stab if if if

#

My guess is it was an old thing changed or in progress work that got pushed to the back burner

#

Same for the XP if chains

jaunty marten
#

ยฏ_(ใƒ„)_/ยฏ

sour island
#

Yep

#

I think the UI stuff creating new instances without needing to is probably something worth tracking down

#

I haven't checked the rest of the UI but debug stuff is pretty bad for that

#

But debug stuff isn't really a priority to optimize either ๐Ÿคทโ€โ™‚๏ธ

drifting ore
#

when i lowered the spawn rate i received an exponent and the % is def not 5%. anyone have experience, as long as it shows, even if showing as exponent, it's correct? guess i could kill a crap ton of zombies to see if it still spawns

#

i lowered the roll from .001 to .0001 and it went from .01% to this

sour island
#

That's scientific notation

#

That number is really really small

drifting ore
#

so even though its showing 5% you think it's just not right

#

i'm guessing it's like a tens of thousands decimal

sour island
#

It's not showing 5%

drifting ore
#

5.030429209432094

sour island
#

Note the E

drifting ore
#

doesnt exponent just mean there is tons more numbers

#

to the power of

sour island
#

0.00005

#

It's E -5

drifting ore
#

ahhhhh well thats exactly what i want

sour island
#

5 to the power of -5

drifting ore
#

i totally missed the -

#

derp

#

okay thanks man. this is really good

sour island
#

No worries, not something you'd know as common - the scientific notation that is

drifting ore
#

time to kill 500 zombies and see the chance and if this roll is just a facade lol

sour island
#

If you spawn with no zombies in the world the loot chance goes up by 40% if Im not mistaken

drifting ore
#

oh wow. so if i play with 6x pop then... lol

#

typically my standard

sour island
#

I think higher pop is more loot? But no zombies changes the formula

#

I could be wrong as the math gets thrown around a bit

drifting ore
#

yea for sure. nothing some testing cant clear up

#

thanks for that lol thats actually good ass info

odd notch
#

congrats on making the mod!!

#

i saw it pop up in a different channel being sung praise

red tiger
odd notch
#

switch... tables..........

red tiger
#
const vitamin: string = "A";

switch(vitamin.toLowerCase()) {
  case "a":
    console.log("Spinach, Carrots, Sweet Potatoes, Mango");
    break;
  case "b":
    console.log("Meat, Fish, Milk, Cheese, Eggs.");
    break;
  case "c":
    console.log("Oranges, Kiwi, Lemon, Strawberries, Tomatoes");
    break;
  default:
    console.log("No sources available.");
    break;
}
#

Switch tables.

jaunty marten
jaunty marten
#

lua is powerful katana

red tiger
#

Lua is wieldy.

jaunty marten
drifting ore
#

lua is life

red tiger
jaunty marten
#

btw idk why in ur typescript guide said lua have no oop, in my mind metatables is good for it

red tiger
#

You can absolutely write OOP Lua.

#

I did this for many years while PipeWrench wasn't a thing.

jaunty marten
red tiger
jaunty marten
#

๐Ÿฅบ

red tiger
#

metatable is basically prototype from JS, ignoring the nuance.

#

Lua acts a lot like ES5 JavaScript conventions.

jaunty marten
#

nah, anyway u can create oop so it's fine

red tiger
#

You don't need Typescript to do simple mod works.

#

If you're writing an API or framework of sorts, I'd recommend TS over Lua.

#

Since I almost always write utilities that scales, I'd need TS probably more than anyone.

#

At least I'm realistic about how I market my stuff. xD

jaunty marten
red tiger
jaunty marten
#

so on output it's lua anyway

red tiger
#

They provide a conversions / operations library alongside the compilation of their own OOP implementation with Lua.

jaunty marten
#

exactly for pz don't see any reason to use ts only if u originally ts developer and it's easier for u

red tiger
#

As a note, I'm writing my nifty little HTML project in TS because it obviously needs to keep a consistent design.

red tiger
#

Oh you meant a TS dev in general.

#

I am one btw.

jaunty marten
#

oh

#

then yea

red tiger
#

People do struggle with Lua and functional design.. I've had C# and Java heads come through and use TS.

jaunty marten
#

I got why u using ts instead lua

red tiger
#

"Having options" is the ultimate goal.. not specific options. =)

jaunty marten
#

didn't work with ts but I think with ts it's much easier to code than on lua

#

if to select between them

red tiger
jaunty marten
#

due to code structure

jaunty marten
#

I forgot about it

red tiger
jaunty marten
#

for pz it's crazy thing

red tiger
#

That and docs.

#

I had the silly idea of implementing an entire Electron app designed to write out JSON data for baking in third-party documentation for missing documentation in PZ API.

#

Got that all working.. but never announced it. xD

#

50-60 hours of work gathering dust.

red tiger
#

Looks like this.

jaunty marten
#

wow

#

๐Ÿ‘ x3

#

mb I'll do same thing for lua cos it's really speed up modding by several times

#

already have some ideas for it but sadly can't spend time for it yet

#

when u have a few projects and can't select which of it to do it's killing ded

red tiger
jaunty marten
#

mb will be easier to create clone of me to create other projects..

jaunty marten
red tiger
#

Yeah I'll need to write the schema for it.

red tiger
#

Here's my current example.

stone garden
#

still waiting to someone make my mod idea happen

#

im waiting for like 1 months or more

jaunty marten
stone garden
finite radish
stone garden
stone garden
#

not to make but mechanics

drifting ore
#

why not just post it public. lol

zinc pilot
proud marsh
#

I'm probably not the first to suggest it, but it would be amazing if there was a mod that adds the clickers from the last of us to zomboid, with their respective characteristics of being blind, with great hearing and super strong.
I leave the idea here but surely it is not the first time that someone suggests it

proud marsh
#

wow honestly i searched a lot and found nothing about it.
thank you

zinc pilot
#

is there a guide on how to add custom sounds?

idle dawn
#

Anyone made a speedhacker zombies mod yet?

#

Where they animate like 3 times faster and just ZWOOP to their destination?

jaunty marten
tardy basin
#

does anyone have any idea how one would go about adding hand pain to swinging long blunt weapons e.g Baseball bats?

jaunty marten
#

u can to slow them but don't faster

tardy basin
#

thanks

jaunty marten
idle dawn
faint jewel
#

He is

jaunty marten
#

just the image to don't ping him heh

astral dune
#

extremely bizarre to expect some random person here to make your mod for you for no reason. Especially when you try to keep what the idea is secret for some reason. Thats all I'm gonna say cuz I'm busy and passive aggressive

#

(obvs not talking about thegandalf)

golden sparrow
#

I don't understand, I have this server side

#

And this client side

#

But it doesn't print the receive part, i'm in single player it driving me crazy

jaunty marten
#

u have to send clientcommand

#

and receive clientcommand too

golden sparrow
jaunty marten
#

whoops

bronze yoke
#

in singleplayer, for these purposes, it is considered only a server

jaunty marten
#

sec will think then

bronze yoke
#

it's a little frustrating really

golden sparrow
rustic radish
#

Anyone know where the descriptions for professions come from? Like when you make a character and it gives the the stats like "+2 Cooking" and also a short description?

#

I have a profession working right now, it has a working icon, it actually gives the stats I assigned and free traits, but the description is totally blank

jaunty marten
golden sparrow
jaunty marten
bronze yoke
#

it's still annoying that client commands do work, and server commands don't: ideally you wouldn't have to write different code for singleplayer

jaunty marten
#

if sp just do it, if mp send to client/server and just do it there

ruby urchin
zinc pilot
#

random question, how much faster is running a local func compared to a global one?

jaunty marten
rustic radish
zinc pilot
red tiger
#

(again)

bronze yoke
#

it wasn't really a scientific test, but i tried some of my code with all used functions pulled into local against my normal code and i found about 20% faster

bronze yoke
#

if your code runs a lot i strongly recommend it

thorny garnet
#

I'm trying to rewrite generator repair functions to allow repairs to greater than 100 condition. Changing generators' initial condition was fairly easy but holy crap I'm out of my league with overriding vanilla functions. https://github.com/genchadt/improvedgeneratorlongevity/tree/alpha/improvedgeneratorlongevity/Contents/mods/improvedgeneratorlongevity/media/lua/client

GitHub

Allows Project Zomboid players to modify the base game's generator condition. - improvedgeneratorlongevity/improvedgeneratorlongevity/Contents/mods/improvedgeneratorlongevity/media/lua/clie...

#

Gonna leave this up and hope for someone with a bigger brain to critique because mine is exhausted ๐Ÿ˜ฉ

bronze yoke
#

your timed action is derived from the original? don't you want to override it?

drifting ore
#

Hello there
I need to change the radius of pipebombs in game to one cell, and I need it to work in multiplayer, could someone help me maybe?

jaunty marten
zinc pilot
jaunty marten
#

wdym?

bronze yoke
#

nothing special about standard lib, it's all global

zinc pilot
#

mh

bronze yoke
#

so pulling it into local is faster

zinc pilot
#

coming from "normal" compiled languages this seems so unconventional

#

but I guess it makes sense

jaunty marten
#

btw local string_format = string.format "greedy local" way is not always better exactly for big file cos lua have limit for local variable and in big file with much localized vars u can beat this limit

bronze yoke
#

the java setCondition() will limit it anyway

zinc pilot
#

just rewrite IsoGenerator

#

ez

thorny garnet
#

They show up in-game as 200 condition and run down from there, but as soon as I attempt to repair them they reset to 100 :/

#

So that tracks I suppose. Thanks for saving me more headaches from this. Hopefully the devs will add a feature to change genny longevity as they have done with lightbulbs

jaunty marten
#

error panicded

local aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,el,em,en,eo,ep,eq,er,es,et,eu,ev,ew,ex,ey,ez,fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,gk,gl,gm,gn,go,gp,gq,gr,gs,gt,gu,gv,gw,gx,gy,gz,ha,hb,hc,hd,he,hf,hg,hh,hi,hj,hk,hl,hm,hn,ho,hp,hq,hr,hs,ht
red tiger
#

The fact that programmers here know these nuances with Kahlua makes it worth randomly popping in and reading chat.

red tiger
#

Can't remember.

jaunty marten
#

200

zinc pilot
#

per single file?

jaunty marten
#

yes

red tiger
#

Per lua unit yeah

#

I think loadstring() operates the same as a file in that limit.

#

I like this limit because you shouldn't ever need 200 variables in one unit.

jaunty marten
red tiger
#

I wouldn't touch it.

#

I'd make it 100 tbh.

bronze yoke
#

yeah, 200 locals in the same scope sounds like you're not doing things right

red tiger
#

(My rule is that if a Java file is over 1000 lines long without documentation or over 2000-2500 lines with full documentation, it's too large and has to be divided up)

jaunty marten
red tiger
#

I'd have a field-day with classes like GlobalObject and GameServer.java xD

bronze yoke
#

i think having more files looks cool LOL

#

that's why i do it... it definitely makes things more readable but i just think it's cool

zinc pilot
#

what's the meaning of "greedy locals"? I'm not sure I understand

bronze yoke
#

i don't work on a scale for it to matter too much anyway

jaunty marten
#

it's greedy cos with first way u can local only string global table but with second one u need to cache each function that u will use

#

1 local < 1+ locals

zinc pilot
#

isn't that a better approach if you're gonna use that func frequently?

#

I mean, for performance

jaunty marten
#

better performance with greedy way

zinc pilot
#

but messier

jaunty marten
#

as I said problem is 200 limit of local vars but it's not real problem cos idk when u will have more than 200 locals in single file ded

#

so better always do second way

#

u can to local class methods too

local item_base = getmetatable(InventoryItem.class).__index
local item_getName = item_base.getName

item_getName(item) instead item:getName()
bronze yoke
#

there's a getmetatable ๐Ÿ˜Ÿ

jaunty marten
#

sure

bronze yoke
#

i didn't know and wrote my own :(

jaunty marten
#

XD

jaunty marten
#

or did you do smth else?

bronze yoke
#

it took class name as a string

#

so like
local IsoPlayer = Starlit.getMetatable('IsoPlayer')

jaunty marten
#

what's the source?

bronze yoke
#

sorta

jaunty marten
#

he-he

#

if arg is string then better to name findMetatable I think

#

ยฏ_(ใƒ„)_/ยฏ

bronze yoke
#

sure, best to rename it anyway if there's already one

jaunty marten
shadow lynx
#

Hello all, I have a question - is it possible to write a mod that skips the main screen and immediately starts a single mode?

idle dawn
#

SP only runs server+shared?

#

That means UI stuff needs to be in shared. ๐Ÿ˜

bronze yoke
#

sp runs all

idle dawn
#

Oh

jaunty marten
#

in mp client won't run server folder as Ik

#

but server will run client one

#

correct me if I'm wrong

bronze yoke
#

client and singleplayer runs all three folders, server runs shared and server only

jaunty marten
#

is it? why I remember server runs every folder

#

huh

drifting ore
#

i'm stumped. i'm trying to get the current electrical level
using ```
getPlayer():getPerkLevel(Perks.Electricity)

#

am i using this wrong?

bronze yoke
#

that looks right

drifting ore
#

okay it must be the way im using it i guess lol

#

i tried using your method of global overwrite or psuedo overwrite or however and i couldnt get it working

#

so then i went even crazier

#

for book context menu

#
local bookItem = ScriptManager.instance:getItem("Base.Lightswitches_fordummies")
local player = getPlayer()
local bookLevel = SandboxVars.Nipswitch.Booklevel
local zapLevel = player:getPerkLevel(Perks.Electricity)
local lowLevel = "bookLevel <="..zapLevel
local goodlevel = "bookLevel >="..zapLevel
local menus = {
    player.invMenu.context:addOption(getText("You just don't getit..."+self.invMenu, nil )),
    player.invMenu.context:addOption(getText("You go cross-eyed when you try to read..."+self.invMenu, nil )),
    player.invMenu.context:addOption(getText("You feel like a complete potato..."+self.invMenu, nil ))
}

if lowLevel or player:getAlreadyReadBook():contains(player:getFullType()) then
    local txtRandom = ZombRand(3);
    local selectedMenu = menus[txtRandom + 1]
    selectedMenu()
    for _, menu in pairs(menus) do
        menu.notAvailable = true
    end
    selectedMenu.notAvailable = false
end

if goodlevel then
    for _, menu in pairs(menus) do
        menu.notAvailable = false
    end
end

this is where i ended up LOL

#

its just saying it's nil table for zaplevel

bronze yoke
#

is this code outside of a function? if it is getPlayer() is running on the main menu, where there is no player

drifting ore
#

oh oops lol im blind

#

yes it is thanks LOL i knew it was something silly to start at least

#

this stuff is making me go crosseyed at times it feels lol

thick karma
#

Anyone have a nice set of (freely usable) transparent background PlayStation 4 button PNGs preferably at 32x32? I feel like this has to be an extremely common need in modding, so I'm hoping... haha

dark wedge
# thick karma Anyone have a nice set of (freely usable) transparent background PlayStation 4 b...

https://opengameart.org/content/free-controller-prompts-xbox-playstation-switch-pc
Will need to scale them down, but these are public domain

jaunty marten
ancient grail
#

Whats the difference between

Scriptmanager.instance:getItem()

getScriptManager():getItem()

jaunty marten
#

no difference

#

same

thick karma
weak crescent
#

Do you guys know any good events to catch if a zombie attacks a player

ancient grail
#

Thats the one

jaunty marten
#

in mp it's working for players too so u'll need to add

if not instanceof(attacker, "IsoZombie") then return end
ancient grail
#

Just add a checker if its not a player

#

Or a checker if its a zed that could work

weak crescent
#

That works for zombies? Didn't know a zombie claw counts as a "weapon" lol

#

But thanks, I'll give it a try

jaunty marten
#

works

#

just won't weapon object I think so

cosmic condor
jaunty marten
small topaz
#

In the models_items.txt, some items don't have a "texture" entry like this

model EggPoached_Ground
{
    mesh = WorldItems/EggPoached,
    scale = 0.4,
}

It only has a mesh. Does anyone has an idea how the game knows which texture it should apply? (Also asked this in the modelling section a few days ago but no answer so far. So tried here again.)

drifting ore
#

uses icon?

#

i thought that was default fallback

bronze yoke
#

maybe it's in the model?

ancient grail
#

Ithink ive encountered this too. Its baked on the model.

#

You could try and open it up using 3d dev software of choice

jaunty marten
#

it's common sense I'm not sure if pz does it smth else way

#

but it's pz.. they can do anything drunk

weak crescent
#

Hmm, OnWeaponHitCharacter doesn't seem to work

#

And with disabling the player check, it would only call if the player attacks a zombie

#

But not the other way around for some reason

ancient grail
#

worked for me

#

off topic but mod related:
anyone tried arma 3? its on sale i was wondering about its workshop and why it has so many dlc.. how does that work

bronze yoke
#

what do you mean? it's just a normal dlc system

jaunty marten
#

dlc is a thing that always works

bronze yoke
#

if you're wondering why people would pay for content when there's free mods, mostly it's just the prestige of being 'official'

thick karma
#

Can anyone make me less confused please? ( ๐Ÿคช )
In JoyPadSetup.lua, we have:

Joypad.Texture = {}
Joypad.Texture.AButton = getTexture("media/ui/xbox/XBOX_A.png")
Joypad.Texture.BButton = getTexture("media/ui/xbox/XBOX_B.png")
Joypad.Texture.XButton = getTexture("media/ui/xbox/XBOX_X.png")
Joypad.Texture.YButton = getTexture("media/ui/xbox/XBOX_Y.png")
Joypad.Texture.LBumper = getTexture("media/ui/xbox/xbox_lb.png")
Joypad.Texture.RBumper = getTexture("media/ui/xbox/xbox_rb.png")
Joypad.Texture.DPadLeft = getTexture("media/ui/xbox/XBOX_dpad_left.png")
Joypad.Texture.DPadRight = getTexture("media/ui/xbox/XBOX_dpad_right.png")
Joypad.Texture.DPadUp = getTexture("media/ui/xbox/XBOX_dpad_up.png")
Joypad.Texture.DPadDown = getTexture("media/ui/xbox/XBOX_dpad_down.png")
Joypad.Texture.DPad = getTexture("media/ui/xbox/XBOX_dpad.png")
Joypad.Texture.LStick = getTexture("media/ui/leftstick.png")
Joypad.Texture.RStick = getTexture("media/ui/rightstick.png")
Joypad.Texture.LTrigger = getTexture("media/ui/xbox/xbox_lefttrigger.png")
Joypad.Texture.RTrigger = getTexture("media/ui/xbox/xbox_righttrigger.png")
Joypad.Texture.Menu = getTexture("media/ui/xbox/XBOX_Menu.png")
Joypad.Texture.View = getTexture("media/ui/xbox/XBOX_View.png")
Joypad.Texture.Back = Joypad.Texture.View
Joypad.Texture.Start = Joypad.Texture.Menu

This runs before all mods. Then loaded mods happen. One of my loaded mods, which confirms that it is working by writing correct output to a file, does this immediately:

        Joypad.Texture.AButton = WGS.PlayStation.AButton
        Joypad.Texture.BButton = WGS.PlayStation.BButton
        Joypad.Texture.XButton = WGS.PlayStation.XButton
        Joypad.Texture.YButton = WGS.PlayStation.YButton
        Joypad.Texture.LBumper = WGS.PlayStation.LBumper
        Joypad.Texture.RBumper = WGS.PlayStation.RBumper
        Joypad.Texture.DPadLeft = WGS.PlayStation.DPadLeft
        Joypad.Texture.DPadRight = WGS.PlayStation.DPadRight
        Joypad.Texture.DPadUp = WGS.PlayStation.DPadUp
        Joypad.Texture.DPadDown = WGS.PlayStation.DPadDown
        Joypad.Texture.DPad = WGS.PlayStation.DPad
        Joypad.Texture.LStick = WGS.PlayStation.LStick 
        Joypad.Texture.RStick = WGS.PlayStation.RStick
        Joypad.Texture.LTrigger = WGS.PlayStation.LTrigger
        Joypad.Texture.RTrigger = WGS.PlayStation.RTrigger
        Joypad.Texture.Menu = WGS.PlayStation.Menu
        Joypad.Texture.View = WGS.PlayStation.View
        Joypad.Texture.Back = WGS.PlayStation.View
        Joypad.Texture.Start = WGS.PlayStation.Menu

Where all of those are new icons (they work, not the issue).

The issue is that in the Main Menu of the game, when I first connect the controller, the game seems to reload JoyPadSetup.lua, or at least does something that causes it to reinitialize the values of Joypad.Texture, such that it shows Xbox buttons until I enter and exit the Options menu to trigger a refresh in a different way.

#

Does anyone know exactly where this happens so I can perhaps intervene immediately after?

ancient grail
#

~~I dont understand your problem clearly but im assuming you are having problems with refresh thats related to loadorder
Something like your mod getting overwritten by vanilla cuz vanilla re initialize ~~

thick karma
#

Yes, that is what I am saying, but no worries if you don't know. Just asking the community in general in case someone spotted a relevant thing recently

ancient grail
#

If thats the case you might have to hook on the function when it refreshes itself ๐Ÿค

thick karma
#

My question above is asking if anyone knows when that happens.

#

If I knew what to hook, I wouldn't be asking. ๐Ÿ™‚

thick karma
jaunty marten
#

there're more events

thick karma
#

I'll try a couple. Been hooking Lua functions directly to no avail.

jaunty marten
#

OnJoypadActivateUI - menu
OnJoypadActivate - in-game

thick karma
#

I am trying to use it in Main Menu before joining any servers.

#

Not in the start menu

#

(Nope, I know nothing.)

jaunty marten
thick karma
#

Aha!

#

I DID know a thing!

#
            self.abutton = ISImage:new (self.controllerLabel.x + 31, 17, 32, 32, Joypad.Texture.AButton);

This little weasel is my problem.

#

A moving a-button that gets initialized BEFORE joypad even EXISTS

#

With the original texture, of course

#

gonna try to hook the end of initialize and fix it...

#

No wait

#

Gonna have to just call it via MainScreen object

thick karma
#

If they just used the damn setISButtonFor function like they should be...

#

damn it

thick karma
#

Okay that did not fix it

jaunty marten
thick karma
# jaunty marten wdym?

I mean that function uses the crurently stored Joypad.Texture for the button being set, so if they WERE using it, it would already automatically apply my textures when joypad gained focus on the menu.

#

Potentially revealing anomaly: 3 buttons appear to be set (improperly) before my custom textures load into the game, but the back button does not. When I start the game, it prompts me to press (A), and when I first enter Options menu, it prompts me to press (Y) or (X) as usual to apply stuff, but it actually shows Circle to go back

#

At THAT point, when I EXIT Options, A becomes Cross, X becomes Square, and Y becomes Triangle.

#

But B is already Circle.

#

So weird.

thick karma
thick karma
#

Of course it reinitializes moving from Options -> Main Screen

#

I feel like that's gotta be a big hint as to how this happens

jaunty marten
#

I mean if it's called before set variables and if u set ur variables in this event then they will override anyway

#

so u can wait 1 tick and set variable exactly after vanilla set

thick karma
#

The problem is I don't know where it's set.

#

And I may be wrong about when.

#

I don't need to delay at all after it's set if I know when it is set

#

There would be no need to wait any ticks...

jaunty marten
thick karma
#

I mean I do not know the name of the variable

jaunty marten
#

so event actual before

#

it's just my mind cos idk where's event trigger placed

#

in start or in end

thick karma
#

I've done it!

#

Omg what a headache!

dull moss
#

Someone asked me to help them with sandbox options so I wrote a small guide, thought maybe someone could use it here eventually

#sandbox #sandboxoptions #sandboxoptionstutorial #tutorial

Ok, so to make sandbox settings you'll need 2 files and then obviously a way to reference those in your lua files. On picture one you'll see 2 files you'll need for sandbox stuff to show in-game. _EN.txt is obv translation file, options.txt is where you put stuff. options.txt looks something like this (same in all mods) - picture 2. 'Page' dictates on which sandbox page will show up. translation is your translation string, Type can be integer, boolean, double and enum. Haven't used enum (dropdown menu) so idk how that one works. Picture 3 on how values in options.txt are linked to _EN.txt (or any other translation file). Once you done stuff in first 3 pictures, you got yourself a sandbox page and some adjustable variables in it. Now you need a way of getting those values from the code. To reference value that you set up in sandbox settings, you call it by option name. So, for example, if I'd want to call my

{
    type = boolean,
    default = true,
    page = EvolvingTraitsWorldSimplePerks,
    translation = EvolvingTraitsWorld_Mechanics,
}```
 option I'd call for `SandboxVars.EvolvingTraitsWorld.Mechanics` and it returns a boolean. I have a personal preference of using a local variable (picture 4) at the start of the file to skip using `SandboxVars.yourModNameHere` every time I need to grab a sandbox variable. So (on picture 4) numbers 1+2 are same as number 3. That's pretty much all there is to sandbox options.
jaunty marten
thick karma
#

Borky and incomplete lmao

#

Basically, when I detect a gamepad button press, if it's the first button press, I do something that I know will reliably fix the prompts: I open options and close it. The user cannot see this happen, but by doing so, it creates the illusion "Press X -> Gamepad Active With PS4 Buttons"

#

The problem now is that this solution is also firing in the character creation menu when trying to join a server

#

And that is causing a problem

#

So I need to better distinguish when the player is in fact in that initial menu state.

thick karma
thick karma
#

Omfg wow I just found the dumbest mistake that actually explains my headache... I was accidentally using a mod option where I meant to be using a local variable... oof.

ancient grail
#

i noticed the x_extends on the xml refers to file that also has m_BlendTime
do i need to have both ... for the file that i trigger and the extends?

also if i do getPlayer():playEmote("testt") testt is the m_Name or the m_StringValue???

ancient grail
drifting ore
#

Iirc setting zombies sight to poor in sandbox setting just reduces the chance of them spotting you, but is there any way to modify their sight range? So for example zombies would see you only if you were x tiles away from them?

dull moss
minor island
#

Any fixes for the LuaManager.getFunctionObject. no such function "recipe_recipename" error? Had a look through the Discord but couldn't find a fix. This is from my mod and is the only mod installed while testing. Functions still work as intended yet this error appears for every recipe. Cheers

thick karma
#

Does anyone have a screenshot showing the [gamepad] start or back button on screen by any chance? Not even sure when the game shows you that...

cosmic condor
#

not sure what do you mean lol

thick karma
#

a.k.a. Options and Share, + and -

#

But presumably Start and Back iirc in Xbox world.

#

I know what the A button prompt looks like but thank you nonetheless

cosmic condor
#

also, there is no start button in the ProjectZomboid\media\ui

#

but it appears in ProjectZomboid\media\ui\xbox

#

can't think of scenario to show the button

thick karma
#

I was trying to determine whether people would be likelier to see that on a dark background if they ever did see it

#

Nice work

solid dawn
#

Does someone here has experience with the profession framework? I used it for my professions and trait mod and, for some reason, the game always freezes completely whenever I select a profession/trait preset... I can't pin down the source as there is nothing about it in the console.txt.

solid dawn
#

I can try it but if the game doesn't writes anything into the console.txt file (because it freezes completely) I don't think this will help. I'll try it out tho

cosmic condor
#

check if you forgot { }

thick karma
#

A while loop, perhaps, or a do repeat until, or a very weirdly written for loop

sour island
#

Even suspected infinite loops will throw an error

solid dawn
#

I can send you the link to my mod if you want to take a look yourself. I really just need to know whats the source of this problem.
I've tested other mods that use the profession framework and they don't have this problem

thick karma
#

I don't know about in vanilla

#

I figured you did something unique with your profession

solid dawn
#

I did some unique things with my trait yeah but I can't say if one of those special functions is the source without the logs telling me lma

#

So I seeked helped from more experienced folks

#

๐Ÿ˜ฎโ€๐Ÿ’จ

thick karma
#

Did you check the log when the crash happens?

#

@solid dawn

#

Nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

#

๐Ÿ˜ญ Whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, Indie Stone? Why this ONE prompt!???!? Do not waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaant!

#

Uuuugh.

#

I was so close...

jaunty marten
small topaz
#

How do I check whether my game is single player or multiplayer? Can I simply use if not isClient() and not isServer() then to check whether I am in single player mode?

jaunty marten
#

.

thick karma
viral notch
#

sometimes is Client isn't the same what any type from joining to game?

small topaz
#

And another question: ModData.transmit(String key) sends data to every client. Will the player who actually hosts game also receive those data?

thick karma
#

Yeah if you are a host player you're a client too iirc

jaunty marten
solid dawn
thick karma
#

pointless lol but whatever

#

Writing "not" twice feels awk to me

jaunty marten
#

it's shorted but first way more easier to get what is real condition

thick karma
#

Subjective

#

If you know your DeMorgan's law well, it's identical

#

Also, some conditions read more naturally as "if not (this and that)"

#

if not (poor or stupid) then increaseOddsSuccess() end

#

Pretty sure that condition is easy to follow

jaunty marten
#

I'm sometimes getting confuse when creating a bit big condition by second way ๐Ÿ˜…

jaunty marten
thick karma
#

Fair fair