#mod_development

1 messages ยท Page 28 of 1

clever totem
#

I also made sure to change it back to normal

hearty dew
#

Oh, yes. Good

clever totem
#

Ay let's go!

#

Thanks mate!

ancient grail
#

saw wthis before when i was also making a clothing mod but it was basically a retexture of a vanila thing if i remember correctly....

#

maybe you have donesomething wrong with the xml

clever totem
#

yeah it's already fixed!

#

and yes it was something wrong with XML

ancient grail
#

ow ok cool

clever totem
#

thank you anyway tho!

hollow current
#

Any idea what may cause this issue? I've been at it for hours and still can't figure it out

#

tldr; mod works fine in hosted and sp but on dedicated server, it refuses to be enabled and gets replaced by a blank mod called "url". Also mods after it don't load

hearty dew
#

The Mods= line is modified in the config file to have a mod id url in place of your mod's id?

#

One comment mentioned mod manager. Does this happen without the mod manager mod loaded?

hollow current
#

idk honestly I can't test it myself on a mp dedicated server which poses an issue at debugging it

#

I am trying rn to run a dedicated server locally to be able to test it

hearty dew
#

Can you download the dedicated server and try running it with the mod enabled to see if it happens? Don't have to connect to it presumably (going from those comments)

#

But that way, you'd have a log file to see if there are any errors

hollow current
#

um how exactly can I load the mod into the dedicated server? can't see a file to load in the mod anywhere

hearty dew
#

The bat files pass a flag to the exe that specifies which server config file to use (by default I think it is servertest.ini).

#

And those ini files are in ~/Zomboid/Saves/Multipler if I remember right

#

That said, you can modify those config files via the normal client pz exe. Main menu -> host -> something about edit config

hollow current
#

interesting, gonna try that

#

Host tab shows the settings of "servertest" only, which is a hosted server

@setlocal enableextensions
@cd /d "%~dp0"
SET PZ_CLASSPATH=java/istack-commons-runtime.jar;java/jassimp.jar;java/javacord-2.0.17-shaded.jar;java/javax.activation-api.jar;java/jaxb-api.jar;java/jaxb-runtime.jar;java/lwjgl.jar;java/lwjgl-natives-windows.jar;java/lwjgl-glfw.jar;java/lwjgl-glfw-natives-windows.jar;java/lwjgl-jemalloc.jar;java/lwjgl-jemalloc-natives-windows.jar;java/lwjgl-opengl.jar;java/lwjgl-opengl-natives-windows.jar;java/lwjgl_util.jar;java/sqlite-jdbc-3.27.2.1.jar;java/trove-3.0.3.jar;java/uncommons-maths-1.2.3.jar;java/commons-compress-1.18.jar;java/
".\jre64\bin\java.exe" -Djava.awt.headless=true -Dzomboid.steam=1 -Dzomboid.znetlog=1 -XX:+UseZGC -XX:-CreateCoredumpOnCrash -XX:-OmitStackTraceInFastThrow -Xms16g -Xmx16g -Djava.library.path=natives/;natives/win64/;. -cp %PZ_CLASSPATH% zombie.network.GameServer -statistic 0 %1 %2
PAUSE

Those are the contents of the bat file

#

I assume the first folder would be the one relevant to editing the server's config?

hearty dew
#

sorry, it is ~/Zomboid/Server

hollow current
#

There we go

hearty dew
hollow current
#

I see. But currently it should be loading the mod fine anyways, right?

#

btw, after launching the bat, how can I exactly connect to the server itself? I am entering my public IP address and the port, 16261, does seem like the server is responding

hollow current
hearty dew
hollow current
#

no luck, doesn't work in local ip either

hearty dew
hollow current
#

do i need to configure the ports from the router to be able to connect locally?

hearty dew
#

not if you use 127.0.0.1

#

and you don't have a crazy firewall running locally on your machine ๐Ÿ˜…

hollow current
#

oh there we go it just started working now

hearty dew
#

Might have not finished initializing the world

hollow current
#

I think I might have mistakenly edited the vanilla vehicle items file while modding ๐Ÿ˜‚

hearty dew
#

You can disable file version checks in the config

#

There's a section with cheat detection, I forget exactly what term they use

hollow current
#

oh lovely, lemme try that

#
DoLuaChecksum=true```
hearty dew
#

would need to restart the server after changing it, I presume

hollow current
#

ye

#

aand got error 10 and game crashed while trying to connect

#

i guess its a memory issue

#
# Native memory allocation (malloc) failed to allocate 434256 bytes for Chunk::new
# Possible reasons:
#   The system is out of physical RAM or swap space
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (arena.cpp:189), pid=996, tid=14436
#
# JRE version: OpenJDK Runtime Environment Zulu17.30+15-CA (17.0.1+12) (build 17.0.1+12-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu17.30+15-CA (17.0.1+12-LTS, mixed mode, sharing, tiered, compressed class ptrs, z gc, windows-amd64)
# CreateCoredumpOnCrash turned off, no core file dumped```
#

how do i set up how much memory i want to use for the server

hollow current
#

ah

hearty dew
#

-Xms2g -Xmx2g

hollow current
#

I assume 6 works just so that is loads faster?

#

-Xms6g -Xmx6g

hearty dew
#

yea, it should reserve less memory initially than 16

hollow current
#

lovely

hearty dew
#

one of them is max the other is initial. I forget which is which

#

I've seen people suggest 2 or 3 is enough for 1 player to join

hollow current
#

well mod seems to be working so far without any kind of issues/error

#

imma try to load some different mod with it

#

interesting

#

so,
Mods=SkillRecoveryJournal,EverythingHasAName
The latter didn't load in

#

the first, not so sure

hearty dew
#

should use ; to delimit them

#

You can modify those files via that Host button on the main menu

#

Also, there is the Mod Manager: Server mod that makes it a little easier to configure mods in those server configs

#

and change mod loading order

hollow current
#

lemme get that mod real quick

hollow current
#

like so?

hearty dew
#

believe so, yea. But you don't need to do that if you are using servertest.ini

#

oh, maybe should put it before -statistic

#

that 0 might be a parameter to -statistic

hollow current
#

okay so its just like the comment said

#

I loaded in my mod first

#

then AutoMechanics as an example

hearty dew
#

And what shows up in the vanilla server configurator?

#

(wondering if it's an issue in Mod Manager: Server but not the vanilla server configurator

hollow current
#

I may have a hunch about what's causing it

#
poster=poster.png
id=EverythingHasAName
description=A mod to rename anything
url=https://steamcommunity.com/sharedfiles/filedetails/?id=2867163008```
#

could be the url= line or is it unrelated?

hollow current
#

oh

#

ye, one min

hearty dew
#

that url does have a query parameter id

#

Whatever is parsing it might be parsing that incorrectly

hollow current
#

get f'ed at the vanilla thingy as well

hearty dew
#

Weird. Might be a bug in pz's mod.info parser

hollow current
#

Lemme try changing the url and see if that does it

signal ibex
#

Looks like that yeah

hollow current
#

ye, that was definitely the issue

#

Thanks so much for the time! Got a question though, how do you configure the spawn place/chance of a custom item?

hearty dew
#

There are a number of global objects that control loot percentages and where/what spawns what items. $ find ProjectZomboid/media/lua -iname '*distribut*' ProjectZomboid/media/lua/server/Items/Distributions.lua ProjectZomboid/media/lua/server/Items/ProceduralDistributions.lua ProjectZomboid/media/lua/server/Items/SuburbsDistributions.lua ProjectZomboid/media/lua/server/Vehicles/VehicleDistributions.lua

$ find ProjectZomboid/media/lua -iname '*attachedw*'
ProjectZomboid/media/lua/shared/Definitions/AttachedWeaponDefinitions.lua
ProjectZomboid/media/lua/shared/NPCs/ZombiesZoneDefinition.lua```
There might be some others
#

Seems like containers can have a set of named categories of loot they can drop, then each category has a set of items with percentages. I haven't dug too far into it

#

If I were trying to add a custom item, I'd look at how some other mod is modifying those tables

#

Oh, also, in debug mode, under the cheats list, there is LootZed. If you check that, you can right-click containers in the inventory pane to see the loot tables

hollow current
#

Alright, thank you so much! Really appreciate it

neon bronze
#

Hey, anyone knows where all the AnimNodes stored for recipes or where i could find them?

gilded hawk
#

DId anyone find a way to unit test lua files for zomboid mods? ๐Ÿค”

vague raven
#

@autumn garnet Hey, sorry for ping. Do you know why 10 years later's veg settings are only applying to some chunks and not others? Maybe it's a mod conflict? https://i.imgur.com/DZ1FHJx.jpeg

autumn garnet
#

No , isn't that ^^'

ancient grail
#

hi i wanted to add somefunction on the miniscoreboard

#

without messing up the vanila

#

how do i do that?

#

can i just copy the same function on a diffrent lua and it will work?

fossil parcel
#

Hello everyone. I made my very first clothing mod but the texture just disappears after a while, cleaning and fixing the item doesn't solve it. What could be the possible cause and how would one go about fixing this problem?

ancient grail
fossil parcel
#

I received a comment on my workshop page that one of my subscribers was having this problem, I checked it out on my end and they were right. Seems like it's a problem with my mod.

winter bolt
#

does your clothing item use decals or something?

fossil parcel
#

it only uses those two textures. Sorry if this isn't what you were asking about, I'm completely new to this

#

Can I post the mod file here or is it a no-no on this server?

merry quail
#

If the author updates the mod, will my edits in that mod be lost?

hidden estuary
#

how can I fight the god awful balance dillema where making a trait that requires medication becomes a non-issue from a single visit to your local pharmacy?

#

any ideas or am I just gonna have to deal with it?

#

its not really unrealistic but considering its a pricy trait its sort of supposed to be challenging, playtesting however just dives into "you have 5 days to head to a pharmacy" and boom, good for.. months

#

I tried to nerf that medication to the ground, like 5 uses per box, still ridiculously easy to get set up

#

realistically its a very common medication so I can't exactly make it like its some military grade stuff

#

I tried to add rarer variants for long-term, but literally the box of meds becomes the long term when you head to pharmacy and get a dozen

hidden estuary
#

? I'm making a trait mod that requires medication, similar to smoker requiring cigarettes

#

I played around various, various numbers, both to how many uses should the item hold and how easily can you find it

#

point being: its literally as easy to find as vitamins, irl

#

thats how common this medication is irl, so

#

making it a one of a kind medication

#

is sort of going against the game's realism

#

for the sake of balance

#

hormones

#

nowadays, yes

#

1993 was different

#

I totally didnt look up everything about it trust me

#

me trying to find pregnant horse urine alternative in a game without horses

#

I tried really hard, its.. really impossible to balance this

#

I tried to make it very rare, but obviously each box has to at least contain a substantial amount, its the whole point of quality over quantity

#

literally boiled down to a visit to the pharmacy getting you 3 boxes which is still a very long time of supplies

#

vs. finding none cause funny rolls and having to desperately loot other places

#

I'm against doing that one cause I want the realistic idea that you will run out of this medication and you will have to resort to natural resources for it

#

the problem is that, yeah, you're good for life when you loot all pharmacies on the map

#

and the same kind of holds true for this medication

#

rare or not

#

like, medication by itself is already flawed

#

in this game

#

cause one visit to the pharmacy and you're good, you're just good

#

so this trait is meant to be a big deal, but it still falls into the same issue that every other medication falls into

#

hoarding too op

#

I dont think I can do that

#

can I? I'm using loot tables, loot tables arent exactly "per building"

#

they're per storage and per rolls

#

but then I run into the issue of them finding none

#

and poof, run's over

#

I know this cause I added injections as a long-term much rarer resource

#

they

#

"sorta do"

#

depends on the progress, actually

#

in version 1 I'm aiming mainly for post-op, fully transitioned individual

#

this means medication is a live or die scenario

shadow geyser
hidden estuary
#

its a little deeper than that

#

your body sort of

#

needs hormones

#

to function

#

like it needs u know, oxygen, but on a much lesser extent

#

yes hence, post-op

#

this is gone.

#

this is no longer reliable or damaged

#

its like, the whole deal, you take hormones for life because if you stop they're not gonna

#

replace those

#

the body eventually just stops caring and doing that for you

#

point being: its meant to be a crippling trait if you dont take medication

#

similar to smoker but on a deeper level than just

#

"find cigarettes, smoke 4 times a day"

#

but because its medication its just a crushing defeat of balancing it properly

#

any iteration of it just... doesnt really work at keeping the stakes high

#

hoarding the local pharmacy is too op

#

I did run all the tests, I even tried the "individual pills"

#

it basically defaults to winning a lottery the moment you find a box or a needle

#

and ur good for a very long time gameplay wise

shadow geyser
#

if the issues is that there are items that you luck out on and get a box of 10, just remove the boxs

hidden estuary
#

even non-boxes

shadow geyser
#

and put individual doses with a very low rate

hidden estuary
#

I already nerfed said medication a TON, like, a ton ton, for the sake of the downsides to actually be present, downsides such as chemical imbalance, etc etc

shadow geyser
#

wydm, then just lower the chances, you can easily just count the number of containers, then calculate the chance so that the expected number of doses in a pharmacy is 1

drifting ore
hidden estuary
#

unless I make it like, pills only, individual ones

shadow geyser
#

so if there is one dose, the player is set for the rest of the game?

hidden estuary
#

but if I'm doing that, at that point, I'm going a tad too far

#

its more like

#

well I tried several numbers, but for example, you die in 5 days

#

which... heavy fucking nerf there

#

you start getting downsides in half that time

shadow geyser
#

well, this is just an idea. you can balance it in a way, that from looting houses, you are able to find what you need to sustain yourself after looting say a neighbourhood

hidden estuary
#

you go to the pharmacy you get 1 box, 1 single box

#

I can nerf it to have like, 5 uses, also a huge nerf to the actual thing

#

it does not matter

shadow geyser
#

pharmacies aren't a way to get alot of them, its how you guaranteed get that one does you need when you are running low

hidden estuary
#

you have just quintupled your lifespan

#

which if you really minmax, which any person would in the apocalypse

#

you have 15 days

drifting ore
#

Make it to where you have to cook like Walter white

hidden estuary
#

min

#

and 15 days in zomboid

#

its a LOT

#

so see?

#

nerfing everything to the ground

shadow geyser
#

15 days is nothing

hidden estuary
#

still does not matter

#

xD

shadow geyser
#

like what?

hidden estuary
#

I meant its a lot in like

#

you have literally 15 days to find more of the medication

#

you add it as a side-quest, basically

#

you dont worry about it

#

the downside becomes non-existent or not present

#

thats the nerfed example I used

shadow geyser
#

well, the way I see it, you don't want the PZ game to be entirely about just finding the med

hidden estuary
#

ยฌยฌ

#

the first iteration, which tackled into realism

#

welp

#

13 boxes of 10 uses each

#

from a trip to louisville's pharmacy

drifting ore
hidden estuary
shadow geyser
#

it should be ok to be able to get lucky, and not need to spend 24/7/365 finding the next dose they need

hidden estuary
#

then I nerfed it to be a little rarer like antibiotics

shadow geyser
#

otherwise how will they ever find the time to play with trapping, or actually play the game

hidden estuary
#

still gave me a substantial kick in supplies to a point I wouldnt need to worry about it

#

I added injections, injections with vanilla statistics are just insane, you find 1 and you're good for a month, in real life

#

I nerfed it to a week

#

and its still like winning a lottery

#

you jab that up and done

#

you no longer worry about this

shadow geyser
#

like if you make it so rare and necessary, noone will ever be able to make their own base, because they will be too busy looking for their next dose, that they can't train carpentry

hidden estuary
#

and I did make it insanely rare

#

it did not matter

shadow geyser
hidden estuary
#

you find 1? you're the lucky oneee

#

actually I did do my research, we used to overkill back in the day

#

hilariously I even made the medication look like its 90s equivalent

#

ugh

#

they dont "die" die

#

but its so many downsides

#

that gradually build-up

#

your character's death is certain

#

for sure

#

so you dont DIE die, but you die

#

yes and if I make an expensive trait which's main purpose is to be crippling IF you go several months without medication

#

thats not really good is it?

#

not a good idea

#

so I've already twisted realism

#

a LOT for the sake of balance

#

and even then

#

even with the "You basically die in 5 days"

#

you still win a lottery

#

at your local clinic

#

now that you brought it up

#

I actually think I tried one time with only 2 uses per box

#

and still broken

#

xD

#

its what I said

#

hoarding too good

bronze yoke
#

if you want it to be both expensive and you want to make the medication common, you could make the medication only lessen the negative effects, or have side effects of its own

hidden estuary
#

what am I supposed to do about that

bronze yoke
#

otherwise, 'easily mitigated' and 'worth a lot of points' are just at odds with each other

hidden estuary
#

so I can stick with it

#

and I got stuck trying and trying and playtesting change after change

gilded hawk
#

Did it happen to anyone that their clothing modded items would randomly appear on zombies?

hidden estuary
#

I also tried essentially every location

#

I even remember one unlucky run where I nerfed it so much I couldn't find anything in the clinic at muldraugh

#

yes darling, I have felt it

shadow geyser
hidden estuary
#

and boy is chemical imbalance a SPECIAL type of pain

#

again, did happen, and even if I sticked with further than 2 weeks I'm making a trait that basically never comes into play

hidden estuary
#

because its getting a tad ridiculous and disrespectful

#

you said it yourself

#

"are you implying trans people die in a week without hormones"

#

like

#

I'm already shifting the best I can and I did this

#

trying to find a line

#

where hoarding wouldnt be op

#

and I did not find a solution

#

thats the whole reason I brought this up

shadow geyser
#

this conversation is getting a bit heated considering this started with a question about loot balance

hidden estuary
#

cause yeah, if there is no other solution to the hoarding problem

#

I might just have to give up and stick to realism

#

cause no amount of nerfing

#

can fix hoarding

#

usually when people make medication in this game

#

its like the cure, or something extremely technical that you need to do a lot of build up for

bronze yoke
#

is there a reason you don't want to just make the trait cheaper?

hidden estuary
#

like, ok, little background: this idea of a mod started based on the golden question that every trans person asks at least once as a boring thought; "how long can they last in an apocalypse without supply of medication"

#

because they need lifetime supply

#

so it started as an idea that this would be an actual negative thing on your character to have, you would have to worry about this specific supply

#

which isnt even that "trans" cause elders often need hormones just the same

#

but the point being, if I make it basically non-existent of an issue

#

then its really just, smoker but slower

#

cant do that without first setting up the foundation, can I?

#

now do that but for the 90s

#

vastly depends

#

but thats not the point

#

if there's no other solution to the hoarding problem, then yeah I'm gonna have to just lower my expectations and address the medication as is

#

cause no amount of nerfing has done justice to this problem

hollow current
#

quick question, what's the right way to loop through a list returned from

local jumpstarters = invent:getItemsFromType("Jumpstarter")``` to do something like
```lua
local jumpstarter_item
for jumpstarter in jumpstarters do
  if jumpstarter:getUsedDelta() > 0 then
    jumpstarter_item = jumpstarter
    return
  end
end```
I still do not have a full grip over looping through lists in lua
shadow geyser
hidden estuary
#

like, put 2 people with this trait in the same area

#

I now divided that supply in half

#

put this on a multiplayer server

shadow geyser
#

exactly, just like reality and all other resources in this game

hidden estuary
#

we have a bigger problem

shadow geyser
#

if there are 2 people in a town, you need to fight for food

hidden estuary
#

put this on a server that runs time faster

#

I know that

#

I'm explaining how

#

making something only considering 1 playstyle and this playstyle being vanilla solo, in zomboid of all god damn games? where everyone plays mods and often plays with friends too?

#

like, good job for me, but I'm making this for the 5%, essentially

#

good girl medal but for what purpose

shadow geyser
#

so basically, you just need to make a sandbox option that lets you modify the spawn rate

#

problem solved

hidden estuary
#

I'll go back to the drawing board, I only brought this up cause I wanted to see if there's one magical solution to hoarding that I had yet to try

shadow geyser
#

that way if someone knows they are going to play with 15 people on a server, they just increase the spawn rate

hidden estuary
#

it broke balance no matter what I did

#

you do bring up a point

#

fair

shadow geyser
# hidden estuary it broke balance no matter what I did

well, the thing is,that is just patently untrue. if you had set the rate to zero, it would have been too hard. you said earlier you tried with 2 in a box and that was too easy. there is a number somewhere inbetween 0 and two which can probably satisfy your desires for the balance

hidden estuary
#

dysphoria is gonna be a rat's nest that I'm not diving into yet

#

I'd rather focus on making hormone treatment replaceable years into the run

#

literally every outfit in this game

#

has 0 fucks about gender

#

not even amounting to modded outfits

#

I'd have to change every single piece of clothing in this god damn game

#

somehow account for clothes in other mods

#

yes I know

#

but this is like

#

to even start this conversation

#

thats just.. the usual downsides

#

it doesnt have to be its own thing

#

thats.. the point

#

I have yet to code the moodle but it has essentially 5 stages

#

of gradual build-up into downsides

#

similar to smoker building up stress

#

because its literally part of the balance of it

#

its as simple as that

bronze yoke
#

if there's going to be multiple systems, balancing one system won't balance the whole, and the other systems will affect each other's balance

hidden estuary
#

how detrimental it is, and how hard is it to prevent it

#

I KNOW this

#

thats why I started this convo, cause it didnt matter how much I changed the systems, hoarding would break balance no matter what

shadow geyser
#

ok wait

#

you don't want it to be possible to hoard it

hidden estuary
#

by hoarding I mean

#

"going to a pharmacy"

#

u know

#

cleaning the place dry

shadow geyser
hidden estuary
#

and then put it where?

#

its a normal ass medication, they give them out like vitamins

#

zombies makes this renewable and as I said I'm not looking into that too much

shadow geyser
#

figure out, what is the proportion of the population that is transgender. lets say it is 1 in 100

hidden estuary
#

I want medication to run out

#

and for the players to have to find alternative ways

#

of circumventing downsides

shadow geyser
#

then make a rate so that 1 in 100 houses has a couple doses

hidden estuary
#

for long term

hollow current
bronze yoke
#

i think it goes like this

for i = 0, jumpstarters:size()-1 do
    local jumpstarter = jumpstarters:get(i)
    -- do your stuff
end
shadow geyser
boreal crow
#

Ask people nicely not to hoard, of course! That'll work ๐Ÿ˜›

hidden estuary
#

with that out of the way tho, so how about that double jump

weak sierra
#

it depends on if it's a java arraylist or if it's a lua table

#

pairs/ipairs only works on lua tables

#

for java arraylists you must do what albion said above

hollow current
#

lemme print jumpstarters only

weak sierra
#

unless u write extensions for it ofc

#

some ppl do that

hollow current
#

Is that an array list?

weak sierra
#

that's individual items

hidden estuary
#

oh yeah I even tried to make a god damn magazine

weak sierra
#

or wait

hidden estuary
#

that you have to find and read

weak sierra
#

two items

hidden estuary
#

to properly take the medication

hollow current
#

yes

weak sierra
#

in a square bracket

hidden estuary
#

and it still did not matter for balance

weak sierra
#

i don't rightly know

#

try using for _,jumpstarter in pairs(jumpstarters) do --[[stuff]] end

#

and if it fails

#

do what albion did

#

you could find out by printing the type

#

but

#

it's about as fast to just try

#

to do that though you can do print(tostring(type(<whateverYourCollection>)))

#

it'll say java.arrayList

#

or smth

#

if it's one of those

hollow current
#

Got it, thanks so much!

shadow geyser
#

it is an arraylist

#

and if it isn't a java function, I think 99% of the time it will be a lua table

weak sierra
#

ah yeah i meant to say something about that too

#

forgot

#

curious if one cane instantiate an arraylist tho there's reasons one might wanna use that instead of tables

#

being able to just do :contains is pretty nice

#

lol

#

without having to loop thru

shadow geyser
#

yeah, you can. i've definitely seen it in a mod before

weak sierra
#

im unsure of what kind of syntax since lua has no notion of instantiation really

shadow geyser
#

can't really remember the syntax right now though. i've never needed to personally use it though since I've never had the need to do so

weak sierra
#

ive done things where im looping through hundreds of entries where it'd be better if i used an arraylist

#

lol

#

or i've used awkward tables

#

defined like

#

table = {}

#

table["thing"] = true

#

if table["thing"] == true then

#

to test for membership

#

in a list

#

works but awkward

shadow geyser
boreal crow
#
--***********************************************************
--**                    THE INDIE STONE                    **
--***********************************************************

if isClient() then return end

local VehicleCommands = {}
local Commands = {}

....

function Commands.hotwireEngine(player, args)
..... etc

I want to override various functions within this table, but it's local - so does that mean I can't override?

shadow geyser
#

from vanilla. it seems like they do it here and there to contain other java objects

weak sierra
#

ah ArrayList.new() then

#

thanks

weak sierra
#

if u wanna do it

#

i hate when people use local functions

#

im not sure if there is a metatable approach to bypassing that restriction

boreal crow
#

Yeah right now I am overriding the entire file but that makes issues for other mods I imagine

meager lion
#

You could do it a bit hacky from the looks of that, the funcions are visible but the array isnt

weak sierra
#

just make your mod load real high in the load order

#

so that anything that does anything happens after u

#

but

#

that said, any other mod modifyin the stuff would have to do the same thing

#

unless there's non-local stuff in there to mess with

boreal crow
#

the functions themselves don't seem to be local, but the table is

weak sierra
#

but if the table is then u can't get to it still from outside no?

shadow geyser
weak sierra
#

im not sure

meager lion
#

You could make your own table to replace it then i would assume

weak sierra
#

i was assuming it wasn't but i guess i shouldnt

shadow geyser
#

if you just want to add an additional thing to happen, you can add a new onclientcommand that will react to the command as well.

meager lion
#

Random thought, does anyone know of any means to hook into the discord bot?

boreal crow
#

this is all lua/server/vehicles/VehicleCommands.lua the one that gets missed by capsid for whatever reason

shadow geyser
#

however if you want to prevent something that is happening in that code, you will need to either manually edit it out through code from the event handler, or overwrite the file

boreal crow
#

because I am changing their math

shadow geyser
#

could you retroactively do it by having another function in the event handler essentially fix it? that could also be a solution

#

hard to really give a good suggestion for another method without knowing exactly what you are trying to do, but that could be something you look into

hollow current
# shadow geyser

Got it handled, thanks so much!
One more question (hopefully the last for this whole mod lol)
How do I make the character equip an item?

boreal crow
#

That is my mod, as it is, it works - but I currently just entirely override the lua file

bronze yoke
hollow current
#

equip in hands

#

not necessarily visually

#

just to be equipped in primary code-wise

#

or secondary/both hands

shadow geyser
#

but you need to also unequip if they already had something

#

take a look at ISEquipWeaponAction.lua. You can look to see how it is done in lua, or you can just add an ISEquipWeaponAction to the queue to make your player actually equip the item

gilded hawk
#

How the hell is the game replacing the zombie items with my own iteeeeeeeeeeems????

I don't even have code that adds my items to the zombie pool WTF

shadow geyser
#

can you show the script of the item

gilded hawk
# shadow geyser can you show the script of the item
/* Thank you to OliPro for allowing me to base this code of his work */
module TransmogV2 {
    imports { Base }

        [Truncatedhere]
        item Hide_MxBaseShoes_TrainerTINT
        {
            DisplayCategory = Transmog,
            Type = Clothing,
            DisplayName = Cosmetic Sneakers,
            ClothingItem = Shoes_TrainerTINT,
            BodyLocation = Transmog_Shoes,
            Icon = NoseRing_Gold,
            Weight = 0,
            Cosmetic = TRUE,
        }
        [Truncatedhere]

        item Hide_Scarf
        {
            Type = Clothing,
            Cosmetic = TRUE,
            DisplayName = Hide Scarf,
            DisplayCategory = Clothing,
            ClothingItem = Belt,
            BodyLocation = Hide_Scarf,
            Icon = NoseRing_Gold,
            Weight = 0,
        }


}

Truncated version

shadow geyser
#

it will be added to be able to show on a zombie automaticcaly

gilded hawk
#

dafaq

shadow geyser
#

yep

gilded hawk
#

And How am I supposed to add a new clothing without it being added to the zombies

shadow geyser
#

or wait let me double check

#

I just remember having a similiar item that did that

hollow current
#

so it should be like

function BatteryJumpstarter_GeneratorTimedAction:waitToStart() -- Wait until return false
    self.character:faceThisObject(self.generator)
    ISTimedActionQueue.add(ISEquipWeaponAction:new(playerObj, item, 10, primary))
    return self.character:shouldBeTurning()
end```?
#

oh hold up that's wait until return false

shadow geyser
hollow current
#
function BatteryJumpstarter.onJumpstarterRecharge(worldobjects, generator, player, item, remainingUses, fuel)
    local playerObj = getSpecificPlayer(player);
    if luautils.walkAdj(playerObj, generator:getSquare()) then
        ISTimedActionQueue.add(ISEquipWeaponAction:new(playerObj, item, 10, primary))
        for i=1,5-math.floor(remainingUses) do
            ISTimedActionQueue.add(BatteryJumpstarter_GeneratorTimedAction:new(playerObj, generator, item, remainingUses))
        end
    end
end```
gilded hawk
hollow current
#

something like this?

meager lion
#

the Tags are nice for the end user though ๐Ÿ˜› (Personal gipe about hydrocraft)

shadow geyser
#

the body location tag is the one that tells the game where it can be worn anyways

gilded hawk
shadow geyser
gilded hawk
#

Oh goddamit ๐Ÿ˜ฆ

bronze yoke
#

yeah i can't find the exact file but it looks like items are added to outfits based on their xml, not their script

gilded hawk
#

This is a massive problem for my transmog mod

gilded hawk
#

I guess I'll improvise

shadow geyser
gilded hawk
#

It has to be dynamic

#

That's why I generate the items.txt on the fly

shadow geyser
#

can't you just generate them the same time you generate the items.txt?

#

you only need a copy of every vanilla model you are trying to use

gilded hawk
shadow geyser
#

isn't it just read this file, and print into another?

#

with a different name

gilded hawk
#

it's not that straight forward in lua

hollow current
#

can I make the item "inherit" the spawn behavior of another item? Looking at the way I am supposed to set it up, I think I have to define every container the item can spawn in. What if, for example, I want to make its spawn behave the same way as the item "Car Battery Charge", but just modify the spawn chance?

boreal crow
#
module MSGTweaks
{
    imports {
        Base
    }

    recipe Weld into Metal Plates
    {
        BlowTorch=5,
        keep [Recipe.GetItemTypes.WeldingMask],
        [MSGTweaks_RecipeCodes.GetItemTypes.ConvertsToMetal],

        Result:SheetMetal,
        Time:500.0,
        RemoveResultItem:true,
        AllowDestroyedItem:true,
        Category:Welding,
        SkillRequired:MetalWelding=4,
        OnCreate:MSGTweaks_RecipeCodes.OnCreate.ConvertToMetal,
        OnGiveXP:MSGTweaks_RecipeCodes.OnGiveXP.ConvertingToMetal,
        NeedToBeLearn:false,
        Sound:Blowtorch,
        AnimNode:BlowTorchFloor,
        Prop1:Source=1,
    }

}```

How can I find valid sounds? I found what I thought was a valid sound "Blowtorch" but it doesn't play any sound
shadow geyser
fossil parcel
#

Workshop link for those super paranoid about viruses

calm acorn
#

what do you use to convert to .x format?

fossil parcel
#

is this, bad?

calm acorn
#

no clue, i been looking around for a app that does the conversion too/from .x and found one that i had to enter a bunch of bible quotes in to use

#

op nm this is the one, eh i was hoping i could just install a blender plugin

#

You can also just add the mod as a requirement and then call it directly with out a pinkslip

sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van" } )
sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van", condition = 100} )
sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van", condition = 100, gastank = 100  } )
sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van", condition = 100, gastank = 100, fueltank = 100  } )
sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van", condition = 100, gastank = 100, fueltank = 100, makekey = true  } )
sendClientCommand(player, "CW", "spawnVehicle",  {type = "Base.Van", condition = 100, gastank = 100, fueltank = 100, makekey = true, upgrade = true } )
fossil parcel
#

Do you need to create a separate texture for dirty clothing or anything like that?

#

or alternatively (a lazy path of least resistance I assume) Can you disable blood and dirt effects on specific items?

hollow current
#

Any idea what's the container name for vehicle trunks?

winter bolt
#

export as .fbx instead its way easier

winter bolt
fossil parcel
#

haha, I added it in hopes of fixing it

winter bolt
#

ohh

#

i think ive found it

#

remove the BloodLocation line

#

wait no, other hats have that in the base game

#

im looking at the spiffo hat from the base game and the only thing in yours thats different is that you have the "<m_Masks>0</m_Masks>" to hide the head which you could try removing

mighty wedge
#

quick question ab weapon mods, is it possible to give guns aiming animations?

#

like when youre holding down rmb

hollow current
#

By the way, any way to know what container each "Container Name" refers to ProceduralDistributions file?

winter bolt
#

oh thats weird wtf lol

fossil parcel
#

I think I'll just start from scratch, heh. It might be unsalvagable.

#

Sometimes you just must swallow the sunk cost fallacy

winter bolt
#

i think just try remaking the scripts by copying the spiffo hat

#

the model and texture are probably fine but i'd recommend using .fbx instead of .x though

fossil parcel
#

yeh, replaced the model and texture with original spiffo ones and it's also broken

#

something's with the scripting

regal fiber
#

hi someone can give me a guide how to make custom spawns?

winter bolt
# fossil parcel

yeah just copy the spiffo script and just replace it with your stuff and see if that fixes it

clever totem
mighty wedge
#

does anyone know anything ab making custom poses for custom fireamrs?

ruby urchin
mighty wedge
#

ah ok

clever totem
dim geode
#

Think someone should do a blindness mod if it hasnโ€™t been done make it to where your footsteps illuminate a small area in front of you, and interacting with containers in your immediate vicinity requires you to move your cursor over the selected UI element

#

Any sounds from meta events might play a role in how much you see in that little instance

#

Although if you wanted to truly put it into zomboid a different framework not requiring sound for blindness would have to be implemented for the people who want to do deaf/blind runs ๐Ÿ˜‚๐Ÿคฉ

hearty dew
hearty dew
clever totem
#

It is Clothing type

#

but I couldn't find it

#

on Absurd loot mode

#

I was running through LV Mall looking for it

#

I kept on finding normal hoodies tho

winter bolt
hearty dew
#

Ah okay. That's what I had thought originally, but someone had experienced seeing their clothing item drop without adding anything via lua, so someone said it may have been due to ClothingItem in the script file

#

@clever totem So you'd probably want to insert MerchHoodieUp into some tables into the ProceduralDistributions table in ProjectZomboid/media/lua/server/Items/ProceduralDistributions.lua

clever totem
#

umm

#

yeah it was made for a streamer

#

since we're playing on his server

#

so he'd need to do it

#

I think

#

Does it spawn on zombies tho?

hearty dew
#
table.insert(ProceduralDistributions.list.BedroomDresser.items, "MerchHoodieUp")
table.insert(ProceduralDistributions.list.BedroomDresser.items, 0.5)


table.insert(ProceduralDistributions.list.ClothingStoresJumpers.items, "MerchHoodieUp")
table.insert(ProceduralDistributions.list.ClothingStoresJumpers.items, 10)

-- etc```
hearty dew
clever totem
#

oooh

hearty dew
clever totem
#

and tell him where to put it in?

#

or like replace ProceduralDistributions with mine?

#

Isn't there a way to do it in my mod files or something?

#

like other clothes modes somehow manage to do it

#

I think

hearty dew
clever totem
#

yessir

hearty dew
#

If so, you can just update it on steam, and his steam client will download the update (when pz is closed)

clever totem
#

hmmm

#

Okay hold up

#

where do i put that distributions again?

winter bolt
clever totem
hearty dew
clever totem
#

oooh

#

got it

#

Mod ID is here right?

#

like that's the one?

hearty dew
#

yea

clever totem
#

actually stupid question of course it is lmao

#

and now I put that script u sent before

#

into that and change txt to lua?

hearty dew
#

yea, that should be enough for your hoodie to show up in those areas, "BedroomDresser" and "ClothingStoresJumpers", but I imagine you might want it in more

#

also, need to do what spongie said to get it to appear on zombies

#

I remember seeing some code related to zombie outfits, just gotta find it

clever totem
#

eh it's sorta supposed to be rarer than normal outfits

#

is there a way to lower the chance of it appearing?

hearty dew
# clever totem

and btw, the exact name isn't that important. You could rename it to sdksdjf.lua and it'd work. The important thing is it is a unique name. If you named it ProceduralDistributions.lua it would cause the original ProceduralDistributions.lua in pz to not load

clever totem
#

oh

hearty dew
clever totem
#

oooh

hearty dew
#

So change 10 to 1

clever totem
#

so 10 is high chance

#

and 1 is low chance

hearty dew
#

It is higher than 1 heh

clever totem
#

fair enough

hearty dew
#

and 0.5 is lower than 1, etc

clever totem
#

okay

#

got it

#

there's many of those shelves in the clothing store

#

where can i find their name?

#

like how they're called in the code

#

so i can include them aswell

hearty dew
#

I think if you enable LootZed in the cheats menu while in debug mode, you can right-click the container in the loot panel when you are next to it. In there, there is a pull down with the loot lists that the container pulls from to generate loot

#
    "BandMerchClothes",2.0);
    "BandPracticeClothing",2.0);
    "ClosetShelfGeneric",0.5);
    "ClothingStorageAllJackets",2.5);
    "ClothingStorageWinter",2.0);
    "ClothingStoresJackets",2.0);```
#

Another mod uses those for jackets, so that might be a starting place

clever totem
#

hmm

#

I'll check it out in 10 min

hearty dew
#

Now if you want your hoodie to appear on zombies, you need to create a media/clothing/clothing.xml file to create an outfit that zombies can spawn with.

Then create a media/shared/mymodid_ZombiesZoneDefinition.lua that inserts that clothing outfit set into the ZombiesZoneDefinition tables, and there you specify a chance for it to appear and where it can appear (like maybe that outfit only appears in bars or whatever, or in the Default area that can appear anywhere)

mighty wedge
#

hey im having trouble getting a firearm to spawn in the game, ive been able to get a templet item to spwan but once i add my own assets it wont spawn anymore

buoyant violet
#

Ok so I did it, I manage to make the Suppresors from Firearms B41 and Resident Evil Weapons (REWmod) work together by doing 2 things
1- Add the REW suppresors as a Type in the B41 silencer Lua.
2- Delete the Silencer Lua from REWmod

So my question is, can I create a patch that can achieve what I did without having to modify or delete the anything from the original addons? as in creating a LUA code that overrites both silencer luas from the original mods?

(this is for personal use, I dont plan to release anything since im not sure I can)

vast veldt
#

Is there a way I can add XP unmodified?

#

Sorry, I think I was going blind there, there is clearly a AddXPNoMultiplier method. Sorry!

#

Although it still doesn't seem to apply exactly the amount of XP I provide ๐Ÿ˜ฌ

astral dune
#

is Events.OnClientCommand.Add(onVehicleUpdate) not how you would add a listener on the server side for commands sent from the client with sendClientCommand?? I have a function local function onVehicleUpdate(module, command, player, args) and I cannot get it to fire to save my life

white quest
#

would it be possible to make custom 'composter' with diffrent input and output to the regular one?

#

coz i cant find any lua file referencing the composter;(

vast veldt
#

(Looks like yes from your message but just checking!)

astral dune
# vast veldt Are you calling sendClientCommand() within your function? (With arguments)

got this sitting in the server folder

local function onVehicleUpdate(module, command, player, args)
    print("client command received")
    if module ~= "Vehicles" then return end
    player:Say("Vehicle updated", 0.0, 1.0, 1.0, UIFont.Small, 60.0, "radio")
    print("Vehicle update")
end

Events.OnClientCommand.Add(onVehicleUpdate)```

and this on the client

```lua
function VehicleAccess:sendClientCommand(vehicle, method, args)
    args = args or {};
    if vehicle then
        args["_vehicleID"] = vehicle:getID();
    end
    Mekanicks.getPlayer():Say("sendClientCommand", 0.0, 1.0, 1.0, UIFont.Small, 60.0, "radio")
    sendClientCommand("Vehicles", method, args)
end```
#

my player will say "sendClientCommand", so I know that function is getting called, but the onVehicleUpdate function is never called

vast veldt
#

Looks sensible in principle. And the code on the server, are you actually running a server to test or Singleplayer?

astral dune
#

I'm running a server through the "Host" function in the main menu

#

as far as I know it just fires up a dedicated server in the background then connects you to it

vast veldt
#

It certainly all looks correct... sorry, I'm a little new, though I do have a working sendClientCommand / OnClientCommand setup working in my current project.

weak sierra
#

what about that module check thing

#

u sure that's the right module?

#

does anything show in the log at all?

vast veldt
#

(Even if the module check failed, he'd still get the "client command received" message?)

weak sierra
#

yeah

#

that's not there either eh

astral dune
#

nopers

#

could it be the "Host" thing? is it not a legit server/client setup?

weak sierra
#

i haven't messed with commands enough to know yet

vast veldt
astral dune
#

I've been having pretty much no luck with anything so far. ModData refuses to persist, commands don't send, its very frustrating

vast veldt
#

Just a note on the folders though - as I understand they make no difference at all to where the code runs, it's purely an organizational thing.

#

i.e. putting something in /client or /server has no bearing on where it runs

#

it depends on where the originating event is coming from

astral dune
#

the event that starts the whole ball rolling is ISOpenMechanicsUIAction:new

vast veldt
#

(Although the server should be originating the OnClientCommand events when a client fires a sendClientCommand() call

#

Unless you've added any code to cause either of the files to only run on server or client, i.e. isClient/isServer (You'd know if you'd done so though, as these lines would be expressly set out!)

astral dune
#

hmm, I suppose I could print the result from isClient and see if things are running in weird places

vast veldt
#

Unless you explicitly state not to run in a certain environment, code will run anywhere the relevant hooks are called. e.g. EveryTenMinutes runs both server and client side, and no matter where you put the code in terms of folder structure, it will run on both unless you check these and inhibit it.

#

However, that would cause you to end up with more calls if running in extra, unexpected environments, not zero calls.

#

i.e. at the top of all my client files I add:

-- Client Only
if not isClient() then return end;

And to Server:

-- Server Only
if not isServer() then return end;

Doing so will give you assurance over exactly where your LUA files are executing.

astral dune
#

looks like its running in the right place

#

I do get this in the logs though LOG : General , 1664409223582> 72,841,325> bugged action, cleared queue ISOpenVehicleDoor, may be related

buoyant violet
#

Do you guys know if a mod can overrite another mod lua?

weak sierra
#

yes

#

if it has the same path and loads after

#

good way to patch mods that don't lend themselves to it in a more gentle way

vast veldt
weak sierra
#

ive seen looots of that log line but never for opening the door

astral dune
#

I'm opening the hood at the time

weak sierra
#

huh

#

mb that falls under the same command, i havent looked in there in a while

buoyant violet
# weak sierra if it has the same path and loads after

because I have 2 mods which add silencers, both have their LUA code for them. I manage to make them work by adding an attachment from one mod to the other, and basically delete the LUa of one

So the question is, if I make a patch, can I achieve that

weak sierra
#

..probably?

#

u could use my Udderly Attachments mod that makes diff gun mods and attachment mods play nicely together if u like, but it might be overkill for your situation

#

it acts as a central hub to patch all guns and attachments

#

well, it doesnt patch the guns, it patches the guns into the attachments mounton lists

#

and classifies the guns

buoyant violet
#

I see I will give it a shot. Im just trying to use FB4 and REWmod together, becuase REW breaks the silencers of B41

weak sierra
#

im unfamiliar with rewmod

weak sierra
#

never even seen that, probably because i have never searched for resident evil and don't speak chinese

#

xD

vast veldt
#

Ohhhh...

#

Anonymous

astral dune
#

ya

buoyant violet
#

lol yeah, the mod its translated to english ingame at least

vast veldt
#

Your call to sendClientCommand

#

the first parameter is player, it's missing?

#

-- Send Command
sendClientCommand(getPlayer(),"PGMG.Server.Telemetry","fromClient",PGMG.Client.Telemetry.data);

buoyant violet
vast veldt
#

Here's an example from one of my libraries - see parameter #1

astral dune
#

the guide I was working with said the player was optional. I used to have it and removed it as part of testing

vast veldt
#

Did it work before removal?

weak sierra
#

u cant just blindly put it on there, and the database is written for vanilla/VFE, u'd have to write a bit of code to add the guns and attachments to the database

astral dune
#

nope

weak sierra
#

from the two mods

#

but it would work together after that

vast veldt
#

I know there is a version without player, but the third parameter type changes from KahluaTable to java.lang.Object...

#

And I can see from your args parameter (args = {}) it is a LUA table

#

So not sure what it would do if parameter 1 not player and parameter 3 not Java Objects.

astral dune
#

put the getPlayer() back in but no dice

vast veldt
#

Ok. I still think that's a stronger starting position. So the code is the same as posted above but now has getPlayer() as arg 1?

astral dune
#

yes. Dislaik's guide says Apparently IsoPlayer will always be the source player, otherwise the event will not be triggered. which may be my issue, but I'm not sure what he means by this

vast veldt
#

So call is now sendClientCommand(getPlayer(),"Vehicles", method, args) ?

astral dune
#
function VehicleAccess:sendClientCommand(vehicle, method, args)
    args = args or {};
    if vehicle then
        args["_vehicleID"] = vehicle:getID();
    end
    getPlayer():Say("sendClientCommand", 0.0, 1.0, 1.0, UIFont.Small, 60.0, "radio")
    sendClientCommand(getPlayer(), "Vehicles", method, args)
end
clever totem
#

@hearty dew can I go above 10?

#

it seems like on 9 it's around 19%

vast veldt
#

And all args are confirmed as correct type etc? (e.g the caller to VehicleAccess:sendClientCommand is passing method and args correctly?

#

e.g. there are no prints() there to confirm this method is being called and that the args are correct yet

#

(Although your getPlayer:say() will do something)

astral dune
#

the getPlayer():Say does fire, and this particular function is called by VehicleAccess:sendClientCommand(vehicle, "updateVehicle",{})

#

the vehicle being passed from the input to the mechanics action, so I'm sure its a vehicle

clever totem
#

I keep refreshing but it doesn't appear in the storage

vast veldt
#

It would be worth just for sanity's sake checking the method and args just before the sendClientCommand (either through prints or breakpoints)

astral dune
#

can you do breakpoints? I've not found a way to run this from intellij, I just copy it to the mods folder and run the game

vast veldt
#

F11 in game, double click the line

#

(Need debug mode on)

astral dune
#

oh interesting

vast veldt
#

Yeah it's super helpful you can inspect the vars as they run line by line

#

(And reload files as you edit, etc)

astral dune
#

lol, server booted me once I left debug

#

but yes, looks like the inputs are legit

vast veldt
#

I've made some test cases just trying to get the world running with "Host" option.

astral dune
#

ok

vast veldt
#

Other events etc do work when using the "Host" option yes? I just did my first test and realised unless you expressly add it, Mods are not set active on a "Host" session even if enabled in the main menu.

astral dune
#

you have to configure the hosted server the same way as a normal one, it doesn't use the mods you have enabled in the client

#

my mod is definitely loaded, at least that much I'm sure of, lol

vast veldt
#

I have loaded my test cases now and I see the same issue, events are not firing....

astral dune
#

oh rly?

vast veldt
#

Yeah

astral dune
#

well that's bittersweet news. I'm not crazy, but also this doesn't work in my prefered way of running a server

vast veldt
#

Let me just try a couple of other things...

#

Yeah, I've tried a couple of different ways and I can't get that working via "Host" either, and the same works fine on dedicated server. I tried a few variance of the "not isClient" e.g. "isServer" and any server blocks for me just aren't' running.

I suspect this is related to your issue but I would like to caveat my experience whilst quite broad in programming in general, is quite limited with PZ and whilst I do have those commands working, I have only ever tested / used them via dedicated server and not via the "Host" option. Perhaps someone else has relevant experience to suggest how to make these work as expected when using that hosting option.

#

The client side sender test absolutely works ok

bronze yoke
#

try without the getPlayer() argument

#

while i think there was something like that on the api, none of my sendClientCommand() usages take a player as argument and i don't think it worked for me when i tried it

vast veldt
#

There is a 3 argument version of sendClientCommand() which I believe Anonymous was using prior, the error seems to be the server side event just doesn't fire, but I have a feeling I have a knowledge gap here so defer to others who have gotten things working on the "Host" option as I've only got these working ok on dedicated server.

clever totem
#

Hey guys! does anyone know where I can get T-shirt or baseball cap models?

astral dune
#

running an actual dedicated server does allow my events to fire

#

just tested it

#

but what gives, what the heck does "Host" do then

#

lol

vast veldt
#

Well that's fairly definitive then, something different must need to be done to make it work on dedi, as I also get expected behaviour in dedi with both test cases and all my other uses of sendClientCommand()

#

(**Make it work on "host" vs dedi)

bronze yoke
#

oh, wait

#

isClient() returns true on an in-game hosted server

astral dune
#

makes me wonder how many of the mods I've been running under Host haven't been working properly

bronze yoke
#

an in-game hosted server is both a client and a server, so both return true

#

and likewise, in singleplayer they both return false

vast veldt
#

I did try with isServer, does it also have odd behaviour?

bronze yoke
#

or at least that's how i remember it

vast veldt
#

(Although the server lines did not run in the client when using "Host")

#

I also have the same issue when I test my dedicated-proven mod when I am doing local dev - that event just doesn't work at all when I run in SP. I'm not that surprised at that but perhaps an unexpected behaviour is affecting Anonymous where attempting to set up server-client comms via that option.

#

I mean that fact his code is running when in dedicated and not when using "Host" suggests a critical difference

astral dune
#

I wonder if everyone just tests with a dedicated server and I'm the first to notice this issue, or if there is a known workaround

vast veldt
#

I suspect there is a known workaround yeah, I'm afraid I just don't know it myself as I've always been focused on dedi server development

bronze yoke
#

are you checking your in-game console?

vast veldt
#

You can't be the first person to want to run an MP mod via "Host", after all

bronze yoke
#

i just checked a hunch of mine, and

#
if isServer() then print('isServer') end

prints to coop-console.txt, but not the in-game console

vast veldt
#

Which suggests it is running...

#

And if you expand the test case to include an Events.OnClientCommand() handler?

bronze yoke
#

let's see

vast veldt
#

That's where it falls down for me

#

It believes it is a server, but doesn't act quite like a dedicated one.

astral dune
#

it also throws an error if I try to use player:Say() on the server side from the triggered event

#

which is kinda interesting

vast veldt
#

getPlayer() won't work on a server to my knowledge, only a client

#

(Which I presume is the origin of said "object"?)

astral dune
#

the player is being passed in by the command

bronze yoke
#

i recall hearing somewhere that Say() just doesn't work on servers at all

astral dune
#

OnClientCommand has module, commnad, player, args as its inputs

#

ya, I wouldn't be surprised by that

vast veldt
#

Here's a fun quirk of OnClientCommand when you get it working... player is apparently the client side version of the object...

bronze yoke
#

yeah it works

vast veldt
#

It works?

bronze yoke
#

in client

function sendTestMessage()
    sendClientCommand('ZContagion', 'sendTestMessage', {})
end```
in server
```lua
local function OnClientCommand(module, command, player, args)
    if module == 'ZContagion' then
        print(command)
        Commands[command](player, unpack(args))
    end
end
Events.OnClientCommand.Add(OnClientCommand)```
#

and then in coop-console.txt there's a nice 'sendTestMessage'

vast veldt
#

Hmm.... what on earth is different from the tests or indeed, Anoymous's samples sent earlier though... they look identical...

weak sierra
#

i advise to not test local coop as if it is dedicated

#

set up a local dedicated for testing with that

bronze yoke
#

all they were trying to do was print right? if they were checking the in-game console they wouldn't've seen it

weak sierra
#

test all three if u wanna support coop/local hosting

vast veldt
weak sierra
#

oh yeah i only ever look at the real log

#

the debug log is.. wonk

#

it doesn't show everything and shows some stuff that the real log doesn't

astral dune
#

I tried to print, which prints to the console, also tried to Say, which of course prints out onto the screen, neither seemed to work

vast veldt
#

Blimey, you're correct

astral dune
#

but yes, now that I look in coop-console, the prints are there

#

as well as this error:
java.lang.NullPointerException: Cannot invoke "zombie.chat.defaultChats.RadioChat.createMessage(String)" because "this.radioChat" is null

vast veldt
#

Yep, all the commands did run:

#

That's so weird, when debugging a dedicated server, the logs get re-routed to your local LUA console, but apparently not in "Host"!

astral dune
#

long story short, looking at the wrong output and Say doesn't work most of the time

bronze yoke
vast veldt
#

Yeah, I had DS debug coming through to both the servers stdout and local console.

#

So... the conclusion is Anon's code was running all along?

astral dune
#

all along

bronze yoke
#

it seems so!

vast veldt
#

Gotta love debugging

astral dune
#

several days of hair pulling later, lmao

#

now back to trying to get modData to stay after a reboot

buoyant violet
#

I did itamen

#

thank you all

weak sierra
#

grats

hearty dew
clever totem
#

though I noticed a mistake

#

it was called "MerchHoodieUp"

#

instead of "MerchHoodieUP"

hearty dew
#

Maybe set it to some huge number just to test it to verify it works right. Then tune the number appropriately

vast veldt
clever totem
#

it spawned 2 times

#

I tested it, I can wear it

#

take off the hood

#

and put it on

#

yay

hearty dew
#

I presumed it went of that

clever totem
#

MerchHoodieUP

hearty dew
#

Maybe it uses a different identifier, like from the scripts file :)

clever totem
#

yeah it's all good I fixed it!

hearty dew
clever totem
#

so proud of myself

#

Thank you!

#

yeah it's blooming

mighty wedge
#

can anyone help with getting my custom weapon to spawn?

hearty dew
mighty wedge
#

the problem isnt the distribution and stuff, more i cant get the game to read it or something

#

i was following a template that i found onlin

#

but it only seems top do something when i just use the raw templete

hearty dew
#

Can you spawn the item manually using the debug/admin tools?

mighty wedge
#

how do i do that?

#

im already in debug mode

hearty dew
#

Click the fly icon to bring up the debug menu

#

I think there is Items under the Cheat tab?

mighty wedge
#

ill try that in amin

mighty wedge
#

@hearty dew its this menu right?

weak sierra
#

yes

mighty wedge
#

is there a specific tab for modded items?

weak sierra
#

the name of an item u see in a script after "item" would go under "Type" on the bottom left to filter it

#

what tab it's in depends on how u code the mod

#

u can see some mods ur running have tabs like Tsarcraft

#

many just put things in Base

mighty wedge
#

ah ok

#

thnx

weak sierra
#

mhm

#

the name of the item u'd see in the game normally goes in "Name"

#

to filter by that instead

#

that part is relatively obvious

#

lol

mighty wedge
#

i found it!

#

but the model isnt showing

weak sierra
#

well that's the icon

#

is it equipped too?

#

i see nothing there either yeah

#

99.9% of the time it's cuz the model is too small or too big

#

in the model declaration try putting Scale = .1,

mighty wedge
#

i used an m14 to scale it in blender

weak sierra
#

idk

mighty wedge
weak sierra
#

u did make a model declaration right?

#

and assign it to the gun

#

yes?

mighty wedge
#

in the csript right?

weak sierra
#

yeah

#

mesh { blah blah }

#

and then u set the "sprite" to the mesh

#

in the item

mighty wedge
#

yeah

weak sierra
#

yeah u'd put it in the mesh thing

#

as an extra line

mighty wedge
#

idk if the template im using is good tho

weak sierra
#

idk, can post it

#

will look

mighty wedge
#

sure 1 sec

#

unrelated question: How does blender handle models with multiple parts?

#

this model im trying to use isnt though

weak sierra
#

i don't use blender

#

but i can tell u the game doesn't use multiple objects

#

u have to combine them into one

#

or it will just pick the first one and pretend the rest aren't there

#

(i use wings3d)

#

nothing looks obviously wrong with how this is set up

mighty wedge
#

oh wait im stupid

weak sierra
#

i presume the mesh/texture are at the prescribed locations?

mighty wedge
#

i meant to ask proj zom

weak sierra
#

good thing i answered that then :P

#

l;ol

mighty wedge
#

oh lol

#

@weak sierra does wings 3d export as directx?

astral dune
mighty wedge
#

Does anyone know of an application that will let me view .x files?

astral dune
#

Vehicle IDs don't seem to match between server and client ๐Ÿ˜‚ can't catch a break

hearty dew
#

Hmm.. is there enough data about the vehicle that you could use to hash to make a unique id?

astral dune
#

What I'm doing is sending the ID from the client to the server, and calling getVehicleByID() on the server to access it and make the necessary changes

#

problem is the server doesn't find it

hearty dew
#

Hrm, maybe you could send the server id to the clients, they store it in mod data, and use that to reference it

astral dune
#

I must be doing something wrong, there is no way these IDs don't match

hearty dew
#

question is how the client can associate it to the correct vehicle initially

astral dune
#

breakpoint on server side doesn't seem to work in debug mode, thats too bad

hearty dew
#

I see getVehicleByID() on the vehicle manager. There is also a global getVehicleById(). Do they both have this issue?

astral dune
#

I'm only using the global

fringe cape
#

God dam spiffo burgers

astral dune
#
 @LuaMethod(
         name = "getVehicleById",
         global = true
      )
      public static BaseVehicle getVehicleById(int var0) {
         return VehicleManager.instance.getVehicleByID((short)var0);
      }

this is what the global does, so its gotta be the same either way

hearty dew
#

Ah, yea

#

I see code in client/ and in server/ both using getVehicleById().. hrm :/

astral dune
#

I wonder if the player entering vehicle event fires on both sides, if it does I could print the IDs and compare them myself to be sure. Gonna look into that

fringe cape
#

Dog Goblin ๐Ÿ‘ฟ

astral dune
#

OnEnterVehicle only has a reference to the player entering a vehicle and not the vehicle. OnUseVehicle has a reference to the vehicle, but only exists server side, yet is only called by the client?? None of this makes sense I'm going to bed

weak sierra
#

i've done stuff with vehicles and have never used either of those functions

#

instead i use the vehicle getting function on the cell

#

:p

astral dune
#

I'm not aware of that function

weak sierra
#

it's not documented

#

iirc it's just getVehicles()

#

on IsoCell

#

it only gets the ones that are loaded in

#

like all of these things

#

unfortunately]

#

but

#

it has worked fine in my experience

astral dune
#

I just want a reference to the vehicle the player is touching, on the server side so I can write to the moddata and have a beggars chance of it still being there on a reload

weak sierra
#

that won't work

#

have to store the moddata on a part

#

not the vehicle itself

astral dune
#

yes, we spoke about that the other day

weak sierra
#

vehicles and inventoryitems don't actually retain mod data

#

ah

#

i never remember who i tell things to lmao

hearty dew
#

Client side, there is OnMechanicActionDone, which has players, success, vehicle id, part id, item id, some installing flag

astral dune
#

but I can't get a reference to a part if I can't get a reference to the vehicle

weak sierra
#

yeah

#

so what u do is do cell:getVehicles()

weak sierra
#

and iterate through them checking distances

#

the closest one is the one u want

astral dune
#

that's honestly a little ridiculous, lmao

weak sierra
#

do math.abs(playerX - vehicleX) and same for Y

#

add them up

#

yeah

#

u can get the vehicle the player is IN

#

very easily

#

but not the one they are near

signal frost
#

I'm trying to run a server locally, do I need to port forward if I'm intending to connect from the same machine?

weak sierra
#

it'd be nice if they exposed vehicles.db

weak sierra
#

xD

#

traffic to/from same machine isn't normally blocked by a firewall

signal frost
weak sierra
#

grey area ig

astral dune
#

there is a BaseVehicle:getSqlID(), I have a sneaking suspicion I need that

#

The valhalla mod you linked me to the other day takes that ID and imprints it on a part, along with the VehicleID that I'm currently pulling clientside. I don't see them ever using it but its gotta be for a reason. I'll have a better look tomorrow with fresh eyes

weak sierra
#

that'd be the ID in the vehicles.db

#

which is undoubtedly a stable id

#

that much i can tell u

#

i haven't looked deeper tho

astral dune
#

you're likely right, but it really doesn't look like they use it for anything

#

now that I know how commands actually work, I can trace the flow of data from the client to the server, and they're literally doing exactly what I am. Getting the ID from the vehicle, passing it to the server, and loading it from that ID... hmm hmmhmm

signal frost
#

Can I hot reload a local server?

#

Lua, specifically. Assuming I also hot reload it on the clients

astral dune
#

personally, I dunno

blazing thorn
#

Hey, I'm trying to make a mod where I need to keep track of how many books the player has read(skill books). Is there any way to do that?

fringe cape
#

but im not stopping you

astral dune
#

Leaving what I just discovered here for posterity, maybe it will help someone in the future:

BaseVehicle has both a getId() and a getID() method. They do not return the same data.

getId() is the one you want if you plan on using the result with getVehicleById() later

blazing thorn
#

No I want to make it so after an amount of books are read, fast reader is given as a trait

blazing thorn
fringe cape
azure dock
#

aye guys

#

any way to make a mod to make custom skill journals without lua coding

#

like a journal that any players who enters the area sees

shadow geyser
tepid rock
#

Okay after a hiatus of not really doing much of anything, I want to do a simple clothing addition. A simple jacket retexture. I don't know where a good tutorial on modding in items is on YouTube or a good recommendation is. Any idea on where to get started? I haven't talked here for awhile. I have a specific "pack" of clothing I'd like to make, but I just want to start with one article of clothing and then make my way to making some others. Eventually I want to also model or edit some hair styles as well and add in some consumables. (I don't know if people here know of Laverne and Shirley but I was going to add in some items from that specific sitcom for fun)

fringe cape
#

someone make a mod where you can push furniture behind a window or door and it acts like a barricade