#💻・modding-dev

1 messages · Page 312 of 1

rough furnace
#

Oh just like one time?

dapper sun
#

yea i just wanna get its key

#

it's for a consumable

gusty peak
#

G.jokers.highlighted[1].config.center.key

rough furnace
#

If you have DebugPlus you can run eval dp.hovered.config.center in the console

gusty peak
#

i thinkkkk

dapper sun
gusty iron
#

If I did do this, I had some cool ideas for new hands.

Flush Six - Six cards of same suit and rank
Fuller House - 4 of a Kind + 2 of a Kind
Flush Full - Fuller House, but all of the same suits
Six of a Kind - Six cards of same rank
Two Three - Two three of a kinds

gusty peak
#

give me a few minutes

gilded narwhal
#

okay i got it ty

rapid stag
#

bump

sonic cedar
#

didn’t work 💔

digital niche
#

?

gusty peak
# gusty iron If I did do this, I had some cool ideas for new hands. Flush Six - Six cards of...
local orig_add_to_highlighted = Card.add_to_highlighted
function Card:add_to_highlighted(card, silent)
        local cardio = find_joker(AST.JOKER.CARDIO.KEY)
        local old_highlighted_limit = self.config.highlighted_limit
        if self.config.type == 'hand' and next(cardio) then 
            for i=1,#cardio do
                self.config.highlighted_limit = self.config.highlighted_limit + cardio[i].ability.extra.extra_discards
            end
        end

        orig_add_to_highlighted(self, card, silent)
        self.config.highlighted_limit = context.old_highlighted_limit
end

that works for discards, HOWEVER, you might will have to also hook into G.FUNCS.can_play function cause it cheks if there are less then 5 highlighted cards

#

cause thats what it does

#

makes the button not work if you have 0 or more than 5

gusty peak
lucid owl
#

big fan of this guy

gusty peak
#

damn

gusty iron
#

how would i make a text color green if a variable was true, and red if it was false?

gusty peak
#

thatsssss complicated af actually, ui stuff is beyond my understanding

#

there no easy way of doing afaik

gusty iron
#

so would something like this work? (minus the thing i just asked)

gusty peak
#

looks good, but put {} after the closing bracket

lucid owl
gusty iron
gusty peak
#

you could return different values in loc_vars depending on weather or not you have the turtle

gusty peak
#

ye

lucid owl
paper zealot
dapper sun
#

how do i make using set_ability

  1. play the card flip animation like when adding an edition/enhancement
  2. update the sell cost
lucid owl
#

like, base notepad?? not notepad++?? 😭

gusty iron
paper zealot
gusty peak
dapper sun
#

ah

lucid owl
gusty peak
#

you do all that in consumable use function

lucid owl
#

coding in notepad is just making the experience a lot more difficult

gusty iron
gusty peak
#

like its super worth it

lucid owl
gusty iron
#

i mean i technically do have vscode

lucid owl
#

stubbornness for the most inefficient possible code editing tool 😭

gusty iron
#

its just that its vscode 2017 (i make ktane mods too)

gusty peak
#

its visual studio not vscode

gusty iron
#

oh

lucid owl
gusty peak
#

vscode is like light code editor

#

and has plugins

gusty iron
#

also one more thing

#

for next(find_joker(<key>))

paper zealot
#

Starts up a hell of a lot faster than Visual Studio too, if that's what's putting you off

gusty iron
#

is <key> a string value

gusty peak
#

yes

gusty iron
#

okay peak

digital niche
#

how do i refer to this in a string?

gusty peak
#

for jokers its gonna be "j_<your_mod_prefix>_<joker_key>"

gusty iron
#

so

#

j_JCJ_j_turtle?

gusty peak
#

if in SMODS.JOKER the key = j_turtle then ye

gusty iron
#

okay peak

gusty peak
gusty iron
#

how would i localize XMult?

gusty peak
#

{X:red,C:white}text{}

gusty iron
#

no im ean

#

message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.Xmult } },

#

this

#

but for

gusty peak
#

a_xmult

gusty iron
#

okay peak

sonic cedar
#

Now that my computer is running better, I'm sending ss of what the sticker is looking like, including the localization entry. Why doesn't it load in?

gusty peak
#

badge color also looks weird

sonic cedar
#

can you not do it like that

gusty peak
#

HEX("000000")

gusty iron
#

i love using pantone 448 c as my mod's badge color

sonic cedar
#

ok so it HAS to be hex

paper zealot
#

I don't see why it wouldn't work, HEX just returns an array of 4 numbers. They should be equivalent

gusty peak
#

actually...

gusty peak
#

hex just does that

sonic cedar
#

oh ok

gusty peak
sonic cedar
#

no

#

nor in my mod’s additions

gusty peak
#

is it in a sperate file?

sonic cedar
#

yeah it i—i didn’t load the file.

gusty peak
#

yeaaaaaaaaaa

#

mooooodd

sonic cedar
#

do i have to load the toml file too

gusty peak
#

no

sonic cedar
#

no i don’t. what am i talking a—yeah

#

it crashed…

#

this is a new one

gusty peak
#

is the file in x1 and x2 called that?

sonic cedar
#

the file in 2x doesnt exist because im an idiot

#

ok THIS TIME for sure

#

there it is! thank you guys 😭

gusty peak
#

yay

sonic cedar
#

do stickers auto tooltip or no

gusty peak
#

youll need

misc = {
  labels = {
    <mod_prefix>_<sticker_key> = {
      "Text"
    }
},

and

        Other = {
            <mod_prefix>_<sticker_key> = {
                name = "",
                text = {
                    "",
                    ""
                }
            },
#

in localization file

sonic cedar
#

and that’ll make the sticker’s description show up next to the joker?

gusty peak
#

yes

sonic cedar
#

got it

gusty iron
#

okay so small issue

when the 2 jokers are paired, they say "false" until you play, is there anyway to update the text constantly?

gusty peak
#

show loc_vars

gusty iron
#

loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.mult,
card.ability.extra.Xmult,
card.ability.extra.turt,
}
}
end,

gusty peak
#

i think it should request that eveyt time you hover over it

gusty iron
gusty peak
#

no i think it does that by default

gusty iron
#

no it

doesnt

gusty peak
#

when is card.ability.extra.turt set?

#

if its set in the calculate function then that explains it

gusty iron
#

yeah i figured it out

gusty peak
#
loc_vars = function(self, info_queue, card)
        return {
            vars = {
                card.ability.extra.mult,
                card.ability.extra.Xmult,
                #find_joker(<turtle_id>) > 0,
            }
        }
    end,
gusty iron
#

ill be working on the 6 joker soon

gusty iron
gilded narwhal
#

what a funny reference

gusty iron
#

okay nevermind the if didnt work

gusty peak
#

ye it shouldnt be in calculate

gusty peak
gusty iron
#

okay i fixed it

gusty peak
#

also so many people from ktane move over to balatro modding lmao

rustic swallow
#

does anyone know how to make a joker that gives chips when a suit is scored (like arrowhead)

gusty iron
gusty peak
sonic cedar
#

like how jokers do j_ do stickers use s_?

gusty peak
#

its called a hook, were basically making a copy of old function, and appending our own code

gusty iron
gusty peak
#

and calling the old function inside if our overwritten one

gusty iron
#

so do i need to replace AST.JOKER.CARDIO.KEY with the key of my joker

gusty peak
#

yesss

gusty iron
#

okay peak

#

j_JCJ_j_andrew it is

gusty peak
#

and add stuff to config extra cause it has some

#

extra_discards

#

rename it to your liking

gusty iron
#

so:

local orig_add_to_highlighted = Card.add_to_highlighted
function Card:add_to_highlighted(card, silent)
        local cardio = find_joker("j_JCJ_j_andrew")
        local old_highlighted_limit = self.config.highlighted_limit
        if self.config.type == 'hand' and next(cardio) then 
            for i=1,#cardio do
                self.config.highlighted_limit = self.config.highlighted_limit + cardio[i].ability.extra.extra_cards
            end
        end

        orig_add_to_highlighted(self, card, silent)
        self.config.highlighted_limit = context.old_highlighted_limit
end

with config being:

    config = { ability = { extra_cards = 1 } },
```?
gusty peak
#

yeee

gusty iron
#

jippie

gusty peak
#

not ability

#

extra

thin anchor
#

is this right for a consumable that changes the edition of 1 to 2 selected cards

gusty iron
gusty peak
#
local orig_can_play = G.FUNCS.can_play
G.FUNCS.can_play = function(e)
-- do your stuff

end
gusty iron
#

do i legit just

#

change 5 to 6

faint yacht
#

I have it as such, if this helps any.

local canplayref = G.FUNCS.can_play
G.FUNCS.can_play = function(e)
    canplayref(e) -- execute original first before we do anything.
    if #G.hand.highlighted <= G.hand.config.highlighted_limit then
        if #G.hand.highlighted >= 52 then -- Cryptid?
            e.config.colour = G.C.EDITION
            e.config.button = 'play_cards_from_highlighted'
        elseif #G.hand.highlighted >= 10 and #G.hand.highlighted < 52 then -- 2x the base and more.
            e.config.colour = G.C.DARK_EDITION
            e.config.button = 'play_cards_from_highlighted'
        elseif #G.hand.highlighted > 5 and #G.hand.highlighted < 10 then -- more than base.
            e.config.colour = G.C.PURPLE
            e.config.button = 'play_cards_from_highlighted'
        end
    end
end
gusty iron
#

okay peak so just change it to 6

gusty peak
#

it just might brak compat with mods that also hook into that function

#

soooo

#

wait

rustic swallow
gusty peak
#

i know how

gusty iron
digital niche
gusty peak
faint yacht
#

Best use if next(SMODS.find_card('j_modprefix_key')) then.

gusty peak
gusty iron
#

so would this work?

local orig_add_to_highlighted = Card.add_to_highlighted
function Card:add_to_highlighted(card, silent)
        local cardio = find_joker("j_JCJ_j_andrew")
        local old_highlighted_limit = self.config.highlighted_limit
        if self.config.type == 'hand' and next(cardio) then 
            for i=1,#cardio do
                self.config.highlighted_limit = self.config.highlighted_limit + cardio[i].ability.extra.extra_cards
            end
        end

        orig_add_to_highlighted(self, card, silent)
        self.config.highlighted_limit = context.old_highlighted_limit
end

local orig_can_play = G.FUNCS.can_play
G.FUNCS.can_play = function(e)
if #find_joker("j_JCJ_j_andrew") > 0 then
if #G.hand.highlighted <= 0 or G.GAME.blind.block_play or #G.hand.highlighted > 6 then
        e.config.colour = G.C.UI.BACKGROUND_INACTIVE
        e.config.button = nil
    else
        e.config.colour = G.C.BLUE
        e.config.button = 'play_cards_from_highlighted'
    end
  return
end

orig_can_play (e)
end
gusty peak
#

ye try that

faint yacht
#

Maybe don't return in that particular hook.

gusty peak
#

nah you have to return so it doesnt call the original

faint yacht
#

If that's intended, sure then.

gusty peak
#

the original function doesnt return anything

gusty iron
#

still doesnt let me select more than 5 :(

faint yacht
#

-# I've shared what worked, that's my two cents in.

sonic cedar
gusty peak
gusty peak
sonic cedar
#

i have a joker that does that however it's not meant for playing more than 5 cards, just selection/discard

gusty peak
gusty iron
#

okay replaced

#

lets

#

pray

#

I STILL CANT SELECT 6 WHAT

#
local orig_add_to_highlighted = Card.add_to_highlighted
function Card:add_to_highlighted(card, silent)
        local cardio = find_joker("j_JCJ_j_andrew")
        local old_highlighted_limit = self.config.highlighted_limit
        if self.config.type == 'hand' and next(cardio) then 
            for i=1,#cardio do
                self.config.highlighted_limit = self.config.highlighted_limit + cardio[i].ability.extra.extra_cards
            end
        end

        orig_add_to_highlighted(self, card, silent)
self.config.highlighted_limit = old_highlighted_limit
end
#

like

#

is anything wrong with this???

gusty peak
#

omg im stupidddd

#

its not Card

#

its CardArea

gusty iron
#

...

gusty peak
#

CardArea.add_to_highlighted

gusty iron
#

so this?

gusty peak
#

yes

gusty iron
#

okay

gusty peak
#

im sorry

gusty iron
#

if this doesnt work

#

we riot.

gusty peak
#

...

gusty iron
#

TIME TO ADD MY CUSTOM HANDS

gusty peak
#

so... also a note, this will stack, if you ahve multiple if them you can select more

#

so if you dont want that

#

you remoev the loop

gusty iron
gusty peak
#

ye in can_play but not in the add to highlighted

gusty iron
#

no i did that too

gusty peak
#

ok

#

i need to go to bed its 4 am

gilded narwhal
#

guys how would I use info_queue for seals?

gusty peak
gusty iron
#
SMODS.PokerHand({
    key = "twothree",
    chips = 50,
    mult = 6,
    l_chips = 20,
    l_mult = 3,
    visible = false, -- Change to true if you want it to appear in the compendium
    example = {        
        { 'S_3', true},
        { 'H_3', true},
        { 'C_3', true},
        { 'D_2', true},
        { 'S_2', true},
        { 'H_2', true},
    },
    loc_txt = {
        name = "Two Three",
        text = {
            "Two sets of {C:attention}Three of a kind{}",
        },
        description = {
            "Two sets of Three of a kind",
            "Like two pair, but better!"
        }
    },
evaluate = function(parts, hand)
    local threes = parts._3 or {}

    -- Check if there are at least two distinct 3-of-a-kinds
    if #threes >= 2 then
        -- Combine the two 3-of-a-kinds
        return { SMODS.merge_lists(threes[1], threes[2]) }
    end

    return {}
end

})

so like, this works in terms of scoring, but it doesnt play through the cards, any help?

digital niche
#

how do i refer to this in a string???

gusty peak
#

Shat do you mean?

#

What*

digital niche
#

like, this is a list of all the "ore enhancements", and i have a joker that adds a ore enhancement everytime a bblind is selected

#

how do i add this ore list to the string?

gusty peak
#

In lua concatination operator is ..

gusty iron
#

yeah

#

use ..

#

so like

#

1.." hi" would return

#

1 hi

gusty iron
digital niche
gusty iron
#

when you use .. on two strings

#

it combines them

#

so "hello ".."world!" would be

hello world!

digital niche
#

and how would it apply to what im looking for? i thought i would have to use some key for the list, im not sure how this would work?

gusty iron
digital niche
gusty iron
#

the humble table.concat():

gusty iron
#

it doesnt score the cards

#

it just

#

multiplies the two numbers together

digital niche
gusty peak
#

Try just putting hand into return table instead of merging

gusty iron
digital niche
gusty iron
gusty peak
#

Ye

gusty iron
#

with SMODS.hand(threes[1], threes[2])

gusty peak
#

No

#

{ hand}

gusty iron
#

oh

digital niche
gusty peak
#

Or parts._3 actually

sonic cedar
#

my sticker won’t apply to my joker,,,,,, is there a specific way youre supposed to do it i’m just missing?

gusty iron
#

would hand still work

#

i just realized

gusty peak
#

Hand woukd work but if something allows you to select 7 cards it will score every card

gusty iron
#

Six of a Kind and Flush Six are gonna be hectic to code

#

so what would i do for fuller house\

#

Four of a Kind + Two of a Kind

gusty peak
#

In some mods its called a mansion

gusty iron
#

meh

#

would i like

#

local j = SMODS.merge_lists(four, pair)
return{j}?

gusty peak
#

I think so, honestly never tried adding a hand

gusty iron
#

i think what i need to do is call each card individually

sonic cedar
#

adding

#

is that also why the badge shows up as error?

gusty peak
#

No youre probably missing a localizarion entry

#

Or typoed a key in there

sonic cedar
#

all i have is the badge color so yeah i’m missing an actual entry

#

how do i link it to the sticker?

#

cause yeah i have the sticker’s name and description but what about its badge

sonic cedar
#

oh that’s for the badge too? not just the tooltip

gusty peak
#

label is for badge

sonic cedar
#

ohhhhhhhhhhh that’s why

#

ok thanks

#

adding and then testing

native zinc
sonic cedar
gusty peak
#

Show the hook again

sonic cedar
#

one minute i have a slow pc lmao

gusty peak
#

Its <mod_prefix>_priceless

sonic cedar
#

oh i see

#

testingggg

#

it works!!

gusty iron
#
for _, pair in ipairs(parts._2) do
                if pair[1].base.id ~= four[1].base.id then
                    return {SMODS.merge_lists(four, pair)}
else
        return {}
                end

i think this isnt working

steady smelt
#

hypothetically do straight work straight out of the box with ranks above king? like if i were to add a rank 14 would it automatically work as a rank above kings for straights or do I have to add that functionality

steady smelt
#

i assumed they were 1 and hardcoded to work with kings instead of vice versa

#

question still stands though, like if I added cards with value 14 15 16 could i make a straight with them and K Q without changing anything else?

gusty iron
steady smelt
#

see the problem with that is that's not what i'm doing and it's harder to tell what it's actually doing with my thing so i'm not sure it'll actually work or not but we do a little debugging

proud moon
#

how would i trigger a repetition on the first scored card of a certain enhancment?

faint yacht
#

What is the source of repetition?

proud moon
#

the joker itself, it retriggers the first scored card with a certain enhancment

tall wharf
#

and prev

faint yacht
proud moon
#

no, the first card with the enhancement that is scored

faint yacht
#

You'd probably have to iterate over the scoring hand and store said card somewhere, then reset after hand is played.

proud moon
#

alright thats what i was afraid of doing lol

#

because i dont know how to iterate in lua yet, but its a single search away

faint yacht
#

-# Steel example.

for i = 1, #context.scoring_hand do
  if SMODS.has_enhancement(context.scoring_hand[i], 'm_steel') then ... end -- You could store the card in the Joker itself temporarily.
end
gusty iron
#

am i the first to do this

tepid crow
gusty iron
#

oh

proud moon
#

waot

#

is it break

gusty iron
#

heres all the hands i have so far (+ Three pair)

faint yacht
proud moon
tender ermine
#

I already posted this but I kinda want some more feedback for balancing purposes.
What are yall’s thoughts on a joker (rare maybe legendary) that retriggers planet cards once for every 10-20 dollars you have. Be honest with feedback

proud moon
tender ermine
proud moon
#

planet cards are super powerful

stark geode
#

Id look into how that works if I were you

gusty iron
#

i feel like those are all the hands i want to add

#

just:

3 + 3
4 + 2
2 + 2 + 2
6

stark geode
#

?

gusty iron
#

and then flushes

gusty iron
stark geode
#

Ah

stark geode
gusty iron
#

it also allows some synnergy with the one that scores every card

#

you get 1 extra card to play around with

#

but overall im really happy with how this turned out

digital niche
#

how do i add the animation of the card going to the deck when created? like in the marble joker?

tepid crow
#

can't you just... copy what marble joker does?

digital niche
#

in my defense i have 2 neurons and both are fighting for thr third place of best one

tepid crow
#

understandable, have a great day

digital niche
#

so i looked in the marble joker code but nothing about animation

rapid stag
#

bump

shut crater
#

how to check if in game vs in menu in joker's update function? game crashes because of trying to access G.jokers

faint yacht
#

if G.jokers and ...

celest aspen
#

anyone know what the syntax would be to have the joker created by create_card be eternal? I've got:
local card = create_card('Joker', G.jokers, nil, nil, nil, nil, 'j_TYN_explodedJoker', nil, nil, nil, 'eternal')

but its only making the joker itself without adding the eternal sticker

shut crater
#

I don't think the last parameter of create_card works (I couldn't get it to work).

Instead I did:

local new_card = SMODS.add_card({ key = joker_key })
SMODS.Stickers['sticker_key']:apply(new_card, true)
faint yacht
#

SMODS.add_card({ key = 'j_TYN_explodedJoker', stickers = { "eternal" } })

shut crater
#

can someone give me a quick primer on how cards are moved around on the screen?

#

and what functions one might call to move cards around

wooden nexus
#

working on stuff for a mod project

faint yacht
digital niche
# faint yacht

im working in something similar but im not sure how id do, its a tarot card that you select 2 cards with enhancements and it fuses both cards into one card based on the enhancements they had

proud moon
faint yacht
#

I... had to reference one of my older projects to remember how I did this sort of thign before with today's adjustments... and, well, honestly not sure whether to keep this mechanic actually around?

And... I suppose so, lol. Bunco already has Copper cards... pair 3 of them with 1 Tin card and I'll need to come up with an idea for Bronze cards.

proud moon
#

ok, im trying to get the first mult card scored retrigger twice, its a joker's ability. But it isnt quite working. the issue i think im running into is i cant figure out how to retrigger only the first card that is the mult card, but the code does indeed find it.

    config = { extra = { repetitions = 2, card_found = nil, index = 0} },
    calculate = function(self,card,context)
        if context.cardarea == G.play and context.repetition and not context.repetition_only then
            for i = 1, #context.scoring_hand, 1 do
                if SMODS.has_enhancement(context.scoring_hand[i], 'm_mult') then
                    card.ability.extra.card_found = context.scoring_hand[i]
                    card.ability.extra.index = i
                    break
                end 
            end
            if card.ability.extra.card_found ~= nil and context.card == card.ability.extra.card_found then
                return {
                    message = 'Again!',
                    repetitions = card.ability.extra.repetitions,
                    card = context.other_card
                }
            end
        end
    end

anyone know what i did wrong lol?

digital niche
#

what is tthe context for checking a card in the deck?

rugged pier
digital niche
#

idk what i did wrong here

red flower
digital niche
#

oooh, what is the context? is just a reguler held in hand thing

red flower
rugged pier
#

is there a way to check the current mult in a blind? is it G.GAME.mult like there is a G.GAME.chips

faint yacht
#

hand_chips and mult are globals of currently scored chips and mult.

rugged pier
#

i thought it was just chips?

#

ive used G.GAME.chips before with the intended effect working out

crystal perch
#

i can't find reference to G.GAME.mult in the game code

faint yacht
#

G.GAME.chips is tallied up chips.

#

hand_chips and mult are the current numbers in the blue and red boxes respectively.

crystal perch
#

yeah that makes sense

rugged pier
#

how do i check tallied up mult

crystal perch
#

i don't think the game keeps tracks of that

#

unless you're talking about the red box mult?

rugged pier
#

actually wait

#

no i needed the hand chips

#

i think that should be perfect for my ability

faint yacht
#

It's just G.GAME.chips for amount of chips scored during the blind and hand_chips and mult for the currently scoring values of chips and mult of the hand.

rugged pier
#

obviously there cant be G.GAME.mult that would make no sense, im a ding dong

rapid stag
#

bump

crystal perch
#

can't spawn in my booster using debug plus nor can i find it in the in-game shop. any pointers?

rugged pier
#
if hand_chips < 0 then
                hand_chips = 0
            end
            if mult < 0 then
                mult = 0
            end
#

so i would just access it like this?

crystal perch
#

try it out

rugged pier
#

cant access that value

#

line 26 is the first if in my code

faint yacht
#

They aren't defined initially.

#

if hand_chips and hand_chips < 0 and such.

rugged pier
burnt cairn
#

im new to modding and following along with this video, having trouble getting my head around the loc_vars function? the video just types out the block of code that serves the example joker and nothing else, is there a better resource for that specifically

STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.

https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...

▶ Play video
faint yacht
burnt cairn
#

the joker im trying to make is "gives x4 mult after 30 hands have been played"

rugged pier
#

if you see in the loc_txt, specifically in the text = section, you will see stuff like #number#, the loc_vars replaces those with the stuff you want to add dynamically

burnt cairn
#

but moreso i wanna get my head around like, the syntax of the loc_vars function

crystal perch
# burnt cairn im new to modding and following along with [this video](https://www.youtube.com/...
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.

#

steamodded wiki + example jokers !

#

very good reference

burnt cairn
#

like i have no idea what return {vars = {center.ability.extra.Xmult} means

rugged pier
#

chat am i cooked

reef belfry
#

When doing a rounds remaining counter what would be better, starting_shop or end_of_round (i dont mean the technicality, more like the overall experience)

crystal perch
#

rounds start upon entering a shop

rugged pier
#

like a perishable?

#

then what he said^

crystal perch
#

the humble in-game round counter

rugged pier
# rugged pier chat am i cooked
press_play = function(self)
        local jokers = {}
        if G.jokers.cards and G.jokers.cards[1] then
            for i = 1, #G.jokers.cards do
                if not G.jokers.cards[i].debuff then
                    table.insert(jokers, G.jokers.cards[i])
                end
            end
        end
        if #jokers > 0 then
            local _card = pseudorandom_element(jokers, pseudoseed('denth'))
            if _card then
                if not _card.ability.multiplier then
                    _card.ability.multiplier = -1
                end
                _card:juice_up()
            end
            if hand_chips and hand_chips < 0 then
                hand_chips = 0
            end
            if mult and mult < 0 then
                mult = 0
            end
        end
    end,

im trying to make a joker give the opposite effect in this boss but i dont want the hand_chips and mult go below 0 for each hand played

assume that i have the multiplier set up properly already

#

what could be causing that issue

#

the if condition is only checked once on pressing play but it seems at the time of that check the value is "nil"

#

so the negative value is still happening

faint yacht
#

...actually, do Blinds even support the calculate function like other objects?

#

You could've had the < 0 prevention happening there instead.

rugged pier
#

let me check

#

i lied

#

they do

#

that should fix it

reef belfry
#

Can you have multiple lines in name = ???

#

Actually i could probably just test it

shut crater
#

for some reason unscored_cards always contains all of the cards from the full hand, any clues as to why?

#

or is there a better way to get the cards that did not score?

brisk rose
shut crater
#

does context have a field for the unscored hand?

shut crater
# daring fern What does your object do?

well eventually I want to yoink a random unscored card and place it in a special cardarea, but for now I'd be happy with moving any played, unscored cards to the consumables cardarea

#

here's the full calculate function

#

most of this does not work

daring fern
shut crater
#

no, do you think that somehow the full_hand and scored_hand arrays don't actually point to the same cards?

#

and that the timing is causing an issue?

burnt cairn
#

this crash im getting seems to imply i forgot a close bracket somewhere even though ive certainly not?
[SMODS _ "src/loader.lua"]:571: [SMODS GRATLATRO "main.lua"]:30: '}' expected (to close '{' at line 17) near 'config'

daring fern
burnt cairn
#

thats the issue, thanks

rugged star
#

next(get_straight(hand)) doesn't return anything if Shortcut is used, and I am trying to tell if the hand contains a Straight while overriding get_flush(hand)

#

SMODS modifies this function and that's why isn't it

rugged star
#

get_straight(hand) has more parameters in SMODS and the default values ignores skipping and wrapping around

reef belfry
#

do decks use d_modprefix or b_modprefix

#

for localization

faint yacht
#

b_

rugged pier
#

is there a way to show a longer lasting message on a card?

daring fern
#

How could I make a tag that puts a seal on everything in the next shop similar to the coupon tag?

daring fern
rugged pier
unborn bay
#

you'd have to look into how card_eval_status_text works for the specifics of the message function

rugged pier
#

gotcha ty

daring fern
tepid crow
#

Ah. Yeah probably

rugged pier
#

its blocking eh

unborn bay
#

delay is very much blocking yeah

tepid crow
#

yeah you might need to go through card_eval_status_text to find out how delay is used and how to make it unblocking

burnt cairn
#

what am i doing wrong here for the xmult to not be applying?

red flower
burnt cairn
#

wait catstare youre right

#

yeah nvm im just a dummy

#

got my first joker fully working! yay!

long acorn
#

what

wheres the rest of the joker

shell timber
#

elsewhere

plain apex
#

what am i doing something wrong here? it is ALWAYS hitting the chance on every single one of those cards

SMODS.Joker{
    key = "Control",
    loc_txt = {
        name = "Piece Control",
        text = {
            "Each played {C:money}Wood{} cards have a {C:green}#3# in #1#{} chance to become {C:inactive}Metal{}",
            "Each played {C:mult}Brick{} cards have a {C:green}#3# in #2#{} chance to become {C:inactive}Metal{}",
            "Idea: BoiRowan"
        }
    },
    rarity = 3,
    atlas = "Jokers",
    pos = { x = 1, y = 23 },
    cost = 9,
    unlocked = true,
    discovered = false,
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    config = { 
        extra = {
            w_odds = 3,  -- 1/3 chance for Wood to become Metal
            b_odds = 2,  -- 1/2 chance for Brick to become Metal
        }
    },
    weight = 0,

    loc_vars = function(self, info_queue, card)
        return { 
            vars = {  
                card.ability.extra.w_odds,
                card.ability.extra.b_odds,
                G.GAME.probabilities.normal
            }
        }
    end,

    -- Checks the played hand and potentially transforms Wood and Brick into Metal
    calculate = function(self, card, context)
        if context.cardarea == G.play then
            for _, played_card in ipairs(G.play.cards) do
                -- Check if the card is Wood and transform it if the odds are met
                if played_card.config.center == G.P_CENTERS.m_fn_Wood then
                    if pseudorandom('wood') < G.GAME.probabilities.normal/card.ability.extra.w_odds then
                        played_card:set_ability(G.P_CENTERS.m_fn_Metal)
                    end
                -- Check if the card is Brick and transform it if the odds are met
                elseif played_card.config.center == G.P_CENTERS.m_fn_Brick then
                    if pseudorandom('brick') < G.GAME.probabilities.normal/card.ability.extra.b_odds then
                        played_card:set_ability(G.P_CENTERS.m_fn_Metal)
                    end
                end
            end
        end
    end,
}
willow plinth
daring fern
#

How do I prevent putting a sprite on a card from lagging my game permanently?

#

Even when I remove it?

dapper sun
#

i'm trying to make a retrigger joker but nothing's happening,,

calculate = function(self, card, context)
    if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then
        return {
            message = "Again!",
            repetitions = 1,
            card = card
        }
    end
end```
daring fern
dapper sun
#

oh

#

i didn't know i needed to do that i'll try it

faint yacht
#
SMODS.current_mod.optional_features = function()
    return { retrigger_joker = true }
end
dapper sun
#

where do i put that?

#

nvmd

long acorn
#

nvm i got it to work lol

red flower
faint yacht
#

Besides Bunco's Copper... any other Copper cards I should be aware of?

reef belfry
#

Ortalab maybe

faint yacht
#

...does Ortalab have Copper enhancements?

reef belfry
#

yeah

shell timber
#

im going to make a police joker and call it Copper Card

faint yacht
#

...not finding any definitions for Copper cards from a quick search for Ortalab.

reef belfry
#

huh

#

maybe i remembered wrong

#

the one with the X0.25 mult for each one played

hushed field
#

The wiki's only got Bunco's at least, so if there's other copper cards, it's not in a notable mod

daring fern
reef belfry
#

oh my god

#

i forgot it was rusty

#

nevermind

#

the thought of the texture threw me off

hushed field
reef belfry
#

tetanus joker

#

makes steel cards give 5x mult but kills you anyway

unborn bay
#

X5 Mult
-4 hand size

shell timber
#

Huger Joker

manic rune
#

is that the guy who invented colors

crisp coral
unborn bay
#

is that the guy who invented rotating cards

zealous glen
dapper sun
#

how do i make cards use the flip animation when doing something?

dapper sun
#

ty

#

how do i add a wait in a card's animation?

reef belfry
#

is this WAY too cruel

dapper sun
#

nvmd

faint yacht
dapper sun
# dapper sun nvmd

i think this should work but it isn't,,

use = function(self, card, area, copier)
    local _c = G.jokers.highlighted[1]
    local _j_key = _c.config.center.key
    local _upgrade = elle_parasite_upgrades[_j_key]
    if (_upgrade) ~= nil then
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.1,
            func = function()
                G.hand.highlighted[1]:set_ability(elle_parasite_upgrades[ G.jokers.highlighted[1].config.center.key ].upgrade)
                G.hand.highlighted[1].sell_cost = G.hand.highlighted[1].config.center.cost
                return true
            end
        }))
    end
end```
hushed field
rapid stag
# rapid stag bump

bump - additionally, does loc_vars apply to the text defined in unlock? lkie if i write #1# etc. in an unlock description, will it do the matching thingy

daring fern
unborn bay
#

don't create a new sprite every frame

hushed field
# daring fern

i made this same error, don't define the sprite each frame

unborn bay
#

save it to a variable somewhere in the card and do a nil check if it exists

#

if it doesn't initialize the sprite from there

unborn bay
#

a drawstep's func variable is a function that takes in the card that's being rendered and the layer

#

you can reference the card from there

daring fern
hushed field
#

you can define it on the card. In this case it's a seal, so I'd take the approach normal seals make and create a global for the sprites

dapper sun
hushed field
#

also, yeah, the highlight doesn't exist anymore when you have the event happen

#

just set up a local variable with that card, and pass that along

dapper sun
#

ah ok

#

ty

rapid stag
unborn bay
#

i should probably move the house drawing function that property cards use to a drawstep now that i think about it

#

right now it's being done on an extension of SMODS.Consumable with a custom draw function

daring fern
#

Would this work?

unborn bay
#

self here should be card

rapid stag
#

func = function(card, layer)

unborn bay
#

actually no self doesn't exist in drawstep functions

daring fern
rapid stag
unborn bay
# unborn bay right now it's being done on an extension of SMODS.Consumable with a custom draw...
    draw = function(self, card, layer)
        card.children.center:draw_shader('negative_shine', nil, card.ARGS.send_to_shader)
        -- update soul_parts
        if not card.children.soul_parts then
            card.children.soul_parts = Sprite(card.T.x, card.T.y, card.T.w, card.T.h, card.children.center.atlas, { x = 0, y = 2 })
            card.children.soul_parts.role.draw_major = card
            card.children.soul_parts.states.hover.can = false
            card.children.soul_parts.states.click.can = false
        end
        if card.children.soul_parts then
            -- update position
            card.children.soul_parts.T.y = card.T.y
            card.children.soul_parts.T.x = card.T.x
            card.children.soul_parts.T.r = card.T.r
            card.children.soul_parts:set_sprite_pos({ x = math.min((card.ability.house_status or 0), 5), y = 2 })
            -- draw it
            card.children.soul_parts:draw_shader('dissolve', 0, nil, nil, card.children.center)
            card.children.soul_parts:draw_shader('dissolve', nil, nil, nil, card.children.center)
        end
    end,
#

i only named it soul_parts because i didn't wanted it drawn twice like soul_pos does

#

lmao

#

unused variable moment

burnt cairn
#

how do you activate a joker per played card?

daring fern
burnt cairn
#

🫡 thanks

runic pecan
#

How to destroy a consumeable? Is there a SMODS method or do I need to copy the code of joker destruction?

unborn bay
burnt cairn
#

crashing because
[SMODS _ "src/loader.lua"]:571: [SMODS GRATLATRO "main.lua"]:93: '}' expected (to close '{' at line 73) near 'if'
i assume its a syntax error but i cannot find it?

marble flint
vague helm
#

Man, maintaining Steammodded must be a nightmare. Half of the GitHub issues are user errors or caused by another mod.

burnt cairn
# daring fern

i got to the installing vscode part and got intimidated out of there nom

burnt cairn
storm wharf
#

I downloaded the brainstorm mod to reroll for jokers but the config for it wont pop up in the settings anyone know why?

proud wagon
#

Does anyone know how to create new rank cards with steammodded? The API documentation doesn't really explain it all too well, especially with the sprites for the card in different suits.

rapid stag
#

bump;

  • what should i do if i want to update a modded achievement's description during runtime cirDerp
  • does loc_vars apply to the text defined in unlock? lkie if i write #1# etc. in an unlock description, will it do the matching thingy
unborn bay
rapid stag
#

i see

long acorn
#

how does cloud 9 work

it goes through the whole deck to check if there's nines and increases in value if yeah right

rapid stag
#

wow free $50 pog cirPoint definitely real

dapper sun
#

<@&1133519078540185692>

unborn bay
#

it doesn't

#

only objects SMODS.Center and anything that inherits it have loc_vars and its function

dapper sun
#

oh ok

rapid stag
dapper sun
#

does anyone know why my joker (the one on the left) activates after everything else instead of left to right

if context.joker_main then
    if card.ability.extra.mult ~= 0 then
        return {
            mult_mod = card.ability.extra.mult,
            message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
        }
    end
end```
rapid stag
dapper sun
#

ah right

unborn bay
dapper sun
wintry solar
dapper sun
#

ok

#

thanks

#

what about mult_mod?

rapid stag
unborn bay
#

i forget that you could just make the keys completely separate in the same localization file and dynamically change the actual key in runtime

#

im sutpid 🥀

dapper sun
#

so yes i do

rapid stag
unborn bay
hushed field
dapper sun
#
if context.joker_main then
    if card.ability.extra.mult ~= 0 then
        return {
            mult_mod = card.ability.extra.mult,
            --message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
        }
    end
end```
dapper sun
#

ok

rapid stag
#

ohhh there's a difference between _mod and not cirISee i didn't know that

hushed field
#

_mod works, but it's for when you want no message, and a custom message to be set instead, basically. There's not really a reason to ever use a _mod in the return, unless you specifically want the message to be a custom one, or no message to appear

unborn bay
#

omg discord flagged my message because i put fuck in it

#

gdi

#

i don't wanna type it again

dapper sun
unborn bay
#

i like naming my variables with the word fuck because that's how i cope with programming

hushed field
unborn bay
#

cryptid ,,,,

dapper sun
#

talisman?

wintry solar
dapper sun
#

true but now i've removed the _mod

hushed field
dapper sun
#

a

wintry solar
#

Yeah talisman is a piece of shit mod that makes everything specifically build around it

dapper sun
#

how do i make it compatible with talisman?

unborn bay
#

le to_big

rapid stag
#

talisman girldmSad

dapper sun
#

me and my friends like playing my mod with cryptid 😭

hushed field
#

i don't know why removing the _mod would cause a talisman issue where it didn't before, however

#

lm check the stack trace

wintry solar
#

You get talisman to fix their shit

hard needle
#

uhh looking at this i'll just continue using _mod

hushed field
#

who is currently the dev for talisman?

wintry solar
#

What’s the value of the mult?

hushed field
hard needle
#

why not

rapid stag
hushed field
# hard needle why not

because while this conversation may make it seem like it's more complicated, it's a lot easier and more readable if you're not consistently having to define your messages. Talisman crashes are entirely unrelated to the use of _mod in your return, generally

dapper sun
#
calculate = function(self, card, context)
    if context.end_of_round and context.cardarea == G.jokers then
        local _mult = math.floor(G.GAME.chips / G.GAME.blind.chips) * card.ability.extra.mult_mod
        card.ability.extra.mult = card.ability.extra.mult + _mult
        return {
            message = "Hehe~ (+".._mult..")"
        }
    end
    if context.joker_main then
        if card.ability.extra.mult ~= 0 then
            return {
                mult_mod = card.ability.extra.mult
                --message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
            }
        end
    end
end```
hard needle
#

the only reason i started using it is cuz its in the example joker mod for steamodded

dapper sun
#

same

unborn bay
#

pretty sure luajit supports comparison metafunctions

hushed field
#

yeah, metatables should be an option to solve this, I think. I'm just not comfortable enough with more fundamental code stuff to actually be the person to take a stab at it, haha

wintry solar
#

Yeah you’re doing stuff with the blind chips which talisman screws with, this should always crash the message 🤔

unborn bay
#

talisman already uses metatables though

#

all except comparisons

hushed field
#

oh it does? I thought you'd need to properly define operator and comparator behaviour for that?

wintry solar
#

I guess this is a rare occasion to use _mod whilst talisman fixes itself

dapper sun
#

ok

hushed field
#

is that the cause? Is it not math.floor doing a comparison internally?

dapper sun
#

i'll try disabling talisman

unborn bay
#

though talisman already handles it automatically

#

except comparisons

hushed field
#

🥲

wintry solar
#

No its the message being given a table rather than a number iirc

dapper sun
wintry solar
#

I guess the localize handles that automatically

unborn bay
#

im not sure why doesn't talisman just use __le and __lt and just get away with it

hushed field
#

ah, okay. I think that might also explain some niche talisman issues in Kino that I've been unable to properly squash

unborn bay
#

is there some edge case as to why they won't do that

#

can't really think of one

wintry solar
#

The easiest way to squash talisman bugs is to uninstall it

#

🙃

hushed field
#

it's literally impossible to convince anyone of playing a mod as anything but a cryptid add-on, though ❤️

dapper sun
#

?

unborn bay
wintry solar
#

I wish they would split the big number crap out away from the cool stuff with calculations and animations

shell timber
#

move the bignum stuff to The Devil

#

both give $3

rapid stag
#

crying 😭

dapper sun
#

regardless, i'm not making my mod incompatible with talisman just to save a few lines on messages

wintry solar
hushed field
#

you don't make a mod incompatible with talisman, you try and get it compatible with talisman and then scream as you get annoyed at the constant to_big and to_number statements in your code

runic pecan
#

I wonder if the author of talisman is still in this channel (or even contactable)

hushed field
#

talisman is originally by mathisfun, no?

#

i don't know if it's maintained by someone else atm or anything

rapid stag
shell timber
#

math's still in the server but probably won't respond to anything

dapper sun
shell timber
#

granted it has been moved to the spectralpack organisation so

wintry solar
hushed field
# dapper sun i've had no problems with talisman so far

that's good! There's a chance it automatically works. Are you up to date on how to make sure a mod is talisman compatible? if you're not comparing with globals, generally, it should be good without any effort, but you do wanna wrap all comparisons with global numbers

wintry solar
#

Can you remind me of the seals thing?

rapid stag
rapid stag
hushed field
#

easiest approach is to define your own copies of the to_big and to_number functions that just return the input straight up if talisman isn't active. Then, you need to wrap any comparison with a global so that the global isn't compared with a number, but with a table, by to_big()ing it. So for example if G.GAME.dollars > 10 then should become if G.GAME.dollars > to_big(10) then

#

anything that happens inside of an equation is automatically transformed, so you don't need to worry about those

#

I've set the functions up like this, which I don't think has caused issues, but I haven't been thorough enough in testing with like 100 mods to for sure that this doesn't create something whacky, haha

red flower
#

if that would cause any problems people would scream at me for using it in jokerdisplay so youre fine

hushed field
#

my general implementation of to_big is kinda fucked though, as I sometimes can't pinpoint where the crash is coming from in the comparison, so I just wrap every variable, haha

brisk rose
#

Oh yeah I'm having occasional issues, I forgot in which mods, which are probably talisman related (comparing number to table) because I have it set to vanilla to give most of my mods that don't require talisman a fighting chance of working

#

None of my mods should actually require bignum though so idk what's going on

hushed field
brisk rose
limber blaze
#

most of the issues are probably in cryptid tbh but theres like fixes being added for that

brisk rose
#

I don't personally use cryptid

limber blaze
#

there are a few things that talisman has to mess with to work that can mess with mods which is unfortunate

brisk rose
#

I only have talisman in my pack because some mods ask for it for reasons like xchips, but in my experience setting it to vanilla lets tucks things work without breaking much else

limber blaze
#

most issues should probably be resolved by using ice's method of just having a wrapper and using that for all comparisons

#

since regular arithmetic works between number types thats the main thing you have to worry about

hushed field
#

well, i just learned that messages are broken in that context, so it doesn't fix everything 😛

#

but if a mod relise on talisman for xchips, it's probably old enough to generally have weird dependencies

limber blaze
#

you should probably try and support it if you can rather than not doing that but its understandably a lot more effort if you have a lot of things so not everyone can or will do that

brisk rose
#

And it's been that way for a long time

limber blaze
#

some people will just naturally have it on even if nothing requires it anyway because watching the number go higher is fun

hushed field
# limber blaze you should probably try and support it if you can rather than not doing that but...

i think for players, it's nice to make sure your mod works with talisman just because it's so frequently in someone's mod folder, and they won't know what's causing crashes if they're not code literate (which they don't need to be to play mods ofc). But god, it'd be so great if talisman was set up to do more of that effort on its end, or at least have a better documentation on what good compatibility looks like

limber blaze
#

a lot of the issues with talisman are mostly due to lua being dumb tbf like attempt to compare number with table is literally impossible to fix cause lua doesnt let you override that operator

#

better documentation would be nice though

hushed field
limber blaze
#

there are some attempts to make talisman better just vaguely in progress though

#

idk i usually try to avoid creating hard incompatibilities unless i really have to but other people will see it differently

brisk rose
#

I wish I didn't have to supply one in my modpack. People won't know to set it to vanilla and the way settings are stored on talisman doesn't seem to be compatible with my yosbr hack that lets my nodosck users get my settings

limber blaze
#

some mods are just too weird to fix issues with though

hushed field
brisk rose
hushed field
#

yosbr back?

brisk rose
#

Fixed the operative typo

hushed field
#

ah, i'm entirely unfamiliar with it, i'll have to look into what it does, honestly. But that might be a good add-on yeah

#

only problem there is that it's the side of balatro modding that i don't really interact with, which would make me a terrible person to maintain and bug fix it, which i definitely can with the current gameplay oriented changes for #1353866504743161886

brisk rose
#

It's a very simple thing that just copies the provided mod configs to the main configuration folder is none for each given mod exist

proud moon
#

retriggers suck

#

such a pain

hushed field
#

ah no wait

#

i see what you're doing

proud moon
#

lol ive spent too many hours on this

hushed field
#

yeah no i read your code wrong and was too cocky in my correction 😛

proud moon
#

config = { extra = { repetitions = 2, card_found = nil, found = false} },
    calculate = function(self,card,context)
        if context.cardarea == G.play and context.repetition and not context.repetition_only then
            for _, played_card in ipairs(context.scoring_hand) do
                if SMODS.has_enhancement(played_card, 'm_mult') then
                    card.ability.extra.card_found = played_card
                    card.ability.extra.found = true
                    break
                end 
            end
            if context.other_card == card.ability.extra.card_found then
                return {
                    message = 'Again!',
                    repetitions = card.ability.extra.repetitions,
                    card = context.other_card
                }
            end
        end
    end

hushed field
proud moon
#

just the first played mult card

#

like chad but only on mult cards

hushed field
#

hmm, but this would retrigger the first mult for each card scored, no?

proud moon
#

now, thats what i thought but

#

nope

hushed field
#

oh, no i see, because the second if statement filters it, yeah

#

i guess that works

#

The way I would go about it is to mark the playing card as 'first scored mult' in some way, and just clean that up in the after. That gives you a bit more freedom there. But if this works, it works

proud moon
#

yea. the issue i was having was it was retriggering everything regardless of mult, but it works now

wintry solar
#

You don’t need to iterate through like that, you could just check if other card is a mult card and then set an internal flag that’s reset after the hand is played so it doesn’t check other card

hushed field
#

the way to generally go about finding these arbitrary qualities in cards, I find, is to do so in the before context and then execute on it later.

#

yeah, basically what eremel's saying

wintry solar
#

I wouldn’t use before here

proud moon
wintry solar
#

Just repetition would do the job

hushed field
#

no? Oh I guess you can just check in this context, yeah

proud moon
#

i could add another condition to the first statement so it doesnt check for mult cards after the first mult card has been found, but ive found that it causes problems trying to maintain that variable

#

or, i did it wrong, which is far more likely

wintry solar
#

Something like lua if context.repetition and context.cardarea == G.play and not card.ability.extra.triggered then if SMODS.has_enhancement(context.other_card, “m_mult”) then card.ability.extra.triggered = true return { — values here } end end if context.after then card.ability.extra.triggered = false end

#

Might be scuffed mobile typing is a pain

proud moon
#

no that sounds right

#

i can actually just try it again and see if it works now

#

since there were more than one issues at play when i tried it before

#

wait when retriggering with .rep, its called once per scoring card right? with other_card being the scored card?

#

so like, in a flush its called 5 times (usually)

proud moon
#

but yea that would work

dapper sun
#

how do i copy a value instead of a reference

hard needle
#

how can i change the required score of the current blind

proud moon
#

yippie

#

im just using my testing sprite for now lol

#

but it works

dapper sun
#

using ipairs instead of pairs

minor furnace
#

when did smods change Seeing Double in card.lua

#

and why was the same thing not done with Flower Pot

#

now I need to hook this function...

dire palm
#

Is there a way I can give a perishable Joker at the start of my challenge?

icy adder
minor furnace
#

how do I edit a vanilla joker description?

#

I have tried patching localization/en-us.lua and it has not worked

brisk rose
hushed field
#

can you not just define a new entry, and that'd override it?

timid star
#

what kind of oddity is this
find_card prints an empty table for some reason even if there are multiple of this joker

icy adder
#

is it possible to make a joker with this effect? I had this idea but I couldn't find a solution

lucky cards of hearts
have 3x probablities 
dapper sun
#

how do i add config?

minor furnace
#

this feels so cursed

#

inside of Game:set_language() of game.lua

#

but hey, if it works it works

shell timber
#

you could do it in a similar way to cryptid's rigged

dapper sun
#

maybe look at the code for all 6's?

minor furnace
#

I think you're better off looking at the lucky card code itself

#

and also the code that generates its tooltip

brisk rose
#

Or just have luckies of hearts be its own invisible enhancement that overwrites real luckies

minor furnace
#

that's probably the better solution tbh

brisk rose
#

But you still want it to work with lucky cat and stuff

#

And it's actually a bad idea because it's joker based not card based

#

So yeah prolly don't do the thing the non-coder half jokingly said

timid star
brisk rose
#

But yeah applying conditional probability modification sounds feasible just by using similar code to any other probability modification

minor furnace
dapper sun
minor furnace
icy adder
#

ohh

#

i'll try it

#

thanks!

minor furnace
#

that way, it'll work no matter how many of the joker you have

#

you'll still need to figure out where to put that line though

#

and also any contitionals or restructuring for hearts suits

minor furnace
# icy adder i'll try it

if you don't define your own 'heart lucky' enhancement, then you'll need to hook or patch both Card:get_p_dollars() and Card:get_chip_mult() in card.lua

#

and then also figure out how to change the tooltip to display the affected odds when you hover over a lucky heart

dapper sun
#

how do i add buttons for config settings?

digital niche
gusty peak
minor furnace
#

Perhaps I should look into that

#

At least, I will if I have to do something like this again. For now though, if it ain’t broke don’t fix it

gusty peak
#

localization is like sometimes reloaded from filesystem and it might undo what you did if i understand

wintry solar
#

You can just add it in your localization file

minor furnace
lunar briar
#

so just kinda starting out but what size do i need to make the atlas and the jokers in the atlas? i know i need the 1x and 2x but i cant find the size i need to make them?

gusty peak
#

71x95 per joker on x1

#

is like default

#

but i think you can define an atlas with custom withd and highet per unit

lunar briar
gusty peak
#

ye you just double it, no limitation on how big or small

#

however big you need it to fit your stuff

burnt cairn
#

is there a way to count scoring cards in a hand? ie output 3 if you play a three of a kind with two non scoring cards

lunar briar
#

coolio. thanks!

burnt cairn
#

also! is there a place i can find answers to these types of questions so i dont have to come here and ask every time

gusty peak
lunar briar
#

best pfp for api docs ever

timid star
gusty peak
burnt cairn
#

yeah ive got that link, it doesnt seem to be covered in the example jokers

burnt cairn
#

fair

gusty peak
#

its done in evaluate_play function

#

you can look how its done there

burnt cairn
#

thought maybe it was done before

heavy hare
#

am i doing this hook function correctly?

local start_run_hook = G.start_run
function Game:start_run(args)
  start_run_hook(args)
  -- my code
end
gusty peak
#

local start_run_hook = Game.start_run

#

also youll have to pass self to the original as first param

heavy hare
#

thank you!

#

advanced the error state so i think it worked lol

gusty peak
#

ye usually the sign

burnt cairn
gusty peak
#

its not on the wiki, its in balatro source code

burnt cairn
#

uh. right

bright axle
#

hello

gusty peak
#

hi

bright axle
#

can i ask a question about sprites here?

red flower
gusty peak
#

sure

burnt cairn
#

for a joker nom specifically i wanna debuff the joker if the hand doesnt have 5 scoring cards

dapper sun
#

how do i make this work?

create_toggle({
    ref_table = SMODS.current_mod.config,
    ref_value = "test_config",
    label = "Test Setting"
})```
#

(ui stuff)

bright axle
#

i have a sprite for a joker that is 71x95 but in the game is a blue rectangle instad of the square

red flower
burnt cairn
#

🫡 🫡 🫡 thank you

gusty peak
bright axle
#

SMODS.Atlas {
key = "j_chaos_joker",
path = "j_chaos_joker.png",
px = 71,
py = 95
}

gusty peak
#

ok what about the joker definition, this looks good so far

dapper sun
#

are you using a different atlas for each joker

gusty peak
dapper sun
#

fair

burnt cairn
#

the path = "j_chaos_joker.png", is a bit of a red flag though

dapper sun
#

how?

bright axle
#

why

gusty peak
#

oh i see

#

ye you can use one atlast for multiple jokers

#

but its not the problem

#

do you have the pos set inh your joker definition?

bright axle
#

i have only one atlas also maby this is the prob
rarity = 3,
atlas = 'j_chaos_joker',
pos = { x = 0, y = 0 },
cost = 6,
soul_pos = { x = 1, y = 0 },

dapper sun
#

ah

#

where's the soul sprite on the atlas?

burnt cairn
#

you only need one atlas, it should contain all your jokers

bright axle
#

i remoive it ima reload

dapper sun
#

the black rectangle is probably the soul overlay sprite

burnt cairn
#

heres my atlas for reference

bright axle
dapper sun
#

yw

gusty peak
#

uhhh

#

but i never done ui really

#

theres example from balatro source

dapper sun
#

i think i got it now

#

how do i make a joker's atlas position change based on a config setting?

crystal perch
gusty peak
#

maybe in set_ability you could... card:children.center:set_sprite_pos({ x = ... y = ... })

gusty peak
crystal perch
#

it shows in collection due to me making a consumable type for them, but oddly enough it shows 0/0 despite there being boosters

#

they just can't be spawned in using debug plus nor do they spawn in-game naturally

gusty peak
#

first off... delete the pools completely, this looks like copy pasted example code, you dont need pools here

crystal perch
#

yeah i figured but it wasn't working prior to the pools anyway so i was just grasping at straws

gusty peak
#

thats my example

#

other than you dont return a card, it looks fine, but that wouldnt make it not spawn, it would make it crash if you tried to open it

crystal perch
#

maybe me making a consumable type for it broke it somehow?

gusty peak
#

boosters wouldnt be in the seprate tab also, it would be in boosters

#

consumable type would be in the separate tab

#

you shoulkdnt specify set property in the pack

crystal perch
#

they seem to be working now

crystal perch
#

same with the type

#

that seems to have fixed it

gusty peak
#

yay

crystal perch
#

now i just have to set up the text and background cuz all it says is ERROR at the bottom lol

gusty peak
#

thats group_key

#

and in localization file it would be in misc->dictionary-><group_key>

crystal perch
#

i'm moreso referring to this ERROR text

gusty peak
#

ye me too

crystal perch
#

unless i entered it incorrectly

#

it doesn't seem to be working properly

gusty peak
#

did you set group_key for every booster?

crystal perch
#

yes every booster shares the same group_key, here's my en_us file

#

must i format it like k_chakra_pack?

#

actually i should do that anyway

gusty peak
#

ye try that

#

also probably include your mod prefix

#

k_<prefix>_chakra_pack

burnt cairn
#

looking at this function SMODS.debuff_card(card, debuff, source), what parameters does card support

gusty peak
#

what are you looking to do?

burnt cairn
#

im trying to have a joker debuff itself

#

got here by backsearching this channel nom

crystal perch
#

just do card = card and it'll target itself right

burnt cairn
#

so SMODS.debuff_card(card, debuff, source) = card?

crystal perch
#

no

gusty peak
#

no, SMODS.debuff_card(card, true, ...)

burnt cairn
#

ah

gusty peak
#

im not sure what source is

burnt cairn
#

my programming experience is scratch and html youll have to forgive my ignorance 🦭

gusty peak
#

ok

burnt cairn
#

Oops! The game crashed: [SMODS _ "src/utils.lua"]:401: table index is nil

#

what table catstare

gusty peak
#

how do you call the func?

#

or where

#

ratehr

burnt cairn
#
        if context.before then
                if #context.scoring_hand < 5 then
                    SMODS.debuff_card(card, true, gort)
                end
        end
        
        
    end```
gusty peak
#

well theres no table called gort it should be "gort"

#

a string

burnt cairn
#

ah yeah that figures

icy oak
#

what function do i call to draw cards from deck

gusty peak
#

G.FUNCS.draw_from_deck_to_hand(1)

icy oak
#

o

#

ic

crystal perch
gusty peak
#

oh wait

#

theres also just draw_card, singular

burnt cairn
#

none of the animations though, how would i implement that

gusty peak
#

you could do card:juice_up(0.5, 0.5)

gusty peak
burnt cairn
#

lol its called juice up? thats wacky

gusty peak
shell timber
#

it juices up the card

burnt cairn
#

i assume the parameters are x and y wiggle?

gusty peak
#

scale, rot_amount

burnt cairn
#

nah they dont do that do they the wiggle is rotation

#

yea

gusty peak
#

or you you forgot the save a loc file

crystal perch
#

i definitely saved it

#

vsc shows if it's unsaved

gusty peak
#

ye fair

#

send screenshot of booster definition currently again

crystal perch
#

i'm also looking in balatro's code and it's the same way

#

i've tried entering k_chak_chakra_pack directly into the group_key and still didn't work

gusty peak
#

is it called chakra_pack in loc file?

crystal perch
#

i sent a picture of the en_us file

gusty peak
#

group_key should match whats in loc fkile

#

sry

crystal perch
#

with steamodded it automatically appends the prefixes to keys

gusty peak
#

add k_chak to group_key in definition

lunar briar
crystal perch
#

i tried that earlier and it didn't work so ill try it again

crystal perch
#

honestly maybe it's because my e_chak_ignited code doesn't work?

manic rune
#

BMjoker

BMJoker

lunar briar
#

shit lul

#

that explains it

manic rune
#

oh, and also

#

just return mult = card.ability.extra.mult

#

it will auto handle the message for you

#

better-calc stuff :3

lunar briar
#

ah ok. tbh i was just pretty much going off one of the example jokers

#

one thing i will say is it is saying +nil mult when i hover over it in collection

dapper sun
#

how do i make a joker check for another specific joker?

gusty peak
#

if #find_joker(<key>) > 0 then ... end

dapper sun
#

ty

crystal perch
gusty peak
#

thats just how i did it idkk, thats very strange

lunar briar
burnt cairn
#

the mult = card.ability.extra.base here is just not doing anything?

gusty peak
#

you return object that contains mult =

burnt cairn
#

wait catfacepalm yeah im stupid thanks

wintry solar
#

Also you can’t return mult in context before

burnt cairn
#

yeah im seeing the consequences nom i get the mult before scoring starts and then once the cards start scoring the mult is retracted