#💻・modding-dev

1 messages · Page 620 of 1

mystic river
#

you can't assign values in a return table

#

card.ability.extra.Xmult = card.ability.extra.Xmult + 2 needs to be taken out of there

mystic salmon
#

oh, I see, I need to put it after if and before return

#

right?

daring fern
granite jay
#

How do I like, link a sound file to the "erupt" string?

candid acorn
#

how does the game make the legendary jokers unable to show in the shop? i cant find it anywhere

daring fern
mystic salmon
candid acorn
#

so it wont show up in the shop

daring fern
wind steppe
candid acorn
#

thank

#

s

#

guys

granite jay
daring fern
brave blade
#

By chance, are there any Modifier APIs that let me easily add modifier objects to the run with calculate functions and (possibly) other effects as well?

daring fern
brave blade
daring fern
brave blade
#

I think I'll need to set up a new object type

#

Effectively, I want to have a deck that randomly applies certain modifiers to your run from a selection

hardy vessel
#

Is it possible to have a voucher appear in the shop again after redeeming it?

candid acorn
#

        if #context.full_hand > 5  and context.after and not context.blueprint and context.joker_main then
            
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_gain
            return {
                message = 'Upgraded!',
            }
        end

        if context.joker_main then
            return {
                mult_mod = card.ability.extra.mult,
                message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
            }
        end
    end```
im trying to make a joker wich benefits you for playing hands with more than 5 cards but i get an error because #context.full_hand = nil. I think i forgot a context in the if but i dont know wich one, can anyone help?
daring fern
brave blade
red flower
daring fern
brave blade
hardy vessel
slim ferry
# red flower

voucher spawn checks are wierd so that doesnt work

#

it has a check for G.GAME.used_vouchers instead which takes priority over everything else afaik

red flower
#

i love documentation

slim ferry
#

well

#

this isnt inaccurate

#

its just that vouchers are wierd

#

and have things that override normal spawn rules

red flower
#

it is incomplete then

slim ferry
#

fair

daring fern
brave blade
hardy vessel
#

Best cause is to basically make the voucher "unredeem" itself after use?

red flower
hardy vessel
brave blade
red flower
#

i would pr it so allow_duplicates works

#

let me see if it's easy

slim ferry
#

i mean a PR to allow that and SMODS.Showman to work for vouchers would be cool

#

though it would require also changing showman to not affect vouchers

red flower
#

hmm good point i think it would be better for it to be a different value

slim ferry
#

SMODS.Voucherman

red flower
#

!!

slim ferry
#

is ts peak

granite jay
#

How do you make a joker that disables the joker to the right?

red flower
#

why does it allow showman but then check the vouchers in the shop

why is the voucher logic in this condition at all

#

is it literally just for the unlock check

daring fern
granite jay
#

How do you detect when the joker tries to trigger when disabled?

#

Cos I wanna make it so the joker gains mult if the disabled joker tries to trigger

brave blade
#

Is there any documentation on SMODS.GameObject?

slim ferry
#

no

#

because its just the very basic love2d game object that every SMODS object is an extension from

#

and theres no reason to use it over anything else

#

also there is just nothing to document because it has nothing

mental nacelle
#

is there a way to get rid of the padding on the left and right of a cardarea?

red flower
#

cardareas are not very customizable

#

wow i just found a typo

mental nacelle
#

paddin

mental nacelle
slim ferry
#

that should be possible

#

there are cardareas that do not tilt the cards

#

afaik

brave blade
#

So I created a custom object type by extending SMODS.GameObject, now how do I create an instance of it?

tranquil gull
#
if not next(SMODS.find_mod("Talisman")) then function to_big(...) return ... end end

function get_inverse_blind_amount(score)
    local score = to_big(score) / to_big(blind_amt(8))

    if score < to_big(10) then -- Less than 10x ante 8's size
        for i = 1, 12 do
            if score < to_big(blind_amt(i)) then return i end
        end
    end

    if score < to_big(50) then
        return math.floor(1.728 * (math.log(score) ^ 0.458) - 0.595) + 8
    elseif score < to_big(1e6) then
        return math.floor(1.877 * (math.log(score) ^ 0.4235) - 0.701) + 8
    elseif score < to_big(1e20) then
        return math.floor(1.688 * (math.log(score) ^ 0.433) - 0.386) + 8
    else
        return math.floor(1.0205 * math.sqrt(10 * math.log(score) / math.log(math.log(score))) - 2.425) + 8
    end
end

made an approximation for an inverse of balatro's scaling

brave blade
#

Didn't expect to see you here lol

solid salmon
#

is there a way to make probability stuff retrigger

daring fern
slim ferry
tranquil gull
#

lol

tranquil gull
tranquil gull
slim ferry
#

its safer

tranquil gull
#

ig

slim ferry
#

and cdataman isnt talisman but it also adds to_big

brave blade
tranquil gull
#

i'll just check if not to_big then

tranquil gull
slim ferry
solid salmon
#

hey guys is there a way to retrigger probability based cards

brave blade
daring fern
# solid salmon hey guys is there a way to retrigger probability based cards
calculate = function (self, card, context)
    if (context.repetition or context.retrigger_joker_check) and SMODS.post_prob and next(SMODS.post_prob) then
        local passed = false
        for k, v in pairs(SMODS.post_prob) do
            if v.trigger_obj == context.other_card then
                passed = true
            end
        end
        if passed then
            return {repetitions = 1}
        end
    end
end
slim ferry
#

if youre creating something that has no visual sprite or anything like a calculate its probably not worth extending for

tranquil gull
slim ferry
#

also if its tied to the deck

#

just save the enabled modifiers

#

and do everything in the deck calculate

brave blade
#

Ok sure I'll do that I guess

slim ferry
#

you could also look at one of the a lot of other mods that extend tags to have an indicator for stuff on the top right that also has a calculate

daring fern
solid salmon
#

yes

daring fern
solid salmon
#

1.0.0-beta-1016c

slim ferry
#

like ortalab or entropy

daring fern
slim ferry
#

those add tag-like things that go in the top right of the screen

#

to indicate effects

solid salmon
#

also yes i do

daring fern
near coral
#

Retriggering successful probabilities I intent to include jokers, consumables, card enhancements/editions, blinds, etc.

near coral
#

Basically if it's a probability and gets a hit it happens again

solid salmon
#

yeah

near coral
#

Or at least has the chance to happen again if that's easier

tranquil gull
solid salmon
#

also feel like adding a silly little buff to it

tranquil gull
near coral
daring fern
solid salmon
daring fern
#

Or hook eval_card

solid salmon
umbral zodiac
solid salmon
#

i havent even "patched" anything yet

solid salmon
#

...

#

sorry im feeling a lil stupid rn

#

uhhhh

daring fern
solid salmon
#

oh

#

wait

#

when you say hook you mean???

daring fern
solid salmon
#

...

#

ok neat

#

so thats just making up contexts

#

uh

brave blade
#

Why isn't this printing anything? It doesn't work even if I call the function manually with DebugPlus. I have a feeling I'm doing something obviously wrong but idk what

brave blade
#

Ok

vale grove
#

okay so i released my mod and i have a joker that replaces the language to dutch, however he got this error
He got this error from buying it with a negative icrecream

#

idk how or why

#

ive been trying to replicate it

#

but i just cannot

#

does anyone have any ideas?

#

okay finally its something to do with pulling it from a pack\

spring lantern
#

game crashes at the end of each boss blind when trying to fetch a new voucher to add to the shop, restarting the game fixes it... why the fuck is there a boolean in the voucher pool

#

wait it says debugplus

#

what

#

oh thats just the error handler nvm

solid salmon
#

i know you told me to hook card eval

#

but like

#

how is that supposed to help with balatrue?

daring fern
vale grove
#

okay so how do i delay add_to_deck to after the joker is obtained (or add a little delay or smth)

solid salmon
#

And if its card_eval

#

Do i need to add any additional code or nah?

vale grove
hardy vessel
hardy vessel
daring fern
hardy vessel
#

That seemed to have done something. The voucher is appearing over and over again, with the tier 2 voucher not appering (but I don't plan on making a voucher like this with a tier above, so that's no issue)

pseudo furnace
#

Is there a way to add/set specific cards to a new deck in the apply script?

daring fern
pseudo furnace
gilded narwhal
#

hey guys so how would i make a 3d environment in balatro? /srs

daring fern
brave blade
#

So I just realized that this won't work because I can't use the return values properly... is there a better way to do this or do I need to patch get_card_areas() to add my modifiers in there?

daring fern
brave blade
daring fern
brave blade
#

It's working now, thanks for your help!! :D

paper trout
cerulean rose
#

if you want to do something when the round ends, i'd reccomend using a mod calculate function

lavish elm
#

how to get the current voucher limit?

daring fern
daring fern
lavish elm
red flower
paper trout
#

ty both

desert ore
#

I want to make something with a similar effect to observatory, which is phrased as "Planet cards in your consumable area", do you think if I had it phrased as "Held consumables" it would be fine?

paper trout
#

sounds good to me

paper trout
paper trout
#

local chips_scored = G.GAME.chips
if chips_scored > 100000 then
...
why is this crashing? it says its attempting to compare number with table but both of them seem like numbers to me

daring fern
umbral zodiac
paper trout
#

ok ty

umbral zodiac
#

note that if you do this, you should also include to_big = to_big or function(x) return x end in your main file, or you should make your mod require talisman

#

otherwise your mod will crash when you don't have talisman

#

what that line does is make sure to_big is always a function in case you don't have talisman

hardy viper
#

this tal guy is quite the man

umbral zodiac
#

tal is man, good for him 🏳️‍⚧️

hardy viper
#

meow

#

when i get home im making a debugplus command for tmj

#

not for any particular reason

paper trout
#

sorry if im asking too many questions but is there any way to set the player back to the small blind (i swear this is less devious than it sounds)

azure ember
#

Is there a way I can give consumables the spectral shader without adding them to the spectral set?

azure ember
umbral zodiac
#

well theyre slightly different solutions

#

im asking because if you only want one then you can just add it to the card itself, if you want multiple then you should use a drawstep which is barely different

daring fern
azure ember
#

Can i get an explanation of how to do both pls

#

Or the doc

umbral zodiac
#

for individual card, add ```
draw = function(self, card, layer)
if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
card.children.center:draw_shader('booster', nil, card.ARGS.send_to_shader)
end
end

azure ember
#

Tysm

umbral zodiac
#

for a whole set itd be something like this ```lua
SMODS.DrawStep {
key = "spectral_shader",
order = 11,
func = function(card, layer)
if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
if SHOULD_DRAW_SHADER then --replace with whats relevant to you
card.children.center:draw_shader('booster', nil, card.ARGS.send_to_shader)
end
end
end
}

brave blade
#

Why does pseudorandom_element() sort its pool before choosing an entry?

primal robin
#

for consistency of course

red flower
#

it adds the keys to another table with pairs so the order of that isnt guaranteed

brave blade
#

Ah got it

#

And it needs to be consistent through reloads

paper trout
#

why does opening this pack from the tag crash the game? the tag appears fine and i can open the pack by itself fine but if i open it from a tag it just crashes
-# yes i used jokerforge im not good at this

paper trout
#

I am blind

#

sorry

versed swan
#

what's the best way to debug achievements? like they dont reset on profile reset and stuff, just generally annoying to develop

twilit tundra
#

how does get_straight work again? does it only give you the first straight it finds, or does it give you all possible straights within the hand? (with giving it a smaller value than 5)

#

not seeing any documentation on it on the wiki

#

got no clue what it returns

red flower
#

im pretty sure it returns all straights

frosty rampart
#

yes it returns a table containing all straights
here's the code

twilit tundra
#

is there a get_flush like get_straight? searching smods, i see one call to it, but i can't find the function anywhere in smods or vanillaremade

#

does it exist?

cerulean rose
#

have you searched the balatro source

#

we really should have a tutorial on that in the pins

twilit tundra
cerulean rose
#

extract balatro.exe as a zip

daring fern
twilit tundra
#

huh?

cerulean rose
#

the lovely dump also includes any patches made by mods

#

SMODS is a mod

cerulean rose
# twilit tundra huh?

%appdata%/Balatro/Mods/lovely/dump contains a dump of the source with any lovely patches made by mods applied

frosty rampart
# twilit tundra huh?

when you run any mods with SMODS, a lovely folder gets added to your mods folder. this contains a dump folder, which dumps the patched source code of all the vanilla files that are patched by any mods you ran (including SMODS). there's a good chance the code for get_flush is in there somewhere

cerulean rose
#

(if mod files are patched, they appear here too)

twilit tundra
#

fuck
ok get_flush is not modified by smods to have the same min_length parameter as get_straight
guess its time to reimplement it

cerulean rose
#

smods hasnt been updated in 10 days…
hrrm…

cerulean rose
reef belfry
#

can you tooltip stickers (not as in the sticker being actually applied more like something akin to a consumable referring to another consumable)

#

Im guessing you cant

frosty rampart
#

you should be able to

#

hang on

twilit tundra
umbral zodiac
#

yes

twilit tundra
#

gives me that vibe

#

ok thats a fun convention i like that

umbral zodiac
#

stuff like that and SMODS.showman(?)

frosty rampart
reef belfry
#

its not a custom sticker though

frosty rampart
#

in that case you can just do key = "eternal" (or rental or perishable) in the line i gave you

red flower
reef belfry
#

okay i guess it was actually that simple

wind steppe
#

anyone know what function generates the blind description ui in the collection?

twilit tundra
#

okay
is SMODS.Suits not a table with every suit?

red flower
#

it is

#

you know you can print stuff with debugplus right

cerulean rose
#

if ur using ipairs on it that wont work

#

ipairs only traverses numeric keys of a table

#

SMODS.Suit's keys are the suit key

twilit tundra
#

im doing a for loop based on #SMODS.Suits and it seems to be 0????

umbral zodiac
#

# implies numeric keys

cerulean rose
#

yeah, # also only counts numeric keys

umbral zodiac
#

use pairs()

#

in fact i would get in the habit of just using pairs most of the time unless you have a reason not to

#

its worked out fine for me

twilit tundra
#

so #pairs(SMODS.Suits)?

cerulean rose
#

no

umbral zodiac
#

no #

#

just pairs

twilit tundra
#

or do i skip the #

red flower
#

for key, value in pairs(SMODS.Suits)

twilit tundra
umbral zodiac
#

what do you want to do with the number

cerulean rose
#

thats the neat part, you dont

twilit tundra
red flower
cerulean rose
#

run for each suit

daring fern
umbral zodiac
#

if you do it the way N' said you dont have to do an numeric for loop since value will just be the suit object

versed swan
red flower
#

also order

umbral zodiac
#

i just feel like

#

90% of the time for balatro purposes its not integer keys

#

like p_centers and stuff like that

cerulean rose
#

i wouldnt say that

#

like G.hand.cards is numeric keys

red flower
#

i almost never loop through something that isnt number indexed

twilit tundra
#

i forgot, am i just able to do for _,suit if i dont care about the key

cerulean rose
#

yes

#

but also Card:is_suit takes a key

umbral zodiac
#

suit.key should exist tho

#

so you can save characters or not really

cerulean rose
#

and save a table lookup

twilit tundra
#

how do you scroll the debugplus log without the scroll wheel mine's broken and does not like to work

#

ah its in the lovely terminal

twilit tundra
daring fern
stuck ore
#

elseif link < 1 and #G.jokers.cards == G.jokers.config.card_limit then G.GAME.joker_buffer = G.GAME.joker_buffer G.E_MANAGER:add_event(Event({ func = function() SMODS.add_card { set = 'Joker', key = 'j_gros_michel', edition = "e_negative", eternal = true, rental = true, key_append = 'pnr_pplus_gross_michelle' } G.GAME.joker_buffer = 0 return true end })) return { message = localize('k_plus_joker'), colour = G.C.BLUE, } end
So I have this function to add a joker (Gros Michel) but I'm failing to have them be eternal and rental, is it possible to add those qualities from spawning them from a joker?

daring fern
#

Also it's stickers = {'eternal', 'rental'}

stuck ore
#

Thank you tons!

stuck ore
daring fern
stuck ore
#

Ah. Is there a way around that or should I reimagine the idea?

daring fern
stuck ore
#

And then would I just put that within the function to spawn the joker?

daring fern
stuck ore
#

Thank you a bunch for the assistance, it is now perfect... Until I come back because I find out that when I sneeze my computer explodes

cerulean rose
#

1 clock cycle on a 1GHz cpu is 1e−9 seconds

granite jay
#

How do you reskin/overwrite small blind and big blind?

#

and disable all boss blinds?

obsidian spear
final jewel
#

Why it doesnt increase the blind size

obsidian spear
#

needs to be updated probably

#

like text and chip requirement

#

sure you add the mult, but the chips wont change since it was already calculated

cerulean rose
#

also ur modifying the blind object table

obsidian spear
#

oh that too

#

needs to be blind.mult

cerulean rose
#

so all future encounters will have that changed until the game is restarted

obsidian spear
final jewel
#

I am trying that ?

obsidian spear
#

get_blind_amount(G.GAME.round_resets.ante)*blind.mult*G.GAME.starting_params.ante_scaling
i think this is the line for the chips

#

i think

cerulean rose
#

you could also see how multiplayer does it

obsidian spear
#

this is how a mod i helped with does it atleast

final jewel
#

oh

#

my way as work

obsidian spear
cerulean rose
obsidian spear
obsidian spear
cerulean rose
#

still dont understand how, the blind size text isnt a dynatext object

#

maybe the mod u helped with changed that

final jewel
#

but is 0.25 for each upgraded card strong or weak

obsidian spear
cerulean rose
#

hm maybe thats it

obsidian spear
cerulean rose
#

cus what i had done was trying to modify it in the blind select menu

final jewel
#

for all upgraded card in deck

obsidian spear
obsidian spear
#

which is more than showdown boss blind

obsidian spear
#

it really depends on the jokers you added, and how easy they are to get

#

if theres alot of op ones, then yea probably, but if not maybe do x0.1

#

just try calculating it and see if its a large amount

final jewel
#

its more like + 2X if you have upgraded card

obsidian spear
#

people will either have alot of modified cards or none though

final jewel
#

oh upgraded card are not normal enhance one btw

thorn pumice
#

could someone help me understand why G.P_CENTER_POOLS.Joker only has vanilla jokers when i try to use it in my code :p thought it should have all

obsidian spear
#

how easy are they to get?

#

and how many would an alright deck have?

daring fern
final jewel
daring fern
#

You have to use SMODS.Centers for the modded jokers.

final jewel
obsidian spear
#

-# consumeable is the internal name consumable is the correct spelling sorry

#

ah i see

#

thats pretty good idea

obsidian spear
#

i've mixed them up alot

final jewel
#

I alway taught it was 'ea' so I learn something from u

cerulean rose
thorn pumice
#

it does! but i ran eval G.P_CENTERS["j_crafty"] so maybe im wrong

final jewel
#

I think since this is a blind that appear at min ante4 It should be 0.25

stuck ore
#

SMODS.add_card { set = 'Joker', key = 'j_cavendish', edition = "e_negative", force_stickers = true, stickers = {'perishable'}, key_append = 'pnr_pplus_gross_michelle', cost = 2 }
I was curious if there was a way to change the cost of a spawned in joker and if so what that would look like

cerulean rose
#

just set extra sell value after

#

see egg

cerulean rose
final jewel
obsidian spear
#

ooh

thorn pumice
final jewel
#

seals has usualy 2 upgrade + and ++ and enhancement has one

daring fern
cerulean rose
#

also no you dont G.P_CENTERS also has modded jokers

daring fern
cerulean rose
#

oh ok

stuck ore
# cerulean rose just set extra sell value after

So where would this be put in the function to spawn in the joker, egg uses a function in its calculate:
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then -- See note about SMODS Scaling Manipulation on the wiki card.ability.extra_value = card.ability.extra_value + card.ability.extra.price card:set_cost() return { message = localize('k_val_up'), colour = G.C.MONEY } end
And I'm not sure how to implement that into the spawning joker function:
SMODS.add_card { set = 'Joker', key = 'j_cavendish', edition = "e_negative", force_stickers = true, stickers = {'perishable'}, key_append = 'pnr_pplus_gross_michelle', card.ability.extra_value = 2, card:set_cost(), }

cerulean rose
#

you set the value after creating the joker

#

SMODS.add_card returns the card just created

reef belfry
#

are the seal keys just red blue purple gold or like red_seal or something else

daring fern
reef belfry
#

tnx

stuck ore
#

I'm still a little confused as I don't believe I understand where the change sell value goes, I've put it here but it doesn't change the sell value of 5:

G.GAME.joker_buffer = G.GAME.joker_buffer
                G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.add_card {
                            set = 'Joker',
                            key = 'j_cavendish',
                            edition = "e_negative",
                            force_stickers = true,
                            stickers = {'perishable'},
                            key_append = 'pnr_pplus_gross_michelle',
                        }
                        G.GAME.joker_buffer = 0
                        return true
                    end
                }))
                card.ability.extra_value = card.ability.extra_value + 2
                card:set_cost()
                return {
                    message = localize('k_plus_joker'),
                    colour = G.C.BLUE,
                }```
red flower
stuck ore
#

ah I missed one

red flower
#

also you're changing the cost of the card that is doing the effect not the card that you add, is that intended?

stuck ore
#

Nope I am foolish, basically I want this to create a joker but I find that the sell value it comes in at is too powerful for the purpose

cerulean rose
#

well right now ur increasing is sell value even further

stuck ore
#

Just trying to understand it, then I'm gonna have it lowered

red flower
#

you should save the added card ( local added_card = SMODS.add_card{...} ) and then change the value of that inside the event (so before return true)

obsidian spear
red flower
stuck ore
#

Likely just inputting it wrong but it hasn't seemed to change the value, sorry I'm having such trouble with this I'm going straight to sleep after this from being awake for like 23 hours

G.GAME.joker_buffer = G.GAME.joker_buffer
                G.E_MANAGER:add_event(Event({
                    func = function()
                        local added_card = SMODS.add_card {
                            set = 'Joker',
                            key = 'j_cavendish',
                            edition = "e_negative",
                            force_stickers = true,
                            stickers = {'perishable'},
                            key_append = 'pnr_pplus_gross_michelle',
                        }
                        G.GAME.joker_buffer = 0
                        card.ability.extra_value = card.ability.extra_value + 2
                        card:set_cost()
                        return true
                    end
                }))
                return {
                    message = localize('k_plus_joker'),
                    colour = G.C.BLUE,
                }```
red flower
red flower
obsidian spear
#

🙏

stuck ore
#

Oh my god it finally works, thank you a very great amount more than necessary

red flower
#

but to animate a joker what i do is use update or a drawstep to change the sprite position

obsidian spear
#

i mean should i just ask thunder?

red flower
#

probably

obsidian spear
#

seems viable

reef belfry
#

how would I go about finding 3 random cards held in hand

cerulean rose
obsidian spear
#

yart

red flower
obsidian spear
#

where is the variable or wht ever

#

found it

#

[[Joker]].config.center.pos

red flower
reef belfry
#

does stuff like enhancements and seals always apply at the end of an event

red flower
reef belfry
#

wait

red flower
#

waiting

reef belfry
#

ive been jabbing at it by switching the events that apply the seal and unhighlight it

#

i want the seal to apply while its highlighted

red flower
#

that looks funny

#

what's the code

reef belfry
#

I did it the otherway around to where the seal application was under the highlight event it was basically the same

red flower
#

set_seal has an event i think yeah

reef belfry
#

so.... i have to..

#

patch...?

red flower
#

remove the event around setting the seal i think

#

you shouldn't have to patch

reef belfry
#

how would I go about that doing that then

#

I have absolutely 0 clue how events work

obsidian spear
red flower
#

dont put that in an event

reef belfry
#

oh

red flower
#

it would change the prototype but not the sprite itself

obsidian spear
#

it works because I told it to

red flower
#

🤷‍♂️

tired kestrel
#

Have been trying to like do the jpeg thing but somehow it ended up like this

#

It's almost close to being done

reef belfry
#

actually why did I even put it under an event in the first place

#

actually nvm

tired kestrel
#

okay how do I fix this?

#

I'm so close but for some reason it showing the texture of the jokers

obsidian spear
#
    calculate = function(slef, card, context)
        local results = {}
        local other_joker = nil
        for i, other_joker in pairs(G.jokers.cards) do
            if other_joker == card then other_joker = G.jokers.cards[i-1] end
        end

        if other_joker then
            table.insert(results, SMODS.blueprint_effect(other_joker, card, context))
            table.insert(results, SMODS.blueprint_effect(other_joker, card, context)) -- mitosis
        end

        return SMODS.merge_effects(results)
    end
#

why no work :(

umbral zodiac
#

what does no work mean

#

crash or no crash

obsidian spear
#

no0 crash

#

it just doesnt copy :(

#

shit i should of printed stuff

umbral zodiac
#

log everything and you will see where its going wrong and then it will be way easier to figure out the solution

obsidian spear
#

wait does it need ipairs?

umbral zodiac
#

theoretically no but probably try it

obsidian spear
#

wait no its finding the joker

#

like i can see it

#

fuck me

#

the variable name

#

ihml

umbral zodiac
#

oops lmao

tired kestrel
obsidian spear
#

wait it still no work

#

also whaty

#

@umbral zodiac pretty please js recode this, why doesnt it work

#

im just gonna check vremade

#

i've js stolen it so hope it works

#

why does nothing work

#
    calculate = function(self, card, context)
        local other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i - 1] end
        end
        return {SMODS.blueprint_effect(card, other_joker, context), SMODS.blueprint_effect(card, other_joker, context)}
    end,

wawawawawawawa

red flower
#

that won't work it needs merge_effects

wintry solar
#

I wonder if I should make blueprint effect accept a table of cards similar to destroy cards 🤔

pastel kernel
#

How do you check for debuffed cards

elder rune
#

card.debuff

junior tapir
#

I have logic that I want to have some jokers debuffed and the debuff stay pass the end of round, but I think the game automatically removes any debuffs at end of round (the custom joker only applies debuffs and has no end of round logic). I looked into the end of round function, but I cannot find out at which point the debuff is removed (that's why I provide video footage, you can also see how these jokers don't trigger)

tired kestrel
#

After many tried I managed to do a JPEG (almost) shader.

cerulean rose
tired kestrel
cerulean rose
#

thx for absolving me of making that by doing it first

#

what does JPEG edition do btw?

tired kestrel
reef belfry
#

what does that even do

maiden phoenix
reef belfry
#

oh yeah that makes sense

junior tapir
elder rune
#

No problem

umbral spire
#

I want to make a joker gain xmult when a spectral card is used, how do i do that?

slim ferry
#

step 1: copy constellation
step 2: change the set check from "Planet" to "Spectral"

primal robin
#

🤯

slim ferry
#

what

#

fym vouchers

mental nacelle
#

does UIBox_button support passing args to the button function?

primal robin
#

no

mental nacelle
#

more G.FUNCS functions for me i suppose

umbral spire
#

😭😭

slim ferry
#

😭

primal robin
#

With UIBox_button you cannot define own variables in element's config

umbral spire
primal robin
#

Unless you want to do mth like r.nodes[1].config.your_var = 1

tired kestrel
#

I tried this but I got this:

stone dagger
#

Hello, any idea why this crashes the game?

local card_ui_ref = generate_card_ui

function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end)

    return card_ui_ref(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end)
end

stone dagger
#

which one?

normal crest
#

at the end, called card

stone dagger
#

where is that?

#

the function definition I found doesnt have that

#

is there another place where it's defined?

normal crest
#

In the lovely dump

#

under Mods/lovely/dump

stone dagger
#

oh ok

#

I wasn't are lovely changed this function

#

what does that card arg do?

#

it might be pretty useful for me right now

#

and I haven't messed with the UI yet in my mod so this is new territory for me

daring fern
stone dagger
#

makes sense

#

is that added by SMODS?

red flower
stone dagger
#

damn thanks

#

also SMODS already does exactly what I wanted to do by default xD

#

So I was just reiventing the wheel

#

the power of reading documentation

weary merlin
#

is there a context variable or a method to detect cards that are played but not used in scoring?
i'm assuming you'd probably subtract array elements or something but i don't know how to do this (it's been a while since i did lua)

#

probably would cycle through each card played and check if it's a member of the scored hand

red flower
#

if you ever need to do the latter thing, SMODS.in_scoring(playing_card, context.scoring_hand) works

daring fern
#

twilit tundra
#

feeling like im not returning the right thing in this hand part because while it does seem to recognize when its this hand... no cards score

so uh. how do i get the cards to actually be scoring

        --eject early if hand is too small
        if #hand < (SMODS.four_fingers('straight') -1) then return {} end
        straightsTable = get_straight(hand, SMODS.four_fingers('straight') -1, SMODS.shortcut(), SMODS.wrap_around_straight())
        if next(straightsTable) == nil then return {} end
        bobtails = {}
        for _,straight in pairs(straightsTable) do
            --have to reimplement the flush calc because unlike get_straight, smods doesn't modify it
            for suit,_ in pairs(SMODS.Suits) do
                local t = {}
                local flush_count = 0
                for i,_ in pairs(straight) do
                    if straight[i]:is_suit(suit, nil, true) then flush_count = flush_count + 1;  t[#t+1] = straight[i] end
                end
                if flush_count >= (#straight) then
                    table.insert(bobtails, t)
                end
            end
        end
        if next(bobtails) == nil then return {} end
        return { bobtails }
    end```
#

straight flush but with only four cards (but the four cards have to both be part of the straight and the flush, having cards only part of one of the two doesnt count)

#

right now it.. works except none of the cards actually score

#

so im guessing the bobtails table doesnt contain the right things its looking for or something?

#

they're all played but unscoring, it only gives the hand's base score

#

what?

#

oh wait

twilit tundra
#

dont just give me completely different code that does work i want to understand why what i did isn't working

#

also im looking at this code and i dont think itd do what i want?

wouldn't this make say, H_9 H_10 C_J H_Q H_K count?
i explicitly dont want something like that to count

red flower
#

what if you return bobtails

#

instead of { bobtails }

twilit tundra
#

isnt that syntaxically equivalent?

red flower
#

no?

#

why would it be

twilit tundra
#

wait what the fuck

#

why did that fix it ??????

red flower
#

because you were returning a table of a table of tables of cards

#

it was nested too deep

twilit tundra
#

ty

normal crest
#

np

versed swan
#

How are Lovely patch files targetted by Lovely? Do they need to be in a specific folder, or they just need to be a properly formatted TOML file that can be placed in a folder that's fairly nested

red flower
#

i think they plan to allow nesting in the next version

versed swan
#

gotcha, thank you

umbral zodiac
#

mainly because i was going to say the same thing and then i lost my phone in my bed

quick prairie
#

is there a simple way to check if a scored card counts for more than one suit? I see has_any_suit, but i think that's just for wild cards

red flower
#

I don't think there's api support for anything that's not wild cards

#

you could check all suits one by one

quick prairie
#

yeah, i was hoping it'd be simpler than that but oh well, thanks

distant junco
#

how does set_cost work? ive tried looking through vanillaremade but im not getting at all

daring fern
distant junco
#

yeah but how do i use it

daring fern
distant junco
#

do i literally just put the number in the parentheses

distant junco
#

then what do i de then

#

thats what i was asking

daring fern
distant junco
#

yea

prisma loom
#

Folks, is there a quick guide how to make a new color for text that color shifts like dark edition?

daring fern
# distant junco yea
card.ability.extra_value = (card.ability.extra_value or 0) + number
card:set_cost()
prisma loom
#

I dont understand it

distant junco
prisma loom
#

There's no example

daring fern
red flower
bold oar
#

yeeaah stuff like this way outta my league as someone frankensteining code together

distant junco
bold oar
prisma loom
#

Holy moly, my saviour

#

exactly what I am looking for

tropic tundra
#

ello ^^
been using the "Dark And Colorful" texturepack from daluigi (https://www.nexusmods.com/balatro/mods/393?tab=images)
I've noticed it breaks hologram's floating effects for some reason

dark and colorful does reimplement a bunch of how the game renders cards, but I'm not sure how its exactly breaking because the implementation seems almost identical to how it is in the example steamodded implementation of vanilla objects

any idea why its breaking like this?

granite jay
#

How do you retexture small blinds and big blinds?

bold oar
primal robin
daring fern
bold oar
#

cheers

mystic salmon
#

how do I check owned jokers for editions? I want to make a joker that gives x2 mult per each negative jokers, kinda like baseball card with uncommons

#

I tried to come up with a context check but I dont understand how to build a proper logic

faint yacht
#
if context.other_joker and context.other_joker.edition and context.other_joker.edition.negative then return { xmult = 2 } end

is simplest.

mystic salmon
#

thanks, I'll try it

midnight trellis
distant junco
#

why it doing nothing :(

wintry solar
#

Just PR your version

daring fern
distant junco
#

THATS WHAT YOU TOLD ME TO DO

#

🤬🤬🤬🤬🤬🤬

daring fern
primal robin
#

@wintry solar, I thinked a little bit, and if you need help with reviewing SMODS PRs in theory I can help, at least with filtering

#

So if someone requests review in PR, I can review first and if it "lgfm" then pass to you + aura

solid salmon
#

im trying to make this retrigger cards after they had a success in their pseudorandom

#

and someone told me to hook eval card

daring fern
distant junco
#

no

daring fern
distant junco
#

oh ok

plush depot
#

im trying to remake card arts with the take ownership thing, can someone just send an image of the code for it here cuz im clueless lol

granite jay
twilit tundra
#

where is the primary_colour field of a consumable type used again?

#

the secondary is used for the badge color, but.. wheres the primary used?

frosty rampart
#

pretty much nowhere

wind steppe
#

as far as i know it's actually nowhere

primal robin
#

nice api

frosty rampart
#

when i opened the PR for the text colour field, i actually tried replacing the primary colour field, but smods undid that when they implemented it

twilit tundra
#

incredible

#

so fucking funny that the one called primary is the one that doesnt do shit

primal robin
#

btw ik no one cares but I'm working on Handy 2 blursed

twilit tundra
#

the worst part about coding a consumable is having to do all the juice fx stuff waAwaAWAWAWwAWawaaW

mystic salmon
twilit tundra
#

like somehow for me the visual fx for when the consumable does things is like. 10 times harder to wrap my head around than the actual effect

distant junco
#

are vouchers not included in G.I.CARD?

wind steppe
#

i think only while theyre on screen

#

vouchers arent actively loaded they just have apply functions and they set something in a table to true

daring fern
distant junco
#

ah gotcha

spring lantern
#

how can i get the localized name of a joker from its key

daring fern
twilit tundra
#

okay, i've got three selected cards and want to sort them based on the order they're in the hand

this feels stupid there's gotta be a better way than this

    if(G.hand.highlighted[1].T.x > G.hand.highlighted[2].T.x) then
        if(G.hand.highlighted[1].T.x > G.hand.highlighted[3].T.x) then
            rightmost = G.hand.highlighted[1]
            if(G.hand.highlighted[2].T.x > G.hand.highlighted[3].T.x) then
                middle = G.hand.highlighted[2].T.x
                leftmost = G.hand.highlighted[3].T.x
            else
                middle = G.hand.highlighted[3].T.x
                leftmost = G.hand.highlighted[2].T.x
            end
        else
            rightmost = G.hand.highlighted[3]
            middle = G.hand.highlighted[1]
            leftmost = G.hand.highlighted[2]
        end
    else
        if(G.hand.highlighted[2].T.x > G.hand.highlighted[3].T.x) then
            rightmost = G.hand.highlighted[2]
            if(G.hand.highlighted[1].T.x > G.hand.highlighted[3].T.x) then
                middle = G.hand.highlighted[1].T.x
                leftmost = G.hand.highlighted[3].T.x
            else
                middle = G.hand.highlighted[3].T.x
                leftmost = G.hand.highlighted[1].T.x
            end
        else
            rightmost = G.hand.highlighted[3]
            middle = G.hand.highlighted[2]
            leftmost = G.hand.highlighted[1]
        end
    end```
#

is there?

wind steppe
#

I think. I think G.hand.highlighted automatically sorts itself based on that

twilit tundra
#

nope, it doesn't!

wind steppe
#

wait really

#

hold on what are you trying to do

twilit tundra
#

do a death-like effect that depends on the order of the cards, so i need to know which ones leftmost, which ones in the middle, and which ones rightmost

#

the code i have works, but. look at it

i just have a gut feeling theres some function i could use instead

wind steppe
#

looking at vanillaremade this looks like the way they do it so you might be stuck with this

daring fern
#

table.sort(G.hand.highlighted, function(a,b) return a.T.x < b.T.x end)

distant junco
#

ok i cannot figure out how to alter the price of items this is driving me insane

distant junco
daring fern
distant junco
#

yes

granite jay
#

How do you figure out how to make jokers do things if the joker area changes?

#

Like if a joker was added, sold, destroyed, order was changed, everything.

spring lantern
#

ermmmm what the scallop

#

wait im stupid nvm

#

well im even more stupid cos the thing i thought doesnt make sense

#

i suck with cardareas its crazy

#

how do i stop the return table from being nil

daring fern
granite jay
daring fern
granite jay
#

or have the value be the card being reordered?

twilit tundra
#

is there a way to put a default cost into a consumable type, or do i have to add the cost to each one manually?

spring lantern
daring fern
granite jay
#

ty!

wise jetty
#

hello, im trying to change the main menu on balatro, i want to change the card that you can play with in the middle of the screen to a polychrome, red seal, lucky king of hearts, how would i go about this?

#

feel free to dm me or so on, if needed

granite jay
#
calculate = function(self,card,context)
        if not context.blueprint then
            if
                (context.discard and context.other_card == context.full_hand[#context.full_hand]) or
                context.after
            then
                if G.GAME.blind.boss and (G.GAME.chips + SMODS.calculate_round_score()) >= G.GAME.blind.chips then
                    card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_mod
                    return {
                        message = localize('k_awake_ex'),
                        colour = G.C.CHIPS
                    }
                else
                    if card.ability.extra.chips > 0 then
                        if card.ability.extra.chips - card.ability.extra.chip_penalty > 0 then
                            card.ability.extra.chips = card.ability.extra.chips - card.ability.extra.chip_penalty
                        else
                            card.ability.extra.chips = 0
                        end
                        return {
                            message = localize('k_sleep_ex'),
                            colour = G.C.CHIPS
                        } 
                    end
                end
            end
        end
        if context.joker_main then
            return {
                chips = card.ability.extra.chips
            }
        end
    end,```
#

Anyone know how to fix the G.Game.chips bit?

#

It returns false if you beat a boss blind without the hand being on fire

daring fern
wise jetty
#

where do i put this, sorry im a bit dumb 🙁

wise jetty
#

@daring fern

daring fern
wise jetty
#

i might need more help, sorry

#

whats that

#

do i just need to make it a file and add .toml at the end of it?

#

@daring fern

fleet thorn
#

Sorry if this is a silly question, but I was hoping to find a way to make my mod compatible with another mod. I made PolyLatro a couple days ago, but I realized after making it it doesn't stack with BalaGay. Is there any way for me to do that?

daring fern
daring fern
fleet thorn
#

I tried to only rewrite certain sections, but it didn't run afterwards, it immediately crashed my game.

wise jetty
daring fern
wise jetty
#

one sec, ill send u a pic with it to see if its right, what im doing

river grail
wise jetty
#

i cant for some reason on mine lol

river grail
#

damn
does the button not work?

frosty rampart
#

try win-shift-s

wise jetty
#

it doesnt save anything

#

just flashes

umbral zodiac
#

it copies the image to your clipboard

#

press ctrl+v

wise jetty
#

omg, thank you

umbral zodiac
#

wo

fleet thorn
wise jetty
frosty rampart
#

ah you need a header for your lovely file
gimme a second to pull that up

umbral zodiac
#
[manifest]
version = "1.0.0"
priority = 0

#

should be fine

frosty rampart
#

^ just put that at the very top of lovely.toml, above the [[patches]] line

umbral zodiac
#

yerp

wise jetty
daring fern
# fleet thorn

You're missing a } or you have an extra { or your missing a ,

frosty rampart
umbral zodiac
#

come on meta

#

i was trying to type that except putting them in a block like this to look cool

#

but they are the character that does that so i was failing 🥀

frosty rampart
#

lolll sorry

wise jetty
umbral zodiac
#

yeah

#

should be good

wise jetty
#

nah still the same

azure ember
#
local created_card = create_card("golden_spectral", G.pack_cards, nil, nil, true, true, pseudorandom_element(golden_spectral_keys, pseudoseed('match')), nil)```

trying desperately to make this booster pack code work but running this line is crashing because its passing center as "nil". ive tried passing all sorts of things through center though and it still says that and also im looking at code from the Pokermon mod and it passes nil same spot but works fine, does anyone know what I'm doing wrong?
umbral zodiac
#

if you don't provide a forced key & golden_spectral is a pool then it will pick one itself

azure ember
umbral zodiac
#

is golden_spectral a consumable type

daring fern
azure ember
#

it has a card registered to it too

umbral zodiac
#

then you can just do what somethingcom said

azure ember
#

alright ty!

umbral zodiac
#

you don't need to provide a specific key if its a valid pool and consumabletypes do have pools

wise jetty
#

mine didnt work

#

did i put it in the wrong folder or something?

umbral zodiac
#

you need to actually make a mod rather than editing files directly

wise jetty
#

so put it in my mods folder?

umbral zodiac
#

put it in a folder inside your mods folder; but yes

wise jetty
#

thank you

umbral zodiac
#

like C:\Users\YOUR_NAME\AppData\Roaming\Balatro\Mods\MOD_NAME\lovely.toml

wise jetty
#

ill show u where i put it, one sec

fleet thorn
wise jetty
#

does it need its own folder?

umbral zodiac
#

yes

azure ember
umbral zodiac
#

just put return before the smods.create_card

wise jetty
#

wrong seal

umbral zodiac
#

talisman is loading after your mod loads

#

and talisman makes it a gold seal

wise jetty
#

ohhhh

#

is there a way i can make it go first or no?

fleet thorn
umbral zodiac
#

maybe try a lower priority in the patch

#

or higher actually

azure ember
wise jetty
#

so like priority 10?

umbral zodiac
#

yea try that

wise jetty
#

omfg, i love you, thank yall sooo much

umbral zodiac
#

Meow

wise jetty
#

im sooo happy

azure ember
# azure ember

i assume this happens because it can't find anything in the pool, right?

umbral zodiac
azure ember
#

consumable type is called "golden_spectral"

umbral zodiac
#

like did you use the exact same key as its defined

#

ok good just making sure

#

are the available options perhaps not in the pool

wise jetty
#

@umbral zodiac may i dm you if i need help with other things?

umbral zodiac
#

please dont

#

feel free to ping but do not dm pls

wise jetty
#

k

#

thank you for the help

umbral zodiac
#

for sure

wise jetty
#

look forward to doing some other cool stuff soon

azure ember
umbral zodiac
#

for consumable types they should be automatically made

#

but i mean like

#

for the cards that are there, have you defined in_pool functions which would specify that they shouldnt spawn

wise jetty
#

is there a way i can make the card a steel card instead of a lucky card?

azure ember
#
local pack2 = SMODS.Booster{
    name = "Golden Spectral Pack",
    loc_txt = {
        name = "Golden Spectral Pack",
        text = {"Choose up to {C:attention}1{} of",
        "{C:attention}3{} {C:gold}Golden Spectral{} cards",
    "to be used immediately"}
    },
    key = "gs_booster_1",
    kind = "golden_spectral",
    atlas = "gs_booster_atlas",
    pos = { x = 0, y = 0 },
    config = { extra = 1, choose = 1, c_keys = {} },
    cost = 1,
    order = 2,
    weight = 10,
  draw_hand = true,
  unlocked = true,
  discovered = true,


    create_card = function(self, card, i)

    return SMODS.create_card({set = 'golden_spectral', area = G.pack_cards, skip_materialize = true})
       
    end,


    loc_vars = function(self, info_queue, card)
        return { vars = { card.config.center.config.choose, card.ability.extra - 1, 1 } }
    end,
    group_key = "golden_spectral_pack",
}```
umbral zodiac
#

m_steel instead of m_lucky

wise jetty
#

ohhh so juust m_ and whatever enchancment i want

umbral zodiac
#

pretty much

azure ember
#
    name = "empower",
    key = "gs_empower",
    set = "golden_spectral",
    loc_txt = {
        name = "Empower",
        text = {
            "{C:attention}+2{} joker slots",
        }
    },
    pos = { x = 0, y = 0 },
    soul_pos = {x = 1, y = 0},
    atlas = "empower_atlas",
    cost = 3,
    unlocked = true,
    discovered = true,
    hidden = false, -- In regular packs
    draw = function(self, card, layer) -- Apply shader to card
        if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
            card.children.center:draw_shader('booster', nil, card.ARGS.send_to_shader)
        end
    end,
    can_use = function(self, card)
            return true
    end,
    use = function(self, card, area)
        -- Play the card’s sound and animation
        play_sound('generic1')
        card:juice_up(0.6, 0.6)  -- makes the card “pop” visually
    
        -- Increase the max Joker slots by 2
        G.jokers.config.card_limit = G.jokers.config.card_limit + 2
    
        -- Persist it for the whole run
        -- (This ensures it stays after restarts/round transitions)
        G.P_JOKER_SLOTS = G.jokers.config.card_limit
    
        -- Optional visual confirmation
        local msg = "+2 Joker Slots"
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.3,
            func = function()
                create_floating_text(msg, G.C.WHITE, card, 0, -2)
                play_sound('tarot1')
                return true
            end
        }))
    
        return true
    end
})```

this is the only thing ive put in
wise jetty
#

worked,thank yalll, ima go spend all night playing balatro now lol

umbral zodiac
#

hopefully someone else is less light headed than i am

red flower
azure ember
#

its just generating jokers and saying error

red flower
#

im talking about the consumable itself tho

#

can i see the code for the consumable type

azure ember
# red flower can i see the code for the consumable type
local item = SMODS.ConsumableType{
   key = "golden_spectral",
    primary_colour = HEX("F2BB1D"),
    secondary_colour = HEX("FCCC3F"),
    loc_txt =      {
           name = 'Golden Spectral', -- used on card type badges
           collection = 'Golden Spectral Cards', -- label for the button to access the collection
       },
    collection_row = {6, 6},
    shop_rate = 4,
    default = "t_fool"
  }```
azure ember
azure ember
red flower
#

do you have debugplus

azure ember
#

no whats that

red flower
#

i was going to ask you to run something in the console to see if the pool is loaded

river grail
#

I'm trying to understand how generate_card_ui works.. is there any documentation of it anywhere?

red flower
red flower
#

weird

river grail
#

@red flower

#

sorry im still trying to learn the language and everything LOL

red flower
#

yeah ui stuff is complicated

#

do you just want to add tooltips

river grail
#

yeah i just want to add a dynamic tooltip onto a card
the description should be easy, its just a table of strings

#

lemme make a mockup of what im talking about

red flower
#

you don't need to make a function like me you can just put the code in the patch directly

river grail
#

oh, perfect! thanks!

azure ember
red flower
#

vanillaremade!

fleet thorn
#

This mod is driving me crazy, and I don't know what's wrong with it. Can anyone help with this error? I can provide my lua too if needed, but it's mainly just edits to the localization.

red flower
cerulean rose
waxen shard
fleet thorn
#

I'm following the docs to a t, and I'm still getting errors. After finally fixing all my syntax errors, I'm now getting this error, any help?

#

Wait, I think I figured it out!

fleet thorn
#

...okay, I have one final question, and I think the mod is fixed. The only thing that isn't being edited is the actual Polychrome label under the Joker description. What part of my code is missing?

obsidian spear
#
            local other_joker = nil
            if G.jokers and G.jokers.cards then
                for i = 1, #G.jokers.cards do
                    if G.jokers.cards[i] == card then 
                        other_joker = G.jokers.cards[i - 1] 
                    end
                end
            end

            card.ability.extra.target = other_joker
            -- Update sprite
            if G.GAME.playing and other_joker then
                print("wawa")
                card.config.center.pos = other_joker.config.center.pos```

why tf does this change other_joker
#

just what????

#

im changing the bloody card not other_joker

sturdy compass
#

This doesn't look like the entire code block

obsidian spear
#

its an update func in a joker

sturdy compass
#

This code confuses me a lot, there’s a lot of inconsistency in variable usage

obsidian spear
#

actual?

#

istg

#

if its the same issue i had yesterday where i had two of the same variable

#

oh i do card.config should just be config

#

but then why does it change the joker to the right of this one

azure ember
#

how can i make text pop up like the wheel of fortune's "nope!"

frosty rampart
kindred zephyr
#

how do i even get started

#

with making a mod??

kindred zephyr
#

a

kindred zephyr
#

it's real

#

that nil is supposed to say 50 idk why it says nil

wind steppe
#

Let me guess

#

Is where it says nil #50# in the files

kindred zephyr
#

no??

wind steppe
#

oh it actually is #1#?

kindred zephyr
#

yeah??? heres a snippet

        loc_txt = {
        name = 'Penny',
        text = {
            "{C:attention}Flip a coin{}",
            "If heads,",
            "{C:chips}+#1#{} Chips"
        }
    },
    config = { extra = { chips = 50 } },
wind steppe
#

wheres your loc_vars function

river grail
#

are the loc_vars registered

kindred zephyr
#

oh my god i left it unchanged

river grail
#

LOL

kindred zephyr
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
#

ill fix that rq

#

there we go! :3

#

now i wanna test it but i cant seem to get it in normal play

#

ill check if theres a sandbox mode-like mod in the forum

frosty rampart
#

debugplus

kindred zephyr
#

ty

#

okay the debuff sound effect is NOT debuffed.ogg

#

figured it out

#

how do i create a joker directly with debugplus

sudden notch
#

I'm making a retrigger joker, is it possible to add the sound effect when actual card is scored? it only plays at the start when I am playing my hand ! thanks in advance!

kindred zephyr
cerulean rose
chrome widget
#

Currently working on a music pack framework for my API mod

wintry solar
#

Isn’t there already a music pack mod?

chrome widget
#

No clue. I'm doing what I was tasked to

wintry solar
#

Let me see if I can find it

#

Might be helpful for you

reef belfry
#

how would I go about making a card forcefully selected

#

would looking at cerulean bell help

cerulean rose
#

yeah

tired kestrel
#

thought I want to ask about this, is there anything that can be possible to make an edition that render the card into how the profency panel from chapter 4?

#

also I still have some issues with the texture coords part for when I was developing the jpg shader so I went instead of trying to make something new after discovering the shadertoy shader of the Deltarune Chapter 4 Prophency panel

sudden notch
obsidian spear
#
local geomelatro = SMODS.current_mod

function geomelatro.Load_Dir(directory)
    local files = NFS.getDirectoryItems(geomelatro.path .. "/" .. directory)
    local regular_files = {}

    for _, filename in ipairs(files) do -- iterate over all files in the directory
        local file_path = directory .. "/" .. filename
        if file_path:match(".lua$") then -- check if its lua
            if filename:match("^_") then -- i dont even know
                SMODS.load_file(file_path)
                print("loaded ", filename)
            else
                table.insert(regular_files, file_path) -- add non lua to other table
            end
        end
    end

    for _, file_path in ipairs(regular_files) do
        SMODS.load_file(file_path, "geomelatro")
        print('wawa')
    end
end

geomelatro.Load_Dir("Objects")
geomelatro.Load_Dir("Objects/jokers")

why doesnt it load

#

its all wawa

#

no loaded ...

cerulean rose
tired kestrel
#

Tried to import the profency shader into balatro and I had to make it so that it would load in the two noise images as a test to see how it would owkr but it turned out to be this now.

#

I did my best about it

sudden notch
spring lantern
#

i once again am here to ask if anyone here has worked with custom cardareas before, and if so, do you know why my cardarea returns a null table while setting up a new run?

sudden notch
# cerulean rose yeah

If i want to use a different sound for context.end_of_round, do I have to call the play_sound function? im testing with multiple of the same jokers, and i want the sound to play at a different time

wintry swallow
#

hello. do anyone here help me how to make Balatro mods?

cerulean rose
sudden notch
cerulean rose
#

oh i think playing sounds like that requires a message

#

calling play_sound directly might work there

azure ember
#

im trying to make a booster pack that randomly picks cards from my custom consumable type but i cant get it to work, it always picks the default card of my consumable type not actual cards registered to it. can anyone help? ive tried looking at vremade and i cant get it to work properly

#

its saying error and giving me the default card (i just set it to vanilla fool)

tired kestrel
#

what?

#

I haven2T gotten to boosters yet and I saw this

#

Anyone have any knowladge on balatro shaders?

#

cause I have 2 issues with the two shaders.

queen crescent
azure ember
#
   key = "golden_spectral",
    primary_colour = HEX("F2BB1D"),
    secondary_colour = HEX("FCCC3F"),
    loc_txt =      {
           name = 'Golden Spectral', -- used on card type badges
           collection = 'Golden Spectral Cards', -- label for the button to access the collection
       },
    collection_rows = {4, 5},
    shop_rate = 0,
    default = "c_fool"

  }```
#
local pack2 = SMODS.Booster{
    name = "Golden Spectral Pack",
    loc_txt = {
        name = "Golden Spectral Pack",
        text = {"Choose up to {C:attention}1{} of",
        "{C:attention}3{} {C:gold}Golden Spectral{} cards",
    "to be used immediately"}
    },
    draw_hand = true, -- Draw some cards to use them on
    key = "gs_booster_1",
    kind = "golden_spectral",
    atlas = "gs_booster_atlas",
    pos = { x = 0, y = 0 },
    config = { extra = 1, choose = 1, c_keys = {} },
    cost = 1,
    order = 2,
    weight = 25,
  draw_hand = true,
  unlocked = true,
  discovered = true,


  create_card = function(self, card, i)
    local _card
    _card = {
        set = "golden_spectral",
        area = G.pack_cards,
        skip_materialize = true,
        soulable = false
    }
       
    return _card
    end,


    loc_vars = function(self, info_queue, card)
        return { vars = { card.config.center.config.choose, card.ability.extra - 1, 1 } }
    end
}```
#

its clearly recognizing the consumable type because its using the default card but thats as far as i got

queen crescent
#

have you tried setting a default from golden_spectral specifically?
you also only have one card because extra = 1

azure ember
#
    name = "empower",
    key = "gs_empower",
    set = "golden_spectral",
    loc_txt = {
        name = "Empower",
        text = {
            "{C:attention}+2{} joker slots",
        }
    },
    pos = { x = 0, y = 0 },
    soul_pos = {x = 1, y = 0},
    atlas = "empower_atlas",
    cost = 69420,
    unlocked = true,
    discovered = true,
    hidden = true, -- Not visible in the shop on its own
    draw = function(self, card, layer) -- Apply shader to card
        if (layer == 'card' or layer == 'both') and card.sprite_facing == 'front' then
            card.children.center:draw_shader('booster', nil, card.ARGS.send_to_shader)
        end
    end,
    can_use = function(self, card)
            return true
    end,
    use = function(self, card, area)
        -- Play the card’s sound and animation
        play_sound('generic1')
        card:juice_up(0.6, 0.6)  -- makes the card “pop” visually
    
        -- Increase the max Joker slots by 2
        G.jokers.config.card_limit = G.jokers.config.card_limit + 2
    
        -- Persist it for the whole run
        -- (This ensures it stays after restarts/round transitions)
        G.P_JOKER_SLOTS = G.jokers.config.card_limit
    
        -- Optional visual confirmation
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                attention_text({
                    text = "+2 Joker Slots",
                    scale = 1.3,
                    hold = 1.4,
                    major = card,
                    backdrop_colour = G.C.SECONDARY_SET.Tarot,
                    align = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and
                        'tm' or 'cm',
                    offset = { x = 0, y = (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) and -0.2 or 0 },
                    silent = true
                })
                G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    delay = 0.06 * G.SETTINGS.GAMESPEED,
                    blockable = false,
                    blocking = false,
                    func = function()
                        play_sound('tarot2', 0.76, 0.4)
                        return true
                    end
                }))
                play_sound('tarot2', 1, 0.4)
                card:juice_up(0.3, 0.5)
                return true
            end
        }))

        
    
        return true
    end
})```
#

i tried to set it to this but it didnt work it just had the regular joker place holder

#

but this card can be found in the shop when i set it to not hidden and works fine

#

its also recognized in the collection

queen crescent
azure ember
#

sure thanks

queen crescent
#
SMODS.ConsumableType {
key = 'gspectral',
collection_rows = {5, 5},
primary_colour = G.C.CHIPS,
secondary_colour = HEX('FCCC3F'),
loc_txt = {
  collection = 'Gilded Spectrals',
  name = 'Gilded Spectral'
},
shop_rate = 0
}
SMODS.Consumable {
    key = 'empower',
    set = 'gspectral',
    pos = { x = 0, y = 0 },
    config = { extra = {
        joker_slots_value = 2
    } },
    loc_txt = {
        name = 'Empower',
        text = {
        [1] = '{C:attention}+#1#{} Joker Slots'
    }
    },
    cost = 3,
    unlocked = true,
    discovered = true,
    hidden = false,
    can_repeat_soul = false,
    atlas = 'Consumable',use = function(self, card, area, copier)
        local used_card = copier or card
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    card_eval_status_text(used_card, 'extra', nil, nil, nil, {message = "+"..tostring(2).." Joker Slot", colour = G.C.DARK_EDITION})
                    G.jokers.config.card_limit = G.jokers.config.card_limit + 2
                    return true
                end
            }))
            delay(0.6)
    end,
    can_use = function(self, card)
        return true
    end
}

just saying i used jokerforge for the base of the consumable but this should work if you modify some values

#

it works for me so it should work for you

#

i also gave myself the leisure to rename it a bit (gilded sounds more cool than golden, im sorry 😭)

stoic void
#

Does anyone know how to check if a rare joker was sold?

queen crescent
stoic void
#

I dont wanna use forge :(

queen crescent
#

hold on let me get it in codeform

stoic void
#

wait jokerforge is dumb

queen crescent
#

😭

azure ember
#

im just coding it for a friend anyway

stoic void
#

riddle me this, what tf is the difference

#

one is meant to be for commons, one is rares

queen crescent
#

yeah i dont know how to make it work, but this happens to make the most sense

#

i can make a when card sold condition but making it go with jokers is a different story

tired kestrel
stoic void
#

no

tired kestrel
#

cause I checked there and well.

stoic void
#

not yet

#

im just making them myself

exotic gull
#

Oops! The game crashed:
Duplicate installation of Steamodded detected! Please remove the duplicate steamodded/smods folder in your mods folder.

A bad lovely patch has resulted in this crash.

Additional Context:
Balatro Version: 1.0.1o-FULL (best guess)
Modded Version: 1.0.0~BETA-1016c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows

Stack Traceback

(3) C function 'function: 0x0974fbc8'
(4) global C function 'require'
(5) main chunk of file 'main.lua' at line 1758
(6) global C function 'require'
(7) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x097eb558 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x097eb730, gammacorrect:false, title:Balatro, externalstorage:false (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(10) global C function 'xpcall'
(11) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])

#

i dont have 2 steammodeds installed

exotic gull
#

im using balatro mod manager

queen crescent
#

yes there are duplicate steamoddeds

exotic gull
#

but if i uninstall the 1 in balatro mod manager then mods dont launch at all

#

🤔

queen crescent
#

you remove the 0827c one then

stoic void
#

then just delete the other one?