#mod_development

1 messages ยท Page 122 of 1

ancient grail
#

aside from not being dark mode i dont see anything else wrong with it

nova socket
cunning kestrel
#

shout out and thank you to @ancient grail and @sour island for the continued support ! โค๏ธ (and the others ive missed ofc)

#

Anyone know how to have the character twoHand an item ... I have him equip a barbell as 2 handed, they fill both slots. but in my custom animation he still has it linked to 1 hand only...

faint jewel
#

it will only like to the main hand if you set it to 2 handed.

#

you have to make sure the animation uses the item right\

cunning kestrel
faint jewel
#

yeah joyfully so .

#

lol

quick sandal
#

Do any of y'all know how one might increase the hair growth speed?

faint jewel
#

i would LOVE for you to be able to actually attach items to hands.but it dont do that

quick sandal
#

Wondering where I could find the code for it

cunning kestrel
faint jewel
#

lol it sucks. sooo bad.

#

kinda why i am taking a break from the carry mod.

#

that and it's down to things that would be quite difficult to redo.

pulsar heath
#

is it wrong when i know why something doesnt work but stall for time to charge more because the guy is a douche who thinks he knows everything?

#

๐Ÿ˜„

#

specially when he makes me work on the weekend ...

#

tbh im following the procedures he told me to be the reason of the problem... which they arent

cunning kestrel
#

Hi @pulsar heath , i think this should help you out ๐Ÿ˜‰

If (customer.IsDouche) 
  bill.rate = bill.rate * 1.5:
End
pulsar heath
#

๐Ÿ˜„

pulsar heath
#

its an app, to manage subs in a media group i made like 10 years ago

#

was hired by my "replacement" after i left the company

cunning kestrel
#

xD wow , kinda funny

pulsar heath
#

i tend not to stay more than 4 years in the same place

#

it gets boring and i dont like boring stuff

thick karma
#

Got so tedious

#

Felt like the equivalent of needing to reset joypad focus every time I press a button on joypad

pulsar heath
#

talking about tedious... still need to finish the GUI for the integration app

#

the code is done... but the gui... i hate coding gui's

faint jewel
#

the IK animations thing... i just attached the hands to the item.

thick karma
#

If implementing gamepad support were as unnecessarily tedious as animating weapon motions, I never would've bothered lol

faint jewel
#

i know it's not GOOD, but it worked.

pulsar heath
#

@faint jewel if aint broken and works, just leave it alone ๐Ÿ˜„

#

good is subjective

faint jewel
#

lol i know. the postal truck has the GOOFIEST error.

cunning kestrel
faint jewel
#

and i can't figure out what it is.

pulsar heath
pulsar heath
faint jewel
#

well lemme make a video.

pulsar heath
#

looool

#

wtf...

faint jewel
#

YUP

pulsar heath
#

trying to think of a reason why that happens

#

but makes no sense

faint jewel
#

welcome to MY hell.

sour island
#

Try it with another car?

faint jewel
#

the only other one with a working window roll down is the ecto 1

#

and it works fine

pulsar heath
#

so the problem is on the car object itself

sour island
#

perhaps the script for the mail truck

pulsar heath
#

have you tried with only vanila cars?

faint jewel
#

the scripting is identical

#

it was actually really basic to do.

cunning kestrel
#

ah looks fun

quasi kernel
pulsar heath
#

hmmm the state of the window is overwritting the state of the door

faint jewel
#

what makes no sense is why is just says screw this and changes what animation is used

#

but ONLY if you exit the vehicle with the window down

sour island
pulsar heath
#

hmm through some checks for the door state and window state

sour island
#

grabbing the provided params and changing the text provided to include the coroutine stack

pulsar heath
#

and see what you get

sour island
#

which is how the base game gets info for stack traces - how it shows file names, functions and lines

pulsar heath
#

the most logical thing i see is that when the window is open the door object that contains the window becomes the window

sour island
#

technically finger print could include file name too - but I thought that'd make it less readable

quasi kernel
#

The coroutine stack is what I'm interested in, I need to be able to get a mod name from the currently running file.

#

Well, running context moreso.

sour island
#

that's what this does

quasi kernel
#

Is there anything I'd need to do to fetch the mod name specifically or is it just a few code edits?

#

Like I don't mind any of the other data

#

Only interested in the mod name.

#

Assuming it'll even work for what I'm thinking about doing-

cunning kestrel
#

well almost xD

quasi kernel
sour island
# quasi kernel Assuming it'll even work for what I'm thinking about doing-
    local coroutine = getCurrentCoroutine()
    local count = getCallframeTop(coroutine)
    local modID
    for i= count - 1, 0, -1 do
        local o = getCoroutineCallframeStack(coroutine,i)
        if o ~= nil then
            local modFileFunctionLine = KahluaUtil.rawTostring2(o)
            if modFileFunctionLine then
                local modFile = modFileFunctionLine:match(".* | MOD: (.*)")
                if modFile and modFile~="<THIS VERY MOD>" then
                    modID = modFile
                end
            end
        end
    end

This is what I do for finger print

faint jewel
#

getting it to line up in the main hand is the thing. then it's just make the offhand follow.

sour island
#

inserting this into a function should call on the call stack

pulsar heath
#

@faint jewel make a print to the console everytime you open the door with the result for getPassengerDoor findWindow isopen

#

maybe that will give a clue of why it happens

sour island
#

this only returns the last modID though

#

and ignores the last one which is fingerPrint

faint jewel
#

it has NO lua.

pulsar heath
#

only scripting?

quasi kernel
#

I do have a question, though. What mod do you figure it would read from in a metatable context?

pulsar heath
#

you should add some lua to track the issues at least

#

and i think youll probably need to use some lua code to prevent that from happening

sour island
#

I used the decompiled code and looking around how the f11 screen works

faint jewel
#

vehicle mods only need lua for distribution.

quasi kernel
#

I'm wanting to convert farmingconf.props and similar tables into metatables so I can "hook in" when data is added / changed.

#

Idea behind it is I can automate scraping data from farming mods and just cram it all into one large data set.

sour island
#

oh

pulsar heath
#

do you have the mod on the workshop already? ill have a look and mess around with lua to try and figure out whats happening and maybe provide a fix using lua

faint jewel
#

it is not yet

pulsar heath
#

can you zip it and send it to me?

quasi kernel
#

I need to know what mod the specific run context is in though, because otherwise I'm unsure if this'll work.

pulsar heath
#

lunch break i can have some fun trying to help you

quasi kernel
#

Unless there's some fancy way to determine what the currently loading mod is.

#

This is only needed on initial startup when the mods are loading, nothing else.

sour island
#

You need to confirm the loading mod is a specific mod?

pulsar heath
#

im lazy detecting running mods... i do it the bad way and look for a global the mod creates

quasi kernel
#

I need to try and dynamically determine what mod is currently changing the table data so I can assign it a place in the dictionary appropriately

pulsar heath
#

there is always a global somwhere ๐Ÿ˜„

#

thats what i did with my stats mod... to check if killcount is installed and enabled

sour island
#
        @LuaMethod(
            name = "toggleModActive",
            global = true
        )
        public static void toggleModActive(ChooseGameInfo.Mod var0, boolean var1) {
            String var2 = var0.getDir();
            if (!StringUtils.isNullOrWhitespace(var0.getId())) {
                var2 = var0.getId();
            }

            ActiveMods.getById("default").setModActive(var2, var1);
        }
pulsar heath
#

and it runs fine... and dynamicly changes the dataset used in the stats if the mod is loaded

sour island
#

There's this exposed global function

#

You could decorate this

quasi kernel
sour island
#

I would assume the UI calls on it

quasi kernel
#

Only thing is, would this be a problem in multiplayer?

sour island
#

What exactly are you trying to do?

pulsar heath
#

dont think so, since the player is forced to use the same mods the server has

quasi kernel
#

I need to detect changing to farmingconf.props / sprites and the like to try and "preserve" data in between farming mods.

#

The problem is that farming mods like Soul Filchers and Mo Crops implement the same crops.

sour island
#

I feel like we've spoken about this ...

quasi kernel
#

They overwrite each other's data.

#

We may have, though my memory is foggy.

sour island
#

This is for item scripts I presume?

quasi kernel
#

You mean item scripts as in the funny item creation via the scripts folder stuff?

sour island
#

I mean, the crops being overwritten and the issue lies in items behaving funny?

quasi kernel
#

The items technically work fine, I found a solution to that in my patch.

#

It just overwrites the seed data too when it changed crop data.

#

..which means you can get seeds for a crop you can't plant with said seeds.

#

This was addressed by associating different seeds with the same end crop in manual data entry, but I want to get away from that method if at all possible.

sour island
#

I'm not familiar enough with the farming system to know how seeds work - I would presume the seed items have an intended plant in script? or does it just operate off name?

quasi kernel
#

More like the plants have an intended seed.

#

Farming data has a seed name variable that it relies on.

#

The actual item itself isn't that interesting.

#

I could plant freaking dog leashes for all I care, as long as the plant requires it.

sour island
#

What file are these crop seed definitions?

quasi kernel
#

farmingconf.lua I think?

#

Something along those lines.

#

I'm not at my computer at this exact moment but I can get on if need be

#

It could be vegetableconf

#

I just know it's something like that on the server side.

sour island
#
farming_vegetableconf.props["Strawberry plant"].vegetableName = "farming.Strewberrie";
farming_vegetableconf.props["Strawberry plant"].seedName = "farming.StrewberrieSeed";
#

so each mod does this?

quasi kernel
#

Yeup

#

Problem comes up if they both do.. say..

#

["Corn"]

#

Like SF and MCM do

sour island
#

You could create a function with a require for each mod

#

setting the target as a require

quasi kernel
#

I thought about that, only issue I have with it is getting people to actually follow instructions.

#

Oop wait nvn

#

You changed the funny text

sour island
#

No i mean, in your lua I think

require soul's
store information from list

require mo farm
store information for list

quasi kernel
#

I don't think that would address the issue unfortunately.

#

They're all running off the same table and the data is stored exclusively in the table.

#

Once the data is overwritten - likely from load order or something similar between farming mods - it's gone.

#

Unless each individual farming mod made global stuff for me to use, which would be agonizing to set up with everyone, it isn't possible.

sour island
#

If you can get your mod to load first using !

#

you could use requires to handhold the load order

quasi kernel
#

Abusing requires, I like it!

sour island
#

Unless I'm not caffeinated enough

quasi kernel
#

It sounds like it would work in theory

#

Still easier than manual data entry

#

That solves the mod origin issue too

sour island
#

this was for the patch project right?

quasi kernel
#

Mhm!

sour island
#

snake, soul, mo farm?

quasi kernel
#

More than that now-

#

4K+ lines of manual data entry. Not doing more of it.

#

Snake, Soul, Mo Farm, GMH, More common seed types, That's it, I'm weaving, Xnertot, Farming Coffee, etc

sour island
#

You could create a function to compare the list before and after requires -- if your intention is to modify "Corn" to "CornSoul" or something

#

Unless you want to pick and choose which plants get used

quasi kernel
#

^

#

Built-in mod priority.

sour island
#

for specific plants?

quasi kernel
#

If the same plant falls under different farm names, I set them to the same so they can "find each other" in code and get each other's seed data.

#

Otherwise, I generally leave it alone.

#

I.E, "Corn" and "Corn2"

sour island
#

to clarify, lets say you prefer soul's corn - you want that to be 'the' corn but if you prefer snake's peas then etc

quasi kernel
#

Correct.

#

Though it goes in order of mods rather than per-crop

sour island
#

ah

quasi kernel
#

There's a sandbox var for determining what order is used.

sour island
#

oh

quasi kernel
#

Say you do F:M

#

Filcher crops would take priority in case of a duplicate.

sour island
#

Can you control loadorder with sandbox options?

#

or do you just rerun the lua

quasi kernel
#

All of the other mods have technically already loaded, I just use the data at that point.

#

Since it's all manually inputted, I just go "ok get sf data"

#

"no sf data? mo crops data"

#

And so on.

#

It's more efficient than that, but that's just a rundown.

#

What I'm wanting to do at the end of the day is get that valuable farming_vegetableconf.props data in between farming mods automatically.

#

Your require method could work, it's just a matter of if require still still work if a file isn't present or not.

#

Though I don't suppose that really matters, I can still check if the mods are enabled anyways.

#

It'd probably be safer to use your method instead of full automation anyhow since it prevents unsupported mods from screwing crap up.

cunning kestrel
#

hmm good point...

quasi kernel
#

I can still automate dumping the data, just not automate the in-between mod collection.

cunning kestrel
#

progress so far.
any Input feedback ?

quasi kernel
#

No idea what an .avi is so I dunno what to recommend lol

cunning kestrel
sour island
#

the 3d sprite render will make that look that much better

cunning kestrel
sour island
#

pz pipeline

quasi kernel
#

Finn, I'm gonna try your require method later today, THANK YOU.

sour island
#

if I understand correctly it will make the model's leg render behind the bench where appropriate

quasi kernel
#

This is gonna save me SO MUCH TIME.

sour island
#

ever since the devs made that example video the sprite issues are more glaring

quasi kernel
#

Might still need specific install instructions but whatever, you win some you lose some.

#

Requires would have to go in a specific order so meh

#

It's a solution - an easy to digest one at that - so I'm not too worried.

cunning kestrel
#

good luck let us know

cunning kestrel
# sour island pz pipeline

ah gotcha, but yeah that my mod progess... both linked into the fitness system (including fatigue) and optional exp modifier, looking at level / regularity, etc

cunning kestrel
#

i kinda showed the best outcome ....

#

nothing to be done im afraid. Right ?

sour island
#

well the head should be lower

#

player X/Y can be floating - you may need to apply a different value depending on direction

#

in order to use the same animation - if the tile isn't centered in a way that works inline with the model

cunning kestrel
#

Can I call different animation depending on the direction though ?

#

Oh nvm change player location on different direction,i see hmm...

gusty wharf
#

Is there a way to change forage bonuses while editing or making a new occupation?

cursive coral
quasi kernel
#

Anyone know if getActivatedMods() returns in mod load order?

cursive coral
#

ฤฑ need help guys

gusty wharf
cursive coral
#

ha okey

gusty wharf
#

so you should ask questions here if you're making a mod

cursive coral
#

I made a texture mod, but I have a problem with the .pack file and I can't run the mod.
I had problems with my normal tests. But when I shared it to steam, the mod did not work.

tawdry solar
#

i mean

#

not like being ingame

tepid dawn
#

Hello, what may be the reason for two mods to be uncompatible

tepid dawn
#

I made two clothing mods, both of them work when they're activated on their own

#

but I can only see the items of one of them if I activate both at the same time

thick karma
#

I don't do clothing mods, but intuitively it sounds like you're loading them too late in the launch sequence, or you're accidentally adding them to vanilla base set of clothes and updating it with the additions in both mods, thus not incorporating the changes from the other.

#

I would look at when other clothing mods that do play nicely together add their clothes

#

By subbing and exploring their code

#

@tepid dawn

tepid dawn
#

Ohhh, what you say makes sense

#

I'll try that

#

I didn't quite understand the "loading too late" part but I guess I understand additions to the base game

frank lintel
#

look thru log file and see what is getting overridden by both mods?

thick karma
#

If something you're doing reinitializes the clothing tables indirectly, then a late addition could cause overwrites of other additions.

tepid dawn
#

because I'm almost a complete beginner, I used "module Base {" when declaring items

#

but I see that other mods use "module CustomName { imports{Base}" kind of approach

thick karma
#

Idk for sure because I do not add clothing, but when I added my book items, I did it like this:

module Meditation
{

    imports
    {
        Base
    }

    item Neiye
    {
        DisplayCategory     =   Meditation,
        NumberOfPages        =    420,
        Weight                =   0.5,
        Type                =   Literature,
        DisplayName            =    Neiye,
        Tooltip             =   Tooltip_YogaLessons,
        DisappearOnUse      =   FALSE,
        Icon                =    MeditationBook,
        StaticModel         =   MeditationBookOpen,
        WorldStaticModel    =   MeditationBookClosed,
    }

    item MasteringYoga
    {
        DisplayCategory     =   Meditation,
        NumberOfPages        =    420,
        Weight                =   0.5,
        Type                =   Literature,
        DisplayName            =    Mastering Yoga,
        Tooltip             =   Tooltip_YogaLessons,
        DisappearOnUse      =   FALSE,
        Icon                =    MeditationBook,
        StaticModel         =   MeditationBookOpen,
        WorldStaticModel    =   MeditationBookClosed,
    }

    item MandukyaUpanishad
    {
        DisplayCategory     =   Meditation,
        NumberOfPages        =    420,
        Weight                =   0.5,
        Type                =   Literature,
        DisplayName            =    Mandukya Upanishad,
        Tooltip             =   Tooltip_YogaLessons,
        DisappearOnUse      =   FALSE,
        Icon                =    MeditationBook,
        StaticModel         =   MeditationBookOpen,
        WorldStaticModel    =   MeditationBookClosed,
    }

    item ZenMotorcycleMaintenance
    {
        DisplayCategory     =   Meditation,
        NumberOfPages        =    420,
        Weight                =   0.5,
        Type                =   Literature,
        DisplayName            =    Zen and the Art of Motorcycle Maintenance,
        Tooltip             =   Tooltip_YogaLessons,
        DisappearOnUse      =   FALSE,
        Icon                =    MeditationBook,
        StaticModel         =   MeditationBookOpen,
        WorldStaticModel    =   MeditationBookClosed,
    }

    model MeditationBookOpen
    {
        mesh = Book,
        texture = WorldItems/MeditationBook,
    }

    model MeditationBookClosed
    {
        mesh = WorldItems/BookClosed,
        texture = WorldItems/MeditationBook,
        scale = 0.38,
    }

}
tepid dawn
#

That's exactly like how other people did it.

#

Thanks for sharing, I'll edit my txt and see if it works

thick karma
#

Yeah I would recommend using your own Module name and importing Base if you didn't. That worked for me

#

And the name of the file may need -items.txt, idk for sure (please correct me if I'm wrong, anyone who knows).

tepid dawn
#

Oh that last part made me find something important

#

both of my mod scripts used the same name before "_items.txt"

#

maybe thats why one is overriding the other one

#

Yeah, i dont know which one fixed it but I can see both of them. Thank you @thick karma

thick karma
#

You actually must use different names

#

If the same filename gets loaded in the same directory it will overwrite prior ones.

#

e.g., if one of your mods has mods/MyMod/media/lua/client/foo.bar and the other has mods/MyOtherMod/media/lua/client/foo.bar, from the game's PoV, those are both just media/lua/client/foo.bar

#

And they overwrite each other.

#

You can avoid this with internal folder naming

#

media/lua/client/MyMod/foo.bar and media/lua/client/MyOtherMod/foo.bar

#

Those won't conflict

#

Or you can just use different filenames

frank lintel
#

^ why I mentioned looking thru the log file in debug it says what and when it does and if ya see two mods same name same file....

tepid dawn
hollow current
#
local onlineUsers = getOnlinePlayers()

for i=0, onlineUsers:size()-1 do
  local playerNum = onlineUsers:get(i)
  local playerObj = getSpecificPlayer(playerNum)
  print(playerObj)
end

Trying to retrieve the playerObj for all connected players on a server. Using this simple code but returns an error. Not sure what I am doing wrong

thick karma
#

Anyone wanna give me some feedback on this instructional example for an upcoming framework I plan to release alongside Aza's upcoming NPC mod?

-- (LINE 1) A very simple skeleton without connections between parts. 
local Example = {}

-- Container for all Pattern Explanation dialogues.
Example.PatternExplanation = {}

-- Stand-Alone Conversation Example Skeleton; No Linking of Dialogues.
Example.PatternExplanation.standAlone = {
    id = "Name of this Encounter", -- Spaces are entirely optional in your ids; they're just strings.
    survivor = "Survivor Name",
    -- The response - options - outcome pattern below is recursive. This means that
    -- if you want to add a branch at a deeper level of your dialogue, you can simply copy
    -- everything from line 15 to line 39 below (inclusive), and simply paste it inside
    -- any outcome table in a dialogue tree (e.g., on line 26 or line 37 below)
    response = "", -- (LINE 15) Note: "response" will refer to the NPC speaking; "option" is shorthand for what the player may say.
    [1] = {
        option = "",
        intention = "Friendly", -- You may associate this response with any intent string.
        rapport = 10, -- Options can cause player to build rapport with the NPC.
        impacts = { pain = -1, anger = 1}, -- Options can affect player's feelings.  Values are normalized from -1 to 1.
        command = exampleCommand, 
        -- exampleCommand above doesn't  actually exist, but you could create a 
        -- function with this or any other name, and write that name here.
        arguments = {}, -- This option will call exampleCommand(player, survivorName, arguments)
        outcome = {
            -- response, etc. (LINE 26) (This is where recursion into deeper levels can begin.)
        }
    },
    [1] = {
        option = "",
        intention = "Friendly",
        rapport = 10,
        impacts = { pain = -1, anger = 1},
        command = exampleCommand,
        arguments = {},
        outcome = {
            -- response, etc. (LINE 37)
        }
    }--, (LINE 15) Note: You would need the commented-out comma after "--" if you wanted to add more player reply options.

    -- . . . et cetera. I would not recommend more than 5 options per branch. 
    -- A 5-wide branch 5-levels deep will require 5^5 = 3125 unique endpoints. That is a lot of writing.
    -- It will be much easier write many levels of dialogue if there are fewer branches per level.
    -- If your options are verbose (2-3 lines on 4x font), only 5-6 will on the screen.
    -- If your options are concise (1 line on 4x font), you can get away with maybe 10 options on screen.
    -- Don't forget to test how your responses and options look in 4x font for better accessibility!
}
#

(Will likely need to be viewed in actual editor to look right)

frank lintel
#

formatted fine this side

thick karma
#

Fair enough, I just figured some of the long lines might look awkward in Disc

frank lintel
#

on a phone maybe but /code does a good job at wrapping just be long. but on a halfscreen on this rig looks good.

thick karma
#

Cool nice

#

Well... do you think you could follow this structure to build your own basic custom NPC dialogue? Any explanations too confusing?

#

(I have a framework for running branching dialogues on this structure built.)

frank lintel
#

personally yes, but as a whole no issue it explains it well just for me 'skeleton' throws me off

thick karma
#

I just used "skeleton" because it is not fully filled out

#

But maybe another word would be more well-known for that.

#

Idk

#

template I guess

frank lintel
#

call exactly what a {} is?

fleet yarrow
#

Afternoon folks. I've created a new object script for a new tile, but I can't see it in the Necroforge list. Any quick troubleshooting starter points?

thick karma
#

{} is a Lua table. @frank lintel

frank lintel
#

just call it that then to avoid confusion.

hollow current
frank lintel
#

I knew what it was and what ya were doing but being new to lua and modding for PZ just threw me off a bit

thick karma
#
-- (LINE 1) A Lua table used as a module (a container) for the other elements in this example.
local Example = {}

-- Lua table used as a container for all Pattern Explanation dialogues.
Example.PatternExplanation = {}

-- Stand-Alone Conversation Example Template; No Linking of Dialogues. Also a Lua table.
Example.PatternExplanation.standAlone = {

? @frank lintel

#

Clearer?

#
-- Stand-Alone Conversation Example Template; No Linking of Dialogues. Also a Lua table. (Code below makes extensive use of nested tables).
thick karma
#

I figure this framework will likely be used by people who are NOT Lua experts

#

So, I need that feedback

#

Ideally I want anyone who has any clue about modding to find it pretty easy to fill it out

#

Without eliminating features

frank lintel
#

never touched it before honestly dont even know why they using it still given they already coding in java but... I offered the feedback cuz a newbie pov it seemed was what ya were looking for

thick karma
frank lintel
#

no why they using lua... drunk

thick karma
#

Oh.... lmao

#

(Almost) all mods in PZ are written in Lua

frank lintel
#

exactly why? java the native game lang why the change but thats not really a topic for debate here nor trying to.

thick karma
#

I am not sure; I suspect perhaps it seemed easier to maintain the security of core code that contains sensitive user data... or maybe they just had a lot of Lua experience and decided half the game would be more easily written in Lua than Java.

#

I honestly do not have an answer for you at all, though I would be curious to know the real one.

frank lintel
#

shrugs not knowing either. "Im migrating from doing modding in MC and craftbukkit/bukkit/spigot so unlearning java for lua is not gonna be fun."

thick karma
#

Fair. For what it's worth, if you keep an open mind, I think you'll find that some of its unique features are very useful

#

Mixed-data tables are very easy to whip up in Lua compared to Java.

#

And OOP can be simulated.

#

Such that ultimately using the instances of classes will look very similar to how it looks in Java.

frank lintel
#

oh just ppl trying to explain how they are even different types of programming languages makes my brain ded

thick karma
#

Pro-tip, (index + 1) % numIndexes becomes (index % numIndexes) + 1 in Lua tables that use (1, ... size) for indexes.

frank lintel
#

Im jusst old so ingrained burned in syntax is just hard AF to undo.

thick karma
#

Haha for sure.

frank lintel
#

I started down my coding road with C in '86

fast galleon
#

Are java mods illegal, what's stopping you personally?

frank lintel
#

how to load it?

carmine quartz
#

Hi, i have a quick and probably dumb question:
Is there an easy way to get a player object from a username? I had an idea to grab all online players and just search each one until i found the one with a matching username, but I wanted to check that it was necessary before i do it.

thick karma
#

Olipro wrote a program for that @frank lintel

#

But you will need to get your end users to install it

frank lintel
#

thats the limiter right there

thick karma
#

Exactly

#

Hence many of us don't use it

#

Despite it being very cool

#

I think Blair may be about to enlighten us @frank lintel

#

He is a pro at TIS

willow estuary
#

Also, if you are using modded Java for a game, any problems with your server or game are absolutely out of The Indie Stone's hands; please don't come to us for tech support or help if you are using a modded Java as that is far beyond any point where we could help someone.

#

Voids all warranties etc.

frank lintel
#

oh no that wasnt the topic

willow estuary
#

It is for me ๐Ÿ˜„

frank lintel
#

just didnt know why Lua over using Java since it using it already

carmine quartz
frank lintel
#

if I cant do it natively then its not getting done (for me)

thick karma
willow estuary
#

I have no idea. It's just the way it is.
Also I just want to stay completely out of, and completely uninvolved with, java modding and any associated headaches.

pulsar heath
#

i had some issues "adapting" to lua

#

and what i couldnt solve with lua

#

i solved it with c# by making an app to interact with my mod

#

so the mod is only a listener, and the app does the hard work

thick karma
#

Haha nice.

frank lintel
#

I only mentioned this because a mod Im trying to debug some reason has a java attack.class file in it which I was like o.O

thick karma
#

So that's how you did Twitch Integration?

pulsar heath
#

the last version yup

#

the 1st version was all in lua

thick karma
#

Nice, I had wondered if you had solved that in Lua or what

#

I don't use Twitch lol

pulsar heath
#

the lua only decodes a json string that the app sends to the mod

thick karma
#

Veeeeeeeery rarely to get a free thng maybe

pulsar heath
#

and based on that executes some simple functions

#

all the heavy logic is done by the app

pulsar heath
#

now im making a neutral version of the app

thick karma
#

?

pulsar heath
#

so that if anyone wants to use it with their mods just need to do a few clicks

#

in the app, setup the json that it sends and parse the json on the mod side

thick karma
#

hmm I think I need to see your app to really follow

#

Not clear on how clicking mods is relevant to twitch integration...

pulsar heath
#

clicking mods?

#

what i mean is this: you have a mod you want to integrate with anything

thick karma
pulsar heath
#

so the app has a menu that allows you to config what is sent to the mod

#

the actual mod only parses the results and executes the code needed for the result received

thick karma
#

Ohhh... So it's basically a framework for handling external signals within a mod

pulsar heath
#

yup

#

its a "wrapper"

thick karma
#

That would be great for everyone

pulsar heath
#

works with twitch api, youtube api, discord api and steam api

thick karma
#

I wouldn't necessarily have plans for, but no doubt a ton of people would

scenic cradle
#

Hey @fast galleon - thanks for the advice yesterday - I got the add/remove both working afterwards.

pulsar heath
#

only need to finish the gui... eventualy

#

done the guy to work with my mod, but need to make the "neutral"

frank lintel
#

there any good refs for gui stuff that one thing def wanna look at.

pulsar heath
#

so that it can be customized by the mod dev for their needs

#

there is @frank lintel

thick karma
#

Mang I've been watching Aza whip up a fresh GUI in Bzl and they're not my pics to show you but I gotta say, it's impressive how fast you can build out a GUI in that app.

pulsar heath
#

have a look in the simple ui api mod in the workshop

thick karma
#

If you hate doing it manually.

pulsar heath
#

im using winforms for most of it and user controls

thick karma
pulsar heath
#

the only thing thats dynamic is the user controls

frank lintel
#

well it gotta handle ultrawide and doublewide displays ^_^

thick karma
frank lintel
#

which I clearly not seeing done well so far by modders

thick karma
#

It affects which example I will send you.

#

I have example that do this well

#

But I don't the level of complexity you require

fast galleon
#

I've seen a java mod that says to drag and drop files, does that work with all classes or only vanilla overwrites?

pulsar heath
#

im done with the games UI... i almost went mad just making a simple thing like me stats mod

thick karma
#

Wookiee Gamepad Support features fairly complex examples that do "too much" as the kids like to say @frank lintel

fleet yarrow
#

Trying to get a custom tile ingame, getting the Warning: Moveable not valid error. Any ideas?

frank lintel
#

honestly Im first going after vanilla ones

thick karma
#

I added gamepad support to Trading UI and fixed UI scaling issues while I was there, e.g.

#

You can read that to see how.

pulsar heath
#

and im the crazy one for making an app

#

๐Ÿ˜„

thick karma
#

@frank lintel

frank lintel
#

at this point how I see it I gotta learn how to do it manually...

pulsar heath
#

you finished the gamepad support mod @thick karma ?

thick karma
#

Oh it'll never be finished but I have added PlayStation button support, Switch button support, ISTradingUI support, ISSafehouseUI support, ISFactionUI support, Aquatsar shortcut improvements, gamepad inventory and loot repositioning / saving, gamepad shortcuts for sorting inventory and loot, and probably other stuff I'm forgetting. @pulsar heath

pulsar heath
#

damn... thats a lot of work

thick karma
#

I may do that in the next few days

#

Just a matter of deleting a bunch of stuff from existing code without breaking anything

thick karma
#

Oh, scrolling shortcuts... we can hold triggers down while pressing D-Pad to scroll faster in various contexts @pulsar heath

#

kind of a big deal with all the long lists in this game

pulsar heath
#

i know its a lot of work... i almost went mad sorting through the UI handling in the game...

thick karma
#

Doesn't work everywhere but it's nice where it does (e.g., inventory and loot)

pulsar heath
#

if a simple mod as mine was a lot of work... i can only imagine the amount with something like that

thick karma
#

I went pretty hard on it lmao

red tiger
#

Good morning.

pulsar heath
#

good afternoon kind sir

gusty wharf
#

Are occupations' (mainly foraging) bonuses possible to edit or create with lua?

pulsar heath
#

yes they are

#

you can either alter the bonuses directly

#

or using perks

#

etc

#

and you can do that in lua

#

or just modify the value itself directly

fleet yarrow
#

Blimey, custom tile creation isn't particularly straight forward is it?

fast galleon
# red tiger Good morning.

hey, maybe you know this.

I've seen a java mod that says to drag and drop files, does that work with all classes or only vanilla overwrites?

thorny garnet
#

Does item:DoParam("Param = Value") also work for template parts? I'm trying to write a mod that will pull vehicle storage/trunk names from a file and set their "ConditionAffectsCapacity" property to "False" (edit: typo)

fast galleon
red tiger
#

Working on improving my parser this morning for ZedScript.

fast galleon
#
    item Mov_OfficeChair
    {
        DisplayCategory = Furniture,
        Type            = Moveable,
        Icon            = default,
        Weight              = 0.5,
        DisplayName        = Black Office Chair,
        WorldObjectSprite    = furniture_seating_indoor_01_50,
    }

^for debug Item List

hollow current
#

The following code is being run serverside:

for i=0, onlineUsers:size()-1 do
  local player = onlineUsers:get(i)
  print(player)
end```

The following code is being run clientside:
```lua
RestartAlert.checkModData = function(this)
    print(this)
end
Events.OnPlayerUpdate.Add(RestartAlert.checkModData)```
Why is the player object from the first function and the second function different?
#

even though its the same player (since the server has only one player online)

red tiger
#

I really liked that my new parser was less than 90 lines of code but now I'll have to follow the same rules that PZ has for parsing ZedScript.

hollow current
#

I think its because the server's representation of a player object is different from the client's representation of the same player. Is there a way to get the same object both client wise and server wise?

fast galleon
#

when you print userdata or table it usually prints the "memory location" as somebody (anonymous) called it

fast galleon
hollow current
#

but is there a way to get the same representation on both functions?

fast galleon
#

for print purposes?

hollow current
#

I am setting moddata for the player from serverside, and I want to retrieve it from client side

#

but it's not working since both representations are different so its like I am setting on one player from the serverside and then attempting to retrieve it on another player clientside, while its technically the same player

fast galleon
hollow current
#

well i was able to set moddata for the player from server side and then retrieve it from the same function serverside, but that's not what I am after sooo ye

fast galleon
#

alternative way, send command. Maybe somebody else has better advice

hollow current
#

hmm will look into commands i guess

#

for reference.
Serverside code which is being executed using EveryTenMinutes event:

function RestartAlert.CheckServerRestartTime()
--some lengty stuff
if content then
        local onlineUsers = getOnlinePlayers()
        for i=0, onlineUsers:size()-1 do
            local player = onlineUsers:get(i)
            player:getModData().restartAlert_alert = content
            print("MODDATA HAS BEEN SET FOR: " .. tostring(player))
        end
    end
end```

Clientside Code which is being executed using OnPlayerUpdate event:
```lua
RestartAlert.checkModData = function(this)
  --irrelevant stuff
    if elapsed >= 10000 then
        print(this:getModData().restartAlert_alert)
        print("MODDATA RETRIEVED FOR " .. this)
    end
end```
vivid linden
#

how to add the ability for a message to be sent to /all after an action has been performed?

#

I tried this but it gave an error when it tried running in game SendMessageToAllPlayers(character:getDisplayName() .. " test message")

cunning kestrel
#

any smart person know how to fix this ?

fast galleon
#

lol, when you push yourself into the bench exercise

cunning canyon
#

is the player standing where the feet are planted in that animation?

#

you'll need to make them stand on the eastern tile of that bench and then offset them in the animation i imagine

#

otherwise the clipping is unavoidable (pending juicy changes mentioned in the previous blog post)

cunning kestrel
cunning canyon
#

๐Ÿคทโ€โ™‚๏ธ

#

maybe there's a way to set the front tile to be on the same layer as the carpet? idk, it would be super messy as well

#

you'd need custom tile defs

hollow current
# fast galleon alternative way, send command. Maybe somebody else has better advice

Would this be the correct way to implement a client command?

local Commands = {}

function Commands.showRestartUI(content)
    local myUI = MyUI:new(content)
    myUI:initialise()
    myUI:addToUIManager()
end

local function OnClientCommand(module, command, player, args)
    if module == 'RestartAlert' then
        Commands[command](args[1])
    end
end

Events.OnClientCommand.Add(OnClientCommand)```

```lua
if content then
  local onlineUsers = getOnlinePlayers()
  for i=0, onlineUsers:size()-1 do
    local player = onlineUsers:get(i)
    sendClientCommand(player, 'RestartAlert', 'showRestartUI', {content})
  end
end```

I'm not sure if the usage of sendClientCommand in this context is correct
kindred dawn
#

Hmmm

#

How do I add the recipe to insert a battery into something?

fast galleon
kindred dawn
#

Since trying to add just โ€œbatteryโ€ uses only 1 unit of its 100000 units

#

Just set it to 100000?

hollow current
kindred dawn
vivid linden
scenic cradle
#

suggestions on how I can do this: getCell():getGridSquare(x, y, z):RemoveTileObject(getCell():getGridSquare(x, y, z):getObjects():get(1)) but target the tile object by name?

#

as opposed to grabbing the object by reference

kindred dawn
#

Anyone know how to use up the battery when making a recipe?

kindred dawn
#

Ah, you do destroy battery

fast galleon
scenic cradle
#

thanks again @fast galleon !

fast galleon
scenic cradle
#

I'm passing hard references so nils shouldn't be an issue

fast galleon
#

if you're doing this client side then you can use ISMoveableSpriteProps:findOnSquare( _square, _spriteName )

kindred dawn
#

So I made a thrown home alarm with timer, but every time it hits something, it disappears and doesnโ€™t make any noise

#

Itโ€™s made the same way as the NoiseTrapTriggered Noise Generator in newitems

fleet yarrow
vivid linden
#

Update... It works now. If you soil your pants in the game... A message is sent to the discord server letting everyone know you just poo'd your pants

Shame

fervent raven
#

how do i find the modding tools

fast galleon
fleet yarrow
#

Thanks, sprite name - is that the name of the sprite within the pack?

fast galleon
#

replying here in case they are allergic to code there

fleet yarrow
#

(the one I can get from the packviewer)

fast galleon
#

yeah

fleet yarrow
#

Ok, so it adds 'Moveable' to my inventory, but it doesn't actually show or place anything when I try to place it in world

#

Just highlights the target floor tile as usual

fast galleon
#

does getSprite("insert sprite name here") from console work? print(getSprite("furniture_seating_indoor_03_17"))

#

are there any errors?

fleet yarrow
#

No errors, there's a LOG general and a zombie.iso.sprite text output

red tiger
#

Oooookaaayyy.. 6 hours later.

#

My rewrite for a raw string parser for ZedScript files is somewhat working now.

#

It tokenizes assignment lines as single tokens and takes into account commas possibly stacking for empty statements that are ignored.

#

Tokens are parsed by scope. E.G: module, sound, recipe, etc.

#

So this one should work.

#

I could parse out property->value statements as separate tokens however I think my parser code further in will be cleaner doing this.

#

@quasi geode

strong dragon
#

So, I made a version of Arsenal26 so I could lower spawn values, I updated the mod, now my game is saying workshop item version is different or something like that when I host

#

Could someone assist me with that?

red tiger
#

AFK for a bit.

#

<3

#

Glad I found a cleaner method to implement lexing.

mellow lichen
#

Okay so i was toying with this idea just before my computer exploded (trying to find replacement motherboard level exploded)-
How hard would it be to mod the pz medical system to act like the med system from the Rim?
Things like tend quality and medical skill increasing bonuses?
Cause i got some ideas about it just wondering how feasible it is

modern hamlet
#

Does the self:forceComplete() command for TฤฑmedActions prevent the action from being cancelled? I couldn't find explanation for this command.

dark wedge
sour island
#

The vanilla injuries are tied to fields 1:1 with timers

umbral surge
#

good evening, i've never modded games, but i have the basics of OOP down, and basic programming knowledge in general. Where should i start, if i want to learn how to make some simple mods?

glass basalt
umbral surge
#

call me insane but i'd like to try to make some basic NPCs

glass basalt
#

There is "Superb Survivors" on the Workshop, they're currently looking for help

umbral surge
#

there are basically no working NPC mods left

#

couldn't find a way to fix it either

glass basalt
#

the devs can't even make working NPCs, that's why they're leaving it off until Build 48 or something hahaha

umbral surge
#

this is a dumb question but what's so hard about it? Both project Humanoid and Superb worked decently until the latest builds, except for the stutters

glass basalt
#

It's reimplementing everything that a player character can do, but with an artificial intelligence. It is simply horrendous tedium, on top of the bugfixing

umbral surge
#

i'll probably look into Superb, basically everything works except for melees

glass basalt
#

You could start with making scripted NPCs, that's what previous versions of PZ had

#

as in ones that do a particular thing

umbral surge
bronze yoke
#

and don't forget your artificial intelligence is running in *lua*

umbral surge
#

there's probably going to be an horrendous amounth of math involved in the Ai

glass basalt
#

lua banter be like:
๐Ÿคฎ ๐Ÿคฎ ๐Ÿคฎ ๐Ÿคฎ ๐Ÿคฎ ๐Ÿคฎ
WHY is --- LIEK ----???

bronze yoke
#

i honestly think lua is really really good but its performance limitations don't lend well to ai

glass basalt
#

the amount of math you have to do can be mitigated if you leave everything else constant, i.e. an NPC doesn't have to worry about food, looking for other NPCs or players, because you made it to just spawn on the map, walk around and shoot zombies, and either die or disappear after a certain amount of time

#

once you start actually making the NPC a part of the world, is when every little detail leaves blocks of code

#

time to make a vehicle spawn mod for the first time, to better understand why my other mod doesn't work as its supposed to ๐Ÿ™‚

scenic cradle
shadow flower
#

Is there a way to detect if a mod is enabled to not add an item to the distribution code?

#

This is what I tried and it did not like that to say the least

if (!isModActive(getID():contains("FarmingTime"))) then
    table.insert(SuburbsDistributions.SeedBag.items, "MCM.CornBagSeed");
    table.insert(SuburbsDistributions.SeedBag.items, 20);
end
frank lintel
#

I was testing superb today it was actually working

#

still trying to track down exactly what is causing the 'Exception thrown java.lang.IllegalStateException at UIManager.update line:685' error

shadow flower
#

I think my problem is lua not liking the not modifier

bronze yoke
#

use not condition instead of !condition

frank lintel
#

my bad it does but I think it has to be done after all the logic is done. ie !(A and B) atleast the examples Im seeing give it this way

bronze yoke
#

i don't think there is a ! operator at all

frank lintel
#

this page Im reading shows one for logical operators but precedence order on a not is R2L not L2R according to this also.

shadow flower
# bronze yoke use ``not condition`` instead of ``!condition``
if (isModActive(getId():contains("FarmingTime"))) then

else
    table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.CornBagSeed");
    table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 20);
    table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.LettuceBagSeed");
    table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 20);
end

This responds with

STACK TRACE
-----------------------------------------
function: MCM-Distributions.lua -- file: MCM-Distributions.lua line # 43 | MOD: 'Mo Crops

Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE:  java.lang.RuntimeException
Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException: 
Feb 25, 2023 5:24:46 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: at MCM-Distributions.lua:43
#

does getId not have a contains

bronze yoke
#

i think you want if not getActivatedMods():contains("FarmingTime") then

frank lintel
#

is getId() a string outpout ... beat me to it was just gonna say use 'contains'

shadow flower
#

I'll give that a try

frank lintel
#

and albion you might be right I gotta look at more sites cuz the popout examples all use not but the one example on the main page uses ! what the heck?

shadow flower
#

excellent thanks guys

frank lintel
#

contains did the trick?

shadow flower
#

Switching it back the way I had it, but adding the else statement worked

#

I tried using the every other language way of checking for false before

#

which got lua confused

#

now with the else it works exactly as i wanted

frank lintel
#

lua has some unique syntax etc Im on the official lua.org site now looking to see if ! even is a legit operator.

#

and nope they dont according to Lua 5.0 manual its typed out and/or/not so ? : ! functions dont exist

#

also 0 = true ^_^

bronze yoke
#

somewhat confusingly, no

#

0 evaluates to true, but 0 == true evaluates to false

frank lintel
#

if ya old school where 0 and 1 had logical value yeah

#

do an if (0)

bronze yoke
#

yeah, if 0 evaluates to true, but if 0 == true evaluates to false

#

they're both true but they're not equal

frank lintel
#

^

#

integer vs logical

#

I meant equal to not literal ==

bronze yoke
#

like it already has something written in it when it spawns? that can't be done with item scripts alone, needs lua

scenic cradle
#

@drifting ore if you look at an existing item in the zomboid files you'll see how it hooks a function into play from a lua file - you can just look at that function then and attempt to replicate it for your own item to make changes - I wouldn't be able to tell you the files off hand without looking - I learned about this stuff by trying to update Hydrocraft. As for the picture question - I know with the UI elements you can make custom frames/windows - I've yet to get my head around how though

#

If you look at mods like Snake's Gourmet revolution I know it uses instances of custom images in UI frames that you may be able to look at as reference.

glass basalt
#

pretty quiet in here for a saturday night lol

vivid linden
glass basalt
#

lol nice. I recommend inserting a link to the original mod for referenceability

glass basalt
vivid linden
#

I added it on the description

#

Its mostly just a way to have fun with my server as I have the discord connected to game chat. I imagine most people will not be able to fully appreciate that part of it. But they will still enjoy the 3 better sounds and text changes at least.

glass basalt
#

the meme factor is more than enough. A super elaborate mod likely won't get the same amount of views and coverage as a "sex 2.0" funny mod. If you care about that kind of stuff, that is

glass basalt
sleek heath
#

tracklist info is in the description of the mod

#

just letting you know though it's 5.0GB's so it's kinda beefy

ancient grail
glass basalt
#

Thats a good code snippet to yoink

#

I made my own for sprites. I should link it somewhere, since I personally have no use for it

ancient grail
#

super broken

rancid panther
#

is there a function that i can use to block xp gain from a book in certain cases?

#

or what i would call in regards to book xp boost

fast galleon
#

sure, just skip the add xp multiplier step

ancient grail
rancid panther
scenic cradle
#

mmm... what's wrong with my logic here:
function vPlace(square,sprite)
if square:getObjects():get(0) == nil then
print("DEBUG: Why no print?")
end
...

fast galleon
#

I don't know where to begin...

scenic cradle
#

LOL

fast galleon
#

print the if check (square:getObjects():get(0)) and you'll see for start

#

squares almost never have no objects

#

an array throws errors when you try to get an out of bounds element (?)

#

the missing end is probably cropped out

scenic cradle
#

oh it is - I chopped the rest of the code out

#

as I'm just trying to figure out how to do a check to see if a square is empty or not

fast galleon
#

what do you consider empty, do walls count? what about items e.g nails?

scenic cradle
#

should only be a ground tile, nothing else.

#

Going to attempt to dump the get(0) to print now though and see if I can figure anything out from there.

fast galleon
#

I guess you could check size then if objs:size == 1 then

scenic cradle
#

I still want to understand how get() will work though; as I intend to iterate thru the square's objects afterwards

#

thanks for the advise @fast galleon - going to go do some debugging

#

mrm.. except square:getObjects():get(0) doesn't print to console...

#

wtf.

ancient grail
#

isEmpty()

#

Not sure if its for container only

#

Might as well try it

fast galleon
#

that would be true when no objects are there, no floors either

scenic cradle
#

Okay - let me refocus my efforts here; how can I ENSURE I get a print to console/logs, even if it's a bad value - anyway to address that @fast galleon ?

ancient grail
#

If you get like a swuare above you and unare outside
Then yeah thats empty

#

Try error()

#

Hi tags polt almost every other msg ๐Ÿ™‚

#

Nope i was wrong

#

Only twice

#

The scren just scolled up cuz phone buh

#

Bug

fast galleon
#

I used to think all squares have floors, but now I remember that's no true. Not all squares have an square object btw.

fast galleon
#

no print means the function isn't called

scenic cradle
#

function def gets called - cause if I take my print + the square object reference out, and let the rest of the code run, it has no issues.

fast galleon
#

or you can get an error stack if you try print something that erros

glass basalt
#

If I give any supposed vehicle, item, recipe, or anything in the game a string in the translation files, but those entities don't exist (either missing or not enabled from a certain mod), will the game handle the new strings without issue and simply never use them? I can check really quickly with my own mods, but i wanted to know if anyone has had experience with translation files.

fast galleon
#

when a translation isn't found, they game uses the given string

glass basalt
ancient grail
#

If u want you can disect this code i wrote

The function gets the highest z
But i have a version for prints only

#

Highest z that has floor

fast galleon
#

ah, you can translate as much as you want no errors will happen from extra translations

ancient grail
#

It returns nil if theres no floor

scenic cradle
#

So here's the original code in that function that works:
local isoObject = IsoObject.new(square:getCell(), square, sprite);
square:getObjects():add(isoObject);
square:RecalcProperties();
The code above will add objects to a square without issue every time it runs; when I try and print or error anything I'm working with in regards to square:getObjects():get(0) to debug and check to see if the square is empty BEFORE the adding is done, it fails but I can't get error output...

glass basalt
ancient grail
#

What are you. Looking for .. floor or obj?

scenic cradle
#

I want to make sure the object I'm about to place (in this case "sprite") isn't already placed on that square.

ancient grail
#

I have that function too but im afk
Check out my bear trap mod

scenic cradle
#

will do.

ancient grail
#

Tho it does check for abunch of stuff too
Not just the tile itself

#

You can just select which one u want to remove basically its a checker function that checks bunch of stuff

#

Like if player is blocked by a wall
If theres something there
Is there a floor
Can you see it

#

Stuff like that

#

Hope u find what u need frkm that function

fast galleon
ancient grail
#

I wrote it when people said you cam stack the traps
And i realized i forgot to do a check

scenic cradle
#

Yes - exiting to main menu after each code change for testing...

ancient grail
#

Dpends on the lua files content you can always try the reload button

#

To save time . Just need to know what reloads and what doesnt

#

Like on game start events

fast galleon
#

are you testing in sp?

scenic cradle
#

MP. As this is server side generation

ancient grail
#

What mod are u making

fast galleon
#

ok so that would never appear in your console log

scenic cradle
#

Right - would appear in server debug log right?

fast galleon
#

yeah

scenic cradle
#

Cause nothing shows up there either ๐Ÿ˜›

ancient grail
#

You must be looking at the wrong directory

scenic cradle
#

Nope - cause other functions I can throw print statements from no issue... can confirm looking at server log output.

ancient grail
#

Try to tail it

#

Ahhh so it crash before it writes

earnest lark
#

Is there a way to run OS command inside lua files (because os or io tables are not available). For example call curl command when sever starts?

scenic cradle
#

yeah - if I just use the original addition code I posted above, and toss a print in there, print will work no problem and I'll get output in server log

ancient grail
#

Yesh if you are just solving the the tile placement then no need to further focus on the log

fast galleon
#

sorry for all the stupid questions, is your new unconditional print unique - something you can search for?

scenic cradle
#

Yes - i tag all my prints with "DEBUG-X1, DEBUG-X2, etc.

ancient grail
#

Not sure if theres somthing else

earnest lark
ancient grail
#

How exactly do you tag em

scenic cradle
#

print("DEBUG-X1 :"..addCodeHereIfNeeded)

ancient grail
scenic cradle
#

yes, if I do this:
function vPlace(square,sprite)
print("DEBUG-X1: Placing sprite");
local isoObject = IsoObject.new(square:getCell(), square, sprite);
square:getObjects():add(isoObject);
square:RecalcProperties();
end
that works

ancient grail
#

Why not just make a moveable

scenic cradle
#

lol... okay

ancient grail
#

Save yourself the trouble

scenic cradle
#

So I'm trying to take our existing vendor setup which uses tile+UI interactions for a shop, and have those vendors "move" on boot

ancient grail
#

Not possible

fast galleon
#

moveable is an inventory type though

scenic cradle
#

why not? If I can check to see if my tilesprite is present I can just delete it

ancient grail
#

You need a player present for that to work unless u expensively force load a grid

scenic cradle
#

that's already done.

#

it's how we prepopulate the vendors on boot

ancient grail
#

For reals? Wow ok . .

#

Im still skeptic

#

Are they goobal obj?

scenic cradle
#

you want me to just paste my functional code file for you to look at?

#

cause it works.

#

Been using it for months.

ancient grail
#

Sure and if it works the. U mumight have solve something alot of modders failed to do

scenic cradle
#

I doubt it seeing as I butchered this code together from other modders code :p

ancient grail
#

On top of my head i know probably 4-5 modders who wanted to spawn obj without a. Player there on that gridcell

#

Like server spawns it .

fast galleon
#

I'm rethinking my options for v42

scenic cradle
ancient grail
#

Yeh he used loadgridsquare that will work

#

Expensive but yeah ..

#

I failed to mention without using loadgridsquare sorry

scenic cradle
#

The server that we host our game on can handle it so I don't really care about the resource clog

ancient grail
#

Cuz some servers cant handle it even if u optimize the code

#

Like baricaded world
A very cool mod but the method

#

Nice

scenic cradle
#

barricaded world - and trash + corpses - were two of my inspirations for this.

ancient grail
#

Since thats the sotuation . Imean if yourenot doing the mod for general public then theres no reason why you shouldnt use that

#

Good job btw
Looks amazing

scenic cradle
#

right.. so anyway, what I'm trying to achieve is have it run the placement on boot everytime (that I can do easy enough) what I can't do is have it check to see if I've already placed the vendor on that square

#

if I have, I want to remove it

#

then I'm going to add a randomizer to only POTENTIALLY spawn said vendor

#

to emulate them "travelling"

ancient grail
#

Search for the sledge function

scenic cradle
#

oh I can remove objects no problem

#

once I know they're there

#

๐Ÿ˜›

ancient grail
#

Right

I have a suggestion

#

Instead of teleporting them why not make them chance encounters

#

Like they just disapear and comes back from time to time

scenic cradle
#

that's the intention

#

but I'm going to use the same grids each time

#

so one day a vendor might be at the race way; next he might not be - but eventually he will come back there

ancient grail
#

You can use a radius check near a player if they are xlose to the obj then do the thing

scenic cradle
#

erm... okay that's a bit beyond me at this point LOL

glass basalt
#

I need some advice. I have a mod that has a crap ton of mods that all do the same thing but for different vehicle mods. I just learned that I can combine all of them into one nice AIO mod. But, it isn't finished and I'm still making more translation files to cover more vehicles. Should I merge all of them now, or continue making separate mods until I finish and then merge? For reference, my mod is "KI5's Vehicles - Lore-Friendly Names"

scenic cradle
#

also if it becomes a radius check based on player - would the vendors be instanced to players then vs the server? I don't want vendors vanishing when another player approaches, or only being visible to one player...

fast galleon
ancient grail
#

Nooe just snippets

#

I think authentic z had it and it says konijima wrote it for peach

#

Iirc

red tiger
#

Good morning. Fired up to resume work on my parser for ZedScript today.

fast galleon
#

see how to loop the arraylist

scenic cradle
#

thanks Polt - I'll give that a read later... taking a break for now, frustrations are at a high

fast galleon
#

I wonder how many global objects are equivalent to force loading a chunk, imagine adding object every hour to random position so that something happens when chunk is loaded

hot patrol
#

Anyone know if it is possible for an item to have two world static models and if so how I would go about doing it?

clear yoke
#

hi i was wondering has anyone made a mod yet that makes alternators work in vehicles so the batteries charge when you have the vehicle on?

#

if not might be a good mod to make although i know nothing of making mods so it may be alot of work im not sure

clear yoke
#

not that im aware of no

frank lintel
#

actually should be very easy to do.

modern hamlet
#

ah i confused it with the car battery it's my fault

frank lintel
#

make a new triggerable event to the car base that would add in power to the battery power when its running.

clear yoke
frank lintel
#

actually might give it a shot and try and make it myself but I bet someone would beat me to it.

clear yoke
#

or girl sorry didnt mean to assume

frank lintel
#

all good and my half century old brain dont care I call everyone dude pretty much cuz ppl get bent if I just use babe now it seems.

#

actually think I pretty much just say 'sup now to avoid all that.. but yeah moment you mentioned it I was like oooh thats a good idea.

clear yoke
#

i have another idea too i always wanted but again too smooth brained to try

frank lintel
#

it shouldnt be hard to do I could just look thru the 'god' mode code of a cheat mod to see how the event handling is done... Im totally new to the modding let alone lua. I did all my modding in MC years ago.

#

like first person to make a mod lets you pick up arrows you shoot :P

clear yoke
#

it would be pretty cool if that was something that could be done

#

also i play the deaf trait alot and one thing that bothered me bad was heli events while deaf it bothers me so much you can see things like the moon but there is no visual indicator for tha choppa

frank lintel
#

how do you see the moon?

clear yoke
#

like a little icon or even a light on the side of the screen would be the best

#

there is an icon on the top right of the screen which shows the moons status

#

whether its full or crescent you can see that

frank lintel
#

far as I know chopper event totally randoml

clear yoke
#

it can be depending on settings yes

frank lintel
#

yeah but think those are just starting/day start restrictions not an exact like 'start day 30' thing

clear yoke
#

but really in reality even if you are deaf you can still look up and see a chopper in the sky i just thought it would be nice to have a indicator of some kind that a chopper was in the area

frank lintel
#

I dont think its intended to ever really be seen since it just randomly flies about till it f's off its like a news chopper circling the area or something

clear yoke
#

and one last idea i had was the chatbox in multiplayer servers sometimes that box is just in the way and if you close it you miss messages meant for you a light on the side when a new message comes through would be amazing

clear yoke
#

so if its not intended i mean i get it

frank lintel
#

a pro in the modding community might know if its possible to track the audio sources for direction since it does I believe get pushed into directional audio

#

or if there anything that gives it a location so you could do that

clear yoke
#

oh it dont even have to be that great in detail just a light or something to indicate its in the air would be nice

#

or a negative moodlet even

frank lintel
#

well just adding an icon if the chopper event fired off could be something to look into

clear yoke
#

right i mean it makes sense that a deaf person cant hear a car alarm or a house alarm but being hard of hearing myself i can still even feel the vibrations of a heli going overhead

frank lintel
#

btw never really noticed or looked but do house alarms stop working when power dies?

clear yoke
#

no they are battery powered like a battery backup kicks in

frank lintel
#

like infinite age cuz thats bull and non-existent

clear yoke
frank lintel
#

another idea... ๐Ÿคฃ

clear yoke
#

maybe an idea for another mod

#

lol

frank lintel
#

hmm wonder if when the power goes off is preset on world gen I know its pretty much random but wonder once you make the world when it does is choose not just an random odds chance if it does that day or not...

#

this way could have a date when power goes down then add in a decay death for the alarms

clear yoke
#

yeah that sounds viable but i dont know anything about modding so i have no clue how tough it would be to do

#

i know some people seemingly know exactly when the power will go out so there is a way to do that although again i dont know how they know but i witnessed ppl being spot on when the utilities will shut off

frank lintel
#

when ya make the world you can define how long power/water so there settings for it, believe you can even make it so never happens and never shuts off

clear yoke
#

well in that case then it sounds like it can be worked out

#

anyways those are my ideas i hope someone finds them useful

red tiger
#
keep [Recipe.GetItemTypes.Hammer],

I'm guessing this is a method call for an ingredient in recipe in ZedScript.

fast galleon
#

Recipe.GetItemTypes.Hammer is a Lua function

torn igloo
#

is there a way to get player's safehouse without having to loop through all the safehouse?

red tiger
#

...

#

Templates in ZedScript.. Oh man..

#

(Quietly deletes /media/scripts/vehicles/)

#

"So how about them vehicle scripts?" .. "What are those?"

deft falcon
#

How do I check if a helicopter is active?

quasi geode
red tiger
#
LexerError: [4581:41] :: Illegal line in 'Base.GlassTumbler': ,
#

Heheh

#
    item GlassTumbler
    {
        DisplayCategory     = WaterContainer,,
        Type                = Normal,
        DisplayName            = Tumbler,
#

It's good to know that my lexer is working as intended.

quasi geode
#

mines turned into a fullblown error checker. logging overwritten entries, duplicate key / value pairs, incorrect data types, and validating any references to other blocks in the scripts... anywhere a string points to another thing in a script or file (ie: checking a item's model entry exists, and that model entry points to a existing .fbx etc)

#

just need to do vehicles then onto the .xml's

red tiger
#

Hmm ok. Yeah I'll need to work with vehicles. I didn't think I'd need to be doing nested objects like in templates.

#

My lexer should also be a linter. That's been my approach.

#

My non-location rendered JSON is nearly instantaneous. My location rendered JSON takes a little bit of time. I decided to write a cursor calculator approach to prevent desyncing from seeking in certain situations.

#

I could write good, but rigid code that speeds up locations being passed however that's basically debugging stuff.

#

locations are presented during errors though.

#

Going to skip rewriting my AST parser and work towards getting the desired JSON result..

#

I mainly did that for both fun and research / learning how to make an AST.

#

This language is too rigid / specific for an abstract tree.

quasi geode
#

still havent coded in a json converter, might have to do that after i take my whining dog for her walk

red tiger
#

I need a ZedScript > JSON and JSON > ZedScript solution before I begin working on my application.

#

Something I'll need to go through for my exporter that I hope will be fixed in b42 is the properties that are case-sensitive.

#

Besides mod_data, I'd expect property names to be PascalCased, however to be read without case-sensitivity. unhappy

#

BTW I'm performing checks on if property objects are not in their respective parent object's definition type.

#

So if clip is inside of model it'll throw.

#

EOF checks are in-place as well.

#

The big issue I have when it comes to consistency in ZedScript is that every category for definitions does not contain any whitespace.. except template vehicle.

#

Going to guess there's a string.toLowerCase().startsWith("template vehicle") check somewhere in the script Java code.. =/

frank elbow
#

It appears to accept one or more whitespace characters between the two words (although none of the vanilla scripts have any more than 1, from my quick glance)

hot patrol
# thick karma What's the end goal here?

so I have a mod that adds dakimakuras. all of them have an image on both sides. I want players to be able to choose which side is displayed when placed. so far the only idea I have it making a duplicate of the item for the other side but my mod already consists of duplicating the same item muliple times for different texture varients since weapons can't have multiple textures.

#

so my 30 items would go up to 60 just so you can show off the other side

thick karma
#

Yeah.

#

That's what I was gonna suggest.

#

Sorry

#

Lmao

hot patrol
#

lol well thanks anyways

thick karma
#

quietly hides

hot patrol
#

build 41 can't come soon enough. latest blog post says things like weapons will be able to have multiple texture optuions like cars can now

#

that would slim my mod down a bunch

#

and if the devs opened the placement option up for modders that would fix my flipping issue. Honestly if it's possibly I will lay down some cash right now to get an advance placement mod made

thick karma
#

@hot patrol Build 42*. Also, shot in the dark . . . have you tried this?

hot patrol
#

I'm thinking shift r to rotate one way alt r for the other axis and then maybe arrow keys to move up and down

hot patrol
#

i'm working blind and dumb

thick karma
#

I.e., if you store the inventory item object as, e.g., item, you may be able to call item:setWorldTexture("WorldObjectTextureName") and it might do a thing

#

I do not know, haven't tried it.

bronze yoke
#

i'd be surprised

hot patrol
#

hmmm

bronze yoke
#

chuck wanted to do something like this but couldn't, i'd be surprised if it was that easy and he missed it

thick karma
#

I don't think it'll change object but maybe the texture of the object

#

shrug

hot patrol
#

I mean these are the items in question. I think changing texture should be enough if that would work

#

these are how the items are textured

#

and yes, that's what you think

#

all I would need to do it swap the imaged so that if fits the model correctly

#

i'd try it but I don't know lua

thick karma
#

Haha time to learn. ๐Ÿ™‚

hollow shadow
#

im down bad

hot patrol
#

it's already in my mod

thick karma
#

@hot patrol

local Example = {}

Example.onFillInventoryObjectContextMenu = function(playerIndex, contextMenu, items)
    items = ISInventoryPane.getActualItems(items)
    local player = getSpecificPlayer(playerIndex)
    for index, item in ipairs(items) do
        if item:getFullType() == "YourModule.YourItemName" then -- Guessing a bit here.
            item:setWorldTexture("TheTextureNameYouWant")
            break
        end
    end
end

Events.OnFillInventoryObjectContextMenu.Add(Example.onFillInventoryObjectContextMenu)

return Example

You could try this.

thick karma
# hot patrol

Need to create textures for the models if they are not using textures yet

#

Presumably

deft falcon
#

what does baseRange and customTag mean

thick karma
hot patrol
deft falcon
#

could I just write nil for customTag

hot patrol
thick karma
#

Not necessarily. You could actually just make a generic function that takes one string as input and returns another.

#

And then just activate that function on every texture that exists in inventory.

#

And design it to simply return the same texture if an alternate doesn't exist in a table you made.

thick karma
fast galleon
deft falcon
fast galleon
#

I don't think so

deft falcon
#

k

fast galleon
#

I mean when you shout, it then leads to this but this doesn't cause any hearing

deft falcon
#

kk then

thick karma
#

If I could make colorful shout text that is also visible online, it would be cool to know that.

fast galleon
#

the strings above do that

#

they change behaviour slightly

#

but Say can be used with one string or all the vars mentioned above

#

the final function is: private void ProcessSay

fast galleon
#

r,g,b = 1,1,1

frank elbow
#

I mean more specifically than that lol

#

The shout chat is hardcoded to not accept colors in the overhead speech bubbles afaik

sour island
#

Say code does different things depending on whisper/shout etc

#

In order to get say() working I MP for cnd speech I used a command

thick karma
thick karma
frank elbow
#

Not all that important to what you're saying, but the speech bubble color differs per player (there's an option in settings to modify it under Multiplayer)

thick karma
#

Oh cool!

#

I did not know that!

#

Omg

frank elbow
#

I didn't know about the option until recently either. I was adding that feature to my mod & then came across sendPersonalColor and was like ???

thick karma
#

Personal Text Color

#

Duh

#

That's what Personal Text is

#

Of course lol

#

Amazing

glass basalt
glass basalt
red tiger
#

There we go. =)

#

Time to convert things over.

scenic cradle
#

...took a break at being frustrated by my code to go be frustrated with frozen pipes; ultimately decided the frustrating code is a better time.

sleek heath
#

fuck yea i got it working

#

enjoy

#

722 songs

#

:)

#

@prisma imp ^

#

got it working ayy

#

theres so many cassettes in containers now though lmao

#

probably because theres a lot of music added

#

lol

#

gotta catch em all

prisma imp
glass basalt
sleek heath
#

i kinda wish there wasnt as many cassettes in some of the things lol

#

i wish you could adjust the rate

bronze yoke
#

mfteotw has to use custom spawning logic to get around this

barren junco
sleek heath
#

its there

#

every banger

#

i do have songs after 1993 aswell but i wanted to stick to the lore

glass basalt
opal rivet
sleek heath
glass basalt
sleek heath
#

ah

sleek heath
glass basalt
sleek heath
#

yes

#

that would greatly help

glass basalt
#

It would be under lua\server iirc, not at PC rn

sleek heath
#

:)

glass basalt
#

Alrighty, I'll get on that soon, ttyl ๐Ÿ‘‹

sleek heath
#

yep

glass basalt
red tiger
#

I finally have recipes rendering as JSON..

weak sierra
#

you can fix the commonality by changing the rarities in ur own distribution file but

#

this is so much easier

#

spawn in blind boxes basically

weak sierra
#

i used to tweak the dist rates

#

but this made that unnecessary xD

sleek heath
#

but if this makes it easier then i'll give this a shot aswell

weak sierra
#

the way ibrrus wrote the distribution example makes it a pain to tweak

sleek heath
#

do they still spawn in regular containers?

#

or only special crates?

weak sierra
#

they spawn in the same places

sleek heath
#

ah ok

weak sierra
#

just instead of loose tapes

#

u find openable packs

sleek heath
#

just less frequent

weak sierra
#

yeah

sleek heath
#

ah

#

nice

#

thats useful

#

I'll give this one a try then

weak sierra
#

the example for dist in true music has hardcoded values for each song even tho they are the same value

#

i wish he'd written the script to use a variable at the top or smth

#

then it'd be so easy

#

whenever i write distribution files for N things of a type

#

i always make the rarity a value then make the entries use rarity / #items

#

that way if i add more items they stay the same rarity

#

i also use loops instead of manually writing a line for each

#

easier

#

but mostly i just wish he'd put the value in a variable kek

red tiger
#

mmmmmmmmmm

#

Well that's cool. Rewrote my parser and things are looking clean.

weak sierra
#

if anyone here wants to do in-house mod dev on an RP server with hardcore gameplay hmu i could really use other devs, it's just me and sporadically a friend of mine when he's available

sleek heath
#

makes it faster

weak sierra
#

yeah u can do that too

#

but like.. why did he write it like that to begin with

#

lol

glass basalt
sleek heath