#mod_development

1 messages · Page 166 of 1

bronze yoke
#

like timed actions

mellow frigate
#

I have, OnCharacterDeath is one exemple

mystic rose
#

i would of thought rotating was moving

bronze yoke
#

what are you trying to get this facing direction for anyway?

mystic rose
#

honestly im just testing how everything works

bronze yoke
#

oh fair, i guess you'd have to use OnPlayerUpdate if you wanted it to track rotation without moving then

mystic rose
#

i have a few ideas but nothing really concreat till i learn more about the games limit

bronze yoke
#

hey, don't you make barotrauma mods? i think i've seen you around that discord before

mystic rose
#

i do

bronze yoke
#

that's sick

mystic rose
#

hmm time to keep learning

#

so i saw in the docs theres IsoDummyCameraCharacter and IsoCamera and a few other dummy things, but whats the point of the dummies and what are they used for? i was searching for IsoDirections and saw it

#

im assuming dummy isnt really used for anything as it is just a dummy

bronze yoke
#

IsoDummyCameraCharacter is unused

#

it has no code or references

mystic rose
#

intresting

#

im surprised you can even mess with the camera as the game heavily relies on your camera being in an exact angle

bronze yoke
#

you're not able to mess with it in a 3d sense

mystic rose
#

oh?

bronze yoke
#

it's just for moving it about and zoom and stuff, it can't be rotated or anything

mystic rose
#

huh

#

would of loved to see if i could break the camera and show how the buildings worked in 3d space

bronze yoke
#

unfortunately the game doesn't have a 3d world at all

mystic rose
#

i thought it was 3d? as the guns in game appear so

bronze yoke
#

it does render some things in 3d but there isn't a 3d world, those are 3d models rendered on top of the 2d world

mystic rose
#

ah i see how its done a bit more

#

im assuming anything that rotates is 3d but everything like the ground and buildings are 2d textures?

bronze yoke
#

yeah, pretty much

mystic rose
#

figuring out how the game works makes it easier for me to mod stuff in the long run

gilded hawk
#

Are you 100% this works? it does not look like it's being triggered in my code

mystic rose
#

hmmm i wonder if theres a way to get and set camera zoom amounts...

bronze yoke
#

if you mean changing the specific zoom levels, no

mystic rose
#

damn

gilded hawk
#

Like, I have followed your example but notthing happens

CasualoidUtils = {}

function CasualoidPrint(...)
    if not isDebugEnabled() then
        return
    end
    local arguments = { ... }
    local printResult = ''
    for _, v in ipairs(arguments) do
        printResult = printResult .. tostring(v or 'nil') .. " "
    end
    print('Casualoid:' .. printResult)
end

CasualoidUtils.patchClassMethod = function(class, methodName, createPatch)
    CasualoidPrint('CasualoidUtils.patchClassMethod', methodName)
    local metatable = __classmetatables[class]
    if not metatable then
        error("CasualoidUtils.patchClassMethod: Unable to find metatable for class " .. tostring(class))
    end
    local metatable__index = metatable.__index
    if not metatable__index then
        error("CasualoidUtils.patchClassMethod: Unable to find __index in metatable for class " .. tostring(class))
    end
    local originalMethod = metatable__index[methodName]
    metatable__index[methodName] = createPatch(originalMethod)
end

CasualoidUtils.patchClassMethod(TraitFactory.class, "addTrait", function(addTrait)
    return function(...)
        local args = { ... }
        local traitId = args[1]
        print('traitId' .. traitId)
        if args[1] == "Asthmatic" then
            return Trait.new("", "", 0, "", false, false)
        end
        return addTrait(unpack(args))
    end
end)
bronze yoke
#

it's quite a popular mod idea and unfortunately it's only been found to be possible with java modding

mystic rose
#

i was trying to make it so i forced zoomed when wearing an item..

bronze yoke
#

if you want to force the player to be at a specific vanilla zoom level it should be fine

#

i think there's a longsighted mod that forces you to be zoomed all the way out while not wearing your glasses

mystic rose
#

but anything path vanilla is a no go

bronze yoke
#

yeah, you can't change the actual zoom levels

mystic rose
#

pain

#

how much more in depth is java modding? like is there a limit to what you can do there too?

bronze yoke
#

not really, but there's very little support for it

mystic rose
#

i have no idea how java works so

bronze yoke
#

your mods have to be manually installed and you'll just be rebuilding the game source with your changes

#

there might even be legal issues with redistributing them because of that... not sure

mystic rose
#

yeah im not sure thats a thing id even try

#

wish there was more players could do with cameras and such, could be very cool

#

time to go back to experimenting

gilded hawk
#

@sour island Chuck, I tried to use your metamethod overwrite but I'm having no success

-- Based from: https://github.com/Project-Zomboid-Community-Modding/pz-community-modding/issues/38

local _metaMethodOverwrite = {}

_metaMethodOverwrite.addTrait = function(original_fn)
    return function(self, ...)
        local args = { ... }
        print('args[1]'..args[1])
        local originalReturn = original_fn(self, unpack(args))
        return originalReturn
    end
end

function _metaMethodOverwrite.apply(class, methodName)
    local metatable = __classmetatables[class]
    local metatable__index = metatable.__index
    local originalMethod = metatable__index[methodName]
    metatable__index[methodName] = _metaMethodOverwrite[methodName](originalMethod)
end

_metaMethodOverwrite.apply(zombie.characters.traits.TraitFactory.class, "addTrait")

It never prints the 'args[1]'..args[1] do you have any idea why?

mellow frigate
#

Hello there, anyone has insights on when to use getSquare and when to use getCurrentSquare for a player ?

fast galleon
spice saddle
#

So i've been able to access IsoPlayer object through LuaManager GlobalObject. How would I go about getting IsoGameCharacter object? I'm interested in inventory items which is accessible via IsoGameCharacter but how to get IsoGameCharaceter from IsoPlayer? Or am I going about the wrong way stressed

gilded hawk
fast galleon
#

oh, sorry I just got back, you're probably right

gilded hawk
#

No worries, anyway. As I said earlier, the interceptor is not being triggered at all

mellow frigate
fast galleon
#

Is the patch printing? CasualoidUtils.patchClassMethod

mellow frigate
#

so all interface from IsoGameCharacter can be called from IsoPlayer

frank elbow
#

I can't imagine why they wouldn't be the same reference so I'd be very surprised if this worked, but have you tried just TraitFactory.class

gilded hawk
frank elbow
#

As opposed to zombie.characters.traits.TraitFactory.class, just TraitFactory.class

gilded hawk
#

Sure I can try that

gilded hawk
#

I think this happens because media\lua\shared\NPCs\MainCreationMethods.lua is loaded before my lua file. And I can't intercept the traits yet

frank elbow
#

The traits are added in an event handler for OnGameBoot, so I wouldn't think that'd be an issue

sour island
#

They have to be exposed to be intercepted - is it?

gilded hawk
#

this.setExposed(TraitFactory.class); java\Lua\LuaManager.java

#

Looks like it is

#

Wait, is the fact that addTrait is static a problem?

#
   public static Trait addTrait(String var0, String var1, int var2, String var3, boolean var4) {
      Trait var5 = new Trait(var0, var1, var2, var3, var4, false);
      TraitMap.put(var0, var5);
      return var5;
   }

   public static Trait addTrait(String var0, String var1, int var2, String var3, boolean var4, boolean var5) {
      Trait var6 = new Trait(var0, var1, var2, var3, var4, var5);
      TraitMap.put(var0, var6);
      return var6;
   }
sour island
#

Is it characters in the classes?

gilded hawk
#

Yes? java\characters\traits\TraitFactory.java

sour island
#

Not on a computer so just eyeballing it

gilded hawk
#

No problem mate

#

🤗

sage eagle
#

@heady crystal

frank elbow
#

I can see why Kahlua wouldn't add static methods to the class metatable, so you may be onto something there

sage eagle
#

add hairspray flamethrowers to common sense

frank elbow
#

Feature requests is not what this channel is for lol

gilded hawk
#

👏

sour island
#

Love the no context ping and actual content in another message

#

Very baller

fast galleon
#

Right, so you would just patch the normal function

frank elbow
#

@ chuck

#

add planes to EHE

gilded hawk
#

@ Chuck add railgun to EHE

sour island
#

Even decorating the java calls works on calls from Lua

#

Doesn't get applied to calls made in java

#

If there's something in the global table that can be overwritten it should be done there

frank elbow
#

If it's static they may not be present in the class metatable since instances wouldn't necessarily need it—if that is the case, what poltergeist said should work unless it prevents overwrites (idr whether it does)

gilded hawk
#

Tbf, I could do what I did for my tmog mod and directly override the function

  local backupGetAllItems = getAllItems;
  getAllItems = function()
    -- Funny code here
  end

  ISItemsListViewer.initList(self);

  -- put the original function back in it's place
  getAllItems = backupGetAllItems;
mellow frigate
#

I intend to use InventoryItem:getId() to identify uniquely an item instance on a server. Is that the way to go or should I use something else instead ? are those IDs recycled or really unique ?

gilded hawk
#

@frank elbow @sour island @fast galleon

This WORKS 🎉

local oldAddTrait = TraitFactory.addTrait

print('YOLO')
TraitFactory.addTrait = function(...)
    local args = { ... }
    print('args[1]'..args[1])
    return oldAddTrait(...)
end
#

So, this is bad but it works, sooo, it's not bad?

wet sandal
#

Oh cool, didn't know you could capture ... args like that into a table

gilded hawk
#

It's quite cool! I learned about this recently! It's like the desctructuring in javascript, but a bit worse

frank elbow
#

Beware cases where any of those can be nil, since it'll discard it & any after that; select is useful for those cases

gilded hawk
#

I'm a bit confused what are you referring to?

frank elbow
#
local function f(...)
  return {...}
end

local function g(...)
  local t = {}
  for i = 1, select('#', ...) do
    t[i] = select(i, ...)
  end
  return t
end

f(1, nil, 3){1}
g(1, nil, 3){1, nil, 3}

gilded hawk
#

oooooooooh

frank elbow
#

I just tested that in 5.4 and both resulted in the second table, so maybe I'm completely wrong ? I'll have to try it with 5.1 and see

gilded hawk
#

Okay I understand now. But I can still do oldAddTrait(...) and have the ... still spread the nils, and values correctly right?

frank elbow
#

Yes, if used directly it'll be fine

gilded hawk
#

Alright 🫡

#

Thank you and I'll look into it 😄

#

Okay, different question.

How does Events.OnGameBoot work when you connect to a MP server?
Like, if Events.OnGameBoot is only fired in the main menu, why then you can still use custom trait mods when you connect to an MP game, even if you don't have the mod enabled before connecting to it?

frank elbow
#

A quick search of the source suggests that, on the client, it's fired when resetting Lua, when exiting the ingame state (likely return to main menu or desktop), or as one of the first steps when initializing the game thread. These occur in both SP and MP, particularly that last one

fast galleon
#

you only get the 1

frank elbow
#

Maybe that's what I was thinking of; my memory is clearly going 😄 thanks

spice saddle
gilded hawk
frank elbow
#

unpack also accepts arguments that specify the start and end indices

#

It's not necessarily unsafe if nil is not an acceptable argument (rather, if it's contiguous), but you can use those to be safer

fast galleon
#

main issue is with function that have 0 to 5 arguments and adding nils or removing args causes issues

gilded hawk
#
TraitFactory.addTrait = function(...)
    local args = { ... }
    local traitId = args[1]
    if noobTraps[traitId] then
        CasualoidPrint('Noob trap detected, remove it', traitId)
        -- oh no! I need to swap this with a dummy trait!
        return oldAddTrait("", "", 0, "", false, false)
    end
    return oldAddTrait(unpack(args))
end
LOG  : General     , 1685728735620> Casualoid:Noob trap detected, remove it Asthmatic 

I think this works well enough 😄

#

Can't trust my newbie friends to not cripple themselves with bad traits 😅 🤣 (again)

gilded hawk
mystic rose
#

so does player:getPosition give me the positions x and y?

cursive coral
#

I need help...

bronze sand
#

Would it be possible to have a vehicle with a container that has only one item inside, which can be equipped by the player, but, has the restriction of Not allowing the player to leave the vehicle with the item in their inventory?

#

If the item was some kind of weapon, would it be possible to equip it without it going into the player's inventory?

finite parcel
#

Hi, I am creating new "Carpentry" items... I took reference from ISWoodenContainer and made my own canBuild function for solar panels and made context menu for it. For sprites I used crate sprites since I dont have my own rn but main problem is when I place it on ground it creates object named Crate and not Solar Panel(I also named it in code) + when I dismantle it it gives me plank... is there something I need to change because I dont see any settings for it... Firstly I thought it is selecting by sprite name (but its kinda weird for me)...

mystic rose
#

does this really not have any use? it is using x,y, and surprisingly Z

#

how i gotta figure out how to print their values to see if they ever update

bronze yoke
#

the class is literally never instantiated

#

the unused turn based code instantiates it but the turn based stuff is barely more than stub - it was probably intended for whatever that was going to be

#

looking around it it seemed like it was intended as a way to control the position of the camera from lua, but it's such a skeleton that i don't really expect it to work

mystic rose
#

well i doubt it would work, but by the dummy type, it could be what the camera is attached to so having more control over the camera is the dream

#
    print("Current Camera Position: X: "..IsoDummyCameraCharacter.getOffX().." Y:"..IsoDummyCameraCharacter.getOffY().." Z:"..IsoDummyCameraCharacter.getOffZ());
```kinda hoping it was this easy, its not lol
#

i might be misunderstanding, but what im wishing/hoping for is that its used in some magical way, idk man im just wanting more camera control as having a Z axis could be very interesting for multiple reasons such as ADS

mellow frigate
#

@TIS could you make IsoMarkers rendered even for players on different levels? (depending on some Line Of Sight check)

red tiger
#

There's a lot of dead code in the docs.

mystic rose
#

seems so, but its always cool to try to find what still has a unintended use

mystic rose
#

wonder if i can lock the camera to the player to prevent anyone from looking around...

ancient grail
ancient grail
ancient grail
trim mist
#

Could anyone give me a lead as to why TraitFactory is throwing an error here? on TraitFactory.getTrait(traitname)

--Uses alphanumberic symbols and commas only.
TraitTags.add = function(traitName, tags)
    local globalTagTable = ModData.get("TraitTags");
    local sanitizedTags = TraitTags.sanitizeTags(tags);
    local tagTable = {};
    if TraitFactory.getTrait(traitName) ~= nil
    then
        if globalTagTable[traitName] == nil
        then
            print("Trait Tag Framework: Initializing entry for "..traitName.." in TraitTags")
            globalTagTable[traitName] = {};
        end
        if string.len(sanitizedTags) > 0
        then
            tagTable =  string.split(sanitizedTags, ',');
            print("Trait Tag Framework: adding tags "..sanitizedTags.." to "..traitName.." entry.");
            globalTagTable[traitName] = tagTable;
        else
            print("Trait Tag Framework: No tags detected for "..traitName..", skipping...");
        end
    else
        print("Trait Tag Framework: Cannot find trait "..traitName..", skipping...");
    end
end
bronze yoke
#

traitName is most likely not a string

trim mist
bronze yoke
#

what you're feeding it isn't a string

trim mist
#
require("NPCs/MainCreationMethods");
local TTF = require("TraitTagFramework");
...
local function initAnthroTraits()
...
   TTF:add("KeenHearing", "Anthro,KeenHearing");
...

That first TTF:add is what it's erroring out on

bronze yoke
#

the use of a colon is passing TTF as traitName

trim mist
#

OH MY--

#

hold on. let me try changing that

#

yep. That was it. Thank albion 🤦‍♂️

#

Anyone have examples of the use of ModData (the global one)? Try as I might to access ModData it seems to be giving me nils

#

or @bronze yoke you mentioned that using global ModData to keep track of this table was unnecessary to keep it persistent. Do you have another suggestion if I can't figure this out?

bronze yoke
#

i just don't think it needs to be persistent in the first place

#

it should regenerate itself the same every time

#

a typical usage of global moddata is just like:```lua
local myModData = ModData.getOrCreate("MyKey")
myModData.foo = "bar"

cursive coral
# ancient grail <:moreinfo:850460523313102898>
item MetalsmithTable
        {
            DisplayCategory = Item,
            Weight    =    30,
            Type    =    Normal,
            DisplayName    =    Metalsmith Table,
            Icon    =    MetalWorkbench,
            MetalValue = 1,
            WorldStaticModel = MetalsmithTable_Ground,
        }
    recipe Make Metalsmith Table
    {
        keep [Recipe.GetItemTypes.WeldingMask],
        keep [Recipe.GetItemTypes.Hammer],
        keep [Recipe.GetItemTypes.Saw],
        SheetMetal=5,
        BlowTorch=2,
        Result             : MetalsmithTable,
        Sound             : Welding2,
        Time             : 1000,
        SkillRequired     : MetalWelding=2,
        OnGiveXP         : Give25MWXP,
        AnimNode         : BlowTorchMid,
        Prop1             : BlowTorch,
    }
#

this my mod but not crafting

trim mist
#

and the full line of the log, it's cut off in the picture

cursive coral
#

ha okey wait

#
ERROR: General     , 1685731017219> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: texture of non-table: null at KahluaThread.tableget line:1689.
bronze yoke
#

one of the items in your recipe can't be found

trim mist
#

they all have what?

#

and they say what?

cursive coral
#

sorry i wrote it in the wrong place.

#

So all true, why such a mistake?

drifting ore
#

Why does this code work if I haven't defined what "player" is?

bronze yoke
#

you or another mod probably accidentally made a player global somewhere

#

or it's local to your file scope or something

drifting ore
#

damn, need to fix that shit, thanks!

ancient grail
#

How did you figure this out

#

Like you tested and it work

#

I mean

#

I dunno how to phrase my question ...

drifting ore
#

I had some people complaining on a mod so I finally disabled all mods and tested the mod in question alone and I kind of figured it was some global variable somewhere. I wanted confirmation from this channel as well 😄 As you know : I think everything related to coding is magic 🧙

sour island
#

Someone had a big brain moment and made a global player = getPlayer()? 🤔

trim mist
#

Can anyone tell me why this function thinks the passed variable is itself, and not what I provided?

bronze yoke
#

sounds like unwanted colon usage

trim mist
#

line 233, when I pass player:

trim mist
#

but then I get here and it says that player is actually the TraitTags object

#

I made sure I wasn't using a colon so I'm kind of confuzzled

#

The only thing I could think of is the "self" I put on line 233, but how else do I reference that function I need?

bronze yoke
#

if you're not using a colon, self shouldn't have any meaning, so i'm not sure why self.getPlayerTagStatistics() is even valid

#

you'd just use TraitTags.funcname instead of self:funcname

trim mist
#

but that's originally what I had and it did the same thing

#

let me reload the whole game and see if this is just something that can be resolved by that

trim mist
bronze yoke
#

the function is getting called, so it is valid, but i don't understand why it is

trim mist
#

when the original error was that my return value couldn't be automatically concatenated into a string 💀

#

I swear though, it said it was returning nil but I can't get that to reproduce.

bronze yoke
#

debugging drunk

trim mist
#

It's 100% my least favorite part of coding

red tiger
#

Debugging is a whole different skill to master.

#

Debugging is hardest when either you assume something is correct or a library you call assumes that something is correct.

#

98% your assumption

#

Debug test code in smaller bites. Evaluate parameters and calculations. It'll save you time.

weary matrix
#

well not to mention once you triggered an error you have a high change your code won't be working properly unless you quit and reload the game

bronze yoke
#

lua reloads are usually enough

weary matrix
#

depends how you reload lua

bronze yoke
#

i never reload single files

weary matrix
#

so I played zomboid, it's been a while. I can see the game is getting more and more bugs along new versions 😂

#

I can't prevent myself to imagine an inversed changelog like:
So for this version we decided to break this and that subsystem because it's more fun!

#

😂

trim mist
#

when you're in game

thin hornet
#

you cant

bronze yoke
#

not midgame

trim mist
#

dang okay

thin hornet
#

You back out to menu then load again

bronze yoke
#

what i do is turn off my mods on the main menu so that lua reloads whenever i reload the save

thin hornet
#

To load faster in, you can start a game with no zombie, it load much faster. But of course if you dont need zombies in your mod.

fading horizon
ancient grail
#

Is it possible to mod the camera pan?
Like infinite panning

fading horizon
#

Make the character invisible and have them teleport along the panning path

#

When they stop panning, teleport back to original spot

#

That's how I would try to do it

mighty ether
#

Hey, I don't know if I'm just missing it on the java docs or I'm doing something wrong, but is it possible to write modData on the player server side, then allow the client only read it?

tranquil kindle
#

Could someone tell me if while making new firearm item is there diffrence between X files and FBX files in terms of visibility of attachments? I added my model in FBX as new item but no matter what i did i couldnt get attachments to appear on model with player (it was visible in attachment editor in debug mode), so i tried overriting m16 that had x8 scope on it. Vanila m16 has 8xscope model where it should be, but once i changed only model to my FBX one it was nowhere to be seen, no floating, nothing. Making new model of attachment with new item attachment aswell appear in attachment editor, but not on playermodel while playing? Neither the attachment or muzzle flash are visible.

weary matrix
mighty ether
#

For more context, I’m making a mod with various medkits, if the player is healing at a rate equal to greater than the rate of the medkit they are trying to use, it won’t let them

weary matrix
mighty ether
fair crater
#

I'd like to try my hand at creating new TV channels / Radio channels for players who'd like some extra lore, or general entertainment to listen to. Would anybody know how to go about doing this? Never modded a game before and I'm really throwing myself into the deep-end with no experience here.

weary matrix
#

@fair crater I don't know but all the text for TV/radio channels are in shared/Translate. Search for one, get the textID and then search the textID in the code to see how it's used

sour island
#

Wasn't there a tool for tv/radio?

bronze yoke
sour island
#

Using the item on the ground would cause modData desync - so probably make sure it occurs in hand

bronze yoke
#

also, transmitmoddata is not relevant to players, their moddata is automatically synchronised and transmit doesn't even work on them

bronze yoke
sour island
#

Oh I thought he was giving a value to the bag - nvm morning brain

spice saddle
weary matrix
#

Nice! I have a working poc of ModGuardian where both ModGuardian and the mod using it are encrypted 😄

#

of course the loader is only obfuscated, but I don't see any way around that

#

@sour island 😄

fading horizon
somber rivet
#

Pirate

fading horizon
#

i made a leg amputation item using m_mask in the .xml

#

however

#

shoes don't care about clothing masks

#

so you still get a shoe on the amputated side

#

anyone have any ideas on what i could do to fix this

fading horizon
#

i'm working on that mod right now

#

haha

#

that's what this is for

#

its because it was a modded shoe lol

#

works with vanilla shoes

weary matrix
#

I'm curious what happen if you remove the shoes from your character, does it work then?

fading horizon
#

works if its not a modded shoe

#

so any vanilla shoe works

#

amputation + wheelchair

lyric turtle
#

Wheelchair trait moment becoming reality

drifting ore
#

i need some help

#

so im trying to make a moodle and the coding doesnt work it says error 1,2,3,4,5

#

and it make me frustrated

#

can someone please help me

#

and yes its two mod combind its the insanity one and the cannot attack'

fair crater
weary matrix
#

full stack trace if possible

drifting ore
weary matrix
# fair crater I appreciate the reply, but, I'm entirely dropping myself in here without any cl...

While in game, listen to some radio or TV channel, take note of some part of the text, then search that text in all files under the media/ folder of your zomboid install directory (steam). It should give you some lines like:

Some_Identifier = "The text you search for"```
Then search for `Some_Identifier` (replace with the actual identifier) in all .lua files. It should show you where it's used and how to use it.
fair crater
drifting ore
#

of the game

weary matrix
sour island
#

Also at the top there is a checkbox and play button. Uncheck the checkbox and hit the play button.

ashen pine
#

how do i make 1,0 and 2,0 goto the other side?

potent garden
#

If someone who has experience with modding in custom foods and drinks, please let me know. I'd want a mod created, and I am willing to pay you

eternal garnet
mellow frigate
#

Hello there, any Global Object specialist around ? When I remove a global object on solo it's all good. when I remove a global object in MP, the luaObject is removed (both Server and Client sides), but the isoObject remains on the world (at least client side). last info known on the server is that transmitRemoveItemFromSquare(isoObject) returned 1 (which is the position of the said isoObject in the square array, see pic from the client side). Last info known on the client is the call to my CGlobalObjectSystem removeLuaObject that seemed successful (size of lua GO array confirmed to be 0). Any cue is welcome, and I mainly wonder who is responsible for removing the isoObject on MP client side ? (both when the isoObject is loaded client side at removal time and when it is not)

ashen pine
#

howw do i use place walls in tilezed?

low basin
low basin
#

If you need extra walls to divide a room you can use the 'place walls' and select trim,int walls, ext walls to customize them from the panel on the right.
However if you click on the red/blue/green cube you can set up default walls by room and establish the internal name there as well.

  • You can also use the 'Place Walls' and select 'None' in that right panel if you want to 'erase' walls for an open floor plan.
ashen pine
#

ok

fast galleon
#

You may have issues if you try removing a 2nd tile object because it's hard to sync the indexes

mellow frigate
#

More info: after quit and join again the isoObject has disappeared

mellow frigate
#

I may simply add client isoObj removal, but it seems redundant and it requires the grid to be loaded.

#

and also CFarming /CPlant does not do that.

#

My isoObj specificity is that there is no sprite but as removal works in solo I guess it should be also ok in MP

fast galleon
#

What are you sending from client? I think it should be remove isoObject and transmitRemoveItemFromSquare. Then server does everything automatically.

mellow frigate
#

I am sending a client command sendClientCommand, both for adding and removing, like it is done for CFarming. All isoObj life control is done server side.

#

In fact I create 2 objects initialy instead of 1. so deletion seems to work, deleting only one. it is the creation that I must analyse. my bad

#

I may be back crying in a few hours. angry

wary sonnet
#

How do annotated maps work? Is the reference generated upon looting the map? So if I get a map that says a house has guns. Does the game then decide to spawn them there?

ashen pine
#

anyone know where the big lights are in BuildingEd?

wary sonnet
weary matrix
mellow frigate
bronze yoke
fast galleon
ancient grail
#

Thnx boss @eternal garnet

eternal garnet
ashen pine
#

how would i add a building here?

#

im in tileEd btw

low basin
# ashen pine im in tileEd btw

Buildings are added in WorldEd, Go to #mapping for stuff related to WorldEd and TileEd Many of these questions already have comprehensive guides and/or answers posted so you won't have to wait for someone to come back with answers.

red tiger
drifting ore
mellow frigate
#

At login, my client does not receive a GlobalModData update, what is the right way to get it ? (I would like not to force Global Data synchro to all clients, just the the new one).

nimble spoke
weary matrix
novel barn
#

I've got (what is hopefully) a quick question about table.insert(). I'm trying to burn a body part which I can do in the lua console with getPlayer():getBodyDamage():getBodyPart(Hand_L):setBurned() but when I unpause the game the damage disappears. I'm guessing I need to write this data to either a player table or a moddata table. Without telling me what table it goes on, how can I determine WHERE this data needs to be written? Or is this just a matter of "You kinda just need to know where it goes."? I'm assuming it needs to be inserted because I'm digging through the More Traits mod and that's how it's being done there.

Update: I had GodMode on and everytime I unpaused GodMode would kick in...

weary matrix
novel barn
weary matrix
#

Ok so it's probably not related to transmitting moddata

fast galleon
mellow frigate
fast galleon
#
-- TimedAction and UI code should call this repeatedly to keep this luaObject
-- in sync with the isoObject, which may be updated at any time.
function CGlobalObject:updateFromIsoObject()
mellow frigate
#

I'm on another part involving GlobalModData aka ModData

fast galleon
#

oh

#

wait

#

ModData.request("...") and Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)

somber rivet
#

how can I fix this? Im loading in my own map and I got this error in the console.txt ERROR: General , 1685817644774> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: can't create player at x,y,z=456,506,0 because the square is null at IsoWorld.init line:2799.

mellow frigate
somber rivet
#

how do I know if it is valid?

mellow frigate
weary matrix
somber rivet
weary matrix
somber rivet
#

got the same message this time even after changing the spawn WARN : General , 1685818432139> SpawnPoints.initSpawnBuildings> initSpawnBuildings: no room or building at 456,546,0 ERROR: General , 1685818432144> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: can't create player at x,y,z=456,546,0 because the square is null at IsoWorld.init line:2799. ERROR: General , 1685818432145> DebugLogStream.printException> Stack trace: java.lang.RuntimeException: can't create player at x,y,z=456,546,0 because the square is null at zombie.iso.IsoWorld.init(IsoWorld.java:2799) at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268) at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225) at java.base/java.lang.Thread.run(Unknown Source)

bronze yoke
#

is this a custom map? these co-ordinates are very far from the vanilla map

mellow frigate
novel barn
#

[SOLVED] I had unchecked everything in the debuglog menu of the f11 view.

different question. I can read a table in the lua console with something like this

mod_data = getPlayer():getModData() for k,v in pairs(mod_data) do print(k) end

but it's annoying seeing the output just 11 lines at a time. I've been trying to find my print output in any log files but can't. ***Is there a way to force console.txt or debuglog.txt to capture lua commands that are run in real time? ***

bronze yoke
#

it should already

#

console.txt anyway, i don't look at the other log files

novel barn
#

I've even tried just "print(hello world)" and a ctrl-f for hello world and can't find it. I've confirmed the logs have updated since I ran the last print.

mellow frigate
novel barn
#

completely closed and reopened the file in my editor too. closed the file, printed statement, waited for file to update, reopened it.

mellow frigate
#

Then I guess your code does not run

bronze yoke
#

if you see it in debug console it must run, maybe i'm mistaken about that going to console.txt

novel barn
#

I'm running print(hello world) in the lua console. 😦 I know the code is running.

bronze yoke
#

i don't know the exact syntax for it but you can write to clipboard, then paste and read that, or write to your own file

novel barn
#

hmmm writing to my own file is a good idea. I'll just look into that.

neon bronze
#

anyone knows what OnGrab does for recipes?

potent ibex
bronze yoke
#

it seems kind of redundant with ontest, i don't think vanilla even uses it

novel barn
#

@bronze yoke and @mellow frigate thanks for the help. I figured out the problem... I had unchecked just about everything in the debuglog menu. I rechecked everything and data is flowing in again. I must have unchecked everything last week when I was trying to figure out how to get the command console to reopen.

neon bronze
#

Still very interesting legacy thing

bronze yoke
#

i mean when grabbing the ingredients

neon bronze
#

Oh is it when you pick stuff from your inventory and backpacks and such?

bronze yoke
#

yeah

#

i can't really imagine anything you would want to do then that you wouldn't want to do ontest

neon bronze
#

True

low basin
#

Is it possible to require an item in a recipe to be cooked to perform the recipe, I have yet to find an example of this or find a way to do so.

red tiger
neon bronze
warped valve
#

Is there a way to get a grid square clientside when the cell isn't loaded for the client?

thin hornet
thin hornet
warped valve
low basin
trim mist
thin hornet
warped valve
#

If I can get the door on the square serverside then I should be able to do what I need to do serverside

#

(which is validating leases by removing someone's auto billing if they're no longer a leaseholder or removing duplicate leases)

bronze yoke
#

you could just save them in global mod data by co-ordinate

warped valve
#

I'm assuming that's possible

bronze yoke
#

not object moddata, global moddata

#

that way it wouldn't really be tied to whether the square is loaded or not

warped valve
# bronze yoke not object moddata, global moddata

I'm using both right now. My global mod data has everyone's leases with coordinates of the door their lease was activated on, and the object mod data stores required info (e.g. key ID, who's renting what, whether it's for lease or not, lease price, etc.)

warped valve
#

There'd just be a lot of networking between the client/server

drifting ore
#

how do you make a player more tired,sad,start dying slowly

low basin
#

Someone willing to enlighten me on how much of an idiot I am? I apparently can not figure out how to create the OnTest function to force an item to need to be cooked in order for the recipe to be valid. Yes, I looked at the Github and PZWiki guides and have got nowhere.

bronze sand
#

Is it possible to combine different lootables so a server has the same likelihood of spawning weapons in a crate with a ton of mods that it does in vanilla?

#

Or, the likelihood when there's only a couple of weapon mods as opposed to having 8?

mellow frigate
#

Hi, do you have any idea what I should do to ensure a teleport called during OnUpdatePlayer is not reversed by vanilla ? (destination out of the current cell, my player is teleported back to the center of its previous square) I currently do the teleport on next OnTick and it works but I wonder if there is a better way.

bronze yoke
bronze sand
#

How would that work?

#

I wish we had a mod for that

#

So we can add as many Melee Weapon Packs as we want

#

And there are a lot

bronze yoke
#

i've been thinking about making an api for it since i've spent so much time making stuff like that already but i haven't had the time yet

mellow frigate
ancient grail
low basin
bronze yoke
ancient grail
#

If you want you can ad delays between checks or turn of the on playerupdate as soon it teleports

bronze yoke
#

most likely the name of a food in this case

mellow frigate
ancient grail
#

you can bind it on a keypress i guess

#

for long sword mods

mellow frigate
#

I need it to be controlled by the model

ancient grail
#

you can look at fast move i guess

low basin
#

I replaced "Food" with the item name already if that is what you are referring to and it still throws a thousands errors complaining about the function not existing

bronze yoke
#

either your file is not loading or your script references your function wrong

mellow frigate
# ancient grail like fast move?

yes, like fast move, like all teleports (map, minimap). it seems not to work reliably from OnPlayerUpdate when the target square in not loaded

low basin
#

I am going to be honest I have no idea what I am doing at this point and the function script in the lua may be completely wrong. The goal was to force the item "NWCookingPotOfKetchup" to be cooked before the recipe to put it into bottles was executed. At this point it stopped throwing errors for the function itself and has just broken the craffting UI until it wont even open.
function Recipe.OnTest.KetchupIsCooked(item)
local itemType = item:getType()
if itemType == "NWCookingPotOfKetchup" then
if item:isCooked() then return false; end
end
return true;
end

bronze yoke
#

if the crafting ui won't open the recipe is broken elsewhere

#

i've seen that happen when an item in the recipe doesn't exist

#

Result : Base.Ketchup=4, is not valid

#

a recipe can have exactly one result, you must use an OnCreate function if you want more

#

the ui is breaking because it's looking for an item called 'Base.Ketchup=4' for the preview

#

oh-

#

no, apparently i'm wrong, you can do that

#

weird, i could swear i've seen people using oncreates to get around that - you do need them for recipes that make more than one kind of item

low basin
#

Multiple Items, Like the empty pot + the ketchup would be an issue for sure. I will change it just to see what happens

bronze yoke
#

you can have multiple sources fine

low basin
#

If I tried to have it give me a Pot+the Ketchup from the ResultItem it wouldnt work
I also had an issue with putting destroy in front of the destroyed items making it not register the first item in the list and keep wouldnt work at all

bronze yoke
#

multiple sources is fine, multiple results of differing types isn't

#

and the ui is still broken? no function issue should be able to cause that

#

yeah, that's a classic 'item not found'

#

it's trying to call getFullType on an item, but the item is null because it was failed to be found

low basin
#

So then in theory the item is borked?

bronze yoke
#

either the item is borked or there's a mistake in the recipe

#

in my experience it's always been the latter: does the item show up in the debug spawner?

low basin
#

All 3 the empty Bottle, The Pot of it, and the completed product. Oh for whatever it is worth I overwrote the vanilla ketchup bottle to have it give you an empty on use

bronze yoke
#

then the mistake must be in the recipe, no matter what's up with the item that should work so long as the game has loaded it, which it clearly has

low basin
#

Both recipes in relation to the pot It helps when I find the right thing.
recipe Prepare A Cooking Pot Of Ketchup
{
Base.WaterPot, Base.Salt;2, Base.Sugar;2, farming.Tomato=6,
Result : NWCookingPotOfKetchup,
Time : 100,
OnGiveXP: Recipe.OnGiveXP.Cooking3,
Category: Cooking,
AllowRottenItem:false,
}

recipe Pour Cooked Ketchup Into Bottles

{
NWCookingPotOfKetchup, KetchupEmpty=4, Base.Spoon,
Result : Base.Ketchup=4,
Time : 100,
OnCreate : Recipe.OnCreate.BottleKetchup,
OnGiveXP : Recipe.OnGiveXP.Cooking3,
OnTest : Recipe.OnTest.KetchupIsCooked,
Category : Cooking,
AllowRottenItem :false,
}

#

Idk I do not see a problem, not that that is saying much. I have half a mind to just write it off as a skill limitation and axe the cooking aspect. Thanks for the help Albion.

golden apex
#

Anybody know how i could give my servers players unlimited carry capacity for a limited time without having to give them full admin privilages? is there a mod for that anyone knows of?

trim mist
#

Anybody know why this doesn't have a size property? I thought all tables did

#

Here's what it looks like

bronze yoke
#

java arrays have size

#

lua tables have the # operator (#AnthroTraitsGlobals.UnwieldyHandsAffectedTimedActions)

bronze yoke
#

also if you're looping through a lua table you probably want to do for i = 1, length instead of for i = 0, length-1 since they're 1 indexed

trim mist
#

That doesn't work either... 😰

#

It says it's calling nil

#

If niether are working, I suspect that I defined the table wrong so it isn't recognized as a table or something

#

It's got all the commas though. and the strings seem appropriately wrapped in quotes?

bronze yoke
#

the definition looks correct to me

bronze sand
#

Could someone please make a Diagonal Log Walls Mod?

#

I don't care if they have a full 1 Tile Hitbox

#

I don't care if there's no placement of any other object next to them

#

I just want diagonal Log Walls to accomodate for irregular terrain

trim mist
#
local OriginalTimedActionCreate = ISBaseTimedAction.create;
ISBaseTimedAction.create = function(self)
    OriginalTimedActionCreate(self);
    local atg = AnthroTraitsGlobals;
    local timedActions = atg.UnwieldyHandsAffectedTimedActions;
    local uwu = timedActions:size();
    local n = table.getn(timedActions);
    print(#timedActions);
    print(uwu)

could it be that this isn't working because i'm hooking into the original function, and it doesn't have that?

#

even the table library doesn't work

#

it's "oops! All nil"

#

lol

#

I guess I can try pairs?

bronze yoke
#

i don't think getn exists in kahlua

#

i could be wrong but i went through the kahlua library stuff a while ago and i don't think i've even heard of getn before

#

(though google does confirm that it does exist in normal lua)

#

i wonder if omar's stubs include it

#

nope, only the kahlua original stuff (as it probably should)

trim mist
#

I've had table.add work. Table.create, etc

#

:S

#

pairs worked 🤷‍♂️

weary matrix
#

I couldn't find getn either

#

hum, so I have a Lua popup that derives from ISPanelJoypad. In the render() method i do this:

self:drawTextCentre(getText("UI_ModGuardian_Title"), self.width / 2, 10, 1, 1, 1, 1, UIFont.Title);```
In `media/lua/shared/Translate/EN/UI_EN.txt` I have this:

UI_ModGuardian_Title = "ModGuardian"```
Yet when my popup is shown the title is UI_ModGuardian_Title instead of ModGuardian.
Any clue what I could be doing wrong?

#

I'm doing the exact same thing for other strings which are correctly replaced, so I'm a bit at a loss here

bronze yoke
#

is the file formatted correctly with the UI_EN = {? (or whatever the correct one happens to be, since they don't always match the filename)

weary matrix
#

oh my, actually no, thanks

#

but how come it's working for the other strings in the same file though?

bronze yoke
#

iirc the whole thing is pretty much fake

weary matrix
#

it's not really parsing the header?

bronze yoke
#

i caught some of them just ignoring the first line, but i also remember some not working because of the wrong header

weary matrix
#

so it just skip the first line or something?

bronze yoke
#

so it's inconsistent between them

weary matrix
#

i see

bronze yoke
#

maybe they were actually lua files in the past or something

#

otherwise the dedication to pretending to be a lua table seems really odd

weary matrix
#

looks like Lua and JSON had a malformed kid to be honest 😂

#

hum and what about this:

local message = getText(self.text, self.config.modID) .. "\n\n" .. getText("UI_ModGuardian_Warning")
self.richText:setText(message)
``` It is rendered correctly, except for the "\n\n" which are displayed as is
bronze yoke
#

hmm i remember it working differently in different places (again), try <BR>

weary matrix
#

oh, good idea

#

let's see

weary matrix
bronze yoke
#

nice!!

weary matrix
#

still one mystery remains though, I replaced \n\n with <BR>\n\n<BR>, but the \n are not visible anymore 😂

#

it's not really a problem but it still feels weird

#

Nice! My stuff is very close to be fully working and usable by others 😄

trim mist
#

Question for you all. I found the timed actions "ISClimbOverFence", "ISClimbSheetRopeAction", "ISClimbThroughWindow", etc.

Is there a way to make these go faster?

#

maxtime doesnt seem to affect them, or at least these actions don't get created

weary matrix
#

maybe I'm wrong though

bronze yoke
#

these things are usually heavily tied to the speed of the animation itself, yeah

#

it's not something i've looked into myself but somebody here mentioned that these timed actions only get used in specific circumstances

low basin
#

Welp I did find one issue in a different recipe unrelated to the ketchup, so yea... I feel my IQ dropping. The UI works again. However the recipe for the bottling now just sits greyed out and unusable. I am assuming that I built the function incorrectly. The goal of the function is to force the pot of ketchup to be in a cooked state in order for the recipe to be executed. Have I got anywhere close with this function?
function Recipe.OnTest.KetchupIsCooked(item)
local itemType = item:getType()
if itemType == "NWCookingPotOfKetchup" then
if item:isCooked() then return true; end
end
return true;
end

weary matrix
low basin
#

Nope. I have tried swapping both the the trues back and forth just to figure out what I have messed up and that is just an artifact of that

weary matrix
low basin
#

I know the function listed before it (On.Create) in the same lua was working before I added this one. outside of that 🤷

weary matrix
#

I'm not sure but I kind of remember print() statement not going to console for recipes though

low basin
#

Nope I have not as I know nothing about coding. I have only got as far as I have with my modding thanks looking up functioning examples, going "ok this is how this works", and starting a monkey see monkey do routine. So far I have only used script and not used the lua outside of translation files, the only reason I am touching it now is because I kinda have too.

weary matrix
#

(also fix your return values)

low basin
#

first is true second is false

weary matrix
#

sounds good

bronze yoke
#

print should be fine

weary matrix
# bronze yoke print should be fine

I remember some place where you can put lua code in script files and the print() statements were ignore, probably because it's called as a closure or something. Am I hallucinating?

bronze yoke
#

i've never heard of it anyway, if that is a thing it's not recipes

weary matrix
#

ok good to know

low basin
#

Adding that has resulted in a stream of
[03-06-23 23:38:44.097] ERROR: General , 1685849924097> LuaManager.getFunctionObject> no such function "Recipie.OnTest.KetchupIsCooked".

bronze yoke
#

Recipie

bronze yoke
#

it was a typo all along...

low basin
#

Oh ffs

weary matrix
#

hehe

#

don't worry, learning the hard way is good 😁

low basin
#

Not even mad I just want to cry, lets try this again

#

Ok now the pot of ketchup in the recipe is lit up but it is graying out the bottles and spoon despite them being in my inv. Tested and confirmed it is only lighting up when the pot is cooked. Would that be due to my function check? Do I need a bypass for the other items. Also THANK YOU so much for finding that. I have been fighting this since yesterday.

weary matrix
low basin
#

I have not engaged Debug, however based on my track record so far I will double check that.

bronze yoke
#

can you show the latest version of your function? i'm guessing it's been edited since you last posted it or else i'm really stumped

low basin
#

function Recipe.OnTest.KetchupIsCooked(item)
local itemType = item:getType()
if itemType == "NWCookingPotOfKetchup" then
if item:isCooked() then return true; end
end
return false;
end

bronze yoke
#

i would do it the other way around

#
function Recipe.OnTest.KetchupIsCooked(item)
    local itemType = item:getType()
    if itemType == "NWCookingPotOfKetchup" then
        if not item:isCooked() then return false; end
    end
    return true;
end
#

that should sort it out i think

low basin
#

That fixes the other two but allows the uncooked kecthup

mellow frigate
#

Hello there, I wanna add a radio communication, any idea where I should start with ?

bronze yoke
#

it shouldn't allow the uncooked ketchup as far as i can see

low basin
#

I can only tell you it does, and that would be due to a typo again. I hate this keyboard.
Working as intended. thank you so very very much.

bronze yoke
#

nice!

weary matrix
bronze yoke
#

yeah i don't typically use them

#

i didn't realise they were literally never required though

weary matrix
#

I was suprised because in Lua 5.1 they are supposed to be mandatory for some cases, but my lua 5.1 is not choking on my obfuscated code

bronze yoke
#

the only time i can think i actually use them is when i want to debug an early return (e.g. if foo then print("foo"); return end), if that's not necessary i suppose i'll omit them from now on

weary matrix
#

please do and let me know if you find cases where it's breaking semantic 😅

bronze yoke
#

will do! i'm sure your obfuscator would've run into it by now though

weary matrix
#

I'm sure too but I guess it could not trigger an error, and still change the logic of the code somehow

bronze yoke
#

hmm yeah that's possible

weary matrix
#

the nice thing about having one lines with no semicolons is that no Lua editor / code beautifier I tried so far where able to process the input 😄

weary matrix
mellow frigate
weary matrix
mellow frigate
narrow sparrow
#

I'm using continued survivors but I found that it kinda buggy

#

What's the best survivors mod at the moment, raider npc didnt die when I shot him 5 times bruh

iron siren
#

@mellow frigate I have implemented this sort of feature in my "Rick's MLC AdHocCmds" mod where the PZ streamer chat can broadcast their chat through the player radio. The code for it adds a new radio station and adds broadcast strings

iron siren
#

I have not posted here before, but do you want the code or will you be OK downloading the mod? The particular file in the mod is 106 lines long (RicksMLC_Radio.lua)

#

When a player is attacked by a player's previous character (now a zombie) I would like to know which player's zombie attacked the player. At the moment when I call the ISOZombie zombie:isReanimatedPlayer() it returns true, but the zombie:getReanimatedPlayer() returns nil. Is there a problem with the zombie:getReanimatedPlayer()? Or is the information only known for a short time (eg between player death and creating a new character for the same player)?

crude magnet
#

Hello i have a question about making this mod I'm trying to develop appear in the mod loader in game I followed the example mod template however neither my example mod nor my mod show up in the mod loader I event tried loading it into the workshop folder and following that structure that did not work either here's an image of how the folders look any help is much appreciated.

mellow frigate
crude magnet
ancient grail
#

Where is it located

#

I dont use mod loader so idk
I always use host

crude magnet
#

how do i do it with hoast?

ancient grail
#

You just add the name on the mods section

crude magnet
#

is this what you mean cause it still empty sorry for bothering you with so many questions

ancient grail
#

You might have placed it in the wrong folder

ancient grail
fiery hollow
#

Hi guys

#

I was wondering if its possible to mod the behavior of the zombies

#

like make it so that some of them can run from you in certain conditions?

iron siren
fast galleon
weary matrix
#

Well to be fair many things are 😅

drifting ore
#

i found a mod that lets you spawn inside a prison, but when i do that the whole building is empty, is there a way to fix that?

fast galleon
mellow frigate
thorn robin
#

Hi folks, is it any lua documentation where I can check available functions, their signatures, etc?

mellow frigate
bronze yoke
weary matrix
weary matrix
weary matrix
bronze yoke
weary matrix
#

true, guess I could parse the official one to inject parameter names

mellow frigate
weary matrix
#

@mellow frigate are you done with your radio channel stuff?

mellow frigate
thorn robin
#

Another quick question, is it possible to add some custom attribute to the Vehicle object?
Basically, I'm trying to create a new object and attach it to the vehicle on context menu click

 Rope.attach= function(o, vehicle)
    o.vehicle = vehicle; # sets attribute to my custom object, works fine
    vehicle.rope= o; # doesn't work
 end
fast galleon
weary matrix
#

but you could serialize those objects into a table, and instanciate them back when you need to

fast galleon
weary matrix
#

also it's easier to have all your code in one place, allows me to edit part of the game for testing without fucking up my game installation

#

is it a problem?

fast galleon
#

not really, how do I make it into a library so it's not editable

weary matrix
fast galleon
#

I think capsid packs them into a jar for example?

weary matrix
#

well that's not really my use case, also half the code is bash scripts, not sure how I would make them run from inside a jar

#

guess I could package only the variable renaming part into a jar though, cause it's pure java

fast galleon
#

No, I mean the original Lua files and the decompiled Java files. So that I can read them without accidentally editing them.

#

I'll test some things, see if Intellij can still read them.

weary matrix
#

yeah just set read only permission on the parent directory and sub files/folders

fast galleon
#

done, good idea

mellow frigate
#

going to try how ?

fast galleon
#

Nevermind, I was trying to set Intellij to not edit the files. Then I just changed the folder permissions.

mellow frigate
dull moss
#

Kpog real @mellow frigate

#

Yo, anyone knows how to check if specific vanilla sandbox settings are enabled

#

Namely I need those 2

#

From MP server settings

thorn robin
fast galleon
fast galleon
mellow frigate
dull moss
#

oh just like that

#

thanks

mellow frigate
#

yep parse your code source with SleepAllowed and you got them

tawdry solar
#
   item Thrumbo
    {
        DisplayCategory = Plush,
        Weight    =    0.2,
        Type    =    Normal,
        DisplayName    =    Thrumbo plush,
        Icon    =    Thrumbo,
        WorldStaticModel = SpiffoPlushie,
    }

my item doesnt apear in the item spawner but im sure my code is right cause i used teh spiffo plush code

weary matrix
#

also did you restart the game to be sure?

tawdry solar
#

yup

tawdry solar
#

i have the model in a seperate file

weary matrix
#

hum from memory there's a kind of header to add in the item file

tawdry solar
#

ooh

#

imports

#

like this

#

the module

weary matrix
#

yes

tawdry solar
#

makes sense

#

thanks

weary matrix
#

you're welcome

drifting ore
#

Learning to make a mod. Just adding in a simple item for my first one. How does one understand distribution tables?

#

I get the gist of things like rolls and whatnot. I just can't quite understand how to find the exact containers I want to.

#

Like, how do I find kitchen cupboards in large houses?

fast galleon
drifting ore
pseudo estuary
#

i make these sprites if anyone needs any for a mod if i have time ill do it free

bronze yoke
drifting ore
#

lootzed?

trim mist
#

right now most of my trait ui symbols are just crowbars lol

bronze yoke
pseudo estuary
bronze yoke
#

when it's enabled right click the icon of a container in the inventory ui to open lootzed for that container

pseudo estuary
trim mist
pseudo estuary
trim mist
#

just keep in mind that I'm working on a trait mod for furries, so the symbols would have those for a theme
also there's like ~18 traits right now. I want to add a few more

fast galleon
#

Is there a simple way to keep a zombie in a ZombieOnGroundState?

trim mist
#

Vaguely I remember there's like an IsCrawler() function for zombies

#

there might be a way to set that, if that's what you're looking for

fast galleon
#

I am afraid if I do that, Zombie might be reset and or player logs out and then it will be permanently a crawler.

#

It seems that the game adds ReanimateTimer when a player is standing on a zombie but it didn't work for me.

#

Is OnTick the only option 🤔

drifting ore
trim mist
#

They like to hide the close buttons in the most unusual places

#

there's one probably on the bottom lol

bronze yoke
#

that dropdown with KitchenBottles i think

fast galleon
# drifting ore Opened up lootzed and selected the first kitchen cupboard I saw. 1) What informa...
GitHub

Project Zomboid Community Modding. Contribute to Project-Zomboid-Community-Modding/pz-community-modding development by creating an account on GitHub.

drifting ore
#

So I need to place my item in:
Kitchen{
KitchenBottles{
}
}

Or something that looks similar to that?

fast galleon
bronze sand
#

Anyone has experience adding a simple object to the game?

#

To practice and for fun, I would like to make a mod that adds some collectible toys, probably using Creative Commons 3D models I can find

#

I don't know where to start

drifting ore
fast galleon
crude magnet
drifting ore
#

But since the small box pool is defined here, it won't pull anything from all?

#

Alright. So how do I figure out what specific item pool a container is pulling from?

fast galleon
#

smallbox

drifting ore
fast galleon
fast galleon
fast galleon
drifting ore
#

Ah, alrighty then

#

Thanks mate

#

hi guys i'm new to modding, is there any resources for creating a custom profession mod? i'd also prefer not to use the professions framework

fast galleon
#

#mod_development message
this is base hook to the function

then you need something like
local burglar = ProfessionFactory.getProfession("burglar")

You can see examples in MainCreationMethods.lua

#

@drifting ore

drifting ore
#

ty, i'll check it out 👍

warped valve
#

Anyone know how to sync an IsoObject's mod data to the client from the server when the client isn't in that particular cell? I've tried transmitModData() and sendObjectModData() but neither seemed to have worked

bronze yoke
#

it should be transmit, but, how do you even have an object if it's not in the cell?

#

the client will discard it because transmit moddata finds the object through the square and obviously there is none if it's not in the cell

warped valve
bronze yoke
#

oh, when i say cell i mean IsoCell

#

i don't think mapping cells have any runtime relevance

fast galleon
#

The client will not have information about map parts that are not loaded for him.

warped valve
#

Well I'm assuming the server keeps everything in memory, because if I reconnect after the mod data has been updated then the changes are reflected. It's just that right after it's updated, if I enter the cell where the object is then the mod data is desynced

bronze yoke
#

are you editing objects that aren't near any players, or ones that are near a player but not this player?

fast galleon
warped valve
warped valve
bronze yoke
#

hmm, you're not really supposed to be able to access objects in unloaded areas at all, so i imagine the issue is to do with that

#

i wonder if doors are a special case or something because i don't understand how you're even getting that far

warped valve
#

Hmmm

bronze yoke
#

the server usually only keeps the chunks near players loaded, it reads/writes chunks to/from file when needed

fast galleon
warped valve
# fast galleon probably cached object or ~~getOrCreateSquare~~

I haven't even done anything like that. I fully restart the server and reconnect at which point the mod data is supposed to be updated (while I'm in a different cell), then I TP'd back to see that the changes aren't reflected clientside, and finally I reconnect/restart again and then I find that it's showing the changes

bronze yoke
#

i feel i should correct you about how cells work

warped valve
#

Sure thing

bronze yoke
#

IsoCell is a singleton that contains the area loaded around the player, the idea of 300x300 area cells is mostly only relevant to mapping and doesn't seem to matter for anything at runtime

#

i'm not sure it matters too much for what you're talking about right now but it is something a lot of people end up tripping up on

slow graniteBOT
#
IXIZoNeIXI#5683 has been warned

Reason: Bad word usage

warped valve
bronze yoke
#

the size varies by resolution (or so i've heard)

#

i think it's usually smaller

#

i remember being able to access a ~200x200 area with getsquare

fast galleon
#

It depends on a number of factors, debug has option for even smaller size

warped valve
bronze yoke
#

i don't understand how the object is even loaded on the server, how are you grabbing the object?

warped valve
fast galleon
bronze yoke
#

i wonder if doors are a special case then

warped valve
#

Well apparently I can get the square, and then the door on the square. So something is definitely up in both regards 🤔

#

This isn't singleplayer btw, I'm using the Host button on the main menu

bronze yoke
#

my guess is that the server (and likely client) still keep track of it to some extent while it's unloaded, but the transmitmoddata receiver isn't able to understand that

fast galleon
#

When you're telepoting there's a few ticks before the player is moved to an unloaded square. I was trying to do things at the new square and had to wait for a few ticks is what I mean.

warped valve
#

I wonder if I could just hook into LoadGridsquare's event and request the moddata on the square's door (if it has a door) and call it a day 🤣

#

Bad for performance I'd imagine...

bronze yoke
#

yeah generally i would tell someone not to try to edit unloaded objects and just cache the changes until the object loads

#

i don't really know why that isn't as necessary here as it usually is but it still seems like the solution

warped valve
#

Actually, I've already answered that. I just gotta use the LoadGridsquare event

tawdry solar
#
module base

   item Thrumbo
    {
        DisplayCategory = Plush,
        Weight    =    0.2,
        Type    =    Normal,
        DisplayName    =    Thrumbo plush,
        Icon    =    Thrumbo,
        WorldStaticModel = SpiffoPlushie,
    }

this item should work correct?

#

the wsm is wrong

#

i just noticed

#

but it should apear in the item spawner right?

bronze yoke
#

when it fires it fires hundreds of times at once (because it loads in chunks) so any imperfections will be amplified

warped valve
tawdry solar
#

this doesnt work

#

and i cant figure why

bronze yoke
#

needs an extra } at the end if that's the full file

tawdry solar
#

item Thrumbo
{
DisplayCategory = Plush,
Weight = 0.2,
Type = Normal,
DisplayName = Thrumbo plush,
Icon = Thrumbo,
WorldStaticModel = Thrumbo,
}
}

#

like this

#

that didnt work

#

ima go for a bit

red tiger
tawdry solar
#

fml this is the code i got from the wiki

#

thanks#

dull moss
#

how do you check if game is in single player or in multiplayer?

#

found it EZ

#

thought i had it bookmarked

drifting cipher
#

Hello everyone, who can help in writing a mod? Based on the Stalker setting

drifting ore
mellow frigate
#

Hello there, I added an IsoObject on a specific square and I am surprised to see no spriteName through F2 tool. The sprite is the one expected though. Can you explain to me why the sprite is not cemetery_01_30 ? ``` local isoObject = IsoObject.new(square,sprite)
square:AddTileObject(isoObject)
isoObject:getModData()[mdKey] = {myObjModData}
isoObject:transmitCompleteItemToClients()

mellow frigate
#

after quit and reload, the isoObject is still there but it cannot be seen anymore.

drifting ore
proven bough
bronze yoke
#
local activatedMods = getActivatedMods()

if activatedMods:contains("ModId") then
#

since activated mods will never change it's optimal if you can structure things around only checking them once

lone nest
#

i'm not gonna write 200+ mod patch checks for you random people.

#

Also, thank you for sharing

proven bough
cosmic arrow
#

should be the mod id

proven bough
#

Okay sweet, thanks for your help 🙂

crystal oar
#

if i just omit the category from a crafting recipe it will be in the general category right?

fast galleon
bronze sand
lone nest
lone nest
#

Something like this should be OK and it should create a log file on game start.

    local activatedMods = getActivatedMods();
    local file = getFileWriter(
        "logs/" .. "activatedMods_logs.txt", 
        true, -- true to create file if null
        true  -- true to "append" to existing file, false to replace.
    );

    local content = tostring(activatedMods);
    file:write(content .. "\r\n");
    file:close();
end

Events.OnGameStart.Add(logActiveMods)```
#

the file will be located in %USERNAME/Zomboid/Lua/logs

proven bough
#

Cause I'm big dum, I'm looking at my code and drawing up a blank, wondering where I'm supposed to put this if/then statement, and what to put after it

drifting ore
#

i have a problem, i'm trying to add knox prison as a starting point but the problem is nearly all of the doors there are locked. is there anyway i can have the doors be unlocked by default or give a special key to the player?

proven bough
# lone nest Something like this should be OK and it should create a log file on game start. ...

Replying to you cause you seem to be pretty knowledgeable when it comes to code, unlike myself 😛

function Recipe.OnCreate.OpenCommonLootBox(items, result, player)
comweap = {"Base.MugSpiffo", "Base.Plunger", "Base.TableLeg", "Base.ChairLeg", "Base.Fork", "Base.Spoon", "Base.ButterKnife"};
comsup = {"Base.Pills", "Base.Tissue", "Base.Dogfood", "Base.TinnedBeans", "Base.RippedSheets", "Base.Pinecone", "Base.Sponge"}
comcash = {"ASS.asscoin"}
combox1 = comweap[ZombRand(7) +1];
combox2 = comsup[ZombRand(7) +1];
combox3 = comsup[ZombRand(7) +1];
combox4 = comcash[ZombRand(1) +1];
player: getInventory():AddItem(combox1);
player: getInventory():AddItem(combox2);
player: getInventory():AddItem(combox3);
player: getInventory():AddItem(combox4);
end

So here's a snippet of the code I'm working with. If I had to take a wild guess, I would assume that I pop this getActivatedMods if/then statement at the very top, before the function starts? and tell it to require, say, BCGTools as an example. Then would I have to specify it to add the items from BGCTools? then just add those items to the comweap category as necessary?

lone nest
#

theoretically should give you the key of the building you're in.

drifting ore
#

ty, i'll try it out

lone nest
#

although getSpecificPlayer(0) points to local player only...

drifting ore
#

also the game seems to have a system in place where it clears out your spawn location of zombies or something, is there anyway to work around that?

lone nest
#

your guess is as good as mine, I'm still fairly new myself. ¯_(ツ)_/¯

lone nest
#

i dunno when you plan to call your function, nor what mod you're referring to

#

so replace ModId as needed for whatever you're trying to use.

proven bough
#

So in my code, the function is called as the very top line. It's the first thing in the lua file

lone nest
#

... That would imply it runs unconditionally when the game app launches.

#

not when the game starts.

proven bough
#

and ideally, I'm trying to add compatibility for multiple mods, Bushcraft Gear, Bushcraft Rare Weapons, Shark's Weapon Pack

proven bough
lone nest
#

🤔

#

order of execution matters, if your code runs at the start, it could be running before the specified mods are loaded.

proven bough
#

Riiiiight. See I haven't encountered this issue before, as everything that my function is calling for is a vanilla "Base.XXXXX" item

lone nest
#

Oh, then it's probably not an issue

proven bough
#

Adding compatibility for modded content is a whole new thing for me 🥲

lone nest
#

since base game assets are loaded before everything

#

In my experience, Events.OnGameStart.Add(<function>) is generally a safe starting point...

If you're looking at sandbox options, Events.OnInitGlobalModData.Add(<function>)

#

more experienced modders may have better insight, this is just based on my 1 month messing around.

proven bough
#

Oh it's not related to equipping or clothing or anything - basically I've made a loot box that you open from the crafting menu

lone nest
#

Oh then Events.OnGameStart.Add(<function>) should be fine, as long as your mod is loaded after the pre-req mods.

#

dunno if require applies since not all users, I assume, will have every listed mods installed.

proven bough
#

I'm hoping to set it up in such a way that, if you DO have these mods installed, it'll put these items in, but if you don't, it'll just omit them

lone nest
#

Well, I'm guessing it would look like this?

    local activatedMods = getActivatedMods();

    if activatedMods:contains("ModOne") then
        -- Your function below
    end

    if activatedMods:contains("ModTwo") then
        -- Your function below
    end
end

Events.OnGameStart.Add(AddStuffToMyBox);```
#

I don't know what you're trying to add to your loot box nor how many

#

but I'm assuming that's logically what it should look like.

#

and since you're checking for multiple mods, I think there is no need for else and elseif to consider.

#

I probably need to sleep cause i'm over-correcting myself here.

#

so have a good night and hopefully you'll have your answers tomorrow.

proven bough
#

Hah that's quite alright. I appreciate the help regardless!

gaunt meteor
#

is it possible to trigger a radio broadcast from the xml? for e.g., an item in inventory, right click -> use, timed action into a onCreate function, then trigger specific broadcast from the radio xml?

#

my main thing im stuck on is triggering the broadcast itself

fading horizon
#

Guys don't fall asleep in west point wtf

bronze yoke
#

so trying to spawn modded items like this should never be an issue

drifting ore
charred hemlock
#

bit of an odd question, anybody know of any mods that take advantage of the spears spawning in zombies after a certain amount of months modifier to make modifiers for seeing other things?

#

like more weapons, like nail spiked planks and bats stuck inside zombies, or even different zombie types, like more of a chance to see nomad zombies as time goes on, essentially zombies definitely not from within the exclusion zone, but happened to wander in, or nomadic survivors that got infected with preserved food and wilderness survival gear

pliant yarrow
#

I'm having a bit of a problem I think using Profession Framework for my mod. I'm trying to add an xp boost for stats to a perk with a line like SpecialInterest:addXPBoost(Perks.Fishing, 1) because the modding wiki said you need to use a trait to add an xp boost, but I keep getting an error of attempted index: addXPBoost of non-table. I'm suspecting it's because it's not recognizing the trait because of Profession Framework or something. I'm not super experienced and don't know what to make of it.

warped valve
#

Does getPlayer:getCell() return what's loaded for the player in-game, or does that return the map's cell?

#

The reason I ask is because I'm working with the LoadGridsquare event but it doesn't appear to get called after a player hits "Click to continue..." after loading into their game

#

I just discovered the getChunk() function available on an IsoPlayer, maybe I could use that for what I need to do

proven bough
bronze yoke
bronze yoke
warped valve
#

Unless I'm confused about what you mean by runtime

bronze yoke
#

isochunk is the loaded area

#

oh sorry

#

you can access the squares, but the cell object isn't related to map cells, it's just the loaded area

warped valve
tame mulch
warped valve
tame mulch
#

As idea, try get coords of player and check squares in player radius

warped valve
#

Ah yes, that could work. I'll try that out

coarse sinew
#

Is there any method to make a refrigerator when I build it to be both a Fridge and a Freezer? I'm using

local _simpleFridge = ISWoodenContainer:new(sprite.sprite, sprite.northSprite);
_simpleFridge.containerType = "fridge"; -- to set it as a fridge
fringe heart
#

hello! I want to make a mod for project zomboid, so that objects in the world will spawn regardless of the place in which they are located. That is, so that I could find a shotgun, a needle, an anesthetic, anything in the kitchen.

#

Who can help me? I do not know codding PZ, but i get ready learn it/

plush sigil
#

Let him cook…

mellow frigate
mellow frigate
mellow frigate
#

Hello there, Battle Royale mod teleports players. this provokes client being kicked from the server with type2. Is there a way to keep anticheat type 2 on and not kicking the client by initiating the teleport server side ?

trim mist
#

Not that I know of, sorry :X
I was hoping anyone knew if when a trait was added or lost in game triggered an event. All I can find is "onlevelperk" which I don't think is the same thing

mellow frigate
mellow frigate
trim mist
#

Fair enough. I was hoping I wouldn't have to do that

trim mist
# mellow frigate Hello there, Battle Royale mod teleports players. this provokes client being kic...

I did a little research, according to Poltergeist here (#mod_development message) You can find what each anticheat protection does if you look for it in the java. Here's what I found for type 2:

 public static boolean checkSpeed(UdpConnection var0, IMovable var1, String var2) {
      float var3 = var1.getSpeed();
      double var4 = var1.isVehicle() ? ServerOptions.instance.SpeedLimit.getValue() : 10.0D;
      boolean var6 = (double)var3 <= var4 * ServerOptions.instance.AntiCheatProtectionType2ThresholdMultiplier.getValue();
      if (!var6 && ServerOptions.instance.AntiCheatProtectionType2.getValue() && checkUser(var0)) {
         doKickUser(var0, var2, "Type2", String.valueOf(var3));
      }

      return var6;
   }

If there's a way for you to set the speed of the player below the threshold while teleporting you may be able to circumvent that

#

(is pasting vanilla java here okay?)

mellow frigate
#

decompiling seems ok to TIS so I'd say yes until further notice from them

trim mist
#

I hope that helps

mellow frigate
#

thanx

sour island
#

Discord gave me my username as is

#

I am the one and only Chuck

red tiger
trim mist
red tiger
unborn valley
#

Quick Question:

If I want to add multiple modules to my file how do I do that?

module Base

Would it be as easy as:

module Base,UndeadSuvivor
```or
```lua
module Base;UndeadSuvivor
#

Or do I just list it twice?

module Base
module UndeadSuvivor
```?
weary matrix
#

is it possible to have lua code that would be available for require() from any of those locations: client/server/shared?

#

or do I have to duplicate my code

#

guess I should try to put it in shared 😂

#

oh damn

#

seems to be working when I move my code to shared, but since I use stuff from client it's not able to load it :(((

WARN : Lua         , 1685990507570> LuaManager$GlobalObject.require> require("ISUI/ISPanel") failed
WARN : Lua         , 1685990507571> LuaManager$GlobalObject.require> require("ISUI/ISButton") failed
WARN : Lua         , 1685990507571> LuaManager$GlobalObject.require> require("ISUI/ISModalRichText") failed```
#

unless someone knows how I could create a panel with a title + text content + a button without using those from vanilla?

mellow frigate
weary matrix
#

but it's only solving half the problem

mellow frigate
#

there is no good reason to put UI server side

#

there is noone to appreciate it

drifting ore
#

yo, where can i find api docs for methods, events etc.

weary matrix
weary matrix
#

well I really do

#

otherwise code from shared can't use my stuff

#

and I need it to be able to use it

mellow frigate
weary matrix
#

but I need code from shared to be able to use the popup

mellow frigate
#

I guess you'll have to split between shared and client

weary matrix
weary matrix
# mellow frigate What needs a pop up does not need to be shared.

I'm making a library mod that let's you obfuscate/encrypt your lua code. It's decrypted on the fly. So if someone obfuscate/encrypt his code that is in shared, then shared needs access to my decryption routine. In case something goes wrong I want to show a popup with an explicit description of the problem

mellow frigate
#

encryption description looks like shared stuff, output (concept) of that is shared, but effective output can only be logs server side and can be that or pop up client side.

weary matrix
#

I need some sort of notification in-game

mellow frigate
#

there is no player to click the pop up server side. you can either handle the error automatically or crash. I'd recommend the crash for a start or you'll obfuscate your obfustacing error report :D.

weary matrix
#

you keep talking about server and I keep telling you I don't care about server

#

hum, unless what you're saying is that distribution only occurs in server?

mellow frigate
weary matrix
mellow frigate
#

ok, so why is any of the code in shared ?

weary matrix
#

because code in shared can only require code from shared

#

and code in shared should be able to use my mod

#

if I put my mod in client, when code from shared is calling require(), it just returns nil because it doesn't have access to code in client

mellow frigate
drifting ore
#

if i wanted to use getCell():roomSpotted(room) how would i go about that since it can only be called from the server, what event can i use to determine when a player has spawned in?

weary matrix
#

hum, maybe I could write code in server and in shared that would send a message to client so that it would trigger the popup?

mellow frigate
red tiger
#

lol

mellow frigate
red tiger
red tiger
#

Umbrella has those events.

mellow frigate
drifting ore
drifting ore
weary matrix
#

@mellow frigate @red tiger maybe I could use sendMessage or something like that?

red tiger
#

I don't know what you're doing.

#

I saw albion's events repo being linked and mentioned that her typings are included in a full typings project.

weary matrix
#

I'd like to trigger a popup on client side from code in shared (or eventually in server)

weary matrix
#

pz naming can be so confusing sometimes 😂

#

thx I'll try that

#

so sendServerCommand is called from server and sends a command to client right? 😂

dull moss
#

Ok, help me out here, who has gigabrain in optimizing code.

Local functions run faster than global. But I got following situation. I have a function that I want to use in 2 different lua files. I can either

  1. Make function global
  2. put my functions into some CommonFunctions.lua and require that lua in my 2 files (but that would make them global, unless I'm confusing something?)
  3. Just copy my function to 2 files.

So like on 1 hand I don't want to have 2 instances of same code, but on other hand I want shit to be optimized. Opinions?

weary matrix
dull moss
#

ye that's option number 2

weary matrix
#

except it doesn't make doSomething global

dull moss
#

ah that's the point i was missing

weary matrix
#

or well somehow it does, cause it's accessible globally but it's still a local symbol AFAIK

dull moss
#

fuck it I'll jsut stick with option 2

#

cheers

weary matrix
dull moss
#

It's not about PZ it's about finding inner peace in doing my part in optimizing

weary matrix
#

it's still nice to organize your code

weary matrix
#

I can respect that 😅

dull moss
#

also my mod is pretty much nicest thing on my github so yknow

#

gotta make it count

weary matrix
#

😂

#

@red tiger how do I catch the sendServerCommand from client? I can't find any example in vanilla or in all the shitloads of mods I subscribed to

#

oh maybe Events.OnServerCommand.Add?

trim mist
#

How does one create a new animationset? I'm trying to give a player a different AnimationSet based on a trait they pick but, when I try setting it I get an error

weary matrix
#

damn I think I found a bug in grep linux command 😮

weary matrix
trim mist
#

here's aa. and the method. Is this another case of periods vs. colons?

weary matrix
# trim mist

Don't think so, otherwise it would tell you about it

#

@trim mist try to add this: lua print("DEBUG", aa, type(aa)) just after assigning aa

trim mist
#

this seems like a very useful tool

weary matrix
#

then just search your console.txt for DEBUG

#

or whatever word you're using

trim mist
#

It's definitely an AdvancedAnimator component

#

but that's good to know for sure

weary matrix
#

and AdvancedAnimator is not exposed to Lua

trim mist
#

oh NO

weary matrix
#

yeah :/

trim mist
#

I think this is quashing my dreams of selective sped up animations

weary matrix
#

@trim mist but you could check True Actions etc to see how they do it? I think what you need is similar right?

red tiger
#

@weary matrix Yes.

#

It's Event handlers + send command calls.

weary matrix
#

thx

red tiger
#

My mod loader does this.

trim mist
drifting ore
weary matrix
#

ah wait

#

not sure you can catch sendServerCommand from server 😅

red tiger
#

@weary matrix you can I think.

#
_G.__sendServerCommand = _G.sendServerCommand;
_G.sendServerCommand = function(..)
  -- Do your stuff here.
  _G.__sendServerCommand(..);
end
weary matrix
#

@drifting ore check Jab's example, but to be honest I don't understand why/how it would work 😂

red tiger
#

The .. should be replaced by the proper params.

drifting ore
#

if i use OnTick then im gonna have to somehow check a few things like if the building is actually a spawn location as i don't want the same effect to be applied to every building in the game

#

its p weird how the game doesn't have an event fired on the server for when a player first spawns in tbh

#

if i can have the client give the server a message tho i can prob work around it ig by using OnGameStart client-sided and having the client tell the server they just loaded in

#

seems kinda scuffed tho

dull moss
#

using onTick is heresy

drifting ore
#

mhm, would be really bad to use it for this too since im gonna be going thru like every tile to find a tile a player is in and then somehow determine if they have just spawned there which sounds absolutely horrible

dull moss
#

excuse me what do you mean going through every tile

#

there's absolutely no way you can do that, zomboid map is 16k by 16k or some shit

drifting ore
#

cell*

dull moss
#

ok that's bearable

drifting ore
#

ye i think im just gonna have the client tell the server when they have loaded in ig lol

#

tho it sounds sorta insecure since the server is trusting the client for that

#

not sure how multiplayer is in this game since i haven't really tried it at all but i'm assuming its bad practice for the server to just blatantly trust whatever the client tells it