#mod_development
1 messages · Page 198 of 1
that's a smart idea, thank you!
Hmm, what about glowing zombies? or a way to make them turn a different color, for example in thermal vision creatures glow bright
Does anyone know why the cursor wouldn't show up in game?
Now that I’m less sure of, could maybe take a look at how the aiming outline code looks, at least as far as how it applies the effect, and I know the game has checks for how many zombies are visible to you for panic accumulation and such.
Nice work!
Thanks, today I shed even more blood and tears thou.
Had some dedicated server syncing issues to fix 
That's modding for ya 
Say, are there limitations to Moddata?
I'm trying to save the following structure:
myModNameData = {
tile = {
x = 1234,
y = 1234,
z = 1234
},
tileType = "someString"
}
ModData.getOrCreate("myModName") = myModNameData
But it appears to only save tileType.
Does it not allow for tables inside of tables to be saved?
Is there an issue with integers?
No, it can save/add/transmit any object (table)
So, I should also be able to save IsoObjects? (such a squares or items)
Just to be sure what I actually transmit as data is
{
['base'] = {
['name'] = "Immersive Trader",
['range'] = 10,
['icon'] = "media/textures/Shop.png",
['x'] = 12598,
['y'] = 955,
['z'] = 0
},
['data'] = {
['Weapons'] = {
{"Base.Katana", 1, "Base.Money", 4000, 1250},
{"Base.AssaultRifle2", 1, "Base.Money", 2000, 1000},
{"Base.AssaultRifle", 1, "Base.Money", 1500, 750},
{"Base.HuntingRifle", 1, "Base.Money", 1000, 500},
{"Base.VarmintRifle", 1, "Base.Money", 1000, 500},
{"Base.DoubleBarrelShotgun", 1, "Base.Money", 750, 400},
{"Base.DoubleBarrelShotgunSawnoff", 1, "Base.Money", 750, 300},
{"Base.Shotgun", 1, "Base.Money", 600, 300},
{"Base.ShotgunSawnoff", 1, "Base.Money", 600, 200},
{"Base.Revolver_Long", 1, "Base.Money", 500, 250},
{"Base.Revolver", 1, "Base.Money", 300, 150},
{"Base.Revolver_Short", 1, "Base.Money", 300, 150},
{"Base.Pistol2", 1, "Base.Money", 300, 150},
{"Base.Pistol", 1, "Base.Money", 300, 150}
},
['Weapon Parts'] = {
{"Base.x8Scope", 1, "ICurrency.GemScrap", 100, 25},
{"Base.x4Scope", 1, "ICurrency.GemScrap", 50, 15},
{"Base.x2Scope", 1, "ICurrency.GemScrap", 25, 10}
},
['Ammo'] = {
{"Base.Bullets45", 30, "Base.Money", 150, 3},
{"Base.Bullets44", 30, "Base.Money", 125, 3},
{"Base.308Bullets", 30, "Base.Money", 100, 2},
{"Base.556Bullets", 30, "Base.Money", 100, 2},
{"Base.ShotgunShells", 24, "Base.Money", 100, 3},
{"Base.Bullets9mm", 30, "Base.Money", 50, 1}
},
['Currency'] = {
{"ICurrency.GoldScrap", 1, "Base.Money", 0, 10},
{"ICurrency.SilverScrap", 1, "Base.Money", 0, 5},
{"ICurrency.GemScrap", 1, "Base.Money", 0, 25},
{"ICurrency.GemScrap", 1, "ICurrency.GoldScrap", 5, 0},
{"ICurrency.GemScrap", 1, "ICurrency.SilverScrap", 10, 0}
},
['Miscellaneous'] = {
{"Base.PetrolCan", 1, "Base.Money", 250, 100},
{"Base.Bag_ALICEpack_Army", 1, "Base.Money", 1000, 500}
}
}
}
So there is a lot of various data
Hm
And it goes through normally to client
I'm a bit puzzled as to what is wrong with my code then 
local firstLink = {
tile = WarpTiles.toXYZTable(inProgressLink[2]),
tileType = inProgressLink[3]
}
local secondLink = {
tile = WarpTiles.toXYZTable(_tile),
tileType = _tileType
}
print("Saving link (performed by " .. playerObj:getUsername() .. ")")
local link = {
source = firstLink,
destination = secondLink
}
WarpTiles.saveTileData(firstLink.tile, firstLink, secondLink)
WarpTiles.saveTileData(secondLink.tile, secondLink, firstLink)
local linkTable = WarpTiles.getModData()
table.insert(linkTable, link)
WarpTiles.syncModData()
The saveTileData stuff works
--- Get the mod data table.
---@return KahluaTable
WarpTiles.getModData = function()
ModData.request(WarpTiles.modDataKey)
return ModData.getOrCreate(WarpTiles.modDataKey)
end
WarpTiles.getModData ^
It saves the tileType fields properly, and I can access those through source & destination, but not the "tile" fields.
Basically on server you need to do getOrCreate(), then fill with stuff and once you are ready you need to transmit() it.
On other end (client) you need to have two events OnInitGlobalModData and OnReceiveGlobalModData - first is to catch data already transmitted, second is to catch data updated.
-- Moddata
local function onInitGlobalModData()
ModData.request("IShopsData");
end
local function OnReceiveGlobalModData(module, packet)
if module == "IShopsData" or module == "IShopsObjects" then
if packet then
IShops:print('Getting data packet from server');
ModData.add(module, packet)
else
IShops:print('Getting update packet from server');
end
end
end
Events.OnInitGlobalModData.Add(onInitGlobalModData)
Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)
Something like that on client
add() is required on other end
The issue isn't syncing. It's not saving the entire table for whatever reason.
Not saving where on receiving end?
local firstLink = {
tile = WarpTiles.toXYZTable(inProgressLink[2]),
tileType = inProgressLink[3]
}
local secondLink = {
tile = WarpTiles.toXYZTable(_tile),
tileType = _tileType
}
local link = {
source = firstLink,
destination = secondLink
}
local linkTable = WarpTiles.getModData()
table.insert(linkTable, link)
WarpTiles.syncModData()
This is the relevant bit of code
It's not saving the tile portion of the first & second link tables.
But it is saving tileType
oh wait you are talking a IsoObject mod data
I'm talking about Global Mod Data its a different entity.
No, I'm talking about global mod data
This is where I fetch the global mod data
Yep
And tile as a table of 3 integers
--- Convert a tile to an x,y,z table.
---@param _tile IsoObject
--- The tile to be converted.
---@return table
--- An x,y,z table representing the tile.
WarpTiles.toXYZTable = function(_tile)
return {
x = _tile:getX(),
y = _tile:getY(),
z = _tile:getZ()
}
end
Weird huh
This is the toXYZTable method ^
I use this method in other places, and it seems to work fine there, so it's not returning nil as far as I'm aware
what is exactly WarpTiles.syncModData()
--- Sync the mod data table to the server & clients.
WarpTiles.syncModData = function()
ModData.transmit(WarpTiles.modDataKey)
end
oh well makes sense
Simply a transmit with the key pre-filled
tileType = _tileType could this issue be related to linking it as _ variable?
How so?
They're two different variables
Unless LUA does funky stuff with underscores
plain example is class inheritance with setmetatable and self.index = __self shit
Yeah, those are just conventions for variables
Its just weird string is not going through. Your chain seems right
You do trasmit() and you have request() and probably add() too
I'm having trouble with russian translations, I'm using notepad++, what are the steps to follow? or how should i save my itemname_ru.txt? 🇷🇺 🇷🇺🇷🇺🇷🇺🇷🇺🇷🇺🇷🇺🇷🇺
this looks wrong, shouldn't be transmit("myModData")?
I would double check 
Minimal viable example of what I was doing
Is there a simple way to browse global mod data?
An sqlite database file somewhere?
Or a way to attach a debugger to the LUA script somehow?
In debug mode debuggers Dev section there is GlobalModData viewer
How do you enable debug mode again?
-debug as startup param
Also, there isn't a quick way to reload LUA while hosting a server, by any chance?
Without having to reboot the test server entirely
No unfortunately not on the server, in hosted game or singeplayer you can do that safely in F11
Much appreciated for the help so far btw!
this usually leads to more confusions
there is however a reloadlua command
however might be viable if you have an event with remote exectuin
so client debug console can send sendServerCommand
and the server reload file scripted, but it already sounds more like liability
Quick side question, is there a simple way to do a reliable timer?
Or do I just use os.time() and go from there?
There are some guides around.
To sum up: use the same file name as the game and the same encoding.
makes sense
I did a code scheduler
lemme post it again
function IC:sleepDo(seconds, func, condition)
local time = os.time();
local targetTime = time + seconds;
if condition == nil then condition = true end; -- Optional
local function OnSleepTick()
local timeNew = os.time();
if not condition then
Events.OnTick.Remove(OnSleepTick);
return
end
if timeNew >= targetTime then
Events.OnTick.Remove(OnSleepTick);
func();
end
end
Events.OnTick.Add(OnSleepTick)
end
It's moreso for cooldowns on specific methods
So you can even loop it until condition is met
like debounce?
usage is something like
local function func()
if whatevercondition then return end -- End it
-- Do your stuff every N-seconds
-- Repeat (optional)
IC:sleepDo(1, func);
end
IC:sleepDo(1, func);
equivalent of setInterval from JS
Does that not block other parts of the script? Or is LUA async / threaded?
It uses OnTick and os.time() to measure time, only then performs it removing itself from OnTick span.
so its technically performed only in one frame
But in general I would not recommend looping something really heavy anyways.
there are a few lua timer modules for pz. Wish one was in vanilla for performance.
https://steamcommunity.com/workshop/filedetails/?id=2875394066
or this, but thats a whole mod
does anyone know where are all base items icon textures are located
it does seem its inside of some of the .packs?
Speaking of reloading Lua, I plan to look into having clientside force that on servers - but only if in debug mode for the tools.
Also for the error magnifier, I'm toying with the idea of having clients send their errors to the server so admins can check them.
That's actually a good idea
But how you wanna do it in case of runtime exceptions? or Lua can handle them?
Errors are processed to get added to the UI pop up / f11
For error magnifier I grab that list and clean it up somewhat
So yes, although there are some errors that don't get added to this list
I think streamlining error management is a good step for the community at large
It's a lot of steps and time for most people to go back and forth - and they're not really obligated to commit to helping a modder. Just like it's not an obligation the modder tackles every bug. But yeah, the current system is not friendly for either party. 😅
I'm always grateful for people who go through the trouble of finding their console logs. But they also send me hours of logs.
The debug tools I mentioned are part of the community project - if this is a project you'd want to help with / want help with @nova socket .
It's kind of in limbo as I told myself I'd not commit to a large project and only work on this off and on...
But it's automatically updated off GitHub every Friday.
oh wait
I actually realized https://github.com/Project-Zomboid-Community-Modding/pz-community-modding/blob/main/Contents/mods/!pz_frameworks/media/lua/shared/utils/debounce.lua
Is exactly what I did with my sleepDo but a bit more advanced
lmao
no idea is unique 
Yeah, that was one of the reasons I wanted to start this
I think we've all spent half a day making something only to discover it's an obscure vanilla function or already exists
I subbed and pinned repo If I come up with some usefullness ill post a pull request.
Sounds good 👍
I'm looking into a vote to pull system
But ... also terrified of that
I have open repo for my stuff too https://bitbucket.org/demellion/pzmods/src/master/
immersivecurrency is technically an API, so might be useful
I found that stuff like this might be overly useful
function IShops:getItemCondition(item)
if not item then return -1 end;
if item:IsDrainable() then return item:getUsedDelta() end
if item:IsWeapon() then return item:getCondition() / item:getConditionMax() end
if item:IsClothing() then return item:getCondition() / item:getConditionMax() end
if item:IsFood() then
local stage = item:HowRotten();
if stage == -2 then return 1 end
if stage == -1 then return 0.75 end
if stage == 0 then return 0.5 end
return 0;
end
return -1;
end
function IShops:checkItemParent(item)
if not item then return false end;
local container = item:getContainer();
if not container then return false end;
local parent = container:getParent();
if not parent then return false end;
if parent ~= getPlayer() then return false end;
return true;
end
or this, but its borrowed from one of the mods
function IShops:chatMessage(msg, visual, channel)
local chatMsg = {
getTextWithPrefix = function(self)
return msg
end,
getText = function(self)
return msg
end,
setText = function(self, newMsg)
msg = newMsg
end,
isOverHeadSpeech = function() return not visual end, --
isServerAlert = function() return visual end,
isShowAuthor = function() return false end,
isServerAuthor = function() return true end,
getAuthor = function() return false end,
getRadioChannel = function() return -1 end
};
ISChat.addLineInChat(setmetatable({ msg = msg.."\t" }, chatMsg), channel or 0)
end
funny is that food has 2 stages of freshness
-2 fresh and -1 is also fresh
Ishops? :0
I also made a shops mod
As for APIs I'm steering away from including those into the project in favor of general utility stuff.
I need to incorporate quality checks for items in my shops
Right now it's just a blanket > 75%
Would be cool if people wanted intentionally broken items
Or rotten food etc
Hey, is there any tutorial on the resolutions for the menu background? I downloaded a bunch of main menu mods and investigated them but they're all weirdly cropped.
yes, this doesnt work
how would I do an "or" for these two items?
"you can use 4 smallSheetMetal OR 2 sheetMetal" is my goal
similarly, how could I create "any of"
the game wants EITHER 6 metalPipe or 6 metalBar
not like 4 metalPipe and 2 metalBar
since I kinda want them to be the "same thing"
two different recipes with the same name can accomplish the first
recipes are extremely rigid
So I've decided why not?
rigid? how so? just whatever is in the "/" can only be one "=" value at the end?
yeah, i mean as a whole there's just very little flexibility in how they work
no OR or ANDs?
Hello everybody,
Trying to understand how loot and procedural distribution works to configure my mod.
Do you know videos or forums which learn how to use ProceduralDistribution, Rolls, weighchance etc... please guys ? 🙂 ❤️
even though theres two of them seperately hahaha
for the 'any of' issue, someone was in here trying to work it out for weeks, it's just not supported
you can do it with food to an extent but not with anything else
hm....
thanks so much for your assistance mate
my reasonings is that metal sheets and small metal sheets vary in popularity
same with metal bars and metal pipes, and even lead pipes 
so if only there was a way to make pipes of each
Wait so does that work with resultingitem?
Can't you use the function injections for this?
Like [hammer] or what not
Evaluate the item type and count
they're evaluated at script load
ah, this is a "fair solution"
make the same recipe but with different materials kinda
good thing next version updates recipe system
make a recipe for metal pipes
make a recipe for metal bars
make a recipe for lead pipes
right?
You'd have to make one for each count of ingredients
If you want pipes/bars = 4 you only need 1
If you want a=4, b=6, c=8 you'd need three.
a/b=4, c=6 means just 2 recipes
The issue is you can't define the amount per ingredient and use OR?
They have to all be the same amount
yeah as mentioned earlier, no OR or AND or ANYOF
There is an OR
And is just default ...
Can you not define the amount if you use or at all?
the amount is applied to the entire selection
"MetalPipe/MetalBar=6"
Yes.. that's an OR
means 6 of metalpipes or 6 metalbars
if you have 3 of each it wont let you craft yeah
which is what im trying to get at
Thank you a lot Poltergeist, don't understand very much how does work the "Roll" system = it manage the chance to have got items ? The higher it is, the more chance you've got to have got items ?
Ah you're worried about the anyof
ANYOF itemA/itemB
Yeah.... that uh
yeah... 
I wonder how far you can push the evaluation functions for ingredients
I feel like it should be possible... even if you have to really bend it in Lua
you can do this stuff with them but i didn't recommend it since you're basically just rewriting recipes at that point
Yeah a bit
crafting a generator
Like convert the items into something to prepare them
hm....
Then you could use 6 of those
Although I feel great pain suggesting adding a dead-end single use item
dang... the wiki has uses for both the bar and pipes
metal bars are for construction
and pipes are for furnishings
lead pipe is a no go, no recipes. its a weapon 
You can totally use those
You can use any item in a recipe, keep or use any, etc
Just no any of apparently
🧠
nah not gonna use "keep" since its being used to construct the generators bars
You can generate recipes dynamically
Make one recipe for every combination on boot
🙉
All the cardinal sins
METAL PIPE IT IS.
@sour island@bronze yokealright finally, are these fair to the player?
its a fucken generator so its hella expensive
pretty big deal so it needs to be difficult
sure. I'll keep an eye on the steam workshop comment section for any needed balance adjustments
thats the item apparently, "wire" is used for something else
ElectricWire without radio
but it is in the radio module
I think I had some issues without the radio.ITEM
hmmm
recipe zReVCPersonalComputer
{
ElectronicsScrap=15,
ElectricWire=8,
LightBulb=6,
SmallSheetMetal=4,
SheetMetal=2,
Screws=16,
destroy CarBattery1/CarBattery2/CarBattery3=1,
destroy Radio.TvAntique/Radio.TvWideScreen/Radio.TvBlack=1,
WeldingRods=5,
BlowTorch=1,
keep WeldingMask,
Result:Moveables.appliances_com_01_72=1,
Sound:Blow_Torch_A,
Time:1300.0,
Category:Equipment,
CanBeDoneFromFloor:False,
SkillRequired:MetalWelding=2;Electricity=2,
Prop1:BlowTorch,
NeedToBeLearn:true,
OnTest:LabRecipes_IsNearWorkbench,
OnGiveXP:LabRecipes_GiveXP_Large,
Tooltip:Tooltip_zReVC_Workbench,
}
strange...
my recipe work fine but ok
if you import the radio module you don't have to
oh.... well its fine right?
yeah, i prefer not to import for one item anyway
do you know a way to block the possibility for a container to spawn more than one item ?
u have mod from spoon?
the engineer?
This part just raises some questions for me...
only spoon(author) use same item id with another module
in this engineer mod:
module Radio
{
imports
{
Base,
}
bla bla bla
item ElectricWire
{
DisplayCategory = Electronics,
Weight = 0.1,
Type = Normal,
DisplayName = Electric Wire,
Icon = Wire,
ColorRed = 244,
ColorGreen = 164,
ColorBlue = 96,
WorldStaticModel = ElectricWire,
}
@verbal yew@bronze yoke@sour island thanks for your assistance everyone! that should be all for now. I'll release these soon
in the meantime, heres something interesting
FYI: Weapons with condition set to over 150(?) will be broken down to 0 after player relogs/restarts the same game.
Anticheat shenanigans?
so im making a quick mod that allows people to switch the appearance of the sledgehammer
hmmm...
okay, yep, vanilla have radio module for ElectricWire, but I'm wondering why there are problems adding it to craft.
i have it without import radio in module in my recipe and it's work fine ^^'
Probably the save system is not handling it well, I think the condition is 0-1
thats cute
Thank you! I'm currently working on a sims ui mod for it
@verbal yew@bronze yoke@sour islandthe mods are now available on the steam workshop (sort by Most Recent), thanks for your contribution!
I wonder why it would'nt
do i code in visual studio?
without require?
local function CraftGeneratorRTFL(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
Item:DoParam(Property.." = "..Value)
end
CraftGeneratorRTFL("Base.ElectronicsMag4","TeachedRecipes","Generator;Craft Generator")
drop it in lua/client
this will add to the magazine with teaching how to use generators the ability to craft them
but look at your opinion, I just suggested...
ou!
and
NeedToBeLearn:True,
in recipe
thanks so much!
I dont know anything about LUA or how to lock the recipe behind an existing book, so this is a huge help/good balance addition
craftable 2 wheel trailer (vehicle) 
2 wheels, suspension, a TON of metal sheets, a lot of propane/blowtorch and high mechanics and metalworking requirements
I don't know if it's even possible to spawn a vehicle without cheating
or how you would even construct this... thing? through the crafting menu??
the trailer is rare, but it's something that's really sought after. and if you're super unlucky, you won't find one
The Sims : Zomboid UI
Can anyone help me test something in MP for like 5 minutes?
somehow toxic... too contrasting or something...
look like windows xp
Well thats the aesthetic of the original Sims
The Sims 1?
Yup
Jesus...
I mean zomboid is just sims 1 with zombies after all, is it not?
As for me, this is a very ancient palette, very toxic and eye-catching...
Reminds me of 1990-2000, old ugly websites... brrrr
It's an omage lol
just imho
see @verbal yew
i react on them.
ESC menu look fine
Exactly what I was going for!
just a shame I couldn't get the old windows xp cursor working
Just with peripheral vision, all the panels cut into the eyes - this is what I don’t consider normal.
But this is just my opinion xD
i'm fond of it
probably more of a nostolgia thing
streaming game night development - also would appreciate any testers
I mean sims 1 UI can be considered ugly, but I certainly see it as more nostalgic than anything
xD
🅰️
yeh
pimp my ride?
we set game in your game when you play game
and another recursion
not know, i'm 28 years old
damn you're younger than me
okey google, urbandictionary com
damn, I did something and the descriptions of the trits in the game disappeared...
although it is there when creating a character
pixel art hard
hmm...
That is adorable hahahha
ty
Trying to use a VM for MP testing and its failing cause the VM doesnt have openGL 💀
i have old code:
function CrowbarWindow:doUnlock()
if self.mode == MODE_VEHICLE_DOOR then -- ДВЕРЬ МАШИНЫ
self.lockpick_object:getDoor():setLocked(false);
self.lockpick_object:getDoor():setLockBroken(true);
end
i need that stuff:
local args = { vehicle = self.vehicleID, part = self.priableObjectID, locked = false, open = true }
sendClientCommand(self.character, 'vehicle', 'setDoorLocked', args)
sendClientCommand(self.character, 'vehicle', 'setDoorOpen', args)
but i can't understand where does the information come from and how to apply for them.
If i try use it, vehicleID derive nil
If you have self.lockpick_object:getDoor() maybe you can work your way back if this is a car part?
self.lockpick_object = car?
I can't get my VM to launch PZ
😦
I just need someone to move some game pieces to see if the syncing issue was fixed
first - addSlice - when trigger BetLock.UI.startLockpickingVehicleDoorCrowbar
function BetLock.UI.addOutsideOptions(playerObj)
local endurance = playerObj:getStats():getEndurance() -- zRe
--local strength = playerObj:getPerkLevel(Perks.Strength) -- zRe
local menu = getPlayerRadialMenu(playerObj:getPlayerNum())
if menu == nil then return end
local vehicle = playerObj:getUseableVehicle()
if vehicle == nil then return end
local part = vehicle:getUseablePart(playerObj)
if part and part:getDoor()then
if part:getDoor():isLocked() then
local playerSkill = playerObj:getPerkLevel(Perks.Lockpicking)
if vehicle:getModData().LockpickLevel == nil then
vehicle:getModData().LockpickLevel = BetLock.Utils.getLockpickingLevelVehicle(vehicle)
end
-- ОПЦИЯ ВЗЛОМА МОНТИРОВКОЙ
local inv = playerObj:getInventory();
local crowbar = inv:getFirstTagEvalRecurse("zReBLCrow", predicateNotBroken);
if not crowbar then
menu:addSlice(getText("ContextMenu_Require", getItemNameFromFullType("Base.Crowbar")), getTexture("media/textures/BetLock_lockpick_Crowbar_Icon.png"))
elseif endurance <= 0.5 then
menu:addSlice(getText("UI_enduranceRequireCar"), getTexture("media/textures/BetLock_lockpick_Crowbar_Icon.png"))
--elseif strength <= 3 then
-- menu:addSlice(getText("UI_strengthRequireCar"), getTexture("media/textures/BetLock_lockpick_Crowbar_Icon.png"))
else
local text = getText("UI_BetLock_LockpickDoorCrowBar") .. " \n(" .. getText(vehicle:getModData().LockpickLevel.name) .. ")"
menu:addSlice(text, getTexture("media/textures/BetLock_lockpick_Crowbar_Icon.png"), BetLock.UI.startLockpickingVehicleDoorCrowbar, playerObj, part)
end
second - trigger CrowbarWindow.createVehicleDoor
function BetLock.UI.startLockpickingVehicleDoorCrowbar(playerObj, part)
local vehicle = part:getVehicle()
playerObj:facePosition(vehicle:getX(), vehicle:getY())
local inv = playerObj:getInventory();
local crowbar = inv:getFirstTagEvalRecurse("zReBLCrow", predicateNotBroken);
if not playerObj:isItemInBothHands(crowbar) then
ISInventoryPaneContextMenu.equipWeapon(crowbar, true, true, playerObj:getPlayerNum())
return
end
ISTimedActionQueue.add(ISPathFindAction:pathToVehicleArea(playerObj, vehicle, part:getArea()))
ISTimedActionQueue.add(EmptyAction:new(playerObj, CrowbarWindow.createVehicleDoor, nil, playerObj, part))
end
local vehicle = playerObj:getUseableVehicle()
third - CrowbarWindow:createVehicleDoor where trigger self.mode == MODE_VEHICLE_DOOR
function CrowbarWindow:createVehicleDoor(playerObj, part)
local modal = CrowbarWindow:new(Core:getInstance():getScreenWidth()/2 - WINDOW_WIDTH/2 + 300, Core:getInstance():getScreenHeight()/2 - 500/2, WINDOW_WIDTH, WINDOW_HEIGHT)
modal.lockpick_object = part
modal.mode = MODE_VEHICLE_DOOR
modal.character = playerObj
modal.diffLevel = part:getVehicle():getModData().LockpickLevel.num
modal.addingXP = part:getVehicle():getModData().LockpickLevel.xp
modal.isGarage = false
modal:initialise()
modal:addToUIManager()
end
four - result
function CrowbarWindow:doUnlock()
if self.mode == MODE_VEHICLE_DOOR then -- ДВЕРЬ МАШИНЫ
self.lockpick_object:getDoor():setLocked(false);
self.lockpick_object:getDoor():setOpen(true);
self.lockpick_object:getDoor():setLockBroken(true);
hmm I'm going to try now
local args = { local vehicle = playerObj:getUseableVehicle(), part = self.priableObjectID, locked = false, open = true }
sendClientCommand(self.character, 'vehicle', 'setDoorLocked', args)
sendClientCommand(self.character, 'vehicle', 'setDoorOpen', args)
?
how about part?
part = vehicle:getUseablePart(playerObj)?
You're trying to get the vehicle id from in the crowbar code?
Or you're trying to update the vehicle in the server?
second
did you try transmitting the part?
assuming the part/door is what determines if it's locked or not
vehicle:transmitPartItem(VehiclePart)
vehicle:transmitPartModData(VehiclePart)
nope...
I found fix solution in Common Sense
local args = { vehicle = self.vehicleID, part = self.priableObjectID, locked = false, open = true }
sendClientCommand(self.character, 'vehicle', 'setDoorLocked', args)
sendClientCommand(self.character, 'vehicle', 'setDoorOpen', args)
but not know how to adaptive it in Better Lockpicking, because in Better Lockpicking it has:
function CrowbarWindow:doUnlock()
if self.mode == MODE_VEHICLE_DOOR then -- ДВЕРЬ МАШИНЫ
self.lockpick_object:getDoor():setLocked(false);
self.lockpick_object:getDoor():setLockBroken(true);
end
but it's not sync for other player
local args = { vehicle = self.vehicle:getId(), part = self.part:getId(), locked = false }
sendClientCommand(self.character, 'vehicle', 'setDoorLocked', args)
not sure if there's one for breaking

that means self.vehicle isn't a thing
What is lockpick_object ?
is says getDoor() - is the lockpick object the vehcile part for the door - and it's getting the door object?
.
if the lock_object is the part you can use getVehicle() on it
modal.lockpick_object = part
derive from
vehicle = lockpick_object:getVehicle():getId()
part = ?
local args = { vehicle = lockpick_object:getVehicle():getId(), part = self.part:getId(), locked = false }
sendClientCommand(self.character, 'vehicle', 'setDoorLocked', args)
?
uh

if there is a self.part
other wise i'd use lockpick_object
lockpick_object:getId()
I'm not sure if there's a command to break the lock
I know there's a file housing the command stuff but it's not registered in CAPSID
and I forget the name of the file
found it
VehicleCommands.lua
housed in /server/
this is basically a vanilla clientcommand afterall, so you can write your own
so you're not sending 2 commands for both things
function Commands.setDoorLocked(player, args)
local vehicle = getVehicleById(args.vehicle)
if vehicle then
local part = vehicle:getPartById(args.part)
if not part then
noise('no such part '..tostring(args.part))
return
end
if not part:getDoor() then
noise('part ' .. args.part .. ' has no door')
return
end
if not part:getDoor():isLockBroken() then
part:getDoor():setLocked(args.locked)
end
--vehicle:toggleLockedDoor(part, player, args.locked)
vehicle:transmitPartDoor(part)
else
noise('no such vehicle id='..tostring(args.vehicle))
end
end
unfortunately these are local
so you'll have to write it differently to be a command
sucks that it's local - would have been nice to insert custom ones
---THIS IS CALLED IN CLIENT
sendClientCommand(self.character, 'crowbar', 'vehicleDoor', { vehicle=lockpick_object:getVehicle():getId(), part=lockpick_object:getId() })
---THIS GOES IN /SERVER/
local function crowbarCommands(module, command, player, args)
if module == "crowbar" and command == "vehicleDoor" then
local vehicle = getVehicleById(args.vehicle)
if not vehicle then return end
local part = vehicle:getPartById(args.part)
if not part then return end
if not part:getDoor() then return end
part:getDoor():setLocked(false)
part:getDoor():setLockBroken(true)
vehicle:transmitPartDoor(part)
end
end
Events.OnClientCommand.Add(crowbarCommands)
not tested
the clientCommands you were trying to use is just a vanilla version
but you should be able to use these just fine
there isn't one that breaks the lock like you want
hence this
God...
I'm just ready to cut out the mini-game with a crowbar and take the working function, only instead of the chance to predetermine the time for lockpicking and wasting stamina...
Does this command not work?
nope.
error?
Most likely I'm doing something wrong...
maybe I don't use reqire in head of local function...
this shouldn't need a require
unless you mean for the other mod?
is this like a patch/expansion?
nope. this in one mod
which?
what's that line exactly?
sendClientCommand(self.character, 'crowbar', 'vehicleDoor', { vehicle=lockpick_object:getVehicle():getId(), part=lockpick_object:getId() })?
that would imply lockpick_object = nil
do you use github?
nope
this is what defines that variable right?
should be
Where is CrowbarWindow:createVehicleDoor(playerObj, part) called?
seems like you're setting the part wrong
here
ISTimedActionQueue.add(EmptyAction:new(playerObj, CrowbarWindow.createVehicleDoor, nil, playerObj, part))
yeah looking
if part is nil at the end there's something wrong with how the argument is being passed
require "TimedActions/ISBaseTimedAction"
EmptyAction = ISBaseTimedAction:derive("EmptyAction")
function EmptyAction:isValid()
return true
end
function EmptyAction:update()
end
function EmptyAction:start()
end
function EmptyAction:stop()
ISBaseTimedAction.stop(self)
end
function EmptyAction:perform()
self.func(self.arg1, self.arg2, self.arg3, self.arg4)
ISBaseTimedAction.perform(self)
end
function EmptyAction:new(character, func, arg1, arg2, arg3, arg4)
local o = {}
setmetatable(o, self)
self.__index = self
o.character = character
o.maxTime = 1
o.func = func
o.arg1 = arg1
o.arg2 = arg2
o.arg3 = arg3
o.arg4 = arg4
return o
end
but it's use in most part, for windows and door like thumb or isoObject
the first arguement is null for self?
ISTimedActionQueue.add(EmptyAction:new(playerObj, CrowbarWindow.createVehicleDoor, nil, playerObj, part))
in here can you print the arguments before the command is called
and check the log
specifically print(lockpick_object)
may have to put tostring() around it
making CrowbarWindow:createVehicleDoor( use . instead and ditching the nil argument won't impact anything as well
yeeem...
looks like
ISTimedActionQueue.add(EmptyAction:new(playerObj, CrowbarWindow.createVehicleDoor, ., playerObj, part)) ?
., ?
I didn't understand what to try ^^'
ISTimedActionQueue.add(EmptyAction:new(playerObj, CrowbarWindow.createVehicleDoor, playerObj, part)
If this doesnt help, just put prints for part in all the steps
see where it goes wrong/gets lost
you're like 90% there
STACK TRACE
-----------------------------------------
function: createVehicleDoor -- file: CrowbarWindow.lua line # 204 | MOD: zRe Better Lockpicking BETA
function: perform -- file: EmptyAction.lua line # 20 | MOD: zRe Better Lockpicking BETA.
[26-09-23 09:30:56.002] ERROR: General , 1695702656002> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getVehicle of non-table: null at KahluaThread.tableget line:1689..
[26-09-23 09:30:56.002] ERROR: General , 1695702656002> DebugLogStream.printException> Stack trace:.
[26-09-23 09:30:56.005] LOG : General , 1695702656005> -----------------------------------------
STACK TRACE
-----------------------------------------
function: createVehicleDoor -- file: CrowbarWindow.lua line # 204 | MOD: zRe Better Lockpicking BETA
function: perform -- file: EmptyAction.lua line # 20 | MOD: zRe Better Lockpicking BETA.
[26-09-23 09:30:56.005] LOG : General , 1695702656005> .
[26-09-23 09:30:56.005] LOG : General , 1695702656005> [zReBetterLockpickingBETA] creating new sourcewindow: C:/Users/kERHUS/Zomboid/Workshop/zRe BetterLockpicking BETA/Contents/mods/zRe BetterLockpicking BETA/media/lua/server/Lockpicking/Crowbar/CrowbarWindow.lua.
[26-09-23 09:31:10.920] LOG : General , 1695702670920> bugged action, cleared queue EmptyAction.
without nil
usssssssssssaaaaaaaaaaaaaaaaaaaaa
nah
i just drop it
not my level
thanks for help
attempted index: getVehicle of non-table: null
it's the same error
so the issue wasn't how it's being called
part is nil to begin with
try putting a print in BetLock.UI.startLockpickingVehicleDoorCrowbar( for it's part
it will most likely be nil
no, I’m done, I’m going to go to bed, I’ve been poking around with this bullshit all night...
I can send files
Unfortunately, I don't live on GitHub...
nothing that can't wait
Okay, thanks again, goodbye
Hello, I cant seem to get a custom name working, any idea where iv gone wrong
module parameds
imports {
Base
}
code stuff
}
Weight = 0.1,
my hero
@sour island Hello when can we expect the poker mods ? (Don't want to hurry you, I just want to settle an argument on my server with a good old fashioned poker stand off)
Cannot invoke "zombie.inventory.types.HandWeapon.getType()" because "<parameter1>" is null Can someone translate this for me to something coherent?
anyone else have a problem downloading Basements?
Having no luck finding testers
Trying to setup a VM didn't work, so I scrounged up an old laptop - currently installing pz
There's a lingering issue of multiple interactions with pieces causing desync
Thx hope you will find a way to do magic with the code sir
#1154887595537481728 @pale eagle If you'd like to test it
Thx I should take a look tonight
Is there any way to change the color of the created context menu?
**Hello guys,
Want to add a new container type into an existing vanilla container to transform this :
**
militarycrate = {
procedural = true,
procList = {
{name="ArmyStorageElectronics", min=0, max=9999, weightChance=50},
{name="ArmyStorageGuns", min=0, max=1, weightChance=100},
{name="ArmyStorageMedical", min=0, max=9999, weightChance=50},
{name="ArmyStorageOutfit", min=0, max=2, weightChance=50},
{name="ArmyStorageAmmunition", min=0, max=3, weightChance=50},
Into this :
militarycrate = {
procedural = true,
procList = {
{name="ArmyStorageElectronics", min=0, max=9999, weightChance=50},
{name="ArmyStorageGuns", min=0, max=1, weightChance=100},
{name="ArmyStorageMedical", min=0, max=9999, weightChance=50},
{name="ArmyStorageOutfit", min=0, max=2, weightChance=50},
** {name="ArmyStoragePistols", min=0, max=2, weightChance=50},**
{name="ArmyStorageAmmunition", min=0, max=3, weightChance=50},
Please anybody knows how to add this into the Vanilla table with an external file into the mod ?
use table.insert
probably not the best example but here is one:
https://github.com/radx5Blue/ImmersiveSolarArrays/blob/2e4f3a1cb78c1edac5806978331ef055faa693da/Contents/mods/ImmersiveSolarArrays/media/lua/server/Items/ISADistributions.lua#L269
Thanks a lot again Poltergeist ⭐ 👑
I'll give it a try
Hello i need a little help with evolved recepies
i create a custom item CannedSauce
i have a recepie that open the cannedsauce to cannedsauceopen
the cannedsauceopen have some evolved recepies with pasta (for example), in game when i mix the cannedsauceopen with pasta i get "Open can Sauce pasta" instead of "sauce pasta"
this is the item
item CannedSauceOpen
{
DisplayName = Open can Sauce,
DisplayCategory = Food,
Type = Food,
Weight = 0.4,
Icon = CannedBologneseOpen,
CannedFood = TRUE,
EatType = can,
EvolvedRecipe = Pizza:12;Burger:12;Omelette:8;Stew:12;Stir fry Griddle Pan:12;Stir fry:12;Sandwich:8;Sandwich Baguette:8;Salad:12;Roasted Vegetables:12;PastaPot:12;PastaPan:12;RicePot:12;RicePan:12,
/EvolvedRecipeName = sauce,/
FoodType = Meat,
Packaged = TRUE,
ReplaceOnUse = TinCanEmpty,
DaysFresh = 3,
DaysTotallyRotten = 5,
HungerChange = -24,
Calories = 400,
Carbohydrates = 31,
Lipids = 9,
Proteins = 16,
StaticModel = CanOpen,
WorldStaticModel = CanOpenBolognese,
Tags = HasMetal,
}
add
EvolvedRecipeName = Sauce,
The very thing you have commented out
the line is /* EvolvedRecipeName = sauce, */
discord is formatting the ** the line is copied by a default open can
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
Item:DoParam(Property.." = "..Value)
end
zReAdjustItem("AuthenticZLite.BunnyEars", "CanHaveHoles", "false");
If the mod is not connected, then an error appears referring to this line with the item.
Is there any way to improve the code so that if there is no item, it simply skips it?
but not like
if getActivatedMods():contains("AuthenticZLite") then
zReAdjustItem("AuthenticZLite.BunnyEars", "CanHaveHoles", "false");
end
Call the function in a pcall()
Or check if Item then
I didn't understand, a little
can u write example?
pcall(zReAdjustItem("AuthenticZLite.BunnyEars", "CanHaveHoles", "false"));?
emm...
Correct
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
?
Yes
If there is no item of that name, the getItem returns nil
And nil inside an If evaluates to false
So it's a simple null-check
Probably the faster option tbh
Do you know if there is a way to force the player to use an object in Perfect condition into a recipe ? To do not let him use used objects ?
yep
in recipe:
OnTest:MyModFuncName,
in lua folder on server side:
function MyModFuncName(sourceItem, result)
if sourceItem:hasTag("zReRepairableVest") then -- OR ANOTHER METHOD TO CALL YOUR ITEM
if sourceItem:getCondition() < sourceItem:getConditionMax() then
return false
end
end
return true
end
You're my third sunshine of the day 👑 Thanks a lot
i reccomend add tooltip into recipe too
for string with reqire
have you got an example ?
add it in recipe:
Tooltip:Tooltip_zReRAC_MustHaveHole,
translate file EN:
Tooltip_EN = {
Tooltip_zReRAC_MustHaveHole = "Vest Armor must be damaged!<br>Take it off before repairing!<br> ",
}
for example
Oh yes ok, to see it into the game 😉
look like
into the IG_UI_EN ?
Tooltip_EN
ok 👍 thank you
hmhmhm...
it's not all
now, I'm thinking....
it's work?
I just woke up, and for some reason now it seems to me that I missed something...
My recipe simply has three functions built in...
keep [Recipe.GetItemTypes.zReRAC_Is_Armor], -- add item into recipe
OnCreate:zReRAC_Repair_Armor, -- func for result
OnTest:zReRAC_Can_Repair_Armor, -- check item condition
And now I'm trying to figure out whether there were links to others or not...
looks like not ^^'
i gonna try
Tooltip Works
but my perfect item does'nt work into the recipe
but i commented your hasTag line to skip this condition
is it important ?
Yes, this should include items whose condition you want to test and which are used in the recipe.
i'm adding
no it doesn't work
condition is not true
send recipe and your lua func
recipe Vendre Pistolet Glock 18C
{ destroy Base.EFK_G18C,
keep TancredTrader,
Result: Money=168,
CanBeDoneFromFloor:true,
Category:Money,
Time:0,
OnTest:Change_All_For_Money_OnTest,
OnTest:ItemGoodCondition,
Tooltip:Tooltip_EFK_ConditionReparation,
}
arf ok
what do your OnTest:Change_All_For_Money_OnTest?
u can do stuff for items with another condition (bad or good) but it get u another money count - depending on condition item (in one recipe) ^^'
recipe Vendre Pistolet Glock 18C
{ destroy Base.EFK_G18C,
keep TancredTrader,
Result: Money=168,
CanBeDoneFromFloor:true,
Category:Money,
Time:0,
OnTest:ItemGoodCondition,
Tooltip:Tooltip_EFK_ConditionReparation,
}
it doesn't work too
function MyModFuncName(sourceItem, result)
if sourceItem:hasTag("EFK_Selling") then -- OR ANOTHER METHOD TO CALL YOUR ITEM
if sourceItem:getCondition() < sourceItem:getConditionMax() then
return false
end
end
return true
end
ItemGoodCondition.lua into the server folder
item EFK_G18C {
DisplayName = Glock 18C Pistol ,
Icon = G18,
WeaponSprite = G18,
Type = Weapon,
SubCategory = Firearm,
Ranged = TRUE,
IsAimedFirearm = TRUE,
WeaponReloadType = handgun,
FireMode = Auto,
FireModePossibilities = Auto/Single,
AttachmentType = Holster,
Tags = EFK_Selling,
The Item have got the Tag EFK_Selling
hmm
OnTest:ItemGoodCondition,
but function MyModFuncName
OnTest should contain name of function
if OnTest:ItemGoodCondition, then function ItemGoodCondition(sourceItem, result)
don’t worry, Im far from ideal of coding and I know what it is xD
Of course it works now 🤣
Thanks again mate 😉 🎉
nice
tip:
Add 'mod-tag' in name of func and where it call in OnTest.
like EFC_ItemGoodCondition, it's reduce chance for compatibility issue.
tip 2:
Ou! And file name ^^'
ItemGoodCondition just look like perhaps something that occurs frequently ^^'
most likely not, but the name is too non-individual
may be need do func local (like local function MyModFuncName(sourceItem, result), for reduce another thing, but i'm not sure can local func be called from another places, need ask veteran's of codding
Yeah i'll add my mod name near to it 😉 thanks for this advices 🙂
By the way, a question!
Why u wont want sell any item on condition side?
it's possible do for get another count of money, condition dependent
first answer : to be honnest i don't know how to do 🤣
second one : i'm putting the Escape From Tarkov gameplay into the Project Zomboid game
not playing...
Into Tarkov, people stop to buy the item after a condition
so into PZ, because player can repair weapon, it invite player to think when he loots or to repair to sell 😉
and i think it's harder and more interesting
final answer : all my project is based on the classic recipe system
i was looking for a good mod to manage buy/sell in solo i didn't find anything
and because next build will reset the classic recipe system, i don't look too much on little details for the moment about recipes 😉
just trying to make something working good with a lot of features
and will try to do better into every feature after 🙂
but you question is really good 🙂 in perfect case i hope to let player sell an item 100 - 60 % with a decreased price
and under 60%, don't accept the item 😉
I'm more blue than Blood Angels 😉
Император осуждает xD
what is the name of your mod man ? 🙂 i gonna take a look to maybe play with your stuff 😛
zRe Repair Any Clothes
Chuckleberry "GOD OF GODS" Finn, you Rippa! ❤️
it's work!
been forever but slowly getting back into it. you can force it. can probably do more with java side also
mainoptions.lua
getCore():getOptionUIRenderFPS()
getCore():setOptionUIRenderFPS()
Hmmm... I can get current FPS like number?
not option in setting
just like info?
i want try to use it
Current problem - Better Lockpicking has render UI with lockpicking and if your FPS high (more than 100 with UIFBO false) - this do more problem for lockpicking, arrow move very fast or bobbypin breaking so fast
Empirically, the following was identified:
if (getCore():getOptionUIFBO() == true) then
arrowSpeed = 3 -- separate interface processing ON (30 fps) (Best for 30 fps)
else
arrowSpeed = 1.5 -- separate interface processing OFF (vsync 60 fps) (Best for 60 fps)
-- But if FPS unlock some people has 400+ FPS and it's very big speed...
end
you should use delta time rather than relying on the fps cap, otherwise slowdown/speedup are unavoidable
local arrowTex = getTexture("media/textures/BetLock_arrow.png") --
local arrow_scale_step = 0
local arrowSpeed = 0
if (getCore():getOptionUIFBO() == true) then
arrowSpeed = 3 -- separate interface processing ON (30 fps)
else
arrowSpeed = 1.5 -- separate interface processing OF (vsync 60 fps)
-- But if FPS unlock some people has 400+ FPS and it's very big speed...
end
--local zReBLfps = self:getFPS()
local arrow_dx = arrowSpeed
local arrow_step_to_x = (WINDOW_WIDTH - xShift*2)/100
local crowbarTimer = 0
local progressBarVal = 0
local lastRenderMillis = nil
function CrowbarWindow:render()
self:drawText(getText("UI_Controls_Crowbar"), self.width/2 - (getTextManager():MeasureStringX(UIFont.Small, getText("UI_Controls_Crowbar")) / 2), 10, 1,1,1,1, UIFont.Small);
self:drawProgressBar(xShift, yShift, WINDOW_WIDTH - xShift*2, 20, progressBarVal, {r=0, g=0.6, b=0, a=0.8 })
self:drawRectBorder(xShift, yShift, WINDOW_WIDTH - xShift*2, 20, 1, 0.4, 0.4, 0.4)
self:drawTexture(arrowTex, xShift - arrowTex:getWidth()/2 + arrow_scale_step*arrow_step_to_x, 75+30, 1, 1, 1, 1)
local currentMillis = math.floor(getTimeInMillis())
local isNewTimeStep = false
if lastRenderMillis ~= currentMillis then
lastRenderMillis = currentMillis
isNewTimeStep = true
end
if crowbarTimer > 0 then return end
local endurance = self.character:getStats():getEndurance()
--- zRe anti-abuze system
if endurance <= 0.5 then
self:close() --CrowbarWindow.instance:close()
return
end---
if isNewTimeStep then
arrow_scale_step = arrow_scale_step + arrow_dx
if arrow_scale_step >= 100 then
arrow_scale_step = 100
arrow_dx = -arrowSpeed
elseif arrow_scale_step <= 0 then
arrow_scale_step = 0
arrow_dx = arrowSpeed
end
end
end
tell me how to do this?
i just made a weapon model in blender. how do i change where on the item my character holds?
multiply by UIManager.getMillisSinceLastRender() when applying the movement
this way it will behave the same at any fps
Can you be more specific for complete dummies? ^^'
wherever you move something, multiply the amount of movement by that
e.g. it looks like in this code it should be used as ```lua
arrow_scale_step = arrow_scale_step + arrow_dx * UIManager.getMillisSinceLastRender()
if i'm understanding how this code works
im try it now, thanks
holy sh...
okay. has big effect
trying put it something else, but your help so great, thanks a lot
--local currentMillis = math.floor(getTimeInMillis())
local currentMillis = UIManager.getMillisSinceLastRender() -- zReBL
perfect
but yep, your solution be smoother
arrow_scale_step = arrow_scale_step + (arrow_dx * UIManager.getMillisSinceLastRender() * 0.1)
Adding zombie loot
require "Items/SuburbsDistributions"
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "Base.Money")
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 100.00)
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "Base.Money")
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 100.00)
How do I set an item amount and add extra rolls? Also, will this override vanilla or modded item distributions in this table doing it this way?
My thought is to merge a new table into the existing table to avoid conflicts, but my thought process may be wrong.
this won't override anything
the item amount is defined in the item script, and the number of rolls is specific to the container type
that is, it's not a per item thing, the entire container is rolled however many times it's set to
Hrmm, I would have to create new item entries to set the amount? Not something like this?
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "Base.Money:5")
no, i don't think there's any trick like that
Hrmm, is it different for zombie loot? Maybe something like this will work.
#mod_development message
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, { name = "Base.Money", min = 1, max = 99, weightChance=50});
that's for adding a loot table, not an item
i don't think zombie loot even supports multiple loot tables but if it did i don't think it'd be all that helpful anyway
does anyone know if chanceOfAttachedWeapon works like degrade chance?
So it would be "1 out of X" X being the value its set to?
Or am I mistaken?
I'm lost here
real quick, is there a way to select the radio.xml file and making changes programmatically
howdy all
Anyone know if it's possible to use the new tags for scripting a recipe? I'm trying to create a recipe where it uses one unit of any source of gasoline as part of the recipe
Would anyone have an idea about that? Animations' xml
Hi so
I have an idea for a death music replacer
Anyone willing to give me a crash course on how to make?
at the very least where the hell does Workshop put the mods because I'm trying to learn this
what export settings? I am using vanilla animations
I'd really suggest this guide:
Should get you started on most of stuff
rephrasing myself: is it possible to get the current online players coordinates?
getPlayer():getX()
getPlayer():getY()
no sorry, this code runs on the client, i want to get the X and Y coordinates of the current online players (all of them)
guys, what do function Myfunc:perform() in ISBaseTimedAction?
and what is the difference between perform and stop
Does anyone have a step-by-step tutorial on how to create my custom tiles and be able to use them?
Which event triggers when you update the sandbox settings?
Some sandbox options apply after restart or on new game. There is no event.
one is for success, the other is for fail.
So how does a server update it's sandbox settings once they get modifed and saved ingame?
OnInitGlobalModData?
it processes the packet and applies to java and lua I guess. Saving is probably done on shutdown.
local function CFIEnable()
if SandboxVars.CustomizableFakeInfection.Enable == true then
Events.OnPlayerUpdate.Add(UpdateFakeInfection)
Events.EveryOneMinute.Add(CustomizableFakeInfection)
end
end
Events."???".Add(CFIEnable)
I got that setting in the sandbox options that either enables or disables the script and I'm not quite sure on which event It should update
Or if it even needs an event. 😄
yeah, OnInitGlobalModData is good for this.
Has there been any major changes for item spawning since this was updated?
https://steamcommunity.com/sharedfiles/filedetails/?id=2609939329
emmm
if actions be stopped by zombies, it's fail? xD
yeah, most action don't do nothing unless it's finished
local function UpdateFakeInfection(player)
if SandboxVars.CustomizableFakeInfection.Enable == true then
local bodydmg = player:getBodyDamage();
etc ...
etc ...
So that modinit didn't work for me, I probably ducked it up. I just added the SandboxVar in question to the actual functions and it seems to work. 🤷
If it's set to false it'll just skip the function entirely.
not sure what you mean, this event triggers during loading. Before this event, the options will not be loaded from the save most times, unless you create a character. You need to quit to menu after you change the options.
Uhh... so I got these functions
local function UpdateFakeInfection(player)
-- Does Something
end
local function CustomizableFakeInfection()
-- Does Something
end
Events.OnPlayerUpdate.Add(UpdateFakeInfection)
Events.EveryOneMinute.Add(CustomizableFakeInfection)
Each of these functions now check for the SandboxVars.CustomizableFakeInfection.Enable == true and if it isn't true it'll just end the function.
local function UpdateFakeInfection(player)
if SandboxVars.CustomizableFakeInfection.Enable == true then
-- Does Something
end
end
local function CustomizableFakeInfection()
if SandboxVars.CustomizableFakeInfection.Enable == true then
-- Does Something
end
end
Events.OnPlayerUpdate.Add(UpdateFakeInfection)
Events.EveryOneMinute.Add(CustomizableFakeInfection)
The whole thing is a huge Rube Goldberg machine 😂
If nested in If nested in for loop nested in ifs* ...
can anyone explain what "OnCreate:BSItem_OnCreate" means
the wiki doesn't do a very good job
fyi, overlays don't change alpha in 41.78. The object sprite is barely visible but the overlay sprites are bright in darkness.
* this happens when you add overlay colour.
v.42 probably not an issue
#overlaySprite
can you correct it by updating the overlay colors depending on some parameter on the rest of the tile changing depending on the darkness ?
At that point I'd rather add more sprites pre-coloured to the game.
dunno if you solved yet but you'd want to loop over online players and return their coordinates
local playersList = getOnlinePlayers();
for i=1,playersList:size() do
local player = playersList:get(i-1)
local x = player:getX()
local y = player:getY()
end```
keep in mind if you want this to reliably get *every* player it needs to be done on the server side
Why does the Crack not show up in LootZed?
ZedDistro.lua
require 'Items/SuburbsDistributions'
table.insert(SuburbsDistributions.all["Outfit_Police"].items, "Base.PA_Crack")
table.insert(SuburbsDistributions.all["Outfit_Police"].items, 100.00)
The light itself is the button.
wooooow
bad things
if u have state for TrunkDoor like LockBroken
vanilla hole...
for vanilla function override i should create lua file in same folder with another file name but same func name?
Thank you!
its fine i think, the area is small enough that i think can get away with it, i can test it in a couple of days anyway
?
I was going to ask about that
lock being broken usually means it can't be opened doesn't it?
that's how the building windows work (don't they?)
yep, but vanilla not has this func, because in vanilla not have method for break Lock on usable car
we do it for Crowbar lockpicking
ah
crowbar break lock => but u can use lock func for trunk fine and it's do state to lock
for another door work fine
i need a help with old thing, again...
min
How i can close UI in this TimedAction:
https://github.com/kERHUS/zRe-Better-Lockpicking/blob/main/lua/client/Lockpicking/Actions/CrowbarActionAnim.lua
local win = CrowbarWindow.instance
win:setVisible(false); -- zRe Force Close FIX
win:removeFromUIManager(); -- zRe Force Close FIX
win:close() -- zRe Force Close FIX
that looks right?
i should do req, yep?
yeah
you can have multiple requires
just require the UI file if you're going to call that close
how about folder?
CrowbarActionAnim.lua in client/lockpicking/Actions folder
CrowbarWindow.lua in client/lockpicking/Crowbar folder
require "lockpicking/crowbar/CrowbarWindow"?
and where need put this:
local win = CrowbarWindow.instance
win:setVisible(false); -- zRe Force Close FIX
win:removeFromUIManager(); -- zRe Force Close FIX
win:close() -- zRe Force Close FIX```
i try put it in :Stop
mhmhm...
it's in perform
yes, requires need anything after /client/ /server/ or /shared/
I think perform = complete
so that's the right place
understond
nah, looks like not
is there a complete?
win:setVisible(false); -- zRe Force Close FIX
win:removeFromUIManager();
this param not work on preform
error?
but work on stop
this
paste it
min
ouch
when i open Error Magnifier frame
generate it's
nah, can't copy xD
[28-09-23 08:23:49.006] DEBUG: Vehicle , 1695871429005> BaseVehicle.update > Vehicle vid=252 velocity last=( 1,792E-2 1,863E-1 1,202E-3)/0,187192 current=(-5,152E-3 1,758E-1 -3,460E-4)/0,175903 delta=0,023127.
[28-09-23 08:24:07.845] ERROR: General , 1695871447845> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Stack overflow at Coroutine.ensureCallFrameStackSize line:96..
[28-09-23 08:24:07.846] ERROR: General , 1695871447846> DebugLogStream.printException> Stack trace:.
[28-09-23 08:24:08.058] LOG : General , 1695871448058> -----------------------------------------
STACK TRACE
-----------------------------------------
function: clear -- file: ISTimedActionQueue.lua line # 158 | Vanilla
function: close -- file: CrowbarWindow.lua line # 168 | MOD: zRe Better Lockpicking
function: stop -- file: CrowbarActionAnim.lua line # 61 | MOD: zRe Better Lockpicking
Callframe at: StopAllActionQueue
function: clear -- file: ISTimedActionQueue.lua line # 158 | Vanilla
function: close -- file: CrowbarWindow.lua line # 168 | MOD: zRe Better Lockpicking
function: stop -- file: CrowbarActionAnim.lua line # 61 | MOD: zRe Better Lockpicking
Callframe at: StopAllActionQueue
hmmm CrowbarWindow.lua
function CrowbarWindow:close()
self.lockpick_object:getModData()["BetLock_crowbarProgressBar"] = progressBarVal
getCore():addKeyBinding("Left", self.character:getModData()["Lockpick_Left"])
self.character:getModData()["Lockpick_Left"] = nil
getCore():addKeyBinding("Right", self.character:getModData()["Lockpick_Right"])
self.character:getModData()["Lockpick_Right"] = nil
getCore():addKeyBinding("Forward", self.character:getModData()["Lockpick_Forward"])
self.character:getModData()["Lockpick_Forward"] = nil
getCore():addKeyBinding("Backward", self.character:getModData()["Lockpick_Backward"])
self.character:getModData()["Lockpick_Backward"] = nil
getCore():addKeyBinding("Melee", self.character:getModData()["Lockpick_Melee"])
self.character:getModData()["Lockpick_Melee"] = nil
ISTimedActionQueue.clear(self.character) -- <---- THIS IS 168 line
CrowbarWindow.instance = nil
ISPanel.close(self)
end
CrowbarActionAnim.lua
function CrowbarActionAnim:stop()
if self.sound and self.sound:isPlaying() then
getSoundManager():StopSound(self.sound)
end
local win = CrowbarWindow.instance
win:setVisible(false);
win:removeFromUIManager();
win:close(); -- < --- THIS IS 61 line
ISBaseTimedAction.stop(self)
end
hmm, may be just copy function CrowbarWindow:close() without ISTimedActionQueue.clear(self.character)
like :close2()
function gameNightWindow:closeAndRemove()
self:setVisible(false)
self.elements = {}
self:clearMovingPiece()
self:removeFromUIManager()
if gameNightWindow.instance == self then gameNightWindow.instance = nil end
end
I usually write my own close which includes remove
i think ISTimedActionQueue.clear(self.character) in function CrowbarWindow:close() just workaround, when u complete minigame
function CrowbarActionAnim:new(character, isGarage, lockpick_object)
local o = {}
local zReBLLO = self.lockpick_object
setmetatable(o, self)
self.__index = self
o.character = character
o.lockpick_object = lockpick_object
o.maxTime = 50000
o.isGarage = isGarage
return o
end
action time 50000
hhmhmhmh
brain assault
okey,may be i'm understood, I'll try some stuff
If you need the action to continue while the game goes on you can just make the action looped
Are you using a timed action to make the player animate?
but when u atacked by zombies - it's turn off control
like this
u can't move by SWDA, because minigame change control mode
only with mouse
your animation stop
but UI not close
you can use update() in the UI
function gameNightWindow:update()
if (not self.player) or (not self.square) or ( self.square:DistToProper(self.player) > 1.5 ) then
self:closeAndRemove()
return
end
you can pull the current action
hmhmhmh
but what you have should work
okey. im try it, thanks for tip
nice, work without drop into error
but not control
swda not work xD
function CrowbarWindow:closeFromActionAnim() -- zReBL Фикс при прерывании взлома зомбиками
self.lockpick_object:getModData()["BetLock_crowbarProgressBar"] = progressBarVal
getCore():addKeyBinding("Left", self.character:getModData()["Lockpick_Left"])
self.character:getModData()["Lockpick_Left"] = nil
getCore():addKeyBinding("Right", self.character:getModData()["Lockpick_Right"])
self.character:getModData()["Lockpick_Right"] = nil
getCore():addKeyBinding("Forward", self.character:getModData()["Lockpick_Forward"])
self.character:getModData()["Lockpick_Forward"] = nil
getCore():addKeyBinding("Backward", self.character:getModData()["Lockpick_Backward"])
self.character:getModData()["Lockpick_Backward"] = nil
getCore():addKeyBinding("Melee", self.character:getModData()["Lockpick_Melee"])
self.character:getModData()["Lockpick_Melee"] = nil
--ISTimedActionQueue.clear(self.character)
CrowbarWindow.instance = nil
ISPanel.close(self)
end
you can grab the action's update
i forget what the function is called
could end the action if there's no instance open
making a pretty simple mod for a few buddies and had a question im wondering about
how would you go about changing
CustomEatSound = DrinkFromCarton
to another sound of your choice?
ive attempted just switching the name of the mp3 to the name of my sound which didnt work
Did you create a sound script?
I only have 1 script with the item and its consume sound, changed that consume sound to be
CustomEatSound = media/sound/mysoundname
hopefully that works
nah didnt work
wait
@fast galleon would it be
{
category = player,
clip
{ event = character/survival/drink/blank,
}
}```
thats my maybe guess
no add file = path to your sound
sound zxCalloutGetOverHere
{
category = Player,
clip { file = media/sound/scorpion-get_over_here.mp3, volume = 0.5,}
}
mine is up being
sound DrinkingFromChocolate
{
category = Player,
clip
{
file = media/sound/samsulekmilk,
}
}```
I seem to have forgotten the .mp3
also volume might come in handy later on
@fast galleon thank you for your help
I actually got the sound working
might have to tune it a tad down as it just blew my head off but I am one step closer
today I custom drew pixel art for the icon, made up the mod files and now the sound file
just need the ingame models for dropping it on the floor and holding it
wait maybe nvm just a holding it model
this ones funny
oops I dropped my PNG
as for how it looks in the inventory
i do it!
but with madness workaround
perfect!
https://youtu.be/GY0K42jYCsQ
Hi everyone,
I'm writing modData using ModData.add(String key, LuaTable table).
For some reason if the client doesn't close correctly, the moddata may not be saved to the harddisk.
Is something missing? Like an event?
I found in the documentation ( https://www.projectzomboid.com/modding/zombie/world/moddata/GlobalModData.html ) that there is Java API Moddata:save(), but is say:
" TurboTuTone. This class is not exposed to Lua, ModData.java which callbacks to this is exposed instead. "
Is there any way to use it? There is a solution?
Thank you
declaration: package: zombie.world.moddata, class: GlobalModData
ModData is the lua api for GlobalModData, if that doesn't have it you're probably out of luck
you can write files and read them in if it's absolutely critical
it should not matter how the client closes, but how the server closes. This is made to be on the server.
Are you suggesting manually saving the content of the moddata to a file and then retrieving it?
i noticed this issue both in single player and in multiplayer. I work on linux, if you write moddata ( pressing g ) and forcibly terminate it ( using xkill on Linux ) sometimes the file are lost, approximately 50% of the time
in debug mode you need to properly quit, out of debug it's a bit safer from my experience.
It's not only the moddata that is not saved...
I absolutely agree, but there can be cases where the client crashes inadvertently, and I must handle this situation.
My mod relies on recovering information present in the moddata.
I can work around the issues by creating and handling the file independently, but is there a specific API I would prefer to use
How often do you change the data? Normally you send it to server as soon as it needs to be changed.
The mod was created to host PVP events.
Therefore, it creates a local copy of the character. In case of death, the character can be retrieved.
The mod works correctly; out of 16 participants, 4 experienced crashes for unknown reasons.
In those cases, the mod didn't perform well. On their server, there are hundreds of mods, and as far as I know, my mod hasn't caused any crashes.
well I still lean towards saving it on server, unless it's something that is allowed to be changed by the users.
Okay, What do you recommend? I'm new to the world of modding and I'm here to learn.
Do you have any mod/code to inspire me?
This is not exactly something I'm very familiar with. I do have some irregular syncing mods, but nothing inspiring.
how do I force player to wear welding mask in a recipe script?
I only know these two methods
- ModData.transmit(String key)
- ModData.request(String key)
So, I want to use sandbox vars for distributions. Seems sandbox vars are loaded after distribution tables. Tried using ItemPickerJava.Parse() on Events.OnInitGlobalModData.Add. Results in LootZed tables being correct but the item will not drop.
Any other suggestions?
These are used to relay the data from servers to clients and vice versa. You'd still want to use the get methods to grab the subtable matching the ID used in transmit/request
Also, by chance - the message above related to your next step - as there are events when data is received
that's when you can decide how to treat the data
You don't really need to house the data on clientside at all - so I would suggest keeping it on server and pulling it when needed
Actually 🤔
If the globalmoddata never gets wiped for players' version of it
you may not need the server at all
I'm pretty sure that data is tied to the world/save
even in MP
anyone knows how you can use rgb in translations?
I can't seem to recreate a fannypack item by copying the same vanilla coding, everything works fine ingame except there is no model showing
item MedicalFannyPackFront
{
DisplayCategory = Bag,
WeightReduction = 50,
ClothingItemExtra = MedicalFannyPackBack,
ClothingItemExtraOption = FannyPack_WearBack,
clothingExtraSubmenu = FannyPack_WearFront,
Weight = 0.2,
Type = Container,
Capacity = 1,
DisplayName = Medical Fanny Pack (Front),
Icon = MedicalFannyPack,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
BodyLocation = FannyPackFront,
ClothingItem = MedicalFannyPackFront,
CanBeEquipped = FannyPackFront,
RunSpeedModifier = 0.98,
WorldStaticModel = FannyPack_Ground,
}
item MedicalFannyPackBack
{
DisplayCategory = Bag,
WeightReduction = 50,
ClothingItemExtra = MedicalFannyPackFront,
ClothingItemExtraOption = FannyPack_WearFront,
clothingExtraSubmenu = FannyPack_WearBack,
Weight = 0.2,
Type = Container,
Capacity = 1,
DisplayName = Medical Fanny Pack (Back),
Icon = MedicalFannyPack,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
BodyLocation = FannyPackBack,
ClothingItem = MedicalFannyPackBack,
CanBeEquipped = FannyPackBack,
RunSpeedModifier = 0.98,
WorldStaticModel = FannyPack_Ground,
}
I just copied everything from the vanilla files, except I added the "Medical" here and there
the line "ClothingItem = MedicalFannyPackBack" refers to the .xml files inside media/clothing/clothingitems
Dont quote me on this as I'm brand spanking new to modding.... but I think that ClothingItem = MedicalFannyPackBack, should just be default (ClothingItem = FannyPackBack, if that's the default).
My guess is the script pointing towards a particular model for the clothing item, MedicalFannyPack, which doesn't exist, so it just doesn't display.
The world model isn't the same as the static model used by characters, so you can't just point towards the ground model, which I believe already has x,y,z, attributes appointed to it.
Again, this is just an educated guess, try it out and LMK
yeah what @spongie said
yeah you'll have to make a new .xml file in that folder which you reference in the item script
inside the xml file you'll need to replace the GUID tag with a new GUID so that it doesn't conflict with any other files. you'll also need to make a "media/fileguidtable.xml" where you reference your new clothingitem .xml file as well as its GUID
you can copy the fileguidtable from the vanilla files and use it as a base to start from, just delete everything in there except for your new items
yes, I had both front and back.xml all set up
I did all those steps
everything shows up on the game except from the model
did you add them to the fileguidtable?
yes
<files>
<path>media/clothing/clothingItems/MedicalFannyPackBack.xml</path>
<guid>bb4d7252-0769-45ac-b23d-900c549f1043</guid>
</files>
<files>
<path>media/clothing/clothingItems/MedicalFannyPackFront.xml</path>
<guid>f12278ad-58f3-4bb0-aa30-858e34e9eb91</guid>
</files>
oh weird
Does anybody know if it's possible to fetch a zombie's current animation being played?
what do the xml files look like?
pretty much like the vanilla one
it's literally a copypaste
the only thing I found strange is that I copied the vanilla .x models for this one
and they looked like this
thats what the importer does to them it should be fine
the uv map is out of the space
I tried doing it without the models in my mod folder, so it should run to the gamefiles
didn't work either
i noticed that the model names in the vanilla file has a typo lol
idk if thats connected or if the actual model name is the same
no, they are just to tell them apart, the front and back models
so they are also listed one below the other
they are labeled that way on purpose
like it says Pact instead of Pack
but it has back at the end lol
yea the models are named that
it's all on purpose
idk why
they just did it, and it works
i cant tell what might be messing it up
the only kind of problem in the vanilla file is that they included the "media/models_x" thing and the ".x" when they dont need to include either of those
but that usually doesnt break anything
try checking the console in debug mode when you equip it and see if it says anything maybe
it usually mentions if it cant find the xml file
Ok I'll check
I tried converting them to .fbx and erase the .x on the .xml and still didn't work
I'm sure I'm missing something so little
Need help.
How to check all self inventory (with backpack) for items on has tag?
How to remove this item, if they exist (one count, X count)?
self.character:getInventory():containsTag("MyTag")?
There's recursive checks
Check the java file for item containers
There's a boatload of methods
getFirstTagRecurse?
local myitem = self.character:getInventory():getFirstTagRecurse("MyTag")
myitem:Remove?
nice, it's looks i need for my one count
container:remove(myitem)?
The container in this case is the players inventory
So self.character:getInventory() etc
self.character:getInventory():container:remove(myitem)
if win.character:getInventory():getFirstTypeRecurse("BobbyPin") then -- containsType
win.character:getInventory():getContainer():Remove():getFirstTypeRecurse("BobbyPin")
-- win.character:getInventory():Remove("BobbyPin")
elseif win.character:getInventory():getFirstTypeRecurse("HandmadeBobbyPin") then -- containsType
win.character:getInventory():getContainer():Remove():getFirstTypeRecurse("HandmadeBobbyPin")
-- win.character:getInventory():Remove("BobbyPin")
else
win.breakTimer = 2
win.isFailEnd = true
end
if not (win.character:getInventory():getFirstTypeRecurse("BobbyPin") or win.character:getInventory():getFirstTypeRecurse("HandmadeBobbyPin")) then -- containsType
win.breakTimer = 2
win.isFailEnd = true
end
comments - original
not work...
remove item's from inventory, but if them in backpack - nope
@winter bolt I fixed it, I had the texture path wrong all this time
ohh
Maybe there's another function for deeper recurse
Although recursive should be that lol
Oh I see something that may be wrong
Isn't inventory the container?
Does getInventory():get container() do anything?
I have a "mayby" simple question. For a timed action I equip two items:
ISWorldObjectContextMenu.equip(player, player:getPrimaryHandItem(), tool, true) ISWorldObjectContextMenu.equip(player, player:getSecondaryHandItem(), item, false)
after the action is done I want to convert the "item" to another one which is added to the inventory.
The problem appears when I try to remove the old item in the SecondaryHand. So far I tried to remove it with the following code:
ISInventoryPaneContextMenu.unequipItem(self.item, self.character:getPlayerNum()) self.character:getInventory():DoRemoveItem(self.item)
What I expect is the same behavior when a weapon breaks. The weapon disappears and the broken item is in the inventory. Is there a simple way to do it?
did you call ItemPickerJava.Parse() before adding to the distributions instead of after? the lootzed inconsistency is caused by changing the tables but *not* pushing them to the item picker after
I have been doing it after. Pretty much at loss for now trying different events.
not sure i just take it from vanilla:
items = playerInv:getSomeTypeEvalRecurse(itemFullType, buildUtil.predicateMaterial, itemCount)
for i=1,items:size() do
local item = items:get(i-1)
playerObj:removeFromHands(item)
if item:getContainer() then
item:getContainer():Remove(item);
else
playerInv:Remove(item)
end
itemCount = itemCount - 1
table.insert(consumedItems, item)
end
but removed array (massive, not know how it be on eng)
okey, looks like i do something wrong
Item container is the object type
Player:getInventory is a item container
You are trying to get the container of a container
Also I'm not home, so I might be remembering wrong
This should be producing an error or something
local zReBLBP = win.character:getInventory():getFirstTypeRecurse("BobbyPin")
local zReBLHBP = win.character:getInventory():getFirstTypeRecurse("HandmadeBobbyPin")
if zReBLBP then -- containsType
win.character:getInventory():Remove(zReBLBP)
elseif zReBLHBP then -- containsType
win.character:getInventory():Remove(zReBLHBP)
else
Any errors?
not know, test in progress
If this doesn't error out - then the method for finding the item isn't what it's advertised as
finding work fine
but remove method not work
nope!
Work on inventory
but not trigger into backpack
hmhmhmh
remove from item:getContainer() not from character:getInventory()
attempted index: Remove of non-table: null function: OnKeyKeepPressed -- file: BobbyPinWindow.lua line # 421 | MOD: zRe Better Lockpicking java.lang.RuntimeException: attempted index: Remove of non-table: null at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980) at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812) at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66) at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139) at zombie.Lua.Event.trigger(Event.java:64) at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92) at zombie.input.GameKeyboard.update(GameKeyboard.java:85) at zombie.GameWindow.logic(GameWindow.java:249) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71) at zombie.GameWindow.frameStep(GameWindow.java:765) at zombie.GameWindow.run_ez(GameWindow.java:681) at zombie.GameWindow.mainThread(GameWindow.java:495) at java.base/java.lang.Thread.run(Unknown Source)
oh, item... not character...
local zReBLBP = win.character:getInventory():getFirstTypeRecurse("BobbyPin") - item
zReBLBP:getContainer():Remove()?
how it's should write... 
He doesn't know where the item is or if there is one
Remove erroring from a null 🤔
local zReBLBP = win.character:getInventory():getFirstTypeRecurse("BobbyPin")
if zReBLBP then
zReBLBP:getContainer():DoRemoveItem(zReBLBP)
end
Am I mistaken, isn't get inventory an item container?
it is the main inventory container
LEGEND!
work
thanks so much :3
not all functions are recursive and once the getFirstRecurse is valid the lower layer (backpack) container can be retrieved directly from the item.
It seems I could solve my issue with:
self.character:removeFromHands(self.item) self.character:getInventory():DoRemoveItem(self.item)
Ah, I get it now. Whoops.
Chuck, remember u write thing for client-server command to sync vehicle
it's should be do for doors and windows like Thumbnail or IsoObject? (not car doors)
i'm just nothing see in vanilla doing client-server command...
function ISLockDoor:perform()
local soundPrefix = self:getSoundPrefix()
if self.lock then
self.door:setLockedByKey(true);
self.character:getEmitter():playSound(soundPrefix .. "Lock");
-- getSoundManager():PlayWorldSound("lockDoor", self.door:getSquare(), 0, 10, 0.7, true);
else
self.door:setLockedByKey(false);
self.character:getEmitter():playSound(soundPrefix .. "Unlock");
-- getSoundManager():PlayWorldSound("unlockDoor", self.door:getSquare(), 0, 10, 0.7, true);
end
local doubleDoorObjects = buildUtil.getDoubleDoorObjects(self.door)
for i=1,#doubleDoorObjects do
local object = doubleDoorObjects[i]
object:setLockedByKey(self.lock)
end
local garageDoorObjects = buildUtil.getGarageDoorObjects(self.door)
for i=1,#garageDoorObjects do
local object = garageDoorObjects[i]
object:setLockedByKey(self.lock)
end
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
And to be honest, I don’t know if it syncs... need testing...
There is vanilla stuff the file doesn't appear in the documenting tools though
yeah, i test it with friend. that normal sync without any send client-server command
sounds of relief
Yeah most things are relayed
How do y'all create items? I'm so tired of manually copy pasting stuff I've already made and generation is HORRIBLE to configure, just wondering if y'all use some tool or smth.
Howdy party people
Quick question, anyone know about how the RNG generator works? I'm trying to code for an item I've made to make it super rare (1 in a million example)
If you mean for loot, the chance varies
right, but why are some items on the table 4? Shouldn't the rolls be between 0 and 1?
rolls are how many times the chance is 'rolled'
oh because it's adjusting the weighting to compensate for the rolls, got it
yup ok just answered my own question lol
yah in a container with one roll, an item that has 50% chance to spawn would read as 0.5, where as in container with two rolls it would be 1
Right?