#đŸ’»ăƒ»modding-dev

1 messages · Page 229 of 1

pale temple
#

apparently i fixed it by wrapping it in an event

#

why is it like that

frosty dock
#

this isn't about a specific card of the scoring process, I'm talking about the entire evaluation of a card in a context, which includes calling every eligible calculate function like calculate_enhancement or calculate_seal, but not triggering effects returned by those functions

wintry solar
#

I think the debuffed state should be locked at the start of eval_card personally

frosty dock
#

i assumed it would be sufficient to check can_calculate once at the beginning of this process

#

i think it makes more sense to delay stuff like debuffs and destroying to effects being triggered anyway

tall wharf
#

❀

frosty dock
#

else there's weird dependencies on the order things happen in eval_card, which isn't supposed to happen

zealous glen
#

Because modders want them

#

It’s like Midas Mask needing to apply in advance and needing to hack the appearance of cards until the right moment

wintry solar
#

no that's different

frosty dock
#

I'm talking about order in the sense of calculate_enhancement being called before calculate_edition is

zealous glen
#

I mean that order is already important

frosty dock
#

order at this level is arbitrary, effects in the same card evaluation should be treated in unity

zealous glen
#

But the game already doesn’t

latent portal
#

this is so fucked why won't it WORRKKKK

#

are there ANY other functions i can hook that happen LATER than Card:open()?

frosty dock
#

we do though

#

they are returned in one table from eval_card

#

and processed by SMODS.trigger_effects all together

zealous glen
#

Are these specific effects like Chips and Mult

#

I mean like

#

It’s a card applying an effect to the game state or itself

tall wharf
#

❀

zealous glen
#

Not like a Joker acting on a card

tall wharf
#

btw eremel i ended up making a new cardarea type

wintry solar
#

if there's an enhancement that is, for example, "becomes debuffed after 3 uses", the 3rd play shouldn't stop seals and editions from triggering

zealous glen
#

Yeah I’m thinking what’d be a good way to handle that

frosty dock
#

it's also specific effects

zealous glen
#

But in terms of implementation I’d prefer if it didn’t

#

I think for a card modifying itself, we can lock the debuff state

strong jacinth
#

Can anyone explain

frosty dock
#

though these shouldn't really be affecting debuff state, it's more that calculate_joker is called after

strong jacinth
#

-# (This is game code)

zealous glen
#

As in, it doesn’t need to wait for Glass timing

#

But it also doesn’t destroy itself before e.g. Editions

frosty dock
#

yeah that's the level eval_card operates at

zealous glen
#

tl; dr: I think a check at the start and none inside makes sense as long as they’re all effects that come from the card and apply to the card

#

Or to whatever you want to say +Chips apply to

frosty dock
#

then that's exactly what i have now

dire palm
#

How can I make a custom tooltip that's not ERROR?

zealous glen
#

But before Glass

#

Just to avoid the messages proccing on air

dire palm
tall wharf
#

i love UI

strong jacinth
#

Where is set amd key defined

latent portal
#

WHAT THE FUCK

strong jacinth
rapid stag
#

i also hate ui

latent portal
#

I HAD MY CODE PRINT pack_cards.cards

#

AND ITS NOT NIL???

#

WHY IS MY GAME CRASHING

zealous glen
#

I have no strong opinion one way or the other about UI

sonic cedar
tall wharf
#

real

strong jacinth
#

That looks sick

#

-# How did you do the card area

tall wharf
#

you create new cardarea

#

and put cards in it

rapid stag
#

my understanding is that it's a G.UIT.O

strong jacinth
tall wharf
#

you just

#

CardArea(args)?

strong jacinth
#

And the args are?

rapid stag
#

aiko please help me fix my config ui cirPls

strong jacinth
#

Are there written down any where

tall wharf
#

😭

#

@rapid stag hello

tall wharf
strong jacinth
#

Uhh, these numbers are hard to know what they do...

dire palm
rapid stag
tall wharf
#

what's thje problematic code

#

i can pay 100% attention now

strong jacinth
#

Me or Nope or KLG

rapid stag
sonic cedar
rapid stag
#

i managed to get the text up top but now it demands to be on the left

#

if i don't clamp the width with maxw, the ui element tries to be unreasonably large

tall wharf
#

align = "tm" in config somewhere

#

ok there we go time to push this

strong jacinth
rapid stag
tall wharf
#

😔

sonic cedar
strong jacinth
#

Where is the card area defined in the balatro src

tall wharf
#

cardarea.lua ...

rapid stag
sonic cedar
#

😭

tall wharf
#

😔

#

UI is difficult

rapid stag
#

yes cirPls

tall wharf
#

pretty sure you'll have to make one of them have full width

#

so that there's area to align to

rapid stag
#

full width to what, the screen or

tall wharf
#

of the container

rapid stag
#

how do i get the width of the container cirDerp do i need to do id shenanigans

tall wharf
#

i think you just need a fixed width at root

#

pretty sure it will flow automatically

latent portal
#

hey quick question

#

theoretically

#

is it possible to flip over consumables

#

i thought thats what might be crashing since youre never supposed to see them flipped over

tall wharf
#

i think so?

#

idk

#

i think most cards flipped will show the current deck texture?

#

ill try smth

rapid stag
tall wharf
#

do you have a github for this or smth

#

working with UI does suck

rapid stag
rain slate
#
calculate = function (self, card, context)
  if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
      --TBA       
    end
  end

is the card here the card that the Tarot card was used on, or the Joker card itself?

tall wharf
#

i guess not

dire palm
#

Anyone has a good tutorial to make custom tooltip?

tall wharf
#

try setting height

strong jacinth
latent portal
#

oh

#

THEN WHY ISNT MY CODE WORKING? ?!? !??!?!?!?!?

#

I PUT RETURN END EVERYWHERE

tall wharf
#

show code

rapid stag
tall wharf
#

fucking ui lmao

#

ui will never work how you want

latent portal
#

@tall wharf

#

the code monolith

tall wharf
#

where exactly does it crash actually

ionic verge
#

making a six card hands mod, how would i define this as a six long straight?

latent portal
ionic verge
#

wait if i just had _straight <2 would it count that as like A-2-3-4-5 and 2-3-4-5-6?

latent portal
#

the pairs

ionic verge
#

hmmm\

tall wharf
#

G.pack_cards?

#

so u wanna flip cards in the pack

strong jacinth
# ionic verge making a six card hands mod, how would i define this as a six long straight?

Ive done something similar, the way i did it was:

SMODS.PokerHandPart {
    key = "SuperStraight",
    func = function(hand)
        return get_straight(hand, 6, false, false)
    end
}

SMODS.PokerHand {
    key = "Super Straight",
    chips = 280,
    mult = 20,
    l_chips = 60,
    l_mult = 6,
    example = {
        { 'S_K', true},
        { 'H_Q', true},
        { 'C_J', true},
        { 'D_T', true},
        { 'S_9', true},
        { 'H_8', true}
    },
    loc_txt = {
         name = 'Super Straight',
        description = {
            'Six cards with consecutive ranks'
        }
    },
    evaluate = function(parts, hand)
            return parts.[YOURMODPREFIX]_SuperStraight
    end
}
latent portal
#

I have it as G.pack_cards.cards now

frosty dock
#

you can also take the first straight and check its length, technically

#

but this is cleaner

strong jacinth
#

Do you know this

tall wharf
ionic verge
#

checking if this works first

#

it does!

latent portal
#

IDK WHY IT DOESNT WORK

frosty dock
ionic verge
#

(also means it benefits from four fingers i think)

frosty dock
ionic verge
#

ohh ok

strong jacinth
latent portal
#

i have to go for a while

frosty dock
#

also means you'll trigger on two unrelated straights

latent portal
#

ill be back though

frosty dock
#

you need a table that contains your node

ionic verge
strong jacinth
frosty dock
#

unrelated does not mean not overlapping

ionic verge
#

and yea im gonna fix it

#

explain

frosty dock
frosty dock
ionic verge
#

what does that mean

frosty dock
#

say I have a rank that comes after 10 but isn't a jack

zealous glen
frosty dock
#

and I play 7 8 9 10 11 J

strong jacinth
ionic verge
#

and thatd count as a broadway

frosty dock
ionic verge
#

ok

zealous glen
#

Because J doesn’t come after 11

ionic verge
#

no i mean under my build it would

frosty dock
#

local combine_nodes = {
{
n = G.UIT.C,
-- etc etc you get the point
}
}

zealous glen
#

Ah I see

ionic verge
#

(which again, am fixing)

#

will that super straight thing work with four fingers?

#

the poker hand part?

frosty dock
#

you can change the length you pass in based on four fingers

ionic verge
#

how? just an if statement?

strong jacinth
#

So like this?```lua
combine_tab_function = function()
local combine_nodes = {
{
n = G.UIT.C,
config = { align = 'cm' },
nodes = {
n = G.UIT.O,
config = { object = CardArea(
0.5,
0.5,
80,
100,
{
card_limit = 1,
}
)}
}
}
}

return {
    n = G.UIT.ROOT,
    config = {
        align = "cm",
        padding = 0.05,
        colour = G.C.CLEAR,
    },
    nodes = combine_nodes
}

end

#

(If yes, it still crashes

frosty dock
frosty dock
#

that is also a single node

ionic verge
frosty dock
strong jacinth
ionic verge
#

ohh ok

tall wharf
ionic verge
#

mb didnt see

manic rune
# tall wharf show code

you can probably make a function that checks each letter of a string then adds a card with that letter to the cardarea, now that i think about it :3

frosty dock
frosty dock
#

that is not my debug print

#

i think it's cryptid

strong jacinth
hard flume
#

Is it possible to have a rank change the amount of chips it gives over time?

strong jacinth
#
combine_tab_function = function() 
    local combine_nodes = {
        {
            n = G.UIT.C,
            config = { align = 'cm' },
            nodes = {
                {
                    n = G.UIT.O,
                    config = { object = CardArea(
                        0.5,
                        0.5,
                        80,
                        100,
                        {
                            card_limit = 1,
                        }
                    )}
                }
            }
        }  
    }
    
    return {
        n = G.UIT.ROOT,
        config = {
            align = "cm",
            padding = 0.05,
            colour = G.C.CLEAR,
        },
        nodes = combine_nodes
    }
end
#

And it crashes when i press new game

frosty dock
#

did you save

ionic verge
# frosty dock

ok i did the four fingers part, do i also need to add the shortcut part or will that just work?

#

i presume i need to add it

frosty dock
ionic verge
#

ok

#

also lmao
A-3-5-7-9-J broadway

#

if i were making 7 card hands i could make a full circle

hard flume
strong jacinth
#

I think its this button

frosty dock
#

changing the base chips of an entire rank seems harder to do and isn't exactly supported by smods as of yet

ionic verge
#

am i doing something wrong?

#

(and the evaluate for good measure)

frosty dock
ionic verge
#

oh is it not needed?

frosty dock
#

(also j_shortcut)

hard flume
ionic verge
#

i thought it was gonna be needed bc the vanilla handparts have it

frosty dock
#

it's put there manually for vanilla parts to keep consistent with what the game code calls them

ionic verge
#

ok

sturdy compass
#

For my implementation of super straight I kinda just took the existing straight code and bumped the restricting values from 5 to 6

strong jacinth
frosty dock
#

well get_straight now supports variable length directly

sturdy compass
#

Well

ionic verge
#

there we go

sturdy compass
#

When was that a thing?

frosty dock
#

wait i misread that

ionic verge
#

wait you have the balatro font for your visual studio code?

tall wharf
frosty dock
tall wharf
#

ok nvm not directed at me

ionic verge
#

also these guys work with it

sturdy compass
dire palm
#

How do I give a joker an ability when it's being obtained?

manic rune
#

add_to_deck = function

#

smt smt, check SMODS.Joker documentation, its probably on there

latent portal
#

OKAY

#

SO

#

The function I hooked is correct

#

There's just something CATASTROPHICALLY WRONG with my code

rain slate
#

is there like some sandbox mode or smtn I can use to test my cards?

latent portal
#

Because if you run THIS

rain slate
#

kinda tedious to play Balatro just to get one card

zealous glen
#

Or DebugPlus

rain slate
latent portal
#

It explodes

zealous glen
#

Just get Debug Plus

rain slate
#

nice

latent portal
#

I FOUND THE ISSUE

strong jacinth
stiff locust
#

how can I make a pack that uses a pool which is a list of joker keys

#

i can't find an easy to follow example of this

latent portal
#

ITS SOMEWHERE IN THIS SHIT

tall wharf
sturdy compass
stiff locust
#

is there any documentation on packs

rain slate
#

Ok so I've got this now which I think should give +2 mult to every card affected by a tarot card, but G.hand.highlighted might be something different in this context iunno ```lua
calculate = function (self, card, context)
if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
for i = 1, #G.hand.highlighted do
local target = G.hand.highlighted[i]

            target.ability.perma_mult = target.ability.perma_mult or 0
            target.ability.perma_mult = target.ability.perma_mult + card.ability.extra
        end
    end
end
#

I want to show the +2 mult above all the cards but I don't know how to do that

zealous glen
rain slate
#

yeah that's what I was thinking

zealous glen
rain slate
#

so that's why it needs to be different

rain slate
#

I want it to happen for every card

zealous glen
sturdy compass
rain slate
#

and I'm looping over them

zealous glen
#

Idk what’s the recommended SMODS way right now

#

But classically it was attention_text I think

winged prism
#

anyone know how to add more UI elements?
say like, 3 extra buttons to the pause menu?

primal robin
#

Omg 3 buttons to pause menu Trolge

zealous glen
#

There’s already a few extra ones

wintry solar
#

attention_text has never been used for that

zealous glen
#

Without an attached effect?

wintry solar
#

yes

zealous glen
wintry solar
#

yeah the message in the middle of the screen

zealous glen
#

Idk why I mentioned it then balatrojoker

#

Maybe I bought Hallucination and forgot balatrojoker

ionic verge
#

how would i define a 4oak and a pair as a hand?

rain slate
#

got that working first try

rain slate
#

for people searching in the future (i know what you are): ```lua
if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
for i = 1, #G.hand.highlighted do
local target = G.hand.highlighted[i]

            target.ability.perma_mult = target.ability.perma_mult or 0
            target.ability.perma_mult = target.ability.perma_mult + card.ability.extra

            SMODS.calculate_effect {
                message = localize {
                    type = "variable",
                    key = "a_mult",
                    vars = {
                        card.ability.extra
                    }
                },
                card = target
            }
        end
    end
#

oh wait yeah still gotta fix the G.hand.highlighted issue somehow

strong jacinth
maiden river
#

is there a way to make the popups appear somewhere other than the top or bottom, like on the side? I have a bunch of cards' descriptions that kinda clip into the right side

maiden river
#

true

#

but I have a similar issue with the cards above it

#

(the title getting cut off, in this case)

#

optimally I'd just like the text to show up to the left instead

strong jacinth
ionic verge
strong jacinth
#

Like what for

ionic verge
#

six card hands

strong jacinth
#

Oh

dense vector
ionic verge
#

already done

strong jacinth
#

Or not implemented yet

ionic verge
#

thinking abt it might be done wrong

dense vector
#

What about a 6 card flush or straight?

ionic verge
#

working on it

#

the straight is done though

#

i have also done three pair

dense vector
#

Can't wait for a six of a kind

#

Or a flush six

ionic verge
#

yeah thatll be the easy part

dense vector
#

I also realize that a Broadway Straight Flush would be a mouthful

ionic verge
#

just gonna call it broadway flush

strong jacinth
#

And a 6 of a kind flush?

ionic verge
#

(Flush six)

lyric wadi
#

hello chat

rain slate
#

society if Balatro modding was in C#:

ionic verge
rain slate
lyric wadi
#

if i want a joker to give +chips THEN +mult, each time showing the appropriate number effect, can i just return both values, or do i have to return each one separtely with eventmanager or something

rain slate
#

I think you could do what I did where you manually show the effect with calculate_effect

primal robin
rain slate
ionic verge
# ionic verge

but seriously does anyone know how to define this as a hand in the evaluate function?

rain slate
# lyric wadi where can i look
SMODS.calculate_effect {
  message = localize {
    type = "variable",
    key = "a_mult",
    vars = {
      card.ability.extra
    }
  },
  card = card
}
``` This is what I did to show +2 mult above each card
lyric wadi
#

what about the message

#

like imagine this but with the message going in order one after the other

rain slate
#

yeah that's like a different thing you can't do it there I think

woeful tusk
#

can ":take_ownership" be executed mid-game? more exactly for a specific challenge

lyric wadi
#

sadge

#

where do i do it then

rain slate
#

he's probably more knowledgeable about modding than I am considering I just started like 30 minutes ago

lyric wadi
#

i want it to be at just the jonkler tho

maiden river
lyric wadi
#

not at each individual played card

#

like the joker give chips, then give +mult, then give xmult, in that order

wintry solar
#

just do

return {
  chips = X,
  mult = Y,
  xmult = Z
}```
lyric wadi
#

so no message then

#

or

tawdry magnet
#

I have a custom files for my jokers, but i'm not entirely sure how to make them work in the game files
I've opened with 7-zip, pulled the files out, edited them, then tried to put them back in, but that messed up the whole lineup when i opened the game, with some jokers textures being a group of four other jokers, and some jokers having no textures at all
Can anyone help me out?
I've tried following a few tutorials but am just not sure what the issue is

frosty dock
lyric wadi
#

oh ok cool

woeful tusk
#

How can I apply take_ownership only to a challenge?

lyric wadi
#

and is it exactly chips or chip_mod also have the message

frosty dock
#

chip_mod specifically doesn't have the message

#

due to vanilla behavior

lyric wadi
#

so chips without _mod is a SMOD thing?

#

or

hardy viper
#

and vice versa

tawdry magnet
#

No, i didn't edit the source code at all i dont think

#

I was just in the resources and textures folders

lyric wadi
#

that

#

hm

tawdry magnet
lyric wadi
#

like by "open with a 7z" do you mean, the executable?>

hardy viper
hardy viper
#

2x is just, twice the size of what 1x is

tawdry magnet
#

Okay yeah it looks like i just
did the 1x in the 2x

tardy wind
#

Hello there, anyone’s got examples of custom consumables ? Bonus points if it has a custom set as well

woeful tusk
#

How can I apply take_ownership only to a challenge?

kindred heron
#

can you change the id of a playing card?

#

like how you can do something like Card:change_suit('Hearts')

gilded narwhal
#

i figured this out btw

#

nobody responded but the solution was whatever tf this was

lyric wadi
#

question chat

#

in the joker code, can you define a variable to be a table

hardy viper
#

yeah

#

in a dynamically typed language like Lua any variable can become a table (or start as a table) whenever

maiden river
lyric wadi
#

can i then use card.ability.extra.valueTable for that table

#

and like potentially manipulate it

wintry solar
#

ye#

lyric wadi
#

pog

#

makes this so much easiwe

kindred heron
#

G.GAME.starting_deck_size = 26 doesn't do anything for me
i want to make the deck size smaller

tardy wind
#

I feel like you'd have to generate the deck yourself if you want exactly 26 cards

gilded narwhal
#

any tips for rewording this?

tardy wind
manic rune
gilded narwhal
#

That's much better ty

gilded narwhal
manic rune
#

oh i see

royal ridge
kindred heron
#

can you change the id of a playing card?

lyric wadi
#

another question

#

is there a vanila function or an SMOD function to shuffle a table

#

or do you have to implement your own

manic rune
#

i think you can just make your own

#

thats pretty easy to implement

lyric wadi
#

ok

#

yeah i was just asking if there was any

manic rune
#

-# in fact, cant you just use pairs

lyric wadi
#

what

manic rune
#

yeah

lyric wadi
#

how

manic rune
#

wait, let me check smt

#

oh nevermind, i think pairs works differently in luau compared to this

#

:3 sorry

manic rune
lyric wadi
#

wtf

#

why

#

??????

manic rune
wintry solar
#

I don’t think pairs is random, it’s just it isn’t ordered consistently

manic rune
#

im pretty sure it is in LUAU, since its always like that when i was still helping with games in roblox lol

#

but welp, maybe you gotta make your own function then

woeful tusk
#

how can i get to work a challenge custom rule?

gilded narwhal
#

hey gang is there a way to see if you're at the end of round without using context?

old bane
gilded narwhal
#

i'm in loc_vars which doesn't have context

old bane
steady smelt
#

i need help giving certain tarot cards a different undiscovered sprite, everything i do doesn't change anything no matter what

i already have the floating '?' icon changed, i need the base sprite changed

maiden river
#

is there a way to check if a joker is unlocked yet?

old bane
#

joker.config.center.unlocked?

red flower
gilded narwhal
#

i'm using a global

#

unless

#

lmao this is all i had to do

steady smelt
lyric wadi
#

oh yeah

#

if i implement table shuffling i probably should make it with the vanil seeded functions right

manic rune
#

mhm

lyric wadi
#

ok

#

i did it

#

chat

#

this is huge

#

he is real

gilded narwhal
#

hey quick question. i know we really don't appreciate AI 'art' when making art for these. could we say the same thing for ai programming?

manic rune
#

i also have this one function which selects a random number of stuff from a table

lyric wadi
#

woud be hard to get ai to code with balatro api

manic rune
#

and it doesnt select the same card during that process too

formal parrot
lyric wadi
#

but if you can go ahead

manic rune
long urchin
#

hey, with the deckskin SMOD api, is there a way to replace cards without showing them as replaced? I'm replacing all of the cards, but i only wanna show the KQJA on the screen since the rest of the cards are just recolors and it looks cluttered.

lyric wadi
#

also something to note

#

the "numbers in this description" includes the 1 and 3 in 1 in 3

manic rune
#

3 in 1

lyric wadi
#

so you can roll into 1 in 40

manic rune
#

1 in 40

lyric wadi
#

or 9 in 2

long urchin
lyric wadi
#

im actually happy i got this to work

#

this was a silly joke idea i talked with someone in dm

#

for what actual joker called Jonkler might dop

#

it's not much but it's honest work

steady smelt
#

can you give certain tarot cards a different undiscovered sprite? everything i try with patching doesn't change anything no matter what

i already have the floating '?' icon changed, i need the base sprite changed

lyric wadi
#

also jonkler sprite

minor magnet
#

is there a way to change an enhancement's variable while it's in the deck?

#

like

#

not drawn

manic rune
#

i also have those functions which shorten the process of enhancing cards

#

they all have animations and allat already in there

#

:3

lyric wadi
#

ah yes

#

40 in 9

#

such a beautiful sight

#

i love my creation

manic rune
#

how would oops all 6s work with this

lyric wadi
#

correctly

#

:3

sonic cedar
lyric wadi
#

got a x1 mult

#

amazing

winged prism
#

add a 0 and wait for the rare bug report where someone got an in 0 chance :3c

lyric wadi
#

the 3 becomes a 6

#

with oops

#

although i guess what you mean is

#

what happen now if the 3* moves of the chance slot

#

unfortunately it will revert into being a 3

#

but the new number that comes up will also be doubled accordingly

turbid maple
#

insane synergy

lyric wadi
#

although if it's permanently doubled that would also be funny syngergy

#

just crank every number so high it doesn't matter what lands in the xmult slot

#

although once the 40 hits the in X slot the values are basically as good as locked

#

unless you can get the 15 up there

ionic verge
#

how would i define this in code?

minor magnet
#

I'm having an issue: since this code is for a card enhancement, it does not run if the card isn't in hand/scored at the end of round, how do i have it run for all cards in deck?

lyric wadi
#

in other news, hell yeah

ionic verge
#

cus this doesnt work

winged prism
sturdy compass
#

Woah it’s the Upcraft

minor magnet
sturdy compass
#

Fancy seeing you here

winged prism
sturdy compass
#

Oop sorry

ionic verge
minor magnet
#

like

ionic verge
#

the thing is it triggers early

old bane
#

can a joker return xchips now that we have the perma-bonuses

minor magnet
#

does it just never happen?

solar eagle
#

is there an easy way to detect if a card has been copied, instead of just added to deck?

ionic verge
#

cus technically theres 6 seperate pairs in a four of a kind

#

im trying a fix

#

but this feels messy

minor magnet
ionic verge
#

there isnt a full house part is the thing

#

but

#

i could make one

steady smelt
#

why isn't this patch injecting? it's never making it into the code

[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = "G.ASSET_ATLAS[_center.atlas or _center.set]"
position = 'at'
match_indent = true
payload = '''
(MANIFOLD.funcs.is_reversal(_center) and G.ASSET_ATLAS['manifold_centers']) or G.ASSET_ATLAS[_center.atlas or _center.set]
'''```
ionic verge
#

one sec

minor magnet
ionic verge
#

thats the better solution

wintry solar
solar eagle
#

smods changes some stuff

wintry solar
#

This doesn’t patch because it’s not a full line

steady smelt
#

ah that would probably do it

minor magnet
strong jacinth
wintry solar
wintry solar
strong jacinth
#

So which part is the useful one.

maiden river
#

basically everything under what you put

#

the stack traceback

wintry solar
#

Yeah, anything from 3 downwards is useful generally

zealous glen
#

to be fair the top can tell you the exact line that causes the issue

#

the issue is that sometimes it causes the issue because of something that happened prior

ionic verge
#

ok well how would i make a HandPart for a hous without using other parts? cus the function doesnt take other parts

zealous glen
# strong jacinth

idk what args in line 95 is, but whatever it is it doesn't have a config

wintry solar
#

And what exactly are you trying to do here?

ionic verge
#

make a HandPart that represents a full house
so i can make a 4oak+pair house
for my six card hands mod

wintry solar
#

Sorry I meant eldzey

ionic verge
#

the plan is to check if this part and the 4oak part is in the hand

#

oh

wintry solar
#

I have no idea how poker hands work 😭

ionic verge
#

damn 😔

manic rune
#

made another function for grabbing adjacent cards, with radius and allat ❀

#

i love making random functions

tall wharf
#

lowercase

ionic verge
#

hey youve worked with pokerhand stuff, do you think you can help with my problem?

wintry solar
rain slate
#

how do you get the symbol for the suit, like for example in Greedy Joker it has the diamond symbol in the description?

ionic verge
manic rune
#

...weird

#

sometimes when i clone a joker

#

it seems something is fucking up the game so bad it went into stack overflow

#

its just sometimes though, weird

maiden river
rain slate
#

interesting

maiden river
#

is that a language thing, maybe?

rain slate
#

iunno

#

I tried just putting like the unicode symbols for them but they just don't get rendered

woeful tusk
#

i cant create a challenge and be it a specific stake?

wintry solar
verbal wyvern
#

Is there a way to make a Joker that resets countdowns on other Jokers? ie Gros Michel and other perishables

tall wharf
#

does anyone experience lag when looking at hand info while selecting more than 5 cards in hand?

manic rune
#

nop

sonic cedar
tall wharf
#

ok what the fuck did my mod do to actually make it lag

maiden river
#

that checks out

sonic cedar
tall wharf
#

no

rain slate
#
config = {
        extra = {
            buff = 1.5,
            debuff = 0.5
        }
    },
    loc_vars = function (self, info_queue, card)
        return {
            vars = {
                card.ability.extra.buff,
                card.ability.extra.debuff
            }
        }
    end,
    calculate = function (self, card, context)
        if context.individual then
            if card:is_suit("Hearts") or card:is_suit("Diamonds") then
                return {
                    xmult = card.ability.extra.buff
                }
            elseif card:is_suit("Spades") or card:is_suit("Clubs") then
                return {
                    xmult = card.ability.extra.debuff
                }
            end
        end
    end
``` why ain't this doing shit
#

it's supposed to give 1.5x if it's a heart or a diamond and 0.5x if it's a spade or a club and it just does... nothing

#

oh wait I may be stupid

#

I think it might be context.individual, I had it cuz I read somewhere that a certain similar card used it

tall wharf
manic rune
#

and also

rain slate
#

I explained below

manic rune
#

is this a joker, or?

rain slate
#

yeah

manic rune
#

card in calculation refers to the joker

#

you are telling the game to check whether joker's suit is Hearts

#

and secondly, the context is not clear enough

#

what are you trying to do here

rain slate
#

ok so how do I get the scored cards then

tall wharf
manic rune
#

in here, use context.other_card to check its suit

rain slate
#

alright

manic rune
#

i really suggest reading this, they documented all contexts you will possibly need

sonic cedar
rain slate
#

yeah I looked at that before but I didn't scroll down far enough it seems

tall wharf
manic rune
#

...its the third area including contexts you will see, but ok 😭

sonic cedar
manic rune
manic rune
distant grove
rapid stag
#

is there a way i can hex colour text? like say, in a joker description via SMODS.process_loc_text([full joker variable], "text", { "bla bla bla", "i want this this to be a specific colour", "bla bla bla" })
i know the UI methods have hex support, but i'm not sure if that will work for this

solar eagle
#

what's the proper way to create a joker in a calculate function?

#

SMODS.add_card crashes inside functions/common_events though maybe im usin it wrong

red flower
#

that's the proper way, what's your code?

solar eagle
#

SMODS.add_card("j_UT_dog_residue")

#

gave it the joker key

#

as i understand them being formatted

red flower
#

SMODS.add_card({ key = "j_UT_dog_residue"})

solar eagle
#

ahhh

manic rune
#

N'

kindred heron
manic rune
#

a mod that replaces all jokers' art with touhou dropped

red flower
#

yooooo!?

solar eagle
#

thank you!!

red flower
manic rune
#

fr

#

dropped out of nowhere too 😭

manic rune
#

oh also, i decided to turn the modding guide copypasta into a thread

#

i actually dont know about that, sorry

rocky pawn
#

question

#

is there a way to modify the title screen

rapid stag
#

yes!

rocky pawn
#

i've seen it in other larger mods but i'm not sure how to do something similar

manic rune
#

definitely check cryptid

#

the mod changes the title screen's background

rapid stag
# rocky pawn i've seen it in other larger mods but i'm not sure how to do something similar

you can replace the title screen graphic itself, but messing with the actual card that appears is a little trickier

the colours are impossible though, i've tried and can only get crashes cirPls

the way the mod i'm working on does it (and i think this is how cryptid & cardsauce do it as well, as this functionality is basically directly copied from them) is via a standard steamodded atlas call with the key "balatro"

solar eagle
#

you can only do some things or it crashes

rapid stag
#

YES.

solar eagle
#

i was able to give it an enhancement

manic rune
#

cirno :D

solar eagle
#

but i couldnt change the rank

manic rune
#

its called Balatro for a reason, not Bal2tro

#

;3

solar eagle
#

you can give it a seal

rapid stag
#

bal2tro would be very funny

solar eagle
#

that works

#

edition doesnt, i think?

manic rune
#

edition should

#

i mean, cryptid does that

rocky pawn
#

i was mainly just planning to skin over it with a png

#

like for a shitpost

solar eagle
manic rune
#

ok so, how do i explain this effect

solar eagle
#

but that stupid fucking card does not behave like other cards

manic rune
#

chooses a random card in hand

#

then chooses adjacent cards to it

#

but it chooses like, 2 cards from each side

rapid stag
#

it's difficult, but you can also just make that ace of spades whatever you want, as you can see, i made it blueprint

manic rune
#

how do i word that

rocky pawn
solar eagle
#

to get the overall chips and mult before they're multiplied, i'd use hand_chips and mult right?

solar eagle
#

but the card that exists by default is a BITCH

rocky pawn
#

or have a mod replace the graphic, I mean

solar eagle
#

look in game.lua for replace_card

rapid stag
manic rune
#

why does your image have aura

#

like, chill man 😭

#

it cant be that deep

rapid stag
#

don't worry about it cirBox

steady smelt
#

how do you patch to a line that appears multiple times in the code?

solar eagle
#
[patches.pattern]
target = 'game.lua'
pattern = 'replace_card.states.visible = false'
position = 'before'
payload = '''
if problematic.config_file.cardfuckery then
    replace_card:set_ability(G.P_CENTERS["m_enhancement"])
end
'''

this is my lovely patch to give the card an edition

manic rune
#

i mean

steady smelt
#

i only want to patch to one of them

manic rune
#

lovely patches will replace all instances of whatever you type in the "pattern"

#

oh

solar eagle
#

get surrounding lines

#

so you only get the instance you want

steady smelt
#

i thought pattern could only check one line?

manic rune
rapid stag
#

i'm pretty sure there's an argument you can specify to make it do it only once (or however many times you want), but then you run into the problem if it only doing the first one, which might not be the one you want

yeah that

solar eagle
#
[patches.pattern]
target = 'functions/state_events.lua'
pattern = '''
local splashed = SMODS.always_scores(G.play.cards[i]) or next(find_joker('Splash'))
'''
position = 'at'
payload = '''
local splashed = SMODS.always_scores(G.play.cards[i]) or next(find_joker('Splash')) or G.play.cards[i].seal == "TWT_nb"
'''
match_indent = true```
manic rune
#

lines dont even matter at all, actually

solar eagle
#

you just do

your multiple
lines of code
here
'''```
manic rune
#

its only for readability

solar eagle
#

true

#

turn the entirety of balatro into a single line of code

steady smelt
#

ok well i tried that for something unrelated yesterday and it didn't work and someone said it's because it was multiple lines and changing that worked

#

but i guess that was wrong

manic rune
#

like, you can do this

solar eagle
#

yea ive been using multiline patterns for awhile

manic rune
#

i try my best not touching patches in my mod

#

since it can cause unintended conflicts with other mods

steep bronze
#

Is it possible to increase the size of the hand played? I want to increase it from 5 to 6.

solar eagle
#

look at cryptid to see how sticky hand works

#

bc just increasing the card selection limit doesn't work

steady smelt
#

match_indent just applies the indent of the furthest indented line not included in the pattern right? idk if i'm wording that right

manic rune
#

steamodded is gonna work on implementing card selection size soon

steep bronze
manic rune
#

check cryptid's files

#

you can access them through their mod's github

#

or download their mod, and open them up with vsc or even notepad (dont)

steady smelt
#

discord markdown being perfectly intuitive moment

manic rune
#

:3

kindred heron
#

this part broke again
its supposed to destroy the cards that are equal to or are less then 6 (rank)

manic rune
#

i think its not context.destroying_card

#

its just context.destroy_card

kindred heron
#

i was told to use destroying_card with cardarea

manic rune
kindred heron
#

g.play i mean

manic rune
#

what are you trying to do here?
-# why does that sound so violent 😭

kindred heron
manic rune
#

oh

#

if context.destroying_card alone should suffice

rapid stag
#

is there no way to give text a custom hex colour?

manic rune
#

shouldnt that already be handled

zealous glen
rain slate
#

how do you get this kind of effect on the X multiplier?

zealous glen
#

You need to find out yourself what passes args to it

zealous glen
rapid stag
rain slate
#

no like the thing with the red around it

strong jacinth
zealous glen
#

Like {X:red,C:white}

rain slate
rapid stag
zealous glen
zealous glen
strong jacinth
kindred heron
#

i sure do love when i try to make a blueprint like joker and try to use the blueprint code as a reference, but not understand anything

strong jacinth
#

It is with the UIBox:init

#

But i dont call UIBox:init?

gilded narwhal
#

hey gang so i have this deck where end of round money turns into a multiplier for money instead, so if you would have normally gotten $7 at the end of round you would instead multiply your money by 1.7X. As it stands, basically any joker that gives extra money is completely broken. Like if you get a decently scaled cloud 9 or rocket you can easily double your money every round. How should I nerf those jokers?

#

Should I increase their rarity or just decrease the amount of money they give

zealous glen
manic rune
#

embrace the unbalanced :3

gilded narwhal
#

counterpoint: don't wanna

#

which i know thats super lame but

manic rune
#

thats fair

gilded narwhal
#

oh well

manic rune
#

probably reduces it then

zealous glen
#

Now let me copy this Cryptid Edition code

kindred heron
#

today im learning stuff about smods i didn't know existed

gilded narwhal
#

also is X$ aka yellow-bg a thing in steamodded

manic rune
#

{C:money}

lyric wadi
#

question chatt

surreal mason
lyric wadi
#

can you make it so that a Jokers can always appear multiple times even if you dont have Showman

gilded narwhal
manic rune
#

{X:money}

gilded narwhal
surreal mason
lyric wadi
#

it's as shrimple as that

manic rune
kindred heron
#

ok sorry but how exactly do i use blue print effect?

#

do i use trigger_effect?

steady smelt
#

this is the hardest and most jank thing i've ever done

zealous glen
#

I feel like there must be a SMODS way to do it though

zealous glen
steady smelt
#

different consumables in the same set having different undiscovered sprites

#

Card:set_sprite REALLY does not like being patched

#

ive been using this for debugging but it's too funny to remove even though it's never used

manic rune
#

you are not the only one

#

:3

#

i included the "a" part so that i can print values lol

steady smelt
#

that's probably smart

kindred heron
#

Superior debugging function

manic rune
#

i mean, what could be better than that

#

i used to use this but its now useless

kindred heron
#

skibidi

kindred heron
manic rune
#

i have some weird functions too like these ones

manic rune
kindred heron
kindred heron
manic rune
zealous glen
steady smelt
#

i don't know why i added this but it's there

manic rune
#

three

zealous glen
#

Well

manic rune
#

you managed to make something more useless than stuff in my mod

#

congrats 💔

zealous glen
#

At least it’s not a magic number

steady smelt
#

i probably needed 3

kindred heron
#

and idk how to access it

steady smelt
#

from now on any time i need 3 i'm referencing MANIFOLD.vars.three

manic rune
#

i also have this :3

zealous glen
kindred heron
steady smelt
#

and i'm professionally recommending any other mod devs to check if my mod is installed, and if it is, to reference MANIFOLD.vars.three any time 3 is in your code

steady smelt
manic rune
steady smelt
#

i only know 3

manic rune
#

this is definitely my most advanced "useless" function though lmfao

steady smelt
#

that one's kinda based actually

manic rune
#

mhm

#

it auto adds the {C:mult} {}

#

to +5 Mult in your string and allat

umbral frost
#

Noob question: Where are the jokers in the code? I want to look at flash card to see how its code is written

manic rune
#

balatro source code, card.lua

umbral frost
#

ok great thanks

manic rune
#

i should probably include that in my thread

steady smelt
#

what's your thread?

zealous glen
#

đŸ§”

manic rune
steady smelt
#

oh pog i've just been cobbling everything together with those purple glue sticks

#

no documentation required only scraping everyone else's mods for incredibly niche functions

manic rune
#

😭

steady smelt
#

anyways time to brainstorm consumable effects

gilded narwhal
#

why does this not work?

[[patches]] [patches.pattern] target = 'functions/common_events.lua' pattern = '''{n=G.UIT.O, config={object = DynaText({string = {localize('$')..format_ui_value(num_dollars)}, colours = {G.C.MONEY}, shadow = true, pop_in = 0, scale = 0.65, float = true})}}''' position = 'at' match_indent = true payload = ''' {n=G.UIT.T, config={text = (not G.GAME.selected_back.effect.config.ttr_yellow) and (localize('$')..format_ui_value(config.dollars)) or localize('$') .. (format_ui_value(config.dollars * G.GAME.selected_back.effect.config.money_mult + G.GAME.selected_back.effect.config.money_mult_min) .. "X") , scale = 1.2*scale, colour = G.C.WHITE, shadow = true, juice = true}} '''

#

it got patched correctly

tardy wind
#

For consumables, is theres a table/variable I can check to make sure game state is in a blind ?

#

(for can_use)

chrome widget
#

The blind table is G.GAME.blind

steady smelt
#

hierophant and canio are best friends and you can't convince me otherwise (they're both misspelled in the code)

chrome widget
#

So true, I kept screwing up hierophant tweaks because I didn't realize it was misspelled 😭

kindred heron
#

what should i put as blueprint card

manic rune
#

thats a new one

tardy wind
chrome widget
#

After you defeat a blind, this event calls set blind to nil, which means when not in a blind, it's an empty table

zealous glen
#

And Consumables

chrome widget
#

you can also check G.GAME.blind.blind_set

#

Because it only sets that to true when it actually has a blind

steady smelt
#

didnt know those were misspelled

#

oh i did know consumables actually

zealous glen
#

There’s another one

steady smelt
#

perfect

zealous glen
#

They tried to fix it but it was brought back by popular demand

kindred heron
#

im gonna nil

zealous glen
#

You might need to update SMODS

#

Also that’s not how you use it

tardy wind
kindred heron
#

oh i didn't know there was an update last week

#

what am i supposed to put in the blueprint_card parameter

#

my card's id?

steady smelt
#

what happens if you use a negative copy of the fool while your consumables area is over full? the code would lead me to believe it's consumed and then nothing happens but that doesn't seem right

manic rune
#

yeah so, for some reason

zealous glen
manic rune
#

this is "nil"

#

despite returnStr being a string

#

how so?

steady smelt
#

doesn't # before a variable get the length of it if it's a table or array? (i don't know lua)

#

so for a string it would just be nil

manic rune
#

no, for strings it gets the number of characters

old bane
#

how do i have should_apply for a sticker still require an rng check

manic rune
#

HOW IS THIS NIL?????

steady smelt
#

integer 38 is nil didn't you know

manic rune
#

im confused.

#

what do you mean 😭

steady smelt
#

just check if it's nil and if it is, replace it with the number 38

#

problem solved

manic rune
#

💀

zealous glen
#

@hushed field also I spotted this old message

kindred heron
#

i have no idea what i'm doing

scarlet spire
#

it's argument 2, so it'd be v["endpos"] that's nil, right?

#

not #returnStr

kindred heron
#

what are you supposed to put in the blueprint_card parameter

#

in blueprint_effect

gilded narwhal
#

hey guys could someone do me a favor and tell me what the lib file is?

steady smelt
#

this is incredibly broken but hey it works

gilded narwhal
#

i wonder how many reverse tarot mods there are

steady smelt
#

so many

#

this is also very funny to me

kindred heron
#

Peak Foolery

manic rune
#

no one shall question my testing string choice

steady smelt
#

hehe :3

scarlet spire
#

reverse tarot is the copper ore of balatro modding

minor magnet
#

is there any reason why this isn't triggering?

steady smelt
#

i feel bad for people who want to play with balatro modpacks because they probably have to deal with hundreds of reverse tarot variants that just flood the tarot pool

manic rune
# manic rune

this looks funny but it is the most ambitious project ive worked on lmfao

zealous glen
steady smelt
#

before copper was added to mc basically everyone ever made a copper ore mod

scarlet spire
#

minecraft modding was filled with hundreds of mods that all added their own separate copper ore (before the ore became official)

#

yeah

steady smelt
#

same thing with balatro and reversed tarots

scarlet spire
#

all the big mods had their own copper ore

#

I was also thinking of adding my own reverse tarots but i'd have to have a config option to disable them if you had other reverse tarot mods

gilded narwhal
#

its a little different because not many mc mods were just there to add copper ore

#

but a lot of balatro mods just add reverse tarots

steady smelt
#

and mine are just a percentage chance to replace their regular variants so no affecting tarot odds

#

though ig i'd need a separate config for reversed vanilla tarots and reversed ones of the tarots in my mod

wintry arch
#

how do you make card status text appear when the joker triggers

gilded narwhal
#

hey guys how would i isolate specifically the cash gained from cashing out at the end of the blind so i can change how its ease_dollar looks?

broken cliff
#

what if instead of tarot it was tarat and they would do nothing

wintry arch
#

i dunno how but my joker is waiting until the very end of the calculation to say it's line

#

i'm guessing i'm not supposed to be using card_eval_status_text but idk what im supposed to be using instead

kindred heron
#

how do i use blueprint_effect

broken cliff
wintry arch
kindred heron
wintry arch
broken cliff
manic rune
#

im getting super close now

#

:3

kindred heron
broken cliff
#

i might be wrong

minor magnet
#

chat i need help

broken cliff
#

if you want to not make it copy the joker do blueprint_compat false

minor magnet
#

this code is meant to have a chance to make the card to the left and to the right infected cards

broken cliff
minor magnet
#

but it occurs on all cards on the right

wintry arch
kindred heron
#

And I was told to use blueprint_effect

manic rune
#

💔

gilded narwhal
#

hey guys how would i use cashing out as a context?

broken cliff
gilded narwhal
#

it's not end_of_round

manic rune
#

you have to add not context.blueprint to your context if you want blueprint to not copy that effect

kindred heron
#

Yes

wintry arch
#

oh wait, i found something on the docs that solves my problem

broken cliff
manic rune
#

IT WORKS

broken cliff
#

Gg

rough furnace
# manic rune

does it work with Hello World! split on multiple lines?

manic rune
#

oh wait, im missing a space there, hm

rough furnace
#

also when they are in another colour (like inactive)

broken cliff
#

unless it concatonates all strings into one

manic rune
#

but its definitely possible

broken cliff
#

my best bet would be to join all strings together and then segregate them later

wintry arch
#

i figured it out

rough furnace
manic rune
#

mhm

broken cliff
#

oh yh

#

could js check for x amount of letters then check the next line for remaining

manic rune
# manic rune

had to do some string manipulation shit here, since string.find only accounts for the first instance

rough furnace
#

you would just have to do a check over mutliple lines

#

and make sure you don't insert into the wrong strings

gilded narwhal
#

should i have it where the multiplier also appears in the ease_dollars instead of just showing the +$ here?

onyx sonnet
#

im trying to make all triggered 7s give the lucky card effect but the debug prints never even show up, am i checking the wrong contexts?

manic rune
#

:3

broken cliff
#

either you have wrong context

#

or Idk

onyx sonnet
#

its obvious that it never triggers, im aware of this because my debug prints dont show up

broken cliff
#

try printing context.other_card

#

see what will happen

#

might return nil