#💻・modding-dev

1 messages · Page 279 of 1

buoyant merlin
brazen tusk
lyric blade
#

But idk

buoyant merlin
#

Isn't X:func() shorthand for Y.func(X)

lyric blade
#

No idea

wintry solar
buoyant merlin
wintry solar
#

context.poker_hands[“Pair”] would be a table of all the present pairs

short mauve
#

Button for what

buoyant merlin
wintry solar
#

Yes but your loop grabs a table of cards and assumes it is a card

manic rune
#

basically

short mauve
#

Oh

manic rune
#

...i couldve swore someone did that before

short mauve
#

That's cool

buoyant merlin
#

I think I get it now

wintry solar
#

So your played_card is actually {card1, card2}

buoyant merlin
manic rune
#

or just

#

go with the vanilla one

wintry solar
manic rune
#

i think its nice to let players have more control over what they fight

#

:3

quartz ravine
#

this goes pretty well together!

wintry solar
manic rune
#

oh wait

#

did ortalab

#

YEAH

#

I REMEMBER YOU HAVING THAT

#

💔

quartz ravine
#

Oh cool, you are a part of Ortalab?

buoyant merlin
manic rune
#

is it out, eremel?

wintry solar
#

Not yet

manic rune
#

i want to check ur code for reference :3

#

aw

wintry solar
#

It’s on the test repo at the moment

#

I can send it over to you later on for reference if you like

manic rune
#

sure, that would help a lot since im bad at UIs, thanks :D

digital niche
quartz ravine
#

I've got one here you can look at. I think SMODS has a lot of documentation but I feel it woul be really nice to also have an example of each on the wiki page for the topic

runic pecan
#

bump

digital niche
digital niche
quartz ravine
#

Mine is a very weird example because it is like a stone card meets a steel card. It gives +chips but is focused on holding it so it gains chips every hand

digital niche
#

it gives +50 chips when hold in hand

#

my mod is about fusing different enhancements, than i have:

Steel + Stone = Concrete: +50 chips while in hand

quartz ravine
#

that's cool!

mental nacelle
#

update - it is functional, but the button always says 'nil' and the ui stuff is a bit dodgy

tall wharf
#

what the fuck

mental nacelle
#

what

tall wharf
#

4 blinds 😭😭😭😭

mental nacelle
#

yeah

manic rune
#

oh thats cool

next timber
#

my mod is broken right now so that playing generosity and friendship seal cards in the same hand can give you negative mult for some reason??? but fuck that i wanna play math deck

digital niche
#

where can i find all the enhancement cards assets without like the rank in suit? like in the collections page?

mental nacelle
runic pecan
ivory coral
lyric blade
#

Tried and it did just something else. now, the card eval message comes as a bunch after all the retriggers instead of before

radiant plank
#

how do i handle file inclusion using 'require' in a balatro mod?

#

do i need to append my mod's directory to lua's package.path?

lyric blade
#

without event

manic rune
#

I GOT THE BUTTON TO SHOW UP 🗣️

digital niche
manic rune
#

-# ignore the text please

humble girder
tall wharf
manic rune
#

im adding Worlds to my mod

#

its randomly chosen every time you start a run

tall wharf
#

PENACONY IN BALATRO

#

🗣️🔥🗣️🔥🗣️🔥💯

manic rune
#

pressing that button will switch between the vanilla boss blind, and a mega boss from my mod

#

:3

manic rune
#

let me see if i can get it working first :3

#

i think thats the hardest part done already

wintry solar
#

The button is the easy part

manic rune
#

...not the switching boss part???

wintry solar
#

Making it update all the ui elements correctly is the hard part

manic rune
#

ah

#

oh but also

#

is it weird that the button flies from the top of the screen to the boss blind ui

#

lemme record rq

runic pecan
#

bump

tall wharf
#

the button is easy

humble girder
#

Idk what you mean but yes

wintry solar
#

That is weird yes

tall wharf
#

Eremel You're the wizard here i trust you

humble girder
#

Whenever anyone says "flying button" I think "weird"

manic rune
#

THE WIZARD BUTTON

#

🧙‍♂️

radiant plank
digital niche
#

the 1x size is 71x95 right? so the 2x is 142x190?

short mountain
#

Guys can someone help me

tall wharf
#

do i really need to patch the code to make it display "Score as close as possible to"

#

instead of "Score at least"

short mountain
#

I need help with cryptid

wintry solar
#

Yea that is definitely weird

#

You need to attach it to the blind ui ideally

humble girder
#

Why does it always have to be cryptid

tall wharf
#

my thought goes

#

did you set the button to be at 0,0

manic rune
#

this is what my ui code looks like rn

tall wharf
#

aa

#

i wonder if you'll have to properly parent it

#

somehow

manic rune
#

:3

#

uhhh

#

table.insert(G.blind_select_opts.boss, G.hsr_change_boss_button)?

#

dunno

next timber
#

what the

#

why did i lose the blind, i had hands left

#

math deck

#

aiko how tf does math deck work

digital niche
#

where do yall draw your cards?

buoyant merlin
#

Is there a table of consumables that the player currently has?
Trying to make a card that interacts with current consumables

radiant plank
#

if i have in my main.lua

CHB = SMODS.current_mod
SMODS.load_file('utils.lua', 'chb_mod')
CHB.load_dir('jokers')

and in another file utils.lua

function CHB.load_file(file)
  -- implementation
end

function CHB.load_dir(directory)
  -- implementation
end

why is CHB.load_dir still nil in main.lua? not seeing what im doing wrong here

manic rune
digital niche
manic rune
#

OH, the other meaning of "draw"

#

aesprite is usually the best app for that

digital niche
#

im making custom cards but the app i normally use for pixelart doesnt let me use the assets i have for some reason

digital niche
digital niche
manic rune
#

you can manually compile the app to use it for free

#

but its tougher that way

digital niche
#

oh, how?

manic rune
#

BUT the app itself is definitely worth it

#

since it has a bunch of useful features for pixel art

digital niche
#

imma try to ind a tutorial, tyty!

manic rune
#

i would even say its the best app for pixel art :3

digital niche
#

i was using fire alpaca

manic rune
#

here

digital niche
#

if i had to pay it would be over for me, its 120 of my currency and yesterday i was trying to get 3,50 from some friends so i TOTALLY wouldnt have LOL😭

manic rune
gleaming summit
#

I can confirm aseprite is worth it

digital niche
buoyant merlin
manic rune
#

do not be afraid.

digital niche
#

i can barely take it with 2 hours of godot i cant imagine 80 hours of vscode

digital niche
manic rune
#

idk 😭

manic rune
#

IDK HOW I FIGURED THAT OUT 🔥

#

is this how it feels to be eremel

digital niche
radiant plank
#

how do i properly make/use a localization file? I've created a localization/default.lua and followed the table structure on the wiki but the description isn't showing up in the collection for me.

#

for the prefixing - do I do something like j_jokername = {...}, j_[modprefix]_jokername = {...}, or [modprefix]_j_jokername = {...}?

radiant plank
# red flower j_[modprefix]_jokerkey

thanks, so if jokerkey already looks like j_jokername i would create an entry in descriptions.Joker like j_[modprefix]_j_jokername as i understand it?

red flower
#

yes

radiant plank
#

thanks!

manic rune
#

im CONFUSED

#

why does this "repeat" line make the return line red

#

i will remove the entire code chunk later since its not what im looking for rn

#

but im a bit confused over this

chrome widget
#

Once again facing my biggest issue: how to limit the visibility of the vertex shader transformation for mouse hover

#

Larger textures get offset by much more than smaller ones

#

Wait.... but maybe...

red flower
manic rune
#

o

#

I AM COOKED 🗣️

#

yeah that was a dumb idea lmfao

ionic cobalt
#

freezing 🗣️

red flower
# manic rune

this is an infinite loop is you're running it like that

manic rune
#

mhm, i realized

red flower
#

you might want an event for that instead

manic rune
#

nice, this button exists even when boss is rerolled now :3

#

time to work on the actual fuctionality, yipee

#

actually

#

how do i check whether the boss blind is a showdown one or not?

radiant plank
#

how would you all suggest going about implementing a variable message in a joker's description (like Loyalty Card)?

#

ive found the localize function but don't fully understand what i need to be passing to it or how it works

open aspen
#

if im creating my own new object class with SMODS.GameObject:extend, how can I apply it to a card for testing purposes? eg like with debug_plus

red flower
manic rune
#

thanks :3

red flower
#

you can return strings in loc_vars

radiant plank
#

yeah i tried that first but the substitution wasn't happening on them (which makes sense). for one condition i want the stylization to be different than from another

red flower
#

you can use main_end then, you pass a UI table to it and it appends it at the end of the description

#

(or main_start for the opposite)

rapid stag
#

anyone got any ideas on how i can alter calculate_seal() in card.lua so i can get red seals on jokers to retrigger the joker?

this is what it looks like in my dumped lua file right now, with my patched code highlighted

manic rune
#

HMMM

#

shouldnt it work?

#

.

#

oh wait its blind

#

im dumb

#

oh no

#

god my resolution is so ass i thought "b" was "B"

digital niche
tired skiff
#

owo

digital niche
#

btw is this right?

open aspen
#

if im creating my own new object class with SMODS.GameObject:extend, how can I apply it to a card for testing purposes? eg like with debug_plus?

rapid stag
manic rune
#

...

#

turned out

#

its ~~ G.GAME.blind.config.blind.boss.showdown~~ that only works when you are actually fighting against the blind

#

:3

#

wtf

#

i have no clue why it doesnt work 💔

digital niche
#

if i want the playing card to have both +30 chips and +4 mult i would need to do this right?

spiral crown
#

getting this error after using the following code, anyone got any ideas?

quartz ravine
quartz ravine
#

Probably because I am doing this for fun and not work, lol!

digital niche
#

so fairrr

digital niche
#

like side by siide with a +

quartz ravine
#

Does anyone have an example of a consumable which can only be used when X cards are selected? For some reason, my consumable can be used even if in the shop, or no cards are seleceted. Basically doing nothing, ha!

digital niche
#

how do i solve this?

#

oh wait i just have to change the name of the file lol

quartz ravine
#

If you use this card.ability.perma_bonus, it will automatically apply that much in chips when scored

digital niche
#

like, card.ability.perma_bonus = card.ability.extra.chips + card.ability.extra.mult?

rancid bridge
#

trying to make a joker that shows the current amount of xMult they have in the description
first question: is the text scale thing {S:value} or {s:value}
second question: how do i have it show the current amount (i want it to start on x1 also)

manic rune
#

i want to check outside the boss blind itself, by the way

#

:3

#

i cant figure it out

#

at all

quartz ravine
#

then populate the variable using loc_vars

quartz ravine
# digital niche this?

@rafae actually just do this

return {
          chips = card.ability.chips,
          mult = card.ability.plusMult,
          card = card
      }
#

change your vars to match of course

rancid bridge
digital niche
#

sorry im really new to modding

#

oh wait nvm

rain hazel
#

Need some modding assistance, I have never installed mods before and I followed a YouTube tutorial and I think I did everything right, the mods folder is in the game but when I look at it it’s saying im missing steam modded which isn’t the case since I definitely have it installed and in the mod directory, so I’m not sure where I went wrong here

digital niche
quartz ravine
#

@rain hazel

Does your SMODs dir look like this?

quartz ravine
#

Also be sure you put this in the right folder, tons of people put their mods in the wrong place. It does not go in the same path as the Balatro.exe

quartz ravine
digital niche
#

my balatro crashes when i try opening

manic rune
#

that loc vars

quartz ravine
manic rune
#

seems wrong

quartz ravine
#

Return Chips,etc needs to be in the calaculate function

digital niche
rain hazel
radiant plank
#

how do i make use of the juice_card_until function? is there an equivalent provided by steamodded? I tried using it as its used for Loyalty Card but the function tries to access center while it is nil

digital niche
radiant plank
digital niche
manic rune
#

:3 i think u need to research the example joker mod more

quartz ravine
# radiant plank awesome, thank you :)

This card will jiggle if the played hand (i.e. what the user has selected but not yet played) will be a flush

if nil ~= context.poker_hands and next(context.poker_hands["Flush]) then
      if false == card.ability.ready then 
          sendInfoMessage("Joker is now READY!", self.key)
          card.ability.ready = true;
      end

      local eval = function(card) return (next(context.poker_hands["Flush]) end
      juice_card_until(card, eval, true)
manic rune
#

"Flush

#

also

quartz ravine
manic rune
#

ive never seen ANYONE use false == card.ability.ready instead of card.ability.ready == false

quartz ravine
#

Well we can't go around giving people actually working samples, where is the fun in that

manic rune
#

ur crazy 💔

radiant plank
manic rune
#

but also

#

not card.ability.ready alone would suffice

radiant plank
#
...
elseif context.joker_main and not context.blueprint then
  local eval = function(card) return (card.ability.extra.tarots_remaining == 0) end
  juice_card_until(self, eval, true)
end
...
manic rune
#

replace self with card

radiant plank
#

oh wait i need to pass card duh

manic rune
#

and that should be it

digital niche
# quartz ravine loc_vars is where you put variables tha will be dropped into the loc_txt of your...

yeah ill just add here the code, i dont really follow

SMODS.Enhancement ({
    key="extra",
    name = "Extra Card",
    atlas = "enhanc",
    pos = {x=2, y = 1},
    replace_base_card = true,
    no_suit = false,
    no_rank = false,
    always_scores = false,
    loc_txt = {
        name = "Extra Card",
        label = "Extra",
        text = {"Gives +30 chips and +4 mult",}
    },
    config = {extra = {  bonus = 30, mult = 4}},

    loc_vars = function(self, info_queue, card)
        return {card.ability.perma_bonus == card.ability.chips + card.ability.plusMult}
    end,

    calculate = function(self, card, context, ret)
        if context.cardarea == G.hand and context.before then  
            Chips = card.ability.chips,
            Mult == card.ability.plusMult,
            Card == card
        end
       
    end
})```
spiral crown
#

anyone know why I would be getting this error for the following code?

manic rune
#

remove cardarea, using_consuneable, consumeable, and area stuff

#

those in the documentation are just to show you want u can access, not for u to actually put it in the code

#

and also, the conditions are wrong, you are checking for the joker itself, not the consumable being used

#

context.consumeable refers to the consumable being used

spiral crown
#

Oh! thank you! Would explain why the documentation was confusing me lol so the second if statement would be context.consumeable.edition.e_negative?

manic rune
#

mjm

#

mhm

spiral crown
#

Thank you!

quartz ravine
#

Change your atlas back, but this works. You only need a calculate block if you're being conditional

wicked leaf
#

are there any steamodded addons for visual studio code?

digital niche
#

oh ok, so literally take all of the loc_vars

#

tyty!!

digital niche
#

does this automatically show up in collection or do i need a code for this aswell?

#

and the game still crashed

#

oh wait nvm i didnt save

manic rune
#

can someone pls tell me how to check if the boss blind is a showdown one outside of the actual boss blind? 😭

quartz ravine
manic rune
#

i cant figure it out

#

ngngngngg

quartz ravine
digital niche
manic rune
#

yeah dw, i know that :3

im just hoping that theres someone with better understanding than me coming in to save the day

hushed field
#

blind.boss.showdown, no?

manic rune
#

that only works if you are in the boss blind, it seems

manic rune
hushed field
#

you have access to the key, no?

manic rune
#

the button should only appear when its a showdown blind

manic rune
hushed field
twin flicker
#

Can someone help me with an issue im having? I basically just want the joker to do X3 Mult when time a full house is played, the game crashes when i play a hand saying XMult is an nil value

Heres my code:

text = {
"{X:mult,C:white} X#1# {} Mult if played",
"hand contains",
"a {C:attention}Full House{}"
}
},
blueprint_compat = true,
perishable_compat = true,
eternal_compat = true,
rarity = 3,
atlas = "Modded_Jokers",
pos = { x = 0, y = 0 },
cost = 10,
unlocked = true,
discovered = true,
config = { extra = { Xmult = 3 } },
local_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult } }
end,

calculate = function(self, card, context)
    if context.joker_main and context.poker_hands["Full House"] then
        return {
            card = card,
            Xmult_mod = card.ability.extra.Xmult,
            message = 'X' .. card.ability.extra.Xmult,
            colour = G.C.MULT
        }
    end
end

}

manic rune
#

oh, true

am i supposed to dig through the ui to find the blind key?

hushed field
#

and because the blind already is determined when you enter the ante, you should have access to the blind

#

That'd be the logical place to check where it is stored, yeah, haha

manic rune
#

man, this is more complicated than i thought it would be, thanks!

radiant plank
#

hey fox, still struggling with juice_up_until. LOVE isn't crashing or anything but im still not getting any juice up effects on the card. is it the context that's incorrect for me?
for reference here's what i have again:

elseif context.joker_main and not context.blueprint then
  local eval = function(card) return (card.ability.extra.tarots_remaining == 0) end
  juice_card_until(self, eval, true)
end

i've tried inverting the condition but that didn't have any effect.

another edit: just remembered the context.joker_main context is ONLY for scoring effects.. do i even need to wrap this block in a context?

digital niche
#

what is that one page in github about the text and collors etc?

red flower
hushed field
twin flicker
hushed field
cursive ocean
#

Is it possible to extend the SMODS.calculate_individual_effect function in my mod to alter some parameters before calling the original?

cursive ocean
#

please tell me more

twin flicker
manic rune
#

i dunno, thats out of my field :(

#

ah, i meant to reply to NopeTooFast

#

all i can think of is trying to use context.retrigger_joker somehow

rancid bridge
#

trying to make a config for this effect
i am a bit stupid though...

manic rune
#

C:hearts

rancid bridge
#

thank you for pointing that out

hushed field
manic rune
#

{C:inactive}(Currently{} {X:mult,C:white}#X1#{} {C:inactive}Mult)

digital niche
hushed field
#

haha damn I thought I'd grab an example from my own mod, but the easiest one still does it the old way 🥲

normal crest
ruby delta
#

Does anyone know if I could take the whole Balatro game files and upload it on discord (private ofc) so I can use it for personal projects when modding as it would be easier

manic rune
#

kh crap

radiant plank
#

what context should i be running juice_up_until inside? i took it out of the joker_main context but now the card is spazzing haha

mental nacelle
#

i very much enjoy this

manic rune
#

i apologize :3

normal crest
#

both ones

red flower
manic rune
#

im so used to using it that im unconfident to remove them now

#

❤️

normal crest
#

Fair

mental nacelle
red flower
#

im an advocate for more {}

rugged pier
#

Hey guys

radiant plank
#

should i just do something like if context.cardarea == G.jokers?

red flower
cursive ocean
# hushed field you can hook it

local old = SMODS.calculate_individual_effect

SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)
print("pre calc")
local ret = old(effect, scored_card, key, 123, from_edition)
print("post calc")
return ret
end
works thanks for the hint

rugged pier
#

i am trying to create a new joker that randomly copies the ability of a joker in hand, current implementation does not work, is there something im missing?

#
calculate = function(self, card, context)
        if context.end_of_round and context.joker_main then
            local joker_list = {}
            for k, v in pairs(G.jokers.cards) do
                if v ~= card and v.ability.set == 'Joker' and not v.debuff then
                    table.insert(joker_list, v)
                end
            end
            if #joker_list > 0 then
                local random_joker = joker_list[pseudorandom('tensoon') % #joker_list + 1]
                card.ability.extra.joker = random_joker:get_id()
                card:set_ability(random_joker.ability.set, nil, true)
                card:copy_enhancements(random_joker)
                return {
                    message = localize('k_csmr_copy'),
                    color = G.C.MULT,
                    message_card = card
                }
            end
        end
        if context.joker_main then
            local joker_list = {}
            if card.ability.extra.joker == '' then
                for k, v in pairs(G.jokers.cards) do
                    if v ~= card and v.ability.set == 'Joker' and not v.debuff then
                        table.insert(joker_list, v)
                    end
                end
            else
                if #joker_list > 0 then
                    local random_joker = joker_list[pseudorandom('tensoon') % #joker_list + 1]
                    card.ability.extra.joker = random_joker:get_id()
                    card:set_ability(random_joker.ability.set, nil, true)
                    card:copy_enhancements(random_joker)
                    return {
                        message = localize('k_csmr_copy'),
                        color = G.C.MULT,
                        message_card = card
                    }
                else
                    card.ability.extra.joker = 'Inactive'
                end
            end
        end
    end```
wintry solar
#

What do you possibly need to hook calc effect for

manic rune
#

crap im on phone, cant help this one :(

rugged pier
manic rune
#

double it and give it to the next person

#

❤️

radiant plank
wintry solar
#

No

rancid bridge
wintry solar
#

The function will let the card shake until the other function you pass it is true

red flower
wintry solar
#

Or it might be until it’s false, I don’t remember off the top of my head

red flower
#

it's until false because the name cant be logical

radiant plank
#

yeah i understand that, i have the eval function correct but the card spazzes as if multiple calls to juice_up_until are being run. i have the call outside of a context at the moment so this behavior makes sense.

wintry solar
#

Well without knowing your effect it’s impossible to tell you where it should go

red flower
#

maybe you are calling it multiple times

gleaming summit
#

So I'm trying to make a Blueprint clone that changes the target joker after scoring (context.after). When I exit to main menu and come back it seems to forget the value and it replaces it with "MANUAL_REPLACE" and then the game crashes because I'm trying to calculate a nil value.
I saw that vanilla Blueprint and Brainstorm fix this by changing the target every if G.STAGE == G.STAGES.RUN, but this would be executed whenever I do anything and I want it only to change after scoring
Is there any way to fix this? Like some way of detecting when the run is loaded and then resetting the value

radiant plank
#

can i just share the entire calculate function with you? im only calling it once.

red flower
#

go ahead

radiant plank
#
  calculate = function(self, card, context)
    if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
      local key = CHB.tarot_key_from_name(context.consumeable.ability.name)
      sendTraceMessage("[doubledipper calculate] - key = '"..key.."'", "DoubledipperLogger")
      if card.ability.extra.tarots_remaining == 0 then
        card.ability.extra.tarots_remaining = card.ability.extra.tarot_dupe_cycle - 1
        if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
          G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
          G.E_MANAGER:add_event(Event({
            trigger = 'before',
            delay = 0.0,
            func = (function()
              local card = create_card('Tarot', G.consumeables, nil, nil, nil, nil, key, 'double')
              card:add_to_deck()
              G.consumeables:emplace(card)
              G.GAME.consumeable_buffer = 0
              return true
            end
          )}))
          return {
            message = "Creation!",
            colour = G.C.RED
          }
        else
          return {
            message = "Oops!",
            colour = G.C.RED
          }
        end
      else
        card.ability.extra.tarots_remaining = card.ability.extra.tarots_remaining - 1
      end
    end
    local juice_eval = function(card) return (card.ability.extra.tarots_remaining == 0) end
    juice_card_until(card, juice_eval, true)
  end
red flower
#

you are not

#

the function is run in every calculate call

digital niche
#

how hard would it be to make a tarot card that you select 2 cards that have enhancements then 1 looses the enhancement and the other one changes to one enhancement based on the one both had?

#

im guessing a lot?

digital niche
#

i was thinking of doing something like destroying both cards and adding one with the enhancement to make it easier

radiant plank
rancid bridge
manic rune
#

ic

#

do u have the vars prepared?

red flower
manic rune
#

like, is there anything in ur config = {extra = {...}} rn

radiant plank
#

sure, the joker's ability is that every fourth tarot card will be duplicated. when the counter is 0 (im counting downwards) i want the card to be juiced showing the next tarot used will be duplicated

manic rune
#

oof

radiant plank
#

this can happen anywhere at any time

manic rune
#

make two then

hushed field
rancid bridge
red flower
#

note the ~= 0

manic rune
#

make the vars

red flower
manic rune
#

🫵

red flower
#

🫵

manic rune
#

if you are reading this

you are now breathing manually.

willow void
#

hey all, i am attempting to build an idol-like card but cannot find the actual code in the balatro luas. could anyone help me out? i need to recreate the random card effect mostly

radiant plank
modern kindle
#

if you are reading this

owisurgewoirun

manic rune
#

and grab stuff from there

radiant plank
#

thanks for bearing with me as well lol

digital niche
#

my atlas is not doing anything for some reason?

#

the image is not showing up

red flower
manic rune
#

if you are reading this

you are now blinking manually.

radiant plank
#

okay so its not just me thinking that naming is reversed lol

willow void
digital niche
radiant plank
#

i first tried inverting the third argument to false haha

red flower
#

nah its just bad naming

manic rune
willow void
#

mm

manic rune
#

it grabs a random value from a table, and it remains consistent for the same seed

willow void
#

mkay

spiral crown
#

where am I going wrong? Game crashes upon using a planet card

rancid bridge
manic rune
#

yes

digital niche
manic rune
#

if context.consumeable.edition and ...

digital niche
#

my atlas is not adding the image to the enhancementt

spiral crown
manic rune
#

basically

normal crest
#

without the e_

manic rune
#

if the consumeable doesn't have an edition, then context.consumeable.edition is nil

#

ur trying to grab stuff from nil

#

which will result in a crash

spiral crown
#

okay so context.consumeable.edition == nil will perform the same check

manic rune
#

if context.consumeable.edition and context.consumeable.edition.negative and context.consumeable.ability.set == "Planet" then

twin flicker
manic rune
#

i dont remember if its e_negative or negative actually

wintry solar
#

The e_ is removed iirc

tall salmon
#

does anyone else really struggle getting their lovely tmol patterns to work?
like I copy them straight from the game files and it doesn't find them

#

i'm wondering if im doing something wrong

stiff locust
#

how do I check what ante it is currently

normal crest
#

Steamodded makes a lot of patches that will change stuff from vanilla code

normal crest
tall salmon
#

yeah i realized it might be that but i couldn't find any changes to card:is_suit

hushed field
normal crest
tall salmon
#

kk i'll check that

#

thank you

spiral crown
manic rune
#

copy_card(context.consumeable)

normal crest
#

you're passing a list of cards to copy_card

manic rune
#

yeah

rancid bridge
normal crest
#

canio is misspelled as caino in the code

digital niche
#

my atlas is not adding the image to the enhancement

rancid bridge
manic rune
#

whats so difficult about setting ur own stuff in config extra tho 😭

#

config = {extra = {currentXMult = 1, XMultIncrease = 0.2,}}

#

like, that works

rancid bridge
#

oh you meant like that

#

i thought you meant like actually making my own variables

manic rune
#

💔

#

anyways, u know how to pass them to loc_vars right?

rancid bridge
#

yeah i think so

manic rune
#

mhm, do it then :3

spiral crown
stiff locust
#

what does this mean chat

manic rune
#

G.consumeables.cards refers to the entire table containing every single consumeable in your area

manic rune
stiff locust
#

i am playing the hand what

rancid bridge
#

this looks right

manic rune
#

please refrain from naming your var as "card"

manic rune
normal crest
#

it just means, use the return value of the function or u will get a warning

stiff locust
#

so that's not the reason why this code simply is not working

normal crest
#

nop

stiff locust
#

well shit

normal crest
#

would you be able to show your entire code

manic rune
#

i feel like

#

thats the wrong way to use change_base

#

isnt it something like 7H (i dont remember) or smt?

normal crest
#

nop

manic rune
#

huh

normal crest
#

that's if you use the vanilla func

#

smods handles that for u

manic rune
#

icic

normal crest
#

you just pass card, suit, rank

stiff locust
digital niche
#

my atlas is not giving me the image

manic rune
#

u sure u set the atlas right

digital niche
#

99% sure

manic rune
#

send in the code

#

-# both of u

digital niche
manic rune
#

andd the enhancement?

digital niche
manic rune
#

hmmm

#

show ur Enhanc.png pls

digital niche
stiff locust
manic rune
#

its only x = 0, y = 0

digital niche
manic rune
#

mhm

digital niche
#

tyy!!

#

btw how do i know the x and the y?

stiff locust
#

the top left sprite in your sprite sheet is x = 0, y = 0

#

your sprite sheet is a grid from the top left

#

increase x by 1 to go right, increase y by 1 to go down

manic rune
#

marie explained it very well :3

digital niche
#

oooh, thought the middle was 0, 0

#

and i just used what was aleady in there when someone handed me the example coded, also forgot to change

#

looking a little strange but its already good enough, ty!!

stiff locust
#

they are slightly thinner than jokers but still use the same sprite size

#

so there is empty space mostly on the sides

spiral crown
manic rune
#

the emplace part

stiff locust
stiff locust
#

but as a placeholder it seems useful

digital niche
#

and makes sense since im using a consumable placeholder for a enhancement lolll

stiff locust
#

yyyeah that's not a great idea

digital niche
#

figured, but just wanted a random image so i knew it was atleeast working, later ill download the aseprite and make the enhancements

#

btw what is the playing card size?

gleaming summit
long sun
#

hiyaaaaaaaaaaaaa! how do i add something like the None The Fool has?

stiff locust
#

i have no idea what it is

#

i have no idea how to do it

#

it made zero sense to me when i tried to learn it

spiral crown
stiff locust
#

all I know is that dynatext does that apparently

long sun
#

right

manic rune
normal crest
#

on your first one you have if repetition and g.play stuff

manic rune
#

i hope that u will receive help from other people about that though, i tried my best 💔

#

sorry

normal crest
#

then in the case that that is not true you check if repetition and g.play

#

so the ifs inside the else block never execute

spiral crown
# manic rune sorry

Don't be sorry, I appreciate all of the assistance you got me much further than I was!

digital niche
#

ok so how do i make a wild card

stiff locust
digital niche
#

does someone have an example code for wild card? i cant find it in the balatro files

stiff locust
#

the first if checks if context.repetition and cardarea and then checks the ranks of cards
the second checks if context.repetition and cardarea and then checks for different ranks

#

putting print statements before the rank changing events prints them out as expected

#

i'm probably gonna clean up the code anyway, but that is not the issue

#

the rank changing code is running but not changing the ranks

normal crest
#

Oh I didn't see the last and

#

Oh you know what it is

#

context changed by the time your event runs

#

so you gotta store a reference to context.other_card

stiff locust
#

that makes sense

#

i'll move the effect to context.after and use ipairs to go through the cards then

rose dragon
# long sun hiyaaaaaaaaaaaaa! how do i add something like the `None` The Fool has?

i'm looking at the balatro source code rn
put in your loc_vars function this:

main_end = {
  {n=G.UIT.C, config={align = "bm", padding = 0.02}, nodes={
    {n=G.UIT.C, config={align = "m", colour = BACKGROUND_COLOR_YOU_WANT_TO_SET_IT_TO, r = 0.05, padding = 0.05}, nodes={
      {n=G.UIT.T, config={text = ' '..TEXT_YOU_WANT_TO_SET_IT_TO..' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.3, shadow = true}},
    }}
  }}
}

replace BACKGROUND_COLOR_YOU_WANT_TO_SET_IT_TO with the background color (ex. G.C.GREEN, G.C.MULT, etc.) and replace TEXT_YOU_WANT_TO_SET_IT_TO with the string of text you'd like it to display

edit: put main_end in your return statement

stiff locust
#

that'll be far cleaner in execution anyhow

long sun
#

grand, thanks!

digital niche
#

does someone have an example code for wild card? i cant find it in the balatro files

hushed field
#

but you can find code related to it by looking for 'm_wild' in the sc

normal crest
digital niche
stiff locust
#

got it working again

digital niche
#

it works as any suit and gives +30 chip

stiff locust
#

this code is so much cleaner now too

normal crest
digital niche
#

oh, just that?

normal crest
#

yes

digital niche
#

easier than i thought

#

do i add it like under the "no_suit = false"?

normal crest
#

where'd you get no_suit from

#

Oh I see

digital niche
#

its because i got the template im using from an example

#

it was true and i changed to false

normal crest
#

just add it wherever yeah

#

as long as it's in your definition

normal crest
digital niche
#

okok! ty!

#

i was just about to ask that loll

#

it had "always score", "no suit" and "no rank", i removed the three of them

#

it was kind of a stone like card in the example

rose dragon
#

is there a way to make it so that the repeat doesn't score first and goes after the card behind it?

if pre ~= nil then
  local ret = SMODS.blueprint_effect(card, pre, context)
  if ret then should = true SMODS.calculate_effect(ret, card) end
end
if should then return {} end
twin flicker
#

I've got the joker to proc during the correct times finally but the value that it multiplies by and the value displayed in the joker description still read Xnil, any help? Heres the code:

SMODS.Joker {
key = 'test_joker',
loc_txt = {
name = 'testJoker',
text = {
"{X:mult,C:white} X#1# {} Mult if played",
"hand contains",
"a {C:attention}Full House{}"
}
},
blueprint_compat = true,
perishable_compat = true,
eternal_compat = true,
rarity = 3,
atlas = "Modded_Jokers",
pos = { x = 0, y = 0 },
cost = 10,
unlocked = true,
discovered = true,
config = { extra = { Xmult = 3 } },
local_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult } }
end,

calculate = function(self, card, context)
    if context.joker_main and next(context.poker_hands["Full House"]) then
        return {
            message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
            Xmult_mod = card.ability.extra.Xmult
        }
    end
end

}

digital niche
#

how do i make something that have a chance of happening when card is playing?

#

like a glass card

twin flicker
#

You have to define odds in ur config and then include something like this in the loc_vars,

(G.GAME.probabilities.normal or 1), card.ability.extra.odds

At least I think, theres more to the calculate part but i think thats the start, im very new to this so take it with a grain of salt plz lmao

digital niche
#

tyty!

spiral crown
#

anyone know if there is any documentation for copy_card?

normal crest
#

which should not be there

#

you're using copy_card properly

digital niche
#

how do i make the event occurs when card played?

maiden phoenix
spiral crown
maiden phoenix
#

The way you coded it, your consumable must have an edition to proc

#

Your context check should go like ```lua
if (not context.edition or (context.edition and not context.edition.negative)) and...

spiral crown
normal crest
#

be specific

#

is ther an error

twin flicker
#

So i finally figured out how to get my card to show 3X mult in its description in the collections but when I go in game now it just goes back to Xnil, any ideas?

spiral crown
rapid stag
rancid bridge
normal crest
digital niche
#

i have the part of the card breaking, but how do i change the chance?

chrome widget
#

I have a wonderful shader effect now and I can't use it until I somehow figure out how to make the transform projection thing not weird

spiral crown
maiden phoenix
#

I recreated the calculate function more properly and it works fine on my side

if context.using_consumeable then
            if (not context.consumeable.edition or (context.consumeable.edition and not context.consumeable.edition.negative)) and context.consumeable.ability.set == "Planet" then
                ...
            end
        end
humble girder
#

yo whoever's got experience with the new blind calc can you give me a rundown, i can't find quick evidence of it existing

maiden phoenix
twin flicker
# hushed field can you show your code?

SMODS.Joker {
key = 'test_joker',
loc_txt = {
name = 'The test',
text = {
"{X:mult,C:white} X#1# {} Mult if played",
"hand contains",
"a {C:attention}Full House{}"
}
},
blueprint_compat = true,
perishable_compat = true,
eternal_compat = true,
rarity = 3,
atlas = "Modded_Jokers",
pos = { x = 0, y = 0 },
cost = 10,
unlocked = true,
discovered = true,
config = { extra = { Xmult = 3 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands["Full House"]) then
return {
message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
Xmult_mod = card.ability.extra.Xmult
}
end
end
}

maiden phoenix
normal crest
hushed field
maiden phoenix
#

Oh it's right there

humble girder
#

okay so i kinda wanna make this two-way and give blinds a proper calculate() 🤔

hushed field
twin flicker
hushed field
#

does that work?

maiden phoenix
#

Makes the code less of an eyesore to look at

twin flicker
#

trying a new run now

hushed field
humble girder
#

consider this:

#

every time you set_ability() a card (ie. a card appears in the shop or wherever)

#

the center config is copied to card.ability

spiral crown
humble girder
#

so of course if you then go in your code and change the center, that won't change the values in your save file

maiden phoenix
twin flicker
#

LMAO thanks for saving me that time, it seems like it works great thanks guys appreaciate your help

rapid stag
humble girder
#

card manipulation functions are kind of dumb

#

set_ability wants a center

#

set_seal wants a key

maiden phoenix
humble girder
#

set_edition works with a key, or a stupid edition table {negative = true} but not a center

#

c o n s i s t e n c y

maiden phoenix
#

I think Cryptid made red seal retriggering Jokers work tho

digital niche
#

how do i chance chances in cards like glass

radiant plank
#

how do i go about handling suit conversion like a 'The Moon' card would? can't find a reference in the source.

hushed field
hushed field
maiden phoenix
gleaming summit
#

please how do I fix this

maiden phoenix
#

? What's that

gleaming summit
#

hold on let me find my message

wintry solar
humble girder
#

oh?

gleaming summit
#

I've changed a few things ever since I sent that message
now I'm using a random value being set in init_game_object

maiden phoenix
#

Have you tried saving said value inside the config table?

gleaming summit
maiden phoenix
#

Yes

humble girder
#

has this been a thing forever?

#

ah

#

Eremel, last month

#

correction: it didn't work when I started modding 😄

gleaming summit
# maiden phoenix Yes

it starts at nil (extra.joker) and then gets set to G.GAME.current_round.current_hand.bootleg_joker.joker every time calculate is ran

wintry solar
#

yeah I got sick of having to correct people's usage of it to use the centers

#

it makes more sense to take a key imo

humble girder
#

yeah everything working with keys would be ideal

radiant plank
digital niche
#

i wish there was one of that example "ModdedVanilla" for the enhancements because god how hard is it being to understand the glass card

next timber
#

how do you retrigger a joker from a seal? i have ```lua
SMODS.optional_features.retrigger_joker = true

```lua
if context.retrigger_joker_check then
  return {
    repetitions = 1,
    card = G.jokers.cards[1]
  }
end
``` and its not doing anything
maiden phoenix
wintry solar
gleaming summit
normal crest
wintry solar
#
SMODS.current_mod.optional_features = function()
    return {
        retrigger_joker = true,
    }
end```
normal crest
#

why bother with a function tho

#

does it make any difference

humble girder
#

imma just quickly sweep this under a rug
SMODS.optional_features.cardareas.unscored = true

next timber
humble girder
normal crest
#

smods checks if it's a function or a table

#

i dunno why, but it does

digital niche
#

i give up

normal crest
wintry solar
#

oh I didnt realise it accepted just a table

next timber
maiden phoenix
next timber
#

i have a print("retrigger") in the if context.retrigger_joker_check then and its not firing

maiden phoenix
next timber
#

i did

#

i always start new runs when debugging

normal crest
#

Hmm, I had the same issue but I don't remember what I did besides that

#

If you have debugplus try printing SMODS.optional_features

scarlet spire
#

what does "removing playing cards" actually mean for context.remove_playing_cards? can I use that to destroy cards when they're discarded?

wintry solar
#

no

#

that's to see which cards have been removed

normal crest
#

To do thar you use context.discard and return {remove = true}

scarlet spire
#

ah okay, discarding context can return remove as well

#

missed that bit

next timber
#

when and where exactly does context.retrigger_joker_check fire? because this is on a seal right now

normal crest
wintry solar
#

seals should calculate that fine

next timber
#

have i made some sort of syntax error?

maiden phoenix
#

Try context.retrigger_joker instead?

next timber
#

nope

signal oak
#

yo can anyone help me set up the balatro mod stuff? i know some lua and wanna try and add my own jokers but i dont actually know what i have to do to like add them to the game

maiden phoenix
#

If you debug the context value inside calculate but outside your if, which context shows up?

rapid stag
maiden phoenix
# signal oak yo can anyone help me set up the balatro mod stuff? i know some lua and wanna tr...
GitHub

A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.

GitHub

Steamodded example mods. Contribute to Steamodded/examples development by creating an account on GitHub.

next timber
#

hang on im setting up a debug to only print the keys

#

ok thats still a lot of keys but it looks like from card select to card played and new cards drawn, im getting modify_scoring_hand, debuff_hand, press_play, stay_flipped?, modify_scoring_hand 2 more times, debuff_hand again, before, modify_hand, main_scoring, repetition, final_scoring_step, destroying_card, after, and then after that is all stuff from discarding the played hand and drawing a new one

#

so no joker retriggering events in sight

chrome widget
#

crawling out of shader hell yet again with cuts and bruises and my clothes slightly on fire: stand auras

next timber
#

how the hell did you make shaders bigger than the card

#

teach me your witchcraft

#

also teach me your witchcraft in general those look awesome

chrome widget
#

Actually making shader stuff larger than the card requires vertex transformations that I'm less familiar with, so right now this is a pixel shader just with a larger sprite itself that has a lot of negative space

#

Only downside is that the vertex projection cards do already doesn't really work in combination so I had to tone it down to not look awkward

#

It's passable but admittedly I would've preferred to be able to at least do the offsetting cards do as they get farther from the screen center more accurately to the base card

normal crest
#

And I see you weren't able to do the voucher thing

hushed briar
#

anyone have an idea of how i might go about hooking a function from a mod with higher priority than mine? trying to add compatibility with a mod that currently can cause a crash when used with mine

chrome widget
normal crest
chrome widget
#

All stands are part of the Stand set, and then I made separate pools for regular and Evolved Stands. So I can directly access one from those pools if I need to get them randomly, but for the purposes of vouchers that make Stands and Evolved Stands purchasable in the shop, it spawns from the main Stand pool and then the two types have hidden rarities

zealous glen
chrome widget
#

So the first voucher sets the base stand rarity rate above 0, and the upgraded voucher sets the evolved stand rarity rate above 0

modern kindle
#

Winter hi :D

hushed briar
chrome widget
#

Also hi dilly!! Did you figure out the blind you were struggling with?

normal crest
#

Unless that also doesn't work on mac

chrome widget
#

!!!!!

zealous glen
zealous glen
modern kindle
#

Alot of stuff I struggle with gets solved after I sleep
Unfortunately I only slept until like 3 am, then was up to like 6 or 7 lmao

chrome widget
#

Yikes. Get some damn sleep

zealous glen
#

have any of you added a new context in a way that automatically handles the calculation?

rugged pier
#
    calculate = function(self,card,context)
        if context.setting_blind then
            local joker_list = {}
            for i,v in ipairs(G.jokers.cards) do
                if v.ability.name ~= 'Tensoon' and v.config.center.blueprint_compat then
                    joker_list[#joker_list + 1] = v
                end
            end
            if #joker_list > 0 then
                card.ability.extra.copying = pseudorandom_element(joker_list,pseudoseed('Tensoon'))
            end
        end
        local other_joker = card.ability.extra.copying
        if other_joker ~= nil then
            context.blueprint = (context.blueprint and (context.blueprint + 1)) or 1
            local copy_return = other_joker:calculate_joker(context)
            if copy_return then
                return other_joker:calculate_joker(context)
            end
        end
    end

crashing the game with a stack overflow error with this joker...didnt even know this was possible

#

can someone have a look?

modern kindle
# zealous glen what blind

Oh it's just one that is an inside joke in a friend server
We have a whole thing about doing a dice roll against a specific person who has the role 'hand of the high roller' and if you lose you get kicked
If you win nothing happens

So I made a blind that rolls against you
If you roll higher, you gain you normal score
If the blind wins the roll the scored hand value gets subtracted from your total chips

normal crest
zealous glen
ivory coral
#

hello chat
Currently making some jokers that interact with current game chips and the sort, and because i use talisman i've only just learned that to_number() isnt a vanilla thing and will crash the game if talisman isnt installed, but it also has to be included if it is installed or it crashes, is there a way to make these work together? I dont really want to make my mod either incompatible with or dependent on talisman

radiant plank
#

how would i go about creating a suit based joker like Ancient Joker? i see that ancient joker has a G.GAME.current_round.ancient_card.suit but im not sure exactly where i would want to be setting this for my own card.

zealous glen
#

to_big = to_big or function(x) return x end

zealous glen
radiant plank
#

thanks!

#

will do

zealous glen
radiant plank
#

wait where can i find this? is it on the smods wiki or in here?

rugged pier
normal crest
ivory coral
rose dragon
zealous glen
modern kindle
normal crest
#

Oh

radiant plank
#

okay thanks

normal crest
#

Wait can you show where you used calculate_context and where you put the message?

modern kindle
zealous glen
#

@normal crest

#

example

normal crest
#

Oh I see, this is what smods does if you don't pass a return table

mental nacelle
#

does anyone happen to know where the deck object in the corner of the game is stored

normal crest
#

and the effects are put into the return_table if you pass one

#

instead of being calculated like that

normal crest
# zealous glen

Tho, correct me if I'm wrong, but instead of passing a return table couldn't you store the return value of calculate_context and check if that has repetitions

trail arrow
#

so, i'm wanting to make a new card modifier, looked around the docs a bit but there seems to be nothing for easily adding a new card mod

long sun
#

hiiiiii question! G.GAME.last_spectral is always nil, do you know why?

gilded narwhal
#

hey gang does steamodded have a way to tell if a certain joker is +mult or +chips

#

I want to have a joker that makes either +chips or +mult more likely to appear

rapid stag
#

@next timber ...did you figure out how to make red seals work on jokers cirBox

gilded narwhal
normal crest
#

pretty much, but your mod won't be very compatible with other mods

normal crest
#

looking at SMODS It looks like you should, but I haven't tested

long sun
#

aha no nevermind, it works now!! :D

sturdy compass
#

Lmao

sturdy compass
rugged pier
sturdy compass
#

If you’d like you can check how I do it with my Zombie Joker. It’s a little different since it’s a global target and not on a per-card basis, but it could pretty easily be adapted to do that I think

next timber
zealous glen
#

@normal crest It only seems to return {calculate = true}

rugged pier
normal crest
#

I swear it looked like it was doing more

long sun
#

WE ARE SO GAMING

rose dragon
# long sun

couldn't you mass produce the soul/blackhole if you use shard and have perkeo?

long sun
#

exactly :D

#

it's added to the pool by a particular deck, hold on

tall salmon
#

for some reason i'm really struggling to hook into smods functions

#

im doing this as a test but can still play flushes and such

rose dragon
long sun
#

i'm guessing they mean enhancement

trail arrow
#

nope

tall salmon
#

my guess was a new kind of those

#

different from enhancement and edition

zealous glen
#

replacing small and big blinds with boss blinds

trail arrow
#

new effect thing different from editions or enhancements

long sun
#

ah icic

trail arrow
#

want to add card conditions, so like a scratch or card errors (like misprint, but expanded upon and available for any joker)

#

or car for that matter

tall salmon
#

the only thing that comes to mind right now is the little thingy that the "seed" code card in cryptid gives your jokers

rose dragon
# trail arrow new effect thing different from editions or enhancements

if you're doing that then i would recommend checking aikos mod source code
they added scrabble words/letters that are different to editions and enhancements (but can't be applied to joker cards)
i would also recommend this for drawing things on it, you could store the modifier in the card.ability and check for it in the drawstep
https://github.com/Steamodded/smods/wiki/SMODS.DrawStep

GitHub

A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.

trail arrow
#

oh yep

tall salmon
#

i can't figure out why this wouldn't work

analog pilot
analog pilot
# long sun

I might also make it possible to appear in shop tbh

zealous glen
#

Paperback

#

also I think Clips are Seals

analog pilot
#

didn’t know that

#

and idk why I thought they were from bunco lol, I use a lot of vanilla-esque mods so

zealous glen
#

I think so

analog pilot
#

yeah they’re from paperback. odd

untold garden
#

I'm sure this gets asked a lot, but are there any good resources for getting into developing mods?

untold garden
analog pilot
#

and also just trying to learn Lua in general I’d think

analog pilot
#
  • the smods documentation
#

for sure

analog pilot
zealous glen
#
  • the example mods
hushed field
untold garden
#

Must've missed that thread when I skimmed through them, thanks all of you

hushed field
long sun
#

i'm back :D how do i only add a consumable to the pool if you're using a certain deck?

hushed field
#

Use the in_pool func to check for the deck type

long sun
#

thanks :D

#

ah wait, how do i check for the current deck?

#

actually no wait lemme try that first

#

i might know

normal crest
analog pilot
normal crest
#

the only reason they're stickers is so that they can be applied on top of everything else

zealous glen
#

Me when I spread misinformation: jimbOrb

radiant plank
#

im trying to hook Game:init_game_object and generate a pseudorandom value within the function. unfortunately i keep accessing G.GAME while its nil. how do i get around this?

normal crest
#

otherwise they'd have to replace something

long sun
#

okay i can't find it — how do i get the current deck?

radiant plank
#

here's what i have

local init_game_object_hook = Game.init_game_object
function Game:init_game_object()
  local ret = init_game_object_hook(self)

  -- initialize with a random suit
  local suits = {'Spades', 'Clubs', 'Diamonds', 'Hearts'}
  local suit = pseudorandom_element(suits, pseudoseed('bc'))

  ret.current_round.bluecrystal_card = { suit = suit }
  return ret
end
hushed field
long sun
#

ah, thanks :D

#

searching for back granted G.GAME.selected_back.effect.center.key :D

zealous glen
normal crest
#

Yeaaah but then I'd have to patch/hook all the calculations in

#

Even the ui generation

#

All of that is already done with stickers so I didn't see the benefit of reinventing the wheel

hushed field
#

Stickers are the easiest way to set things like that up, honestly. Them being stackable really helps

zealous glen
#

automatic sticker placement when

digital niche
#

can someone tell me if this is right?

zealous glen
#

Actually I discovered earlier SMODS has a function to decide if a card is shatterable or not

narrow iron
#

what does balatro use for its shaders for the card editions? like foil and holo

zealous glen
chrome widget
#

Hmm............

digital niche
chrome widget
#

strangely, trying to set stands appearing in the shop is resulting in only Jimbo appearing

#

the base rate field is not working as intended

zealous glen
#

This must be the work of an enemy Stand!

narrow iron
#

like the shaders are a .fs file with code in it but what language is the code in?

zealous glen
#

… Sorry

zealous glen
#

You can check the SMODS wiki for references

chrome widget
narrow iron
#

thanks!

digital niche
zealous glen
#

wha

digital niche
#

change the chance*

normal crest
#

SMODS.shatters just returns if the card should visually shatter like glass when destroyed

digital niche
#

oooh

normal crest
#

not if it should be destroyed in the first place

digital niche
#

is there a SMODS for being destroyed?

zealous glen
#

a what

normal crest
#

idk what you mean

digital niche
#

like

#

to say the card can be destroyed

#

like, it haves a chance of being destroyed

zealous glen
#

There is a calculation context where effects can determine if a card should be destroyed with the timing of Glass cards

digital niche
#

how do i make that? ive been trying since like 7pm and now is 9pm

#

i looked at the vanilla balatro code and at mods codes and i still dont understand

tall salmon
normal crest
zealous glen
digital niche
zealous glen
#

context.destroy_card

digital niche
normal crest
#
calculate = function(self, card, context)
    if context.destroy_card and context.cardarea == G.play and context.destroy_card == card and pseudorandom('glass') < G.GAME.probabilities.normal/card.ability.extra then
        return { remove = true }
    end
end,

this is how glass cards are destroyed when played ingame (this is how SMODS takes ownership of them anyway)

digital niche
#

tyyy

#

how do i like change the probability of this happening?

zealous glen
#

this is unrelated but it's Brazilian Miku Joker

digital niche
#

BRAZIL MENTIONED🔥🔥🇧🇷🇧🇷🔥🔥

tall salmon
zealous glen
#

-# well you can multiply the numerator too, but they're essentially equivalent

digital niche
#

so i need to do something like ```

card.ability.extra = 1/3```
if i wanted to be a chance of 1 in 3 or something different?

tall salmon
#

she's so pretty

normal crest
tall salmon
#

it gets divided after

digital niche
#

oh okok, ty so much, ive been stuck in this for hours

normal crest
#

Ideally you define the value in your config, but for now do it like that

digital niche
#

if i wanted in the description to do like that red box id use {X:mult,C:white}, if i wanted to do it but about Xchips would it just be {X:chips,C:white} ?

zealous glen
tall salmon
#

steamodded itself doesn't have a priority does it?

#

like i can't be loading my mod before it

chrome widget
#

So this is the consumable type I made for my Stands, but for some reason every time I pass "Stand" into create_card(), it returns Jimbo as if the pool is empty?

for i, v in ipairs(items_to_load['Stand']) do stand_map[v] = true end
SMODS.ConsumableType {
    key = 'Stand',
    primary_colour = G.C.STAND,
    secondary_colour = G.C.STAND,
    collection_rows = { 8, 8 },
    shop_rate = 100,
    default = "c_stand_star",
    prefix_config = false,
    rarities = {
        {key = 'StandNormal'},
        {key = 'StandEvolved'},
    },
    cards = stand_map,
    can_stack = false,
    can_divide = false,
    inject_card = function(self, center)
        local pool_key = center.config.evolved and 'EvolvedPool' or 'StandPool'
        SMODS.insert_pool(G.P_CENTER_POOLS[pool_key], center)
    end
}```
zealous glen
chrome widget
#

prefix_config is set to false so I shouldn't need to?

digital niche
#

what is the thing i use for green text? like in the "1 in 4" in the glass card description

plush cove
#

{C:green}

digital niche
#

oh, tyty!

normal crest
plush cove
#

for future reference, if there's a colour you want to get, go into the balatro localization (accessible via 7Zip), Ctrl+F to a card that has that colour, and copy what it says

normal crest
#

cus you're overriding inject_card

chrome widget
#

'StandPool' is what I use specifically for unevolved Stands

normal crest
#

yeah you're not actually injecting the card into the Stand pool

#

cus you override it

chrome widget
#

Oh I see

normal crest
#

add SMODS.ObjectType.inject_card(self, center) at the start of inject_card

chrome widget
#

Thanks!!

digital niche
#

lesgoooo, finally god

#

now just more 32 enhancements to go 😀

chrome widget
#

Hmm still not working, seemingly

#

But it does seem to correctly add cards to StandPool

gleaming summit
#

hey sorry to bother you but did you ever find out how to save tables so that they don't get replaced?
I'm having the same issue because I'm trying to save the data of a joker (which is a table) into an ability.extra variable

normal crest
#

I believe every consumable with the set = 'Stand' will automatically be added

fallen tendon
#

how can you get the key of the current blind from G.GAME.blind?

normal crest
#

G.GAME.blind.config.center.key

#

I think

chrome widget
#

Tried that too, and they're still correctly added to the other pools

normal crest
gleaming summit
normal crest
#

you could add a variable to that specific joker's ability table that you look for in your code

#

but you have to carefully manage that to ensure that there aren't multiple copies of it at once

chrome widget
#

Looks like the pool is correctly populated so it's some other bizarre issue

#

Gonna have to debug create_card itself

normal crest
#

try

#

SMODS.add_card { set = 'Stand' }

#

that still calls create_card tho

#

but just in case

chrome widget
#

I can definitely try it, but I'm using the built-in support for setting an appearance rate for a consumable type, so I can do that for one of my consumables that creates a Stand, but I don't think I should need to patch the create_card_for_shop() function

manic rune
#

whats the pool for all blinds in the game

#

G.P_CENTER.Blind or smt?

#

🤔

chrome widget
#

So trying SMODS.add_card{ set = 'Stand' } didn't just create Jimbo, it apparently also created a ghost card

normal crest
#

Hmm