#mod_development

1 messages · Page 132 of 1

modern hamlet
#
function MHRepairWall:perform()
    print("Repair wall performed")
    args = {self.construction}
        repairObject = self.construction --global
    sendClientCommand(self.character,'MadhousePayment','RepairWall', args)    
    -- TODO remove repair kit    
    ISBaseTimedAction.perform(self);
end

i tried to pass the object with args but couldn't get it at server side so i used a global var at server side. It seems working with global var (worked on sp so far) but i am not sure, am i doing right?

bronze yoke
#

it won't work with a global var outside of singleplayer since the server is a completely separate lua environment

#

to send an object over a command, you usually send the co-ordinates and the object index

modern hamlet
#

ahh i see thank you

wide oar
#

is there a tutorial for doing custom weapon sounds

novel bluff
#

how to remove an item from a mod without breaking the mod itself? armor mod

polar onyx
#

does anybody know a way to just disable fire damage? I don't really want to make a mod, I just want to disable it from the game files but I figured that maybe on this channel somebody would know what to do

wide oar
#

Would it be possible to get MMD animations in as a dance in zomboid somehow?

#

Using the base rig and somehow retargeting it woudl be my guess

#

.-.

ancient grail
#

You become immune to fire dmg

open drum
#

hey hey, Im terrible with Lua table

#

could anyone help me to understand this snippets below?

#
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)
#

from my understanding. It creates a table named "Commands"

#

Commands[module] <--- does this mean it created another table within commands table?

#

Commands[module][command] <--- and this creating table within a table within a table????????

#

feels like some crazy inception shixx to me...

#

😵‍💫

ancient grail
open drum
#

yea i got that part

#

but Commands[module] and Commands[module][command]

#

this is the part im confused about

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

    
    if module == "Wuro" and command == "printcode" then 
        
        print("recieved code from client with "..command)    
        local X = player:getX();
        local Y = player:getY();
        local Z = player:getZ();
        
        addZombieSitting(X,Y,Z)
    


    
    end

#

this is how I used it

#

but im confused with that lua table method

neon bronze
open drum
open drum
#

so then the if statement would return false?

neon bronze
#

Yep if you run it directly afterwards but i assume the commands table gets used somewhere so it wouldn’t always return false

#

Its used mainly to not cause errors cause accessing something that doesnt exist just returns nil back but if you want to access a member of nil it results in an error

open drum
#

then what about

#

Commands[module][command] then <--- this part?

neon bronze
#

Same thing you just have a nested a table

open drum
#

is it checking if commands table has module and command? or a moduel with a table with command variable

#

so... it would b... Commands [module[command]] ?

#

or commands [module, command] ?

neon bronze
#

Those are both vars so if commands[module] doesnt exist it wont check further

#

And it first looks for the table with module as its key and then access that exact table with command

open drum
#

Commands = {module, command}

ancient grail
#

anyone knows what this reportEvent() really does and if we can use our own strings or something


ISWorldObjectContextMenu.onSitOnGround = function(player)
    getSpecificPlayer(player):reportEvent("EventSitOnGround");
end
open drum
#

so if Commands table looks like that, it will return True

neon bronze
#

more like Commands = {module = {command}} i think

open drum
#

i see.. so it was Inception ...

#

table within a table...

#

that's bizzar....

fast galleon
open drum
#

i see that now thanks to haram

#

i was so confused... because why would one make table within a table just to check for 2 keys...

fast galleon
#

it's useful to avoid big if trees, improves performance and is easier to add / remove commands without touching this function.

open drum
#

i guess u r right...

#

it will def. avoid all the "elseif"s

loud wagon
#

How do i make a melee weapon specifically one handed?

Like a knife etc.

I've got 2 handed down, just copy a bat.

Tried to copy a knife but still holds it like a bat lmao

open drum
#

though, I; a newbie modder would still doe elseifs xD

open drum
#

maybe you copied the two-handed one accidently?? by any chance?

loud wagon
#

I sure did, because that's all I could find the files for is bat haha

open drum
#

does ur "weapon" show the character is holding it in one hand at UI?

#

or both UI and animation

#

have two hands

loud wagon
#

all two handed, ui and everything else. Is there a specific anim list for it?

open drum
#

check if your weapon has

#

TwoHandWeapon = TRUE,

ancient grail
loud wagon
ancient grail
#

SwingAnim=Stab,

loud wagon
#

Ooo thank you

ancient grail
#

SwingAnim = Spear,
SwingAnim = Rifle,
SwingAnim = Handgun,
SwingAnim = Throw,
SwingAnim = Shove,
SwingAnim = Heavy,
SwingAnim = Stab,

open drum
#

Do anyone know if we can increase the max level above 10??

#

or is that hard coded in xpfactory and can't be changed>?

loud wagon
fast galleon
open drum
#

i guess ill use modData then :(((

drifting ore
#

What is the text to add to launch option to be on debug ? Forgot

bronze yoke
#

-debug

drifting ore
#

And to lunch the debug menu it's F11 right ?

fast galleon
long cloud
#

hey, does any modders who make loot distribution mods know what is considered military/police/surplus loot? like what container falls under what category? cause for some reasons im getting military loot in police stations and i dont really understand how the loot distribution works. Unless those green lockers in police stations are considered "military"?

rancid panther
#

would it be better to go back and make dif if statements for each type of data to account for if any characters are only missing one type of data somehow?

strong dragon
#

Anyone gonna help me?

sour island
#

Are you the owner of the mod or just trying to use it?

#

You could try to validate the cache, if you are the creator of the mod you might be loading the local version and if there's changes from the online version it can cause issues.

#

There's a pin to make handling your own mods in development easier - related to setting up a new shortcut.

#

That being said, I know your frustrated but if no one is answering it's cause they don't know, or you're not giving enough information.

#

@strong dragon

open drum
#

What will be easiest way to execute automated /severmsg ???

#

is there any built in functioni for it?

neon bronze
#

I guess events would be the way to go

open drum
#

Event.Everyminutes.add () would be good start

#

but what function would i have to use?

#

ischat?

fleet snow
#

ffs my WiFi died

#

i meant using mods like modZ check

#

as base

#

would be easiest way

#

because basically this mod does automatic restart + announcements with 5 minutes waiting period

#

when mod is updated

#

so it totally has something to do automatic broadcasts

#

just need to change it a bit

open drum
fleet snow
#

yep, ModZ check

open drum
#

ty, ill take a look

open drum
#
local getTimestamp = getTimestamp
local querySteamWorkshopItemDetails = querySteamWorkshopItemDetails
local getSteamWorkshopItemIDs = getSteamWorkshopItemIDs
local getCore = getCore

if not getCore():isDedicated() then
    print("[ModzCheck] Refusing to load, not a dedicated server")
    return
end

local serverStarted = getTimestamp()
local pendingReboot = false

local pollWorkshop do
    local fakeTable = {}
    function pollWorkshop()
        if pendingReboot then return end
        print("[ModzCheck] Checking for outdated Workshop items")
        querySteamWorkshopItemDetails(getSteamWorkshopItemIDs(), function(_, status, info)
            if status ~= "Completed" then return end
            for i = 0, info:size() - 1 do
                local details = info:get(i)
                local updated = details:getTimeUpdated()
                if updated >= serverStarted then
                    pendingReboot = true
                    print("[ModzCheck] Mod update required")
                    return
                end
            end
        end, fakeTable)
    end
end

local nextPoll = getTimestamp() + 300
Events.OnTickEvenPaused.Add(function()
    if pendingReboot then return end
    local timestamp = getTimestamp()
    if timestamp >= nextPoll then
        nextPoll = timestamp + 300
        return pollWorkshop()
    end
end)
#

i don't see any servermsg in here...

#

maybe i am not getting it...

fleet snow
#

well does do servermsg

#

it does*

#

just a sec

#

ok im back

#

@open drum SalSevenSix#4798

#

this guy is author of it

#

so might as well shoot him a dm

supple reef
#

Anyone here who can possibly identify why a sprite acts normal and then just stops moving?

  • imaging it hits an invisible barrier
  • aggro is maintained if LoS is active
  • moving within 3-5 tiles makes the sprite move again

To my knowledge I do not have any code that is causing this.

while stuck the sprite looks like its trying to move (although its like a slow glitchy version)

sour island
#

Sprite of what?

open drum
#

@ornate flax

supple reef
sour island
#

So you mean the zombie is stopping?

supple reef
ancient grail
#

Its for the left or right arm

zinc pilot
ancient grail
#

Thats where i added the flashlight stance for pistol proficiency

zinc pilot
#

Clothing items

ancient grail
#

Woops mybad

sour island
#

Locked zombies can occur if you're sending changes to them too frequently

#

Perhaps you're working on AI that changes their speed?

abstract raptor
#

Hey hey hey. um... So I'm trying to get the debug zombie menu available outside of debug mode

#

can someone help me?

hardy wave
#

I dont know where to ask this but is there a mod that disables using a sledgehammer on other peoples safehouses but not disabling it anywhere else?

neon bronze
abstract raptor
neon bronze
#

i dunno i dont see any issue rn but i flew over it

abstract raptor
#

my concept is making a sort of mode where a player can possess zombies

#

But you can only really move them around

neon bronze
#

one thing though, why dont make the ZombieContext.doMenu a local? or just call both of the function in the events

abstract raptor
#

I basically just cut out all this code from the DebugContextMenu

#

I just wanted to see if I could get it working outside of debug menu

#

then I was going to cut the options down to just being able to move the zombie

neon bronze
#

btw how do you get the menu?

abstract raptor
#

I dunno, it's not showing

#

lmao

neon bronze
#

have you tried rigt clicking?

supple reef
abstract raptor
neon bronze
#

well you should OnPreFillWorldObjectContextMenu i did it that way and it worked for me

abstract raptor
neon bronze
#

No i mean for my mods where i also added context options

neon bronze
#

I did that win onprefill

abstract raptor
#

yeah I dunno this just aint working

#

I dunno what I'm missing here

frank lintel
#

hmmm Zeus for PZ...

neon bronze
old crescent
#

is there any mods that has the ability to post in the bulletin.. then anyone ingame can see the words that is posted ?

abstract raptor
opal nest
#

Hi can i send someone my item spawning lua so it can be checked if i have done it correctly?

abstract raptor
#

I dunno I have to enable god and invisble

rustic garnet
#

I wanted to make a dictionary that takes the item id's as keys but the ints of the ids seem too large to use as key in the table what is your suggestion?

neon bronze
#

The vanilla debug one only works on corpses

abstract raptor
#

I wouldn't be doin this if it didn't that's what inspired me

#

I was playing around luring a zombie wherever I wanted

#

hahah

old crescent
#

is there any mods that has the ability to post in the ingame bulletin.. then anyone ingame can see the words that is posted ?

neon bronze
#

Maybe thats the problem

sour island
#

If I were to guess you're trying to make it move slower or faster?

#

You'll need to figure out a way to slow or block overlapping changes/calls

#

You could compare speed to current speed - only apply the changes if it needs to be

supple reef
#

one sec ill show you code

abstract raptor
#

ugh why am i so stupid. I can't figure out how to set invincible on the player lmao

#
func setGhost(player)
    player = getSpecificPlayer(0)
    player.setInvincible(true)
    player.setInvisible(true)
    end
    
    

Events.OnGameStart(setGhost)```
supple reef
sour island
#

Applying a speed each update tick will lock it up

#

Just compare the speed against what you'll set it to, and only set it if it's not what you want

drifting ore
#

Is there a easy example to add an item in the game ? (need to make a copy of the notebook)

#

And moddata of items are save right ? As long it's int, float or string ?

sour island
#

Also, I assume you're using setWalkType?

rustic garnet
#

I wanted to make a dictionary that takes the item id's as keys but the ints of the ids seem too large to use as key in the table what is your suggestion?

supple reef
supple reef
supple reef
abstract raptor
#

is there a way to disable a players ability to attack?

ancient grail
abstract raptor
#

awesome

ancient grail
#

🫡

abstract raptor
#

I think i got this working

#

Now all I need to do is make it so it's tied to a trait and we gotta zombie mode

#

hahaha

#

maybe a profession

#

Zombie Master

ancient grail
#
    getPlayer():setBannedAttacking(false);
    getPlayer():setAuthorizeMeleeAction(true);
    getPlayer():setAuthorizeShoveStomp(false);
rustic garnet
#

How do you call a vanilla function from other file in pz?

supple reef
ancient grail
#

heres somemore i found

sour island
rustic garnet
#

how would you call this function from my file in my function

function ISInventoryPage:refreshBackpacks() 
#

do I need to use require?

frank elbow
#

ISInventoryPage:refreshBackpacks()

abstract raptor
supple reef
#

would that work?

#

or am I using check wrong?

rustic garnet
rustic garnet
frank elbow
#

Break how?

rustic garnet
#

stdlib.lua - null line #10

fast galleon
#

the inventory page is also cached in player data, so if you still have problems it might be worth to share your code.

rustic garnet
#

Mhmm I can call the original I believe.

fast galleon
#

bad overwrites can also happen because your file name or location of the file causes issues

rustic garnet
#

But I overwrote ```lua
function ISInventoryPage:refreshBackpacks()

#

The overwrites works, I just need to call it in another function to refresh the backpacks

hollow current
#

If i store moddata in isoplayer and the player died, does he maintain the moddata after respawning?

bronze yoke
#

no

hollow current
#

Oki tyy

bronze yoke
#

the moddata is transferred to the corpse and then the zombie

fast galleon
# rustic garnet

the commented out line with cursor should be done on an instance of the inventory page.

#

have you tried one of render dirty= true commands instead?

#

Also you do a full overwrite of the function after that? ⛔

sour island
opal nest
#

What git licence do you use for mods?

rustic garnet
rustic garnet
rustic garnet
supple reef
# sour island Is there not a getWalkType?

there is but what I think I am running into is that the

CheckTimer is running constantly

So I need to implement something similar to what I did for the zombie behavior and say

check time since last update
if Less than x seconds ignore

only problem I have is I dont know what to use

Do I check time since Events.OnZombieUpdate
or do I just check the time since the CheckTimer function (its not exactly a timer from what I can tell in the code)

red tiger
#

Thinking about writing a superset format to ZedScript that compiles to ZedScript.

undone elbow
#

How to remove object obj from square sq on the server (not on client)?

red tiger
#

Yeah.. I think that's what I'm going to do.

#

Something like

Module Base {
  item Axe {
    // Axe-specific properties.
  }
  item StoneAxe extends Axe {
    // StoneAxe-specific properties.
  }
}
wide oar
#

blender wont export my animation with my fbx

#

i dont understand why???

red tiger
#

Oh heck yes.

#

This would be an insanely useful tool.

#

Inheritance-driven scripts would be insanely useful and would allow for templating.

opal nest
red tiger
#

Remember modders, you have a right to your works and that as long as it is yours and you're sure (This includes code that isn't overriding others' code), you can license them.

#

This is for some reason controversial to discuss however you should own your works. =)

#

I'd avoid licensing artifacts in your mod that overrides or modifies works of other parties.

#

I personally use MIT for projects that I don't plan on scaling to a potential commercial product. I use LGPL if I want to promote open-source or keep forks of works from going commercial with it.

opal nest
#

Ah ok nice!

red tiger
#

Because you are modding a game, typically this complicates licensing and ownership rights all to hell.. If it weren't for the API that is provided with the game.

opal nest
red tiger
#

Pretty much if you're not a dick things won't go sideways here in the modding community.

opal nest
#

yeah haha

#

Thank you, if I make my repo public i'll probably use MIT

red tiger
#

That's one of the least-intrusive / legally-combative licenses to use.

#

That and I think BSD.

#

(Copy Center)

#

Be careful when going Copy-Left. GPL, AGPL, and others like it will establish an infectious open-source obligation to anything touching it. I use LGPL to avoid this mess but still keep any forks of my code to legally have to stay open-source.

#

It would be outrageous for a mod to license GPL going left. That'd be nuts.

#

What are you going to try to force the game to open-source because you modded it? lol.

#

Have fun in court.

opal nest
#

I've still got some loot table code from another dev on the forum that i've used to get the spawning working but once ive written that in my own way i will probably make it public, it was only because I was trying to understand how the generation works

#

They did say people can use it but id rather re write it to make sure its all ok

red tiger
#

When in doubt, always credit the author(s).

#

You can license parts of your mod differently. =)

#

That's what I've done.

#

It respects the rights of the third-party code.

opal nest
#

Oh right! Is that just by adding the comments at the top? I've been told that is official but not 100% sure

red tiger
#

A file-wide license? Yeah.

opal nest
#

I think thats what we do for our uni stuff, just not got around to doing it for our project yet

red tiger
#

Yeah. It's basically license file pointing at a file or DLL, a directory license, or a source-file license heading the document.

worn juniper
#

jab finished the vscode thingy is done..?

opal nest
#

Ah ok cool, I'll look into that properly when I get back so I can sort it!

red tiger
#

I'm working on it this evening. =)

opal nest
#

Thank you for the advice! I've got to head off now but that was really useful!

red tiger
#

I'm thinking about making a superset of ZedScript that compiles to ZedScript supporting inheritance.

worn juniper
red tiger
#

I'm actually at work sneaking these msgs through a string of yarn and tin cans.

worn juniper
#

actually i cant say nothing since you're work is immense and i respect it 👍

red tiger
rancid panther
#

remove that mod id from ur server

#

in the actual server file

strong dragon
#

That isn't the problem

#

EVERY world that I try to use the mod on won't work

#

The mod itself won't download, cus it's pending

rancid panther
#

this a mod u made or downloaded?

strong dragon
#

Made

#

Uploaded

#

And it worked

#

Then I updated it, then it won't work

#

I have prob been flagged for spam

rancid panther
#

it's not pending for review?

strong dragon
#

Since I reuploaded it

rancid panther
#

if u keep updating ur mod it will keep pending for review. when did u last upload/update?

strong dragon
#

Ok, lemme lay out the whole story

fast galleon
#

🍿

ancient grail
# fast galleon 🍿

Im curious why did he tag you? Cuz you responded to his first report? Or does it involve your mod

red tiger
#

Inb4 thread.

#

:D

ancient grail
rancid panther
#

oh yeah r u subsrcrib

ancient grail
#

The resub. Or reupload with new id

Try isolating the case

#

Delete your save try another world
Or maybe u play sp try it on mp
And vice versa

rancid panther
#

if u have a local mod and a workshop mod with the exact same id u should move the local folder somewhere it can not be accessed by the game or change the mod id

ancient grail
#

Every possible thing that might cause it remove it till you narrow down the source of problem the. Fix it or remove it

rancid panther
#

my local mod id has LOCAL added to it

strong dragon
#

I needed a mod to lower the spawn rated for Brita/A26 gear, I asked around and an absolute lad by the name of "Mad_max_000" reached out to me, he had a version that I was allowed to edit and upload.

I changed the values in the pack to fit my needs, blah blah not too important.

I uploaded the mod, it work! really well too, my server even booted up faster (idk why)
Then I realized some values were off, cus I didn't understand some code.
I updated the mod, changing some values.
My game said it was now different from the from the workshop version, and could not run the server.
So I removed it from the server, unsubbed, and literally deleted the mod from the workshop.

I reuploaded it and it worked again.

1.5 weeks later

I see that I didn't understand what 1 line of code meant and now crates of ammo were spawning EVERYWHERE, got pissed, updated the mod with new values, tried to boot the server and it said the server was using a different version from the workshop.
Well f%!#. so I removed it from the world, unsubbed, and deleted it from the workshop, reuploaded it, and now the server just terminates itself, and the log file says:

LOG : General , 1678744081241> 6,162,068> Workshop: GetItemState()=None ID=2946645642.

LOG : General , 1678744081241> 6,162,069> Workshop: item state CheckItemState -> DownloadPending ID=2946645642.

LOG : General , 1678744081280> 6,162,107> Workshop: download 0/0 ID=2946645642.

#

I reuploaded it twice after messing around with it

#

Well, a grand total of 3 to 4 times

#

And that is why I feel I have been flagged for spam.

strong dragon
rancid panther
#

what is the workshop id and what is the mod id

rancid panther
#

not the number but the name

strong dragon
#

VooydFighter Mod

("Vooyd" is just a word me and my lad say randomly, the name don't matter too much)

#

The mod changes spawn values for "Arsenal[26] GunFighter Mod [2.0]"

#

Ping/reply to me if you need me to see something

#

I gtg for a bit

ancient grail
#

Its a dependency mod . Like true music

worn juniper
abstract raptor
strong dragon
#

Cus I made it public

#

Cus I want people to be able to see if something is wrong

#

But yay

#

It's not blocked

ancient grail
#

getSpecificPlayer(getPlayer():getPlayerNum())

?

#

instanceof(player, "isoPlayer")
?

#

self.player
?

worn juniper
#

self.player could be that

rancid panther
strong dragon
#

I am updating the one on the workshop

rancid panther
#

in the workshop folder?

strong dragon
#

Yea

rancid panther
#

do me a favor and show me a picture of your workshop folder

strong dragon
rancid panther
#

okay now make a new empty folder and name it whatever you want

#

put that folder in there

ivory warren
#

Hey, is there a way to change the clothing of all of a certain type of zombie, like sprinters, shamblers, etc..
Like in this script it should make it a 100% chance that all female/male zombies will spawn with black underwear VVVV

require "Definitions/UnderwearDefinition"

UnderwearDefinition = UnderwearDefinition or {};

UnderwearDefinition.Female_F_Black = {
    chanceToSpawn = 1000,
    gender = "female",
    bottom = "Underpants_Black",
}

UnderwearDefinition.Male_F_Black = {
    chanceToSpawn = 1000,
    gender = "male",
    bottom = "Underpants_Black",
}

Is there a way to do this to (for example) sprinters only? or where could i figure out how to do this if that would be faster or something lol

strong dragon
#

Ok

ivory warren
#

sorry for bumping into ongoing chat also

strong dragon
#

I put it in the new folder

rancid panther
#

try launching the server now with the mod subscribed

strong dragon
#

Ok

rancid panther
#

and if the values are wrong it's okay. we're just checking if this works first

strong dragon
#

What is this trying to achieve?

rancid panther
#

i think the server is reading your local files before reading subscribed files

strong dragon
#

Ok

strong dragon
#

Oh?

#

OH?

#

IT MIGHT BE WORKING

#

CONE ON LADS!

rancid panther
#

ok nice

strong dragon
#

PRAY WITH ME

rancid panther
#

but im assuming the values might not be updated yet. this is just to make sure i know what the issue was

strong dragon
#

No, the version I have uploaded is the right one

rancid panther
#

ok nice

strong dragon
#

So this might work

#

Thank you so much dude

rancid panther
#

if u ever need to change something you have to take it out of that folder to update it

#

and close the game to put it back in the folder

#

no problemo spiffo

sour island
#

make a local list outside of any functions - call it like zombieSprintCooldown. When you want to set the coolddown, do lua zombieSprintCooldown[isoZombie] = getTimeStamp()+1000 --this should be 1000 ms

#

Then in Zombie update check for the current speed and if the current getTimeStamp is greater than the stored one.

#

Maybe check if the cool down is expired first, then check if the current speed is not what you want it at, then set the speed, and give it a new cooldown

#

Hope that helps

ancient grail
boreal garnet
#

what does ISWorldMap.lua govern? spiffo

ornate summit
#

Would it be possible to make a building movable?

#

Trying to concept out how a train system might work.

tawdry solar
#

item MetalPipe
{
MaxRange = 1.2,
WeaponSprite = LeadPipe,
MinAngle = 0.72,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;SmallBlunt,
ConditionLowerChanceOneIn = 15,
Weight = 1.5,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 8,
MaxHitCount = 2,
DoorDamage = 1,
SwingAnim = Bat,
DisplayName = Metal Pipe,
MinRange = 0.61,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = FALSE,
Icon = MetalTube,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
BreakSound = BreakMetalItem,
TreeDamage = 0,
CriticalChance = 30,
CritDmgMultiplier = 2,
MinDamage = 0.6,
MaxDamage = 1,
BaseSpeed = 0.95,
WeaponLength = 0.35,
AttachmentType = BigWeapon,
}

#

im making my own custom weapon

#

but idk where to start with this

ornate summit
#

I mean, most of those variables are pretty self explanatory.

#

What specifically do you need help with?

tawdry solar
#

any of it

#

this is my first melee mod

#

im doing bits that i have learnt from my other mods

#

but idk where to put texture world model etc

fast galleon
tawdry solar
#

ty man

opal nest
#

Hi guys, can the both models for mods be FBX? So the one in the modelX folder as well as the world item model?

boreal garnet
tawdry solar
#

item Spring-club
{
MaxRange = 1.2,
WeaponSprite = Spring-club,
MinAngle = 0.72,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;SmallBlunt,
ConditionLowerChanceOneIn = 15,
Weight = 1.5,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 8,
MaxHitCount = 2,
DoorDamage = 1,
SwingAnim = Bat,
DisplayName = spring club (ger),
MinRange = 0.61,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = TRUE,
Icon = PLACEHOLDER-2.Png,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
BreakSound = BreakMetalItem,
TreeDamage = 0,
CriticalChance = 30,
CritDmgMultiplier = 2,
MinDamage = 0.6,
MaxDamage = 1,
BaseSpeed = 0.95,
WeaponLength = 0.35,
AttachmentType = BigWeapon,
}

anyone know why this doesnt apear ingame>

#

?

fast galleon
tawdry solar
open drum
fast galleon
#

this is co`s mod, I will let him know as soon as we iron out the bugs of this change

open drum
#

nice nice thank you

modern hamlet
#

im looking for a different IsoFlagType between wallframe and wall. Does anyone know?

jaunty marten
wooden lodge
#

Question to all the experienced "OnCreate" gurus out there - I made implants that are supposed to be consumeable and level up a certain skill of a player. Is it possible to do that it levels up one level no matter how much XP the person using it has and if so, how?

modern hamlet
rancid panther
#

i have no idea how to start on making a new health panel feature

jaunty marten
# modern hamlet didnt work 😦

then the best way to find flag for it is to save 2 tables of flags: wallframe and wall. and after via loop find difference between these tables
have no better idea PB_peepo_shrug

#

tbh not sure that there's some separate flag for wallframe

#

btw u can try a luck with search context menu options when u clicking on tile with wallframe and to find how pz gets what on this tile wallframe and not complete wall

red tiger
#

Looks like you did.

modern hamlet
open drum
#

Does anyone know if there's sandbox setting or a file that i can edit to increase the number of safehouses a player can join? Default is only 1

#

didn't see any setting in sandbox nor server setting.. unless im wrong

rancid panther
#

i dont think it is as simple as increasing the number

#

you would have to add a new menu to allow players to view all safehouses they are a part of

open drum
#

ah u r right..

#

i didn't think about the UI

#

how innocent of me..

rancid panther
#

there is a mod for faction safehouses. that's the best alternative i have seen

open drum
#

hmm , ill take a look

weak sierra
#

@rancid panther since ur unaware, pinging u so u know

#

much better than that faction safehouse mess

open drum
#

BTSE?

weak sierra
#

bikinitools server edition

open drum
#

ah oki ty

weak sierra
rancid panther
#

i dont use bikinitools but i'll keep that in mind

weak sierra
#

u dont have to use the regular one to use the server edition, it's a different mod w/ different purpose

#

and modular

rancid panther
#

ok

#

i'll check it out

wheat kraken
neon badger
#

does anyone know how to add controller support in a mods lua? i asked in here just incase i was in the wrong place before 🙂

wheat kraken
neon badger
#

nice ill look at it so far the helicopter mod i have im its only keymapping is WSAD for left right up down but in the scripts theres no controller mapping so was hopping to add gamepad keys for myself

#

if isKeyDown(Keyboard.KEY_UP) then
helizuobiao[4] = math.sin(math.rad(helizuobiao[2]+90))
helizuobiao[5] = math.cos(math.rad(helizuobiao[2]+90))
if helizuobiao[3] > -40 then
helizuobiao[3] = helizuobiao[3] - 0.6
vehicle:setAngles(helizuobiao[1], helizuobiao[2], helizuobiao[3])
end
if helizuobiao[6] < 2.1 then
helizuobiao[6] = helizuobiao[6]+0.001
end
zhuansu[2] = 1
end

#

this is the code just need to add the pad

#

maybe i should add gamepad in place of keyboard

wheat kraken
#

i added my controller support on this mods of mine, you can learn from them
https://steamcommunity.com/sharedfiles/filedetails/?id=2937462009

https://steamcommunity.com/sharedfiles/filedetails/?id=2927368291

basically you need to implement your own
onJoypadDown
function

this is linking, from original code

    comboentry:setJoypadFocused(true)--controller support
    comboentry.onJoypadDown = LimitSurvivor_SS.onJoypadDown

this is the separeted code

function RebalanceIt:onJoypadDown(button, joypadData) --controller support
    if button == Joypad.AButton then    
        --do stuff
    elseif button == Joypad.BButton then
        self.parent:close()    
        setJoypadFocus(joypadData.player, getPlayerInventory(joypadData.player))
    end
end

to my needs, this fullfil it

neon badger
#

so i add a seperate line for that code?

wheat kraken
#

yes, and you need to link it from your actual code

thick karma
#

Are you trying to add special controls for a vehicle? What exactly is the context for these controls?

neon badger
#

yes this acts like a vehicle

#

i only want to modify it for me and my friends dedicated server

wheat kraken
#

for vehicle probably you will need to deal with radial

thick karma
#

D-Pad is used for hold-press overlays such as the vehicle menu for getting in and out, switching seats, and starting vehicles or removing the key

neon badger
#

i use controller he uses steamdeck

thick karma
#

So that's probably not ideal for shortcuts while in a vehicle

jaunty marten
open drum
neon badger
#

normally when someone drives its left and right to steer but the copter also has to go up and down plus a key for the guns

thick karma
#

You might consider requiring a hold press while in the vehicle to allow for firing guns or raising or lowering vehicle

#

Idr but L2 might be available while you're driving

jaunty marten
thick karma
#

Then you could decorate onPressButtonNoFocus and intercept d-pad button signals when you're in a vehicle AND button is held

jaunty marten
#

lua tips for optimisation

neon badger
#

oof....very new to this lol

thick karma
#

You can see an example of a no focus decoration in Dawn of the Zed if you grab its code from the workshop

#

I decorate R3 but you could use the same technique for your purposes

neon badger
#

ok quick question. if i modify the script on my end will my friend on my dedicated server be able to use the controller since i will not upload it on the workshop? dont have permission

thick karma
#

You could share a local copy with them

#

And they could put it in their mods folder

#

And you could put one in yours

#

No upload required

neon badger
#

nice!!!!!

thick karma
#

Just add local mods via Mods instead of via Steam Workshop

#

In the Edit Server Settings menu of HOST

#

Also iirc there is a function isJoypadLTPressed(playerIndex) for knowing whether the trigger is down

#

Global

#

So youll need something like isJoypadLTPressed(self.joypad.player) and button == Joypad.DPadDown as the condition used in your decoration of the function above.

#

E.g. for going down (or up, maybe inverted controls is an option idk)

neon badger
#

got it so just add that code in place of if isKeyDown(Keyboard.KEY_DOWN) then

thick karma
#

Basically but you have to do this in a decoration of the function I mentioned

#

The OnKeyPressed event doesn't pass a self with joypad.player inside of it that has a joypad player's index

neon badger
#

i would love to add movement for left joystick up and down with right and R2 as guns that would be perfect

thick karma
#

Basically instead of doing all that in an OnKeyPressed event you do it in a decoration of onPressButtonNoFocus in JoyPadSetup

jaunty marten
thick karma
neon badger
#

ok

#

i appreciate all the help i should be able to get it to work again still new 😛

#

modding skyrim was so much more easier lol

thick karma
#

So I've heard

jaunty marten
neon badger
#

😛

wheat kraken
#

is it possible to teleport vehicle with player inside?

loud wagon
#

Anyone got a script template for a static 3D item?

ancient grail
loud wagon
ancient grail
#

Media/scripts

loud wagon
#

Thankye \m/

ancient grail
#

🫡

wide oar
#

Would it be possible to make a weapon that changes models when you get a certain amount of kills

#

i feel like it would be, have it count kills and when it detects a certain amount with the weapon change items or something?

ancient grail
#

That would be nice

Ye this is possible
Great idea

#

But not like how you think

You have to despawn the okd weapon and respawn a new one
(Make sure you tranfer all properties of old weapon to the new, such as condition)
You should have some code that remembers where the old sworld is
Attached or not inside a bag or not
Floor or container
You should equip the new one to you hands if its equiped etc

#

Then delete the old one

bronze yoke
#

if you wait until b42 these hacks won't be needed

ancient grail
#

This is the main function

Now you need somesort of a listener

Playerupdate or maybe onhitcharacter
Or onswing
(Not sure abt the syntax of these events)

ancient grail
bronze yoke
#

you might be able to do it easier by treating each stage as a weapon attachment but not sure how flexible this system is

wooden lodge
#

How long until horses and dogs are modded after animal AI gets released

#

🤓

ancient grail
#

Dogs already done .. dislaik made em

ancient grail
bronze yoke
#

the entire weapon is the attachment

#

base model is nothing

#

then you can do whatever you want with the attachments

ancient grail
#

Niceeeee

#

What an innovative idea

#

Hey albion have you tried modding anything related to the bare hands?.
Do you know anything about it like something that you discovered?

Cuz its the thing when you have nothing equipped but getting the primary hand always return nils

#

So how does that work exactly

#

Can it be modded into something else?

#

Might be useful for @zinc pilot 's
ToC
Like replace barehand with something else

bronze yoke
#

just overwrite the BareHands script

ancient grail
#

But what if the player isnt amputated?

bronze yoke
#

you can't have different ones for different players

ancient grail
#

I mean replace the hand with hook for example or something

#

Ahh ok

bronze yoke
#

it is created when the player object is created, and i don't see any way to overwrite it from lua

ancient grail
#

Damn another limitation

Workaround is to have something permanently attached to secondary hand maybe

bronze yoke
#

the reason getprimaryhand returns nil is because the game only equips it during the attack and unequips it after

ancient grail
#

Isee ok then
Thanks for the info

bronze yoke
#

all during one frame iirc

ancient grail
#

Ahhhh nice

#

Cant i hook on that

bronze yoke
#

maybe

#

you might be able to get it generally with the reflection methods

ancient grail
#

Whats that?

bronze yoke
#

getclassfieldval etc

#

it seems to only grab very specific fields, couldn't get it to give me barehands

#

not really sure what the pattern is

#

all the fields it gave me were IsoPlayer so it might not work with inheritance

#

and bareHands is from IsoLivingCharacter

#

might have been possible but IsoLivingCharacter is not exposed

ancient grail
#

ok then.. i guess ill just change the shove anim if player is amputee

bronze yoke
#

if you hook Attack you can probably overwrite the functionality but you would have to rewrite everything

#

not worth it at all

drifting ore
#

Is there a guide to add an item to the game ? I remember one but can't find it

#

Need to make a copy of the blocknote

#

Also, is it possible to add an icon to the map at a giving position or open the map and move it at a giving position?

jaunty marten
rancid panther
#

what are the absolute most required things for making a mod that uses the health panel?

#

or would it be better to try something easier like a timed action and a normal recipe for now?

drifting ore
#

Working on a notebook to keep information of vehicles. Any suggestion of features that would be nice ?

fast galleon
# drifting ore Also, is it possible to add an icon to the map at a giving position or open the ...
GitHub

ImmersiveSolarArrays for Project Zomboid. Contribute to radx5Blue/ImmersiveSolarArrays development by creating an account on GitHub.

GitHub

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

drifting ore
#

Thanks, will take a look 🙂

viral notch
fast galleon
#

I guess pm me, or ask on solar panel discord

rustic garnet
fast galleon
#

Do you have some event that runs only on new save, or save some persistent data?
*or a sandbox setting, that is off by default

jaunty marten
#

@rustic garnet no no no no no, dude, what's the hell is that

frank elbow
#

If you're sure have it enabled, a way to see what's happening is to check the console.txt file for errors. Or just start in debug mode

jaunty marten
sour island
#

I feel like everyone writes one of those

jaunty marten
ancient grail
#

Not suppose to be global

sour island
#

That too

jaunty marten
#

not suppose to exist

sour island
#

You could also strip down the first one considerably.

#

Actually not even have it

#

if table[value] then ~

ancient grail
#

A guide explaining why we need to out globals on a table would help alot

frank elbow
#

I think it's safe to say people newer to programming are focusing more on "make it work" than "make it performant", which is sometimes ideal actually. Not in this case, but just a thought

ancient grail
#

So to reduce global functions

sour island
#

Could be a generic "good programming guidelines for readability"

sour island
#

But most new learners are in the "please God, work" phase

jaunty marten
ancient grail
#

Alot of veteran modders who saw my code explained to me why

But most new pz modders dont have that kind of guidance

#

Esp if they just lurk

sour island
#

Doesn't help alot of vanilla uses globals

ancient grail
#

True

sour island
#

All the UI uses requires and derives, but they should be returned modules

ancient grail
#

But still naming a global function something generic or copied a global from other mods
And named it the same but modified it abit will definitely cause error

sour island
#

I ran into that issue

ancient grail
#

And the modder that commited this cant be easily reached omg thats the worst

sour island
#

Named something a bit complicated like "getOutsideSquareFromAbove"

#

And superb survivors had something with the same name ._.

jaunty marten
#

if ur mod adding more than 1 global var then how did u feel

ancient grail
frank elbow
#

I was about to say the same lol, one global to allow easy access to other mods extending mine is all I'm comfortable with

sour island
#

I kind of wish the recipe code could not be globals somehow

#

But it would break a lot of old mods

frank elbow
#

Even then I return the global from the module so it can be required too

jaunty marten
sour island
#

You can just use require on returned code -- it feels clunky at first but it also makes it clear where the "globals" are coming from

jaunty marten
ancient grail
sour island
#

All they'd have to do is require it to be under atleast the Recipe global

frank elbow
sour island
#

Or have a event trigger to add the function with an ID to a list

#

So it doesn't have to be global at all

jaunty marten
frank elbow
#

I think he's referring to OnCreate and stuff like that

sour island
#

The Lua functions in recipes are pulled in real-time afaik

ancient grail
#

What is rawget and rawset? They came from _G

wheat kraken
jaunty marten
frank elbow
jaunty marten
#

he must fix it by another way

#

and remove these 2 funcs at all

ancient grail
#

Ahhh ok

sour island
#

The second function of his could be removed if he stored those values in a sister list as the original list changes

frank elbow
#

I suppose "without checking the metatable" would be more accurate, since __index can also be a table

sour island
#

But I doubt he needs to check for index tbh

wheat kraken
jaunty marten
tame mulch
sour island
#

Depends what he's using it for

jaunty marten
#

so expensive

sour island
#

Oh no remove() 😢

tawdry solar
#

can anyone help idk what the issue is

jaunty marten
sour island
#

If PZ could hard break table.remove like it does for math.random -- @tame mulch 🙏

jaunty marten
#

there's explanation what I want from u

frank elbow
jaunty marten
sour island
#

Table.remove() is super expensive

#

It amounts to table.insert and recursive removes for every entry

jaunty marten
#

mb it's a bit rude

#

but it's just a facts

frank elbow
#

People would just reimplement it if needed; I don't think it should never be used. There's just usually a better alternative

sour island
#

If you Google Lua table remove there's countless threads with people ripping their hair out saying to not use it

wheat kraken
#

getting the oportunity to have many veterans reading that, 😂

is that possible to tp vehicle with player inside?
i find out that is hard to do, or buggy, (maybe vehicle need to tp on loaded chunk)

sour island
#

There's a way to shuffle values around that gets the same result as table.remove without all the overhead

#

I can snippet it when I'm free later

tame mulch
sour island
#

If somehow PZ could superimpose that function over the standard remove it would be nice

wheat kraken
#

do you get any further on this stuff? or have knowledge to share? about teleportation of vehicles?

jaunty marten
#

@rustic garnet did u get about what did I said? I can help u with that if u want. useful knowledge for ur future mods

ancient grail
fast galleon
#

is there a math function to get the integer part and the remaining value at the same time?
*from a division
x, y = 7//2, 7%2

tame mulch
ancient grail
#

Im pretty sure your icon doesnt work

jaunty marten
worn juniper
ancient grail
jaunty marten
fast galleon
#

@ math.modf does not do that

frank elbow
#

Nah, I looked it up just after to confirm and that's integral and fractional part

ancient grail
frank elbow
#

I was thinking fmod but that's also not what you want

jaunty marten
fast galleon
#

also kahlua doesn't have the // operator 😦

jaunty marten
#
local x, y = math.modf(1.23)
x > 1
y > 0.23
ancient grail
sour island
#

@tame mulch This isn't a complete example but it shows the compression after niling the entries.

local function compressTableOfNils(table) 
         local n = #table 
         --prepare new index for self.hostilesToFireOn 
         local newIndex = 0 
         --iterate through and overwrite nil entries 
         for i=1, n do 
                 if table[i]~=nil then 
                         newIndex = newIndex+1 
                         table[newIndex]=table[i] 
                 end 
         end 
  
         --overwrite rest of entries to nil based on newIndex 
         for i=newIndex+1, n do table[i]=nil end 
 end

From what I've tested this is faster than using table.remove.

Should be noted if the end of the table is nil'd this isn't needed as Lua collapses the table down. What it can't do is handle nils in-between entries.

frank elbow
jaunty marten
jaunty marten
wheat kraken
frank elbow
#

What reifel said

#

What I mean is it's not the solution to the question; getting the integral & fractional parts is not modulo

jaunty marten
#

he wants to get integer and fractional as 2 different values

#

so it's math.modf

frank elbow
#

No he doesn't

fast galleon
#

I want to get 3 and 1

jaunty marten
frank elbow
#

Perhaps poor phrasing on the question, but the code directly after it does clarify it pretty well lol

jaunty marten
sour island
#

You can define 2 variables from 1 function, if you return 2 values

fast galleon
#

huh, how should I phrase it?

sour island
#

X, Y = function()

#

function() return x, y end

#

I use it to keep linecount down if the variables are like x, y etc

frank elbow
sour island
#

You can also do
X, Y = getX, getY

jaunty marten
fast galleon
jaunty marten
#

btw to get // u can use x//y = x / y - (x / y) % 1

fast galleon
#

I just roll my eye and use floor

frank elbow
#

Curious about the performance of that vs just using floor, but also either way I would just use floor lol (unless it's much faster & I'm for some reason that worried about performance)

jaunty marten
#

never tested

sour island
#

You can check using Lua Test Bed from Lua.org

wheat kraken
#

when i tp player inside vehicle, and it appears in new position, it get bugged,
spamming error that chunk is not loaded for the vehicle

and after sometime, it get back to original position, with two vehicles cloned and on top of each others

#

there is a hint to solve it?

sour island
#

You'll have to remove the driver from the car or teleport the car instead

#

IsoPlayer has a getVehicle() returns the car if there is one

#

Might have to eject passengers though if you want the car to come along with just 1 person

#

Ejecting the player would probably be the easiest though lol

jaunty marten
#

@livid gale @frank elbow floor is slower Gagaga

frank elbow
#

Significantly slower, or this-is-probably-premature-optimization slower?

sour island
#

There's scalability to test as well

fast galleon
sour island
#

Although flooring thousands of numbers is probably not a case that'd occur

#
  • globals vs locals
#

Not calling a function should be faster usually

scarlet wigeon
#

Hi, i've done the tutorial to add zomboid exe as "dev", but i'm unsure to understand how it works.
does it create a new folder with the whole game inside ?

frank elbow
#

I'd say that's acceptable for something not worrying about being super performant tbh

jaunty marten
#

x / y - (x / y) % 1 near of real //
btw fresh lua version have //, my bad haha

jaunty marten
frank elbow
#

local floor = math.floor

#

I'm assuming you compared w that bc global access would cause additional overhead

sour island
#

If you mean the pinned comment

#

The main advantage of this is avoiding moving your mods around when you want to play with friends and you have work in progress

jaunty marten
ancient grail
jaunty marten
frank elbow
#

Lol yeah we've strayed pretty far from the question

fast galleon
#

yeah, I've needed that a few times before.

jaunty marten
# frank elbow What are the overall results? Interesting that it's faster in some cases

run 5 times
#1 x / y - (x / y) % 1
#2 math.floor
#3 local math_floor = math.floor

Benchmark results: 100000000 function calls | 3203.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3249.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3177.00 milliseconds elapsed

Benchmark results: 100000000 function calls | 3213.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3270.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3240.00 milliseconds elapsed

Benchmark results: 100000000 function calls | 3371.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3448.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3474.00 milliseconds elapsed

Benchmark results: 100000000 function calls | 3417.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3473.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3370.00 milliseconds elapsed

Benchmark results: 100000000 function calls | 3252.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3243.00 milliseconds elapsed
Benchmark results: 100000000 function calls | 3346.00 milliseconds elapsed
jaunty marten
#

just ran it for 1000000000 times LUL, need to wait A BIT

jaunty marten
scarlet wigeon
fast galleon
jaunty marten
#

benchmark unstabled

fast galleon
#

anyway, thanks for trying to find a good solution spiffo

kind fossil
#

Hello! I'm trying to make admins spawn scars on players by giving them the items you can choose when creating your character with the all clothes unlocked sandbox option checked
Those are the items I can choose during the character creation panel
Can't find these items in the database

frank lintel
#

you should see the tests I get on clamp

#

also not sure why but I thought memory assignments inside a func would make it slower if ya could just use the args straight thru... nope dont work that way.

kind fossil
#

I see that yes

#

also when I apply a scar, i can't remove it anymore

frank lintel
#

cuz its a scar?

kind fossil
#

hehe

frank lintel
#

sorry didnt mean to be funny I was being literal. scars dont go away personal experience. game treats it as such.

sour island
frank lintel
#

does a player in debug mode play different in MP (only asking cuz never did it yet...)

sour island
#

No, but you need to be admin or hosting machine to connect

frank lintel
#

ah didnt matter I sworn I seen scars for body parts cuz of debug but it wasnt. just burns (post injury stuff)

jaunty marten
frank lintel
#

I was able to squeeze 3% outta clamp

tawdry solar
#

can anyone help

#

oh wait

#

there was replies with no ping

tawdry solar
jaunty marten
tawdry solar
#

alright

jaunty marten
tawdry solar
jaunty marten
#

module ...
{

}

tawdry solar
#

i did that

#

this is correct?

jaunty marten
#

u forgot to add } at the end of file to close { of module MM_Springclub

tawdry solar
#

oh

#

like thta?

jaunty marten
#

no

#

}

#

not {

tawdry solar
#

like that

jaunty marten
#

👍

faint jewel
#

dear god man.
use three ` before and after code.

tawdry solar
#

thanks man

faint jewel
#

no bright white boxes

tawdry solar
#

eh?

jaunty marten
#

oh

faint jewel
#

three CODE three

#

oof

jaunty marten
#

three `

faint jewel
#

that works lol

tawdry solar
#

i dont get it

#

what does that mean

faint jewel
#

oh lawd.

#

type out what he pasted.

#

see what it does.

jaunty marten
#
dsfjhagfg
dfjsajasg
djsfasuigherg
dsjfgj
#

instead screens

tawdry solar
#

does it put it in dark mode

faint jewel
#

if you are IN dark mode yes

#

that's called a code block.

#

it keeps code formatting.

tawdry solar
#

the item works now

faint jewel
#

and even even color it.

tawdry solar
#

the textures invis tho

jaunty marten
frank lintel
#

if you make a .lua temp text file and drag and paste that way, it makes it a 'collapseable'

jaunty marten
#

too much action

#

instead just copy text and paste it into code block

frank lintel
#

yeah wait till someone pastes 100+ lines of code :)

jaunty marten
#

it's fine lul

frank lintel
#

it used to have a limit then do the same thing but discord yanked that at some point.

frank elbow
#

Note that you can't view files like that on mobile discord

#

So anyone who's on mobile will probably just ignore the message 😄

tawdry solar
#

bc the icon doesnt show either

#

OH WIA

#

i donwloaded a melee template

#

and it shows like file structures

red tiger
#

Good morning.

#

So I've ran into something of an issue with writing a VSCode extension for ZedScript support. @quasi geode is TXT supposed to be the official extension? If so, is there any way a format-specific extension can be supported? I can't simply tell VSCode to load for txt files.

tawdry solar
#

ig i would need this

#

fml

frank lintel
#

ah yeah it does and images I'd ignore cuz I got'm turned off esp on mobile. wonder why they pulled the collapse function for <code>

frank elbow
red tiger
#

You are all secretly C# devs.

tawdry solar
#

couldnt be arsed

red tiger
frank lintel
#

Heathen! we are all C lovers

granite wind
#

how are there 128 home VHS tapes yet i havent found a SINGLE ONE

frank elbow
red tiger
frank lintel
#

C and VI...

red tiger
# tawdry solar zed what

ZedScript is an unofficial name that Aiteron and I are using when discussing those txt files you guys throw around in here. =)

frank lintel
#

most IDE's will actually just scan a file and guessitmate what lang it is without the .ext

tawdry solar
#

ah

frank elbow
#

...well, because it is

red tiger
#

Well I wonder if scripts can be loaded in PZ with another file extension.

#

If so, I'll use that.

frank lintel
#

you gotta define the whole file name regardless right?

red tiger
#

*.zs* or *.zed would work.

tawdry solar
#

does that work now

red tiger
frank lintel
#

yeah but thats easy you wrote it basically/decrypted etc.

red tiger
#

Yeah......... buuuuuutttt

#

If I write files in an extension not picked up by PZ then that's an issue.

frank elbow
# tawdry solar does that work now

What someone before was trying to describe to you was the markdown syntax for including code blocks in discord messages. If you paste your code with three sets of backticks—“fences”—it will be formatted as code and will be easier to read than a screenshot.

That is,
```
code
```

Becomes:

code
frank lintel
#

if ya reading a file arent you using the whole name?

granite wind
red tiger
ancient grail
#

``

--code

``

ancient grail
#

Woops acidentaly pasted something else

red tiger
#

I'm about 5 seconds away from straight-up writing a file format proposal on the forums.

#

lol

#

ZedScript needs so much love rn.

frank lintel
#

block of left colon once for single line, block of 3 for multi I just miss the collapse func when they were over (x) in size

red tiger
#

(Investing time in writing VSCode support for scripts)

sour island
#

So like just making it a text but with .zScript or something?

red tiger
#

Also getting close to 100+ hours time spent working with this format now. xD

red tiger
#

.zs or .zed

#

It would force the question of what the official name and extension is, however it's necessary to make a solid vscode extension.

sour island
#

Otherwise you have to check the text contents?

red tiger
#

I'm going to be writing it.

red tiger
fast galleon
#

You should probably raise these issues on the TIS forum.

red tiger
#

I'm slamming my keyboard in here to hopefully avoid that. My questions will quickly turn into a schema proposal. xD

fast galleon
#

I wonder how easy it is to set it for a specific folder?

red tiger
#

I can see that maybe getting messy?

fast galleon
#

considering these need to be in specific folders

red tiger
#

What if TIS changes the folder in a future update?

#

=)

#

I could always toss VSCode extension support for ZedScript to the wind and go along with my plan to write a preprocessor language that compiles to ZedScript.

#

I'm going to write a white paper on it.

fast galleon
red tiger
#

The preprocessor format will be called 'DeadScript' for now.

#

The main pitch for it is adding in an inheritance feature where (for example), items could extend another and inherit properties set from the parent to its children.

#

DeadScript example:

module foo {
  item BaseAxe { 
    type = Weapon,
    // [Parent Properties]
  }

  item StoneAxe extends BaseAxe {
    // [Child Properties]
  }
}

Becomes ZedScript:

module foo {
  item BaseAxe { 
    type = Weapon,
    // [Properties]
  }

  /** @extends BaseAxe */
  item StoneAxe {
    // [Parent Properties]
    // [Child Properties]
  }
}
#

I also plan to use inheritance for things like recipe where all children of an item would be supported as an ingredient:

recipe blah {
  keep {extends BaseAxe}
  // ...
}

compiles to:

recipe blah {
  keep BaseAxe / StoneAxe / //...
}
red tiger
#

I guess it's too abstract with no concrete example for people here to comment on it just yet. =/

#

This is basically saying I'm wanting to write a new language that compiles to ZedScript. =)

frank elbow
#

I don't have much to say because I don't think I'd use it, but I do read these messages nonetheless 🤠

red tiger
frank elbow
#

Definitely fair. I think it'd be neat if your ideas were implemented into the game. Inheritance seems like it could be handy for less repetition

red tiger
#

Would save modders time and devs time spent working.

#

=)

sour island
#

While it's not ideal the scripts are expected in the scripts folder

#

As mentioned above

#

The sandbox options sit outside though

#

I don't expect the scripts directory to be refactored

#

Logically speaking, as I wouldn't know

red tiger
#

I'd imagine adding a .ext OR check next to the .txt check wouldn't take much effort.

sour island
#

For backwards compatibility, probably not an issue

red tiger
sour island
#

My statement was in agreement 😅

#

Sorry, typing outloud so to speak

red tiger
#
if (fileName.endsWith(".txt") || fileName.endsWith(".zed")) { 
// Load ZedScript..
}
red tiger
sour island
#

They could also change vanilla files so future modders use that as a template but would having that unknown extension cause issues?

#

Right now people can open it in notepad without guessing

red tiger
#

I think it should be a technical legacy feature to allow for eventual migration.

red tiger
#

Rich text editors are expected to simply open up plain-text files with non-txt format extensions.

#

VSCode does this.

sour island
#

I'm probably being overly cautious for redundant tech support issues

red tiger
#

I'm saying in a more drawn-out situation example that it's okay for a modder to spend a couple seconds selecting to open the file as plain-text than the potential hours of debugging a property that could be explained through intellisense.

sour island
#

True

red tiger
#

This is some of the same reasons why I wrote PipeWrench / TypeScript modding support.

sour island
#

I think it's definitely something that would help alot of modders -- scripts are the easiest thing to experiment with

#

But there's that huge threshold from syntax errors

red tiger
#

Making integrated extension / support for scripts would eliminate a lot of that human error.

#

That being said, a preprocessor language could mitigate a lot of redundancy within said scripts.

#

=)

#

tl;dr: "I'm not crazy. You're crazy."

sour island
#

I'm hoping when NPCs are out and stable that the "polish" update also includes more tools and such

#

The arrows for the vehicle editor barely registers the cursor ._.

#

So ones choice is to sit there clicking an arrow hoping it gets clicked or typing and reloading the script in the editor

red tiger
#

Honestly, I thought: "Why not make an Electron application that displays vehicles adjusted with those settings?"

#

OpenGL isn't hard. :D

sour island
#

The editor is decent for what it's for -- but it would be nice to have manual inputs and arrows that work

sour island
#

I can't imagine the devs use it...

red tiger
#

It's probably there for certain devs to view it.

#

(See if things loads correctly in-game)

sour island
#

I mean... It barely works - unless I'm doing something wrong -- I can't ever get the arrow to activate

#

The anim editor is also flakey but a bit better

frank elbow
#

My wish for the polish update is a pass through the Lua (and exposed stuff to Lua) for small fixes for bugs & inconsistencies

red tiger
#

xD

sour island
#

I kind of wanted to get that ball rolling with the community patch, as evidence it's needed

red tiger
#

Or a API version control.

#

I've said this for years.

sour island
#
  • give us modders less of a headache when trying to resolve compat issues
frank elbow
#

Honestly some of my desires are entirely benign typo fixes, but I'd assume they'd just deprecate the old one & add a fixed spelling that corrects it

red tiger
#

People are already salty about issues with the API as it is currently. Breaking it would be worth it. People complain regardless.

sour island
#

There's two tool checks in mechanics that aren't recursively searched - I made a mod for two lines of Lua lol

frank elbow
#

I'm thinking they're gonna try for backwards compatibility after the b41 changes got a reputation for breaking everything in the workshop, but who knows

sour island
#

Honestly, bomb the workshop

#

True music add-ons and gunfighter server settings

#

And now Noir shops

#

But also, it has to be a fuckton more work for the devs too to keep stuff so stretched out for compat-- so, if it's painful at first but better overall and for the future pull the pin and close the door.

red tiger
#

long-term

#

=)

#

Maybe B43 could be the breaker.

#

But that's like 2024-2025 based on the prior big updates.

sour island
#

I wonder if there could be a hide feature for mods and versions

#

Mod.info can have version control for min and max

#

But I feel like that could clutter up the players modlist

frank elbow
#

There are versionMax and versionMin fields in mod.info, unsure if that's what you mean or if they're even used

#

I just noticed them while looking through to see what all the fields were

#

Checked & they are used—ChooseGameInfo.Mod has getVersionMin and getVersionMax, which seem to only be used by ModSelector.lua to inform the user about it if the version is out of range

#

Unfortunately I don't think the fields are used very much anyhow, so even if something were added to be able to hide them it wouldn't have the information necessary to do so for most mods 😔

sour island
#

They exist, but the mod shows up as red - I was wondering if it could be just hidden altogether to not clutter up the menu

frank elbow
#

Oh, I misinterpreted "can have" as a theoretical "could have" 😄

red tiger
#

Ultimately I support long-term "Quality of Life" changes.

sour island
#

You'll improve your quality and you'll like it.

viral notch
#

what i missed ?

wet sandal
#

I've got to make a compromise with how furniture items are handled in my grid inventory.

Do you guys think it would be preferable to:
A - Not be able to equip furniture items into the hands
B - Furniture items can be equipped, but cannot be unequipped until you properly place them in container or the world

red tiger
#

Have a 1x1 grid for hands exclusively and place it there.

wet sandal
#

Reason is the game doesn't want them to be on the ground and forcing it, they are invisible.
That's how they worked when equipped.

fast galleon
#

skizot has made mod where he carries moveables in hands, so...

red tiger
#

I eventually want to try my hand at a grid inventory mod. :D

#

Want to see what you come up with first. <3

#

Too busy writing tools tho.

wet sandal
#

Think I'm going with B then

sour island
#

B fits how it's handled for bodies and generators afaik

red tiger
#

Side-Note: Someone needs to make an animation where you can hold up a corpse like Lion King.

wet sandal
#

To explain a bit better, equipped items do not take grid space, and neither do items that are part of a "transaction" (i.e. TimedActions)

sour island
#

Carrying or dragging the bodies would be great

wet sandal
#

The issue arises here when a transaction fails, which my policy until now was to just drop the item

sour island
#

Dragging could be more exhausting but require less strength + you can drop it faster

rancid panther
sour island
#

Picking up could require more strength, by be less exhausting - and we'll I guess you could quick drop it ... 🤔

wet sandal
#

SO LONG KING BOWSER

sour island
#

We do need grappling lol

#

Would alleviate "welp your bit, kick rocks scrub"

#

To, you fucked up now wrestle this zombie

red tiger
#

I like the idea that fumbling through the bottom of your backpack to get the item you need would be way more dramatic.

#

Like needing to remove the top items or move them to the side.