#mod_development

1 messages · Page 134 of 1

bronze yoke
#

that does seem like an inconsistency - i came across some old code implying fit did only give level 6 at some point, so that's probably why

#

most likely they made the trait stronger at some point to make it more worthwhile (one level of fitness really isn't much) and forgot to/chose not to alter the level you earn it at

wide oar
#

question

#

how would you make a object seen as solid

#

because rn i have a placable piece of furniture that i just walk through

tawdry solar
#

i got my mod working

small topaz
warm flame
#

Oh nice, i thought that the alternative mod had the same issue, ill have to check it out, thanks

abstract raptor
#

tryna place a tile with code but I'm noticing it doesn't have collision properties

keen silo
#

Hello, Im new to PZ mod development, and I want to try out a project to add voice overs to several if not all radio and tv programs using ElevenLabs (I'll start with some by hand, but I will try to automate the process using their API).

As far as I know, I believe I will have to create a sounds file like

sounds_voiceOvers.txt

where I add sounds items with the format

sound {text_id} { category = VoiceOver, clip { file = media/sound/VoiceOver/{text_id}.ogg, distanceMax = 20, } }

Now comes the hard part. I need a way to make every audio play whenever they are displayed on the game, acording to their ID.

Looking at the pzwiki Lua Events/OnDeviceText (https://pzwiki.net/wiki/Modding:Lua_Events/OnDeviceText) seems to be what I need. However, I don't fully understand how this event works, and how to make the appropiate sound be played when they happen. Does anybody know what interactCodes mean? is it like an id for the Lines?

I know there will be a miriad of problems, that I will look into after having an initial workable solution for this (like audios still playing after changing channels, Volume afecting the sound distanceMax, etc.). I just want to know of a way to know which line is being shown, with which id, and how to call a sound event.

Does anybody have any experience in this regard and could give me a hand with this spiffo?

abstract raptor
# keen silo Hello, Im new to PZ mod development, and I want to try out a project to add voic...

RadioBroadcastlines have GUID's, and it is all read from the RadioData.XML . I was able to add voice acting to the radio by using a combintation of using deprecated broadcast effects (in my case drunkeness tags, which I created a table to have every file associated with a number) and duration tags to synch the audio. You will inevitably have problems syncing the audio to the text, because the text dissapears based on how long the text line is, hence why duration tags are neccesary for voicing the media.

bronze yoke
#

the wiki is outdated, there's now an additional argument passed which is the line's guid

keen silo
#

for instance, the GUID of this line:

<LineEntry ID="b0ee632b-789e-4e4f-a2b0-b09374856a62" r="255" g="192" b="0">Where in the Pizza Whirled are we today?</LineEntry>

would be b0ee632b-789e-4e4f-a2b0-b09374856a62 ?

abstract raptor
#

Yep. That's right.

keen silo
#

thanks 😀

abstract raptor
#

I'm sure you can get it working off of that alone, but like I said, you're going to run into an issue with timing unless you add duration codes to every line ha

#

Additionally you will probably go insane writing scripts for each indivual sound file

keen silo
#

I'll try to automate using their api. Luckily it's free for the first 10000 character each motn

#

month*

abstract raptor
#

You're gonna need a lot more characters than that! I pay for eleven labs and even I wouldn't want to try to voice the entire radio/tv broadcasts.

keen silo
#

or a lot of time ded

#

I obviously would start with the most popular programs like woodcraft and improve from there

abstract raptor
#

Yeah, if you want to see how I've done it here are some links;

https://youtu.be/q7qnejz0I1Y

https://youtu.be/35XBR9GlxpY

Meet Erin, she runs a pirate radio station in the middle of a zombie apocalypse -- But she's not alone.

Footage from Project Zomboid and the Mod Survivor Radio 3.4

Erin/Agent 15 - Scarlet
Penelope/Agent 77 - Annakath
Kyle/Agent 13 - Kurokaze
Written by Azakaela

Edit: Appears there was a problem with the audio on exporting, buuuuuuuuuuuut I'm...

▶ Play video
#

you can check out Survivor Radio to see the code I utilized as well; but if you want to easily edit the radiodata, you'll need WordZed

frank lintel
#

reads on the diff of . vs : in Lua and sighs...

keen silo
frank lintel
#

isnt that just done in the text stuff adds in delays and display times etc

bronze yoke
#

that's what they mean

frank lintel
#

nvm just realized that was reading it other way... sorry dang lua manual making my eyes swim lol

abstract raptor
keen silo
#

which is the best up to date LUA manual for this?

abstract raptor
#

t can be set to any time between 0:00 and 5:00

keen silo
#

Hey, I was wondering. Could I use your LUA code as a base for my project? I believe that most problems I would encounter were already solved. probably all I would have to do is modify this line of the LUA

for _,_v in ipairs(codes) do
if _v:len() > 4 then
local code = string.sub(_v, 1, 3)
local op = string.sub(_v, 4, 4)
local amount = tonumber(string.sub(_v, 5, _v:len()))
if op=="-" then
amount = -amount
end
if amount ~= nil and amount > 0 and code=="DRU" then
RadioWavs.PlaySound(amount, radio)
end
end
end

To allow the use of normal lines instead of your custom ones, and modify the RadioWavs.files to my custom wav files so I can make it reproduce the audios generated by ElevenLabs

abstract raptor
#

sure, just make sure to credit me

keen silo
#

Thank you very much.

How can I overwrite radio lines?

for instance, I want to specifically modify this line from RadioData.xml:

<LineEntry ID="d363f154-086a-44c8-bf79-db09bfa3299c" r="0" g="176" b="80">Y'all are watching Woodcraft!</LineEntry>

to

<LineEntry ID="d363f154-086a-44c8-bf79-db09bfa3299c" r="0" g="176" b="80" codes="WDC-1">${t:3.66}Y'all are watching Woodcraft!</LineEntry>

to add codes as you used in your mod, and time tags defined by the clip size.

Do I just add a file in media/radio called RadioData.xml with just that entry? or do I have to copy the entire RadioData.xml and specifically modify that line for the changes to take effect without breaking everything else ?

abstract raptor
#

You could ammend the XML directly or you could use Wordzed to open up the radiodata file; Word to the wise, the RadioData.XML cannot currently be replaced in the steam workshop so people would have to take your file and add it to their game.

#

(unless they fixed that. I've been asking but I'm not sure if they ever did it)

#

(as far as I'm aware, you cannot replace the radiodata.xml file)

keen silo
#

so essentialy, there would be no way to make an easy one click install mod, because I cannot overwrite the radiodata.xml file

abstract raptor
#

well I'm not sure if it's still like that

#

last i checked was a while back

keen silo
#

where can I ask if this changed?

abstract raptor
#

Not sure.

#

You can try it, maybe they changed it. But last time I tried to replace the radiodata.xml in the radio folder it didn't do anything

keen silo
#

should I try to copy the entire radiodata.xml and change a few lines, or just change the specific lines with specific IDs?

#

worst case scenario, I just have to tell people to copy and paste one file in their folders anyway, but I know the beauty of plug and play 😛

abstract raptor
#

whatever works ha

#

wish you luck

old crescent
#

hello need help.. does changing the charcter respawn time posible?

keen silo
#

alright. If I understood correctly, What I need to do is the following:

Add a code DRU+number to all the lines that I want to add voice to
Make one large AudioFile with the entire episode programing (Will be difficult since I will have to implement multiple voices for certain programs, and I dont want to have to splice together separate files)
Adjust text times to audio speed accordingly

Once this works manually, find a way to automate the process using the API

jaunty marten
bronze yoke
#

radio doesn't go through recmedia

jaunty marten
#

ah, I missed that part, my bad

worn juniper
#

the -- comment was the issue

rustic garnet
#

Any resource when it comes to Localization? So I can support my mod in multiple languages?

ancient grail
#

I cant seem to find poltergeist

#

Did he change his name?

jaunty marten
#

nope, he's here

#

578454892364955655

fast galleon
fast galleon
ancient grail
jaunty marten
glass basalt
#

здесь все русские молчать ))))

jaunty marten
#

жёско бро Gagaga

glass basalt
frank elbow
#

The modding wiki (see pins) has a small section on localization, but it's just about encoding

#

One of the guides on GitHub probably has a section on them too, dunno

glass basalt
#

generally it is just media\lua\shared\Translate\Language\the text files

fast galleon
# rustic garnet Any resource when it comes to Localization? So I can support my mod in multiple ...

translations means don't use literal strings in your code when it comes to things the player will see.
https://github.com/FWolfe/Zomboid-Modding-Guide/tree/master/translations
this is a good guide, though I don't agree with everything, maybe it's based on older version

GitHub

Guide to modding various aspects of Project Zomboid - Zomboid-Modding-Guide/translations at master · FWolfe/Zomboid-Modding-Guide

fast galleon
#

ok, if you have more links I might try to merge them a to wiki page

#

As soon as I debug what's wrong with climbing

glass basalt
#

hmm, the wiki page could just be a list of examples of what strings could be translated per category

#

like, I barely see any mods that use IGUI_CraftCategory

#

would be neat to know that there is an option for that in IGUI

fast galleon
#

yeah, there's maps for the translations but like scripts they don't all follow the same rules.

glass basalt
#

does anyone know how to force the player to drop a particular item?

#

or does the game delete and duplicate items in the game world whenever a player clicks to "drop"?

buoyant osprey
#

How do I start on making a new location for the base game map (i.e not making a whole new map but just changing a cell)

glass basalt
ancient grail
#

i think theres something like that

#

when its too heavy it gets drop

#

just get the function it triggers

glass basalt
#

hmmm okay

#

dropHeavyItems() is a Java method, and I don't have the decompiled class files 😔

#

i am gonna try using the unequip timed action, I just need the parachute to be taken off immediately to not look goofy

frank lintel
#

I just love how steam decided after I just restarted it, oh you need to update steam... MF I just had you running and a restart was needed for you to tell me this? Denied....

glass basalt
frank lintel
#

tbh kinda lost... improve what? its not obvious to me atleast.

hot patrol
#

could someone help me out with something. I want to make a repair recipe that requires a needle and thread to fix the item without consuming the needle. I tried this ```fixing Fix Dakimakura
{
Require : Dakimakura1,
Require : Needle,

   Fixer : Thread=2; Tailoring=2,
   
}``` but it didn't work. What would be the right way to do it if it's even possible?
cyan juniper
glass basalt
cyan juniper
#

It looks awesome as it is, don't stress it

frank lintel
#

looked pretty good to me for an infil

glass basalt
cyan juniper
glass basalt
#

i think my only gripe is that the item itself is goofy and I'm not experienced enough to make it more refined

tame mulch
cyan juniper
#

It looks really great yeah

frank lintel
#

maybe someway to make the viewing area a 360 exposure not only 'POV' cuz you are dropping in from high above.

glass basalt
#

lol thanks Aiteron

frank lintel
#

but honestly looks good to me.

glass basalt
#

well, thank you for the positive feedback, I feel that I can release this mod now

cyan juniper
glass basalt
frank lintel
#

^

glass basalt
#

it's possible but idk how

cyan juniper
#

Ah my bad

#

at that height I don't think you'd see 360 degrees anyway

tame mulch
tame mulch
hot patrol
tame mulch
#

Yep. Maybe your item not in Base module

hot patrol
#

it is

#

but I will try that

tame mulch
chrome egret
#

@tame mulch while you're here, how can I get trace logs appearing in my files?

#

(running a dedicated server, so presuming the info would appear in server-console.txt if enabled)

tame mulch
chrome egret
# tame mulch Hmmm. I think You can't get this logs

Damn. I'm adding an inventory transfer action when the requested item is found at the end of a search. Works beautifully in singleplayer, but in MP it appears the state gets changed to accepted (2) and then rejected (1) shortly thereafter:

Example logs for ItemTransactionManager.receiveOnClient:
                            2[1817133102: -1 => -1]
                            1[1817133102: -1 => -1]
#

Any thoughts on debugging that?

red tiger
#

Good morning.

chrome egret
#

Good morning, Jab

uncut garnet
#

Hi people, I was wondering if I could commission someone to make me a mod. id like a London double-decker bus. has to be compatible with RV Interiors. was hoping to get a quote, or someone to point me towards where one is already made, but i cant find 🙂

red tiger
glass basalt
#

I just uploaded a mod and Steam is giving me this BS

#

AHA, right when I complained about it, it started working all of a sudden

#

the universe works in mysterious, sadistic ways 😏

frank lintel
#

steam prob getting DDOS'd again

halcyon robin
#

Hi everybody. Sorry, I don't know English, so I use a translator. Please tell me who can help me? I would like to make changes to the game, but I do not know how. Create a mod.

glass basalt
halcyon robin
#

@glass basalt map, location, houses, fortresses, castles and buildings of survival in the forest. I'm sorry if there are any spelling mistakes.

glass basalt
#

Choose one mod to start

halcyon robin
#

@glass basalt Choose one mod-to get started? I'm sorry, I don't understand.

warped valve
#

Anyone know how to get just the door in OnFillWorldObjectContextMenu? Right now I've got it to where it's selecting both the door and the tile the door is on, so I'm getting two context menus to appear where I only want one

hot patrol
#

could someone exlpain to me what this does? I am tring to replicate the opening and closing of the umbrella for one of my own items

#

OnCreate:Recipe.OnCreate.OpenUmbrella,

glass basalt
glass basalt
halcyon robin
#

@glass basalt good.. the place where the house stands

#

Isn't that the most basic thing?

fast galleon
#

is there an accepted global subtable to add modules, so it's both global and not global. example use: API that can be included in several mods.

_G.notG or .API or .__modTables _G["$ _ G"]
_G["𝅘𝅥𝅮"]
glass basalt
#

go to #mapping , people there know how to make houses

glass basalt
fast galleon
#

_G is lua side, base is for scripts

#

generally a module in lua is when you make a local table and return that table in the end so another file can require your file and get that table

frank elbow
#

I think it's acceptable to just declare a single global if its name is unique enough (that is, you could declare the global and return it from the module, so it can be used both ways)

#

I also think _G.notG is cursed

frank lintel
#

it uses index[-1] cuz it wants to be different

fast galleon
#

_G["$ _ G"] lol

frank lintel
#

too bad not as simple as _G.!G

frank elbow
#

It would be nice if there were an officially supported way to declare & get APIs. That is, besides just declaring globals

frank lintel
#

you just make it

frank elbow
#

Mhm, I'm saying if there were utilities provided by the game for it

#

Then there wouldn't be any question abt conventions

frank lintel
#

isnt repeating themselves...

fast galleon
#

Somebody just needs to set a decent standard, with version included or something.

frank lintel
#

thats the point ya basically gotta make one

frank elbow
#

Yeah, thus "it would be nice"

frank lintel
#

only saying this because thats literally how/what happed in MC

#

MC provided nothing to the community in that sense it was purely made by us.

frank elbow
#

Something something xkcd competing standards (surely this doesn't count as a meme: https://xkcd.com/927)

hot patrol
frank lintel
#

I'd rather just not flat out see bla[0] = nil in a .lua file... ftlogp...

glass basalt
hot patrol
glass basalt
#

ill take a look at the umbrella item

hot patrol
#

I already did. everything in my mod seems to match up. I imagine that oncreate is a lua thing but idk where it is located so I can rplicate it

glass basalt
#

@hot patrol

function Recipe.OnCreate.OpenUmbrella(items, result, player, umbrella, firstHand, secondHand)
    result:setCondition(umbrella:getCondition());
    if secondHand then
        player:setSecondaryHandItem(result);
    elseif firstHand and not secondHand then
        player:setPrimaryHandItem(result);
    end
end
hot patrol
#

Perfect

#

thank you

glass basalt
#

👍

#

i don't get this code though. you are setting the condition that the umbrella already has

#

unless result and umbrella are different

red tiger
#

I'm surprised that result in recipe scripts has a :.

#

Would make sense to have all directly-related settings for the actual recipe be without :..

glass basalt
#

result is probably an InventoryItem

ancient grail
#

Yes

red tiger
#

It's syntactically inconsistent.

ancient grail
#

Its not

red tiger
#

Also giving me headaches atm

glass basalt
ancient grail
#

Its an inventoryItem
Thats has bunch of stuff
Like
getBloodLevel()

hot patrol
ancient grail
#

result:getName()

glass basalt
# glass basalt `Recipe.OnCreate.CloseUmbrella` is almost the same
function Recipe.OnCreate.CloseUmbrella(items, result, player, umbrella, firstHand, secondHand)
    result:setCondition(umbrella:getCondition());
    if secondHand or firstHand then
        if not player:getPrimaryHandItem() then
            player:setPrimaryHandItem(result);
        end
        player:setSecondaryHandItem(result);
    end
end
#

the if statement is different though

hot patrol
#

thanks again

red tiger
ancient grail
#

I dont what your saying all the time man

#

You are a wizard from other dimension i speak few anguages you can speak all

red tiger
#

I'm saying that the syntax would make sense to use is result ..., and not result: ...,

frank elbow
#

Written by different people I assume, I thought that was odd too

glass basalt
ancient grail
#

Ye

red tiger
#

I'm currently in the "Picking the syntax apart" stages.

red tiger
#

My syntax highlighter has to be written using 100% regex so less syntactic logic the worse.

#

It'll be better to leave it this way for now. It highlights the issue I'm talking about.

#

This is what I'm saying would make more sense.

#

Might as well be a reserved keyword like the other two.

frank elbow
#

How'd you end up dealing with the file extension hurdle, by the way? Will it attempt to parse all .txt files? Stop after it doesn't seem to match?

red tiger
frank elbow
#

Ah, gotcha. Makes sense

red tiger
#

Going to make it the extension for ZedScript until TIS says otherwise.

#

I think recipes and one other category has some funny syntax stuff going on so after that my syntax highlighter should be most-of-the-way completed.

#

Everything else is pretty much an object->key->value.

sour island
old crescent
#

is it possible to add player respawn time ?

sour island
frank lintel
#

dangit knew I shoulda saved what file that I seen... isnt steamID depreciated?

bronze yoke
#

no?

sour island
#

I hope not ded

#

Printing it to text can cause issues with printing it

old crescent
sour island
#

I recall someone having issues with it hitting scientific notation and even when getting it to print the last few numbers changed (?)

frank lintel
#

I thought it was odd too as I was looking into Superb possible going MP and I was like ah f...

#

gimme a min Im looking now think it was in core

sour island
#

I dont think you can get SS to work in MP...

#

🤔 Maybe if you could get the host machine (dedicated or not) to use it's co-op slots?

frank lintel
#

I was thinking headless client more like... ^_^

sour island
#

NPCs are scrapping by as is, I don't think you'd be able to get it to work in MP without alot of time and effort

frank lintel
#

oh I know

sour island
#

Not one to scoff at a challenge, but that is a lot of time one could devote to another project that's more feasible lol

frank lintel
#

if anything likely have to look at a whole different way of how its done atm its just ugh...

sour island
#

I think SS took a dive in stability when chunks were introduced?

#

prior to this I think having the entire map loaded everything kind of worked fine - or was it related to how MP worked

#

either-way, I think there's a big issue of NPCs unloading and being in limbo

frank lintel
#

yeah this just thinking ahead as Im trying to wrap my head around lua<>java nonsense thats going on in there

sour island
#

From what I saw the code is fine, aside from alot of the prints

frank lintel
#

yeah index 0 in a lua file ever is good how?

sour island
#

there's index 0 in SS?

tawdry solar
#
module Base
  {
        imports
        {
             Base
}
    item Bolo
    {
        MaxRange    =    1.23,
        WeaponSprite    =    Bolo,
        MinAngle    =    0.7,
        Type    =    Weapon,
        SwingSound = MacheteSwing,
        HitFloorSound    =    MacheteHit,
        ImpactSound    =    MacheteHit,
        DoorHitSound = MacheteHit,
        HitSound    =    MacheteHit,
        MinimumSwingTime    =    4,
        KnockBackOnNoDeath    =    FALSE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    LongBlade,
        ConditionLowerChanceOneIn    =    25,
        Weight    =    2,
        SplatNumber    =    2,
        PushBackMod    =    0.3,
        SubCategory    =    Swinging,
        ConditionMax    =    13,
        MaxHitCount    =    2,
        DoorDamage    =    10,
        SwingAnim    =    Bat,
        DisplayName    =    Machete,
        MinRange    =    0.61,
        SwingTime    =    4,
        KnockdownMod    =    2,
        SplatBloodOnNoDeath    =    TRUE,
        Icon    =    Dudclub,
        TreeDamage  =   10,
        CriticalChance    =    20,
        CritDmgMultiplier = 5,
        MinDamage    =    2,
        MaxDamage    =    3,
        BaseSpeed = 1,
        WeaponLength = 0.3,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        AttachmentType = BigBlade,
        Tags = CutPlant,
        DoorHitSound = MacheteHit,
        HitSound = MacheteHit,
        HitFloorSound = MacheteHit,
        BreakSound  =   MacheteBreak,
        SwingSound = MacheteSwing,
     }

my item doesnt seem to spawn ingame and idk what the issue is

sour island
#

Also, didn't someone post an alternative to onSquare Loading that loads chunks? Perhaps Nolan if he's still back can make use of that

red tiger
#

I don't know why TIS didn't simply make a modified arraylist object with a index offset of 1.

frank lintel
#

perfect eg. bla[0] = nil

#

java okay, lua file that makes no sense to me

red tiger
#

That's what I remember dealing with back in my main Lua days.

bronze yoke
#

i wish we could just access java objects with lua syntax like the barotrauma lua mod does (for c#, obviously)

#

it seems like i spend more time writing java in lua than writing lua

red tiger
#

I'd rather see wrapper objects with methods that works with expected Lua arguments as it's more practical in the short-term.

#

That and pre-typed generic lists and dictionaries for primitive values.

#

(A big opportunity for TIS to prune a lot of wasteful variable assignments in Lua code with memory)

#

Like

public class BooleanArrayList extends ArrayList<Boolean> {}
public class ByteArrayList extends ArrayList<Byte> {}
sour island
#

You can .new java objects in Lua

red tiger
#

True. You can.

#

I don't think that you can pass type logic though.

sour island
#

Be the change you want to see 🎉

red tiger
#

:D

frank lintel
#

okay sorry if Im stupid on this. but here's some code.

    if(not t) then return false end
    if(t[0] or t[1]) then return true
    else return false end
  local i = 0
  for _ in pairs(t) do
      i = i + 1
      if t[i] == nil then return false end
  end
  return true
end```
red tiger
#

Comments & documentation highlighting.

bronze yoke
#

some way to pass null as a type would be nice (not sure exactly what language is used for that in java)

#

i was imitating some java that passed a null isoobject, but you can't do that in lua, so it would randomly choose which overload to call if i passed nil

frank lintel
#

yeah like index[0] does not exist at all in lua correct?

red tiger
sour island
#

you can check if the variable is an array using type() afaik

frank elbow
tawdry solar
frank elbow
#

That is, a distinct not nil null. Dunno whether it's unique, but something returns that instead of nil as userdata

frank lintel
#

chuck just rewrite it if there something better.

sour island
frank lintel
#

nothing that is example code I did not write... aka SS.

bronze yoke
#

in the end it turned out the area of code had a lot of redundancy so i used a different method that didn't have that ambiguity, but it seems like a future issue

sour island
#

I never saw this in SS before - but there was that guy that worked on it in Nolan's absence, and upon his return Nolan kind of just took it all in at face value

bronze yoke
frank elbow
bronze yoke
#

i'm not sure if this is just an unsolvable issue in kahlua

frank lintel
#

0_Utilities/SuperSurvivorUtilities.lua line 216...

sour island
true vault
#

Is there a way to have the game send a string to a webhook? Text-only ofc at the moment.

I know base Lua can do so..

red tiger
#

Would TIS be willing to try to make a rewrite of Kahlua?

#

Would they even want to?

frank elbow
bronze yoke
#

yeah, it was with the sound player, but luckily that code has been rewritten enough times that most of the methods don't actually do what they say they do

sour island
#

That'd be more manageable

frank lintel
#

why Im lost cuz lua manual says index start on 1 thats it end of game... not sure how trying to yank 0 isnt erroring out. (remember lua noob here)

sour island
true vault
frank elbow
frank lintel
#

if I was in a java compile I wouldnt be worried....

bronze yoke
#

you can use whatever you want as a key in a table, but it's not a good idea

sour island
#

also could just do return type(t)=="array"

frank elbow
#

'table'

sour island
#

depends if they want an array or not

true vault
#

With Lua, basically everything is just a table, in some form lolz

sour island
#

referring to Lua tables as arrays is an issue too

frank elbow
bronze yoke
#

instanceof(obj, "ArrayList") would be better for that use

#

nevermind, i was misunderstanding the purpose

frank elbow
#

The unreachable loop in the code up there is trying to check that it's a table with exclusively integer keys starting at 0*. It does so in a strange way

#

Presumably, at some point whoever wrote it decided checking for 0 or 1 was enough

sour island
#

If it's trying to find that it could abuse #table

#

Would make sense it's checking pairs() to confirm it's (not?) empty I guess

frank elbow
#

#table + 1 if there's 0 would certainly be simpler, idk why you'd really need a strict array check

bronze yoke
#

the way pairs and i are used there makes me think whoever wrote this probably doesn't know lua very well

frank lintel
#

well I got my answer thanks... its bad.. drunk

frank elbow
sour island
#

Looked it up - that is part of the new quest system

#

which is why I haven't seen it

frank lintel
#

and I appreciate all the feedback just trying to make sure Im not picking up bad practice thats all

#

check out 3_Other/SuperSurvivorManager.lua

#

like Im reading init() and just going ummm... brain explosion

#

and IJ just crying at it also so Im like okay 'should I not be trying to learn this way...' or what ie. ignore it... drunk

sour island
#

I wouldn't try to learn from one source if you're using other's mods

#

Yeah looking at init --- you can use 0 as a key

frank lintel
#

just trying to ingrain syntax etc specific for lua cuz honestly the manuals Ive found suck arse for example.

sour island
#

but I don't know if that gets treated as a standard table or a keyed table

frank lintel
#

dunno either guess thats why IJ warning over it?

sour island
#

it is read as a keyed table

merry plover
#

I just need the spawn ID for the insurgent clothing

sour island
#

Now that's interesting

#

Usually keyed tables don't produce a consistent order using pairs

frank lintel
#

oh boy...

sour island
#

also ipairs(t) ignores [0]

frank elbow
#

I'm more concerned by the #table resulting in 0 for that

#

OH

sour island
#

that's cause keyed tables can't be sized

frank elbow
#

It's because it's t, not table

sour island
#

oh

#

oops

#

so it is counted as a numeric table

#

and [0] is just like optional?

frank elbow
#

Lua tables are mixed; all of the functions that deal with tables are just 1-indexed by convention

#

If you really wanted to get wild you could even use the __len metamethod to have #table count 0*

sour island
#

I think it's neat [0] is ignored using ipairs() -- although I don't know what use that'd have

#

I wonder

frank lintel
#

could a value of nil do anything?

sour island
frank lintel
#

wut...

sour island
#

#t can't reach negatives or 0

#

could store some values safely this way

#

but you could also just use another table

frank lintel
#

okay is there something that instantly index the start or end of anything? as like some languages have...

sour island
#

Lua by default indexes at 1

#

But you can also index is as whatever you want

#

you can even index it as java exposed objects or other tables

#

the behavior above is basically hybriding numerically ordered keys (the default is no keys are provided) and non-numeric keys, these just happen to be numeric and in order

frank lintel
#

okay so like with your code t[-2] = nil just flat out removes it or is it nil? like add that on the end after t[4] how would it behave?

red tiger
#

Lol. Thought I was through the thick of it with highlighting buuuuuttt

#

More bug fun. :D

tawdry solar
#

i need help with my mod

frank elbow
red tiger
#

Current look and feel.

#

:D

#

This is what I have so far.

atomic trout
#

Im currently trying to make a little mod that changes zed's eyes to yellow so they look like cod zombies, I have copied all of the zombie textures and edited the white eyes out but question is:
do i create a new folder to place them somewhere?
if not, where do i put the textures in the game folders?

red tiger
#

I've made my syntax Regex for strings intelligent so that they highlight numeric values and syntax-specific characters for special properties.

sour island
#

nice

#

Are there plans to expand into sound, model, and other scripts?

red tiger
#

Working on populating highlighting for categories and improving the string code.

tawdry solar
#

it wont show ingame

#

my pings dont work

azure rivet
#

Hello, can someone help me by giving me a code to increase the damage to the SmallBlade weapon category, I try this but it doesn't work for me.
local function SB_Damage(character, weapon, damage) if weapon ~= nil and weapon:getCategories():contains("SmallBlade") then damage = damage * 10 return damage end end Events.OnWeaponSwing.Add(SB_Damage)

red tiger
#

Heheh found this:

#

=)

modern hamlet
#
local function SendExpToNearestPlayers(player, args)
    
    local expType = args[1]
    local newArgs = { args[2], args[3]}

    -- Does not work
    for playerIndex = 0, getNumActivePlayers() -1 do
        local p = getSpecificPlayer(playerIndex)        
        if expType == "Religion" then    
            sendServerCommand(p, 'MadhousePayment', 'AddReligionExp', newArgs)
        end
    end
    
    
    -- Works
    if expType == "Religion" then    
        sendServerCommand(player, 'MadhousePayment', 'AddReligionExp', newArgs)
    end
    
    -- Works
    if expType == "Religion" then    
        sendServerCommand('MadhousePayment', 'AddReligionExp', newArgs)
    end
end

I wonder why it doesn't work when I send command from server to player I found with loop?

bronze yoke
#

getSpecificPlayer, getNumActivePlayers, etc are client only

#

if you want to loop through players on the server use getOnlinePlayers()

modern hamlet
#
-- Give money to all online players
local function PayToPlayers()
    for playerIndex = 0, getNumActivePlayers() -1 do
        local player = getSpecificPlayer(playerIndex)
        
        local repLevel = player:getPerkLevel(Perks.Reputation)
        if repLevel then
            player:getInventory():AddItems("mh_items.MHOneDollar",(repLevel*2)+1)
        end
    end
end
Events.EveryHours.Add(PayToPlayers)

but this one works, i give money to online players like this

bronze yoke
#

are you testing this in multiplayer?

modern hamlet
#

yes

bronze yoke
#

are you sure this isn't running on the client? does your file return if isclient()?

#

you shouldn't be able to access player inventories from the server at all iirc

modern hamlet
#

its on server lua 😕

bronze yoke
#

server folder runs on both

#

you need to return if isclient() if you only want it to run on the server

true vault
small topaz
# atomic trout Im currently trying to make a little mod that changes zed's eyes to yellow so th...

you can just mimic the folder structure of the vanilla game and put your new textures into the respective folders. they will then overwrite the vanilla textures and it may be necessary to restart the game in order to enable/disable the mod. the location for your new textures should be yourMod/media/textures/Body. Make sure to give your new textures the same name as the vanilla zombie textures.

glass basalt
#

I'm making clothes for the first time, how do I handle GUIDs? where do I get them, do they have to be unique IDs?
Example of a GUID I have for an existing item
<m_GUID>5dfffb14-f9d4-4399-aada-8c671690fcd6</m_GUID>

boreal garnet
#

whoops, was not supposed to be a reply drunk

glass basalt
#

alright, what files

boreal garnet
tawdry solar
#

anyone else help?

glass basalt
tawdry solar
#

acc no

#

im going to sleep

#

ill deal with it later

glass basalt
#

good plan lol

tawdry solar
#

you fcould try to help me

#

i can post my code for you too see whats wrong if you would like

glass basalt
#

sure

tawdry solar
#

ty

#
module Base
  {
        imports
        {
             Base
}
    item Bolo
    {
        MaxRange    =    1.23,
        WeaponSprite    =    Bolo,
        MinAngle    =    0.7,
        Type    =    Weapon,
        SwingSound = MacheteSwing,
        HitFloorSound    =    MacheteHit,
        ImpactSound    =    MacheteHit,
        DoorHitSound = MacheteHit,
        HitSound    =    MacheteHit,
        MinimumSwingTime    =    4,
        KnockBackOnNoDeath    =    FALSE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    LongBlade,
        ConditionLowerChanceOneIn    =    25,
        Weight    =    2,
        SplatNumber    =    2,
        PushBackMod    =    0.3,
        SubCategory    =    Swinging,
        ConditionMax    =    13,
        MaxHitCount    =    2,
        DoorDamage    =    10,
        SwingAnim    =    Bat,
        DisplayName    =    Machete,
        MinRange    =    0.61,
        SwingTime    =    4,
        KnockdownMod    =    2,
        SplatBloodOnNoDeath    =    TRUE,
        Icon    =    Dudclub,
        TreeDamage  =   10,
        CriticalChance    =    20,
        CritDmgMultiplier = 5,
        MinDamage    =    2,
        MaxDamage    =    3,
        BaseSpeed = 1,
        WeaponLength = 0.3,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        AttachmentType = BigBlade,
        Tags = CutPlant,
        DoorHitSound = MacheteHit,
        HitSound = MacheteHit,
        HitFloorSound = MacheteHit,
        BreakSound  =   MacheteBreak,
        SwingSound = MacheteSwing,
     }


        model Bolo
                {
                mesh = weapons/1handed/Bolo,
    
                attachment world
                {
                offset = 0.0000 -0.1660 0.0070,
                        rotate = -180.0000 0.0000 0.0000,
                }
            }
}
glass basalt
glass basalt
#

sorry my response took a while - my mod isn't working either 😂

glass basalt
#

to confirm: Events.OnGameStart IS client-side, right? My mod is no longer multiplayer compatible for some reason, and I have been using this event the whole time

bronze yoke
#

it's client-side

glass basalt
#

I am a fat moron: I changed my mod ID and couldn't figure out why nothing was happening (it wasn't even enabled correctly)

#

it's always the stupid stuff

red tiger
#

Just finished walking through every vanilla script file with my syntax highlighting WIP extension.

#

=)

#

A couple changes and I consider it to be in basic working order.

fast galleon
#

I noticed a weird thing, I remove the "BlocksPlacement" from a sprite from Lua but the square still gets that. Using f2, the flag is no longer on the object... I tried searching for anything that would add that but see nothing, weird. Object is campfire if it makes any difference.

red tiger
#

I'd like to use the slice-of-pie icon for my ZedScript extension for VSCode.

#

No rights to though. =/

glass basalt
#

could someone PLEASE upload this to Imgur? it refuses to upload for me for some reason
Let me know if you are experiencing the same issue

#

God bless you man. Thank you so much

#

ill even credit you in my mod description. this was such a PITA

#

you sure?

#

okay. Thank you again

rancid panther
#

@glass basalthey are you free to help me with adding sandbox settings to my mod?

glass basalt
rancid panther
#

here is fine if ur okay with that

glass basalt
#

okay

#

God dammit, now my update is giving me error code 2

#

@rancid panther are you familiar with how to add new sandbox optipns? or completely unfamiliar

rancid panther
#

i've seen other mods that add it but im not sure how to do it

#

all i know is there's a sandbox file and you use SandboxVars.blablabla

glass basalt
glass basalt
#

that is the hardcoded file

rancid panther
#

i have

glass basalt
#

alright, now what kind of options do you want? a boolean checkbox, an integer / float / string input?

rancid panther
#

so this is what im trying to do rn but im not sure if im doing it right

glass basalt
#

you are missing a line on top

#

let me find it, one second

bronze yoke
#

i don't think you can use lua style comments

weak sierra
rancid panther
#

oh okay

bronze yoke
#

java style only iirc

weak sierra
#

has to be the regular PNG format

#

no wonky shit

glass basalt
#

they should be... ill check again

rancid panther
#

i have those in the translation files that didnt have any issues

weak sierra
#

translation files are lua

rancid panther
#

but should i remove those as well to be safe?

weak sierra
#

that's zedscript

rancid panther
#

oh okay

glass basalt
#

it would be better to simply not use them

weak sierra
#

zedscript uses /* comment */

rancid panther
#

i'll just keep them out then thanks

glass basalt
rancid panther
#

at the very very top or after the {

glass basalt
#

here is an example of my option

option InsurgentLUVVehicleConditionMin = {
    type = integer, 
    min = 1,
    max = 100,
    default = 1,
    page = Vehicle,
    translation = Vehicle_InsurgentLUVVehicleConditionMin,
}
glass basalt
rancid panther
#

ok

glass basalt
rancid panther
#

this is what it looks like now

glass basalt
#

presto. although you could have it spaced the way it was previously 🤗

#

doesn't matter much

rancid panther
#

i like ur way better

bronze yoke
#

missing comma on first line

glass basalt
#

oh yeah lol

rancid panther
#

Version = 1,?

glass basalt
#

yes

rancid panther
#

kk

red tiger
#

I think I'm going to settle with what I have.

rancid panther
#

okay and now in the actual lua file im using it

#

does this make sense?

glass basalt
#

now, to call the option as it is, use SandboxVars.TomaroSOAT.ImmuneChance
this should give you a double (which is an integer for Lua)
there is also a more verbose way of finding the sandbox variable, but this is newer and cleaner

#

yes

#

also make sure TomaroSOAT is defined

#

unless it is not important... i don't use objects for the sandbox options

rancid panther
#

sorry i dont know what you mean

#

where do i call it as is?

#

the way i already have it? or somewhere else?

glass basalt
#

make sure the game knows what TomaroSOAT is
add at the top of the Lua file TomaroSOAT = TomaroSOAT or {} to inherit or instantiate the object

bronze yoke
#

it doesn't need to be defined

glass basalt
#

it doesn't? okay good, nvm

bronze yoke
#

the sandbox option parser creates those tables

rancid panther
#

i see

#

and how is this translation?

#

i dont understand why it uses underscores now but another mod i looked at used underscores here

bronze yoke
glass basalt
rancid panther
#

oh it does?

glass basalt
rancid panther
#

other mods with sandbox options sometimes dont say the default tho

glass basalt
#

they don't say them if the option is not an integer or float type

#

you have an integer for immunechance

rancid panther
#

okay thanks

bronze yoke
#

lua doesn't have an integer type, it just has number, which is a double

glass basalt
#

yeah

rancid panther
#

so when i say ZombRand 100 doesnt that actually technically mean 101 because 0 counts?

glass basalt
#

yeah, you need ZombRand(101) to get a number between 0 and 100

rancid panther
#

i thought it is 99 because if you have 0 it will count too

glass basalt
#

it is exclusive

#

you can do ZombRand(1, 101) to include 1 and exclude 101, for 1 to 100

rancid panther
#

cuz before i had it as ZombRand(20) <= 0

#

i see

#

i'll do that then

#

but then would it cause issues if someone typed 0 in sandbox?

glass basalt
#

that is what min and max are for

bronze yoke
#

it wouldn't, it would just never be true, which is what they would want anyway

glass basalt
#

hmm, that too

bronze yoke
#

although i guess they probably wouldn't use an immune mod if they wanted a 0% chance of being immune

rancid panther
#

cuz i want an option to have 0% chance since im using it in my own mod that has other features

glass basalt
#

it could be used for not having a random chance to gain immunity, but have the option of being immune from the trait

rancid panther
#

which is mostly just professions and traits

glass basalt
#

unless the mod works differently from what i recall

rancid panther
#

the standalone mod is just the immune chance with testing for immunity, but the one i havent uploaded has the selectable trait as well as immune chance

#

so if you make it 1-101 it actually means 1-100, and leaving 0 as an option in sandbox will still work?

glass basalt
#

depends on where you're leaving 0

#

what does the sandbox option do

rancid panther
#

im testing it rn if there is any errors if i have 0

#
elseif ZombRand(1, 101) <= immunechance then
            testData.testStatus = "untested"
            testData.immune = true
glass basalt
#

if ZombRand(1,101) <= 0, then ZombRand will always be false since it is > 0, so the sandbox option would work if set to zero

rancid panther
#

immunechance is the sandbox option

#

well it works now! thanks!

#

could you also help me properly add translations for when i want the player to say something?

#

i still havent even started on improving the testing method

glass basalt
#

the getText() method will work best

#

you specify a parameter as a string the name of the variable in a Translation file somewhere, and it'll get the actual string

#

which translation file, idk

#

ill look

#

in IGUI_EN.txt add a line similar to IGUI_PlayerText_MyText = "I am saying something",

rancid panther
#

okay so it uses IGUI_EN?

glass basalt
#

then in the Lua, do playerObj:Say(getText("IGUI_PlayerText_MyText"))

#

maybe, maybe not

#

i don't think it actually matters

rancid panther
#

i tried using getText before but it didnt work probably due to where i was defining the translations

#

i was using the same file as where i had the trait translations

glass basalt
#

where were the translations

rancid panther
#

UI_EN

glass basalt
#

hmm

rancid panther
#

i'll try IGUI_EN

bronze yoke
#

it does matter

#

it's hardcoded to a misleading degree

glass basalt
#

sasuga indie stone-san

glass basalt
rancid panther
#

where can i see how to make a crafting recipe?

#

im making a temporary crafting recipe as a replacement of my old testing system

which im gonna eventually replace for a health panel version of a bite inspection instead of using a recipe

#

nvm

glass basalt
#

you can take a look at how mods like Replace Bandage add options to the health panel, instead of a recipe

#

at most you will need a timed action but they are relatively easy

rancid panther
#

i saw it but it was overwhelming. im gonna need help if i wanna do that too

glass basalt
#

it should just be a context menu injector, but I have not looked at it

rancid panther
#

the replace bandage mod has hundreds of lines, and i cant find anyone else really asking questions about modding the health panel in this server that i can use for reference

#

it seems like it is a lot more work than most ppl are willing to do so they just prefer to make a normal crafting recipe

#

my playertext translations didnt seem to work

#

it must be something else then

dark wedge
#

Got some new flashlight masks to fix the clipping and direction when aiming. Also some new poses for when you are more skilled, or just want it.

wide oar
#

these are the worst UV's i've ever seen

rancid panther
#

what are the possible options for AnimNode in recipe scripts?

dark wedge
#

But you could do like:
AnimNode:Dig
AnimNode:TakePills
Should work.

rancid panther
#

thanks

wooden lodge
#
item KaeldorMushroomPowder
    {
        BoredomChange            = -50,
        UnhappyChange            = -10,
        StressChange            = -10,
        EnduranceChange            = +100,
        HungerChange = +20,
        ThirstChange = +20,
        Weight                = 0.2,
        Type                = Food,
        DisplayName            = Mushroom Powder,
        DisplayCategory = Food,
        Type = Food,
        Icon                = MushroomBaggy,
        Tooltip                = That stuff will make sure you're not going to sleep tonight.,
        CantBeFrozen            = TRUE,
    }

Any reason this can't be eaten ingame?

#
item KaeldorStrawberryPowder
    {
        BoredomChange            = -10,
        UnhappyChange            = -10,
        StressChange            = -10,
        EnduranceChange            = +30,
        HungerChange = +10,
        Weight                = 0.2,
        Type                = Food,
        DisplayName            = Strawberry Powder,
        Type = Food,
        DisplayCategory = Food,
        Icon                = StrawberryBaggy,
        Tooltip                = A Strawberry Powder mixture to boost your endurance.,
        CantBeFrozen            = TRUE,
    }

Same with this

#

They show up but you can't right clic kand eat it

#
item KaeldorCornPowder
    {
        BoredomChange            = -10,
        UnhappyChange            = -10,
        StressChange            = -10,
        HungerChange = -30,
        ThirstChange = +10,
        Weight                = 0.2,
        Type                = Food,
        DisplayName            = Corn Powder,
        DisplayCategory = Food,
        Type = Food,
        Icon                = CornBaggy,
        Tooltip                = A Corn Powder mixture to fill your stomach.,
        CantBeFrozen            = TRUE,
    }

This one on the other hand works fine

wooden lodge
#

Does Hunger have to be a negative value or what am I missing

jaunty marten
rancid panther
#

i think changing the testing/inspection system will be the last major thing before i can officially consider my mod complete

wooden lodge
#

You simply can't eat it at all

ancient grail
jaunty marten
wooden lodge
#

I can't find it and it doesn't make sense looking at it at all

rancid panther
#

try making thirst go down by 1

#

maybe it requires at least one of them to be negative

#

as long as it is in the food category

jaunty marten
rancid panther
#

could be that too

wooden lodge
#

Ohhhhhhhhhhhhhhhhhhhhhhhhh

#

I will try that

jaunty marten
#

btw it shouldn't be a issue but u have two Type variable in ur item

rancid panther
#

tell us if removing the plus works out for uu

ancient grail
#

Looks like it worked cuz he didnt came back

rancid panther
#

lol

hot patrol
#

Any chainsaw man stuff? zzPowerSmile

chrome egret
#

Good morning, all

#

I think I solved my item transfer bug C:

fast galleon
chrome egret
#

There is a server component to this, but since I can't get those logs or truly debug it I avoided really speaking on that.

sour island
#

Server logs are named co-op console -- unless there's something else that logs/it doesn't have what you want

chrome egret
#

The receiveOnServer method is logging at trace level

#

per Aiteron, you can't get that level of logging

#

or at least we can't without doing Java recompilation shenanigans to which I'm not willing to resort 😄

#

Perhaps someone here could shed some light, though. I fear I'm missing something obvious about Safehouses

#

I've connected to my dedicated server with an admin, a client, and now two clients. In none do I see any option to create or designate a Safehouse.

#

Does it have to be something other than a residential house?

frank elbow
# tawdry solar didnt fix it

Have you added the item to any distribution tables? Have you checked whether you can spawn it in debug mode with the items list?

frank lintel
#

ah how I wish I had ban powers in some discord servers

winter coral
#

yo does anyone know what this means when making a script for clothing
"<m_Masks>13</m_Masks>
<m_Masks>14</m_Masks>
<m_Masks>3</m_Masks>
<m_Masks>5</m_Masks>"

red tiger
frank lintel
#

well got plebs asking if 'something' works with a broken copy of their game lets just leave it at that.

red tiger
#

ok.

#

I have one outstanding issue with my syntax highlighter.

frank lintel
#

o.O

red tiger
#

It's for an oddly formatted copy of sandbox-options.txt.

#

Multi-property lines.

frank lintel
#

ugh

red tiger
#

That shouldn't be aqua in there. =)

#

This is the normally formatted version.

frank lintel
#

so why there different formats?

red tiger
#

Other than that, every vanilla file works properly.

frank lintel
#

age when it was made?

red tiger
#

I work with Regex to produce highlighting in VSCode.

#

I'm asking myself if I should try to make my highlighting work with that formatting.

frank lintel
#

yeah I get that but ya got one working one not just wondering why the diff they both listing same version # so...

red tiger
#

I modified the first screenshot to adhere to the formatting of the vanilla files.

#

I can publish this extension in its current form.

#

What I'm openly asking is if I should support that odd format of the same file.

frank lintel
#

if thats not std. to me... nope.

#

that be like supporting depreciated stuff 5 major versions later...

red tiger
#

The code would run all the same in that spacing in PZ.

#

Hmm ok.

#

I can always leave that up to future me or someone to try to make my syntax Regex stronger.

frank lintel
#

I see it more of odds... how much do you think that odd version going to be seen is it worth the time... can you make an exception for it to catch that etc etc. just weigh it out.

red tiger
#

Not with highlighting no.

#

While TextMate Grammars uses recursive JSON API, it is ran 100% through Regex.

#

I plan to write a formatter and an IntelliSense component to the extension.

#

The formatter will format close to the vanilla file formats.

#

The IntelliSense component will be by far the most helpful component.

#

Property-specific logic can be implemented with IntelliSense where it will tell you: "Hey, this is the wrong value for this property".

frank lintel
#

well Im no fan of IS so cant help ya on opinion there

red tiger
#

IS?

#

What's that?

#

Oh

frank lintel
#

IntelliSense so I dont ....

#

lol

red tiger
#

I'm a fan of it when it's actually modified to work with what I'm working on specifically.

#

Generic IntelliSense gets in the way.

frank lintel
#

you give me only a pulldown suggestion fine... closing my " ( if then adding in ends etc automatic which just make me type just as much having to move to another key to get to EOL etc.... no thanks ^_^

red tiger
#

.. And that's why I hate Visual Studio.

#

I know the syntax and flow.

#

VS is a nanny-state-driven editor.

frank lintel
#

🤣

red tiger
#

Look: I won't tell you to use VI or VIM.

frank lintel
#

why I do...

red tiger
#

VSCode is a great middle-ground for "some support" vs too much or too little.

frank lintel
#

literally my first editor I ever used was Vi lol on a vt100 to a at&t unix system

red tiger
#

VS is literally a giant trap to force their customers to use theme exclusively forever..

#

I'm the only programmer in my team that doesn't use Visual Studio to code.

#

They use those products.

#

I have to run it but I don't write in it.

frank lintel
#

I dont mind it Lua wise it sure the hell better at dependancies etc then IJ is.

#

but ewww on writing like you said.

red tiger
#

I w a n t to shit on Notepad++ users but they're doing it entirely for the same reasons, mostly.

#

It's just ugly. That's my severance to it. hahaha

#

It has every tool you need though.

frank lintel
#

why Im surprized no-one hasnt done anything for netbeans

red tiger
#

I thought NetBeans was dead.

#

I wrote in that when I was in school.

atomic trout
#

someone has time to sit with me in vc and walk me through this tiny texture mod im making pls?

tawdry solar
#

oh wait

#

i tried to spawn with debug

frank lintel
#

prob dunno workshop was too strict think that was the issue. but I mean we using a java lua not C lua...

cerulean rover
#

Is there a way to change the form of the chat? I am not saying to make it more invisible with the same configuration that it has, I am saying to be able to eliminate it completely and that only the text remains with the invisible background.

red tiger
#

Going to license my ZedScript VSCode extension as MIT so people in here and modders can improve on it without restrictions. =)

#

Tempted to use LGPL but it doesn't make sense for this project.

frank lintel
red tiger
#

Actually it's a good refresher.

#

New licenses pop up all the time.

frank lintel
#

Ive seen better pickers just dont know where cuz it been years

red tiger
#

Yeah..

#

I've spent days considering multiple licenses on projects, both small and big.

frank lintel
#

I cant even remember what I typically used looks like bsd changed alot

red tiger
#

Always remind people that they can license their works.. =)

#

I use MIT when I don't care about the uses of my work, even commercially.

frank lintel
red tiger
#

Just 1) Don't sue for damages and 2) Don't forget to credit.

frank lintel
#

think that sums up my lisc :P I just looked

#

bsd-3-clause whatever that name is

frank elbow
#

I usually go with MIT but I've been on the fence about what I want to use for mods. Haven't released any yet so still time to go hmmmm a billion more times

red tiger
dull moss
#

What was the way to make PZ generate random numbers? I remember it had some zrand() or something?

frank elbow
#

I like copyleft 🥺 I just don't know that it really works for mods

red tiger
#

I have PZ libraries licensed as LGPL too because I feel that ownership is important enough to keep from being anything used at an official capacity.

#

You cannot use anything strong as or stronger than GPL for PZ.

dull moss
#

public static double ZombRand(double double1)
double 1 is upper limit?

frank elbow
#

Mhm, exclusive [0, that number)

red tiger
dull moss
red tiger
#

Seriously. You can own any files you write from scratch, even Lua files that interfaces with the game. You can't force PZ to go open-source though.

#

You can't own a file that is modified or overwritten with code from that file.

#

Picking a license also means being compliant with that license or it is voided.

frank elbow
#

One of my current mods has some functions that were taken from the existing source & modified (for performance or other reasons)

#

I don't know where the line is for originality

red tiger
frank elbow
#

I wouldn't say they're modified files, that's the thing

red tiger
#

The relationship between those files and how they might interact will also need to be compliant with the license... which is why if you don't want to go through that then pick MIT or BSD.

frank elbow
#

It's very few instances of similar code so it's ambiguous

#

Might stick with MIT then, thanks

red tiger
#

Yeah. Thought I'd help provide insight into what might be good based on how much you are 1) Willing to support copyleft and 2) What you want others to do with your works.

tawdry solar
#

can anyone else help

tame mulch
tawdry solar
tame mulch
#

Or not spawn in world?

tawdry solar
#

i cant figure whats wrong with my code

red tiger
#

@tame mulch I'm going to publish my third-party VSCode extension today. =)

#

You see any screenshots?

tame mulch
red tiger
#

I will formally post information in the following days. I will also suggest support for the extension .zed.

frank elbow
#

Initial response: heck yeah, looks good
Louder part of my brain: WHY is the "v" in that font so small

keen silo
#

little update from my mod @abstract raptor and good news:

I just copied the entire RadioData.xml file and modified the values in my mod file, and it correctly loaded the changes to the tv

I'll try to generate the first audio for woodcraft and test how it works. Then, I'll try to automate the process with a script somehow

dull moss
# frank elbow Mhm, exclusive `[0, that number)`

so if my sbvar var is 1-100, this sounds about right to have % to trigger something, right?

    if player:HasTrait("RestorationExpert") then
        local chance = SBvars.RestorationExpertChance - 1;
        if ZombRand(100) < chance then
            self.item:setHaveBeenRepaired(self.item:getHaveBeenRepaired() - 1);
        end
    end
#

oh wait

#

should be <= I think

frank elbow
#

Is chance sbvar?

#

Oh, I missed the bit just to the right

dull moss
#

sbvar is [1-100]

frank elbow
#

ZombRand(100) is [0, 99], so < should be correct (i.e., a chance of 0 should never pass)

red tiger
#

@tame mulch If you get another itch to scratch for ZedScript documentation, perhaps you could help me with transcribing documentation with the extension as I enter the IntelliSense phase of the project.

dull moss
red tiger
#

Remember, you can always multiply a 0.0 -> 1.0 random value.

frank elbow
dull moss
#

y

frank elbow
#

<= should work then ya

dull moss
#

cheers

#

as a proper modder I won't test if it works and just ask ppl

#

Its fine I got 40k ppl to test it for me

frank elbow
#

I was listening to music, looking at something on my other screen, and whistling while answering

#

Put zero trust in me

red tiger
#

<3

dull moss
red tiger
#

Also, am I allowed to use the chery-pie icon for the extension? (To show when seeing the file in a directory listing or on the file tab)

#

I wouldn't know what I could use otherwise. :X

ancient grail
#

Im oretty sure you can. It is after all the default poster thing in the modtemplate

red tiger
#

I mean people do this with mod images.

#

Maybe I do..

#

Ugh.. If they ask me to remove it I can.

ancient grail
#

Ye .

red tiger
#

This is what two decades of modding has done to my brain. zombie

frank elbow
#

We give you a licence to ... Use art, music, video footage or other assets of Project Zomboid for creative purposes in any way you like providing the end result is related in some way to promoting Project Zomboid or The Indie Stone, is for non-commercial use only (unless we agreed otherwise with you) and states Project Zomboid as its influence and origin by supplying the following wording prominently with the assets:
“Thanks to The Indie Stone for creating Project Zomboid https://projectzomboid.com/), which made this possible. This is an unofficial fan production for non-commercial purposes made under the Indie Stone Terms [link to these terms]“
https://projectzomboid.com/blog/support/terms-conditions/

Here’s the scoop on what you're allowed to do, and what you’re not allowed to do, through the purchase and continuing use of our game, website and forums

#

Should be all good

red tiger
#

Yeah.. The default logo is used as an example banner.

ancient grail
winter coral
#

Thank you g

tawdry solar
tame mulch
tawdry solar
#

ha lar

#

ah alr

#

ill post it

#
module Base
  {
        imports
        {
             
}
    item Bolo
    {
        MaxRange    =    1.23,
        WeaponSprite    =    Bolo,
        MinAngle    =    0.7,
        Type    =    Weapon,
        SwingSound = MacheteSwing,
        HitFloorSound    =    MacheteHit,
        ImpactSound    =    MacheteHit,
        DoorHitSound = MacheteHit,
        HitSound    =    MacheteHit,
        MinimumSwingTime    =    4,
        KnockBackOnNoDeath    =    FALSE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    LongBlade,
        ConditionLowerChanceOneIn    =    25,
        Weight    =    2,
        SplatNumber    =    2,
        PushBackMod    =    0.3,
        SubCategory    =    Swinging,
        ConditionMax    =    13,
        MaxHitCount    =    2,
        DoorDamage    =    10,
        SwingAnim    =    Bat,
        DisplayName    =    Machete,
        MinRange    =    0.61,
        SwingTime    =    4,
        KnockdownMod    =    2,
        SplatBloodOnNoDeath    =    TRUE,
        Icon    =    Dudclub,
        TreeDamage  =   10,
        CriticalChance    =    20,
        CritDmgMultiplier = 5,
        MinDamage    =    2,
        MaxDamage    =    3,
        BaseSpeed = 1,
        WeaponLength = 0.3,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        AttachmentType = BigBlade,
        Tags = CutPlant,
        DoorHitSound = MacheteHit,
        HitSound = MacheteHit,
        HitFloorSound = MacheteHit,
        BreakSound  =   MacheteBreak,
        SwingSound = MacheteSwing,
     }


        model Bolo
                {
                mesh = weapons/1handed/Bolo,
    
                attachment world
                {
                offset = 0.0000 -0.1660 0.0070,
                        rotate = -180.0000 0.0000 0.0000,
                }
            }
}
ancient grail
#

Imports what?

tawdry solar
#

i was told to remove it

#

even before it didnt work

sour island
#

remove the entire {} block then

ancient grail
#

Cuz your module is Base

tawdry solar
#

modding hurts #

ancient grail
#

Tho afaik you still need to import.base? Not sure

ancient grail
sour island
#

You don't need to import it if the module is Base

tawdry solar
#

this is my other ojne

tawdry solar
sour island
#

I'm like 20% sure you can't define a model next to an item(?)

ancient grail
tawdry solar
#

the model isnt the issue

#

the item doesnt work

sour island
#

You have to be more descriptive lol

ancient grail
#

Yes

#

How exactly

#

Do you know it doesnt work?

tawdry solar
#

i cant explain

ancient grail
#

Can you see the model?

tawdry solar
#

as it just doesnt show ingame

#

no

#

the item doesnt sho

ancient grail
#

So its the model

tawdry solar
#

like in debug

#

i try to spawn it in

ancient grail
#

You mean item oicker

tawdry solar
#

and it isnt there

sour island
#

So it:
(A) is invisible
(B) has no model
(C) doesn't appear in the itemViewer

ancient grail
#

Picker*

tawdry solar
#

im using cheat menu

sour island
#

Fairly certain cheatMenu uses the vanilla itemViewer - but that's not important

tawdry solar
#

oh

sour island
#

If it's not showing up something is wrong with the script

ancient grail
#

type this on debug

getPlayer():getInventory():AddItem("Dudclub")

#

Lua console

tawdry solar
tawdry solar
ancient grail
#

So when aiteron asked for the script you showed us the working one?

tawdry solar
#

no

sour island
#

try removing imports {}

tawdry solar
#

thats the new one

ancient grail
#

Ahh ok

#

Sorry

#

My bad

tawdry solar
#

its fin

#

fine

sour island
#

For your working weapon, do you have item and model in the same file?

ancient grail
#

But yeah replace the name

#

With Bolo

#

Try it using lua console

ancient grail
#

Not sure why you thought it wont

sour island
#

Probably something I heard once

ancient grail
#

Tho 20¢

#

%

red tiger
#

The problem is that the files are .txt.

#

I don't think that it's a good idea to associate .txt with ZedScript automagically.

sour island
#

you could use .txt with specific names like the java does

#

as a stopgap

red tiger
ancient grail
sour island
#

that too

red tiger
#

B42 could fix this issue with a line of code.

ancient grail
#

Cuz we are looking for whats causing it not to spawn at all

sour island
#

Toss it up as a suggestion

tawdry solar
#

im really confused

ancient grail
#

But change the name

tawdry solar
#

but my item isnt dudclub

#

oh

ancient grail
#

To Bolo

ancient grail
red tiger
#
else if (!var1.endsWith(".txt")) {
    DebugLog.Script.warn(" file is not a .txt (script) file: " + var1);
}
else if (!var1.endsWith(".txt") && !var1.endsWith(".zed")) {
    DebugLog.Script.warn(" file is not a .txt or .zed (ZedScript) file: " + var1);
}
#

@tame mulch 🥺

#

Fixes so many issues.

#

If I have to write a suggestion on the forums I will.

sour island
#

You should, and also include a writeup of the whole zedscript concept

tawdry solar
#

it kinda worked @ancient grail

#

it gave me an item called machete

#

the models kinda fucked too

red tiger
tawdry solar
red tiger
#

I'm about to write another paper on a draft for a preprocessing language to ZedScript.

sour island
#
    item Bolo
    {
     ...
        DisplayName    =    Machete,
tawdry solar
#

hm?

sour island
#

That's what you named it @tawdry solar

tawdry solar
#

oh right

#

thanks

frank elbow
sour island
#

Those are kind of sort of not scripts

red tiger
sour island
#

It's to work around enums

frank elbow
#

They use the same parser

tawdry solar
#

now i just need to fix my model

sour island
#

fair

tawdry solar
#

its a strange thing though

#

its the same size as the pz machete

frank elbow
ancient grail
#

getType()

sour island
#

he spawned it using the type

ancient grail
#

didnt know it looks for the DisplayName?

sour island
#

and complained it was named machete

ancient grail
#

ahh

#

i see

red tiger
sour island
#

meanwhile the script is just crying in confusion

red tiger
#

I think all ZedScript files should contain a version flag.

ancient grail
#

so it works there now you have spawned the item you needed thats your item 🙂 goodluck fixing the model you can ask #modeling

#

@tawdry solar

tawdry solar
#

i did

frank elbow
#

Yeah, BBCode (well, the whole file is not really BBCode, just the description values)

red tiger
#

Oh wait yeah lol

#

I didn't know about sandbox-options.txt until someone pointed that out.

frank elbow
#

I'm still curious about what the skill one is

red tiger
#

Same.

frank elbow
#

Might take a peek at some mod that adds skills to see

#

It's perks.txt

red tiger
frank elbow
#

Credit to https://steamcommunity.com/sharedfiles/filedetails/?id=2721945297 for letting me peek 😉 here:

VERSION = 1,

perk Miscellaneous
{
    parent = None,
    translation = Miscellaneous,
    passive = false,
    xp1 = 0,
    xp2 = 0,
    xp3 = 0,
    xp4 = 0,
    xp5 = 0,
    xp6 = 0,
    xp7 = 0,
    xp8 = 0,
    xp9 = 0,
    xp10 = 0,
}

perk Driving
{
    parent = Miscellaneous,
    translation = Driving,
    passive = false,
    xp1 = 50,
    xp2 = 100,
    xp3 = 200,
    xp4 = 500,
    xp5 = 1000,
    xp6 = 2000,
    xp7 = 3000,
    xp8 = 4000,
    xp9 = 5000,
    xp10 = 6000,
}
red tiger
#

Writing support for it right now.

frank elbow
#

Like sandbox-options, VERSION is required and must be 1 (as of now). If only that applied to the other scripts

sour island
#

Anyone know of a way to confirm remote co-op players are the same steamID?

#

I presume not as it's relying on the split-screen tech

red tiger
#

@frank elbow

#

All I had to do for the syntax highlighter is add perk to the list of types.

frank elbow
#

Neat, looking forward to looking over the source 😄

red tiger
#

Going to probably scrap the TextMate Grammars file I spent around two weeks working on and move to a Language Service.

#

It's here though. I'll publish this one so people have something in the meantime.

red tiger
#

Hmm

#

I think I need to add a picture for the extension.

#

Supposed to be a dead eye but themed for my org.

#

There we go. Happy.

#

My personal, unofficial icon for an unnoficial script name. xD

#

It's live on VSCode. <3

#

Time for lunch.

keen silo
#

Update 2 of my Voiced TVs and Radios mod.

I managed to voice the first woodcraft episode of day 0 at 12:00

This is the audio I made using ElevenLabs premade/sam and some editing to add the hammer sounds.

The audio works and plays perfectly (aparentyl .wav doesn't work, but .ogg does 🤷‍♂️ ), but I have some problems @abstract raptor.

The first problem is that the tags appear and fade away way too fast. Here is the modified xml with time tags:

${t:1.15}Y'all are watching Woodcraft!
${t:2.05}Your one stop shop for home improvement!
${t:1.19}We're startin' with the basics.
${t:1.20}The kinda stuff they teach at kindergarten.
${t:2.10}You like floors? I like floors.
${t:1.21}Take a plank and a nail like this...
${t:1.09}Take your hammer and...
${t:0.23}bang bang
${t:1.20}Looks kinda nice like that huh?
${t:0.23}bang bang
${t:1.22}Know what else is good for practice?
${t:2.03}A sign. Write whatever you like.
${t:1.01}Hunk at work, maybe?
${t:0.23}bang bang
${t:2.11}Like that ladies? Leadin' y'all straight to me!
${t:1.23}Tomorrow we're takin' off the training wheels.
${t:1.09}Door frames here we come!

I assumed the t: is in seconds, so i used the time the clips lasted in the editor for them. Am I missing something?

abstract raptor
#

t: is in seconds yes

keen silo
#

do I have to add some number to ofset the fadeaway? it is way too quick

abstract raptor
#

well some of those are only playing for like a fraction of a second so that makes sense

sour island
#

I messed with eleven labs a bit, you can actually supply different voices as samples to get a hybrid

abstract raptor
#

I cloned my voice with Eleven Labs ha

#

i pay for it too, made some ads for my friends business

#

I wouldn't think to voice the radio with the voice clones but meh

bronze yoke
#

when i was writing my radio stuff i didn't see any way to alter the fade time whatsoever

#

i might have missed something, but it seemed like the related methods had a set time they would show messages, and the only thing you could change was the timing that the messages appear

sour island
keen silo
#

I just crunched the numbers and it adds up to 20 seconds instead of 29, so perhaps I wrote some numbers wrong

sour island
#

When you stumble into the guy 3 years into the apoc acting out his tv show in the dead studio

abstract raptor
keen silo
#

im using Wondershare, but I dont know what mistake Im making, every time I add the times i get it wrong

#

for like, 5 seconds

#

oooooooooo

#

i just realized

#

I dont know who made this, but he is evil

#

check the times of the table. it goes 0.0 0.05 0.1 0.15 0.2 1.0

abstract raptor
#

just use audacity lol

#

it's free

#

and doesn't snap like that

keen silo
#

so the decimal point is not in seconds, it is in cuarter of seconds

abstract raptor
#

maybe there's a preference you can change?

keen silo
#

alright, after fixing the decimal point, now it adds to 29.6 seconds, im gonna check it again

#

It would be nice to have a woodcraft jingle to add at the end, but I don't know audio editing enough to make it, and I don't believe I can get Eleven Labs to sing Wood... Craft!

chrome egret
craggy furnace
#

ive already done it

#

you tweak the sliders to the left

#

they will just have very little tune so dont waste your time

ancient grail
#

Ei yo shark

keen silo
#

Alright, Here I have a working demo of the first episode of woodcraft voiced. I'll start to work on a automation script for this project. Otherwise, I might go insane 😛

Thanks @abstract raptor for the framework. Is there a way to not get my character drunk when watching the show? Because of how it is made, it seems to increase the drunkenness

abstract raptor
#

IT just says it increases drunkeness

#

it doesn't actually

#

cuz it's disabled

keen silo
#

great

tardy wren
#

okay, my mod is... well, having a bad day

#

This thing executes just fine on a server. But on a client, it has a stroke when I call the anyKnifeProxy

#

It's in the shared folder...

bronze yoke
#

server folder isn't loaded until some time after ongameboot for some reason, so the Recipe table doesn't exist yet

tardy wren
#

Oh

#

Then why does it trip after calling the functions from it several times?

#

Eh whatever. I'll try onInitGlobalModData

tardy wren
bronze yoke
#

not really sure! but i ran into the same issue with ongameboot

tardy wren
#

Okay

#

I figured it may have something to do with difference in file load order between server and client...

bronze yoke
#

i think the event must fire after server lua is loaded instead of before on servers

tardy wren
#

I'm still surprised that modifying the array works

#

When trying to remove an item out of the array didn't before

bronze yoke
#

that should actually work

#

arrays should always be passed by reference as far as i know

tardy wren
#

Unless I was doing it wrong all that time and I could've saved myself all of this nonsense

#

okay, no, remove() does work by index

ancient grail
tardy wren
#

YES

#

It finally works, holy shit

glass basalt
red tiger
#

Improving some stuff ATM based on feedback.

glass basalt
#

Jab, what else would I need to get syntax highlighting for PZ's Kahlua?

red tiger
#

(Rich Text Editor)

glass basalt
#

Hmmm, I meant documenting the Java methods from PZ in Lua

red tiger
#

Only things I can offer are looking up EmyLua, PipeWrench (My stuff), or that prototype for PipeWrench for third-party documenting.

opal nest
#

Trying to make it so I can craft a new bottle into a smashed bottle, ive added a new recipe that names the new type but when its in game the option doesnt appear, anyone know what could be the cause?

glass basalt
#

Alright, cheers Jab 🍺

red tiger
#

Oh BTW are there modders who want me to complete all ZedScript UML diagrams?

#

Here's the Vehicle category.

opal nest
#

There's no errors in the console

red tiger
#

More debugging. yaaaay.

#

xD

sour island
#

If you can get vehicle scripting to be less of a headache that would be great lol

#

I spent like a hour trying to figure out how to get templates to work as I expected

red tiger