#💻・modding-dev

1 messages · Page 320 of 1

hard needle
#

hm?

tepid crow
#

jesus wtf was that spelling of mine

#

if this is the function definition function Card:set_ability(center, initial, delay_sprites) how is this the call cardsetabilityref(self)

daring fern
tepid crow
#

regardless, you should probably just use the built-in smods methods of resizing the joker if possible yeah ^

hard needle
#

😭

#

alright thanks

hard needle
#

i think he's a little big

hushed field
#

Absolute unit

regal ether
#

big guy

runic pecan
#

It's been three weeks and I still don't know how this feature works.
At least I know it's not G.P_CENTER_POOLS.Foo.

tepid crow
hard needle
daring fern
hard needle
tepid crow
#

yeah that's because that's a totally different function signature with no arguments

zealous glen
#

instance:method(args) is equivalent to instance.method(instance, args)

rapid stag
#

bump

wintry solar
#

I will try and take a look at this tonight but I’m 95% sure you are just doing it wrong

rapid stag
keen tiger
#

is there a way to check if you have unlocked some deck/stake?

runic pecan
keen tiger
runic pecan
keen tiger
#

ebin

#

thanks

#

weird that decks is just called Backs internally

#

i mean balatros entire codebase is insane amounts of spaghetti code so not shocking lol

maiden river
#

well, it is the card back

hard needle
#
calculate = function(self, card, context)
        if context.cardarea == G.play and context.individual then
            if pseudorandom('instant_replay') < G.GAME.probabilities.normal / card.ability.extra.odds then
                return {
                    message=localize("k_again_ex"),
                    repititions = card.ability.extra.repititions,
                    card=card
                }
            end
        end
    end

why isn't it repeating properly (chips are not being added)

odd wyvern
#

So I've never worked on a balatro mod, but I'm interested in getting into it, so a quick question: is it possible to replace a card face with an animated sprite, made in aseprite or something similar?

odd wyvern
#

In this situation Im intending to alter a spectral card, but I'd assume it's similar for both?

hot island
#

i was trying to convert all the base game balatro cards into json to be used in javascript so i wouldnt need to do it all manually

hot island
#

but after i just decided to use the reddit bot that already did it

daring fern
scarlet thorn
#

Cryptid's way is much easier, imo. It can be done patchless

hard needle
daring fern
odd wyvern
hard needle
scarlet thorn
hard needle
red flower
dreamy thunder
#

how would i make a joker change the values of the glass cards? For example when you have a specific joker mult and odds of glass cards will double

hard needle
#

yeah that was why 😭

hard needle
#

i need to stop making typos bro

red flower
#

smods does so you can just copy that code

dreamy thunder
#

oh i forgot about

#

ownerships

#

thank u 🙏

lethal stratus
#

boo development boo

hoary crown
#

a

sturdy compass
#

Ok so to do this, you'd wanna check if context.other_card has 'm_stone'

#

You can do that in a variety of different ways, but the one I'd recommend is via SMODS.has_enhancement, which is a function that takes a card and an enhancement key

lethal stratus
#

how do i type that out?

#

ive been using context.other_card:get_id()

hoary crown
#

/find glass_card

sturdy compass
#

SMODS.has_enhancement(context.other_card, 'm_stone')

unborn bay
#

get_id usually refers to rank

sturdy compass
#

<@&1133519078540185692> scammer!!

unborn bay
#

kill this person

lethal stratus
#

that was fast ggs guys

sturdy compass
#

Yeah that looks good minus the card = context.other_card bit. You could honestly get rid of it entirely

unborn bay
#

usually repetitions caused by jokers have messages by the joker itself

sturdy compass
#

also it's spelled "repetition" not "reptition"

lethal stratus
#

oop

unborn bay
#

not the card its repeating

#

i almost said fard

odd wyvern
scarlet thorn
#

It's in the base game code

lethal stratus
#

how do i pull up the debugplus menu again

scarlet thorn
sturdy compass
#

hold tab

hoary crown
lethal stratus
#

no

#

:(

hoary crown
#

yes

#

<:)

sturdy compass
#

no no he's right

lethal stratus
#

currently no retriggers

odd wyvern
lethal stratus
#

any ideas as to why stones arent retriggering?

sturdy compass
#

Your variable is still called "reptitions" lol

lethal stratus
#

motherFUCK

tepid crow
lethal stratus
#

i changed the wrong one

sturdy compass
hoary crown
#

R E P T I T I O N S

lethal stratus
#

no more reptitions

#

still nothin

sturdy compass
#

hmmmm

tepid crow
#

did you restart the run

lethal stratus
#

i reset the game like

sturdy compass
#

Oh true

lethal stratus
#

5 times

#

lol

#

and yes i did

sturdy compass
#

But the run

tepid crow
#

no, whether you restarted the run

lethal stratus
#

everytime i go to retest a joker i start a new run

tepid crow
#

👍

sturdy compass
#

That's good, but still weird that it's not working

lethal stratus
#

here hold on

#

let me uploadf

rare obsidian
#

hi, how do I develop a mod with steammodded instead of just messing with the source code?

rough furnace
sturdy compass
#

Damn barely beat me

rare obsidian
#

I’m working on a mod called Scribble, in which you can make scribbled cards, which are more common, but less powerful

#

is it a cool concept?

shell timber
#

oh like scribbled perkeo would make a nonnegative copy

#

sounds funny

lethal stratus
#

idk why jade doesnt work

hard needle
#

scribbled chicot disables of a boss blind after 3 boss blinds

sturdy compass
#

I'm just throwing stuff at the wall here ngl

lethal stratus
#

that was it lmao

#

jokers not shaking again though

#

snh

sturdy compass
lethal stratus
#

this one seems easy

sturdy compass
#

yeah that's basically just a chain of context.scoring_hand[1]:get_id() checks

lethal stratus
#

I have a huge list of joker concepts if you're wondering

sturdy compass
#

I can see that

lethal stratus
#

how much do rares normally cost

red flower
lethal stratus
sturdy compass
sturdy compass
#

That would explain it 😭

lethal stratus
#

lemme fix that 😭

rough furnace
#

3 month old steamodded my beloved

lethal stratus
#

how much does the trio cost?

undone maple
#

i wanna learn modding balatro, specifically aiming for a jokers mod for a friend group, where should i start?

plain apex
#

can i copy a joker even if it is no longer there?
like this works but if you sell the joker then it no longer copies it

SMODS.Joker{
    key = 'bbillyn',
    loc_txt = {
        ['en-us'] = {
            name = "Billboard",
            text = {
                "Copies the last bought Joker",
                "Currently: {C:attention}#1#{}"
            }
        }
    },
    atlas = 'Jokers',
    pos = { x = 3, y = 4 },
    config = {
        extra = {
            copied_key = nil
        }
    },
    rarity = 3,
    cost = 12,
    blueprint_compat = true,

    loc_vars = function(self, info_queue, card)
        local name = card.ability.extra.copied_key
        return { vars = { name } }
    end,

    calculate = function(self, card, context)
        -- If buying a Joker and it's not Billboard itself
        if context.buying_card and context.card ~= card and context.card.ability.set == 'Joker' then
            local bought_key = context.card.config.center.key
            card.ability.extra.copied_key = bought_key
        end

        local key = card.ability.extra.copied_key
        if not key then return end

        -- Find a joker with that key on the board (exclude Billboard itself)
        for _, other in ipairs(G.jokers.cards) do
            if other ~= card and other.config.center.key == key then
                context.blueprint = (context.blueprint and (context.blueprint + 1)) or 1
                context.blueprint_card = context.blueprint_card or card

                if context.blueprint > #G.jokers.cards + 1 then return end

                local result, triggered = other:calculate_joker(context)
                if result or triggered then
                    if not result then result = {} end
                    result.card = context.blueprint_card or card
                    result.colour = G.C.GREEN
                    result.no_callback = true
                    return result, triggered
                end
            end
        end
    end
}
undone maple
sturdy compass
#

Oh hey another last bought joker blueprint lol

lethal stratus
daring fern
red flower
#

i would create a copy of the joker in a hidden cardarea

plain apex
lethal stratus
plain apex
sturdy compass
sturdy compass
#

It does actually

#

Not handled in that file but yes

red flower
#

oh do you do something else for it to work? i assumed G.GAME.last_bought.card breaks on load

#

<@&1133519078540185692>

sturdy compass
red flower
#

oh yeah i think i remember the zombie thing

sturdy compass
#

That's probably still the most in-depth card I've made lol

formal parrot
#

I’ve been learning too much C i can’t end a sentence without the ;

lethal stratus
#

screwed something up! accidentally made this card trigger on each card instead of if there was a card.

formal parrot
#

Like what the fuck ;

#

VOID GET MY ASS OUT OF HERE ;

daring fern
red flower
#

damn

sturdy compass
red flower
# lethal stratus ?

you need to do that in context.joker_main and check context.scoring_hand[1]

sturdy compass
#

I don't think that has to be in joker_main does it?

red flower
#

it says "gives" so im assuming its the joker and not the card

#

the timing changes

sturdy compass
#

Hmmm you're right, wording definitely gives that

#

That sounds like a description rework instead then since they went for individual off rip

lethal stratus
#

no i coded it wrong

#

description is what i meant to do

sturdy compass
#

Ah lmao

lethal stratus
sturdy compass
#

what code

red flower
#

code?

lethal stratus
#

i love checks

sturdy compass
#

You don't need this anymore actually lol

#

I was going off of you using context.individual

wintry solar
sturdy compass
red flower
# lethal stratus

also this is kinda technical but you want the general context check before using context.scoring_hand because it doesn't exist in every context

wintry solar
#

yeah but if you buy a joker then a planet doesnt this do nothing?

sturdy compass
lethal stratus
sturdy compass
#

The stored card doesn't change unless the card being bought is blueprint_compat == true

red flower
lethal stratus
#

where?

red flower
#

all of them

lethal stratus
#

i thought i already did that

#

oh do you meant the context checks

sturdy compass
#

yes

wintry solar
#

oh its a value that you set conditionally, I see

sturdy compass
#

correct

daring fern
#

Would blueprint for non-jokers be possible?

sturdy compass
#

It's a lil weird but I think it's more player-friendly since they don't have to worry about buying things that aren't compatible

lethal stratus
#

ok that works

sturdy compass
daring fern
sturdy compass
#

I’m honestly not sure

rough furnace
#

playing cards use calculate do they not?

#

nothing will have blueprint checks though

sturdy compass
rough furnace
#

it should work the same

#

like retriggering

#

stuff likely isn't designed around it though

#

so it might need more work

lethal stratus
#

the mod is supposed to be base-game plus so uh... is this too different

sturdy compass
#

Not at all. I have one that does that too and it’s Uncommon LMAO

lethal stratus
#

i think it being legendary might be a bit too small

#

maybe it should be add a card to both sides?

sturdy compass
#

Both sides?

lethal stratus
#

one to the amount of cards in the pack, one to the amount you can take

tepid crow
#

one extra card to take, one extra card to see

lethal stratus
#

^

tepid crow
#

both sides cuz it's left/right on the booster pack description haha

sturdy compass
#

Ah so offbyone lol

#

Still not sure if it’s legendary-calibre tho

lethal stratus
#

i need it to be legendary so if thats not good enough i need to buff it x3

#

(the legendaries are all based on important things from vivid/stasis)

hushed field
#

I do think that that a version of that effect that's suitably legendary might not feel as base game compatible anymore

sturdy compass
#

Having a ton of pack cards is cool an all but that can backfire pretty easily because of cardarea limits

lethal stratus
#

yeah thats true

#

what else could i have it do that wouldn't feel too out of hand

red flower
#

xchips

lethal stratus
#

hm

#

none of the other cards do that, but what Xchips amount would be legendary considering

sturdy compass
#

I have a X2 chips card that’s rare so take that how you will

red flower
#

i was joking anyway lol

lethal stratus
#

raghhh

wintry solar
#

X2 chips as a rare is horrible imo

shell timber
#

the Duo:

modern kindle
#

i was gonna say yea

wintry solar
#

yeah I guess

rapid stag
#

how strong is xchips cirThink

keen tiger
#

should i use the event manager to call stuff like Game:start_run?

#

Also: does Game:start_run fully initialize the blind info

shell timber
#

xchips is roughly equal to xmult

faint yacht
#

All depends.

rapid stag
lethal stratus
#

hmmph

rugged pier
#

how do you prevent death but continue the same round?

lethal stratus
#

idk how to make this either worth being a legendary or just make some utility joker like this that is a legendary

daring fern
sturdy compass
rugged pier
#

nevermind

#

doesnt work

hidden notch
#

I want to iterate trough a List of all Booster Packs, Vouchers, Consumable Cards (Like Tarot, Planet or Spectral) and Jokers...
I thought I'd be cheeky and solve it with this lil' Code-Snippet... But that runs into some problems, so any better Ideas on how to tackle this? :)

keen tiger
#

is there any documentation of the objects contained in the raw G.GAME object at all?

#

id like to just read through that rather than having to decipher how the bajillion different fields are used

sturdy compass
#

Not really lol

keen tiger
#

😐

#

i might be the one documenting this then

#

for what im working on i need to obtain more or less the entire game state

sturdy compass
rugged pier
#

that prevents the round from ending?

#

since the context is already set by the game

sturdy compass
#

hmm

rugged pier
#

i guess i could just do final scoring step on last hand if i cant use end_of_round

sturdy compass
hidden notch
#

If Card-Sleeves are installed, you pull those from the G.P_CENTERS aswell ^^'

sturdy compass
#

I think the main thing is that we don't have context as to what you're trying to do with this list

hardy viper
#

pool names r all caps

#

iirc

red flower
hardy viper
#

could be like

#

Joker

willow plinth
#

holy shit this took way too long but here it is (icc profile didn't work because all icc tools are outdated garbage and newer mac screens kinda don't use icc so i had to convert the game shader to a metal shader and put it into a swift app aaaaahhhhhhcsweopscvmwmvgwioerrgwrgweiopjk)

hardy viper
#

then

#

im not sure

red flower
#

yeah

sturdy compass
hidden notch
hardy viper
#

regardless for that initial approach you should do string.sub(key, 1, 2) == "j_"

sturdy compass
willow plinth
keen tiger
#

i want to poll something: is anyone interested in automated unit testing for balatro mods? i.e. instead of having to repeatedly do the same things in balatro to test your additions, you could write some code that does stuff to the balatro game state and then tests if the results make sense. what i'm working on could feasibly allow this, assuming your mod doesnt do insane things to balatro's codebase

keen tiger
keen tiger
#

OH

#

so uhhh i was working on this

#

😐

willow plinth
#

well we couild both work on this

#

mine isn't even usable, theres nothing implemented yet

keen tiger
#

ok so me and @haughty cargo were working on a remoting mod. it uses rust and a tcp socket so you can make remote control interfaces

red flower
keen tiger
#

so if we want to collectively pool our efforts into a single project that would be ebin

willow plinth
unkempt thicket
#

How can i remove all UI that appears when hovering over a card?

red flower
willow plinth
keen tiger
red flower
willow plinth
#

yeah i was afraid to call it finite state machine because i dropped out of school and don't have a single semester of CS under my belt but yeah i guess that's what it's called

hidden notch
willow plinth
desert ore
#

just wondering, how feasible is a joker concept that reverses scoring order? so for all goes right to left. jokers first, then held in hand, then played hand, then base?

red flower
#

you need to patch the scoring loops i think

desert ore
#

sounds like an interesting idea but might be a lot of work lol

#

oh that's funny observatory would go before jokers

lethal stratus
#

losing my mind

undone maple
#

still unsure whats causing this,, im trying to mod for the first time

lethal stratus
#

i need a utility based joker(something that happens like perkeo does) but i cant think of it

#

this isnt good enough

desert ore
lethal stratus
#

basically

#

changes some other aspect, like rerolling

rugged pier
undone maple
rugged pier
#

youre missing a comma

undone maple
#

🤦‍♂️ classic

#

thank you

rugged pier
#

np

next timber
#

When making a collab skin you can define additional palettes beyond high and low contrast, but i cant see any way to do this for the default skins of custom suits?

old bane
#

how does one use SMODS.calculate_effect() btw?

red flower
graceful magnet
#

I've tried like a dozen different things but I can't get the G.play/scoring_hand check to go through

red flower
#

i think cardarea is not given in before

#

it's an error in the wiki

#

or it's bugged or something

old bane
# red flower for what

like id ideally want to use it for like a blueprint effect or something where a joker copies the effect of a random other joker for a round

red flower
#

there's a helper function for blueprint effects

old bane
#

oh i see

#

does this helper function require that the player have the other joker in their loadout or no

red flower
#

im pretty sure it does

graceful magnet
red flower
#

oh weird

graceful magnet
#

wait, I might need to make these not connected ifs

red flower
#

if both conditions can be met at the same time yes

graceful magnet
#

yeah that's what it is then

lethal stratus
#

how do i make the config/calculate for this

#

(ik config and loc_vars are wrong i copied it)

graceful magnet
next timber
#

is there any way to define palettes other than lc and hc for a custom suit? i know its possible with deckskins but id like this to be on the default skin

undone maple
#

trying to make a joker work like flower pot, but i dont know what an "unexpected symbol" is

daring fern
daring fern
gusty iron
#

So im trying to make it so when youre playing with a certain deck, after every round, theres a 1/[rank] chance of each card in the deck ranking up, how would i do this?

daring fern
gusty iron
#

and how would i check the current deck being used?

lethal stratus
#

whats the voucher tag called 😭

daring fern
gusty iron
daring fern
cedar island
#

sorry to barge in, but I'm trying to make a mod for the first time and it's not showing up in the list. I followed the example mod in the SModded repo mostly, what's the most likely reason?

lethal stratus
#

what would the config be

#

/ loc_vars

daring fern
gusty iron
#

so

#

from 2~14?

daring fern
gusty iron
#

okay that should

#

make this ALOT easier

desert ore
# lethal stratus

I don't think it needs a loc_vars or config? right? there's no extra variables that need to be displayed/used/can be tweaked later here, if you were to change it to 2 voucher tags or smth I think it would though?

lethal stratus
#

fair

gusty iron
#
if G.GAME.selected_back == "b_JCJ_2deck" then
for _, card in pairs(G.playing_cards) do
if not card.base.id == 14 then
number = pseudorandom('deck') -- This just generates a number from 0 to 1
if number <= 1 / card.base.id then
card.base.id = card.base.id + 1
end

end
end
end

would this work?

cedar island
daring fern
lethal stratus
gusty iron
daring fern
daring fern
lethal stratus
#

didnt mean to reply

#

but

#

idk why it tweaketh so

gusty iron
desert ore
#

I should probably change what program editor I use, which do you guys recommend?

daring fern
sturdy compass
lethal stratus
#

...

#

how did i do that

daring fern
cedar island
# daring fern No, you should read the first message.

sorry maybe I'm stupid, but do you mean "Remember to download Steamodded and Lovely first." or something else? Other mods work fine, I made a separate copy of Balatro and everything. Mine just doesn't show up in the list in-game

daring fern
lethal stratus
daring fern
gusty iron
#

does anyone here now how to upgrade a card's rank?

lethal stratus
#

probably forgot about a prefix or smthn

daring fern
gusty iron
daring fern
sturdy compass
lethal stratus
#

theres like twelve of them

#

i was just told get a lua extension 😭

gusty iron
#

oh i see

daring fern
daring fern
red flower
#

vscode

lethal stratus
#

its tweaking about SMODS rn 😭

gusty iron
#
if G.GAME.selected_back == "b_JCJ_2deck" then
for _, card in pairs(G.playing_cards) do
if not card.base.id == 14 then
number = pseudorandom('deck') -- This just generates a number from 0 to 1
if number <= (1 / card.base.id) then
  local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
                    local rank_suffix = card.base.id == 14 and 2 or math.min(card.base.id+1, 14)
                    if rank_suffix < 10 then rank_suffix = tostring(rank_suffix)
                    elseif rank_suffix == 10 then rank_suffix = 'T'
                    elseif rank_suffix == 11 then rank_suffix = 'J'
                    elseif rank_suffix == 12 then rank_suffix = 'Q'
                    elseif rank_suffix == 13 then rank_suffix = 'K'
                    elseif rank_suffix == 14 then rank_suffix = 'A'
                    end
                    card:set_base(G.P_CARDS[suit_prefix..rank_suffix])
end

end
end
end
``` i dont think this works
#

oh wait

#

im an idiot

lethal stratus
red flower
#

try add_tag(Tag('tag_voucher'))

desert ore
#

lol was just typing that out

#

diet cola has it like that for some reason

lethal stratus
#

voucher tags work, jokers dont move at all

red flower
#

wdym

lethal stratus
#

need to give them a message is all

red flower
#

yeah

lethal stratus
#

what message should i use

gusty iron
#

how would i make something print into debugplus?

sturdy compass
#

print(message)

lethal stratus
#

i dont know what to make it say though

gusty iron
daring fern
lethal stratus
#

message is a placeholder 😭

sturdy compass
#

are you looking in the external console or the ingame debug console

gusty iron
sturdy compass
#

what

rapid stag
#

are you referring to debugplus

lethal stratus
#

thats not what i meant 😭

sturdy compass
#

That does not answer my question lmao

sturdy compass
gusty iron
lethal stratus
#

what are they trying to do?!?!

rapid stag
#

so, yes

daring fern
gusty iron
sturdy compass
sturdy compass
#

Then have you considered the code you're running never actually reaches the line that the print is at

gusty iron
#

no i found out where it prints

#

the command prompt

sturdy compass
quick kraken
#

What's the name of the variable for on trigger money effects?

bright axle
quick kraken
#

Like on scoring a certain card gain money

#

And where can I go about learning more stuff like this, like the names of variables I need to use, without needing to look at the example mod or the code of other mods?

rapid stag
bright axle
sturdy compass
#

I’m aware

red flower
red flower
sturdy compass
#

And also the fact that the dbp console is allegedly not showing the prints

rapid stag
#

my understanding is that the dbp console doesn't output everything that goes to the lovely console

#

depending on the dbp setting

#

i forget what the default setting is

red flower
#

yeah thats true but the default should im pretty sure

sturdy compass
#

I definitely didn’t have to change anything for stuff to print Emoti_Shrug

rapid stag
#

...i see the confusion now cirDerp

bright axle
#

any idea why if context.main_scoring and context.cardarea == G.play then
doesnt trigger bc i have logs and they dont show up

sturdy compass
#

Yeah lmao

sturdy compass
gusty iron
#

how do i get the current game round?

bright axle
#

in generating 4 cards

#

but none gets generated

#

and no logs show

undone maple
#

how do i check if the card played is an ace of spades? i know to check the played cards rank but is there a way to narrow it down to spades

gusty iron
bright axle
undone maple
#

that'd help

#

thank you :)

bright axle
#

im asking

daring fern
bright axle
#

and could you do card.front=="S_A"?

daring fern
gusty iron
#

jippie

daring fern
# gusty iron

If that’s the effect of the deck why did you need to check what deck was being used?

gusty iron
#

i put it into a hook

daring fern
gusty iron
#

so if i didnt do the deck check

#

it would activate for every deck

daring fern
gusty iron
#

.

#

im going to fall over

#

i mean

#

it works though so

#

i guess im not complaining

gusty iron
daring fern
gusty iron
#

oh my god so peak

#

thatll make this next joker im making so easy

#

though how do i check the rarity of a joker

next timber
#

im trying to add my mod to bmm, but for some reason the /archive/refs/heads/main.zip for my repo is a 404? for other repos it gives the source code zip for the latest release so idk why its not working on mine

sleek siren
#

How would I be able to add my own collab face cards texture with steamodded?

sleek siren
#

Thanks! ^^

undone maple
#

struggling so hard to word this, need more opinions about it

gusty iron
#

If played hand has 2 cards
and a spade; destroy all
non-spades, and retrigger all
spades.

#

how do i check the order of the jokers?

undone maple
red flower
sleek siren
daring fern
gusty iron
quick kraken
#

What's the context name for skipping a blind and for reaching required score?

daring fern
red flower
gusty iron
quick kraken
red flower
#

where and how are you using it

quick kraken
#

basically I need something to happen to a scaling value when skipping

#

and I also need somehting to happen to that scaling value at end of round

red flower
#
if context.skip_blind then
    card.ability.extra.value = ...
end
if context.end_of_round and context.main_eval and context.game_over == false then
    card.ability.extra.value = ...
end
gusty iron
#

last question, how do i get the rarity of a joker?

red flower
#

card.config.center.rarity

quick kraken
red flower
#

yes

quick kraken
#

ok...

#

then I don't get how my earlier test didn't work

#

wait

#

Does this not go in calculate()?

red flower
#

yes

quick kraken
#

it does?

red flower
#

yeah

quick kraken
#

then that is mighty weird how it didn't work with the skip earlier

red flower
#

no idea

quick kraken
#

Well I'm running the game testing the joker and neither works

cedar island
#

how do I factor retriggers into #context.scoring_hand?

red flower
red flower
cedar island
#

probably not

quick kraken
#
    key = "manualTest",
    loc_txt = {
        name = "Instruction Manual",
        text = {
            "At end of round,",
            "Gains {C:mult}+Mult{} equal to {C:chips}remaining hands{}",
            "Resets if blind is skipped",
            "{C:inactive}(Currently {C:mult}+#1#{C:inactive} Mult)"
        }
    },
    config = {extra = { mult = 0}},
    rarity = 2,
    atlas = "Jokers",
    pos = {x = 3, y = 0},
    cost = 4,
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.mult } }
    end,
    calculate = function(self, card, context)
        if context.joker_main and not mult == 0 then
            return {
                mult_mod = card.ability.extra.mult,
                message = "+" .. card.ability.extra.mult,
                colour = G.C.MULT
            }
        end
        if context.skip_blind then
            card.ability.extra.mult = 0
            return {
                message = "Reset",
                colour = G.C.MULT
            }
        end
        
        if context.end_of_round and context.main_eval and context.game_over == false then
            card.ability.extra.mult = card.ability.extra.mult + G.GAME.current_round.hands_left
            return {
                message = "Next step!",
                colour = G.C.CHIPS
            }
        end
    end
}```
red flower
#

do the messages not appear at all?

#

also what version of smods do you have

quick kraken
#

Not at all, and the values don't change

quick kraken
#

do I really just need to update smods?

red flower
#

nah i just wanted to see if you had a really old one

wintry solar
#

not mult == 0 isn't correct

quick kraken
bright axle
red flower
quick kraken
#

The upgrade part somehow works now after updating smods and restarting the run

red flower
#

amazing

quick kraken
#

And the skip blind too

gusty iron
#

so im running a chance at the end of each round, but for some reason, it runs once for every single card in my hand

gentle rain
#

currently trying to decipher how blueprint/brainstorm work

gentle rain
#

is it possible to copy more than one joker at once

#

and regardless of the jokers position, instead based off its name

#

currently trying to implement "copies the ability of food jokers"

brisk rose
tepid crow
#

there is definitely a gameplay difference between copy and retrigger though

#

I've considered nerfing one of my jokers to be copy instead of retrigger

#

(I just couldn't get it to behave properly)

gentle rain
sleek siren
#

For some reason my deck skin isn't showing anything for the cards, how could I fix this?

brisk rose
bright axle
#

how can i add a created card to the deck?

tepid crow
#

they* mean for other jokers

#

pretty sure you should be able to set context.blueprint yourself though

gentle rain
#

not he/him!!

brisk rose
gentle rain
#

thankyou

red flower
red flower
#

then use the check i did in that code

gusty iron
#

oh

#

that

#

worked

#

thanks

#

!!

sleek siren
cedar island
#

really basic question but I don't understand what the Smods doc for calculate functions tells me. I understand the context check statements, but I don't understand what the variables below them do. What are they and how do I use them?

gentle rain
red flower
red flower
gentle rain
#

if theres mods that use it i could certainly peek off of them

gentle rain
red flower
lethal stratus
#

how do i make this lol

last sentinel
#

are context.before and context.individual mutually exclusive?

cedar island
tepid crow
hasty mist
#

is it possible to make boss blinds skippable

crisp coral
#

if you add logic to boss blind skipping, maybe

hasty mist
#

wdym by that

crisp coral
#

there's no logic for skipping boss blinds because the game never expects you to do so

scarlet thorn
#

I remember seeing snippets of conversations about this but, lovely patching another mod like =[SMODS XXX "file.path"] doesnt work on mac, right?

scarlet thorn
formal parrot
#

Yes

red flower
last sentinel
#

Yes

shrewd cobalt
#

Am doing this right? Trying to have a joker retrigger lucky cards only if theres at least one still held in hand unplayed

keen tiger
#

what can you pass into the (e) parameter in button fns to make them work?

#

it cant be nil and its something related to ui elements

red flower
#

either make it a field in card.ability.extra or do a loop on G.hand directly in repetition

shrewd cobalt
#

Alright, sounds good, thanks a lot!

undone maple
#

how will i destroy non-spade cards?

#

doesnt seem to trigger

#

the retrigger works fine - destroying doesnt

red flower
#

it needs to be in context.destroy_card

undone maple
red flower
#
if context.destroy_card and context.cardarea == G.play then
    -- check if it's not spades and destroy it
end
undone maple
#

thats helpful

#

thank you

keen tiger
#

what ui element do i pass into functions taking the e argument to avoid a crash

red flower
#

the UIElement of the button im guessing

keen tiger
red flower
#

whats the function?

rustic swallow
#

i made a joker that gives 2 free rerolls if you have $25 or more, but its triggering multiple times as long as i have over $25, does anyone know how to fix it?

undone maple
wooden nexus
#

How do i make something shiny like gold stake?

#

or spectrals

red flower
red flower
#

it's at the top

red flower
undone maple
#

just when i played the hand

red flower
#

oh yeah sorry

#

replace other_card with destroy_card

keen tiger
hasty mist
#

im trying to migrate some hardcoded code into a function for ease of use, what's wrong here?

red flower
keen tiger
#

what is e

#

how do i find e

undone maple
keen tiger
#

is it GAME.E or

red flower
#

the game uses G.blind_select.UIRoot.children[1].children[1].config.object:get_UIE_by_ID('select_blind_button')

#

i hate UI

unkempt thicket
#

Speaking of UI (Art pending)

brisk rose
#

But I think that's built in

#

Idk what is called though

gusty iron
#

how would i make a consumable/consumable pack only be available when you have a certain deck?

red flower
#

(change small for the type of blind)

brisk rose
gusty iron
brisk rose
gusty iron
desert ore
#

looking at what message to have on my joker when it adds mult to itself, and it turns out it's very inconsistent

#

green joker displays "+1 Mult", Spare Trousers displays a red "Upgraded!" wee displays a yellow "Upgraded", ride the bus displays nothing

urban wasp
#

is there a way to make the color of the text of card evals a specific color?
like, for example, i would like the bg to be dark_edition and the text to be edition

urban wasp
desert ore
#

that's what I was going to go with but it's odd how it's not consistent

gusty iron
urban wasp
#

if it's chips, blue "Upgraded!", and if it's both or none, yellow "Upgraded!"

rapid stag
#

what the upgraded

gusty iron
#

i dont have enough space for 100 so i have to improvise

urban wasp
#

PEAK

wooden nexus
#

how do i do this?

#

(The shine)

unkempt thicket
#

Drawstep

gusty iron
#

how do i make custom cards using smods?

wooden nexus
#

I don't know how to set that up lol

undone maple
#

trying to check if the played hand contains a scored spade card. trying to do it the way superposition does to check if theres a scoring ace. whats causing this?

unkempt thicket
gusty iron
brisk rose
gusty iron
#

these ones dont have suits

#

just the respective chip and multiplier upgrades

unkempt thicket
#

So like enhancements?

brisk rose
#

Do you want it programmed as an enhancement?

gusty iron
#

would it make them separate cards?

brisk rose
red flower
brisk rose
urban wasp
wooden nexus
brisk rose
urban wasp
#

so, like, when a joker scores

red flower
# undone maple

you should do that inside both context.repetition and context.destroy_card because context.scoring_hand doesn't always exist

wooden nexus
#

Also I think i messed something up

#

I'm hiding what the actual seal is

unkempt thicket
wooden nexus
#

ok. So how do i fix this then?

red flower
#

card instead of self

wooden nexus
#

Got it

#

Seal is still not shiny

red flower
#

idk if that check will work never used drawstep for seals

urban wasp
#

maybe i need to create a "key" that has my attributes?

#

i don't exactly know how to do that though

gusty iron
#

but lemme see if i can do that

brisk rose
unkempt thicket
wooden nexus
#

alright, i'll try that

undone maple
brisk rose
smoky token
#

anyone able to tell me how to combine all my sprites into an atlas

urban wasp
#

i think xchips is handled by smods now

#

er

#

talisman?

#

something like that

brisk rose
#

Or they did a couple months ago

urban wasp
#

could you give me an example?

brisk rose
#

Familiar

#

I think

paper zealot
regal ether
#

is there a list of contexts documented anywhere i can look at?

#

things are probably named pretty intuitively but i just dont wanna guess

red flower
#

there are some undocumented ones however

regal ether
#

oh

gusty iron
#

last question, how do i set the starting cards in a deck?

red flower
#

oh wait no

#

check cardarea == 'unscored' alongside G.play

brisk rose
urban wasp
gusty iron
brazen tusk
urban wasp
#

i don't think it's possible

wooden nexus
#

Welp i made it worse

#

Not only is my seal not shiny, I made gold unshiny

unkempt thicket
#

Did you use the same key?

wooden nexus
#

I used my previous one

#

should i have?

unkempt thicket
#

No, try 2 more than that order, so order 32

undone maple
gusty iron
undone maple
#

how do i check both

wooden nexus
#

Okay I'm clearly breaking the game somehow

#

now every seal but mine is shiny

red flower
rapid stag
#

bump cirBox

wooden nexus
#

Just gonna show the grayscaled template seal i have

scarlet spire
#

oh

brisk rose
scarlet spire
#

I know the issue

#

the shiny shader modulates itself based on the saturation of the base image

#

a greyscale seal is going to have a much less noticeable shine than something that's colorful

unkempt thicket
#

Your code should look similar to this, though i would use the key instead of the name of the seal

brisk rose
unkempt thicket
scarlet spire
#

I think there's still something slightly there if it's fully gray, but barely

brisk rose
#

Also... that's a shitty shader. Makes silver a lot harder than it should be to pull off

wooden nexus
#

Just a side thing, sending the picture makes it difficult for me to put into the program y'know. lol

undone maple
scarlet spire
#

on vouchers, the outlines and stuff not being as reflective retains artwork contrast even when the glare is right on top of it

#

it is a serious nightmare for my silver stake though, I still need to figure out a workaround for that

red flower
scarlet spire
#

because right now it's the Grey Stake

wooden nexus
#

I changed the color to test

#

but it shiny

undone maple
wooden nexus
#

Yeah I see what you mean now about lower saturation = harder to see shiny

undone maple
#

ill remove it anyways

red flower
undone maple
#

thank you for your help

red flower
#

oh then the full_hand thing was correct lol

desert ore
#

should I keep this phrased as is to keep in line with acrobat/dusk, or should I change it to "when 0 hands remaining" to make it a little more clear while still kind of being in line with mystic summit?

iron haven
#

How do I make a card retrigger?

#

really

lethal stratus
lethal stratus
late basin
# iron haven How do I make a card retrigger?
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.

lethal stratus
#

then a return in the calculate segment

lethal stratus
#

or specifically
with 1 hand remaining, this joker gains mult equal to 4*Max hands

desert ore
#

black deck doesn't need any more nerfs lol

iron haven
desert ore
#

no, you can retrigger playing cards

lethal stratus
#

deck*

iron haven
lethal stratus
#

Red seal for example

#

or hack

late basin
desert ore
#

^

wooden nexus
#

So I have a weird question: I want to do something like Cryptid where it duplicates the card, but i want it to remove the seal

#

Is that difficult?

unkempt thicket
#

Not really

wooden nexus
#

For reasons

unkempt thicket
#

btw how do you make it one solid code thing

wooden nexus
#
```
#

instead of `

late basin
#

I've got a problem in my code: I'm trying to make it so my joker gains X0.5 mult when a wild card is destroyed, and it works (kind of), but it doesn't register both cards when 2 wild cards are destroyed at once -- it just counts it as 1 card destroyed. Here's my code:

    
        if context.remove_playing_cards then 
            
            local wild_cards = 0
                for k, val in ipairs(context.removed) do
                    if val:is_suit() then wild_cards = wild_cards + 1 end
                
                end
                if wild_cards > 0 then
                    card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_mod
                    return {
                        message = localize('k_upgrade_ex'),
                    }
                end
                
        elseif context.cardarea == G.jokers and context.joker_main and card.ability.extra.Xmult > 1 then
            return{
            
                Xmult_mod = card.ability.extra.Xmult
            }
        end
    end```
iron haven
#
test
#

line 559

if context.other_card:get_id() == 9 then
wooden nexus
#

Caused my game to overflow and almost crash my PC

#

okay it works now, thanks

iron haven
iron haven
red flower
rustic swallow
#

how do you make a joker do the shaking thing when its active

red flower
#

juice_card_until

regal ether
#

trying to make a seal that stops the card from being destroyed, then removes the seal, and i am making bullshit i think

lethal stratus
#

how do i write the calculate here

sturdy compass
#

What does that even entail 😭

lethal stratus
#

ignore my awful description

#

basically means beating the hand with a score higher than the requirement increments the joker by 0.5x

regal ether
#

🗣️🔥

brisk rose
#

Which is how it's normally phrased

#

But I see the appeal focusing on the fire ngl

lethal stratus
#

focusing on the fire is cool, wording it is not 😭

brisk rose
regal ether
#

mfw "table index is nil" ???

iron haven
lethal stratus
iron haven
#

oh code?

brisk rose
iron haven
#

@red flower need the code?

regal ether
#

OH

brisk rose
#

I need to learn though

regal ether
#

well before i was using the function set_seal

#

now im just setting the seal variable directly lol

brisk rose
#

Ah makes sense

#

God I wish I kept some working coding knowledge since college

#

But on the plus side my miniscule python and c++ knowledge is now nuked, so can't interfere Wyeth learning lua

karmic arch
peak obsidian
#

how would i code a blind that checks for the most common suit in the deck and debuffs it

iron haven
#

I'm just waiting.

brisk rose
tall wharf
#

me when godot

lethal stratus
#

😭

tall wharf
#

G.GAME.current_round.current_hand.chips or something

brisk rose
#

Closest I could find weirdly

#

Seemed like an obvious idea

lethal stratus
iron haven
tall wharf
#

i don't remember the exact argument but you can dig the game's code

regal ether
#

ok i feel like i'm fundamentally misunderstanding context.destroy_card because it's executing the code when i just play a hand with my seal

lethal stratus
#

can i see your seals code?

regal ether
#

that on the left is the seal's calculate

#

what more r u looking for

rustic swallow
#

does anyone know why this doesnt trigger the chips when those ranks are played

thorn ridge
#

how do i take ownership of stuff from the vanilla game

rugged pier
#

guys

#

what context does blueprint/brainstorm run in

high sinew
rugged pier
#

i need to run a joker that acts like a blueprint/brainstorm

#

since the ability of other jokers could run in multiple contexts

#

what context would a joker like blueprint run in

high sinew
#

you wanna make a joker that has brainstorm or blueprint effect?

#

they are diff

rugged pier
#

yeah

#
calculate = function(self,card,context)
        if context.setting_blind then
            local jokerList = {}
            for i,v in ipairs(G.jokers.cards) do
                if v.ability.name ~= 'TenSoon' and v.config.center.blueprint_compat then
                    jokerList[#jokerList + 1] = v
                end
            end
            if #jokerList > 0 then
                card.ability.extra.selectedJoker = pseudorandom_element(jokerList,pseudoseed('tensoon'))
            end
        end
        local other_joker = card.ability.extra.selectedJoker
        if other_joker 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
#

i have this so far

#

but this throws a stackoverflow error since the joker is calculated infinite times

#

i need it to calculate once and use it in appropriate context

high sinew
#

what is the joker do exactly gotta know purpose of it

#

intention of this joker

rugged pier
#

copies a random joker at the start of a blind

#

its like BP/BS except its not positional

#

it copies at start of blind and remains constant till end of blind

high sinew
#

if v ~= card and v.ability and v.ability.name ~= 'TenSoon' and v.config and v.config.center and v.config.center.blueprint_compat then
table.insert(jokerList, v)
end

#

first issue i notice

#

use this

#

and for the Jokerlist > 0
card.ability.extra = card.ability.extra or {}
card.ability.extra.selectedJoker = pseudorandom_element(jokerList, pseudoseed('tensoon' .. G.GAME.round_resets.blind))
else
card.ability.extra = {}
end
end

shrewd cobalt
#

Can someone help me figure out why the foil isnt being scored here? this is in the before context

high sinew
rugged pier
rugged pier
#

that would help since events take some time maybe

#

it worked for my scoring

#
if context.before and context.scoring_hand and not context.blueprint then
            card.ability.extra.flag = true
            transform_card(context.scoring_hand[1], 'm_csmr_heightened', card.ability.extra.edition)
            return {
                message = 'Awakened!',
                message_card = context.scoring_hand[1]
            }
        end
#

transform card has the following code

#
function transform_card(old_card, center, edition)
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            old_card:flip()
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            if center then
                old_card:set_ability(G.P_CENTERS[center])
            end
            if edition then
                old_card:set_edition(edition)
            end
            play_sound("card1")
            old_card:juice_up(0.3, 0.3)
            return true
        end,
    }))
    G.E_MANAGER:add_event(Event({
        trigger = "after",
        delay = 0.15,
        func = function()
            old_card:flip()
            return true
        end,
    }))
end
gentle rain
wise crown
rugged pier
# high sinew

.. G.GAME.round_resets.blind)) what purpose does this serve?

high sinew
#

tracking blind index

rugged pier
#

it throws an error

#

but i removed it and it seems to work

#

the other issue im running into is

#

localization of the copied joker

#

it does the message on the original joker again

high sinew
#

oh it might be wrong way of doing but if it works without then shouldnt be nneeded

#

anyone see why this isnt being loaded in game? doesnt crash but isnt showing up for my collection

rugged pier
high sinew
rugged pier
high sinew
#

the variable name

#

for my cards

tall apex
#

Snacks :3

sage crater
tall apex
#

Well that’s pretty simple! What effect are you looking for?

rugged pier
tall apex
#

It’s gonna be that silly little set ability argument :3

daring fern
# sage crater

Change G.P_CENTERS.m_wild to G.P_CENTERS.m_mult or others.

sage crater
sage crater
rugged pier
tall apex
rugged pier
#

So it would be different for polychrome vs mult

sage crater
tall apex
#

Rather than set ability

sage crater
daring fern
tall apex
tall apex
high sinew
#

yes

tall apex
#

… huh

high sinew
#

just name of the consumable

tall apex
#

I’ve never thought of gum like that

high sinew
#

lol its "close enough"

tall apex
#

Valid

#

I always thought of it for like stimming

#

Monch monch

high sinew
#

but i rthink it fits the theme of my pack for snack

tall apex
#

Valid :3

high sinew
#

got the issue too 😝

rugged pier
#

and your game doesnt crash on launch right? @high sinew

#

you just dont see it loaded in?

#

^bubblegum

rugged pier
#

what was the issue?

high sinew
#

honey nut cheerioes about to go nuts

#

had = in SMODS.Consumable XD

rugged pier
high sinew
#

yee honey nut makes spades golden

#

cause theyre delicious!

sage crater
# sage crater

couple more questions about the code in this screenshot:
(for context, I've coded in python, c#, and java. I know how to code for the most part, but I don't know the intricacies of lua yet)

  • What does the local keyword before local loc_def do?
  • what are the {wildonly = true} and {x=3,y=1}?
  • I assume the SMODS.Deck:new{} is instantiating a new deck that this file is deciding to call Wild deck; is the second string "wildDeck" the ID of the deck or something?

thanks in advance

stiff locust
rugged pier
#

i thought local is a variable defined within that scope

unborn bay
#

local variables are only available in the scope you're in

rugged pier
#

^