#mod_development

1 messages ยท Page 59 of 1

rancid tendon
#

start a new world

#

spawn a new item

fast galleon
#

you can test most of those changes while ingame, especially the DoParam
ScriptManager.instance:getItem("Tsarcraft.CassetteACDCHighwayToHell(1979)"):DoParam("DisplayName = Unlabelled Cassette")
and spawn the item from Items List

rancid tendon
#

how do i execute that from within game?

fast galleon
#

in debug mode, there's a console

rancid tendon
#

i did know about debug mode, just didn't know about the console part of it

lusty marsh
#

@fast galleon @thick karma Thanks guys, I tried using setJoypadFocus however it doesn't seem to work in the main menu (joypadData seems to have a MainMenu flag implying it might be treated differently)

I've ultimately got it working by forwarding the onJoypad* methods from the parent panel to my element when it's the current panel button. the vanilla Lua does something similar in ISPanelJoypad

rancid tendon
thick karma
#

Glad you got it solved!

rancid tendon
#

turns out it is spitting out errors for the actual mesh replacement portion of that code

bronze yoke
#

let me check a time i actually used that

#

oh i forgot how weird the syntax was, my bad

#
local model = getScriptManager():getModelScript('Tsarcraft.TCVinylrecord5')
if model then
    model:Load('TCVinylrecord5', '{mesh = WorldItems/DifferentModel,}')
end
rancid tendon
#

thank you!!

rancid tendon
#

this works pretty well on the small scale of changing the cassette mesh but... turns out the vinyl's dictated on a per-item basis which makes sense, but would require me to individually edit 1000 models

bronze yoke
#
for i=1,#modelList do
    local model = getScriptManager():getModelScript('Tsarcraft.' .. model)
    if model then
        model:Load(model, '{mesh = WorldItems/DifferentModel,}')
    end
end
#

modelList should be a table of models without the module

rancid tendon
#

like so?

#

oh wait

#

no nevermind i'm dumb i see how to do it lol

brazen harness
#

is there a way to change player animations through mods? i.e. Character holds guns pointing downwards instead of upwards when not aiming.

lusty marsh
#

is there any kind of warning functionality instead of using assert and stopping everything?

finite owl
round stump
#

Just checked, doesn't seem to be it.
That method "isDismantable()", seems to exist only for Thumpables (which I never understood what the heck are "ThumpableS")

#

What properties specifically? just checked and its not very clear.

#

it looks that the game just destroys everything blindly when you have a sledgehammer.

#

I guess I need to check the other way around, around damage performed by some stuff, like an Axe.

finite owl
#

Is there a "best practice" for transitioning a mod from separate SP and MP versions to a single, combined (backwards-compatible) version? The options as I see it is for the combined version to have a new modID (requiring both SP players and server admins to change their mod lists), or re-use either the SP or MP modID, allowing one to just upgrade smoothly, but requiring the other to change their mod list. And then there's the question of what to do with the now-unused modID(s)... do you leave a non-functional placeholder there saying "use the other mod", or do you just delete, forcing the player/server admin to do the switch if they want to load the save/start their server?

#

(Specifically, the RV Interior mod has SP and MP versions which are distributed under the same workshop ID, so anyone subscribed currently has both. The next version is a single combined mod, but we want to minimize the disruption for users.)

astral dune
#

if you delete a mod, it can be really unclear for end users which mod disappeared or why. Or even that it happened, but their game will throw errors. Best to leave a placeholder at least for that

unreal zealot
#

Thanks bro I found it

bronze yoke
#

you might be able to force the game to unload the mod and load the new one, but i haven't really heard of anyone actually doing it, just theorising about it, and it'd probably behave badly on servers

finite owl
#

We're thinking that we'll re-use the SP modID, since we figure that (as a gross generalisatoin) server admins are more technically savvy on average than SP players. And we're thinking that we'll make the MP version a non-functional placeholder that just logs messages saying "change to the combined version!"

astral dune
#

personally I would roll the version thats compatible with both into the MP modid, and then leave a fully functional SP version behind that warns them every 10 minutes or whatever that the version is outdated and no longer supported

#

I'd leave it functional so they don't lose anything, although I don't know how you'd migrate a savegame across to a new modid, they'd probably lose stuff anyway

bronze yoke
#

yeah servers will be a lot more annoyed than singleplayer

astral dune
#

if the new mod is a different modid, and that's in the item names or whatever, they'll disappear

bronze yoke
#

why would the modid be in the item names? isn't it just the same mod but multiplayer/singleplayer version?

finite owl
#

RV Interior has no unique items. It has custom maps (the interiors), but they're the same between the two versions, and for existing saves maps don't get updated when the underlying mod changes in any case.

astral dune
#

are people just using generic names for things without their ID? Doesn't that just invite conflicts?

#

well there you go

bronze yoke
#

instead of using 'ModSP.item' and 'ModMP.item' you'd just use 'Mod.item', surely? otherwise it complicates everything for no gain

finite owl
#

When I originally built the combined version, I based it on the MP version, and I've tested upgrading SP games to the combined version (including my actual long-term nomad run) without issues.

#

Well, any issues I encountered, I fixed ๐Ÿ™‚

bronze yoke
#

yeah, just add a little popup or any kind of notice to switch to the combined version

finite owl
#

And you reckon make it easy on server admins and use the MP ModID, and force SP players to update?

bronze yoke
#

yeah that's what i'd go with, server admins have a lot to deal with with mods already

finite owl
#

Yeah - Zomboid + Workshop + MP, what a mess. Players regularly unable to connect because some mod has updated, until the server does a restart.

#

Unless the server admin creates their own modpack, which many mod devs disallow.

bronze yoke
#

finally got around to checking this, loot is generated when the vehicle is created

finite owl
#

Nice! That should make things simpler ๐Ÿ™‚

bronze yoke
#

when the event is fired by a vehicle, it returns the vehicle type in place of the room type

rancid tendon
#

is the require field in mod.info comma or semicolon separated

bronze yoke
#

comma, don't use spaces

#

e.g.
require=Mod1,Mod2
not
require=Mod1, Mod2

true oriole
# bronze yoke comma, don't use spaces

ty for being kind and helping others thats rlly cool. this community is so friendly. idk rlly how to contribute here but i rlly want to learn modding just 4 this game.

rancid tendon
#

albion has been an absolute lifesaver for me repeatedly lol

#

she's great

true oriole
#

queen

#

how hard would it be to make a gun mod 4 this game

#

I really want to add the mp40

#

i love it sooo much its so cool

dark arch
rancid tendon
#

https://steamcommunity.com/sharedfiles/filedetails/?id=2857842616
sharing this because, hey, i just pushed the last very major content update for this mod! i'm proud to announce that, barring any bugs that come up from this patch and any new features i might think to add in the future, at least music-wise, Music for the End of the World is now a completed project and has a ton of new customization features and improvements to loot distribution

marsh dew
#

this mod is so good!

#

i really enjoy finding vinyls in my worlds

cedar salmon
#

Can anyone point me in roughly the right direction to mod the industrial generator (the thing in the back of the 3 car detached garage along Louisville's mansion row) to be functional? I don't want to add/remove anything from the world, I just want to make that tile have the same behavior as a portable generator. I've modded inventory items, but not world tiles so not sure where to start.

bronze yoke
#

i can't think of a way to do that outside of maybe hiding a generator inside it?

#

generators are pretty hardcoded i'm afraid

#

maybe you can manually set the powered status of nearby objects...?

cedar salmon
#

Hmm. That's a bit of a shame. I'll consider those options. I want it to be reasonably immersive, so just powering nearby objects isn't really what I'm after. Maybe hiding a generator in it will work. I'll think about possibly placing one in the world and seeing if that might work out. Time for some experimenting. Thanks for your help.

bronze yoke
#

as far as i know, it's either hiding a generator or reimplementing generators entirely

faint jewel
#

has anyone here used mrbountys simpleui?

frank rivet
#

Does anyone know where I can find the ingame cardboard box Java Class? I don't know where to look I am assuming it starts with "Base." But idk if its Base.Cardboardbox.

bronze yoke
#

i think you might be on the wrong track, specific objects rarely have their own class in java

frank rivet
#

Forgive me idk wtf I am talking about lol.

bronze yoke
#

the wording of your question makes me think you might be looking for the type of the item

#

which probably starts with Moveables. in this instance

frank rivet
#

I am creating a mod that makes the ingame cardboard box visible in your hand when you equip it.

#

Okay Ill check there.

bronze yoke
#

Base.Mov_CardboardBox

frank rivet
#

how did you find it! lol

bronze yoke
#

i went ingame and used the debug item list

#

it doesn't show modules though, so i used the console to print the full type

frank rivet
#

Ohh huh. Idk how to use console to print full types lol. Did you get the base id from the Big cardboard box or the small one you find in vacant houses? I need the small one lol

bronze yoke
#

i didn't actually place the item ๐Ÿ˜…

#

it's the small one

frank rivet
#

oaky thank you!

frank rivet
# bronze yoke i didn't actually place the item ๐Ÿ˜…

Hey so it looks like I am going to have to overwrite the vanilla cardboard box. Do you know where I can find all the information regarding that box? Planet Algol had to overwrite vanilla items for his mod to work as well. And I am using his mod as a template. This mod is mainly for myself. But I might post it to the workshop if it comes out well enough.

#

item Generator
{
DisplayCategory = Electronics,
Weight = 40,
Type = Normal,
DisplayName = Generator,
Icon = Generator,
Tooltip = Tooltip_Generator,
RequiresEquippedBothHands = true,
MetalValue = 500,
ConditionMax = 100,
Tags = HeavyItem,
StaticModel = PA_Generator,
primaryAnimMask = HoldingTorchRight,
secondaryAnimMask = HoldingTorchLeft,
}
I am looking for this kind of information. But for the small moveable cardboard box.

#

Also I am aware overwriting vanilla items are bad practice from what he said.

#

I am just brute forcing atm to make it work for me atleast. I am completely done with everything else regarding the mod. but without this info I keep crashing to desktop.

bronze yoke
#

i didn't think blair tended to overwrite items? i've only looked at one he made but that used doparam, which is the good practice way of modifying vanilla items

#

this data likely doesn't exist, moveable items are generated at runtime

frank rivet
#

yes doparam didn't work for him in this case. And fuqqqq lol. I came so far haha.

#

/* NOTE: overwriting vanilla items is generally a BAD PRACTICE. However, for whatever reason, using lua + the DoParam function to modify the script items in question did not work in this instance.
I have no idea why; using lua in that fashion has always worked before in my experience, and is best pratices, but in this case I had to overwrite the scripts themselves.
Hopefully I will be able to figure out the issue and find a solution that works w/o overwriting vanilla items, as it is a BAD PRACTICE. */

#

this is from his note.

bronze yoke
#

i wonder why... maybe moveables are created later than their code ran - though i'm sure they would have thought of that

#

that said, though it is very unappealing, as far as overriding items goes you're not likely to find another mod that modifies cardboard boxes

#

i'd like to experiment with changing it through lua but i've just gotten into bed ๐Ÿ˜…

frank rivet
#

haha no worries man. If you have time tomorrow. Ill be in here tomorrow harassing people to figure this out haha jk. But not really lol. Like this mod is fully complete besides this. But I might have to add container capabilities for the cardboard box in the lua. but i doubt it.

fast galleon
#

the masks have more logic done on load right after DoParam happens...
Added this to requests on the forum...

ancient grail
fading hinge
#

why is there no portable cassette player into the game yet? earbuds are already in all we need is just a way to use cassettes on the go

fast galleon
#

hm, does any one have a function that can match a series of OnKeyPressed to a string, so you can do
if text == "querty" then

#

just sharing some random thoughts and I remember again why I drop this, almost every key triggers something.

faint jewel
#

i don't mind if others do it ๐Ÿ™‚

robust briar
#

It's the little things like this that make me rage:

-- ISUIElement.lua
function ISUIElement:drawRect(x, y, w, h, a, r, g, b)
function ISUIElement:drawText(str, x, y, r, g, b, a, font)

One has a call signature of a,r,g,b and the other has r,g,b,a. angry

#

Thats an hour of my life I won't get back

calm depot
#

yeah, once you go beyond a few arguments, you really should use a struct, or, since this is lua, a table

#

but it's less effort to take args in java from lua than it is to process the table

thick karma
thick karma
lusty canyon
#

I can't fix this bug when i'm creating a top hat ๐Ÿ˜ฆ

ripe warren
#

do you have a shader and a texture defined on the model?

lusty canyon
#

Texture yes, 128x128

faint jewel
#

what is your script looking like?

ancient grail
#

ok thought i finally understood the whole inventory context menu thing...
but then again i was wrong.. i dont know how to capture the exact item that i clicked.
the arg items returns a table of items and some arent even on my inventory... and i cant even print it out for some reason cuz of some buffer thing...

does anyone know how to properly asign a variable to whetver i right clicked on"? pls help thnk you ๐Ÿ™

robust briar
# ancient grail ok thought i finally understood the whole inventory context menu thing... but th...

Here is a simple example of how to capture the item when clicked in your inventory

ISInventoryMenuElements = ISInventoryMenuElements or {}
function ISInventoryMenuElements.ContextMyMod()
    local self = ISMenuElement.new()
    self.invMenu = ISContextManager.getInstance().getInventoryMenu()

    function self.init()
        self.theItemClicked = nil
    end
    function self.createMenu(item)
        if not item or item:getType() ~= "MyModItemType" then
            return nil
        end
        self.theItemClicked = item
    end
    return self
end

edit: forgot the return self

ancient grail
lusty canyon
faint jewel
#

yeah

#

you should have two files.

lusty canyon
#

modelItems.txt too?

faint jewel
#

one describing the model, and one describing the item.

#

yup

lusty canyon
#

    imports {
        Base
    }

    item Gorrito
        {
            DisplayCategory = Accessory,
            Type            = Clothing,
            DisplayName     = Gorrito,
            ClothingItem    = Gorrito,
            BodyLocation    = Hat,
            Icon            = Gorrito,
            CanHaveHoles    = false,
            BloodLocation   = Head,
            BiteDefense     = 0,
            ScratchDefense  = 0,
            ChanceToFall    = 10,
            Insulation      = 0.25,
            WaterResistance = 0.2,
            Weight = 1,
        }
}```
#

and ```module TM {

imports {
    Base
}

model Gorrito {
    mesh = WorldItems/Clothing/Gorrito,
    scale = 1,
}

}```

tacit plover
#

it looks like your model is missing a texture file

hidden estuary
#

is there an easy way to make a certain food contract a trait over time?

#

somewhat like how tainted water contracts sickness that kills you but instead of an affliction is a trait

#

trying to make someone sick of eating the same stuff but to a specific food, not just any dish in the game

#

and then if they keep eating they eventually contract a trait that makes their life a tad tougher

bronze yoke
#

perhaps store the type of the last x meals in the player's mod data, and every time they eat check how many times that item is in the cache

hidden estuary
#

my hassle is at the trait tho

#

how can I "give" a trait to an existing character

#

a trait that you dont exactly choose at the character creation screen

#

obviously if the cache reaches a limit it can then give trait but I dont know how to give a trait

bronze yoke
#

IsoPlayer:getTraits():add('TraitName')

hidden estuary
#

wow thats simple

#

I figured it couldnt be the same as afflictions, I guess I was wrong

#

thank you

robust briar
bronze yoke
#

nice job!

frank rivet
frank rivet
faint jewel
#

it's not public atm... but yeah it's out there.

dark arch
#

I just published a mod to zoom in more yesterday on nexus mods

bronze yoke
#

zomboid has a nexus...?

#

oh i see, it wouldn't have worked on the workshop anyway

dark arch
#

yeah, it seems like a lot of the workshop mods are also published there as well for some reasons

bronze yoke
#

i guess there *are* non-steam users lol

dark arch
#

ohhh i didn't think about that lol

bronze yoke
#

i've never really thought to account for them LOL

#

most of my mods are available on github now but it's not really discoverable (or meant to be, it's just a portfolio lol)

dark arch
#

yarr!

astral dune
#

non steam user? never heard of em

quasi geode
#

i'm a non-steam user ๐Ÿ˜

dark arch
quasi geode
#

yep

#

i technically own it on steam as well for testing stuff (it was a gift) but i really dont use steam

frank rivet
frank rivet
faint jewel
#

of course you will lol.

grand spoke
#

why wont my mini map work when i host with mods

#

or play anything wont work anywhere ive uninstalled and validated

finite owl
violet solar
#

Would anyone here be interested in a mod collaboration for a playable board game mod? I specifically want to implement a mtg mod and have all of the required assets, however I do not know anything about lua or gui coding ๐Ÿ™‚ feel free to dm me if you would like more details

frank rivet
# faint jewel of course you will lol.

so I am basically done with everything but I need to know where to find the information that looks like this. This is from planet algol's visible generator mod. item Generator
{
DisplayCategory = Electronics,
Weight = 40,
Type = Normal,
DisplayName = Generator,
Icon = Generator,
Tooltip = Tooltip_Generator,
RequiresEquippedBothHands = true,
MetalValue = 500,
ConditionMax = 100,
Tags = HeavyItem,
StaticModel = PA_Generator,
primaryAnimMask = HoldingTorchRight,
secondaryAnimMask = HoldingTorchLeft,

frank rivet
#

lol

faint jewel
#

Lol.

#

Media\scripts\

bronze yoke
#
item Mov_CardboardBox
{
    DisplayCategory = Furniture,
    Type            = Moveable,
    Icon            = default,
    Weight              = 0.5,
    DisplayName        = Cardboard Box,
    WorldObjectSprite    = trashcontainers_01_24,
}
#

from newMoveables.txt

faint jewel
#

sorry was on my phone couldn't be as exact.

dark arch
#

is there a lua event for equiping/unequiping clothing? i couldn't find it on the wiki

frank rivet
# faint jewel sorry was on my phone couldn't be as exact.

np. so uh i made this lol. idk if thats enough lol item Mov_CardboardBox
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = default,
Weight = 0.5,
DisplayName = Cardboard Box,
WorldObjectSprite = trashcontainers_01_24,
RequiresEquippedBothHands = true,
StaticModel = PA_Cardboard Box,
primaryAnimMask = HoldingTorchRight,
secondaryAnimMask = HoldingTorchLeft
}

faint jewel
#

that should handle it.

frank rivet
bronze yoke
faint jewel
#
item Mov_CardboardBox
    {
        DisplayCategory = Container,
        Weight    =    2,
        Type    =    Container,
        DisplayName    =    Large Box,
        Icon    =    Cartbox,
        Tooltip = Tooltip_Cartbox,
        EquippedNoSprint         = TRUE,
        WeightReduction    =    65,
        RequiresEquippedBothHands = true,
        ConditionMax = 100,
        Capacity    =    50,
        OpenSound   =   OpenBag,
        CloseSound   =   CloseBag,
        PutInSound   =   PutItemInBag,
        Tags = HeavyItem,
        StaticModel = KYRP/PA_Cardboard_Box,
        primaryAnimMask = HoldingCarryGrabRight,
        secondaryAnimMask = HoldingCarryGrabLeft,
        WorldStaticModel = W_Cardboard_Box,
    }```
frank rivet
frank rivet
dark arch
bronze yoke
#

you can insert your own code into a vanilla function by saving the original function into a variable, and then overwriting it with your own code followed by (or following) a call to the original

#

you can make custom events but it's not too often useful

#

you can do this with something like LuaEventManager.AddEvent('OnEventName') and then triggerEvent('OnEventName', param1, param2, etc)

dark arch
#

im assuming the java files can call events as well for somethings?

bronze yoke
#

yeah, most events are from java

dark arch
#

thanks!

faint jewel
#

i need some assistance with lua and simpleui.

#

I am trying to make something very similar to this. image on the left. two title lines. and 4 cells below that.

finite owl
# dark arch What exactly calls events? Can you make custom events? The modding wiki was very...

As well as the event system where you register a callback against a particular event using e.g. Events.OnKeyPressed.Add(myCallbackFunction), there are also client commands... they're half of the client-server comms system for MP, but client commands also fire in SP. A callback registered for the OnClientCommand event using Events.OnClientCommand.Add(myClientCommandHandler) will be invoked on every client command, passed the arguments module (string), command (string), player (the player the command was send on behalf of, mostly) and arguments (a Lua table of parameters which are different for each different client command). You can detect some interesting events that way - anything that would need to be sent to the server in a MP game, basically. So for example you can check if module == 'vehicle' and command == 'uninstallPart' to detect if the player has just uninstalled a part from a vehicle.

#

I've been using Lua tables to make it easy to register callbacks against certain combos of module and command. I just use those params to look up the callback in tables, like this:

-- Generic handler for client commands
local clientCommandHandlers = {}
local adminClientCommandHandlers = {}
local clientVehicleCommandHandlers = {}

local allCommandHandlers = {
    RVInterior = clientCommandHandlers,
    RVInteriorAdmin = adminClientCommandHandlers,
    vehicle = clientVehicleCommandHandlers
}

local function onClientCommand(module, command, player, arguments)
    local handers = allCommandHandlers[module]
    if handers and handers[command] then
        handers[command](player, arguments)
    end
end

Events.OnClientCommand.Add(onClientCommand)```
#

And then you can just assign a callback to one of those handler tables to fire when that module/command combo is fired, e.g.:

--- Synch when a battery is removed
clientVehicleCommandHandlers.uninstallPart = function(_player, arguments)
    if arguments.part == "Battery" then
        synchBatteryAndGeneratorIfBothLoaded(getVehicleById(arguments.vehicle))
    end
end
modest ermine
#

Anyone using PW template to develop mods?

viral notch
rancid tendon
#

question: does anyone here know of a way to compress audio files in a way that might be usable by PZ? my music mod has about 4gb of music in it, and currently they're just ogg files sitting in the open, and i feel like there's gotta be a good way to compress them further into like a pack file or something so that they take up less space until they're loaded

viral notch
#

use wav

finite owl
#

Ogg Vorbis files already use a pretty good compression algorithm. Wavs are uncompressed and much larger.

rancid tendon
#

yeah those would be much worse lol

ancient grail
finite owl
#

Lots of individual files take up a lot more space if the files are small, because they usually round up to some minimum block size. Lots of sizable files won't be wasting that much space relative to the total size, though.

ancient grail
#

Instead of file =

modest ermine
ancient grail
#

Ah wow . Have you joined their discord?i dont think they are active anymore tho

#

The devs .. i mean

modest ermine
#

Jab returned from Navy so, right now its on hold

#

It works fine, until you try to implement your own lets say UI class

#

Working with intellisense is more convenient, since in lua you can't see farther then parent "class"

ancient grail
modest ermine
#

I like when I can see all fields/methods exposed

tired hawk
#

I wish I could help

#

Speaking of TCGs, I made an alternate version of the checklist for the PKMN Trading Cards mod

fast galleon
#

lol, can somebody make "dig meseum" game for PZ. Collect bones around Kentucky, to build Dinosaur skeletons.

violet solar
fast galleon
#

honestly, I am waiting for v.42 monster rancher mods.

pastel storm
#

No matter what I do, sendServerCommand or sendClientCommand does absolutely nothing.

#
-- ISBlackjackMenu.lua
ISBlackjackMenu = ISPanel:derive("ISBlackjackMenu")

ISBlackjackMenu.cOnServerCommand = function(module, command, player, args)
    print("On server module", module)
    print("On server command", command)
    print("args") print(args)
end

Events.OnServerCommand.Add(ISBlackjackMenu.cOnServerCommand)

From console:

sendServerCommand("ISBlackjackMenu", "test", {"abc"})
sendServerCommand(getSpecificPlayer(0), "ISBlackjackMenu", "test", {"abc"})
rancid tendon
#

question: if i include a sandbox options file in a mod that contains an option, and then put that sandbox option's translation into another mod that is required by the first mod, will that work fine or do the translation and the sandbox option need to be stored within the same mod?

#

update: tested it myself, works fine

bronze yoke
pastel storm
#

it was the fact that I wasnt running dedicated

bronze yoke
#

server commands work in hosted too

astral dune
#

Ya, hosted works just like dedicated. It can be a little confusing, it was for me at first, but your client handles server commands and your server handles client commands. In other words, you call sendServerCommand from the server, and sendClientCommand from the client

#

when you use the console in-game, thats client side, so sendServerCommand would do nothing

exotic hornet
#

Hello im new here and i want to play with my friends on my DEDICATED SERVER.... so i dont know how i can setup my own BRITAS WEAPON MOD like changing the spawnrate can someone help me out because no one in youtube shows it... like i know that i have to setup my own mod but yeah i dont know what i should put in there... anyone have time for a call ?

winter thunder
#

Anyone here messed with multi-stage building? I am trying to figure out if I can have it work on something that is larger than a single tile.

For the sake of explanation- something like turning a dining table into a couch. Both are 2 wide, using 2 separate tile definitions- but I just wanna make sure that is a possibility

ancient grail
bronze yoke
#

translations are translations, the game doesn't care where they come from

ancient grail
hollow current
#

is there any way to check if there are zombies within x range of the player?

bronze yoke
#

i don't think there's a better way than either checking the squares or using the zombie list

weak sierra
#

the game also seems to know which second tile is programmatically associated with the first for picking it up

#

so there may well be an even cleaner way to do it too

bronze yoke
#

as far as multi-stage building goes, probably not? vanilla doesn't use it so i don't see why it'd be a feature

#

but it would be easy enough to do yourself

hollow current
#

actually I am thinking about a logic but I am not sure what's the best way to do this. So basically, what I am trying to do is have the player have an uncontrollable mental breakdown when sadness is above a certain level, and has picked a certain trait. So, to make it realistic, he shouldn't have that kind of mental breakdown when he's fighting hordes or there are zombies nearby, cause yk, survival instincts

#

that's where it gets complex. I thought initially about making it check if there are zombies present within the range of the player, but that doesn't take into account whether player is aware of the zombie's presence or not

astral dune
#

can't sleep, enemies nearby

bronze yoke
#

maybe IsoGameCharacter:getSurroundingAttackingZombies()?

#

no idea exactly what it does but it sounds like it could be useful

finite owl
# pastel storm ```lua -- ISBlackjackMenu.lua ISBlackjackMenu = ISPanel:derive("ISBlackjackMenu"...

Yeah, as mentioned, server commands don't fire in single player, although client commands do. It's rather annoying - if server commands just triggered the event handlers in SP as well, it would reduce the amount of coding you'd need to do when writing a SP+MP mod. As it is, you can write your own version of sendServerCommand which triggers the event handler:

-- Do nothing in multiplayer on the client (isClient always returns false in single player)
if isClient() then return end

-- Wrap sendServerCommand to invoke the event handler for singleplayer, because the game engine doesn't do it.
local function sendServerCommandTo(player, module, command, arguments)
    arguments = arguments or {}
    arguments.playerId = player:getOnlineID()
    if isServer() then
        sendServerCommand(player, module, command, arguments)
    else
        triggerEvent("OnServerCommand", module, command, arguments)
    end
end
hollow current
bronze yoke
#

how about looping through getCell():getZombieList() and checking if their target is the player with IsoZombie:getTarget()?

finite owl
#

There's player:getStats():getNumChasingZombies() and player:getStats():getNumVisibleZombies()

hollow current
#

oo that does sound like we're getting somewhere, that definitely solves 80% of the issue

dark arch
#

I love how one of the java files is just called "Thumpable"

hollow current
#

out of curiousty, would there be a function that lets you know if the player can hear any zombie nearby (but can't see it and the zombie isn't attacking the player)?

#

like, a zombie groaning, or thumping on a nearby door/gate/window

dark arch
#

Im not really sure, how do i paste code blocks?

pastel storm
finite owl
#

Enclose the code in three backticks (the symbol above the tilde on US keyboards). Like this, but using backticks instead of apostrophes
'''lua
(code)
'''

pastel storm
#

```lua
code here
```
makes

code here
dark arch
#
 package zombie.iso.objects.interfaces;

import zombie.inventory.types.HandWeapon;
import zombie.characters.IsoGameCharacter;
import zombie.iso.IsoMovingObject;

public interface Thumpable
{
    boolean isDestroyed();
    
    void Thump(final IsoMovingObject p0);
    
    void WeaponHit(final IsoGameCharacter p0, final HandWeapon p1);
    
    Thumpable getThumpableFor(final IsoGameCharacter p0);
    
    float getThumpCondition();
} ```
bronze yoke
#

or ```java in this case

pastel storm
#

Ah yes there is a java property called OhFuckMoment lol

finite owl
#

Looks like the Thumpable interface is for things like doors, windows, roller doors... environmental objects you can break by thumping them.

bronze yoke
#

of course there's both getNumVisibleZombies() and getVisibleZombies() and they do the exact same thing

hollow current
#

i'd think getVisibleZombies returns a list of visible zombie objects

#

whereas getNumVisibleZombies() returns an integer of visible zombies

bronze yoke
#

it doesn't

#

they do the exact same thing

hollow current
#

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

#

wait so do they actually return an integer or a list

bronze yoke
#

an integer

hollow current
#

playerObj:getStats():getNumVeryCloseZombies()

#

apparently there is this as well

#

not sure how veryClose we're talking about

winter thunder
frank rivet
#

So I am making a mod that is skizot made with being able to visibly see different ingame objects in your hand when having them equipped. And I keep getting crashes. Heres my lua local scriptItem = getScriptManager():getItem("Base.Mov_CardboardBox") if scriptItem then -- print("Visible Cardboard Box!") scriptItem:DoParam("StaticModel = PA_CardboardBox") scriptItem:DoParam("primaryAnimMask = HoldingTorchRight") scriptItem:DoParam("secondaryAnimMask = HoldingTorchLeft") end

#

script 1 ```module Base
{

    model PA_CarboardBox
{
    mesh = PA_CardboardBox,
    texture = PA_CardboardBox,
    scale = 0.005,
}```
#
    {
        DisplayCategory = Furniture,
        Weight    =    0.5,
        Type    =    Moveable,
        DisplayName    =    Cardboard Box,
        Icon    =    default,
        RequiresEquippedBothHands = true,
    Tags = HeavyItem,
        StaticModel = PA_CardboardBox,
        primaryAnimMask = HoldingTorchRight,
        secondaryAnimMask = HoldingTorchLeft,

    }```
#

script 2. Can anyone tell me where I went wrong. I am able to launch the game now atleast. but when I reload my lua it crashes.

winter thunder
#

@frank rivet have you tried making a new item, basically copying the base cardboard box- but with your changes to make sure there isnโ€™t something else that is broken?

#

Wait

winter thunder
frank rivet
#

yes.

#

did i commit a mortal sin? haha

winter thunder
#

Like, you posted 3 things- are any of them in the same? Or are they all separate

frank rivet
#

all separate. the top code block is my VisibleCardboardBox_vanillaModifications.lua and the other 2 are my script.txt files

winter thunder
#

Oh

#

Lol I know the issue

frank rivet
#

did I pick a whole bouquet of oopsy daisy's?

winter thunder
#

You need to end your brackets for the module here

#

And

#

On your item file you didnโ€™t declare the module, so- you can do the same as your other script with

module Base {

your code

}

frank rivet
#

Oh okay one sec. I can try to fix the second script but what should it look like for the first script? I'm confused on how to end the brackets for the module lol

#
{
    

    item Mov_CardboardBox
    {
        DisplayCategory = Furniture,
        Weight    =    0.5,
        Type    =    Moveable,
        DisplayName    =    Cardboard Box,
        Icon    =    default,
        RequiresEquippedBothHands = true,
    Tags = HeavyItem,
        StaticModel = PA_CardboardBox,
        primaryAnimMask = HoldingTorchRight,
        secondaryAnimMask = HoldingTorchLeft,

    }```
winter thunder
#

Like, you have your module set and then your have an bracket โ€œ{โ€œ

At the VERY end you are missing a another โ€œ}โ€

frank rivet
#

is that correct?

#

ohh okay thank you lol

winter thunder
#

So you need another at the very end

#

Lol yeah no worries

frank rivet
#
{
    
        model PA_CarboardBox
    {
        mesh = PA_CardboardBox,
        texture = PA_CardboardBox,
        scale = 0.005,
    }}```
#

does that look better lol?

winter thunder
#

For cleanup put it one row down in line with the one on the top

frank rivet
#
{
        model PA_CarboardBox
    {
        mesh = PA_CardboardBox,
        texture = PA_CardboardBox,
        scale = 0.005,
    }}```
#

? I have no idea what I am doing as you can tell haha.

winter thunder
#

Like this is what I mean, so your brackets line up

frank rivet
#

Oh thank you! I really appreciate the help!

winter thunder
#

Just looks nicer lol

hollow current
frank rivet
winter thunder
frank rivet
winter thunder
#

๐Ÿ‘

frank rivet
#

I am aware the model for it is a little weird lol. I got it off sketchfab since i didn't know how to find ingame models lol.

winter thunder
hollow current
#

i'll still have to figure sth out for the more complex circumstances

frank rivet
winter thunder
#

Yes

#

More than likely at least

frank rivet
# winter thunder Yes

hmm. I am confused on how to ask this now. So planet algol made the visible generator mod. But the difference between the generator and the box is that the box is only a tile and not a equippable like the generator?

winter thunder
#

Really quick @frank rivet edit your mod.info file, and set the id to

id=VisibleCardboardBox

#

then try launching it lol

frank rivet
#

okay I will! one sec haha

winter thunder
frank rivet
winter thunder
trail lotus
#

any modders that want to create some pretty immersive mods for a server let me know I'd love to talk about some commissions. (farming, cooking, creating things) or any base game changes that might make things harder like the health system and so fourth. I normally just pay weekly or we can do a one off project. also if you already have a big immersive mod and want to improve it or add on but don't have the motivation let me know and maybe I can help you find that motivation haha, thanks!

winter thunder
#

adds the ability to pin up / stab paper

trail lotus
#

Ill look now, I have a pretty big roleplay server.

winter thunder
#

as well as some ooc markers for event staff

trail lotus
#

but it has no zombies.

#

oh wow that's actually sick.

winter thunder
#

Thanks! :)

#

Was a pain to figure out at first, but the notes keep their information when you put them up/take them down too

trail lotus
#

that's actually sick I could for sure see some like serial killer rp type stuff going on, leaving notes at the crime scene.

#

we had a bomber in the server a few weeks ago who left pipe bombs around and notes.

winter thunder
#

but- also, if you have anything specific in mind, me and a few friends have started some mod dev stuff recently. If you have anything particular in mind, we might be able to help out!

ancient grail
#

Ow like the tile has the paper write function?

trail lotus
#

uh oh here comes trouble

winter thunder
ancient grail
#

Wow

trail lotus
#

so you can place it free floating anywhere technically as its just a floating item?

winter thunder
#

Yeah, technically- but it does mean that you can pin it to just about anything. So you could leave notes on trees, graves, walls, or whatever else you can think of

trail lotus
#

hmm i see, i'd have to be careful cause any chance my people get to abuse something to troll they will. apparently its easy to craft mortars and pestles as you get a ton with glytchers mining mod he built for us, so instead of properly disposing of the stones or even selling them because you can do that

#

people crafted over 3000 mortar and pestles

#

in like a week and just left them in piles

winter thunder
#

Jesus... That is brutal

trail lotus
#

they are little assholes if you don't watch them

winter thunder
#

Similar stuff happens with knitting needles in the base game though too, since people will find any way to farm the hell out of a resource if possible

trail lotus
#

also apparently its easy to craft crosses so at the sell point people crafted like 500 crosses and started placing them around the sell point in satanic formations.

winter thunder
#

that one is pretty funny though- ngl haha

trail lotus
#

Looool one sec then you have stuff like this on the server ๐Ÿ˜ฉ๐Ÿ˜ฉ I guess when players donโ€™t have any zombies to kill they find very creative ways to spend their newly found free time

winter thunder
#

The corn lord taketh and the corn lord giveth

trail lotus
#

I think his name is cornhulu?

weak sierra
trail lotus
#

He left me a interesting note on my desk in my office.

#

Ahh itโ€™s fun though, I admire the creativity of some of the random methods they have come up with. however I donโ€™t think the people that want to mine peacefully and get more then 1 frame while doing so appreciated the large piles.

frank rivet
# faint jewel that should handle it.

Hey did you have to create new items for the items in game that didn't have visible fbx models? I think that is probably why I am running into issues with my mod lol.

dark arch
#

so i think i found a tool to edit the java files easier, so now you will be able to zoom out further in my zoom mod

faint jewel
#

i was able to override the existing stuff

robust briar
bronze yoke
#

nice!

robust briar
#

Ty โ™ฅ๏ธ

#

Can't stop working on it lol

late hound
robust briar
# late hound super cool!

Super efficient too. the light show takes place entirely in client, with only a "show setup" message going from the originating client to server then to all other connected players. Basically it causes like zero server overhead ๐ŸŽ‰

young orchid
robust briar
#

Thats the game plan

young orchid
#

@robust briar btw PZ clubbing: would it be possible to create a modded radio which plays mp3 files of a folder stored on that server or another ftp url? also synced between nearby players?

#

I dont like that oldschool mp3 exchange for all clients and making sure everyone has identical files

robust briar
#

Ummm... I don't think pz has an http or ftp Lua library enabled

#

I can test later, but I doubt it

frank rivet
# faint jewel i was able to override the existing stuff

Okay so then this is what I got so far. Idk if you could tell me why I would be crashing. "module Base { item Mov_CardboardBox { DisplayCategory = Furniture, Weight = 0.5, Type = Moveable, DisplayName = Cardboard Box, Icon = default, RequiresEquippedBothHands = true, Tags = HeavyItem, StaticModel = PA_CardboardBox, primaryAnimMask = HoldingTorchRight, secondaryAnimMask = HoldingTorchLeft, }

#
{
        model PA_CarboardBox
    {
        mesh = PA_CardboardBox,
        texture = PA_CardboardBox,
        scale = 0.005,
    }
}```
frank rivet
#

sorry the lua pasted weird.

frank rivet
faint jewel
#

did you check the log?

frank rivet
frank rivet
frank rivet
frank rivet
faint jewel
winter thunder
#

I made a file that went over my corrections, if you wanna try that

#

I dont have the opportunity to test it myself

frank rivet
frank rivet
opal rivet
steady apex
#

Taxi go broom

opal rivet
#

Indeed

#

I'm going to update my mod soon

steady apex
#

They've got nice models, personally prefer the white bar with black taxi logo.

opal rivet
#

So there will this vehicle in game

#

What do you mean by that?

#

Well you see here they can be randomize

steady apex
#

I just prefer how it looks out of the 2 taxi models, just an opinion as they are both nice textures

opal rivet
#

You see on the top that's 91 Crown Vic LTD

#

Down one is the 85 Crown Vic LTD

steady apex
#

Explains the different tail lights

opal rivet
#

Exactly

vernal citrus
#

Anyone here use the only cure mod? does the arm have to be bitten to amputate it

#

cause I cant see any menus for some reason

dark arch
#

so ive encounted a map bug. I tried reinstalling the game without mods, but I still have it. Based on the online map it seems some ferns aren't showing up right. Any suggestions? location 10798, 10050

bronze yoke
#

this just happens in debug mode

opal rivet
#

I've seen that in game as well

#

That Explains it

dark arch
#

ohh, that makes me feel a lot better! thanks

frank rivet
# winter thunder <@812400835182854156> sorry, I had some stuff come up

Hey so good news! I didn't crash and i seen what you wrote! That's going to be super helpful going forward. But unfortunately when I pick up the cardboard box and equip it. My model doesn't show up. I seen you said something about an event trigger. But I used planet algol's generator mod as a template and filled in the blanks with information regarding the cardboard box. He didn't have a trigger in his. So I wouldn't have a clue on how to create that haha. I was hoping I could recreate what he did for my "first" mod. But it's turning out to not be as easy as I hoped lol.

frank rivet
worn sail
#

Hello, I'm looking for sprinter zed spawn mod
Has anyone done it yet?

dark arch
frank rivet
frank rivet
worn sail
#

I'm making zomboid server and want to make some map have only sprinter by hoard manager

frank rivet
#

Ah if its map specific, I wouldn't be much help lol.

worn sail
#

like create only sprinter by admin tool

wheat cove
#

Hi, I'm fairly new to the modding, and I'm here to get some help creating a mod. I'm trying to create a mod with weapons that can be converted to each other. Let's say the mod has weapon Alpha and Beta.

recipe Convert to Beta
{
    Alpha,

    Result:Beta,
    Time:30.0,
    Category:Weapons,
}

recipe Convert to Alpha
{
    Beta,

    Result:Alpha,
    Time:30.0,
    Category:Weapons,
}

When I create recipe scripts like above, I can see the converted items keep the original condition. But I'd also like to keep the original repair counts as well. I'm looking into codes related with spear-crafting but I couldn't find a clue to do so. Anyone can help me out? Or is there any mod with similar features I can refer to? Or would there be any way to make the recipe work only with items with no repair counts?

hot patrol
#

the creator of it made it an entirely stand alone mod so it's fallen behind the original.

zealous wing
#

So I'm working on a sort of quasi mod/patch for a bunch of the military vehicles on the workshop. I've noticed that with the exception of Filibuster Rhymes' cars, NONE of them have what I would consider to be "military" themed loot. So I've been working the last few days on a set of loot and vehicle tables that allows a lot of military gear from both the vanilla experience and many mods to spawn inside any abandoned jeeps, deuces or humvees you'll find. In addition to KI5's US army stuff, I've added cars from a few others into the mix as well.

Also, I've created a class of military vehicle called "Black Ops". Blacked out army vehicles that are very rare, but are filled to the gills with high grade loot. I like to think they're immersive. The idea being that in those few early days of the outbreak, these task forces were running around trying to figure out what was going on on the ground. weeks or months later, their rides can still be found, scattered around the map. Finding one of these would mean you are very lucky and are having a good day:

finite owl
#

But yes, it's annoying that the Bow and Arrow AddOn QoL mod has been updated to work with the new version of Gluten the Sensitive's mod, and so is no longer compatible with Alternative Drawing.

hot patrol
#

yea it's a shame because I love the alternative drawing mod.

winter thunder
#

Anyone know of an elegant way to 'lock' an inventory/item container?

#

Basically- put items in, "close/seal" it, and it makes it so there is no way to access the things inside without actually "opening" the item

bronze yoke
#

object containers can be locked, don't think there's anything like that for item containers

winter thunder
#

yeah, i know about the locking mech for obj containers. My goal is to add boxes/packages that can be sealed/opened

opal rivet
#

I think there's a lock in game I think

#

I'm not quite sure

winter thunder
#

Like- In inventory, as items

opal rivet
#

I'm confused

bronze yoke
#

you can store all the items into moddata and destroy the original container and recreate it when it's unlocked, but that's kind of a massive nightmare of figuring out which properties you need to store and stuff

#

maybe you can just hijack the inventory ui?

#

oh you'd still have to block stuff being taken out for like recipes and stuff...

winter thunder
#

Yeah, that sounds like a cluster fโ€” ngl. I wanna avoid that sorta stuff if possible. Iโ€™m thinking I could hijack the UI like you said, make it so that it doesnโ€™t show anything inside unless you specifically open it

quasi kernel
#

Would something like this be viable as a mod?

#

I think it's be interesting to have a proper multitool, only downside is it'd be pretty heavy.

winter thunder
#

yes, and using tags it would be really easy

quasi kernel
#

Would have the functionality of an axe, can opener, screwdriver, hammer, and knife all in one.

#

Would likely dumb down it's damage though since it's meant to be a tool and not a weapon.

#

Axe part is for cutting trees.

winter thunder
#

yeah, you could do that. would be pretty op- imho. but it would work

quasi kernel
#

I was thinking of making it moreso like a craft able that requires a crap ton of supplies.

#

You'd need every piece, perhaps some carpentry, some duct tape, screws (wow a use for screws!), etc

#

Was also thinking like tool kits.

#

Would be heavy but just means you can transfer one item instead of like 5.

#

Multitool might be more proper for something like this but I dunno

#

Toolboxes already kinda exist I guess so shrug

winter thunder
#

that would be pretty easy too, same deal. You'd just have to copy over all the item tags from each item into the one you wanna add

quasi kernel
#

I just hope screwdriver has a tag

#

Hammer I'm p sure does, so do knives.

winter thunder
#

it does

quasi kernel
#

Sweet

winter thunder
#

so does hammer, saw, and more

quasi kernel
#

Well this'll be an easy implementation.

winter thunder
#

yeah

quasi kernel
#

Only problem is how am I gonna balance this cuz a multitool is like you said, kinda op.

bronze yoke
#

it should definitely be the worst axe

quasi kernel
#

Def

bronze yoke
#

okay well it's hard to be worse than the stone axe, but let's ignore that one

quasi kernel
#

Maybe equal to, if not a tad better than stone.

#

You'd have to sacrifice a hand hatchet or something to get the parts so

#

Man how would I balance something like this-

#

The creation fee in itself may be it's balance.

#

Cuz it'd likely require a hand hatchet of some sort, a screwdriver, screws, perhaps proficiency in some skills a saw (?), a can opener, a hammer of some sort, and a knife of some sort.

#

Perhaps metalworking skill.

#

Throw in some screws and scrap metal requirement and I think we're closer.

dark arch
dark arch
quasi kernel
#

Thinking of making it makeshift

#

Companies can't do it right, so you make it yourself.

dark arch
#

remember everything is a hammer if you try hard enough

quasi kernel
#

Fair point

dark arch
#

i dont think its possible, but it would be really cool if you switch weapon modes to some of the different tools

bronze yoke
#

it's possible but kind of a pain

frank rivet
#

Incoming new mod where you can visibly see most things you pick that don't currently have a model when equipped. I have finally gotten one step closer to bringing this mod to reality.

zealous wing
ancient grail
hot patrol
#

I remember almost breaking my foot replacing one of those

young orchid
ancient grail
fast galleon
# ancient grail How can we add items to a tag table without writing it on the item script? And c...
ancient grail
#

Ow yrmeah now i remember this.

frank rivet
finite owl
# hot patrol yea it's a shame because I love the alternative drawing mod.

I had a look comparing the code from the Alternate Draw mod to the current version of Bow and Arrow. It's a bit confusing because B&A has updated since AD took it and made changes on top (as you know), and AD appears to change quite a few things beyond the drawing of the bow, but it looks like it should be possible to write a mod which just adds the left-click-to-draw, release-to-shoot behaviour of AD to B&A

young orchid
ancient grail
#

Thats true fuse.. but the thing is seddows want to create the mod uptill skizots's current progress.
Not like beyond it i think

young orchid
frank rivet
# young orchid he lit wrote _Incoming new mod where you can visibly see most things you pick th...

I plan on expanding it. But again it's for myself. Skizot said his mod compendium for the visible assets is already out there. But I wasn't able to find it "because he never uploaded it" so I decided to retrace his steps. This is my first mod. Weather it gets put on the workshop by me or someone else isn't my focus. Also. In regards to us working together. Skizot is leagues ahead of me. He would get more done with less time just working on it himself lol.

#

"Incoming mod" was just an update on my progress lol.

hot patrol
finite owl
#

Cool, although it's 8pm here so might be ๐Ÿ’ค by then ๐Ÿ˜

hot patrol
#

No worries.

fast galleon
#

I want to have visual difference between converted items (buckets) for uis and the best way seems to modify the icons. Considering these are very small in size, what's a good way to do this? Scaling down other textures like pvp_icon and backpack would probably not work for this.

ancient grail
#

Anyone knows how to capture the square you right clicked when doing context menu

#

Like the getSquare() of that rightclick

fast galleon
#

I mean one of worldobjects btw, not the table.

ancient grail
#

Is it ok to make it worldobject cuz i see all the params use worldobjects

#

Ah so i have to loop thru it and look for what exactly? To convert worldobjects to worldobject

fast galleon
#

it's a lua table with items in world

ancient grail
#

Cuz i need to capture the movingobject isoplayer

#

Like clickedplayer

fast galleon
#

there's already some context's for actions on clicked players like medical, not sure where it is though

ancient grail
#

Ye and trade but i cant seem to disect it..

#

Same problem with what i did yesterday but it was inventoryitem

I think this is a diffent set of pain ahead of me lol

I was only able to do it cuz gravy helped me
But idont think i can apply the same method

spare river
#

anyone know a similar map mod?

#

this one i have been waiting for a while but it has been canceled sadly

gilded hawk
spare river
#

no an entirely new map

#

there are already mods for that

gilded hawk
#

Mh I see ๐Ÿค”

spare river
#

like the 10 years later and others

#

but this one was focused on detail

ruby urchin
#

Is possible to change getSaveInfo() properties?

ruby urchin
#

in case someone finds it useful, kahlua has serialize and deserialize functions

print(deserialize("{x = 10}").x)
print(serialize({x = 10, y = 50, z = 20, object = {one = "asdsa"}}, "\n", "    "))
buoyant sky
#

Is the modder for the basement mod here around? I would like to know if the code is opensource

remote garden
#

Why not ask in the comments of the workshop page?

halcyon tide
#

When youโ€™re trying to tell squidward to get a job lol

faint jewel
neon bronze
#

anyone knows how you can access the inventory of duffel bags and such through your character?

undone crag
#

There's the something function on the something object, which can be found somewhere in the java API documentation or in some parts of the base game LUA where it calls relevant functions. (this answer is not greatly detailed)

quasi kernel
#

Has anyone made a chemlight mod?

gilded hawk
#

Is there a way to have joggers zombies? Like spriters, but less fast

gilded hawk
quasi kernel
#

Agony

#

You figure it'd still be viable as its own mod?

gilded hawk
gilded hawk
#

As an example, authentic z chem lights don't sync up

quasi kernel
#

Wonder what vanilla does differently.

gilded hawk
#

Most of the modded light especially the one you can "wear" they just make a client side light, that's why

quasi kernel
#

Ah, I see.

gilded hawk
#

I'm fairly sure that it can be synched with some networking code, but it's quite challenging

quasi kernel
#

Hmm

#

I haven't stepped into the networking side yet

robust briar
#

It's really quite simple once you get the idea

quasi kernel
#

Tell me your knowledge

gilded hawk
robust briar
#

Well, in my case its about lamps, so they are not moving, but in theory if you say "PlayerX has a light of X color with Y intensity" the receiving client could do the check of their orientation and apply the light there.

#

Then use the OnTick event to adjust the light.

#

Obviously, lots of bail early checks would be needed to keep up performance

#

The other "gotcha" is when dealing with both SP and MP. I had to do a bit of weird things to make it work in both. If you want to see all my lua, and how I accomplish it you can look up the "Remote Lights Controller" mod. I do both "server synced" and "clients only" light modifications.

quasi kernel
#

Interesting

#

Will check it out, I thank

#

May focus in on my multitool first tho

nocturne swift
#

Hi, did someone fix the dup of any item through disconnecting from the server?
I don't know, maybe you can somehow implement a delay in exiting the server, or at least an idea of how it can be implemented?

robust briar
#

Does Events.OnCreatePlayer trigger when a player is created, ala joins the server or starts the game. or is that in reference to the character creation screen?

robust briar
#

It doesn't seem so. I wonder if there is an event

kind galleon
#

Does anyone have a list of mods that have a public git repository? New to modding and good to see how some things are done

robust briar
#

Wait, maybe it does.. I had the params wrong. Testing again lol

robust briar
quasi kernel
#

^^

robust briar
#

Assuming windows, C:\Program Files (x86)\Steam\steamapps\workshop\content\108600

quasi kernel
#

Need some ideas for what should be in what tier for like, a makeshift multitool mod.

#

Right now i'm thinking like

#

SMK = Knife, Can Opener, Screwdriver
LG = All features of SMK, Saw, Scissors, Spoon
CT = All features of SMK + LG, Hammer, Axe, Wrench
TS = All features of SMK, LG, and CT, Shovel

#

Don't know if the "Tactical Shovel" should have access to a lug wrench or not.

low yarrow
bronze yoke
#

if you want to only fire on creation, set some mod data

robust briar
#

Ty

hollow current
#

would the :stop() function in timed actions get called if the player quits mid timed action?

bronze yoke
#

yeah

hollow current
#

neat

kind galleon
hollow current
#

I have a small problem that's driving me crazy and not sure whether its a problem in the logic which I am not noticing or the overall style of the code

#

Hang on lemme upload code to pastebin so it's more readable

#

So according to the code, it checks if player:getModData().breakIntoTears_lastRoll and player:getModData().breakIntoTears_lastForcedCry are equal to current in-game day

#

... yup i think i just found where the issue is now that I laid down the problem.

bronze yoke
#

could i comment on performance?

hollow current
#

of course

bronze yoke
#

as the code currently is, you could remove the function from onplayerupdate after they finally cry, and have it readded by a check in everydays, and it would behave exactly the same but not run the day checks every frame

#

you could also have a function oncreateplayer that checks for the trait and only adds the event if they have it, so you aren't checking for the trait every frame

hollow current
bronze yoke
#

like they quit the game mid cry? that's a pain

hollow current
#

yupp

bronze yoke
#

oohh i think i misinterpreted your question

#

i have no idea ๐Ÿ˜…

hollow current
#

oh

bronze yoke
#

but basically my thought is instead of this

player:getModData().breakIntoTears_lastRoll = getGameTime():getDay()
```you can use
```lua
Events.OnPlayerUpdate.Remove(nameOfFunction)
```you'll need to use the traditional function constructor and then add it to the event, not
```lua
Events.OnPlayerUpdate.Add(function(player)
```to do this, though (but you should do that for the sake of patchability anyway)
#

then you have a function on EveryDays that just readds it

hollow current
#

hm yea that does sounds more viable performance-wise. Definitely not acceptable to have the code repeat itself each frame if the action was done already

#

I will keep that in mind, thanks!

frank rivet
#

Say I wanted to have access to the ingame models for my mod I am making. Are there accessible fbx files. Or are they call only?

hollow current
#

steamapps\common\ProjectZomboid\media\models_X

kind galleon
#

Is .X extension just a renamed .fbx?

winter bolt
hollow current
#

There are also .fbx files in the subfolders. For the .x, like spongie said, needs converting

winter bolt
#

the character models and most clothing items are pinned in the modelling channel but you can use https://3d-convert.com and convert to ".dae" and they usually work fine in blender

quasi kernel
#

Thoughts?

hollow current
#

Honestly speaking not sure what I am looking at

thorn cipher
#

Swiss Army knife right?

quasi kernel
#

Correct

faint jewel
#

that's actually norwegian.

ruby urchin
#

I'm working on a permadeath mod, someone knows if is there a mod similar to this?

hollow current
#

any idea why I am getting __le not defined for operand at if (currentUnhappyness >= 80 and currentStress < 0.75 and chasingZombs == 0 and visibleZombs == 0 and veryCloseZombs == 0 and attackingZombs == 0) then? Not sure what the error means

bronze yoke
#

either currentUnhappyness or currentStress is null

hollow current
#

hmmm yea actually both are null since I apparently defined them inside an if condition that didn't get executed

#

Thanks!

hollow current
quasi kernel
#

the horror

fast galleon
#

Stuck on textures - icons. Need something that would make more obvious what type of bucket you have in inventory and also radial for conversion.

bronze yoke
#

you also might need to check the event isn't already added, or you could have it doubled (i think removing the event before adding it will work, i don't think it'll error if it's already been removed)

hollow current
fast galleon
bronze yoke
sour island
#

You changed the item type of empty buckets to weapons?

fast galleon
sour island
#

So you have to right click to convert?

#

Besides the item deletion on old saves/or removing the mod- there isn't an issue with changing the type btw

fast galleon
#

but for ease I also thought a radial menu would be useful

sour island
#

I did it for my Vanilla Weapons Expanded mod

fast galleon
#

I am stuck on images

#

Let's say I add a second item, I need to differentiate them somehow.

hollow current
#

Does OnCreatePlayer get called the first time a character is created or every time a character spawns?

ancient grail
#

ongamestart then apply tthe moddata .. read it next time skip the functions

fast galleon
bronze yoke
#

every time a character spawns

#

i have never seen an error like that glytch3r

jagged ingot
#

Hello. Been a mighty minute since I've been on a PC.

ancient grail
#

ah wait i remember.. its not oncreate i think it was something else like even before you choose a server

jagged ingot
#

Might be more active again with helping people in here for TypeScript / some Lua questions. ๐Ÿ™‚

ancient grail
#

yey for sledgehammer ๐Ÿ™‚

hollow current
#

Any idea what both those warnings mean?
Warning that gamesound doesn't exist-- even though it working perfectly fine?
also what does "bugged action, clearing queue" mean, even though the timed action is working perfectly fine?

ancient grail
#

ow its a time action thing,, the bugged action isnt really an error the first one is obviously a missing audio file

#

so its safe

#

the bugged action it hink it cuz u canceled it

bronze yoke
#

bugged action means cancelled or invalid i think

hollow current
#

kinda weird since the bugged action thing only happens when the timed action finishes

hollow current
drifting ore
#

Does anyone know where most of the movable items are? I found punch of them at the scripts/newMoveables, but most are not there

bronze yoke
#

it means there isn't a gamesound, not that the audio file is missing

fast galleon
#

Most of it is defined in map tools.

drifting ore
#

I need their item names for a recipe

fast galleon
hollow current
bronze yoke
#

i don't think so, vanilla has that error sometimes too

drifting ore
#

sprite names act as item names in recipes as well?

fast galleon
#

I use something like "moveables.sprite_01_01"

drifting ore
#

Thank you. I'll give it a try

brazen harness
#

does Paw Low Loot still work?

fast galleon
#

there's a thing that you might spawn an item "module.myitem" but after you pick it up, it will be a "moveables.spritename"

hollow current
#

I am trying to add a Cry to sleep context option that "inherits" all of the Sleep option properties. That means appearing where the Sleep option appears, when the Sleep option appears, and when pressed, executes the same function as going to sleep. Only difference is that I am adding an additional piece of code that lets the player actually cry to sleep and removing some moodles.

Would there be an easy way to do that-- Inheriting all of the properties of the "sleep" option into a new context option?

bronze yoke
#

you could hook addoption

#

if i'm understanding you correctly

hollow current
bronze yoke
#

it's about a million different things and whoever you ask will say different things do and don't count ๐Ÿ˜…

hollow current
#

okkkkaay.. so how do you hook then ๐Ÿ˜‚

ancient grail
#

Maybe that might help

#

Konijima hooked the isgrab corpse

hollow current
#

oooo that's hooking. Done it before, but I don't get how'd that work on adding a new context option

bronze yoke
#
local old_addOption = ISContextMenu.addOption

function ISContextMenu:addOption(name, ...)
    local option = old_addOption(self, name, ...)
    if name == 'Sleep' then
        -- whatever
    end
    return option
end
#

you can add another option, hijack that call, whatever you want

ancient grail
#

You hijack the original contest menu

bronze yoke
#

if this isn't applicable then i don't know what you mean by 'inherit'

ancient grail
#

We wre thinking of the same thing but she just coded the thing while i search reference lol. Albions wizzard

hollow current
#

Doesn't that edit the original option?

ancient grail
#

It does in a clean way cuz u stored the original one . It can still. Be used afaik

#

And your intention isnt really going to cause serious mod conflicts i think cuz ur just adding sound right?

bronze yoke
#

you can choose not to override it and just run your own code next to it

hollow current
ancient grail
#

Ahhh but it would be better if the sleep is the same . Doesnt show cry to sleep
But would cry when depressed

hollow current
#

I thought about having it automatically come into effect when you're too depressed and go to sleep

ancient grail
#

like your function only hijacks the vanilla one conditionally

#

Just an idea

hollow current
#

but not optimal since it'd conflict with other mods. Sleep on it, for example. That's why I am giving the player the option to choose to cry to sleep in the first place

ancient grail
#

Oh i never played with sleep on so i really dont know

hollow current
#

hmm I will think of something. Thanks either ways for you both!

bronze yoke
#

you can even just not hijack it

ancient grail
#

There are mods that tampered with sleep already? Then i gues that would be like part of the description saying conflicts with ___ mod

hollow current
#

I prefer to have it compatible with other mods if I can help it

hollow current
bronze yoke
#

you can just use that code to trigger your own code

#

you don't have to override vanilla at all

hollow current
#

hmm i guess that's a possibility

bronze yoke
#

i don't know what else inheriting an option might refer to

finite owl
#

The other thing to note with overriding methods by keeping a ref to the original and replacing with your own is that you want to make it work when you use F11 to reload the script. So you might want to only assign the var to the original function if it's currently unassigned, so you don't end up replacing it with a long chain of function closures with all your bugs baked into it.

hollow current
#

If I'd reword it to being more clear, I meant simply copying a context option into a whole new one and adding to it

#

I guess that was answered already (If I am understanding correctly)

bronze yoke
#

i guess your code could run the vanilla function twice, edit one, and return the unedited one

hollow current
#

I'll try to think first of a way to make it work without having to utilize context options in the first place. Easier that way. Gonna have to put it off as a last resort considering how problematic it may be

ancient grail
#

Is there a sound produced when sleeping ? Like flre example snoring? If u overwrite just the sfx
That wont cause any bugs 100%

hollow current
#

i doubt there are any sounds played when sleeping except the meta events/zombies

#

I may end up having the code automatically trigger when sleeping

#

and just simply adding a check if player has any mods that may cause conflicts

#

so it goes like

if NOT has mod that may cause conflict then
  if player:isAsleep() then
    --code
  end
end```
ancient grail
#

Hmmm... Ok probably the last idea i can think of. I think theres a way tk create your own even

If you could then just have a listener that wait for the isAsleep
Or is kt called isSleep? But yeah

Then if it know the player is asleep and ks depressed then play crytosleep.ogg

hollow current
#

the sound may not be even a priority/needed tbh now that i think about it

ancient grail
#

Speaking of sleep m hesding to bed now good luck arendameth dont forget to sleep lol

bronze yoke
#

what would the conflict be, anyway?

hollow current
#

Sleep On It, for example, already removes unhappyness from the player when he goes to sleep. Having my mod remove it automatically as well doubles the effect, making it overpowered

#

i guess the best way is to just check if such mods I may be aware of exist, if not, execute the code normally. If they do, ignore the code and prioritrise the other mods

sour island
trail lotus
#

Possible to create voice links in game? Like a phone call between two players?

#

I know I know (walkie talkies) but I want something a little more advanced.

vast veldt
#

In a similar manner of thinking to the discussion of context options - is there an event I can hook into to know when the player selects an option (any option, of any kind) from a context menu. i.e. "Rip Sheets" or "Smoke"?

sour island
#

There's Lua functions for adding context options

#

I vaguely recall it being an event ๐Ÿค”

vast veldt
#

Seems there's a few around when rendering the context options, just nothing I could see that was for when one was selected.

sour island
#

You can add options after they're "filled"

#

This is what I remember it from

bitter widget
#

has anyone here ever used typescript instead of lua ? I'm looking for some examples ๐Ÿ™

dark arch
#

Does anyone remember where the vanilla items lua is again? I appear to have forgotten where it was

undone crag
#

What is vanilla items lua?

dark arch
#

where all the item info is stored right?

undone crag
#

Oh wow yeah (I wanted to type something about forgetting but what I thought of seemed rude) it's not in a lua file it's in \scripts.

dark arch
#

woops!

#

thats why i couldn't find it lol

finite owl
astral dune
#

there is some other project that allows it, ya

finite owl
#

Hmm, interesting.

#

Thanks!

robust briar
#

Does anyone use the built in attachment editor? Is it this buggy for everyone?

bronze yoke
#

i don't, but from what i hear, yes

robust briar
#

Okay, was just making sure I didn't miss something... the "rotate" on the model attachment points has me so confused. For some reason I just CAN NOT wrap my head around it. I keep holding my hand out in front of my and spinning it around like "okay okay... twist is x, flip is y. I need Z wtf"

#

Then I save and reload and the model is half way inside my body ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

faint jewel
#

anyone have a script handy for adding an option to a tile when you right click it?

dark arch
#

ISWorldObjectContextMenu

#

in ProjectZomboid\media\lua\client\ISUI

#

i think

finite owl
#

Is there a channel where updates to mods can be announced? The new version of RV Interior has been released, and I thought I'd spruik it on the Discord if there's an appropriate channel.

robust briar
#

"Enter the interior using the vehicle radial menu (instead of changing seats)." THANK YOU

finite owl
#

The hotkey is even more convenient ๐Ÿ™‚

#

(But radial menu works for split-screen controller users, who can't use hotkeys)

dark arch
trail lotus
#

anyone working on a super immersive building mod? i will buy the time you use in making it work. looking for super immersive building. between placing new roads, laying down concrete, building houses from start to finish. let me know if you're interested

#

i'd like to make it possible to 100% build a normal house in pz from scratch. i know theres mods that do this, "more builds" but i want to actually have the crafting recipes made if certain things require glass, and some things require a higherskill because they have more detail. and so fourth lmk if you are interested i think it would be a cool mod, for all pz players. but i'd love to pay for you to do it if needed. i know it would be a big mod

ancient grail
dark arch
#

anyone remember where the lua event files are? i forgot to write that down and can't find them anymore

bronze yoke
#

what do you mean?

dark arch
#

like where the list of events is stored in code

bronze yoke
#

there's no one place, i think the from java events are probably in luamanager but the from lua defined events are all over the place

finite owl
#

Do you mean the list of all event hooks being created? That's in LuaEventManager.java, function AddEvents()

dark arch
bronze yoke
#

there's a bunch of events that are created from lua though, and they're just in whatever the relevant file is

quasi kernel
#

Can weapon models use .fbx instead of .x?

bronze yoke
#

these ones in particular

hot patrol
finite owl
#

It looks like it shouldn't be too bad actually. The Bow & Arrow mod kindly stores much of its code and data in a global MandelaBowAndArrow table, so you can drill down and get at e.g. MandelaBowAndArrow.Client.attackHook, the function that it runs when the player fires the bow.

#

I actually made a start on doing the overrides needed to make drawing behave like Alternate Drawing, and was having some success, but didn't get too far before I had to deal with some other stuff.

#

Like, RV Interior has been released, and the legacy version of the SP mod is breaking players' saves by deleting their walls ๐Ÿ˜ฆ

ancient grail
#

What the?! My discord msg never got sent

An org called sledgehammer
They built pipewrench
A proj that allows modders to use templates typescript for pz

finite owl
#

I don't know the first thing about the mapping/tile side of PZ, but the walls of RV Interior were custom tiles, and they've somehow been omitted from the last release

#

Unfortunately Maxwelt is asleep, and he's the one who knows that side of things.

hot patrol
#

and this is just SP you say? Cuz I have that on my MP server with frinds and was just playing in my RV

#

granted it was actually the buss

finite owl
#

Yup, just SP.

hot patrol
finite owl
#

We left in the SP legacy version so people could upgrade in their own time... but it apparently got mangled between being deleted in Git, then recreated but in a different directory.

finite owl
#

But, yeah, add-on version of Alternate Draw for the current bow & arrow mod looks totally doable to me.

hot patrol
#

speaking of the RV. I was trying to change the floor of my bus to wood flooring but it wouldn't let me. Will this ever be possible?

hot patrol
#

I'll be happy to be able to use it again. I had reached out to the original creator as well but got no response

finite owl
#

Not sure about the floor tiles.

dark arch
hot patrol
#

yea giant rv interiors would be a problem lol. being able to change up the floor and wall textures would be a cool feature tho.

#

makes me think of those tiny home videos you can find on YT of people tearing apart buses and vans and making them into living spaces

finite owl
#

So the legacy version of RV Interior is missing these lines from the mod.info:

pack=rvinterior
tiledef=rvinterior 446
#

Would that explain why custom tiles have vanished from people's maps?

bronze yoke
#

yeah

finite owl
#

If they didn't have a backup of their save, are we screwed?

bronze yoke
#

i don't really know for sure, but probably

finite owl
#

Ok, cool, cool. ๐Ÿคฆโ€โ™‚๏ธ

#

Didn't test the legacy mod before releasing, just the shiny new version...

dark arch
#

so say i wanted to get an item's tags would i go item.getTags()?

bronze yoke
#

item:getTags(), not item.getTags() (usually)

dark arch
#

that works great thanks, but umm isnt the item a java object rather than lua? isnt the colon syntax only for lua?

bronze yoke
#

unless you're making a java mod, you need to use colons when interacting with java objects (usually)

finite owl
#

They're Lua wrappers of Java objects.

dark arch
#

im putting that on the list! thanks

astral dune
#

if its a method that is accessing that particular object, you almost always use a colon, java or lua

#

if its a "static" method, then you use the dot

#

obv if its just a table then you use the dot as well

quasi kernel
#

How do you link up a model to a weapon..?

#

I have an .fbx file I got, a texture, everything.

#
module Base
{
    model SwedishKnife
    {
        mesh = Weapons/1Handed/SwissArmyKnife,
        texture = Wepaons/1Handed/SwissArmyKnife_Texture,

        attachment world
        {
            offset = 0.0000 0.0900 -0.0100,
            rotate = 180.0000 0.0000 180.0000,
        }
    }
}
#

aaand I mispelled weapons

#

Well I fixed that and I'm still lost

finite owl
#

Slightly urgent query: Maxwelt added me as a "contributor" on the RV Interior workshop item. I can edit the description etc. Am I able to publish a new version, does anyone know?

bronze yoke
#

no

finite owl
#

Ok, makes sense.

#

I might put something big in the description, but since Workshop items just silently update in the background it will be too late for most people by the time they come looking for an explanation.

oblique trench
#

does anyone know if it's possible to make a mod for a customizable bite zombification infection chance? ideally i'd like to make one where I could set it so getting bit has... i don't know, like a 70% chance of zombifying the character, and a 100% chance to get the symptoms of zombification whether they're truly zombifying or not. antibodies and cure mods aren't for me or my friends, but having a reason to try and save our characters while still faced with the risk of turning would increase our enjoyment factor a ton

robust briar
#

omg. so after bashing my skull against the wall for about a 43200 seconds, I got the attach points looking right. NOOO thanks to Zomboid's Attachment Points built in dev tool for it.

#

Just needed to share after that slog

quasi kernel
#

You seem knowledgeable there

robust briar
#

pfft nope

quasi kernel
#

agony

robust briar
#

I just copy-paste and prayed

quasi kernel
#

Was worth a shot!1

bronze yoke
oblique trench
#

[x

robust briar
bronze yoke
#

good luck!

#

i wouldn't mind a mix of that and antibodies honestly...

#

or like generally, 'antibodies but there's a chance you're just fucked'

#

although i've never been able to get antibodies balanced how i'd like it either

bronze yoke
quasi kernel
oblique trench
robust briar
#

Events.OnPlayerGetDamage.Add(yourFunction)

#

Wait, that event isn't there

#

It's defined in Java though

oblique trench
#

jeeze coding is scary, i'm on FWolfe's zomboid modding guide on github and i'm struggling to comprehend anything i'm seeing

robust briar
#

It really can be at first. But once you try, and fail, and try, and fail, and THEN it works. No better feeling imo

oblique trench
#

out of curiosity, a mod with really limited scope like i outlined above, how long would it take someone experienced to make it?

#

because if it's like "someone experienced could do it in 20 minutes" then i feel a bit of confidence in its simplicity, and could try powering through

oblique trench
#

not a thing ^ ^

drifting ore
#

Well the game is based on the lua program language

#

Learn the characters first

#

Do some algoritm exercises

bronze yoke
#

i think i could do it in twenty minutes, but my guess is something would go wrong and i'd end up actually working on it all day

#

that's typically how it goes

drifting ore
#

Ik

bronze yoke
#

the onplayergetdamage event is pretty weird, i'm not sure how perfect it is for this usecase

robust briar
oblique trench
#

thank you for the realistic estimates, so for someone with no experience with coding at all, this is at minimum a full day kind of thing, right?

robust briar
#

But lets be honest, we always over-estimate our abilities, and under-estimate the task at hand

dark arch
robust briar
#

Like I could spend a whole day on it and not be happy lol

bronze yoke
#

the event is too recent to be mentioned on that wiki, but i made some notes on it here

#

i can't promise they're perfectly accurate, i'd like to go over it again sometime soon (and maybe compile an overall event guide, as the one on the wiki is slightly outdated and occasionally too vague to be useful)

#

i misremembered there being specific damage types for specific injuries, so this may be more annoying than i initially thought

tardy wren
ancient grail
#

anyone know wtf this means

    self.character:setMetabolicTarget(Metabolics.HeavyDomestic);
ancient grail
fast galleon
#

Seems like it changes the Thermoregulator in BodyDamage, never looked what that is, but it includes Nutrition too.

ancient grail
#

ill just omit it from my code.. im reverse engineering the
ISRefuelFromGasPump
and
ISVehiclePartMenu

basically to do the reverse

finite owl
#

What determines if an item shows a condition bar when you hover over it in the UI? Is it just whether the item has a defined ConditionMax?

fast galleon
finite owl
#

Thank you!

deft falcon
#

is there a way to tell whether or not the food you ate was stale or not

#

preferably also how much hunger it reduced

fast galleon
#

https://github.com/radx5Blue/ImmersiveSolarArrays/blob/main/Contents/mods/ImmersiveSolarArrays/media/lua/client/SolarUI/ISAUI.lua
Here there's an example of custom tooltip, but you need to patch the metatable.

Otherwise you can hook to lua and draw more things, examples to this are show food freshness and have I found this book.

GitHub

ImmersiveSolarArrays for Project Zomboid. Contribute to radx5Blue/ImmersiveSolarArrays development by creating an account on GitHub.

#

@finite owl

finite owl
#

Thanks! I'm trying to work out why an item with a reduced condition (a bowstring) shows up with a condition bar in the Bow and Arrow Alternate Drawing mod, but not when it has a reduced condition in the Bow and Arrow mod.

fast galleon
#

ah, check how they call the DoTooltip, if it's vanilla and what item they use.

#

I might have misunderstood something again, is alternate drawing for UI drawing, or... ?

finite owl
#

They seem to override ISToolTipInv:render in one case and ISToolTipInv:prerender in the other, storing the original function and doing a bunch of stuff. Wow, is that really the best way for mods to customise the tooltips on their custom items?

fast galleon
#

yeah, when java is involved...
or UI...

finite owl
#

Its... not great. Oh well, at least I can see why the tooltip might be different between them now, when the item definition of the bowstring itself was pretty much identical.

#

Thanks for your help!

ancient grail
#

i wonder what rotator lib does to the debug

#

loooks very useful

#

but idk what its for

#

i think its sorta the same as what chuck did only it was print,. rotators lib is more on debugger?

faint jewel
#
--- for the job board

local function setupJobBoard(player, context, worldObjects, test)
    for i,v in ipairs(worldObjects) do
        if v:getSprite() ~= nil and (v:getSprite():getName() == 'trashcontainers_01_18' or v:getSprite():getName() == 'trashcontainers_01_19') then
            context:addOption('Check Job Board', player, openboard, params)
            break;
        end
    end
end

local function openboard()
    getPlayer():Say("open menu");
    JobsUI:open();
end



-- ------------------------------------------------
-- Game hooks
-- ------------------------------------------------
Events.OnFillWorldObjectContextMenu.Add(setupJobBoard);
``` anyone know why it;s not calling my openboard function?
kind galleon
#

don't think lua hoists

#

not an expert in lua though, but that's what stands out , maybe put openboard above setupJobBoard

hot patrol
faint jewel
#

hmmm ok

#

@kind galleon you are a damned genius. thank you sir.

thick karma
#

Any reliable way to grab the last index of body parts? I am aware I can loop from 0 to 16 to hit them all

#

(I just don't like hardcoding)

bronze yoke
#

BodyPartType.MAX

thick karma
#

When I do that it returns MAX

#

Which... doesn't make any sense to me

#

print(BodyPartType.MAX) => "MAX"

#

wtf does that even mean and is it useful?

bronze yoke
#

hmm i seem to remember doing something like that

#

if that doesn't work then you could just loop until you get nil

thick karma
#

Hmmm not a bad idea

#

May do it that way

bronze yoke
#

oh maybe i looped from 0 to BodyPartType.ToIndex(BodyPartType.MAX)

#

yep, that's what i did

#

or well actually i used that to just get the number of parts but you can use it for that

thick karma
#

This is no good print(getPlayer():getBodyDamage():getBodyPart(BodyPartType.FromIndex(17)))

#

But thanks so much!

bronze yoke
#

probably - as i said i didn't actually use it in a loop, i just used it as a bodypart count

thick karma
#

print(BodyPartType.ToIndex(BodyPartType.MAX)) => 17... perfect

prime viper
#

can someone explain an error that im getting while using a mod?

bronze yoke
#

what's the error?

prime viper
bronze yoke
#

your sandbox settings for crawlers, shamblers, fast shamblers and sprinters don't add up to 100

prime viper
#

i see thanks

thick karma
#

Hmmm so I am looking through Lua for any example of pain-setting and coming up with zilch.... is pain handled entirely Javaside? All I seem to be able to do is check my pain levels, not change them... tried setPainReduction, setStandardPainReductionWhenWellโ€‹, setPainReductionFromMeds, setPain itself (in Stats) . . . Nothing seems to change the pain level in my hand...

bronze yoke
#

i wouldn't be surprised if it was set by the java every frame, a lot of health stuff is

#

a CalculateStats hook might work, not sure if health goes through there or not

#

it does not :(

thick karma
#

Mmmmm makes sense. Weeeeell fair enough then.

frank rivet
#

Does anyone have a tool they use to open ".pack" files? I'm trying open the game files to find some information regarding textures for the world items.

thick karma
#

Hmm so if I use setPain it actually seems to very briefly reduce pain, but it rapidly returns to the value determined by my wounds. @bronze yoke

bronze yoke
frank rivet
robust briar
faint jewel
#

you should make it so you can set lights in a sequence so you can do GAMER RGB RAINBOW LIGHTING.

#

also, would you like a custom Holding controller animation?

#

@robust briar

ancient grail
bronze yoke
#

it's not a lua table

vast nacelle
# thick karma Hmmm so I am looking through Lua for any example of pain-setting and coming up w...

setAdditionalPain is what you use to add new pain. Normal Pain is determined by other factors while AdditionalPain is added on top of that. Directly setting Pain will fail because the game will just recalculate the Pain again.

For example to add a headache:
getPlayer():getBodyDamage():getBodyPart(BodyPartType.Head):setAdditionalPain(20.0)

Though if your goal is reducing Pain, then yeah. That is Java side as its a deterministic value. You'd have to alter how its calculated.

robust briar
faint jewel
#

get me a picture of how you would like them holding them (imagine they have one in each hand) and i'll set ya up.

#

if you can only find one arm that's fine, i'll just mirror it to the other side.

willow estuary
#

For the record, so modders know in advance, we have hardcoded out negative item weights for build 42 in our internal development branch.
It has proven to be problematic and generate bug reports, including sending vehicles into space, to a point where we need to remove that feature.

#

The game was never designed for negative item weights, and it breaks multiple features of the game.

jagged ingot
#

Surprised that's a thing you can do in the first place.

#

Figured those would be clamped values at runtime.

astral dune
#

what has a negative item weight? A balloon?

willow estuary
#

RIP vanilla helium balloons.

#

There's a bunch of mods that use negative weight items as cheat/"magic" items.

astral dune
#

interesting

willow estuary
#

There's a lot of stuff mod wise intended for super looting/hoarding that generates bug reports ๐Ÿ˜„

#

Used to be trunk space mods before the save optimization was implemented.
Was a daily issue where people using trunk space mods reported their vehicle/vehicle contents evaporating.

astral dune
#

so you can't change the size of a trunk anymore? thats a bummer

bronze yoke
#

i think they just mean you can't do that via negative weight anymore

jagged ingot
#

Mmm wish that nametag text rendering above players was customizable.

jagged ingot
#

So many things that could be done with having a string property with a force boolean flag for names... like Twitch audience usernames for streaming.

robust briar
#

And... if I get in a vehicle, and it glitches to space, does that make me an astronaut?

robust briar
#

If can determine exactly how the space launch glitch works, maybe we could turn cars into missiles ๐Ÿ˜‚๐Ÿ˜‚

jagged ingot
#

I'd rather get the ability to drive my car through the mall's 2nd story first.

robust briar
#

You know what they say, never let a good bug go to waste. Utilize it!

bronze yoke
#

my guess is that it's related to vehicle physics weight including the weight of items in containers

jagged ingot
#

I thought that the MP car glitches were the funniest.

astral dune
#

yes, setting cars to weigh nothing has fun effects

uneven nimbus
#

Hello! Newbie here, can anyone help me solve this bug with the chunks. I'm currently trying to run a multiplayer server with map mods in it and I keep getting this bug. Can anyone help me solve how to properly fix this.

astral dune
#

You could look at this metazonehandler.lua at the lines mentioned and see if you can figure out what its doing. May lead you somewhere. Could even potentially patch it to handle null values properly so it doesn't error out

drifting ore
#

it's just seeming to show lines to messages with how it prints the errors lol

humble oriole
#

has anyone come across the code that converts the items in the composter to fertilizer? I can only see player interactions with it. Looking at making a mod that has a similar function. I'm not sure how to program the event(s) with little server impact on how to change the amount of x item to y item over time with/without a player in the area.

bronze yoke
#

it could be java if you can't find it

#

the way wgb handles simulating things when players aren't around is to just store the last time it was simulated and when it's loaded, simulate the entire time period until now

fast galleon
#

oh boy, no time to make and enjoy a wizard of Oz mod with negative weight houses ๐Ÿ˜ฆ

bronze yoke
#

or you could use global objects actually... that'd be easier

humble oriole
humble oriole
bronze yoke
#

come to think of it, that *is* what global objects do ๐Ÿ˜…

fast galleon
#

I bet those items are removed when a player comes close

humble oriole
#

yea, that's more or less what this is doing

humble oriole
bronze yoke
#

rainbarrels are the first thing that comes to mind

#

the mod i mentioned doesn't use global objects, or simulate anything at all when players are actually nearby, so i don't think it meets your usecase