#mod_development

1 messages Β· Page 232 of 1

bright fog
#

I didn't fully test sizes

#

I just know that, you can make your images as large as you want

#

And they'll fit in the modpage

#

But if they are too small, they might not take the entire space

#

So like at a minimum I know my images take the whole page so I use that or more

#

I think the important part is finding your style, in my case I just took back Susceptible's style to really feel like an extension to it

#

But something really nice I made for example recently

#

You can even add videos

#

Like not gif, actual videos in your mod pages

gleaming sorrel
# bright fog So like at a minimum I know my images take the whole page so I use that or more

Yeah

I think I'm going to start work on some images to use

Maybe a picture of courtman medical
The 2 patient images and the symptoms chart

At least for the Boiling Rash

I really want to go all out with a government briefing style
Sort of like
A document full of information you would give to someone to explain the situation

There is alot I could do to make it look really nice

bright fog
#

You can take for example TLOU symptom charts

#

You could even make these spawn around the world

#

Make it an item

gleaming sorrel
bright fog
#

Yeah

#

Check out Expanded Helicopter Events

#

They have some items like that that you open like a map

#

Chuck's also made a framework to easily add new custom map items like that

gleaming sorrel
#

Because I honestly have no idea how people do that

bright fog
#

Haha

#

Let me show you my mod page code

#

List of all markup (BBCode) tags on Steam, where they can be used, their parameters and issues surrounding them....

This guide shows you how to embed images and buttons in the description of artwork, screenshots, and workshops.

https://i.imgur.com/m9mCPUE.png
https:/...

gleaming sorrel
#

This should help

Thank you for the resources
I've been struggling to get this information for awhile

bright fog
#

Don't hesitate if you have any questions

#

Especially for hosting your images and videos

#

Anyway gtg sleep now

violet shell
#

Anyone would have some spare time to help me understand why my mod options doesn't show up in SandboxVars options ?

violet shell
#

I think I made it πŸ™‚ Thanks πŸ˜‰

#

I have a question tho. I just made a little mod that expand Braven's "Erase Map Data" mod (with is courtesy). I chose to have a sandbox option to "Erase All map" or "Erase only visited areas". The main objective of this mod is to be able to play with map full revealed but still be able to erase visited areas on death. I wonder if it would be better to just check server map options and select the right choice depending of the server map option. What do you think ?

red tiger
#

Progress on my software.

#

@thick karma

thick karma
#

😎

uneven vessel
#

Can someone help me figure out why my case item isn't spawning items?

violet shell
#

Hmm ok, I don't understand why my sandbox options are in the main options and not in my own category...

uneven vessel
#

I've inserted the case itself into multiple things and it works fine

#

but the case is always empty even tho I have this

violet shell
mellow frigate
violet shell
#

My previous verison was :


option EraseMapXpanded = {
type = enum, numValues = 2, default = 1,
    page = EraseMapXpanded, translation = EraseMapXpanded_option,
 valueTranslation = EraseMapXpanded_optionChoices,
}```
#

without the ".Option" it just adds a line in the vanilla Sandbox options, with the ".Option" it adds a new category πŸ™‚

#

Do you know how I can inject comments in the SandboxVars.lua in my mod options category so when people edit the file they can have hints on what numbers does what ?

violet shell
violet shell
#

Anyone can help me finding relationship between Nutrition() and Stats():Hunger() ? How the first one affects the second one ? I'm making a mod that tries to simulate fast forwarding time in MP by draining stats, but I don't find how Nutrition & Hunger are tied together πŸ™‚

bronze yoke
#

the short answer is they aren't tied together

#

when you eat food you gain nutrients and lose hunger, but nutrients and hunger don't really interact with each other

violet shell
#

ok, so if I want to simulate passing time, then I should update player Stats():Hunger() rather than Nutrition() right ?

bronze yoke
#

both decrease over time

#

if you increase hunger but don't decrease nutrition it'll be difficult to lose weight

violet shell
#

ok, so I need to find where are hidden the increase/decrease Stats in the code to be able to simulate what I want πŸ™‚

#

kERHUS found me this :
ThirstIncrease = 0.000019,
ThirstSleepingIncrease = 0.000015,
ThirstLevelToAutoDrink = 0.1,
ThirstLevelReductionOnAutoDrink = 0.1,
HungerIncrease = 0.00005,
HungerIncreaseWhenWellFed = 0,
HungerIncreaseWhileAsleep = 0.000025,
FatigueIncrease = 0.00012,
StressDecrease = 0.00003,
BoredomIncrease = 0.0030,
BoredomDecrease = 0.0385,
UnhappinessIncrease = 0.001,
StressFromSoundsMultiplier = 0.00002,
StressFromBiteOrScratch = 0.0001,
AngerDecrease = 0.0001,
BroodingAngerDecreaseMultiplier = 0.3,
SleepFatigueReduction = 0.0001,

#

but I don't know where they found this πŸ˜„

bronze yoke
#

i think that's from ZomboidGlobals.lua

violet shell
#

All the stats are at 0

bronze yoke
#

yeah, because it loads the values from the lua table in Load()

violet shell
bronze yoke
#

ZomboidGlobals from defines.lua

violet shell
#

ok got them, thanks a lot @bronze yoke ! Do you know if the hours per day sandbox option modify those numbers ? Or maybe it's only the update that is made on in game time rather than RL time ?

bronze yoke
#

hunger is updated every tick but it's adjusted for in game time

#

i haven't researched nutrition but i would imagine it to be the same

violet shell
#

ok, so to simulate on a MP server the stats update due to fast forwarding when reading, I would just have to do the maths and apply the changes, no need to adapt it to the server day lenght options, right ?

#

Also, in BodyDamage.Class there are stuff like that :
setBoredomLevel((float)(getBoredomLevel() + ZomboidGlobals.BoredomIncreaseRate * GameTime.instance.getMultiplier()));

#

I guess that "getMultiplier" is the fast forward multiplier so is always = 1 in MP, so I don't care and can ignore it.

bronze yoke
#

it's a time delta that accounts for game speed and day length

grizzled fulcrum
#

Does PZ not allow debug module for lua? Was going to write some logging stuff but I get "non-table" so I'd assume it's a no.

#

Is there a list of lua modules that are available for PZ mods?

bronze yoke
#

it doesn't

grizzled fulcrum
#

that sucks

#

oh well logging isn't that important lol just wanted to see if I could've made it better

bronze yoke
#

for the umbrella addon i was able to disable intellisense for those libraries, so i can quickly find that if you want to know which ones aren't available

grizzled fulcrum
#

yes please πŸ™

bronze yoke
#

debug, io, package are not implemented

grizzled fulcrum
#

I do use umbrella but I still get intellisense

grizzled fulcrum
bronze yoke
#

also parts of the os library aren't available either, but i don't have a list of what exactly isn't

bronze yoke
grizzled fulcrum
bronze yoke
#

that's odd then, no idea what that's about

grizzled fulcrum
#

I can only assume it might be a result of emmylua or vscode's lua thing

bronze yoke
#

the addon manager lets me set some default settings for the language server when using the addon, i guess that part doesn't work for everyone

#
    "Lua.runtime.version": "Lua 5.1",
    "Lua.runtime.path": [
        "shared/?.lua",
        "client/?.lua",
        "server/?.lua"
    ],
    "Lua.completion.requireSeparator": "/",
    "Lua.workspace.preloadFileSize": 800,
    "Lua.runtime.builtin": {
      "debug": "disable",
      "io": "disable",
      "package": "disable"
    }
```specifically these
#

you can disable those manually from the extension settings if you want

grizzled fulcrum
#

ty! I put this in my .luarc.json file and it worked perfectly

violet shell
#

I would like to have something like getZomboidGlobals():getHungerIncrease()

bronze yoke
#

they're read from the lua table i pointed you to, just read them from there

violet shell
#

so I should have :
require ZomboidGlobals
or
require defines.lua

grizzled fulcrum
#

eg ZomboidGlobals.HungerIncrease and ZomboidGlobals.HungerIncreaseWhenExercise etc

violet shell
#

ok thanks, do I need to add a require XXX or as global data it's always loaded ?

grizzled fulcrum
#

Also you don't need to require ZomboidGlobals because it is global table and not a file

#

the latter

violet shell
#

Here where I am right now, so I can delete the require line

grizzled fulcrum
#

you should be able to yes

violet shell
#

Do you think this code would work or I'm missing something ?

grizzled fulcrum
#

well you can always test it

violet shell
#

sure πŸ™‚

grizzled fulcrum
#

but from a quick glance it looks like it would work

violet shell
#

the idea of the mod is to simulate fast forwarding time in MP, by adding stats decrease when player read, using the minutesperpage config of the server

grizzled fulcrum
#

the bottom line where you are adding your callback

#

it should be

Events.OnPlayerUpdate.Add(readwithfriends())
violet shell
#

ok thanks πŸ™‚ also, it's better to have this on server side right ?

grizzled fulcrum
#

With the code above, it wouldn't quite work on the server side

#

to my knowledge, getPlayer() is client side for getting the client player (the one you control).

#

The only thing I am unsure if it would work on the client side is getServerOptions (which you need to add a () too)

#

A good thing to note is that the way PZ is networked, client side handles most of the stuff. Server side is only used for somewhat specific things. Most things you can do on the client side only (for better or for worse)

violet shell
#

but all the stats stuff is server side I think

grizzled fulcrum
#

You can set stats from the client

#

It sounds weird, I thought that too but it's how this game is

violet shell
#

ok, also, to answer your question, getPlayer() can be server side. I use it in another mod I made.

grizzled fulcrum
#

I am not aware of that, I have never heard of it being server side

#

someone can correct me :p

violet shell
#

This is my mod that uses getPlayer() in a server side .lua

#

so I should have the getServerOption() in a server side file, and the rest in client side ?

grizzled fulcrum
#

I just tried to call getPlayer() on the server side and it's nil so I have no idea how you used it

violet shell
#

like that, and it works πŸ™‚ at least it was working last time I played with it

#

I call for the player in the function

#

local function getInfectionProgress(player)

#

and

#

function onCreateBloodAnalysis(items, result, player)

grizzled fulcrum
#

yes I see, I think I am wrong one sec

#

You can get the server options from the client btw

violet shell
#

ok nice πŸ™‚

#

gonna give it a try then, and I'll see if ot works accordingly

grizzled fulcrum
#

ok I just tested it 3 more times, getPlayer may not work as you think it might on the server side

#

I called getPlayer() on both client/server and got two different IsoPlayer.

violet shell
#

but I played with my mod for days on a dedicade server and it worked as intended. But I'm curious to learn more πŸ™‚

grizzled fulcrum
#

Server IsoPlayer is just a generic one named "Bob"

violet shell
#

I call my function only throught a recipe, so maybe that's why it works ?

grizzled fulcrum
#

I'd like to think so, but I'd expect it to error if it were trying to execute the functions on the client

#

I too am curious on why the hell this works but honestly I have no idea

violet shell
#

I have an error for my new mod btw

#

forgot a () after Unhappiness line 22 I think

vestal gyro
# violet shell I have an error for my new mod btw

How it feels when I first tested my mod thats adds a trait that lets you craft pipebombs and it got no error actually work and the only thing that didn't work at the start was displaying the name, description and icon

bronze yoke
bronze yoke
# violet shell

if you don't have a server check in your file it will run on the client, this only works because it is also running on the client, getPlayer() never returns anything on the server

grizzled fulcrum
bronze yoke
#

you can't

#

putting a file in the server folder is not enough to make it only run on the server, this is running on the client

violet shell
#

ok so even if my lua file is on the server folder, it runs as if it were in client folder ?

grizzled fulcrum
#

Maybe it's because of the recipe?

violet shell
#

because game just load lua files in alphabetical order ?

bronze yoke
#

the game loads files in this order
vanilla shared -> modded shared -> vanilla client -> modded client -> vanilla server -> modded server

#

each stage is loaded alphabetically

grizzled fulcrum
#

possibly to do with logical client/logical server stuff?? I am actually curious why the hell asilar's code was working then

bronze yoke
#

on the server, client is skipped vanilla shared -> modded shared -> vanilla server -> modded server

#

but the client does not skip server

#

infact the majority of the lua in the vanilla server folder is client only

grizzled fulcrum
#

my brain just enhanced to the fourth dimension

violet shell
#

ok πŸ™‚ That's also why I thought stats was serverside then I guess

bronze yoke
#

if you want your file to only run on the server you should start it with if isClient() then return end

grizzled fulcrum
#

and I thought minecraft's client/server model was hard 😭

bronze yoke
#

or rarely if not isServer() then return end

#

singleplayer is neither a client or a server, so it passes the first check, but not the second

#

usually you still want server stuff to run in singleplayer so the first one is more often useful

violet shell
#

What am I missing ?

grizzled fulcrum
#

nil*

violet shell
#

oh ok, so it's ok to get this error when I load the mod on the main menu, but it won't return an error when the game is running ?

bronze yoke
#

probably

grizzled fulcrum
#

well getPlayer wont return anything in the menu since there is no player

#

I thought OnPlayerUpdate would only update in the game where there is a player but I guess not?

violet shell
#

I guess there is a way to avoid that error right ? πŸ˜„

grizzled fulcrum
#

Oh wait

#

It's because I told you to do that stuff outside of the event callback

#

you could probably do it like this:

#
local plr = nil

function readwithfriends()
    print(plr:getUsername())
    -- Your stuff here
end

Events.OnPlayerCreate.Add(function ()
    plr = getPlayer()
end

Events.OnPlayerUpdate.Add(readwithfriends)
``` or something similar
#

although im not sure if the callback will actually set the local variable because it's in a callback

#

idk my mind is fried im going to sleep

violet shell
#

thanks for the help

grizzled fable
#

Would it be possible to hook into the "Delete All" action that you can use in trashbins to run some code? How could I do?
The code would be, take the trash container and cicle to see all the items it contains and take for all the items the weight from them and than add this to a variable, when the "delete all" is used that value is given to something...

violet shell
#

@bronze yoke damn, my mod doesn't work. Would you have some spare time to try to help me debug it ?

neon bronze
#

Does it raise an error for using the :getUserName() method?

violet shell
#

aoqia was not sure so I didn't try their code, shoud i try it like it's written here ?

neon bronze
#

You can always try

#

Never hurts

violet shell
#

but it's only onplayercreate, so if player just log back in, it won't work, right ?

bronze yoke
#

no, it's fired every time they join

#

but it should be OnCreatePlayer

#

not OnPlayerCreate

violet shell
#

ok, gonna give it a try then πŸ™‚ thanks !

bronze yoke
#

syntax error: Events.OnPlayerUpdate.Add(readwithfriends())
when you do readwithfriends() you call the function and pass the result (nothing), you want to do just Events.OnPlayerUpdate.Add(readwithfriends) to pass a reference to the function

violet shell
#

so it should be :
Events.OnPlayerUpdate.Add(readwithfriends)
instead of :
Events.OnPlayerUpdate.Add(readwithfriends())
?

bronze yoke
#

yeah

violet shell
#

Ok, trying πŸ™‚

red tiger
#

Good morning!

violet shell
#

does the UnhappinessIncrease is obsolete ?

#

This is defined in ZobmoidGlobals & defines.lua, but not in Stats Class

bronze yoke
#

it's still used

#

unhappiness is handled by BodyDamage

violet shell
#

ok

#
bDamage:setUnhappynessLevel(bDamage:getUnhappynessLevel()-(deltaUnhappiness/minperpage-deltaUnhappiness));``` ?
#

but the mod doesn't work as intended : player doesn't get thirsty or hungry when reading a 220 pages book (in solo play when you read a 220 pages book with fast forward, you get hungry/thirsty)

bronze yoke
#

stats:setHunger(stats:getHunger()-(deltaHunger/minperpage-deltaHunger));
won't deltaHunger/minperpage-deltaHunger always be a negative value? if minperpage is above 1

#

you're reducing their hunger

violet shell
#

minperpage is at 0.2 on my test server

verbal yew
#

oo

violet shell
#

so it's positive
for example :
deltahunger = 0.0030
minperpage = 0.2
deltaHunger/minperpage = 0.0030/0.2 = 0.0030*5 = 0.015
and deltahunger/minperpage-deltahunger = 0.01470

violet shell
verbal yew
#

hunger from 0 to 1.0 or 0 to 100?

violet shell
#

based on BodyDamage.class I think it's 0 to 1.0

verbal yew
#

hmm

violet shell
#

maybe my local SandboxMult = SandboxVars.StatsDecrease; is zero ?

#

or nil

verbal yew
#

maybe

snow hedge
#

It's 24 hours later but hey, here ya go!

verbal yew
#

module base imports base

#

bruh

bronze yoke
#

missing commas can cause problems even on the last line of a block

snow hedge
#

I just kept it as is, so, that's probably my issue then.

#

Whomp.

#

That too.

grizzled fable
#

Would it be possible to hook into the "Delete All" action that you can use in trashbins to run some code? How could I do?
The code would be, take the trash container and cicle to see all the items it contains and take for all the items the weight from them and than add this to a variable, when the "delete all" is used that value is given to something...

verbal yew
coarse sinew
verbal yew
#

or

function ISInventoryPane:onConfirmDelete(button)
    if button.internal == "YES" then
        local object = self.inventory:getParent()
        local playerObj = getSpecificPlayer(self.player)
        local args = { x = object:getX(), y = object:getY(), z = object:getZ(), index = object:getObjectIndex() }
        sendClientCommand(playerObj, 'object', 'emptyTrash', args)
    end
    self.removeAllDialog = nil
end
#

hmm, need look into object emptyTrash command

violet shell
#

is it possible that solo play stats drain and MP stats drain are not equal ? even if you setup your server as "Normal" for statsdecrease ?

violet shell
#

how can I find the ranges (numbers) of stats like boredom, fatigue, hunger, thirst and unhappiness ? I have weird numbers with my mod when I print the stats

#

Boredom is from 0 to 100 according to BodyDamage.class

#

UnhappynessLevel is also from 0 to 100 I think

#

and Hunger, Thirst and Fatigue should be from 0 to 1.0 I guess

violet shell
#

I managed to have my function working (for readwithfriends mod)
but the results are not as intended
When I tried a solo play to test, I red the 220 pages with fast forward, and at the end I was at second stage of thirst and first stage of hunger
In MP with my mod, after the 220 pages I was at last level of Hunger (took damage from it), and first level of unhappyness, and zero level of thirst
it is better than before, but doesn't work as intended.
drains too much hunger and unhappyness, and not enough thirst
Any idea ?

verbal yew
#

BoredomChange = (deltaBoredom/minperpage-deltaBoredom)*getGameTime():getGameWorldSecondsSinceLastUpdate()

#

or, as i say before - print getStats onPlayerUpdate, (last stat - previous) = delta per tick

#

in standart setting (1 hour daylenght)

mellow frigate
# verbal yew

TchernoLib gives a simple interface for delta time convertions between Simulated World Hours and Real Time Seconds: luatime.getRealtimeSeconds2WorldHours(sbTime) / luatime.getWorldHours2RealtimeSeconds(worldHours)

shadow edge
#

Hello, I want to make my own mod but I dont have any knowledge of coding. How can I begin with making a mod/coding? Can anyone recommend a good tutorial?

bright fog
hollow current
# shadow edge Hello, I want to make my own mod but I dont have any knowledge of coding. How ca...

I wouldn't say there's one single tutorial to encompass everything, but:

1- You can learn by looking at the lua code of the game and other mods.

2- To easily find what you're looking for in game files, use a tool that has the feature for "Search in files". I personally use Notepad++ for this.

3- You can also do some searches on this channel for your problem or question. Chances are it was asked before

4- There are tons of tutorials out there and github repos to help you get started. Unfortunately I'm not able to link you to them right now, but you can easily find them by searching for links or terms including GitHub in this channel

5- The community is very supportive so if you ever need help regarding something feel free to ask here

Happy modding :)

sweet escarp
#

Could someone help me? I'm trying to get the items in the trunk but I get an object call nil error when I use getItems() even though it's part of a container and it's not empty.

violet shell
verbal yew
#

i'm not sure, OnTick should be same as OnPlayerUpdate

#

but i think defines vars uses like not ontick, should be something else

#

or this is vars just... not mention for this

#

it general - as i say

#

find delta per tick

#

not like global variables from defines

#

just do stuff like

local function test()
  local stats = player:getStats();
  print("BoredomStat = "..stats:getBoredom());
end
Events.OnUpdatePlayer.add(test)
#

in log u get lines with print

hollow current
verbal yew
#

like
0.01
0.04
0.07
etc

nevermind.
push pause, get last (0.07) and previous (0.04)

#

0.07 - 0.04 = 0.03

#

this is delta boredom

#

for example

verbal yew
#

Events.OnUpdatePlayer.Add(getTrunkItems)*

#

OnUpdatePlayer take param to isoCharacter

#

not Vehicle

thick karma
verbal yew
#

local function getTrunkItems(ass)
local function getTrunkItems(goverments)
ass, goverments - just like local player

thick karma
#

This means it only proceeds when vehicle is nil, i.e., there is no valid object to work with

verbal yew
#

getPartByid from player?!

thick karma
#

No it's nil (if that line is ever reached)

verbal yew
#

nice

#

u see event?

#

OnUpdatePlayer

#

function OnUpdatePlayer(IsoChar)

thick karma
#

if vehicle ~= nil then return end guarantees vehicle will be nil

#

It only gets past that line if vehicle IS nil

#

It's supposed to be if vehicle == nil then return end

#

The code may have other problems, but this is definitely one of them

verbal yew
#
local function getTrunkItems(vehicle)  -- HERE VEHICLE IT"S PLAYER!!!
if vehicle ~= nil then return end -- IF NOT PLAYER THEN NOTHING, YEP?!
end

Events.OnUpdatePlayer.add(getTrunkItems)```
thick karma
#

You are supposed to bail from functions when the variable you need to exist IS nil

verbal yew
sweet escarp
#

Sorry, the wrong file was uploaded

thick karma
thick karma
# verbal yew

I understand what you're saying but you're missing what I'm saying

#

The items = line literally never happens UNLESS in theory vehicle is nil, which it probably won't be unless you manually call the function

verbal yew
#
local function getTrunkItems(player)
if player:getVehicle() == nil then return end
end

Events.OnUpdatePlayer.add(getTrunkItems)```
thick karma
#

Not ~=. You need ==

#

Otherwise you're guaranteeing that there is no vehicle

verbal yew
thick karma
#

But yeah in addition to that problem, as kERHUS is saying, the function is designed to receive a player, not a vehicle.

sweet escarp
#

Without the errors of the old version that I forgot to fix

verbal yew
#

Events.OnUpdatePlayer.Add(restoreVehicle)

#

?!

#

Add

#

nope?!

sweet escarp
verbal yew
bright fog
#

yeah

bronze yoke
#

umbrella has been updated! the main new feature is event callback alias types, you can now annotate a function as an event callback using this method:```lua
---@type Callback_OnCreatePlayer
local myOnCreatePlayer = function(playerNum, player)
-- your ide will automatically understand that playerNum is an integer, and player is an IsoPlayer
end

Events.OnCreatePlayer.Add(myOnCreatePlayer)


i've also added type definitions for functions linked to scripts: ``Item_OnCreate``, ``Item_OnCooked ``, ``Item_OnEat``, ``Item_AcceptItemFunction``, ``Recipe_OnCanPerform``, ``Recipe_OnTest``, ``Recipe_OnCreate``, ``Recipe_OnGiveXP``, ``VehiclePart_init``, ``VehiclePart_create``, ``VehiclePart_checkEngine``, ``VehiclePart_checkOperate``, ``VehiclePart_update``, ``VehiclePart_use``, ``VehiclePart_Install_test``, ``VehiclePart_Install_complete``, ``VehiclePart_Uninstall_test``, ``VehiclePart_Uninstall_complete`` - these should make interacting with these script properties much easier, especially as documentation for these is otherwise poor

the latest version of the events documentation has also been pushed, which includes descriptions for most* events' parameters, class definitions for events that pass complex tables (i.e. inventory context menu events), and enum types for events that pass strings
sweet escarp
#

Well, it may still have errors since I'm bathing myself in what I remember of the code since I don't have access to it right now.

verbal yew
#

HMMMM!!!!!!

#

OnCharacterCollide...

verbal yew
#

blushes

bright fog
#

uh πŸ‘€

verbal yew
#

HASHAHSHASHAHSH

#

xD

verbal yew
bright fog
#

There's methods you can apply on zombies to do that

#

Give me a sec

#

zombie:knockDown(true)

#

I believe it is

#

Tho not sure if that makes the zombies crawler actually

verbal yew
#

setStaggerBack(true) hmm... should be stuff to direction from player and zombie...

bright fog
#

Have never used the stagger one

verbal yew
bright fog
#

Guessed it

gleaming sorrel
#

Made a disease awareness poster

bright fog
verbal yew
# bright fog Guessed it
local function shouldBeStanding(zombie)
  -- as of 41.71:
  -- leg break, head bash, vehicle hit: isKnockedDown
  -- randomized vehicle stories: wasFakeDead / crawlerType = 1
  -- fakeDead: wasFakeDead
  -- Kate and Baldspot: crawlerType = 1
  -- createhorde2command: isKnockedDown / crawlerType = 1
      -- Note that isKnockedDown and crawlerType are not transferred on the network
      -- so not reliable when generated by server for client-owned state like knockedDown
  return not zombie:isKnockedDown()
    and not zombie:isStaggerBack()
    and zombie:getCrawlerType() == 0
    and not zombie:wasFakeDead()
end

local function SmashAllZombiesOnMyWay(player, zombie)
        --    ΠΈΠ³Ρ€ΠΎΠΊΠΈ Π·ΠΎΠΌΠ±ΠΈ               Π±Π΅ΠΆΠΈΡ‚ ΠΈΠ»ΠΈ спринтуСт
  if not player:isZombie() and (player:isRunning() or player:isSprinting())
  and zombie:isZombie() and shouldBeStanding(zombie) then
    
    local zSmash = 0
    if player:isSprinting() then zSmash = 0 end
    local zRandomizer = ZombRand(101)
    if zSmash > zRandomizer then
        zombie:setStaggerBack(true)
        player:Say("zombie stagger back")
     else
        zombie:knockDown(true)
        player:Say("zombie knockDown")
    end
    player:setKnockedDown(false)
    player:setFallOnFront(false)
    player:setBumpStaggered(false)
    --player:setBumpType("stagger");
    player:setVariable("BumpFall", false);
    --player:setVariable("BumpDone", true);
    --player:setVariable("BumpFallType", "pushedFront");
    end
end
Events.OnCharacterCollide.Add(SmashAllZombiesOnMyWay)```
#

who can test it?

bright fog
verbal yew
verbal yew
#

bruh...

#

and cancel run when collide...

#

main problem - player can fall. it's so much offen when you sprint

verbal yew
# verbal yew AHAHAHA
player:setBumpType("stagger");
player:setVariable("BumpFall", false);
player:setVariable("BumpDone", true);
player:setVariable("BumpFallType", "pushedFront");

so funny

outer crypt
#

Is it possible to "nudge" a world object by changing it's WorldPos slightly?

sweet escarp
bright fog
#

What did you do to have the player fall stumble backwards ?

red tiger
#

=)

#

The tool is live. Glad to get it into BETA so soon.

thick karma
#

Nice, I'll give it a try soon.

frank elbow
red tiger
#

We should look into generating json files with your older code.

frank elbow
#

Outing myself for not reading the greet message because I wanted to jump right in πŸ˜…

red tiger
#

I developed this in 72 hours.

#

lol

frank elbow
#

I'll still need to update that code; probably gonna scrap the overhaul I was doing for more sophisticated analysis

red tiger
#

This is the power of brain surgery hahah

#

What do you think of the rich text editor?

#

I use QuillJS and wrote my own conversion code for markdown to their format "delta".

#

The greet msg also links to a test JSON file that you can load.

frank elbow
#

I like it. Could be good to provide a shortcut for code

red tiger
#

Oh there's a preview pane on the bottom.

#

If your window is wide, a 3rd panel on the right appears.

uneven vessel
#

still stuck on this :c

#

I can't figure out why the boxes come out empty

#

i don't think this is loading even

red tiger
#

I'm adding a copy button for code windows right now.

#

@frank elbow I plan to expand this to Java API in the future.

#

That way Umbrella can take both and apply it to IntelliSense, giving more details / documentation to modders.

frank elbow
#

Heck yeah

red tiger
#

This was the plan for like two years.

uneven vessel
#

Anyone know how to insert a loot table into an item? I'm trying to replicate it but can't

gleaming sorrel
# bright fog

I'm struggling to figure out what you did here
I've searched the site the image is hosted from and can't find a way to do so myself

I've searched through the internet and haven't been able to find 1 working tutorial on how to put images into the description

#

Best I got was a tiny little image icon

#

But no image

gleaming sorrel
bright fog
#

You can use imgur but you need to use this:

#

And the issue is that imgur links eventually die

#

And then just use this image with

[img]https://raw.githubusercontent.com/SirDoggyJvla/Susceptible-Overhaul/main/images/mod_advancement.png[/img]
gleaming sorrel
#

Thank you

bright fog
#

πŸ‘Œ

#

Told you if you need help ;)
I knew you might need more info on that part haha

manic magnet
#

Sir Doggy out here laying down the steam formatting knowledge. πŸ™ŒπŸ»

bright fog
#

I mean idk if you've seen my modpages, at this point I know a bunch on it

manic magnet
#

Ya bro. I should spend some actual time on the propane station page. It's basically just a solid block of text. lol

#

I am sure plenty of people take a look at it and go "tl;dr". 🀣

bright fog
#

Presenting a mod can be important, I'll prepare my current big project a fuck ton before releasing it on the modpage

#

I want it to be as clean and presentable as possible to increase its visibility

bright fog
gleaming sorrel
#

I've been searching for how to do that for so long

I only found 1 tutorial on the subject and it was outdated

manic magnet
bright fog
#

Even when you get in the technical aspect of a mod, there's better ways to present it

#

Usually I leave the technical stuff on side pages like Discussions and shit like that

bright fog
#

It won't stop those from being a thing haha

#

But there will be less questions

manic magnet
#

I don't think many people have even seen the Propane Station mod.

bright fog
#

I have

#

But I know a fuck ton of mods lol

manic magnet
#

Melo did some dope tiles for me though, so hopefully that changes soon. I'll try to make the workshop page worthy of his effort when I get the changes rolled out.

bright fog
#

But like isn't it a map mod ?

#

In its current state at least

manic magnet
#

Nope! I dynamically place them! ❀️

bright fog
#

Nice

#

Before it was a map mod right ?

manic magnet
#

It may have been at one point, when TiReKs was still managing it.

bright fog
#

Right

manic magnet
#

Then Aika inherited it, and I helped her out with it, then I took it full time when people started being shitty towards her. πŸ˜‘

#

It changed a lot over time, for sure.

bright fog
#

yikes

#

Ok so something you could do for your modpage, is add points on the PZ map of where the propane stations are

#

And you could even hide the various points with a spoiler on the image

#

So if people don't want to get spoiled

manic magnet
#

Oh! Good advice!

bright fog
#

Also you can probably drop the tutorial for old maps

#

It's been ages since then

#

People will all use the most recent version

#

(Also damn that mod is old asf)

#

I would add an example image of the propane tiles being shown

#

Perhaps you could show it's compatible with any map mods

#

I can give you an Excel file with almost every map mods in my modlist and every cells they occupy, to find example mod maps that replace one of the locations of your propane tanks

manic magnet
gilded hawk
#

My GF asked me to make a mod that shows a message when your armor get's a hole, what do you think?

bright fog
#

Pretty cool

bright fog
#

It's barely readable

#

But you could manage since you'd look at specific cells
You could just look at which modded maps are on the cells of your propane spawns

earnest night
#

Any Idea why my vehicle texture would be showing as a red and white checkerbox texture? I've checked and made sure all the names match and the file sizes are correct

grizzled fulcrum
red tiger
#

GitHub is life.

violet shell
#

Any way to find what's the value of "Minutesperpage" in a solo play ? in MP it's in Server Options, but in Solo I don't know where to get the data

violet shell
#

ok, I did a test in a solo game, survival difficulty, no reading perk on the character : it took 450 in-game minutes to read 220 pages. In MP, default value is 1 minute per page, so it's 220 in-game minutes for the 220 pages, so it's around 2.045 faster in MP than in SP. That explains part of the issue I get with my mod.

rich reef
#

Is it possible to add comments within the recipe/item/model .txt files? Trying to organize stuff and make it easy to find sections/categories.

manic magnet
bronze yoke
rich reef
red tiger
#

=)

#

Yup

#

This looks nice.

#

The Markdown support is there.

#

:D

#

Going to start documenting the ISUI library either tonight or tomorrow.

violet shell
#

Encountering another little challenge πŸ™‚ How can I hide one of the Insurgent mod Traits if I don't want it to be available to players on my server ? I tried several things but it didn't work.

bronze yoke
#

if you're doing it through a mod, you can just create a new trait with the same name and set it as a profession trait (but not give it to any profession)

#

the new trait will overwrite the old one

violet shell
#

So best way is to make a "fork" of original mod ? or what you are saying is different from that ?

bronze yoke
#

you can do it from a separate mod

#

if you were going to fork the original you might as well just delete the code that adds it in the first place

violet shell
#

yeah, I'm sorry my coding knowledge is quite limitated compared to you, so I am afraid I don't get all you said in the first answer 😦

bronze yoke
#
-- normal trait initialisation from the original mod, creates MyTrait
TraitFactory.addTrait("MyTrait", name, cost, desc, false)

-- overwrites MyTrait with a new trait, the boolean makes it a profession specific trait, which basically just makes it unobtainable if you don't give it to a profession
TraitFactory.addTrait("MyTrait", name, cost, desc, true)
violet shell
#

I dug in Insurgent mod code, but it's kinda complicated, maybe I'll dig in another profession/trait mod simplier than insurgent to try to figure it out

#

This : TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 10, getText("UI_trait_UndyingDesc"), false, false)

#

so I just create a lua file in shared folder with :
TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 10, getText("UI_trait_UndyingDesc"), false, true) and make it load after insurgent and I'm good ?

bronze yoke
#

should be the first boolean set to true, but yeah

violet shell
#

ok, no need any 'require' because I don't mind if it's desc is not good or so ?

bronze yoke
#

you should require the file that adds the trait so you can ensure your file loads after it

manic magnet
#

Require the file in the resurgent mod that adds that trait, specifically. Just to clarify and help you avoid getting confused. 😁

violet shell
#

ok thank you so much ! I'll give it a try tomorrow, time to sleep now πŸ˜‰

grim yarrow
#

Hiyas, I'm working on an animation mod to replace the default walking animations. Would anyone be able to give me a breakdown on the animation xml files?

grim yarrow
#

I managed to get my animation into the game - however the player is moving at half its usual speed. Help would be lovely lmao

verbal yew
verbal yew
bright fog
verbal yew
#
local function shouldBeStanding(zombie)
  -- as of 41.71:
  -- leg break, head bash, vehicle hit: isKnockedDown
  -- randomized vehicle stories: wasFakeDead / crawlerType = 1
  -- fakeDead: wasFakeDead
  -- Kate and Baldspot: crawlerType = 1
  -- createhorde2command: isKnockedDown / crawlerType = 1
      -- Note that isKnockedDown and crawlerType are not transferred on the network
      -- so not reliable when generated by server for client-owned state like knockedDown
  return not zombie:isKnockedDown()
    and not zombie:isStaggerBack()
    and zombie:getCrawlerType() == 0
    and not zombie:wasFakeDead()
end

local function SmashAllZombiesOnMyWay(player, zombie)
        --    ΠΈΠ³Ρ€ΠΎΠΊΠΈ Π·ΠΎΠΌΠ±ΠΈ               Π±Π΅ΠΆΠΈΡ‚ ΠΈΠ»ΠΈ спринтуСт
  if not player:isZombie() and (player:isRunning() or player:isSprinting())
  and zombie:isZombie() and shouldBeStanding(zombie) then
    
    local zSmash = 70
    if player:isSprinting() then zSmash = 30 end
    local zRandomizer = ZombRand(101)
    if zSmash > zRandomizer then
        zombie:setStaggerBack(true)
        player:Say("zombie stagger back")
     else
        zombie:knockDown(true)
        player:Say("zombie knockDown")
    end
    -- player:setKnockedDown(false)
    -- player:setFallOnFront(false)
    -- player:setBumpStaggered(false)
    player:setBumpType("stagger");
    player:setVariable("BumpFall", false);
    player:setVariable("BumpDone", true);
 player:setVariable("BumpFallType", "pushedFront");
    end
end
Events.OnCharacterCollide.Add(SmashAllZombiesOnMyWay)```
bright fog
#

What's the diff

verbal yew
bronze yoke
#

when you push a zombie but they don't fall

verbal yew
#

stagger animation

#

knockDown - knock down xD

#
player:setKnockedDown(false)  -- don't work, looks like if player start fall - its somewhere not it this function, maybe OnPlayerUpdate?!
player:setFallOnFront(false)  -- same
player:setBumpStaggered(false)  -- disabled collider for player... if im rigtly understood
verbal yew
#

idk how to set player not fall if player run into zombies

#

it seems like he stumbles over them at some point in time...

verbal yew
gilded hawk
grim yarrow
# bright fog Aah I see

You were helping me yesterday - I managed to get my animation into the game thanks to you! However, I'm replacing the default walking animations, and my animation seems to be halving the player speed... Would you happen to know anything about that?

verbal yew
bright fog
grim yarrow
#

Oh, how does that translation data bone work in Blender?

#

Sorry, none of the guides I've looked at have mentioned it at all!

gilded hawk
#
    if cachedHoles and itemHoles > cachedHoles then
      local text = item:getDisplayName() .. ' ' .. getText("IGUI_garment_Hole")
      ---@diagnostic disable-next-line: param-type-mismatch
      HaloTextHelper.addTextWithArrow(player, text, false, 255, 100, 100)
    end
grim yarrow
gilded hawk
grim yarrow
#

That looks so good!

verbal yew
grizzled fulcrum
#

Does anyone know if there's a better function for checking multiple items?
Example:

local toothbrush = playerInv:getItemFromType("Toothbrush")

This only gets toothbrush, but if I have say ToothbrushRed it does not get it. I have a handful of toothbrush items and I do not want to write this line above for every single toothbrush. I thought of doing this:

local toothbrushNames = { "Toothbrush", "ToothbrushRed", "ToothbrushGreen", }
local toothbrushes = {}
for _, v in pairs(toothbrushNames) do
    local foundToothbrush = playerInv:getItemFromType(v)
    if foundToothbrush ~= nil then
        table.insert(toothbrushes, foundToothbrush)
    end
end

But is there a better way I am not thinking of?

stable yew
bronze yoke
#

you can also use getFirstEval with a function that takes an item argument and returns true if the item is a valid catch to implement custom searching logic

bright fog
bright fog
#

How does it work is that it defines the distance traveled by the character, since the animation isn't moving within the environment, it stays at the center of the environment

grizzled fulcrum
verbal yew
bright fog
grim yarrow
grim yarrow
sweet escarp
#

Is it possible to store a vehicle in a way that when it is removed from the world the variable still retains it?

grim yarrow
verbal yew
#

who know it's possible to predetermine catched fish?

#

or it's randomized only in getFishByLure() javacoded side?!

austere sequoia
grim yarrow
#

I've tried playing with that line and I'm not seeing a difference

#

It's befuddling me lmao

austere sequoia
#

mhm, then I have no idea, lol πŸ˜„

bright fog
bright fog
#

Can't show you the code now but it's just speed_scale

bright fog
grim yarrow
#

Oh I fixed it

#

I reopened my Blender file and the export settings reset lmao

bright fog
#

Yup

grim yarrow
# bright fog Yup

Do you have any idea why <m_SpeedScale> isn't doing anything for me?

tulip sierra
#

I have a question, i am getting a error whenever i hit a zombie, what mod could be causing it?

violet shell
# bronze yoke you should require the file that adds the trait so you can ensure your file load...

@manic magnet my test failed, due to bad usage of require function.
I'm not sure how to use it. For now, I have my own .lua file in the exact same directory path as the required file and I have this code :


TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 10, getText("UI_trait_UndyingDesc"), true, false)```
Should I store my file in /lua/shared/ directly ? How to write the require argument ? What am I doing wrong ?
manic magnet
#

Look at the other mod, how is the filename of their file that their TraitFactory.addTrait call is being named in? Also, what directory path is it in under their mod?

#

@violet shell ☝🏻

bright fog
grim yarrow
#

So like, bar for bar, the xml file is the same as the original

bright fog
#

Hmm

#

Send your xml file ?

#

I can't do much rn tho

grim yarrow
bronze yoke
#

require paths are absolute, starting from shared/client/server

#

e.g. shared/MyMod/MyFile.lua would be required as require "MyMod/MyFile" regardless of where you are calling it from

#

if the other mod adds its trait on an event (OnGameBoot is commonly used) you need to do it on that event too or your code will actually be running first

slow graniteBOT
#
confusedprodidy has been warned

Reason: Bad word usage

violet shell
bright fog
#

Bob_Walk ?

grim yarrow
#

Yeah

#

My mod is using the default names

bright fog
#

Which speed scale did you change ?

bronze yoke
#

looks like they use a custom mechanism for registering their trait which isn't fully implemented in this file alone, it might be enough to just do this```lua
require "insurgent/Traits/UndyingTrait"

-- replace it with an empty function so nothing happens when it gets called
UndyingTrait.Create = function() end

violet shell
#

Ok thanks, gonna try this πŸ™‚

grim yarrow
manic magnet
#

@bronze yoke out here being an MVP! πŸ™ŒπŸ»

bright fog
#

It didn't do anything ?

#

Perhaps try to modify directly in the game's files ?

#

Also it does run your animation ?

grim yarrow
#

I didn't seem to do anything, no

#

My animations work - I ended up resorting to changing it in Blender

bright fog
#

Did you try to put very high numbers ?

grim yarrow
#

Rather than the xml file

#

I did, yeah

bright fog
#

Yeah you can change the fps of your animation

#

Which directly changes its speed

grim yarrow
#

Yeah

tranquil kindle
#

@grim yarrow try changing it by higher number?

grim yarrow
#

Off topic, but how's this for bad luck? In my testing for the animation (debug world so it doesn't matter), I got scratched and infected

#

Zombified off a single scratch

grim yarrow
bright fog
bright fog
#

You won't need more

violet shell
#

Game freeze when loading the server (I'm testing on hosted server, not on my dedicated server)

drifting ore
#

I would like to dabble in making my own mods. How does one go about starting? As in, what sites/programs do you use and any tips are much appreciated

drifting ore
#

Thank you

verbal yew
#

Holy Molly

#

i know how predetermine fish

#

with chance or skill level

#

:D I DO IT!

verbal yew
bright fog
#

:)

vestal gyro
bright fog
#

yeah lol

#

fish.fish.name

vestal gyro
#

I love and hate zomboids code

echo fiber
# snow hedge It's 24 hours later but hey, here ya go!

sorry for the late reply but hello XD, so your missing a , at the end of the line should look more like

model BenfordRifle
{
  mesh = weapons/firearms/BenfordRifle,
  texture = weapons/firearms/BenfordRiflePZ,
  scale = 0.03,
}

But i assume someone by now has said something hope you got it fixed!

snow hedge
echo fiber
uneven vessel
#

I've been stuck on this for days, I can't replicate the functionality of distribution in a mod

#

I've managed to create the crate and getting it to spawn in lottable zones

#

but i can't get the items in it to spawn

verbal yew
#

it's possible to integrate traits Dextrous and Eagle eyed in character like passive function?

#

i mean, i want remove this is traits from the game, but functionality from this traits want on passive level

#

In general, to increase the viewing radius of characters and the speed of moving items, how can I do this?
Nowhere in vanilla did I find a dependence on the presence of these skills...

bright fog
#

I believe it's handled in the java

verbal yew
#

ouh, i find for Dextrous (first scan be like nimblefingers, my wrong)

#

i can inject into this function? (not have skill to injected)

#

im just want to decrease maxTime

verbal yew
verbal yew
#

anybody here? ^^`

thick karma
#

Yes

thick karma
#

Do you know basic function decoration?

verbal yew
#

yeeemmm....... ugh....

thick karma
#

A = B
function B()
return A() * yourAdjustment
end

#

In pseudocode

thick karma
#

A is a name you make up, preferably in one of your modules that gets returned so people can have access to it for patches.

B is the exact name of the function you're decorating (ISWorldObjectContextMenu.grabItemTime)

verbal yew
#

how it should be right

thick karma
verbal yew
#

like

zReIJECTOR = {}
local zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime = ISWorldObjectContextMenu.grabItemTime
ISWorldObjectContextMenu.grabItemTime = function(playerObj, witem)
 return zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime()*1.5
end
return 

?

thick karma
#

Close. You need to declare old_ISWorldObjectContextMenu as a subtable of zReIJECTOR first.

#

Then you also need to pass playerObj and witem to A

thick karma
#

A = {} -- table

#

A.B = {} -- subtable

verbal yew
#

._.

thick karma
#

The parentheses beside *1.5 need the params from the function header

#

You could just use ... instead of writing the params though if you have no plan to use them

verbal yew
#

can you write how should look right this injection, one example

#

?

#

please ^^'

thick karma
#

... can be used to receive and represent an arbitrary list of unspecified parameters after the specific parameters that are named.

verbal yew
#

I really don't understand what you're talking about...

thick karma
#

E.g. you could do (playerObj, ...) and the ... would in that case represent witems

#

Or you could just to (...) and then ... is going to be playerObj, witems

thick karma
#

You're very close already... The line under zReIJECTOR is needs a line above it that declares old_ISWorldObjectContextMenu as a table.

#

Declaring a table means writing variableName = {}

thick karma
#

I'll tell you if it's wrong

#

It's good for you πŸ€ͺ

verbal yew
#
local zReIJECTOR = {}

zReIJECTOR.old_ISWorldObjectContextMenu = {}
zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime = ISWorldObjectContextMenu.grabItemTime

ISWorldObjectContextMenu.grabItemTime = function(...)
 return zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime(...)*1.5
end

return 
thick karma
#

Since you're expecting to access that table inside zReIJECTOR everywhere else

red tiger
#

Good afternoon

thick karma
verbal yew
thick karma
#

You can do that, but if you write it that way (which seems like a fine idea here for now), you also need to change "playerObj, witem" to simply "..."

#

Your functions parameters are playerObj and witem

#

You need to pass them to the copy of the original function for it to work

#

If you want, you can change your parameters to ... and also pass ... to the copy of the original function.

#

Either way will work

verbal yew
#

I think I understand a little :Π·

thick karma
#

And you'll be golden

#

And if you want them to be local, just make zReIJECTOR itself local

#

But be aware you'll need to return zReIJECTOR at the end of the file and import it using "require" to use it in other files if you localize it.

#

Almost everyone here who has been doing this a long time will recommend you do that.

red tiger
#

I've already worked on quality improvements to Mallet with CSS and some feature upgrades.

thick karma
#

Although I imagine multiplying by 1.5 would slow you down

#

Rather than speed you up

#

Since it's calculating a time requirement

#

Not sure which one is your goal

verbal yew
thick karma
#

return at end of file would do nothing

#

Need to tell it what to return

verbal yew
#
local zReIJECTOR = {}

zReIJECTOR.old_ISWorldObjectContextMenu = {}
zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime = ISWorldObjectContextMenu.grabItemTime

ISWorldObjectContextMenu.grabItemTime = function(...)
 return zReIJECTOR.old_ISWorldObjectContextMenu.grabItemTime(...)*0.5
end

return zReIJECTOR
thick karma
#

Returning the main module of the file is standard

#

And if you add anything else to that file, be sure to put it above the return line

#

An unavoidable return line generally needs to be last in any file (or function) in most if not all languages

verbal yew
#

should my lua file copy path of original function?

thick karma
#

No

#

Vanilla files load before mod files

verbal yew
#

i can drop it everywhere into lua/client?

thick karma
#

Yes; ISWorldObjectContextMenu will be available in lua/client before your code runs.

#

Without requiring it

verbal yew
#

thanks so much :3

verbal yew
crystal oar
#

can you put parenthesis in a recipe name?

#

same question for forward slash

thick karma
#

(i know the EN doesn't but the others do, and the EN in theory could easily grab the whole line trimmed as name)

#

I do not know though

crystal oar
#

i'll try it out the hard way i guess lol

neat herald
#

This is a complete shot in the dark but maybe someone will know something to point me in the right direction.

How does one determine player dead bodies and zombie dead bodies? In the sandbox setting, there is an option for player body to despawn at a different time than the zombies. What piece of code controls that sandbox setting?

thick karma
thick karma
#

Oh wait dead bodies, shit... Hmm

bright fog
#

yeah dead body

thick karma
bright fog
#

exactly

thick karma
#

Sorry misread @neat herald

bright fog
#

There's a few methods to check isPlayer() and isZombie()

#

for dead bodies

thick karma
#

Creepy... IsSpeaking.... Lol

bright fog
#

._.

#

isSpeaking πŸ‘€

thick karma
#

Fun possibility

#

Necromancy mod anyone

bright fog
#
   public boolean IsSpeaking() {
      return this.Speaking;
   }
#
         this.sayLine = var1.getSayLine();
         this.SpeakColor = var1.getSpeakColour();
         this.SpeakTime = var1.getSpeakTime();
         this.Speaking = var1.isSpeaking();
#

eh

verbal yew
neat herald
thick karma
#

Just feels bloated to me to make a different parent table and file for minorly decorating each of a dozen functions in a dozen places

thick karma
thick karma
#

So not ISInventoryTransferAction:new, ISInventoryTransferAction.new, on line 3

#

On both sides of the = sign

thick karma
#

The other change you beed to make is that because this is an object function (as opposed to a static function) you need to pass the implied "self" variable before the ...

In other words, the second (...) will become (self, ...). The first, however, will not change, because the : format is responsible for passing "self"... It is not explicitly written in the function header.

#

And when you call your backup function, you will use . notation instead of :

verbal yew
thick karma
#

Because YOU are manually passing self, not implicitly passing it.

#

Remove the second and third returns and refactor zRePRREW_IJECTOR 2 and 3 to just be the original. Put all decorations in one super table

thick karma
#

Just delete 2 and 3 basically

#

And don't redeclare it over and over of course

#

That would wipe the backup functions each time you did it

verbal yew
#

ISInventoryTransferAction:new (character, item, srcContainer, destContainer, time)
i should copy like (character, ...)?

thick karma
#

No

#

Your header is fine

#

Although you need to change the header back to : on the new function

#

I notice you changed it in wrong place

#

In the function header, you DO use :

#

Basically everywhere else you do not

verbal yew
#
-- ISDropWorldItemAction.lua (client/timedActions/)
zRePRREW_IJECTOR.ISDropWorldItemAction = {}
zRePRREW_IJECTOR.ISDropWorldItemAction:new = ISDropWorldItemAction.new

function ISDropWorldItemAction.new(...)
    local o = zRePRREW_IJECTOR.ISDropWorldItemAction.new(...)
    o.maxTime = o.maxTime * 0.5
    return o
end

?

thick karma
#

3rd line : should be .

verbal yew
#

or :new = :new?

thick karma
#

Function line . should be :

verbal yew
#
-- ISDropWorldItemAction.lua (client/timedActions/)
zRePRREW_IJECTOR.ISDropWorldItemAction = {}
zRePRREW_IJECTOR.ISDropWorldItemAction.new = ISDropWorldItemAction.new

function ISDropWorldItemAction:new(...)
    local o = zRePRREW_IJECTOR.ISDropWorldItemAction.new(self, ...)
    o.maxTime = o.maxTime * 0.5
    return o
end
thick karma
#

local o line (...) should be (self, ...)

thick karma
verbal yew
#

like this?

thick karma
#

Yes that looks right

verbal yew
#

god, it's hard ^^'

thick karma
#

So the idea here is that the function line is automatically receiving the object that calls it (the timed action instance in this case) as "self", which is basically a reference to the instance. If you don't know what an instance or an object is, you need to look into Object Oriented Programming a bit and get a feel for the lingo.

:new(...) is the same as saying .new(self, ...)

#

And therefore the true parameters that need to be passed when calling a function of an instance variable using . notation will be "self, ..."

verbal yew
muted garnet
#

If there is some way to extract the vanilla traits code from Java into lua? I need to extract some vanilla perks code, like organized or graceful

tiny wolf
#

Hey guys,
I want to create a 0-1 frame animation to disable the hitreactionpvp animation and replace it
Please can someone help me or give me links to get information about animation creation on PZ ? πŸ™‚
Thanks

verbal yew
tiny wolf
verbal yew
#

try <m_SpeedScale>0.01</m_SpeedScale>
<m_BlendTime>0.01</m_BlendTime>

quaint brook
#

Quick dumb question... What happens when 2 mods load a LUA File with the same name? Do they both get loaded or does one overwrite the other?

bright fog
quaint brook
#

OmG 😐

#

TY

sour island
#

PSA: Mod authors, don't worry too hard about updating mods to include a highly requested feature or most of all to meet the B42 update. For your own sake, take your time, and test thoroughly when able. Having a few "please update" comments is better than "why did you update / you broke my game" and feeling like you have to crunch for a fix / leaving things broken for extended periods.

violet shell
# violet shell

Hi there, I'm still stuck with the "how to delete Unstoppable/Undying" trait from Insurgent mod. If anyone have an idea πŸ˜‰

verbal yew
#

where SlowLearner - Unstoppable / Undying

#

true - removed from create menu

sour island
#

Most people have accepted most mods will be broken anyway πŸ˜… - although it's a bit premature it can be a good "out".

violet shell
verbal yew
#

drunk filename?

violet shell
#

of original code ?

verbal yew
#

original and your

violet shell
#

UndyingTrait.lua for original, and Insurgent_Tweaks.lua for mine

#

I also added on my code a require to be sure my code is loaded after

verbal yew
#

U in priority

#

overwrite I

#

zzz_trait.lua
!!zzz_trait.lua

second has high priority and overwrite first

violet shell
#

err, my file was IVV_Insurgent_Tweaks

#

even if I call require function ?

verbal yew
#

nevermind

#

your file should be in priority to overwriting

#

the path for sorting too (so server/a.lua -> server/a/z.lua -> server/b.lua )

#

b.lua overwrite a.lua and z.lua

violet shell
#

Undying.lua is in lua/shared/Insurgent/Traits/, and mine was in lua/shared/

verbal yew
#

just rename your lua into !!z_

manic magnet
#

Also when B42? ||I joke! I kid!||

sour island
#

No clue, probably soon, but wouldn't recommend planning a vacation around it lol

manic magnet
sour island
#

Honestly the way some people talk about it's release you'd think it was holding up their life plans

violet shell
#

Ok I'll try again with a file rename πŸ™‚ trying it now

manic magnet
manic magnet
violet shell
manic magnet
sour island
violet shell
#

I think original code assign it to Insurgent profession 😦

manic magnet
#

Yes, but you are recreating a whole new trait that overwrites the first trait, so unless they are doing some additional wizardry there it shouldn't matter because your trait replaces the old one and is never reassigned... I think.

violet shell
#

Yup, Undying/Unstoppable trait still available 😦

manic magnet
#

Hummmmm...

#

How are they assigning the trait?

violet shell
#

Insurgent Traits creation is quite complex, it uses 4 or 5 different lua files, with 5-6 different events

manic magnet
#

Woof...

violet shell
#

I can copy/paste or put lua files here, but I don't know if it's ok

manic magnet
#

Anybody know how order for firing functions happens when an event fires?

#

That's something I haven't had to dig for. @sour island @bronze yoke ??? Maybe? ❀️

#

I would assume it is order they are registered in...

sour island
#

Generally yeah

manic magnet
#

Okay. If that is the case then we need to figure out what event they are actually registering their trait in @violet shell and do the same thing. If it's something like OnGameStart (I think...) then you want yours to run after.

sour island
#

I don't know the situation but why not alter the function they're using?

#

Is it accessible?

violet shell
#
Events.OnGameBoot.Remove(original_traits);
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoTraits);
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions);``` in CreateInsurgentTrait.lua
#
    Events.OnNewGame.Add(UndyingTrait.OnNewGame)
    Events.OnGameStart.Add(UndyingTrait.OnGameStart)
    Events.OnPlayerUpdate.Add(UndyingTrait.OnPlayerUpdate)
    Events.OnDawn.Add(UndyingTrait.OnDawn)
end``` in UndyingTrait.lua
manic magnet
violet shell
#
    local players = IsoPlayer.getPlayers()
    for i=0,players:size()-1 do
        local player = players:get(i)
        if player and player:isLocalPlayer() and not player:isDead() and player:HasTrait("Undying") then
            UndyingTrait.ResetCooldown(player)
        end
    end
end``` in UndyingTrait.lua
#

about function, I tried that :


-- replace it with an empty function so nothing happens when it gets called
UndyingTrait.Create = function() end```
sour island
#

Is UndyingTrait global?

violet shell
#

And it didn't work : game freeze when I should arrive at the professions screen

sour island
#

Sounds like you broke something

#

But that is the right way

violet shell
#

this is the trace when I try to erase the function

manic magnet
#

Yes, but what if you updated UndyingTrait.Create instead like this:

function UndyingTrait.Create()
    return TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 10, getText("UI_trait_UndyingDesc"), true, false)
end
#

The same way as you did last time.

violet shell
#

ok, let me try

#

I don't need to add Events right ? I'll just use the original ones ?

#

I think the problem with this, is that I think the original mod assign the trait to the Insurgent profession already

#

so changing the boolean should not change anything. But I'm trying right now

manic magnet
#

So like this:

require "insurgent/Traits/UndyingTrait"

-- replace it with a profession specific trait
function UndyingTrait.Create()
    return TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 10, getText("UI_trait_UndyingDesc"), true, false)
end
#

Oh... I see what you are saying... hmmm...

violet shell
#

I think that I'll just put the price to 100 points, so nobody can buy it πŸ˜„

manic magnet
#

Hold on... where are they assigning the trait?

violet shell
#

yup, Unstoppable/Undying still available with your last code

violet shell
manic magnet
#

Couldn't you modify each of these functions to not assign the trait, on top of making the trait unpurchasable?

function UndyingTrait.RegisterEvents()
    Events.OnNewGame.Add(UndyingTrait.OnNewGame)
    Events.OnGameStart.Add(UndyingTrait.OnGameStart)
    Events.OnPlayerUpdate.Add(UndyingTrait.OnPlayerUpdate)
    Events.OnDawn.Add(UndyingTrait.OnDawn)
end
#

I can't remember how well unregistering events works...

violet shell
#

I'll try to raise the price, and see if it works, first of all. Let me check and come back to you

#

ok

#

:``

#

function UndyingTrait.Create()
    return TraitFactory.addTrait("Undying", getText("UI_trait_Undying"), 100, getText("UI_trait_UndyingDesc"), true, false)
end``` actually setup the trait at 100 points, as intended πŸ™‚
#

that's a start πŸ˜„

violet shell
manic magnet
#

You might be able to modify UndyingTrait.RegisterEvents() and have it return false... maybe?

#
function UndyingTrait.RegisterEvents()
  return false
end
#

That might not work if it that function gets called before your script runs, though.

violet shell
#

ok, maybe the simplier way with raising the cost is enough for what I want, right ?

#

I have other issues for others mods to chat about πŸ˜„

manic magnet
#

Yeah. Maybe...

#

🀣

violet shell
#

Can I bother you a little more ? πŸ™‚

#
    local AutotestTrait = TraitFactory.addTrait("AutotestTrait", getText("UI_trait_AutotestTrait"), -2, getText("UI_trait_AutotestTraitdesc"), false, false)
end

function AutotestTrait.OnNewGame(player)
    if player:HasTrait("AutotestTrait") then
        local inv = player:getInventory();
        inv:AddItems("Asilar_Autotest_Knox_Infection.Autotest_KnoxInf", 3);
    end    
end

Events.OnGameBoot.Add(initAutotestTrait);
Events.OnNewGame.Add(AutotestTrait.OnNewGame);```
#

will this add a trait "AutotestTrait" and if player buy it, then it'll start with 3 "Autotest" from my mod ?

manic magnet
#

It seems like it should work just glancing it over?

violet shell
#

?

manic magnet
#

It looks sane. πŸ˜…

#

I can't know for sure without running it. Most of my process is just trial and error! 😁

violet shell
#

ok

#

just got an error, the game didn't like the AutotestTrait.OnNewGame πŸ™‚ the dot was too much I think πŸ™‚

#

trying again with AutotestTraitOnNewGame (without the dot)

manic magnet
#

Wait... but you are defining AutotestTrait itself first?

#

I mean... that should work if so...

#

Okay. I see the problem. In your case AutoTestTrait is being assigned as a local variable to the result of a TraitFactory.addTrait call object.

violet shell
#

ok, the trait appears on the list, but when I choose it, I don't spawn with the stuff I am supposed to get with the trait

#

I think I know where I made a mistake, trying again πŸ˜„

#

I have a question about models/icons

#

this is the 3Dmodel on the ground : that's fine

#

but in the inventory, how I can have an icon ?

#

I know before it was a .png in textures folder, with Item_Itemname.png, but seems it's not that anymore

#

Ok, trait is working as intended now πŸ™‚ At least that's a win πŸ˜„

manic magnet
#

I don't remember how to do item icons. It's been a long time. πŸ˜…

violet shell
#

I think it's still the same πŸ™‚

#

I used to use modData on items to give them "memory" in another mod I made. I wonder if I can use that on multiple items at once. For instance, can I inject some modData in the 3 items I give at start for those who buy the Trait ?

#

the goal is to inject in the item modData the name of the player, and then in the function I call to use it, it'll check if the player using it is the "owner" of the item.

brazen jasper
#

This is a message to any modder who doesn't already, please for the love of god use notepad++ cause I didn't and my dumbass left out 2 quotes

#

which lead to this just

#

breaking

violet shell
#

player:getID() is valid ?

#

I'm not sure how to get the Player ID, anyone have an idea ?

violet shell
#

I think it's player:getUsername

rich reef
#

Does anyone have a list of game events/usage? Or by chance, does anyone know if their is an event that is fired when an individual player kills a zombie?

rich reef
#

If the code is ran client side, and the event fires, and I run code from that, it should only affect the client/player themselves, is that right?

#

Context: I'm trying to run code for a player when a zombie is killed by that specific player. Not just when a zombie dies in general.

coarse sinew
#

At that event you can take the zombie's last attacker and compare with the local player

#

If they are equal do your thing

rich reef
#

Do you have a reference for how to do that? It doesn't quite detail that in the list you gave me. Appreciate the help, I'm fairly new to PZ modding.

coarse sinew
rich reef
#

Thank you very much. Is there a reference for this zombie class/function, or the isoPlayer/getPlayer functions?

verbal yew
#

OnPlayerGetDamage

#

WOW

#

@bronze yoke what?!
this is event work on zombie too

#

i used it for my juggernauts:

local zReJuggernautOutfits = {
    "zRe_Military_exo1",
    "zRe_Military_exo2",
    "zRe_Military_exo3",
    "zRe_Military_Tractor",
}

local function zReZombieisJuggernaut(target)
    local zombieOutfit = target:getOutfitName()
    for _, v in pairs(zReJuggernautOutfits) do
        if v == zombieOutfit then return true end
    end
    return false
end

local function OnWeaponHitCharacter(attacker, target, handWeapon, damage)
    if not (target:isZombie() and zReZombieisJuggernaut(target)) then return end
    
    if not target:getModData().zReZFlag then
            target:setHealth(40)
            target:getModData().zReZAbsorb = 50
            target:getModData().zReZFlag = true
            target:transmitModData()
    end
    
    if target:getModData().zReZAbsorb > 0 then
        if handWeapon:isRanged() and target:isOnlyJawStab() then
            target:setOnlyJawStab(false)
        end
        if not handWeapon:isRanged() and not target:isOnlyJawStab() then
            target:setOnlyJawStab(true)
        end
        
        local AbsorbDamage = 0
        if handWeapon:isRanged() then
            AbsorbDamage = 1        -- need improve for weapon category/type/caliber etc
        end
        if not handWeapon:isRanged() then    -- if melee, stagger on
            target:setStaggerBack(true)
            AbsorbDamage = 3        -- need improve for weapon category/type/one-twohands
        end
        target:setHealth(40)
        target:getModData().zReZAbsorb = target:getModData().zReZAbsorb - AbsorbDamage
        target:transmitModData()
        --target:DoZombieStats()
      else
        target:setHealth(2)
        target:setOnlyJawStab(false)
        --target:DoZombieStats()
    end
    attacker:Say( "zReZFakeHP: "..tostring(target:getModData().zReZAbsorb).."  Health: ~"..tostring(math.floor(target:getHealth()*100)) )
end

Events.OnWeaponHitCharacter.Add(OnWeaponHitCharacter)
bronze yoke
#

oh maybe

#

attacker is definitely not a zombie

crude snow
#

Hey, I want to make a Gas Helmet mod, can someone direct me to some info or a tutorial, for the coding segment.

verbal yew
# crude snow Hey, I want to make a Gas Helmet mod, can someone direct me to some info or a tu...
module Base
{

/* HELMETS */
    item zReV2_1ECO_fullhelmet1
    {
        Type = Clothing,
        DisplayName = zReV2_1ECO_fullhelmet1,
        ClothingItem = zReV2_1ECO_fullhelmet1,
        ClothingItemExtra = zReV2_1ECO_fullhelmet1A,
        ClothingItemExtraOption = zReECOWear_2,
        BodyLocation = FullHat,
        Icon = zReV2_1ECO_fullhelmet1,
        CanHaveHoles = false,
        BloodLocation = FullHelmet,
            BiteDefense = 100,
            ScratchDefense = 100,            
            BulletDefense = 0,
        Insulation = 0.70,
        WindResistance = 0.60,
        WaterResistance = 1.0,
        Weight = 0.4,
        Tags = GasMask,
        WorldStaticModel = zReV2_1ECO_fullhelmet1_Ground,
    }
}
crude snow
#

@verbal yew Tyvm

verbal yew
#

Guid generate in internet

verbal yew
#

for test:
first catch - trophy fish, i have 10 fishing level,
second catch - trophy fish, but i have 6 lvl (should be more then 8), generate new
chance like randomizer will be in the future

sonic needle
vestal gyro
#

I am currently like working on a decently big update for one of my mods and was wondering if I should wait till B42 to release it

bronze yoke
#

i would expect literally anything to do with crafting at all to break

#

water containers probably won't be compatible with the new fluid system, weapons almost definitely won't be compatible with the new weapon systems

#

profession and skill mods are probably quite likely to break too as those systems are supposed to be revamped

#

basically - everything will break

#

for lua, anything that adds items to containers from the client side will probably break, and i'm sure there'll be api changes all over the place that break things

#

i think in most cases the work to port mods will not be colossal but i would expect few to work out of the box

bright fog
#

thx god my zombie framework doesn't touch any of these points ShibaNom

#

at least my entire mod won't need a rework lol

bronze yoke
#

i'd expect zombies to have a different api

bright fog
#

hmm

bronze yoke
#

actually nah

bright fog
#

there isn't any reasons for zombies to be changed, even with animals getting added

#

if they added animals with an entire new class

bronze yoke
#

i was gonna say they'd probably be hooked into whatever the ai system ends up being but they already have some crazy ai stuff to optimise zombie hordes, i doubt the more general ai stuff would be too helpful for zombies

bright fog
#

Didn't they plan on optimizing zombies actually ?

bronze yoke
#

they're always optimising zombies

bright fog
#

Or perhaps it was something else

bronze yoke
#

that said, the interfaces for characters are probably the most prone to changes in the entire game, so i wouldn't consider them stable either

bright fog
#

I'm not touching any of that either lmao

bronze yoke
#

zombies are characters!

bright fog
#

wdym by "interface for characters" then ?

#

Interface for zombies ?

bronze yoke
bright fog
#

Yes I know IsoZombies are IsoGameCharacter :|

bronze yoke
#

IsoGameCharacter is probably very prone to changes

bright fog
#

But that mean they would have to rework IsoZombie if they made changes to IsoGameCharacter that could affect zombies then

#

And thus my mod DOES get affected

#

And anything related to zombies

bronze yoke
#

yeah

bright fog
#

If we go from this principle, literally the entire game is getting reworked

#

That doesn't make any sense

bronze yoke
#

i'd just say it's very likely that a major update to a zombie game would include changes to zombies

#

even if i can't think of a specific planned one

bright fog
#

I highly doubt they'll change the entire zombie framework, would literally require to rewrite everything related to them

bronze yoke
#

i didn't say they would, though it wouldn't require them to rewrite anything to rename some methods

#

but it would require all mod developers to change it

bright fog
#

Perhaps change one or two thing but what my mod does to zombies is actually fairly disconnected from the general stuff, I just access some info about the zombies and that's mostly it

bronze yoke
#

i'm just saying i wouldn't expect the interface to stay exactly the same in any area of the game, let alone a central one like characters

bright fog
#

But wdym by "interface" ? The UI ?

bronze yoke
#

it's a general term for the functions and variables and whatever that a program makes available

#

in java it has more specific meaning which is somewhat applicable here but that's not specifically what i'm talking about

#

i've noticed a reluctance to make interface changes when avoidable at all but i don't expect the same from b42 since it's pretty much accepted at this point that it'll break every mod in existence into tiny pieces

#

didn't they mention in the last thursdoid the game won't even *load* mods that haven't been specifically updated? i don't think they've done that before

#

deliberately i mean, to my knowledge they're not overhauling how mods actually get loaded

bright fog
#

πŸ‘Œ

bright fog
bronze yoke
#

they are but i don't think we'll need to adjust for that

#

they're just appending workshop id to the mod id

bright fog
#

Yeah

#

But perhaps mods with the workshop ID downloaded from the workshop won't work ?

#

Depends if they do it on workshop mod creation/updating

#

Or just on mod load

bronze yoke
#

i think it'll probably be on mod load, if it's not it'll make dependencies annoying

bright fog
#

Perhaps

#

Reuploading mods with the same ID to have them work for any other mod that depends on it probably won't work

#

And will require mods to update their dependencies

bronze yoke
#

all the getActivatedMods():contains() calls 😟

muted garnet
#

Is there any way to extract the vanilla traits code from Java into lua? I need to extract some vanilla perks code, like organized or graceful

violet shell
#

ThursdoΓ―d is published today right ?

bronze yoke
#

yeah

verbal yew
#

@bronze yoke its possible to inject into java code:

   public InventoryItem getItemFromTypeRecurse(String var1) {
      return this.getFirstTypeRecurse(var1);
   }

   public int getEffectiveCapacity(IsoGameCharacter var1) {
      if (var1 != null && !(this.parent instanceof IsoGameCharacter) && !(this.parent instanceof IsoDeadBody) && !"floor".equals(this.getType())) {
         if (var1.Traits.Organized.isSet()) {
            return (int)Math.max((float)this.Capacity * 1.3F, (float)(this.Capacity + 1));
         }

         if (var1.Traits.Disorganized.isSet()) {
            return (int)Math.max((float)this.Capacity * 0.7F, 1.0F);
         }
      }

      return this.Capacity;
   }

   public boolean hasRoomFor(IsoGameCharacter var1, InventoryItem var2) {
      if (this.vehiclePart != null && this.vehiclePart.getId().contains("Seat") && this.Items.isEmpty() && var2.getUnequippedWeight() <= 50.0F) {
         return true;
      } else if (floatingPointCorrection(this.getCapacityWeight()) + var2.getUnequippedWeight() <= (float)this.getEffectiveCapacity(var1)) {
         if (this.getContainingItem() != null && this.getContainingItem().getEquipParent() != null && this.getContainingItem().getEquipParent().getInventory() != null && !this.getContainingItem().getEquipParent().getInventory().contains(var2)) {
            return floatingPointCorrection(this.getContainingItem().getEquipParent().getInventory().getCapacityWeight()) + var2.getUnequippedWeight() <= (float)this.getContainingItem().getEquipParent().getInventory().getEffectiveCapacity(var1);
         } else {
            return true;
         }
      } else {
         return false;
      }
   }

   public boolean hasRoomFor(IsoGameCharacter var1, float var2) {
      return floatingPointCorrection(this.getCapacityWeight()) + var2 <= (float)this.getEffectiveCapacity(var1);
   }
#

like lua

local zRePRREW_IJECTOR = {}

zRePRREW_IJECTOR.ItemContainer = {}
zRePRREW_IJECTOR.ItemContainer.getEffectiveCapacity = ItemContainer.getEffectiveCapacity

function ItemContainer.getEffectiveCapacity(...)
    local this = zRePRREW_IJECTOR.ItemContainer.getEffectiveCapacity(self, ...)
    if self.character -- check trait here should be then
      this.Capacity = this.Capacity * 1.5
      return this
    end
end
bronze yoke
#

only from the perspective of lua

bronze yoke
#
local index = __classmetatables[ItemContainer.class].__index
local old_getEffectiveCapacity = index.getEffectiveCapacity
index.getEffectiveCapacity = function(...)
    local capacity = old_getEffectiveCapacity(...)
    if something then
        capacity = capacity * 1.5
    end
    return capacity
end
#

what you are patching when you do this is the lua function that represents the java method, so it doesn't trigger your code if the method isn't being called from lua

verbal yew
#

hmmm... not working(

verbal yew
bronze yoke
#

i would check where this is being enforced

#

if it's enforced from the java side there isn't anything you can do with this technique

#

if it's enforced from the lua side you might need to patch a different method instead

#

ItemContainer.hasRoomFor is checked in the inventory transfer action