#mod_development
1 messages Ā· Page 51 of 1
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@bronze yoke does this look like it'll work?
if you don't mind taking a look rq!
i'm concerned by this 'CassetteNancySinatraTheseBootsAreMadeforWalkin'(1966)', looks like some of your item names have single quotes in them which will break the string
NOOOOOOO you're right a bunch of them do
maybe it's a little late to say this but it looks like you should've used double quotes...
oh nevermind found it, its 0.0625
where did you find that?
Project Zomboid directory/media/scripts/
can i use double quotes in place of the quotes bracketing the items in the list?
that's super easy to fix if so
that's where i got the 0.1 from too
yeah you can!
but 800 item names to change... have fun
err propane tank? not propane torch
oh no i have a tool that does that for me!
Convert column of data to comma separated list of data instantly using this free online tool.
oooh my mistake lol
this thing has a lil option to put symbols on either end of each part of the string so i can just change those to "s super easy
givin it a shot now
if this works i'm gonna be so happy it'd solve all of my problems with this system lol
Should also be able to escape the ' inside the strings by replacing them with \'
hey guys im new to the this discord how u guys doing? i have a dedicated server and was wondering if any1 knows a mod that gives more starting locations instead of just the standard 4. i tried getting the "More Starting Locations" mod and that didnt work
You can initialize an array like so to avoid lines that are 999999 characters long fyi```lua
local foo = {
"blah",
"blarg",
}
hmm this leads me to a question actually
when you're deciding on the drop rates of items
is it like... what is the 'guaranteed' drop rate? 100?
i've seen the same item in different containers with the same spawn weight have different spawn rates in lootzed
Depends on which loot rate value you are referring to. There are a number of them that behave a bit differently
hmmm
the dummy replacement code doesn't seem to be working
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is what i'm using atm--anything stick out that might be broken? š i probably didn't realize i was supposed to fill something in or smth
have you checked if the event actually fires for corpses?
how would i go about testing that?
reading from the java it doesn't look like it does
aw darn; is there one you think would work for corpses? this is a shot in the dark based on some googling but maybe OnContainerUpdate?
ach
let me check how the client adds synchronised items
local function replaceDummies(container)
local dummies = container:FindAll('Tsarcraft.BlankCassetteMain')
for i = 0, dummies:size()-1 do
container:removeItemOnServer(dummies:get(i))
local itemChoice = ZombRand(#itemList)+1
container:addItemOnServer(itemList[itemChoice])
end
end
Events.OnContainerUpdate.Add(replaceDummies)
thank you!! i'll give this one a shot! :)
hmm
that one seems to produce an error, lemme see if i can grab it..
ooh i know
local function replaceDummies(container)
local dummies = container:FindAll('Tsarcraft.BlankCassetteMain')
for i = 0, dummies:size()-1 do
container:removeItemOnServer(dummies:get(i))
local itemChoice = ZombRand(#itemList)+1
local item = container:AddItem(itemList[itemChoice])
container:addItemOnServer(item)
end
end
Events.OnContainerUpdate.Add(replaceDummies)
forgot about that one
i'm giving this one a look! it seems to have.. resulted in a strange bug but im doing a bit more testing
it seems like it stopped producing errors, but instead it just kind of.. removed the dummy item from the drop list for zombies for some reason
huh...
yeah, they seem to just not be dropping the blank cassette at all and it doesn't show up in loot zed, but if i remove that chunk of code and just leave in the drop code i think it works just fine
gonna do a bit more testing just to be sure
also albion i've had you kinda tied up in this for a while so feel free to throw your hands up and go 'well i've helped you enough' whenever you need to, i know this is a lot of free help to expect from a stranger ;w;
are you sure there's no errors? that sounds like it's erroring out
local itemList = character limit
local function replaceDummies(_roomName, _containerType, container)
local dummies = container:FindAll('Tsarcraft.BlankCassetteMain')
for i = 0, dummies:size()-1 do
container:Remove(dummies:get(i))
local itemChoice = ZombRand(#itemList)+1
container:AddItem(itemList[itemChoice])
end
end
if SandboxVars.MFTEOTW.zombiedropA then
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "Tsarcraft.BlankCassetteMain");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 100 * SandboxVars.MFTEOTW.zombiedroprateA);
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "Tsarcraft.BlankCassetteMain");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 100 * SandboxVars.MFTEOTW.zombiedroprateA);
ItemPickerJava.Parse()
Events.OnFillContainer.Add(replaceDummies)
end
```this is how i'd format it, but i'm not sure that is actually the issue
hmm, it doesn't seem to be printing any errors no
oh, this isn't the whole program is it? with that ItemPickerJava.Parse() i imagine this part of another function that runs after sandbox options load
basically though, i wouldn't put the replaceDummies() function inside the main part of the code, i didn't point it out earlier because i think it should still work but maybe that's it
i did give this format a test and that seemed to result in the same problem ;w;
maybe it would like
benefit us if i just sent over the lua file so you can see what i'm doin with it
give this a try
givin it a try!!
yipee!! that solved the problem of removing the item from the list!
but the replacement does not work ;w;
it just remains a blank cassette
.. wait
hmm
i have a couple of ideas as to why that might be
idea one is that maybe i don't need the Tsarcraft. on there for the 'findall' function
inversely, it's possible that maybe it's bugging out because i don't have the tsarcraft. on there for the items in the list
so i'm gonna change both of those things one at a time and see if either one fixes it
first one isn't the case, but at this point i'm almost sure that it's the latter--i bet it's trying to replace it with items that don't exist (the entire list) and just failing and leaving the item there
testing now
nope.. ;w; probably for the best that i added the Tsarcraft. bit to the list now, but that did not seem to fix it
is there a recipe line to prevent queued actions from happening on favorited/equipped items?
like dismantling 10 radios but I have 1 equiped it will ignore that one
use an OnTest function
function Recipe.OnTest.NotFavourite(item)
return not item:isFavorite()
end
it is
is isFavorite() return True/False do you know?
it does
if not item:isFavorite() then
return not item:isFavorite()
elseif not item:isEquipped() then
return not item:isEquipped()
end
end```
or am I overthinking it
you can simplify this to just return not item:isFavorite() and not item:isEquipped()
thank you for all the help once again btw albion! you put a lot of work into making something work for a silly stranger's random mod, i appreciate it a lot :)
aw thank you ^_^ sorry i couldn't fully solve your thing, i honestly have no idea why that isn't working now
tis a shame! zomboid's a weird game, maybe there's some arcane thing about the way zomboid handles zombie corpses as containers that is making this not work
Thanks albion, we're loving more literacy, people are grumbling that they lost their multiplier, but knowing you're working on that big update pacifies them ahha.
i'll come back to the discord tomorrow and see if anybody else has some ideas on how i could manage the zombie cassette spawnrate
so work goes on, no problem that we couldn't figure it out tonight :) always more to try
Do you want me to invite you into our discord albion?
sure!
hmmm, what's the tag for stuff that's "attached" like when you attach a hammer to a belt
There's isAttachedItemā() but it doesn't seem to have the same effect
as per say isEquipped()
perhaps getAttachedSlot()
hmm, I'll try that
little hacky but
if item:getAttachedSlot() > 0 then
return false
end
return not item:isFavorite() and not item:isEquipped()
end```
this seems to work though, I'm guessing that the int that getAttachedSlot returns is the index of a table built to hold the "attached" items
and since lua indexes start at 1 it should never be 0
def annoyed they don't just give us isAttached() though, since that's pretty vanilla
Thank you so much Albion ā¤ļø
Getting body parts is far more annoying
Can I add my own modded clothes to the mannequin's initial equipment?
Xyberviri tried this
And i dont know if he was able to acomplish the task
The thing is the inventory is afteryou place the manequin
Perhaps its possible if you just spawn the manequin
But theres no way to capture a player placing an object
Theres even an unused function
OnDestroyObject
I think it was
But i dont know how that works too.
If you are able to hook a function to the place item command then thats the key
I dont think anyone knows how to do this yet. There arent many mods that does place item i think
Thanks you,. It looks like the mannequin's equipment is defined in clothing.xml, but it would be nice if the mod could add items to this setting from the mod side, but I can't think of a way to do it.
In case someone is curious about how I managed the work with my mod, I've tried to keep the design simple and clean, some parts are a little more complex but I still think it can be helpful to whoever is trying to write it's own mod, so here it is: https://github.com/theCrius/project-zomboid-random-zombies-full
Contributions are welcome, in case it fits the scope of the project. One thing I "hate" about the modding scene is that every one is forced to create a new mod when wanting something slightly different. I'd greatly prefer to integrate new features instead so that the userbase don't have to go around shopping for 400 mods.
In any case, showing the source helps others create plugins/synergetic mods as well, so, there we are š
i cant seem to find anything about how pills work
the items onlysays medical true
but on lua i cant find where it is located
how does it determine the effect
Hello guys, i want to make my own spawn point mod in PZ, but i still can“t figure it out. Is any guide around the forums or something?
Also try posting #mapping they might also know abt this
Ah, okey. THANKS.
U might want to download and looknat references thee are mods that adds spawnpoints
Yeah, i download Pillow Random Spawn as a reference, but i canĀ“t still figure it out. š
Just, in fallout.
That“s the problem, i try to search in the mods folder. But it“s empty. So i can“t really look the files inside the mod when is downloaded in the workshop.
you simply just looked up the wrong folder
Steam\SteamApps\workshop\content\108600
Which folder? š
Anyone know why my mod's sandbox option doesn't showing in some people, but showing on some others?
It's like it doesn't load on everyone
They have to enable the mod in the Main Menu to see the sandbox settings when they are editing the Host config.
It may be that the ones reporting inability to see it do not know this.
It's insufficient to add it to the Host config, unfortunately.
Which... is honestly a bit of an oversight imo.
We're using dedicated server btw, and other sandbox is loaded well, but not with this one, 2-3 player said they got so much error coz this sandboxvars doesn't loaded on their PC
Wanna link me to the mod?
It might be faster for me to subscribe and run it than to speculate
I would say if you're throwing errors from the lack of access to the sandbox vars, then for whatever reason they are accessing them at a time when they have not yet been initialized. This could imply many things, but if it's not throwing exceptions for one person and it is for another, I would guess that somehow the Sandbox Vars are being read in a different context or at a different timepoint in those two scenarios. So, e.g., if perhaps you tested as host with success, but the clients bug, then maybe something about being client caused the mod to try to use the sandbox vars before they became available. In general, I try to access the sandbox vars as late as possible in loading (preferably not until a function call from a live player) because then I can be sure they exist if I've named them right.
However, if I were you, I would still add protection against exceptions thrown by nonexistent sandbox vars by wrapping code that depends on them in a conditional, e.g.:
if SandboxVars.MyModName then
--
end
That way if they do not yet exist they will simply not be used, and the defaults can be used instead without error until a point in time when your code can load them.
In my experience, if I throw errors on Sandbox Variables, it's because I tried loading them too early or because I forgot to restrict a custom keybinding / mouseclick / gamepad click to the player's alive state and thus fires something I shouldn't have in the Main Menu.
Is there something i can so they can load it a later?
It depends on what you're trying to do
If your goal is to load your Sandbox Settings before initializing Mod Options, afaik, no.
If you wait to initialize Mod Options with your Sandbox Settings, other mods will not load after your mod.
I've gone down that road awhile
If you just want to access your sandbox settings, usually simply doing so after making sure your character is alive is fine.
aren't sandbox options initialised before the lua even runs?
local player = getSpecificPlayer(index)
if player and player:isAlive() then
end
No definitely not for clients. I have tried using them in my Lua and it throws errors if I try to just assume they exist when my Lua is loading. @bronze yoke
Using them in variable initialization is not okay.
that was already a bad idea, but i've never observed this and i've had code that expects them before
May work in SP or previous builds but for MP it caused issues for me
If it did work, using my SandboxVars in my Mod Options would have been trivially easy
hmm well i didn't rigorously test multiplayer, but it did have quite a few subscribers before i changed it
then again, this is the same mod that i completely broke for a week and nobody reported it, so...
it's just a bad idea to begin with because while in my experience it's always initialised (it sounds like this may not even be the case) the server's settings aren't usually applied yet
i think there's some situations where they are but generally you want to wait before reading them or you'll just get the default value
Anyone knows the lua command for a server restart?.
Only for admins
Ok nvm i think misinterpreted the question
Ill send you a pm
Uhh... To Find the position of an "=" sign in a string word I should call word.find("=")?
ohh albion!! did u go back and work on it more that's so sweet you're the best
i'll get on testing this soon!! thank u!!
local item = {}
item.userdata = self.item
setmetatable(item,{__index=function(t,k)
local v = t.userdata[k]
if type(v) == "function" then
return function(arg1,...)
if arg1 == t then arg1 = t.userdata end
return v(arg1,...)
end
end
return v
end})
self.item = item
In the end I ended up patching the class table, but this seems promising for next time.
let's gooo
ohhh this gives me so much power
excellent... this feature will now be like 5x as nice as it would have been otherwise
I have problem with something
If the item type is letsay meth_pan
And i decided to change to kt to meth_tray cuz ots more appropriate
The only thing ican change is the displayname right? Otherwise it will break servers with the mod
Imean they will lose the item
If ever some. Player has it
Is there a way via lua to do this without losing their stuff
Can i make like on the script both items the orig one. And the one i want it to be changed into and via lua change all of the first kne to the other? And make the first one obsolete or something
you can't really change the internal name... but you shouldn't really need to right?
you can make a new item and have a lua script that replaces the old ones with the new one when they load or as a context menu action or something, but it's sort of overkill
Yeah was jist asking out of curiosity.
Wizards out there might know a trick
If its easy to do then why the hell not right
I'm still desperate. I can't get my onUpdateZombie event to work anymore (like I already described yesterday). I created a new Server Instance (Local Hosted). I added only my (new) testmod to the server and beside of some scripts, textures and models (which all work), I just have a single lua file /media/lua/server/test.lua
local function OnZombieUpdate(zombie)
zombie:setWalkType("sprint1")
zombie:setCanWalk(false)
zombie:transmitCompleteItemToClients() -- not sure if this is even needed
end
if not isClient() then
print("Add event")
Events.OnZombieUpdate.Add(OnZombieUpdate)
end
I can see the "Add event" in the log:
LOG : Lua , 1668546218341> 41ā654ā513> Loading: C:/Users/Peter/Zomboid/mods/SoulModClubTest/media/lua/server/test.lua
LOG : General , 1668546218341> 41ā654ā513> Add event
But the zombies don't get the sprint1. I have no clue what I'm doing wrong. I can't finde my error and I have no idea anymore what I can test...
there was a guy once who had to purge an item from server and he was replacing everything, there might be tools/help in mod support
not all events trigger on both sides
hmm... most of the time I tested in solo. I really start to think if it never worked on server. But I think I've seen other mods which manipulated the zombie on this event (server side). But I'll check this...
If i have a recipe that just do 1 thing like say oncreate: then it just allows you to say your coordinate for example
Then theres no other required item and you have that 1 item and you set it to keep
You will have a context menu of one and all
If you click all you will lag
Is there a way to remove that "all" context menu so that i can continue to do function only items without the risk making players go endless loop lag
Yo @silk hollow just posted something earlier related to this
Here
Whats the sprint 1? Maybe its syntax issue? Or you should require a lua ? Idk
Might want to try renaming test.lua
Idk i feel like its jinxed or something lol
no this is a fixed string which is accepted. If I spawn for example a new zombie then I can set it to sprint1 and the zombie is sprinting...
I bet you need onservercommand
but I'm really not sure about Poltergeist's statement. Did it really work on the server. I have to check.
You have tried onServercommand before?
Heres wizard tyrir explaining the differences
This is not what I want. OnServerCommand is executed on the client afaik.
And heres senpai Konijima giving a perfectly useable template
Yep but i think zombie owners is a thing
I used my own function for this:
function SoulMod.server.SendCommandToClient(command, parameters)
print("SendCommandToClient")
if not parameters then parameters = {} end
if not command then
return
end
sendServerCommand("SoulMod", command, parameters)
end
But my game also don't recogized the sendServerCommand anymore... But I'm sure that it worked before...
I used a ClientCommand to call this on the server
function SoulMod.server.commands.SendAnimals(player, args)
print("SendAnimals")
SoulMod.server.SendCommandToClient("ReceiveAnimals", Animals)
end
and the list was sent back to the client...
And it has something to do with client but ireally havent tried to mess with em
As far as i know theres a debug event on admin context
And it doesnt show on other players
And so it means it can be shown if theres a server client pingpong
Hmm.. have you looked at accelerating zombies?
Maybe the answer is there
Have you tried removing the local on the function?
Also you might want to define the specific zed instead
Like for loop and look for isomovingobject and stufflike that
Can you try print(zombie)
print(getType(zombie))
I tried to print first and then tried to change the zombie like above. But I try to find out if the Update is even called on the server...
hey question
if i want an item to potentially have a chance to drop twice on a container, should i just put a second entry into its loot table for the same item
I remembered Tyrir sent me a script to check which events are fired...
#mod_development message
After executing it it seams thet the onZombieUpdate don't fire on Server. So obviously I never checked my code on a Hosted Server. I just was confused because when I spawn my own new zombie on serverside setting the speed etc. worked.
But thx for your support.
yeah that's how you should do that! you can give them slightly different drop chances to tweak the chance of getting 2 vs getting 1
yeah that was the plan! thank u :)
@bronze yoke https://i.imgur.com/en6CzSu.png
just a heads up, i gave you a special thanks credit! (I'd have given one to tyrir too for past stuff but i think tyrir prefers not to be credited)
aw thank you ^u^
Lets say there is an item like Base.Katana, which seems to spawn too often in some mods and renders the game too easy. Does anyone here has a small lua script that removes an Item with its ID from ZombieLoot and City Distribution?
why cant i put moddata on a getBuilding()
because isobuildings don't have moddata
with exceptions, mostly only objects have moddata
that is, descendants of IsoObject, not the programming concept š
Im starting to look at java side codes now but i dont understand em still
Check out arsenal it overwites brita distrib
isn't arsenal a dependency of brita?
yeah that doesn't sound right to me
OnTick doesn't work on server side?
I would be surprised.
Whose ever mod this is, please...
Kind of wish prints included the file they're from
anybody interested in making a working phone mod. basically a flip phone that can call other cell phones, each phone would have a different number. so if a player drops there phone another player could get it and have that phone number.
sounds dumb and unrealistic but for normal pz maybe players could rp getting cell towers up and working
for me personally i have a no zombie rp server so it would benifit me very much. haha and my players, it could be a simple ui skin that does the calling and texting. or if you want to take it farther with skins and what not by all means, i'd love to personally commision it just name your price,
I use FileLocator on my mod repository in such case
Ye i see that alot before too. I think its scrap armor but im not sure
I think its triggered when u right click a wall or something
But im pretty sure it still overwrites the distrib
Ow jeez the meth mod is doing the error thing again
My brain aint working anymore its 10am already i havent slept
Add all the tiles of the room on a table and modified each tiles moddata
After a delay
Loops the table remove the moddata of each tile
And nil the table
Where is that thing causing the error ... Could it be syntax.. ow man
That would be really bizarre. Why would Brita have distributions at all if its own dependency overwrites it?
that's removing vanilla stuff innit?
function RemoveItemFromDistribution(_dist, _item, _chance, _dorecursive)
i just thought it did cuz of the lua name
inever really checked the code
hahaha
atleast now i know
i always thought there was a reason for doing that.. sorta like a patch to its own mod for upgrades and stuff... idk lol no wonder i was confused whenever people talk about arsenal
why does brita exist at all when like 95% of its scripts and code are in its dependency š¤·
it is a little odd
i always assumed it was so they can be updated independently. ie: lazy collaboration
i dont mean that in a negative way, just requires less communication and passing file back and forth
aren't they the same developer?
i guess that makes sense then! i only had a brief look but that basically describes the majority content of each mod
Why? anyway, OnTickEvenPaused worked
ontick definitely works server side
yeah absolutely
I just used it, but I didn't get any results
---shared.lua
Events.OnTick.Add(function(tick)
print("test")
end);
were there any players on the server when you tested it?
if not, the server was paused because there were no players, so a normal ontick won't fire
Probably was that
I use serverside ontick to check the condition of every vehicle currently occupied by a player, works very well
I still feel that server side works differently than in other games work
I can't find a way to detect damage to an idle vehicle, bummer. I'll have to look at other vehicle mods to see if someone else has figured it out
that's a setting
fysa
i would think most servers keep that on so that time passes in expected ways
i certainly do
that's true, happens every time you right click
there's also other mods that copied the sledgehammer logic and left the same print
one of the mods even had two or more prints in this exact place
Haha š i just went with it .. it made looking backing at logs and investigations alot harder with all the spam
Why not ask brita ? š
i already got a pretty good explanation
Im curious about your door hp and floor spawning problems @summer rune any progress?
did you find why objects vanish?
nope, but i did discover that the bug only occurs when there's a rain barrel at z=0
potentially, it's something like 'rain barrels above the lowest one in the world don't work', not 'rain barrels above z=0 don't work'
i'm going to have another look given that extra information, but it's likely to be a java issue, and i haven't noticed any negative side-effects to the AddToWorld() solution
and this happens only when you build it or also when you place it
i don't know, there's no naturally spawning rain barrels in the vanilla map
Whats the diffrence with ipairs and pairs again
I mean up till now i cant seem to remember and always end up figuring it out everytine i need to use one of em
ipairs only loops through the numerical keys
I mean pick up / place
Ow ok thnx haha im sure ill forget it again
do you have mods that change building logic or tilesheet
i wouldn't test a bug with mods activated
I have no errors, but I test on Host.
can some one make a Ballgag mod?
thanks, that helped. š
I mean the screenshots u posted.
Yeah well i was wrong that arsenal renoved britas but atleast theres a remove distrib thing hehe
Hows the door hp mod?
Errors here and there, because I want it to track the HP of all player build structures including barricades. However barricades dont have a HP u can read out. U can only read how much % dmg they have taken. So there is a lot of special cases.
+TimedActions
+Server has to check the HP as well. Because the HP is not always reliably synced across clients
So you stopped doing it for now?
Do you mind sharing how exactly did you implement setHealth() for IsoDoors?
I did not implement setHealth(), neither did i use it. Some other modder of us overwrote the whole ISDoor Implementation
calling setHealth() is not working afaik.
That error might indicate a file was not found, if that's those are the right error codes
Is your mod.info present with its thumbnail image?
ok so I was using a simple player:playSound but it seems to have stopped working, playSoundLocal works though
how do I add a sound for an isoObject
getFreeEmitter and play or something?
square:playSound is a thing, lol
Yep.
i'm back to working on my diabetes mod after months away and i'm so confounded. i remember writing NONE of this code. without my previous comments i'd be lost
my last couple sessions have just been annotating my functions. Its easy to overestimate how much you'll retain without documentation
YEAH seeing all my comments really makes a lot of the workshop items i'm digging through to learn the ropes as inscrutable as monoliths to some dark god. dear people who annotate their code: i love you.
Still stumped
Hiya, just a quick noob question, how could I go about shrinking the size of the icon of an item when it is dropped on the ground?
I believe there is a way to do this without shrinking resolution a ton?
Is there a function to call to make the player update their locally saved sandbox vars when connecting to the server?
I've ran into an odd issue where they seem to be updated when the player is disconnecting from the server
And it's causing issues with desyncs on client-side functions that use configuration from the sandbox settings
I probably should report that to the game devs instead as a bug?
that has definitely worked for me, if that really doesn't work it's a recent issue
make sure you don't have some weird mod breaking it, and then yeah i would report it
I have only the mod that wants to use these variables
Hmmm... So... Any.way I can forcibly read the variables off the server?
Step one?
i'm no longer able to reproduce this either
it must've been silently patched in 41.78, since i couldn't find any patch notes that seemed related
that means they patched it about 10 minutes before my mod that needed it came out, which was pretty considerate of them
Hello would appreciate it if anyone could help me understand how specific zombies (or their outfits?) spawn chance works.
take e.g. table.insert(ZombiesZoneDefinition.Default,{name = "AuthenticBiker", chance=0.05}); from AuthenticZ. would a higher chance value increase the amount of Biker zombies spawning in the game or instead lower it? I'm confused because the mod "TheyKnew" has a sandbox setting which should decrease the spawn rate of a certain zombie type the higher you set it, except when looking at the source what is fed to the "chance" column gets higher instead of lower.
you could check the variables later, like OnTick would that work for you?
No no... I'm reading the variable per tick while a timed action is going on
Directly from SandboxOptions
The server owner is balancing a mod via sandbox options
Server is being reset and all
It worked for them
But me? It behaved like on my old settings
Map_sand.bin is the file they're save in locally, per account for the multiplayer saves
I then tested the mod on a local server. Shut down the server and game, let the mod load a new set of default sandbox settings(by deleting the mod's section)
Verified that the server has new variables loaded in properly
Then joined in with a player who had the old settings in their files. After joining, the file remained
But once they left, they updated to the new ones
Another really really wierd question. Is there away to get the zombiod version or build number from a method call ?
Heya, ive 3d modelled a bandana using blender and I want to add it to the game, is there a tutorial on how I could do so since youtube wasnt much help,
Any advice would be great
Is it possible to reduce perk levels (and respectively the xp for them)? Toying with the concept of a trait that sets skills to 0 but treats them all as skills that started at 3 or higher by adding the skills in normal character creation then taking them away on spawning (opposite to some traits from more traits which don't count for xp as they get added to the character in OnNewGame)
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/ This link is pinned in the #modeling
That channel might be more useful if the people paying attention to it regularly know more about modelling
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
Thank you!
you can just set the multiplier yourself, you don't have to do anything complicated like that
IsoPlayer:getXp():setPerkBoost(perk, level) (where level is 0-3, granting you the perk boost you would normally get if you started at that level)
Thank you š
there's also an IsoPlayer:level0(perk) which seems useful
Please could I ask where to find/access the error log?
Found it in the zomboid users folder
~~Message from the devs:
weapon/vehicle/character textures need to be a power of 2 in pixels of size (256, 512, 1048, 2096, 4096) from build 41.78.8 forward. This is to improve performance and memory management.
Issues with transparent pixels may otherwise result.~~
EDIT: The issue was resolved.
Yes, there's a version object that houses a few methods
If you're trying to version lock your mod to can just use version min in the mod info I believe
Speaking of which I need to update those
is that about pixels?
Sorry, pixels, yes.
yea im not fan of people there do multiple version of the mod for each patch of the game.. but i would like have if it below version x.x.x it shoudl do this instead of else code
also do you have an example on it
I'm not at home at the moment but if you have vcs or intelliJ and a copy of the decompiled code you should be able to find it pretty quickly
i have one kind of decompiiled verson i guess or wait that was before i change computer ĀØ^ so yea only got utimate version at intellij lol
it's getCore():getVersion() isn't it?
For a trait to be usable in HasTrait, what do you need to do? I've got it appearing properly and it can be selected but the error "attempted index: HasTrait of non-table: null" appears when I attempt to use it in an if statement
that's not a problem with the trait, that means whatever you're calling HasTrait() on isn't a player object
is HasTrait a static method? if its no then they're calling HasTrait on nil
Oh, right, thanks.
Wait, fudge, I wasn't passing _player into the function; would that be it?
you should be calling player:HasTrait('TraitName') (or whatever your player variable is called)
The full line is if player:HasTrait("eagerBeaverTrait") then
I think I've just not set the player variable properly. One mod I'd looked at as an example set player to _player (passed to the function) although another uses GetPlayer()
getPlayer() would work, but it wouldn't work in splitscreen (which nobody uses, but we should probably still plan for it anyway)
is your code linked to the OnCreatePlayer event by chance? that sounds like how you'd write a trait like this
the second variable passed from that event is the player object
modules system
---manifest.lua
game_version '41.78.7'
author 'Dislaik'
server_files {
"main.lua"
}
---server.lua
print("Wait 10 seg");
Wait(10000);
print("Wait 5 seg");
Wait(5000);
print("End Waits");
It was tied to OnNewGame although I'll swap that.
I changed it to GetPlayer and it's now thrown a different error, so hopefully progress.
Exception thrown java.lang.RuntimeException: Object tried to call nil in EagerBeaverSetXP at KahluaUtil.fail line:82.
I do apologise for a bit of lack of knowledge; I've only touched C++, c#, python and dm prior to this and not lua before.
it should be getPlayer(), not GetPlayer()
OnNewGame wouldn't work in multiplayer i think - and it might not work if you make a new character after dying either
using OnCreatePlayer does create the extra problem of needing to store whether it has happened or not though, as that will fire every time you load in - you can just use moddata for that
doing something like this would solve that issue - mod data is just a table that's stored on objects, and crucially it persists after saving and loading
if player:getModData().traitNameApplied then return end
-- the rest of your code as normal
player:getModData().traitNameApplied = true
I'm playing with Soul Filcher's Exploring Time, and I noticed that they've updated to not allow Gasoline in Bottles. Is there a patch or another means of playing with a more potable source of Gas for my lanterns? Thanks
Thanks. I do know that capitalisation should be the same but apparently can't read today.
wait till you get to getXp():AddXP()
I never get that one right with first try
Which log should you be checking for the most recent error? There's 5 debug logs and 5 console logs so not really sure what to start with
go a folder higher, console.txt is the current launch of game
Thank you
if you use the steam launch argument -debug, you can press f11 to view errors
sometimes you'll need the console.txt anyway but it can be a lot faster
vehicles have both getId() and getID() and they do not return the same number
Thanks; using -debug does make it a lot smoother.
Hm, so no more errors, which is good, but not actually seeing an effect.
player:getXp():setPerkBoost(Sprinting, 3);
and other setPerkBoost lines are run without error but the character doesn't have those boosts
I've been using the names of perks from the zomboid-javadoc website in case that might be an issue
Perks.Sprinting
Thanks; would this be right?
"player:getXp():setPerkBoost(Perks.Sprinting, 3);"
i think so, yes
of course ^_^
Ive made a mod file, coded it according to a yt video and put it in my pz mods folder but its not showing up when I boot up the game, any reason why?
did you put it on C:\Users\YOURPCNAME\Zomboid\Workshop? there is an example mod too
Havent uploaded it to the workshop yet, just but the folder in my mods section of pz
Do I need to upload it to workshop to even view it privately now?
It not necessary, that path is at least it's the one I use to see/test my mods in development
So uploading it to the workshop might resolve my problem?
No
There is two directories - one called workshop and one called mods
The game pulls mods from either one but they have different file structure expectations
You don't have to upload it for it to be read locally from the workshop folder
But you may have structured your mod in a way that it wouldn't work in the mods folder but would in the workshop
Without seeing how your mod is structured no one can tell
And Eager Beaver is released. Thanks š
Is there any mods to control how much fuel your generator use for a dedicated server can find the file to change that so either that or a mod would do thatās good
Isnt there a sandbox option for that - or is that just cars?
Itās not sandbox itās through a hosting service with bisect
The game has sandbox options regardless - MP has additional configuration options
For a dedicated server, you probably have a file with settings you can change - but not sure if there's one for what you need
Is it possible to send a chat message to a radio channel from the server (not from a client)? I want to create my own emergency broadcast.
I went through a bunch of files with the website couldnāt find any options so if there is a mod for it that would be a good solution but couldnāt find that either
If not then itās gonna be rough for ppl who work to make sure gen is always on so good donāt go bad lol
there are definitely options for that
care to elaborate a bit? i could not find one option to create my own emergency radio chat.
oh, sorry, i was responding to someone else
is there a lower (and upper) limit to the "table.insert(ProceduralDistibutionsList" chance? i've been fiddling with it on a mod that adds tons of items and it doesn't seem like it has much effect
-- Hello all! Extremely new to Lua and modding (I have 3 entire hours of experience). I am running into a loot distribution issue that's in vanilla PZ. I can no longer find instances of Base.Journal in any of the normal locations when searching in game. - Checking the Distributions.lua file, I see a single entry with a weight of 4, in the "SideTable" group under the All heading group. In Rooms - Bedrooms, sidetable is called with a procedural list BedroomSideTable, in which the Journal doesn't exist. There's also a LivingRoomSideTableNoRemote & LivingRoomSideTable procedural lists. So my question is - Where the heck am I going to find a SideTable that isn't in a bedroom or livingroom? And specifically what I mean to ask is: What tool would allow me to parse or view the instances and locations of containers designated with "SideTable" that aren't in a bedroom or living room?
I'll have to add, that the All heading further gives definitions for many SideTables with zero loot in places like furniture stores / warehouses etc.
I'm almost wondering if they've accidentally removed it from the game.
i did feel like i had almost never seen the item... and from what i'm reading of the code, i have to agree that there doesn't seem to be any spawns for it
it looks like you can get it as a junk item from foraging... but that's it
Welp. Guess its time to research modding in a recipe to cobble together a notebook & magazine into a Journal. If you're wondering its related to the Examine Corpses mod. It calls for a Journal to create the recipe item.
Thanks for the info!
yeah, now that i'm looking at the item in-game, i don't think i've actually *ever* seen a journal before
and going through the expected containers with lootzed confirms that the item isn't set to spawn in them
They were exceeding rare a couple patches ago. But since then, it must've been changed to exclude them accidentally. They're still listed in that single table, but its not called anywhere now that they've changed the names of those two procedural lists.
perhaps it's because it pretty much shares a function with the notebook? same sprite, just the journal has twice as many pages (which i'd bet there are few people who care about that)
also, when dropped, the journal uses a newspaper model... maybe it's not meant to be used anymore?
does IsoRoom:getWindows() not work like I think it does? I don't appear to be getting an arraylist of windows
You could also just make an override to the mod that's asking for a journal.
copy their script to craft the recipe using the journal, change the journal to a notebook, throw the override in a mod you're uploading and make sure it's loaded after the mod you're trying to overwrite on your server's mod list.
that has downsides, ofc.
if the mod author pushes an update and changes something in the file you're overriding, you'd have to actually stay ontop of that and manually add the changes to the overwrite (if you want the changes).
but, that's pretty much the easy solution to tweak mods how you want them to work. (without reuploading someone else's mod)
(also make sure the file you're making is named the same as the one you're overwriting, and is in the same folder path.
so, meme.txt in /scripts, your overwrite is still gonna be named meme.txt and is still gonna be in /scripts but it's in a separate mod you're uploading and is loading after the original mod)
@hearty dew hey boss, sorry for the ping but you're the master of this particular thing. I'm trying to get a Field on an IsoPlayer that it inherited from IsoGameCharacter (its SUPER class' Super class). Is it possible with the reflection stuff exposed to Lua? Iterating through the IsoPlayer class fields doesn't seem to find it
it looks like I need to use Class.getSuperclass which doesn't appear to be exposed
If it is an instance field, it should work with the reflection stuff exposed on the GlobalObject. At least I thought it did
If you use that inspectJava function, it would print out everything that is accessible
I don't believe so, it relies on Class.getDeclaredFields, which doesn't show inherited fields, you have to call Class.getSuperclass() to get those, I believe
If it is a static field, you can read it via IsoGameCharacter.staticFieldName
its instanced, unfortunately
hitlist and attackvars
I have an interesting problem where my crafted item disappears when I move it from a "container" (an oven) to my player inventory. I replace an item in the OnCooked method which is defined in my first item. My code looks as follows:
function PotWithFishGuts_OnCooked(item)
local character = item:getPreviousOwner()
local resultItem = InventoryItemFactory.CreateItem(item:getModData().SoulModReplaceOnCooked);
if not resultItem or not instanceof(resultItem, "DrainableComboItem") then return end
resultItem:setUsedDelta(item:getUsedDelta())
resultItem:copyConditionModData(item)
resultItem:setPreviousOwner(character)
local container = item:getContainer()
container:AddItem(resultItem)
container:DoRemoveItem(item)
--character:AddXP(Perks.PrimitiveCrafting, 4)
end
The item is removed and the new item appears in the oven. But when I drag it to my inventory it disappears (I can see it for a second in my inventory). Do I have to call something special?
does this issue occur in singleplayer?
no just when i host a game...
is there any way to view the zombie heatmap
of like.. ur actual save
ur set of maps
etc
if not, what files govern it? can i somehow look at that?
i have VANILLA cells with seemingly psychotic heatmap, out in the woods with 7000 zed count
double the main strip of md
which is around 3800
local container = item:getContainer()
container:addItemOnServer(resultItem)
container:AddItem(resultItem)
Yea, it doesn't. I hadn't run into this situation yet with fields, and it appears they aren't accessible using an IsoPlayer instance and those reflection APIs
boo urns
you might need to use container:removeItemOnServer(item) too
Uhh, How I get all player inventory included backpack on back, and backpack on his both hand?
Might be able to get the Field object from an IsoGameCharacter somehow, then use it with the IsoPlayer instance. Tricky part is getting an IsoGameCharacter instance from the java side somehow
Sounds promising . I'll test this.
IsoGameCharacter.new might possibly work
getPlayer():getInventory():getAllItems()
I think it doesn't work with this code below right? I need to gather backpack, main inventory, pouch, toolbelt so I can getItemsFromFullType from each attached container on my body, so I can add Context option the Curreny.Wallets item
local playerInv = getPlayer():getInventory():getAllItems()
for k,v in pairs(Currency.Wallets) do
local items = playerInv:getItemsFromFullType(k)
.
.
.
playerInv:getAllTypeRecurse(k)
like this?
local playerInv = getPlayer():getInventory():getAllItems()
for k,v in pairs(Currency.Wallets) do
local items = playerInv:getAllTypeRecurse(k)
yep!
Thank you! I am going to test it ā¤ļø
Btw, I find out that v:isInPlayerInventory() only check player main inventory, is there any chance I can check other attached container (like backpack) too?
oh wait, hold on, i just noticed that playerInv is the result of getAllItems() and not the container š
i think if you wanted to do it on an already gathered list of items you'd probably have to parse through it and check it manually, i would just use getAllTypeRecurse(k) on the inventory container
Your solution seems to work... Thanks.
Finally I can go to bed š
The original code was like this, but It's only get player main inventory and I can't find another solution to able collect all inventory container (main inventory, backpack, etc), Any idea?
local playerInv = getPlayerInventory(playerNum).backpacks[1].inventory
for k,v in pairs(Currency.Wallets) do
local items = playerInv:getItemsFromFullType(k)
the getAllTypeRecurse() function will search through any containers it finds within the main container
i've never seen getPlayerInventory before though, is that a custom function?
getSpecificPlayer(playerNum):getInventory() should suffice
I think it's vanilla function, because I cant find the function on the original mod
local playerInv = getSpecificPlayer(playerNum):getInventory()
for k,v in pairs(Currency.Wallets) do
local items = playerInv:getItemsFromFullType(k)
like this?
yes that should work!
i'm unsure, i can't see it on the javadoc but if it was working for you it must exist somewhere, maybe it's in vanilla lua or something
ah that was it, it's a lua function not a java function
Just tested it, but the getInventory() still return main inventory and not included backpack within it
try getInventory -> find backpack item -> getContainer() or something like that was
anyone know if there's an available source or reference for the native C/C++ functions?
do you mean the java functions?
you can find those here https://zomboid-javadoc.com/41.65/
Javadoc Project Zomboid Modding API package index
nah, the native functions. I'm assuming they're C++ but it could be C, similar enough. (if they were Java functions, they wouldn't need to be called natively)
mainly from PZPopMan64 but I figured if a reference exists, it's more general/broad than just that one module
can check the decompiled java for zombie.popman.ZombiePopulationManager.class most of them should be listed in there
private static native void n_init(boolean var0, boolean var1, int var2, int var3, int var4, int var5);
private static native void n_config(float var0, float var1, float var2, int var3, float var4, float var5, float var6, float var7, int var8);
private static native void n_setSpawnOrigins(int[] var0);
etc etc
though theres not going to be much info on the args that way
sure, the declarations are there, but there's no implementation information unfortunately
those would be in the DLL (and there's no real way to decompile it, at least not in a way that'll produce anything meaningful)
Anyone mind enlightening me to a way to generate a sound (or anything) that draws zombies to your character location?
Really specifically I'd prefer to find how Shout does it if that's in the Lua somewhere, but I couldn't find it...
addSound(source object, x, y, z, radius, volume)
Tysm
you can deduce it with the input variables that are used like
n_config((float)zombieConfig.PopulationMultiplier.getValue(), (float)zombieConfig.PopulationStartMultiplier.getValue(), (float)zombieConfig.PopulationPeakMultiplier.getValue(), zombieConfig.PopulationPeakDay.getValue(), (float)zombieConfig.RespawnHours.getValue(), (float)zombieConfig.RespawnUnseenHours.getValue(), (float)zombieConfig.RespawnMultiplier.getValue() * 100.0f, (float)zombieConfig.RedistributeHours.getValue(), zombieConfig.FollowSoundDistance.getValue());
optional parameters are stresshumans (boolean), zombieIgnoreDist(float?), stressMod (float)
not really sure what zombieIgnoreDist does, but i imagine stresshumans will cause humans that hear it to gain stress equal to the stressmod or something
Now to figure out how to call the WorldSoundManager
addSound() is on the global object
that's one thing, but the specific functions I was looking for are n_initMetaGrid, n_initMetaCell, and n_initMetaChunk
which have very little in the way of context clues, at least in terms of their specific functionality
there are bits and pieces in worlded's source code that I can use to figure it out probably, but I was hoping to see how the game reads the chunkdata files directly
the bitwise nature of the data there is pretty clear to me, but how it's structured or determines which byte goes to which coordinate... isn't at all lol
looks like zombieIgnoreDist is the range where zombies won't be attracted to it at all - i expected it to be if they're too far, but it's actually if they're too close
i guess it's to stop nearby zombies bunching up one tile or something
Weird.
Oh I see, I had no idea that native make reference to a C function
Well I'll experiment starting with something like local player = getSpecificPlayer(0); addSound(player, player:getX(), player:getY(), player:getZ(), 10, 10) and see what happens
yeah, either C or C++
I'm assuming the latter, but there's no way to know I don't think
Try looking at forage luas you might find it there
Look interesting, I will take a look
Report to the modders comment section too
(either way, it's pretty much impossible to decompile it in the same way you'd decompile Java/C# - so there'd need to be some sort of source reference provided by the devs elsewhere. I doubt it exists publicly, but I figured it wouldn't hurt to ask lol)
the DLLs also don't appear to have any outward COM interface, so that strikes that off the list (which isn't super surprising)
Hi, I got some question about override vanilla base item, I tried to change the container capacity from vanilla base backpack, it changed on admin spawn, but it doesn't change on natural spawn (still with its old vanilla capacity)
@bronze yoke I'm seeing it labeled x, y, z, radius, radius in places... lol game files so wonky
What wizardry is this š±
honestly, considering that it doesn't make a sound i'm not sure what the difference is
oh it's a multiplier on zombie attraction
so i'm guessing the radius is the range, and the volume is the chance to attract in that range (among some other factors)
You cant find the sandbox options? Ur playing sp..
looks like it!
Nice... I'm gonna try 10, 20 and see how it rolls
reading the java with all this 'varX' nonsense makes things a bit confusing but i'm pretty sure everything i've told you is accurate
Thanks
Definitely 15, 10 "worked" subjectively.
It got some attention from nearby zombies
yeah i think it's something you'll just have to tinker with, not much way of knowing how it'll behave just from maths
Percent of some kind tracks with what I saw in the Luas
That "volume" / "radius" / "percentage chance zombie reacts" ranged from 1 to 100 in files I checked
Use the zombie map on debug
it's not exactly that simple, there's a linear attraction dropoff over range and some stuff depending on whether it's indoors or not
@bronze yoke Yeah and apparently no matter what I set, I attract every zombie in range of the first radius variable
Horizontally at least
that's not the heatmap
that just shows buildings and current zeds within a tiny area
huh? it's volume
which is just a multiplier on attraction
the only time it takes verticality into account is the ignore range only applies on the same z level
otherwise zombie attraction is essentially 2d
@bronze yoke I cannot tell you why, but I can tell you that this:
local player = getSpecificPlayer(0); addSound(player, player:getX(), player:getY(), player:getZ(), 20, 0)
Does the same thing as this:
local player = getSpecificPlayer(0); addSound(player, player:getX(), player:getY(), player:getZ(), 20, 100)
...in an empty field.
What do you mean by heatmap? Is there such a thing
ZombiePopulationWindow.OnOpenPanel()
hmm...
Switching back and forth
Very confused on the purpose of that variable
IF it were vertical distance this could make sense
I dunno gotta find more places to test
it's definitely not vertical distance because i'm looking at the source code
there's no accounting for z at all
Piedpiper mode
(except the minimum range thing)
Maybe it affects how precisely they track the sound???
Nah
Never mind that theory
Hmmm
i really don't understand that... both related functions multiply by volume before they return, so if it's zero it should always return zero... maybe it's just not used for what i think it is
in case anyone in the future is searching for something similar in this same vein and I don't figure out what I'm trying to figure out, this is what I've deduced so far:
(rough, somewhat rambling notes that I didn't bother cleaning up yet, pardon my dust)
// messy chunkdata file format scratch notes below
// -----------------------
// first two bytes are trash, always 00 01
// then there's 900 entries, so that's easy - 30 x 30, it's chunks
// BUT each section of chunk data is of a variable length
// so we need to figure out how the data corresponds to the header/pack
// I'm guessing the pack binary will be the key here, with the count or something, need to finish polishing the read code there
// but essentially it's each square within the chunk that actually has data, ignoring the rest? hence the difference in size
// each byte should in theory be a tile though I think, unless there's a byte at the start
// which would explain why the empty cells have exactly 900 bytes of (usually) empty data, but maybe that's a byproduct of the export process
// cell x=0 y=16 is very weird because it's filled with 0x03 instead of 0x00, which I think means every tile there is considered "solid" and also "north walled"
// but it's also the first cell that exists, so maybe that's notable in some way```
Yeah, very odd. I ended up just setting it arbitrarily near the value used for breaking doors, just in case it starts actually doing something
But regardless my trash talking is now attracting zombies correctly so thanks for that
Gonna just pull within 8 tiles when the trash talk fires.
Ahhhhhhhhhh
That would make so much sense
And also my chosen value is fine if so
Quieter than breaking a door but louder presumably than some other stuff.
it's a set of data
baked into each map
that determines how much zed spawns in each cell
each square even
Ow ok
I'd like to learn how to create a mod that removes the arms from these three leather jackets that already exist within the game, or potentially add variants of the jackets without the arms? I'd still like to be able to see whatever the player character is wearing underneath said jacket though.
-Barrel Dogs Leather Jacket
-Iron Rodent Leather Jacket
-Wild Raccoons Leather Jacket
I have no knowledge about modding, or modding software in general, but I feel like this shouldn't be too too hard to accomplish. I just don't know where to start.
Is this even possible?
u probably want to learn how to mask them
not sure if its possible but thats what i would try ifm to make a mod like that
š
That's a start! Thank you.
is the reload lua files functionality still broken for people? I can't reload any of mine currently
Steam is not downloading any mods anymore when i unsub and resub. Someone else with the same problem?
yes. tried it for 1 hour now. different ways. it is working now... restarting computer helped. restarting steam and killing processes did not help. very weird
maybe something to do with the last steam update
unsubbing did not even delete the files. anyway it is working now as intended. thanks š
it should. and it did not. now it does. but only after the full restart.
ah got it. thought you mean it will not, regulary
likely because there was still some cached steam files in RAM
so yes, restarts usually help because they clear the RAM
My mod is downloaded on my local game client. However when my dedicated server starts and tries to pull my mod from the workshop, it fails. I did almost no change regarding to last time, when it worked. Only thing i changed was adding 2 print outputs to the code.
coop-console.txt:
LOG : General , 1668680381097> 293,767> Workshop: download 0/18833120 ID=...
LOG : General , 1668680381192> 293,862> Workshop: onItemNotDownloaded itemID=... result=2
LOG : General , 1668680381193> 293,863> Workshop: item state DownloadPending -> Fail ID=...
appworkshop_108600.acf:
{
"manifest" "4833560570148361230"
"timeupdated" "1668683365"
"timetouched" "1668683800"
"BytesDownloaded" "0"
"BytesToDownload" "16496"
}
Is there a log file that can tell me an exact error, why and where it is stopping?
Maybe sharing the mods code would help us see whats going on
there is not "one" mod code. it is about 20 mods and patches combined in one mod. and it worked yesterday and now it does not. my client can download the mod. but the server cant. i am wondering if there is a detailed log where the download process stops. since the coop-console just logs one abstract entry
i deleted all of the mods except one with a mere single print statement. still the same error
I'm currently working on something that needs to store a whole lot in modData and everything is working fine, until I quit and load my save again. After the reload everything from my modData is loaded back, except this resultClassConstructor = function(...) return ISDoubleDoor:new(...) end
Does someone in here know why this won't get properly saved?
I've thrown in a log message where I access this field from the modData and when I didn't reload the save it has access to it: ```
LOG : General , 1668686626430> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG : General , 1668686626430> resultClassConstructor
LOG : General , 1668686626431> closure 0x1628397420
LOG : General , 1668686626431> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Once I've reloaded my save it is nil: ```
LOG : General , 1668686651534> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG : General , 1668686651534> resultClassConstructor
LOG : General , 1668686651534> nil
LOG : General , 1668686651535> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'm fairly certain you can't store a closure in mod data
Anything outside of your more basic lua types (number, boolean, string, table) may present issues
e.g. userdata, threads, closures
Damn, but thanks for your reply. Kinda kills my otherwise working approach. Will have to think about something else then...
What are you trying to accomplish?
Are you trying to capture some variables in a closure for use at a later time?
I'm working on an improved CrafTec version (with the go from blindcoder).
any ideas what happens when a player dies? does it destroy all the mod data? it does im sure.... just wanted to confirm
and if i have the player restricted to move
will it return the controls ? (same question if they log in and out)
getPlayer():setIgnoreInputsForDirection(true);
getPlayer():setIgnoreContextKey(true);
getPlayer():getIgnoreMovement(true)
im going to test this anyways but if someone has any idea that will save alot of time
Quick showcase
Think the player's mod data is copied to the isozombie created from the dead player @ancient grail
So once the ghost object is complete I execute the defined constructor of the actual TIS object to create the actual ISObject
Is it not possible to save in moddata the type (as a string) and the parameters required to call the constructor?
In other words, directly store the variables into moddata that you were trying to store in the closure
(if some of those variables were userdata types (e.g. java types), you'll need to handle those differently)
or even simpler, just build a model that stores raw data and then rebuilds the constructor based on that data
i.e. turn it into a state machine, where the state integer that's saved resumes the machine at a certain point, along with variables for the position, progress, materials needed, etc. in the most primitive form possible
imo storing complex structures in moddata is a bad idea anyways, i don't know the details of how it's stored but i imagine network reproc shits out massive packets if you're storing massively unnecessary data
ow ok thnx
is there a way to get a zombies location base from a specific square.
im looking for like square in x:12 y:43 z:0 and nearest zombie from there thats distance is withing 10 squares in direction north gets shot kinda deal
Alright y'all it's time we address something
Are these devs blind or do they just never go outside?
Why is night borderline pitch black?
And how do I fix this atrocity
What is this statement doing at the top of some of the lua files im looking at?
ISInventoryMenuElements = ISInventoryMenuElements or {};
Never seen that syntax before
It says it equals itself or an empty new table if it doesn't exist already.
@lyric bolt
Hmmm... trying getClimateManager():getClimateFloat(2):setAdminValue(???)
I'm having an intermittent issue with the mod I'm making. (Almost) every time I *right click on a specific item I've created the game throws an error. This error looks very similar to the one I received when the same item was missing it's icon. I've fixed the icon problem and it now displays correctly, but it's still throwing an error that says it's trying to pull a texture that doesn't exist. The thing is: I can click through the error and the context menu I was TRYING to call shows up just fine. I'm stumped.
Can you paste the stack trace and the chunks of code surrounding any lines of your code identified by the trace?
if you can direct me on how to do that absolutely! it's been a long time since I modded and I'm very rusty with the interface.
Are you in -debug mode already?
Can you bring up debug window with F11?
If not you need to close the game and add debug as a launch option in Steam and relaunch
yes I'm in -debug! I remembered how to do that
Cool then as soon as the exception is finished firing, open F11 and expand the window with errors in it by clicking its bottom right corner
Make sure you scroll up to the "beginning" (i.e. really the end) of the most recent stack trace (will be near the bottom of errors window in F11 menu), then screenshot that and drop it here
If no other errors have occurred since you triggered exception and you're in game, you can just open F11, expand, screenshot
That'll give us a line number or more
like this? or was it another window
Nailed it... But oddly I'm not seeing mod files in your stack trace, so apparently the vanilla files are reading some object you've created and coming to a null value that they expect to be a table, and they expect that nonexistent table to have getTexture as a function.
I would check ISInventoryPaneContextMenu in the vanilla Lua and see what it's trying to do on 2839
what is "Question_On"? I'm still having trouble understanding what the problem is
Oh thats fuckin neat, Lua is nice havn't worked too much with it before, usually a java/c++ person
Are things automatically serialized? Like I am dissecting a mod here and they use a teleport function that teleports you to a location, sets a 'return point', and then allows you to teleport back to that point. I assume its saved on exit... I should check. But yea does that happen automatically?
I don't think anything is autoserialized here but idk. I have no idea how that mod's teleport function works either, tbh... sorry. But, yes, Lua has some interesting and convenient features. Though I gotta be honest, not a fan of the indexing from 1, especially in context of games that interact with traditional languages that index from 0. Sorta leads to unnecessarily ugly indexing code imo.
Yea you are correct, I just checked, it doesnt serialize xD. That mod might want to mention that....
INDEXES FROM 1?
Also, warning, #table is used to get the length of a table, but it's a lie. Gives you the last index instead. So if your Lua table is:
{
[0]: "Muahaha",
[1]: "Eat my shorts
}
and you use # to find its length, prepare for disappointment.
š¤¢
Also, if your Lua table is:
{
[1]: "Muahaha",
[3]: "Eat my shorts
}
and you use # to find its length, prepare for disappointment.
Thats easy enough to fix.... Util library, do a quick math function on that result
I mean it's not so much something to fix as something weird to think about
yea
Ultimately the way Lua does it is faster if you can programmatically guarantee the structure of your table
Because checking the last index is faster than counting through elements.
yea i mean its faster, and you can just add 1
yeah of course
but it should honestly just do that in compiler...
It's just ugly to me haha
yea
all the +1 conversions that could've been #table
I have not done anything with Textures so I don't really know š¦
Wait... are objects in Lua all just huge nested tables lol?
i ALSO haven't done anything with textures (to my knowledge) so this is extra puzzling. i mean unless the icons count as textures - in which case i have limited experience. the little red box on the bottom right that's supposed to enumerate errors thrown also reads "0" when it comes up, which is driving me BONKERS
if there aren't any errors, why are you BREAKING my dude?? reveal to me your secrets
A whole lot of them yes
I don't think quite all but a lot
e.g. an integer is not a table
Lua - Data Types, Lua is a dynamically typed language, so the variables don't have types, only the values have types. Values can be stored in variables, passed as parameters and
Those are the main ones
can anyone help please?
If you want to zip the source I'll try investigating locally
is your mod set to private?
unlisted. i get the error code 2. i think for hidden/private is the error code 15
i was under the impression that dedicated servers can only access and pull public downloads. maybe im wrong, but i always thought that were the case.
That's funny lol. Do you know how to actually serialize something btw? I want to save coordinate points associated with a specific object. I should actually just look at the Journal mod...
it was working yesterday with the unlisted setting. i dont know what happened today. but even if I make a new mod. i can not download any of my created mods from the workshop onto a hosted/dedicated server.
always this error Workshop: onItemNotDownloaded itemID=... result=2
do i just zip the whole mod folder and fire it at you?? i really appreciate you offering to inveatigate. thanks, man
this might sound like a dumb suggestion but have you double checked you did not accidentally create a new mod id?
before i have checked. but i create a new mod id on purpose while identifying the problem. to see if maybe that might fix the problem
i even deleted everything from my mods contents except a simple debug print. even now it still gives the error
Someone else just had that error with AuthenticZ. I thought it was from server not shutting down properly. But if you have AuthZ maybe thats the culprit too
i made a new server only with my test mod
maybe something wrong with my workshop account?
https://steamcommunity.com/sharedfiles/filedetails/?id=2889759593
i made it public but even then i can not download it to the server. always terminates. other mods i can download fine.
try uploading a mod of somebody else that does get downloaded?
also not working
they can get unlisted
Yes
u'd have to post code
I have had 2 confusing issues where my workshop file wouldn't download.
Solution 1: My mod's image files had the wrong depth (32 instead of 24), so even though the flat resolution was fine, Steam wouldn't let me pull the file. Had to export image again after flattening in GIMP.
Solution 2: My workshop description was too long, so it was rejecting the data after creating the page for the mod. Since there was no mod data, I couldn't even see my mod. Had to shorten desc.
Thank you, appreciate the inside very much.
However i use the default picture to test the problem and here is my workshop doc:
version=1
id=2889759593
title=My Mod Test
description=Some test
tags=Build 41
visibility=unlisted
I don't know how to do any automatic serialization... If I wanted to store coordinate points associated with an object named Bob, I would just say
Bob.coords = {
x = 100, -- or whatever
y = 100 -- or whatever
}
Is there any difference between these syntaxies?
writeSettingsFile = function(tbl, filename)
function writeSettingsFile(tbl, filename)
alright what line was it
Oh you can attach variables to a player?
in the player moddata yes
if modData['hasDeaf'] == false then player:getTraits():add("Deaf"); end
Is that a lua object you just have access to?
ah I see
this is the line that glytch3rs code is erroring on
And those syntaxes? Thanks for all the help guys, not versed in lua
Never seen NAME = function() before
@ancient grail look in the log and see if there's a full error, the debug screen kinda sucks imo
or well I guess in expressions
functions are just variables holding functions whether u declare them function X() --[[something]] end or X = function() --[[something]] end
the former is just a syntax sugar that is more like other languages tbh
gotcha, I thought it was the standard
thats pretty neat
which is how we override things and wrap them for modding
When you upload the mod, have you read the output that Project Zomboid shows you to see if there are any errors?
no errors. everything smooth during upload.
Can you link me to the mod page?
Hmmmm
Yeah that's not what happened with mine
Workshop text did not go through for me when my upload bugged
Ok i narrowed the problem down, even more. when i try to download the mod on a hosted server with a real host, it somehow works. however if i use the ingame option "host" and it tries to download the mod it fails.
i guess i can live with that, however this behavior is obviously wrong and broken. i have even reinstalled, steam, the game. verfied files... deleted stuff by hand. nothing helps. so i guess i will leave it at that. the problem occured with the latest steam release for me.
i think the problem occurs if u have a local version of the mod in ur local workshop folder, but then u use the ingame "host" option and it tries to download the version from the steam workshop.
You can DM it to me if you want
Are you getting a checksum error??
š you got it!! i just need to zip the bad boy. got a bit busy and stepped away from the computer for a moment
I too was busy, no rush
are we seeing the same thing? i found night pointlessly bright until i changed the sandbox setting
but there is a sandbox setting for it, so just use that
@summer rune Launching through Host in-game is fine:
@weak sierra
I think you probably have a mismatch between what's in Zomboid/Workshop and the online version. I recommend you unsubscribe from your online version and remove it from your server if you want to test new local code for an existing mod.
I often run into issues if I don't do that, and I have had no issues since I started doing that.
@summer rune
thats what i told him via dm
How do you pass multiple args via menu inputs. Like say I have this function
function AddPoint ( id, x, y, z )
Is this the right way to make that a menu entry?
submenu:addOption( "Mark", self.invMenu, self.AddPoint, id, x, y, z );
Judging by your language, we are not. THIS is the bright night mode on my PC:
Is this reasonable darkness?
I mean my eyes just must be God's gift to night vision if normal people think this is what the dark looks like outside...
yeah we definitely aren't
I'm thinking not.
well this is what my night looks like, but after i set it to pitch black lol
Thank you for testing. It confirms my suspicion about a problem when I run local code which is also uploaded to the workshop. But I had no checksum or version mismatch error. I Iāll just use the local code instead of the uploaded one. Itās fine. I guess.
i may have found the cause for the error l;ol
getPlayer():getIgnoreMovement(false)
instead of
getPlayer():setIgnoreMovement(false)
I have a question
Where are britas weapon pack gun files?
I want to edit them
Can't find them
Yeah I would delete all your wonky mod's files manually from ProjectZomboid folder's workshop & steamapp's workshop (there's a workshop directory in both places), then unsubscribe, then remove it from your server's ini, and then add your local version back to the server through the Mods tab, test it, make sure it's right, and reupload just to be 1000% sure your local and online version match.
nope still same error
@summer rune
Implies getPlayer() is null there @ancient grail
you called player:getTraits() near the start of the function but never assigned a player object to player...
you should really assign it to a variable, as you have like 30 getPlayer()s in there
I second @bronze yoke there, I would just throw local player = getPlayer() at the top
And use player
anyone know where I can find documentation on altering the character model?
Actually I would probably use getSpecificPlayer(0) at least because afaik that works for 1 person playing SP or MP online, which seems to apply to most people. That or loop through the local players. Or if I already were, I would pass along the index. @ancient grail
getSpecificPlayer(0) and getPlayer() are just the same thing i'm pretty sure
Oh okay cool thanks for the correction because first tutorial I used tried to warn me to use getSpecificPlayer(0) for online
this mod is for an rp server that i don't think even allows splitscreen? i've been writing most of my mods for them with it in mind just in case because i think it's good practice and rarely much harder but it's not a big priority
ye albion did the shopmod that totaly kicks ass
I would like to ask again
Still can't find them
ahh so thats where i went wrong
well this is the 3rd syntax related bug.. i think i removed the
local player = getPlayer()
well ididnt plan to use it anyways id rather use the getPlayer()
cuz it will be easier to test on debug parts of the code
like the 3d?
More specifically, files in which I can edit the weapon's stats
you can check the scripts for the model its going to point to where the files are located
ammm there are rules to modding someone elses mod i hope you are aware
I just wanna tweak some stuff to alter my gameplay
How can I do that
Hm
Changed my mind, it's simply too hard for a simple file edit
Shouldn't it be like
sir @willow estuary sorry to ping you but is there limitations to using this when modifying other mods that are on lockdown? cuz technically if you do this then you never included their code and you didnt modify them...
Find the mod folder, search sub folders, find files of the items you wanna edit, edit them, save, exit, start game, changes applied
works for solo
Not in britas weapon pack apparently
the thing is there are rules for using other modders files. so you should check em out
I don't know the specific function you're trying to use, but generally if a function foo allows you to give it another function named bar as a parameter, you just call foo(bar), and then rely on foo to send bar the parameters it needs.
There were some truck mods I edited
They worked fine
But with bwp the closest I get is model x files and in those files there are hundreds of lines of undecipherable code
I'm not creating anything new just customizing for personal use but allright
Where can I read the rules
anyone know of any documentation I can look at to alter the character model? i.e. amputation
Yea but how do you send those via foo?
not legal advice, that is not a violation of copyright, but morally it's up for debate
Personally I think if its just a patch or something to fix an issue and they arent doing it themselves, you give FULL credit for the original work, then its fine
Like NoctisFalcon has been away so I patched one of his mods because people used it a lot
Gave him full credit ofc since I literally added like 20 characters worth
when a modder specifically puts their mod on lockdown i think there is a discussion to be had about whether it's okay to disobey their wishes like that, even if i don't believe there's actually a copyright violation there
i was thinking of the same thing
Its not on lockdown he just vanished
Different thing IMO. If I just died unexpectedly or something... I would be fine if someone continued my work for sure
A patch definitely
if it wasn't under lockdown then it's not really what i was talking about
Ah ok I thought it was about any continuation of code that isnt yours or whatever
(like if they say they dont want forks of it and all, but have vanished)
These are the different levels of permissions available to be applied to your mods, so that other modders know how they can be used. After selecting the appropriate mod permission for your project, just include the relevant image and link to the proper permission in the first post of your WIP/Com...
You would have to be writing foo to make foo call a custom bar with custom parameters in the first place.
So somewhere in foo you would prepare parameters appropriately.
If you're not writing or at least modifying foo, it will never be able to call a custom bar with custom parameters.
However, if a built-in foo (that you are not editing) accepts a bar, odds are good that it intends to pass a standard array of parameters to every bar it is given.
In that case you would want to read foo carefully to figure out what parameters it will be sending to bar and how it will obtain them.
I believe context:addOption() passes at least 4 parameters to the function you give it. So it seems ok.
Does it use that syntax though? Like just param1, param2, param3 etc after the initial stuff?
There's a few things like context where you add a function and then it checks for extra parameters. In some cases you need add lua:addParam(...) but I've been using the context like your example.
mod idea: PZ but in california, chicago, new york, oakland, literally any major urban city. shit would be crazy
PZ in philly š¤Æ
first thing you'll get is the 2nd argument (a table type)
So in your example it should be AddPoint(target,id, x,y,z)
kk, any idea why this isnt working? I am trying to add a new point based on a new menu entry I made, the entry shows up and fires but causes an exception because player is nil when it tries to get the current position
function self.MarkRecallLocation( player )
print("MarkRecallLocation CALL MARK" );
SSDart.Transporter.MarkRecallLocation( player );
end
function self.Return( player )
print("Return FUNCTION MARK" );
SSDart.Transporter.Return( player );
end
submenu:addOption( "Mark", self.invMenu, self.MarkRecallLocation );
function transporter.Return( player )
print("transporterInit FUNCTION MARK" );
player = player.player;
local returnPoint = transporter._returnPoint.Last;
player:setX( returnPoint.X );
player:setY( returnPoint.Y );
player:setZ( returnPoint.Z );
player:setLx( returnPoint.X );
player:setLy( returnPoint.Y );
player:setLz( returnPoint.Z );
transporter._returnPoint.Last = nil;
end
function transporter.MarkRecallLocation( player )
print("MarkRecallLocation FUNCTION MARK" );
player = player.player;
print(player:getX());
print(player:getY());
--transporter.AddPoint(
-- "Markkkk",
-- player:getX(),
-- player:getY()
--);
end
I am basing it on the return function from the mod I am dissecting and cant see a difference
I added MarkRecallLocation = transporter.MarkRecallLocation as well
add player parameter in add option
the original doesnt have it
submenu:addOption( "Return", self.invMenu, self.Return );
ok let me see where it's called then
Where what is?
this is the menu creator
function self.createMenu( _item )
print("createMenu FUNCTION MARK" );
if _item:getFullType() == "Base.TeleportationDevice" then
local teleMenu = self.invMenu.context:addOption( "Teleport", self.invMenu, nil );
local telePoints = SSDart.Transporter.GetAvailablePoints();
local submenu = self.invMenu.context:getNew( self.invMenu.context );
self.invMenu.context:addSubMenu( teleMenu, submenu );
print("======================> Processing '" .. #telePoints .. "' teleporting points" );
for _, pointName in ipairs(telePoints) do
submenu:addOption( "Teleport to '" .. pointName .."'", self.invMenu, self.TeleportTo, pointName );
end
if SSDart.Transporter.CanReturn() then
submenu:addOption( "Return", self.invMenu, self.Return );
end
submenu:addOption( "Mark", self.invMenu, self.MarkRecallLocation );
end
end
just need time
Ah ok thought you were asking me something
here he's passing self.invMenu, which then he calls player in the function and does
player=player.player
You should print all of that, see what you have. If you have a player number you need to use getSpecificPlayer()
the specific error is "Attempted index: player of non-table:null"
his doesnt throw that
Ah ive seen this on github before
The issue?
No issues i just mentioned i saw it š
that's different
print the menu where you add the option
debug includes a bunch of prints š
I got it, this was awful lol
I think when I added a new function, it caused a issue because it was loading the lua files in a different order maybe? Because some changes I could just reload in the game but I fixed it by doing a full reload in the main menu
Anyone know of any good tool to make a lot of recipes without coding them each individually
ItemZed used to be good, but I cannot get it to work with current stuff
what recipes do you have in mind for example? sounds interesting
Ok this is the fuckiest problem. Maybe you can help me understand this guy more because im pretty sure this is it but I am too dumb to understand what ordering he is talking about....https://theindiestone.com/forums/index.php?/topic/1805-timed-actions-attempted-index-new-of-non-table-null/
Well yeah I've run into a problem I can't find a solution to: I call TimedActions from my context menus like this: UI-ScriptISTimedActionQueue.add(TABreakDoorLock:new(player, door, time, primItem)); Construtor in the timed actionTABreakDoorLock = ISBaseTimedAction:derive("TABreakDoorLock"); ... f...
could anyone mod this box to be larger so we could actually read mod titles when making a local server? XD
its impossible to differentiate some of them because the box is so small....look at all that real estate!!
Well, Iām apart of a servers modding team. So we have been working on a ācraft everythingā mod that replaces some of the misc smaller versions of similar things based around vanilla PZ, while including modded content too. So, interweaving different mods together for the sake of crafting and stuff
mod manager server would help with that
coolio š¤
Got a problem with placing custom tiles. I've got things to the point where I can craft an item from a recipe and get it into my inventory, I can right click and place it with all requirements showing green (minimum skill, item needed etc) but then when I actually want to place it, I can't. Item preview over the cursor is always red. I can "drop" it and have it appear in the world, but then I can walk over it.
Anyone know or know a tutorial about how I can get the place action working and ensure the item's tile blocks movement?
so, did you set up the tiles custom properties in tilezed?
and- did you create your .pack file as well
this happened to me too, turns out i placed it near a window , which will make anything you put passable
you might have the same issue if not then idk..
Lmao honestly great idea.
Hello! Do you know if it's possible to find a way for admin to prevent a player from dying without using god mode?
For example to block the health bar to go under a certain amount of health?
I am on this now
Can it be triggered by an admin? Like a power an admin can give and remove to players?
any of you gurus that can help my friend and i get a hosted modded run working?
we've waited until 41 was finished so mod updates could happen....but it keeps terminating the world before opening
we just wanna play some modded pz with the boys ā¤ļø
i havent seen the code
only read the description
you might find more assitance here #mod_support
Just released this simple retexture mod š https://steamcommunity.com/sharedfiles/filedetails/?id=2889883050
Is there any simple way to tap into and rewrite local functions that are used by vanilla Lua OTHER than directly editing the vanilla Lua files?
congrats man
I cant seem to find the code for fade in
I can only see fade out.
Im trying to replicate sleep
I think konijima posted something like this
If you could link me I would appreciate it, because only way I know how to do it is to just copy-paste and edit the file, and that feels like overkill bigtime.
Problem is the file itself seems to locally use its local functions to build the panels before the file's finished
So idk that rewriting the function outside the file could possibly do any good
Even if I could do it.
is their a mod to remove the amount of zombies like it seems kinda unrealistic
Specifically, I need to tap into ServerSettingsScreenWorkshopPanel and ServerSettingsScreenModsPanel in ServerSettingsScreen.lua:
If anyone has any brilliant ideas for how to efficiently edit these lines:
(826)
self.listbox = ServerSettingsScreenModsListBox:new(24, label:getBottom() + 4, math.min(self.width - 24 * 2, 400), self.height - 24 * 2)
(1495)
self.listbox = ServerSettingsScreenWorkshopListBox:new(24, label:getBottom() + 4, math.min(self.width - 24 * 2, 400), self.height - 24 * 2)
You would be a hero.
Tried my best to look for it . But found this instead. Im not sure if its the same,
But yeah ,you might want to ask chuck
No big thanks for trying!
Yeah i hate this part too. Id rather not overwrite vanilla if i cant simply inject something. Not unless its for personal mod use
Sandbox options
Totally.
thanks
Its not a mod
If your not on SP
And you are admin
Then you can find it on the admin panel
It says sandbox options
You can customize zombie lore from there
@thick karma found it!
#mod_development message
Its a hook version tho but it might just do it for your needs
Unfortunately that does not help me, but I still appreciate your enthusiasm for trying
I mean maybe but I don't know how
Most obvious solutions are hampered by lack of access to countless crucial local variables
local Page1 = ISPanelJoypad:derive("Page1")
local Page2 = BaseServerSettingsPanel:derive("Page2")
local Page3 = ISPanelJoypad:derive("Page3")
local Page4 = BaseServerSettingsPanel:derive("Page4")
local Page5 = BaseServerSettingsPanel:derive("Page5")
local Page6 = ISPanelJoypad:derive("Page6")
local MultiColumnPanelJoypad = ISPanelJoypad:derive("MultiColumnPanelJoypad")
local Page7 = MultiColumnPanelJoypad:derive("Page7")
local ServerSettingsScreenPanel = ISPanelJoypad:derive("ServerSettingsScreenPanel")
local ServerSettingsScreenBaseListBox = ISScrollingListBox:derive("ServerSettingsScreenBaseListBox")
local SpawnRegionsPanel = MultiColumnPanelJoypad:derive("SpawnRegionsPanel")
local SpawnRegionsListBox = ServerSettingsScreenBaseListBox:derive("SpawnRegionsListBox")
local SpawnPointsListBox = ISScrollingListBox:derive("SpawnPointsListBox")
local ServerSettingsScreenGroupBox = ServerSettingsScreenPanel:derive("ServerSettingsScreenGroupBox")
local ServerSettingsScreenModsPanel = MultiColumnPanelJoypad:derive("ServerSettingsScreenModsPanel")
local ServerSettingsScreenModsListBox = ServerSettingsScreenBaseListBox:derive("ServerSettingsScreenModsListBox")
local ServerSettingsScreenMapsPanel = MultiColumnPanelJoypad:derive("ServerSettingsScreenMapsPanel")
local ServerSettingsScreenMapsListBox = ServerSettingsScreenBaseListBox:derive("ServerSettingsScreenMapsListBox")
local ServerSettingsScreenWorkshopPanel = MultiColumnPanelJoypad:derive("ServerSettingsScreenWorkshopPanel")
local ServerSettingsScreenWorkshopListBox = ServerSettingsScreenBaseListBox:derive("ServerSettingsScreenWorkshopListBox")
local SandboxPresetPanel = MultiColumnPanelJoypad:derive("SandboxPresetPanel")
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
For context.
What r u trying to do anyways
I'm trying to do exactly what this does, but WITHOUT duplicating Indie Stone's file almost entirely in order to edit it.
Load it up and go see your Host > Edit > Steam Workshop tab.
I would like to upload this for general use but I don't want to make Indie Stone mad
You can ask for permission iguess
They talk to human beings?
Use email
Fair enough, I could try to email them.
Heres the email
Its open for people who needs permission to edit abandoned mods
So i guess u can hijack it to ask for something sorta diffrent
Anyone know how i can disable all player controls. Or fade the screen back in
I need just one these
Cuz i can make the player stay there and not be able to move
But they can still drag and drop stuff which mess up the purpose of being high on heroin
Since it fucks up the animation
After this im done with the heroin mod
the way i stopped them from doing this for the prisoner thing was to just ban them from doing timed actions
do
local old_isValid = ISInventoryTransferAction.isValid
function ISInventoryTransferAction:isValid()
return (some heroin check) and old_isValid(self)
end
end
you'll need to see what timed actions you need to block
We're using a mod where the animation is only shown locally. It gives an odd animation in multiplayer. How can this be?
It's a vanilla animation
(reload animation)
ill try
how did you trigger the animation
We're using the Kitsune's Crossbow thingy on the server
So just their ISKCMReloadCrossbowAction.lua basically which should work, but I assume B41 Firearms could interfere with it so I'll just run some tests
I have something working for this but I need permission to upload it. š
If you want to DM me I'll send you a link if TIS grants permission, or I'll walk you through running local copies if they won't.
Also, anyone who wants to DM me for a mod you can drop in Workshop to just read your mod names better, I'm down to share the solution privately.
i'm pretty sure you're allowed to use tis lua in your mods
like otherwise you wouldn't really be able to overwrite anything, and it'd just be a weird restriction in general when it's right there
and, not legal advice, tis won't sue you for uploading a mod containing their code that can only be downloaded by people who already have access to their code
Fair enough. I will probably just post it if they don't get back to me in reasonable time
Meanwhile, how glorious is this?
They literally said min when they meant max istg
Also tbc I assumed this, but my mod is literally 99.9999% TIS code.
like 3500 lines of it
Because all the local variables are not worth my time
the modding ToS says you can distribute their code as long as you don't make it so ppl can play the game for free, more or less, so I wouldn't worry about it
and the worst you'd likely face is a dmca anyway
you can put that on the description i guess
Thanks debugger, very helpful

