#mod_development

1 messages · Page 243 of 1

bright fog
#

You basically just want the player to be assigned a house when he spawns and stay there ?

#

Is he allowed to go outside ?

#

If no then you can simply:

  1. On spawn, access the building the player is in
  2. Write in the mod data of that building the player

Then

  1. Every minutes, access the building the player is in
  2. If not in a building, then player is not respecting the house arrest
  3. If building, access mod data and the player assigned to that house
  4. If player == player assigned to that building, then house arrest is respected
  5. If not then player is not respecting the house arrest
#

Anyway that would be a very cool concept and truly not hard to make in fact

hard coral
#

I kinda wanted a fuzzy radius, have it give a warning beep if they were getting close to the radius, and then full-on alarm if they leave it. Structure it as either a trait for a start or just as a separate challenge map.

main pasture
#

You could use the distance method of Vector3f for example to calculate the distance to the starting point

hard coral
#

cool. Thanks for your advice everyone this gives me some direction to start in. Is there a mod manual or wiki to reference as i'm going along? I come from linux so don't want to get hit with a RTFM

ashen copper
#

Quick question - is there a way to cancel the skill loss/remove skill loss if you die via player/pvp? Is there an existing mod (other than the skill journal) that covers this more specifically?

main pasture
opaque ocean
#

might have the name wrong, been a hot minute

main pasture
#

I am trying to get "worldZRotation" of an InventoryContainer (inherits InventoryItem). It has no getter in InventoryItem, but I can get the value using GetClassField. However the inheritance hides this value for the GetClassField in the InventoryContainer. I also checked the metatable of the container, but it doesn't contain it either.
Does anyone know if there is some way to get the value using lua?

#

It is a public int, but the class only implements set method for it

ripe lava
#

Looking to commission an outfit mod for PZ that will be the Hive guys from Kenshi?

vestal gyro
late gate
vestal gyro
#

yes

late gate
#

Ah, I didn't realise. I'll check it out

ripe lava
coral lava
#

Hey, just to make sure i'm doing it right. When you want to patch a file, you just give it the same name, right?

small topaz
coral lava
thick karma
#

But it can work

#

If necessary and if you have permission

#

But if you clarify your goal we might know a better way

coral lava
thick karma
#

What is the file name and mod?

fleet bridge
#

Probably udderly knocked out

#

Also burryaga i solved the context menu issue. It was exactly what you pointed out.

#

I made a mistake somewhere and referenced incorrect parent

thick karma
#

Glad you solved it

thick karma
quiet rain
#

Hey guys,
I'm looking into a method to mess with the zombie population through ingame metrics, like day, month, year and so on.
My first thought was to use sandbox.zombieconfig to adjust the sandbox multipliers, but those can't seem to be edited, nor does it let you lower the zombie.
Manually tracking the zombies and adding/removing them doesn't seem to work, because you can't grab them if they're ouside of the cell.
Would anyone have another method I could do this?

verbal yew
#

@thick karma hello, have you by any chance done any modifications on Rimworld?

verbal yew
#

just one number

compact tinsel
#

heya, not sure whether I'm right in this section or another but...
I'm working on a little something where I made some Keychains that can be attached to Noir's Attachements (Backpacks)
I've asked someone with help on some models since I know nothing about models. They've then modified them and they actually work but there is one problem:

#

no matter what the person I asked for help does, the models stay right down there and aren't up close to the backpack like the spiffo is

compact tinsel
#

I uh... resolved this
found out that Noir's uses different types of attachement types and depending on which one you take the model is on the backpack differently
why do I always find an answer straight after asking a question 😭

coral lava
thick karma
small topaz
# coral lava A Lua file, I think overwriting the file *should* be fine though

Just overwriting the .lua file by giving your file the same name should probably work but you have to ensure then that your mod is loaded after the mod you want to patch.

In case the function you want to patch in the Udderly Mod is a global function, there might still be alternative (and better ways) to patch it. The basic structure of such a patch could look like this:

local function myPatchedFunction(something, ...)

   -- [insert new code here]

   backUp_UdderlyFuntion(something, ...) -- execute the original function

   -- [insert new code here]

end

UdderlyFunction = myPatchedFunction -- overwrite with your patched function```

For making this work, you should additionally ensure that the Udderly Mod is already active and loaded before your code. And this won't work in case the function from the Udderly mod is not global.
thick karma
#

Please share the function. It is not strictly true that it must be global for you to accomplish your goals. There are ways.

small topaz
#

I think it can also work if the function is assigned to a local module and the module is returned to make it accessible from other files. Or are there even ways to do this in other cases (i.e. not global, not returned as part of a module)?

thick karma
#

If a local unreturned module derives from BaseObject, you can use DOME to get it.

#

Also, if the local function makes calls to vanilla functions that can be decorated from global space, your goal can often be achieved even if the mod function cannot be decorated.

red tiger
#

Allllllllllrighty

#

Good morning.

coral lava
#
    if hasConfig then
        local oldTargetLevel = 0.0 + targetLevel
        if chanceToLose ~= 0 and UKO.random(chanceToLose) then --we rolled to lose something
            --randomly modify targetLevel up to configured amount for this skill
            targetLevel = 0.0 + targetLevel - (10 * targetLevel)
            if targetLevel == oldTargetLevel and oldTargetLevel ~= 0 then --if we somehow rolled no change, not even a fractional loss, and we're not at zero..
                targetLevel = targetLevel - UKO.randomDecimal(1) --you're not getting away that easily..
            end
            print("UKO: Randomized loss has left the new target at "..targetLevel)
            if (oldTargetLevel - targetLevel > 0) then
                if affectedPerks ~= "" then
                    affectedPerks = affectedPerks..", "
                end
                affectedPerks = affectedPerks..perkName
            end
        --elseif chanceToLose == 0 then
        --    print("UKO: Skill configured to zero chance, so we don't affect it..")
        --else
        --    print("UKO: Got lucky, rolled to not affect this skill.")
        end
    else
        print("UKO: Skipped unconfigured skill \""..perkName.."\".")
    end
red tiger
#

No syntax highlighting? unhappy

thick karma
coral lava
#

oh okay got it

red tiger
#

Let there be syntax highlighting!

thick karma
#

What do you need to edit in this function @coral lava

coral lava
#

The actual edit i made is the line

        targetLevel = 0.0 + targetLevel - (10 * targetLevel)
#

Let me grab the original version of the line as well

#
            targetLevel = 0.0 + targetLevel - ((UKO.randomDecimal(maxToLose / 10)) / 10 * targetLevel)
#

this is the original line

thick karma
#

Okay

#

there are 2 ways that I would consider

#

Yours is what we would call the nuclear option

#

Replacing a whole file

#

That is not necessary here

#

The first way I would consider might be likened to a missile

#

You overwrite just that function

#

That blows up something, but not everything

#

The third option

red tiger
#

You can store the old function and invoke it.

thick karma
#

Which is what I would call the assassin

#

@red tiger did you read the function and their goal?

red tiger
#

Nope.

thick karma
#

😉

#

Anyway, the third option

#

is to decorate UKO.randomDecimal when it's called from this function only

#

That would be the option I would use

#

For minimum casualties

#

But it would be the most complicated to implement mentally in a way

#

More complicated than copy-pasting a function and changing a number

#

The final code would actually be shorter

#

@coral lava You decide

#

Pick your adventure and I'll give you an example

coral lava
thick karma
#

The missile option is very simple

#

And much less conflict-prone

#

If the assassin intimidates you

red tiger
#

It's such a funny way to explain it

thick karma
#

lol

red tiger
#

But I like that you view it as destructive.

#

It's an important thing to send home.

thick karma
#

lmao

#

❤️

red tiger
#

I'm more wordy with my way of explaining.

coral lava
#

Okay

#

lets just do the missle then haha

red tiger
#

I'll leave that wordiness to my documentation project. =)

thick karma
# coral lava lets just do the missle then haha

Okay the missile is this:

  1. Make your own file with its own name in your own mod called MyNameIsBanana.lua (no other name will work; this is the only filename allowed in Lua).
  2. In MyNameIsBanana.lua, add the attached lines (which are 31 through 133 of the original file).
  3. At the top of that file, add the following line:
require("UdderlyKnockedOut/Recoverable/RecoverableLevels")
  1. Change whatever you want.
#

In step 2, we're copying the function you want to change and the 2 local functions it will require.

#

@coral lava Godspeed.

coral lava
#

Thank you so much for the help 🙏!

thick karma
#

Also in your mod.info add a line that says require=UdderlyKnockedOut

#

And link back to her page with credit

uneven ore
#

Does anyone have Information about the Discord Functions? Looking at the Documentation it seems like you can only send messages and there are no functions to Read or Recognize commands

civic tree
#

This is code from superb survivors, it should be what gives ammo to npcs based on the guns they have. i added modded guns but i cant get the mod to give ammo to npcs for guns with new calibers, can someone help me? the ammo that needs to be added are
( bullet itemID - Ammobox itemID ): (Mod id of guns and ammo being added is Guns93 if thats important)

10mmBullets-10mmBox
40Bullets-40Box
25Bullets-25Box
22Bullets-22Box
357Bullets-357Box
792Bullets-792Box
30CarBullets-30CarBox
76239Bullets-76239Box
556Belt-556box
ShotgunSlugs-ShotgunSlugBox

azure rivet
#

Hi, can someone help me with a script to identify when a player is wearing a specific jacket?

knotty path
#

So how can i work with ".tiles" files? Idk if it's necessary but I'm trying to find "changing one item to another" script or something that i can use and for now i have no idea where can i find it. Tried to do it by making new recipes in .txt but the game doesn't even want to open.

jaunty isle
#

guys, I want to add a windup phase to miniguns from Arsenal gunfighter mod
but I have zero knowledge of lua coding and I dont get the mod's structure at all.
I might try ask ChatGPT to write the script for me, but not knowing the mod's structure makes me stuck hahah
any tips will be much appreciated!

reef umbra
#

does anybody know if it's possible to change a specific stat on every item via a script

ebon garden
#

hey guys, the mod I want to make is a touch unusual but I think it would be very useful for many

#

I just want to make it so users can combine and uncombine stacked boxes

#

so three cardboard boxes wouldn't be three separate inventories, it would be one

#

the thing is, when I look at the code for other mods... I really don't see any hints on how I could achieve this

I guess it wouldn't be that hard for me to make a crafting item that stacks them one on top of the other? but does anyone have any ideas for how it might be possible to just click on the stacked crates and have a "combine" button

outer crypt
# ebon garden I just want to make it so users can combine and uncombine stacked boxes

Might be a tough one, for instance, one egg is not a stack but a dozen eggs could be put into a carton. If you take one egg from the carton its now a carton with 11 and that could be handled by the Use() and a usage bar. But I think you would need to define what a stack is to make that work for each item type you want to stack. Otherwise you could just make a recipe combine 12 eggs into a carton and another that empties the carton giving the player 12 eggs. Hope that makes sense... I have seen this done with stacks of bowls, etc...

#

of course if you are trying to do this with a world object then it will get even more complicated, like stacking 100 crates in one square...

#

if I needed access to each of the 100 crates I think my head would explode.

civic tree
#

is there a way to set up """preset cars"""? as in spawning the same car, in an specific car condition and in the same place in every new save

hallow knoll
#

@reef umbra if you mean to change any vanilla or modded item stats like DisplayName, Icon, ConditionMax, MaxDamage, etc. you can use Item Tweaker API OR copy it's functionality inside your mod.

hallow knoll
# azure rivet Hi, can someone help me with a script to identify when a player is wearing a spe...

IsoGameCharacter has two functions for this - isEquipped(InventoryItem item) & isEquippedClothing(InventoryItem item)

local function checkForJacker()
    local player = getPlayer();
    local inventory = player:getInventory();
    for _, item in ipairs(inventory:getItems()) do
        if item:IsClothing() and player:isEquippedClothing(item) and item:getType() == "Base.Jacket" then
            return true
        end
    end
    return false
end
#

Not tested this code but you got the idea

reef umbra
hallow knoll
compact fog
#

I just thought of something, with update 42 coming out, having a homemade ammo and gun mod would be pretty cool.

Would it make sense to have a recipe for gunpowder that needs charcoal (or whatever it is forging will require as a carbon element), sugar and fertilizer?

#

also, homemade rifles, shotties and revolvers that preform slightly worse than normal firearms but can be repaired by metal, wood, etc that can be made in game

true plinth
#

hello all !
let's talking about getSquare(X,Y,Z).

If the square is in not loaded chunck, the return will be nil. ok.

But, i see on this post : #mod_development message
that we can manually load, parse, unload the square.

Does someone know how to do that please ?

ancient grail
hallow knoll
#

forgot about getWornItems()

#

gj!

ancient grail
true plinth
main pasture
fast galleon
#

It doesn't work, he's just wasting your time.

#

For global objects you can use something like getLuaObjectAt. You will need to use this for the specific global system you want to get the object of.

main pasture
#

I'm trying to get a WorldInventoryObject of specific type. Is that possible, or should I change the object to global?

ancient grail
#
function CFarmingSystem:newLuaObject(globalObject)
    return CPlantGlobalObject:new(self, globalObject)
end

if its global object i think you should create a subclass and register it

main pasture
red tiger
#

I see a lot of inventory convenience mods but man oh man do I want to do the exact opposite.

ancient grail
red tiger
#

I'd love a more realistic inventory system where players would struggle in tense situations to open zippers in bags and search items with discovery.

#

I'd love rushed item-searches to be faulty where unclosed bags leak stuff out slowly.

main pasture
red tiger
#

Broken zippers too.

#

Either way I'm a modder so this isn't a suggestion. I'd do it myself. =)

ancient grail
main pasture
main pasture
#

The briefcase and the drone are both items currently (when the drone is not controlled), because that was easiest to do. The "reattachment" of control back to the drone doesn't work if it is outside the loaded area (as expected)

ancient grail
main pasture
ancient grail
fringe heart
# main pasture

How could you switch the camera to the drone. Did you do it using Java?

main pasture
fringe heart
#

And how do you transfer the damage. If other people start shooting at the dummy?

main pasture
main pasture
main pasture
ancient grail
#

also you cant actually switch camera, to do this you have to hide you player like wear a transparent textured skin
and teleport to the drone i guess

main pasture
ancient grail
#

oh yeah theres a delay when you teleport. i guess you can try to do that delay

#

or maybe put everything on a timed action

#

if the drone has no important unique data. then just spawn a new one

main pasture
main pasture
ancient grail
#

ok then delete controller and spawn new one

#

or maybe its possible to just set he id? not sure

#

ISInventoryPaneContextMenu.OnLinkRemoteController = function(itemToLink, remoteController, player)
    local playerObj = getSpecificPlayer(player)
    if remoteController:getRemoteControlID() == -1 then
        remoteController:setRemoteControlID(ZombRand(100000));
    end
    itemToLink:setRemoteControlID(remoteController:getRemoteControlID());
    ISInventoryPage.dirtyUI();

#

instead of doing random just set the same id

main pasture
ancient grail
main pasture
ancient grail
#

or
spawn an item with moddata thats equal to the id of the drone
so it looks like youre carrying it?

#

the when you respawn it ise the moddata to assign the new drone it's id
the remove the item from inventory

main pasture
#

I see. By the way do you know how can I get worldZRotation of an InventoryContainer as it has no get method? It is a public int, and it is visible to the getClassField in an InventoryItem, but not in InventoryContainer which inherits it

#

The cast methods of java API don't seem to be implemented in lua, so I can't just cast it to InventoryItem

sonic ibex
#

Hmm could it be modded so that players need sleep but it can be done by logging out? So that people can't just grind for 10 days straight in multiplayer?

pine sonnet
#

Can you change the position of a held or equipped model in the players hand without changing the models themselves? For example, change where the player holds an item.

teal slate
#

Does anyone know what IsoZombie:isUseless() does? I'm writing an extension to Susceptible that makes fresh zombie corpses cause sickness, and the base code for Susceptible calls it, so I'm curious.

#

Oh, interesting, it looks like it makes them docile?

ancient grail
#

try that

bright fog
#

So yes, docile

teal slate
#

Yeah, it makes them not respond to sounds and prevents them from spotting players, it seems

#

thank goodness BeautifulJava exists

bright fog
#

Yup

#

Decompiling the java is very useful :)

teal slate
#

I've got a couple mod ideas I'm working on in order of what I consider their feasibility, so knowing that isUseless exists is nice. I'd love a mod that lets you restrain or otherwise pacify zombies, mostly for roleplay purposes

teal slate
main pasture
ancient grail
bright fog
teal slate
#

oh shoot, I just hit the hundred server limit

bright fog
#

Not sure how it handles in MP however but it would require testing

bright fog
#

I made a framework called Zomboid Forge and I made TLOU Infected so zombies is my expertise and I can assure you it's really not easy

ancient grail
ancient grail
#

so you dont need to get the info

bright fog
teal slate
bright fog
#

               var1.put((byte)var7);

               for(int var9 = 0; var9 < var7; ++var9) {
                  AttachedItem var10 = var16.get(var9);
                  GameWindow.WriteStringUTF(var1, var10.getLocation());
                  var1.putShort((short)var12.indexOf(var10.getItem()));
               }
            }
         } catch (IOException var11) {
            DebugLog.Multiplayer.printException(var11, "WriteInventory error for zombie " + this.getOnlineID(), LogSeverity.Error);
         }
      } else {
         var1.put((byte)0);
      }

   }

   public void Kill(IsoGameCharacter var1, boolean var2) {
      if (!this.isOnKillDone()) {
         super.Kill(var1);
         if (this.shouldDoInventory()) {
            this.DoZombieInventory();
         }

         LuaEventManager.triggerEvent("OnZombieDead", this);
         if (var1 == null) {
            this.DoDeath((HandWeapon)null, (IsoGameCharacter)null, var2);
         } else if (var1.getPrimaryHandItem() instanceof HandWeapon) {
            this.DoDeath((HandWeapon)var1.getPrimaryHandItem(), var1, var2);
         } else {
            this.DoDeath(this.getUseHandWeapon(), var1, var2);
         }

      }
   }

   public void Kill(IsoGameCharacter var1) {
      this.Kill(var1, true);
   }

   public boolean shouldDoInventory() {
      return !GameClient.bClient || this.getAttackedBy() instanceof IsoPlayer && ((IsoPlayer)this.getAttackedBy()).isLocalPlayer() || this.getAttackedBy() == IsoWorld.instance.CurrentCell.getFakeZombieForHit() && (this.wasLocal() || this.isLocal());
   }

   public void becomeCorpse() {
      if (!this.isOnDeathDone()) {
         if (this.shouldBecomeCorpse()) {
            super.becomeCorpse();
            if (GameClient.bClient && this.shouldDoInventory()) {
               GameClient.sendZombieDeath(this);
            }
teal slate
#

it outputs two folders

bright fog
#

Oh ?

teal slate
#

decompiled and sources

#

you're looking in decompiled, i believe?

bright fog
#

Yeah

teal slate
#

you want sources

bright fog
#

Damn thanks didn't knew what those other folders were for

teal slate
#

it makes my eyes glaze over less when reading large functions, haha

bright fog
#

Now that's fucking nice thanks

#

Anyway yeah if you ever start working on your idea, don't hesitate to ping me. I'm mostly active in the modding Discord (you'll see me there hanging out and going crazy after random ass shit)

bronze yoke
#

wonder how much work it'd be to hook up beautifuljava to the api scrape

bright fog
#

api scrape ?

bronze yoke
#

jab scraped the javadocs for candle, that's where it sources parameter names and the rare tiny bits of documentation that exist

bright fog
#

hmmm

bronze yoke
#

in-method variable names aren't ever happening but parameter names would really make things easier to read and in theory isn't that much work

red tiger
#

@bright fog Yeah I wrote a scraper for the JavaDocs so that Umbrella & Candle wouldn't have silly variable names.

#

What I'm working on with Mallet right now actually further-improves these names by human hands.

bright fog
#

idk what a scraper is

red tiger
#

I grep'd the hosted JavaDocs by TheIndieStone and then took that local copy and scraped it for all the documentation data and applied it to my PZ-Rosetta JSON format.

#

If you want an offline copy I have one.

teal slate
red tiger
teal slate
#

that would be incredibly useful

red tiger
#

I was buddies with the kids who originally made MCP, the first competent Minecraft decompiler project.

#

Would be fun to make my own version of what they did.

#

It wouldn't be providing the games' code. It'd instead provide a format of sorts that changes characters in the file based on a compiled data source by using the differences between fernflower's decompile and mine.

#

All it'd provide are fixes in a binary format, nothing else. =)

#

You'd still need the game to use the tools.

#

Sarge made his own format with MCP.

raw trellis
#

does anyone know how to get the current weight of a players inventory? I'm logging out some information about players for admin use and one of the things I want to pull out is the current total weight of all inventory items as shown at the top of the inventory window. I'm probably missing something but i've tried getInventoryWeight() and also getInventory() and getContentsWeight(). No luck so far. Getting various other things without issue.

mellow frigate
raw trellis
#

testing that out

teal slate
#

is there a way to tell the age of an IsoDeadBody?

wet sandal
raw trellis
teal slate
#

but yeah, that's the closest I can get

wet sandal
teal slate
#

I just remembered that, thank you

#

in that case I can just use deathTime

#

getClassFieldVal(corpse, "deathTime")

#

getClassFieldVal doesn't need debug mode, right

wet sandal
mellow frigate
raw trellis
patent quarry
#

how do i make a mod

#

i want to add fema vests and jackets

reef umbra
#

im trying something very stupid and seeing if it works

#

if player:HasTrait(LeadStomach) then TweakItem("Base","Type","Food") end

reef umbra
#

oh wait i forgot to add item tweaker api to my mods list

teal slate
#

I am not great at designing mod posters

bright fog
teal slate
#

please do, ha

bright fog
#

It's called Stencil

#

It's what you see on my Susceptible Overhaul mod page

reef umbra
#

is there any way to do this @hallow knoll

wet sandal
#

Awesome

teal slate
#

I don't actually know if the stencil font makes it look better, darn

#

I wanted to emulate the appearance of the exclamation mark on the icon, but

wet sandal
#

Gonna give Susceptible some love soon.
I've been sitting on a half finished update for like a year.

Adds "contamination" that builds up inside buildings based on zombies and corpses, requiring masks even once the zombies are gone until the building has time to air out.

wet sandal
#

Feels like something Mr Sunshine would make

teal slate
#

maybe I'll make the drop shadow a little larger

bright fog
bright fog
bright fog
wet sandal
#

Hoping to kick this out the door in the next few months

#

Just gotta get through all my other mods that need support first

bright fog
#

Hmmm

#

Me needing to update my Overhaul for Susceptible and CSZ to fit this lol

wet sandal
#

It will be a sandbox option, not default

bright fog
#

From Susceptible Overhaul

#

Check it out I've got a fuck ton of new mod compatibilities added

#

Also update some wrong ones

#

Like Undead Survivor

wet sandal
#

Oh, like the masks?

bright fog
#

Yeah

wet sandal
#

That would be great, Mr Sunshine mainly took care of that, but he's busy with life and Insurgent these days.

bright fog
#

Yea nvm you weren't talking about it

#

I mean I could work with you on it but my Overhaul mod is still a thing haha

#

Idk what your plans are exactly

wet sandal
#

For Susceptible, I don't either tbh

#

It's near the bottom of the list

#

I'll know more in a month or 2

#

Gotta handle Inventory Tetris 6 first

bright fog
#

Damn didn't knew you made that one too

#

You worked quite on a few banger mods

teal slate
wet sandal
#

It's also worth considering the image will get downscaled when users are viewing it on the workshop

teal slate
#

and the ol' classic

#

seems pretty alright when downscaled

#

maybe a bit less clear about the thumbs-down pose, but that was pretty silly anyway

bright fog
#

I would make the character look towards the pov

#

So front view thumb down

teal slate
#

alas, then the thumbs-down is less clear

#

but I can try that

bright fog
#

Now thay I think about it I wanted to do exactly something like that

#

For my rework of "Working Gasmasks"

teal slate
#

I think this mod should also work with Susceptible Overhaul but I don't use it myself so I can't test

#

(or rather, I have it installed but am too lazy to start a save with it and test it)

bright fog
#

I set a fuck ton of corpses so the floor you see on the image is only corpses and my character in the middle with a thumb up

bright fog
#

I'll link your mod on my mod page once it's out

bright fog
#

Nice I'll check this out tomorrow

#

Tell me if you ever test compat

teal slate
#

ah, I made it require the Susceptible mod ID

#

does Susceptible Overhaul require Susceptible?

teal slate
#

oh dear

#

this mod makes it a lot harder than I thought

#

I think a large pile of corpses is enough to overpower a gas mask

wet sandal
patent quarry
#

how on earth do i make custom acessory icons

reef umbra
#

does anybody know if it's possible to tweak every item in the game at once via item tweaker api

sullen basin
#

icons seem to need 'item_' before their name. I don't know how this worked for me honestly, but it did.

patent quarry
#

i need to read a whole lotta shit 💀

sullen basin
#

You can make them with like ms paint or something

reef umbra
hallow knoll
#

It's simple af

reef umbra
#

i was thinking of using a for loop but i don't know if that would work so im testing it right now

hallow knoll
#

----------------------------------------------Begin File
if getActivatedMods():contains("ItemTweakerAPI") then
require("ItemTweaker_Core");
else return end

TweakItem("Base.Needle","Icon", "Worm");
TweakItem("Base.Needle","Tooltip", "Wearable: Waist");
TweakItem("Base.Needle","DisplayCategory", "Repair");
------------------------------------------------End File

reef umbra
#

no i was meaning how do i tweak a stat of EVERY item in the game at once

#

if possible

#

not how to initiate the mod

hallow knoll
#

aww

reef umbra
#

this is how i plan on doing it

#
        for _, item in pairs do
            inventory = getInventory()
            if not item:IsWeapon() then
                TweakItem(item,"CantEat",false);
                TweakItem(item,"HungerChange",-20);
            end

        end```
#

don't know if it'll work though

hallow knoll
#

ah, ItemTweaker tweaks items on startup

reef umbra
#

ohhhhh

hallow knoll
#

meaning it's chaning stats of all items of type

reef umbra
#

so uh

#

is there any way to do it without having to manually change the type

hallow knoll
reef umbra
#

oh ok

hallow knoll
#

you can change a lot, just check this docs

reef umbra
#

ok

#

if i want to keep the functionality though

#

if i were to make a certain weapon the type "food" would it remove the weapon functionality

hallow knoll
#

I think no

reef umbra
#

ok

hallow knoll
#

It'll be strange that you can eat m16

#

But I think it should work, not sure

reef umbra
#

ill try it

#

ty

hallow knoll
#

gl

reef umbra
#

ty

#
    local player = getPlayer();
    TraitFactory.addTrait("leadstomach", getText("UI_trait_leadstomach"), 12, getText("UI_trait_leadstomach_desc"),false,false);
    if player:HasTrait("leadstomach") then
        for _, item in pairs do
            item:setType("Food")
        end
    end
end```
#

this doesn't work

#

why doesn't it work

reef umbra
reef umbra
#

oh wait i forgot to figure out what the item was

#

mb

hallow knoll
#

uhm the question is when you call this function

#

when and where

reef umbra
#

uh

#

on game boot

hallow knoll
#

you looping nothing

reef umbra
#

?

hallow knoll
#

on game boot character even is not created

reef umbra
#

oh good point

hallow knoll
#

use another lua events for this

#

like on inventory contents update

reef umbra
#

how do i run it

#

ok

#

would that just be

#

Events.OnInventoryUpdate or something

hallow knoll
#

check for lua guides how to properly loop arrays

reef umbra
#

ok

hallow knoll
ancient grail
#

is there such event? im not sure abt that

reef umbra
#

is it uh

#

OnRefreshInventoryWindowContainers?

hallow knoll
#

OnContainerUpdate
or
OnRefreshInventoryWindowContainers

#

check both

reef umbra
#

ok

ancient grail
#

just use player update event

reef umbra
#

oh yeah good point

reef umbra
#

why does this if statement give an error

#
        for _, item in pairs do
            if item:IsInPlayerInventory() then
                item:setType("Food");
                item.HungerChange = -20;
                item.Calories = 0;
                item.CantEat = false;
            end```
#

@hallow knoll

#

i need to send another line hold up

#

TraitFactory.addTrait("leadstomach", getText("UI_trait_leadstomach"), 12, getText("UI_trait_leadstomach_desc"),false,false);

#

this is in the initLeadStomach() function

reef umbra
#

yay

#

congratulations

patent quarry
#

I still have to make the vest icon and then make the actual thing itself

#

But oh yeah I'm feeling good

wet sandal
#

for _, item in pairs(listObject) do is how this should be done

reef umbra
#

that gives an error

wet sandal
#

If you literally wrote listObject as your pairs Target, yeah it should give an error

#

What are you intending to loop over?

thick karma
reef umbra
#

yeah mb one sec

reef umbra
wet sandal
#

I would say pause on this approach to be honest, I don't know exactly what the goal is, but its immediately incompatible with split screen

#

You probably want to modify the result of an ISEatFoodAction instead

reef umbra
#

what

#

ok yeah i'm just gonna pause on making that mod for now

zenith igloo
#

is there a way to check if the certain bodypart has clothing on it?

#

like if feet has shoes

bright fog
hallow knoll
#

Hey guys, someone know where I can a function responsible for interacting with object when pressing E/Shift+E?
I wanna to block certain interactions, but I can't find how to block E interactions...

zenith igloo
ancient grail
#

what object dont you want them to interact with

raw trellis
# mellow frigate I'm using those in autoloot

i've worked out my issue (why I wasn't getting any useful information for inventory capacity)

I'm logging only on the server events, not on the client events, when I enabled logging EveryOneMinute for both client and server I got duplicate log entries, except the server log entry had no weight information and the client log had the weight information.

This leads me to... does the server know anything about a players current inventory or is it all clientside and as a result very cheatable?

ancient grail
raw trellis
hallow knoll
#

like windows, doors etc

ancient grail
#

hold on

#

local function disabler(player, bool)
    player:setIgnoreInputsForDirection(bool)
    player:setAuthorizeMeleeAction(bool)
    player:setAuthorizeShoveStomp(bool)
    player:setIgnoreMovement(bool) 
    player:setCanShout(bool)
    --player:setZombiesDontAttack(bool)
    --player:setAvoidDamage(bool)
    player:setBlockMovement(bool)
    JoypadState.disableClimbOver = bool
    JoypadState.disableSmashWindow = bool
    JoypadState.disableReload = bool
    JoypadState.disableGrab = bool
    JoypadState.disableInvInteraction = bool
    JoypadState.disableYInventory = bool
    JoypadState.disableControllerPrompt = bool
    JoypadState.disableMovement = bool
    ISBackButtonWheel.disablePlayerInfo = bool
    ISBackButtonWheel.disableCrafting = bool
    ISBackButtonWheel.disableTime = bool
    ISBackButtonWheel.disableMoveable = bool
    ISBackButtonWheel.disableZoomOut = bool
    ISBackButtonWheel.disableZoomIn = bool
end
#

but its better if you use timed action

hallow knoll
#

Thx for inside

#

Maybe timed action really will help, but I don't know how to hide this action line above character's head

hallow knoll
raw trellis
raw trellis
raw trellis
ancient grail
raw trellis
# ancient grail why not just look for logging mod

i've got my own logging mod i'm working on atm, the main issue I have is so much is dealt with clientside and abusable so trying to gather more information, also looking at other preexisting mods that handle some of the issues for me

#

there is quite a lot of inconsistency in what is actually available clientside and serverside so just trying to trawl through it a bit

marsh idol
#

Hey guys, Im looking to make my mod multiplayer compatible and am having a hard time finding what I need to make the client and server scripts communicate with each other, my mod effects how calories are burned, got any ideas or knowledge that can be passed to me?

fast galleon
# marsh idol Hey guys, Im looking to make my mod multiplayer compatible and am having a hard ...

This sounds like something that only needs on the client side and not require any mp compatibility.

There are multiple guides explaining how to communicate things. Here's one for example
https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Use commands.md

GitHub

Contribute to MrBounty/PZ-Mod---Doc development by creating an account on GitHub.

patent quarry
#

i makea the stuff

marsh idol
mellow frigate
teal slate
#

Hm

#

I wonder how hard it'd be to make an addon for Tetris inventory that modifies how gravity works

#

I'd like it if instead of blocking objects it just adds a configurable delay to accessing them, like 0.2 seconds per blocked square above it

bronze yoke
#

probably pretty simple

teal slate
#

as a hook that doesn't outright copy and replace the original code?

#

... also, maybe it'd be good to factor in weight. A single nail shouldn't block something beneath it...

bronze yoke
#

i haven't looked at inventory tetris but notloc has seemed very knowledgeable whenever i've seen them around so i assume it is structured in a sane way that would allow you to do that

wet sandal
teal slate
#

Oh, nice!

patent quarry
#

how do i upload the clothing and actually make the mod?

abstract topaz
#

what would it take to build a hang glider mod?

sullen basin
patent quarry
bright fog
teal slate
#

Yeah, it's very barebones

patent quarry
bright fog
patent quarry
bright fog
#

Does your mod work ?

#

Then you need to look at the example in /Zomboid/Workshop

bright fog
#

When you created your mod, you put it in the folder /mods ?

patent quarry
#

i want to create a unique zombie that spawns with my stuff but idk how

bright fog
#

So your mod doesn't work, you haven't even created the mod yet

#

There's nothing to upload, it's your last concern

#

Have you made your clothing ?

patent quarry
#

I thought I could make a thumbnail and add the content later

#

And yes I have the textures and everything

patent quarry
bright fog
#

You want to replace an existing clothing ?

patent quarry
#

yeah

raw trellis
sour island
#

Hello friends, just wanted to share that the PZ Modding Community discord server (for 3 Saturdays now) has held an event called Supportive Saturday where modders all share their mod(s) they'd like a bit more support towards in the form of ratings, thumbs up, comments, etc. The time frame is All Day Saturday UTC, so it starts in 2 hours.

The way it works is members can use a /promote command to a mod, and it generates a link to the page in Steam. You just rate it up, and that's it. Thanks to the fact people don't really use the Steam Workshop all that consistently these mods shoot up to the most popular for the day/week and get more eyes on it.

We would be greatly appreciative to anyone willing to help support the mods to the front page. 🙂

https://discord.gg/fjB35Twd?event=1249403950524792872

worthy mulch
#

I was working on DinoVille, yes very similar to name lol, but I got bored, made a way to load into the tutorial world...not a remake, but the actual world, just gotta figure out the coords now, I heavily modified the tutorial codes

#

so I made it better lol it only broke because I changed the lots=muldred ky, which it should of stayed lots="media/lua/LastStand/Challenge1.png";

sullen basin
patent quarry
#

this is peak

civic tree
#

hello, i got this thing for a mod that tweaks some zone spawns, but for some reason it makes "Yaki's Makeshift Clothing" mod not work, can someone help me?

patent quarry
#

however wheres the rusting of the cartridge pouch followed by the ripping >:(

sullen basin
#

That's actually in the mod

patent quarry
#

oh the video didnt show it

sullen basin
#

It's right at the start of the reload

patent quarry
#

how do i create this

hollow lodge
sullen basin
#

It's not the greatest sound I don't think but it works

rare obsidian
#

mod idea Im thinking of.

adds buildable blocks that turns wood into charcoal + mix with water to create syngas

patent quarry
#

what do i do now

rare obsidian
#

wouldnt the mod appear at your local newgame since it's in mod folder

#

so at that point you'd test by loading it

patent quarry
#

then i fucked something up cause i did but it aint hsowing up

#

aw shiy

chrome veldt
#

Pro-tip : Upload your mods during the weekend. I made the mistake of publishing one of mine on a tuesday and it got way less visitors compared to the others (maybe my preview image sucks, that might have played a role tbh)

ancient grail
chrome veldt
ancient grail
chrome veldt
hallow knoll
#

Who worked with client/server commands?
I'm trying to send specific states from moddata from all players to one when someone joins server.
Is it better to send individual packets for every player to this one player, or it's better to send ONE big packet with every player state?

chrome veldt
#

Never done it but I’d say individual packets over big ones. Large operations can cause stuttering

thick karma
pine sonnet
#

Is there a way of adjusting the position of an item held by the player, without editing the model itself?

hallow knoll
hallow knoll
thick karma
thick karma
# hallow knoll so you can directly send packet from one client to another?

I thought you could but I could be misremembering. I know you can send data from server back to one player using sendServerCommand(player, module, command, packet) if you supply player object in your sendClientCommand. We do this in True Music Jukebox and you can review it and refactor what you need.

#

I don't know if you're allowed to send the player object of another player from client to server that way or not.

#

But you can use a loop on client to get the clientside player object of another player.

#

You just loop through the ArrayList returned by getOnlinePlayers().

#

I would imagine you could combine those tactics to send 1 thing to 1 person in theory.

hallow knoll
#

This is how I implemented all my stuff right now

thick karma
#

But when you're sending so little data to everyone, I honestly don't think it's gonna matter much

#

That won't cause any human perceptible lag most likely

#

One way you can perhaps slow it down is by requiring a random number to pass when the event is flagged as ready if you're already checking on player update or something

hallow knoll
#

But I need to send data of all other players to one player

#

It'll be on player join to sync states

#

For some reason even if I store states in moddata on player join server not sending moddata to client

thick karma
#

I haven't narrowed down sending the update to one player yet so I can't show you that

#

But clientside this is how I plan to check whether players need update:

#

Anyway good luck!

hallow knoll
#

What mod do you developing?

#

Thx)

tidal pike
#

someone ask me a question please , i want to create a closet , in blender i just make the model , i create the UV mapping and export it and the 3d model to create the texture in the right way and in the .txt tell the game what the texture issomeone ask me a question please , I want to create a closet , in blender I just make the model , I create the UV mapping and export it and the 3d model to create the texture in the right way and in the .txt tell the game I say what is the texture ?

stone umbra
#

Would it be possible to make a mod for server admins that displays all whitelisted characters in a UI that we can utilize like the mini scoreboard whether they are online or offline? Currently there is no way to check stats of someone offline to conduct administrative actions (log and warnings) besides outright banning the user from the database white list

thick karma
chrome veldt
#

Do you guys promote your mods? If so, where?

mellow frigate
teal slate
#

I'm wondering... for Susceptible Corpses, I wonder if maybe I could make the infection strength taper to zero as the corpse gets older

#

or maybe it should just be a cutoff like it is now

chrome veldt
chrome veldt
empty flame
#

anyon can help me? i created a tiles mod but for some reason i cant find them on the debug menù brush tool
Any info? thanks

wraith ruin
#

Looking for answers on how to create my own loading screen replace text message mod prior to loading into the world?

ya know currently it says "bla bla bla bla" and "this is how you died". i want to change that to something else basically.

mellow frigate
wraith ruin
mellow frigate
#

I have not found any way to make it dynamic so I'd be happy to see what mods you are refering to. (I do not understand what 'anime weeaboo' means)

burnt grotto
wraith ruin
tiny stirrup
#

Since IsoGameCharacter is exposed, can I call any function from within it?

burnt grotto
wraith ruin
#

Bet

tiny stirrup
#

Specifically getFootInjuryType

wraith ruin
burnt grotto
#

It's super super easy, you can do it!!! \o/ I think TIS was kind enough to include instructions in the game itself, if you click 'Workshop' and 'Mods' - I can't check right fast now, though. ; v ;

mellow frigate
tiny stirrup
# wraith ruin If I only knew how to upload mods 🤣 but i bet I can find some tutorials on that...

It's easy, yeah. The game will tell you where to put your mod files (in ...user/Zomboid/Workshop/) and there's a Mod Template to serve as an example. You want your directory structure to mimic that one's, with preview.png, poster.png, and mod.info in the same places, and the same basic information in mod.info. If anything's wrong, it'll prompt you with what's wrong and where it expected something.

You don't have to back out of the whole game to refresh, just hit "back" and then the mod folder and "next" and it'll tell you what else is wrong now.

#

Then it walks you through the process of creating the description, tags, etc, and you hit "Upload to Workshop Now!" and it does it.

wraith ruin
#

I made it work. I simply just copied ModTemplate and replaced with my own stuff. AWESOMEEEEEEEEEEEEEEE.

Thank you @tiny stirrup and @burnt grotto 🥰 🥺👉👈

tiny stirrup
#

I'm trying to test out some Lua commands. I have the debug console up, and I have Accessible Fields running.

If I type print(getPlayer().footInjuryTimer) it works just fine, and returns an integer appropriate to that variable.

But if I do print(getPlayer().footInjuryType) it only ever returns 'nil', when I'm expecting "heavyleft" or "heavyright" (or both, which is maybe problematic?)

Does anyone know what's going wrong?

#

Congrats!

bright fog
#

Oh nvm you have accessible fields

tiny stirrup
#

Now you'll probably want to move that directory somewhere else, so when you download via "subscribe" it won't be duplicated in your mod selector.

#

Yeah, I'm wondering if it is maybe returning an array, and I'm not requesting it to print that or something?

bright fog
#

No it wouldn't say nil

#

Are you sure it can give out something ?

#

Because there's a lot of cases where fields can just be unused yet available

tiny stirrup
#

Here's what the code for the method is...

#
      if (!(this instanceof IsoPlayer)) {
         return "";
      } else {
         BodyPart var1 = this.getBodyDamage().getBodyPart(BodyPartType.Foot_L);
         BodyPart var2 = this.getBodyDamage().getBodyPart(BodyPartType.Foot_R);
         if (!this.bRunning) {
            if (var1.haveBullet() || var1.getBurnTime() > 5.0F || var1.bitten() || var1.deepWounded() || var1.isSplint() || var1.getFractureTime() > 0.0F || var1.haveGlass()) {
               return "leftheavy";
            }

            if (var2.haveBullet() || var2.getBurnTime() > 5.0F || var2.bitten() || var2.deepWounded() || var2.isSplint() || var2.getFractureTime() > 0.0F || var2.haveGlass()) {
               return "rightheavy";
            }
         }

         if (!(var1.getScratchTime() > 5.0F) && !(var1.getCutTime() > 7.0F) && !(var1.getBurnTime() > 0.0F)) {
            if (!(var2.getScratchTime() > 5.0F) && !(var2.getCutTime() > 7.0F) && !(var2.getBurnTime() > 0.0F)) {
               return "";
            } else {
               return "rightlight";
            }
         } else {
            return "leftlight";
         }
      }
   }```
#

Well, not sure why the formatting didn't work, but yeah.

#

Oh, maybe it's because of the intermediate temp variables? Maybe Accessible Fields didn't populate through those?

bright fog
#

But this method is private and thus not exposed

tiny stirrup
#

Ah. How can I tell that (other than by it failing)?

bright fog
#

Where did you even get footInjuryType

tiny stirrup
#

IsoGameCharacter

bright fog
#

Did you understand what Accessible Field is for ?

#

Bcs there isn't a field for footInjuryType, at all

tiny stirrup
#

Those are only the vanilla exposed fields, though, right?

bright fog
#

There's nothing else you can access

#

You can only access what is shown in the documentation

tiny stirrup
#

That's... just not true. footInjuryTimer isn't in the documentation either, but that works just fine, as long as Accessible Fields is working.

#

It's in IsoPlayer

bright fog
#

Hmm you're right actually

tiny stirrup
#

Ah, heh, sorry, didn't see that you'd said that.

bright fog
#

Well either way, I didn't find any footInjuryType field in the java

#

So my guess is your trying to access something that doesn't exist

tiny stirrup
#

Like, in the actual code? It's in IsoGameCharacter.java on line 9348

bright fog
#

Giving lines for the java doesn't mean anything bcs the decompile doesn't give out the same lines as what the devs actually had so it depends on what decompiled your code I believe

tiny stirrup
#

Ah, fair. But... isn't the top one where it defines the variable?

bright fog
bright fog
tiny stirrup
#

Ah. Interesting...

bright fog
#

this.setVariable("footInjuryType", this::getFootInjuryType); will set the animation variable "footInjuryType" to this::getFootInjuryType

#

Check out AnimSets if you wonder what it's used for

tiny stirrup
#

Could I just reproduce what their code is doing using like, IsBleeding, IsScratched, etc?

#

Though they're using ScratchTime...

bright fog
#

You can reproduce a few java methods in lua

#

I've done it myself to get the hit reaction of zombies based on the attack type

tiny stirrup
#

I guess I don't really need scratch time. Just... if it's scratched vs. worse injuries. I just thought using that method would be elegant, as it already has everything defined and worked out, and is about what I'm looking for.

bright fog
#

yup

bronze yoke
#

footInjuryTimer won't be on the javadoc because it is private

tiny stirrup
#

How do I test, say, "IsBleeding" for a body part, in the lua console, just to see if it's working? I don't know the syntax for that.

bronze yoke
#

the methods accessible fields calls on force access so i don't think access modifiers matter

tiny stirrup
#

Heh, hihi albion. I hear you is wizard. xD

#

Is there any easy way to tell what I can access with Accessible Fields and what I can't?

bronze yoke
#

to my recollection, any field declared directly by the class of the object

#

fields declared by superclasses can't be accessed

tiny stirrup
#

And what is the syntax for something like public boolean isBodyPartBleeding(BodyPartType bodyPartType) in the lua console?

tiny stirrup
bronze yoke
#

yeah, it doesn't allow you to access any methods you couldn't without it

mellow frigate
bronze yoke
#

i honestly thought it was public only but they seem to be accessing private fields fine

mellow frigate
tiny stirrup
#

Yeah, like I can see FootInjuryTimer just fine.

bronze yoke
#

iirc the method used to get the field calls makeAccessible so access modifiers shouldn't really matter

#

that's why it used to error on core java objects, zombie package isn't allowed to make those accessible

tiny stirrup
#

So you think footInjuryTimer (which is private int) woudl fail in normal gameplay? Or would be okay?

#

Also, what is a protected variable?

#

Or... field, I guess?

bronze yoke
#

protected is similar to private but accessible within subclasses

mellow frigate
#

and then you tell us 🙂

tiny stirrup
#

But if I don't have debug mode, I also have no console with which to test it. <_<

#

When the code says this... what exactly does that mean?

#

Does that mean isWearingNightVisionGoggles is deprecated? Or transactionID? Or everything below it? Or is it a placeholder for something deprecated that's no longer there?

bronze yoke
#

it would mean transactionID is

tiny stirrup
#

Ah, so the next thing. Okay, that's... somewhat reassuring. xD My initial assumption was everything from there down but that'd be a lot of deprecated stuff. >_<

#

Okay, so the reason I can call footInjuryTimer is because it's defined as a field at the top of IsoPlayer, while I can't called getFootInjuryType because it isn't defined as a field, but is a method?

#

What would be the syntax to get the type of injury to a body part in general?

#

Also, can I use the && syntax in Lua in an if statement?

dry chasm
tiny stirrup
#

Thanks!

ocean gulch
#

Do we have anything more up to date than https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/ ?
The images aren't loading.
Point of reference; I'm looking to make a vehicle, custom ui overlay, custom parts, custom part requirements (like how a door window requires the door), 3d model, and animated when opening closing.
The coding and 3d modeling aren't daunting. My issue is getting integrated in understanding the structure of the mods, especially the vehicles. I'm currently digging around in https://steamcommunity.com/sharedfiles/filedetails/?id=2846036306&searchtext=r32 to look for clues on how to handle these things, as this modder seems to have touched on all of the points that I'm looking for.
I'm already running into issues when looking for part requirements though. I know the spoiler requires the trunk lid, but I can't seem to find where that is referenced, etc., etc. Basically, I need to start a tutorial from scratch so I can have a better understanding but I can't seem to find these topics and don't know where to look. The forum seems pretty antiquated and derelict, and discord search is very hit or miss.
https://theindiestone.com/forums/index.php?/topic/28633-complete-vehicle-modding-tutorial/#comment-292151
Definitely covers the broader subjects in plenty of detail and will definitely be my starting point. But these little things like the requirements and ui that are eluding me. I can use other tutorials for making my own parts, I'm sure those tutorials are abundant.
Summary: vehicle part pre-requiring (like door windows need doors) and animating the vehicle are what I'm really looking for. I can live without the latter, but the part pre-requiring is necessary for my vision.

junior blaze
#

how do u create learned traits recipe?

#

i tried this. the traits won't show up when start the char creation.

#

did i missed something?

ancient grail
coarse sinew
junior blaze
#

i'll copy paste that?

coarse sinew
#

Yes, and also changing Doomsday_Preppers to Vintner

ancient grail
#

right

#

good catch

junior blaze
#

yeah but i have thattraits active. the vintner

ancient grail
#

or change vinter to Doomsday_Preppers

#

its not gona matter cuz its local var

#

but yeah just link them

junior blaze
#

i changed the code

ancient grail
#

yeah

#

but your description and icon will be from that mod you got vinter from

#

if people dont have that mod then nothings gona show there

#

you need to make your own and create the translate files

#

or require the mod

junior blaze
#

i see. it was just reverse engineer. i copy pasted the code..

ancient grail
#

better to look at vanilla

junior blaze
#

still not showing up

ancient grail
#

maybe you dont have the mod installed

#

or did you just copied the whole mod

junior blaze
#

the file was located in different folder

#

in the mod from crossbows

#

i copied the mod code inside from crossbows and make a new NPCs files to store the code there. and copy paste the code from vintner

#

this is the new one i created new file and still won't show up

surreal crater
#

for procedural loot tables, does "min" indicate the least that WILL spawn or the least that CAN spawn?

#

procedural loot distributions i should say

civic tree
#

im trying to delete some building and table stories, is that posible?

wet sandal
#

Math, partially successful

#

I have rotated a texture

#

Shout-out to umbrella for making ISUIElement:drawTextureAllPoint make sense

drifting ore
#

does anyone know how to modified this mod ?

dull bear
#

Hello everyone. I am trying to modify the player FoV / view cone (tightening and widening it) and also view distance. Does anyone have any references to how i could go about this?

gilded crescent
dull bear
tiny wolf
#

Hey guys
When player eat a part of a food item, what is the variable modified by that on the item ?
I'm seeing it is not "condition" or "usedelta" of the item 😳 but i'm looking for which one it is

half remnant
ancient grail
tiny wolf
#

Because I’ve got a function which test the use delta of this kind of items, but when player eat a part of food, function don’t return a « modified use delta »

#

And it consider a perfect food or eatten food got the same use delta

tiny wolf
ancient grail
ancient grail
tiny wolf
#

I'm using a trader mod

#

and i'm creating a function that is conditionning the possibility to sell

#

If player consume a part of an item, he can't sell it

#

so i'm trying to check if a food item is into perfect condition or not

ancient grail
#

not sure which one but yeah

#

if it errors try just one of em

tiny wolf
#

Gonna check 😉 Thanks Glytch3r

#

I'm using this

  function EFK_ItemNotUsedDelta(sourceItem, result)
    if sourceItem:hasTag("EFK_Selling") then
      if sourceItem:getUsedDelta() < 1 then
        return false
      end
    end
    return true
  end
#

And it always return true for food items

#

even if i eat half of it

#

But Drainable items works fine

mellow frigate
tiny wolf
mellow frigate
tiny wolf
#

Hey guys @mellow frigate @ancient grail
It does not work for example :

#

ITEM

    item EFK_Sugar
    {
        DisplayName = Pack of sugar,
        DisplayCategory = Food,
        Type = Food,
        Weight = 0.5,
        WeightEmpty = 0.1,
        Icon = EFK_Sugar,
        Spice = true,
        UseDelta = 0.16,
        UseWhileEquipped = FALSE,
        HungerChange = -70,
        ThirstChange = 45,
        Calories = 387,
        Carbohydrates = 100,
        Lipids = 0,
        Proteins = 0,
        WorldStaticModel = Sugar,
        Tags = Sugar;EFK_Selling,    
        FoodType = Sugar,
    }
#

RECIPE

    recipe Sell Pack of sugar
    {   destroy EFK_Sugar,
        keep TancredTrader,

        Result:    Money=135,
        CanBeDoneFromFloor:true,
        Category:Money,
        OnTest:EFK_ItemNotUsedDelta,
        Tooltip:Tooltip_EFK_ConditionReparation,  
        Time:0,           
    }
#

FUNCTION

  function EFK_ItemNotUsedDelta(sourceItem, result)
    if sourceItem:hasTag("EFK_Selling") and ((sourceItem:getUsedDelta() == 1 or item:getScript():getUsedDelta() == 1)) then
        return true
    end
    return false
  end
#

ERROR :

LOG  : General     , 1718547253494> Object tried to call nil in EFK_ItemNotUsedDelta
ERROR: General     , 1718547253494> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in EFK_ItemNotUsedDelta at KahluaUtil.fail line:82.
ERROR: General     , 1718547253494> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in EFK_ItemNotUsedDelta
#

Any idea about where is the problem ?

coarse sinew
tiny wolf
#

SSR only let player sell items which come from his main inventory, not bags or belts of chest rigs or on the floor

#

But into my EFK project, player do not have got main inventory

mellow frigate
ancient grail
#
--server folder
Recipe = Recipe  or {}
Recipe.OnTest = Recipe.OnTest or {}
function Recipe.OnTest.IsNotWorn(item)
    if instanceof(item, "Clothing") then
        return not item:isWorn()
    end
    return true    
end


#

this is from vanilla

#

add this to your file

Recipe = Recipe  or {}
Recipe.OnTest = Recipe.OnTest or {}
ancient grail
#

oh nevermind arent you making recipe cuz i saw the sourceitem param

#

i got confused

#

(sourceItem, result) <--- this is what OnTest use

ancient grail
ancient grail
#

i ment where is this being use

#

whos calling the functions

tiny wolf
#

into the recipe during a OnTest

tiny wolf
ancient grail
#

Recipe = Recipe  or {}
Recipe.OnTest = Recipe.OnTest or {}


function Recipe.OnTest.isItemFull(item)    
    return item:getUsedDelta() == 1 and item:hasTag("EFK_Selling") 
end




recipe Sell Pack of sugar
{   
    destroy EFK_Sugar,
    keep TancredTrader,

    Result:    Money=135,
    CanBeDoneFromFloor:true,
    Category:Money,
    OnTest:Recipe.OnTest.isItemFull,
    Tooltip:Tooltip_EFK_ConditionReparation,  
    Time:0,           
}
tiny wolf
#

Yeah ok 🙂 Gonna try this

#

You're the best guys @ancient grail @mellow frigate ❤️ Thank you very much to you and other big PZ moders
My Escape From Knox County project won't be as sophisticated as it is without all your good work on PZ from the beginning ❤️

thick karma
thick karma
#

If you needed to declare those objects to add your recipe function because there was any chance at all that the vanilla file hadn't yet loaded (which is not the case), then the vanilla file would erase your access to your functions as soon as it said Recipe = {} in the vanilla files.

#

So it still wouldn't work to try to set them to a new table

tiny wolf
#

OK thanks to you @thick karma
I gonna test this right now

#

Error again 😬

#
LOG  : General     , 1718551650014> Object tried to call nil in EFK_isItemFull
LOG  : General     , 1718551650112> [INVENTORY_TETRIS]     creating new sourcewindow: C:/Users/TancredTerror-Gaming/Zomboid/mods/EFK_CORE/media/lua/server/EFK_ItemGoodCondition.lua
ERROR: General     , 1718551702716> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in EFK_isItemFull at KahluaUtil.fail line:82.
ERROR: General     , 1718551702716> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in EFK_isItemFull
#

Strange, Inventory Tetris mod seems to do things here

#

function: EFK_isItemFull -- file: EFK_ItemGoodCondition.lua line # 12 | MOD: Escape From Knox Project CORE Callframe at: getUniqueRecipeItems function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 274 | MOD: Escape From Knox Project FIX function: createMenu -- file: InventoryTetris_DevTool.lua line # 917 | MOD: Inventory Tetris function: openStackContextMenu -- file: ItemGridUI_events.lua line # 573 | MOD: Inventory Tetris function: onRightMouseUp -- file: ItemGridUI_events.lua line # 109 | MOD: Inventory Tetris java.lang.RuntimeException: Object tried to call nil in EFK_isItemFull

#

Erf, do you think it could be a Inventory Tetris issue or incompatibility ?

#
function Recipe.OnTest.EFK_isItemFull(item)    
  return item:getUsedDelta() == 1 and item:hasTag("EFK_Selling") 
end



    recipe Sell Pack of sugar
    {   destroy EFK_Sugar,
        keep TancredTrader,

        Result:    Money=135,
        CanBeDoneFromFloor:true,
        Category:Money,
        OnTest:Recipe.OnTest.EFK_isItemFull,
        Tooltip:Tooltip_EFK_ConditionReparation,  
        Time:0,           
    }

junior blaze
fast galleon
tiny wolf
#

so : do food type items have got a usedelta variable ?

fast galleon
#

test function tests all items, so you need to check that it's food then
?

tiny wolf
#

because i don't think so

tiny wolf
fast galleon
#

To give you a list of available recipes when you right click on something every item is being tested so it would not be surprising if not all of them were drainbale or food. But I haven't looked at the specifics of this in a while so it might not apply for your case.

#

Anyhow, you need a drainable item to use getUsedDelta.

tiny wolf
#

Gonna add a test to test only food item into function

thick karma
tiny wolf
#

but about food, i don't think this will solve my situation
because i want to test food type item that player didn't eat a part

thick karma
tiny wolf
#

I'm sorry, i don't understand your question

thick karma
#

Is line 12 of the file identified by your error the line that says return item:getUsedDelta() == 1 and item:hasTag("EFK_Selling") end?

thick karma
#

I'm asking for confirmation about which line is line 12

tiny wolf
#

Oh yes ok

#

it is always linked to the UsedDelta test of Get

#

And it seems, after a lot of tests, that food type items do not have got a Drainable variable

#

So the UseDelta do not work

#

So there is another variable which save the state of a food type item when a player eat a part of it

#

but i can't find what it is

#

so i could test it when i would know

fast galleon
tiny wolf
#

because weight evolve when player eat a part

#

do you know a way to get the "initial" weight of an item ?

runic siren
runic siren
#

that's just In The House In a Heartbeat and East Hastings though

lilac belfry
#

Hello guys, I am trying to do my very first mod, a very simple add of a pistol following a tutorial, just to get the hang of it, unfortunately while the item works in game, I can't get it to appear. It stays invisible, despite having proper nomenclature. Does anyone know what could be the issue ? (note, I used an online fbx to X converter since I don't have a plug-in for that file format)
I'm sure it's something very little but I can't seem to find the problem

tranquil kindle
#

Just use FBX model

tranquil kindle
lilac belfry
#

I did try to add the fbx in the same folder, with no result as well weirdass

tranquil kindle
#

Launch debug mode and restart game, in console if you equip/have gun "visible" if its issue with model script it will tell you

lilac belfry
#

I'm gonna try that, thank you !

#

... yup 😬 I guess I'm good to check my nomenclature once again

regal hornet
#

mod idea: i just want to make/have made a more realistic loot tables. grocery stores should be nearly empty except the back storage, and peoples pantries should have more food, etc

#

would anyone be willing to make it/help me make it? id be willing to pay depending on how much it costs

tiny wolf
regal hornet
tiny wolf
#

i just finished to rework all loot tables of the game and i needed 3 weeks to finish it with my project ^^

bright fog
#

Which is 20k lines of code to go through ShibaNom

regal hornet
#

jeez!

bright fog
#

Well yeah

austere sequoia
regal hornet
slim steeple
#

how can i make some custom flags for a zomboid server im in

#

basically will it require coding or putting custom pictures

ancient grail
#

the actual sprite sheet
and depending on how you want to use the tiles you would have to do bit of code

wet sandal
#

What version of Lua is Zomboid using again?

bronze yoke
#

5.1ish

sour island
#

Anyone know what font face this could be:

#

I assume it's not hand drawn

#

Looks like ravie

hallow knoll
#

guys, I have a really stupid question

#

I wanna translate in english button, which responds for getting up knocked player

#

How to properly translate, "Help to get up"?

#

Or "Help to stand up"?

muted garnet
#

can I find out when the player clicked the go here button? like for example I can find out player:pressedMovement(false) or player:pressedCancelAction() but can I find out when the player selected the go here button with the mouse?

royal rose
#

Can someone tell me how can i change which materials a tile drops when it is disassembled? I want some vanilla tile, for example the military tent walls, to drop some custom item. How can i do that?

bright fog
teal slate
#

progress...

bright fog
sour island
#

Update on why I needed the font. These are WIP and changes have since been made.

#

Basically Spiffo trading cards for Game-Night.

bright fog
#

Nice

#

That's amazing

sour island
#

Thank you 🙂

Can't take all the credit, as I had StableDiff generate the foundation, and I just had to do some chops/edits + the graphic design aspect.

#

There's still a lot of details that stand out and bug me, but the whole point of using SD instead of drawing them all out was so shave off time.

bright fog
#

I mean you can just link the stable diffusion model you used in the mod's description

sour island
#

For example the police's gun before was melded into his hand lol, I also had to construct most of their hands, eyes, and tools.

sour island
bright fog
#

That would be amazing

sour island
#

I was thinking of marking them as sets with logos on the back - but I'm concerned with making it harder to expand.

#

These would be like "Careers of the World" or something - maybe with a little globe

#

But yeah, it would mean others would need some level of skill lol

#

I do need to make a guide for card generation - could be useful for others. Anything to make the workflow easier.

teal slate
#

wonder if I should retitle my mod's page to say Susceptible Corpses [Sandbox Options] or something

#

since it's a pretty notable change...

bright fog
#

What you can do however is make an announcement in the comments and also make sure to make your patch notes clear

teal slate
#

I did make the patch notes clear, comments are probably useful too though

#

Still waiting on verification...

teal slate
#

I'm too lazy to figure out formatting, ha. Is it markdown, BBcode, limited HTML...?

dull moss
#

does getServerOptions() work for SP game too?

#

nvm its probably getSandboxOptions() for SP

fast galleon
#

@dull moss
those are different things that you access both in SP.

dull moss
#

huh

sour island
#

Those are two different sets of settings

dull moss
#

oh

#

so serveroptions are there both in sp and mp?

#

cuz i've been using this getServerOptions():getBoolean("SleepNeeded")

#

to check if MP server uses sleep needed

thick karma
#

But

#

Some things get reported oddly

#

It does not error

dull moss
#

hmm

#

imma go test stuff i guess PepeLaugh

thick karma
#

It seems possibly that it reflects the most recent way you ran your server

dull moss
#

ok thats not good then

thick karma
#

I used it in SP just yesterday and expected a nil value

#

Was surprised

#

Then I added a feature to make a popup show based on an Anti-Cheat

#

And that showed in SP when Anti-Cheat was true

#

Much to my surprise

#

I haven't further explored the weirdness of it but it suffices to say the function works and returns non nil under some conditions at least, all the ones I tested

dull moss
#

i have to decide if i wanna add safeguard vs players not properly setting sandbox settings or if i leave it be and assume they are smart enough

thick karma
#

Safeguard will spare you headache long-term

dull moss
thick karma
#

Idk I can send you some very useful code in a minute

dull moss
#

only now realized that i check for mp if sleep is forced

thick karma
#

I've been moving from mod to mod

dull moss
#

but not in sp

thick karma
#

For different purposes

dull moss
#

ignore sandbox thing i jsut added it without testing yet

thick karma
#

But not sure when Internet back

bright fog
dull moss
#

ye its a huge if so i had to decide how do i wanna format it

#

i dont like it

#

but i have to format it somehow

#

ye i tried getServerOptions():getBoolean("SleepNeeded") and getServerOptions():getBoolean("SleepAllowed") in SP where both of those are on, and it returned false twice

#

Which is I assume from my server where both are off

#

So how do I check those in SP

#

How can I open table in f11 to browse it

#

Like for example I know there's table SandboxVars

#

how do I open it in here

#

to view its fields

bright fog
dull moss
#

yes

bright fog
#

SandboxVars.MyModName.MyOptionOne in lua
for

option MyModName.MyOptionOne= {
    type = integer,
    default = 1,
    min = 1,
    max = 100,
    
    page = MyModName,
    translation = MyModName_OptionNameOne,
    valueTranslation = MyModName_OptionNameOne,
}
dull moss
#

I am aware of how my options work, I need base game

#

Idk how SleepNeeded is named internally

#

or where to find it

bright fog
#

Oooh

dull moss
#

which is my initial question

dull moss
#

bruh

bright fog
#

Allows you to check every option names

dull moss
#

oh

bright fog
#

No I'm not fucking with you

#

At least you can use it to find every option tags I guess

#

It has a command you can print in-game (or anywhere in lua I guess) to check sandbox options IDs

#

It's not it's original use but you can use it for that I guess

dull moss
bright fog
#

I believe you can use it for it ?

#

Maybe I'm completely wrong lmao

coarse sinew
#

SleepNeeded and SleepAllowed aren't sandbox options, you can set them only in the .ini

dull moss
#

I mean the game somehow knows if in SP those options are enabled

#

right

#

So there's gotta be a way to fetch those values

dull moss
#

how to open specific table

#

just make it error out and then you can have it in object stack

#

prints(SandboxVars) works like a charm

#

also its not in there so I officially give up on trying to fetch from game if sleep is needed

thick karma
#

And check the variable as the condition

#

Just to avoid the aesthetic atrocity

#

😎

dull moss
#

oh ye I actually do that for few things already
local desensitized = function(player) return player:HasTrait("Desensitized") and SBvars.BraverySystemRemovesOtherFearPerks end

#

no worries, I fix it by deleting whole thing and letting users figure it out since it doesnt work as intended anyway

dull moss
#

looks slightly different from yours

#

or did you not mean to put = sign in there at the start?

#

or does it work regardless if = there or not

bright fog
#

Ah right the =

dull moss
#

ye

bright fog
#

I copied the example from somewhere else

dull moss
#

ah k

bright fog
#

Gonna report it to the guy who made the option example

bright fog
dull moss
compact warren
#

Im trying to make a mod that adds some custom buildings into the vanilla map

#

Will this work

#

I have no

#

previous experience at all with project zomboid

#

only LUA

slow hound
# compact warren https://github.com/Unjammer/PZ_Vanilla_Map

better luck in #mapping if you haven't tried yet. also mapping for the most part, you use external tools such as a painting program, worlded, tilezed, depending on what youa re trying to do. mainly tilezed if you are redoing buildings from vanilla. you then create the mod, and with your editing map using the same locations as in game map you are replacing, will overwrite the map with yours. you have a bit of learning you may need though if your goal is to edit a preexisting vanilla map

compact warren
#

Alright

#

i tried

slow hound
#

if you want to create full custom map over top of vanilla there is some good guides. look at pins in mapping, there is also another discord for mapping with a LOT of resources and guides

compact warren
#

Daddy Dirkie dirks zomboid mapping tutorials

#

or am trying

slow hound
#

yep, you just move through those and ask specific questions as you run into things

calm rose
#

Can anyone give me a starting point as to where I can learn more about how to create PvP zones on a server, ideally with higher loot spawns?

slow hound
#

asking general question like what you did though will get you not much help

#

it's too many answers needed at the same time 😄

#

if you overwrite vanilla map with full custom map, you don't need that github though.

#

Alree does make some updated tools that make mapping WAY easier though. try to find a link for unofficial mapping discord. thats your best bet imo

compact warren
#

trivial but uhh

#

how do i see a detailed version

#

this is what the cell looks like

#

but its only showing in green for some reason

slow hound
#
The Indie Stone Forums

Here you will find a (hopefully) comprehensive guide to map modding using TileZed, from scratch, to uploading to Steam Workshop. Step 1) Installation and setup Spoiler - Download the latest version of TileZed here: https://theindiestone.com/forums/index.php?/forum/64-mapping/ 3 Step 2) Creating a...

compact warren
slow hound
#

you put them all with a veg layer in worlded and drag it all to your cell, it will show all. you can change the view to show

#

the problem is you aren't obviously using any guide here

compact warren
#

I am

slow hound
#

you really need to use the guide i posted to at least have some idea