#💻・modding-dev

1 messages · Page 136 of 1

wicked leaf
#

(pain)

#

Is uhhh anyone willing to collaborate to help me code the mod

wintry solar
#

As long as it’s a table, yeah

#

If you want to add the deck and discard to contexts, just hook them into calculate context

long sun
#

Have tested this card, and it works really well with Crescent

#

Getting a High Priestess gives four free sells :D

#

I like it ^^

#

Deffo more fun than Campfire imo

zealous glen
#

So effects that shouldn't trigger will trigger because they don't test what area the card is in

sick sparrow
#

does sound in edition support keys?

wintry solar
random sleet
#

context api....

zealous glen
#

I think Eremel didn't see why add it

night pagoda
#

How do I get the base table of booster pack ui box?

#

This doesn't want to work

random sleet
#

i think if you're calling it statically like that you dont use the colon

night pagoda
#

oh oops, thanks!

random sleet
#

ur basically giving it the class of SMODS.Booster as self

#

which i assume has a great many reasons why it doesn't work

zealous glen
#

I think the final one was the context?

random sleet
#

we have context api at home

zealous glen
#

the number gives the order

vagrant cedar
#

Anybody available to help me with some coding I'm way out of my league for?

wooden badge
#

I'll try and help, also learning but getting a hang

vagrant cedar
#

Might be too hard if you're learning

#

It's certainly too hard for me

wooden badge
#

hmm, if it's wildly out of the realm of vanilla then maybe

vagrant cedar
#

I'm trying to get a gameboy emulator running inside Balatro

wooden badge
#

bruh

vagrant cedar
#

😎

#

I think it's possible and I'm trying

wooden badge
#

I saw someone post that a vid of them running an entire episode of family guy in a pop up in balatro not long ago

wooden badge
#

oh haha

#

well then

wooden badge
#

I most certainly am out of my league

vagrant cedar
#

This is the released version of that

sick sparrow
#

made a wobbly shader and mista four hand

zealous glen
vagrant cedar
#

But I don't want it running on the card

#

I want to attempt to put it on the UIBox but I don't know if that part is possible

zealous glen
#

UI elements can hold Objects

#

that's about all I have

vagrant cedar
#

interesting

nocturne garnet
sick sparrow
nocturne garnet
#

okay so

#

theres a 1/4 chance that every 4 Mista Four hands played you die

sick sparrow
nocturne garnet
#

damnit

sick sparrow
#

you have to play with mista four cards or any 4 cards with rank 4 and mista edition

#

(you can mix it too)

tight thistle
#

hello! does anybody know how to do this? my coding knowledge is very limited as of yet, so any help is appreciated!

weary jungle
#

how do i get the boss blind? (so i can increase the boss blind)

nocturne garnet
#

G.GAME.blind

weary jungle
#

the boss blind

#

like i want to reroll boss blind and increase its chips by 1.1X

hoary tiger
#

Hey, maybe an already answered question but does SMODS currently support adding a seal or enhancement that always scores (like stone card)? The code for it in github appears to be commented out but the patch still exists so I wasn't sure if it works

vagrant cedar
#

How do I replace the music when a Joker is owned? I'm looking at the code for Jimball but I'm not seeing what I need

vagrant cedar
#

always_scores = true

storm kraken
#
 SMODS.Consumable{
    key = 'towel',
    set = 'Tarot',
    atlas = 'towel',
    pos = {x = 0, y = 0},
    loc_txt = {
        name = 'The Towel', 
        text = { 
            'Dries {C:attention}#1#{} cards,',
            'makes them {C.attention}DRY{}.'
        }
    },
    config = {
        extra = {
            cards = 3
            
        }
    },
    
   loc_vars = function(self,info_queue, card)
         info_queue[#info_queue+1] = G.P_CENTERS.m_440_dry
        return {vars = {card.ability.extra.cards}}
    end,

(whenever i hover over the fool after using this tarot card the game crashes from the return vars in loc.vars = function for whatever reason just wondering if there was a way to fix this?)

#

c.

#

😭

#

i should really check code hold up

#

yeah it still crashes

#

c is not the problem

dim steeple
weary jungle
#

how do i get the boss blind

#

is there a place that i can loop throught to get the current boss blind

tall wharf
zealous glen
weary jungle
#

consumable use when selecting blind

#

before you select blind

zealous glen
#

I decided I didn’t want to mess with changing it before

#

To reroll you can just call the function that rerolls

weary jungle
#

i think i would just need the blind objectt for the boss blind

#

but i dont know how to get that

zealous glen
#

But you need to set a random table value to make it not cost money

zealous glen
#

Because the UI wouldn’t update either

#

I think someone else has changed the Blind value but I forget who

weary jungle
weary jungle
zealous glen
zealous glen
weary jungle
zealous glen
#

Because thunk said so

#

thunk moment

weary jungle
#

i just want to increase the blind by 1.1X 😭 why is this so hard

vagrant cedar
#

Anyone know how to change the background music using a Joker?

storm kraken
#

to the person that was asking for boss blind i found this

#

idk if it helps but

#

its there

zealous glen
#

jimball?

vagrant cedar
#

I'll check L Corp

#

I checked Jimball and couldn't figure out how to do it from that

zealous glen
#

No idea what it did with them

zealous glen
#

They were removed from Steamodded and into their own repo for some reason

vagrant cedar
#

I have no clue how to apply this to a Joker

zealous glen
vagrant cedar
#

I want it to replace the background music as soon as you have the Joker

shell timber
vagrant cedar
#

I have multiple files that I want to play one after another

#

If that's not possible, I can edit them into one song

shell timber
vagrant cedar
shell timber
#

i'm blind...

zealous glen
#

Anyways

#

I don’t know how music works

#

But my instinct is to try add_to_deck

vagrant cedar
#

I'm honestly sure Jimball has the code I need but I have no clue how to do it, I'm new to this

zealous glen
#

Maybe a blocking = false and return false event too

#

Depending on the specifics

shell timber
#

the check is on the smods sound object

#
SMODS.Sound({
    key = "music_jimball",
    path = "music_jimball.ogg",
    sync = false,
    pitch = 1,
    select_music_track = function()
        return next(find_joker("cry-Jimball")) and Cryptid_config.Cryptid.jimball_music and 1.57e308
    end,
})
#

that's how cryptid does it

#

the and 1.57e308 is for priority purposes probably

nocturne garnet
zealous glen
zealous glen
#

I’m gonna update mine to new calc

autumn geode
#

having a bit of trouble with this how do i get it so that the joker converts to the enhancement ive added tried a bunch of different variations and nothing has seemed to work

#

ive tried without centers

#

ive tried with set_ability

vagrant cedar
#

["Cryptid"] = { ["jimball_music"] = true, ["code_music"] = true, ["exotic_music"] = true, ["big_music"] = true }

#

Is what it says in config.lua

zealous glen
#

@nocturne garnet do your temporary cards work in new calc already

shell timber
#

that's so you can turn it off in the mod's settings

nocturne garnet
#

its not like i made a sticker for them or anything

zealous glen
vagrant cedar
weary jungle
#

3 more runes! 3 more runes!

shell timber
#

you could just take it out

zealous glen
nocturne garnet
#

nono i didnt do anything special

#

its just cards that are destroyed at end of round

#

i didnt want my joker to say "that is destoyed at end of round" because i didnt want the joker to have like 6 lines of text

zealous glen
#

Also I think it’s a neat mechanic

#

Do you have a graphic?

#

I repurposed the debuff sticker for mine

#

As a placeholder

vagrant cedar
mellow prism
#

been looking through several examples people have given of how they destroy cards. the whole destroyed cards appearing in hand as empty is still where i'm at if it's what i had from before, i feel like i'm missing something extraordinarily obvious at this point for as many times as i've seen this implemented

nocturne garnet
#

atp

#

i might aswell just make it a sticker

zealous glen
dim steeple
tall wharf
#

oh those are seals?

dim steeple
#

yeah

#

mechanical seal

zealous glen
#

I’ve never seen anyone use it except maybe keku so I don’t know how it works, but I believe the only way to change the z-order is to change the order of love.draw calls

zealous glen
dim steeple
#
        card.scale = card.scale or 1
        card.speed = card.speed or 1
        local timer = G.TIMERS.REAL * card.speed
        local scale_mod = (card.scale * 0.1) +
            0.2 *
            (0.07 + 0.02 * math.sin(1.8 * timer) + 0.00 * math.sin((timer - math.floor(timer)) * math.pi * 14) * (1 - (timer - math.floor(timer))) ^ 3)
        local rotate_mod = 0.05 * timer


        if card.seal and card.seal == 'btp_mechanical_seal' then
            G.shared_seals[card.seal].role.draw_major = card
            G.shared_seals[card.seal]:draw_shader('dissolve', nil, nil, nil, card.children.center)
            card.children.center:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center, 0, 0)
            G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
                0 * scale_mod, 80 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('played', nil, card.ARGS.send_to_shader, nil, card.children.center,
                1 * scale_mod, 10 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
                1 * scale_mod, 40 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('played', nil, card.ARGS.send_to_shader, nil, card.children.center,
                2 * scale_mod, 10 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
                2 * scale_mod, 20 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('voucher', nil, card.ARGS.send_to_shader, nil, card.children.center,
                2 * scale_mod, 10 * rotate_mod)
            G.shared_seals[card.seal]:draw_shader('hologram', nil, card.ARGS.send_to_shader, nil, card.children.center,
                3 * scale_mod, 10 * rotate_mod)
        end
    end,```
#

rotate_mod is an endless spinner based on the global timer value

#

then the shaders are modified by the card.scale and card.speed values I've set

#
...
G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0,
                func = function()
                    destroyed_card.speed = base_card_speed
                    destroyed_card.scale = base_card_scale

                    ease_value(played_card, 'speed', inc_speed, nil, nil, nil, ease_speed, 'quad')
                    ease_value(played_card, 'scale', inc_scale, nil, nil, nil, ease_speed, 'quad')
                    play_sound('whoosh1', 0.94, 0.3)
                    ease_value(destroyed_card, 'speed', inc_speed, nil, nil, nil, ease_speed, 'quad')
                    ease_value(destroyed_card, 'scale', inc_scale, nil, nil, nil, ease_speed, 'quad')
                    return true
                end
            }))
...
zealous glen
#

Okay so it doesn’t use love.draw directly

#

Which I think keku did

dim steeple
#

Here is the original way patching the draw method

#

but both work

zealous glen
dim steeple
#

Ah I see what you mean now

dusk garnet
#

what are the default rarity weights for vanilla

violet void
wooden badge
#

damn its really 5% for rare cards?

dusk garnet
#

(adding to joker pool)

tight thistle
storm kraken
#
  calculate = function (self,card,context) 
  if G.GAME.blind.boss then
     if context.end_of_round then
             for i = 1, #G.jokers.cards do 
                     G.jokers.cards[i]:set_edition({negative = true} ,true)
                end
        end
    end
end

how would i make this not happen alot of times and not slow down the game

zealous glen
zealous glen
#

See if the wiki helps

tight thistle
zealous glen
#

You save if you found any Queens or not, then you can remember it later

#

Then at some point you clear it and forget

autumn geode
zealous glen
wooden badge
#

if it works anything like poll_seal then you don't need the G.P_CENTERS

lyric blade
autumn geode
#

hmmm let me give it a whirl

lyric blade
#

But seems really interesting

wooden badge
#

just do what you have without G.P_CENTERS - you'll have to look at the arguments afterwards I don't know if theya re right

wooden badge
nocturne garnet
autumn geode
wooden badge
#

I'm not sure why you are using poll_enhancement then, isn't that for choosing a random enhancement in the pool?

autumn geode
#

ive tried without and was suggested to use the poll enhancement

#

basically all i want is to set played cards to my enhancement

#

through the joker

wooden badge
#

is set_enhancement even a function? Have you made your own because I can't find it in the source or the smods

#

don't confuse enhancements and editions they don't fall under the same parameters

autumn geode
#

another thing i was told to use by someone else before i was trying to use set ability

wooden badge
#

you've used "e_..." to reference your enhancement but the game uses "m_...'

#

if it is an edition you can use set edition

#

but I don't know how it would work for enhancements

frosty dock
#

poll_enhancement is for random enhancement

wooden badge
#

ah right I just found it

#

I think @frosty dock will know a bit more about this than me lol

frosty dock
#

if you're trying to set a card to one specific enhancement, you'd use v:set_ability(G.P_CENTERS['m_mldg_moldge']) if that's the key of your enhancement

autumn geode
#

ah perfect thank you

zealous glen
frosty dock
#

it's a seed

autumn geode
zealous glen
#

Yeah you need to pass it as a table

#

In another argument

upper ermine
#

Hi, I just joined the Discord. I'm making a mod that is really just for myself and a group of friends, for fun. I've successfully modded all the cards and stuff that I want to do, but I'd like to make changes to the Balatro logo on the main menu as you load in. I have a couple questions if anyone happens to know from previous experience.

Is the Balatro logo a font that exists? Or if I were to add letters/change the wording would I have to approximate those new letters from scratch? I noticed a lot of mods have done it and even matched the gradient, 3D effect, and outer glow. I'm no artist, but I will give it a shot.

Do you know if the card that pops up on that screen goes to the center of the image? (ie, if I add 100 pixels to either side of the .png, would it still work?)

zealous glen
#

The card on the center of the screen is a card

#

If you set the size right it should still work

night pagoda
#

What do I do if my patch has the same target as steamodded's patch and it doesn't apply because of that? It did apply before and steamodded's patch isn't using at, so I have no idea what to do besides relocation

hardy viper
#

change priority?

zealous glen
#

Patch the Steamodded code?

night pagoda
night pagoda
zealous glen
night pagoda
#

ah, that it can do yes

#

I thought you meant steamodded's files

dusk garnet
#

is there a way to force a joker to trigger after scoring and every other joker? i want to set chips to 1 without letting other jokers override it

night pagoda
#

yes changed priority and the patch works

elder vapor
#

any ideas what to add here

weary jungle
#

what is the code for no edition

weary jungle
#

brush

#

maybe even a card getting polished

long sun
#

spray lines

#

possibly make it larger, and tilted?

#

oh also, does anyone have a link to the context documentation?

weary jungle
long sun
#

ah i think i found- yep, that's the one, thanks!! :D

dusk garnet
#

also answered my question :p

#

thanks!

long sun
#

oh ya one more question

#

how do i check the name of a Joker?

#

(i want to check through the list of jokers, and find the ones which are both not editioned and not Dimere)

tight thistle
zealous glen
#

Also check for key not name

long sun
#

thanks ^^

glass scaffold
#

Getting this error when starting a blind with my Joker. Any ideas?

violet void
wooden badge
# tight thistle i still do not understand, im really sorry

I think what they are saying is that you need to make another variable in your loc_vars extra table. One that is a boolean check for at least a queen present in your hand during context.before. If it is, then you can continue into the context.individual stage and operate on each of the kings using the get_id check (it is 13 for kings).

glass scaffold
violet void
glass scaffold
tight thistle
#

thank you!

violet void
tepid crow
#

does anyone know where the music speed is defined in the code? it seems slowed down from the original sound files

edit: my guess seems to be about 70%?

wooden badge
#

@tight thistle call it something like queen_check, then have a process during context.before to scan your hand for a queen and return true to queen_check

glass scaffold
weary jungle
violet void
weary jungle
#

short circuit evaluation moment

glass scaffold
weary jungle
#

that should work

#

probably

#

🤞

glass scaffold
#

And it worked

long sun
#

one more question, sorry :}

#

how can i check if a Joker has no edition?

weary jungle
#

if card.edition == nil iirc

glass scaffold
long sun
#

cheers :D

#

i'll take that one, thanks!

glass scaffold
#

In my experience, this has worked.

#

But YMMV.

weary jungle
#

but we are looking for if the joker has no edition

long sun
#

they're saying that base means no edition, though?

glass scaffold
#

Editions are a whole new ball game.

long sun
#

how do you play said ball game? is it as fun as cage batting? :D

glass scaffold
weary jungle
#

i just realized i made wheel of misfortune 😭

rough furnace
#

3 in 4 chance to remove an edition from a joker

weary jungle
#

1/4 chance actually

wicked leaf
#

I have an idea.

long sun
#

the four winds!!

weary jungle
#

guys im basically done

wicked leaf
#

these three most specifically

long sun
#

sorry to keep bothering, but how do i do seeded probability, again?

#

i'd like to randomly select an index in the applicable jokers

violet void
#

You could use Pseudorandom_element() to select a random Joker

long sun
#

does that work with seeds, though?

violet void
#

It does from my experience

long sun
#

okay, i'll try that :D

weary jungle
#

pseudorandom_element(G.jokers.cards, pseudoseed('seed'))

long sun
#

schweet, thanks!

wicked leaf
#

whats the context for scoring a card?

long sun
#

checking, two secs

#

ah wait sorry i misread =w=

violet void
wicked leaf
#

and ONLY 3s

#

actually, no wait

#

ok im checking again

#

if it contains a 3, give mult

#

not score a 3

violet void
#

You'd need to loop #G.play.cards

#

I would write an example if I was on PC

wicked leaf
#

ill look around for examples

sturdy compass
#

Just pushed my first public release YAHOOOOOOOOOOOOOOO

wicked leaf
#

congrations

#

send a link

violet void
#

I concur

sturdy compass
violet void
#

Did you create a thread?

sturdy compass
#

Not yet

#

I should

violet void
#

Yess

wicked leaf
#

im gonna remake my thread once I release my mod

maiden river
#

changed this from every glass card in scored hand to every glass card discarded, which I think is a nicer change

long sun
#

(note: use {C:mult} and not {C:white,X:mult})

violet void
#

Yes that should be used for xmult

maiden river
#

ah

long sun
#

(actually there are a few changes, lemme note those)

maiden river
#

makes sense

violet void
#

Unless it's a stylistic choice

sturdy compass
#

Thread made danceman

maiden river
long sun
#

All discarded Glass cards break, gains double their ranks as Mult (Currently +0 Mult)

#

seems a bit weak for Rare?

maiden river
#

oh yeah I haven't really messed w/ the rarites in a bit

#

it's a little unfortunate that I have to keep restarting the game whenever I change anything,
esp. when it's something as small as text descriptions

rough furnace
maiden river
#

jonh DebugPkus saves me yet again

candid epoch
#

also question, can consumable detect if you have specific vouchers and then apply effect depending on it?

weary jungle
#

probably

paper lantern
#

Hey there. So if I'm interested in creating Balatro mods, what's the go-to set up? There doesn't seem to be anything specific listed in the pins.

candid epoch
#

also, are vouchers only possible as tier 1 and tier 2 or can there be more?

rough furnace
#

Other mods have added higher teirs but I'm not sure if they need patches to work

elder vapor
#

trying to figure out how to fill the empty space

candid epoch
elder vapor
#

shhh

#

they don't need to know

weary jungle
#

is there more options to the ease in event manager

candid epoch
#

well, i need to learn how to apply consumables to cards

maiden river
candid epoch
#

like how to use consumable to apply permanent +10 mult

weary jungle
#

as an edition/enhancement?

candid epoch
#

nah

#

imagine as the hiker joker

#

permanent chip giver

rough furnace
maiden river
#

ah I see

#

big

wooden badge
#

can anything go outside of the calculate function in SMODS.Joker? I think that the game stores certain parameters after a single complete call of 'calculate' but I want something to update globally without having to consult calculate at all

maiden river
#

I get it

weary jungle
#

does anything need to be to_big()itized?

wooden badge
#

I tried putting it in loc_vars but of course that will only update when you hover over the joker

frosty dock
#

you can even have vouchers that require a bunch of different vouchers to be redeemed first

candid epoch
#

may change it to tag, depending how i can do it

frosty dock
candid epoch
#

so basicly, i think it will have function in Lv 1 voucher, and checks if voucher Lv 2 is redeemed, if yes, make Lv 2 pack, if not, make Lv 1 pack

vagrant cedar
#

@rough furnace @frosty dock Are either of you available to assist me in crafting a new Joker

#

I'm trying to emulate Gameboy in Balatro

candid epoch
#

so NES wasnt enough? 💀

vagrant cedar
#

Well... No

frosty dock
vagrant cedar
wooden badge
#

@frosty dock when I use context.using_consumeable the G.GAME.last_tarot_planet doesn't update until the full call of 'calculate' is complete. EG if my backlog is empty then trying to access what the last consumeable that has just been used to trigger the branch returns nil instead. I know that there is context.consumeable which is that card but when I ask for the name/key of it can only give me the table signature rather than the ACTUAL name string of the consumeable - it is that name string that I want.

frosty dock
candid epoch
#

so looking at example
this is seal code?

        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                for i = 1, card.ability.max_highlighted do
                    local highlighted = G.hand.highlighted[i]

                    if highlighted then
                        highlighted:set_seal('s_seel_blu')
                    else
                        break
                    end
                end
                return true
            end
        }))
    end```
wooden badge
candid epoch
#

how to spawn a consumable from the debugplus?

zealous glen
#

same as Jokers

candid epoch
#

i am first time useing it, i dont know how any of those

zealous glen
#

holding tab will show you the menu

weary jungle
#

guys im done with the runes

#

now i have to do localization

#

😭

elder vapor
#

3/3 textured furiyippie

candid epoch
#

what are these silly goobers?

#
  loc_txt = {
    name = "White Potion",
    text = {
        "Add {green}Green Seal{}", 
        "to {C:attention}1{} selected card"
    }
  },
    unlocked = true,
    discovered = true,
    atlas = "PotionUP",
    set = "Potions",
    key = "whitepotion",    
    pos = {x = 2, y = 1},
    cost = 2,
    order = 7,
    max_highlighted = 1,
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                for i = 1, card.ability.max_highlighted do
                    local highlighted = G.hand.highlighted[i]

                    if highlighted then
                        highlighted:set_seal('s_potionup_potseal')
                    else
                        break
                    end
                end
                return true
            end
        }))
    end
}```
this shit aint letting my consumable be used
#

what i done wrong?

weary jungle
#

add a can_use function

candid epoch
#

ofc theres no can_use in example...

violet void
# candid epoch what i done wrong?

Not wrong per se but I would probably remove the check if highlighted exists and actually loop the highlighted cards instead of max_highlighted

weary jungle
candid epoch
violet void
#

I saw, but, generally speaking

candid epoch
#

i am just so confused

candid epoch
weary jungle
#

<=

candid epoch
#

also what function can_use uses?

#

just self or anything else?

weary jungle
#
        return --insert here
    end,```
vagrant cedar
#

Is there anybody that knows coding outside of Balatro that can help me with my project?

#

I'm trying to run a gameboy emulator inside Balatro

frosty dock
tight thistle
candid epoch
#
        if #G.hand.highlighted <= max_highlighted then
            return true
        else
            return false
    end,```
this?
weary jungle
#

you can simplify

#

return #G.hand.highlighted <= max_highlighted

candid epoch
#

"you can simplyfy" man you sound like my math teacher 😭

worthy stirrup
#

Is there a way to have a keybind select a card?

candid epoch
#

i clicked on a card after adding

       return #G.hand.highlighted <= max_highlighted
    end,```
and game crashed lmao
weary jungle
#

card.ability.max_highlighted

wooden badge
karmic totem
#

i have a quick question. what does this crash mean and how do i fix it? is it a mod crashing or is it smth else?

candid epoch
#
       return #G.hand.highlighted = card.ability.max_highlighted
    end,```
i be going insane by the end of this
candid epoch
karmic totem
#

the crash is up top but i can zoom in on it

vagrant cedar
candid epoch
#

ctrl + C

#

ctrl + V

paper lantern
#

Hey so I'm getting an error related to the json metadata. Does anything stick out about this?

karmic totem
#

gimme a sec

hardy viper
#

needs a version

candid epoch
hardy viper
#

and a badge colour

#

and yeah remove dependencies array but that shouldnt be an issue

karmic totem
#

alright here

vagrant cedar
#

Something with the Blind Editions mod

#

That's all I can get from it

hardy viper
#

thats first-round-joker

candid epoch
#

oooga booga shit crash

       return #G.hand.highlighted <= card.ability.max_highlighted
    end,```
i am stupid lmao
hardy viper
#

not blind editions

paper lantern
hardy viper
#

@karmic totem uninstall first round joker btw

#

thats whats crashing

karmic totem
#

Alright then

hardy viper
#

ya

paper lantern
#

kk I'll take a look then

wooden badge
candid epoch
#

@weary jungle, i did everything you asked and it still dont work

weary jungle
#

can you send your code?

candid epoch
#
  loc_txt = {
    name = "White Potion",
    text = {
        "Add {green}Green Seal{}", 
        "to {C:attention}1{} selected card"
    }
  },
    unlocked = true,
    discovered = true,
    atlas = "PotionUP",
    set = "Potions",
    key = "whitepotion",    
    pos = {x = 2, y = 1},
    cost = 2,
    order = 7,
    max_highlighted = 1,
    can_use = function(self, card)
       return #G.hand.highlighted <= card.ability.max_highlighted
    end,
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                for i = 1, card.ability.max_highlighted do
                    local highlighted = G.hand.highlighted[i]

                    if highlighted then
                        highlighted:set_seal('s_potionup_potseal')
                    else
                        break
                    end
                end
                return true
            end
        }))
    end
}```
#

it says it trying to compare number with nil

weary jungle
#

what line is the error on/

candid epoch
#

the one added
return #G.hand.highlighted <= card.ability.max_highlighted

hardy viper
paper lantern
#

Is there any way to get intellisense?

candid epoch
hardy viper
#

add ```
config = {
extra = {
max_highlighted = 5 --any number
}
},

karmic totem
#

that works but now when i move to page 3 of my decks this happens :/

hardy viper
candid epoch
#
  loc_txt = {
    name = "White Potion",
    text = {
        "Add {green}Green Seal{}", 
        "to {C:attention}1{} selected card"
    }
  },
    unlocked = true,
    discovered = true,
    atlas = "PotionUP",
    set = "Potions",
    key = "whitepotion",    
    pos = {x = 2, y = 1},
    cost = 2,
    order = 7,
    max_highlighted = 1,
    config = {
        extra = {
        max_highlighted = 5 --any number
        }},
    can_use = function(self, card)
       return #G.hand.highlighted <= card.ability.max_highlighted
    end,
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                for i = 1, card.ability.max_highlighted do
                    local highlighted = G.hand.highlighted[i]

                    if highlighted then
                        highlighted:set_seal('s_potionup_potseal')
                    else
                        break
                    end
                end
                return true
            end
        }))
    end
}```
#

still broken

viscid bough
#

anyone able to help me here?

karmic totem
weary jungle
candid epoch
#

you said earlier that card.ability.max_highlighted???

weary jungle
#

that was when you had no config

#

now that you have a config, its a bit different

candid epoch
#

welp, now it breaks when applying seal

#

fuuuuuuuuuuuuuuuuuuuuuuuckkkkkkkkkkkk

weary jungle
#

make sure to replace all instances of card.ability.max_highlighted

#

even in the use function

weary jungle
karmic totem
candid epoch
#
  loc_txt = {
    name = "White Potion",
    text = {
        "Add {green}Green Seal{}", 
        "to {C:attention}1{} selected card"
    }
  },
    unlocked = true,
    discovered = true,
    atlas = "PotionUP",
    set = "Potions",
    key = "whitepotion",    
    pos = {x = 2, y = 1},
    cost = 2,
    order = 7,
    max_highlighted = 1,
    
    config = {
        extra = {
        max_highlighted = 1
        }},
        
    can_use = function(self, card)
       return #G.hand.highlighted == card.ability.extra.max_highlighted
    end,
    
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                for i = 1, card.ability.extra.max_highlighted do
                    local highlighted = G.hand.highlighted[i]

                    if highlighted then
                        highlighted:set_seal('s_potionup_potseal')
                    else
                        break
                    end
                end
                return true
            end
        }))
    end
}```
candid epoch
#

you have it, you just dont know it

#

but anyway, your problem is an atlas

karmic totem
tight thistle
candid epoch
weary jungle
#

what is the crash?

candid epoch
wooden badge
weary jungle
karmic totem
candid epoch
#

i am like takeing one hour to make one fucking make one consumable, i am going insane

weary jungle
#

do you have an image of the joker? or is there no art yet

karmic totem
#

how do i figure out what the atlas is trying to show?

candid epoch
#

whatever you assigned it

#

whats on your 11 line of code?

weary jungle
candid epoch
#

atleast i think its that

karmic totem
weary jungle
#

modding dev is for when you are developing mods

karmic totem
#

oh ok

#

sorry then didnt know really

weary jungle
#

its ok

candid epoch
#

why the fuck my game, crashes when seal is being made, idfk

weary jungle
#

what is the crash

candid epoch
wooden badge
#

@tight thistle

#

something like that

#

you may have to tweak your 'if' branch structures but that's the idea

rigid moss
#

Hey guys, I have a problem... after updating lovely to newest version for some reason my override of Card:calculate_joker(context) and subsequently all my jokers that modified it completely stopped working

#

for example I have a joker that converts joker to the left to xmult by capturing the return message from calculate_joker and turning some fields to xmult

#

according to debug console the message actually changed

wooden badge
#

@tight thistle

rigid moss
#

but the joker returned its old value anyways. This did not happen before and the conversion joker worked properly but now stopped

wooden badge
#

this is a bit more thorough

#

@tight thistle Do note that you can't just blindly copy paste what I wrote there its just a skeleton for the idea that I am suggesting, you will need to figure out how your bits and pieces fit together

rigid moss
#

did lovely change the way function overrides work in newest version or something completely different is at fault here?

candid epoch
#

i need to check something, whats the code for applying golden seal?

rigid moss
#

card:set_seal('Gold', true) should work

candid epoch
#

that contredicts whole shit

paper lantern
#

Alright this is kind of strange. The joker sort of looks as you'd expect when you bring the settings menu up. But in normal gameplay it gets dark.

#

Anyone know why?

worthy stirrup
#

Is there a way to select a card with the code

candid epoch
worthy stirrup
#

im aware but im trying to figure out how to do it, lol

#

G.hand:add_to_highlighted()

paper lantern
#

Ya can't find anything about the Joker appearing super dark in gameplay. The sprite atlas is a png like the base game.

candid epoch
#

the shaders of CRT may be the thing

#

try to turn it off

#

and see what happens

#

anyway, i am going insane by how the fuck the seal not working properly

tight thistle
wooden badge
#

@tight thistle does it make some sense now after my picture?

paper lantern
tight thistle
worthy stirrup
#

Im unsure what is causing this crash

SMODS.Keybind{
  key = 'FirstCard',
  key_pressed = '1',

  -- Initialize the toggle state
  toggle_state = false,

  action = function(self)
      if G.hand then
          -- Toggle the state
          self.toggle_state = not self.toggle_state

          -- Use the toggled state in your function
          G.hand:add_to_highlighted(G.hand.cards[0], self.toggle_state)
      end
  end
}
candid epoch
#

i am giving up with the seal for today

worthy stirrup
#

okay, it now selects it, but it no longer deslects it, even if the card is discarded

candid epoch
#

well you have _add_to_highlighted

worthy stirrup
#

How do i play a hand, i see G.play but im sure thats most likely not all thats needed

violet void
#

Does formatting not work for the unlock condition?

#

It's always attention and not important 🙄

candid epoch
#

lmao

hidden timber
#

current status of the mods page

dusk garnet
#

what stack

night pagoda
#

How can I trigger scoring for a certain card?

#

As in: Is there a function that lets me do something like this?
some_card:score()

iron socket
#

Hello, I am new to Balatro modding (and modding in general), I've been creating a few mods by looking at other ones and trying to understand how they do what they do. I want to create a mod that replaces the texture and name of specific things (Jokers, playing cards, tarots, etc.) without replacing the entire file. For example, I want to rename and retexture the Lucky Cat Joker to be Turbo Granny from DanDaDan, but I don't want to replace the entire en-us and Jokers files. Can anyone tell me how that's done or show me a mod that does it so I can learn? Thanks

zealous glen
#

Check out Legendere for referece

iron socket
#

Great, thanks! If I have any other questions I'll be sure to come back

candid epoch
#

question
if my prefix is " potionup "
my seal key is " potseal "
then the correct code to apply it to a card is " s_potionup_potseal "?

#

or i fucked up?

sand oasis
#

that sounds right

#

Is there a context for after a hand is played?

sand oasis
candid epoch
elder vapor
#

how are you applying the seal

#

(also i like to look at mods that add stuff when adding smth (like cryptid))

candid epoch
#

SMODS.Consumable{
loc_txt = {
name = "White Potion",
text = {
"Add {green}Green Seal{}",
"to {C:attention}1{} selected card"
}
},
unlocked = true,
discovered = true,
atlas = "PotionUP",
set = "Potions",
key = "whitepotion",
pos = {x = 2, y = 1},
cost = 2,
order = 7,
max_highlighted = 1,

config = {
    extra = {
    max_highlighted = 1
    }},
    
can_use = function(self, card)
   return #G.hand.highlighted == card.ability.extra.max_highlighted
end,

use = function(self, card, area, copier)
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 0.1,
        func = function()
            for i = 1, card.ability.extra.max_highlighted do
                local highlighted = G.hand.highlighted[i]

                if highlighted then
                    highlighted:set_seal('s_potionup_potseal')
                else
                    break
                end
            end
            return true
        end
    }))
end

}

#

by consumable

rough furnace
#

new reaction gif dropped

candid epoch
#

i think wrong channel bud

hidden timber
rough furnace
candid epoch
#

maybe you are, but how this releated 😭

dusk garnet
candid epoch
#

i am loseing myself trying to make seal work properly

viscid bough
#

Yall I wanted to make a mod named after a spectral card but that cryptid guy has, like, all of them already 😭😭😭

frosty dock
frosty dock
weary jungle
#

name it after a cryptid spectral 😭

candid epoch
#

PLEASE SOMEONE FOR THE LORD OF CHRIST UPDATE THE EXAMPLE

frosty dock
#

wtf that example is so fucking old

candid epoch
#

and then i have to ask about everything how to do when example is outdated 😭

frosty dock
#

that's a solid 5+ months old example

#

the date of its creation is literally closer to the release of steamodded 0.9.8 than it is to today

#

💀💀💀

candid epoch
#

someone really needs to update it...

#

new devs like me have hard time learning 😭

#

and it doesnt help me that some devs are also oblivvious

#

like these 2 were wrong apparently

#

well, gn

violet void
#

Smods adds "_seal" automatically

Also, I feel you

#

I guess that was already discussed above though

lean swift
#

hey this is probs a really basic question but if I wanna edit the texture of a single joker do i just edit the jokers.png file in resources/textures/2x (or 1x idk what the difference is)?

wooden badge
# tight thistle nope, sorry

@tight thistle Then I'm afriad I'm going to have to be brutally honest and suggest you go away and get the hang of some programming fundamentals and seriously consider if this is what you want to spend your time on. Only then should you try and make some sense of Balatro's source code and the steamodded API.

frosty dock
frosty dock
night pagoda
#

Any ideas?

#

I want to score a certain card under some condition while the regular scoring happens

violet void
#

Do you mean like how lusty joker adds +3 to Heart cards?

night pagoda
#

Nope; more like red seal retriggers except it's not the same card gets scored again

analog pilot
#

they want to just be able to score a card even if its not a part of the poker hand

frosty dock
zealous glen
zealous glen
night pagoda
zealous glen
#

I had code for it which I need to update

tight thistle
frosty dock
#

better calc is not better enough to be able to consistently use the same function across all scoring contexts

viscid bough
#

Im planning to make a consumable that brings back a random joker that you’ve sold or destroyed. Is this possible without some sorta patching? If so, how would I patch something in to let me do this

frosty dock
#

i could try to see if there's anything similar enough to be merged into a single function, but i think main joker/card scoring is just a bit too unique

zealous glen
#

Then select one of them

#

IIRC myst had a graveyard

#

@frosty dock I asked earlier, but now that I'm trying to do it, I'm a bit confused what's the best way to iterate over the deck and discard pile to calculate a new context

wooden badge
# tight thistle feels great

sorry if that sounded off-handed, it wan't meant to be. I'm not going to beat about the bush though, you need to sit down and really work out how variables and checks on those variables are processed before you can approach stuff like this yourself.

#

Every language has its quirks but the fundamental rules are pretty much the same across languages

maiden river
#

finally got the forum page for my mod up to date egg

#

feelin swag

hidden timber
#

Assembly

#

Mainly

dusk garnet
#

nice!

zealous glen
#

I'm mostly trying to decide if it should be SMODS.trigger_effects or what

#

that doesn't seem to receive a full context table, so maybe eval_card?

frosty dock
# zealous glen <@538635176847343636> I asked earlier, but now that I'm trying to do it, I'm a b...

something along the lines of

local context = {something}
context.cardarea = G.deck
for i=1, #G.deck.cards do
  local effects = {eval_card(G.deck.cards[i], context)}
  SMODS.calculate_quantum_enhancements(G.deck.cards[i], effects, context)
  SMODS.trigger_effects(effects, G.deck.cards[i])
end
context.cardarea = G.discard
for i=1, #G.discard.cards do
  local effects = {eval_card(G.discard.cards[i], context)}
  SMODS.calculate_quantum_enhancements(G.discard.cards[i], effects, context)
  SMODS.trigger_effects(effects, G.discard.cards[i])
end
zealous glen
frosty dock
#

wdym non-enhancements? calculate_quantum_enhancements just evaluates additional effects from additional enhancements if they exist

#

this is basically what calculate_context does minus the return_table part

zealous glen
frosty dock
#

not sure if this is something that should be added into steamodded for all viable contexts, seems like a lot of overhead

frosty dock
frosty dock
#

calculation on deck and discard

zealous glen
#

without needing to reimplement it

#

because each mod iterating on their own is even more overhead

#

besides the fact I'm sure some mods won't do it properly and cause side effects 🤔

#

(with other mods)

#

So if a mod could request that some context be applied to some area would be useful

viscid bough
zealous glen
#

The Castle example does something similar

frosty dock
#

okay what if I check any loaded files for containing context.cardarea == G.discard or context.cardarea == G.deck and use that to activate the contexts 🤔

zealous glen
violet void
#

This might be the most complicated thing I tried

I'm trying to have a Joker retrigger the Joker to the left for X repetitions, and while it's working for non-scoring contexts, xmult, mult and chips dont apply at all

Suggestions?

        if #G.jokers.cards > 1 then
            local self_index
            for i = 1, #G.jokers.cards do
                if G.jokers.cards[i] == card then self_index = i end
            end

            if G.jokers.cards[self_index - 1] then
                for i = 1, card.ability.repeats do
                    local effects = eval_card(G.jokers.cards[self_index - 1], context)
                    if effects.jokers then
                        card_eval_status_text(G.jokers.cards[self_index - 1], 'extra', nil, nil, nil, {message = localize('cs_fall_again'), colour = G.C.YELLOW})
                    end
                end
            end
        end
    end```
frosty dock
violet void
#

you assumed correctly, lemme try

zealous glen
karmic kelp
#

I'm working on a mod, and just about to get onto making the jokers. I've currently got old calc (I think before better calc even released?)
should I upgrade immediately or hold off?

zealous glen
#

I think you should upgrade

#

I upgraded and for the most part I didn't have do change anything

#

I think I had one or two broken patches

topaz sun
random sleet
#

bettercalc doesnt even change that much if you arent doing certain things

#

(mostly enhancements, and jokers need to return mult instead of mult_mod)

wintry solar
#

They can return mult mod still

#

It just requires a message too

random sleet
#

oh yeah

zealous glen
#

also I have a question

random sleet
#

that makes sense

zealous glen
#

what's the proper way to destroy a card or multiple and send it as context

topaz sun
zealous glen
#

But mainly playing cards

random sleet
#

i think pcards and other cards have different destruction contexts

zealous glen
#

Currently trying this out which doesn't quite work with Canio

local vic_destroy_card = function(card)
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 0.2,
        func = function()
            if card and not card.removed then
                if card.ability.name == 'Glass Card' then
                    card:shatter()
                else
                    card:start_dissolve(nil, i == #G.hand.highlighted)
                end
            end
            if card.playing_card and G.jokers then
                for j = 1, #G.jokers.cards do
                    eval_card(G.jokers.cards[j], {
                        cardarea = G.jokers,
                        remove_playing_cards = true,
                        removed = {card}
                    })
                end
            end
            return true
        end
    }))
end
zealous glen
topaz sun
karmic kelp
#

are there any tips for figuring out why an atlas isn't being loaded?

frosty dock
#

alright seals mod is updated

random sleet
#

seals mod

frosty dock
#

seal mod, rather

hidden timber
frosty dock
frosty dock
#

I see a lot of loc_vars being done incorrectly and not working with tooltips as a result

zealous glen
#

Out of curiosity, any ideas for how to handle card destruction besides asking thunk to fix it in vanilla

wintry solar
#

I’d considered having deck cards in calc context, but thought it would add too many unnecessary calculations, a toggle could be worthwhile though

frosty dock
#

thinking we could have something like a mod.optional_features function that can enable access to things like this that are too expensive to have always on

zealous glen
#

See if a Joker still exists before calculating it or displaying a message on it

#

I'm getting popups on thin air when I destroy Canio alongside cards

topaz sun
#

I'm trying to make an enhancement that breaks similarly to Glass Cards, but for some reason when the card is destroyed it "goes back" into the deck. the deck card count becomes "52/51" and sometimes the "ghost card" is drawn and sits in hand

#

What am I doing wrong?

zealous glen
#

There's some timing issues regarding when the card is destroyed

#

If the timing for destruction is the same as Glass, there's a variable you can set so that it is automatically destroyed

topaz sun
#

I couldn't find the glass card code inside card.lua

topaz sun
zealous glen
#

not a property of the card

wintry solar
# frosty dock also this

Not sure on this one, what scenarios don’t currently have a card anyway? Is it just info queue stuff?

frosty dock
#

yeah

wintry solar
#

Oh the fake card would be the card it would normally be right?

frosty dock
#

it's not a lot of effort to handle correctly, maybe we just need it to be documented better

wintry solar
#

Or would it be a one size fits all dummy card to stop the card indexing crash?

frosty dock
#

the fake card would be similar to what I did to retrieve the joker vars

wintry solar
#

I think that’s probably a good idea then

topaz sun
#

Did you ever find out? I have the same issue

autumn geode
#

have their been changes in the way that SMOD handles custom enhancements, following the wiki i added the calculate function for x_mult as listed but my effect is always nil

wintry solar
#

Yes the wiki is outdated, enhancements follow all other calculation principles now

wintry solar
autumn geode
#

thanks

topaz sun
wintry solar
#

On an enhancement?

topaz sun
#

yep

#

the card:remove_from_deck is just me desperarely trying anything

wintry solar
#

Why are you using final scoring step and not destroying card

topaz sun
#

oooh, makes sense now

#

so theres a whole context for card destruction inside enhancements

wintry solar
#

Probably needs an area check too though

#

My sand cards were hastily updated

topaz sun
#

Thanks a lot!

wintry solar
#

In fact, these contexts need the area adding

#

I shall have to remember that for another time

dusk garnet
#

is there a way to disable the shop's reroll button

topaz sun
wooden badge
#

is the G.P_CENTER_POOLS.Planet.config.softlock variable what the game uses to check if the secret planets are now discoverable? if not I assume there's a boolean somewhere that flips once they are

wintry solar
#

Eh I’ll just do it now on mobile

wintry solar
autumn geode
#

using context.cardarea == G.play my shit went off like 5 times each

#

is it triggering because there is more than one card with the enhancement played in the hand

#

adding context.individual it ended up not adding any mult at all

#

would anyone know what the context is so that the enhanced card only triggers the once during scoring?

wintry solar
#

Add context.main_scoring to the area check

autumn geode
#

ah thanks

viscid bough
#

are there any examples of custom consumables?

frosty dock
# wintry solar Add `context.main_scoring` to the area check

is there a reason for repetition checks with calculate_repetitions being different between G.hand and G.play calc? play calls it once with a nil ref as card_effects, while hand calls it inside the loop with existing card_effects based on effects.calculated?

wintry solar
#

I think that was just how it was in vanilla

frosty dock
#

uh alright

wintry solar
#

Maybe due to not needing reps on cards that don’t have effects?

#

Every played card should have an effect so I guess they can be calced first?

autumn geode
#

this does have the slight downside of the first card played when converted doesnt apply the effect but all other ones after do wether they are converted in that hand or not

#

i think that maybe unavoidable though

#

oh infact the first card doesnt trigger the ability at all even if it was enhanced before or not

dusk garnet
#

is there a function that is called when a joker is destroyed by any means (selling, other cards, etc.)

autumn geode
#

and if that card is played on its own then the ability doesnt trigger either

dusk garnet
#

as in how would i listen for an event and call something on that

topaz sun
#

I'm on the latest steamodded

wintry solar
#

Get rid of the old bit

autumn geode
#

oh its setting the initial value of my cards to have nil instead of 1 when it converts to the enhancement

topaz sun
dusk garnet
wintry solar
#

It should be

#

Where are you setting your card to be marked?

dusk garnet
#

ah

#

icic

topaz sun
wintry solar
#

Can you throw a print in the destroying context?

viscid bough
#

Ive got a few questions for a consumable im making. Its a spectral card thats supposed to create a negative copy of a random destroyed joker. I think ive got the things i need correct, however for one: I dont know how to make the card negative. Two: i dont know how to actually add destroyed jokers to the table i made. Id assume patches? but im not sure where to patch and last time i tried to make a patch it was absolutely terrible

topaz sun
#

I added print("message") just below the destroying_card context

viscid bough
wintry solar
#

But it doesn’t destroy?

dusk garnet
topaz sun
dusk garnet
#

what do i have to do to run something in a card's code when it's about to be destroyed

topaz sun
#

It does give the xchips, but no destroying

wintry solar
#

I am baffled

topaz sun
#

So am I

viscid bough
wintry solar
topaz sun
wintry solar
#

mods/lovely/dumps/functions

topaz sun
#

ok

wintry solar
#

Try updating again now

autumn geode
#

is there a way to make a custom joker have the same visual size as the square joker basically making another square joker but with different ability and art

zealous glen
#

Yes

autumn geode
#

are there some properties i can change for the card like the width and height directly?

zealous glen
#

Yes

autumn geode
#

would you happen to know what those are or any general way i can find it

vagrant cedar
zealous glen
#

You can check vanilla code and it's very similar

wintry solar
#

I believe smods supports it in object definition now

zealous glen
#

but I feel like this doesn't always work

zealous glen
#

but probably not offsetting right?

topaz sun
wintry solar
#

Some pixelsize or something

dusk garnet
#

anyone have any idea?

wintry solar
#

I didn’t read the pr fully

topaz sun
#

Thank you once more

wintry solar
#

Was merged the other day though

dusk garnet
#

the problem i'm trying to solve is setting/unsetting a flag while a joker is held

viscid bough
wintry solar
wintry solar
zealous glen
zealous glen
topaz sun
#

And then you'd use something like create_card to create the jokers once you use the spectral and set_edition to make em negative

viscid bough
#

i cant seem to find a wiki thing for set_edition but i found an example without any explanations on it. idk what the last two arguments are but they're set to true in the example

supple folio
#

Is there a way to add or remove a card from a pool when playing a specific deck?

viscid bough
wintry solar
#

It’s on the edition page in the wiki

zealous glen
runic pecan
#

Does smods doc include codes about side description?

wintry solar
zealous glen
#

Blame GitHub search I guess

frosty dock
wintry solar
#

That’s odd, got a screenshot I can look at?

frosty dock
#

nothing too interesting, it just doesn't retrigger. red seals and mime work fine

#

pushed what i have so far to a branch

wintry solar
#

Pls ss mobile toml browsing is hard

frosty dock
#

hold on lemme try something

viscid bough
#

the first one i mean

#

i think

#

but now im not sure how to save the keys of destroyed jokers

#

im assuming i gotta do some sorta patch

#

(Which i havent figured out really how to do well)

#

i already have my thing setting up a global table thingy to hold the keys

zealous glen
#

and save to it

viscid bough
#

i already have it creating a table for destroyed jokers

#

i just need to figure out how to save to it

zealous glen
#

uh

#

table[#table + 1] = key

viscid bough
#

not what i mean

#

i mean like

#

Detecting when a joker is destroyed and then saving its key

zealous glen
#

ah

viscid bough
#

ive used lua before, and so im not having too many issues with that stuff like tables, but what i havent used before is whatever the patch stuff is

frosty dock
misty cape
#

i am confusion

frosty dock
vagrant cedar
#

I stole that one guy's idea and started making music album Jokers

viscid bough
vagrant cedar
#

unrelated(related) question: Is it possible to give chips or mult a decimal value?

#

wait dumb question, i've done it before

#

Nevermind

viscid bough
wintry solar
# frosty dock

Yeah I don’t see why this wouldn’t work, I can take a look tomorrow if you have sorted it by then

ionic verge
#

my jokers feel oddly common whenever i playtest, like appearing way more than other jokers in their rarity bracket, does anyone know whats up with that?

#

(also, ive seen dupes appear without showman)

zealous glen
ionic verge
#

no with steammodded

#

though i have debug enabled

zealous glen
#

I meant in-game

ionic verge
#

does it boost modded jokers or something?

zealous glen
#

by opening the collection and pressing 3

ionic verge
#

i did

zealous glen
#

It allows duplicates to appear

ionic verge
#

mhm
still doesnt answer the too common problem

zealous glen
#

You need to generate it either in the shop or through Judgement, etc. for it to not be duplicated

ionic verge
#

though that might just be me

zealous glen
ionic verge
#

yeah

dusk garnet
#

how might i access "shop_final_pass" (the place where tags are triggered) in a joker context?

viscid bough
dusk garnet
#

check that it got removed from the jokers cardarea, then add it to your list

tepid crow
#

hold on, I've got a similar joker implemented to your idea

#

oh wait destroyed? 🤔

viscid bough
#

its alright, im gonna change it

#

i also realised its sorta unuseful because its not super often that a joker gets destroyed

tepid crow
#

I mean should be doable if joker destruction triggers [JOKER]:calculate_joker({destroying_card = [CARD], full_hand = G.play.cards}) nope

EDIT: it does not. You'd probably have to hook start_dissolve? And make sure it's not being sold

viscid bough
#

gonna change it to be like a better fool card

dusk garnet
#

i looked at the code for the "cash out" button and it sets the state to G.STATE.SHOP

#

and i can see where it actually populates the jokers and stuff

frosty dock
flat ridge
#

Does anyone have any ideas on how to add my language to the ui?

zealous glen
tepid crow
zealous glen
#

(checking the colors passed to start_dissolve)

tepid crow
#

HAHAHA

#

I considered that for a second

zealous glen
#

also I guess it doesn't require calling calculate each time

#

Unlike the vanilla implementation

misty cape
#

what function should i use if i am only trying to change between 2 different textures if the config option is enabled?

sturdy compass
#

Is there any way I can get the actual name here instead of the key? It works fine for vanilla jokers. G.GAME.current_round.zombie_target just holds a joker object

raw geyser
#

Anyone up to be guinea pigs for a complex simulation mod? I tried to make DV's sim mod work with any mods, but haven't tested it much

elder vapor
sturdy compass
#

Cool, ty

sand oasis
#

this may be a bit complex but would anyone understand how to sort your hand to find the highest valued card (as in its rank, a King)

elder vapor
#

ig do what raised fist does but inverse

sand oasis
#

oh good call

dusk garnet
frosty dock
zealous glen
#

Oh it's the branch

frosty dock
#

still need to test the actual feature added here, being calculation for deck and discard areas

zealous glen
#

Earlier Eremel gave me code which worked for me

analog pilot
#

...this may be a stupid question, how do i get ready to make a mod? i have vscode and i have a folder for the mod but i'm not sure what exactly i need to do

#

unless if thats all and i can get to coding

frosty dock
zealous glen
analog pilot
#

yeah

#

i have all that

zealous glen
#

then that should be it

analog pilot
#

oh cool lol, ty

zealous glen
runic pecan
#

Which file is localize function code stored?

elder vapor
#

localization/default.lua

sand oasis
#

which lua file has the consumables?

nova finch
#

can anyone help? still ttrying to fix this

runic pecan
elder vapor
#

default.lua is just the language the game defaults to if none is found

#

en-us.lua is the exact same

sand oasis
#

Would anyone happen to know where the code for the Tarot cards is stored?

elder vapor
#

card.lua

misty cape
#

i feel like im doing this wrong.. also, my config doesn't update when i reload the game. both options are always ticked off

#

i just want it to use the top one by default and if i check the option in config, it uses the bottom one

#

top part does work but changing the option does nothing.

runic pecan
#

if config.hc_Neon then
Atlas HighContrastNeon
else
Atlas HighContrast
end

misty cape
#

youre awesome thank you so mcuh

covert nova
#

How does Talisman calculate final hand size? Could it be optimized to prevent crashes on stupid mods?

#

Like does it just use whatever built in math functions Lua has

misty cape
runic pecan
nova finch
#

still can't get my joker to work how i want to

tacit flicker
#

be so fr with me, is balatro modding a good place to start modding in general? like i know a little bit about coding, but i wanna know if im being too ambitious

runic pecan
versed swan
#

(Steamodded) I'm trying to make a Joker that multiplies every price in a shop by 0.7 when in deck, but it's not working. Mod prefix tiwmig and Joker key generic_brand. Here's the code (inside the Joker object) for its add_to_deck and remove_from_deck (based on Astronomer):

add_to_deck = function(self, card, from_debuff)
    G.E_MANAGER:add_event(Event({func = function()
        for k, v in pairs(G.I.CARD) do
            if v.set_cost then v:set_cost() end
        end
    return true end }))
end,

remove_from_deck = function(self, card, from_debuff)
    G.E_MANAGER:add_event(Event({func = function()
        for k, v in pairs(G.I.CARD) do
            if v.set_cost then v:set_cost() end
        end
    return true end }))
end

and then I also have a thing being injected into the set_cost function:

#Add discount for Generic Brand Joker
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if (self.ability.set == 'Planet' or (self.ability.set == 'Booster' and self.ability.name:find('Celestial'))) and #find_joker('Astronomer') > 0 then self.cost = 0 end"
position = "after"
payload = "if #SMODS.find_card('tiwmig_generic_brand') > 0 then self.cost = self.cost*(1-0.3) end"
match_indent = true

I'm not really sure what I'm doing wrong, input would be appreciated

runic pecan
#

I have a similar joker that also manipulates shop item price.

#

In the previous version of that joker,
I looked up the coupon tag.

versed swan
#

How did you implement that Joker?

sick sparrow
#

how to make variants of same card?

#

like the variant that changes no functionality but only design

runic pecan
# versed swan How did you implement that Joker?

I wrote:
if G.shop_jokers and G.shop_booster then
for k, v in pairs(G.shop_jokers.cards) do
v.cost = [Enter new cost]
end
for k, v in pairs(G.shop_booster.cards) do
v.cost = [Enter new cost]
end
end

versed swan
#

I'll give that a try, thank you

#

Another question while I'm here, is there like a list of the properties that "G" has or whatever?

runic pecan
analog pilot
#

so it begins

sick sparrow
#

how to make variants of same card?
like the variant that changes no functionality but only design

versed swan
runic pecan
sick sparrow
iron socket
runic pecan
#

You said "design" as in, atlas/sprite?

sick sparrow
sick sparrow
runic pecan
#

Let's say, write

    return bamtris_calculate(self, card, context)
end```And define bamtris_calculate outside of SMODS.Joker but in the same file.
#

So it would like

end

SMODS.Joker{[Bamtris]}
SMODS.Joker{[looking]}
SMODS.Joker{[weirdo]}
...```
nova finch
#

I keep getting this crash when winning a blind with a joker with this code
I'm trying to give $2 for the amount of cards left in deck at the end of a round

faint yacht
#

...uh, if you're doing it there, would it not be better to try and #G.playing_cards*2?

ionic verge
#

alright im trying to make a blueprint/brainstorm like joker, can i get a run down of what this stuff does so i know what im doing?

analog pilot
ionic verge
#

card.lua

analog pilot
#

i see

#

i was trying to find the code for midas mask earlier n couldn't find it in there

ionic verge
#

just look for midas using ctrl-f

analog pilot
#

it was giving me no results but doing it again now it is

#

💔

#

i also want to look at strength bc it's important for what i'm doing too

nova finch
ionic verge
#

would there be anything id have to set up for this? like does other_joker need to be initialized or something?

faint yacht
nova finch