#mod_development

1 messages · Page 138 of 1

fading horizon
#

i read through like 3/4 of the lua website documentation in a day a couple days ago

red tiger
#

It's type-safety meets OOP tools with JavaScript.

fading horizon
#

it had a lot of crossover with stuff i learned from js

#

which i was thankful for

red tiger
#

Heh.

#

I wrote PipeWrench so I can mod in TypeScript for PZ.

#

I don't really like Lua all that much.

fading horizon
#

i just want to get better at coding in general

#

so i can get a job in the coding industry

#

that's the dream lol

#

i have decent personal experience but trying to get your foot in the door without a degree or prior professional experience is pain

glass basalt
#

i code w/o professional experience or degree, it's just an investment

trail bloom
#

Question I'm trying to code in lua but I'm struggling to get the methods that PZ uses. I've tried decompiling the luamanager but it crashes everytime I try to decompile, any advice?

glass basalt
bronze yoke
#

ah... too slow

glass basalt
#

beat ya :P

fading horizon
#

i just want to get a coding job so i can make $$$

glass basalt
#

get a sysadmin job and fake it with ChatGPT until you make it

fading horizon
glass basalt
#

from what i've heard its cozy

fading horizon
#

but also getting taken seriously as a woman in the computer field is dreadful

#

so that's super fun

fading horizon
#

@red tiger are you manually removing your link previews or is that a bot

glass basalt
#

sysadmin usually don't interact with people IRL

red tiger
#

That'd be me.

fading horizon
#

king shit

red tiger
#

It's out of respect to not flood the chat.

fading horizon
#

love to see mindfulness like that

red tiger
#

It's also why I post files over code blocks.

fading horizon
#

were you the one that like two days ago told me about syntax highlighting with the discord code blocks

fading horizon
#

bc ive been using code blocks and the highlighting ever since and its amazing

red tiger
#

I do this to everyone I see who plain pastes their code here.

fading horizon
#

i love this discord man. Everyone here has been so nice and helpful

#

and y'all are some smart mfs

red tiger
#

I like to spend time working on things that helps people.. that's about all.

#

=)

fading horizon
#

i wanna get there someday

#

unfortunately most of the things ive coded are only useful to me so i can't really share them

red tiger
#

Nothing stopping you from starting today.

#

Just make sure you're correct and know it before giving definite / confident answers.

#

Nothing wrong learning with the one you help.

fading horizon
#

like heres the youtube theme / js extension i made a couple days ago

glass basalt
#

out of all of my stupid code, the SOUND is what's bugging my entire mod functionality
stressed

fading horizon
#

its nothing special but i think it makes youtube a lot better lol

red tiger
#

Like.. just have fun.

#

Good things will follow.

#

I have honestly no aim with my work. This code started out as a meme and PipeWrench too.

#

I hated Lua so much that I joked about compiling to it.

#

Then I found TSTL.

red tiger
#

8 months of work followed.

fading horizon
#

it be like that

red tiger
#

You simply follow what's fun.

fading horizon
#

i got pissed off at one single field on my company CRM that IT couldn't bother to fix

rancid panther
#

TIL the workshop rating system... uses stars to represent upvotes drunk

fading horizon
#

decided to write some code to fix it

#

a year later i automated my whole job

glass basalt
rancid panther
#

i was wondering why i couldnt rate a mod with stars

glass basalt
fading horizon
#

mindfulness is definitely a learned skill

rancid panther
#

it's cuz u cant... they just have stars for no reason

fading horizon
#

you can rate a mod with no stars

rancid panther
#

yea i know

fading horizon
#

my new mod has no stars but upvotes

rancid panther
#

but the stars are represented by the upvotes

#

all this time i thought they were 2 different rating systems

fading horizon
#

any change you know how many ratings you need to get the stars to show up?

glass basalt
#

reifel is a star rating connoisseur, could bug him about it

#

25

fading horizon
#

i'm at 12 and no stars

rancid panther
#

apparently u need 75 upvotes for 3 stars? not sure

fading horizon
#

dang ill never get that 💀

rancid panther
#

and 200 for 4 stars

ancient grail
cosmic condor
#

1-4 stars are easy to reach

fading horizon
#

although i will say i'm really fucking proud that my first mod has that many subs

red tiger
#

I said I'd get all Recipe properties put into my extension before midnight.. and I'm having fun talking here.

#

lol.

fading horizon
glass basalt
#

25 positive ratings gets you 3 stars
afterwards it gets convoluted

ancient grail
#

ahh nice

fading horizon
#

my very first mod

#

my baby

rancid panther
#

it's a very good mod for a problem many pol have with patching clothes

fading horizon
#

honestly i was amazed it hadnt been done yet

#

there was an invisible patches mod already out there but i saw it had errors

#

do people just not patch their clothes?

ancient grail
#

congrats pretty soon you will have alot more high ranking mods

fading horizon
#

just run around with dookie stain leather patches?

red tiger
#

My first mod in PZ was an anecdotal situation. It absolutely blew up.

rancid panther
#

most ppl do not do tailoring

cosmic condor
red tiger
#

It was my baby too.

#

I got banned over it.

#

Hahaha

fading horizon
#

i'm really excited for the mod I want to make eventually

#

its going to be an absolutely massive undertaking

#

but theres nothing like it on the workshop

ancient grail
cosmic condor
#

yes, people are different

ancient grail
red tiger
#

I wish I could get the drunk emote as my badge for this server.

cosmic condor
#

better give them choices

fading horizon
glass basalt
#

tailoring in vanilla is a PITA POS system that requires you to cheat to make it seem worthwhile

rancid panther
#

amphetamae can i have the text coding for how you added your mods in the workshop description?

fading horizon
#

sure!!

#

it took some googling

glass basalt
#

probably just an imgur img and url

fading horizon
#

was a pain

#

one sec

#
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2949818236][img]https://i.imgur.com/4Ia4Tue.png[/img][/url][noparse]     [/noparse][url=https://steamcommunity.com/sharedfiles/filedetails/?id=2951287846][img]https://i.imgur.com/pDYJFPo.png[/img][/url]```
rancid panther
#

i see. i used to use that on message boards

#

is this BBCode?

fading horizon
#

has to be all on one line or it will insert a line break between the images

#

note that widgets do not seem to work on workshop pages

rancid panther
#

i see thank you

fading horizon
#

or at least I couldn't get them too

#

also be aware that for some reason, not all image links work

#

for example, linking an image from the pz forum did not work so i had to use imgur as a host

#

not mentioned in that guide I just linked is that there is more than just he [h1] format

rancid panther
#

ah

fading horizon
#

i think it goes all the way to [h4]

rancid panther
#

i have used bbcode before

fading horizon
#

[img][/img] also isn't in that formattting guide

#

so keep that in mind

rancid panther
#

so im familiar with a lot of these

#

i should probably add that for easy self promotion

fading horizon
#

had to google bbcode

#

interesting

#

Security

If you allow users to use HTML, you have to protect your webpage against malicious scripts in <script> tags.

#

because i was like "why would anyone use bbcode when html exists"

#

but that's a solid point

fading horizon
#

i honestly wouldn't mind formatting a description for your page if you want me to

#

wouldn't take me too long

cosmic condor
#

Sometimes, Steam filters out outside links, so I upload images to another private mod instead of using Imgur

rancid panther
#

yea me too. i can do that on my own thanks

fading horizon
#

also if you want this

#

[img]https://steamuserimages-a.akamaihd.net/ugc/1660101375273576639/0C12E325C464F5DC166E5FF2AB70A43581BED64F/[/img]

#

i took this from another mods page, but ive seen the exact same gif on many other mods by different creators so I assume its fair use

#

(if someone thinks that's bad please let me know and i'll remove it immediately)

rancid panther
#

thank u very much

fading horizon
#

of course, happy to help however i can

fading horizon
#

i recommend resizing your images to 100x100 if you're going to do something similar

#

esp if you have several mods

rancid panther
#

there's a way to change the length and width of an image in bbcode im p sure

fading horizon
#

unfortunately theres no way to set height and width properties in the img tag

#

that i found at least

#

if you figure that out, ill owe you big time

rancid panther
#

just put width=100 i think and it will properly adjust

#

or w=100

fading horizon
#

i tried several different ways

#

couldn't get it to work

red tiger
#

Cool. Just made my property API auto-populate with a float value for float properties and int values for int properties.

#

That should help people.

fading horizon
#

based

cosmic condor
red tiger
fading horizon
#

also the fact i'm just figuring out the separate zomboid exe with local cache pisses me off so much

#

ive been sitting here with like 10 minute load times from all my mods

#

now i do this and i can load up with two mods in like a minute

#

i looked up resizing an image with bbcode and it looks like the standard way to do it is [img=100x50]

#

unfortunately, does not work in steam

cosmic condor
#

try this

[img]https://steamuserimages-a.akamaihd.net/ugc/1749106328797076821/645FD7D2186000D12D667825B039D30C350056E5/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img]

fading horizon
#

works

#

but i don't see where the image size is in that link / tag

cosmic condor
#

imw=150&imh=150

fading horizon
#

oh

#

my blind ass

cosmic condor
#

with a link
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2854030563][img]https://steamuserimages-a.akamaihd.net/ugc/1749106328797076821/645FD7D2186000D12D667825B039D30C350056E5/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img][/url]

red tiger
#

I now support autofill for Lua code based on Recipe name.

fading horizon
#

hmmm

#

i can't seem to get it to work with my images

#

[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2949818236][img]https://i.imgur.com/4Ia4Tue.png/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[[/img][/url][noparse] [/noparse][url=https://steamcommunity.com/sharedfiles/filedetails/?id=2951287846][img]https://i.imgur.com/pDYJFPo.pngimw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[[/img][/url]

#

here you can see i tried adding the imw thing with /? before it to the first link

#

and adding it directly after .png in the second link

#

neither seems to have worked

#

do you think you could help me with the formatting with my images?

cosmic condor
#

upload images to another of your private mod instead

fading horizon
#

well i guess i could use the mod pages preview image

red tiger
#

Going to spread this logic to all Lua properties and then head out.

#

People are going to flip when they see auto-fill for Lua method references.

#

They'll have to make them in Lua but yeah.

#

The goal is to make it easier on people who don't know what the property is or does.

#

This is what my API config looks like: (Uses custom completion function over the generic one):

#
OnTest: {
            type: 'string',
            onComplete: (name: string | undefined): vscode.CompletionItem => {
                const key = 'OnTest';
                const desc = `
### Description:
The parameter contains the name of the Lua function that
checks the resources (items) used in crafting and returns
true or false.

### Example:
\`\`\`zed
OnTest: Recipe.OnTest.IsNotWorn,
\`\`\`

### Implemented Lua Function:
\`\`\`lua
function Recipe.OnTest.IsNotWorn(item)
    if instanceof(item, "Clothing") then
    return not item:isWorn()
    end
    return true
end
\`\`\`
`;
                const nameProper = name
                    ?.toLowerCase()
                    .split(' ')
                    .map((o) => {
                        if(o.length) {
                            o = o[0].toUpperCase() + o.substring(1);
                        }
                        return o;
                    })
                    .join('');
                const item = new vscode.CompletionItem(key);
                item.documentation = new vscode.MarkdownString(desc);
                item.insertText = new vscode.SnippetString(key + ': Recipe.OnTest.${1|' + nameProper + '|},');
                return item;
            },
        },
#

This is what you don't see.

fading horizon
#

you know what I would appreciate in your vscode extension that would have saved me a lot of time?

#

checking for difference in : and .

red tiger
#

Heh. Eventually.

red tiger
fading horizon
#

i didn't understand the difference when trying to add / replace a function and it took me literal hours to figure out why

#

simply because of having . instead of :

#

maddening, but part of the learning process

red tiger
#

Lua has zero checking.

#

Lua isn't designed to check pre-runtime.

#

I'd literally be shooting myself in the foot if I tried to do that.

fading horizon
#

yeah i tried to search for something like that and all i got was some pcall function that i couldn't really get to work how i wanted it to

#

so i just said fuck it

red tiger
#

I wrote TypeScript alternative to fix this.

fading horizon
#

Jab you're making me want to learn TypeScript

#

stop it

red tiger
#

I'll eventually convert everyone.

bronze yoke
#

i stopped using : for function definitions because emmylua won't understand the type tired

red tiger
#

Muhahahah

#

(Laughs in JavaScript)

#
export function toPascalCase(str: string): string {
    return str
        .trim()
        .toLowerCase()
        .split(' ')
        .map((o) => {
            if (o.length) {
                o = o[0].toUpperCase() + o.substring(1);
            }
            return o;
        })
        .join('');
}
fading horizon
#

very much appreciated, thank you

glass basalt
#

TypeScript is a POS, I HATE NPM I HATE THE BLOAT I HATE RECOMPILINNGGGGGGG

#

lol

red tiger
glass basalt
red tiger
fading horizon
#

note that the images must be steam image links

#

i recommend making the size 150 x 150

#

[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2949818236][img]https://steamuserimages-a.akamaihd.net/ugc/2046362392225211607/72B0EBF6F283ADFEC058805DC437E6B06EEC21CD/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img][/url][noparse] [/noparse][url=https://steamcommunity.com/sharedfiles/filedetails/?id=2951287846][img]https://steamuserimages-a.akamaihd.net/ugc/2046363109997134551/25FB1A820B4AD7852AF82B879EE045769A79EC91/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img][/url]

#

must all be on one line or it will insert a line break between images

#

/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true

the first two numbers are where you set the custom width and height

#

i feel like i should write a guide on this description formatting because all i found online is outdated shit

glass basalt
#

apparently, when I remove a function from my event, it breaks the rest of the functions called by the event
stressed

fading horizon
#

love to see it

glass basalt
#

literally just
Events.OnParachuteLanding.Remove(ParachuteSoundAfterLanding)
like any other vanilla event. Why does this break everything?

#

it should be syntactically correct

fading horizon
#

wait you made the parachute mod?

#

good stuff

glass basalt
#

i feel like im having deja vu

fading horizon
#

very cool idea

#

you might

#

i'm still getting to know everyone

#

so I may have come to this realization before

glass basalt
#

i could swear like 4 different people recognized that I uploaded the parachute mod

fading horizon
#

#famous

glass basalt
#

"haha yes thank you"

bronze yoke
#

honestly i just wouldn't use events

#

custom events, i mean

wooden lodge
#

Does anyone know where I can find the default vanilla VHS tapes and how to make my own? I remember I've done it in the past but for the love of god I can not remember the vanill file

fading horizon
#

probably a .x file

glass basalt
#

how else can I time timed actions to perform after another event, when they are in completely separate blocks of code

fading horizon
#

ill take a look real quick

glass basalt
bronze yoke
#

i'd need more detail on why you can't just call the function

fading horizon
#

relevant vhs files

glass basalt
bronze yoke
glass basalt
#

functions with queue actions. params are complicated

function InsurgentWeaponUtil.equipAndFullyLoadWeapon(player, weapon, magName)
    local mag = InsurgentWeaponUtil.addMag(player, magName)
    mag:setCurrentAmmoCount(mag:getMaxAmmo() + 1)

    InsurgentWeaponUtil.equipWeapon(player, weapon)
    ISTimedActionQueue.add(ISInsertMagazine:new(player, weapon, mag))
end

function InsurgentWeaponUtil.equipWeapon(player, weapon)
    ISTimedActionQueue.add(ISEquipWeaponAction:new(player, weapon, 30, true, weapon:isTwoHandWeapon()))
end
glass basalt
red tiger
#

Happy.

#

Very happy.

glass basalt
#

where I trigger the event

function ParachutingAction:perform() -- Trigger when the action is complete
    self.action:setBlockMovementEtc(false)
    ISBaseTimedAction.perform(self)
    triggerEvent("OnParachuteLanding", self.character)
    print("["..modName.."] Finished timed action")
end
red tiger
#

Time to read some webtoons and get some rest.

#

Thanks for all the feedback today.

bronze yoke
#

if you remove a function from the event while the game is still looping through the event functions, the index gets offset and it messes up

glass basalt
#

i have two other functions that work flawlessly

#

oh

bronze yoke
#

it's sort of hard to describe

#

it's like removing elements from a table while looping through that table

glass basalt
#

the functions fire by index?

bronze yoke
#

this is what i've heard anyway

fading horizon
#

jeez i wonder why my mod isn't fucking working or doing anything when i add new code
realize i just switched to a local cached version of zomboid and i'm still editing the old files so its not updating on the version i'm actually using

i'm gonna scream

glass basalt
fading horizon
#

so i don't have to load like 400 mods

#

reduces my load time to nothing

#

also this way i'm not touching the main version of the mod

#

kinda version control

glass basalt
bronze yoke
#

that'd probably be fine

glass basalt
#

the spaghetti thickens

small topaz
#

can world objects like traps also have persistent modData?

#

not yet exactly sure but I think the "trap" I am working with a an isoObject

bronze yoke
#

all isoobject derivatives have moddata

glass basalt
#

I think I'm a little stupid and don't need to remove these functions from my event

#

and have basically wasted time being infuriated with code that is working as intended

open drum
#

is there a simple lua function that adds recipe that is stated in script folder?

glass basalt
#

recipes are automatically added in the script folder

#

if you want lua functionality, you need to write a function for it

open drum
#

yea i knew they are automatically added when i have it on script file

#

but to give better question

#

i wanted to make an item

#

that gives recipe

glass basalt
#

ah. that I do not know, but you can probably look for items in the game that do that, in the script files

open drum
#

but use Normal type

#

instead of literature type

#

gotcha 🙂

#

'''

red tiger
#

I am a creature of the night.

open drum
#
    item GenBlueprint
    {
        DisplayCategory = WURO_items,
        DisplayName = Generator Blueprints,
        Type            = Literature,
        Icon            = GenBlueprint,
        Weight              = 0.1,
        WorldStaticModel = CreditCard,
        Tooltip = Contains instruction about generators,
        TeachedRecipes = Generator Tech
    } 
    ```
glass basalt
#

The types block off functionality between items, you may be restricted to needing to use Literature type

open drum
#

i don't know if I can also include onCreate parameter in literature type item

red tiger
#

I'm scared about making this extension for the reason of knowing how to answer more questions in here.

glass basalt
#

knowledge is scary

red tiger
#

People seeking knowledge is scary.

#

Wanna know something even more scary?

#

I haven't sat down and played PZ since February of last year.

#

Everything up until now has been modding.

glass basalt
#

i haven't sat down to play PZ legitimately since I started this mess, and its been 2 months

bronze yoke
#

i think i've had maybe two zomboid saves in the last year?

open drum
#

zㅋㅋㅋ

bronze yoke
#

modding is the new game for me

open drum
#

lol yea

#

same

#

after i started modding

#

i wasn't able to actually play PZ

#

XD

glass basalt
#

why are we modding a game to improve it if we aren't playing the game while it's continuously being improved? stressed

open drum
#

xD

#

agreed

red tiger
#

I play vicariously

#

I meta harder than you all since you mod using my mods.

open drum
#

haha watching youtube?

red tiger
#

Hahaha help me

open drum
#

xD

red tiger
#

I'm more interested in transpilers and tools than playing games.

#

PZ needs so much more love with improving API and language design.

glass basalt
#

is there a way to clear all functions added to an event or do I have to hard-code it?

#

ah shoot nvm this clears everything, oh no

red tiger
#

Sometimes simple can be too powerful.

#

Remove the function that you add when you need to.

#

Assign to a var and call Remove when you need to remove it

#

Something tells me that I am going to write a second goddamn vscode extension for Lua .

#

Hahaha

glass basalt
#

doesn't change that it's hardcoded. I don't mind explicitly removing each function or making a loop that removes from a table I made, but I wish it could be dynamic

red tiger
#

One-time fired event handlers would be insanely useful though...

#

Once you write one that works it isn't hard after.

indigo hemlock
#

Does somebody ever tried to add animation for placed 3d objects or sprite furniture? 😅

red tiger
#

Aren't map tiles static sprites in build 41?

glass basalt
#

sprite furniture aren't map tiles

#

radios and TVs have anims

red tiger
#

Ah ok

open drum
#
addGridSquareMarker(int int1, int int2, int int3, float float1, float float2, float float3, float float4)
#

anyone know what those int 123 and float 1234 do?

#
  public WorldMapGridSquareMarker addGridSquareMarker(int paramInt1, int paramInt2, int paramInt3, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4) {
    WorldMapGridSquareMarker worldMapGridSquareMarker = ((WorldMapGridSquareMarker)s_gridSquareMarkerPool.alloc()).init(paramInt1, paramInt2, paramInt3, paramFloat1, paramFloat2, paramFloat3, paramFloat4);
    this.m_markers.add(worldMapGridSquareMarker);
    return worldMapGridSquareMarker;```
bronze yoke
#

the javadoc has parameter names

open drum
#

this was all i could find..

red tiger
bronze yoke
#

public WorldMapGridSquareMarker addGridSquareMarker(int worldX, int worldY, int radius, float r, float g, float b, float a)

indigo hemlock
open drum
#

ah gotcha

#

thanks

glass basalt
red tiger
open drum
#

why couldn't they just write that on .class

bronze yoke
#

it's lost after compilation

open drum
#

ah

#

so it's better to use api website

red tiger
#

Whatever made TIS care enough to update their docs thank you..

glass basalt
#

yeah holy crap

bronze yoke
#

the website is fast for finding things, reading the source is still very useful

#

sometimes it still won't be clear what something does, best to just read the source when that happens

red tiger
glass basalt
#

time to test like a bajillion edits I made in my code, all at once 😎

red tiger
#

As someone who has worked with the most obfuscated code in reverse engineering, what they do to obfuscate the end result isn't worth it m

open drum
#

boom~

red tiger
#

I'd rather see modders getting what info they need to do what they came to do.

glass basalt
#

attempted index: isTwoHandWeapon of non-table: null
looks like I missed a thing to tweak

red tiger
#

Thanks for being epic albion with helping people here. Lurk mode activated.

open drum
#
function GenRepair_OnCreate(items, result, player)
    
    local locX = player:getX
    local locY = player:getY
    local locZ = player:getZ
    
    local checkX = 200    
    local checkY = 200
    local checkZ = 0 
    
    if locX == checkX and locY == checkY and == locZ == checkZ then
    player:say("FIXED!")
    
    
    else 
    
    local _square = getCell():getGridSquare(checkX,checkY,checkZ)    
    local circle = getWorldMarkers():addGridSquareMarker("circle_center", "circle_only_highlight", _square, 0.2, 1.0, 0.2, true, 1,0.1,0,100);
    
    --circle:remove()
    
    end
    
    
end
#

not sure if i did this correctly..

#

probably not really a good idea to use exact x y z coordinates though..

#

maybe i should use chunk intead..

glass basalt
#

player:getX
shouldn't this be getX()?

open drum
#

wanted to make , when perfomed oncreate action, the game checks the player's xyz and if the player is at the right spot, it produce Fixed saying, while not, it produce a circle marker at the correct place

glass basalt
#

or is it an int

open drum
#

getX()

#

yea u r right

#

lol

#

WHIPLASH ~!

open drum
#

if i do getCell:getGridSquare() in client

#

will that only work on 1 person in MP?

#

logically it should...

glass basalt
#

you probably need to execute that in the client

open drum
#

yea

#

i dont' want recieving 20 diff. responses

#

xD

#

looks like isoplayer don't have getGridSquire() function inherited

#

haha

#

ah, getPlayer():getCell():getGridSquare() works.

#

ill use that instead of X Y Z

#

a gridsquare is 10x10 right?

glass basalt
#

hmmm, honestly idk

open drum
#

gotcha

glass basalt
#

I only know cells and isogridsquares

open drum
#
getGridSquare(int x, int y, int z)```
#

do i have to give int X Y Z in this constructor?

#

wouldn't getPlayer

#

just automatically fill it in and return gridsqure value of where character is standing?

glass basalt
#

i would first get the player's square and then the x y z from that object

#

i don't have any map stuff in front of me right now so I don't know the execution

open drum
#

hmm i guess ill have to run the game and find out...what is returned when i do getPlayer():getCell():getGridSquare()

#

on console

glass basalt
#

or are you trying to getPlayer():getCurrentSquare()?

open drum
#

to a set gridsquare

#

so when a player enters that gridsqure

#

a function can b executed

glass basalt
#

ah gotcha

glass basalt
#

well yeah, you just need to define x y z

#

and put them in

ancient grail
glass basalt
#

wait... it worked? no no no, this can't be. I'm supposed to be debugging mods, that's all that I do, WHAT DO YOU MEAN IT JUST WORKS NOW? NOW I HAVE TO STOP DEBUGGING THAT'S ALL I KNOW

#

yay 😄

wooden lodge
# fading horizon

That is not at all what I'm looking for. Those are objects and images. I'm looking for the file wher the VHS's are defined, the text, skill etc. they display

fading horizon
#

my bad, your question was a little unclear on exactly what you wanted

wooden lodge
#

That's on my end, I apologize

fading horizon
#

nicely done

rancid panther
#

what r the backpack's stats?

glass basalt
#

hiking bag stats

#

20 cap 70 reduce

drifting ore
#

hmm, i found some file like record media and translate EN, so i guess its use for the VHS tape.
The question is i see it’s line has structure like RM-abcxyz
So this line is generate or we just type what we want?

rancid panther
fading horizon
#

i want to make a drug mod but theres already so many on the workshop

#

:/

#

i just finished the first update to my clove cigarettes mod though

rancid panther
#

u can make whatever u want and make it better than all the alternatives out there

fading horizon
#

added a carton of cloves

rancid panther
#

that's how you win in this world

fading horizon
#

which is a recipe item

#

made another custom model for it too

#

it was a pain in the ass

#

lol

rancid panther
#

nice nice

fading horizon
#

its a shitty model but its so small you can't really tell

rancid panther
#

we love shitty models in this house

fading horizon
glass basalt
#

it's a box, how can it be shitty

rancid panther
#

how many packs r in there

fading horizon
rancid panther
#

that honestly looks perfectly fine

fading horizon
#

my next step is randomizing the amount of cigarettes that get dropped

#

i found a mod that does exactly that

rancid panther
#

24 individual cigs? you might be able to make the box thinner then

fading horizon
#

trying to contact the owner for permission to use some of his code

fading horizon
#

i know its not proportionally accurate but i think it looks better

rancid panther
#

i see. in that case it's nice

#

it will look nice on display

fading horizon
#

what the real thing looks like

#

i basically just ripped the faces from this image and transformed them onto the model

rancid panther
#

ah

fading horizon
#

i guess the real thing would have like 6 or 8 packs in a box. 12 per pack so 72 / 96 individual cigarettes per carton

#

and that just seems like too much to be able to drop

#

but on the other hand it would help with cigarette hoarders who need to pack large amounts

rancid panther
#

it is helpful to have a carton to carry more cigs, for those with smoker trait

fading horizon
#

ive honestly never even used the smoking mechanics in this game

rancid panther
#

did you make your cigs compatible with the smoker trait? you need to decrease smoking stress rather than just normal stress

glass basalt
fading horizon
#

its not very simple 😓

#

at least to me

glass basalt
#

hmm alr

rancid panther
#

do u already know how to make it spawn with an exact amount inside?

fading horizon
#

not really. I've done very, very little with loot distribution

rancid panther
#

or only spawns as an item with a normal recipe to give u 24 cigs back?

fading horizon
#
    {
        DisplayCategory             =   Junk,
        Count                        =    12,
        HungerChange                =    0,
        StressChange                =    -3,
        UnhappyChange                =     -3,
        Weight                        =    0.001,
        RequireInHandOrInventory    =    Matches/Lighter,
        Type                        =    Food,
        DisplayName                    =    Clove cigarettes,
        Icon                        =    cloves,
        Tooltip                        =     Get lung cancer in the edgiest way,
        CustomContextMenu           =   Smoke,
        CantBeFrozen                =   TRUE,
        OnEat                       =   OnEat_Cigarettes,
        StaticModel                 =   clove,
        EatType                     =   Cigarettes,
        WorldStaticModel            =   clove_ground,
    }

item ClovePack
    {
        Weight                =    .01,
        Type                =    Normal,
        DisplayName            =    Pack of Clove Cigarettes,
        DisplayCategory     =   Junk,
        StaticModel         =   cloveBox,
        WorldStaticModel    =   cloveBox,
        Icon                =    clovePack,
    }```
rancid panther
#

if you make it a drainable item with 24 uses, you can make it spawn with a random fill

fading horizon
#
    {
        ClovePack,

        Result:CloveCigarettes=2,
        Time:10.0,
    }

recipe Pack Cloves
    {
        CloveCigarettes = 24,

        Result:ClovePack,
        Time:10,
    }```
#

this is the code

rancid panther
#

and then every use removes 1 cig

fading horizon
#

hmm

#

that's a solid idea

#

i'm also trying to modify the individual clove cig distribution thoughh

#

which i can't make a drainable

glass basalt
#

just take a look at the Smoker mod, uses standard code, nothing special

rancid panther
#

drainable as in removing 1 from a pack

fading horizon
#

basically what the cigarette randomizer mod does is check if a container has cigarettes, roll a random, and remove a certain number of cigarettes from the container

#

thats basically what i'm going to try to recreate

#
local function removeCigarettesFromContainer(_container)
    if not _container  then return; end
    local chance = ZombRand(100)
    if chance == 0 then return; end
    local containerItems = _container:getItems()
    local itemsToRemove= {};
    if containerItems then
        for i = 0, containerItems:size()-1 do
            local item = containerItems:get(i);
            if item and item:getEatType() == "Cigarettes" then
                if ZombRand(100) <= chance then
                    itemsToRemove[i] = item
                end
            end
        end
        for k, itemToRemove in pairs(itemsToRemove) do
            _container:Remove(itemToRemove)
        end
        itemsToRemove = {}
    end
end```
#

like this

#

but that's not super important right now

rancid panther
#

if you make a clovepack as an individual item, then it always needs to be full on spawn. if it is drainable, you can remove cigs until it is empty

#

depending on how u wanna do it

fading horizon
#

but so far in a couple days ive learned 3d modeling, lua stuff, published two mods, learned how to properly replace functions, etc

#

i'm hap

rancid panther
#

but i wouldnt mind if there was a rare chance of just finding full cartons

#

just make it rare

fading horizon
rancid panther
#

nice nice

#

im p new to modding myself

#

everything i learned so far is related to traits and professions

fading horizon
#

ooo

#

may i ask what it is that you're working on?

#

or what it is you intend to try to create?

fading horizon
#

ooooooooooooooooooooooooo now i remember us talking about this. We were going back and forth on how long it should take to check the wound after bitten

#

cool stuff

rancid panther
#

i think my immunity mod is the only mod that currently lets players spawn as immune on a random chance

fading horizon
#

i'm gonna have to start adding notes to peoples profiles in here so i can remember who is who i swear

rancid panther
#

ah yea

#

my mod has comments in it to explain why i have each function in there

fading horizon
#

Unfortunately the health panel does not have proper modding support, so I will not be attempting it again until support is added for it.

#

pain

rancid panther
#

very pain

#

it's okay tho. i'd be more pain if they changed the health ui and i'd have to remake the mod

fading horizon
#

build 42 never

rancid panther
#

i'm also open to using a framework or library if someone were to make a mod that allows anyone to modify the health panel and all be compatible with each other

fading horizon
#

also if anyone actually plays this game instead of just modding, would you mind turning my mod on to see if the item distribution is okay?

I've tested it myself and it seems alright but i don't really know what i'm doing

#

not trying to bait subscribers i just legit want some testing help aha

rancid panther
#

lol anyone who gets into modding rarely ever returns to being a normal player

fading horizon
#

i killed 75 zombies and got 2 packs of cigs

#

i feel that's decent

rancid panther
#

sounds decent to me

fading horizon
#

haven't made distribution for the carton yet

#

i don't know if i even want to

rancid panther
#

is the spawn rate based on the vanilla cigs?

fading horizon
#

maybe it should just be a recipe for the player

fading horizon
rancid panther
#

it can be. a lot of mods have packages that arent meant to be found

#

ah

fading horizon
#

they should mostly be found on zombies though

#
-- ["list"]["inventorymale"]
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "CloveCigarettes.CloveCigarettes");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 3);

-- ["list"]["inventoryfemale"]
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "CloveCigarettes.CloveCigarettes");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 3);```
rancid panther
#

good good

fading horizon
#

they have the highest spawn of "3"

rancid panther
#

you can make it so they only spawn clove cigs if they are wearing black 😂

fading horizon
#

that is something i want to do

#

i know there's a punk outfit character

#

they need cloves

rancid panther
#

in that case, it might be even easier, since punks have spawn definitions

fading horizon
#

or i can check for any of the goth items from several mods I have and make it spawn if those exist

rancid panther
#

that too

fading horizon
#

so much i can do

#

i wish i could fast forward like a month to when i know more so i could just make the mod i want to make right now

rancid panther
#

the ideas keep coming and then eventually you cant actually keep up with them all

#

i wanna make a mod for call of duty zombies sodas to spawn in soda machines

fading horizon
#

hmm i don't think that should be too too difficult

#

that's a cool idea though

#

will they have significant buffs / power ups?

rancid panther
#

it depends on how i feel about balancing it probably

#

maybe it'll have sandbox variable effects

fading horizon
#

that's one of the next things on my to do list to learn

#

mod options and sandbox variables

#

dang i wish you could zoom in more in the game / the graphics were just a little bit better

#

making a makeup mod that added a bunch of different cosmetics would be cool

rancid panther
#

idk how sandbox variables work for loot tables, but you can use SandboxVars.Module.Name (something like this) to make sandbox options, with a sandbox options file

#

if u wanna use something as practice without any guilt, u can look at my mods as much as you want

fading horizon
#

thank you, I appreciate it

#

I kinda want to make a whole array of goth style mods

#

so i might take a look at your trait / profession framework to make a goth trait

rancid panther
#

profession framework is super easy to use

fading horizon
#

which could give night eye trait by default, no clove health damage, etc

rancid panther
#

i have an unlisted mod that uses it

#

havent uploaded it yet cuz i wanna use it with my friends before uploading it

and also cuz i just add a bunch of useless features on it that dont make sense together

#

like a Tomaro ModPack. all my mods combined into one

fading horizon
#

i get that

#

some of the programs ive written are just like that

#

a hodge podge of things that just work for me

rancid panther
#

i should probably upload a separate thing for just the occupations and traits tho

#

and make the modpack its own mod

fading horizon
#

oh man

#

i could make the goth trait give bonus damage or speed when wearing all black

#

why do i get filled with ideas at 1am

#

this is a stupid question but does anyone have a guide on properly updating your workshop mod

glass basalt
#

wdym properly update

glass basalt
fading horizon
#

well ive never updated a mod before.

Do i just upload the new files in the C:\Users\user\Zomboid\Workshop and steam will catch that and update it?

#

i don't really know how it works in general

fading horizon
#

i live in hell

glass basalt
#

all of your changes in Workshop\YourMod are saved when you upload. it just reuploads the entire folder

#

nothing fancy

glass basalt
fading horizon
#

i'm near phoenix

glass basalt
#

yeah I've heard phoenix is terrible because it's just a flat plain

fading horizon
#

yeah, desert is ugly. Just sand and dirt and barren trees

#

people here suck, inflation and rent increase is some of the highest in the USA atm, politics are a mess

#

but i came from texas which is even worse so

glass basalt
#

not much of an improvement lol

fading horizon
#

ill move somewhere north someday

#

that's the goal

#

somewhere its not so hot all the time

glass basalt
#

i feel 😔

fading horizon
#

what about you? where are u from

glass basalt
#

Denver

#

cold as shit rn

fading horizon
#

i was in denver once

#

seemed nice

#

i was just passing through though

glass basalt
#

there's just snow and that's about it

#

nature is nice sometimes

fading horizon
#

well you know where i'm from so to me, snow is a miracle

glass basalt
#

once in a blue moon it snows in AZ. i heard it did recently, somewhere in the desert

open drum
#
    
    local locX = player:getX()
    local locY = player:getY()
    local locZ = player:getZ()
    

    
    
    local playergrid = getCell():getGridSquare(getPlayer():getX(),getPlayer():getY(),getPlayer():getZ())    
    local setgrid = getCell():getGridSquare(x,y,z)    
    
    
    if playergrid == setgrid then
    player:say("FIXED!")
    
    
    else 
    
    
    local circle = getWorldMarkers():addGridSquareMarker("circle_center", "circle_only_highlight", playergrid, 0.2, 1.0, 0.2, true, 1,0.1,0,3);
    
    --circle:remove()
    
    end
    
    
end```
fading horizon
#

it snows sometimes up in places in the mountains

open drum
#

guys what's the best way to run circle:remove()

#

after like 10 seconds?

fading horizon
#

or somewhat recently we got some snow crystals. Thanks climate change

open drum
#

since event.add has 10 mins and every tick only

glass basalt
open drum
#

event.OnPlayerUpdate.add() ?

#

how many ticks are in a second?

fading horizon
#

The question has no answer, because the world is not driven by a constant timer tick.

glass basalt
#

i don't know, it depends on framerate 😂
have a variable for like, 600

open drum
#

ah

glass basalt
#

and then subtract the variable by 1

fading horizon
#

taken from here

glass basalt
#

if the variable is not 0 yet, just return

open drum
#

till the variable goes to 0

#

and exit the function

glass basalt
#
local myGlobalVariable = 600

function myTimer(player)
  myGlobalVariable = myGlobalVariable - 1
  if myGlobalVariable > 1 then
    return
  end
  -- do something
  Events.OnPlayerUpdate.Remove(myTimer) -- to stop this function
end

Events.OnPlayerUpdate.Add(myTimer)
#

here

open drum
#

ah

glass basalt
#

put Events.OnPlayerUpdate.Add(myTimer) somewhere in the other function you have

open drum
#

so it only runs when player is updating

glass basalt
#

it is simply the fastest event that triggers

open drum
#

but will this event run

glass basalt
#

I haven't figure out how to run by tickrate so this is my cheat

open drum
#

if player doesn't move

glass basalt
#

yes

open drum
#

nor do anything?

#

i see

glass basalt
#

OnPlayerUpdate is every few milliseconds

open drum
#

gotcha

glass basalt
#

like tick rate but again idk ticks

open drum
#

then after the circle is removed

#

i should remove the event too

#

to reduce the lag

glass basalt
#

yeah the event should remove itself

open drum
#

oh? automatically it is removed?

glass basalt
open drum
#

Events.OnPlayerUpdate.Remove(myTimer) -- to stop this function

#

ah yea u have that there

glass basalt
#

no, you need Events.OnPlayerUpdate.Remove(myTimer) which I added for you at the end

#

yeah

open drum
#

gotcha good sir

#

great help !

glass basalt
#

👍

#

bedtime, I don't want to mod anymore for tonight

#

gn 💤

ancient grail
fading horizon
#

sweet dreams

fading horizon
#

just pushed an update for my clove cigarettes mod

#
  • Added a new item, " Pack of Clove Cigarettes "
  • Can be opened to acquire 24 individual clove cigarettes
  • The inverse is also true ; box 24 individual cloves into a pack
  • Custom 3d model and texture added for pack of clove cigarettes
rancid panther
#

nice

small topaz
#

Is their a script.txt parameter which makes things so that a food item cannot burn when it is cooked?

fast galleon
#

like time to burn?

#

not sure about it's absence

fading horizon
#

does anyone know what makes a modded vehicle able to tow something?

#

my favorite modded vehicle isn't able to tow stuff for some reason and it kills me

#

i wanted to see if i could make a mod just for myself so i could tow stuff with it

#

ive searched through vehicle files and i really can't find anything related

rancid panther
#

try looking at the vehicle parts

#

maybe it is missing a part that is associated with towing

eager pollen
#

yea I think you need to add attachment trailer or attachment trailerfront

#

if you look at the bottom of the pickuptruck_mccoy script file it has both of those so I'm assuming you need them but haven't tested myself.

zinc ingot
#

hello guys i would made a mod that implement new first aids issues like cast or other thing.
And i would add a way to exp first aid with corpse autopsy but only with player corpse, do you know how i separate zombies corpses and players corpses ?

rancid panther
#

if u find a way to do it i'll be truly blessed

#

there are dif models for player and zombie corpses, which u can tell because it shows different when u pick them up

#

i really wanna make first aid implementations work too :(

#

maybe i can ask the immersive medicine creator if they found a way around it

frank elbow
#

Ticks are inherently variable; N ticks will be a slightly (or vastly, depending on the machine) different amount of time on every execution

small topaz
#

is there a way to set rotten icons for new food items? have no idea how the vanilla game does this.

rancid panther
#

i used everyhours for my immunity mod so it doesnt actually accurately portray how many hours it's been since u got bitten

#

but im too lazy to change that and it isnt too big of a deal imo

open drum
frank elbow
chrome egret
frank elbow
# small topaz many thanks!

Took a second look. It seems like Spoiled & Rotten have the same effect & either works as the rotten texture (which is also the case for Burnt/Overdone)

#

Dunno what happens with stale ones, maybe just a saturation change

small topaz
frank elbow
#

Probably my faulty memory then 😄 I thought they looked slightly "off"

chrome egret
zinc ingot
zinc ingot
rancid panther
#

but u cant change p much anything that is part of the actual health panel ui without rewriting it

bronze yoke
ancient grail
#

@drifting stump dude u online?
You remember your vehicle shop mod
The one you did for krp server

I would like to recommend you to a client. They are looking for similar stuff

drifting stump
#

summoned

#

been a while

#

i didnt do a vehicle shop

#

you can probably just tell them to use server points

#

it has a vehicle type for buying

ancient grail
#

Only the UI perhaps?

zinc ingot
ancient grail
#

They want the vehicle to be visible

drifting stump
#

yeah it has preview

ancient grail
#

Right

#

Ok then i gues
Thnx for your time

drifting stump
#

it was improved since i took this screen

fading horizon
#

i'm trying to learn about what meta tables are right now and god damn this is confusing

drifting stump
#

you can spin it around and zoom

fading horizon
drifting stump
fading horizon
#

i understand

#

just reading through this guide, the examples are difficult for me to follow

drifting stump
#

you probably wont need metatables for anything

fading horizon
#
Set = {}
    
    function Set.new (t)
      local set = {}
      for _, l in ipairs(t) do set[l] = true end
      return set
    end
    
    function Set.union (a,b)
      local res = Set.new{}
      for k in pairs(a) do res[k] = true end
      for k in pairs(b) do res[k] = true end
      return res
    end
    
    function Set.intersection (a,b)
      local res = Set.new{}
      for k in pairs(a) do
        res[k] = b[k]
      end
      return res
    end```
#

such as this

drifting stump
#

unless youre trying to understand method inheritance in ui

fading horizon
#

yes i understand it, it just takes me a while to go through the process and actually figure out what's happening

#

idk

#

i'm dumb

drifting stump
#

theres no metatable voodoo happening there

fading horizon
#

no the metatable stuff comes right after that

#

that's why i was frustrated

#

i was struggling with the shit before the stuff that's even difficult

frank elbow
#

That code example relies on basic knowledge of set theory

drifting stump
#

anyway dipping again life been too busy
if anyone needs me ping

fading horizon
#

i have no knowledge of what a set is ngl

#

it also does not help that i am tired and also very stoned

#

lol

frank elbow
#

A set is a collection of elements without ordering or repetition (that is, the set {1, 2} is equivalent to the set {1, 1, 2})

#

The union operation on two sets combines their elements, and the intersection of two sets is the elements that they have in common (think Venn diagram)

#

e.g., for sets A = {1, 2}, B = {2, 3}, the union of A and B is {1, 2, 3} and the intersection is {2}.

fading horizon
#

that clears things up a lot for me actually

#

i was just fundamentally ignorant on the whole underlying idea lol

#

thank you very much

ancient grail
red tiger
#

Good morning.

open drum
#

guys, what will be the best way to play a sound in MP so everyone can hear "boom" sound?

#

everyone in the region

#

getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 5, 5, false);

#

this would do?

#

or do i have to put that code under sendclientcommand ?

pulsar heath
#

good afternoon

ancient grail
pulsar heath
#

been busy at work...

#

but finally... only working 4 days a week 😄

#

and no more sql!!!!!!

#

YAY

sour island
#

Speaking of being busy at work

#

Soon™

red tiger
#

A lot of progress while you were gone.

#

@sour island Hey. Your community library could be templated in a command-based solution in a VSCode extension.

#

Thought about it last night.

#

I know how to do that now. =P

sour island
#

Templates? :V

autumn garnet
#

Yeah Live Template

red tiger
#

Would an extension that does this help your project @sour island ?

red tiger
#

Below is an example of a for loop snippet for JavaScript:

// in file 'Code/User/snippets/javascript.json'
{
  "For Loop": {
    "prefix": ["for", "for-const"],
    "body": ["for (const ${2:element} of ${1:array}) {", "\t$0", "}"],
    "description": "A for loop."
  }
}
autumn garnet
#

it's really interesting, I also added all the Project Zomboid events in Live Templates

red tiger
#

I did my own take on events in PipeWrench with callback types.

autumn garnet
#

No, but I can ^^ I just have to complete the live templates because I only added the ones I used and I work on Intellij

red tiger
#

We can translate them to vscode too if desired.

open drum
#
local Execute = function (module, command, player, args)
print(command)
--local command = {};

    
    if module == "Quest" and command == "generatormission" then 
        getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false); 
        getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 500, 50, false); 
        print("recieved code from client with "..command)    
        local X = player:getX();
        local Y = player:getY();
        local Z = player:getZ();
        
        chunk1 = player:getChunk();
    
    
        VirtualZombieManager.instance:AddBloodToMap(44, chunk1)
        
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y-80, X, Y, 150)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y+50, X, Y, 80)
        
    


    
    end

end


Events.OnClientCommand.Add(Execute)```
#

anyone help me why this isn't playing any sounds in MP?

#

it worked fine in single player

ancient grail
#

You guys know what mods adds custom bayonet
Cuznfor ny bayonet mod

#

Ill getActivatedMod()

autumn garnet
red tiger
#

Nice.

#

I'll need to find ways to make gifs.

pulsar heath
red tiger
#

@pulsar heath This is the progress.

pulsar heath
#

nice nice... im delaying my new mod and mods updates for the b42... hopefuly it will take some time till i have to bash my brain and finish the new mod and improve the old ones

#

so the copy pasta to reply to everyone that dm's me is... "Im working on the update, but will be waiting for the b42 release so that i don't to the same thing twice in case the mod get's broken"

#

😄

red tiger
#

Makes sense.

#

I have a clean tokenizer that I'm now applying as a vscode extension.

#

Templates will be a thing.

pulsar heath
#

yeah, i've been focusing on the youtube integration for the mod

#

so working at the app...

#

also updated the twitch lib and will be releasing it in github in 2 or 3 weeks

red tiger
#

I also implemented syntax highlighting for the format. =)

pulsar heath
#

finished the bits handling part... it works on the mock server so it should work on the twitch api as well

#

ill have to stream one of these days to test it out irl

red tiger
#

Heheh.

#

Good to see you back.

pulsar heath
#

you've been a busy bee

#

i feel like the lazy dude who drops by randomly 😄

red tiger
#

That repo you sacrificed a small forest to read is mostly done too.

open drum
#

ugh

pulsar heath
#

so i need to kill another forest to update my reading?

open drum
#

i can't figure out what's wrong with the code

pulsar heath
#

😄

red tiger
#

Hahah

open drum
#

im done for today

#

😦

red tiger
#

That's how this works.

open drum
#

can't figure out why it works on SP but not MP

#

no error shows up

pulsar heath
#

im wondering if i could use a sqlite db with a mod

#

hmmm

red tiger
#

file storage basically.

#

lol.

pulsar heath
#

yes and no kinda

#

im working on a server management "webpage"

#

as off now it uses mariadb to store everything and it "dumps" the data from the db to each individual file for the server config

#

but im wondering if maybe... i could streamline it a bit more

#

plus it has a server creation page which is basicly a copy pasta of the games host creation UI

#

but still very messy... and the code is so damn ugly... plus i ended up using php... easier but not very secure...

red tiger
#

I'm just the oldhat modder that writes funny tools now.

#

xD

#

I don't touch that stuff now.

pulsar heath
#

well... i wasnt planning in doing this... but since i made a script tool to detect server updates mod updates etc and restart the server process i ended up working on a server management "portal"

#

it works fine for my personal use, but since i made i might as well go all the way and make it public

#

so that means... simplify, improve security and make it work on windows as well

sour island
#

Would this mean the Lua library (from pzDoc/Capsid or your own) and zedscripts play nice in intelliJ?

red tiger
#

What I'm suggesting is taking common functions and helper code blocks and templating them so modders can apply the template with their needs.

#

That or straight-up code insertion.

sour island
#

Hmm could be useful - although I'm not sure in what cases that something like intellisense wouldn't already do

red tiger
red tiger
#

@tame mulch Out of curiosity.. Why did you separate the definitions of Item properties in separate pages?

#

I thought the way that Recipe is setup was pretty nice.

#

Is this setup better for other reasons?

#

I also spotted some formatting inconsistencies. I might make a wiki account to try to edit those out.

#

I might also make a run through the wiki script properties if possible.

#

(Noting which are case-sensitive)

#

Added range options to my extension's API.

#

Considering adding auto-gen documentation to let people know.

clever spruce
#

HI al, I know I've asked a few quest9ons here in the past that were meant for #mod_support , but this question is related to mod dev. It's a question that is asked a LOT and I was just wondering if anyone was possibly working on a new towing mod since Aiteron is now a game dev and no longer updates it.
Another question I have is,.. if anyone knows if Better Towings functionality is being added to the base game or something? I would think it made sense that that would be hapening as a reason for their not updating their own mod.
I'm not trying to nag, it was a great mod when it worked. I am just wondering if more of it's functionality is being added to the base game, same as the rope towing functionality was a while ago, based on Aiteron's work.
🙂

bronze yoke
#

i wouldn't be surprised if some of its features show up in b42's vehicle rework

clever spruce
#

That's going to add support for articulated trailers such as big rigs, animated bits on cars and possibly even vehicle mounted weapons, yes?

#

Someone was telling me about that, just earlier today.

bronze yoke
#

i haven't heard about the other stuff but vehicle armour was confirmed and animated vehicles are something tis has been working on so doubtless that'll be part of it too

fast galleon
#

every time I join my test server it makes me make a new player ded

red tiger
#

Hover support! :D

drifting ore
red tiger
#

The latest stable BETA version is live on the marketplace.

drifting ore
#

Damn

red tiger
#

I'm working on adding value assistance and diagnostics support right now.

drifting ore
#

What's the name of it

red tiger
#

ZedScript

drifting ore
#

That's gonna be really helpful to the whole modding community

red tiger
#

I still need to post on the forums, requesting support for the name to become the official name along with a unique file extension so that the extension on vscode auto-loads the language.

#

I can't take over .txt files. That' be really bad.

#

It'd be better if script files ended with something like .zed

#

Thought I'd get a competent extension first.

glass basalt
drifting ore
#

That's really great

#

And impressive

red tiger
#

I built out the design of the extension in a way that provides modders the opportunity to fill in documentation from the wiki or personally.

scarlet wigeon
#

Hi, i've updated a mod to the workshop yesterday
server cannot download the mod
but i've set it to public, and already tried to unsubscribe / restart steam and the game
what is preventing my server from downloading it ?

open drum
#

good sirs and ma'ams

#

I request thy humble assistance

#
    sendClientCommand(player,"Quest","generatormission",args)
#

i sent this command from the server

#

which i checked it has sent correctly by putting print("sent")

#

checked on console that it has sent

#
local perform = function (module, command, player, args)
print(command)
--local command = {};

    
    if module == "Quest" and command == "generatormission" then 
        getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false); 
        getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 500, 50, false); 
        print("recieved code from client with "..command)    
        local X = player:getX();
        local Y = player:getY();
        local Z = player:getZ();
        
        chunk1 = player:getChunk();
    
    
        VirtualZombieManager.instance:AddBloodToMap(44, chunk1)
        
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y-80, X, Y, 150)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y+50, X, Y, 80)
        
    


    
    end

end


Events.OnClientCommand.Add(perform)
#

but this won't work

#

print(command) is not showing up

#

is it cuz it's on local perform???

rancid panther
#

you might be enabling the local version of your mod on the server

open drum
#

yea maybe he has same mod IDs

scarlet wigeon
#

gonna try that, thanks

#

Just so i'm sure, the folders used for mods are mod and workshop from both game and cache dir ?

sour island
#

I would presume the one to send to clients

#

You'd need to differentiate between MP and SP

open drum
sour island
#

There is onServerCommand and onClientCommand

open drum
#

yea

sour island
#

one of them doesn't work in singleplayer - I think it is onClientCommand

#

What you can do is put the command in a "shared" function

#

make the command call if isServer() is true

#

otherwise call the contents of perform directly

#

so instead of calling sendClientCommand() you'd call the shared function

open drum
#

i thought onClientCommand is a trigger for server..

#

guess i was wrong

#

i mean listening

#
Listening Server Events
 
To listening a server event.
 
 

local Commands = {};

local onClientCommand = function(module, command, player, args)
 if Commands[module] and Commands[module][command] then
 Commands[module][command](player, args)
 end
end

Events.OnClientCommand.Add(onClientCommand)
 
 
Listening Client Events
 
To listening a client event.
 
 

local Commands = {};

local onServerCommand = function(module, command, args)
 if Commands[module] and Commands[module][command] then
 Commands[module][command](args)
 end
end

Events.OnServerCommand.Add(onServerCommand)
sour island
#

OnClientCommand is server side

#

it is when commands are sent by clients

open drum
#

yea

scarlet wigeon
open drum
#

onclientcommand function on serverside

#

which contains playworld sound and spawn zombiehorde

sour island
#

I checked my old code - sendServerCommand is the one that doesn't work in single player

open drum
#

are you saying the commands that are inside onclientcommand isn't for mp?

#

oh oh

#

but i executed that in MP

#

it runs on SP but not on MP

sour island
#

Where do you have onClientCommand code?

#

/server/?

open drum
#

in server

#

yea

#

sendclientcommand on /client

sour island
#

And you're using sendClientCommand in /client/?

#

Sorry didn't load your message lol

open drum
#

yea

#

hold on let me write it again

#

sendClientCommand(player,"Quest","generatormission",args)

#

that from client folder

#
print("Server side recieved")

local function perform(module, command, player, args)
print(command)
--local command = {};

    
    if module == "Quest" and command == "generatormission" then 
        getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false); 
        getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 500, 50, false); 
        print("recieved code from client with "..command)    
        local X = player:getX();
        local Y = player:getY();
        local Z = player:getZ();
        
        chunk1 = player:getChunk();
    
    
        VirtualZombieManager.instance:AddBloodToMap(44, chunk1)
        
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X+50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y-80, X, Y, 150)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X-50, Y+5, X, Y, 80)
        VirtualZombieManager.instance:createHordeFromTo(X, Y+50, X, Y, 80)
        
    


    
    end

end


Events.OnClientCommand.Add(perform)```
#

this from server folder

#

i have print("sent code") under sendclientcommand

#

so i saw it sending

sour island
#

oh

open drum
#

but it didn't recieve

#

print("server side recieved") nor print(command) is showing up on console

sour island
#

in MP console is split between console (players) and coop-console (host)

#

but you're saying it works in MP, not in SP?

#

that's odd

open drum
#

it works on SP

#

not in MP

sour island
#

oh

open drum
#

i ran the code on dedicated server

sour island
#

did you check coop-console.txt?

open drum
#

listening to you, am doing that right now

#
STACK TRACE
-----------------------------------------
function: perform -- file: Wuro_quest_server.lua line # 12 | MOD: Wuro Quest
#

found error

#

wow

#

why it didn't show error in game...

sour island
#

the debug console only shows player-side afaik

open drum
#

getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false);

sour island
#

host stuff is in coop-console

open drum
#

this is causing the error

#

i guess it's not compartible on server?

sour island
#

what's the whole error?

open drum
#
function: perform -- file: Wuro_quest_server.lua line # 12 | MOD: Wuro Quest

ERROR: General     , 1679701750822> 139,382,088> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getSquare of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1679701750822> 139,382,088> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getSquare of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:214)
    at zombie.network.GameServer.receiveClientCommand(GameServer.java:4168)
    at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:1022)
    at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1532)
    at zombie.network.GameServer.main(GameServer.java:800)```
sour island
#

This is not getting getPlayer()

#

should just be player probably?

open drum
#

oh??

#

where does that say??

sour island
#

server wouldn't have a getPlayer() return anything

#

getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false);
getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 500, 50, false);

#
 getSoundManager():PlayWorldSound('pumpaction', getPlayer():getSquare(), 0, 500, 50, false); 
 getSoundManager():PlayWorldSound('bigExplosion', getPlayer():getSquare(), 0, 500, 50, false); 
open drum
#

i mean how did you know it was getPlayer???

#

from that error messege

sour island
#
java.lang.RuntimeException: attempted index: getSquare of non-table: null
#

top of the stack trace

#

is the last thing ran

#

all of those lines are lines of code handing off the product

open drum
#

oh

sour island
#

the one on-top is the broken one

#

and has the printed out message

open drum
#

so it's saying it ran till getsquare?

sour island
#

it's saying it tried to getSquare from null|nil

open drum
#

ah

sour island
#

which means getPlayer() = nul|nil

open drum
#

wow thanks

#

now i can read error messeges better

sour island
#

getPlayer returns the local player - but servers don't have local players - just connected ones

open drum
#

i only read the line numbers up to now

#

that is true