#mod_development
1 messages ยท Page 28 of 1
Oh, yes. Good
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
ow ok cool
thank you anyway tho!
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
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?
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
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
um how exactly can I load the mod into the dedicated server? can't see a file to load in the mod anywhere
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
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?
sorry, it is ~/Zomboid/Server
zombie.network.GameServer -statistic 0 %1 %2
by default it usesservertest.ini. You add-servername fooif you want to usefoo.iniinstead
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
yea
if that doesn't work, use 127.0.0.1 for the ip
That's the end of the server log?
yes
do i need to configure the ports from the router to be able to connect locally?
not if you use 127.0.0.1
and you don't have a crazy firewall running locally on your machine ๐
oh there we go it just started working now
Might have not finished initializing the world
I think I might have mistakenly edited the vanilla vehicle items file while modding ๐
You can disable file version checks in the config
There's a section with cheat detection, I forget exactly what term they use
would need to restart the server after changing it, I presume
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
Change -Xms16g -Xmx16g to 2
ah
-Xms2g -Xmx2g
yea, it should reserve less memory initially than 16
lovely
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
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
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
lemme get that mod real quick
zombie.network.GameServer -statistic -servername foo 0 %1 %2
like so?
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
okay so its just like the comment said
I loaded in my mod first
then AutoMechanics as an example
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
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```
this is my mod.info
could be the url= line or is it unrelated?
also what's that?
oh
ye, one min
Possibly, but it shouldn't be if it is parsing the file correctly
that url does have a query parameter id
Whatever is parsing it might be parsing that incorrectly
Lemme try changing the url and see if that does it
Looks like that yeah
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?
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
Alright, thank you so much! Really appreciate it
Hey, anyone knows where all the AnimNodes stored for recipes or where i could find them?
DId anyone find a way to unit test lua files for zomboid mods? ๐ค
@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
Hey ๐
I must have forgotten to reference the tiles blends_street_01_103 at first sight
No , isn't that ^^'
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?
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?
its probably on your on the client..side only
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.
does your clothing item use decals or something?
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?
If the author updates the mod, will my edits in that mod be lost?
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
? 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
you could just significantly reduce the amount of the medication in one pharmacy to just scraps, a pill or two here and there, and just assume that when the apocalypse started, people emptied the shelves on their way out of the city
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
if the issues is that there are items that you luck out on and get a box of 10, just remove the boxs
even non-boxes
and put individual doses with a very low rate
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
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
And there is a chance someone with a blood born disease used the needle and you get sick
still ends up winning a lottery
unless I make it like, pills only, individual ones
so if there is one dose, the player is set for the rest of the game?
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
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
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
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
you have just quintupled your lifespan
which if you really minmax, which any person would in the apocalypse
you have 15 days
Make it to where you have to cook like Walter white
min
and 15 days in zomboid
its a LOT
so see?
nerfing everything to the ground
15 days is nothing
like what?
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
well, the way I see it, you don't want the PZ game to be entirely about just finding the med
ยฌยฌ
the first iteration, which tackled into realism
welp
13 boxes of 10 uses each
from a trip to louisville's pharmacy
Make it to where you can make medicine

it should be ok to be able to get lucky, and not need to spend 24/7/365 finding the next dose they need
then I nerfed it to be a little rarer like antibiotics
otherwise how will they ever find the time to play with trapping, or actually play the game
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
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
imo this is a good thing and not a bad thing
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
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
what am I supposed to do about that
otherwise, 'easily mitigated' and 'worth a lot of points' are just at odds with each other
was my idea in the future but obviously I need to find a foundation
so I can stick with it
and I got stuck trying and trying and playtesting change after change
Did it happen to anyone that their clothing modded items would randomly appear on zombies?
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
how long did you actually play that save. Like one of my PZ saves is now at one year long. do you think there were enough doses for that long of a game?
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
yes
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
this conversation is getting a bit heated considering this started with a question about loot balance
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
is there a reason you don't want to just make the trait cheaper?
I can make it cheaper but then what's really the point, u know?
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
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
I think, for your balance issue, you just need to think of, how long do you want players to be able to stay in a single town before needing to go to the next one. then change the numbers so that in one town(which basically is just one pharmacy since I don't think there are towns with multiple), that is the expected number of doses to be found in a pharmacy
the problem is that this is highly arbitrary
like, put 2 people with this trait in the same area
I now divided that supply in half
put this on a multiplayer server
exactly, just like reality and all other resources in this game
we have a bigger problem
if there are 2 people in a town, you need to fight for food
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
so basically, you just need to make a sandbox option that lets you modify the spawn rate
problem solved
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
that way if someone knows they are going to play with 15 people on a server, they just increase the spawn rate
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
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
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
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
so just remove it from the pharmacy
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
figure out, what is the proportion of the population that is transgender. lets say it is 1 in 100
I want medication to run out
and for the players to have to find alternative ways
of circumventing downsides
then make a rate so that 1 in 100 houses has a couple doses
for long term
uhm gentlemen, apologies for the interruption but would appreciate any kind of help here xd
i think it goes like this
for i = 0, jumpstarters:size()-1 do
local jumpstarter = jumpstarters:get(i)
-- do your stuff
end
use either the pairs or the ipairs function
Ask people nicely not to hoard, of course! That'll work ๐
with that out of the way tho, so how about that double jump
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
lemme print jumpstarters only
that's individual items
oh yeah I even tried to make a god damn magazine
or wait
that you have to find and read
two items
to properly take the medication
yes
in a square bracket
and it still did not matter for balance
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
Got it, thanks so much!
it is an arraylist
you can check the return types for all java functions from here.https://zomboid-javadoc.com/41.65/
Javadoc Project Zomboid Modding API package index
and if it isn't a java function, I think 99% of the time it will be a lua table
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
yeah, you can. i've definitely seen it in a mod before
im unsure of what kind of syntax since lua has no notion of instantiation really
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
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
--***********************************************************
--** 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?
from vanilla. it seems like they do it here and there to contain other java objects
it means you have to override the file afaik
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
Yeah right now I am overriding the entire file but that makes issues for other mods I imagine
You could do it a bit hacky from the looks of that, the funcions are visible but the array isnt
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
the functions themselves don't seem to be local, but the table is
but if the table is then u can't get to it still from outside no?
you can also just add in a new Onclientcommand function to catch the command depending on what you want to change
im not sure
You could make your own table to replace it then i would assume
if it's all client command yeah
i was assuming it wasn't but i guess i shouldnt
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.
Random thought, does anyone know of any means to hook into the discord bot?
this is all lua/server/vehicles/VehicleCommands.lua the one that gets missed by capsid for whatever reason
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
I need to override the entire functionality of the command rather than additional
because I am changing their math
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
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?
That is my mod, as it is, it works - but I currently just entirely override the lua file
do you want them to wear clothing or equip it in their hands?
equip in hands
not necessarily visually
just to be equipped in primary code-wise
or secondary/both hands
if you just want it to happen, use :setPrimaryHandItem()
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
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
can you show the script of the item
Alright, thanks!
/* 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
if you use the ClothingItem = Blah
it will be added to be able to show on a zombie automaticcaly
dafaq
yep
And How am I supposed to add a new clothing without it being added to the zombies
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
you dont need the clothingItem tag anyways, just remove it. the clothing will still work
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```
?? But without ClothingItem it won't load the model, no?
something like this?
the Tags are nice for the end user though ๐ (Personal gipe about hydrocraft)
the body location tag is the one that tells the game where it can be worn anyways
Okay, fair but this still does not solve the issue that I can't make a clothing without the ClothingItem right? or am I going insane?
oh wait, I think I remembered wrong. you need to make your own essentially, and not use the vanilla ones
Oh goddamit ๐ฆ
yeah i can't find the exact file but it looks like items are added to outfits based on their xml, not their script
This is a massive problem for my transmog mod
Goddamit, this is awful to work with
I guess I'll improvise
I think you can just copy paste the vanilla files/models but just rename them
I could but it's not what I need
It has to be dynamic
That's why I generate the items.txt on the fly
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
That would be waaaaaaaay too much work, writing the code to generate all the xmls, is lowkey insane, and might still not work
it's not that straight forward in lua
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?
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
no I don't think there is a function that already does that. If you need to do it alot, you probably should just make your own function for it
Understandable, that's basically the whole mod without packing it into a zip. I have no idea if it's a script, model or a texture issue.
Workshop link for those super paranoid about viruses
boomp
what do you use to convert to .x format?
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 } )
Yup, it's tied to blood and dirt, checked it with the debug mode. Strange...
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?
Any idea what's the container name for vehicle trunks?
try removing
CanHaveBlood = false
CanHaveDirt = false
haha, I added it in hopes of fixing it
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
quick question ab weapon mods, is it possible to give guns aiming animations?
like when youre holding down rmb
By the way, any way to know what container each "Container Name" refers to ProceduralDistributions file?
sadly, no luck
oh thats weird wtf lol
I think I'll just start from scratch, heh. It might be unsalvagable.
Sometimes you just must swallow the sunk cost fallacy
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
yeh, replaced the model and texture with original spiffo ones and it's also broken
something's with the scripting
hi someone can give me a guide how to make custom spawns?
yeah just copy the spiffo script and just replace it with your stuff and see if that fixes it
Actually one more thing, the hoodie should be now normally spawning right?
does anyone know anything ab making custom poses for custom fireamrs?
You need animate them, I'm working on a guide about anims but it's stand-by
ah ok
yeah it doesn't seem to spawn
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 ๐๐คฉ
I don't know. Someone had said earlier that if the ClothingItem = ... line is set to something known, it will automatically show up in loot tables, but he wasn't certain.
If not, here are all the loot tables I've come across and your clothing item could be added to those
Hmmm.. I see
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
ClothingItem is just the script file that sets how the clothing item looks when its equipped, you have to manually insert the item into the loot tables through lua
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
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?
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```
You just include the lua that adds to those tables in your mod that adds the hoodie
oooh
Good question. I'm not sure how clothing spawns on zombies works offhand. Do you know, @winter bolt ?
Okay, so for example can I edit it and then send that to the streamer?
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
Did you upload your hoodie mod to steam and he downloaded it from steam?
yessir
If so, you can just update it on steam, and his steam client will download the update (when pz is closed)
you have to make a new outfit in clothing.xml
in your mod, create media/lua/server/mymodid_ProceduralDistributions.lua
yea
actually stupid question of course it is lmao
and now I put that script u sent before
into that and change txt to lua?
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
eh it's sorta supposed to be rarer than normal outfits
is there a way to lower the chance of it appearing?
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
oh
Change the number in that code to what you want
oooh
So change 10 to 1
It is higher than 1 heh
fair enough
and 0.5 is lower than 1, etc
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
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
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)
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
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)
Hi - the method AddXP() from https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.XP.html seems to be applying a modifier of sorts to the amount I provide it - i.e. if I calculate how much is required for say, 5000xp, add that, I don't end up at 5000, but some other amount.
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 ๐ฌ
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
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;(
Are you calling sendClientCommand() within your function? (With arguments)
(Looks like yes from your message but just checking!)
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
Looks sensible in principle. And the code on the server, are you actually running a server to test or Singleplayer?
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
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.
what about that module check thing
u sure that's the right module?
does anything show in the log at all?
(Even if the module check failed, he'd still get the "client command received" message?)
i haven't messed with commands enough to know yet
Only in as much as I can say I've only tested with a dedicated server (which does work)
I've been having pretty much no luck with anything so far. ModData refuses to persist, commands don't send, its very frustrating
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
the event that starts the whole ball rolling is ISOpenMechanicsUIAction:new
(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!)
hmm, I suppose I could print the result from isClient and see if things are running in weird places
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.
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
Do you guys know if a mod can overrite another mod lua?
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
Now that's a new one, not seen that before. Sounds like something else may be the cause rather than just the basic setup, which looks correct.
Probably best to write a completely isolated test case away from anything else your mod is doing to prove the basics.
ive seen looots of that log line but never for opening the door
I'm opening the hood at the time
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
..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
I see I will give it a shot. Im just trying to use FB4 and REWmod together, becuase REW breaks the silencers of B41
im unfamiliar with rewmod
never even seen that, probably because i have never searched for resident evil and don't speak chinese
xD
ya
lol yeah, the mod its translated to english ingame at least
Your call to sendClientCommand
the first parameter is player, it's missing?
-- Send Command
sendClientCommand(getPlayer(),"PGMG.Server.Telemetry","fromClient",PGMG.Client.Telemetry.data);
btw gonna try your mod now lol
Here's an example from one of my libraries - see parameter #1
the guide I was working with said the player was optional. I used to have it and removed it as part of testing
Did it work before removal?
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
nope
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.
put the getPlayer() back in but no dice
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?
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
So call is now sendClientCommand(getPlayer(),"Vehicles", method, args) ?
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
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)
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
others seem to be 100-300%
I keep refreshing but it doesn't appear in the storage
It would be worth just for sanity's sake checking the method and args just before the sendClientCommand (either through prints or breakpoints)
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
oh interesting
Yeah it's super helpful you can inspect the vars as they run line by line
(And reload files as you edit, etc)
I've made some test cases just trying to get the world running with "Host" option.
ok
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.
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
I have loaded my test cases now and I see the same issue, events are not firing....
oh rly?
Yeah
well that's bittersweet news. I'm not crazy, but also this doesn't work in my prefered way of running a server
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
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
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.
Hey guys! does anyone know where I can get T-shirt or baseball cap models?
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
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)
makes me wonder how many of the mods I've been running under Host haven't been working properly
an in-game hosted server is both a client and a server, so both return true
and likewise, in singleplayer they both return false
I did try with isServer, does it also have odd behaviour?
or at least that's how i remember it
(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
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
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
are you checking your in-game console?
You can't be the first person to want to run an MP mod via "Host", after all
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
Which suggests it is running...
And if you expand the test case to include an Events.OnClientCommand() handler?
let's see
That's where it falls down for me
It believes it is a server, but doesn't act quite like a dedicated one.
it also throws an error if I try to use player:Say() on the server side from the triggered event
which is kinda interesting
getPlayer() won't work on a server to my knowledge, only a client
(Which I presume is the origin of said "object"?)
the player is being passed in by the command
i recall hearing somewhere that Say() just doesn't work on servers at all
OnClientCommand has module, commnad, player, args as its inputs
ya, I wouldn't be surprised by that
Here's a fun quirk of OnClientCommand when you get it working... player is apparently the client side version of the object...
yeah it works
It works?
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'
Hmm.... what on earth is different from the tests or indeed, Anoymous's samples sent earlier though... they look identical...
i advise to not test local coop as if it is dedicated
set up a local dedicated for testing with that
all they were trying to do was print right? if they were checking the in-game console they wouldn't've seen it
test all three if u wanna support coop/local hosting
I... never thought of that... if that's true then I should have my own tests logging success too in the same...
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
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
Blimey, you're correct
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
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"!
long story short, looking at the wrong output and Say doesn't work most of the time
do they? i haven't experienced that
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?
all along
it seems so!
Gotta love debugging
several days of hair pulling later, lmao
now back to trying to get modData to stay after a reboot
grats
I'm not certain how those %s in LootZed are calculated from the ProceduralDistribution table, but if it's showing up in LootZed, I think you've got is working right :)
Yeah!! it is
though I noticed a mistake
it was called "MerchHoodieUp"
instead of "MerchHoodieUP"
Maybe set it to some huge number just to test it to verify it works right. Then tune the number appropriately
GL, sorry for the trip round the houses only to find out your code was fine! Much love to the debug tooling ๐
To capture and share your gaming highlights, download the Outplayed app on Overwolf
it spawned 2 times
I tested it, I can wear it
take off the hood
and put it on
yay
Oh, hmm.. What is the xml filed called? MerchHoodieUp.xml or MerchHoodieUP.xml?
I presumed it went of that
Maybe it uses a different identifier, like from the scripts file :)
yeah it's all good I fixed it!
Congrats :)
can anyone help with getting my custom weapon to spawn?
How/where do you want it to spawn?
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
Can you spawn the item manually using the debug/admin tools?
Click the fly icon to bring up the debug menu
I think there is Items under the Cheat tab?
ill try that in amin
@hearty dew its this menu right?
yes
is there a specific tab for modded items?
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
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
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,
i used an m14 to scale it in blender
idk
how do i rreach this?
in the csript right?
yeah
idk if the template im using is good tho
sure 1 sec
unrelated question: How does blender handle models with multiple parts?
this model im trying to use isnt though
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
oh wait im stupid
i presume the mesh/texture are at the prescribed locations?
i meant to ask proj zom
fyi I just tried to call a function I had in the client folder from the server and it caused an Invocation exception until I moved it to the shared or server folder. Looks like its not just an organizational thing
Does anyone know of an application that will let me view .x files?
fragmotion
Vehicle IDs don't seem to match between server and client ๐ can't catch a break
Hmm.. is there enough data about the vehicle that you could use to hash to make a unique id?
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
Hrm, maybe you could send the server id to the clients, they store it in mod data, and use that to reference it
I must be doing something wrong, there is no way these IDs don't match
question is how the client can associate it to the correct vehicle initially
breakpoint on server side doesn't seem to work in debug mode, thats too bad
I see getVehicleByID() on the vehicle manager. There is also a global getVehicleById(). Do they both have this issue?
I'm only using the global
God dam spiffo burgers
@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
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
Dog Goblin ๐ฟ
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
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
I'm not aware of that function
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
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
yes, we spoke about that the other day
vehicles and inventoryitems don't actually retain mod data
ah
i never remember who i tell things to lmao
Client side, there is OnMechanicActionDone, which has players, success, vehicle id, part id, item id, some installing flag
but I can't get a reference to a part if I can't get a reference to the vehicle
Might be server side too, idk
that's honestly a little ridiculous, lmao
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
I'm trying to run a server locally, do I need to port forward if I'm intending to connect from the same machine?
it'd be nice if they exposed vehicles.db
no, but that does not belong in #mod_development
xD
traffic to/from same machine isn't normally blocked by a firewall
Ahh, it's part of the creation of my mod so I figured it was relevant
grey area ig
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
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
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
Can I hot reload a local server?
Lua, specifically. Assuming I also hot reload it on the clients
personally, I dunno
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?
Not helping but there already is a mod about that
but im not stopping you
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
No I want to make it so after an amount of books are read, fast reader is given as a trait
Not to just show which books are read
ohh ok
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
you should try it out. make a new item that uses a ClothingItem defined by vanilla, and they will never wear that vanilla item anymore, only your modded item
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)
someone make a mod where you can push furniture behind a window or door and it acts like a barricade
