#mod_development

1 messages Β· Page 165 of 1

hidden jungle
#

best way to figure out how to make your mod compatible with another mod is to go look at how that mod works. or look at other mods you know are compatible with it and see how they do it.

#

most likely its an item tag but it could be anything

potent ibex
#

ok ty ill check that, i tho at first it was maybe the category type but nope lol

hidden jungle
#

items have some properties that are important to know
Type is the internal name used by the game to determine what the item is because its display name can change
Name is what is displayed
Category is an arbitrary category system for items and it can also be changed
Tags are assigned to items based on their functions. ie: all the hammer items have "Hammer" as a tag and thats how the game knows they can be used for hammering purposes without needing a list of every valid item.

weary matrix
#

well zombie:knockDown(true) is working perfectly fine for my mod πŸ€·β€β™‚οΈ
Unless some pz update broke it recently but no one complained so far

hidden jungle
weary matrix
#

ah I see

#

then you might want to check all the Hit*() methods maybes?

hidden jungle
#

its aight, i shelved the idea for now. i'm just gonna leave it as a stagger effect instead.

on a separate note, is there any way to detect when a player shouts? like with Q

weary matrix
#

AFAIK all the functions to make the player speak end up calling IsoPlayer.Say()

#

so unless there's a way to detect shouting by "hearing" it, I doubt it's possible

hidden jungle
#

what about detecting the keypress?
maybe you can pull the control scheme and have a function trigger on key press?

stone garden
#

hey guys can you guys help me on making an way to npcs naturally spawn on aiteron npc mod? project humanoid

hidden jungle
#

that would be a question for #mod_support in here we're talking about the internals of zomboid modding.

stone garden
#

im making an modification in code

#

im trying to do modding to make npcs spawn naturally in The project humanoid im trying do it with coding

turbid gale
#

it would be possible to intercept the lua before it fires though

stone garden
#

can anyone help at the part of npcs spawn naturally im trying to program that to make it work

#

like an submod

turbid gale
#

by intercepting both ISEmoteRadialMenu:emote and ISEmoteRadialMenu.onKeyReleased

#

ISEmoteRadialMenu.onKeyReleased actually doesn't even have to be intercepted actually, as you can't technically. It would be best to have your own function fire with the same event hook and conditions

bronze yoke
#

if it's only called from lua as mentioned above, you could just hook the metatable for Callout

pseudo estuary
#

Am I able to make my mods and test offline? I just moved today and don’t have internet

turbid gale
#

is that how it works?

#

as it seems like Callout is on the Java end of the game and not the lua side

bronze yoke
#

yeah, but you can still mess with the lua reference to that method

#

as long as it's called from lua it has to go through that

turbid gale
#

interesting πŸ€”

#

that would 100% be the better way to do it then

stone garden
#

can you guys help me

#

im trying to make npcs spawn naturally at project humanoid with lua

mellow frigate
stone garden
#

im trying to make npcs spawn at an random location with project humanoid can someone help?

hidden jungle
mellow frigate
hidden jungle
#

isnt that going to trigger on all sounds though?
like coughing or building?

mellow frigate
#

yes most (not exactly all) but it will include all your players sound and you can filter with the input parameters

hidden jungle
#

aight, i'll look into it. Thanks!

mellow frigate
weary matrix
#

@stone garden what's the issue exactly? Shouldn't be too hard. Also isn't it already implemented in Aiteron's mod?

stone garden
stone garden
#

but each one i tried doenst work

#

can you give me some ?

weary matrix
stone garden
weary matrix
#

but if you have some code snippets I might be able to help you getting it to work

stone garden
#

OnGameStart.Add(<function>); EveryHour (in-game hour)

#

i tried this one

weary matrix
#

I fail to see how that would spawn a NPC πŸ€”

stone garden
#

well

#

you got any solution?

weary matrix
#

well I already told you I don't

stone garden
#

well

weary matrix
#

Why aren't you checking Aiteron mod? He's definitely spawning NPCs, so it would be a good start

stone garden
weary matrix
#

what do you mean by "they don't spawn automatically"? When I've been trying Aiteron's mod, NPCs would spawn, and it wasn't a manual thing, meaning it had to be automatic somehow

stone garden
#

is there an solution to increase frequency

weary matrix
#

probably yes, you'd have to dig his code to find out though

heady crystal
#

Anybody here have tile ed and would be willing to help a modder out? I'll see myself out for that pun but still!

potent ibex
#

nope i really don't get it how to make a custom item attachable with the mod noir attachment, checked all the codes and can't find it :/

weary matrix
#

depends which modder you want out πŸ˜‚

weary matrix
heady crystal
#

Gonna be very boring and annoying doing this in-game

weary matrix
heady crystal
#

Look I have PTSD from that thing

#

I'm not touching it

#

ever

weary matrix
#

πŸ˜‚

#

I mean you can download the tileset separately from tilez

#

IIRC it's just a zipped folder with all the tiles

heady crystal
#

NEVER AGAINN

#

NEEVERRRR

#

And I actually may need a property or two

weary matrix
#

hehe

#

I agree TileZ is very bad piece of software

mellow frigate
#

Tell me what you think of the (very tiny simple) evolution proposal on github.

potent ibex
#

any modder who can help me with the attachment bag?

potent ibex
# weary matrix maybe check authenticZ?

that helped me, thanks now it work but i have a problem 1 of my 3 plushie appear at the wrong location on the backpack and i really don't know why, they have the same codes and location models :S

#

😦

weary matrix
potent ibex
#

@late hound sorry to ping you! I need your help if you have time of course. ❀️

weary matrix
#

any clue what could identify a server uniquely? I've been using the IP address but it's actually not a good idea because it's sensitive information that shouldn't be embedded in code

mellow frigate
weary matrix
#

the name is too easy to change, and I need a value that would persist over a restart

#

trying to enforce a blacklist on some servers πŸ˜…

lone nest
weary matrix
#

Anyway, guess I'll sleep on it. See you guys

pearl citrus
# weary matrix any clue what could identify a server uniquely? I've been using the IP address b...

well if you want to go turbo nerd you could set up some public-key encryption and encrypt a message with your private key, allowing your users to decrypt with your public key to reveal the contents of your message, that way any prospecting charlatans who wish to pose as you will need to either get access to your private key, or break modern security standards as we know it!

but there's probably an easier way

pearl citrus
# weary matrix any clue what could identify a server uniquely? I've been using the IP address b...

I will say though, depending on your concern for your privacy, an IP doesn't reveal that much information. Especially as a lot of ISPs will change your IP whenever your router disconnects, meaning you don't have a persisting IP. Mind, not all of them do it, but yeah.
There's not an awful lot the average person can do if they get your IP - maybe figure out your country or state, but beyond that it's very unreliable for location data. Unless you're being targeted by a hacker group, it probably isn't much of a concern.

If you are very concious about your privacy, you could set up a forwarding proxy or something to mask that IP while still allowing people to access through an IP, but that's not something I have experience in and it's probably overkill.

#

hm, i didn't make these ping replies so they might not see this, i should probably @weary matrix in case they get any use out of it

#

also im reasonably sure that if people are connecting to your server they can probably get your ip if they want anyway

charred patrol
#

well ppl always scare about exposing their ip to public, but still willing to give out phone number or address for online shopping Hmmmm

pearl citrus
#

using phone numbers for identification is dumb and i hope websites stop it :(

#

doubly so because they'll normally send text messages with codes and stuff, and sms is totally unencrypted!!!

#

ooh looking that up though it seems there's a new protocol called rcs that actually has an encryption
i'd rather we just do away with texts all together but that's something!

#

anyway sorry this isn't crunchys-tech-security back to zomboid with me

pearl citrus
#

Anyone familiar with any mods that use evolved recipes for something that isn't cooking?

fast galleon
#

@ancient grail
how do vanilla animations like fire work? Is it made from the fire.frag and fire.vert files, because I see no tiles.

ancient grail
#

Tile animation

#

It can be found on the vanilla pack files

#

I just figured this out last night

fast galleon
ancient grail
#

Ughh no... Ill check tho hold on

fast galleon
#

nice

fast galleon
ancient grail
#

SteamLibrary\steamapps\common\ProjectZomboid\media\texturepacks\Tiles2x.pack

#

ah ok ill just leave it here still incase someone else wants to know

fast galleon
#

I assumed that since it was not in the tiles images zip, it would not be in this file and checked only all other smaller packs.

cunning crest
#

hi, we can have mods from server side?

white pivot
#

hello everyone, i'm trying to remove visual iso square highlight for some reason. But there is so many classes about square. Is it https://zomboid-javadoc.com/41.78/zombie/iso/IsoGridSquare.html#IsOnScreen() ? Or maybe https://zomboid-javadoc.com/41.78/zombie/iso/IsoGridSquare.ILighting.html#bCouldSee() ?

fast galleon
#

Hello

white pivot
#

just hiding the highlight effect. I'm working on arsenal 2.0 compatible version of advanced trajectory mod. But one arsenal's weapon brings back this isogrid highlight

fast galleon
#

I'm not familiar with that mod. If it highlights an object or adds a square marker maybe I can help.

#

Since it's a weapons mod, maybe it's a muzzle flash.

white pivot
#

this mod take over all the autoaim system, and calculate vectors based on mouseposition for projectiles. So it draws it's own mousecursor, and removes original ones. It uses square check to catch all targets data, but no square highlight should be seen. It works quite good atm but i found a shotgun that brings back this square highlight, so i would like to make it invisible. It's the same iso square highlight you can see for rightclick->move to feature.

sour island
#

Nah, these two are definitely outliers and probably luck on my part. Your mods are better performing on average.

ancient grail
fast galleon
white pivot
#

i already use setDrag and a lua cursor object with mousecursor as a parent. But maybe i dont understand everything you meaned

fast galleon
#

You can have only one dragged object. So stop the change or add your object again.

thorn bane
#

I remember you can use sprites in chat, does anyone know how?

#

Ah got it

#

me rn ^

white pivot
#

you were right on the fact that i wasn't using set drag for this weapon mode XD. However, i tried to add it in my object initialisation like if not Advanced_trajectory.panel.instance and getSandboxOptions():getOptionByName("Advanced_trajectory.aimpoint"):getValue() then Advanced_trajectory.panel.instance = Advanced_trajectory.panel:new(0,0,200,200) Advanced_trajectory.panel.instance:initialise() Advanced_trajectory.panel.instance:addToUIManager() getCell():setDrag(Advanced_trajectory.aimcursor, 0) endIt runs, but it won't hide the green square

ancient grail
#

Youre the author of advance trajectory?

fast galleon
#

Usually that is drawn by the lua cursor every tick. Maybe it's as simple as setting to nil.

white pivot
#

the square follow the mouse, but i don't know where this square come from. It's only on one weapon. I'm trying to set it to nil, but i'm strugling to catch only the display of the square. I'm not familliar with the use of IsoGridSquare. I just tried if IsoGridSquare.ILighting():getVariableBoolean("bSeen") then IsoGridSquare.ILighting():setVariableBoolean("bSeen",false) end But debug is just laughing at me

fast galleon
#

try getCell():setDrag(nil,0)

#

from console

#

just for debug, to find what is happening

fast galleon
white pivot
#

nah i keep getting this green square, that's weird

gilded hawk
#

Guys, what is the correct way to make in the zomboid Kalua a class, and make that class a singleton?

weary matrix
gilded hawk
# weary matrix What are you trying to achieve?

I'm trying to turn this file: https://github.com/mxswat/pz-transmog-definitive-edition/blob/master/Contents/mods/TransmogDefinitiveEdition/media/lua/shared/TransmogDE.lua

Into a proper class, to tidy up the code, and I want to turn it into a class. And import an istance of that class using require

I think it's a good way to tidy up my code, but I'm open for suggestions.

GitHub

Contribute to mxswat/pz-transmog-definitive-edition development by creating an account on GitHub.

#

So that instead of doing

TransmogDE.setClothingColorModdata(ogItem, TransmogDE.getClothingColor(ogItem))
  TransmogDE.setClothingTextureModdata(ogItem, TransmogDE.getClothingTexture(ogItem))
  TransmogDE.setTmogColor(tmogItem, TransmogDE.getClothingColor(ogItem))
  TransmogDE.setTmogTexture(tmogItem, TransmogDE.getClothingTexture(ogItem))

I can do

  self:setClothingColorModdata(ogItem, self:getClothingColor(ogItem))
  self:setClothingTextureModdata(ogItem, self:getClothingTexture(ogItem))
  self:setTmogColor(tmogItem, self:getClothingColor(ogItem))
  self:setTmogTexture(tmogItem, self:getClothingTexture(ogItem))

Does this make sense @weary matrix ?

weary matrix
thin hornet
thin hornet
#

your current code look good enough

#

Making it a class that can be instanciated into multiple instance is only needed if you plan on running multiple instance

#

for example:

Static method

TransmogDE.getClothingColor = function(item)

is an utility method that you pass an item and get a result.

Instance method

TransmogDE:getClothingColor = function()
    return self.item:getColor() --- just an example
end
#

In your case i think static is proper as it seem to be an API.

gilded hawk
#

Okay, I see. But I do also have these two, that at the moment I'm accessing in some functions directly using TransmogDE.BackupClothingItemAsset

TransmogDE.ImmersiveModeMap = {}
TransmogDE.BackupClothingItemAsset = {}

As an example:

TransmogDE.getClothingItemAsset = function(scriptItem)
  if scriptItem.getScriptItem then
    scriptItem = scriptItem:getScriptItem()
  end
  local fullName = scriptItem:getFullName()
  local clothingItemAsset = TransmogDE.BackupClothingItemAsset[fullName] or scriptItem:getClothingItemAsset()
  
  return clothingItemAsset
end
#

And I don't know why, but this feels messy, and I'm not sure why. In general the code of this mod feels messy and even though it works, I don't feel super satisfied.

fast galleon
potent ibex
# late hound Why the ping

yeah sorry for that, i need help and i got told you could help me. i have a problem 1 of my 3 plushie appear at the wrong location on the backpack and i really don't know why, they have the same codes and location models :S

late hound
potent ibex
pearl citrus
#

"the plushie mod is more of a weapon pack" is quite the sentence.

potent ibex
#

loll i added '' AttachmentType = SpiffoPlushie,
StaticModel = chocoboplushie,'' to it so it can work with noir attachment mod

pearl citrus
#

amazing
this is the kind of creativity we need

gilded hawk
late hound
#

re-export this model rotated 180 degrees on the X axis and translate it up in your 3d modeling program of choice.

potent ibex
#

ok will try thank you

gilded hawk
white pivot
late hound
thorn bane
#

For testing mods with a friend, do I just have to ask them to drag and drop the mod into the workshop folder?

#

Or is there a few other feats I have to do?

red tiger
#

There's little consistency and that is defined by legacy code practices which are no longer at play.

tawdry solar
#

My code is fixed!!! drunk drunk drunk

fickle current
weary matrix
fickle current
#

getPlayer():setHoursSurvived() was what worked in the end!

tawdry solar
#

does anyone got a .x exporter

weary matrix
gilded hawk
weary matrix
#

Any clue about a simple example of using ISPanel? I just need a simple panel with some text and a button.

sour island
#

Like a pop up?

#

There's a pop-up on the main menu

late hound
gilded hawk
weary matrix
gilded hawk
sour island
#

Do body locations still have to be entered in order?

late hound
#

change around the bodylocations, some hide the rendering of others

sour island
#

If I recall there is no way to reorder them. You have to define them in entirety

gilded hawk
gilded hawk
magic halo
bronze yoke
trim mist
#

Hey y'all, could anyone tell me why my return value comes out as nil here?

#
function TraitTags:getPlayerTraitTags(player)
    local playerTraits = player:getTraits();
    local concatenatedTags = "";
    local returnString = "";
    local traitName = "";
    --
    --local test1 = getn(playerTraits);
    --print(tostring(test1));
    --
    if playerTraits ~= nil
    then
        for i = 1, playerTraits:size() -1
        do
            local trait = playerTraits:get(i);

            if TraitTags[trait] ~= nil
            then
                concatenatedTags = "";
                for _,tag in pairs(TraitTags[trait])
                do
                    if not returnString:contains(tag)
                    then
                        concatenatedTags = concatenatedTags..","..tag;
                    end
                end
                returnString = returnString..concatenatedTags;
            end
        end
    end
    return returnString;
end
#

So at the very end returnString has ",anthro,carnivore,human" buuuuut

#

d (the testing value that's supposed to store the result of getPlayerTraitTags()) is null

#

and so is a, which also returns a string.

#

I'm thinking maybe there's an issue with the way I have the function structured?

#

but for the life of me I can't see anything I'm doing wrong

thin hornet
pearl citrus
#

The function looks fine to me. I'd immediately assume it's just a typo - lua is terrible and will just allow you to access variables that don't exist, and it causes endless headaches.

red tiger
#

Just a reminder that is is now possible to write third-party documentation for PZ's API & JavaDocs for non-English languages.

#

Wow. It's been a long time since I've seen someone use 8-space Tabs.

#

You clearly use Linux. xD

#

Rip my heart out will ya? xD

bronze sand
#

How could someone make "Item Displays" like special shelves for the game?

robust briar
#

Alright, I am racking my brain. Is there a way from one mod to completely disable an item from another. Not "replace it" but completely just nuke it.

I used getClassField to manually set Hidden to true on the Item, but if a player has it on them it just makes it undroppable πŸ’€ (and hidden so it "works")

I tried to manually peek into scriptmanager right after OnGameBoot to manually remove the item from all the points I can find but that as expected is causing all sorts of hell. Like it works, but there must be more reference to the item than I can find cause I then start to get all sorts of issues with rendering.

Basically, does anyone know a way to actually remove an item?

bronze yoke
#

i can only imagine this causing endless issues

fast galleon
#

You can disable the mod

cunning crest
#

how can i create a custom keybind?

fast galleon
robust briar
#

Its like.. an endless pit of "oh so you thought you had it.. NOPE"

bronze yoke
#

why are you trying to do this?

robust briar
#

Pitstop is an awesome mod with a lot of cool stuff, but some of the items it adds are.. well.. a bit much

bronze yoke
#

you can override the file that adds them as long as your mod loads later

robust briar
#

My understanding of Script Files is they merge

#

not overwrite

bronze yoke
#

well... they don't πŸ˜…

robust briar
#

if you are about to tell me, i can jsut copy the txt file

#

and remove the items

#

I will go cry

bronze yoke
#

if you have multiple script files with the same name and directory only the one that belongs to the latest loading mod is used

robust briar
#

AHHH

#

please hold while I go find a toaster and bathtub

cunning crest
#

any tutorial to create UIElements, Drag, etc...

#

??

sour island
#

If I added a mod to the requirement in steam, that wouldn't break any servers right?

bronze yoke
#

no, steam requirements don't do anything beyond the pop-up warning

sour island
#

I know adding required mods to the modInfo breaks servers cause dedicated servers don't get any warnings and just drop mods missing requirements

#

Thinking of starting to blanket require my errorMag mod 😩

#

And maybe merge fingerPrint into it

gilded hawk
sour island
#

Need to add that to the issues for community projects

#

Maybe there's something that can be done

mellow frigate
#

Should'nt the problems only come for clients using steam (and so having the auto update of the mods) while playing no-steam on a disconnected server? Or am I missing something ?

bronze yoke
#

adding an item as a steam requirement won't make servers download that item

mellow frigate
bronze yoke
#

no, server never automatically adds new workshop items

mellow frigate
#

When I start my pz with steam, am I also wrong to think my subscribed mods update automatically ?

bronze yoke
#

they do

bronze yoke
#

steam requirements don't do anything besides a pop-up when you subscribe telling you to also get the requirements

mellow frigate
fast galleon
mellow frigate
fast galleon
#

@bronze yoke Can you update the game while it is open?

bronze yoke
#

the game, probably not, if you mean workshop items, not sure

#

there's a steam setting to allow downloads while playing a game, not sure if that still blocks same game workshop though

sour island
#

I don't think it even activates the mod if it were to be downloaded either

wet sandal
#

I can download mods with Zomboid open

#

If you trigger a lua reload they'll be good to go

fast galleon
mellow frigate
#

Hello there, I'm playing with GlobalObject and I did not find how to detect the client object destruction event. Any idea what I should use for that ? Could I use OnObjectAboutToBeRemoved or is it only server-sided ?

fast galleon
#

It triggers for the client on whose side it breaks but not for everything. On server it should trigger for everything I think.

mellow frigate
fast galleon
#

What do you want to do exactly?

#

Would knowing when a client lua object is removed be enough?

mellow frigate
fast galleon
#

This would be triggered on all clients, even if square is not loaded.

red tiger
#

Good evening.

ancient grail
gilded hawk
#

Is there a way to preview a single clothing item in a UI box, like it's done in the Improved Hair Menu?

eg: in image

#

Like, is there anyway to instead of having a player, an object is rendered here? in ISUI3DModel

trim mist
#

Does anyone know why this causes a black screen on mod load?

TraitTags = {}

local function sanitizeTags(tagString)
    --remove all spaces, control characters, null, punctuation & symbols (except commas)
    local workString = tagString:gsub('[^%w,]', '')
    return workString;
end


function TraitTags:toString()
    local returnString = "";

    for trait, tagTable in pairs(self)
    do
        if type(tagTable) == "table"
        then
            returnString = returnString..trait..": ";
            returnString = returnString..table.concat(tagTable, ',');
            returnString = returnString.."; ";
        end
    end

    return returnString;
end

...

function TraitTags:PlayerTagCountLargerThan(player, subjectTag, comparatorTag)
    local stats = self:getPlayerTagStatistics(player);
    local subjectIndexS, subjectIndexE = stats:find(subjectTag);
    local comparatorIndexS, comparatorIndexE = stats:find(comparatorTag);

    if subjectIndexS ~= nil and comparatorIndexS ~= nil
    then
        if subjectIndexS > comparatorIndexS
        then
            return true;
        else
            return false;
        end
    else
        if getDebug()
        then
            print("TraitTags: PlayerTagLargerCountThan(): One or more of the given tags is null");
        end
        return nil;
    end
end


ModData.add(TraitTags);
#

This is the last thing in the log

bronze yoke
#

sounds like an infinite loop

trim mist
#

My best guess is that I'm making global mod variables wrong lol

trim mist
bronze yoke
#

no errors but endless black screen usually means an infinite loop

trim mist
#

fair enough lol

bronze yoke
#

i don't think this would cause the issue, but ModData.add() at lua load wouldn't work

#

moddata is save specific and lua loads on the main menu

#

actually, are you adding your whole class to moddata?

trim mist
#

My hope was that I was creating a table with some functions in it and adding that to moddata

bronze yoke
#

functions can't be saved to moddata, i think it might work until it tries to save anyway but it feels like you might be misunderstanding the purpose of moddata if you're trying to do that

trim mist
#
local function TTInit()
    ModData.add(TraitTags);
end

Events.OnNewGame.Add(TTInit);

So if I stuck this at the end, that's one problem fixed?

trim mist
#

like whenever I make a change and save in my environment and reload the file, the data I need is cleared out and messes with my testing. That's why I was trying to shove it in a more persistent place

#

but I could still maybe... make a TraitTags object that gets returned and can use the functions I have? And I'll just have the tags I need in moddata?

bronze yoke
#

if it's just for testing, you can just keep it in the global namespace and make sure your code doesn't overwrite it if it already exists

#

you generally only want to use moddata when you want data to be persistent to that save file

trim mist
#

I definitely want this data to be persistent to the save file. Hopefully that will take care of it working in MP as well

#

I think I'm gonna try to separate the functions out from the data I need by turning all the "TraitTags:[function name]"s into "local function [function name]"s. Just unclear what to do with the "selfs" I have floating around. That won't automatically reference the TraitTags Table, will it?

#

And just an aside, this is the thing I was working on like a week ago that will allow you to assign persistent groups (defined by a tag) to traits, so if there's a gameplay mechanic you want affected by a trait (like a model, UI, or something), you won't have to code out the possibilities per trait, just per trait group (as defined by a tag)

#

My use case in particular is, if someone selects a trait like "Hoofed" from the Anthro Traits mod i'm in the middle of finishing, if they have Anthro Survivors installed, they could only select a species with hooves at character creation

sage eagle
#

@heady crystal did you figure out if reusable needles is worth being added to common sense

mellow frigate
#

Hello again, Is there already a vanilla fully transparent sprite available ?

mellow frigate
silver widget
#

hay guys is there a way to make the avatar panal in the character creation screen bigger ? ive been at it for a few days now but i cant figure it out - that or i cant get my file to show up in game ... this is what i have so far
https://pastebin.com/qCtPpw9d

silver widget
#

True and real lol... I'll see if I can get the same effect on the character creation screen

sage eagle
#

all good

trim mist
silver widget
#

Hmm I feel like it might be a bit different as I may need to modify characterCreationHeader to get the adjustment i want but I can't get it to show up in game

tawdry solar
#

the brackets are closed correct?

#

ig it wasnt

heady crystal
#

No you had two open brackets there

tawdry solar
#

i saw

#

omfg

#

i didnt even do the model code

heady crystal
#

What are you doing?

tawdry solar
#

a weapon

heady crystal
tawdry solar
#

im too tierd for this shit

#

but i really want to get this done

#

and i forgot how brackets work

heady crystal
#
{
    -- Stuff
}
tawdry solar
#

i thought thats how it worked

#

huh

#

when i try and place a bracket it foes {}

wet sandal
#

Ok... hear me out.

#

Gravity.

#

(Will be a sandbox option, not default)

tame mulch
barren kraken
#

dunno if this is a dumb question or not but is there any easier way to fill out a distribution file? like get AI to write it or something?

#

anything to just do it easily i dont wanna copy paste the code for an hour for 120 items 😭

lone nest
#

there are worse deaths than to dying by playing tetris.

wet sandal
#

Lol

drifting ore
pearl citrus
# wet sandal

oh man, flashbacks to the era of flash games...
must neatly stack.......

novel swallow
#

that's what I did/do, there's probably a tool chain somewhere that does it already

thorn bane
# wet sandal

How hard would it be to make the squares smaller, but the items take the same space? Think Neo Scavenger style

tropic hedge
#

Hello everyone
where am i wrong? The events are not triggered.

Thank you

Client-side

require("MyDebugServer")

local function onServerResponse(player, command, args)
    print("onServerResponse")
    --if command == "exampleResponse" then
    --    local response = args[1]
    --    print("Received server response:", response)
    --end
end

local function sendServerRequest()
    print("sendServerRequest")
    local player = getPlayer()
    sendClientCommand(player, "exampleCommand", "AAAAAA", {})
    -- sendServerCommand(player, "exampleCommand", "AAAAAA", {})
end

Events.OnKeyPressed.Add(sendServerRequest)
Events.OnServerCommand.Add(onServerResponse)
--Events.OnClientCommand.Add(onServerResponse)

Server-side

local function handleClientRequest(player, command, args)
    print("handleClientRequest")
    local response = "Hello from the server!"
     sendServerCommand(player, "exampleResponse", response, {})
     -- sendClientCommand(player, "exampleResponse", response, {})

    --if command == "exampleCommand" then
    --    print("handleClientRequest")
    --    local response = "Hello from the server!"
    --    sendServerCommand(player, "exampleResponse", response)
    --end
end

Events.OnClientCommand.Add(handleClientRequest)
-- Events.OnServerCommand.Add(handleClientRequest)
tame mulch
# tropic hedge Hello everyone where am i wrong? The events are not triggered. Thank you Clie...

Client

require("MyDebugServer")

local function onServerResponse(module, command, args)
    print(args[0])
end

local function sendServerRequest()
    print("sendServerRequest")
    local player = getPlayer()
    sendClientCommand("MyMod", "exampleCommand", { "A" })
end

Events.OnKeyPressed.Add(sendServerRequest)
Events.OnServerCommand.Add(onServerResponse)

Server

local function handleClientRequest(module, command, args)
    print("handleClientRequest - " .. args[1])
    local response = "Hello from the server!" 
    sendServerCommand(module, "exampleResponse", { response })
end

Events.OnClientCommand.Add(handleClientRequest)
tropic hedge
tame mulch
#

Can you send console.txt?

tropic hedge
fading horizon
#

How do i set a drainable water container's water level?

#

I want to completely drain the water bottle

neon bronze
#

Remove the water bottle and spawn in an empty bottle

fading horizon
#

I guess I could do it that way

#

but I also don't always want to remove 100% of it

#

id like to add future ability to only do 50%, 25%, etc

#

would it be as simple as setting self.item.waterUnit = WATERLEVEL;?

neon bronze
#

Then youd need to set its used delta i think i dont really know

tame mulch
tropic hedge
tame mulch
tropic hedge
tropic hedge
sick yew
#

Is it possible to calculate the amount of indoor zombies?

tame mulch
sick yew
#

Apparently there are maps per cell how many spawn indoors

tame mulch
#

You can't check unloaded cells

sick yew
#

I always wanted to fiddle with pop to get a quarter mil

#

Now I'm not sure whether to do 4.5 or 12x

tropic hedge
fickle relic
#

Heylo! I'm a newbie at Zomboid mod making πŸ™‚ I'd like to be able to display a tooltip on hover, when the user hovers over Containers in the game.

I know that the functionality is probably somewhere in lua/client/ISUI.

Are there any other mods folks can think of that display a UI tooltip when hovering over items in-world? That I can look at to start with

thin hornet
fickle relic
wet sandal
spice saddle
fickle relic
fast galleon
solid dawn
#

Does anyone here know if there is a way to make a trait mutually exclusive to an occupation/profession.

For some reason making traits exclusive to profession traits instead of regular selectable traits doesn't seem to work

stiff minnow
#

Does anyone know if its possible to add new information and numbers in this area (circled) which would have different numbers for each vehicle?

tawdry solar
#

omg

#

it was the smae thing

#

i dont fucking get it

iron trellis
#

i know this is a dumb question, but how do i get started with making a food mod? i've been wanting to make a mod that adds some more snacks/foods (ex. bottles of juice, chips, candy, etc.), yet i have no idea where to even start from. i checked google, and no useful info appeared. could someone lend me a helping hand?
(plus i have like really slim modding experience, having made only 3 mods (two of them being addons)

worldly olive
iron trellis
#

awesome, thanks! though it really sucks that basically all of the links don't direct to anything anymore :p

red tiger
spice saddle
red tiger
spice saddle
#

very nifty

red tiger
gilded hawk
# red tiger

Is this with the new lua toolset you are working on?

red tiger
gilded hawk
#

link link link

#

😻

spice saddle
#

i just might have to learn ts, god dang

red tiger
#

That's PipeWrench.

#

You could mix TS and Lua and use both typings too.

gilded hawk
#

Didn't another guy use Umbrella as base for another tool? πŸ€”

red tiger
#

This is a collaborative effort BTW.

gilded hawk
#

Ah cool!

red tiger
#

I rewrote the PipeWrench Java API generator for Candle.

#

Candle is my Java API rendering tool for Umbrella.

gilded hawk
#

Wow Impressive!

red tiger
#

Candle does something else.

#

I wrote a project called PZ-Rosetta which scrapes the JavaDocs and saves documentation from PZ's official code like parameter names to a Yaml dictionary.

#

That data is picked up and rendered with the exposed Java API.

#

So basically (arg1, arg2) is replaced with (x, y)

gilded hawk
#

uuuh, pretty

#

What kind of black magic is doing that? πŸ€”

red tiger
#

PZ-Rosetta opens the door for modders to add to the documentation too, in non-English even.

spice saddle
#

man you three are like mod dev tool all star team

red tiger
#

I'd like to activate the Russian modding community when I write a tool to make this process easy to do.

#

Would be sick to see a flavor of Umbrella with Russian documentation on the game's API.

bronze yoke
#

it also includes my event stubs, which are generated using, as far as i know, the only up to date event schema

red tiger
#
- name: invokeOnPlayerInstance
    modifiers:
      - public
      - static
    return:
      type: void
    notes: >-
      The IsoPlayer.instance thread-safe invoke.
        Calls the supplied callback if the IsoPlayer.instance is non-null.
        Performs this in a thread-safe manner.

        It is intended that, should any thread intend to use the IsoPlayer.instance, and does not want another thread
        to change the ptr in the meanwhile, it should call invokeOnPlayerInstance(Runnable callback)

        eg.
        IsoPlayer.invokeOnPlayerInstance(()->
          {
              IsoPlayer.instance.doStuff();
          }
#

Stuff extracted from the official JavaDocs.

tawdry solar
#

could somone help me with my brackets

gilded hawk
tawdry solar
#

but idk why

red tiger
#

You don't post the entire script yet ask about bracket issues?

tawdry solar
#

it just is red on vsc

red tiger
#

Walk through your file.

tawdry solar
#

im booting vsc up

red tiger
#

Your plan of action is confusing.

#

Make sure that your brackets are even.

tawdry solar
#
{
    
}
    item Naginata
    {
        MaxRange    =    1.55,
        WeaponSprite    =    Naginata,
        MinAngle    =    0.8,
        Type    =    Weapon,
        MinimumSwingTime    =    2,
        KnockBackOnNoDeath    =    FALSE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    Improvised;Spear,
        ConditionLowerChanceOneIn    =    10,
        Weight    =    1.5,
        SplatNumber    =    1,
        PushBackMod    =    0.3,
        SubCategory    =    Spear,
        ConditionMax    =    12,
        MaxHitCount    =    2,
        DoorDamage    =    10,
        SwingAnim    =    Spear,
        DisplayName    =    Naginata,
        MinRange    =    0.98,
        SwingTime    =    2,
        KnockdownMod    =    0,
        SplatBloodOnNoDeath    =    TRUE,
        Icon    =    Dudclub,
        RunAnim    =    Run_Weapon2,
        IdleAnim    =    Idle_Weapon2,
        TreeDamage  =   0,
        TwoHandWeapon = TRUE,
        CriticalChance    =    30,
        CritDmgMultiplier = 10,
        MinDamage    =    1.3,
        MaxDamage    =    2,
        BaseSpeed = 0.9,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        BreakSound  =   SpearMacheteBreak,
        HitFloorSound    =    SpearMacheteHit,
        ImpactSound    =    SpearMacheteHit,
        DoorHitSound = SpearMacheteHit,
        HitSound    =    SpearMacheteHit,
        SwingSound    =    SpearMacheteSwing,
        AttachmentType = Shovel,
        Tags = FishingSpear,
    
        model Naginata
                {
                mesh                 = weapons/1handed/Naginata,
                attachment world
                {
                        offset = 0.0000 -0.1660 0.0070,
                        rotate = -180.0000 0.0000 0.0000,
                }
            }
    }
}
#

there

red tiger
#
    item Naginata {
        MaxRange = 1.55,
        WeaponSprite = Naginata,
        MinAngle = 0.8,
        Type = Weapon,
        MinimumSwingTime = 2,
        KnockBackOnNoDeath = false,
        SwingAmountBeforeImpact = 0.02,
        Categories = Improvised;Spear,
        ConditionLowerChanceOneIn = 10,
        Weight = 1.5,
        SplatNumber = 1,
        PushBackMod = 0.3,
        SubCategory = Spear,
        ConditionMax = 12,
        MaxHitCount = 2,
        DoorDamage = 10,
        SwingAnim = Spear,
        DisplayName = Naginata,
        MinRange = 0.98,
        SwingTime = 2,
        KnockdownMod = 0,
        SplatBloodOnNoDeath = true,
        Icon = Dudclub,
        RunAnim = Run_Weapon2,
        IdleAnim = Idle_Weapon2,
        TreeDamage = 0,
        TwoHandWeapon = true,
        CriticalChance = 30,
        CritDmgMultiplier = 10,
        MinDamage = 1.3,
        MaxDamage = 2,
        BaseSpeed = 0.9,
        DamageCategory = Slash,
        DamageMakeHole = true,
        BreakSound  =   SpearMacheteBreak,
        HitFloorSound = SpearMacheteHit,
        ImpactSound = SpearMacheteHit,
        DoorHitSound = SpearMacheteHit,
        HitSound = SpearMacheteHit,
        SwingSound = SpearMacheteSwing,
        AttachmentType = Shovel,
        Tags = FishingSpear,
    
        model Naginata {
            mesh = weapons/1handed/Naginata,
            attachment world {
                offset = 0.0000 -0.1660 0.0070,
                rotate = -180.0000 0.0000 0.0000,
            }
        }
    }
}
tawdry solar
#

ty

red tiger
#

If someone wants to help explain these fixes, please do. Am at work.

#

Figured it would be best to simply show you the format.

tawdry solar
#

what was wrong

bronze yoke
#

no module and unbalanced brackets

red tiger
#

I'm going to go mad if b42 doesn't have formatted scripts.

tawdry solar
#

oh

#

can somone help me my model doesnt show ingame but i think its all fine

module Base {
    item Naginata {
        MaxRange = 1.55,
        WeaponSprite = Naginata,
        MinAngle = 0.8,
        Type = Weapon,
        MinimumSwingTime = 2,
        KnockBackOnNoDeath = false,
        SwingAmountBeforeImpact = 0.02,
        Categories = Improvised;Spear,
        ConditionLowerChanceOneIn = 10,
        Weight = 1.5,
        SplatNumber = 1,
        PushBackMod = 0.3,
        SubCategory = Spear,
        ConditionMax = 12,
        MaxHitCount = 2,
        DoorDamage = 10,
        SwingAnim = Spear,
        DisplayName = Naginata,
        MinRange = 0.98,
        SwingTime = 2,
        KnockdownMod = 0,
        SplatBloodOnNoDeath = true,
        Icon = Dudclub,
        RunAnim = Run_Weapon2,
        IdleAnim = Idle_Weapon2,
        TreeDamage = 0,
        TwoHandWeapon = true,
        CriticalChance = 30,
        CritDmgMultiplier = 10,
        MinDamage = 1.3,
        MaxDamage = 2,
        BaseSpeed = 0.9,
        DamageCategory = Slash,
        DamageMakeHole = true,
        BreakSound  =   SpearMacheteBreak,
        HitFloorSound = SpearMacheteHit,
        ImpactSound = SpearMacheteHit,
        DoorHitSound = SpearMacheteHit,
        HitSound = SpearMacheteHit,
        SwingSound = SpearMacheteSwing,
        AttachmentType = Shovel,
        Tags = FishingSpear,
    
        model Naginata {
            mesh = weapons/2handed/Naginata,
            attachment world {
                offset = 0.0000 -0.1660 0.0070,
                rotate = -180.0000 0.0000 0.0000,
            }
        }
    }
}
#

i had to update my code a bir

sick yew
#

Hi mod makers

#

I'm going to ask, how difficult would it be to make agorophobic not mutually exclusive with adrenaline junkie?

red tiger
red tiger
# tame mulch Very cool!

I'd like to get this project exposed to the public. Let me know what I can do if you have ideas for that.

#

Might make a steam guide, a forum post, and a reddit post.

tame mulch
red tiger
tame mulch
red tiger
#

I wish that Git would allow media embeds for git projects to show a graphic for the repository and not the account / org's picture. =(

weary matrix
#

Any clue if TIS fixed their broken RCON implementation?

spice saddle
#

What was broken about it? Just curious

tame mulch
weary matrix
# tame mulch I think not yet. I hope request about RCON on TIS forum?
magic halo
#

I needed to spawn a car when the onCreate function was called in the recipe script on the multiplayer server, could anyone help me? it seems that addVehicleDebug does not generate the car on the server

weary matrix
weary matrix
red tiger
weary matrix
# weary matrix This looks similar to what I've been experiencing: https://theindiestone.com/for...
magic halo
stiff minnow
#

Is it possible to create a mod that adds new information in the mechanics menu?

tame mulch
#

hmmm, wait. It will works only for admins

#

You need for any player?

magic halo
red tiger
#

I need to write a Steam guide on how to splice PZ mods to write exclusive content on servers.

#

The code is already provided to make this possible.

#

It utilizes the Lua BufferedInputStream API to separate code that is then bootloaded into the mod after requesting it from the client-side via mod.

weary matrix
# magic halo yes I am creating a car shop that spawns a car when making the recipe

Try to check if this logic can be reproduced from Lua. This code is from the /addvehicle command in the engine:

                                IsoGridSquare square = ServerMap.instance.getGridSquare(int1, int2, int3);
                                if (square == null) {
                                        return "Invalid location " + int1 + "," + int2 + "," + int3;
                                } else {
                                        BaseVehicle baseVehicle = new BaseVehicle(IsoWorld.instance.CurrentCell);
                                        baseVehicle.setScriptName(string);
                                        baseVehicle.setX((float)int1 - 1.0F);
                                        baseVehicle.setY((float)int2 - 0.1F);
                                        baseVehicle.setZ((float)int3 + 0.2F);
                                        if (IsoChunk.doSpawnedVehiclesInInvalidPosition(baseVehicle)) {
                                                baseVehicle.setSquare(square);
                                                baseVehicle.square.chunk.vehicles.add(baseVehicle);
                                                baseVehicle.chunk = baseVehicle.square.chunk;
                                                baseVehicle.addToWorld();
                                                VehiclesDB2.instance.addVehicle(baseVehicle);
                                                return "Vehicle spawned";
                                        } else {
                                                return "ERROR: I can not spawn the vehicle. Invalid position. Try to change position.";
                                        }
                                }
tame mulch
stiff minnow
#

Is it even possible to create a weight system for every vehicle to be different and show hiw much the vehicle weighs in the mechanics menu? I think it would be cool if it was possible but do not know where to start in creating a mod like this

magic halo
lyric turtle
#

And it does have an effect over vehicle's performance, its just not that noticeable

tame mulch
gaunt meteor
#

MapRemotePlayerVisibility anyone know where this is handled?

#

i mean. not the ini, but the lua side

stiff minnow
gaunt meteor
stiff minnow
#

Not to my understanding... but if it is, then it would be atleast more visual... showing numbers and such

gaunt meteor
#

thank you

lyric turtle
#

Then again, its not that noticeable due to how vehicles handle

#

Notice how you can only reach high rpms in reverse with Speed Demon

red tiger
#

Never not a golden opportunity to Java mod. breakdance

mellow frigate
#

Hum my link to the fresh export from Albion's events tool is down. Anyone knows where I can find one ? (wiki is still on B41.65) @bronze yoke

bronze yoke
bronze yoke
#

i don't expect it to move again, the project was very disorganised before this

mellow frigate
cunning crest
#

hi guys, we can centered a ISUIElement or just set x,y position?

tame mulch
#

and then use set x y

cunning crest
#

ahh okey

#

and u know any tutorial to create ui elements?

#

walked me through the documentation

bronze yoke
#

it's not the stubs, it's just an md reference

tame mulch
cunning crest
#

Ok, I'll try on my own then

#

thx

red tiger
#

RadialMenu drawCircle API call when?

#

Also AngelCodeFont API support for ISUIElement font draw calls when?

#

I'd like to round the corners of my UI.

wet sandal
#

Nah, nice square boxes ⏹️

spice saddle
#

what kind of objects are accessible in debug lua console?

bronze yoke
#

everything exposed that you can grab an instance of

tame mulch
red tiger
#

Actually 3. One is annoying.

tame mulch
red tiger
#

GLSL can be used to draw and discard areas of the screen that can be calculated to create these round corners.

#

You can also draw polygons with GL11 calls using radius and resolution.

#

This could be achieved using the BasicSpriteRenderer implementation yall have.

#

You can do sprites but this limits to what's available.

#

PZ doesn't actually have any communication layer between GLSL shaders and Lua.

#

This would make the GLSL approach not possible.

#

I modded PZ's core render code to see if UI shading would be possible and useful. Spoiler Alert: It totally is.

#

So much so that I'd give my async Shader Uniform API if TIS were willing to modify it how they see fit and implement it.

tame mulch
#

We have some plans about UI. But not for 42

cunning crest
#

hi again, what is this params:

InventoryItem(String module, String name, String type, String tex)

#

how can i get a player inventory

red tiger
#

I'm talking about GLSL Uniform accessibility, not UI implementations.

#

That's a separate thing.

tame mulch
red tiger
#

Sure thing.

cunning crest
#

how can i get InventoryItem when dragging a item with the mouse?

tame mulch
cunning crest
#

I want that when I drag a weapon to a box I have created with ISUIElement, this weapon is equipped on the character.

wet sandal
#

Isn't it (not at a computer) ISMouse.dragging?

#

There's a static object the inventory populates with the stack of items your dragging

#

The property name is definitely .dragging

wet sandal
#

ISMouseDrag.dragging

cunning crest
#

Ye thx

#

One question, is it possible to modify an already created mod to fix or change some functionality and use this modified mod on my server and have other players use this mod?

weary matrix
red tiger
#

Silly mod drama things. x)

mellow frigate
weary matrix
#

if you used code from the original mod then it would be obvious copyright infridgement

red tiger
gilded hawk
#

What's the diffference betwen onGameBoot and OnGameStart?

red tiger
#

I specifically write code with the understanding that I can use that approach more quickly as a CRD approach to avoid legal issues.

weary matrix
red tiger
gilded hawk
#

Okay makes sense thank you

cunning crest
#

Jab I am using your library to transpile TS to Lua, but I see that there are types that do not appear in the java doc, is this ok?

weary matrix
#

hum, I'm getting a weird behavior with mod dependencies. I have two mods with require=MySuperMod in their mod.info. When I try to enable first mod, it correctly enable MySuperMod, but not for the second one. Any clue what might be the culprit?

#

I double checked for typos etc

#

arf, I had the non-working mod in a modpack I subscribed for testing πŸ˜…

#

but isn't Zomboid/mods supposed to take precedence over steam mods?

gilded hawk
#

I had the same issue, I remember it had precedence, but something has changed

bronze yoke
#

it seems inconsistent

errant lichen
#

Anyone know of a mod that provides a hub like environment?

bronze yoke
#

i've had cases where either one takes priority, and i've even had strange cases where the local mod takes priority but the sandbox-options.txt from the workshop mod is loaded

errant lichen
#

something like a hypixel hub?

weary matrix
#

@gilded hawk @bronze yoke thx for confirming I'm not crazy πŸ˜‚

#

@tame mulch Any plan to have a fully working implementation of loadstring()?

#

it seems to be working for simple values/expressions but for example functions and events seem to be ignored/missing when loaded through loadstring()

red tiger
magic halo
# tame mulch Check my messages above in this chat. I send some info about commands today or y...

I'm probably doing something wrong... would that be it? This gives an error on sendClientCommand()

-- Arquivo media/lua/client/client.lua --

AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};

function AUESP_Economia.sendCommandToServer(module, command, args)
    local player = getSpecificPlayer(0);
    sendClientCommand(player, module or "AUESP_Economia", command, args or {});
end

Events.OnServerCommand.Add(function (module, command, args)
    if module == "AUESP_Economia" then
        if AUESP_Economia.commands[command] then
            AUESP_Economia.commands[command](args);
        end
    end
end);

-- Arquivo media/lua/server/onTest.lua --

AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};

function Recipe.OnCreate.BuyCarChevalierCeriseWagon(items, result, player)
    local sortnum = ZombRand(2);
    local arguments = {};

    if sortnum == 0 then
        arguments["vehicleName"] = "Base.CarStationWagon";
    else
        arguments["vehicleName"] = "Base.CarStationWagon2";
    end

    AUESP_Economia.sendCommandToServer(player, "AUESP_Economia", "SpawnVehicle", arguments);
end

-- Arquivo media/lua/server/spawnVehicle.lua --

AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};

function AUESP_Economia.commands.SpawnVehicle(player, args)
    local vehicleName = args["vehicleName"];
    local vehicleSkinID = args["vehicleSkinID"];
    local isoDir = args["isoDir"] or IsoDirections.S;
    local coordToSpawn = player:getSquare();

    local vehicle = addVehicleDebug(vehicleName, isoDir, vehicleSkinID, coordToSpawn);
end
tawdry solar
#

hello aitreon

tame mulch
red tiger
#

@tame mulch BTW that Rosetta project that is extracted details from the JavaDocs? I'm writing a software that allows third-parties to generate their own docs. This will open the door for projects like Umbrella to support Russian-translated / Russian-written docs.

magic halo
weary matrix
#

now it seems to be working perfectly

#

wondering why though πŸ˜…

red tiger
#

I use PZ-Rosetta as a library to sprinkle over Candle, the Java API portion of Umbrella.

tame mulch
red tiger
#

You could modify this dataset with non-English documentation.

#

arg parameter names becomes the names from the docs, and even their TIS documentations are brought over.

tawdry solar
#

aitreon is it allowed to retexure vanilla cars?

tame mulch
tame mulch
tawdry solar
weary matrix
# magic halo

I'm not sure but it looks like you're passing a value that java tries to cast to something it shouldn't

red tiger
tawdry solar
#

so it makes sense

tame mulch
red tiger
#

I thought I'd let you know. Perhaps you'd find it interesting.

#

Modders could document where is needed.

#

English aand non-English.

tame mulch
#

Yep, this is cool option

red tiger
#

We are all patchworks of knowledge on how things work.

bronze yoke
#

something is jumbled there

magic halo
red tiger
#

Use {arg1=foo, arg2=bar} instead of arg1, arg2. It's not a varargs.

bronze yoke
#

in this case, you are passing the player object as the module

#

@magic halo AUESP_Economia.sendCommandToServer(player, "AUESP_Economia", "SpawnVehicle", arguments); means you are calling
function AUESP_Economia.sendCommandToServer(module = player, command = "AUESP_Economia", args = "SpawnVehicle")

#

everything's jumbled so it breaks when it tries to call the java method which is expecting completely different parameters

magic halo
#

OMG, I fixed what you said here and it worked perfectly! Thank you very much! @bronze yoke

#

Thank you for your patience guys, I really appreciate it

weary matrix
magic halo
#

I'll send here a preview of the mod

sage eagle
#

@heady crystal what was added in the most recent update for common sense

heady crystal
#

Check the update notes ded

sage eagle
#

it doesnt say anything for may 30

#

just 2.1.0

#

whoops

#

my dumbass

#

sorry for pinging you

#

i shouldve read more

#

aww

heady crystal
#

It's okay

sage eagle
#

no reuseable needles

heady crystal
#

I am working on an update right now

sage eagle
#

T_T

heady crystal
#

But it's coming next week or so

#

Can't update too frequently

#

It includes a ||sound overhaul||

sage eagle
#

me still a bit sad

#

but that news made me feel a bit better

heady crystal
#

I only found this about resugin needles so far:

sage eagle
#

too in depth

#

its for suturing

#

those look like injection needles

heady crystal
#

Exactly

#

Suture needles gotta be used even more!

sage eagle
#

i meant suture needles

#

they work differently

#

you poke through the skin and flesh

heady crystal
#

I'd have to find a surgeon to make sure

sage eagle
#

its more a matter of keeping it clean

#

so you dont get infected

#

also

#

mod reccomendation

#

zombie bites cause deep wounds

#

cause ya know, flesh getting torn off you is probably gonne be a little deep

heady crystal
#

@sage eagle

fickle relic
#

I'm struggling to debug my mod - I can't see any of my print() commands come through to the debug log. Does anyone have a recommendation of an easy Events hook I can hook into & trigger on command just to test a simple print to console command?

fickle relic
#

Thank you 😊

sage eagle
#

you should still make it

#

lmao

#

i would download it

#

just add thread to it lmao

merry cradle
#

Hey guys/gals, I'm working on a mod that removes bandages/wounds from spawned zombies. Giving them a cleaner look. Does anyone know which .lua file contains the logic for that? I've been scanning around for a couple hours and haven't been able to find it.

bronze yoke
#

i'd expect it to be java

#

never looked into that specifically before, but at a guess

pliant yarrow
#

I'm working on a mod to adjust stats on food and everything's working fine but I want it to ignore unopened canned food because unopened canned food shouldn't display stat changes. I'm new to modding and to adjust the stats of those foods I tried to call on the CantEat line in items_food.txt but no matter how I try it just calls nil. I have no idea what I'm doing and my girlfriend can't help me at the moment so I was wondering if anyone here had any ideas.

trim mist
#

Or i guess it didn't really fit my use case. But that's an option

pliant yarrow
#

I'm trying to adjust the happiness and boredom on food. I'm basically making a mod to randomly assign your character picky eater traits, so certain foods make you happy and certain make you unhappy

trim mist
#

That seems cool af

#

I did something very very similar actually

bronze yoke
#

can you show the code you're using?

pliant yarrow
#

And like I said it's all working for the most part so far, but I want canned foods to not display that they make you unhappy when they're unopened. I figure I just need to multiply the unhappiness and boredom by zero but like I said I have no clue how to call upon the canned food specifically

bronze yoke
#

oh, i think they actually have a special property...?

trim mist
#

I'm pretty sure there is an IsCanned or IsContainer property

pliant yarrow
#

There is, but that affects both opened and closed canned food

bronze yoke
#

ah, i see that now

pliant yarrow
#

The only variable that closed canned food has that opened canned food doesn't is CantEat = True

bronze yoke
#

those properties don't seem accessible...

trim mist
#

So why are you trying to adjust the cantEat line when you just need to change its happiness values?

bronze yoke
#

i think they're just trying to automatically detect these items

pliant yarrow
#

Yeah, I am, I'm trying to detect if CantEat = true then unhappyness * 0 etc. essentially

bronze yoke
#

a hacky way could be to regex the item name, or check the model as they seem to all have CanClosed as their static model

#

it might not interact nicely with modded food though

bronze yoke
#

i feel most mods will probably follow the item name pattern

trim mist
#

worse comes to worst you can detect if said food-adding mods are activated and do the same thing you're doing now to the applicable foods

pliant yarrow
#

I appreciate the help. Like I said, it's my first mod and I have no modding experience. My girlfriend is the one with all the experience and knowledge but she's asleep and she recommended I check here if I have any problems.

bronze yoke
#

you could save yourself the regex and just go if luautils.stringStarts(name, "Canned") and not luautils.stringEnds("Open")

#

that seems like it would catch all the vanilla closed food cans

trim mist
#
Base.CannedCornedBeefOpen
Base.CannedSardinesOpen
base.OpenBeans
base.CannedCarrotsOpen
base.CannedCornOpen
base.CannedFruitCocktailOpen
base.CannedPeachesOpen
base.CannedPeasOpen
base.CannedPineappleOpen
base.CannedPotatoOpen
base.CannedTomatoOpen
base.TinnedSoupOpen

pretty sure these are the IDs of all the vanilla opened cans

bronze yoke
#

OpenBeans stressed

trim mist
#

yeah i need to double check that one lmao

bronze yoke
#

it seems correct

bronze sand
bronze yoke
#

tinnedsoup too... this is a pain

#

i guess you'd just have to have special exceptions for those two, and hope mods don't deviate too much

#

TunaTin stressed

trim mist
#

wait TUNA TIN

#

I missed one?! lmao

bronze sand
#

@fading horizon
Did you happened to see the last suggestions I made in Backpack Flags?

bronze yoke
#

yeah, i think if you combine that pattern with a lookup table of special exceptions it might work

fading horizon
#

yes, i've just been really busy with other things

bronze sand
#

Steam nuked All of the comments I ever did

pliant yarrow
#

Thank you both nyannHappy

bronze sand
#

Because I tried to share a translation to a mod with a Google Drive link

fading horizon
#

i'm able to see them still

#

since i'm admin of this mod

#

that's cool actually

#

didn't know that

bronze sand
#

Ohhh

#

I also didn't

bronze sand
#

That's good

fading horizon
#

this is what ive been working on recently

#

prosthesis mod

#

i'm also about to upload another mod rn

bronze sand
#

Oh, cool

merry cradle
unreal canyon
#

Omg prosthesis would be so cool

bronze yoke
#

boss...

fading horizon
#

i tried playing the game earlier...

#

game kinda boring

#

making mods is more fun

#

lol

unreal canyon
#

I'm guessing that you cant get scratches or anything on artificial limbs, it'd be interesting to see how you deal with them being damaged

bronze sand
#

Sekiro and The Walking Dead come to mind for the potential with Prosthesis

bronze sand
bronze sand
#

The first for how the damage works, the latter for how repairing them does

trim mist
bronze sand
unreal canyon
#

wait no ultimate zombie movie prosthetic, Ash Williams chainsaw arm

bronze yoke
#

in notepad no less

trim mist
#

pff rip

bronze yoke
#

you could quite easily write regex to extract item names if you needed something like that

trim mist
#

Well, I went through the game's debug mode item spawner thing

bronze yoke
#

that's probably faster

trim mist
#

I missed the tuna so I want to slap that into a file I have

bronze yoke
#

an item browser might be a fun tool... out of my depth though

#

the event stub generator is the deepest i've dove into tool creation

trim mist
pliant yarrow
#

I am not a very technical person so I don't know if I know how to answer. My girlfriend has helped write a good deal of the code. I really have like no clue what I'm doing without her SilverSweat

#

I can do very basic functions and that's about it

trim mist
#

fair enough. I'm doing the same concept with my mod that I've been working on (for too long)

#

I was curious to see if there was a better way to do what I was doing, and if not whether or not I could help

pliant yarrow
#

I'm not the best person to ask. My girlfriend recommended I look at other people's similar mods for ideas on how they handle things and that has helped a bit but I haven't found anything exactly like what I need. I've found some that come close that have helped a bit, but my mod got a bit more complicated SilverSweat

trim mist
pliant yarrow
#

I referred to the mod Dog Food Isn't That Bad for a large part of the coding for picky vs. non-picky eating, but as I said it's not perfect because I need to make multiple categories of picky eaters so you can be randomly assigned multiple traits and stuff

trim mist
#

So you take the trait and the categories you don't like are randomly assigned?

pliant yarrow
#

Yes, it's part of a larger mod

bronze yoke
#

that sounds pretty fun, if you could choose it'd likely get pretty stale

trim mist
#

Not to mention the meta. I can imagine going someone going "Lets get some free points by taking Picky Eater: Insects, cause no way in hell am I gonna eat those anyway lol"

pliant yarrow
#

I really like the Neurodiverse mod and wanted to make my own addon for ASD since me and my girlfriend both have it. I thought the neurodiverse mod was really cool to see myself represented in game, but I wanted to make my own contribution and make a similar mod.

trim mist
#

Theres a ND mod?

#

that's kinda cool

pliant yarrow
#

Yeah, it adds ADHD, Tourrettes, Alzheimers and Bipolar Disorder. It's not perfect but it's really neat and as someone with tics I love the addition of playing the game with tics.

trim mist
#

Kind of hate the implementation of ADHD in extra traits or whichever trait mod it is.
"Bahh I can't read without my antianxiety pills"

bronze yoke
#

i'd consider making a mod to represent my own neurodiversity but i'm not quite sure what the mechanical implications of 'likes my little pony a bit too much' are

trim mist
#

Multiplied unhappiness gain if you spend too many hours away from MLP figurines / tapes

#

lol

spice saddle
#

With your own little scripts of your fav characters

bronze yoke
#

hehe i've considered it but needing to write a couple vhs tapes has had an update for my literacy mod held behind... maybe a year now...? so i know my limits LOL

spice saddle
#

Gotta collect em all

pliant yarrow
#

My plan is to make Autism randomly assign you picky eater traits, make you stressed by noises and certain sensory factors, and you have special interests that manifest as randomly assigned stat bonuses. It's not perfect but like I said I wanted to feel represented in gameplay a bit, and if other people felt represented or it spiced up other people's gameplay then I'm glad

trim mist
#

I think the stressed moodle is underutilized so good on you

#

By the way.... anyone know how to change up load order?

bronze yoke
#

in vanilla singleplayer it's just alphabetical

trim mist
#

I think my AnthroTraits mod is loading before my TraitTags mod and--

#

yep that'll do it lmao

bronze yoke
#

i think if you require a mod it'll load that one first

#

otherwise you can just require that mod's files

#

which you'll need to do anyway if your mod is written modularly

#

if you have mod manager you can move them around and servers can do that anyway

#

though lua requires are always respected

trim mist
#

Maybe that's not enough? I have the requires here

bronze yoke
#

hmm, maybe those doesn't enforce load order then

trim mist
#

Interestingly enough the requires didn't throw an error when i put that p in there

bronze yoke
#

they don't throw errors in the traditional sense

#

it's more like they throw warnings (though the warnings do say error iirc)

#

they won't make a stack trace or pause the game or anything

#

one of the less important advantages to using modules is things break in a more obvious way when the require fails πŸ˜…

trim mist
#

I'm not aware of what modules are qwq

bronze yoke
#

it's basically what you're doing, but instead of adding your table to the global namespace, you keep it local and have the file return it

#

then when you want to use it in another file, you do local myModule = require("etc")

#

it avoids polluting the global namespace, and it just runs faster

#

it's how you're supposed to write lua, but most modders don't pick up on it because the vanilla lua is not done properly unhappy

trim mist
#

Albion :l do you think we could talk in a VC here and I can stream my workspace and ask you some questions? This TraitTagsFramework thing has been really kicking my ass the past couple of days and I'm fighting to keep up the enthusiasm to get my AnthroTraits mod to the finish line

bronze yoke
#

i'm sorry, i don't vc, but i'm happy to give you any advice

trim mist
#

No worries. Let me see if I can try to collect my thoughts real quick

trim mist
#

No global ModData. No Global functions. Just a local module.

bronze yoke
#

if TraitTags contains your functions and stuff, yeah, definitely not i'm afraid πŸ˜…

trim mist
#

I can probably figure that out without asking too many questions, but then I'm stuck with the original issue of where do I put the table? It needs to be remembered if the lua gets reloaded, a server gets restarted, etc

bronze yoke
#

if lua gets reloaded, won't the module reload too? i don't quite understand the issue

#

unless the trait tag table gets populated during gameplay or something and isn't necessarily going to be the same every time it's run with the same settings (and needs to stay the same despite that)

trim mist
#
Events.OnGameBoot.Add(initAnthroTraits);
``` is where this section of code runs
#

Maybe there's a better way to plug in the data than this? I think I'm starting to understand my path forward

#

My thought is to keep the functions out of the table itself by keeping it local, and creating the table in the TraitTagFramework files. Still I'd be adding the TraitTags table to the global moddata table, but I could only interact with it through the module (interacting being your standard CRUD functions and some statistics)

#

I hope I'm making sense. I have a bad habit of using imprecise language in situations like these lol

bronze yoke
#

i don't think i understand, if lua reloads won't this code just run again and you end up with the same table?

trim mist
#

I don't think the OnGameBoot event runs again, only once when you start the new game

bronze yoke
#

i think you're misunderstanding OnGameBoot, that fires when the game reaches the main menu and after lua reloads

trim mist
#

O_O

#

If that's the case, then why does everything added to TraitTags get wiped after a reload? My testing functions always errored out after a reset saying they were nil

bronze yoke
#

if you did need to keep it persistently (i don't think you do), this is sort of how you'd do it, though normally you'd just keep the table of tags in moddata and not the entire module

#

that's a good question, i don't really know

#

keep in mind though that the vanilla traits are set up by ongameboot, so if it doesn't fire, traits shouldn't work either...?

trim mist
#

As far as I know they did. Oh god, I have to do a lot more testing

bronze yoke
#

well, when i say that i mean that the issue is probably elsewhere, because traits definitely work after lua resets

#

is your file in the server folder? ongameboot behaves strangely there

trim mist
#

I think I understand what my path forward is now at least. I'm changing all the functions in TraitTagFramework.lua to local functions that aren't inside a table local function add(traitName, tags), still adding the data table to ModData, but calling the module and interacting only through that to affect the table.

trim mist
bronze yoke
#

this is the basic structure when we talk about modules```lua
-- myModule.lua
local myModule = {}

myModule.foo = function()
print("bar!")
end

return myModule

-- another file
local myModule = require "myModule"
myModule.foo()

trim mist
#

So I couldn't do

TTF = require("TraitTagFramework");
...
TTF.add("TraitName", "Tag1,tag2,tag3")?
#

OH i see i think

bronze yoke
#

you can keep things completely local if you don't want other files interacting with them (or if you want to control interactions with them by only giving them functions to interact with them and not the object itself)

trim mist
#

Oh lord. So this is the lua equivalent of encapsulation

bronze yoke
#

yeah, though most people don't bother with stuff like that and just throw everything in the module

trim mist
#

That's kinda gross to me lol. I've always been strong in OOP so I've been consistently wondering how to make my code "cleaner" in that way

#

I should make a wiki page about this

bronze yoke
trim mist
#

so this is where it gets a little messy. How do I separate the data table from the function table?

#
TraitTags = TraitTags or {}

is what I have. Should I add another one like

TraitTagsFunctions = TraitTagsFunctions or {}

and use that one...?

bronze yoke
#

i'd just do TraitTags.tags = {}

trim mist
#
TraitTags = TraitTags or {}
TraitTags.tags = TraitTags.tags or {}

So like this you think?

bronze yoke
#

i should mention that if you're working modularly, TraitTags = TraitTags or {} has no meaning since that's for ensuring multiple files with the same global table don't overwrite each other - instead you'd just do local TraitTags = {}, and if it is defined between multiple files just require the first file

trim mist
#

I'm adding the or bit just in case another modder happens to use this and this module gets calle--

#

buh

#

Ah okay I get that I think. I saw that in Moodle Framework and thought that was... just the way to do it lol

bronze yoke
#

it's another solution to the problems that modules solve better

trim mist
#

πŸ€” but that makes sense I guess. The module itself can be local, but the data is floating in ModData. So other mods using the framework at the same time could have their own instance of the function table, but they'd all be accessing the same global ModData table

#

God lua makes my brain hurt

bronze yoke
#

modules are local, but the file returns it, so that other files can get a reference to it in their own local namespaces by requiring that file

#

the global namespace is just generally bad news (it's considered by many a disaster how much vanilla uses it), so modules avoid it entirely

trim mist
#
require("NPCs/MainCreationMethods");
local TTF = require("TraitTagFramework");


local function initAnthroTraits()
...
    TTF.add("KeenHearing", "Anthro,KeenHearing");
    TTF:add("EagleEyed", "Anthro,KeenVision");
...

okay so this is how the implementation should look, right? I think I fixed up the TraitTagsFramework file to be a module. Can I show you the whole thing somehow, and do you have the patience/time/inclination to look?

bronze yoke
#

this looks right (except the mixed usage of . and : in your add calls - one of those is probably a mistake?)

#

i can look at the whole files if you'd like

trim mist
#

I did that intentionally cause I didn't know which one was correct lol. IIRC the colon calls like, an instance of a function or something?

bronze yoke
#

the colon is for calling functions on an instance of an object - it's syntactic sugar, myObject:function() is the same as calling myObject.function(myObject)

#

it's mostly just to make lua's weird fake oop look less weird

trim mist
#

This makes more sense hahaha

#

brb I'm gonna grab a cookie

bronze yoke
#

when defining a function using a colon is the same as adding a self argument as the first argument

#

i think you forgot to push your commit πŸ˜…

trim mist
#

πŸ’€

#

pushed now

bronze yoke
#

at the very end of your file you want to return TraitTags

#

that's what lets other files grab it with require

#

other than that - i see you swapped your functions to be written the other way around (name = function() instead of function name()), i just thought i should make sure you know that that isn't a mandatory part of the module format and just my style preference, which is why i wrote my examples that way

#

the only practical difference is that you can't use colon when defining them that way and functions defined that way can't recurse (unless you declare the variable first)

#

i still don't think the moddata is necessary but it shouldn't interfere with the operation of your module or anything

trim mist
#

And if I could figure out why functions calling TraitTags return nil after a reload, I could just include TraitTags.tags in the module, right?

trim mist
bronze yoke
#

it's already included in the module, anything under TraitTags will be

#

i picked up the habit when i was modifying a mod that had functions under very long chains of tables and it was just easier to understand that structure that way - it doesn't really matter for things written in a reasonable manner

glass basalt
ancient grail
#

Nope why

#

Maybe chuck can

glass basalt
#

just to clean the chat messages and such

trim mist
#

I have to say albion, thank you very, very much for your help. You've consistenly helpful to me--I wanted to credit the discord somewhere in the development of this mod but I think I'd like to mention you specifically? Is that alright?

bronze yoke
#

that'd be lovely ^_^ thank you

glass basalt
#

I already credit albion and the server without approval lol

trim mist
#

I'll slap the credits into the steam page and github page, not sure really how else to do it lol

bronze yoke
#

yeah i mean if anyone wants to give me another thing to put on my cv i'm all for it

glass basalt
#

"helped make a bajillion scripts for a zombie apocalypse game"

trim mist
#

I mean. I'm all for it if you want to put "contributed to a Project zomboid mod to make furries more furry-like".

#

lmfao

#

I could understand not wanting to do that though

bronze yoke
#

hey, it's the industry

glass basalt
#

i have to now remember wth i was doing with my java code a week ago

bronze yoke
#

game over: you looked away from your code for ten minutes

trim mist
#

oof. Good luck mucking about in the Java

glass basalt
#

I remembered. I have to scour through all of it to figure out why it is still behaving like vanilla

#

time to procrastinate again πŸ™ƒ

bronze sand
#

I have an idea for a mod
"Tile Shipping Trucks"
Trucks that appear shipping the Furniture from different Tile Packs so you can get access to a wide variety of building options in any map and on already started saves

#

Including random packs of "Floor Tiles"

ancient grail
#
    local bodyParts = bodyDamage:getBodyParts();
    for i=bodyParts:size()-1, 0, -1  do
        local bodyPart = bodyParts:get(i);
        if bodyPart:isInjured() and bodyPart:isBurnt() then
            bodyPart:setBurnTime(0)
            bodyPart:setNeedBurnWash(false)
        end
    end

Am i using wrong syntax?

red tiger
#

Inconsistent semi-colon usage. Either use it or don't.

ancient grail
#

if i dont backward loop once i remove the burn it will remove it from the array

#

i assume

#

but ok ill try forward then thnx

red tiger
#

That's a mighty assumption. It's not like a java Iterator and even then you have to invoke remove()

ancient grail
#

still didnt work

#

i bet im using wrong syntax

red tiger
#

I don't know what the issue is but I can see that you complicated your code without needing to.

ancient grail
#
        for i = 0, bodyParts:size() -1 do 
            local bodyPart = bodyDamage:getBodyParts():get(i) 
            if bodyPart:getBurnTime() > 0 then
                bodyPart:setBurnTime(0)    
            end
            if bodyPart:getBurnTime() > 0 then
                bodyPart:setNeedBurnWash(not bodyPart:isNeedBurnWash())
            end
        end
#

got it working

#

im not overcomplicating i really need to iterate the parts as i dont know which one is burnt

subtle sapphire
#

hello! πŸ‘‹ I am trying to understand how to add a new moveable item in game. Like a new chair, or a small container to let players interact with. I tried to define a new item like that:

    item Mov_LockableSafe
    {
        DisplayCategory = Furniture,
        Type = Moveable,
        Icon = default,
        Weight = 40,
        DisplayName = Lockable Safe,
        WorldObjectSprite = location_business_bank_01_68,
    }

With no luck. The result is that I can see the item in the item list, but I can't place and can't see the sprite on it. Is there a guide or something that explains how to add new moveable items? Thanks!

fast galleon
heady crystal
#

Anybody knows a way to prevent vehicle parts from taking damage from zombies?

#

Setting them to 999 condition doesn't work

cursive coral
#

guys

#

What does MetalValue mean?

#

certain items have it, some don't.

fast galleon
sturdy salmon
#

Hello, good morning. Is there any property in the title properties that prevents the zombies from breaking the wall? I want to emulate the behavior of certain walls, that do not break, but when I place them on the map, the zombies zombify them. My idea, is that they surround them. There are several such walls within the game.

fast galleon
#

What's the best way to get OnMouseUp to trigger for children elements that extend the parent element.

I get OnMouseUpOutside instead.

I'm guessing I have to add them to UI manager or manually find them from parent.

granite torrent
#

Hi guys!!
Quick question, I've read that you can now use Typescript to code Mods, is this true? Do you have the same flexibility as lua or are there any missing pieces that I should be aware of?
Thank you!

sturdy salmon
granite torrent
magic halo
#

Guys, I'm having a very annoying problem on my server, what can cause this error here?

ERROR: General , 1685711587269> 0> ExceptionLogger.logException> Exception thrown java.io.IOException: map download from server timed out at WorldStreamer.requestLargeAreaZip line:850.
ERROR: General , 1685711587270> 0> DebugLogStream.printException> Stack trace:
java.io.IOException: map download from server timed out
at zombie.iso.WorldStreamer.requestLargeAreaZip(WorldStreamer.java:850)
at zombie.iso.CellLoader.LoadCellBinaryChunk(CellLoader.java:440)
at zombie.iso.IsoWorld.init(IsoWorld.java:2625)
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)

#

Bad connection?

#

A huge amount of people are having this error

#

I've been trying to find the cause of this for months and nothing 🫠

#

They get stuck in the part of downloading map chunks

#

But sometimes they manage to log in and play normally

spice saddle
#

@mystic rose maybe IsoPlayer:getPlayerMoveDir() can help you get the angle of the character facing

mystic rose
#

hmm

#

i assumed that gave an xyz on the location rather then facing direction, but i could always be wrong

spice saddle
#

i'm also very new to modding so i don't know what i'm talking about, just fyi lol

#

it returns JVector2 which seems to have a couple of ange functions

mystic rose
#

For others here that are smarter then me, im trying to get the exact angle of the player facing even with decimals but the closest ive found in my search was getAngle() but it gives very little info on what it does or is used for, could be it though

mellow frigate
mystic rose
#

eh?

mellow frigate
mystic rose
#

so character:getAnimAngleRadians(); gets the exact angle or? how your saying it sounds like its just rounding up to each cardinal direction

sour island
#

I wrote something related to this, it's used in fancy handiwork I believe(?)

#

The snippet should be in here if you search -- I type alot though πŸ˜…

mystic rose
#

ill be lookin

mellow frigate
sour island
#

Also, yeah, I'm not smart -- I just slapped stuff together until it got what I expected

mystic rose
#

ah ok

sour island
#

As is tradition πŸ—Ώ

mystic rose
#

theres a lot of messages...

#

so i could just now print to console to verify..

#
while true do
  if player:isAsleep(false) then
    print(character:getAnimAngleRadians())
  end
end
``` wish i knew a way to update it whenever the character moves, rather then every frame but it works for testing
bronze yoke
#

this is an infinite loop

mellow frigate
#

Events.OnPlayerUpdate.Add(function(player) if player and player:isMoving() then print(player:getAnimAngleRadians()) end end)

bronze yoke
#

OnPlayerMove would probably let you circumvent that check

#

(and you never need to check if player as part of an event because if there isn't a player then the event wouldn't be fired)

mystic rose
#

wat

bronze yoke
#
Events.OnPlayerMove.Add(function(player)
    print(character:getAnimeAngleRadians())
end)
mystic rose
#

no while?

bronze yoke
#

the while true just makes an infinite loop and crashes the game

#

OnPlayerMove will already fire every single tick that the player is moving

mystic rose
frank elbow
#

Why player and character? I see it's in the original snippet

mystic rose
#

oh uh

#

might of been messing about and didnt do that correctly

frank elbow
#

Ah gotcha

mystic rose
bronze yoke
#

it should go into the debug console and the log

mellow frigate
#

anyone there has a snippet for getMouseSquare that handles the Z coord depending on local visibility ?

#

and if you handle the joypad it's even better

#

Mine is mouse only and I only use player square Z.

granite torrent
#

Hi guys!

I'm exploring some mods and I know that some can extend properties in SandboxVars.lua file to let a user customize variables. Is there any guide on how to properly setup such extension?
For example: i want user to set an array of items to delete, by name, in a property in this file called: ItemsToRemove = {
items = [array]
}

Do any of you know how to do such thing and can point me toward a guide, perhaps?
Thanks!

weary matrix
#

@mellow frigate How hard would it be to adapt Dogs for MP?

mystic rose
#

why am i getting an error, did i do the stupid? im just copy pasting what albion said...did i need another part for that?

mellow frigate
mystic rose
#

i feel like it needs to be called but im unsure

bronze yoke
#

oh, i was copying what you did and mixed up the character/player πŸ˜…

mystic rose
#

ah right

#

since character is the actual character model correct?

bronze yoke
#

character is nothing in this context

mystic rose
#

oh derr

frank elbow
# granite torrent Hi guys! I'm exploring some mods and I know that some can extend properties in ...

I don't know that there's a guide, but vanilla handles a similar type of rule by using a string delimited with semicolons. i.e., item1;item2;item3. You can create a sandbox variable with a special file in your mod's media folder, sandbox-options.txt.
Example string option:

option ModName.OptionName
{ type = string, default = default value that cannot contain a comma or curly brace, page = ModName, translation = ModNameOptionName, }
mystic rose
#

so it would be player:getAnimeAngleRadians()?

bronze yoke
#

some people use the two terms to refer to different things but they don't have any inherent meaning

#

player:getAnimAngleRadians()

#

not quite sure how that anime got in there πŸ˜…

mellow frigate
weary matrix
#

sad, it would be a nice addition

mystic rose
#

ah uhh

weary matrix
#

going to try it right now in SP

frank elbow
mellow frigate
mystic rose
mellow frigate
bronze yoke
#

i like to use player for objects that are definitely players and character for objects that could be non-player characters, though that doesn't occur in the current version of the game

mystic rose
#

im assuming theres no way to stop the snapping to directions without a weapon?

mellow frigate
weary matrix
#

Any clue where I can reach Dislaik?

bronze yoke
#

(it *definitely* makes sense to base your naming conventions around a feature that will doubtlessly require you to rewrite half your code anyway)

granite torrent
mellow frigate
bronze yoke
#

i use character when the code would theoretically apply to npcs too, or just in areas vanilla tends to do that