#mod_development

1 messages ยท Page 97 of 1

pulsar heath
#

and enough for me... is like the basics...

#

never again will i make mods with UI

fast galleon
#

It's like riding a bicycle, only need to learn it once.

pulsar heath
#

yeah you never forget... but you will still crash regularly ๐Ÿ˜„

#

almost done with the testing... so far so good... no errors no impact on performance

uncut meteor
#

is there a way i can overwrite a mod original code

bronze yoke
#

if it's in a global/returned function you can just overwrite the function

#

otherwise you can overwrite the entire file by making one with the same name and directory and messing with the load order

uncut meteor
#

Ok thx

stone garden
#

i wish my mod ideas happen

#

at least one of them

zinc pilot
#

at this point I'm lost, is there anyone that could help me with BodyLocations stuff?

#

I've got a custom body location to manage amputations, just added at the end of the body locations so it shouldn't affect item rendering

#

except it does

#

for a while, it didnt

spare knoll
#

and are you using blender

zinc pilot
#

with a custom body part

zinc pilot
#

should have been clearer

spare knoll
#

No, It's fine

zinc pilot
#

m_masks shouldn't affect clothing afaik

#

and I'm trying to null everything else mask related

#

for some reasons, in some saves it works, in some other it doesn''t

#

I'm not sure what I'm missing

uncut meteor
#

over 10k lines but atleast working

pulsar heath
#

im trying ( and its working kinda ) to create a UI Element that is "animated"... for now i have a timer running and when i trigger the function it changes the texture in the ui everytime the timer reachs 0 (timer has around 2 seconds duration ) and loops until the counter is 5 ( around 10s animation ).

am i just complicating whats already easy to do some other way? Is there a better way to do this?

sour island
#

If you're doing it in render you're probably fine

pulsar heath
#

yup doing in render

#

render is always running, that made my life easier when changing the amount of elements in the UI without player interaction

spare knoll
sour island
#

I don't do models, sorry

spare knoll
#

ah ok..

ancient grail
pulsar heath
#

ok ok... needs some improving but atm i can get the image from a twitch user account send it to the mod, and do some basic animations messing with another elements alpha ( another image )

stone garden
pulsar heath
#

so this way i can change the player say to that animation with some text related to the event triggered

ancient grail
#

ProccessMsg i forgot the syntax

#

But you can check the ISChat i think

#

Or just use Halo

#

@pulsar heath

pulsar heath
#

yeah im using halo for the temporary traits

#

but for zombie events and heli events i want to do something... different

ancient grail
#

No one else sees this msg tho

#

Just the player itself

#

Im not sure if there a way to make other see it

pulsar heath
#

yeah but thats not the point

ancient grail
#

Maybe a sever to client event might read others saying it

#

Ow ok

pulsar heath
#

its not related with if only the player sees it

#

or if everyone does

ancient grail
#

Then just type what he wants to say

pulsar heath
#

im trying to do something like the alerts we use on twitch

#

like a sub alert and stuff like that

ancient grail
#

Use servermsg

pulsar heath
#

hmmm

#

ill have to make a video or gif perhaps its better to understand my objective

ancient grail
#

client server msg

     local myMsg = "hello world";
SendCommandToServer(string.format("/servermsg \"" .. myMsg  .. "\""))
pulsar heath
#

but ill simplify what im trying to do: i have right now an animated heli or jet for the EHE events bought via twitch

ancient grail
#

Idk what else is there. Proccess msg
Servermsg say halo

pulsar heath
#

running in game... the jet crosses the screen from left to right has has a "banner" behind with the name of the viewer that bought it

ancient grail
#

Ah then thats UI

pulsar heath
#

yup

#

im doing it all in UI

#

replacing the player says

#

๐Ÿ™‚

ancient grail
#

Ok i dont know anything about that anymore goodluck hehe

pulsar heath
#

kinda works... a bit janky

#

but ill sort it out ๐Ÿ˜„

ancient grail
#

Im sure you will figure it out

pulsar heath
#

as of now the jankyness is in the movement of the ui

#

its... not fluid ๐Ÿ˜„

crystal pollen
#

Does anyone know if AllowRandomHue or AllowRandomTint or a similar command, works non-clothing objects like pillows for example.

ancient grail
#

You might have gotten a syntax wrong

A file thats not suppose to be part of the mod.

Wrong directory structure

Or you have something wrong with your game files verifying files will fix this

polar thicket
#

But thanks

#

I found out what I did wrong

ancient grail
ancient grail
pulsar heath
#

Using this for the air events ๐Ÿ˜„

#

mslug rules

ancient grail
#

DCMA

#

Lol

pulsar heath
#

i doubt they will care enough

atomic river
#

does anyone know how to make a mod pack including various mods for easier download?

ancient grail
#

Idk a t the steam collection feature i think they gave that where you can group em so its easier to sub and resub ithink.. idk how it works ihavent tried that

weary forge
#

Would it be possible to make a mod that shows the "remaining" Zombies under the kill counter? I normally play without any respawn and i am curios how much progress i am making ๐Ÿ˜„ (Playing on Insane population without ramp up. First week and i am 4k zombies in. xD)

fast galleon
bronze yoke
#

it's not something i know enough about, but i can't think of a way to do it

ancient grail
#

it cant be done afaik if you look at the zeds population data there are zeds that are virtual local remote and ithink theres more

#

but if you test it out and figure out whaqt thoes are then maybe we can figure out how to merge the zeds

#

or like do the math of it based on the spawn rate if its not random

onyx sage
#

I need someone to help make a few mods for my server im working on (PAID)

weary forge
small topaz
#

has there been a recent vanilla update?

ancient grail
uncut meteor
onyx sage
#

any mod devopers that could either point me in the right direction or i could maybe hire?

bronze yoke
#

next() is not available?

#

it's apparently implemented in kahlua so i'm a little confused by that

small topaz
#

did the zomboid devs recently removed the feature that you can cook food with rotten ingredients??

bronze yoke
#

you need a high cooking level

small topaz
#

I have now the situation that I cannot craft jars when having rotten food in my inventory even I have enough fresh food to craft them too.

#

is this a known issue? I could swear that a few weeks ago, this was not a problem

sour island
#

do you have any mods changing jarring behavior?

small topaz
ancient grail
#

<m_2DBlends referenceID="3">
<m_AnimName>Bob_Idle</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>0.04</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>

sour island
#

sounds like the onTest / onPerform might need to be fixed/changed

ancient grail
#

anyone know show to use that

small topaz
#

it's crazy. I could swear that this problem wasn't around a few weeks ago. I am working on a mod changing the jarring behavior and playtested the system quite deeply. now, I have this strange issue without any mod...

#

maybe I only playtested stuff with high cooking skill and therefore didn't notice the problem. but definitely seems to be a vanilla bug...

honest shard
#

there's a mod to chain zeds like Michonne? or to lock'em down?

stray yacht
#

Quick easy question I think, is there a place in one of the txt files that I should declare dependency on another mod? I've listed the dependent mod on steam but wonder if there's anything I should do in the mod as well to help people notice the dependency

ancient grail
#

U plan to make that? @honest shard

honest shard
#

I have a zombie I don't want to kill, I need a mod like that rn

ancient grail
ancient grail
ancient grail
#

But just so you know zed is hard to manipulate and it will need you to like configure probably the groupings on the sandbox

bronze yoke
#

if you have multiple separate them like this
require=modid,modid (don't add spaces between them)

ancient grail
#

And make em like always attract to each other by noisewhich would be difficult to control

stray yacht
#

ah awesome, thanks albion!

zinc pilot
#

there is a OnBeingHitByZombie event on the wiki but it seems like it's obsolete, is there any alternative?

#

OnWeaponHitCharacter?

ancient grail
#

OnHitCharacter

#

Character can be zed you or other players

#

Ow wait i could be wrong

zinc pilot
#

You're talking about OnWeaponHitCharacter

#

and no

#

it doesn't work

#

zombies do not trigger it

bronze yoke
#

you can use onplayergetdamage but it's not 'precise'

#

depends if you need it to *only* run when hit by a zombie or not

#

although that event is super laggy so be careful with it regardless

ancient grail
#

You cant isolate the dmg comming from the zed. Why did that zedhit event got removed

bronze yoke
#

a lot of the 'obsolete' events were just never implemented

#

some of them aren't even events

#

all the hooks are listed as obsolete events on there

zinc pilot
bronze yoke
zinc pilot
#

oh, perfect

#

thanks for the help then

bronze yoke
#

i have notes about it here

#

it literally gets called every frame, often multiple times every frame, while you're taking any damage, so it's only useful as like a last resort for catching things and not a consistent 'zombie damage' event

ancient grail
#

Adding this to the list of reference

zinc pilot
#

do you know what variables are passed to it?

bronze yoke
#

in the message i linked

zinc pilot
#

today I'm blind, nvm

bronze yoke
#

i wanted to write a more up to date event guide (since the wiki can't really be updated) but it's a lot of work, probably need to automate it to a certain degree and i don't really know anything about that

bronze yoke
#

probably in the same format as my hook guide

ancient grail
#

Ill add that to the reference list once its finished

#

Pls link of hook guide

bronze yoke
zinc pilot
#

ok wow you weren't kidding, every single blood droplet calls it

ancient grail
#

Added it

bronze yoke
#

yeah, you literally get a call for every negative health change, most of which happen every frame, for every BodyPart it is happening to, *and* the BodyDamage as well

zinc pilot
#

not getting the body part there kinda sucks

orchid carbon
#

Hey all, I'm brand new to modding, no coding experience to speak of, and I'm looking to get help with figuring out a component of a project. Mostly just trying to figure out how to determine what exactly gets returned by things like getTimeOfDay and getDawn.

#

I'm trying to get the mod to determine if it's daytime, and return true if it is. I assumed getDawn returned a time and I could just compare it with greater than/less thans to the getGameTime, but it doesn't seem to work that way.

#

getDawn and getDusk, that is.

#

Any help would be greatly appreciated!

ancient grail
#

Look at the foraging lua
It has a function that does that @orchid carbon

orchid carbon
#

alright... where would I find the foraging lua?

ancient grail
#

media/lua

#

Not sure where exactly

#

Or what it's called
You might need to have your id index your folders so you can just search easily

orchid carbon
#

Thanks. I'll try to slog through it, its just hard as a non-coder to understand what other coders intend the code to do without really good commenting.

bronze yoke
#

it looks like getClimateManager():getSeason():getDawn() is used instead

ancient grail
bronze yoke
#

they aren't events, they're hooks

orchid carbon
bronze yoke
#

yep, that's what the code i found it in does

vast veldt
#

Does the game assign a unique, immutable ID to vehicles? I've just tried to capture a reference to a vehicle using the getId() method of https://zomboid-javadoc.com/41.78/zombie/vehicles/BaseVehicle.html, however, after disconnecting and logging into the server again, I get a different value (I got 247 originally, now I get 251).

bronze yoke
#

gametime's dawn/dusk are integers and i don't see any indication that the game actually updates them with seasons and stuff, they might just be a relic

ancient grail
orchid carbon
ancient grail
faint jewel
#

huh?

#

there's a what now?

ancient grail
#

The one u wanted to capture the id

#

Long time ago

faint jewel
#

yes i know!

#

i am reading my boy!

abstract raptor
drifting ore
#

what would i need to do to obsolete an item? i cant seem to remove an item i want from distribution

zealous cosmos
#

Hi, are there any devs here with audio/ai-audio/tts knowledge? I've created a mod with talking zombies -> twitch chatters can make them talk through twitch chat. I'm using google cloud, but the voices there are much to clean

nimble spoke
zealous cosmos
# abstract raptor How does this mod work?

websocket to twitchchat, analyzes messages, if it encounters the tts command, it makes a call to a small backend component to fetch a wav file and run it on the zombie (zombie.getEmitter().playSound(wav)).
The small backend just sends some voice and audio parameters and the text to google cloud tts service

abstract raptor
drifting ore
#
MechanicMag1: Obsolete = true``` is this correct?
#

oh copy the item script

zealous cosmos
#

The problem with bulldogs tts: it's entangled with plenty of other services on his gh account + no/not enough docs. I don't know where to start

small topaz
#

when I have a string of the form "Base.MyItem" which refers to an item defined via the script.txt, is there an easy way to retrieve the string "MyItem" from it?

#

so just deleting the "Base." in the prefix?

bronze yoke
#

if you know the module is always going to be the same you can just trim it that length

#

otherwise you have to do some weird regex (or whatever lua uses)

#

you can probably just trim using string.find to find the . actually

nimble spoke
small topaz
ancient grail
fast galleon
fast galleon
ancient grail
#

getPlayer():getStats():getNumVisibleZombies()
getPlayer():getStats():getNumChasingZombies()
getPlayer():getStats():getNumVeryCloseZombies()
sour island
#

@fast galleon Looking into the registerWindow() stuff and the intended behavior is the windows that were open will reopen onCreate - I suppose the issue is registering the window leads to it being 'nil' on death?

fast galleon
sour island
#

Using the registerWindow in your PR leads to the debug windows not being open on create new character

jaunty marten
fast galleon
#

you added registerWindow

sour island
#

to the vanillaOpen yes

fast galleon
#

I added ISDebugMenu.RegisterClass(_class)

sour island
#

. _ .

fast galleon
#

It closes the UI on player death

faint jewel
#

Is there wa way to disable sneaking when holding a certain item?

#

i mean the "stop player from running while holding stuff" doesn';t work.

#

it says it does but it dont.

#

you can TOTALLY sprint even when it says you cant.

sour island
#

but the windows that were opening on their own did not open on their own atleast

fast galleon
#

ah, so you'd like to keep the instances saved

sour island
#

If possible yes, I'd like the debug "setup" so to speak to come back

#

The issue isn't present when relogging - only seems to happen when you die and make a new character

#

I'm guessing there's something I missed in the new() for isoregionwindow and generaldebug

dark wedge
bronze yoke
faint jewel
#

i wanna force them to walk when carrying heavy stuff lol.

fast galleon
#

@sour island
so this, but keep the instances

function ISDebugMenu.OnPlayerDeath(playerObj)
    for _,class in ipairs(ISDebugMenu.classes) do
        if class.instance then
            class.instance:setVisible(false);
            class.instance:removeFromUIManager();
            class.instance = nil;
        end
    end
end
sour island
#

Yeah, I made my own version of the func so far

#

But now another issue cropped up

fast galleon
sour island
#

well it's still using the new() of the original classes

#

and those are kind of all over the place

drifting ore
#

Im setting the items as obsolete and they still spawn in game? ```module Base
{
item MechanicMag1
{
Obsolete = true
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = Laines Auto Manual - Standard Models,
Icon = MagazineMechanic1,
TeachedRecipes = Basic Mechanics,
ReplaceOnUse = MechanicMag1,
Tooltip = Tooltip_item_MechanicMag1,
StaticModel = Magazine,
WorldStaticModel = MagazineMec1Ground,
}

bronze yoke
#

Obsolete = true line should have a comma at the end

drifting ore
#

ty

sour island
#

I wonder if I could use layout and just use a different variable than visible to track if it was open or not

fast galleon
#

@sour island

        --ISDebugMenu.RegisterClass(_class)
        Events.OnPlayerDeath.Add(function() _class.instance:close() end)
sour island
#

that's a bit slicker than what I had

#
function generic.OnPlayerDeath(playerObj)
    for req,args in pairs(generic.overwrites) do
        require(req)
        local _class = _G[args[1]]
        if _class and _class.instance then
            _class.instance:close()
            _class.instance = nil
        end
    end
end
Events.OnPlayerDeath.Add(generic.OnPlayerDeath)
#

hmm

#

I got it working but I'm not sure at what point

#

I'll remove the = nil to check

#

interesting

#

with =nil removed this is what I get

#

the only windows I had open was cheats and stats

#

@fast galleon Appreciate the help, added your PR and name for credit

red tiger
#

Always fun.

#

Time to work on some PZ commissions I've had backlogged. =)

sour island
#

backlog? damn I'd feel so much anxiety ๐Ÿ˜…

red tiger
#

Also some are friends.

#

I try to let people know every now and again that I have a market for commissions but not many used it.

#

I'd like to see people in here who work really hard on their hobby projects get rewarded. =)

#

Also me lol

#

Mainly the work I get is bug-fixing or updating older mods.

sour island
#

I'v been using Kofi for comissions but there isn't a way to accept/decline - it's all instantly accepted and money upfront

#

Probably where my anxiety stems from lol

bronze yoke
#

that's so scary

weak sierra
#

don't do anything unless they talk to you first

#

<_<

sour island
#

I set the 'stock available' to 0 after the first one came in

#

it was 1 fortunately

nimble spoke
red tiger
#

Time to debugggg

queen sail
#

Is there any way to fix the bug that causes Walkies to only work if players have met each other, by changing who has access to get all players?

#

Perhaps a sandbox setting?

weak sierra
#

i wish

#

im equally annoyed at that change.

#

if not moreso

#

it's possible that a java mod on the server end might be able to fix it

#

anyway

#

though that's irritating in its own ways

queen sail
#

You think there may be a server end thing that could be changed?

#

I have gone through the sandbox settings and the .ini because i heard there may be but i have not found anything- I am curious if there's any i missed or any files i missed

#

oh you mean a java mod on the server end i misread

weak sierra
#

yeah

#

there's no setting

#

i' begged them to add one, as im sure u saw in the support thread

#

this is terrible for all RP servers

#

and any servers that wanna VC without discord involved

queen sail
#

oh shit yeah you're The Guy lmao

#

I have established just now that by making somebody admin they are able to send and recieve voice messages once they are no longer admin

weak sierra
#

yes

#

they were attempting to prevent non-admins from getting a list of player positions

#

because a specific scenario in which a hacker could teleport between players and kill them rapidly

#

this seems pointless to me because if they can teleport between players they already have access and this probably would not stop them, plus you can just java mod the client to bypass most limitations

#

but i don't decide their priorities

#

if i were them id've made it an anti-cheat setting or something, at least.

queen sail
#

Do you know how one might go about java modding the client to fix them?

drifting ore
#

Decompile. Fix . compile. Distribute manually

#

Not ideal which is why no one jumping on it

queen sail
#

I'm not very literate with code and i kinda get what you are saying but not entirely

red tiger
#

Looks like I need to get back to updating CraftHammer for server-side plugins.

#

Someone also asked me to look into the bugs for walkie-talkies a while ago.

#

I'm guessing the bug is still around.

limber oar
#

I'm back with another episode of "probably made a stupid mistake and need someone to point it out for me."

Long story short, I have different items spawning based on sandbox options, and so I need to run the distributions file after loading said sandbox options. I have it linked to OnInitGlobalModData, which works fine in other cases. But while the file works fine when not in a function, it's not spawning items once I wrap it in a function and wait for that event.

Is there any reason why this wouldn't be working?

require "Items/ProceduralDistributions"
require "Vehicles/VehicleDistributions"

local function modnameSetDistributions()
    -- This works fine when it's not wrapped in the function / triggered on event.
    table.insert(ProceduralDistributions.list["BedroomDresser"].items, "modname.clothingitem");
    table.insert(ProceduralDistributions.list["BedroomDresser"].items, 0.05);
    etc.
end

Events.OnInitGlobalModData.Add(modnameSetDistributions)```
weak sierra
#

i suspect the walkie thing can be fixed server-side since it works fine for admins atm

limber oar
queen sail
#

Is there a particular server side file that I may want to look at for a setting to switch like other zomboid files? Or will Java not be as easy to read as Lua

#

Is it something in here?

weak sierra
#

you CAN force them to load code-wise

#

but presently all mods that do that just.. placebo..

limber oar
#

So there's currently no way at all to affect what might appear in a container based on sandbox options?

bronze yoke
#

just call ItemPickerJava.Parse() at the end

limber oar
bronze yoke
#

at the end of the event function

limber oar
# bronze yoke at the end of the event function

So:

    table.insert(ProceduralDistributions.list["BedroomDresser"].items, "modname.clothingitem");
    table.insert(ProceduralDistributions.list["BedroomDresser"].items, 0.05);
    etc.
    ItemPickerJava.Parse();
end```
?
bronze yoke
#

that's right

limber oar
#

truly an angel

#

thanks for the help :)

queen sail
#

Would it not be as easy to find in the java file as in the Lua files?

limber oar
#

Shouldn't expect anything otherwise at this point, but it worked perfectly. Thanks again.

orchid carbon
#

LUA event question - when I use OnGameBoot to load a profession it works fine when someone is making a character the first time, but it does not load that profession if they die and make a new character without restarting. Is there an event which does similar things as OnGameBoot but applies to character recreation after death as well?

#

I'm slowly working my way down the list on the wiki of events that sound like something that works at any character creation, but figured someone here might be able to save me some time. ๐Ÿ˜‰ Much appreciated if so.

bronze yoke
#

i think usually people just hook the vanilla profession function for that

orchid carbon
#

Alright. I'll look at another mod that adds professions and see how that works then. Thanks!

fresh geyser
#

Just throwing out a concept here for a child trait along with some concept art

Negative Trait
-3 Strength
-1 Fitness
+2 Nimble
+3 Sneaking
+1 Sprinting

Personally would pretty much exclusively use this to emulate a Joel and Ellie duo.

#

Clementine and Lee too

queen sail
#

Does anybody know a way to change server files so that all players can getOnlineUsers?

#

to fix walkies

limber oar
cosmic condor
fresh geyser
#

Sorry to disappoint itโ€™s not in game

#

Though Iโ€™ve explored the issue

#

You would need to create new clothing items with different connecting points

#

Same with hats

#

So child exclusive clothes and items

cosmic condor
#

yes, that's a lot of headache

limber oar
#

I mean, that in and of itself makes sense from a realism perspective. Most adults can't just wear children's clothing and vice versa.

#

I actually considered making a "clothing sizes" mod just to make scavenging for outfits a bit more involved than purely "does this look good on me"

#

Add a small mobility debuff or something for clothes one size too small/large and then make anything more than one size out completely unwearable

fresh geyser
#

Still itโ€™s technically doable

#

Just tedious with hats and bags

sacred matrix
#

I'm working on a mod that needs custom sprites for the a custom world object. I think I need TileZed but when I launch the Linux version from the forums it errors out with:

Error renaming file!
From: 
To: /home/jaql/.TileZed/Tilesets.txt

Invalid cross-device link
(while reading Tilesets.txt)

Is TileZed the right tool? Is there documentation on setting it up?

sacred matrix
cosmic condor
#

oh... no idea then ๐Ÿ˜…

dark wedge
#

If you're on Linux, can run it with Proton via Steam. Not sure how stable it is as I don't use this often, but it loads.

sacred matrix
#

Ah, is there a way to get to it in Steam?

#

That said I'm a C++/Qt dev. I found the GitHub and could fix the crash, but I'm not a GitHub user so I don't know where I'd send the patch...

#

I'll figure something out. Just a bit of a faff to simply add a tile...

dark wedge
# sacred matrix Ah, is there a way to get to it in Steam?

You can get it in Steam, just make sure that you have "Tools" enabled in your Library and you'll find the "Project Zomboid Modding Tools". If you right click on it in your Library and choose "Properties" -> "Compatibility", you can choose to run it through Proton. This is assuming you're on Linux. ha

sacred matrix
ancient grail
#

Na dont waste too much efforts on rant.
Atleast you got it working

humble oriole
#

can you only have one item module per modID?

bronze yoke
#

no, no restrictions like that

humble oriole
#

Man a single } hangs the whole server haha

ancient grail
#

yea thats just normal for me.. i always make mistakes like this whenver im copy pasting from another file to another file like piece by piece or like converting from a script into lua variables

humble oriole
#

Yea, I was refactoring our server's items and shops and everything into separate mod IDs and when I was splitting the recipes into their own files I missed a closing } aahah.

queen sail
#

does anybody know where in the java files i would be able to change permissions for getOnlineUsers or getOnlinePlayers so that walkie talkies can do voip again

#

Alternatively could i make interested parties admins and or observers, allowing them permissions to see players connected, and just have them disable godmode and invisibility

pulsar heath
#

good morning

#

having mine right now... brain cant function before having coffee

pulsar heath
#

the plane flies... kind off

#

it looks like a drunk fly on a bad winters day

#

but it goes through the animation cycle

#

๐Ÿ˜„

ancient grail
pulsar heath
#

oh and i finally got to test dynamic traits branch in the more traits mod

#

thinking about adding some stuff to the twitch integration, gonna make the char trip and have a panic atack stuff like that

queen sail
#

Is there any way to either allow regular players to access player info or to limit the abilities of mods so they can't sprint infinitely?

jaunty marten
queen sail
# jaunty marten is there a correlation between the two questions?

Yes, i want to fix walkie talkie VOIP on my private server and the thing that is broken is that players cannot draw user data unless they have been physically close to the player they are drawing from, and pulling that data is how the voip over talkies works
However mods can pull player data, and disable godmode on themselves and it seems like they can still interact with locked doors, however they can sprint at max speed infinitely and idk how to disable that

I either need to give players the power or take a different power away from observers

pulsar heath
#

i would like to help, but i cant make sense of what you are asking

tardy wren
#

How do I mark a mod as a required?

pulsar heath
#

@tardy wren i did that for one of my mods but cant remember how

#

lemme check my notes

queen sail
#

I want to use the in game voice chat over walkie talkies
That feature broke a few patches ago because a function of the game was restricted to moderators, specifically the ability to pull user data of people on the server
I do not think i can change the game's files so that the function is re-enabled for players so I want to either enable that feature, or disable a feature of being a moderator
because my other option is to make everybody a moderator and just let them play like that with god mode off
But mods can sprint infinitely and i want to disable that

pulsar heath
tardy wren
queen sail
#

Yeah i think it does and that's where i'm stuck so i'm trying to find alternatives or workarounds

tardy wren
#

boycot IndieStone harder?

#

Though it didn't work when we tried when it first was released

tardy wren
#

question

#

playerModData['DaikonPanic_ZombieKills']
What if I do this when That index isn't defined

thick karma
#

It'll just be nil

tardy wren
#

alright

thick karma
#

Hey does anyone do UI stuff who is awake?

cosmic condor
#

yes, but only by tiles replacing not by coding drunk

faint jewel
#

what are you needing burryaga?

pulsar heath
#

if is there anything i know, ill happy to share

#

almost done with animating a UI element

#

using still images extracted from a gif

#

still a bit janky but... it works

#

๐Ÿ˜„

faint jewel
#

yikes lol

pulsar heath
#

but tbh i dont think this will be viable

faint jewel
#

animated pngs not available?

pulsar heath
#

it will probably impact perfomance a lot

#

i just extracted the images from the gif into png format

#

and in animates 6 frames

#

1 per second

#

and loops back

faint jewel
#

1 fps?

jaunty marten
faint jewel
#

what is it?

pulsar heath
#

1 fps yes

#

total 6 frames, 6 seconds animation

faint jewel
#

but... why? lol! zomboid slug?

pulsar heath
#

using that as a test

#

simple small and simple animation

faint jewel
#

true.

jaunty marten
#

best game drunk

pulsar heath
#

i do what i want in the game my friend

#

if you dont like it, thats just your problem

faint jewel
#

vishnya is just playin lol.

jaunty marten
#

why r u bulling me unhappy

pulsar heath
#

here comes the victim, i just said i do what i want, its not your concern and thats bullying? just block me or ignore me and youll be happier... i will im sure

jaunty marten
#

just chill, lol

pulsar heath
#

i misunderstood you then, sorry about that

#

Events.OnRenderTick.Add(functionName) i thought this would be a good event to call the timer function but i guess i was wrong

jaunty marten
pulsar heath
#

and i cant put the frame changer in the :render ...

pulsar heath
#

tried it, it just didnt update the render properly

#

but i can try it again... i've changed the fram changer function... maybe that was the problem and not having in the render

#

yup it was the function... but still kinda janky

#

but better... kind off

#

nop... the game cant handle it ๐Ÿ˜„

jaunty marten
#

btw if I got right in pz no render order, right? all render divides to 2 parts: world and UI, and for second all elements is panels? worked before only with render in panels and didn't check how to render, for example, just simple text somewhere

pulsar heath
#

it has to be outside of the render

#

i use panels mainly

#

even for text

#

at least the way i need to use it

#

second

jaunty marten
pulsar heath
#

function STATSTab:render()
    local player = getPlayer()
    local KillModData = player:getModData().AKCModData
    local alivefor = player:getTimeSurvived();
    local zkills = player:getZombieKills()
    local fkills = 0
    
    if KillModData then
    fkills = KillModData["fk"]
    self.KillCount = true
    end
    
    if self.leftside then
    if not self.KillCount then
    self:drawTextureScaled(getTexture("media/ui/calendar.png"),0,-15,70,70,1,1,1,1)
    self:drawTextureScaled(getTexture("media/ui/zedkills.png"),0,25,70,70,1,1,1,1)
    self:drawText(alivefor,55,10,1,1,1,1, UIFont.Large);
    self:drawText(tostring(zkills),55,45,1,1,1,1, UIFont.Large);
    else
    self:drawTextureScaled(getTexture("media/ui/calendar.png"),0,-15,70,70,1,1,1,1)
    self:drawTextureScaled(getTexture("media/ui/zedkills.png"),0,25,70,70,1,1,1,1)
    self:drawTextureScaled(getTexture("media/ui/firekills.png"),0,65,70,70,1,1,1,1)
    self:drawText(alivefor,55,10,1,1,1,1, UIFont.Large);
    self:drawText(tostring(zkills),55,45,1,1,1,1, UIFont.Large);
    self:drawText(tostring(fkills),55,85,1,1,1,1, UIFont.Large);
    end```
#

it was the only way to change the ui on the fly

#

was using the children method

#

but that isnt very flexible ...

#

plus this way it allow to add and remove elements on the fly when certain conditions are met

#

like in my mod, since everyone was asking for fire kill count... i just used the data from another mod that does that already and is well coded

#

so no point in doing something that already exists, i rather make a require in my mod

jaunty marten
#

I remember, while have been creating new mod, draw methods don't use panel bounds and render context can be free outside of panel bounds, so maybe it's fine to create panel with 0, 0 size and use draw methods on it

pulsar heath
#

yup

#

im doing something like that

#

the panel is only the size of the icons

#

so it can be dragged around

#

the text appears oustide of the panel with no problems

jaunty marten
#

cool, so then there's way to draw smth "without" panel

pulsar heath
#

yeah if you define the size 0,0 the only stupid thing you have to do is to use "weird" xy locations, since the element xy is based on the panel size

jaunty marten
#

I can set pos 0, 0 too and just use screen size to get position

pulsar heath
#

im just getting the width of the panel and base on that adding or subtracting x and y values on the elements

#
    self:drawTextureScaled(getTexture("media/ui/zedkills.png"),self.width-55,25,70,70,1,1,1,1)```
#

thought about using the screen size but this way no matter the resolution the ui itself will be on the right place

#

it will prolly work with the screen size as well but this was simple and easy to implement

#

when i say the ui itself i meant the panel elements ๐Ÿ˜„

#

nop, the function to change the frame cant be inside the render

#

the game ends up not responding ๐Ÿ˜„

jaunty marten
#

for panel context it's fine, yea, but for my way to draw smth somewhere by (0, 0, 0, 0) panel it won't work ded

#

ha-ha

pulsar heath
#

never tried it with 0 size

#

mine are 60x120 and 60x80

#

just big enough to have the icons inside and 1 or 2 px border for when you "anchor" the panel to the screen limits

#

if 0 doesnt work you can always make it 0,0,1,1 ๐Ÿ˜„

#

so 0x 0y 1w 1h

jaunty marten
#

when started with pz modding anchor was nothing for me, I literally can't get how it works until check in pz source

#

always have did in manually but in pz for it is anchor

#

useless discovery for me xd

#

too strange way

pulsar heath
#

the problem with pz modding is the lack of proper documentation and no standard in a lot of things

#

you wanna do this the syntax is this way the naming logic is x

#

the next thing you wanna do the naming logic is totally diferent or the syntax changes

#

so its more digging throught the damn file to make sense out of how thing works than it is actually coding the mod

#

its like 4 or 5 hours digging around the vanilla code then around 1h to actually make the code you want..

jaunty marten
#

but while I tried to find anchor I found that pz surprisingly have stencil functions

#

at least some good news

pulsar heath
#

are they exposed?

#

that would allow to do animations easier and less prone to impact performance

jaunty marten
pulsar heath
#

hmm i need to check those out then

jaunty marten
#

but don't know how much of it tis provide to us

#

just know there they are but didn't use yet

pulsar heath
#

a good thing would be a pz "IDE" to test stuff out

jaunty marten
#

pz ide?

pulsar heath
#

an "interpreter"

jaunty marten
#

I mean pz ide = in-game ide?

#

or... ?

#

ยฏ_(ใƒ„)_/ยฏ

pulsar heath
#

a tool, a modding tool

#

something for you to test UI code and crap like that

#

without having to do it ingame

jaunty marten
#

ah

pulsar heath
#

all the math functions and stuff like that are easy to test without running the game, the UI

#

....

jaunty marten
#

I think will be too complex to create such thing with ALL logic from pz

pulsar heath
#

and i crashed the game again

#

๐Ÿ˜„

jaunty marten
pulsar heath
#

im sure theres a event in lua that will allow me to do this

#

but... which one...

#

maybe OnPostUIDraw?

#

even if the render tick made more sense

#

ill give that one another try

jaunty marten
#

can u show the code? I can try to do smth

pulsar heath
#
print("----------------LOADING AniMOD UI ------------------")
local aniframe = 1
function AniModUI:initialise()
    ISPanel.initialise(self)
end

function startanimodui()
    AniModUI = AniModUI:new(900, 250, 90,48)
    AniModUI:addToUIManager()
    AniModUI:setVisible(true);
end


function AniModUI:new(x, y, w, h)
    local stats = {};
    stats = ISPanel:new(x, y, w, h);
    setmetatable(stats, self);
    self.__index = self;
    stats.title = "AniModUI";
    stats.background = false
    stats.moveWithMouse = true
    return stats;
end

function AniModUI:render()
        self:drawTextureScaled(getTexture("media/ui/" .. tostring(aniframe) ..".png"),0,0,90,48,1,1,1,1)
        
end

function AniModUI:onRightMouseDown(x,y)
print("------------ r mouse click -------------")
self:removeFromUIManager()
self:setVisible(false)
end

function stopanimodui()
AniModUI:setVisible(false);
AniModUI:removeFromUIManager()
end

function updateTimer()
local calendar = PZCalendar.getInstance()
return calendar:get(Calendar.SECOND)
end

function myaniTimer()
        local second = updateTimer()
        local endframetime = second + 1
        while endframetime >= second do
        if endframetime > 60 then
        break
        end
        
        second = updateTimer()
        if endframetime == second then
        
        aniframe = aniframe + 1
        if aniframe == 7 then aniframe = 1 end
        
        break
        end
        end
end

Events.OnRenderTick.Add(myaniTimer())```
jaunty marten
#

render gif as a few pngs is a shit but for pz it's fine XD
interesting to try

#

can u give frames too?

pulsar heath
#

still need to replace that break for some logic about the seconds value

#

but for now i just want to see it run ๐Ÿ˜„

vague raven
#

Is there a function for preloading chunks?

fast galleon
vague raven
#

Just having a problem with teleporting players above z0 as they'll just fall through the floor and take fall damage

pulsar heath
#

thats just an homage pz devs made to skyrim

#

it isnt a game until a player can fall through the floor

#

sorry for the bad joke ๐Ÿ˜„

open drum
#

good morning fellow modders

#

I have a question about a clothing item that i made

#

I tried to add a flag to be worn on the back

#

so I made an item with following variables

#

imports {
Base
}
item CFlag
{
DisplayCategory = Accessory,
Type = Clothing,
DisplayName = Beavers Flag,
BodyLocation = UnderwearTop,
Icon = CLbeavers,
ClothingItem = CFlag,
WorldStaticModel = CFlagGround,
}

#

I tried BodyLocation= Back (but this didn't allow me to wear a bag at the same time)

#

Thus I tried underwear, necklace, neck, LeftWrist, and also ZedDmg

#

necklace, neck, LeftWrist these locations cut my item render into wierd shape

#

when it suppose to look like this

#

Ive tried ZedDmg which worked great flag + Bags however, I couldn't take the flag off. When I do take off, i can place it on the ground but game still shows that it's attached on my back..

#

Could anyone help me if there's any simple solution for this?? I would like to wear both flag and rest of items;including bags at the same time

jaunty marten
#

@pulsar heath first ur problem is Events.OnRenderTick.Add(myaniTimer()) ๐Ÿ˜„

pulsar heath
#

yeah not using that anymore

#

plus the timer fucntion is a bit frankensteiny ๐Ÿ˜„

jaunty marten
#
local delay = 0.1
local change_frame_time = os.time() + delay

function myaniTimer()

    if change_frame_time < os.time() then

        aniframe = aniframe % 6 + 1

        change_frame_time = os.time() + delay

    end

end

Events.OnRenderTick.Add(myaniTimer)
pulsar heath
#

you have access to os in pz?

jaunty marten
#

sure

pulsar heath
#

i thought i didnt thats why im using the pz calendar ๐Ÿ˜„

jaunty marten
#

he-he

pulsar heath
#

oh that makes things a lot simpler and less impact on perfomance

#

so you got it to work?

jaunty marten
open drum
#

oh wow that's amazing

pulsar heath
#

awesome

#

and its on the onRendetick event?

#

ok ok now i can finish this crap

pulsar heath
#

i need to change my other mod then

#

to use os.time

#

no need for bloated functions anymore

#

you just made my day

open drum
#

that's so cool m3ss

blazing vine
jaunty marten
#

I used os.time for benchmark lib but it not so good, will be so cool to get highly accurate time by any way

#

mb do u know such func?

golden sparrow
pulsar heath
#

hmm

jaunty marten
#

I sure it's just formatted but there's used not highly accurate time func, think so

pulsar heath
#

never even remembered the timestamp

#

but for this, accuracy is secondary i think

jaunty marten
#

even os.time returns time with millseconds but this func not so accurate

pulsar heath
#

as long as it works without having to much impact in the game performance

jaunty marten
#

mb some function that returns time since game/server starts will be more accurate

#

but yet don't know such one

open drum
#

but can't wear it with the scarf

pulsar heath
#

well thats smoething they should think about adding in the future?

#

a timer function

open drum
#

is there a way to make an extra body part to wear somthing

golden sparrow
pulsar heath
#

thats not related with anything else

open drum
#

or make ZedDmg bodypart refresh?

jaunty marten
golden sparrow
jaunty marten
#

it's seconds past the unix epoch

pulsar heath
#

@jaunty marten this will do just fine, now just need to make the movement bit, mess around with the alpha a bit and im set

pulsar heath
#

and update my integration mod to use os time

#

that cuts around 40 lines of code ๐Ÿ˜„

#

i was convinced that os wasnt available in pz lua dunno why... never even tried to use it

#

i think someone told me that?

#

whatever... im happy... another step in the right direction

ancient grail
pulsar heath
#

๐Ÿ˜„

ancient grail
#

How many ssprite frames it would be cool if you hover then it animates

pulsar heath
#

whats stopping you?

ancient grail
#

Idk how yey

#

Yet

pulsar heath
#

just detect the move hover and trigger the code

#

thats what im doing in one of my UI's

#

it should be a way do to it on game objects

ancient grail
jaunty marten
ancient grail
#

When i find the use for this ill gove credit to you thnx

ancient grail
pulsar heath
#

me and @jaunty marten

#

he fixed the function to change the frame

ancient grail
#

Nvm ill just learn that when. Cuz i dont need it yet

Yeah sure vishnya always gets credit on my code cuz lua timers a staple code for me

jaunty marten
# ancient grail How
local textures = {
[1] = getTexture(...),
[2] = getTexture(...),
[3] = getTexture(...),
end

:drawTexture(textures[...], ...)
jaunty marten
ancient grail
#

I dont care about SP very nuch

#

So no worries abt that

pulsar heath
#

now the sound...

#

@ancient grail werent you making a mod with a chainsaw?

#

that looped the sound?

ancient grail
#

Why

#

Its done

pulsar heath
#

how did you loop the sound?

ancient grail
#

You need the code for surio

#

Ok wait

#
            if not getPlayer():getEmitter():isPlaying('chainsawLoopsfx') then 
                getPlayer():getEmitter():playSound("chainsawLoopsfx");            
                addSound(getPlayer(), getPlayer():getX(), getPlayer():getY(), getPlayer():getZ(), 50, 50) 
            end
        elseif handWeapon:isBroken() then
            getPlayer():getModData()['chainsawDBG'] = nil                     
            if getPlayer():getEmitter():isPlaying('chainsawLoopsfx') then
            getPlayer():getEmitter():stopSoundByName('chainsawLoopsfx')
            end
            ISTimedActionQueue.add(ISUnequipAction:new(getPlayer(), handWeapon, 10))    
        end
pulsar heath
#

thank you

ancient grail
#

function chainsawLoop(pl, chainsaw)
        if pl:getEmitter():isPlaying('chainsawLoopsfx') then
        pl:getEmitter():stopSoundByName('chainsawLoopsfx')
        end
end
Events.OnEquipPrimary.Add(chainsawLoop)
ancient grail
red tiger
#
local player = getPlayer();
local emitter = player:getEmitter();

-- ...

    if not emitter:isPlaying('chainsawLoopsfx') then
        -- NOTE: Could probably tuple these. 
        local x = player:getX();
        local y = player:getY();
        local z = player:getZ(); 
        emitter:playSound("chainsawLoopsfx");            
        addSound(player, x, y, z, 50, 50);
    end
elseif handWeapon:isBroken() then
    player:getModData()['chainsawDBG'] = nil;
    if emitter:isPlaying('chainsawLoopsfx') then
        emitter:stopSoundByName('chainsawLoopsfx');
    end

    ISTimedActionQueue.add(ISUnequipAction:new(player, handWeapon, 10));    
end
pulsar heath
#

now to build a decent animation adding more elements to the UI

#

and make one for the helis and zombies events ๐Ÿ˜„

drifting stump
#

are you taking into account render speed?

pulsar heath
#

render speed?

drifting stump
#

you can change ui fps so some people may be running it at higher values

#

are you accounting for that in the animation?

pulsar heath
#

the animation is based on a real time timer

#

and its like 1 fps

#

oops

#

6

#

its prolly more than that

#

but i dont think it will be an issue

jaunty marten
#

need to find better gif cos looks not so good

pulsar heath
#

since its a timed function to change between 6 images

#

yeah this one is for testing

#

now to get decent images

#

and make my own

#

and maybe cut the images number from 6 to 3

jaunty marten
#

even 6 too laggy, 3 will the hell

pulsar heath
#

thinking about using something like this for the zombies event

ancient grail
pulsar heath
red tiger
pulsar heath
#

the ideal would be at least 16 images

red tiger
#

You should use a OnTickEvenPaused() Event-hook.

#

This is how I get around this limitation for my HTML render engine project.

pulsar heath
#

to pause the animation if the game is paused?

drifting stump
#

while render and prerender tick every ui frame

pulsar heath
#

this is meant to be a simple thing

#

just plays the animation doesnt care if the game is paused or not

drifting stump
#

theres no need for updating animations on tick when you already have the perfect hook with render

jaunty marten
pulsar heath
#

Events.OnRenderTick.Add(myaniTimer)

drifting stump
#

dont use events for this

red tiger
pulsar heath
#

ui in pz is a pain to work with

jaunty marten
#

btw @red tiger do u know in pz some accurate time function instead os.time? for benchmarking

drifting stump
#

os.time is the best you can get

pulsar heath
#

i dont see any other way to do what i want to do without using onrendertick

red tiger
# drifting stump dont use events for this

There will be cases where it is a good idea to use the event. It's good to know about it as an alternative while respecting update code being in its own thing vs render code being in its own thing.

jaunty marten
jaunty marten
#

๐Ÿ˜ฎ

drifting stump
#

ive asked the devs for a nanosecond timestamp but alas nothing

pulsar heath
#
print("----------------LOADING AniMOD UI ------------------")
local aniframe = 1
local delay = 0.1
local change_frame_time = os.time() + delay
local AnimPosX = 1400


function AniModUI:initialise()
    ISPanel.initialise(self)
end

function startanimodui()
    AnimPosX = 1800
    AniModUI = AniModUI:new(AnimPosX, 250, 90,48)
    AniModUI:addToUIManager()
    AniModUI:setVisible(true);
end


function AniModUI:new(x, y, w, h)
    local stats = {};
    stats = ISPanel:new(x, y, w, h);
    setmetatable(stats, self);
    self.__index = self;
    stats.title = "AniModUI";
    stats.background = false
    stats.moveWithMouse = true
    return stats;
end

function AniModUI:render()
        self:setX(AnimPosX)
        self:drawTextureScaled(getTexture("media/ui/" .. tostring(aniframe) ..".png"),0,0,90,48,1,1,1,1)
        self:drawText(tostring(AnimPosX),55,85,1,1,1,1, UIFont.Large);
        if AnimPosX <=0 then stopanimodui() end
end

function AniModUI:onRightMouseDown(x,y)
print("------------ r mouse click -------------")
self:removeFromUIManager()
self:setVisible(false)
end

function stopanimodui()
AniModUI:setVisible(false);
AniModUI:removeFromUIManager()
end

function myaniTimer()
    if change_frame_time < os.time() then
        aniframe = aniframe % 6 + 1
        change_frame_time = os.time() + delay
        AnimPosX = AnimPosX - 10
        end
end

Events.OnRenderTick.Add(myaniTimer)```
jaunty marten
red tiger
#

They don't have an exposed API for it.

#

I can add this to Crowbar.

drifting stump
#

yeah every exposed timestamp was ms

jaunty marten
pulsar heath
#

yeah that would make it more smooth

drifting stump
#

i had a really efficient animation system need to find where it is

jaunty marten
pulsar heath
#

but atm while im building this up it will have to do

#

first the blueprint then the fiddling and improving

jaunty marten
pulsar heath
#

im probabbly gonna end up making a panel with the screen width

#

and move the elements inside of it

#

and not the panel itself

red tiger
jaunty marten
drifting stump
#

hmmmmm

red tiger
#

Added it to CrowBar.

#

That method is not in the game without modding it so don't try it.

jaunty marten
drifting stump
#
local time, totalTime, frameCount = 0, 0, 0
    local function OnPreUIDraw()
        time = getTimestampMs()
    end

    local function OnPostUIDraw()
        local milli = getTimestampMs() - time
        totalTime = totalTime + milli
        frameCount = frameCount + 1
        print(string.format("UIFrame took %.0fms to render", milli))
    end

    UIProfiler = {}
    function UIProfiler.start()
        totalTime, frameCount = 0, 0
        Events.OnPreUIDraw.Add(OnPreUIDraw)
        Events.OnPostUIDraw.Add(OnPostUIDraw)
    end

    function UIProfiler.stop()
        Events.OnPreUIDraw.Remove(OnPreUIDraw)
        Events.OnPostUIDraw.Remove(OnPostUIDraw)
        print(string.format("Average UIFrame render time: %.3fms", totalTime/frameCount))
    end
#

remove the print on postuidraw for a more accurate reading prints slow things down a lot

#

let it run for a while before you stop because the minimum time it can represent for each frame is 1ms

#

more samples gives a better average of the real performance

tardy wren
#

Phew. You ever break the game so hard it refuses to load to the main menu?

pulsar heath
#

not even i managed to do that

red tiger
#

Also remember that the time it takes Lua to convert from Java and execute pcall will also affect the times.

pulsar heath
#

but i make it crash a lot ๐Ÿ˜„

red tiger
tardy wren
red tiger
tardy wren
#

I see

#

Hmmm

#

My submod didn't load in the sandbox settings

#

Its translations did override the base mod's but it should've added an extra option which isn't showing up

#

Failed to parse...

#
option DaikonGeneralAnxiety.MoodleListMoodleFramework
{
    type = string,
    page = DaikonGeneralAnxiety, translation = DGR_MoodleListMoodleFramework,
}
#

Why did it fail to parse this?

#

I didn't miss a comma at the end did I

ancient grail
#

I have this idea of sort ranking system but only based on days survive
It will change the players name and everyone should be able to see the color change
Is it possible?

jaunty marten
#

I'm not sure if it's on lua side but if yes then u can try to override get player name method
about color change idk, I think there's just a color without reference

ancient grail
#

Ayt thnx

red tiger
ancient grail
#

No way im gonna do that. Lol

jaunty marten
#

yea btw I think if even override name method on lua side other features can be broken due to usage from java no lua

tardy wren
#

Well, crud, I fixed the mod option but now the translations load in the wrong order

pulsar heath
#

dumb question is there a way to name the elements inside a panel?

drifting stump
#

?

pulsar heath
#

im adding ui elements manually

#
        self:setX(AnimPosX)
        self:drawTextureScaled(getTexture("media/ui/" .. tostring(aniframe) ..".png"),0,0,90,50,1,1,1,1)
        self:drawText(tostring(AnimPosX),55,85,1,1,1,1, UIFont.Massive);
        if AnimPosX <=0 then stopanimodui() end
end```
drifting stump
#

those arent elements

#

those are draw calls

faint jewel
#

it warms me heart to see browser talking code again.

pulsar heath
#

ok, is there anyway to name the drawcalls?

drifting stump
#

no

#

you could have another uielement drawing that but youd just be moving the draw call somewhere else

pulsar heath
#

i guess il make 2 panels and manipulate everything inside each panel

#

or something even simpler... thanks @drifting stump

drifting stump
#

draw calls are as simple as it gets

pulsar heath
#

yeah im saying simpler in what i want to do

drifting stump
pulsar heath
#

ill frankenstein some code and post it so you can at least try to understand wth im doin'/talking about

#

i doubt that covers what im trying to do but will have a look

tardy wren
#

Hmm, so now it loads the lua correctly

#

But my function is now nil?

#

How do I reference a function from a different file across a global table?

#

I'm making a submod that will provide a function, and the main mod should only call it if the submod is loaded

#

I did something like this

local daikonGeneralAnxiety = daikonGeneralAnxiety or {}
local DGA_extraAnxietyMoodleFramework = daikonGeneralAnxiety.DGA_extraAnxietyMoodleFramework or nil
drifting stump
#

you could make a module exposing your main mod

tardy wren
#

In the main mod

drifting stump
#

then require it in your sub mod and add the function to the module

tardy wren
drifting stump
#

could

#

could also not

pulsar heath
tardy wren
#

Bowser you're not helping

drifting stump
#
local MyModule = {}

local function doTheThing()
    if MyModule.subModFunction then
        MyModule.subModFunction()
    end
end

return MyModule
local MyModule = require("TheFileContainingTheAbove")

function MyModule.subModFunction()
end
#

there you go

tardy wren
#

thank you

drifting stump
#

fixed

tardy wren
#

To require multiple mods, I need to put them after a comma?

drifting stump
tardy wren
#

yes

#

Oh are you kidding me

#

My mod didn't load because a mod it depends on loaded later in the order

tawdry moss
#

Is there a way to have the โ€œread sheet of paper/journalโ€ UI show up without the player having access to the paper? Iโ€™m trying to make a mod that allows using the computers as a sort of chat room for multiplayer and I canโ€™t think of a way to display the saved messages

drifting stump
#

ah yes one of my many projects

#

a fully functional pc

#

you probably want to make a custom ui

tawdry moss
#

Thatโ€™s not something I really want to do though. I guess I could try it.

#

For a different mod Iโ€™m making, is there a way to override the speed penalty imposed by injuries? A mod Iโ€™m working on will include a lot of drugs, and I want morphine to make players temporarily unaffected by speed penalties from injuries, but I donโ€™t know how to do that

pulsar heath
#

ok, got everything working... apart from the sound

#

but time for a break

drifting stump
#

i need to get the base ui elements for the community framework done before anything else

#

but im not happy with the way it is now

red tiger
#

If you need insight I could possibly provide some.

drifting stump
#

yes please im banging my head against this

red tiger
#

UI is such a pain if you don't know how it's designed from the bottom up.

#

I've probably spent around 400 to 500 hours doing UI code in PZ since 2015.

drifting stump
#

im working on the base for all uis

#

a new uielement class

red tiger
drifting stump
#

i want annotations to not show every single method available and actually act like a class

red tiger
#

I'm planning to add draw calls for things like circles and other useful bits.

#

Also the HTML render engine project. <3

drifting stump
#

if you call on the class only static methods should show up

red tiger
#

The real reason I wrote PW was for UI.

#

That's the white paper for it.

drifting stump
#

and if you call an instance then youd see everything like render update etc

red tiger
#

I'm glad to see someone else taking action to improve the UI API.

drifting stump
#

this should only show for instances aka the return of new

red tiger
drifting stump
#

of course

red tiger
#

I guess IntelliSense can be used for Lua.

#

I know about EmmiLua but not this.

drifting stump
#

this is derived from emmylua

red tiger
#

Ah ok.

#

It's beneficial regardless of choice.

drifting stump
red tiger
#

Now we have two languages with documentation as options.

#

I planned on baking in my own third-party documentation to UIElement when finishing up what PipeWrench is right now

#

So our priorities are aligned. xD

jaunty marten
red tiger
#

I simply need more time to get to it. =(

jaunty marten
#

I thought it's still on dev branch

red tiger
#

It's not ready yeah. (Not close)

jaunty marten
#

(private)

red tiger
#

But the framework's basically there.

jaunty marten
#

yea, cool, will check spiffo

red tiger
#

I paused when I started writing CSSChain. (My attempt at rulesets and order of CSS rules)

#

You can easily argue that a bit of it isn't organized in a way that would be better however most of it is documented to all hell.

drifting stump
#

i could have a table of static and another of instance methods then do some metatable magic

#

but might not be very user friendly adding functions to those tables instead of the main one

red tiger
#

Surprised that TIS didn't place drawPolygon in UIElement. It's currently in RadialMenu.

drifting stump
#
---@class CFUIElement
local CFUIElement = {}

CFUIElement.InstanceMethods = {}
CFUIElement.StaticMethods = {}

setmetatable(CFUIElement, CFUIElement)
CFUIElement.__index = CFUIElement.StaticMethods

function CFUIElement.StaticMethods:new()
    local o = {}
    setmetatable(o, o)
    o.__index = self.InstanceMethods

    return o
end
#

something like this

red tiger
jaunty marten
drifting stump
#

@red tiger think something like that would work or too complicated for newcomers to extend the class?

red tiger
#

Typescript / Lua would then be used to manipulate those elements much like how JavaScript is used to on websites.

drifting stump
#

before i get to any pre-made element i need to get the super class done

#

which is what im working on

red tiger
#

Oh, I'm talking about my stuff.

red tiger
#

I plan on writing things like ```html
<radialmenu onclick="..">
<option />...
</radialmenu>

drifting stump
#

but that will have to get translated to lua code

#

which is what this is addressing

#

making the lua side of things actually usable

red tiger
red tiger
#

I wrote my own CSS parser.

#

I can also write an HTML parser.

drifting stump
#

i dont like ts

red tiger
finite radish
red tiger
finite radish
#

oh, I was initially thinking something like SASS/SCSS/etc. but I think I see what you mean now, you wrote a parser for the game to parse CSS

drifting stump
finite radish
drifting stump
#

we talking about completely different things XD

#

im rewritting the entire ui base

finite radish
#

that's irrelevant, plenty of non-UI stuff uses inheritance in the base game

#

unless by "extension" you mean something else entirely

drifting stump
#

youre a bit lost XD

#

im rewritting it all

#

the way inheritance works atm has issues with documentation

finite radish
#

also I'm not really lost, just asking you to clarify KEKW

drifting stump
#

given any ui class

#

in fact ill examplify

#

im operating on the class yet its showing me instance methods

red tiger
# drifting stump given any ui class

This is of course my personal opinion, however as big as ISUI is in PZ's Lua codebase, ISUI needs scalability with error checking / strong types / object types.

drifting stump
#

only static methods should show up

red tiger
#

IMHO ISUI should be rewritten as TS.

pulsar heath
drifting stump
red tiger
finite radish
drifting stump
stone garden
#

guys

#

i figured the issue why superb survivors doenst work in mp

drifting stump
#

new and derive are static methods yet they still need self to make the inheritance work

stone garden
#

with my friend that know coding

#

soo the issue is obvious the npcs dont spawn in mp[

drifting stump
#

yes they dont theyre too afraid of you

drifting stump
#

to understand the mechanism behind it

red tiger
#

Keep in mind that Kahlua isn't real Lua and is 5.1. (You may know this but others don't)

finite radish
drifting stump
#

no

red tiger
#

.new is a thing Kahlua does with Java objects.

#

:new is the pseudo-class implementation that TIS uses for Lua code.

drifting stump
#

the column is needed to make inheritance work in lua

stone garden
drifting stump
#

but conceptually the method is static

#

it doesnt operate on an instance of the object

stone garden
#

i just found the issue

red tiger
#

It's a silly nuance that trips people up when they start modding PZ.

#

Thank goodness that I can rid of that nuance in Typescript using @customConstructor

finite radish
finite radish
#

but you mentioned Kahlua/TIS's implementation, that's what threw me off - it's not specific to that

red tiger
#

I've clarified already that Kahlua uses .new for Java classes that are exposed.

ancient grail
#

x and fbx

#

its just shove

sour island
#

heh nice

ancient grail
#

]so its never gonna be solid unless i do somehit reaction to the zed

#

idk how to do that via xml so i guess ill have to do it using lua

#

๐Ÿ™

finite radish
red tiger
pulsar heath
#

whats the right way to get the resolution that the game is running? I only know getPlayerScreenWidth() and that give my screen resolution and not the game

drifting stump
finite radish
drifting stump
#

the self parameter is needed for the inheritance to work

#

your version is not going to work

finite radish
drifting stump
#

ill link it again

finite radish
#

that's one way to do it, but it's not the best way (imo)

ancient grail
#

Im also going to make use of spear stab anim for the shove of the riffle with bayonet but im not sure if its possible
Is it?

drifting stump
#

what you wrote literally does not work

#

it has no inheritance

finite radish
#

lmao

drifting stump
#

but thats the issue

#

it has to inherit at any level

finite radish
#
local newClassLmao = {}
newClassLmao.new = function()
    local self = ISBaseObject.new()

    return self
end```

this is what inheritance would look like, if you want to keep proper static encapsulation (using the above change to `ISBaseObject`)
finite radish
drifting stump
#

but youre already doing it wrong having to call the new of the parent

finite radish
#

that's not "doing it wrong" if it maintains encapsulation

#

(and it does, unlike the vanilla way)

red tiger
#

I'm fine with using :new() for now.

finite radish
#

to explain why that's "the right way": any static members shouldn't be inherited with the class, because static members are inherently (lol) tied to the class. if you're trying to pass those members down, they shouldn't be static in the first place

#

and that's perfectly fine, if encapsulation isn't a goal of yours (and it doesn't really need to be if you know what you're doing and you aren't expecting other people to use your code, but otherwise it's not clean)

drifting stump
finite radish
weak sierra
finite radish
#

(or private, naturally)

drifting stump
#

not statics nor instance

drifting stump
#

read here

finite radish
#

but go off

weak sierra
#

i gather setmetatable associates a lua-interpreter-internal kind of table for something

#

but that's about the extent of my understanding lmao

finite radish
drifting stump
#

right so by what youre saying if i add instance methods to ISBaseObject then it will inherit?

weak sierra
#

huh

finite radish
weak sierra
#

such weird stuff, as someone who comes from C# and Python

drifting stump
finite radish
#

okay!

finite radish
drifting stump
#

there you go

#

no inheritance

finite radish
#

I don't know what you expected when you wrote it wrong lmfao

drifting stump
finite radish
drifting stump
#

you still dont understand

finite radish
#

I don't think you understand

#

if you're trying to emulate OOP, this is how it's done

#

anything that isn't explicity added to self is static (or if it's local, then it's private)

#

which is how encapsulation is maintained - only data added directly to the object should be passed via inheritance to any child classes

#

that's OOP 101

drifting stump
#

massive facepalm having to explicitly declare every function

vital sedge
#

Suppose you have a file with a lot of small functions, those functions are then called in another big function which is then added to OnEvent callback. How can i overwrite just that one small function of someone else mod?

finite radish
vital sedge
#

there are two options - name the file like ZZZ which will overwrite function or copy the one with big function and all others, but maybe theres cleaner way to overwrite function?

finite radish
vital sedge
#

they dont have local keyword, ok so i can overwrite them in other file

finite radish
#

yup! just do ModNameOrWhatever.FunctionName = function() <your code> end

vital sedge
#

Im just modding for myself, but i want to prevent steam erasing my shit if the mod update

blissful canopy
vital sedge
#

if i make my own file it wont replace it when mod update

#

even if its in same folder

weak sierra
#

is there a way to override locals besides overriding the whole file, some lua dark magic perhaps?

finite radish
weak sierra
#

while im asking people who know more lua than i

drifting stump
weak sierra
#

damn

finite radish
vital sedge
#

if namespaces are global[?] couldnt we just overwrite like that "namespace.functionname"?

drifting stump
#

you can get the stack for a given function and overwrite the value at that memory location with debug functions

vital sedge
#

even if function is local?

finite radish
#

because you're overwriting the reference to that function, not the function itself

weak sierra
#

but if something calls localFunction internally

#

it won't overwrite that

finite radish
#

right, exactly