#💻・modding-dev

1 messages · Page 336 of 1

brisk rose
#

I remember applying shaders to deckbacks being a point of discussion back in the 0.98/early 1.0 days

last sentinel
#

Any examples of mods that have a deck that has the player start with >52 cards? having trouble implementing that for myself and want to see how others have done it

brisk rose
daring heron
#

oh yeah, i also was wondering how i could make a deck like checkered deck but with diamonds and clubs

last sentinel
#

basically, a 5th set of A-K with random suit and wild enhancement

brisk rose
#

But that's not a reason not to have your own one in your mod

daring heron
#

mhm

#

dyk how?

sleek siren
#

How can I get a joker to act at the start of a blind?

brisk rose
daring heron
#

how do i look at the code again

daring fern
daring heron
#

forgor

sleek siren
daring heron
#

but, does no one know how i can apply the foil shader to a deck?

#

thatd be a first lol

brisk rose
#

Answer being just open it in a text editor or look directly at github

daring heron
#

how do i change this so it converts them into stamp cards instead of lucky?

valid dove
#

is stamp card a modded enhancement? if so change it to m_modprefix_stampkey

native zinc
#

m_[prefix]_stamp

daring heron
daring fern
native zinc
#

do you mean a seal

daring heron
#

yeah

#

i always confuse those cuz irl theyre called stamps i think

daring fern
daring heron
#

specific

#

just like

#

red seal or smth

daring fern
native zinc
daring heron
#

true

#

i barely use stamps

native zinc
#

seals help to close the envelope

#

they're Different

daring heron
#

wait how do you even get seals on cards

native zinc
#

standard packs, spectrals, and the joker

#

uhhhh

cerulean bane
#

spectrals usually let you do it yeah

native zinc
#

certificate

shell timber
#

certificate?

native zinc
#

ye

#

you should also be able to get them from Illusion but there's a bug and you can't actually

#

what's with all these thunks

daring heron
#

17 decks already lesgo

native zinc
#

i feel targeted with all these thunks . sm h

daring heron
#

damn

#

the thunks are local

native zinc
#

local thunk = {}

daring heron
#

now lemme see if my decks actually work cuz i havent tested like 8 of em

#

yall like my template sprite

native zinc
#

thunks on everything

daring heron
#

so real

native zinc
#

but that is a very silly placeholder sprite

#

i approve

daring heron
#

yay

#

now i gotta figure out how to add shaders to the decks

tall wharf
daring heron
#

very :3

#

hey somethingcom i added seals on the :3

karmic arch
#

:3

native zinc
#

is every thunk one idea for the Think joker

#

if so im such a good contributor to xmult

daring fern
daring heron
#

should i make a negative deck

#

negative playing cards work

daring fern
daring heron
#

only 1 visual bug tho

karmic arch
daring fern
karmic arch
daring heron
#

why did it make the negative cards double negative

#

thats the only visual bug

karmic arch
daring heron
#

it only happens the first time when you start up balatro

daring fern
daring heron
#

and when you interact with literally anything it turns them back to normal

daring heron
#

just not visually

daring fern
#

Wait, no the front is negative but the back is only negative_shine

daring heron
#

??

#

if you click on any of them even it just makes them normal

daring fern
daring heron
daring heron
#

fair

reef belfry
#

how would you define a new key for the message variable

#

more specifically what is the "a" in something like a_xmult

reef belfry
#

oh so v_dictionary

#

yeah tnx

sage crater
daring heron
#

does anyone know how i can add the foil/holo/poly/negative shader to some of my decks

maiden phoenix
daring heron
#

i tried, but it doesnt have enough information on how

#

for me at least

maiden phoenix
#

Check some mod that make use of it or the function Card:draw() in the vanilla code

daring heron
#

idunno how to get there

#

i just started modding 2 days ago lol

#

(and ive only been playing balatro for like a month)

maiden phoenix
#

Oh

daring heron
#

yeah

maiden phoenix
#

You know how to create SMODS object in the first place?

daring heron
#

i know how to make a deck

maiden phoenix
#

Close enough

daring heron
#

do you think you'd be able to help me?

maiden phoenix
#

I'm not on PC sorry

daring heron
#

fair

#

if you'd like to help me when you're on PC i'd appreciate that

maiden phoenix
#

That wont be until long sadly

daring heron
#

aight

#

i'll just see if someone else knows

#

thanks anyway

daring fern
# daring heron aight

Maybe this?```lua
SMODS.DrawStep({
key = "editiondecks",
order = 5,
func = function(self)
if self.area and self.area.config and self.area.config.type == "deck" then
-- following here is a horrendous mod compatability line
local currentBack = not self.params.galdur_selector
and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or type(
self.params.viewed_back
) == "table" and self.params.viewed_back or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
or Back(G.P_CENTERS["b_red"])
self.children.back:draw_shader(
'foil',
nil,
self.ARGS.send_to_shader,
true
)
end
end
})

daring heron
#

which parts can i delete/replace?

daring fern
daring heron
#

nice

#

now what if i want it on only 1 deck

#

okay but negative plasma deck goes hard

daring fern
# daring heron now what if i want it on only 1 deck
SMODS.DrawStep({
    key = "editiondecks",
    order = 5,
    func = function(self)
        if self.area and self.area.config and self.area.config.type == "deck" then
            -- following here is a horrendous mod compatability line
            local currentBack = not self.params.galdur_selector
                    and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or type(
                        self.params.viewed_back
                    ) == "table" and self.params.viewed_back or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
                or Back(G.P_CENTERS["b_red"])
            if currentBack.effect.center.key == 'b_modprefix_key' then
                self.children.back:draw_shader(
                    'foil',
                    nil,
                    self.ARGS.send_to_shader,
                    true
                )
            end
        end
    end
})
``` Replace `b_modprefix_key` with your mod prefix and the deck key.
daring heron
#

also somehow happened to fix the visual bug with negative cards

#

like this?

#

nvm, that doesnt do anything

daring fern
#

Also you should change your prefix to something else.

daring heron
#

like this?

#

stiill doesnt do anything

daring fern
daring heron
#

oh mb i thought you said did you remove the b_

#

tried to add them to more of the decks but it only applies it to the first deck with the shader

daring heron
#

Would send it here but it’s a lot of code

daring fern
daring heron
daring fern
daring heron
#

thanks

#

looks awesome

fading geyser
#

Hi, I'm making a mod with a joker that creates some negative jokers (including Canio) upon selling, however I get this error message: [SMODS Cryptid "Cryptid.lua"]:2033: attempt to index local 'center' (a nil value)
After a bit of digging, it turns out Cryptid overrides the vanilla create_card function, however from what I can see this part of the code is identical to vanilla, so I don't think Cryptid is the problem (I also want this mod to be compatible with vanilla fyi). The first image is the code in question, and the second image is the code from my mod.

daring heron
#

ralsei moment

fading geyser
#

that's what I did, isn't it?

daring fern
fading geyser
#

Ohhh

#

🤦

#

Welp, I feel like a fool

#

it works

#

I even triple checked my spelling, extra embarrassing

daring fern
daring heron
#

how would i go about making the unused braided deck?

#

(+3 levels for each poker hand at the beginning of run)

daring fern
daring heron
#

fair but i don't think thats a reason for me not to

daring fern
daring heron
#

unused one does

daring fern
#

Only most played hand.

daring heron
#

oh

#

nvm i didnt read that properely

#

just wondering if this line does anything

#

because it has --- infront of it

daring fern
daring heron
#

also how would i make this replace with random cards instead of turning them into lucky cards

daring fern
daring heron
#

yes but only rank and suit

daring fern
daring heron
#

kinda, its a combination of erratic and blank

#

since it would only replace 13

#

not the whole deck

reef belfry
#

this jus returns an error message, do i have to put it in another table or add like my mod prefix

daring heron
#

i already have a function for only affecting 13 random cards

#

but i want it to change them into random suits and numbers instead of just lucky cards

tall perch
daring heron
#

don't worry, i'm not gonna make that one today

tall perch
daring heron
#

thats why lol

tall perch
#

Does it go off planet card usage?

daring heron
#

i have no idea

tall perch
#

i see

daring fern
tall perch
daring heron
#

but does anyone know how i can randomize number and suit?

#

would actually be cooler if it was completely random

#

(with modifiers n stuff)

#

does anyone know how to do that?

daring fern
#

card being a card in G.playing_cards

daring heron
#

does that only do ranks and suits?

daring fern
daring heron
#

okay

dapper sun
#

where can i find the code for the edition tarots?

#

i can't find them in card.lua

daring fern
daring heron
#

seals, editions etc

dapper sun
#

i forgot the word,,

daring fern
daring heron
#

this doesnt seem to do anything

dapper sun
daring fern
daring heron
#

my bad

#

still doesnt work

daring fern
daring heron
#

all of it?

#

or only this deck

daring fern
daring heron
#
SMODS.Back{
    atlas = "decks",
    name = "Spare Deck",
    key = "sparedeck",
    pos = {x = 0, y = 0},
    loc_txt = {
        name = "Spare Deck",
        text ={
            "Start run with",
            "{C:attention}13  {}cards in deck"
        },
    },
    apply = function()
        G.E_MANAGER:add_event(Event({
            func = function()
                local cards = {}
                for i, card in ipairs(G.playing_cards) do
                    cards[#cards+1] = card
                end
                
                for i = 1, 13 do
                    local rank = pseudorandom_element(SMODS.Ranks, pseudoseed("seed"))
                    local suit = pseudorandom_element(SMODS.Suits, pseudoseed("seed"))
                    SMODS.change_base(G.playing_cards, suit.key, rank.key)
                end
                    return true
            end
        }))
    end
}
daring fern
daring heron
#

like this?

daring fern
daring heron
#

how do i make it also add random editions, enhancements and seals?

daring fern
daring heron
#

random chance

dapper sun
daring heron
#

tried replacing suit with seal but that didnt work

daring fern
#

mod_conv being the enhancement key.

dapper sun
#

ty

daring heron
#

do you know how i can make it randomize modifiers aswell?

dapper sun
daring fern
daring fern
ionic timber
#

so, what's the best way to cleanly delete something from a pool ? To prevent it from appearing ever again in the run, or at least "randomly" from booster pack/in the shop ; SMODS.remove_pool doesn't seem to work for me

gentle rain
#

:33< :{{

tall wharf
#

why don't you just not do it

dapper sun
hushed arrow
#

it doesnt matter if I split my mod into multiple lua files right? like one file for jokers one for planets etc

brisk rose
daring heron
#

is this too many decks

shell timber
daring heron
#

and also how would i give cards a random seal with a.. say 50% chance?

daring heron
eager pendant
#

Hint how to make the Joker match in the hand when there are 4 distinct Jokers in the hand

daring heron
#

2 full pages and 10 decks

#

nice

hushed arrow
#

how can I change this part of a card using take ownership?

daring heron
#

anyway how would i make cards for this deck have a 50% chance to get a random seal, enhancement and edition?

brisk rose
#

Might be easier to just throw it away 50% if the time

daring heron
#

How do i do that?

eager pendant
#

Hint how to make the Joker match in the hand when there are 4 distinct Jokers in the hand

gentle rain
#

:33< :??

#

:33< why thinking react

brisk rose
gentle rain
#

:33< the thinkerrrrrrrrrrrrr

dapper sun
#

Hold W to Ponder

daring heron
brisk rose
#

Just run each on every card in the deck, interacting through in a loop

#

And the 50% chance I think you already figured out

daring heron
brisk rose
#

It's okay, I've been here for over a year and still haven't really started yet

daring heron
#

You do seem to know a lot

#

Could you tell me what and where to put that code?

#

I already have a loop that repeats 13 times

#

Like, i know how to replace an exact number of random cards with another, but i don’t know how to make it replace a card into a random other card

dull wyvern
#

Do you guys have any idea why this pattern search might fail?

daring fern
#

SMODS patches it already.

#

You need to patch the patched.

dull wyvern
#

Damn

#

Uhh, is there a way to review smods patched source code?

daring fern
dull wyvern
#

Aight, thanks

daring heron
brisk rose
daring heron
#

oh, okay

#

i'm assuming i need to use a pseudorandom_element

#

but i honestly dont know how to set those up

daring heron
#

oh

#

then how?

daring fern
cursive sentinel
#

hi, is it possible to make a joker impossible to create through stuff like judgement tarot cards or riff raff joker?

daring fern
cursive sentinel
#

by defining you mean before loc vars?

daring heron
daring fern
daring heron
#

and what else do i need to add

cursive sentinel
#

like this for example?

daring fern
cursive sentinel
#

thank you !

daring fern
daring heron
#

but how do i fix the error?

cursive sentinel
#

oh right

daring heron
#

i don't know how to set up polls

#

so it's giving an error

daring fern
daring heron
#

okay and where do i put that stuff

#

inside the poll?

#

i have this i dunno what to do next

#

like.. this?

#

i barely know what i'm doing half the time, i need assistance

daring fern
daring heron
#

yeah mb

cyan lagoon
daring fern
daring heron
#

and then where do i put the args

#

oh wait nvm

wintry solar
#

You don’t need the type key

daring heron
#

now what?

#

idunno what to add

wintry solar
#

You don’t need to add anything

daring heron
#

but then how would it know what to choose from

#

or does it know that by default

crisp coral
#

it chooses from all seals in the game

daring fern
daring heron
#

okay

#

wait do i need to put this inside the deck?

cyan lagoon
#

how is this comparing boolean to a number?

brisk rose
brisk rose
#

You also have to have it in a for loop, looping over every card in the deck

daring heron
#

i currently have it just after the base atlas

#

should i put it in the function of the deck?

daring fern
daring heron
#

i have this rn

#

do i need to add anything to actually apply the seal?

#

or is it good

cyan lagoon
valid dove
#

regular brackets ()

#

not curly brackets {}

daring fern
glad osprey
cyan lagoon
daring heron
#

now what do i add

gentle rain
daring heron
#

for it to do smth

gentle rain
#

:33< felt very
:33< insulted

daring heron
#

i think the poll works, now i just need to make it actually set the cards

#

how do i do that again

#

tried this but it doesnt work

#

and like crashes the game

#

so how do i make it work

daring fern
hard flume
#

For the Pikmin Portion of The Carrot Field (my Balatro Mod)
I'm only going to start with red blue and yellow Pikmin, as I feel like I need to test the idea first in order to make sure it even plays well. Heck, I might even decide to just keep it to those three to avoid complicating things

tall wharf
#

😭😭😭😭

#

i never played pikmin

daring heron
#

tried to add multiple polls and now it crashes again

hushed arrow
#

when I'm using take ownership how can I disable the original effect/function?

daring fern
daring heron
daring fern
daring heron
#

oh yeah

daring fern
#

Also poll_edition is not SMODS

daring heron
#

hm?

#

like this?

#

or should the poll also be called ability

#

still doesnt work

#

how do i fix it?

daring fern
daring heron
#

huh??

#

theres SMODS before it

#

should it not have that?

daring fern
daring heron
#

like this?

daring fern
daring fern
daring heron
#

i really don't understand, what do i need to edit here and what should i put there

for i = 1, 52 do
                    local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
                    SMODS.poll_enhancement({ guaranteed = false})
                    chosen:set_ability (SMODS.poll_enhancement({guaranteed = false}))
                    SMODS.poll_edition({ guaranteed = false})
                    chosen:set_edition (SMODS.poll_edition({guaranteed = false}))
                    SMODS.poll_seal({ guaranteed = false})
                    chosen:set_seal (SMODS.poll_seal({guaranteed = false}))
                    table.remove(cards, index)
                end
                    return true
daring fern
daring heron
#

still crashes

#

how do i fix it?

#

it crashes whenever i start a run with the deck

#

how do i make it not crash lol

#

the crashing isnt intentional hah

#

so how do i fix it

daring fern
#

How would one make a joker that cycles through all the joker sprites every frame?

#

The only hard part I'm thinking is the jokers with soul sprites.

daring heron
#

still crashes

quartz ravine
hushed field
#

using SMODS.DrawStep to add this indicator, but not sure how I actually change the placement of a sprite. I want it to end up at the bottom, but I'm not sure what variables actually control its placement

quartz ravine
#

Check your mod prefix, make sure that works

daring heron
hushed field
quartz ravine
#

For reference, if this is an enhnacement you're using, it needs to be applied like this card:set_ability("m_Fox_grass", true)

Abilities are always prefixed by m_. Try changing it to m_b_zodiac

daring fern
quartz ravine
#

I don't have the problem, :), trying to help ceebee

daring fern
daring fern
daring heron
#

not one of mine

daring fern
hushed field
#

can you show the full code, Cebee?

#

Where are you running this?

vocal cedar
#

im having a terrible time understanding editions... like they seem SO complicated to code compared to simple jokers

Anyone have a good tutorial on editions? something simple not too complex?

im trying to create an edition that gives 1.65X Chips

Im also trying to add a "smelt feature"

Basically, if your current hand score exceeds the blind requirement, and your hand contained a stone card, it gets "smelted" into a Ceramic card, which still has no rank or suit, but gives 2.5X chips

anyone know how hard this could be or any ideas on how i could do this

i would PAY a mf to teach me editions man these are SO HARD

#

like

#

doesnt have to be now either

#

just man

#

i am STRUGGLING people 💀

daring heron
daring fern
hushed field
#

I've not messed around with editions yet, but besides the shader, they're very similar to enhancements, no? It shouldn't be too hard to get you to figure it out, soul. What's your code looking like for the edition atm?

#

And what's going wrong?

vocal cedar
#

had a rebrand

#

anyway

hushed field
#

hahahahaha

vocal cedar
#

nothing is WRONG yet

#

like

#

looking at a friends "template" for ONE edition and bro had to like

#

remade almost everything

#

and he didnt know a better way to do it

#

one sec

quartz ravine
vocal cedar
#

please

vocal cedar
#

like im talking polychrome foil holo... how would your edition work on a joker lol?

quartz ravine
#

Check this out 🙂 . It's an edition. Interestingly I found that Joker's need to have a separate calculation step for an edition to work on them.

hard flume
#

Hi chat!

quartz ravine
vocal cedar
#

ooh cool

vocal cedar
#

looking now

rapid stag
quartz ravine
#

Hi folks, does anyone know how to add content to this pane?

hushed field
quartz ravine
#

I've seen other mods add a 'Credits' tab but I would rather do this

daring fern
rapid stag
glad osprey
hushed field
quartz ravine
brisk rose
rapid stag
brisk rose
#

comma seperated lists are common there

glad osprey
#

change the mods description lol

crisp coral
#

it's controlled by the draw_shader if you have it

hushed field
#
                    blind_indicator_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center, scale_mod, rotate_mod)``` I do, yeah!
crisp coral
#

.

#

actually let me just take the lobcorp code

hushed field
#

It does make sense that the code that wiggles it also places it

crisp coral
#
self.children.lobc_prey:draw_shader('dissolve', 0, nil, nil, self.children.center, 0.1, nil, nil, 0.1 + 0.03*math.sin(1.8*G.TIMERS.REAL) + self.T.h*-0.2, nil, 0.6)
self.children.lobc_prey:draw_shader('dissolve', nil, nil, nil, self.children.center, 0.1, nil, nil, self.T.h*-0.2)

for the self.T.h*-0.2, lower value means sprite is higher

#

i think

rapid stag
#

yeah, 0, 0 starts at the top left

#

...or is it the bottom

crisp coral
#

top left

hushed field
#

ah that makes sense. lm check to see which argument is which, so I don't actually erase a necessary nil, haha

#

ms mr mx my? are these new genders?

hushed arrow
#

how can I make a card similiar to hiker but it adds mult to the card instead?

glad osprey
#

frosted prime rib

daring fern
faint yacht
#

Hiker example, but perma_mult instead, yeah.

hushed arrow
#

aight thanks

rapid stag
#

@hushed fielddid you ever get that working?

hushed field
#

Thanks for the help, y'all

hushed arrow
#

if I seperate my mod into several files like jokers, backs, decks etc is there a specific thing I need to do for the game to "read" them? that you wouldnt usually have to do if you had everything in one file?

quartz ravine
#

Sweet, this looks good to me 🙂

daring fern
willow plinth
#

tired coding is also really brainrot btw

#

but also, the smods contexts are ruining me

willow plinth
hard flume
#

Hi :3

willow plinth
#

hi carrot

#

if i do if context.after and context.cardarea == G.play then it never enters that
if i do if context.after then it fires too soon 😭

red flower
#

what do you want to do

willow plinth
#

i want to modify_rank a random scored card after scoring

quartz ravine
#

Hi N', I am sooo inspired by the way you organized your code for your mod. I feel like we could just make a community style guide based on your mod as reference!

willow plinth
#

i also tried final_scoring_step but that felt too soon as well

red flower
#

i want to organize it a bit better honestly

red flower
hushed field
willow plinth
red flower
#

what ice said

willow plinth
#

ahhh okay, i need to wait for events i see

#

makes sense, thanks guys

atomic jolt
#

Hi guys, is there some documentation somewhere that contains all the things that start like G.something?

hushed arrow
red flower
atomic jolt
#

Where in the code can I find that?

willow plinth
daring fern
atomic jolt
#

Ah, thanks guys

willow plinth
# atomic jolt Ah, thanks guys

but i think G also gets updated dynamically all over the place

probably a good idea to do print(inspect(G)) or print(tprint(G)) right before you use it

quartz ravine
#

Jumping back and forth from C#, C++ and yaml for work to Lua and PowerShell for afterhours / fun stuff is breaking my brain

red flower
#

i work with python so its not that hard but sometimes i write "then" after if statements lol

hushed arrow
quartz ravine
#

Hi folks, somehow my toggles are out of sync with my mod config. When I do a print statment, I can see the value is set correctly, but the toggle does not show this

I want the toggle to default to enabled and the user can disable it if they like (or have bad taste)

#

In my config.lua I end with returning these vals as true.

atomic jolt
hushed arrow
placid star
#

can you make your own loc_colours?

red flower
willow plinth
quartz ravine
atomic jolt
willow plinth
#

like especially print(inspect(G)) and print(tprint(G)) are huge

red flower
hard flume
#

How would I go about adding a button to a Joker? Not making it functional right now, I just need to add a new button and go from there

hard flume
#

I'm not sure anyone knows how to answer that one

#

The cycling Joker one

hushed field
quartz ravine
willow plinth
#

animated base sprite is just as easy

hard flume
daring fern
red flower
hard flume
#

Yeah!

red flower
#

you can hook card:highlight and modify self.children.use_button

hard flume
#

Ty!!

willow plinth
# daring fern Please share, but I still need to know a fix to the legendary problem.

i can share it in typescript and transpiled lua, here is the ts, which should still be readable

i basically yanked this from Aura though but simplified a lot of it

jokers here is basically just an array of SMODS.Jokers

and for base sprite instead of soul sprite, you can change every instance of soul_pos to just pos

const jokerEntries = Object.entries(jokers);
const jokerNames = new Set(jokerEntries.map(([key, value]) => value.name));

const defaultFps = 30;

const oldUpdate = G.update;

/**
 *
 * @param dt
 * @example
 */
const newUpdate = function (this: typeof G, dt: number) {
    oldUpdate.call(this, dt);

    for (const [jokerName, joker] of jokerEntries) {
        if (!joker.animation) {
            joker.animation = {
                frames: 60,
                immediate: true,
                target: 0
            };
        }

        if (!joker.animation.t) {
            joker.animation.t = 0;
        }

        joker.animation.t += dt;

        if (joker.animation.t > 1 / (joker.animation.fps || defaultFps)) {
            joker.animation.t -= 1 / (joker.animation.fps || defaultFps);
            joker.animation.next_frame = true;
        }
        else {
            joker.animation.next_frame = false;
        }

        if (joker.animation.next_frame) {
            const loc = joker.soul_pos.y * (joker.animation.frames) + joker.soul_pos.x;

            joker.animation.target = loc + 1;

            if (joker.animation.immediate && joker.animation.target) {
                joker.animation.target = joker.animation.target;
            }

            if (joker.animation.target >= joker.animation.frames) {
                joker.animation.target = 0;
            }

            joker.soul_pos.x = joker.animation.target % (joker.animation.frames);
            joker.soul_pos.y = Math.floor(joker.animation.target / (joker.animation.frames));
        }
    }
};

const oldSetSprites = Card.set_sprites;

/**
 *
 * @param c
 * @param f
 * @example
 */
const newSetSprites = function (this: typeof Card, c: any, f: any) {
    oldSetSprites.call(this, c, f);

    if (
        jokerNames.has(this.config.center.name) &&
        this.config.center && this.config.center.soul_pos &&
        this.config.center.atlas
    ) {
        if (this.children.floating_sprite) {
            (this.children.floating_sprite as unknown as typeof SpriteType)
                .set_sprite_pos(this.config.center.soul_pos);
        }
        else {
            this.children.floating_sprite = Sprite(
                this.T.x,
                this.T.y,
                this.T.w,
                this.T.h,
                G.ASSET_ATLAS[this.config.center.atlas],
                this.config.center.soul_pos
            ) as typeof SpriteType;
            this.children.floating_sprite.states.hover = this.states.hover;
            this.children.floating_sprite.states.click = this.states.click;
            this.children.floating_sprite.states.drag = this.states.drag;
            this.children.floating_sprite.states.collide.can = false;
            this.children.floating_sprite.set_role({
                draw_major: this,
                major: this,
                role_type: "Glued"
            });
        }
    }
};

const oldCardDraw = Card.draw;

/**
 *
 * @param layer
 * @example
 */
function newDraw(this: typeof Card, layer: any) {
    if (
        this.config &&
        this.config.center &&
        this.config.center.pos &&
        jokerNames.has(this.config.center.name)
    ) {
        this.set_sprites();
    }

    oldCardDraw.call(this, layer);
}

G.update = newUpdate;
Card.set_sprites = newSetSprites;
Card.draw = newDraw;
#

and with the jokerNames.has(this.config.center.name) everywhere i make sure only my jokers get animated

quartz ravine
#

Ah, I found my issue! My mod used to be called FoxesGarden and the config file still referenced that, so it wasn't getting updated. Thanks @red flower

cursive sentinel
#

if i have used a centralized method for my mod (putting everything in the main.lua), how hard it is to transition into at least a separate localization file?

willow plinth
#

oh and replace floating_sprite with front if you want to animate the base sprite

red flower
cursive sentinel
#

is it in the docs?

red flower
#

yes but it doesnt say more than i did lol

willow plinth
#

@daring fern i can also share the transpiled lua but it has a lot of noise

cursive sentinel
#

mh, and i put it where? in my main.lua? or in the localization luas?

#

and im not sure if smods loc files have a particular structure too

#

(and i hate french translation, it's horribly inconsistant and unclear)

willow plinth
glad osprey
#

question why does lovely mod patching not work on macs?

red flower
#

I know it has something to do with the compiler that mac uses by default but I don't understand any of that

willow plinth
#

but where does it not work?

red flower
#

you can look at the discussion in the lovely discord

glad osprey
glad osprey
red flower
#

i think it was fixed tho but they still havent finished the release

glad osprey
#

apple TMD fans in shambles

#

(they gotta deal with a smaller galdur menu)

willow plinth
#

oh shit what am i missing out on on macos?

glad osprey
red flower
#

for most mods the problem is lovely patching smods, like to add new cardarea calculations

#

but the most important one is jokerdisplay support with morefluff : )

glad osprey
#

still doesnt work?

#

just cuz something should work doesnt mean it does 😭

#

thats like programmer 101

willow plinth
#

jokerdisplay with morefluff works on my machine

red flower
#

maybe it's not all macs

#

but definitely some

shell timber
#

it's colour cards

willow plinth
#

are people not starting balatro with sh run_lovely_macos.sh ?

willow plinth
cursive sentinel
glad osprey
willow plinth
#

i though you were on mac

glad osprey
#

no

willow plinth
#

okay

glad osprey
#

windows

proud moon
#

does anyone know how i would make a joker use both mult_mod and chip_mod AND show the messages for both? would i need an event for it?

red flower
glad osprey
hushed field
proud moon
#

ah ok

glad osprey
#

com im revoking your human rights

#

im gonna

#

idk but im gonna do something

willow plinth
#

maybe stop lovely patching?

willow plinth
#

i don't get it why it's needed for mods anyway, why not just hook? or maybe i'm dumb and don't see the reason

glad osprey
#

you would have to rewrite the entire function

#

dont do that.

#

that is a mod incompat factory

#

COUGH COUGH CRYPTID COUGH COUGH

red flower
#

rewriting an entire smods function is worse because that updates more frequently as well

#

and they literally provide an easy way to add more cardareas through patches

willow plinth
#

how so? set your priority to load after the mod you are depending on, check if the function exists in your code and then do the ol'

old_fn = fn_from_mod

function fn_from_mod() {
old_fn()
-- do your stuff here

} 
hushed field
#

I guess a solve could've been if smods patched in a custom function to hook where those targets are, though if order matters, you're still out of luck. Though that's gonna be an issue with any patching

red flower
willow plinth
#

i see

woeful stratus
glad osprey
red flower
#

if functions didnt have side effects then maybe but sadly this is not functional programming

willow plinth
#

yeah no i get that

#

hm

glad osprey
#

patching is just so much more convenient

red flower
#

i still do hooks when i dont need to rewrite everything tho

glad osprey
#

yea

willow plinth
willow plinth
#

thanks

glad osprey
#

get prepared for many issues down the line

willow plinth
#

maybe i'll do it if the patch format ever supports doing a patches.pattern where payload can be a file path

glad osprey
#

...

#

oh

#

i see

cursive sentinel
#

is it possible to add spaces within a {X:colour} ?

#

it always crushes it

glad osprey
#

or {X:colour} {}

cursive sentinel
#

no like {X:red,C:white}Something Something{}

#

and for it to give Something Something instead of SomethingSomething

glad osprey
#

huh

#

that shouldnt happen

willow plinth
cursive sentinel
#

it makes two boxes then no?

glad osprey
#

or is it an issue with X specifically

cursive sentinel
#

(with french translation...)

glad osprey
#

ah

willow plinth
glad osprey
#

i figured X was a stand in and not x mult

willow plinth
glad osprey
#

what happens if you do {X:mult}A{X:mult}B{}

#

does that create two boxes aswell

willow plinth
#

@cursive sentinel

Unlike the similar Defined background modifier {X:}, {B:} does not remove or change the whitespace of styled text, so displayed contents will remain the same as their input string.

#

try it with B

glad osprey
#

oh yea that works too

red flower
cursive sentinel
#

so B is like X but better?

#

will try

red flower
#

B is like V but for the background

glad osprey
#

it should look the same tho right

willow plinth
#

X is also for background but only for defined ones

glad osprey
#

just with whitespace

willow plinth
red flower
willow plinth
#

aight i could live with patching if i abstract out as much as possible

glad osprey
#

idk why you insist on overcomplicating it this much 😭

red flower
#

most of my patches are 1 line long anyway

glad osprey
#

its literally not that hard

cursive sentinel
cursive sentinel
#

'créer {B:tarot,C:white}La Mort{} quand',

red flower
#

pls log

cursive sentinel
#

ok

willow plinth
willow plinth
cursive sentinel
cursive sentinel
#

B doesnt use colours as X

glad osprey
cursive sentinel
#

so gotta declare colours, thanks !

glad osprey
#

like N said most of the time its single lines

red flower
#

sometimes i code the patch in the file i want to patch for highlighting and then copy that

glad osprey
#
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1})"
position = "at"
payload = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1e100})"
match_indent = true
#

this is literally what one of my patches for tmd looks like

red flower
#

what if i have 1e100+1 consumables

glad osprey
#

womp womp

modern kindle
#

you get a free bar of soup

red flower
#

yay

glad osprey
#

and an expensive bowl of soap

willow plinth
red flower
#

i love eating soap

willow plinth
#

priority takes over then?

red flower
glad osprey
#

if its an at patch then one will happen the other wont (typically) otherwise its just priority

red flower
#

"at" patches are the most dangerous ones

#

i still use them a ton because UI code is a mess

glad osprey
#

most of tmd's at patches either are inconsequential or contain the original code

modern kindle
#

not if i change ur patches

glad osprey
#

wait can you patch patches 😭

modern kindle
#

that would be pretty peak

glad osprey
#

very very stupid but also funny

red flower
#

im turning your patterns to regex

willow plinth
#

a modding api that patches all the hard coded values in game.lua would be nice

#

to configurable ones

daring heron
#

anyone know how i can disable the sounds of the cards for my deck here

willow plinth
#

so then mods don't need to patch anymore (for the most part)

glad osprey
#

i really need to move some of my qol patches and stuff to their own api

daring heron
#

it's kinda annoying hearing 13 of those sounds

long frigate
#

whats the context for a joker like oops

glad osprey
#

not context

#

add_to_deck and remove_from_deck

long frigate
#

ohhhhhh

red flower
glad osprey
#

seperate funcs

long frigate
#

tyyy

long frigate
#

or other way around i think is how vanilla works

glad osprey
#

seperate funcs

long frigate
#

oh

#

im dumb

#

mb

#

lol

hushed field
#

The values I patch I generally patch to make them adjustable without causing issues. Like changing odds for lucky cards on a per card basis that doesn't mess with other mods

glad osprey
#
-- This function is called when the card is added to deck. from_debuff is true whenever a card gets debuffed and then undebuffed.
    -- Debuffs usually call both of these functions, essentially, when a joker is debuffed, it's simply removed from your jokers, except for the fact that it takes up a slot.
    add_to_deck = function(self, card, from_debuff)
        -- Changes a G.GAME variable, which is usually a global value that's specific to the current run.
        -- These are initialized in game.lua under the Game:init_game_object() function, and you can look through them to get an idea of the things you can change.
        G.GAME.round_resets.discards = G.GAME.round_resets.discards + card.ability.extra.discard_size
        G.hand:change_size(card.ability.extra.hand_size)
    end,
    -- Inverse of above function.
    remove_from_deck = function(self, card, from_debuff)
        -- Adds - instead of +, so they get subtracted when this card is removed.
        G.GAME.round_resets.discards = G.GAME.round_resets.discards - card.ability.extra.discard_size
        G.hand:change_size(-card.ability.extra.hand_size)
    end
    -- Because all the functionality is in remove_from_deck and add_to deck, calculate is unnecessary.
#

from the merry andy modded vanilla code @long frigate

long frigate
#

ty

daring heron
red flower
#

no

#

please read some programming basics

glad osprey
#

its F all over again

#

hey @daring heron quick test

#

what do you think a function called play_sound would do

daring heron
#

probably play a sound

glad osprey
#

correct

#

do you think youd need to ask a discord server what that function does upon seeing it for the first time

sturdy compass
#

Squid has ptsd after the F debugging incident

willow plinth
#

which incident?

daring heron
glad osprey
#

ok nevermind it isnt f all over again

sturdy compass
daring heron
#

damn

sturdy compass
#

Sent a screenshot and asked “What does this do” unironically

glad osprey
willow plinth
glad osprey
hushed field
willow plinth
glad osprey
#

hurts my eyes though

daring heron
#

how do i make it silent tho, idunno which line actually makes it silent, but one of these does in one of my different decks

daring fern
glad osprey
daring heron
#

where can i add it, just after the function?

glad osprey
#

im going to slap you

daring heron
#

oh yeah

red flower
daring heron
#

this does

glad osprey
#

look at it

#

inspect it

sturdy compass
#

That’s an edition

glad osprey
#

see what it does

proud moon
#

you might want to learn general programming structure for lua, it will make problem solving a lot quicker

sturdy compass
#

Not an enhancement

glad osprey
#

they want an edition

daring heron
glad osprey
#

they want it to be silent

sturdy compass
#

Ah

daring heron
#

can i ask what i did to be slapped tho

sturdy compass
#

You were told silent is a function parameter

willow plinth
# daring fern No, It's only vanilla jokers, and I couldn't figure out how to make it slower th...

okay so for the fps (this is straight from aura):

if not anim.t then anim.t = 0 end
anim.t = anim.t + dt
if anim.t > 1/(anim.fps or 10) then
    anim.t = anim.t - 1/(anim.fps or 10)
    next_frame = true
end
if anim.extra then
    if not anim.extra.t then anim.extra.t = 0 end
    anim.extra.t = anim.extra.t + dt
    if anim.extra.t > 1/(anim.extra.fps or 10) then
        anim.extra.t = anim.extra.t - 1/(anim.extra.fps or 10)
        next_frame_extra = true
    end
end

and for vanilla jokers: i can't really help a lot there, because as i said Aura, which is also supposed to modify vanilla jokers, has the same bug you shared in the video for me...Aura additionaly changes SMODS.injectJokers

daring heron
#

i know what to add, but i have no idea where

daring fern
daring heron
#

since it already has true, true

#

dont know what it does cuz ice made it for me

#

but that confuses me

red flower
# daring heron i know what to add, but i have no idea where

Learn to program in Lua. Lua is a popular scripting language that is widely used by many apps and game engines including Roblox, Manticore, Solar 2D (formerly Corona SDK), Defold, Cocos2Dx, neovim, minetest, Amazon Lumberyard, WoW, Adobe Lightroom, and many other great tools.

In Part 17, we examine how to pass arguments to parameters in fun...

▶ Play video
willow plinth
sturdy compass
daring fern
rough furnace
#

Silly idea for a mod: make a joker for every food you have for supper

sturdy compass
#

That actually sounds like a really fun idea

proud moon
glad osprey
daring heron
glad osprey
#

caps lock

#

whoos

#

that was not meant to be caps

willow plinth
glad osprey
#

no it doesnt thats in poll edition

daring heron
#

and poll edition is inside of set_edition

sturdy compass
glad osprey
#

yes

daring heron
glad osprey
#

you are giving those to poll edition

#

not set edition

daring heron
#

well how do i give it to set edition

sturdy compass
#

I’m boutta crash out

red flower
#

lol

daring heron
#

nvm then

#

i'll try to figure it out on my own then

red flower
#

the reason we're not giving you the answer is because if you don't learn how to pass arguments to functions you're going to have a really hard time

sturdy compass
#

Do you have access to base game source code

proud moon
tall wharf
#

:3

willow plinth
glad osprey
#

when i said this wasnt f all over again i was a fool

red flower
#

please dont mock people too much for trying to learn

sturdy compass
#

At least they’re for coherant than F lol

glad osprey
#

true

sturdy compass
#

I respect the grind but man

#

It can be a lot

glad osprey
#

and have enough critical thinking to understand what a function does

willow plinth
sturdy compass
#

You are doing a great job at explaining this, bravo

red flower
daring heron
#

honestly i tried and the code sucked

glad osprey
#

I respect anyone that doesn't just chatgpt

sturdy compass
daring heron
#

yeah

#

i fixed it

glad osprey
#

ngl at some point we should've started charging F per question

willow plinth
# daring heron i fixed it

btw i think people are frustrated because even gpt 3 could have fixed your issue if you prompted it better lol

glad osprey
daring heron
#

oh

#

well, thanks everyone for the help

glad osprey
#

atleast you were trying to learn so thank you for that

red flower
modern kindle
#

You're all gonna be in shambles when I release my mod all balatrogpt

daring heron
red flower
#

a mod that is all AI but it's actually someone pretending that is all AI and just making up hallucinations would be funny

#

like those fake AI scripts

shell timber
#

i wanted to like resprite default jimbo at 100x100 and scale it down to 71x95 and put it in as "AI Joker"

#

and add like a 4th thing to the hat or something

sturdy compass
willow plinth
sturdy compass
#

It’s genuinely insane behavior

shell timber
#

people who use llms for ideas confuse me

#

people who regularly use llms actually

sturdy compass
red flower
modern kindle
sturdy compass
#

Honestly that’s not a half bad idea

willow plinth
#

do i really also need to start using stuff like "/jk" here like an insane person 😭

modern kindle
#

Damn n has me blocked he hates me

red flower
modern kindle
#

Lmfao

red flower
#

the blocked part

sturdy compass
glad osprey
#

cant believe n blocked me i was just asking how to play a sound 😔

modern kindle
red flower
#

noooo

daring heron
#

can i have a kitkat

daring fern
red flower
#

i do have some frequent posters blocked tho

modern kindle
proud moon
#

does anyone else use llms as a faster form of typing because sometimes it can predict your next line of code based on what you already wrote? (or to check syntax because having a 2nd pair of "eyes" is nice)

sturdy compass
#

I do not

shell timber
#

i do not

red flower
proud moon
#

i guess if you are already proficient there is no point

glad osprey
#

what is llms

shell timber
#

intellisense is a good ide feature, full on code completion is yuck

red flower
#

i had to disable all the copilot shit vscode enabled for me recently

shell timber
glad osprey
#

ah

proud moon
glad osprey
#

I only use that stuff when I'm programming for roblox bcus i don't know enough about roblox programming

shell timber
glad osprey
#

so yea basically

modern kindle
#

At most I've used things to help me figure out where the fuck i missed a comma if an error is obscure, but I dont often have that here since vscode is pretty good about telling me where smth fucked up
Gmod lua errors when I missed a comma use to fuckin obliterate me

proud moon
sonic cedar
#

How else does calculate_effect work? I'm trying to use a function for general scoring but using unpack doesn't let the guy score. So i tried putting it in calculate_effect but I'm getting a parameter error? What did i do wrong? (unpack version left in for comparison)

sturdy compass
sonic cedar
#

oh so literally i can just do an ifthen context and just drop it in

sturdy compass
#

No

sonic cedar
#

darn

#

what would i do instead if im not just moving it out of the return?

glad osprey
#

someone should remake this with F and the text being "showing our constant beggar things they've never seen"

#

Last one just being a lua 101 website

shell timber
#

Documentation

willow plinth
#

i admire people that have the time and are so anti ai, they rather go line by line through error logs full of garbage spanning literal meters instead of just giving it to an llm and see if they can find it faster

glad osprey
glad osprey
shell timber
sturdy compass
willow plinth
shell timber
#

i mean i guess yeah

#

at least you're not using it for full code completion (I Hope)

glad osprey
shell timber
#

that stuff actually rots your brain

modern kindle
#

But noooooo it's so convenient guys

sonic cedar
sturdy compass
#

Ah ok

willow plinth
#

i'm also talking from a position where i learned to code without llms (because they kinda didn't exist yet)

so maybe while learning to code one should not use llms or just very sparingly

shell timber
#

the main issue with constantly asking an llm (or a discord chat for that matter) is that you can't move forward if you keep getting the answer given to you

sturdy compass
frosty rampart
#

the other issue with using an llm imo (at least just generally feeding your code to chatgpt or whatever) is that it's NOT SUPPOSED TO BE USED FOR PROGRAMMING. it's a model that predicts how the english language works. it's mashing stackoverflow posts together into something that at least superficially looks right, and maybe it actually functions but maybe it doesn't

sonic cedar
sturdy compass
#

The ome you just sent

brisk rose
#

thinking is for losers, but good luck getting any balatro mod coding done with an llm

willow plinth
sturdy compass
#

That way you can have your helper funtion and the functionality you want

glad osprey
#

hey guys what does create_card do

hard needle
#

video ai will always look like shit.. image ai will always look like shit.. llms will always get better.. what more does AI have to complete

sonic cedar
#

got it!! off to test

shell timber
sonic cedar
modern kindle
keen tiger
shell timber
#

eh i guess

keen tiger
#

that way you arent piping balatro's code off to a remote server

shell timber
#

look if you keep asking the same question then that's the problem

brisk rose
sturdy compass
modern kindle
#

Agreed there yea

sturdy compass
#

Yeah just put a , card after the table in your calculate_effect parameters

shell timber
#

i remember back in the early days of modding when someone said "i asked an llm for variants of your Blood Pact joker, now you should add these!"

glad osprey
#

new speech bubble just dropped

shell timber
#

True...

keen tiger
modern kindle
willow plinth
#

the actual issue is reading comprehension and adhd, llms can actually explain some concepts or issues pretty well, doesn't mean people will magically care more about taking the time to understand

brisk rose
#

I think llms surpress thinking insofar only as things like calculators and google do

glad osprey
shell timber
#

this guy has lived rent free in my head for a year now i guess

#

i wasn't

glad osprey
#

BRO

sturdy compass
glad osprey
#

"hey I know you didn't ask but here's some ideas for your mod that an ai thought of since i can't have original thoughts"

shell timber
#

and then he proceeded to post two shitty ai images with The Joker wearing some crown of thorns thing

sturdy compass
modern kindle
#

I have totally used ai for names cause I can't ever think of cool names lmao

willow plinth
sturdy compass
hard needle
willow plinth
#

my main quest in this discord is converting people to monospace fonts

shell timber
#

ai for placeholder art and names are Yuck. have a shitty ms paint drawing named tempname412 as has been done before

brisk rose
sturdy compass
#

If I were on my computer rn (which will be soon) I’d show an example for you

hushed field
glad osprey
sturdy compass
#

I just ripped Cryptid’s placeholder atlas for placeholder sprites lmfao

glad osprey
#

ai def can be good (just look at doug doug or vedal) but most of the ways it's used are terrible

shell timber
#

i'm not actually blanket ai ban i just cant think of a good use for it

hushed field
#

I tried working with placeholders but at this point I just make art before I get into something

frosty rampart
#

peak art

modern kindle
sturdy compass
#

Still not there…

glad osprey
#

the only reason I made placeholder art for TMD was because someone else is working on it now and they don't do art 😭

sturdy compass
#

Hold on imma do this for ya

brisk rose
sonic cedar
sturdy compass
#

LMFAO

hard needle
frosty rampart
brisk rose
#

Also names being AI is such a triviality. If you get a good idea for a name from an ai, who the fuck cares

glad osprey
#

rate the placeholder art

glad osprey
sonic cedar
glad osprey
#

because i needed placeholder art

proud moon
#

ive got a question,

sonic cedar
#

so ask it

glad osprey
#

no

modern kindle
#

Guys what if we are all placeholders

glad osprey
#

next person

red flower
#

ive got an answer: 42

brisk rose
#

I don't like AI joker art because it looks like shit, but I do not object to it on a deeper level, but again, this discussion is very overplayed recently

proud moon
#

i meant to press shift+enter not enter, oops

shell timber
hard needle
#

guys i have a question about a question about a question

#

can i ask my question about a question about a question

glad osprey
#

hey guys can I ask if it's okay to ask about asking

sturdy compass
# sonic cedar OK.

This is literally all it should be. Cut down on a little extra fluff for ya too (sorry notmario, your fluff is not welcome here >:( )

sonic cedar
modern kindle
#

Guys I dont have a question

shell timber
#

i made a less fluff joker dw

glad osprey
#

guys i took someone's question

frosty rampart
#

in terms of actual art for my mod, i'm uh. slowly learning

modern kindle
sturdy compass
#

I am so blessed to have dedicated artists for Maximus 😭

willow plinth
hushed field
#

I'll end on the note (to prevent taking this over for more ai discussion, ofc) that generally with any technology, it's not some inherent cancerousness that makes it detrimental. The issue with llms and learning aren't inherently llm based, just harshly enabled by them. But at the core is the same issue that makes social media, google search, and youtube algorithms detrimental, which is that there's patterns that enable and then promote behaviours that are detrimental, and use is prioritized over correctness. The nuanced take, I guess, is 'phone bad' but this time a zoomer says it. The entire crux of it comes down to the use case and accessibility of it, and LLMs make this worse due to feeding into sci-fi narrativization that even people that work in the ai field can't properly separate themselves from

modern kindle
#

Ive had to bribe my artist with mcdonalds

glad osprey
shell timber
#

okay yeah im not inherently anti ai im anti ai slop

hushed field
long sun
#

hihi, quick question

#

daft question

glad osprey
#

british

shell timber
#

do ask