#💻・modding-dev

1 messages · Page 393 of 1

snow vale
#

i learnt here, but yeah u can start with balatro modding starter pack

crisp coral
#

or heavily modify existing code

snow vale
#

how can i type in the pi symbol 💔

#

instead of Xpi

#

it would be cool to have Xπ

hard mica
#

you cant

wind steppe
#

does balala not support unicode?

#

shame

#

π

hard mica
#

is it supposed to be modprefix.Pi?

crisp coral
#

the balala font doesn't support pi symbol

keen totem
#

is there anywhere to generate balala font text for card sprites?

red flower
#

the type might be an invalid key

hushed field
#

the font on cards is handdrawn and not consistent

keen totem
#

ok

hard mica
red flower
hard mica
#

i wish i couldve made it so it need to be 3 10 4 to give that pokjer hand

#

but idk how to do that

wind steppe
#

what do yall think the best way to explain to a player why they lost is

#

i cant achievement on the game over screen nor the next run sooo

#

im out of ideas

wind steppe
keen totem
#

this is what i have for my tarot card so far, dont know what to put on the inside

daring fern
wintry swallow
#

could someone help me with a problem i'm having?

onyx sonnet
#

well depends on what the problem is

wintry swallow
#

I think it's reletivly simple, just need a bit of help starting it up

daring fern
daring fern
wind steppe
#

ty

daring fern
#

Then it's like ```lua
again = {
"Again!"
}

wintry swallow
# daring fern Yes, but what is the problem?

I am making a joker that gives 1.5x mult upon scoring a gold card, but has a 1/3 chance to destroy said cards, but I cant make it destroy the cards after giving 1.5x mult, only before

wintry swallow
wind steppe
#

what function determines what quip to use upon run loss?

daring fern
keen loom
#

do most mods limit to the default 5 jokers, or do they extend this limit?

keen loom
#

yeah

snow vale
#

how do i fix this? (a joker generates them)

daring fern
#

A lot more.

keen loom
daring fern
keen loom
#

i was thinking maybe about 10 joker slots

keen totem
#

yea ngl idk what this is even supposed to show

#

but

keen loom
#

at first i thought it's cheese 😭

keen totem
#

its supposed to be destroyed houses

#

bc they cant be maintained in an apocalypse

#

because i dont want to draw people

covert palm
#

Needs more cracks and broken ground methinks

#

The houses are a little too perfect

west prism
#

is there a context table that stores held in hand cards like how context.full_hand stores cards played? or even played and held cards combined

red flower
#

no

#

G.hand.cards has them

west prism
#

ohhh nice ty!

wind steppe
#

i cant find where in the code this function is actually defined

#

only the uses of it

keen totem
daring fern
wind steppe
#

less perfect circles

keen totem
#

ngl i dont feel like doing it again bc i already put it in the assets folder

#

i literally have a joker called Jegg its not that deep

hushed field
#

probably overlooking something obvious, but it seems that the pseudorandom function returns 1.9 as a value, but that's above the max value I've given

red flower
#

i thought it only did integers with min/max

hushed field
#

Ooh, that'd explain it

#

I'll check after I've eaten, I guess

modern kindle
#

i see an ice and an n, happy day

red flower
#

hii dilly

modern kindle
#

hello

errant karma
#

money amount is showing as nil in card desc

red flower
#

you have money at #1#

hushed field
#

Yo, Dilly

modern kindle
#

how has life been ice

#

feel like i aint seen you in ages

oblique pond
hushed field
#

I've spent too much time just hanging out here helping people install mods, haha

gaunt thistle
#

Dilly 🔥

keen totem
#

how do i get the currently selected cards for consumables?

red flower
errant karma
red flower
keen totem
wind steppe
#

why doesn't this overwrite the jimbo quip on run loss?

para_jimbotalk_old = add_speech_bubble
add_speech_bubble = function(self, arg1, arg2, arg3)
    if true then
        para_jimbotalk_old('pineapple', nil, {quip = true})
    else
        para_jimbotalk_old(self, arg1, arg2, arg3)
    end
end
red flower
keen totem
#

yea

#

i dont need which consumables are highlighted

#

although that is interesting

#

ill keep that in mind

keen totem
errant karma
keen totem
#

so do i need an or

red flower
#

read it wrong again lol

#

yes it does

keen totem
#

yea ok

red flower
#

im tired i need to get off work

keen totem
#

can i use

config = { extra = {
        cards = 2
    }
    },
    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.extra.cards}}
    end,

for consumables or do i need to change some stuff

errant karma
#

thank youuuuuu

scarlet imp
wind steppe
#

perfect

keen totem
#
SMODS.Consumable{
    key = "Infection",
    set = "Tarot",
    loc_txt = {
        name = "Infection",
        text = {
            "Enhances {C:attention}2{} selected cards to {C:attention}Virus cards{}"
        }
    },
    atlas = "Infection",
    pos = {x = 0, y = 0},
    cost = 3,
    config = { extra = {
        cards = 2
    }
    },
    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.extra.cards}}
    end,
    use = function(self,card,area,copier)
        for i,v in ipairs(G.hand.highlighted) do
            v:set_ability(G.P_CENTERS["m_CGN_Virus"])
        end
    end,
    can_use = function(self,card)
        if #G.hand.highlighted == card.ability.extra.cards then
            return true
        else
            return false
        end
    end
}

so would this work for a tarot that adds an enhancement

#

eh ill just test it

red flower
#

check vanillaremade :3

red flower
#

but the code looks correct

wintry swallow
#

sorry for asking, but has there been any progress on my problem?

red flower
#

what is the problem?

keen totem
red flower
#

yes

wintry swallow
# red flower what is the problem?

I am making a joker that gives 1.5x mult upon scoring a gold card, but has a 1/3 chance to destroy said gold card, but I cant get it to destroy the card after scoring, only before

daring fern
red flower
# keen totem what

if you return that in loc_vars and use it in the description it's going to just be the key, not the name

hushed field
#

You do indeed wanna use context destroy_card

hushed field
keen totem
#

at least the enhancement

wintry swallow
hushed field
daring fern
wintry swallow
keen totem
#

:juice_up(0.3, 0.3) what do those 2 args do?

hushed field
#

One's duration, other severity, iirc?

oblique pond
#

how could i tell if the player is in the shop? (from within a consumable)

hushed field
oblique pond
#

so i'm making it not usable if you aren't in the shop

hushed field
#

Ah, makes sense. I can gave you the exact syntax in a sec, but you could check the source code for SHOP in all capitals if you're not that patient, haha

oblique pond
#

alr, i'll go do that, thx

wind steppe
#

my game crashes when i lose a run

#
para_jimbotalk_old = Card_Character.add_speech_bubble
Card_Character.add_speech_bubble = function(self, arg1, arg2, arg3)
    if true then
        para_jimbotalk_old('pineapple', nil, {quip = true})
    else
        para_jimbotalk_old(self, arg1, arg2, arg3)
    end
end
oblique pond
#

if G.STATES.SHOP?

wintry swallow
hushed field
errant karma
#

tryna make a joker that's reserved parking without the 1 in 2 thing, how would i do that?

wind steppe
#

oh shit i shot jimbo

#

what mod adds this????

oblique pond
#

thats the only one i can think of

hushed field
#

Cardsauce, iirc

#

Has that mod implemented as a feature

wind steppe
oblique pond
#

ah ok

wind steppe
#

jimbo noooo

wintry swallow
red flower
#

context.destroy_card is the card being calculated so you would check if that's the correct card, like in context.individual

wintry swallow
red flower
#

which card do you want to destroy?

wintry swallow
red flower
#

ok let's say it's all for now

if context.destroy_card and SMODS.has_enhancement(context.destroy_card, "m_gold") then
     return { remove = true }
end
hasty mist
#

ive never worked with joker retriggers before, why doesn't this work?

keen totem
#

do you need to do :flip() and have a true/false

keen totem
#

card:flip() without args only flips

#

doesnt unflip

red flower
#

it does

sturdy compass
keen totem
hasty mist
#

ive already done that

red flower
sturdy compass
tight notch
#

i'm trying to make a deck that gives you a card whne you start, but when I use it I get this:

keen totem
#

too much, gimme a sec

red flower
keen loom
#

does this reads well?

daring fern
wintry solar
#

you're checking the context incorrectly

red flower
tight notch
cyan lagoon
sturdy compass
#

I took too long and let eremel beat me to the punch 😔

wintry solar
keen totem
#

gimme a second here

sturdy compass
#

Also Eremel ty for the hand limit API, very pleased with that implementation Moneyup

keen totem
#

trying to copy the tarot card flipping and juicing and upgrading and allat

wintry solar
wintry swallow
red flower
wind steppe
#

how would i check when a specific joker caused me to lose in a function hook? (the joker has an effect that makes you lose)

sturdy compass
#

It finally went thru yesterday lol

cyan lagoon
#

anyone knows how to exclude cards from SMODS.add_card?

keen totem
hasty mist
keen totem
#

so its one big part of the table

red flower
wind steppe
# wind steppe how would i check when a specific joker caused me to lose in a function hook? (t...
para_jimbotalk_old = Card_Character.add_speech_bubble
Card_Character.add_speech_bubble = function(self, arg1, arg2, arg3)
    if true then -- Replace true with if the pineapple made you lose
        para_jimbotalk_old(self, 'pineapple', nil, {quip = true})
    else
        para_jimbotalk_old(self, arg1, arg2, arg3)
    end
end
SMODS.Joker{ -- Pineapple implementation.
    key = 'pineapple',
    config = { extra = {
        xmult = 3
    }
    },
    atlas = 'Jokers',
    pos = {x = 4, y = 0},
    pools = { ["Food"] = true },
    rarity = 1,
    cost = 2,
    blueprint_compat = true,
    eternal_compat = false,
    perishable_compat = false,
    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.extra.xmult}}
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                xmult = card.ability.extra.xmult
            }
        elseif context.end_of_round then
            G.STATE = G.STATES.GAME_OVER
            G.STATE_COMPLETE = false
        end
    end
}
wintry solar
red flower
cyan lagoon
#

a

red flower
#

you can create an ObjectType or make a list yourself

keen totem
red flower
wind steppe
#

how would i save something between runs?

keen totem
red flower
wind steppe
daring fern
wind steppe
#

how do i do that

keen totem
red flower
#

yeah

daring fern
tight notch
wind steppe
keen totem
#

ok so

#

that works

#

but now i have a much bigger problem

red flower
keen totem
#

2 virus cards can pick the same card to infect

#

and i have no clue why

red flower
#

do you have any check for that?

keen totem
#

(in the calculate for an enhancement)

#

canInfect is to stop cards that just got infected from infecting

#

hasSoap makes it so having soap = instant no infection

#

no clue why they can pick the same one tho

red flower
#

hmm but don't you set the enhancement at the end?

keen totem
#

yea

#

thats why im confused

#

do context.after's run at the EXACT same time?

#

not like one after another?

red flower
#

if you set up an enhancement in the return then context.after is not going to see it

#

because calculations are done before events

tight notch
keen totem
#

so set the enhancement to some placeholder thats not no enhancement instantly

#

then change it to virus

tight notch
#

i assumed it was like create card but different

red flower
tight notch
red flower
tight notch
#

oh ok

#

well in this deck how would i use it like above

keen totem
keen totem
#

ok

#

then this should work

tight notch
red flower
keen totem
#

or do i have to set it somewhere first

pale holly
#

i feel pretty stupid not understand i could have done another extra with my extra simply like this, well i'll die less stupid tonight

red flower
keen totem
#

nice

#

okay wait

#

if its infected

#

then vampire'd

#

then can it be infected again?

#

or will that break it

#

wait i can just set infected false again

red flower
#

you would need to set the variable back to nil after scoring

tight notch
red flower
tight notch
#

a deck where you start with a joker

red flower
#

i get that but which joker

keen totem
tight notch
#

one from a custom pool

#

that i made

red flower
#

lly

keen totem
#

damn

#

if thunk did it, i uh

#

actually

#

he chose to use LOVE2D to make a game

red flower
keen totem
tight notch
keen totem
#

@daring fern dont ? me, LOVE2D is ass

daring fern
vast night
#

hi AGAIN :D
how do i check if the selected blind is the boss blind

keen totem
#

lua is good

#

love2d is bad

vast night
vast night
keen totem
#

love2d has NOTHING

vast night
#

except balatro

keen totem
#

not sleeps, not buttons, not a single thing

#

you have to custommake all of it

vast night
hasty mist
#

How do i check for a specific joker? similarly to how this checks for a specific blind

vast night
keen totem
#

yea

#

but like

daring fern
keen totem
#

literally any other game making system is better

hasty mist
#

tyty

shell timber
#

??

keen totem
#

unity

shell timber
#

horrendously bad take

red flower
shell timber
#

love2d is fun because you can make silly prototypes easily and also make proper games

#

it is a good engine

keen totem
#

well i do not like it

shell timber
#

okay fair. but it is not objectively bad

keen totem
#

maybe not objectively

#

i never said that tho

#

i just hate it bc if youre gonna make smth with lua

#

id rather go and make it in roblox tbh

hasty mist
#

have i missed something here?

high sinew
#

What’s the extra in soul pos?

shell timber
#

"batteries not included" (for lack of a better term) engines are common and good

hasty mist
red flower
hasty mist
#

there's three layers for exotic jokers

tight notch
red flower
hasty mist
#

ah

red flower
hasty mist
#

hm, it still has no effect

red flower
tight notch
#

it looks like it is an object type

red flower
#

or set won't work

#

you want a list of jokers right?

tight notch
red flower
#

you want to create from a pool of jokers? or just a specific one?

tight notch
#

yeah from a pool

red flower
tight notch
#

i've mostly been going off of code that i've seen from other mods(yahimod and cryptid)

#

it's weird that the way they did it just doesn't work

gaunt thistle
#

love2d is cool

#

good framework

#

just wish it got more updates

red flower
tight notch
#

checking the yahimod, the jokers have pools defined in them and then consumeables can create jokers from that pool no issue

#

ig consumeables are different from decks in this case

red flower
#

I just checked and yahimod makes objecttypes

cursive sentinel
#

is there a detect for when a poker hand level is changed?

daring fern
cursive sentinel
#

will do that, thx !

tight notch
cursive sentinel
#

G.GAME.hands[hand].level needs to be to_big too right?

red flower
tight notch
#

nvm found it

hasty mist
#

not sure what the issue is here, it clearly states that chips should be set to mult and vice versa, but ingame it has no effect

native star
#

does somone know what the key for showman is? I'm trying to make a joker that creates a showman

native star
hasty mist
#

localthunk moment

boreal vale
#

Hey I’m new to modding, does anyone know if there’s a way to put a new image on screen? Like if I wanted a joker to put an image of a cat on the screen when it triggers?

keen tiger
#

does anyone know why in the world G.STATE == 999 when opening a booster pack?

#

i can find nothing about this in the codebase

#

im frankly baffled

keen tiger
#

AAAAAAAAAAHHHHHHHHH

#

why

#

why does smods need to do this

#

does it just bypass all other booster states?!?!?!?! @daring fern

outer basalt
#

how does one make a rarity badge be ✨ gradient ✨

daring fern
daring fern
outer basalt
#

i mean like

keen tiger
outer basalt
#

how do i put it in there

keen tiger
#

like, i need to know when the state is arcana/celestial/buffoon/etc

outer basalt
#

i have the gradient i just dont know what to put in badge_colour

daring fern
keen tiger
#

how do i work around this and infer which booster state is which @daring fern

outer basalt
#

i mean like. this

#

its not doing a gradient rn its just. oure white

daring fern
tight notch
#

added pool as an object type in the main lua file and getting same error

red flower
tight notch
red flower
#

the key might need your mod's prefix? idk

outer basalt
tight notch
#

i'll try that

red flower
faint yacht
red flower
#

yeah

red flower
#

center.kind might be useful as well

faint yacht
#

True, if you want to "theme" any given booster packs together.

tight notch
red flower
outer basalt
red flower
red flower
outer basalt
#

ohhh

tawdry shale
#

i'm having trouble figuring out how probability works (card is a 1 in 3 chance of x7 mult)

red flower
outer basalt
#

so like Gradients.OCJ_Concept

tight notch
red flower
#

there

tight notch
#

oh ok i understand now

vast night
#

how do i check if the selected blind is the boss blind?

tawdry shale
red flower
vast night
vast night
#

like this

loc_vars = function(self,info_queue,card) return { G.GAME.probabilities.normal or 1, card.ability.extra.odds } end
still plank
#

can i change the keybind for debugplus cuz there is no / on my keyboard i need to press shift + 7 to get it so the console doesnt work

vast night
#

or more beautiful

loc_vars = function(self,info_queue,card)
  return { G.GAME.probabilities.normal or 1, card.ability.extra.odds }
end
still plank
#

im not german tho

tight notch
#

alr it works

vast night
#

uhm$

#

wait

still plank
#

np

vale plinth
#

Das ist schade

vast night
#

try searching in the mod files

still plank
#

okay

vast night
#
function global.consoleHandleKey(key)
    if not consoleOpen then
        if key == '/' or key == 'kp/' then
            if util.isShiftDown() then
                showNewLogs = not showNewLogs
            else
                openNextFrame = true -- This is to prevent the keyboard handler from typing this key
            end
        end
        return true
    end
still plank
#

oh i was just search

#

ing

#

it

vast night
#

you can also use the numeric key

still plank
#

can i just do it like .

still plank
vast night
#

just search

still plank
# vast night just search

function global.consoleHandleKey(key)
if not consoleOpen then
if key == '.' or key == 'kp.' then
if util.isShiftDown() then
showNewLogs = not showNewLogs
else
openNextFrame = true -- This is to prevent the keyboard handler from typing this key
end
end
return true
endis this good

#

cuz i want it to be ''.''

gaunt thistle
#

are you by any chance on a non english keyboard layout?

still plank
#

qwerty

gaunt thistle
#

well ok, my nordic layout keyboard is also qwerty haha

still plank
#

is the code aight

gaunt thistle
#

like is your slash button here

vast night
#

its at shnift+7

gaunt thistle
#

I was asking eymen thonk

vast night
#

quick q again: how do i change the amount of joker slots by 1?

gaunt thistle
#

but cool, mine's there too. it's a silly spot to push a slash

vast night
gaunt thistle
#

I've been adapting to this layout and it's been awful as a developer haha

#

but no worries

vast night
#

no i have it also like this

still plank
#

ye it worked

red flower
keen loom
#

does this card reads well?

wintry solar
#

is it supposed to say shadows

keen loom
#

yeah

wintry solar
#

it isn't very clear

vast night
#

imma try tho

tawdry shale
gaunt thistle
#

joke tuah

vast night
wintry solar
tawdry shale
wintry solar
#

yeah

clever rose
#

I'm trying to code a joker that only gives 3x mult when the played hand is only 7s, this runs, but it still gives 3x mult for all hands, any ideas why?

wintry solar
vast night
faint yacht
wintry solar
#

@tall wharf I have cleaned up your patches, if you could test it works fine for you I'm happy to merge

tall wharf
#

ty

faint yacht
tall wharf
#

i think you can just merge i haven't actually coded anything

gusty iron
#

is there anyway i can force a boss blind to spawn on an ante?

wintry solar
#

did you not have some descriptions that utilised it?

tall wharf
#

i do

gusty iron
#

(eg, if i want a certain boss blind to forcefully\ spawn every ante thats a multiple of 12)

wintry solar
#

do they still work?

vast night
#

it feels weir asking the whole time but how do i get the amount of cards with a specific rank in a calc func?

tall wharf
#

ill test in a sec

#

default fonts seems to work

tawdry shale
tall wharf
#

but uh

gaunt thistle
#

cute art

gusty iron
#

i dont think the balatro font has japanese support

#

cause it also worked really weirdly when i tried special characters

tall wharf
#

this is the very pr that is adding support for custom fonts

gusty iron
#

oh

#

wait

#

i just realized

#

mb

tight notch
tall wharf
#

yes

gusty iron
#

also hi aikoyori!!

tall wharf
#

hi

wintry solar
wintry solar
snow vale
#
                local _suit = pseudorandom_element({ 'S', 'H', 'D', 'C' }, pseudoseed('crackers'))
                local _card = create_playing_card({ front = G.P_CARDS[_suit .. '_K'], center = G.P_CENTERS.c_base }, G.hand,
                    nil, nil, { G.C.SECONDARY_SET.Enhanced })

                G.GAME.blind:debuff_card(_card)
                G.hand:sort()
                card:juice_up()
                return true
            end
        }))

        playing_card_joker_effects({ true })```
what do i change in order to create a stone card?
tall wharf
#

it's just

#

not there yeahj

#

i might have done something wrong

keen totem
#

what would be a good value for an Xmult-giving enhancement?

tall wharf
#

unless the implementation changed

vast night
#

depends

snow vale
wintry solar
#

I dont think I changed how it loads stuff

keen totem
#

oh i totally forgot about glass

tight notch
#

when trying to add the curate voucher(from cryptid) the game gives me this error upon starting the deck. the voucher works fine normally so i'm wondering if something else is happening

tall wharf
tight notch
#

not using the cry_ prefix btw if it helps

tall wharf
#

and yeah the default one loads fine

wintry solar
#

hmmmm

tall wharf
faint yacht
wintry solar
#

I can just download your dev build right?

tall wharf
#

just remove ui_text.toml (the patch i contributed) and change stuff in fonts.lua

keen totem
tight notch
snow vale
#

what's the key name for the ace?

wooden nexus
cursive sentinel
snow vale
cursive sentinel
#

ah, think i saw it was A in strength code

lament sparrow
#

Man, I'm too smooth brain for this lol

snow vale
#

okk

faint yacht
cursive sentinel
unborn bay
tight notch
keen totem
cursive sentinel
#

i don't need for a not context.blueprint in add_to_deck() nor remove_from_deck() right?

tight notch
#

we should be farming wheat and dying of dysentery

tall wharf
#

I'm adding more kasane teto

#

if you say you love kasane teto

lament sparrow
#

I'm failing so horribly coding this

wintry solar
#

OH I see what's happened

tall wharf
#

also i forgot about the hardcore challenge

keen totem
#

what the hell did i just find

wintry solar
#

there they are

keen totem
#

Prevents Death
Adds 66 debuffed Stone cards to deck
Self-Destructs
(in someones mod wiki)

cursive sentinel
#

the effect is fun

unborn bay
keen totem
#

right down one yes

#

Consumes lead from Steel Cards
Gains +25 Chips every time lead is consumed
(Currently +0 Chips)

tight notch
gusty iron
#

how would i make a boss blind disable face_cards?? i dont know if im understanding this right, but heres my current debuff table:

debuff = {is_face = true},

tawdry shale
keen totem
#

check vanilla remade tho

#

and find plant

gusty iron
keen totem
#

since mods have to have source visible

keen totem
tight notch
#

i mean like where in the source code?

keen totem
#

uh actually i dont think vanillaremade has blinds

lament sparrow
#

it doesn't

keen totem
gusty iron
keen totem
#

modifiers.lua

tight notch
#

alr

daring fern
keen totem
#

the source code is on bros github

daring fern
keen totem
#

yea

#

thats math is fun's github account

gusty iron
# keen totem modifiers.lua

heres what the page says for debuffs:

--debuff = {}: Configure vanilla Blind effects with these fields:
--Disallowing hands in full:
hand = { ['Hand Type'] = true} --for a specific set of hands,
h_size_ge = n, --must play at least n cards,
h_size_le = n, --must play at most n cards.
--Debuffing cards:
suit = 'Hearts' --for one specific suit,
value = '2' --for one specific rank,
nominal = n --for all ranks scoring n base chips,
is_face = true --for all face cards.
tall wharf
keen totem
#

wait

tall wharf
#

math is on hiatus

wooden nexus
keen totem
#

i coulda sworn it said it was on his somewhere on there

tall wharf
keen totem
#

idk

snow vale
keen totem
#

yea MathIsFun0/Talisman links to SpectralPack/Talisman

#

is it just a redirect or what

cursive sentinel
tight notch
daring fern
cursive sentinel
#

you can also card.ability and card.ability.name == "m_stone" (or "Stone", i dont rememebr)

snow vale
keen totem
#

do you think that {X:mult,C:white} being for X mult was intentional

#

cause background totally couldve been B:

snow vale
#

oh wait

#

i think ik how

cursive sentinel
#

well the key is m_stone

snow vale
#

kk

oblique pond
#

what's the key for the vanilla eternal sticker? looked through source code and couldn't find it

keen totem
#

when in doubt, check vanillaremade

gusty iron
keen totem
#

cause you can directly do some stuff

oblique pond
tight notch
#

that is indeed quite silly

keen totem
tall wharf
#

oh right

daring fern
tall wharf
#

i need to make the peakest non joke mod of all time

keen totem
#

@daring fern

#

it works

#

card:set_eternal(true) makes a card eternal

daring fern
snow vale
daring fern
#

SMODS.add_card is better.

keen totem
#

then whats with the ❓

keen totem
oblique pond
tight notch
#

Since curate isn't working, is there an alternative way to make everything have an edition

#

as in things you find in the shop

daring fern
snow vale
#
    key = "banana",
    set = "food",
    loc_txt = {
        name = 'Banana',
        text = {
            'Create a {C:attention}stone card{}',
            'and add it to your hand'
        }
    },
    atlas = 'banana',
    cost = 1,
    pos = {x = 0, y = 0},
    can_use = function(self,card)
        return G.GAME.blind.in_blind
    end,
    in_pool = function(self,args)
        return true
    end,
    use = function(self,card,area,copier)
        G.E_MANAGER:add_event(Event({
            func = function()
                local _suit = pseudorandom_element({ 'S', 'H', 'D', 'C' }, pseudoseed('crackers'))
                local _card = create_playing_card({ front = G.P_CARDS[_suit .. '_K'], center = G.P_CENTERS.c_base }, G.hand,
                    nil, nil, { G.C.SECONDARY_SET.Enhanced.m_stone })

                G.GAME.blind:debuff_card(_card)
                G.hand:sort()
                card:juice_up()
                return true
            end
        }))

        playing_card_joker_effects({ true })
    end
}
gusty iron
#

checking if a card is a face card is just card:is_face(), right?

tight notch
#

it works perfectly fine if you obtain through the shop

daring fern
tight notch
#

i'll try

gusty iron
#

okay yeah i got it to work :)

tight notch
#

what's the difference between apply and init in the context of a deck

snow vale
#

what's the error here?

vast night
#

hi again

daring fern
red flower
vast night
#

how do i check if a card is enhanced

red flower
daring fern
vast night
#

oh k

#

lol thanks

tight notch
#

would poll edition work as a function to replicate curate?

snow vale
daring fern
hybrid shadow
#

what's the condition for the played hand being a pair

daring fern
tight notch
#

poll_edition(nil, 1, false, true, {"e_foil", "e_holo", "e_polychrome", "e_negative"}) so would this work or do I need to change it? and how would I implement this into the apply function?

snow vale
#

what's the center?

tall wharf
#

@wintry solar what was the fix to my issue lmao

#

did anything weird appear in my codebase

#

<@&1133519078540185692>

wintry solar
tall wharf
#

right

#

ok thanks for the heads up

snow vale
#

fake steamcommunity link

#

what was his user?

hybrid shadow
snow vale
#

oh they got him

daring fern
snow vale
#

the mods are REALLY fast

hybrid shadow
daring fern
scarlet imp
#

trying to maker a Joker that makes a copy of The Fool on blind select, the same way Cartomancer works. I copied the code from Cartomancer and modified it to be specific to The Fool, but it does nothing:

calculate_joker = function(self, context)
        if self.debuff then return nil end
        if context.setting_blind and not self.getting_sliced then
            if not (context.blueprint_card or self).getting_sliced and #G.consumables.cards + G.GAME.consumable_buffer < G.consumables.config.card_limit then
                G.E_MANAGER:add_event(Event({
                    func = (function()
                        G.E_MANAGER:add_event(Event({
                            func = function()
                                local card = create_card("Tarot", G.consumables, nil, nil, nil, nil, G.P_CENTERS.c_fool, "fool")
                                card:add_to_deck()
                                G.consumables:emplace(card)
                                G.GAME.consumable_buffer = 0
                                return true
                            end}))
                            card_eval_status_text(context.blueprint_card or self, "extra", nil, nil, nil, {message = localize("k_plus_tarot"), colour = G.C.PURPLE})
                            return true
                        end)}))
            end
        end
    end

any suggestions?

daring fern
scarlet imp
red flower
#

what's calculate_joker

scarlet imp
#

calculate_joker was the name of the function that activates Cartomancer's ability, at least as far as I could tell. Modified the code from the git and it worked perfectly. Thanks

red flower
#

yeah the vanilla code and the smods code differ greatly in a lot of places

scarlet imp
#

alright I'll keep that in mind, thanks for the help. I'm new to modding this game lol

wheat jewel
#

What mod should i reference to help me make a joker that buffs rates of shop appearances of uncommon jokers

red flower
#

I don't know what mod does it but I think you need to change G.GAME.uncommon_mod

wheat jewel
#

tried to refrerence the cryptid mod's deck of equilibrium but it seems they use their own custom functions for that

wheat jewel
red flower
#

(it's the same for all weights)

wheat jewel
#

alright!

red flower
#

G.GAME.uncommon_mod is a multiplier to the base rate iirc

wheat jewel
red flower
#

no that part is just for editions

wheat jewel
#

ohh

red flower
#

you would modify it in add_to_deck and remove_from_deck

wheat jewel
#

imma look at how the hone voucher works and try to work from there

#

makes sense considering what my joker is intended to do

elfin stratus
#

🔥🔥🔥🔥

wheat jewel
red flower
hybrid shadow
daring fern
red flower
tight notch
gusty iron
#

how do i check a card's suit?

#

i dont wanna check if its a specific suit, i just want to get its suit

daring fern
wheat jewel
keen loom
#

completed the extra tarot card

tight notch
keen loom
#

yep

tight notch
#

i was litterally just thinking about a shadow milk joker and how cool it would be

wintry solar
#

that W needs an extra pixel

red flower
cursive sentinel
tight notch
#

pretty sure i'm doing this wrong

keen loom
cursive sentinel
#

oh no wait it's even pixels

wintry solar
#

1 pixel less could work too

cursive sentinel
red flower
tight notch
#

ah ok

keen loom
wheat jewel
#

like this?

tight notch
#

so how would i use it to force the edition on everything in the shop

cursive sentinel
cursive sentinel
wintry solar
#

something like this

cursive sentinel
#

or setting all others to 0

red flower
cursive sentinel
tight notch
cursive sentinel
wheat jewel
red flower
#

but maybe you can set everything to 0

#

i never tried

wheat jewel
#

like when selling the card

gusty iron
#
if not suit_table[card.base.suit] then
                print("inserting")
                table.insert(suit_table, card.base.suit)
                print(#suit_table)
                else
                print(card.base.suit)
                end

its saying that #suit_table is 0??

red flower
wooden nexus
#

Okay question, how do I take ownership of a challenge?

#

or at least add custom jokers to existing challenges?

gusty iron
wheat jewel
#

makes sense

keen loom
red flower
wheat jewel
wheat jewel
wheat jewel
#

this should work then

keen loom
cursive sentinel
wintry solar
wooden nexus
scarlet imp
#

how does the game prevent Jokers from being sold if they are eternal? I have a Joker that gives +1 consumable slot and it shouldn't be able to be sold if selling it would overflow (having 3/2 consumables for example)

#

knowing how to prevent selling could fix that for me

red flower
wind steppe
#

what function would i hook to change something when a run starts?

keen loom
tight notch
#

way better

wintry solar
#

can you show it full art?

keen loom
cursive sentinel
red flower
#

thats why i said you need to go through each

#

G.GAME[rarity_key:lower().."_mod"]

cursive sentinel
#

rarity_key:lower()?

wintry solar
#

I would maybe make each of the O and F one pixel taller, but I think it's pretty good like that

cursive sentinel
#

and i guess i'd need to store base values somewhere if it wasn't a hook

tight notch
red flower
tight notch
#

how do I patch things? apologies for being braindead

red flower
gaunt thistle
#

me jump scare

primal robin
red flower
#

you!!

gaunt thistle
cursive sentinel
red flower
wintry solar
#

huh, when looking at this it appears that playing cards in the shop cannot spawn with modded editions on

cursive sentinel
#

so smth like this? or i msunderstood it completely?

if rarity_key ~= "uncommon" then
  G.GAME[rarity_key:lower().."_mod"] = 0 
end
wild escarp
#

This code seems to have a strange interaction with hologram, where hologram only gains the mult for duplicated cards at the end of the round, and it only adds mult for the amount of cards copied instead of the amount of cards added to deck, can anyone figure it out?

calculate = function(self, card, context)
    if context.before then
        for i = 1, 2 do
            for k, v in ipairs(context.scoring_hand) do
                if v.seal or v.edition or next(SMODS.get_enhancements(v)) then
                    G.playing_card = (G.playing_card and G.playing_card + 1) or 1
                    local copy_card = copy_card(v, nil, nil, G.playing_card)
                    copy_card:add_to_deck()
                    G.deck.config.card_limit = G.deck.config.card_limit + 1
                    table.insert(G.playing_cards, copy_card)
                    G.hand:emplace(copy_card)
                    copy_card.states.visible = nil

                    G.E_MANAGER:add_event(Event({
                        func = function()
                            copy_card:start_materialize()
                            return true
                        end
                    }))
                end
            end
        end
    end
    if context.destroy_card and context.cardarea == G.play and 
    (context.destroy_card.seal or context.destroy_card.edition or next(SMODS.get_enhancements(context.destroy_card))) then
        return {
            message = localize('k_copied_ex'),
            colour = G.C.CHIPS,
            func = function()
                G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.calculate_context({ playing_card_added = true, cards = { copy_card } })
                        return true
                    end
                }))
            end,
            remove = true
        }
    end
end
tight notch
#

so how would i format a pattern patch to do that? never used patches before

cursive sentinel
#

although i have no clue on how to store the original values, through a hook and a global?

red flower
meager pumice
#

Hello im new to modding and I have a joker working fine but when an invisible joker tries to copy it i get a stack overflow. does anyone here have experience with this issue and know why its happening

wind steppe
#

send us the code

#

do you have other mods on?

elfin stratus
#

where can i find all the context.something?

meager pumice
#

ill grab the code one sec

maiden phoenix
elfin stratus
#

car

meager pumice
#

coudl i send a txt instead

wind steppe
#

you could probably paste the whole file

#

it shouldnt be that much code if its ur first joker tho

meager pumice
#

sounds good i just didnt want to paste too much and have it take too much space

wheat jewel
#

How do i edit the rate of rare and legendary jokers?

#

i keep getting errors at the line for rares in add_to_deck

wind steppe
# wheat jewel

legendary shouldn't matter they dont appear in the shop

daring fern
wind steppe
#

no commas tho

#

thats the issue

wheat jewel
tight notch
wind steppe
keen totem
#

put a triple ` around this

meager pumice
#

 loc_txt = {
             name = 'Roxie Volkov',
             text = {
                 "Retriggers joker to the",
                 "right twice."
             }
         },
 
            -- config of the joker. Variables go here.

            config = { extra = { active = "Inactive" , bptarget = 0 } },

             -- rarity level, 1 = common, 2 = uncommon, 3 = rare, 4 = legendary.
         rarity = 4,
 
         atlas = 'roxie',
     
         pos = {
             x = 0,
             y = 0
         },
         cost = 8,
         unlocked = true,
         discovered = true,
         blueprint_compat = true,
         perishable_compat = true,
         eternal_compat = true,
         allow_duplicates = false,
 
         loc_vars = function(self, info_queue, center)
            return { vars = { center.ability.extra.active}  }
         end,

         update = function(self, card, front)
            local _myid = getJokerID(card)
            if G.jokers and G.jokers.cards[_myid + 1] then card.ability.extra.bptarget = G.jokers.cards[_myid + 1] end
        end,

        -- loc_vars works with the config and gives you text variables to work with.
        -- these are formatted as #n#, where n is the position in the variable table.


             -- calculate is where the scoring and effects of the joker are handled. 
             calculate = function(self, card, context)
                local once = false

            if context.retrigger_joker then 
                return{
                    repetitions = 2,
                    retrigger_joker = retrigger_card
                }
            end

            if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then
                if context.other_card == G.jokers.cards[getJokerID(card) + 1] then
                    if context.other_card.bptarget and context.other_card.bptarget ~= 0 then
                        return {
                            repetitions = 2,
                            card = context.other_card.bptarget,
                        }
                    else
                        return {
                            repetitions = 2,
                            --card = card,
                        }
                    end
                else
                    return nil, true 
                end
            end ```
wind steppe
#

type your code like this:
```lua
-- your code here
```

wheat jewel
#

trib appeared in a shop once but i guess that was with the cryptid mod installed (not to deck of equilibrium)

meager pumice
keen totem
#

ya

wind steppe
meager pumice
#

sick alrihgt

wind steppe
#

is invis joker to the right of yours when you sell it?

wheat jewel
wind steppe
#

try selling it to the left

meager pumice
#

ill try it to the left tho too

wind steppe
#

weird

wheat jewel
wind steppe
meager pumice
#

yeah still crashes on the left too

wind steppe
#

try ankh

meager pumice
#

when i have mods loaded the collection crashes on open. is there a way to give myself ankh without going to the collection

#

or is there a way to fix that crash

wind steppe
#

that shouldnt happen

#

without your mod does it crash?

meager pumice
#

yes

#

any mod

wheat jewel
tight notch
#

would there be any other way to force editions without patches? i can't seem to figure out how to use them

wind steppe
#

reinstall steamodded and lovely

meager pumice
wind steppe
#

if youre creating the card then you dont need patches

daring fern
tight notch
#

so how do i loop over in update?

wind steppe
#

on reroll and on entering the shop

meager pumice
#

ankh works

tight notch
wheat jewel
#

Does The Soul have a unique rate variable in the game that can be edited

wind steppe
#

does anyone know any contexts for entering shop

daring fern
tight notch
#

ty

#

my one braincell is using all of its processing power rn 😭

wheat jewel
daring fern
tight notch
#

is there an alternative?

daring fern
tight notch
#

what is hooking (my brain is mush atp)

wind steppe
# tight notch what is hooking (my brain is mush atp)
Klei Entertainment Forums

In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...

tight notch
#

let me rephrase: how do I hook in smods?

wind steppe
#

that tells you basically everything

tight notch
#

alr

wind steppe
#

just put the function hook in main.lua and find the right function

keen totem
#

how do i create a playing card and add it to deck?

wheat jewel
#

Does anyone know if the rate for The Soul appearances can be edited with a variable?

#

Tried looking in the source code

tawdry shale
#

does anyone know how i can time sounds better? i wanna have a message saying "let's go gambling" from the joker but i'm not sure how to do that and the sounds overlap

wheat jewel
#

but i'm a bit lost

meager pumice
#

from the source code i think the 0.997 is the threshold

tawdry shale
wooden nexus
#

So question: How do I add custom jokers to pre-existing challenges?

wheat jewel
tight notch
#

could anyone provide just like a basic example/pseudocode of hooking card:update? the guide helps just barely

meager pumice
# wheat jewel Gotcha ok

this was from the common_events.lua file. idk if itll help much but maybe you could change it to a variable

scarlet imp
#

I'm trying to make a Joker that works the same way as the Observatory voucher and it almost works, but only procs once, not for each Planet card like the voucher does:

calculate = function(self, card, context)
        if self.debuff then return end
        if context.consumeable and context.other_consumable.ability.set == "Planet" and context.other_consumable.ability.consumeable.hand_type == context.scoring_name then
            return {
                x_mult = card.ability.Xmult,
                message_card = context.other_consumable
            }
        end
    end
keen totem
#

whats the area for cards that were played (including unscored cards)

elfin stratus
#

ive been stuck for more than an hour trying to figure out how to make sure the boosterpack you open came from the shop

analog spoke
#

so, uhm, some art-to/from-code questions, so, someone's making some art for me, involving transparency, and, issue is, the art is supposed to have, like, a sheen to it, you know? like seethru plastic, and uhmm, the sheen is building a shadow behind it, any tips here? (wasn't sure to ask in here or in fan-art, but something tells me the answer here is more code related lol)

keen totem
#

unless its fully transparent, full shadow

analog spoke
#

mhhh

keen totem
#

wait

#

no

#

G.hand is your held cards

cursive sentinel
elfin stratus
#

now i know this doesnt work because by the time context.open_booster is triggered, G.STATE is no longer the shop

#

so idk what to try now

red flower
cursive sentinel
#

in the add_to_deck before setting it?

tight notch
keen loom
#

why is game not reading the json file for mod metadata?

tight notch
#

can you send it?

red flower
cursive sentinel
keen totem
#

because G.play is just for scoring cards

marble flint
#

do you want context.full_hand

meager pumice
keen totem
wild escarp
#

Just context.full_hand

marble flint
#

oh for individual contexts it's a bit different

#

iirc you check if it's a string (maybe 'unscore'? idr offhand)

keen totem
#

im trying to context.destroy_card every played card

marble flint
#

you might need to enable an optional smods feature

wintry solar
#

it's context.cardarea == 'unscored'

keen totem
#

i could just do an or tho

wintry solar
#

just unscored

oblique pond
nova epoch
#

im trying to make a card that adds mult when theres both a King and Jack in a played hand, i was thinking of looking at the code for flower pot as a refrence but i realized that flowerpot checks for suits, is there anything similar to what im trying to do that i can look at for reference?

wild escarp
#

You could look at trib.

keen totem
#

yea use trib

nova epoch
#

alright thanks

wild escarp
stoic fulcrum
#

is there an easy way to make a joker check if a specific joker is in your deck?

marble flint
#

SMODS.find_card

nova epoch
#

that seems to be what i need

#

but i want it so that It needs both a king and jack

#

if i change that 'or' to an 'and' would it still work

red flower
keen totem
#

whats the vanilla sound that plays on Xmult triggers?

red flower
primal robin
red flower
#

i already have my own UI problems in my mod sorry

wintry solar
#

I have a void for you to fill too

keen totem
wintry solar
#

Editions dont use get_current_pool and I cba doing that

meager pumice
#
INFO - [G] file not found: functions/button_callbacks.lua: No such file or directory
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] 2025-05-26 17:35:15 :: ERROR :: StackTrace :: Oops! The game crashed
stack overflow
Stack Traceback
===============
(1) Lua upvalue 'orig' at file 'main.lua:612'
    Local variables:
     msg = string: "stack overflow"
     (*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
     (*temporary) = string: "Oops! The game crashed\

This is in my logs when my game crashes. The functions/button_callbacks.lua file exists in the balatro directory but it says that its not found. Would verifying my file integrity through steam mess with lovely or my mods at all?

red flower
#

I also want to see some stuff with get_current_pool for my individual card weights thing

#

since Ice is going to use it

stark geode
#

anyone know how to kill a brainstorm or bp if it triggers an effect

keen loom
#

is a tarot card that creates three random negative consumables too OP?

keen totem
#

consumables? yes it can make soul and spectrals in general

wild escarp
#

Still struggling with this joker. Hologram now gains the right amount of xmult, but it still counts up for every single increment, and only adds the xmult to itself after the scoring.

calculate = function(self, card, context)
    if context.before then
        for i = 1, 2 do
            for k, v in ipairs(context.scoring_hand) do
                if v.seal or v.edition or next(SMODS.get_enhancements(v)) then
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            local new_cards = {}
                            G.playing_card = (G.playing_card and G.playing_card + 1) or 1
                            local copy_card = copy_card(v, nil, nil, G.playing_card)
                            copy_card:add_to_deck()
                            G.deck.config.card_limit = G.deck.config.card_limit + 1
                            table.insert(G.playing_cards, copy_card)
                            G.hand:emplace(copy_card)
                            copy_card.states.visible = nil
                            copy_card:start_materialize()
                            new_cards[#new_cards + 1] = copy_card
                            SMODS.calculate_context({ playing_card_added = true, cards = { new_cards } })
                            return true
                        end
                    }))
                end
            end
        end
    end
    if context.destroy_card and context.cardarea == G.play and 
    (context.destroy_card.seal or context.destroy_card.edition or next(SMODS.get_enhancements(context.destroy_card))) then
        return {
            message = localize('k_copied_ex'),
            colour = G.C.CHIPS,
            remove = true
        }
    end
end
keen totem
#

tarots? thats just emperor but better

#

planets? thats one of them but better

#

spectrals? too OP

vast bough
#

does anyone know where i can find the documentation on functions like add_to_deck() and G.deck:emplace()

red flower
#

for the vanilla functions there's none

vast bough
#

yeah i saw that but is that really it? is it just a case where i have to play around and look at examples to get a better understanding of it

keen loom
wild escarp
keen totem
#

is it possible to do an event and a message at the same exact time

#

in a return of a calc

red flower
#

probably

#

smods just merged the pr to add event options to returns

vast bough
# red flower yes

i said screw it and instead of spending any longer trying to get my specific use case to work i just botched it together. was trying to simply make a joker that creates a playing card on scoring triggers (card scored, hand played) but the method i used to create playing cards before was not working because it uses draw calls. instead, the code now just copies jokers like dna in a way, creating a temp card, copying that card and therefore adding to deck, then deleting the temp card. I LOVE SMODS

red flower
#

there should be an easier way to make playing cards honestly

#

im spoiled by SMODS.add_card

keen totem
vast bough
willow nimbus
#

question, i'm trying to make a joker that gains xmult whenever a specific tarot is played, and im a bit confused about the definition of "card"

#

if "card" is referring to the played tarot then

#

how do i refer to my joker

#

do i need to make a variable

keen totem
red flower
red flower
vast bough
red flower
willow nimbus
#

i see

keen totem
willow nimbus
#

in that case how would i refer to the consumable getting used

red flower
#

the consumable is context.consumeable

willow nimbus
#

ohhh alright

#

perfect, thanks

red flower
keen loom
#

why is this part crashing my game?

    key = 'tarot24',
    set = 'Tarot'
    loc_txt = {
        name = 'Carnival of Shadows'
        text = 
        'Creates 3 random {V:1}Negative{}'
        '{C:attention}Tarot{} cards.'
    },
}```
red flower
#

you're missing a comma

keen loom
#

where?

red flower
#

wait sorry, you're missing a comma and brackets around the text

keen totem
#

actually 2 commas

red flower
#

oh yeah

keen totem
#

since the text's bracket doesnt even exist to have a comma after

#

is there a way to make an event happen literally as the last event did

#

i know that theres something there 1 sec

keen loom
#

oh, the text part needs brackets too

keen totem
#

trigger & delay

#

can those do what i need

red flower