#💻・modding-dev

1 messages · Page 471 of 1

jagged zodiac
#

maybe I should put the extra bar above the joker instead of below the lucky

sullen brook
#

You also swapped your k and c

#

Also, that looks like a fun function of that joker. Nice work

jagged zodiac
#

oop

jagged zodiac
sullen brook
#

NP, happens to the best of us

native zinc
#

IPA name is pretty cool

pearl jacinth
#

what is the function to draw a card from the deck

#

if it even exists

red flower
#

SMODS.draw_cards(number)

flat mist
#

is this not the right way to make a function

jagged zodiac
plucky zenith
#

Can jokers have animation? This seems to work, but when I uncomment the atlas_table and frames lines, the game crashes when the joker is displayed, saying it tried to access atlas that was nil.

SMODS.Atlas({
    key = "roulette",
    path = "j_roulette.png",
    -- atlas_table = 'ANIMATION_ATLAS',
    -- frames = 2,
    px = 71,
    py = 95
})
red flower
red flower
#

you need to update the sprite position manually

flat mist
red flower
#

inside a function

#

<@&1133519078540185692>

flat mist
plucky zenith
faint yacht
native zinc
#

SMODS.draw_cards(#G.deck)

#

well it should be .cards i think

#

i for got

#

wait no im correct

#

its G.hand.cards

thorn furnace
plucky zenith
# faint yacht Use [Aura](https://discord.com/channels/1116389027176787968/1249486500811378718)...

Thanks! I was trying to do something similar in the calculate function - with the idea being that when the hand is about to be calculated the roulette wheel spins and a card value is chosen. It doesn't seem to work, but I'll look at the update function you're using

    calculate = function(self, card, context)
        if card.debuff then return nil end
        if context.before then
            logger = adc_get_logger()
            logger.log( "::CARD::" )
            logger.log( card )

            for i=0,100 do
                logger.log(i%2)
                card.children.center:set_sprite_pos({ x = i%2, y = 0 })
                -- if love.timer then
                --     love.timer.sleep(0.1)
                -- end
            end
        end
    end,
red flower
#

i need to do something like that for my mod next but still havent looked into it

humble matrix
flat mist
vast bough
#

are there any jokers that can only spawn with a certain sticker so i can have a look at how they do it. i can see small cube in cryptid but are there any others

#

wait nvm i got it

jagged zodiac
#

not fully happy with the art, it's a bit too empty, but it'll work for now :v

long sun
#

how can i make a card as large as a booster pack?

jagged zodiac
long sun
#

wait sorry i don't know what you meant ^^; do you mean something in the atlas?

jagged zodiac
#

so, in the directory Atlas reads the images from

long sun
#

ya it'd be smaller if the image was smaller

#

but this is the same size as the base game spritesheet

jagged zodiac
#

ah

#

I don't know then :v

jagged zodiac
spare ocean
#

how do i mod? im new

long sun
#

i love how this shop is completely modded dfkjgndfjkg

jagged zodiac
# spare ocean how do i mod? im new

Welcome to the Balatro Modding 101 tutorial.

In this beginner-friendly guide, I'll walk you through the steps to get started with modding in Balatro. Whether you're looking to install mods created by others or dive into making your very first mod, I've got you covered!

Links!:
https://github.com/Steamodded/smods - Steamodded
https://github.com...

▶ Play video
jagged zodiac
spare ocean
#

a thanks

jagged zodiac
dark quartz
#

in the description, what colour are ranks usually?

jagged zodiac
long sun
#

i love how this shop is COMPLETELY modded

jagged zodiac
#

oh

jagged zodiac
thorn furnace
# red flower looks hard

I figured it wouldn't be too bad but I can't figure out like 50% of it
Also i have no idea how cardareas work

jagged zodiac
long sun
#

most of it is!

#

there's a charm from Bakery and an Arts and Crafts pack from ArtBox

#

but otherwise, all me :3

jagged zodiac
#

I see I see

#

mine just has 15 jokers :v

long sun
#

that's decent going!!

#

dw about how much content your mod may have

#

overall, it's the quality of the content that really matters :D

jagged zodiac
#

oh, I wanted it to be low-impact

#

kinda like a vanilla+ mod

long sun
#

fairfair!

jagged zodiac
#

with jokers that I could see existing in vanilla

jagged zodiac
granite nymph
#

the prefix for booster packs are p_ correct?

granite nymph
#

thats not a normal rainbow

long sun
granite nymph
#

also what mod is that

cursive sentinel
#

hi quick question, looked at clearance/liquidation code and wondered if there was a way to change G.GAME.discount_percent by selling a joker w/o it being "reset" by said vouchers? i can see how to do it if the joker's owned, but not sure if there's a way with a sold joker

pale rampart
#

MY STUPID JOKER FINALLY WORKS (it adds 5 mult for every 2 played)

pure salmon
long sun
#

how can i set the mouse damping of my consumable?

cursive sentinel
#

thought of it, but risky for mod compat no?

#

i think i may do that in the end though

pure salmon
#

if anyone here is familiar with pools could i make a seperate blind pool that has a chance to override the regular boss blind pool at the start of an ante, and if you skip the blind another one from the pool appears? exactly like the showdown pool that appears on the final ante

pale rampart
#

question: how do i change the "nil" to its actual mult value

red flower
#

do you have a loc_vars function

pale rampart
red flower
pure salmon
#

hm, i can't find the blind spawning code in the lovely dumps

long sun
pale rampart
pure salmon
#

oh THANKS balatro. i was looking for POOL but it's just P.BLINDS

#

thunk cannot spell for shit

red flower
#

i mean is the same for the rest

#

like P_CENTERS

pure salmon
#

it's whatever, i found the function i was looking for

#

gulp

#

this is going to take a lot of reverse engineering

red flower
#

what are you trying to do?

pure salmon
#

create a new boss blind pool that sometimes spawns in place of the standard boss blind pool

#

i want a seperate pool, so that if you reroll it generates another in the pool and not a standard boss blind

red flower
#

oh you can probably just swap eligible_bosses at the end then

pure salmon
#

get_new_blind also handles the logic for bosses_used though

pale rampart
#

balatro modding is super fun yo

red flower
#

i wouldnt put stuff in that function tho is what i mean

#

i would copy it and just swap the table at the end

pure salmon
#

you think?

#

still a patch or a hook?

red flower
#

a hook would work

pale rampart
#

i have only made this 3 fellas for now, i'm very proud of myself

wintry wren
#

where would be the best place to start for making a balatro mod?
ive not got much experience with lua and developing game mods as a whole.
is there any decent tutorials that walk me through the full process or do i just need to wing it lmao

pale rampart
wintry wren
pure salmon
#

if i do the swap right here, i can run my own in_pool checks on the shattered blinds and the bosses_used functionality is handled by the rest of the function, right?

red flower
#

yeah

granite nymph
pale rampart
#

was doing a run to test my jokers then this bastard appeared on the shop

#

very good to see how it behaves with my jokers tbh

midnight coyote
#

how would i change jokers that appear in the shop

jagged zodiac
cursive sentinel
#

can a patch overwrite code stuff?

rotund sable
#

it can but it doesn't have to

#

i assume by "code stuff" you mean balatro source code

cursive sentinel
#

yeah

#

looking to have a joker effect to either double or halve all prices when sold

#

i can see how to do it when joker is owned

#

but when sold, the way i originally thought to do it would make it go nil if player buys a voucher after

rotund sable
#

if context.selling_self ?

cursive sentinel
#

cuz it's just G.GAME.discount_percent = extra

cursive sentinel
#

the problem isn't how to do it

#

it's about how price reduction is done

small tartan
#

Making progress, ignore moons and stars from six_suits, i'm using that mod as placeholder for debugging

#

Do you think staves is okay? Since club is already taken

midnight hornet
#

ive added voice to my simple bot mod (LLM use qwen3-32b, voice with local docker travisvn/openai-edge-tts). (Long final pause due to API limit for free tier). Does anyone have experience in Balatro bot dev? ive a few questions.

small tartan
#

Yup

cursive sentinel
#

could i add a line to self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100)) before the /100 that would be basically a * VALUE, with Value being 1 at first, but being modifiable by my jokers?

#

like, inserting a global in card.lua that doesn't exist yet? Sorry if the answer seems obvious

granite nymph
midnight hornet
small tartan
#

Yeah piacentine are nice, they keep that retro look

midnight hornet
small tartan
#

Like knight instead of queen

midnight hornet
lament agate
#

can you actually check the price of the jokers in shop?

red flower
fallow breach
#

i thought my idea was original 😭

jagged zodiac
lament agate
#

whats the context for exiting a shop again

fallow breach
jagged zodiac
#

no

#

it doesn't give 4 dollars

#

it costs 4 dollars

#

+1 joker slot is the effect

fallow breach
#

oh i see

cursive sentinel
#

where's Game:init() in?

fallow breach
#

pretty interesting

red flower
lament agate
lament agate
red flower
#

because its not setting_shop

lament agate
red flower
#

starting

lament agate
#

oh

#

im so dumb

#

hold on

small tartan
#

Guys my custom suit cards generate in all decks

#

How to avoid this?

lament agate
#

everything else is okay right

red flower
small tartan
#

Brb

red flower
lament agate
#

it works now

normal crest
#

If you never want it to generate, return always false

hard flume
#

How do I remove a modded sticker from a card?

#

Is SMODS.remove_sticker a thing?

small tartan
#

I found the culprit, it's how it's implemented in six suits, which i referenced

normal crest
lament agate
#

whats the context for detecting if cards were destroyed

hard flume
#

How would I prevent a card with a certain sticker from being destroyed?

#

Or more in general. How would I prevent a card from being destroyed?

red flower
#

there's a new context to prevent destruction of jokers tho

long sun
#

am bored. lmk if you want me to work on your mod

granite nymph
#

does anyonr know wh the souinds arent working?

daring fern
#

hallow slate
#

How would I make it so my Joker displays a list of variables in loc_vars?

daring fern
#

Also it's context.cardarea

granite nymph
daring fern
#

Also you need your mod prefix.

granite nymph
daring fern
small tartan
#

Are these icons recognizable as sword, coin/gold, club, cup? (as mini deck info icons)

red flower
#

yeah

thorn furnace
hard flume
#

why isnt this working btw

red flower
#

there's a highlight_limit argument in the cardarea init

sullen brook
#

If not, rather.

small tartan
shell timber
#

other than that they look good

small tartan
shell timber
#

yeah the shape is coiny

sullen brook
#

With colors, should be fine. Even in silhouette, you could do a bit of a glint in the dark bit to show it's something shiny and valuable.

small tartan
#

Thanks guys ^^

#

Much love

daring fern
rotund sable
#

in the calc_function in JokerDisplay definition do i have to calculate hand_chips by myself (to display the effects of a joker relaying on that while having the hand selected and not played yet)

hard flume
faint leaf
#

hi guys ummm im working on a joker and i need it to find cards with the glass enhancement how do i check for glass

#

thanks

daring fern
solid grotto
#

Why did this even happen if my code is commented out?

#

Is this lua jank or something

hard flume
solid grotto
#

It was crashing at first so I commented out all of the code just to go in and test jokers normally

#

And it does this

#

Oh wait I have 78 cards, it just added the two suits

#

Oops

thorn furnace
red flower
hard flume
#

The correct way. I'm pretty sure it has to do with the if statements, because its not crashing. It's just not doing anything

thorn furnace
small tartan
#

Coin should be done

daring fern
thorn furnace
small tartan
solid grotto
#

I realized my mistake

solid grotto
#

Didn't realize that with extra suits it creates two pages for the deck

small tartan
solid grotto
#

Question though, if I create new suits how do I stop them from appearing in normal decks immediately
I'd like for them to only be available through tarot cards / a deck that specifically starts you with them

solid grotto
#

Thx

granite nymph
#

how would i go about making a joker not appear in the shop or through any cards (riff raff, judgement, etc)

daring fern
granite nymph
#

would that go at the top around config and atlas

daring fern
hallow slate
#

How would I make a dynamic description that shows a list of values if said values are above 0? e.g. mult/chips

hallow slate
#

I have a Joker that gets bonuses. If it has a mult bonus, it shows a +X mult thing. Otherwise, it shows nothing. same goes for chips/xmult

red flower
#

you have 3 options:

  1. use vars and variable colours in your text to add/remove that text
  2. use main_end and ui nodes
  3. switch descriptions using key
#

what's the goal? a texture pack or some effect?

hallow slate
modern kindle
#

Good schmorning chat

red flower
fallow breach
#

i'm making a joker that destroys the cards to left and right of it, but the game crashes if they aren't both there

red flower
#

use Malverk then

hallow slate
#

Is this frowned upon as a method

fallow breach
thorn furnace
# red flower G.hand is `type = 'hand'`

I'm not sure if I did it right

self.hold_area = CardArea(
        15.5,
        3.75,
        self.CARD_W * 1.95,
        self.CARD_H * 0.95,
        {
            card_limit = ALLOY.hold_limit,
            type = 'hand',
            highlight_limit = 5
        }
    )
    self.hold_area.states.visible = true
    ALLOY.hold_area = G.hold_area

doesnt seem to be letting me highlight anything

teal ferry
#

do you guys know if there is a built in context that holds last played hand ? i am trying to make a joker that triggers if curently played hand is different then previous. if there isn't a builtin i will make my own variable but it may cause a little problem

small tartan
#

Downscaled the sword it's a bit ugly, but i am satisfied

teal ferry
faint leaf
thorn furnace
#

I believe so

teal ferry
#

okay. Thank you ❤️

granite nymph
#

okay the second error (the suit) is fixed now

#

but the first one (the rank) is still broken

faint yacht
faint leaf
#

sooo lets sayyy how would i fix it

faint yacht
red flower
thorn furnace
#

o

#

oh wait i got it working

#

this is the second time where the solution was just "do ???"

#

save code
open balatro
test
it doesn't work
close balatro
open balatro
test
it works now
???

#

Now I just need to make it vertical instead of horizontal

red flower
#

time to steal aiko's solitaire code

thorn furnace
#

don't get me wrong it doesn't look bad like this but like
it would fit so well above the deck

thorn furnace
granite nymph
red flower
granite nymph
thorn furnace
#

o

granite nymph
#

module > custom_minigmaes

thorn furnace
#

thanks dance

thorn furnace
# red flower <@254214302653743104>

oh right unrelated but I forgot I was gonna ask you something about a different thing
uhh
how do you get the number of cards in a specific hand

pure salmon
#

how do i make a card immune to debuffs?

red flower
thorn furnace
# red flower elaborate?
local function get_all_hands(ignore_hand_limit)
    ignore_hand_limit = ignore_hand_limit or false

    no_hand_size_limit = evaluate_poker_hand(G.hand.cards)[G.GAME.last_hand_played]
    hand_limit_accounted = {}
    
    if ignore_hand_limit then return no_hand_size_limit end
    
    if no_hand_size_limit then
        for _, hand in ipairs(no_hand_size_limit) do
            if #hand <= G.hand.config.highlighted_limit then -- Apparently #hand doesn't work and just returns zero? Replace with something equivalent
                hand_limit_accounted[#hand_limit_accounted + 1] = hand
            end
        end
    end
    
    return hand_limit_accounted
end
#

i completely forgot i just kinda left it and gave up on it

pure salmon
#

should i be doing that regardless

red flower
#

oh sorry is this a playing card

pure salmon
#

edition

#

debuffed temp cards won't destroy themselves

red flower
#

oh then on_apply

pure salmon
#

if i can make temporaries self-destruct regardless of debuff status that would probably be better

red flower
thorn furnace
#

so like if it's the first hand

#

tho if I do like
print(#hand)
it just always returns 0

red flower
#

weird

teal ferry
#

any idea ?

leaden hollow
#

config = {extra = {chips = 0, chip_mod = 10, suit = 'Hearts' }},
loc_vars = function(self,info_queue,card)
return {vars = {card.ability.extra.chips}}
end,
calculate = function(self,card,context)
if context.joker_main and context.individual and context.cardarea == G.play and context.other_card:is_suit(card.ability.extra.suit) then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_mod
return{
chips = card.ability.extra.chips
}
end
end,

still new to modding so I cant rlly tell but what's wrong with this code?

fallow breach
teal ferry
#

if context.before and context.main_eval then local reset = true if G.GAME.last_hand_played == context.scoring_name then reset = false card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain end
i use it like this

fallow breach
#

what you can do is "if context.after then, card.ability.extra.previous_hand = G.GAME.last_hand_played"

#

which will log it after the first hand you play with the joker

#

and for the card.ability.extra."blank" <-- anything can go here

fallow breach
teal ferry
#

thank you

worthy stirrup
#

The colors of the non face cards are the low contrast version, how would I have it be the High Contrast ones?

local suits = {
  Clubs = SMODS.Atlas {
    key = "collab_dr_clubs",
    path = "collab_DR_clubs.png",
    px = 71,
    py = 95,
  }
}

for suit, atlas in pairs(suits) do
  SMODS.DeckSkin {
    key = atlas.key,
    suit = suit,
    loc_txt = "Deltarune",
    palettes = {
      {
        key = "hc",
        ranks = {'Jack', 'Queen', "King"},
        display_ranks = {"King", "Queen", "Jack"},
        atlas = atlas.key,
        pos_style = 'collab'
      }
    }
  }
end
graceful vapor
#

First spectral card
It works :3

split sleet
#

Hello, I have a question regarding SMODS.Pokerhand. I want to make a new hand consisting of 5 face cards that are flush. Here is what I have

    key = 'Family',
    visible = false,
    above_hand = 'Flush', 
    chips = 20,
    mult = 5,
    l_chips = 10,
    l_mult = 2,
    
    example = {
        { 'S_K',    true },
        { 'S_Q',    true },
        { 'S_Q',    true },
        { 'S_K',    true },
        { 'S_J',    true },
    },
    loc_txt = {
        ['en-us'] = {
            name = 'Family',
            description = {
                '5 face cards with',
                'all cards sharing the same suit.'
            }
        }
    },
    evaluate = function(parts, hand)
        if not next(parts._flush) then return end
      modify_display_text = function(self, cards, scoring_hand)
        local fam = true
        for j = 1, #scoring_hand do
            local rank = SMODS.Ranks[scoring_hand[j].base.value]
            fam = fam and (rank.key == 'Ace' or rank.key == '10' or rank.face)
        end
        if fam then
           fam then return {parts.flush} end
    end
}```
#

Am I missing like a pokerhandpart or something, how would go about making unique from a normal flush?

sour garden
#

why is my joker not displaying the variables in loc_txt? did i miss setting something up?

pure salmon
sour garden
#

thank you!

pure salmon
#

np

thorn furnace
pure salmon
#

how do i make a calculate function on a card (edition in this case) always execute even the card is debuffed

serene granite
#

can someone come up with a rough draft for a joker that just adds a random card to your hand with the mult enhancement, kinda like certificate but just mult cards

i cant seem to figure it out and i gtg to work it would help me tons !

thorn furnace
# thorn furnace Bump just in case

I'm starting to think my Balatro copy is cursed
This is the third time in the past day that the solution to the problem I was having is just "try again and it magically works"

#

Nvm it broke again

#

Oh
Oh i see the problem nvm

orchid dawn
#

hey, is there any function or method that is called when a hand is played? and also one when its scored?

pure salmon
#

if context.press_play in the calculate() function for the first one

#

there's multiple contexts that trigger during hand scoring, what are you trying to do?

placid star
#

wheres the function that shows how many jokers you have in your slots?

pure salmon
placid star
pure salmon
#

oh, unsure. i don't know ui

#

i can try and find it

chrome widget
#

Trying to figure out joker retriggers... how do I make it so that a Joker that retriggers other cards doesn't respond if the card it's attempting to retrigger doesn't do anything?

orchid dawn
pure salmon
#

np

wild escarp
#

How do I check the ID of a sold joker?

daring fern
wild escarp
#

Yeah

placid star
daring fern
small tartan
#

Did i made something wrong? When i select deck in the description suits are not colored

return {
    ["misc"] = {
        ["suits_plural"] = {
            ["BBB_Swords"] = "Swords",
            ["BBB_Cups"] = "Cups",
            ["BBB_Coins"] = "Coins",
            ["BBB_Staves"] = "Staves",
        },

        ["suits_singular"] = {
            ["BBB_Swords"] = "Sword",
            ["BBB_Cups"] = "Cup",
            ["BBB_Coins"] = "Coin",
            ["BBB_Staves"] = "Stave",
        },
    },

    ["descriptions"] = {
        ["Back"] = {
            ["b_BBB_scopa"] = {
                ["name"] = "Scopa Deck",
                ["text"] = {
                    "Start the run with",
                    "{C:BBB_Cups,E:1,S:1.1}Cups{},{C:BBB_Swords,E:1,S:1.1} Swords{}",
                    "{C:BBB_Coins,E:1,S:1.1}Coins{} and {C:BBB_Staves,E:1,S:1.1}Staves{} suits.",
                },
            },
        },
    },
}
--i'm pasting only cups
local cups_suit = SMODS.Suit {  
    key = 'Cups',  
    card_key = 'COP',  
    hc_atlas = 'hc_cards',  
    lc_atlas = 'lc_cards',  
    hc_ui_atlas = 'hc_ui',  
    lc_ui_atlas = 'lc_ui',  
    pos = { y = 0 },  
    ui_pos = { x = 3, y = 0 }, 
    hc_colour = HEX('C00000'), -- red  
    lc_colour = HEX('C00000'),  
    in_pool = allow_suits  
keen atlas
thorn furnace
wild escarp
#

Wait, isn't context.selling_self a thing?

small tartan
thorn furnace
daring fern
limber marlin
#

How do I like make new variables saved with the run?

daring fern
split cairn
#

how can i make a joker that gains +1 chips every second? it's probably not that hard but idek where to start

limber marlin
# daring fern Put it in `G.GAME`

I currently have it that way, but every time I load the run and try to use the variables it crashes
Do I have to store jokers differently?

daring fern
limber marlin
#

Yes

daring fern
#

You cannot put cards in the save.

limber marlin
#

Any suggestions or like things I should look at instead then?

#

Because storing cards in the save is vital to what I'm attempting to accomplish

limber marlin
#

I am making a deck - TLAZ - which stores 2 different joker hands that swaps each blind, if that makes sense

#

In terms of the code, I'm basically just copying the jokers to an object and pulling from another, and swapping between the two

frigid cargo
#

again ^5

cedar lance
#

gang i cant code for shit what am i doing wrong here (did not crash)

limber marlin
#

I don't know much about lua but the way you set it up seems odd

#

Nevermind

cedar lance
#

bill cipher save us

limber marlin
#

What is wrong?

#

What is or isn't happening?

cedar lance
#

NOTHING is happening. like literally nothing. it should sell all consumables in the consumable area and add the sell value of those consumables to this joker's xmult, but it doesnt

limber marlin
#

well first of all, its not sell_value its sell_cost

#

That might be the issue

#

.. does that fix it?

cedar lance
daring fern
limber marlin
#

that makes sense

idle plaza
small tartan
placid star
#

why doesnt this work?

small tartan
#

Tomorrow i'm doing custom ranks, and if i don't take too much, even custom hands like settebello (single 7 of coins instead of high card, etc.)

When i'm done i'll make custom art instead of placeholders

wild escarp
#

I want this joker to add eternal to the joker on the right when it's sold, I'm guessing G.jokers.cards[i] == self doesn't work, so what else can I use?

calculate = function(self, card, context)
    if G.jokers and not context.blueprint then
        for i = 1, #G.jokers.cards do
            if context.selling_self and G.jokers.cards[i] == self then
                G.jokers.cards[i+1]:set_eternal(true)
            end
        end
    end
end
small tartan
#

But custom art right now is very low on priority

small tartan
#

Autra i can feel you, capitalization Is my enemy too

idle plaza
# placid star why doesnt this work?

Don't put () at the end of the local cfbs = ... line, that calls the function and stores its return value, instead of storing the function itself.

daring fern
#

Also move the context.selling_self check out of the for loop.

daring fern
placid star
idle plaza
limber marlin
#

So like, any work arounds to saving cards into the save?

normal crest
#

The game already saves the cards into the save file

#

You can reuse what it has

wild escarp
#

How would I go about disabling a blind that uses the debuff_hand function?

orchid dawn
#

hey
this is my code, the test 1, 2 and 3 are working (play is pressed too), but the test 4 dont work

the ideia is a joker that choose another joker to copy its effect each hand played. Half of the time it copies the leftmost joker, the other half, the rightmost joker

calculate = function(self, card, context)
        local targetJoker = nil
        local availablePos = {}
        if context.press_play then
            print('play is pressed')
        if G.jokers.cards[1] and G.jokers.cards[1] then
            table.insert(availablePos, 1)
            print('test 1')
        end
        if G.jokers.cards[#G.jokers.cards] and G.jokers.cards[#G.jokers.cards] then
            table.insert(availablePos, #G.jokers.cards)
            print('test 2')
        end
       
            if #availablePos > 0 then
                local chosen_position = pseudorandom_element(availablePos, pseudoseed('losted_doodle'))
                targetJoker = G.jokers.cards[chosen_position]
                print('test 3')
                -- if targetJoker == card then
              --      targetJoker = nil
              --  end
        end
            local ret = SMODS.blueprint_effect(card, targetJoker, context)
            if ret then
                print('test 4')
                ret.colour = G.C.PURPLE
            end
            return ret
        end
        
        return nil
    end

anyone can help me ?

errant arrow
#

what's the context for the end of a round?

red flower
#

context.end_of_round

errant arrow
#

thank you

river apex
#

Hello !
I am having trouble with a feature to dynamically change the hand size,joker size,...
The hand size is linked to a variable in the G.
But if I have a joker that increase this variable on a end_of_round, then all the increase will be made one round later.
It looks like it is :
Check for the value then increase it. But if both joker trigger in end_of_round, how can I choose which one to trigger first ?

SMODS.Joker {
    key = 'X',
    loc_txt = {
        name = 'X',
        text = {
            "Gains +#1# jslots",
        }
    },
    config = {
        extra = {
            slots = 1,
        },
        immutable = {
            max_slots = 50,
        },
    },
    rarity = 2,
    atlas = 'Jokers',
    pos = { x = 0, y = 0 },
    cost = 5,
    loc_vars = function(self, info_queue, center)
        return { vars = { self.config.extra.slots } }
    end,
    add_to_deck = function(self, card, from_debuff)
        local extra = math.min(card.ability.extra.slots * G.GAME.pharahos_scarabs, card.ability.immutable.max_slots)
        G.jokers.config.card_limit = lenient_bignum(G.jokers.config.card_limit + to_big(extra))
    end,
    remove_from_deck = function(self, card, from_debuff)
        local extra = math.min(card.ability.extra.slots * G.GAME.pharahos_scarabs, card.ability.immutable.max_slots)
        G.jokers.config.card_limit = lenient_bignum(G.jokers.config.card_limit - to_big(extra))
    end,
    calculate = function(self, card, context)
        if (context.end_of_round and not context.individual and not context.repetition and not context.blueprint) or context.forcetrigger then
            local extra = math.min(card.ability.extra.slots * G.GAME.pharahos_scarabs, card.ability.immutable.max_slots)
            G.jokers.config.card_limit = lenient_bignum(G.jokers.config.card_limit  + extra)
        end
    end


errant arrow
#

accidentally did a stack overflow crash-

frigid cargo
#

again ^6

rotund sable
#

Isn't wee joker just a regular sprite size

#

But a lot of transparent pixels on the sides

wild escarp
#

I'd like this joker to destroy the 2 and give an ethereal tag if the scoring hand contains one queen and one two, anyone know why it isn't working?

calculate = function(self, card, context)
    if context.before then
        local queens = 0
        local twos = 0
        for i = 1, #context.scoring_hand do
            if context.scoring_hand[i]:get_id() == 2 then twos = twos + 1 end
            if context.scoring_hand[i]:get_id() == 12 then queens = queens + 1 end
        end
        if twos > 0 and twos < 2 and queens > 0 and queens < 2 then
            card.ability.extra.created_tag = true
        end
    end

    if context.destroy_card and not context.blueprint then
        if card.ability.extra.created_tag == true then
            card.ability.extra.created_tag = false

            if context.destroy_card:get_id() == 2 then
                return
                {
                    func = function()
                        G.E_MANAGER:add_event(Event({
                            func = (function()
                                add_tag(Tag('tag_ethereal'))
                                play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                                play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                                return true
                            end)
                        }))
                    end,
                    remove = true
                }
            end
        end
    end
end
thorn furnace
#

How do I change the text on a button

red flower
frigid cargo
red flower
frigid cargo
frigid cargo
errant arrow
#

-# embed fail.

#

i'll put it as a link only youtube video, one moment

orchid dawn
modern kindle
#

you also could just convert it to mp4

#

yewa

#

mp4 embeds, mkv never has in my exp

orchid dawn
errant arrow
#

i know im missing the emplace, but when i put it into my code, the game crashes

errant arrow
#

it's at the end of the video, but here's a ss

daring fern
split cairn
errant arrow
#

yup, that worked

#

now the issue is getting it to only create one

orchid dawn
#

@daring fern can you help me ?

daring fern
errant arrow
#

thank you!

placid star
#

for patching into this func, what would i do as my local variable that stores the original

#

e.g. hookTo = ...

daring fern
placid star
#

ahh i was using : instead of .

wintry solar
# orchid dawn here

you're only ever passing the other jokers the context of pressing play - this context doesn't do anything on almost any joker

errant arrow
#

the create joker works, but when i try to replace it to create my placeholder rose, nothing is made

daring fern
errant arrow
#

first one is placeholder seed, second is the rose

orchid dawn
errant arrow
#

before the screen shots, i also tried placing the key into the quotes for the add card

orchid dawn
chrome widget
#

Is there a central context for the deck being modified? There's a central unlock condition but that doesn't get sent to unlocked items, so I can't leverage that here

frigid cargo
#

can i make a sprite for an edition then just try to match it with the card in shaders or smth?

daring fern
errant arrow
#

ooh.

#

okay

errant arrow
normal crest
chrome widget
#

Probably gonna have to yeah

#

Just slightly annoyed

orchid dawn
thorn furnace
spice wadi
thorn furnace
spice wadi
thorn furnace
# spice wadi so like changes while the menu is open?

Essentially yea

G.FUNCS.can_hold = function(e)
    if 0 < #G.hand.highlighted and #G.hand.highlighted == #ALLOY.hold_area.highlighted then
        e.config.colour = G.C.GOLD
        e.config.button = "toggle_hold"
        e.config.text = "Swap"
    elseif 0 < #G.hand.highlighted and #G.hand.highlighted <= ALLOY.hold_limit - (G.GAME.cards_in_held_area or 0) and #ALLOY.hold_area.highlighted <= 0 then
        e.config.colour = G.C.GOLD
        e.config.button = "toggle_hold"
        e.config.text = "Hold"
    else
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
        e.config.text = "Hold"
    end
end

this but replacing e.config.text with whatever I would be using here

spice wadi
thorn furnace
#

I'm not sure
Currently the colour changes just fine

red flower
#

like where you define it

thorn furnace
# red flower can i see the button code
local hold_button = {n=G.UIT.C, config={id = 'hold_button',align = "tm", padding = 0.3, r = 0.1, minw = 2.5, minh = button_height, hover = true, colour = G.C.GOLD, button = "toggle_hold", one_press = false, shadow = true, func = 'can_hold'}, nodes={
    {n=G.UIT.R, config={align = "cm", padding = 0}, nodes={
        {n=G.UIT.T, config={text = "Hold", scale = text_scale, colour = G.C.UI.TEXT_LIGHT, focus_args = {button = 'z', orientation = 'bm'}, func = 'set_button_pip'}}
    }}
}}
spice wadi
#

i feel like this is an issue with how youve set the variable
like the text is nested in a different element

red flower
#

instead of text = "Hold" change it to ref_table = G.GAME, ref_value = "your_variable" and put the text in G.GAME.your_variable

#

or any other table

thorn furnace
#

thank u :>

median grove
#

Is there a way to use Smods.add_card to create a joker only with a specific prefix? e.g creating jokers only from my mod or smthn like that

thorn furnace
#

i think

errant arrow
#

centered from the sides, a little too high
-# from my glance at least

red flower
#

maybe add align to the text node? idk

thorn furnace
#

tru

thorn furnace
#

huh
I don't even use the sound manager

errant arrow
#

what's the code for the must have room conditional?

daring fern
gaunt thistle
#

hi something, how are you doing today

thorn furnace
#

<@&1133519078540185692>

chrome widget
#

Task Manager, kill him

daring fern
#

And G.GAME.area_buffer with the buffer.

neat leaf
#

Where can I find a template Lovely mod without anything else? I want to make a very simple Lovely mod but the example mod I've found includes a lot more stuff that I don't need, and I don't know how to remove what I don't need without breaking the mod.

red flower
neat leaf
#

I want to add a custom deck to Cryptid by modifying their deck.lua. I have a good idea of what the modifications will look like.

#

Modifying the file via Lovely seems like the most relaible option.

wintry solar
#

a new deck?

neat leaf
wintry solar
#

just add it as a deck within your own mod

neat leaf
#

But it depends on Cryptid's lib.

wintry solar
#

then make your mod depend on cryptid

neat leaf
#

I... don't know how to do that.

neat leaf
#

Does that just give me access to the Cryptid libraries, or do I need to load those myself?

wintry solar
#

it'll mean your mod only loads if the cryptid librares are also loaded

red flower
#

every mod has access to anything other mods make global

neat leaf
#

Okay so I don't need to load anything from Cryptid; I'll just have their globals.

quick scarab
#

Trying to make a joker that randomly changes the enhancement of a card when its played, but it kinda crashed. any help?

calculate = function(self, card, context)
        if context.before and context.main_eval and not context.blueprint then
            local enhanced = {}
            for _, scored_card in ipairs(context.scoring_hand) do
                if next(SMODS.get_enhancements(scored_card)) and not scored_card.debuff then
                    enhanced[#enhanced + 1] = scored_card                    

                    local eligible_card = pseudorandom_element('magic_elephant')

                    local edition = poll_edition('magic_elephant', nil, true, true,
                        { 'm_mult', 'm_bonus', 'm_wild', 'm_glass', 'm_steel', 
                        'm_stone', 'm_gold', 'm_lucky', 'm_fnaf_glitch', 'm_fnaf_pizza' })
                    scored_card:set_ability(edition, nil, true)
                end
            end


        end
    end,
red flower
#

what's the kinda crash log

median grove
#

is .modded_objects still something you can use? this is just a reappropriated version of one of SDM's functions, but it crashes saying it got a nil value where a table was expected

median grove
red flower
orchid dawn
quick scarab
maiden phoenix
#

I do it differently nowdays, check a more recent version of the mod in the pools.lua

red flower
#

i dont know what youre trying to pick there tho

quick scarab
#

good question

#

just trying to make randomly select a enchantement without having to manualy code the random selection

wintry solar
#

those also aren't editions

#

so using poll_edition is probably going to crash

#

you're looking for SMODS.poll_enhancement

cerulean meadow
#

what does it mean when it crashes because of something called "juice_up"

red flower
#

oh yeah

maiden phoenix
#

usually your card no longer exists when it's trying to juice_up

cerulean meadow
#

how does that work

maiden phoenix
#

or it simply doesn't exist

red flower
#

you used self instead of card

cerulean meadow
#

it is there until it is triggered

red flower
#

probably

cerulean meadow
#

let me see

#

used self and card

#

calculate = function(self, card, context) for example

#

wherever there is self there is also card

red flower
#

self is fine there

#

inside the function you shouldnt use self

cerulean meadow
#

am i allowed to post my code here

red flower
#

yes

cerulean meadow
wintry solar
#

delete card = self

#

and focus = self

red flower
#

if card.debuff then return nil end samplejimbos detected

wintry solar
#

also what is the resource you're copying this from?

cerulean meadow
#

yeah using samplejimbos as a base

wintry solar
#

dont

cerulean meadow
#

following a tutorial but its outdated

#

by a few millenia

maiden phoenix
#

I recommend checking the SMODS docs and VanillaRemade

red flower
cerulean meadow
#

i tried ripping the base game up but i couldn't figure out how

maiden phoenix
#

(I really wish VanillaRemade showed up when I google for it)

red flower
wintry solar
#

samplejimbos is badly written, I wouldn't recommend using it as a base at all

urban wasp
#

what is happening?? i keep getting this crash on almost every joker in my mod

red flower
#

at least they updated it from 0.9.8

maiden phoenix
# red flower

No way N you made VanillaRemade for Minecraft too? That's so cool

red flower
urban wasp
#

no, it's all just SMODS.Joker {

#

i have no idea what's happening like

#

it's not just this it's every joker

red flower
#

i ask because thats a common mistake i see

urban wasp
#

yea

red flower
#

and that would break all the other jokers

umbral zodiac
#

i hate to break it to you but i think you committed a cardinal smods sin and you have to perform the ritual to eremel now now

cerulean meadow
#

all works now by the way, thanks guys

maiden phoenix
wintry solar
urban wasp
urban wasp
#

umm

#

oh my god

#

you little

#

thanks

median grove
#

in addition i also added set the .modded_jokers thing to {} in the main file before any of the files are asserted

maiden phoenix
#

after doing your SMODS.Joker tables you added them to the modded_jokers table?

errant arrow
#

trying to make the "must have room" conditional, crashes anytime a joker is attempted to be made.

red flower
#

whats the code

errant arrow
#

i get the feeling its the long line at 56

red flower
#

#G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit

errant arrow
#

so it's the .GAME. on cards and limit?

cedar pendant
#

can i gift one of you coding guys a steam game to make me a single joker cause i cant 💀

red flower
errant arrow
red flower
# orchid dawn bump

oh ok i just saw eremels message from earlier because i couldnt figure it out with the identation lol

you're only calling blueprint_effect in context.press_play so it will only work on jokers that do stuff there

#

you should use press play to save the index of the left or right card but then call blueprint_effect outside of a context

errant arrow
red flower
errant arrow
#

-# why didnt that get copied ;-;

#

-# replaced

chrome widget
#

@red flower Query for you. I'm having trouble setting up this card to work with joker retriggers. Due to the way set_ability and its delayed sprites work, I can't figure out a decent setup so that the cards turned gold by this code wait to visually change at the same time that the message plays. Instead, if it's retriggered, all cards turned gold do so at the same time on the first message, and then nothing appears to happen on the second message even if the retrigger turned cards gold that were missed on the first iteration

    local gold = 0
    for i, v in ipairs(context.scoring_hand) do
        if v.config.center.key ~= 'm_gold' and v:is_suit(G.GAME and G.GAME.wigsaw_suit or "Hearts")
        and SMODS.pseudorandom_probability(card, pseudoseed('csau_goldexperience'), 1, card.ability.extra.prob) then
            gold = gold + 1
            v:set_ability(G.P_CENTERS.m_gold, nil, true)
            G.E_MANAGER:add_event(Event({
                func = function()
                    v:juice_up()
                    return true
                end
            }))
        end
    end

    if gold > 0 then
        local flare_card = context.blueprint_card or card
        return {
            func = function()
                G.FUNCS.flare_stand_aura(flare_card, 0.50)
            end,
            extra = {
                message = localize('k_gold_exp'),
                colour = G.C.MONEY,
                card = flare_card,
                blocking = true,
            }
        }
    end
end```
#

I could just package set_ability in the event, but that means the cards don't have their updated values for the remainder of scoring

#

So if some other card wants to do smth with scoring gold cards, I'd prefer to have those chain off each other rather than it skipping this hand

chrome widget
median grove
red flower
#

the problem is the conditional i guess

worthy stirrup
#

The colors of the non face cards are the low contrast version, how would I have it be the High Contrast ones?

local suits = {
  Clubs = SMODS.Atlas {
    key = "collab_dr_clubs",
    path = "collab_DR_clubs.png",
    px = 71,
    py = 95,
  }
}

for suit, atlas in pairs(suits) do
  SMODS.DeckSkin {
    key = atlas.key,
    suit = suit,
    loc_txt = "Deltarune",
    palettes = {
      {
        key = "hc",
        ranks = {'Jack', 'Queen', "King"},
        display_ranks = {"King", "Queen", "Jack"},
        atlas = atlas.key,
        pos_style = 'collab'
      }
    }
  }
end
chrome widget
#

Ugh yeah again the issue is packaging it func puts it in an event preventing the new enhancement from being visible further in the scoring order

#

Hnmmm

red flower
#

it just runs after all the scoring stuff so you can have an event that runs after it, but doesnt do it automatically

chrome widget
#

Hmm I see. But I think that might result in the same issue. I need a delay after the return block message

#

The main thing is just blocking the delayed sprite application to the second set of set abilities

orchid dawn
red flower
#

My guess about the func thing is that maybe (i really dont know how retriggers work) the main part of calculate runs practically after it first triggered but anything returned runs after the again message, so it would put the set_ability delay event after the again message and the other stuff

red flower
orchid dawn
red flower
orchid dawn
#

idk where the "end" of context.press_play, bruh

red flower
#

?

orchid dawn
red flower
#

what do you mean

orchid dawn
#

i don't know where the "end" of the function context.press_play is

red flower
#

it's not a function it's a statement but there's a line

orchid dawn
#

bruh

orchid dawn
cedar pendant
red flower
#

not the flavor, the effect

cedar pendant
#

oh yeah if you have he gives $100 each round but he has a chance of getting impaled by a metal pole

#

Yes its a joke joker\

red flower
#

again, not the flavor, the effect

#

what does that mean

cedar pendant
#

Am i stupid thats his effect 😭

#

The card gives $100 each round and has a chance to get impaled by a metal pole and die

red flower
#

"getting impaled by a metal pole" is not a balatro mechanic, what does it mean? is it just visual? does it get destroyed?

#

when does it get destroyed

cedar pendant
#

Oh yeah it gets destroyed i shouldve said that 😭

#

1 in 8 chance

red flower
#

1 in 8 chance when

normal crest
red flower
#

when it gives the money or before or when

cedar pendant
#

At the end of each round when he gives the money

#

Sorry i suck at

#

explaining things lmao

red flower
#

give me a sec

serene granite
red flower
# cedar pendant At the end of each round when he gives the money
SMODS.Joker {
    key = "jeongdae",
    loc_txt = {
        name = "Im Jeong-dae",
        text = {
            "{C:money}$#1#{} at end of round",
            "{C:green}#2# in #3#{} chance to get impaled by a metal pole"
        }
    },
    pos = { x = 0, y = 0 },
    rarity = 1,
    blueprint_compat = false,
    cost = 2,
    config = { extra = { odds = 8, money = 100 }, },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.money, G.GAME.probabilities.normal, card.ability.extra.odds } }
    end,
    calc_dollar_bonus = function(self, card)
        if pseudorandom("squidgamemrbeast") < G.GAME.probabilities.normal / card.ability.extra.odds then
            SMODS.destroy_cards(card)
        end
        return card.ability.extra.money
    end
}

figure out the visual part yourself :3

modern kindle
#

N is so nice and so helpful and so cool and so awesome

graceful vapor
orchid dawn
#

i think that have a any sytanx error, because after I moved the copy function outside of context.press_play, my joker stopped being recognized

calculate = function(self, card, context)
        local targetJoker = nil
        local availablePos = {}
        
        if context.press_play then
            print('press play')
            if G.jokers.cards[1] and G.jokers.cards[1] then
                print('test 1')
                table.insert(availablePos, 1)
            end
            if G.jokers.cards[#G.jokers.cards] and G.jokers.cards[#G.jokers.cards] then
                print('test 2')
                table.insert(availablePos, #G.jokers.cards)
            end,

            if #availablePos > 0 then
                local chosen_position = pseudorandom_element(availablePos, pseudoseed('losted_doodle'))
                targetJoker = G.jokers.cards[chosen_position]
                if targetJoker == card then
                    print('test 3')
                    targetJoker = nil
                end,
            end,
        end,
                local ret = SMODS.blueprint_effect(card, targetJoker, context)
                if ret then
                    print('test 4')
                    ret.colour = G.C.PURPLE
                end,
                retun ret
        return nil
    end
red flower
serene granite
#

I tried that but it didn't give me mult cards just unenhanced ones

cedar pendant
red flower
#

this is a recent change

serene granite
#

Hmm I'm not too sure, gotta check when I get home

#

I'll send more info when I'm home from work !

red flower
#

if its not the last release then thats the problem

serene granite
#

Ok good to know, I think it's latest release though

#

But I'll double check

red flower
#

let me try myself tho

cedar pendant
#

N ive never modded before were do i actually like put this goat to run it 💀

serene granite
red flower
serene granite
red flower
#

anyway let me make sure i dont push mult certificate and squid game joker to vanillaremade

modern kindle
#

Nah get em both in

fallow breach
#

so this joker will destroy the joker to its left and right and add chips. that part works well, and i can get it to destroy the right joker on its own too, but it won't destroy the left joker on its own

#

my code is pretty messy but i don't see a reason why it wouldn't work

hidden sable
#

how is math.huge used (from talisman)

ivory coral
#

hi chat
im trying to patch the new SMODS.pseudorandom_probability() to allow me to check if a probability was rolled, and if it was successful
however since the function just returns with a pseudorandom() if i try to check with the same pseudorandom() beforehand it changes the actual outcome
so is there a way to get what pseudorandom() would return without changing its rng? i dont really want to have to patch at the function if i dont have to

fallow breach
serene granite
red flower
#

i mean i made vanillaremade so people steal from me

hidden sable
#

yeha thats kinda the point of vremade

ivory coral
red flower
modern kindle
#

Everyone wants you to steal from em its the wave

fast compass
red flower
#

thats literally the reason it was made

serene granite
ivory coral
#

it would still return with that pseudorandom() at the end and throw off the rng outcome

sturdy compass
red flower
#
local SMODS_pseudorandom_probability_ref = SMODS.pseudorandom_probability
function SMODS.pseudorandom_probability(trigger_obj, seed, base_numerator, base_denominator)
    local ret = SMODS_pseudorandom_probability_ref(trigger_obj, seed, base_numerator, base_denominator)
    if ret then
        -- yep
    else
        -- nope
    end
    return ret
end
ivory coral
red flower
#

no unless you add it there

#

what's your goal?

ivory coral
red flower
#

ret is true or false, it's not a function

#

SMODS_pseudorandom_probability_ref calls pseudorandom once

#

I think you might be misundertanding hooks

ivory coral
#

how do i use it in this case then
i want to check the outcome of the pseudorandom_probability check before its returned

red flower
#

the --yep comment is where you would put the code you want when it succeeds, the --nope where it fails

#

you can also make your own context there for a more general thing which is what astra was talking about

ivory coral
#

oh does it
ok i didnt know that was a thing
how does that actually work im curious
how does it get the outcome

red flower
ivory coral
#

no i know the context bit i mean how does checking if ret then check whether the probability succeeds

red flower
#

SMODS_pseudorandom_probability_ref just calls the original function and saves the return (a boolean) to ret
The hook basically says "wait before you return it for real let me check what the result was"

ivory coral
#

oooh ok i see now

#

im used to hooks as like
extra code at the start of the function then returning the rest of the function
but this is like an extra layer after the function returns

#

ok thats neat

wild escarp
#

This doesn't do anything, anyone know why?

calculate = function(self, card, context)
    if context.before and not context.blueprint then
        local queens = 0
        local twos = 0
        for i = 1, #context.scoring_hand do
            if context.scoring_hand[i]:get_id() == 2 then twos = twos + 1 end
            if context.scoring_hand[i]:get_id() == 12 then queens = queens + 1 end
        end
        if twos > 0 and twos < 2 and queens > 0 and queens < 2 then
            card.ability.extra.created_tag = true
        end
    end

    if context.destroy_card and context.cardarea == G.play and not context.blueprint then
        if card.ability.extra.created_tag == true then
            card.ability.extra.created_tag = false

            if context.destroy_card:get_id() == 2 then
                return
                {
                    func = function()
                        G.E_MANAGER:add_event(Event({
                            func = (function()
                                add_tag(Tag('tag_ethereal'))
                                play_sound('generic1', 0.9 + math.random() * 0.1, 0.8)
                                play_sound('holo1', 1.2 + math.random() * 0.1, 0.4)
                                return true
                            end)
                        }))
                    end,
                    remove = true
                }
            end
        end
    end
end
wild escarp
#

If played and scoring hand has one queen and one two destroy the two and create an ethereal tag.

quick scarab
#

question, is there a way to end the run by its entirely if a certain condition is met, even if I need to make a seperate SMODS commands

#

like if I hold a certain joker for a long time

red flower
#

yes, win or lose?

red flower
#

do it when it destroys a 2

quick scarab
#

but also win just for curiosity

red flower
#

oh idk win lol

#
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false

this is lose

chrome widget
#

huh

serene granite
#

Hey N, I have another question, I made a booster pack a while ago, and I had particles in the background, but when I exit yhe pack, all the particles don't go away. Idk how to fix that. Also the name of the pack near the bottom just says error

red flower
#

for the name you need group_name in your loc_txt

bitter portal
#

behold

red flower
serene granite
#

Ok ill see what I can do

#

Thank you

serene granite
bitter portal
#

The first one is for upgrading a hand type called "Roundabout" which is when 5 cards are played with no duplicate suits (my mod adds a 5th suit so this hand is possible)
The second one is for upgrading a hand called "Funny" which...... is when you.... play a 6, 9, 4, 2, and 0 (which my mod adds) in order

rapid stag
#

bump

bitter portal
bitter portal
#

help

real night
#

how do i give a poker hand a specific amount of chips or mult

thorn furnace
#

When you click on a consumable or a Joker and the sell tab appears, where is that implemented?

main basin
#

hi there i am currently attempting to mod balatro with the brainstorm mod. I have followed a video tutorial alongside multiple forum posts and everything is working accept i do not have a mods button on the homescreen of balatro.

#

can someone please help me figure out what i am doing wrong this is my first time doing something like this

#

never mind i did it !

red flower
thorn furnace
#

thanks :3

main basin
#

okay so the mods button has appeared but brainstorm itself isnt working

quick scarab
#
calculate = function(self, card, context)
        if end_of_round and not context.blueprint and context.blind.boss 
        and #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
            local jokers_to_create = math.min(card.ability.extra.creates, G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer))
            G.GAME.joker_buffer = G.GAME.joker_buffer + jokers_to_create
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _ = 1, jokers_to_create do
                        SMODS.add_card {
                            set = 'Joker',
                            rarity = 'Common', 'Uncommon', 'Rare'
                        }
                        G.GAME.joker_buffer = 0
                    end
                    return true
                end
            }))
            return {
                message = localize('k_plus_joker'),
                colour = G.C.BLUE,
            }
        end
    end,```
#

my joker doesnt trigger after the boss blind

#

it should spawn another joker when this blind is won

red flower
#

it's context.end_of_round and it doesnt have context.blind, you need to use G.GAME.blind.boss

quick scarab
red flower
#

because something else was wrong

bitter portal
#

Trying to make a shader for an edition, got this crash, any idea why?

graceful vapor
#

How do I play a custom sound effect?

vague crest
#

how would i check when the player cashes out?

modern kindle
#

i somehow read it as when the player crashes out lmao

daring fern
vague crest
#

ohhh wait thats smart actually

graceful vapor
#

How do I play a custom sound effec :(

vague crest
#

yup that works ty!

graceful vapor
#

Please somebody tell me how to play a custom sound effect without putting it into the game files

daring fern
lament agate
#

can you guarantee luck for testing purposes?

red flower
graceful vapor
daring fern
serene granite
#

N the code you sent for the mult card worked perfectly thank you !

lament agate
graceful vapor
# daring fern Code?
...
            -- Play custom sound effect
            play_sound('mj_Sparkstaffuse.ogg')
        end
...```
I have it in assets>sounds>Sparkstaffuse.ogg
daring fern
graceful vapor
#

in if context.before

#

bruh

daring fern
graceful vapor
#

I need to define the path at the top?

granite nymph
#

does anyone know why the description isnt working?

lament agate
granite nymph
#

i just dont know whty the rank is not displaying

quick scarab
# quick scarab ```lua calculate = function(self, card, context) if end_of_round and not...
calculate = function(self, card, context)
        if context.end_of_round and G.GAME.blind.boss
        and #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then

            local jokers_to_create = math.min(card.ability.extra.creates,
                G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer))
            G.GAME.joker_buffer = G.GAME.joker_buffer + jokers_to_create
            
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _ = 1, jokers_to_create do
                        SMODS.add_card {
                            set = 'Joker',
                            rarity = 'Common', 'Uncommon', 'Rare'
                        }
                        G.GAME.joker_buffer = 0
                    end
                    return true
                end
            }))

            return {
                message = localize('k_plus_joker'),
                colour = G.C.BLUE,
            }

        end
    end,```
#

I got it to work

#

but it doesnt stop spawning jokers

errant arrow
#

how do i make custom rarities?

red flower
red flower
daring fern
lament agate
#

is ease_volume a thing?

#

it crashes

daring fern
lament agate
granite nymph
#

localization isnt sorking agian

red flower
#

i think it's Back

lament agate
#

how do i combine the sound and the load image together

#

i want it so that it plays the sound when the image is loaded

wheat jewel
#

Is there a way to for a joker to check if a probability fails?

quick scarab
#

How do I make the game check if I have a specify joker at my hand?

wheat jewel
red flower
lament agate
#

is this fine

wheat jewel
#

Sweet

wheat jewel
#

imma try this tysm!!

serene granite
#

is e_holo used for holographic cards?

daring fern
red flower
#

yes

#

@/ozy

lament agate
quick scarab
wheat jewel
serene granite
#

N the booster pack group_name didnt work..

red flower
serene granite
#

ok

red flower
#

remove the group_key

vague crest
#

lmaoooo oops

gray void
#

Get sealed

serene granite
wheat jewel
granite nymph
#

localization is hard

#

game crashes when i hover over pickles

#

debug doersnt work

daring fern
wheat jewel
# red flower outside the joker

So for what the functions outputs, if i want the joker to interpret the return as true or false, do I just do like if SMODS_pseudorandom_probability_ref == true?

red flower
#

that's what i said!

red flower
wheat jewel
#

sorry if i'm kinda aloof

red flower
#

yeah if you want to change the result change ret

wheat jewel
daring fern
wheat jewel
daring fern
#

Then check for context.modprefix_probability_fail

wheat jewel
#

Wait do i do this inside of the pseudorandom func or inside the joker?

#

or do i not need the function at all?

#

Oh wait i might get it now

wheat jewel
#

Did this i think it might work

daring fern
hasty mist
#

i dont think its my mod causing it

#

but i cant even tell

wheat jewel
red flower
# wheat jewel

I might also recommend waiting a couple of weeks because these contexts will probably just get added to smods

daring fern
red flower
wheat jewel
daring fern
wheat jewel
red flower
wheat jewel
wild escarp
#

Is there a way to change what sprite a joker is using in the calculate?

hasty mist
hasty mist
# hasty mist

In this specific context it happened when i hovered over a planet in the shop

daring fern
wheat jewel
hasty mist
#

oh my god i know whats wrong here

#

one of the mods i have installed seems to have made a typo

serene granite
#

is there a way i can make the particles in booster packs, move upwards?

native zinc
# wild escarp Is there a way to change what sprite a joker is using in the calculate?
calculate = function(self, card, context)
      card.children.center.scale = { x = card.children.center.atlas.px, y = card.children.center.atlas.py } -- declare scale
      card.T.w, card.T.h = G.CARD_W, G.CARD_H 
         if card and card.children and card.children.center and card.children.center.set_sprite_pos then 
            card.children.center.atlas = G.ASSET_ATLAS['loy_alty'] -- pick atlas (loy is the prefix of atlas)
         if card.ability then
            if card.ability.loyalty_remaining ~= card.children.center.sprite_pos_copy.x - 1 then -- loyalty_remaining is the. loyalty card procs remaining, duh
               card.children.center:set_sprite_pos({x = card.ability.loyalty_remaining + 1 or 0, y = 0}) -- set sprite pos acc to loy_remaining
               card:juice_up(0.2,0.2) -- solely for fun
               play_sound("cardSlide2") -- this sound actually interprets as hole punching
            end
         else
            card.children.center:set_sprite_pos({x = 0, y = 0}) -- Just In Case
         end
      end
   end
#

this is functionality for punching holes in loyalty card

#

it takes an atlas and moves the position to the right

#

so the image changes

wild escarp
#

Would it be suitable to just use card.children.center:set_sprite_pos for simply swapping the sprite every round then?

lament agate
#

i still need help with this

#

it crashes

daring fern
pure salmon
#

do the boss blind calculate contexts like stay_flipped and debuff_hand work as expected in jokers?

wheat jewel
lament agate
daring fern
daring fern
wheat jewel
daring fern
vague crest
#

how would i destroy a card after it's done being played?

lament agate
#

yes

daring fern
wheat jewel
daring fern
lament agate
daring fern
lament agate
wheat jewel
# daring fern Yes.

It works now but mainly for probabilities that occur during or after a round ends

#

not during the beginning of the round

#

cuz some of the jokers I made have probabilities that occur when selecting a blind

#

but my joker never upgrades itself when those probabilities fail

bitter portal
#

how do i change Edition with DebugPlus?

lament agate
#

mouse above card

wheat jewel
#

Does anyone know how to check if a poker hand has been played more than once

daring fern
#

You have to change your jokers to use that function.

wheat jewel
#

Would this work to check if a hand has been played once?

hidden sable
#

how can i make a joker thats just blueprint but 10 times

bitter portal
#

why is alpha not working in my shader

frigid cargo
#
    config = { hand_size = -1 },
    pos = { x = 0, y = 0 },
    order = 1,
    atlas = "DTiny",
    unlocked = true,

    loc_vars = function(self, info_queue, back)
        return { vars = { self.config.hand_size } }
    end,

    apply = function(self)
        G.GAME.starting_params.hand_size = G.GAME.starting_params.hand_size + self.config.hand_size

why does it subtract 2? hand size

hidden sable
#

it calls a function

#

isnt there something with repetitions

#

but idk if its for jokes

frigid cargo
hidden sable
bitter portal
frigid cargo
wheat jewel
#

I'm trying to make a joker that adds chips when per every poker hand played for the first time, but it isn't doing so in my code

normal crest
#

if I had to guess, by the time this happens the played count is 1 when it's the first time it's played

wheat jewel
#

should i do <=

#

less than or equal to

normal crest
#

Also a better way to do that would be to access G.GAME.hands[context.scoring_name] directly instead of looping through every hand

normal crest
bitter portal
daring fern
# hidden sable how can i make a joker thats just blueprint but 10 times
local other_joker
for i=1, #G.jokers.cards do
    if G.jokers.cards[i] == card and G.jokers.cards[i+1] then
        other_joker = G.jokers.cards[i+1]
    end
end
local effects = {}
for i=1, 10 do
    local effect = SMODS.blueprint_effect(card, other_joker, context)
    if effect then
        table.insert(effects, effect)
    end
end
return SMODS.merge_effects(effects)
normal crest
#

🥄

fallow breach
#

any way to get this to not account for eternals?

errant arrow
#

i've been reading steamodded's wiki page on the SMODS.Rarity but i dont understand what it's telling me

normal crest
thorn furnace
#

For some reason my patch doesn't seem to be working properly
I keep getting the crash in the screenshot whenever i click on a card

[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''
  if card.area and card.area.config.type == 'joker' then
'''
position = "after"
payload = '''
  lock = {n=G.UIT.C, config={align = "cr"}, nodes={
      
      {n=G.UIT.C, config={ref_table = card, align = "cr",maxw = 1.25, padding = 0.1, r=0.08, minw = 1.25, minh = (card.area and card.area.config.type == 'joker') and 0 or 1, hover = true, shadow = true, colour = G.C.UI.BACKGROUND_INACTIVE, one_press = true, button = 'lock_toggle', func = 'can_lock_card'}, nodes={
        {n=G.UIT.B, config = {w=0.1,h=0.6}},
        {n=G.UIT.T, config={ref_table = card.ability, ref_value = "lock_text",colour = G.C.UI.TEXT_LIGHT, scale = 0.55, shadow = true}}
      }}
    }}
'''
match_indent = true
times = 1
fallow breach
normal crest
#

that's not what I said at all

formal quest
#

How do I manipulate the spawning of cards from any source? I want to change the type of a card as it spawns.

red flower
#

you would need to hook/patch create_card

normal crest
formal quest
gusty iron
#

i had a REALLY stupid idea for a mod but idk if i could do this without help

hear me out:

joker mastery

gusty iron
#

maybe

errant arrow
#

day 3: third placeholder added for some testing

#

-# im not managing my time well

red flower
hybrid shadow
#

is the context for starting the game different from the context for starting a run

#

i mean i assume it is i just dont know the code

hidden sable
#

is there a way to insert an image into text

#

like having an "emoji"

daring fern
red flower
hybrid shadow
red flower
#

like doing if Game.start_run??

hybrid shadow
#

yes, apparently that runs the code right when the game boots up

red flower
#

i dont think that's correct

#

that statement is always true

#

because the function exists

hybrid shadow
#

then the code's just running every frame?

red flower
#

If it's not in an update or draw function then no

#

if it's in calculate it might be running every context

hybrid shadow
#

lemme just show the entire code rq

red flower
#

is that line 1

hybrid shadow
#

thats the whole code

#

the entire lua file is just that

red flower
#

then this will run as soon as it loads

hybrid shadow
#

im wondering if i can set the if to run when the player starts a run instead of just when the file is loaded

formal quest
#

How do I get if a card is a planet card?

red flower
red flower
hidden sable
daring fern
bitter portal
#

hey so this is the ID of my zero rank, but im worried it will change if there are other mods, how can I get this ID from the rank?

hidden sable
daring fern
hidden sable
#

there is a log it says stack overflow

daring fern
urban wasp
#

how can i make my music track override everything else?

#

e.g. if i'm playing cryptid and i get a big big score, i don't want it to override the music playing from my mod

daring fern
fallow breach
#

i think v.ability.eternal is causing issues somehow

urban wasp
#

which is already in there

daring fern
hidden sable
#

is there a way to make it so if a certain config/bool is true then give this joker a soul overlay