#mod_development

1 messages · Page 505 of 1

signal beacon
#

I've been looking around trying to find where the attack speed for firearms is defined, but I'm really not sure where it is. Is it tied to the AssaultRifleX animations? And their blend times? Or is there a variable defining the speed of these somwhere? I found a variable called autoShootSpeed in AssaultRifleDefault.xml but I can't find this defined anywhere in the lua

tribal stream
#

Is there any way to export a list of workshop IDs for active mods. Trying to setup a server and I dont want to manually have to add all them

#

through the in-game editor

gilded hawk
#

I have been looking into the sauce of zomboid, what is this?

in D:\Games\steamapps\common\ProjectZomboid\media\lua\shared\NPCs\MainCreationMethods.lua

    ObservationFactory.addObservation("Tough", "Tough", "He looks like he can handle $himselfherself$ in a fight.");

What Observations are?

olive rose
#

is helicopter expanded good for first time players multiplayer?

#

i have the helicopter event set for sometimes vs once for the thrill

undone crag
#

Hello I have been trying to see what actually calls the render function on UI elements and other things but I don't see it.

undone crag
hexed iris
#

Hey guys, Im new to PZ and I thought it might be fun to try some modding.
What is the best resource to learn PZ modding? Is it Zomboid-Modding-Guide on GitHub or are there other good resources?
And what types of mods are easy for first timer?
Thanks in advance

undone crag
#

Making new items: Easy enough, can see how mods do it.
Making icons: Something that saves images with transparency.
Making models: Maybe blender. It can be .X or .FBX.
Having items automatically appear in the game: Uses Lua, can copy a mod that does this, you may make a mistake and break things if you do it wrong.

olive rose
#

Also hey
Authentic Z, it has two mod ids..with spaces, doesnt seem right... can anyone confirm?

undone crag
#

You can use Notepad++ with the Lua plugin, or if you want software that tells you your mistakes you could install the huge gigabytes of microsoft visual studio, or Intellj or whatever it's called maybe that does it too.

#

You could look at code that creates UI windows to see what it does like ISAlarmClockDialog to give just one example.

#

That's pretty dank

undone crag
gilded hawk
#

So, apparently professions framework is not working with clothing 👀

undone crag
#

Aha I just had an idea how to find out what calls render on UI elements. I add some buggy code and look at the error message in the console ohhh yeahhh boiiiii

olive rose
#

Hey, for the used car mod... do I put al the mod ids in the server list? or just FRUsedCars

sour island
#

Idk if this was answered already but you have to run a 'clientCommand' to the server

olive rose
#

like, what is FRUsedCarsFT?

sour island
#

if you're just creating zombies/cars/items its most likely being run through one of the connected clients not actually the "server"

#

a clientCommand ran through the server (with out a specific player given) will mirror the command to all connected clients

gilded hawk
sour island
#

what was happening to me was it would actually spawn the zombies but the server would identify them as "stale" and instantly delete them

gilded hawk
#

What I don't understand is if any of the Steam Workshop version is really updated at the same version of the github version

quasi geode
gilded hawk
hexed iris
#

Modding in PZ uses only lua or java too?
And if so what are the different applications for these 2?

gilded hawk
#

Also, unrelated question, how can I unpack the mods downloaded from the workshop so I can look at the code?
Nevermind they are unpacked into steamapps\workshop\content\108600

quasi geode
#

if you use the github then its going to be more of a pain to publish your mod until the workshop version catches up, since you'd have to actually package the github version with your mod to use its features instead of just adding it as a requirement, which is going to cause incompatibilities and other headache issues. its also potentially unstable atm, theres some features added i havent had time to fully test

#

and no unpacking needed? just browse to the steam folders and look at the code 🤨

gilded hawk
gilded hawk
#

Also, impressive comments in 2ProfessionFramework.lua that was useful to look at

quasi geode
#

ah well, frameworks are only as good as their documentation XD

gilded hawk
#

By removing it I can clone it

quasi geode
#

add NightVision2, its the profession version (see 3ProfessionTraits.lua)

gilded hawk
#

oh, damn, thanks man. Interesting bug tho think360

quasi geode
#

not so much a bug. pz tracks profession versions of traits differently. for ones that are selectable and exist for professions theres 2 versions (this is vanilla behavior)

gilded hawk
#

I'm wondering why Graceful2, NightVision2 and not GracefulPro, NightVisionPro?
Is it to keep consistency with how they are defined in the pz source?

#

Oh well you answered while I was writing the question lol

#

Thanks man

quasi geode
#

ya its consistancy

gilded hawk
#

Works perfect 👍

hexed terrace
#

man the log does not help with seeing what is making errors from mod

fleet smelt
#

Is there a way to pull, say player 6's xyz?

undone crag
sacred cradle
#

ohh wow its Fenris_wolf the mod god

thick bobcat
#

Or do you know any other resources i could User asidenfrom the java doc

#

*use aside from

#

Dont really know where to start learning especially for mp

cyan halo
#

this does not seem to contain the inventory data, I also checked player.db files in my server directory. but nothing shows the data is stored there

#

Actually opening the player.db raw I can see the data. I guess the tables haven't been setup for all data

sour island
sour island
# thick bobcat no answers yet Yeah it does only work clientside Any more Insight on that? So i...

inside the /server folder

--require the shared file name with out the path or .lua
require "SHARED FILE NAME"
--if isClient() then sendClientCommand(player, module, command, args) end -- to server
--_dataA = player, _dataB = args
local function onCommand(_module, _command, _player, _data)
    --serverside
    if _module == "MODULE" then
        if _command == "COMMAND" then
            FUNCTION(_data.PARAM1, _data.PARAM2, _data.PARAM3)
        end
    end
end
Events.OnClientCommand.Add(onCommand)--/client/ to server
#

it looks more complicated than it is

#

I can clean it up a bit

#

I keep the param names all the same because otherwise it's confusing - but it only cares about the order - so I've used it to transfer strings or tables

#

the function in shared uses isClient() to flip the function for both sides - if you're a connected client it sends the command - which then gets relayed to the "server" which then sends it to the clients as a client-side FUNCTION call

#

also means FUNCTION works in single player too

#

as it fails the client check anyway

#

I hope I'm getting the explanation right

#

but it works as intended

flint bolt
#

Is it possible to require "math" or somehow use math. on Lua for a mod?

sour island
#

math is already included

#

random is locked out

flint bolt
#

I'm trying to generate a random number with my own seed

sour island
#

:p

#

ZombRand() is made in math.random's place

#

(I don't actually know why)

#

Doesn't work the same way if I recall

flint bolt
#

Crying right now

cyan halo
#

all player data is stored in players.db, I can see 2 tables using sqllite3 which are of no use. But opening the players.db as raw format I see all the stats, inventory data and what not is there.

Is there a way to modify this data? I can't seem to find a table for this data

sour island
#

So this is how math.random counts

#

zombRand does -1 to the max

flint bolt
# cyan halo all player data is stored in players.db, I can see 2 tables using sqllite3 which...

All player data is indeed stored inside players.db, but as bytes. In fact, the IsoPlayer instance is saved there. You have to know how to deserialize this data to get what you want, you can get hints on how to do that by looking at the .load method inside the IsoPlayer class IIRC. Since this is a lengthy thing to do, its easier to make each client send its data in a better format to the server via a clientCommand and then store it in a file inside the server (that's what I did on my mod ServerPlayersData).

#

Also, characters that die will be deleted from the players.db

sour island
#

This is expected results for ZombRand()

flint bolt
#

@sour island do you know if there is a function to generate a random number with a given seed? :p

sour island
#

Uh

flint bolt
#

If random wasn't locked out, math.randomseed(seed) would work..

sour island
#

Let me check what ZombRand does internally

#

perhaps it can take a seed

flint bolt
sour island
#

that's odd I can't find where ZombRand is defined

flint bolt
#

inside LuaManager, but its just a call to Rand.Next

sour island
#

yep just thought about it

#

ah

#

have you tried calling on Java's math directly?

flint bolt
#

Nope!

sour island
#

should be Math.random()

#

not sure if it will work lol

cyan halo
sour island
#

There's a reason the devs said don't just let anyone on your servers for a while

cyan halo
#

Yeah I understand that

#

I thought it was the case

flint bolt
sour island
#

that could be neat

cyan halo
#

I guess everyone is playing in good faith then

sour island
#

I wonder if multiple servers could be used for larger maps that hotswap players

#

than again the mapsize may not matter as MP stuff is supposedly mostly client side?

cyan halo
#

Like each server handles different parts of the map?

sour island
#

more or less

cyan halo
#

I think that could get confusing when crossing borders

sour island
#

wouldn't be for normal pz play

#

maybe some sort of server to server gimmick

cyan halo
#

Yeah the servers would need to know what cell they handle and the neighbouring servers

#

But I think it gets tricky when a player is in cell x and shoots a zombie that is in cell y

sour island
#

the map is chunk loaded

#

also server to server wouldn't be for smooth gameplay

#

but for weird gimmicks probably not zomboid related

#

another game called SS13 is set on a space station, and floating off the map has a chance to transfer you to one of their other servers entirely

#

so the station you orbit back to might be one that is different entirely

cyan halo
#

yeah it would be slow unless the servers were like very very close together or running on same machine

sour island
#

PZ is probably not the game to have this anyway

cyan halo
#

maybe a java modder in future could pull it off, but it would be very challenging

#

then it would be a true mmorpg

cyan halo
flint bolt
sour island
#

What are you trying to change?

#

Revive a dead player?

cyan halo
#

Just any aspect about the player really

#

Inventory items, health etc

#

I see the data in there

#

but no tables for it

quasi jewel
#

how does one get titanium

weary matrix
#

@formal stone shouldn't be too hard

urban hemlock
#

modders.. anyone doing some electric heater for heating up base?

undone crag
flint bolt
#

@sour island Looks like I would need the Random class to set a custom seed 😦

#

Math has only the random()

old blade
#

i wish there was some Metal Gear mods aside from the alert sound n stuff

sour island
#

I wonder why math.random is locked out anyway

old blade
#

like an old sneaking suit or something thats super rare military loot

#

gives u +1 nimble +1 lightfooted

#

i could help texture it n stuff

fleet smelt
#

if so, then it's probably a way to keep down resource usage

sour island
#

I mean that's not really something for them to decide

#
  • doesn't stop someone from making a resource drain if they really wanted to
#

is math random still locked out? I haven't actually tested it for a while

tranquil reef
#

I'm trying to make a special infected mod but I need to have some zombies wear specific things, I was looking at things and it seems like dressInPersistentOutfit might work, but I'm not exactly sure how to use it

#

does anyone know of a good way to do this?

#

either that or this "dressInClothingItem"

#

also please ping me if anyone answers lol

drifting ore
#

its not that much work to make a simple seed based number gen though if you really need it for a mod

gilded hawk
#

How do I hook to the AddPlayer event?

long grove
#

I downloaded the Java Decompiler but when I try to open any .class files nothing happens. Help?

gilded hawk
dreamy flicker
#

any ideas how to probe the dedicated server for date, time and weather? I want to display that info on a webpage

hidden holly
#

hey all, is there a mechanism for replicating some arbitrary data from server to client? I have a server-managed value (a score) and want to periodically send it to clients but I'm not able to get that working with sendServerCommand (also tried calling sendClientCommand on server)

tacit ermine
dreamy flicker
tacit ermine
long grove
#

I downloaded the Java Decompiler but when I try to open any .class files nothing happens. Help?

dreamy flicker
#

also, do you have a public endpoint I can hit to see the data in action?

tacit ermine
#

They come from the game as strings so don't have an exhaustive list, but normal, sunny, cloud, rain are the ones I've seen in seasonProps. I usually do but my server's offline for a couple hours to do a bit of patching and testing, I can ping you when it's back up

tacit ermine
#

yep, that's the one

dreamy flicker
#

@tacit ermine so if I just run this docker container... it should work?

tacit ermine
#

oh yeah if you have Docker you can just run the container and check it out

frail violet
#

Does anyone possibly know what could be causing this error? It happens after death, when I click on "New Character".

tacit ermine
#

I wouldn't run that specific container in production though, it's a bit specific to my setup and has some issues I need to fix

slow graniteBOT
#
Hahawing999#4965 has been banned

Reason: Unspecified

[unban]

dreamy flicker
pale aurora
#

any mod support you guys know of for custom radio messages?

#

I want to integrate scary events before wipe time, and want to warn them through my radio system

tacit ermine
#

sure, feel free, it should be under MIT/Apache 2.0 but I might have forgotten to add license files

dreamy flicker
#

@tacit ermine so I understand the kotlin code just fine, but what is the java code doing in the com.github.garyttierney.zomboid.server namespace?

#

looks like it's all stat stuff? is that for the promethus stuff I saw in the k8s config?

tacit ermine
#

that's the code that installs the bytecode patches with bytebuddy (raises the max player limit, starts the HTTP server on GameServer startup, shuts it down when finished)

#

and oh yeah it registers an MBean for prometheus

dreamy flicker
#

intresting, I assume the promethus stuff isn't needed for what I'm wanting to do though, do you agree? How useful do you find the instrumentation?

tacit ermine
#

yeah, I agree, my server is setup for almost the sole purpose of gathering stats so that's why I have it

#

my data gets dumped into grafana so I can figure out where I make improvements in hosting

dreamy flicker
#

512 players is alot my guy 😆

tacit ermine
#

yeah that's the engine limit

#

I just raised it to match that, it'll still accept whatever you put in the ini

#

except it won't reject it if it's >32

dreamy flicker
#

is that a RakNet limitation?

tacit ermine
#

nope, zomboid

#

the array of active connections only has 512 elements

dreamy flicker
#

gotcha

#

so I'm looking for the code that starts the :8080 http server

#

is that all in the MBeanServer? The one that also has the /info endpoint?

gilded hawk
#

Which is the name ID for a fully loaded 9mm magazine? if there is any

dreamy flicker
#

ah, and line 16, thanks I missed that. I was staring at this file for longer than I'm willing to admit

#

this is amazing @tacit ermine thank you very much

tacit ermine
#

o7

#

realistically you don't even need to patch GameServer, you can just start the HTTP server in premain and let shutdown hooks deal with stopping it

dreamy flicker
#

the tech support channel said to parse the server output for "WeatherPeriod", which honestly is probably easier and faster to do. But this... this is what I'm going to do.

tacit ermine
#

it might take a tiny bit longer to shutdown

tacit ermine
#

when it loads it patches GameServer so it runs my code before it runs the real zomboid code

#

but I only did bytecode patches because I was also changing things like the player limit

#

you could just as well do the server.start() within here

dreamy flicker
#

I understand

#

trying to figure out how I can fork this without starting a whole new repo. I like the docker and prometheus stuff you've got going on, but honestly I'm just not there yet

#

so I want to strip that stuff out and just work with the http server for nwo

minor onyx
#

Anyone know if the supurb surviver mod is playable?

tacit ermine
lapis stump
dreamy flicker
tacit ermine
#

the MBean doesn't do anything by itself and it's just a native Java thing, it's that separate agent (not my own one) I add to the VM args that does the work

#

so there's no harm in leaving it in, also no harm in just deleting the referencing code

#

nothing will break

#

and happy to help 🙂

dreamy flicker
#

What is PatchLoadMarker.java for?

tacit ermine
#

it's so Java picks the correct class loader if zomboid is ever ran in a JPMS environment, with package isolated classloaders

#

if I try to reference the Advice class directly it'll cause the class loader to load the Advice and its dependencies (including GameServer), and then it'll be too late for me to patch it because it's already loaded

minor onyx
gilded hawk
#

Is there a way to apply programatically a bandage to a newly spawned player?

lapis stump
minor onyx
#

Oh how does on get to this mythical place

gilded hawk
# gilded hawk Is there a way to apply programatically a bandage to a newly spawned player?

So, I didn't manage to make the player spawn with applied bandages, but I found out how to make the player apply bandages automatically on spawn


Events.OnNewGame.Add(function()
    local player = getPlayer();

    if not player:HasTrait("Injured") then return end -- just return early, save a indentation level
    -- Injure the player here just like in CD DA


    local Torso_Upper = player:getBodyDamage():getBodyPart(BodyPartType.Torso_Upper)
    local LowerLeg_L = player:getBodyDamage():getBodyPart(BodyPartType.LowerLeg_L)
    local ForeArm_L = player:getBodyDamage():getBodyPart(BodyPartType.ForeArm_L)

    Torso_Upper:setCut(true);
    LowerLeg_L:setCut(true);
    ForeArm_L:setScratched(true, true);

    local item = newInventoryItem("Base.Bandage")
    local item1 = newInventoryItem("Base.Bandage")
    local item2 = newInventoryItem("Base.Bandage")
    ISTimedActionQueue.add(ISApplyBandage:new(player, player, item, Torso_Upper, 10))
    ISTimedActionQueue.add(ISApplyBandage:new(player, player, item1, LowerLeg_L, 10))
    ISTimedActionQueue.add(ISApplyBandage:new(player, player, item2, ForeArm_L, 10))
end)
tacit ermine
gilded hawk
tacit ermine
#

I think it's just the module the item is declared in

#

like Base

gilded hawk
#

👀 🤔 Oh yeah?

tacit ermine
#

self.item:getModule() .. "." .. self.item:getType() = Base.Bandage, best I can tell

crude talon
#

Can servers have their loot distribution files directly changed, like without having to use a mod, and without other players having the changed setting?

gilded hawk
#

player:getBodyDamage():SetBandaged(Torso_Upper:getIndex(), true, 0, true, "Base.Bandage"); kinda works, but for some reason the bandage spawns as already diry 👀

tacit ermine
#

what did you set bandageLife to?

gilded hawk
tacit ermine
#

it seems like that's how long before it becomes dirty

#
        if string.match(self.item:getType(), "Dirty") then
            bandageLife = 0;
        end
gilded hawk
#

Oh so the life is not the time life but the "HP" of the bandage

tacit ermine
#
item Bandaid
{
    BandagePower    =   1.5,
}

item Bandage
{
    BandagePower    =   4,
}

etc.

gilded hawk
#

Ah okay. makes sense

#
Events.OnNewGame.Add(function()
    local player = getPlayer();

    if not player:HasTrait("Injured") then return end -- just return early, save a indentation level
    -- Injure the player here just like in CD DA

    local Torso_Upper = player:getBodyDamage():getBodyPart(BodyPartType.Torso_Upper)
    local LowerLeg_L = player:getBodyDamage():getBodyPart(BodyPartType.LowerLeg_L)
    local ForeArm_L = player:getBodyDamage():getBodyPart(BodyPartType.ForeArm_L)

    Torso_Upper:setCut(true);
    LowerLeg_L:setCut(true);
    ForeArm_L:setScratched(true, true);

    local item2 = newInventoryItem("Base.Bandage")
    player:getBodyDamage():SetBandaged(Torso_Upper:getIndex(), true, 10, true, "Base.Bandage");
    ISTimedActionQueue.add(ISApplyBandage:new(player, player, item2, ForeArm_L, 10))
end)

Like this I have the best of the 2 world, I have pre applied bandages and the apply bandage animation the moment you spawn

supple briar
tacit ermine
gilded hawk
pearl prism
hazy folio
#

can someone help me please? i cant seem to msg anyone on the tsar server for the true music mod 😦

quasi geode
# gilded hawk Ah okay. makes sense

you can use the OnNewGame event directly with the framework btw, not just OnGameStart

ProfessionFramework.addTrait('Injured', {
    OnNewGame = function(player, square)
       -- do stuff
    end,
})
quasi geode
#

actually sorry, the args are (player, square, trait)

#

had to double check lol

#

dont really need the trait arg though unless your sharing the same callback function between multiple traits

worldly olive
#

Hey there, does somebody knows how to make a trait not appear in a MP server when the sleep is not enabled? is used the "not sleepOK parameter as its used for NeedsLessSleep, NeedsMoreSleep and Insomniac but for some reason it did appear 🤔

#

I have the trait like this:
TraitFactory.addTrait("Nightmares", getText("UI_trait_Nightmares"), -3, getText("UI_trait_NightmaresDesc"), false, not sleepOK);

quasi geode
worldly olive
#

So I will debug it later but to confirm, it is disabled if the value is true, and enabled if it is false, right?

quasi geode
#

ya

worldly olive
#

Got it, will debug it later, thanks!

pearl path
weary matrix
#

@pearl path it means there's a file on the server that your friend is missing, but that's not the right place to ask about this, you should try #mod_support

pearl path
#

thanks

weary matrix
#

Any clue guys how to hook a function that is declared inside another function?

sour island
#

function.function

weary matrix
#

hmm guess you're right 😅

sour island
#

lua is tables

#

all the way to _G

#

I made a variable initlizer to reuse helicopter objects - probably overkill to reuse objects but I don't actually know or want to look into garbage collectors lol -- but you're able to parse through objects for variables and functions

quasi geode
# sour island function.function

huh? functions dont index like this. lua will throw a error such as attempt to index global 'x' (a function value) (functions arent tables)

weary matrix
#

hmm

weary matrix
quasi geode
#
> x= function() local y=function() return  end return end
> x.y()
stdin:1: attempt to index global 'x' (a function value)
weary matrix
#

guess I could replace the parent function, but I was hoping for a better way

quasi geode
#

you cant. unless that function (x) is returning the function (y)

#

replacing the parent is really the only option if y is local

#

with some magic you maybe can get kahlua to give up the local stack on x...but i'm not going to dig through the kahlua source to figure that one out XD

sour island
#

ah you're right, my bad:

quasi geode
#

ya... failed to get TESTb there

sour island
#

yeah

quasi geode
#

but in that example, you typo'd TESTb (the function is defined at Testb) and its also defined as a global (no local keyword) so you could just fetch it normally anyways

sour island
#

@weary matrix is this a vanilla function you're trying to override or your own?

sour island
#

if the function is your own you could have it return a table of functions

weary matrix
#

now trying to find out how to prevent disassembling but only for vanilla containers

#

love the picture btw 😂

#

@quasi geode so basically it's doing this:

function parentFunction()
  local self = someObject.new()

  function self.theFunctionIWantToHook()

  end

  return self
end```
So that I should just do this:
```lua
local result = parentFunction()
result.theFunctionIWantToHook = function()
  -- my custom code
end
``` right?
quasi geode
#

ya

undone crag
# weary matrix Any clue guys how to hook a function that is declared inside another function?

I was looking at some Typescript that was transcompiled into Lua and this may work.

function myFunction()
--declaring local things
end
["someString"] = myFunction;

And then in your function you can put

function myOtherFunction()
require("someString");
--your other things
end

The code had something like this

do
    local ____export = require("someString")
    for ____exportKey, ____exportValue in pairs(____export) do
        ____exports[____exportKey] = ____exportValue
    end
end

ps does not work. requiring a function imports what it returns, not its local namespace

quasi geode
weary matrix
#

ok perfect

#

thx man 👍

quasi geode
#

you could hook the parent function, catch the return result, and hook the function you really want there

undone crag
weary matrix
#

@quasi geode sounds even better indeed

#

@undone crag oh weird I have not received a notification for your message 😮

undone crag
#

:o

#

oops nevermind

cold ledge
#

Hey guys, was wondering do I need extensive knowledge of coding to get started with modding?

weary matrix
#

@cold ledge I think it's more about determination/motivation than actual knowledge

undone crag
#

Oh I think I misread the Lua (transcompiled from Typescript) and it was not exporting a local namespace, it was instead returning a table.

undone crag
weary matrix
#

@undone crag not sure I understand how what you propose does apply to my problem though, but what Fenris_Wolf suggested is the way to go I think

cold ledge
#

So a mix of fundamental knowledge plus determination

cold ledge
#

Maybe. . . maybe is good

undone crag
#

co` why is it you are wanting to use a function declared inside another function? Like is it so the function can have different local variables if it is declared in different circumstances? Is it just because you want the parent function to run at a certain time like on game load instead of when the Lua is all loading?

weary matrix
undone crag
#

Which function plz tell I am interested

weary matrix
undone crag
#

Oh yeah it returns self :o

#

Hey that's odd, the code is not mentioning ContextDisassemble anywhere other than in that one place.

undone crag
#

:d

teal slate
#

oh yeah in that case you'd just

#

set self.disassemble = function() blah blah end

#

though

#

if you mean on everything created with that function

#

you'd hook function ISWorldMenuElements.ContextDisassemble()

#

call the original

#

and then at the end, you'd override that function

undone crag
#

Oh it's going through the functions with loadElements

teal slate
#

specifically

#

function self.disassemble( _data, _v ) is just syntactic sugar

#

for self["disassemble"] = function(_data, _v)

undone crag
teal slate
#
ModNamespace.oldContextDisassemble = ISWorldMenuElements.ContextDisassemble
local new_function = function(_data, _v)
-- your custom code here
end

function ISWorldMenuElements.ContextDisassemble()
    local self = oldContextDisassemble()
    self.disassemble = new_function
    return self
end
#

though to hook it you'd need to keep a reference somewhere

#

you can probably rely on the fact that it's always going to be the same function, and only save the first reference?

undone crag
#

I'm wondering whether it would be best to replace the whole ContextDisassemble function, or hook something into loadElements and go through the functions in pairs and snag the number that corresponds to the function you want if the lua scripts load in the same order each time.

teal slate
#

we're not replacing it

#

just hooking it

undone crag
#

I feel smoothbrain now D:

teal slate
#

this is exactly what "hooking something into" is, basically

undone crag
#

Ree

#

Yeah just editing self after it returns it...

teal slate
# teal slate you can probably rely on the fact that it's always going to be the same function...
ModNamespace.oldContextDisassemble = ISWorldMenuElements.ContextDisassemble
local old_self_disassemble = nil -- if you're not calling the original function, you can skip this
local new_function = function(_data, _v)
    old_self_disassemble(_data, _v) -- this too
    -- your custom code here
end

function ISWorldMenuElements.ContextDisassemble()
    local self = oldContextDisassemble()
    if not old_self_disassemble then old_self_disassemble = self.disassemble end -- you can also skip this
    self.disassemble = new_function
    return self
end
#

if you're hooking the original this should work

#

if you just want to override and not hook, you can skip those lines i noted

undone crag
#

Hang on are you a tulpa? :OOOO

#

I was thinking hey that's odd is this a transgender furry and ohhh even tulpas :O

teal slate
#

i'm not!

#

i haven't been asked that in years... 💀

undone crag
#

:o
I was interested in tulpas and servitors to try improving my brain's capabilities but what they call "parallel processing" seems legendary and rare or disputed, so having parallel minds for superior multitasking has unknown-to-me acquisition requirements. I kept interested in servitors and a mind palace or method of loci for improved memory and other mind things but what sucks is it would help to have a better mind's eye.

weary matrix
teal slate
#

💀 that was the exact same reason i was interested

#

oh our mutual servers!

#

unfortunately the reason i gave up on it was aphantasia

teal slate
#

you'll have to hook the outer function, but hooking it means it'll work fine with future tweaks to the function unless some large, breaking change is introduced (like the inner function name changing, or it no longer returning self)

weary matrix
teal slate
#

💀 i missed that bit

undone crag
#

Tulpas are really interesting to me though because your mind can actually do that. You know what this has implications for? I ask religious people and they say they pray and have spiritual experiences, but prayer seems essentially like a tulpa-forcing technique that creates a thing in your mind matching what you thought you were praying to. There will have to be some way of telling a real god apart from a god tulpa that you might get from praying to a non-existant god.

And also transgender people, what causes that? Some say people are born that way some people say people can become like that, well you can actually create a transgender tulpa and switch with it so it shows what the mind is capable of.

And also being gay, sometimes when a gay (or straight transgender) tulpa controls the body it becomes straight for the duration now that's interesting, also some tulpas don't change in that way when they control the body. INTERESTING SIGHTS INTO THE HUMAN MIND

weary matrix
#

interesting indeed but way off-topic for this channel though 😅

#

unless you're planning to make a tulpa mod? 😂

teal slate
#

it's been so long since i've had someone who's interested in this stuff for the exact same reasons i was. might hop into the discord to talk about it later, but yeah, bit off-topic for here :P

undone crag
#

Hmm actually that could be done. Different mental traits for each one.

#

One is claustrophobic, hmm actually there may be too few personality traits for it...

teal slate
#

the others are observers while one is fronting

#

it'd be neat for a multiplayer challenge run, i'd imagine

undone crag
#

On multiplayer that could be practical ohh yeaahhhh.

#

Oh no too much is Java :d
ps I think probably

teal slate
#

😔

undone crag
#

Those cringelords at Tulpa Central banned me

sour island
#

Anyone familiar with sound emitters in PZ?

#

getting really weird behavior but then again I'm trying to do something really weird lol

thin hornet
#

i did play a little around sound emitter, what's up

sour island
#

so it appears looped sounds don't play for non hosts

#

so I am generating emitters clientside based on the host's requests -- they have IDs to identify them and they're stored in a list -- all is well there

#

but when I move the emitters around it causes the sound to chop

thin hornet
#

you make it with?

 o.soundEmitter = fmod.fmod.FMODSoundEmitter.new()
    o.soundEmitter:setPos(x, y, z)```
sour island
#
storedLooperEvents = {}
function eventSoundHandler:playLooperEvent(reusableID, DATA, command)
    if isClient() then
        ---@type BaseSoundEmitter | FMODSoundEmitter
        local soundEmitter = storedLooperEvents[reusableID]
        if not soundEmitter and command ~= "drop" then
            storedLooperEvents[reusableID] = getWorld():getFreeEmitter()
            soundEmitter = storedLooperEvents[reusableID]
        end
        if soundEmitter then
            print("soundEmitter:"..tostring(soundEmitter).." ("..command..")")
            if command == "play" then
                print("--play:"..DATA)
                soundEmitter:playSound(DATA)
            elseif command == "setPos" then
                print("--x:"..DATA.x..","..DATA.y)
                soundEmitter:setPos(DATA.x,DATA.y,DATA.z)
            elseif command == "stop" then
                print("--stop:"..DATA)
                soundEmitter:stopSoundByName(DATA)
            elseif command == "drop" then
                soundEmitter:stopAll()
                storedLooperEvents[reusableID] = nil
            end
        end
    end
end
thin hornet
#

mhm

sour island
#

This is what the connected players recieve after the commands

#

the prints go through

#

and I can hear the sound

#

but it being severely cutout

#

moving emitters around don't cause this

#

so I'm not sure what is

thin hornet
#

weird never had choppy sound

#

and this same code worked well in SP before?

sour island
#

I didn't have this code in SP

#

sounds works like normal lol

thin hornet
#

@sour island ill head to bed now, but if you didnt find a solution ill check with you tomorrow

sour island
#

the root issue is looped sounds don't seem to get sent to non-hosts

#

but it could be that moving emitters don't update sounds to non-hosts

thin hornet
#

later bud

dreamy flicker
#

@tacit ermine I stripped that down to just the /info endpoint and got the following exception:

Exception in thread "main" java.lang.ClassNotFoundException: dev.oxymoron.zomboidServerApi.ZomboidServerPatcher
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Aborted

Here was the argument - pzexe: vmArg (json) 1: -javaagent:/home/oxymoron/pz-agent.jar

tacit ermine
#

can you pastebin/gist your ZomboidServerPatcher.java

#

or the output of

jar tf /home/oxymoron/pz-agent.jar | grep ZomboidServerPatcher
#

if Premain-Class points to the correct class name it might be failing to load ZomboidServerPatcher because a class it depends on isn't present (could be that you have the normal jar instead of the shaded jar with bytebuddy included)

dreamy flicker
#

lol sorry @tacit ermine I inspected my compiled .jar and found that it didn't package that code at all

#

it wasn't even being built. it was just packaging up the dependencies. but now that I am building the files it's failing because zomboid.* dependencies are missing

#

Any ideas how I can let the compiler find zombie.*

tacit ermine
#

yeah, there's a gradle property you need to set to your zomboid path

#

you can set that by putting it in gradle.properties

dreamy flicker
#

gotcha... So I have a confession to make

#

I might have switched to maven...

#

I'll figure it out 😅

tacit ermine
#

I think for maven you'll need to generate a jar for the classes and a fake POM

#

can do it with mvn install:install-file

dreamy flicker
#

which .jar do I need for the zombie.* namespace?

tacit ermine
#

the zomboid classes aren't in a jar, they're just sitting in the root of the game folder

#

er, unless you're on Linux, then they're in java/

dreamy flicker
#

oh wow

#

ok

#

thx

#

so that is what you mean by generating a jar...

#

oof

#

@tacit ermine does your pz-agent.jar include the zombie.* namespace in the shadow jar?

tacit ermine
#

no, since it's part of the game

#

in maven that's <scope>provided</scope>

dreamy flicker
#

gotcha

tacit ermine
#

jar cvf project-zomboid.jar ./**/*.class should be enough from the pz game folder

#

or from the java subdir if on Linux

dreamy flicker
#

developing/compiling on windows
game server and test game server on linux

tacit ermine
#

same jar, just the folders are different on each platform for some reason

dreamy flicker
#

weird... javac is on my path, but jar is not...

#

I dont do much java work 😅

tacit ermine
#

JVM installations typically live under /usr/lib/jvm on Linux, binary will be under the specific JVM's bin/ folder

dreamy flicker
#

yeah, I know, I'm just supprised javac is there and jar is not

tacit ermine
#

I think it's an alternatives thing

#

what distro?

dreamy flicker
#

debian

#

oh I see what's going on

#

weird symlink stuff.

tacit ermine
#

update-alternatives --config jar might let you symlink the correct path into /usr/bin

dreamy flicker
#

fixed, thank you 🙂

weary matrix
dreamy flicker
#

@tacit ermine Got all the dependency jazz and whatnot figured out, the .jar is building how I like and it's loaded. Here is my new exception

tacit ermine
#

try relocating net.bytebuddy under a different package with the maven shade plugin

dreamy flicker
#

how would I do that?

#

I am using maven-shade-plugin

tacit ermine
#

you already have the shade plugin, so just add this to its <plugin> block

            <configuration>
              <relocations>
                <relocation>
                  <pattern>net.bytebuddy</pattern>
                  <shadedPattern>dev.oxymoron.vendored.net.bytebuddy</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
dreamy flicker
#

ah

tacit ermine
#

er, not the <plugin> block

#

the <execution> block

dreamy flicker
#

I understood

#

looks like the same exception

#

pushing so you can see if I did what you had expceted

tacit ermine
dreamy flicker
#

oh yeah, I removed those earlier for a different reason

#

I can add those back now

tacit ermine
#

Can-Retransform-Classes and Can-Redefine-Classes

#

I do have my bytebuddy relocated too, think I hit an issue with it

dreamy flicker
#

same exception, but with bytebuddy at the new namespace

tacit ermine
#

<Can-Redefine-Classes>false</Can-Redefine-Classes>

#

should be true

dreamy flicker
#

🦸

#

it's working

tacit ermine
#

\o/

dreamy flicker
#

you are a wizard!

tacit ermine
#

you can extend it with whatever information you want fairly easily. I was going to add a couple things like recent deaths, zombie counter, number of factions, etc.

dreamy flicker
tacit ermine
#

oh yeah

#

javalin is a bit odd that way

dreamy flicker
#

I'll figure that stuff out another night! This is amazing

tacit ermine
#

you just need to add the dependency in that error to your POM

dreamy flicker
#

I just took a second to read it 😅 let me try

tacit ermine
dreamy flicker
#

oh. lol I looked for those references while I was building my pom.xml and I figured they were used as part of the stuff I stripped down.

tacit ermine
#

it'd be cool to include the actual date using the thing you linked docs on earlier, I only used world time because I put this together pretty quickly and didn't find the actual date in my 2 minutes of searching

dreamy flicker
#

this is gonna be so awesome!

tacit ermine
#

yeah I tried to put stuff together with RCON but it's pretty limited and it doesn't seem like you can even register new RCON commands with lua

dreamy flicker
#

same findings here. that was my first route

#

Honestly I kinda shied away from modifying the java code. I mean I'm a software dev by trade, but patching java code and having to deal with the headache when IndieStone updates didn't sound all that awesome. but You've really helped me see how powerful it can be

#

I'll probably have questions for you over the next few days to understand really what I've just done, but I'm really greatful for all your help and assistance (And hand-holding)

tacit ermine
#

there's a lot you can do and as long as you're not searching for literal bytecode patterns and TIS don't start obfuscating code it can go pretty smoothly, and of course now you have an entrypoint into the server you can change everything that's only accessible via java

#

and feel free to ping any time, always happy to help

woeful jay
#

@dreamy flicker which command you using to get days elapsed + weather?

dreamy flicker
woeful jay
#

ty

drifting ore
#

Is there overlap/hit events for when an item touches an object?

#

for example a plank on the floor touching a barrel

#

or is there no concept of that in the game? 🙂

willow estuary
#

"Scavenger's Workshop" crafting station, for upgrading bags, making scrap weapons, cooking up bathtub speed, etc.

cobalt steeple
#

How do you create a patch for a mod for pz

late hound
fleet smelt
#

Hey guys, what is the function to pull my character's x,y,z?

rare silo
#

I need a lua programmer. Details in personal correspondence

signal beacon
#

Is the firing speed for guns fixed across all of them? Is there any way to change it? SwingTime does nothing, so I think it might be tied to the animation than any of the stats

gritty sierra
#

In WorldEd i can choose to right click open in TileZed. atleast it used too, it doesnt work anymore, why is that?

heavy hearth
#

does anyone know off hand if what the setxxxxxx() property is for adding VHS media to a television signal device?

weary matrix
#

@teal slate hey, are you around?

teal slate
#

yeah!

#

what's up?

weary matrix
#

trying to execute that code:

ServerOptions.instance.MaxPlayers = new ServerOptions.IntegerServerOption(ServerOptions.instance, "MaxPlayers", 1, maxPlayers, 16);```
#

so the ServerOptions.instance field is static, but not the ServerOptions.MaxPlayers field, but since the instance is static, the MaxPlayers field should get initialized before main is run right?

#

yet I'm getting this error when running the code:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at zombie.javamods.CustomServerOptions.setMaxPlayers(CustomServerOptions.java:8)
    at zombie.javamods.ServerMain.<init>(ServerMain.java:24)
    at zombie.javamods.ServerMain.main(ServerMain.java:52)
Caused by: java.lang.NullPointerException: Cannot invoke "org.uncommons.maths.random.CellularAutomatonRNG.nextInt(int)" because "<parameter2>" is null
    at zombie.core.Rand.Next(Rand.java:80)
    at zombie.core.Rand.Next(Rand.java:91)
    at zombie.network.ServerOptions.<init>(ServerOptions.java:48)
    at zombie.network.ServerOptions.<clinit>(ServerOptions.java:165)
    ... 3 more
#

any clue what I might be doing wrong?

teal slate
#

let's see

#

static initialiser -> instance initialiser -> rand

#

lemme look at the source for serevroptions

teal slate
#

at zombie.network.ServerOptions.<init>(ServerOptions.java:48) oh this isn't the constructor

#

relatively sure this is the instance initialisation?

#

let's see

weary matrix
#

well not sure but if I don't call my setMaxPlayers function then no crash

teal slate
#

oh wait

#

it could be ParseInt failing

#
        if (maxPlayers != null)
            CustomServerOptions.setMaxPlayers(Integer.parseInt(maxPlayers));

try logging what Integer.parseInt(maxPlayers) is

weary matrix
#

hold on

#

it should be "64" but let's see

teal slate
#

ah, wait, if it was failing there it wouldn't return null

#

it'd raise a NumberFormatException

tacit ermine
#

fwiw, you unfortunately also need to override ServerOptions.getMaxPlayers()

teal slate
#
   public int getMaxPlayers() {
      return Math.min(32, getInstance().MaxPlayers.getValue());
   }

eough

weary matrix
#

yeah it is 64:
HOLY MOSES: 64

teal slate
#

i can't tell where this Rand.Next() call is coming from in ServerOptions

#
public ServerOptions.IntegerServerOption ResetID = new ServerOptions.IntegerServerOption(this, "ResetID", 0, 2147483647, Rand.Next(1000000000));
public ServerOptions.StringServerOption ServerPlayerID = new ServerOptions.StringServerOption(this, "ServerPlayerID", Integer.toString(Rand.Next(2147483647)));
weary matrix
#

@tacit ermine why? Since getMaxPlayers() is using ServerOptions.instance.MaxPlayers

teal slate
#

either of these, maybe

tacit ermine
#

it picks whatever's smaller, 32 or whatever ServerOptions.instance.MaxPlayers has

weary matrix
#

ohhh

#

totally missed that

#

damn

tacit ermine
#

yeah I lost an hour or 2 to that

teal slate
#

Rand.Next() isn't called anywhere in this code?? aghh

#

I do have to wonder, though

#

Why make a new IntegerServerOption?

tacit ermine
#

the IntegerServerOption has a max, which is private, but the JVM isn't too picky about going behind access levels

teal slate
#

ahh

weary matrix
#

damn so no way to do that without patching I guess... f***

teal slate
#

i still can't figure out where the Rand.Next() call in the stacktrace is coming from

tacit ermine
#
   public ServerOptions.IntegerServerOption ResetID = new ServerOptions.IntegerServerOption(this, "ResetID", 0, Integer.MAX_VALUE, Rand.Next(1000000000));

is the crash

teal slate
#

that's

#

really odd, why would it suddenly crash there

weary matrix
#

yeah it is weird

teal slate
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.uncommons.maths.random.CellularAutomatonRNG.nextInt(int)" because "<parameter2>" is null

tacit ermine
#

Rand.rand isn't initialized

teal slate
#

... what's parameter2 there? 🤔 just the int being passed?

#

uuuuugh

tacit ermine
#

so Rand.init() hasn't been called

teal slate
#

oh wait

tacit ermine
#

which is typically done in GameServer.init() and GameWindow.init()

teal slate
#

i think accessing instance might initialise it earlier

tacit ermine
#

so it sounds like you're just doing it a bit too early

weary matrix
#

but even if I was doing it a bit later my stuff still couldn't work :/

weary matrix
#

hmm guess I could simply make a one byte patch of the .class before running, should be relatively safe 😅

teal slate
#

gotta wonder why no one's tried using mixins with pz 🤔

#

i asked in there and it would technically be supported

#

(though i haven't tried; not really familiar enough)

weary matrix
#

java has mixins? 🤔

tacit ermine
#

do you mean the minecraft modding framework?

teal slate
#

it's not just for minecraft

#

the mixins framework is compatible with basically any java game (or maybe even any java project), i think

#

as far as i can tell it seems pretty similar to HarmonyLib for Rimworld/Caves of Qud, though it doesn't have the option of writing transpiler patches in IL

#

(I suppose the equivalent to that for Java would be bytecode patching?)

tacit ermine
#

yeah, no reason you can't use it outside of minecraft for generic bytecode weaving

teal slate
#

think the main issue with zomboid would be getting the mods in there in the first place :P

tacit ermine
#

you mean people working on Java mods or just loading them at all?

teal slate
#

i feel the steam workshop would probably take umbrage with "lua bootstrapper that copies a .jar from the mod into the classpath"

#

loading them, yeah

tacit ermine
#

at the point Lua is initialized is way too late for me, so I need to come up with something a bit leaner anyway

teal slate
#

oh, i meant "run the mod to copy it into your classpath, then restart the game"

granite torrent
#

Hi!

Does anybody know if there is a way to randomly get items by category?
I mean, I need a function to return me all items by category, is there any function in the game or should I create my own?

Edit: For example to return all medical stuff in the game

teal slate
#

it'd still be inconvenient and awful for servers

tacit ermine
#

oh, lol

#

that'd be awful

teal slate
#

yup

#

but it's the only way i can think of to do java modding via workshop

#

well, "java modding" and "via workshop", in scare quotes

tacit ermine
#

I think ideally you'd have something that starts up before zomboid, scans enabled mods, and adds them to the classpath

teal slate
#

🤔

tacit ermine
#

that's how I do it on my server, yeah

weary matrix
#

@teal slate fyi you can have a .jar in your mods on the workshop (I tried it), only problem is to install the java mod loader itself

tacit ermine
#

you could create an installer that updates the Steam launch options for the game

#

if you add -pzexeconfig my/own/file.json to the actual Zomboid launch options in Steam it'll load your custom options instead

teal slate
#

i figure that moving files into arbitrary places might be considered malicious or potentially malicious by steam

#

having a .jar there is probably fine

#

oh i see

#

the modloader would check in the mods folder

#

🧐 i see........

tacit ermine
#

and Steam launch options are stored in this text file (one for each steam ID) C:\Program Files (x86)\Steam\userdata\<id>\config\localconfig.vdf, relatively easy to update

weary matrix
tacit ermine
#

yeah, I went looking to see if that was possible after I found your javamods repo and got the idea of Steam launch options

weary matrix
#

I do the steam launch option too for singleplayer

#

the "Good" stuff about steam is their file integrity check doesn't care about extra files in the installation folder 😄

#

@teal slate @tacit ermine we should make a #javamodding channel 😄

teal slate
#

could ask for at the very least a java modding thread in here

weary matrix
teal slate
#

fair

#

i'm not actually planning on doing any java modding, myself

#

been considering making a lua modding wishlist instead

#

imo the biggest issue is getter/setter asymmetry

#

some things have public setters and private getters, or vice versa

weary matrix
#

yeah that's so annoying :/

teal slate
#

heck, some things have public setters and no getters at all

#

(or vice versa)

#

wonder how hard it would be to parse the project/javadocs and detect those asymmetries

weary matrix
teal slate
#

probably! :P

#

but the idea of lua modding is to have a lower barrier to entry

weary matrix
#

at least for getters/setters no problem

weary matrix
#

since I already parse all the source code

teal slate
#

could make a list of all getters/setters by fully qualified name, then substitute get/set in each for the opposite, and report ones that are missing or have mismatched visibility

tacit ermine
#

kotlin exposes that quite nicely

#

could probably get property style docs from the java classes with kdoc

weary matrix
#

@tacit ermine what if you want the full list?

#

like to make a bug report to TIS or something

tacit ermine
#

full list of getters and setters?

weary matrix
heavy hearth
#

anyone know what the setter for AcceptedMediaType is? Tried deviceData:setAcceptMediaType(1); but it doesn't like it

#

can't find anything on google

weary matrix
#

@heavy hearth do you have a reference to a Radio instance? If yes you should try to call setAcceptMediaType on this object

tacit jasper
#

hi, i want to do some ui modding, is there any document or tutorial about this topic? thanks

heavy hearth
#

@weary matrix yeah. I'm creating the defice instance with local deviceData = part:createSignalDevice(); and all the other bits work but it doesn't like setAcceptMediaType

#

function Vehicles.Create.Television(vehicle, part)
local deviceData = part:createSignalDevice();
deviceData:setIsTwoWay(false);
deviceData:setTransmitRange(0);
deviceData:setMicRange(0);
deviceData:setBaseVolumeRange(10);
deviceData:setIsPortable(false);
deviceData:setIsTelevision(true);
deviceData:setMinChannelRange(200);
deviceData:setMaxChannelRange(1000000);
deviceData:setIsBatteryPowered(false);
deviceData:setIsHighTier(false);
deviceData:setUseDelta(0.007);
deviceData:setAcceptMediaType(1);
deviceData:generatePresets();
local invItem = VehicleUtils.createPartInventoryItem(part);
end

willow estuary
# weary matrix <@!72149132969521152> <@!311437188422303745> we should make a #javamodding chann...

Serious answer: there's a lot of reluctance to add more channels, for multiple good reasons, but mainly they cumulatively create more effort and time sink for the management. I pushed for a modding guide workspace channel recently, and the consensus was "if it was to be added, now isn't the right time".

As things are so chaotic right now, and the management has their hands full, I would suggest waiting for things to calm down, maybe a month or two?, before seriously floating that proposal?
(too buy/& disinterested to debate the pros and cons of adding channels RN, but though might be worthwhile advice 🙂 )

weary matrix
#

@willow estuary thanks, but to be honest I don't expected TIS to create a #javamodding channel, not sure they would want to hear about it at all 😂

#

@heavy hearth hmm weird, cause there is a setMediaType() method in DeviceData. Maybe it really needs a byte though?

    public void setMediaType(byte byte1) {
        this.mediaType = byte1;
    }
heavy hearth
#

ah. k

weary matrix
#

@heavy hearth what error do you get?

heavy hearth
#

function: Television -- file: SFDriveVehicles.lua line # 43
Callframe at: addVehicle
function: SpawnVehicle -- file: CheatCore.lua line # 1231
function: worldobjects -- file: ISUICheatMenu.lua line # 364
function: onMouseUp -- file: ISContextMenu.lua line # 90

ERROR: General , 1641220712216> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in Television at KahluaUtil.fail line:82.
ERROR: General , 1641220712216> DebugLogStream.printException> Stack trace:

#

line 43 is the setAcceptMediaType so must be type casting

tacit ermine
#

is it supposed to be setMediaType, not setAcceptMediaType?

weary matrix
#

oh right

heavy hearth
#

lol can't see the wood for the trees

#

thanks for spotting that

#

yup. that was it. thanks for spotting that one

weary matrix
#

@heavy hearth if the problem had been only related to the int/byte stuff, then I think it wouldn't throw that error that you tried to call nil

heavy hearth
#

I think it was that setAccept doesn't exist as @tacit ermine pointed out. deviceData:setMediaType(1); works

weary matrix
#

yeah it is

#

just saying the error itself could have helped you figure it out

zenith smelt
#

Hello. I ha ve a problem with a mod I'm trying to make

#

It works okay in solo

#

but when I do a host or connect to a local server the client crashes right after chracter creation

weary matrix
#

@zenith smelt what's the error?

zenith smelt
#

Game instnatly closes

#

nothing no error

#

Just closes

#

"These are the end times" appears and then the game closes

brazen copper
flint bolt
#

When you call getCell() on the server side, what does it returns exactly?

weary matrix
flint bolt
#

Does not give an error, at least, but I'm not sure behind the meaning of it...

weary matrix
#

have you tried to print the returned value?

#

I have no idea but it just make no sense to me, like what would it be supposed to return? 😮

flint bolt
#

It does return an IsoCell object

amber idol
#

So I have a pretty basic level of programming under my belt. Never have used Java or lua really. Do you guys think making some basic mods is a bad decision?

weary matrix
#

@flint bolt check the coordinates maybe?

amber idol
#

Because right now I’m trying to work on a mod that basically just adds a custom zombie and potentially has certain items on him etc. it seems simple enough

weary matrix
#

@flint bolt why do you need getCell() in server code anyway?

tight blade
flint bolt
amber idol
tight blade
# amber idol Ok thank you I was just curious because people have been saying the documentatio...

It heavily depends on what mod you're making.
Can't say for certain of the documentation or wiki is out of date, although I for the life of me CAN NOT find the damn code that handles the fitness stuff, so I might have to resort to digging into the source code.

I do know for like making a trait mod I'm working on to remove some of the traits from base game I had to reverse engineer the trait system, aka make the game just rebuild it but without two traits. But that's obviously just for modifying/removing stuff. Not adding new content like items.

fleet smelt
#

How do player ids change when people join and leave a server? Using getSpecificPlayer()

#

if 12 are connected, then numbers 4 and 6 leave, do the remaining players fill the holes so getSpecificPlayer(10) will now be the 12th (last person to join)

amber idol
brittle jewel
#

@fleet smelt If it's a client side script, getSpecificPlayer will always be 0 on the client. Unless they're running splitscreen.

fleet smelt
#

What about server side?

brittle jewel
#

Server side uses 'onlineID'.

player:getOnlineID()
getPlayerByOnlineID(int)
tight blade
fleet smelt
amber idol
drifting ore
#

You could even make fat vape clouds

tight blade
brittle jewel
radiant stirrup
#

is there a way to disable dropping equipped items on a fall? (OnItemFall)
i can't seem to find the lua code that handles it

amber idol
fleet smelt
drifting ore
#

Oh well, thats how you learn

#

😄

brittle jewel
#

For the few server side things I've had, I've been using the sendClientCommand to do server side stuff and then from the server I'll do sendServerCommand back to the player(s).
#mod_development message

brittle jewel
#

@fleet smelt Actually, now that I think about it, this might help you with what you're trying to do. In this example, I'm calling it from the OnPlayerAttackFinished event and I'm passing the sound radius to the server (player is passed automatically). Then I pass the playerID and the radius back to the client, where I check if the playerOnlineID matches the local player so I can do stuff for everyone except that player.

--client
sendClientCommand("Test", "toserver", {handWeaponSoundRadius = handWeapon:getSoundRadius()})

--server
sendServerCommand("Test", "toclient", {playerOnlineID = player:getOnlineID(), handWeaponSoundRadius = args.handWeaponSoundRadius})

--back on client
local specificPlayer = getSpecificPlayer(0)
if (specificPlayer:getOnlineID() ~= playerOnlineID) then
  --do stuff for everyone except the player who triggered the orginal sendClientCommand
end
fleet smelt
brittle jewel
#

I'm working on something so guns can make you/others around you temporarily hard of hearing/deaf. I want it to work with any modded items (and I'm too lazy to make a manual list) so the hearing protection is calculated by insulation, wind resistance, water resistance, bite/scratch defense, and quality. (Except ear plugs/ear muffs). Not exactly a foolproof system as a lot of these don't even cover your ears, but I figure it's more of a balance thing too.

I've been having more issues with the text above the player's head properly triggering than anything, because as far as I know, there's no easy way to detect when a player equips or unequips something.
https://streamable.com/ohob3m

proven violet
#

what are some good mods that make firearm gameplay more friendly?

brittle jewel
#

It's mostly done, I'm to the most boring part: testing, setting proper values for hard of hearing/deaf, and making sure there's no performance problems/issues/etc. So progress has been slow lately.

drifting ore
#

Does anyone know if its possible to add markers to the players map?

#

(Through lua)

shadow tide
#

Are custom occupations possible? If so, is there a guide i can follow to make one?

drifting ore
#

They are possible, there's a mod that provides a framework for it.

#

My advice would be, download a mod that adds custom occupations and look at how they do it.

shadow tide
#

thanks man

drifting ore
#

no problem 🙂

#

I dont know a mod that uses this mod as an example from the top of my head, but ill try find one

#

oh nvm

#

forum has a good guide to using this mod

flint bolt
#

Is there a way to draw debug information above a zombie? For example, draw the onlineID of a zombie above its head?

urban hemlock
#

Guys, we need electric heater to base mod!

honest jewel
#

Delete if not allowed,

However, I would like to "commission" a modder or dev or someone with the know how, to make a small mod for Project Zomboid for me, if anyone is interested in this please reach out 🙂

errant meteor
#

@pearl prism I am sure I can stack some stuff on the floors and not just seats :]

mint sphinx
#

for a difficult scale from 1-10 how hard would custom ui be to code in zomboid ? never tried to code ui boxes.

lapis stump
#

I can't get the OnClientCommand lua event to trigger unless I use triggerEvent. I'm connected as an admin to my dedicated server btw.

client script

...
local player = getPlayer();
sendClientCommand(player, "myModule", "test", nil);
triggerEvent("OnClientCommand", "myModule", "test", player, nil);
...

server script

local Commands = {}
local ClientCommands = {}

...
Commands.myModule = {};
Commands.myModule.test = function(player) 
 print('works');
end    

ClientCommands.OnClientCommand = function(module, command, player, args)
    print('received '..module..' '..command..' '..tostring(player)..argStr);
    if Commands[module] and Commands[module][command] then
        local argStr = '';
        for k,v in pairs(args) do argStr = argStr..' '..k..'='..tostring(v) end;
        Commands[module][command](player, args);
    end
end
...

Events.OnClientCommand.Add(ClientCommands.onClientCommand)
quasi geode
lapis stump
#

sendClientCommand() doesn't trigger OnClientCommand() on server script ?

midnight abyss
#

hi, what causes my items icon to be blurry in the ui?

quasi geode
#

it should trigger it for the server only

midnight abyss
#

my items resolution is 16x16

quasi geode
#

but calling triggerEvent on the client would only trigger things on the client not the server

lapis stump
#

the sendClientCommand() in my client script isn't triggering Events.OnClientCommand.Add() in my server script though?

quasi geode
#

only on the client though....client's will still load the scripts in the server directory, but much of the stuff in there will be ignored...like OnClientCommand hooks (unless you force them to trigger)

#

the event should still be triggering normally on the dedicated server

lapis stump
#

idk, I'm using OnKeyPress event to debug the events and it never works with sendClientCommand() only wih triggerEvent.

old blade
#

does ValuTech have a logo?

quasi geode
#

relooking at your server side script it might be throwing a error

ClientCommands.OnClientCommand = function(module, command, player, args)
    print('received '..module..' '..command..' '..tostring(player)..argStr);  -- <<<< argStr is not defined yet. cant concentrate a nil value
    if Commands[module] and Commands[module][command] then
        local argStr = '';
        for k,v in pairs(args) do argStr = argStr..' '..k..'='..tostring(v) end;
        Commands[module][command](player, args);
    end
end
old blade
#

im modelling a heater radiator or whatever and im making the valutech version of it

#

gonna be a plack on the side that says valutech

amber fossil
#

@old blade i think a picture of a dumpster would be accurate

old blade
#

lol

#

i was thinking something kinda like this

#

might make an actual proper logo for this

lapis stump
#
--debugging 
local function onKeyPressed(key)
    local player = getPlayer();
    if key == Keyboard.KEY_Z then
       player:addLineChatElement('test');   
        sendClientCommand(player, "module", "command", nil);
        --triggerEvent("OnClientCommand", "module", "command", player, nil);
    end
end
#

if I uncomment triggerEvent it will trigger the OnClientCommand though

amber fossil
#

@old blade I would use that logo and throw a corporate planned obsolescence theme on it

old blade
#

ill probably end up combining this and something like this

brittle jewel
# lapis stump ``` --debugging local function onKeyPressed(key) local player = getPlayer()...

Based on the sendClientCommand shown here, I think this would work as long as it's in the server directory:

local function testOnClientCommand(module, command, player, args)
    if not isServer() then return end
    if module ~= "module" then return end
      if command == "command" then
        print("onClientCommand")
    end
end
Events.OnClientCommand.Add(testOnClientCommand)

I know a lot of the examples use the 'ClientCommands.OnClientCommand', but if it's only a few commands it really won't matter, as far as performance goes.

drifting ore
#

For some reason my mods script isn't showing up in the debugger, is there anything obvious I might be missing?

fleet smelt
#

How can I print messages from the server into player's chats, I'm trying to find the code that sends the serverwelcomemessage, I'm sure I'll get there eventually, but if anyone knows off the top of their head that'd be incredible

lapis stump
#

besides mod ofc 🙂

brittle jewel
#

Looks like you actually need to remove 'player' from the sendClientCommand(player, "module", "command", nil); line. The player is passed as the 3rd parameter of the OnClientCommand so you'll have access to it either way.

#

Most of the vanilla code passes player first too, so I'm not sure if that's a side effect of me not using the 'ClientCommands.OnClientCommand' setup exactly the same, or what.

lapis stump
#

idk, I'm using #mod_development message in my server script and in my client script I'm doing --debugging local function onKeyPressed(key) local player = getPlayer(); if key == Keyboard.KEY_Z then player:addLineChatElement('debug (Z key pressed)'); sendClientCommand('module', 'command', nil); end end

#

and print("onClientCommand") is never called

brittle jewel
#

Here's exactly what I have in client:

local TestFunctions = {}

TestFunctions.testKeyUp = function(keynum)
    local specificPlayer = getSpecificPlayer(0)
    
    if (specificPlayer ~= nil) then
        sendClientCommand("module", "command", nil)
        print("sendClientCommand")
    end
end
Events.OnKeyPressed.Add(TestFunctions.testKeyUp)
#

And server:

local function testOnClientCommand(module, command, player, args)
    if not isServer() then return end
    if module ~= "module" then return end
      if command == "command" then
        print("onClientCommand")
    end
end
Events.OnClientCommand.Add(testOnClientCommand)
lapis stump
#

~~still doesn't work going to try closing everything out ~~

lapis stump
#

still doesn't work idk why

#

does debug mode disable sendClientCommand() ?

pearl prism
#

This rear door would be amazing to see animated, you could see the entire vehicle from the inside. I'm almost redoing my entire model

brittle jewel
lapis stump
#

yep, with the PZ dedicated server tool from steam.

brittle jewel
#

That's how I installed mine as well. Super weird...

lapis stump
#

no errors in console.log or the server terminal either

fleet smelt
lapis stump
fleet smelt
#

no, i'm asking if lua treats ' as equal to "

lapis stump
#

== equal to and ~= not equal to

fleet smelt
#

😐

#

' == " ??????????????

#

you're using ', I've only ever used, and seen " being used in lua

lapis stump
#

i don't see w/e character you typed

#

oh wait im dumb now i get it

#

you can use ' or " but you need to use double quotes to show special chars

wraith wedge
#

Is there any mod that hides tailoring patches?

wraith wedge
#

nice

devout oriole
#

Guys, I'm creating a car mod, but I'm stuck with a problem. Basically, I want to make the Glove Box unbreakable, because it's the only part that isn't repairable. I'm using Dash Rancher (ingame id: OffRoad) as the test car. I can't make it work. Here is my code:

Events.OnPlayerUpdate.Add(function(player, vehicle, args)
    local vehicle = player.getVehicle and player:getVehicle() or nil
    if (vehicle and string.find( vehicle:getScriptName(), "OffRoad" )) then

    local gb = vehicle:getPartById("PassengerCompartment")
            if gb:getCondition() < 100 then
        gb:setCondition(100)
    end

end

end)

What am I doing wrong here?

shadow tide
#

My mod is not appearing in the Select Mods menu, and I do not know why, I can provide screenshots

devout oriole
#

Should be C:\Users\YourUser\Zomboid\mods

shadow tide
#

thank you!

devout oriole
#

(:

lapis stump
#

Anyone know why my dedicated server isn't reacting to the OnClientCommand event?

shadow tide
#

icon is showing a question mark instead of the icon, how do i fix this?

sour island
#

This is a bittersweet moment when my code actually works
@thin hornet @weary matrix

#

no more sound skips for looped sounds in MP

late hound
#

or whatever the script has for its icon tag

shadow tide
#

oh is the i in item supposed to be lowercase?

late hound
#

doesn't have to be

shadow tide
#

apparently, it still isnt working

late hound
#

what is the item script?

low crystal
#

hey guys if I make a mod that turns zombie models into the terminator (T-800) could Skydance Media come after me for copyright?

shadow tide
devout oriole
late hound
shadow tide
#

this thing?

late hound
#

the whole thing of that item

shadow tide
late hound
#

ah

#

what is the name of your icon in media/textures/

shadow tide
#

Item_Joint.png

late hound
#

ok so in the script here, only put Joint not item_joint

#

should work now

shadow tide
#

so i needed to put .png at the end of joint?

late hound
#

no

shadow tide
#

ah i gotcha

late hound
#

but the icon iteself is a png right?

shadow tide
#

it is

late hound
#

👍

shadow tide
#

it works!

late hound
#

sweet!

gleaming prawn
#

Where is the tailoring skill coded? Like patches on clothing.

late hound
#

addpatch.lua or something

gleaming prawn
#

I'm afraid patch only brings up the patch textures

pseudo lake
#

Anyone worked with the built-in RCON provided at all?

nimble warren
#

Hi all. Got these earlier from the Brita armor pack. IS there a way to turn them on?

devout oriole
#

How do I see what are the vehicles ScriptName?

undone crag
#

Coobs this is really meant to be for chatting about making mods though. :/

opal wind
#

i finished mystique hair and made all Rogue clothing, took me 6h to make her entire outfit 🙂

#

rogue comes with Boot, Gloves, Suit, Jacket, Functional Belt and Hair separated

tribal rune
#

I created a weapon but the model doesnt attach to the player correctly, how do I change the offset of a model?

blissful estuary
#

how easy is it to reskin a car?

#

I just want to make a skin of irl car and put it on an existing ingame car

toxic echo
#

does anyone know if there will be a new or updated NPC mod coming out?

old blade
#

indie stone is working on it but it will take a while

toxic echo
#

that's why i asked about a mod

old blade
#

idk lol

frail violet
toxic echo
#

ok, thanks. i'll look out for it

winter bolt
#

yeah apparently its in aiteron's discord

toxic echo
#

found it. thank you :)

opal wind
#

improved my superman suit texture and made a new cape model

tight blade
#

Anyone know why for some reason when the mod translates into Russian it... Does this?
It doesn't look anything like it in .txt so did I do something wrong or...?

winter bolt
tight blade
cold burrow
tight blade
vale musk
#

Armored Doors and Windows (build 41) keeps updating???

#

Update: Jan 4 @ 4:04am
Update: Jan 4 @ 3:46am
Update: Jan 4 @ 3:38am

heavy hearth
#

I need some advice on radial menus. my mod is blocking another mod from adding slices to the vehicle menu. I'm using this wrapper block which seems to be what other mods are using

-- Save default function for wrap it
if WWVehicleMenu.UI.defaultShowRadialMenu == nil then
WWVehicleMenu.UI.defaultShowRadialMenu = ISVehicleMenu.showRadialMenu
end

-- Wrap default fuction
function ISVehicleMenu.showRadialMenu(playerObj)
WWVehicleMenu.UI.defaultShowRadialMenu(playerObj)
if playerObj:getVehicle() then
WWVehicleMenu.UI.addOptions(playerObj)
end
end

how do I make it play nice?

brave field
#

I would like to start and try to create some mods with one of my friend. Where can I start?

gaunt sand
#

i'm trying to tweak a mod that adds loot to zombies but i dont even know what this numbers mean

#

is that 0.5%? is it 50%?

nimble warren
#

Hey all. Anyone know what happening here?

#

I can't start my server and I suspect this is the reason

gaunt sand
#

does downloading the mod help?

#

you can try to it manually in the mods folder

nimble warren
#

trouble is, I can't ID what mods they are. Both say 0mb with no name.

civic galleon
#

Broken Workshop mods generally appear as their ID# not their name. At least in my experience. Make sure when you remove mods they are removed from both Workshop and Mods in your server's settings

cyan halo
#

Any resources on how to do it? I'm knowledgable in lua and java but I think lua is missing a lot of functionality I need

zenith smelt
#

Anyone got any pointers to how I find out when the player is stomping a zombie?

cobalt steeple
fleet smelt
#

Does anyone know how OnlineID() acts when people disconnect?

Full 12 slot server;
slot 1 - John - ID 0 (Java tables start at 0)
slot 2 - Mike - ID 1
slot 3 - Alice - ID 2
slot 4 - Steve - ID 3
..
slot 11 - Greg - ID 10
slot 12 - Jane - ID 11

Suppose Mike, who is ID 1, leaves;
Will that mean Alice and everyone else drops down an ID number?
Or does it mean the next person to join will become ID 1?

#

Sadly not something I can test with one copy of the game 😦

cobalt steeple
drifting ore
#

Is there a "simple" way to change a function defined in a .class file from a lua script? I've heard that changing the .class and recompiling is frowned upon for this game.

cobalt steeple
#

Well- There is a way i suppose.

To take the .class files i just learned is not exactly the best you can do- You can have a look into it to get an idea how functions were built. I limit myself to looking at the code structure and trying to replicate it in LUA. Mods with .class may be taken down even so the most you can do is some sightseeing

atomic stream
#

Hi, does anyone know if I could add an animal with a new 3D model, without animations(seems to have problems as of right now), and add a simple AI package to that animal type? I've read somewhere that adding new behavior is not possible yet.

fleet smelt
# cobalt steeple I assume that it drops down the ID

Sadly not helpful. I'd like a firm answer.

Also, is there a way to run lua functions from the server without adding them in as commands. The Lua command line allows me to do it seemingly as a client, rather than the server.

cobalt steeple
cobalt steeple
knotty sandal
#

NPCs used to be a thing, and I think they’re still there somewhere in the game’s files

cobalt steeple
#

I don't think that NPC's would work anywhere based on any code left in the base game tbf

knotty sandal
#

Well yeah it does a lot of other things I’m sure

knotty sandal
atomic stream
cobalt steeple
knotty sandal
cobalt steeple
cobalt steeple
knotty sandal
#

The hard part really is getting the thing into the game

#

And now with multiplayer, having its state replicate properly

cobalt steeple
#

Pretty much. With MP it scares me in all honesty

knotty sandal
#

As it should

cobalt steeple
#

But it shouldn't take more than a year to develop... I suppose

#

I know very well AI is difficult to code so i have no expectations in all reality

fleet smelt
knotty sandal
#

It seems that what took the devs so long to figure out for multiplayer was making the zombies replicate

#

Once they add an animal, no matter what it is, we’ve got a foot in the door and we can go crazy with it

cobalt steeple
fleet smelt
#

It's not even the MP side of things, there's no useful documentation for any of it (that I can find).

knotty sandal
#

There’s documentation, but it’s all pretty vague

fleet smelt
#

One thing having a list of all Java class items, then learning the way around the janky interaction between lua and java. But there seems to be duplicates of stuff.

cobalt steeple
#

I assume yeah- Taking code from Java and translating it into LUA isn't the easiest thing to do

fleet smelt
#

Seems simple enough to access the classes just class:class:class:whatever

#

Easy enough to iterate and convert that info into lua tables

#

What isn't easy enough to do is run functions from the server's perspective

cobalt steeple
#

I don't think converting from Java is easy enough in my personal opinion

atomic stream
cobalt steeple
#

Though having a single frame of animation should work as well

fleet smelt
#

each client should only have access to limited data about the other clients;
server should have access to all, but I can't seem to run functions that use this from the server's perspective.

#

just a nightmare, and maybe it's just my lack of knowledge, but yeah. need documentation. Why I can't run functions from the server's command line, I have no idea, yet I can run functions from the lua command box in game.

cobalt steeple
#

I cannot help you too much but ill try my best

Client-side of course means things that should, in theory, only affect you and stuff

But the fact that you can't run, as a host, a command to effect the entire server is a little strange

fleet smelt
#

Yeah. Client side I can know my own x,y,z. Server should know everyone's x,y,z. But when hosting (through in game) and inviting people, those commands do not allow me to access players other than ID 0; implying the lua commands are being sent on a clientside basis

#

swapping to my dedicated server, can't run functions because they're not recognised commands. despite the very same lines working fine through the lua command box.

#

It seems unnecessarily convoluted. And no amount of googling helps find answers.

atomic stream
cobalt steeple
shadow tide
#

Is there a way to make an item give you lower attack speed for a short amount of time

cobalt steeple
#

Editing the value for attack speed

#

And giving it a timer

drifting ore
#

I was working on an animal mod but got bored

fleet smelt
#

^

cobalt steeple
#

lol

fleet smelt
#

not an animal mod lol

#

count ticks, set attack speed to x at tick 0 (or record the tick when the item was used) (I assume there is some sort of tick system in the game...), set attack speed back to y at tick 0+n

cobalt steeple
drifting ore
#

im pretty sure there's a mod that adds timers that you can use

#

probably easier than counting ticks

#

although I guess you should probably use the ingame time

cobalt steeple
#

Function LowerSpeedAtk
Lower the speed
wait
restore to default
end

fleet smelt
#

counting ticks, or in game time difference, should literally be as easy as print("Hey World!")

drifting ore
fleet smelt
#

wait might hang the script

drifting ore
#

you need to count every 10 minutes

cobalt steeple
drifting ore
#

you'd wanna hook in one of these

cobalt steeple
#

I saw that Dreams did time-related coding so if you need a mod that works with time I suppose you can look in there idk

cobalt steeple
fleet smelt
#

or see how getTime() works. 🙂

knotty sandal
knotty sandal
shadow tide
#

actually yeah that would work

knotty sandal
#

That should be pretty easy to do

shadow tide
#

i dont know the command for it tho, im pretty new to this stuff

knotty sandal
#

I don’t do modding at all, sorry for the lack of a specific solution

shadow tide
#

man its all good

fleet smelt
brittle jewel
# fleet smelt Sadly not something I can test with one copy of the game 😦

Late, but you actually can launch more than 1 instance. You just need to change '-Dzomboid.steam=1' to '-Dzomboid.steam=0' in the bat files that launch the game/server:

\steamapps\common\ProjectZomboid\ProjectZomboid64.bat
\steamapps\common\Project Zomboid Dedicated Server\StartServer64.bat

After you make these 2 changes, you can launch as many instances of zomboid as you want with ProjectZomboid64.bat and join your server (or any non steam servers available.)

fleet smelt
#

Thanks Nater, that'll be very helpful

atomic stream
weary kernel
#

Hey, does anyone have an idea why this seems so blurry?

cobalt steeple
#

It doesn't look too blurry, but it may be due to the sprites themselves being blurry

#

Are they modded or base-game

weary kernel
#

the 2 sprites above are base game

#

the gameboy is modded

#

i made it

#

but it isnt as krisp as the other ones

cobalt steeple
#

That is the sprite issue then

#

You need to edit the sprite

#

I can help if you don't know how to do that

weary kernel
#

i know how to edit but i dont know what to change

cobalt steeple
#

You need to get the image to look sharper-

weary kernel
#

how though. its self made so its very sharp when i open it in photoshop

shadow tide
#

how small is the sprite

midnight abyss
#

32x32

weary kernel
#

32x32

shadow tide
#

ight thats right

#

idk what the issue is, maybe darken the lines a bit

weary kernel
#

ok i think i found the issue

#

i had rgb-color chosen but i need to choose indexed colors

vast saddle
#

Can someone give me id of some armour from brittas pack

#

We haven't seen it so I one to spawn some to test is it even working on server

old blade
#

@weary kernel did you take an image and shrink it down in photoshop?

#

if you want smth to look pixely after transforming it in photoshop, make sure you select the Nearest Neighbor option

weary kernel
#

No the Texture is self painted

old blade
#

photoshop automatically applies-

#

ah ok

#

yeah then idk thats weird

weary kernel
#

But the indexed color fixed it

old blade
#

o rlly?

weary kernel
#

Yes

old blade
#

i would have never thought that

weary kernel
#

It looks sharp now

old blade
#

thats weird

#

i wonder why it acted like that

weary kernel
#

I took another mods texture as reference and looked what was different from mine

#

And indexed color it was

old blade
#

thats good to know

weary kernel
#

Yes

#

I haven’t found anything on indie stone forum xD

#

So probably not many people know

fleet smelt
#
function whattime()
    -- getTimeOfDay() returns HH.PH where PH is percentage of an hour. Instead of 12:30 meaning half past twelve, it will display 12.5.
    -- We split the HH from the part after the decimal, then multiply 60 by the part after the decimal to give us the minutes.
    local hh, ph = math.modf(getGameTime():getTimeOfDay())
    print(string.format("%02d:%02d",hh,60*ph))
end

This is how I'd skin the cat, which probably isn't the best way.

#

modf splits the integer from the fraction (which I crudely refer to as the number after the decimal)

#

In a perfect world, for what you're doing, I'd just compare gameticks, but I'm not sure where to find that :^)

atomic stream
#

I just checked Authentic Animations and True Actions mods. They both have tons of animations with xml extension

#

I'll check what coding is included

median salmon
#

Hey guys I'm having some trouble adding my own TRUE MUSIC mod, they say I use a custom template, which I have, but I'm completely at a loss as to what I do next to get my own version of it on the workshop, has anyone done this before?

Heres the template they say to use but I don't even know how to upload this to the steam workshop when ive added my new music.
https://drive.google.com/file/d/1PcSW4bwOe0iyJREadgOyrms0zkpHcIOe/view

old blade
#

i wish you could just replace the soundtrack instead of add music into the gameworld

#

i would want a more sinister STALKER esque soundtrack

#

oh, dude you know what would be cool is being able to add and control a color filter on your game

#

so you could make it darker or more bleak

#

i mean, i could probably achieve it with sweetfx or something but thats not the same

abstract raptor
#

Hey hey.

old blade
#

you could add stuff like an animated film grain, or maybe even a tv filter kinda like hotline miami 2 does it

#

depth of field would be cool but im not sure how that would even translate into the game

abstract raptor
#

So I need a mod. I'll throw down $100 to anyone who makes it but essentially I just need a way for admins to place down any tile that exists in game including ones from modded texture packs. This would be extremely useful for servers that wanted more control over being able to build

#

I think there might be a way to do it with the tiles picker

old blade
#

youre godsent ive been wanting something like that

abstract raptor
#

But unsure.