#💻・modding-dev

1 messages · Page 637 of 1

mystic river
#

230: 'end' expected (to close 'if' at line 225) near '}'
you accidentally deleted an end

#

it belongs somewhere between line 225 and 230

cinder elk
mystic river
#

it thinks those ends close something earlier that didn't get closed properly

loud citrus
#

Remove one of the ends :)

cinder elk
#

w

#

which one

loud citrus
#

Either one

mystic river
#

okay if you're getting a syntax error just post the entire SMODS.Joker

cinder elk
#

`SMODS.Joker{
key = 'lbpjalapeno',

loc_txt = {
    name = 'Uncle Jalapeño',
    text = {
        'Gains {C:mult}+3{} Mult',
        'whenever a card',
        'is {C:red}destroyed{}'
    }
},

atlas = 'Jokers',
rarity = 2,
cost = 5,

blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,

pos = { x = 3, y = 0 },

config = {
    extra = {
        mult = 0
    }
},

calculate = function(self, card, context)

    -- Gain mult when a card is destroyed
    if context.remove_playing_cards and not context.blueprint then
        card.ability.extra.mult = card.ability.extra.mult + 3
    end

    -- Apply stored mult during scoring
    if context.joker_main then
        return {
            mult_mod = card.ability.extra.mult,
            message = "KABOOM!"
            }
        }
end

`}

mystic river
#

you've got an extra }

wicked heron
#

readd the end, remove one of the curlies

loud citrus
#

And an end for the calculate function

mystic river
#

those arrows match beginnings to ends

#

that one } isn't closing anything, and that one if doesn't have an end

storm kraken
#

try getting a code editor with brace highlighting it really helps

#

like alot alot

#

well

cinder elk
#

`SMODS.Joker{
key = 'lbpjalapeno',

loc_txt = {
    name = 'Uncle Jalapeño',
    text = {
        'Gains {C:mult}+3{} Mult',
        'whenever a card',
        'is {C:red}destroyed{}'
    }
},

atlas = 'Jokers',
rarity = 2,
cost = 5,

blueprint_compat = true,
eternal_compat = false,
perishable_compat = false,

pos = { x = 3, y = 0 },

config = {
    extra = {
        mult = 0
    }
},

calculate = function(self, card, context)

    -- Gain mult when a card is destroyed
    if context.remove_playing_cards and not context.blueprint then
        card.ability.extra.mult = card.ability.extra.mult + 3
    end

    -- Apply stored mult during scoring
    if context.joker_main then
        return {
            mult_mod = card.ability.extra.mult,
            message = "KABOOM!"
            }
        }
    end
end`
mystic river
storm kraken
#

try adding it to your code editor

storm kraken
#

built in with vs i think thats cool

#

i use np++

mystic river
#
        if context.joker_main then
            return {
                mult_mod = card.ability.extra.mult,
                message = "KABOOM!"
                }
            } -- DELETE THIS IT DOESN'T HAVE A CORRESPONDING {
        end
cinder elk
#

is. is that it

mystic river
#

put one } below all the ends

#

just like. go through your code looking at all the {s and ask yourself, "where is the } that closes this?"

cinder elk
storm kraken
# cinder elk

you should read up on lua basics
think of the joker as one big table in a {} aswell (because it is)

cinder elk
#

yeah probably.

#

GOT IT.

#
    key = 'lbpjalapeno',

    loc_txt = {
        name = 'Uncle Jalapeño',
        text = {
            'Gains {C:mult}+3{} Mult',
            'whenever a card',
            'is {C:red}destroyed{}'
        }
    },

    atlas = 'Jokers',
    rarity = 2,
    cost = 5,

    blueprint_compat = true,
    eternal_compat = false,
    perishable_compat = false,

    pos = { x = 3, y = 0 },

    config = {
        extra = {
            mult = 0
        }
    },

    calculate = function(self, card, context)

        if context.destroying_card and not context.blueprint then
            card.ability.extra.mult = card.ability.extra.mult + 3
        end

        if context.joker_main then
            return {
                mult_mod = card.ability.extra.mult,
                message = "KABOOM!"
            }
        end

    end
}
mystic river
#

i really recommend putting code in a code block
markdown really hates making it possible to demonstrate this so here's a screenshot instead

if some_lua_code then
  --put it in a code block like this
end
cinder elk
#

got it

cinder elk
#

kind of

#

it doesnt add mult to itself.

#

it only just activates.

storm kraken
#

i guess itd be cuz of the destroying card context

mystic river
#

have you, in fact, destroyed any cards

cinder elk
#

i have, in fact, destroyed cards.

#

with hanged man.

mystic river
storm kraken
#

does destroying card exist as a context

#

ok it diesnt

#

awesome

mystic river
#

destroying_card is a context, it's just the wrong one

storm kraken
#

i feel like you had the correct one before

storm kraken
#

yeah whyd you change it

cinder elk
#

thought it'd work.

#

but yes it works now.

#

oh this next one's gonna be fun.

#

"Trigger Steel Cards regardless of position"

#

(except in deck)

errant fulcrum
#

I have a seal that isn't being affected by mime and I'm not sure how to fix that

    key = 'Seafoam',
    atlas = 'Jokers',
    pos = { x = 4, y = 3 },
    badge_colour = HEX('5acf95'),
    loc_txt = {
        label = 'Seafoam Seal',
        name = 'Seafoam Seal',
        text = {
            'Creates a common {C:attention}Joker{}',
            'at end of round',
            'if {C:attention}held{} in hand',
            '{C:inactive}(Must have room){}'
        }
    },
    loc_vars = function(self, info_queue)
        return { vars = { (G.GAME.probabilities.normal or 1) } }
    end,
    calculate = function(self, card, context)
        if context.playing_card_end_of_round and context.cardarea == G.hand and #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
            G.GAME.joker_buffer = G.GAME.joker_buffer + 1
            G.E_MANAGER:add_event(Event({
                trigger = 'before',
                delay = 0.0,
                func = function()
                    local new_card = SMODS.add_card({ set = 'Joker', area = G.jokers, key_append = 'ocean', rarity = 'Common' })
                    if new_card then
                        new_card:juice_up(0.3, 0.5)
                        play_sound('card1')
                    end
                    G.GAME.joker_buffer = 0
                    return { message = '+1 Joker', colour = G.C.ATTENTION }
                end
            }))
            return
        end
    end
}```
storm kraken
cinder elk
#

h

#

hook?

storm kraken
#

yes a pirate hook

#

i recommend option A

cinder elk
#

good idea

normal crest
#

spaghetti code and hooks aren't mutually exclusive, you can have both!!

cinder elk
#

YI

#

keep in mind. this is only the current jokers.

#

i

#

i have to add a booster pack with cards and seals next.

#

ssssO

#

FUN

loud citrus
#

Seals are similar to jokers, except playing card

vale zinc
#

Is there anything in a Planet card's specification within G.P_CENTER_POOLS that lets me see whether or not the card's been discovered?

rocky plaza
#

this will also work for any object classified as a Center

#

i.e all consumables, jokers

quick scarab
#

bump

errant fulcrum
rigid solar
#

What does blocking = false on an event actually do? I thought it'd let you play the game and just run in the background until it returns true, but I'm wrong

opal hazel
#

Why in the world does modifying the UI do this?

gaunt folio
#

how do i fix this?

#

nvm i got it

loud citrus
#

how would you check if the player is using a curtain deck?

daring fern
spiral mural
#

how ddo i make a joker do something at the end of ante

loud citrus
#

you could always do after boss blind

spiral mural
#

?

dapper sun
#

there's a context for that

#

check smods docs

spiral mural
#

when i use it, it seemly triggers twice?

wintry solar
#

Show code

spiral mural
#
calculate = function(self, card, context)
    if context.after and not context.blueprint then
        print(card.ability.extra.hands_played)
        card.ability.extra.hands_played = card.ability.extra.hands_played + 1
    end
    if (context.ante_end) or context.forcetrigger then
        if card.ability.extra.hands_played < 4 then
            for i = 1, 3 do
                local consumable =
                    SMODS.add_card {
                    -- For a random one
                    set = "Consumeables",
                    area = G.consumeables
                }
                consumable:set_edition("e_negative")
            end
        end
    end
    -- any ante change should reset the counter
    if context.ante_change then
        card.ability.extra.hands_played = 0
    end
end
wintry solar
#

Add and context.ante_change

spiral mural
#

works 😇

elder rune
#

<@&1133519078540185692>

#

Thanks pookies

spiral mural
#

@admins

loud summit
#

is there any way to change collection order besides registering the objects in a different order?

elder rune
#

Have you checked smods wiki?

loud summit
#

yyea

elder rune
#

Eh idk

quick scarab
#

bump

loud summit
#

im just going to rewrite it to change reg oder

#

order

#

yyou have to call the check for unlock i think

quick scarab
rigid moss
#

Is there an easy way to add a line of text to card description? I have a joker that adds xMult to playing cards and it would be nice display it, but generate_UIBox_ability_table and generate_card_ui seem like a nightmare to work with...

hardy vessel
rigid moss
#

SMODS.Joker{
name = "Fairytale",
key = "cv_fairytale",
loc_txt = {
['name'] = "Fairytale",
['text'] = {
"All cards in deck",
"gain {X:mult,C:white}X#1#{} mult",
"each hand. Buff {C:attention}resets{}",
"when card is scored"
}
},
config = {
extra = {
Xmult = 0.03,
drain = {}
}
},
pos = {x = 8,y = 1},
cost = 8,
rarity = 3,
blueprint_compat = true,
eternal_compat = true,
unlocked = true,
discovered = true,
atlas = 'CVjokers',

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

calculate = function(self, card, context)
    if context.cardarea == G.jokers and context.before then
        for i = #G.playing_cards, 1, -1 do
            local c = G.playing_cards[i]
            c.ability.fairy = c.ability.fairy or 0
            c.ability.fairy = c.ability.fairy + card.ability.extra.Xmult
            c.ability.x_mult = c.ability.x_mult + card.ability.extra.Xmult
        end
    elseif context.individual and context.cardarea == G.play then
        if not context.blueprint then card.ability.extra.drain[#card.ability.extra.drain + 1] = context.other_card end
    elseif context.destroying_card and not context.blueprint then -- Does not destroy cards but uses this scoring faze to reset .fairy from them
        for i = #card.ability.extra.drain, 1, -1 do
            local c = card.ability.extra.drain[i]
            c.ability.x_mult = c.ability.x_mult - c.ability.fairy
            c.ability.fairy = 0
        end
        card.ability.extra.drain = {}
    end
end

}

#

Here is the code

#

the joker basically adds 0.03 mult to all cards in deck

#

the mult is on them not on joker

hardy vessel
#

try adding perma_x_mult instead of x_mult. basically the xMult version of Hiker's chips

rigid moss
#

hmmm was perma_x_mult added in smod? I dont see it anywhere in base files

hardy vessel
#

seems like it

rigid moss
#

Oh damn, thats great

#

Actually needed those a lot

hardy vessel
#

Definitely browse the smods wiki, you do end up finding some neat features

candid arch
#

how do you detect if a playing card was retriggered (regardless if it was in played hand or not)?

hardy vessel
#

like, retrigged at all?

#

ok um

candid arch
#

yeah! like if a playing card with red seal gets retriggered or a face card is retriggered with sock

#

any card retriggers

hardy vessel
#

i have a method for scoring

candid arch
#

👀

#

im making a joker that gives $1 whenever a card gets retriggered

hardy vessel
#

actually, the scoring method can also work for in hand

#

This Joker adds +1 mult to any card that gets retriggered in scoring hand

calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            if (context.other_card.count or 0) >= 1 then
                context.other_card.ability.perma_mult = (context.other_card.ability.perma_mult or 0) +
                card.ability.extra.mult
                return {
                message = localize('k_upgrade_ex'),
                colour = G.C.MULT
                }
            end
            context.other_card.count = (context.other_card.count or 0) + 1
        end
        if context.joker_main then
            for i = 1, #context.scoring_hand do
                if context.scoring_hand[i].count >= 1 then
                    context.scoring_hand[i].count = nil
                end
            end
        end
    end,
candid arch
#

ooh

#

is context.other_card.count referring to how many times a card is retriggered?

#

thats what im guessing

hardy vessel
#

you can add and context.cardarea == G.hand and not context.end_of_round to take care of the cards held in hand

hardy vessel
#

you would also have to add a reset to cards held in hand under context.joker_main

#

I'm having some trouble understanding how rarities are handled for object/consumabletype. I want to make a consumable group that has essentially different rarities

Anyone who could help better explain it would be greatly appreciated.

candid arch
#

does context.scoring_hand mean any card that triggers, like gold/steel cards, or just played cards that get scored?

hardy vessel
candid arch
#

ahh darn

#

how do i check if a card got triggered in general?

daring fern
quick scarab
#

Making a unlock condition where if I the player goes to max debt (-$20) the card is unlocked, but it doesn't work any help

check_for_unlock = function(self, args)
        return args.type == 'money' and G.GAME.dollars == -20 
end
daring fern
quick scarab
#

also just in case I checked the documentation of talisman and some of the code in cryptid

daring fern
final jewel
#
    key = 'consecutive',
    func = function(hand)
        if #hand < 4 then
            return {}
        end
        local counts = {}
        for _, card in ipairs(hand) do
            local v = card.base.id
            counts[v] = (counts[v] or 0) + 1
        end
        for v, n in pairs(counts) do
            if n >= 2 and (counts[v + 1] or 0) >= 2 then
                local result = {}
                for _, card in ipairs(hand) do
                    if card.base.id == v then
                        table.insert(result, card)
                        if #result == 2 then break end
                    end
                end
                for _, card in ipairs(hand) do
                    if card.base.id == v + 1 then
                        table.insert(result, card)
                        if #result == 4 then
                            break
                        end
                    end
                end
                return result
            end
        end
        return {}
    end
}```
```SMODS.PokerHand{ --LinkedPairs
    key = 'Linked Pairs',
    visible = true,
    mult = 3,
    chips = 20,
    l_mult = 1,
    l_chips = 20,
    example = {
        {'H_T', true},
        {'S_T', true},
        {'C_J', true},
        {'S_J', true},
        {'D_4', false}
    },
    evaluate = function(parts, hand)
        return parts.giga_consecutive or {}
    end
}```
ok so I have this poker hand and the hand is detect when I select the cards and everything is fine about that but when I play the cards only one score
final jewel
#

thx

#

but why it does that ? isnt result already a table

daring fern
final jewel
quick scarab
vale zinc
#

I want this Blind of mine to switch off when a certain rank is scored, but it's not working. Any pointers?

calculate = function(self, blind, context)
    if not blind.disabled then
        if context.individual and (context.cardarea == G.play) then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                blockable = true,
                blocking = false,
                silent = true,
                func = function()
                    if LAPSEMS.contains(self.config.extra.table_of_ranks, context.other_card:get_id()) then -- This line produces a crash -- says `other_card` is a nil value.
                        card_eval_status_text(context.other_card, 'extra', nil, nil, nil, {
                            message = localize('ph_boss_disabled'),
                            colour = G.GAME.blind.config.blind.boss_colour
                        })
                        self:disable()
                    end
                    return true
                end
            }))
        end
    end
end,
daring fern
brisk tree
#

I've been having this really weird issue

#

I'm trying to check for when a card is triggering by hooking onto SMODS.calculate_effect and other similar functions

candid arch
#

no way so am i what a coincidence

brisk tree
#

And for some reason when I check for triggering cards during context.individual, the first trigger on a card is always nil (I'm setting a "triggered" flag during SMODS.calculate_effect)

daring fern
brisk tree
#

Is there any way to get when cards (both in hand and in play) trigger then in a way that doesn't cause any issues?

#

Like, is there some other context that runs after calculate_effect

daring fern
brisk tree
#

Well trigger effects sorta runs every frame which is less than desirable

#

Since I'd preferably want something to run once when I put a card into play or when it's triggered from hand like a steel card

#

I mean, unless trigger_effects doesn't run every frame and hooking it inside of calculate messes things up

daring fern
daring fern
spiral mural
#

eqmult type effect not working???
code for pretty much all of these

        local chips = SMODS.Scoring_Parameters["chips"]
        chips.current = (smth)
        update_hand_text({delay = 0}, {chips = chips.current})
        if not Talisman or not Talisman.config_file.disable_anims then
            MyDreamJournal.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'chips', amount, percent, nil, nil, "Chips = "..chips.current, G.C.BLUE)
        end
        return true
frigid cargo
#

How do i make a new consumable type?

final jewel
#

Is it normal that telescope doesnt work with my custom hand ???

final jewel
loud citrus
final jewel
#

Or like a rule that says "before asking, look at VanillaRemade"

loud citrus
#

yes, and it could even be a great transition to people asking/learning what stuffs mean :)

frigid cargo
final jewel
#

Idk if its in VanillaRemade but I was trying to find PokerHandPart but didnt find it. It could be a nice addition to VanillaRemade for understanding what every parts do.

frosty rampart
#

for now at least, you can check in vanilla code for the functions get_highest (effectively the definition of the high card pokerhandpart), get_straight (same for straight), get_flush (same for flush), and get_X_same (the first table that this function returns is used as the definition for the _2, _3, _4, and _5 pokerhandparts). and then look at smods src/game_object.lua for the pokerhandpart _all_pairs (it also involves get_X_same)

#

but yea i do think it'd be nice to translate those vanilla functions into direct pokerhandpart definitions in vanillaremade

#

(here's the relevant section in smods src/game_object.lua btw)

final jewel
#

Oh nice thx. I never know where to look for shit like "do I look in lovely dump or in smods folder"

#

And Im always lost in these

frosty rampart
#

btw the way the SMODS.four_fingers function is used here is really weird lmao
the function does indeed take an argument but it just. doesn't do anything with it. it does not matter what you pass in

#

top 10 functions of all time

daring fern
frosty rampart
#

please show me an example of where a hook uses it

#

/genq

daring fern
frosty rampart
#

i meant in like an actual mod

#

because it feels like the only use case is for specifically modifying how the vanilla Four Fingers joker works for one of the two hand types
anything else and you would be better off writing your own utility function

shell timber
frosty rampart
#

hm yea, i guess if you have another joker effect that specifically only lets you make straights with 4 cards, or only flushes with 4 cards, then the hook to four_fingers would be useful
but it still feels very offputting, and i feel like there's a better way to go about it

#

at that point i guess the function name is the issue for me

foggy ginkgo
#

How do I make this say use like how arcana or spectral packs do it

wintry solar
foggy ginkgo
#

:3

subtle hawk
#

Hlep

foggy ginkgo
#

The joker retriggering?

#

Or is the A and 5 retriggering

subtle hawk
#

The Joker itself

#

Needs to retrigger if both

foggy ginkgo
#

Oh so gives double xmult if both are scored

subtle hawk
#

I mean twice and double isn't exactly the same in case of multiplication but yeah kinda

foggy ginkgo
#

I meant twice don't worry

#

I mean you don't need to retrigger it

daring fern
#

You're setting card.ability.extra.retrigger to 0 before returning so repetitions will always be 0

subtle hawk
#

Dimbass

#

Okay

foggy ginkgo
#

Nvm they got it

loud citrus
daring fern
foggy ginkgo
#

Ou

#

Thank you

foggy ginkgo
#

Me too

loud citrus
#

Fern, we love Fern

foggy ginkgo
#

Yessir

safe saddle
#

i dont understand anything 😭

#

i read the smods docs lots of times and yet i still dont understand

frigid cargo
foggy ginkgo
#

What's the next "I'm a fan" you're gonna say

elder rune
solid salmon
#

guys how do i get if a hand is a heart flush

#

oh wait

hardy vessel
#

For ObjectType rarities, is this asking for specific object keys or rarity keys?

frigid cargo
warm marten
#

question for the mod makers, what do you usually do for the art?

#

do you do it yourselves or commission it out?

faint yacht
#

Former applies to most, I'd say.

storm kraken
#

only you know how you want your art to be, after all

warm marten
#

very true

#

do you usually reference other images? or can we use the default balatro art and sort of build off of that?

old epoch
frigid cargo
#

Ill have to check later

frigid cargo
old epoch
#

Ah

lucid owl
#

most people use reference images

#

and balatro art can help give some lines to stay on

#

but i've seen people use random images as joker sprites and i've seen people use slightly hue-shifted base sprites for jokers

#

do whatever ya want

storm kraken
#

if the card is based off something else, its almost like you have to make it look like that thing...

#

but for regular art im trying to stay somewhere in line with balatro but i suck so much its just a new art style

chrome widget
solid salmon
#

hey guys

#

how do i change the first card in a hand

tranquil cypress
#

You can get context.scoring_hand[1] in context.before like this

#
if context.before and not context.blueprint then
  local first_card = context.scoring_hand[1]
  local enhancement = SMODS.poll_enhancement { key = "seed", guaranteed = true }
  first_card:set_ability(enhancement, true)
end```
hallow slate
#

How do I get the localized name for an enhancement?

faint yacht
loud summit
#

how do i move a card from the discard area to the top of the deck

junior tapir
#

Does anyone have tips for making stickers? I've tried, for example, making them only for jokers or with a rate of say 0.3, but they appear on EVERY card, even on jokers when I say sets = {Joker = false} and/or rate = 0. In vanilla remade, two of the remade stickers have some card.config.center.perishable/eternal_compat, but non of this in the rental, so idk where the joker-only should come from. I dug that @static valley has had similar issue with no apparent answer

frosty rampart
#

when the sticker has a custom should_apply function, it completely ignores the rate you set for the sticker. you need to account for it in the function

candid arch
#

i made this joker idea b4 joining the community, but sadly everyone and their mother has done this joker effect 😭

misty halo
# candid arch

there's only one thing i dont like about this and its the fact that sixfold is the name of the mod

candid arch
#

wdym

misty halo
#

nvm

harsh belfry
#

six folds is pretty much all you'll get with a normal piece of paper

misty halo
#

i forgot like almost literally no one here knows about blackout revival

harsh belfry
#

maybe seven

candid arch
#

sevenfold...

#

you probably couldnt fold a playing card more than 6 times tbf, theyre thicker than paper

harsh belfry
#

ngl both of yall could have just posted in modding-chat

#

its weird not debugging someones shit here

candid arch
#

oh sorry, ill post it there instead

misty halo
#

buh

candid arch
#

how do you check if every card in a played hand is a different rank?

red flower
granite jay
#

Anyone know how to get the hand size with a joker?

#

Nvm found it

wicked heron
#

Does anyone know a context that occurs when chips are added to your total after a hand is scored? context.after occurs just before this step

#

the only context I find that comes next is context.hand_drawn, which is a step too late for me

red flower
#

make sure you're using events

wicked heron
#
            card.ability.extra.hand_tick = false
            card.ability.extra.replenishments = card.ability.extra.replenishments - 1
            G.E_MANAGER:add_event(Event({
                func = function()
                    ease_hands_played(1, 1)
                    return true
                end,
            }))
            return {
                message = "+1",
                colour = G.C.BLUE,
            }
        end

#

Do I need to use after in the event?

red flower
#

no that should be fine
do you want it to happen after all the cards in play are discarded?

wicked heron
#

Thanks N, I've pieced it together now (I put an if statement within the event)

candid arch
#

that's all thanks to @brisk tree 🔥 🔥

solid salmon
#

hey guys

#

can i use exponents to calculate stuff

#

like mult = 2^2

sturdy compass
#

Yes

brisk tree
#

is there a way to make a card visually bigger?

#

And permanently keep it visually bigger?

sturdy compass
#

Yeah, if you’re not talking about scaling on the fly, you can set a display_size property to the card object

toxic cave
gaunt thistle
brisk tree
sturdy compass
#

Slightly yes but still possible

#

You can do so by doing math on card.children.center.scale.(x or y)

#

Actually no that's not correct, you'd be doing math on card.T.w and card.T.h for height and width scale respectively

toxic cave
#

is there sth i dont understand about .toml? is it not being loaded or sum? because this should work

normal crest
toxic cave
#

wait the name matters?

normal crest
#

Make a folder called lovely in your mod

#

And put the toml file inside of it

toxic cave
#

ic

candid arch
#

this joker is supposed to check if the first hand in round is a single heart card, delete it, upgrade itself by +12 mult, then add that mult to the hand score. right now it's doing everything except adding the mult to the final score

daring fern
candid arch
#

ohmyg od thank you so much

#

or

#

okay i dont think that solved it but i DID miss that card.ability.mult typo so thank you!!

#

it still isnt adding the mult to the score though which is peculiar

#

i think i found the source of the issue

#

but i still dont know how to fix it

loud citrus
#

context.modify_hand

is this something a joker can use?

candid arch
harsh belfry
loud citrus
#

you're good, no worries 👍

harsh belfry
#

because shit is not calculated when you see it appear

#

it is all precalced

#

this is why events exist

candid arch
#

ooooo

harsh belfry
#

so you can get the neat order on screen

candid arch
#

how can i take advantage of events here

#

wait theres the uhh

harsh belfry
#

yeah but i'm not certain thats the issue

candid arch
#

ah whoops

daring fern
harsh belfry
#

i'm just saying its printing before because everything does that lmao

candid arch
daring fern
candid arch
#

increase the joker mult or add the mult to the score?

#

just to be clear sdhjsfkg

loud citrus
daring fern
candid arch
daring fern
candid arch
#

oh word, thank you! i'll give this a try

#

gonna try adding context.cardarea == G.play and context.main_scoring to the larger if statement

#

that stopped the crashing, but the joker's mult stil isnt being added to the score

red flower
# candid arch

while i understand not wanting to repeat statements it's always better practice to put the timing context before the information checks (i.e. making before and destroy_card the outer if)

candid arch
#

i'll give that a shot

red flower
#

also don't put function calls in returns unless you actually need to return the value

candid arch
#

but i dont know if it'll trigger in the order i want it to? like i want it to be: single heart card is played in first hand > joker deletes heart card and upgrades its own mult > joker adds mult to hand score

red flower
#

the order of the ifs is irrelevant, contexts run in a specific order

#

destroy_card is always at the end

#

you can try using SMODS.destroy_cards() instead in context.before

candid arch
#

alright

daring fern
atomic solar
#

anyone know how to fix this? this happened today when im trying to mod but i think disabling the yahimod just bricked my balatro

candid arch
atomic solar
#

i tried most ways as from deleting the mod, deleting the roaming, deleting the game and reinstalling

#

most didnt work

spiral mural
#

what's the card area for in hand cards

modest jewel
#

bro basically deleted his pc

#

😭

spiral mural
modest jewel
candid arch
#

omfg 😭

atomic solar
#

im fr being serious unless its the fact its actually just removing everything i had in balatro

#

all bc of a weirdass error im having rn

spiral mural
modest jewel
#

who the hell deletes all their file and shit as the first fix😭

atomic solar
#

well idk, this is my first time encountering this errror

modest jewel
#

bro deleted his roaming💔

#

at this point

atomic solar
#

not entirely the roaming

modest jewel
#

idk what to do for you

atomic solar
#

the balatro folder in the roaming folder

modest jewel
#

just factory reset your computer 💔💔💔

candid arch
#

he said the balatro folder in roaming dude 😭

#

not the entire roaming folder

modest jewel
#

oh

#

idk man

#

i have NEVER seen anyone deleting shit outside of Mods folder

#

like why

#

probably just replicate and recreate your balatro folder

#

could work

brisk tree
#

how would I make a tarot card give mult when used

red flower
brisk tree
#

oh yeah you're actually right

#

I'll do the switching part

red flower
#

you can use keep_on_use and then use calculations like a joker and destroy the card when calculation ends

#

the confections in balatro goes kino do something like that

feral tree
#

is it possible to detect if you're hovering over a joker?

hardy viper
#

iirc it's like G.CONTROLLER.hovered.target

hardy viper
#

not .hovered

sturdy compass
#

<@&1133519078540185692>

glass scaffold
sturdy compass
#

Too often

chrome widget
#

Gonna ask around again, does anyone have decent existing solutions for modifying the values of text inputs without somehow misplacing the cursor/input position

#

I've been ripping my hair out over this

primal robin
#

Oh you need keep cursor pos too, hm

pastel kernel
#

how to check for scoring cards

#

"gain something for each card scored"

storm kraken
#

YESSSS

storm kraken
primal robin
storm kraken
pastel kernel
#

what's ref table and ref value?

storm kraken
#

this but replace the ui bits with Other things

#

i used the ui doc for this because i feel like it explains it better

#

basically ref_table is the table that ref_value is in and ref_value is a variable

#

i think

pastel kernel
storm kraken
#

OK KO MENTIONED

pastel kernel
umbral zodiac
#

but yeah thats the general idea

storm kraken
#

in cases where ref_table is the value (a table) and you wanna get an entry from that table (for example ref_table[1]) you'll use a number (quotations) as the ref_value

loud citrus
#

how would i make my joker not debuff itself
i'm thinking simply not allowing it to target itself, though i don't know what i would put

daring fern
loud citrus
#

it works!!!
(unless it's just itself and one other joker, but the player has earned the benefits of self debuff if they can only survive with only 1 joker past anti 8, as it's only possible to get at the end of anti 8.)

pastel kernel
#

how to check for triggering playing cards?

storm kraken
#

i arted again

wicked leaf
#

how do you create a random tag

daring fern
wicked leaf
#

truly a strange thing

#

but hey if it works it works

storm kraken
#

i feel so happy inside when i spend an hour on trying to fix code

#

hey how do i make a tag similair to the uncommon and rare tags

#

ok this is a certified me forgetting vanilla remad

#

e

storm kraken
#

🥀

primal robin
junior tapir
#

How do I add passive effects to stickers, e.g. a juggler effect? the functions add_to_deck and remove_from_deck aren't supported by smods.sticker

solid salmon
#

GUYS

#

WHATS THE CONTEXT FOR DISCARDING

#

like not checking per card just checking for if you discarded

daring fern
storm kraken
obtuse silo
#

how do i check when a consumable is bought
and how do i check for the type of consumable

daring fern
storm kraken
#

uhh

#

is there a way to increase a specific edition's spawn rate

#

or edit it

primal robin
#

yes, get_weight

storm kraken
#

awesome,,,

chrome widget
storm kraken
#

how do i work this mechanism

#

like edit an editions weight with a different card

toxic cave
#

anyone know why this only works for the first ante when the run starts but when it goes to the second ante the hidden blind re-appears?

obtuse silo
obtuse silo
lusty marten
#

hey i want to make a joker that extra x2 to card per trigger like joker Hiker , how can i do that?

lusty marten
elder rune
#

ah

lusty marten
elder rune
lusty marten
#

okay

obtuse silo
#

how do i get a list of the game's jokers

karmic prism
#

if you're talking about base balatro

#

idk man]

elder rune
#

I think he meant a list of all registered jokers within the game

obtuse silo
#

yea
so it should include mods

karmic prism
#

oh ok

elder rune
#

try to access collection ig

karmic prism
#

well idk

elder rune
#

cant help rn cause gotta do family stuff soon

daring fern
brisk tree
#

does anyone know how I would make code run right after a hand is played?

#

Outside a card specifically

#

Is there a specific function that runs that?

daring fern
brisk tree
#

but calculate only works inside of specific classes, doesn't it?

daring fern
obtuse silo
#

no wait i got it
you don't need the "config.center.key" at the end of it

vale zinc
#

G.GAME.LAPSEMS_poker_hands_played_this_ante never fills up with poker hand names. Might anyone tell me why?

SMODS.current_mod.calculate = function(self, context)
    if context.press_play then
        G.GAME.LAPSEMS_poker_hands_played_this_ante = G.GAME.LAPSEMS_poker_hands_played_this_ante or {}
        if not LAPSEMS.contains(G.GAME.LAPSEMS_poker_hands_played_this_ante, context.scoring_name) then
            G.GAME.LAPSEMS_poker_hands_played_this_ante[#G.GAME.LAPSEMS_poker_hands_played_this_ante + 1] = context.scoring_name
        end
    end
end
toxic cave
daring fern
daring fern
obtuse silo
#

third image
this only happens with my modded jokers

daring fern
vale zinc
#

Now the "Hand will not score" text flashes inconstantly without filling up. What do I do to stop that?

get_loc_debuff_text = function(self)
    local random_hand = pseudorandom_element(G.GAME.LAPSEMS_poker_hands_played_this_ante, 'bl_lapsems_nose')
    return G.GAME.blind.loc_debuff_text .. 
    localize {
        type = 'variable',
        key = 'k_lapsems_blind_example_hand',
        vars = {
            localize(random_hand, 'poker_hands')
        }
    }
end,
-- 'k_lapsems_blind_example_hand' = " [i.e.: #1#]",
obtuse silo
daring fern
brisk tree
frosty rampart
#

what version of smods do you have

brisk tree
#

1.0.0 beta 0608b

#

is this too old?

frosty rampart
#

yea that's ancient lol

brisk tree
#

Damn lmao, didn't know

frosty rampart
#

latest version came out a couple of days ago, update

brisk tree
#

I'll update it and see if it works

#

Thanks for the tip

frosty rampart
#

the mod calculate feature was added in late august, updating should get it working

vale zinc
brisk tree
vale zinc
#

Also, this Blind's "Hand will not score" text flashes over and over again without settling on one hand. How do I get it to instead display a random poker hand whenever a new selection of cards is made?

get_loc_debuff_text = function(self)
    local random_hand = pseudorandom_element(G.GAME.LAPSEMS_poker_hands_played_this_ante, 'bl_lapsems_nose')
    return G.GAME.blind.loc_debuff_text .. 
    localize {
        type = 'variable',
        key = 'k_lapsems_blind_example_hand',
        vars = {
            localize(random_hand, 'poker_hands')
        }
    }
end,
-- 'k_lapsems_blind_example_hand' = " [i.e.: #1#]",
random basin
#

where can I modify the maximum selected/played hand size?

#

and can I apply a change to that value through the card back apply_to_run() config function?

daring fern
hardy vessel
#

How would I go about ending a blind early (and potentially also removing cash out)?

frosty rampart
red flower
red flower
hardy vessel
#

On VanillaRemade, I see this functionG.FUNCS.cash_out({config = {}}) but I can't find any other resources on it

red flower
vale zinc
red flower
#

oh i didnt read the description

#

you need to just save the hands

vale zinc
# red flower you need to just save the hands

I already save the hands.

SMODS.current_mod.calculate = function(self, context)
    if context.before then
        G.GAME.LAPSEMS_poker_hands_played_this_ante = G.GAME.LAPSEMS_poker_hands_played_this_ante or {}
        if not LAPSEMS.contains(G.GAME.LAPSEMS_poker_hands_played_this_ante, context.scoring_name) then
            G.GAME.LAPSEMS_poker_hands_played_this_ante[#G.GAME.LAPSEMS_poker_hands_played_this_ante + 1] = context.scoring_name
        end
    end
end
red flower
vale zinc
red flower
#

what do you want the text to display

vale zinc
red flower
#

in debuff_hand or context.debuff_hand (whatever you use) set the random hand that the text will use

weary merlin
#

how can i make a calculate function using joker_main repeat a return multiple times?

loud summit
#

SMODS.calculate_effect

#

takes the same table as the return values but continues afterwards

chrome widget
#

Color correcting the jokers on the right........

#

Greedy and Wrathful feel like they're ever slightly off, whereas I can barely tell Lusty and Gluttenous aren't vanilla

#

Onyx Agate also is pretty noticeable

elder rune
#

is there a way to change how often certain rarities appear

viscid talon
#

finally getting back on cudgel stuff

#

@rocky plaza the cudgel boss blind is still broken

#

heres the cde

#

**code

#

idk why its rendered as a text file

#

lemme redo it as a lua

#

hold on

#

@rocky plaza what do i do

rocky plaza
viscid talon
#

thankies

chrome widget
#

A little more obvious with Seeing Double but I think that's alright

rocky plaza
# viscid talon

theres a lot that needs to be fixed so i'll send the fixed version as well as comments explaining what i fixed and changed

viscid talon
#

thank you c:

#

it was working in an older update but it stopped working and idk why

elder rune
rocky plaza
elder rune
#

thanks pookie

rocky plaza
#

...

elder rune
#

mb

#

thanks fellow human

chrome widget
#

You know what? Fuck you. Flower Pot uses the Diamonds palette

viscid talon
#

hiiii

#

oke lets check it out

#

ahhh, i see

#

so it looks like i forgot to add "round end" "round disabled" contexts

#

i will keep all of this in mind 🥺 thank you so much 😭

rocky plaza
lavish shell
#

sup, anyone got resources for how to make replacement texture for balatro? a random reddit thread said to come here

viscid talon
#

o i see i see

rocky plaza
lavish shell
#

thats literally it lmao i thought itd be cute

#

maybe maybe diamonds cat eyes, hearts cat paws, idk about spades and clubs

elder rune
rocky plaza
lavish shell
#

ty!

chrome widget
lavish shell
chrome widget
#

thank you!!!!

#

I inherently have to make some compromises to make my palette editor work but I want them to look close enough to vanilla that if you don't see a comparison you don't see the difference

charred widget
#

Does anyone have the code for cryptid's green seals? the ones that function on being played and unscoring

iron breach
#

does this seem balanced (costs $5)

charred widget
#

nevermind i think i found it

rocky plaza
rocky plaza
#

consider cryptid as like a last resort code reference

tight pumice
#

Is there a way to use SMODS.add_card to also change what edition the card to be added will have? Asking in the context of consumables

hallow slate
charred widget
hallow slate
tight pumice
#

My first resort is vanilla remade

rocky plaza
tight pumice
#

But I’ve dug into some pretty random mods to try and find examples of highly obscure roughly similar concepts

tight pumice
hallow slate
tight pumice
#

I just could not find documentation for SMODS.add_card for whatever reason

rocky plaza
#

theres docs for it

#

under the utility section

#

also the calculation section of the smods wiki was recently rewritten

tight pumice
#

Missed that section that explains it

#

I was looking all around the game objects things

rocky plaza
#

anyways, time to work on some jank ui stuff

spiral mural
#

how do i mess around wth how poker hands are calcuated///

hallow slate
spiral mural
#

this is a joker

hallow slate
spiral mural
hallow slate
spiral mural
#

pretty much anything that is requires a non-specific rank would be affected here

hallow slate
#

As well as function straight

spiral mural
#

no

#

straights can't be affected here

#

there's no sequence of suits

hallow slate
#

functions/misc_functions

#

That's the file that contains Poker Hand Parts

spiral mural
#

lovely patch...

hallow slate
#

Yeah probably. I used hooks

spiral mural
#

i mean im not completely

#

overriding the function

iron breach
#

where would i find an example of an atlas object in the vanilla remade mod

chrome widget
#

Okay finished the main suit palette

loud summit
#

how do you change what file is loaded outside of the game

#

trying to load my main save file crashes

chrome widget
#

Some of them are more egregious but I think they're close enough to vanilla to work

viscid talon
#

cudgel (unfortunately) works

#

why did i design this bos sblind

iron breach
viscid talon
#

-1 hand size per hand played

#

permanent

spiral mural
#

i hate boss blinds which affect things outside of their blind

chrome widget
#

Huh..... I'm actually not sure how to change the default atlases for playing cards

iron breach
iron breach
#

me when i accidentally make my joker and atlas files jsons instead of luas

#

i was wondering why there was so much red text

chrome widget
#

Time to overwrite get_front_spriteinfo to death

viscid talon
spiral mural
viscid talon
#

you cannot

#

there are some upcoming jokers that should make it easier to get larger hand sizes

hushed briar
#

hi folks, anyone have an idea of how i would go about adding a set of items that function like vouchers but arent included with them? like i dont want them to show up in the shop with vouchers or in the voucher tab in the collection, but i do want them to be in the voucher menu during a run or in a similar menu of its own

hushed briar
#

like should i be using SMODS.Voucher for something like that or should i create a SMODS.Consumable

slim ferry
#

since youre creating an entire new object type with custom collection and menus youre probably best off extending SMODS.Center

frosty rampart
#

you mmmmight be slightly better off extending smods.voucher and then futzing around to undo some stuff that vouchers do
extending smods.center is cleaner in the end, but requires you to re-add some stuff that vouchers do too

#

maybe i should just try extending smods.center and put together a guide on how to do that properly lmao

spiral mural
#

where is a array of suits/a array of suit keys stored?

chrome widget
#

Kills ur palette toggle for fun

lament agate
#

crash about trying to call set_ability

#

whats wrong with this

mellow marsh
#

you're copying card into G.hand, but im pretty sure that second argument is supposed to specify a card to copy onto, not an area

sage crater
viscid talon
#

x1 base

sage crater
#

WHY 😭

upper quarry
sage crater
#

oh wait nvm, needle is also X1 base

upper quarry
#

actually another question, will this work with high contrast?

candid arch
#

is there a way to make a card count as any rank for joker effects?

#

im making a joker that changes the wild card effect to counting as any rank instead of any suit

mystic river
#

currently, no
but quantum ranks any day now

candid arch
#

there's no way to do it?

#

like at all

mystic river
#

i mean. if you constructed the entire function and also took ownership of all jokers that cared about rank to make them use the function

candid arch
#

that wouldnt work with other mods

#

:I

mystic river
#

then no

candid arch
#

i mean could you maybe have the card loop thru all ranks instead of posing as all of them at once

#

or, no that;d break stuff like hack wouldnt it

mystic river
#

Card:get_id() is the current canonical method of checking rank, and it returns one number

candid arch
#

dang

daring fern
spiral mural
candid arch
daring fern
candid arch
#

what is this

daring fern
candid arch
#

how do i make this work for my joker?

candid arch
daring fern
candid arch
#

ooohh

#

i cant just, copy this code for my mod though? like wouldnt that be stealing

daring fern
candid arch
#

ah is that allowed then?

#

hm

brazen kite
#
    calculate = function(self, card, context)
        if context.change_suit and context.other_card:is_suit("Diamonds") then
            card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
        end

is there a reason this is doing jack shit

mystic river
#

change_suit only happens when a card actually changes suit (e.g. starring a diamond won't do anything)

#

also i have no idea whether context.other_card is the card before or after the suit change

chrome widget
#

There we go, seeing double's gradient is now procedurally applied from a flat color base sprite

daring fern
brazen kite
obtuse silo
candid arch
daring fern
# candid arch hm

You would put the multirank.toml in a lovely folder in your mod, then you would take the function from the second link and modify it to check for your joker.

obtuse silo
candid arch
#

i appreciate all your help! thank you so much! 😊

daring fern
hushed briar
daring fern
brazen kite
#

Yeah i figured which is why i didn't attempt it

#

Well I'll figure it out

daring fern
brazen kite
daring fern
candid arch
river grail
hardy vessel
#

Does anyone know where the check for having 0 or less hands giving you a game over is? I'm working on an effect that gives you -1 hand when setting a blind, but if you end up with 0 you don't lose

obtuse silo
daring fern
# candid arch there's a lot of parts with the "SEALS" key(?) (i think it's the mod key) in the...
local function perform_checks(table1, op, table2, mod)
    for k, v in pairs(table1) do
        for kk, vv in pairs(table2) do
            if op == "==" and v == vv then return true end
            if op == "~=" and v ~= vv then return true end
            if op == ">" and v > vv then return true end
            if op == ">=" and v >= vv then return true end
            if op == "<" and v < vv then return true end
            if op == "<=" and v <= vv then return true end
            if op == "mod" and v % vv == mod then return true end
            if type(op) == "function" and op(v, vv) then return true end
        end
    end
    return false
end

local ids_op_ref = ids_op
function ids_op(card, op, b, c)
    local id = card:get_id()
    if not id then return false end
    local other_results = false
    if ids_op_ref ~= nil then
        other_results = ids_op_ref(card, op, b, c)
    end

    local ids = {}
    if SMODS.has_enhancement(card, 'm_wild') and not card.debuff then
        for k, v in pairs(SMODS.Ranks) do
            table.insert(ids, v.id)
        end
    else
        table.insert(ids, id)
    end

    local function alias(x)
        if SMODS.has_enhancement(card, 'm_wild') and not card.debuff then return '11' end
        return x
    end

    if other_results == true then
        return true
    end

    if op == "mod" then
        return perform_checks(ids, "mod", {b}, c)
    end

    if op == "==" then
        local lhs = alias(id)
        local rhs = alias(b)
        return lhs == rhs
    end
    if op == "~=" then
        local lhs = alias(id)
        local rhs = alias(b)
        return lhs ~= rhs
    end

    if op == ">=" then return perform_checks(ids, ">=", {b}) end
    if op == "<=" then return perform_checks(ids, "<=", {b}) end
    if op == ">" then return perform_checks(ids, ">", {b}) end
    if op == "<" then return perform_checks(ids, "<", {b}) end

    error("ids_op: unsupported op " .. tostring(op))
end
daring fern
# obtuse silo hrm

card.ability.extra.card_id = pseudorandom_element(G.playing_cards, 'seed').sort_id

pastel kernel
#

hey guys

#

i'm currently on version 1224

#

i would like to inquire why config is a nil value

#

yes this is my own message, and my own screenshot

#

this is no laughing matter.

daring fern
candid arch
daring fern
candid arch
#

ahh got it!

daring fern
candid arch
#

oh shoot i guess i'd also need to diable the wild card's current effect of counting as all ranks

pastel kernel
#

there's no functions

candid arch
#

hold on a sec

daring fern
candid arch
#

you're amazing, thank you so much 🙏

#

i hope i havent been a burden with all my noob questions haha

pastel kernel
#

unless you mean in balatro, there is that

#

like the main balatro folder

#

the steam folder

daring fern
candid arch
pastel kernel
daring fern
candid arch
#

context.joker_main** sry

#

if not inside the joker's code, do i put them in main.lua?

#

i dont know of any other place to put it

daring fern
candid arch
#

gotcha!

candid arch
#

is this correct

daring fern
# candid arch in `main.lua`

No, you put the next(SMODS.find_card('j_modprefix_key')) check in every if that checks if the card is a wild card inside the ids_op function.

candid arch
#

alright

#

(in joker's code) this in theory should disable the rank effect on wild cards

#

upon testing it doesn't. might've missed something, lemme try

daring fern
candid arch
#

ack i didnt know about that, thank you

brisk tree
#

is there a way to specify which cards should be drawn next from the deck (Like a specific rank or suit)?

brisk tree
#

A joker that makes the next drawn cards match the rank of at least one of the cards in the previously played hand

#

effect doesn't trigger on the first hand of round or if the deck doesn't have any cards that match the criteria

daring fern
candid arch
#

that is what i'm using, i've got that page open on the side

#

or, well i'm hooking it which ia different i guess

#

does simply hooking SMODS.has_any_suit not work?

daring fern
pastel kernel
candid arch
daring fern
candid arch
#

ah okay

final jewel
#

Where do I need to initialise my global

daring fern
candid arch
# daring fern No, because if a card is a wild card then it can't be any suit.
[manifest] # Header for the file, this should only be here once at the beginning
version = "0.1.0"
priority = 0 # Priority for loading the file

[[patches]]
[patches.pattern]
target = 'lsp_def/utils.lua' # The file you want to patch.
pattern = '''
function SMODS.has_any_suit(card) end
''' # The line(s) you want to patch. In pattern patches it should be the whole line(s). Make sure it's unique in that file.
position = "at" # Where you want to patch it: 'before', 'after' or 'at' (this last one replaces the whole pattern)
payload = '''
if SMODS.has_enhancement(card, 'm_wild') and not card.debuff and next(SMODS.find_card('j_sxf_mr_rorschach')) then
    function SMODS.has_any_suit(card) return false end
end
''' # What code you want to replace it with.
match_indent = true
#

how's this

#

i found the definition for has_any_suits in this file utils.lua

olive path
#

any documentation that explains how to use the patches lovely.toml file?

daring fern
candid arch
#

what about the target?

daring fern
candid arch
#

thank you!

candid arch
#

fsr the rank effect doesnt work with smiley face/scary face, but it does work for shoot the moon. i guess i also need to add the face catagory and not just have the specific face ranks?

#

@daring fern how would i go about that

daring fern
candid arch
#

got it.

#

does it matter if i do it in joker code or main.lua

#

i wouldve just put it in main.lua for consistency

daring fern
candid arch
#

oh! i had no idea, thanks for the tip :]

#

how come you shouldnt? does it cause any sort of issues?

sturdy compass
#

I think they mean don't hook inside of the joker init object itself. You are free to hook inside of the files as long as they're outside of the object inits

candid arch
#

ohh, i guess that also works! what would happen if you did it specifically inside a joker's init?

sturdy compass
#

It just wouldn't work lmao

candid arch
#

how would i change the enhancement description while this joker is active? just like changing "suit" to "rank"

daring fern
candid arch
#

is there an example of that on the wiki?

iron breach
#

i love when modded balatro crashes with no crash report

harsh belfry
#

i mean

#

you can see the take ownership page

harsh belfry
# candid arch is there an example of that on the wiki?
SMODS.Joker:take_ownership('joker', -- object key (class prefix not required)
    { -- table of properties to change from the existing object
    cost = 5,
    calculate = function(self, card, context)
        -- more on this later
    end
    },
    true -- silent | suppresses mod badge
)
#

this is for jokers

#

instead of SMODS.Joker it would be SMODS.Enhancement

#
SMODS.Enhancement:take_ownership("wild", {
  loc_vars = function (self, info_queue, card)
      if next(SMODS.find_card("j_MODPREFIX_JOKERKEY")) then
          return { key = "m_wild_rank" }
      end
  end
})
#

and you would add an enhancement entry in the localization

#

            m_wild_rank={
                name="Wild Card",
                text={
                    "Can be used",
                    "as any rank",
                },
            },
#

like that

candid arch
#

oooh!

#

oh, i guess now would be a good time to port all the descriptions and names of my jokers into a proper loc file huh

#

i wasnt doing that up until now

harsh belfry
#

yeah theres certain things you just

#

can't do

#

no multibox either

candid arch
harsh belfry
#

actually impossible

#

loc_txt is deprecated

#

so it does not get any new features

candid arch
#

oh what??

harsh belfry
#

(deprecated meaning it won't be removed but it also isn't recommended for use and will not be worked on)

candid arch
harsh belfry
#

yes

#

or wherever you've made that joker

#

(also remember to replace the MODPREFIX_JOKERKEY placeholder!)

candid arch
#

how can i make the new wild card effect count towards poker hands? right now it really only works with joker effects, but the wild cards arent counted for actual poker hands (if i had 5 differently ranked wild cards, it wouldnt give me a 5oak, for example)

frosty rampart
#

either a lot of manually-coded effort (check how cryptid maximized works possibly? and even then that's not exactly what you need, since it makes cards count as one extra specific rank) or waiting for the quantum ranks pull request to finally get merged (which will handle all the difficult stuff for you)

#

calculating how straights work with wild ranks like this in particular is kind of tricky. although entropy does have a joker that handles it with stone cards filling in gaps in straights

candid arch
#

ahhh i guess that does seem complex

#

maybe i won't worry about that for now then, since wilds dont change the card's chip value with mr. rorschach in your deck

#

so they prob shouldnt affect poker hands either

#

might be confusing to players though, i'll probably add a note in the joker description

lusty marten
#

hey , are there any code to trigger joker from right to left?

lament agate
#

is there another condition for consumables to be usable regardless of room?

#

because

#
can_use = function(self, card)
        return G.consumeables and true or false
    end
#

doesnt work

daring fern
daring fern
harsh belfry
#

it screws with poker hands

#

and it affects the face and number detection

#

plus probably more

#

it doesn't cover everything

#

though

#

that being said it isn't great for if you want multiple ranks

daring fern
harsh belfry
#

why do you think i posted that lmao

#

i saw that those two contained self:get_id

daring fern
harsh belfry
#

its right there bro

#

self:get_id

#

oh wait

#

what??

#

why doesn't it

#

lmao

#

ig its just the stone check

#

but that could be done with a simple rankless check

daring fern
harsh belfry
#

theres a function for that

#

that get_id calls

#

whats the point

#

just use the function

daring fern
# lament agate bump

You mean you want your consumable to be able to be obtained without needing room?

lament agate
#

this consumable creates another negative consumables regardless the room is full or not

candid arch
#

i sold the joker that makes wild cards act as any rank instead of any suit, but they still get debuffed by the Plant

chrome widget
#

Does anyone know an effective way to override the atlases of Vanilla suits? Rather than using a deckskin, I specifically need to replace the default low contrast atlas

daring fern
errant fulcrum
chrome widget
#

Nope

#

Technically so, but I had to directly edit the existing palette table/map for the vanilla suits, which doesn't seem to be currently supported with take_ownership (which just early returns if the key's already been registered)

junior tapir
#

I'm trying to use SMODS.Gradient, but something doesn't work quite right, can anyone tell why? The mod Balatro Gardens has identical use of the SMODS functionality, but when I try it it doesn't work

SMODS.Gradient {
    key = "buried_treasure",
    colours = {
        HEX("f1f9ff"),
        HEX("9ed1f2"),
        HEX("b6ab95")
    }
}
-- {C:CTEH_buried_treasure}
wintry solar
#

Make your key for the colour all lower case

junior tapir
#

you mean no underscore? doesn't work even like that

#

whaaat, is the mod prefix not case sensitive????

wintry solar
#

Colour keys are made lower case

#

Specifically for text styling only

junior tapir
#

so it is not case sensitive in a niche scenario, otherwise is? I'd have to try

#

nope, never has been case sensitive

#

so it's always better to have it lowercase, unless I don't know about another niche scenario that would require uppercase

#

which I doubt there is

wintry solar
#

Nothing requires any casing requirements, in almost every situation your mod prefix will be exactly how you defined it, just for colour keys in text styling it is forced to be lower case (I don’t recall the reason why, might be some vanilla jank)

elder rune
#

How do you check if a specific card is a Joker

daring fern
elder rune
#

yeah I just found that out

storm kraken
wicked leaf
#

im trying to make a joker that triggers when the joker to the left triggers but I cant quite figure it out

daring fern
wicked leaf
#

thank you

sleek valley
#

i've been trying to figure this out since last night, i cant make the seal score properly

#

im just trying to test right now with only the chips modifier and i cant figure it out

wintry solar
#

function(self, card, context)

sleek valley
#

...somedays i wish i wasnt just figuratively blind

#

thank you though

copper thorn
#

hello again, been a long time since i've been there, i need help

how to i make a custom small text beside a jokers description like the screenshot (and how do i associate it with any joker) ?

umbral zodiac
#

what's in ... changes depending on what youre trying to do

#

for a joker itd be G.P_CENTERS.joker_key, for example info_queue[#info_queue+1] = G.P_CENTERS.j_joker

barren sentinel
umbral zodiac
#

i have not

#

curseforge has been open for 4 days

copper thorn
maiden phoenix
#

Rate the fit

upper quarry
#

gas

sleek valley
#

credit or debit ahh haircut

#

10/10

cunning bison
random basin
#

game crashes upon opening the hand types menu, most likely coded the localization wrong:

en-us.lua:

            Mahjong = "A standard Mahjong hand consisting of",
            "4 sets of Pungs or Chows and a Pair.",
        },
        poker_hands = {
            Mahjong = "Mahjong",
        }```
pokerhands.lua:
```SMODS.PokerHand {
    key = "Mahjong",
    mult = 12,
    chips = 160,
    l_mult = 6,
    l_chips = 60,
    example = {{'S_A', true}, {'S_A', true}, {'S_2', true}, {'S_3', true}, {'S_4', true}, {'S_5', true}, {'S_6', true},
               {'D_7', true}, {'D_8', true}, {'D_9', true}, {'H_5', true}, {'H_5', true}, {'H_5', true}, {'H_5', true}},
    evaluate = function(parts, hand)
        if not #hand ~= 14 then
            return
        end
        if #parts._2 ~= 1 then
            return
        end
        local pungs = #parts._3
        local chows = get_chow(hand)
        local chow_count = #chows
        if pungs + chow_count < 4 then
            return
        end
    end
}
...```
#

i'll test if it's because the game can't handle 14 items in the example array still crashes

red flower
iron breach
#

also it doesn't trigger on a hand

elder rune
copper thorn
red flower
#

emplacing also misses add_to_deck

random basin
#

unless i'm copying the example from vanillaremodded wrong

#
                "If the played hand is not any of the above",
                "hands, only the highest ranked card scores",
            },```
red flower
random basin
#

let me restart the run

red flower
#

oh yeah youre missing the prefix also

random basin
#

the prefix?

elder rune
#

mod prefix

random basin
#

oh

red flower
random basin
#

[modtitle_key] then right

red flower
#

yes

#

unless by title you mean the mod name in which case no

random basin
#

the id in the mod json I assume

red flower
#

no

#

the prefix in the json

#

its a different field

iron breach
random basin
#

ah i'm stupid

elder rune
#

idk

lament agate
#
pos = { x = 2, y = 1 },
    config = { max_highlighted = 2, odds = 2 },
loc_vars = function(self, info_queue, card)
    local n, d = SMODS.get_probability_vars(card, 1, card.ability.odds, 'withering_chance')
    return { vars = { card.ability.max_highlighted, n, d } }
end,
use = function(self, card, area, copier)
    local targets = area.highlighted
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 0.4,
        func = function()
            play_sound('tarot1')
            card:juice_up(0.3, 0.5)

            for i = 1, #targets do
                local c = targets[i]

                c.debuff = true
                c:juice_up(0.25, 0.3)

                if SMODS.pseudorandom_probability(
                    card,
                    'geekedupplayingbalatroallday' .. i,
                    1,
                    card.ability.odds
                ) then
                    c.ability.repetitions = (c.ability.repetitions or 0) + 1
                    play_sound('bd_inapmit', 1, 0.7)
                end
            end
            return true
        end
    }))

    delay(0.6)
end

this doesnt do anything when used, am i doing it wrong

red flower
lament agate
#

when used

random basin
#

sick, lots of issues but at least that's squared away

lament agate
#

could it be the odds?

iron breach
#

i'm getting a crash that's saying something about "[SMODS _ "src/utils.lua"]:583: bad argument #1 to '(for generator)' (table expected, got string)" after i changed some code in tags

obtuse silo
#

do i really have to make this object type this way-

normal crest
obtuse silo
#

i see

cunning bison
cunning bison
#

hmmm, no error either right? maybe if you paste the full obj I can try debugging locally for a bit

lament agate
#

heres the obj

#
    config = { max_highlighted = 2, extra = {odds = 2} },
loc_vars = function(self, info_queue, card)
    local n, d = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'withering_chance')
    return { vars = { card.ability.max_highlighted, n, d } }
end,
use = function(self, card, area, copier)
    local targets = area.highlighted
    G.E_MANAGER:add_event(Event({
        trigger = 'after',
        delay = 0.4,
        func = function()
            play_sound('tarot1')
            card:juice_up(0.3, 0.5)

            for i = 1, #targets do
                local c = targets[i]

                c.debuff = true
                c:juice_up(0.25, 0.3)

                if SMODS.pseudorandom_probability(
                    card,
                    'geekedupplayingbalatroallday' .. i,
                    1,
                    card.ability.odds
                ) then
                    c.ability.repetitions = (c.ability.repetitions or 0) + 1
                    play_sound('bd_inapmit', 1, 0.7)
                end
            end
            return true
        end
    }))
    delay(0.6)
end
cunning bison
lament agate
#

thought its unnecessary

#
SMODS.Consumable {
    atlas = "consumisprints",
    key = 'hangedprint',
    set = 'mistarot',
    pos = { x = 2, y = 1 },
        config = { max_highlighted = 2, extra = {odds = 2} },
    loc_vars = function(self, info_queue, card)
        local n, d = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'withering_chance')
        return { vars = { card.ability.max_highlighted, n, d } }
    end,
    use = function(self, card, area, copier)
        local targets = area.highlighted
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('tarot1')
                card:juice_up(0.3, 0.5)

                for i = 1, #targets do
                    local c = targets[i]

                    c.debuff = true
                    c:juice_up(0.25, 0.3)

                    if SMODS.pseudorandom_probability(
                        card,
                        'geekedupplayingbalatroallday' .. i,
                        1,
                        card.ability.odds
                    ) then
                        c.ability.repetitions = (c.ability.repetitions or 0) + 1
                        play_sound('bd_inapmit', 1, 0.7)
                    end
                end
                return true
            end
        }))
        delay(0.6)
    end
}
random basin
#

Anyone have documentation/examples for SMODS.PokerHandPart?

cunning bison
junior tapir
#

I'm trying to do some kind of fading effect on joker names (which clearly doesn't work right now but that's not the point), but if I use variables that are string concatenations, this happens: the Nth letter of each concatenated string is synched up with all other Nth letters of the rest of the strings, and if the entire string is a concatenation of singular characters, then the 'First' effect is in place (it treats them all as 'first letter')
Code: ``` name = Fade_Gradient({HEX("009CFD"),HEX("A267E4"),HEX("E8463D"),HEX("F7AF38")},'quad_dice','First',false,0) .. '{C:cteh_wild_seals}Second'..'{C:cteh_wild_seals}Third'

Here is also some video footage (all concatenation string is also weirdly spaced out :/ )
Maybe there is a way in Lua to remove this weird effect, any clues?
#

Even if you have the joker name be name = 'J' .. 'o' .. 'k' .. 'e' .. 'r', they would too be all synchronized, I haven't used the exact same implementation in the example (the Fade_Gradient functions kinda acts like a black box), but I think I delivered the message

red flower
iron breach
#

is there a way to set the suit or rank of a card with a joker similar to how midas mask makes face cards gold

red flower
iron breach
#

thx

junior tapir
red flower
#

ah you mean the animation?

junior tapir
#

oh wait, no I'm dumb

red flower
#

that's normal, the game generates a new dynatext for each block

junior tapir
#

without color stuff works fine

red flower
#

yeah because the color generates a ui element

#

no real way to fix it without changing how the text is displayed

cunning bison
lament agate
#

i forgot how

iron breach
#

the description shows nil for the suit variable and the change_base utility doesn't do anything

red flower
iron breach
#

forgot to mention i replaced suit in the change_base to G.GAME.current_round.wath_mod_rainbow_joker.suit

red flower
#

i recommend wrapping it in assert like the docs recommend if it still doesnt work

#

that lets you know what the error is

iron breach
#

wrapping the change_base or the calculate?