#💻・modding-dev

1 messages · Page 701 of 1

brittle yacht
#
        if context.end_of_round then
            if context.main_eval then
                if SMODS.last_hand_oneshot then
                    G.GAME.interest_amount = G.GAME.interest_amount * card.ability.extra.interest
                end
            end
        end
    end,```
also it still gave me $9 even though i didnt have the joker
red flower
#

im assuming you reset the run

glossy dagger
#

oh, i see

brittle yacht
red flower
#

well this is a permanent change

brittle yacht
#

oh

red flower
#

if you want it to go back you need to reset it in remove_from_deck

glossy dagger
#

i will do a lil debuggin now thinking

#

first time i think

#

i have to make the joker dont trigger debuffed cards

red flower
#

check raised fist :3

brittle yacht
#

okay wait

#

n'

#

im confused

glossy dagger
brittle yacht
#

the joker is supposed to triple the FINAL amount of interest gained at the end of round ONLY IF you win with fire effects

glossy dagger
#

I DID MY FIRST SOLO DEBUGGIN, LETS GOOOO

brittle yacht
#

and this is what i have

glossy dagger
brittle yacht
#

with 20 dollars
20/5 = 4
4*3 = 12
NOT 36

#

or am i stupid

red flower
#

it should be 12 yeah

brittle yacht
#

so why is it 36

red flower
#

again, are you resetting the run

glossy dagger
#

Parentesis??

#

idk

brittle yacht
#

sorry yeah mb hold on

red flower
#

if you want it to only happen for that round you should reset it in both remove_from_deck and in context.starting_shop (making sure you only do it once)

#

also the opposite of multiplication is division not subtraction lol

brittle yacht
#

14/5 = 2.whatever
2*3 = 6

#

okay 6 is what i got

glossy dagger
#

The second most simple joker in the mod by far

#

(Placeholder)

brittle yacht
#

okay i played one with fire effects and got 6 (which is correct, i had 14)
and then i played one without fire effects and got 5 (which is correct, i had 25)
and then i played another one with fire effects and got 5 (which is incorrect, i had 36)

brittle yacht
#
        if context.end_of_round then
            if context.main_eval then
                if SMODS.last_hand_oneshot then
                    G.GAME.interest_amount = G.GAME.interest_amount * card.ability.extra.interest
                end
            end
        end
        if context.starting_shop then
            G.GAME.interest_amount = G.GAME.interest_amount / card.ability.extra.interest
        end
    end,

    remove_from_deck = function(self, card, from_debuff)
        G.GAME.interest_amount = G.GAME.interest_amount / card.ability.extra.interest
    end,```
#

what did i do wrong this time

red flower
#

15 i think

#

since theres a cap

brittle yacht
#

oh yeah

#

but it still isnt correct

red flower
#

the problem is that you are always resetting the value

#

you only want to do it when you increase it

brazen rock
#

need a little help here:

    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            if next(SMODS.get_enhancements(card)) then
                return {
                    Xmult = 2
                }
            else
                return {
                    mult = 15
                }
            end
        end
    end

what should happen is that enhanced cards should give X2 mult, but they give +15 for some reason..?
idk what im doing wrong

fading rivet
#

any idea why this won't modify the cards rank
it works if I call it manually with debugplus

#

replacing _card with dp.hovered

brazen rock
#

nevermind im stupid

#

i got confused with editions and enhancements

naive coral
#

how can i make sure that the joker in the shop is selectable, but not in the joker cardarea? this is the original hook but i cant figure out how to make it work

function CardArea:add_to_highlighted(card, silent, ...)
    if card.config.center.key == "j_Krypton_LiamCat" or card.config.center.key == "j_Krypton_UltimaJungle then 
        return nil 
    end         
    return StayTheStill(self, card, silent, ...)
end```
red flower
naive coral
# red flower card.area and card.area == G.jokers
function CardArea:add_to_highlighted(card, silent, ...)
    if card.config.center.key == "j_Krypton_LiamCat" or card.config.center.key == "j_Krypton_UltimaJungle" and card.area and card.area == G.jokers then 
        return nil 
    end         
    return StayTheStill(self, card, silent, ...)
end

like this?

red flower
#

yes

naive coral
#

it doesnt seem to prevent the joker from being unselectable in the shop

red flower
#

what about self == G.jokers

naive coral
#

```` if card.config.center.key == "j_Krypton_LiamCat" or card.config.center.key == "j_Krypton_UltimaJungle" and self == G.jokers then ``` like that?

fading rivet
#

what the equivilant for SMODS.Jokers for enhancements?

red flower
#

SMODS.Enhancements?

glossy dagger
#

I have a doubt

fading rivet
#

already tried that lol, hence why i'm asking

red flower
#

there might not be one

fading rivet
#

weird

#

P_CENTER_POOLS then ig

glossy dagger
#

I am doing a joker that gives -15 mult (Dont ask (Is balanced, i swear)) but i want to do it only if mult is more than 20

fading rivet
#

iirc

#

mult and chips are global variables

red flower
glossy dagger
#

I think something like this but with a if and some things

fading rivet
glossy dagger
#

like, if mult > 20 return -15 mult

#

but i know is not just mult

#

because is a global variable

glossy dagger
fading rivet
#

thas all you need

glossy dagger
#

I kinda knowed it

red flower
glossy dagger
#

oh

red flower
#

not for subtracting mult in an effect

glossy dagger
#

thanks

fading rivet
#

I need to get the loc_vars and use of another mods consumable

red flower
#

consumables should be the same

glossy dagger
#

i need to do a joker trigger something after scoring a hand

#

like

#

before ending a hand but after all cards score

red flower
#

context.after

glossy dagger
#

thanks

uneven drift
#

Is there a way to make played cards shuffle back into your deck? Thinking about making a joker that causes the first hand you play each round to be shuffled back in, but idk 🤔

glossy dagger
#

i think balatro just cant use negative values

uneven drift
fading rivet
#

kyofu all back

glossy dagger
#

help

fading rivet
glossy dagger
#

btw, already proved that negative values can exist, a friend has this joker in his jokerforge mod

fading rivet
glossy dagger
fading rivet
#

do mult = value and chips = value, not mult = {value} or {chips = value}

glossy dagger
#

oki doki

fading rivet
cinder elk
#
SMODS.Joker {
    key = 'chaosquartet',
    atlas = 'StarterPackJokers',
    pos = { x = 6, y = 5 },

    rarity = 3,
    blueprint_compat = true,
    cost = 2,
    discovered = true,

    config = {
        extra = {
            xmult = 2, mult = 15
        }
    },

    calculate = function(self, card, context)
        
        if context.cardarea == G.jokers and context.joker_main then
            if playing_card:is_suit("Hearts") then
                hearts = true
            end
            if playing_card:is_suit("Diamonds") then
                diamonds = true
            end
            if playing_card:is_suit("Clubs") then
                clubs = true
            end
            if playing_card:is_suit("Spades") then
                spades = true
            end
        end
        local all_suits = hearts and diamonds and clubs and spades
        if all_suits and context.poker_hands["Four of a Kind"]then
            return {
                    mult = card.ability.extra.mult,
                    Xmult = card.ability.extra.xmult
                }
        end
}

trying to make it so that it procs on four of a kind that is all 4 suits

glossy dagger
fading rivet
#

but yes thats correct

#

oh context.after won't score

#

use context.final_scoring_step

fading rivet
cinder elk
#

you got it boss!

glossy dagger
fading rivet
glossy dagger
fading rivet
#

no

#

the global is hand_chips

lament cloud
#

Question, I have a set of jokers i've made, and want to create a booster pack that only displays from those jokers- ( pool of 10 )

Is there a way to do this ToT, I tried making a global function to generate the card keys randomly and force them but- it works, but it doesn't account for the joker dupilcating so i want to ask if there's like a built in api for this or ralsei_dies

red flower
red flower
uneven drift
glossy dagger
#

what is the hand_chips equivelant for mult?

#

because i think is not hand_mult

fading rivet
glossy dagger
#

sorry for asking, how i can see the amount of hands remaining?

#

probably is in a page but i cant find it

red flower
uneven drift
#

was already considering doing that

#

I mean I guess thats not necessarily a buff either, sometimes u wanna play trash to dig into ur good stuff

#

hmm

#

could also make it so cards with enhancements/editions shuffle, but not "useless" cards

#

hmmmm

#

this might be better as an enhancement after all

#

Actually, imma make it every card you play. I've decided 🔥

#

Anyway, thanks for the help!

#

Hikers best friend

glossy dagger
lament agate
#

How do you make initial release for your Mod in GitHub?

torn thunder
#

push the changes to the repo & then go to the repo on github & look where it says "create a new release"

lament agate
#

Thank You

verbal torrent
#

It crashed

#

Unknownly

naive coral
#

is there anyway to make a custom card destruction effect, like how glass shatters instead of the burning(?) animation that cards normally have when destroyed?

fading rivet
#

how can I get a consumable object of another mod to hook its functions

#

something like this but SMODS.Consumables doens't exist

#

okay this problem has been solved

#

keep getting this crash now

#

nvm fixed it

#

needed to use SMODS.Spectral

umbral spire
#

How would a give a Joker (from my mod) "another life", and when it's sold/destroyed, it comes back (only a certain amount of times)

daring fern
umbral spire
#

I've read that I can use {T:v_crystal_ball} to create a tooltip on text hover, but how can I create my own tooltip?

#

I didn't really get this

umbral spire
red flower
#

that's not what you need then

umbral spire
#

how do i retrigger a joker?

narrow prawn
#

is there a way i can make an enhancement make a card score no chips at all?

red flower
red flower
umbral spire
brazen rock
#

how do i make the description for a modded seal appear next to a consumable?
cant seem to figure it out
tried using SMODS.Seals.[seal] but that doesnt work

silk latch
brazen rock
wintry solar
wispy falcon
#

How do I get the discovered consumables from the collection? Like, from my consumable type specifically

umbral spire
#

im trying to make a thing where it "revives" a joker if sold/destroyed, but the "Saved" message appears and THEN it destroys, so ig this happens too early, how can I make this happen later?

    if (context.destroy_card and context.destroy_card == card) or context.selling_self then
        if fv.walnut_stock and fv.walnut_stock > 0 then
            card.getting_saved = true 

            return {
                no_destroy = true,
                message = "Saved!",
                colour = G.C.FILTER,
                func = function()
                    G.E_MANAGER:add_event(Event({ -- fx
                        trigger = 'immediate',
                        func = function() card:juice_up(0.8, 0.5); return true end
                    }))
                    G.E_MANAGER:add_event(Event({ -- delay/update
                        trigger = 'after',
                        delay = 0.6,
                        func = function()
                            fv.walnut_stock = fv.walnut_stock - 1
                            card_eval_status_text(card, 'extra', nil, nil, nil, {
                                message = "-1", 
                                colour = G.C.FILTER
                            })
                            
                            card.getting_saved = nil 

                            if fv.walnut_stock <= 0 then
                                fv.walnut_stock_flag = false
                                for i, row in ipairs(card.ability.extra_rows) do
                                    if row.key == "fv_walnut_stock" then
                                        table.remove(card.ability.extra_rows, i)
                                        break
                                    end
                                end
                            end
                            return true
                        end
                    }))
                end
            }
        end
    end
#

also, how can I add a rarity badge, like how Jokers have, to a consumable?

mystic river
#

alternately i'm told appending G.P_SEALS[seal_key] works just like a center?

wintry solar
#

it does now, yeah

glass crown
#

how could i go about making it so that a certain enhancement doesnt appear in the collection?

sturdy compass
#

Add no_collection = true to your Enhancement

glass crown
#

thank you!

brittle yacht
#
        if context.end_of_round then
            if not SMODS.last_hand_oneshot and G.jokers and #G.jokers.cards < G.jokers.config.card_limit then
                G.E_MANAGER:add_event(Event({
                    trigger = 'after',
                    delay = 0.4,
                    func = function()
                        SMODS.add_card({ set = 'inv_food' })
                        card:juice_up(0.3, 0.5)
                        return true
                    end
                }))
                delay(0.6)
            end
         end
    end,```
this creates one of each in the pool, why is that
#

its meant to create just 1 card from that pol

red flower
#

end of round is called a bunch of times

brittle yacht
#

oh yeah

versed swan
#

Does anyone have an example of using ref_table/ref_value in a UINode that doesn't define func or button?

#

I'm reading the UI guide and apparently ref_table can be passed to "UI nodes" (implying directly to the UI nodes themselves?)

#

nvm got it - the text in G.UIT.T can be ref_table[ref_value]

elder rune
umbral spire
elder rune
#

Well, create a badge with the rarity ig

versed swan
red flower
versed swan
#

Does it? Trying to look around and I'm not finding anything

#

or maybe my regex is inadequate

hard kayak
#

Does set_badges also work with jokers?

red flower
red flower
hard kayak
#

Oh cool

#

Time to go back and update every single bunny joker to have the bunny badge through set_badges

red flower
versed swan
#

that's a good point

#

I went with the mindset that ref_table[ref_value] is dynamic so I was concerned with this implementation

brittle yacht
#

how do i check if the player has high contrast cards enabled?

faint yacht
#

G.SETTINGS.colourblind_option?

brittle yacht
#

whats with the ?

#

is that what you think it might be

#

or am i an idiot

faint yacht
#

Inferring from a search through the game code itself.

brittle yacht
#

ah

brittle yacht
#

hi!

umbral spire
brittle yacht
#

😄

#

what would be the if statement for a seal that does something

#

ONLY IF the card under the seal is a face card

brittle yacht
versed swan
umbral spire
brittle yacht
versed swan
versed swan
#

I'll show with a screenshot, but first can you edit that post so that the first ``` has a "lua" after it? for syntax highlighting

versed swan
#

(and also remove func since it's become empty)

#

func is called after the rest of the arguments in the return table are processed

umbral spire
versed swan
#

Yeah, this should destroy the card and then show the "Saved" message

brittle yacht
#

my uh

#

loc_vars #1# doesnt work on my seal

#
        return { vars = { card.ability.extra.mult } }
    end,```
```config = { extra = { mult = 5 }, },```
primal robin
#

card.ability.seal.extra.mult

brittle yacht
versed swan
sour garden
#

making a blueprint joker that copies the effect of the last purchased joker, but the console keeps getting spammed with Found effect table with no assigned repetitions during repetition check
do i need to return a repetition with this? the joker works fine otherwise

cinder elk
#

anyone know where i can find blank joker art of stuff like cavendish, flower pot, turtle bean, etc

brittle yacht
#

it's not context.other_card:, right?

brittle yacht
#

but i have no idea

umbral spire
# versed swan ...huh

I'm not sure if this changes anything but that stuff is used in cookielatro.calculate_building_bonuses()

the calculate function is here

    calculate = function(self, card, context)
        local special_ret = cookielatro.calculate_building_bonuses(card, context)
        if special_ret then return special_ret end

        if context.individual and context.cardarea == G.play then
            local fv = card.ability.extra.flavored_cookie_bonuses
            local total_gain = card.ability.extra.chip_mod + (fv.a_chips_per or 0)
            card.ability.extra.chips = card.ability.extra.chips + total_gain
            
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.CHIPS,
                card = card
            }
        end

        if context.joker_main then
            local ret = { chips = card.ability.extra.chips }
            cookielatro.calculate_building_bonuses(card, context, ret)
            return ret
        end
    end

and the calculate_building_bonuses looks like

red flower
brittle yacht
#

im so smart

versed swan
#

I'm beginning to realize that the destruction is probably not what you want

#

I'm fairly certain you're using the wrong context for destruction prevention, only this context and context.check_eternal uses no_destroy

#

but I'm not sure if it counts sold Jokers

brittle yacht
# red flower `card`

so like this???
if context.cardarea == G.play and context.main_scoring and context.card:is_face() then

versed swan
#

context.destroy_card doesn't recognize no_destroy in the return table

#

but context.joker_type_destroyed does

umbral spire
versed swan
#

Yeah, try it out

#

just make sure to use context.card for comparing

#

(and again, I don't know if it counts sold Jokers - in which case your implementation will be a bit more involved)

umbral spire
#

or remove the selling_self too?

versed swan
#

You might have to, it doesn't recognize no_destroy

#

(also my apologies for my uncertainty, I'm not familiar with this, I'm just reading off of documentation)

umbral spire
versed swan
#

damn

#

Yeah destruction prevention with selling will require some additional implementation on your end - I can't really help with that because I personally suck at working with the technical stuff of object calculation, but there might be someone else who could help with that

umbral spire
versed swan
#

It's not impossible at all, but it'll require some hooks/patches (unless someone PRs Steamodded to add no_destroy for even more contexts)

umbral spire
#

Atleast it's possible.

naive coral
#

how do i change the VFX that happens when a card is destroyed, like how glass shatters?

glass crown
#

how do you change the lang information of a card dynamically? i thought i knew how to do it but my implementation here doesnt seem to be working

umbral spire
slim ferry
#

youre just returning an additional arbitrary value outside of vars currently

glass crown
#

ah icic okay

umbral spire
#

it works

#

i did

#

it

#

im so big brain

#

i did soem hook (Card:destroy & Card:start_dissolve) and then it did the right order (*Destroy*, "Saved!", "-1") but didnt regen the card afterwards, so i just manually regenerated it and boom

#

@versed swan ^

versed swan
#

That's awesome

umbral spire
versed swan
#

It is what it is

#

tale as old as time, like 5 hours to solve 1 problem

hard kayak
# red flower yeah

in localize('k_your_string'), where does the 'k_your_string' go in the localization file (I don't know if you want reply pings or not but if you don't I won't do this again)

slim ferry
#

you would have a k_your_string = "something" under misc.dictionary

hard kayak
#

Is the "k" needed?

fading rivet
#

honestly i'm pretty sure no

frosty rampart
#

yea it's not

#

it's just a standard for... something in vanilla

hard kayak
#

oh

frosty rampart
#

i forget what it actually denotes

fading rivet
frosty rampart
#

i know _ex at the end means the message has an exclamation point at the end of it

silk latch
primal robin
slim ferry
fading rivet
slim ferry
#

theres like

hard kayak
#

hell yeah, it works now

slim ferry
#

a bunch of random different letters before different stuff

fading rivet
#

which are deliberately not prefixed

slim ferry
frosty rampart
primal robin
#

b_ is button, ph_ is phrase, _ex is exclamation mark, _q is question mark

slim ferry
#

okay...

#

but then

primal robin
#

ml_ is multiline

slim ferry
#

what is a_ and k_ primarily

primal robin
#

a_ is for displaying common effects such as +mult, +chips, +hand size + hands etc

#

mainly for messages returned by calculate or card_eval_status_text

wintry solar
#

a_ is for add, no?

umbral spire
# umbral spire i did soem hook (Card:destroy & Card:start_dissolve) and then it did the right ...

fixed my Card:start_dissolve to support "slicing" jokers like Madness/Dagger

local card_dissolve_ref = Card.start_dissolve
function Card:start_dissolve(dissolve_colours, skip_no_count, delay, quit_after)
    if self.ability and type(self.ability.extra) == 'table' and self.ability.extra.is_building then
        local fv = self.ability.extra.flavored_cookie_bonuses
        if fv and fv.walnut_stock and fv.walnut_stock > 0 then
            cookielatro.trigger_walnut_save(self)
            return
        end
    end
    return card_dissolve_ref(self, dissolve_colours, skip_no_count, delay, quit_after)
end

now im pretty sure it'll save the joker from any type of destruction

primal robin
#

I mean yes but not only

#

But a_ as add makes sense

wintry solar
#

I would guess it started as just add things and then thunk put some similar messages there and didn't want to change the prefix

primal robin
#

Assuming this exist, it started as-is, and ended as-is

#

so, does not really matter which prefix/suffix you use, kinda

#

But I still believe that you need prefix everything

slim ferry
#

i only do my mod prefix

red flower
hard kayak
#

understood

#

I will try to keep reply pings off then

versed swan
#

Does anyone have any examples of how to useG.UIT.B? It feels quite unintuitive for me to use

primal robin
#

it's a box thish purpose is do nothing and just fill a space

#

you don't have to use it

#

I personally don't use it at all because R/C with minw/minh does the job pretty well

versed swan
#

I think it does a little more than that

primal robin
#

it's just invalid layour right there

versed swan
#

(text are wrapped in G.UIT.R)

primal robin
#

this happens when you mess with element which act as row and element which act as column

versed swan
#

So it's only intended to be used with G.UIT.Cs?

primal robin
#

idk what's it intented for, I dont use it because no point

fading rivet
versed swan
#

Ah

#

That makes sense

primal robin
#

technically they're columns

#

text and objects are columns too

amber turret
#

help plz

#

im trying to make a planet card-like consumable

eternal badger
#

What is the varient of {C:chips}+#1# for mult?

fading rivet
eternal badger
#

thanks!

#

i fixed it, i missed a =

fading rivet
fading rivet
#

you want it to look like this

naive coral
#

how can i change the "label" color of an enhancement? (the color of the background of the text)

#
                SMODS.destroy_cards(card)
            end``` 
Is this how you make a playing card destroy itself after scoring? because its not working and im not too sure why
torn thunder
naive coral
#

true, im forgor

red flower
#

i added that but i dont remember the exact name

#

it should be in api documentation

#

oh i read the text 😭

#

well it should also be documented there

near coral
#

Can someone help me like fix this first page

#

It's meant to be untouched by the added blinds but that doesn't seem to be the case

#

The second page is meant to mirror the first page, just with my mod's counterparts

red flower
#

why is it missing blinds 😭

near coral
#

They're on the second page

red flower
#

do you take ownership of the vanilla ones

near coral
#

Or is that what locks them in place

red flower
#

that's what I'm assuming scrambles them because I've never seen that before

near coral
#

I don't know since I didn't do the coding but I can send you the build and you can check for yourself if that's fine

red flower
#

ok

near coral
#

It's a test build so if you find anything incomplete or broken beyond the blind order that's why

weak grove
#

How to set the blind req to a number? example: 10000 -> 1341

red flower
#

seems to be this part

#

i commented it out and it orders them correctly

near coral
#

So you fixed it?

red flower
#

no, i removed that

near coral
#

I meant fixed the blind order

#

For vanilla

#

Stakes

red flower
#

yes

near coral
#

I mean blinds

#

Not stakes

red flower
#

yes

near coral
near coral
# red flower yes

Thanks, can you compress it and send it here since it's already done

red flower
#

i said it's not a fix 😭

#

it is fixed but i removed something to do it

near coral
#

Yes

red flower
#

idk if it's important for something else

red flower
near coral
#

I can just unzip the build I have now if it does break something

red flower
#

it will break this patch

near coral
#

What does that do exactly

#

The pool boss blinds

red flower
#

it makes a pool of some blinds

#

idk its your mod

near coral
#

Anyway so the issue did lie in taking ownership of the vanilla blinds

#

Is that correct

red flower
#

the mod doesn't do that actually

#

the issue is in the way that pool is made

near coral
#

Is it that the pool included the vanilla blinds in it

#

Or that it didn't

weak grove
red flower
near coral
#

So in short it's not supposed to include those?

#

Or is it strictly the weird pooling

red flower
red flower
near coral
#

Alright

weak grove
near coral
weak grove
near coral
#

That wasn't even chewing you out it was a simple request

red flower
#

it was a polite request lol

near coral
#

Given that reaction if they actually chewed you out you'd be crying on the floor lmao

red flower
#

search for G.GAME.blind.chips

subtle hawk
red flower
#

requiem

subtle hawk
#

Requiement

near coral
#

Requirem

ripe thicket
#

how do I make a custom button thing like the sell and use buttons?
Im tryna make one for a joker but I havent been able to find anything

red flower
ripe thicket
#

ohh ok I'll check it out

#

acutally do you have a link to that bc I dont

red flower
ripe thicket
#

ty!!

hard kayak
#

How does one use #context.full_hand without it being a nil value

faint yacht
#

if context.full_hand and #context.full_hand

hard kayak
#

Okay so I figured that part out

#
    calculate = function(self, card, context)
        if context.stay_flipped and context.from_area == G.play then
            if context.full_hand and #context.full_hand == 1 then
                retain(card, context)
                return {
                    message = "wah"
                }
            end
        end
    end

This isn't returning the message tho

red flower
#

well i would actually say that's bad practice

#

you should check for the main context first

#

if that context has full_hand it wont be nil

hard kayak
#

joker_main?

red flower
#

no, stay_flipped is the main context

#

but it probably never has full_hand

faint yacht
#

Should probably mark the card in a context that has context.full_hand properly, then check for the same mark.

red flower
#

also what does retain do

hard kayak
#

puts the card back into hand after being played

#

that function works already

red flower
#

there's a return for that

hard kayak
#

There is something that does that already?

red flower
#

yes

hard kayak
faint yacht
#

One of my enhancements uses it to go to the deck instead.

if context.stay_flipped and context.from_area == G.play then return { modify = { to_area = G.deck } } end
red flower
hard kayak
#

Oh I already did that then

#
local function retain(card, context)
            G.E_MANAGER:add_event(Event({
                    func = function()
                        SMODS.calculate_effect ({ message = "Retained", colour = mythicalgradient }, context.other_card)
                        return true;
                    end
                }))
        return
            { modify = { to_area = G.hand } }
        end```
red flower
#

that doesn't return in calculate

hard kayak
#

it should?

red flower
#

in calculate you're only retuning a message

#

your function is returning and discarding the value

hard kayak
#

It's not returning the message though

red flower
#

yes it is?

faint yacht
#

...the stay_flipped context doesn't get to have full_hand, so...

hard kayak
#

Apparently I can't read my own code because it's literally in the return in other instances

red flower
#

ah ok

#

but yeah you should save the amount of cards in hand in another context like ali said

faint yacht
#

...mark said cards is what I said.

hard kayak
#

Just gotta figure out how to do that

red flower
faint yacht
#
if context.after and #context.full_hand == 1 then
  context.full_hand[1].ability.yoinky = true
end

if context.stay_flipped and context.from_area == G.play and context.other_card.ability.yoinky then
  context.other_card.ability.yoinky = false
  SMODS.calculate_effect ({ message = "Retained", colour = mythicalgradient }, context.other_card)
  return { modify = { to_area = G.hand } }
end

should/could work. 🐇

hard kayak
#

oh

#

It now works

#

Thank you for the assistance

#

I made retain a local function just because it's easier to just reference it instead of copying and pasting the whole thing over and over again

faint yacht
#

return retain(card, context) then.

hard kayak
#

Exactly what I have been doing

#

except for the return part

#

because of course I can't read

faint yacht
#

Gets everyone from time to time.

hard kayak
#

Also, double-sided is stoopid

hard kayak
#

Yes there is the aether bunny

versed swan
#

so get this: this was not working for me because I disabled shadows in options

hard kayak
#

Incredible

versed swan
#

Anyways, decided to read UI source code and determine actual properties of config values

keen atlas
versed swan
#

ah

#

wish i knew abt this sooner

willow nimbus
#

Does anybody know how to get a list of nodes inside a UI element? I'm referencing an element with get_uie_by_id but I'm not sure how I can reference the nodes

#

element.nodes unsurprisingly doesn't work

gilded blaze
#

what you see with nodes are simply prototype tables to tell the element how to construct itself

willow nimbus
#

Ohhhhh

#

That makes a lot more sense actually

#

Thanks so much

gilded blaze
#

so instead of t.nodes[1].nodes[2], it's element.children[1].children[2]

willow nimbus
#

I see

#

thanks again, that's a big help

glass scaffold
#

So do I just chuck in another message = localize to have both the chips and mult or..?

wintry solar
glass scaffold
hard kayak
#

Only need to have that if you want a custom message over the default message

karmic prism
#

How do I a keep a new custom suit from being included in base game decks

willow nimbus
#

Anybody know if UI text elements are exempt from get_uie_by_id()? I have a row element which I can access with the function, but trying to do it on a text element just doesn’t return anything

#

i get an element returned from "local dots," but not from "local cltxt"

fading rivet
#

hmm

#

okay maybe they might then idk

#

I always wrap my text elements in rows or columns

umbral spire
#

@fading rivet

fading rivet
umbral spire
fading rivet
#

yes

umbral spire
#

and delete my old smods folder?

fading rivet
#

yes

umbral spire
#

how do i load another .lua file?

daring fern
long sun
#

hihi ^u^ i'm back to trying to get Opus Magnum implemented

#

i have this code so far:

#

it's meant to render a canvas with a bunch of red lines, as a test

#

however, the canvas isn't showing up in my menu

#

[looks like this]

#

doing ambitious things like this always leads to me learning how to make games in new game engines :3

#

i learned Unity from KTaNE modding, eg

whole lava
#

how can i make a joker that swaps chips and mult?

slim ferry
#

add swap = true to the return table

whole lava
slim ferry
#

you can

whole lava
#

ok thanks for that

slim ferry
#

if you want specifically xchips after, you would need to do something like return { swap = true, extra = { xchips = ... } }

karmic prism
#

How do I a keep a new custom suit from being included in base game decks like red deck and blue deck?

subtle hawk
#

I have a set of cards that I'm currently transferring into their own Center, however there's this blinding cyan badge and I have not a single idea where it's coming from. I have to assume that it's some kind of smods thing?

#

Ohholyshit
Shinku sorry for pinging a message from 2025 but like did you figure that out?

wooden nexus
#

I can send you what i got if you wish to look with me

#

I wanted to do fillers in Parallel Update but due to lack of knowledge and help, it was pretty much fruitless lol

subtle hawk
#

Wait I literally have my other mod that has a custom Center and doesn't have a blinding cyan badge

#

Why am I not looking there

wooden nexus
#

Hm?

#

Maybe i should try and bring Fillers back

red flower
wooden nexus
#

Yoinking that, I'll need that for BalatroOBV

#

I got a wave of motivation

subtle hawk
# wooden nexus Hm?

Yeah okay uh
Having a set_card_type_badge(self, card, badges) function seems to get rid of the blinding cyan one

red flower
#

i was about to say lol

wooden nexus
#

Alright cool. Now i just need to figure out how to add a card that can go into the joker slots without actually counting as a joker but counts as a filler

red flower
#

what do you mean by not counting as a joker

torn thunder
wooden nexus
#

So you know in decks of cards you have your standard 52 cards, the jokers, and then the extra cards

#

aka the filler cards

wooden nexus
twin fiber
red flower
twin fiber
#

:O

red flower
#

i was about to suggest that if it was the same idea but it doesn't seem like it

#

the spaceship is still a joker in the area

wooden nexus
#

So it'd increase the filler slot but not the joker slot. I gotta look and see what i did in the older version

#

That and see if it still works with the newest smods

#

Seems like I got kinda far?

#

Okay I see the issue already

#

It has no slot to go to

red flower
#

if you don't mind them still being treated as they are in the area you can just make them take 0 slots with the smods config and then just increase the number for the display

wooden nexus
#

I think

#

uh... lemme see something rq

#

idk if it's debug plus or Parallel Update being like this rn

wooden nexus
#

Can’t tell

#

Oh well

hard kayak
#

Is there a way to make it so a joker can be taken always, even if you wouldn't have room for it otherwise?

faint yacht
#

Hook G.FUNCS.check_for_buy_space and return true or make Joker not require a slot by having extra_slots_used defined as -1 in config.

hard kayak
#

How would you hook that

#

(I've never made a hook before)

faint yacht
#
local checkref = G.FUNCS.check_for_buy_space
function G.FUNCS.check_for_buy_space(card)
  -- put your own condition here first.
  return checkref(card)
end
umbral spire
#

I'm trying to make a tag, that, when applied adds a free consumable (of a specific set) of Rare (or specific) rarity from my mod. But, right now it's just giving me any rarity?
My consumable looks like:

SMODS.Consumable {
    key = "milk_chocolate_cookie",
    set = "cl_cookie",
    atlas = "flavored_cookies",
    pos = { x = 2, y = 1 },
    rarity = 2,
    weight = 0.25,

and I create the card like this

        local card = SMODS.create_card {
            set = "cl_cookie",
            area = context.area,
            skip_materialize = true,
            key_append = "cookie_tag_" .. rarity_name,
            rarity = rarity_name, 
        }

Why isn't it working..?

hard kayak
umbral spire
# umbral spire I'm trying to make a tag, that, when applied adds a free consumable (of a specif...

I just tried a different way by creating a list of every cookie that matches the rarity i want, then picking one at random (looping throughSMODS.Centers, and i even tried G.P_CENTERS too) but that didn't work either? it just hit the safeguard here..

        local valid_cookies = {}
        for k, v in pairs(SMODS.Centers) do
            if v.set == "cl_cookie" and v.rarity == rarity_num then
                table.insert(valid_cookies, k)
            end
        end
        --safeguard
        if #valid_cookies == 0 then 
            print('safeguard hit!') 
            return
        end

Can someone help with this?

faint yacht
hard kayak
#

Would this just go at the beginning of the lua file

umbral spire
hard kayak
#

I meant the hook itself

umbral spire
# hard kayak I meant the hook itself

Yeah, I think something like this should work.

local checkref = G.FUNCS.check_for_buy_space
function G.FUNCS.check_for_buy_space(card)
  if SMODS.find_card('yourcardhere') then return true end
  return checkref(card)
end
hard kayak
#

got it

umbral spire
#

Ready your Jokers, prepare for @ Sock's big message. /silly

twin fiber
# umbral spire I'm trying to make a tag, that, when applied adds a free consumable (of a specif...

i'm not at a computer where i could test, but two things come to mind:

  1. (since it was not provided in the snippet) is rarity specified correctly? should be a string like "Rare"
  2. i was reading the SMODS.create_card code and it seems it outsources the bulk of the code to the vanilla create_card function, which i would not be surprised if it didn't handle consumable rarities correctly
    sorry it's not very definitive advice
umbral spire
twin fiber
#

rarity_name...?

umbral spire
twin fiber
#

rarity in my message refers to the key, in rarity = rarity_name in the creation snippet you posted, sorry i was unclear

umbral spire
#

oh

#

does it have to be a string tho?

#

Jokers work fine with it being a number.

twin fiber
#

yes it could also be a number but i assumed it was a string since you were using .., i forgot lua allows concatenation with strings and numbers. both should work fine

umbral spire
#

oh! i managed to fix it lol

twin fiber
#

oh! what was the solution!

slim ferry
#

if youre using rarities for a consumable type they have to be defined as a new rarity iirc? so that automatically means the vanilla rarity numbers dont work

umbral spire
#

-# whoops my msg took forever to send lol

umbral spire
twin fiber
#

nw! that's interesting, seems like a good fix :3 i'm curious to see if eris's solution works too, that sounds elegant

umbral spire
slim ferry
#

you probably want to look at whatever code calls set_badges or whatever for a card and do something with that ig

#

or use extend and create a default set_card_type_badges for the consumable type which adds the consumable type and rarity badges

long sun
#

i'm getting "rendering" printed every frame, but my Canvas doesn't seem to be rendering

#

why must i turn my game into a house of LIES

umbral spire
slim ferry
#

all center instances are stored in SMODS.Centers

brittle yacht
#

what context would i use to check if a hand has ONLY a certain suit

long sun
#

breakthrough: rendering my canvas to a texture shows it's definitely there

brittle yacht
#

woah

umbral spire
slim ferry
#

your current check just works

umbral spire
long sun
#

there's no specific context for it

brittle yacht
#

ight i got that

long sun
#

hmm so it seems the issue is, the canvassprite isn't rendering in the UI

#

i don't know how to fix that

umbral spire
#

oh

#

nvm

brittle yacht
#

but i dont think i did it right

#
            for i = 1, #context.scoring_hand do
                if context.other_card:is_suit(card.ability.extra.suit) then
                    hearts_check = true
                    break
                end
            end```
#

i havent teted

#

i need to add return aswel

long sun
#

if not context.scoring_hand[i]:is_suit(card.ability.extra.suit) then

#

and then do the effect if hearts_check is false

lyric wadi
#

how do you make a pool of all available enhancement, seals, and edition? (including modded ones)

#

like having a joker count modded enhancements along with vanilla without specifically doing crossmod

umbral spire
#

is there any website that lets you preview balatro descriptions?
Like

{
"{C:attention}Attention!",
"Normal Text"
}
uneven drift
#

I have a joker that randomly applies enhancements and it works with modded enhancements off SMODS.poll_enhancement

#

I'm not sure how you filter out to only vanilla enhancements or modded enhancements with that, specifically. But by default if its an enhancement, it'll grab it

#

Not sure if thats what ur asking for

umbral spire
lyric wadi
#

no i just want to have a pool that have every enhancement, seals, and edition in them

#

like how driver's license count cards with enhancements you have

uneven drift
#

oh

long sun
#

!!!!!!!!!!!!!!!!!!!!!!

lyric wadi
#

i want to have that kind of effect but for it to also count modded enhancement

long sun
#

I GOT IT OMG

uneven drift
#

something like this maybe?

#

loop the deck and see for each card if thats true

#

or this

lyric wadi
#

yeah that's my problem tho

#

they need the key of the enhancement to check for

#

meaning that if i want to loop through the cards and count the enhancements, i need to have a list containing the key of every enhancements available

uneven drift
#

lemme see how drivers license does it

lyric wadi
#

i can do that with the vanilla stuff, the pool is limited

stiff locust
#

if it doesn't have no enhancement, then it has an enhancement

uneven drift
#

does get_enhancements only do vanilla stuff?

lyric wadi
#

however my inquiry is how to include modded enhancement should the player have a mod that adds some

lyric wadi
stiff locust
#

oh you need to know more about the enhancement iself

#

i believe the playing cards have a table on their object

#

where it stores enhancement and edition data so you can see like, if a modded edition/enhancement gives xmult or xchips or such

slim ferry
umbral spire
#

how do i make a color gradient in G.C.MY_COLOR ?

lyric wadi
#

and also to bring it back, this also should include seals and editions

#

and thus modded seals and editions

stiff locust
slim ferry
lyric wadi
#

i could also just cop out and be one of those mods that have no support for modded enhancement or editions from other mods

#

and thus remain unpopular in modpack compilations as adding my mod would not provide content synergy value

slim ferry
#

how is your effect actually different from drivers license code wise for enhancements

#

because im reading it and it seems like you can just use the same code

stiff locust
#

itd better be well optimised

#

drivers license checks it on every single frame

#

it's so excessive

slim ferry
#

well

#

vanillaremade

stiff locust
#

does vanillaremade fix stuff like that

slim ferry
#

actual vanilla code is Not Good for reference

slim ferry
#

vanilla but actually usable as a reference for good practices

lyric wadi
slim ferry
#

SMODS.get_enhancements returns a table of enhancement_key = true for each enhancement it has

#

so just iterate over it and copy the enhancements into another table

lyric wadi
#

is the key returned a string or a centre

long sun
#

yes i wanted it to go under the UI thank you

lyric wadi
#

user outerface

#

does SMODS have a get_seals and get_edition method as well or are those different

brittle yacht
#

how do i damage a blind by a percentage

lyric wadi
#

it doesnt appear to have get_seals and get_edition

#

hence my need for a pool of those

#

to iterate against

torn thunder
brittle yacht
#

nvm i figured it out

glossy dagger
#

Someone knows how to check if a card held in hand is an ace?

primal robin
#

Salty ghost trying make canvassprite render so hard

torn thunder
long sun
#

no matter how high i set my drawstep's order, it renders under the UI

primal robin
#

Are you using a card to render this thing on it?

long sun
#

no

#

well the bounding box is fine... it's just that issue

primal robin
#

Draw thing by using func is not a good idea because this callbacks fire in update stage, draw goes after

long sun
#

what should i do, then?

primal robin
#

What you can do by using func hook element's draw function to draw thing, that's it

#
G.FUNCS.setup_transmut = function(e)
  e.config.func = nil
  local old_draw = e.draw_self
  function e:draw_self(...)
    old_draw(self, ...)
    -- draw the thing here
  end
end
long sun
#

i'll give that a go ^u^

#

two seconds

glossy dagger
long sun
#

where do i call this function?

#

ah wait

#

i'm silly

torn thunder
long sun
#

well that did... something

#

it's moving, too ^^:;; weird

#
G.FUNCS.setup_transmutation_engine_rend = function(e)
  e.config.func = nil
  local draw_self_ref = e.draw_self
  function e:draw_self(...)
    draw_self_ref(self, ...)

    local canvas = e.config.object.canvas
    canvas:renderTo(function()
      love.graphics.clear(0, 0, 0, 0)
      love.graphics.setColor(1, 0, 0, 1)
      love.graphics.rectangle("fill", 0, 0, 10, 10)
      love.graphics.setColor(0, 1, 0, 1)
      love.graphics.rectangle("fill", 0, 0, 20, 20)
      love.graphics.setColor(0, 0, 1, 1)
      love.graphics.rectangle("fill", 0, 0, 30, 30)
    end)

    if G.OVERLAY_MENU then
      local obj = G.OVERLAY_MENU:get_UIE_by_ID("opusm_trans_canvas_obj")
      if obj then
        love.graphics.push()
        love.graphics.origin()
        G.opusm_transmutation_engine_sprite:draw_from(obj)
        G.opusm_transmutation_engine_sprite.canvas:renderTo(love.graphics.clear, 0, 0, 0, 0)
        love.graphics.pop()
      end
    end
  end
end```
#

giving up for tonight 😭

tidal hemlock
#

so i've seen many people have this issue
how does one fix this

#

i have them defined

lyric wadi
#

is get_seal real

#

im backreading and im confused

#

does it exist

torn thunder
# tidal hemlock i have them defined

first of all dont keep all the vremade stuff there that's a bad idea
second of all, is your mod prefix correct and the key to your object also correct?

torn thunder
#

could you show the definitions (i.e. your metadata and the SMODS.Consumable etc for the paradox

slim ferry
#

consumable type keys arent prefixed by default

#

so thats probably the issue

tidal hemlock
primal robin
#

what a crazy font + no colors

tidal hemlock
#

im using notepad shut up

#

fixed the crash and still the loc doesnt wanna work

slim ferry
#

bro is using notepad

red flower
tidal hemlock
#

looking at paperback's loc and its defined exactly the same way i did

slim ferry
#

the crash is because you are using the wrong key for a consumable's set

tidal hemlock
#

yeah i already figured that out

#

still cant actually get it to show up though, its just ERROR

hard kayak
lyric wadi
#

uh oh

faint yacht
hard kayak
#

Same thing?

tidal hemlock
#

just noticed this lol

glossy dagger
faint yacht
slim ferry
hard kayak
#

Do I put it in checkref too or do I make a second checkref

faint yacht
#

Separate local

local chkuseref = Card.check_use
function Card:check_use()
  -- add condition here with 'return true'
  return chkuseref(self)
end
hard kayak
#

uhh

#

Packs and Vouchers can't be redeemed/opened and all jokers can be bought, ignoring space requirements

#

I don't think that's supposed to happen

faint yacht
#

Should check if you are in a Booster Pack, too... SMODS.OPENED_BOOSTER.

hard kayak
#

Well I can't open a booster pack anymore so

faint yacht
#

As in, if SMODS.OPENED_BOOSTER and next(SMODS.find_card('aeiou')) then return true end.

hard kayak
#

Okay well now I'm in the booster pack

#

but I still can't select the card

#

Also, I can still buy everything in the shop, regardless of whether I have room or not

faint yacht
#

ough, not quite sure much then-

keen totem
#

is there a variable message key for losing XMult

hard kayak
#

You probably have to manually make one if there isn't one

hard kayak
keen totem
#

found one

#

in Ramen, its shown as "a_xmult_minus"

glossy dagger
hard kayak
#

Good to know

glossy dagger
glossy dagger
#

like, the most forgetable joker to me

keen totem
#

ramen is so unbelievably useless

#

base X2 Mult and it loses value

#

if it were common, i could see it being viable, but its uncommon

glossy dagger
keen totem
#

campfire can be the main scoring if you build towards it

#

its not that bad, just niche

glossy dagger
#

infinite money basically

#

and seeing double i think works with smeared

#

so if you dont have xMult, can work

#

but... back in the topic

#

idk how to recognize cards as aces

lyric wadi
#

okay so get_seal returns the key of the seal

#

and card.seal returns the name of the seal

#

that's one third of the not working functionalities sorted

#

get_edition definitely doesn't exist in the sense that it doesn't return what edition the card has

tidal hemlock
#
    b_celestin_paradox_cards = "Paradox Cards",
    k_celestin_paradox = "Paradox",
        },
        labels = {
        celestin_paradox = "Paradox",
        },```
```SMODS.Atlas({
    key = "paradox",
    path = "paradox.png",
    px = 71,
    py = 95
})
SMODS.ConsumableType {
    key = 'paradox',
    default = 'c_celestin_laplace',
    primary_colour = HEX('84ffe8'),
    secondary_colour = HEX('D85D55'),
    collection_rows = { 6, 6 },
    shop_rate = 3
}
SMODS.Consumable {
    key = 'laplace',
    set = 'paradox',
    atlas = 'paradox',
    pos = { x = 0, y = 0 },
    config = { max_highlighted = 3, suit_conv = 'celestin_Vortexes' },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.max_highlighted, localize(card.ability.suit_conv, 'suits_plural'), colours = { G.C.SUITS[card.ability.suit_conv] } } }
    end,
}```
still showing ERROR and idk why
slim ferry
#

you

#

its

#

its just paradox

#

not celestin_paradox

glossy dagger
#

uhhh, sorry for being annoying with this but

#

i still cant make the joker dont trigger if aces are held in hand

torn thunder
#

ok i can help w that

#
local ace_found = false;
for _, _card in ipairs(G.hand.cards) do
  if _card:get_id() == 14 then
    ace_found = true;
  end
end

if not ace_found then
  -- trigger
end

put this in your context and put the actual joker trigger where the comment is

#

if its a regular joker trigger, should go in context.joker_main

glossy dagger
#

i think i will send the code because the joker in reality has various "if not"

#

calculate = function(self, card, context)
if context.individual and context.cardarea == G.hand and not context.other_card:is_face() and not context.other_card.debuff and not context.end_of_round then
return {chips = context.other_card.base.nominal * 2}
end

#

the second like is really long-

torn thunder
#

ok just tell me the joker effect

glossy dagger
#

numbered cards (2 to 10) give the double of their value as chips

torn thunder
#

the full effect

#

is it that in hand?

glossy dagger
#

yeah

#

i forgor

#

Numbered cards held in hand

#

why i forgot like... the whole joker trigger

keen totem
#

is there a way to speed up a set of effects that use SMODS.upgrade_poker_hands
i have an effect that calls SMODS.upgrade_poker_hands in context.using_consumeable, but it doesn't lower the delay as more and more effects happen, causing it to take pretty long to finish the animation

torn thunder
# glossy dagger yeah
calculate = function(self, card, context)
  if context.individual and context.cardarea == G.hand and not context.end_of_round then
    if card:get_id() > 1 and card:get_id() < 11 then
      return { chips = card:get_id() * 2 }
    end
  end
end
#

there

#

that gives double their rank

#

if u want their nominal u can just change the return to

glossy dagger
#

thanks

torn thunder
#
return { chips = card.base.nominal * 2 }
#

oops i typo'd

#

there now its good

glossy dagger
#

thanks

keen totem
#

is a nominal the base +chips that a card of a certain rank gets?

glossy dagger
#

yeah

faint yacht
#

Used in Card:get_chip_bonus, yeah.

keen totem
#

like how it says "+X extra chips" in the description when its been changed by either Bonus Card or Hiker

glass crown
#

how would i go about changing the name that shows of the current hand? i tried just copying the code from yahimod's "Good Kitty" joker but it doesnt seem to be working for me 🤔

keen totem
#

those two's effects stack into one description piece, but i dont know how to make a +chips effect stack into that description piece as well

keen totem
faint yacht
#

So increase the +Chips of an Ace directly instead of adding the +X extra Chips?

glass crown
keen totem
#

like instead of it showing +15 extra chips (from my enhancement) and +20 extra chips (from Hiker), it just says +35 extra chips

keen totem
# glass crown yes!

in context.evaluate_poker_hand, do
return { replace_display_name = "ABCDE" } with ABCDE being what you want it to say

faint yacht
keen totem
#

where would i find info about localize_perma_bonuses

faint yacht
#

src/utils.lua

keen totem
#

no documentation?

red flower
#

no

#

it looks pretty straightfoward to me tho

keen totem
#

yea

#

i assume that vremade doesn't delve into how the base game actually combines Hiker and Bonus Card's descriptions

faint yacht
glass crown
red flower
keen totem
keen totem
red flower
keen totem
#

+15 extra chips

#

in terms of chips buffs

red flower
#

have you tried using bonus in the config

keen totem
#

it already uses bonus

red flower
#

then it should work the same afaik

#

let me test

glass crown
#
        if context.evaluate_poker_hand then
            return {replace_display_name = "ABCDE"}
        end

        if context.before and next(context.poker_hands[card.ability.extra.type1]) then
            level_up_hand_chips(card, card.ability.extra.type1, false, 2)
            level_up_hand_chips(card, card.ability.extra.type2, true, 2)
        end
        if context.before and next(context.poker_hands[card.ability.extra.type2]) then
            level_up_hand_chips(card, card.ability.extra.type1, true, 2)
            level_up_hand_chips(card, card.ability.extra.type2, false, 2)
        end

and the function

function level_up_hand_chips(card, hand, instant, amount)
    amount = amount or 1
    SMODS.upgrade_poker_hands({
        hands = hand,
        func = function(base, hand, parameter)
            return base + G.GAME.hands[hand]['l_' .. parameter] * amount
        end,
        from = card,
        instant = instant,
        parameters = {"chips"}
    })
    return {replace_display_name = "ABCDE"}
end
#

i had it changing specifically for a certain hand type before but for testing purposes i just replaced the display name for all of them

#

also ignore the return at the bottom of the function i was throwing anything i could at the problem

keen totem
wary gyro
#

I'm trying to make a joker that triggers all cards held in hand and this is the current code:

    calculate = function(self, card, context)
        if context.individual
            and context.cardarea == G.hand
            and context.other_card
            and not context.other_card.debuff then
            local bonus = FB.num(context.other_card:get_chip_bonus(), 0)
            if bonus ~= 0 then
                return {
                    chips = bonus,
                    colour = G.C.CHIPS,
                    card = context.other_card
                }
            end
        end
    end

and FB.num is:

FB.num = FB.num or function(value, fallback)
    fallback = fallback or 0
    if type(value) == 'number' then return value end
    if type(value) == 'table' then
        if type(value.to_number) == 'function' then
            local ok, n = pcall(function() return value:to_number() end)
            if ok and type(n) == 'number' then return n end
        end
        if type(value.toNumber) == 'function' then
            local ok, n = pcall(function() return value:toNumber() end)
            if ok and type(n) == 'number' then return n end
        end
    end
    return fallback
end
#

the problem is that it triggers even after scoring

#

spent over an hour debugging and fixing to no avail

keen totem
#

this is what it does with hiker

#
["m_CGN_Disease"] = {
                ["name"] = "Disease Card",
                ["text"] = {
                    "{C:chips}+#1#{} extra chips",
                    "{C:mult}+#2#{} Mult",
                    "Before a {C:attention}played hand{} scores, scoring {C:attention}Disease Cards{}",
                    "{C:green}spread{} to played and unenhanced cards",
                },
            },
#

this is the localization

#
SMODS.Enhancement{
    key = "Disease",
    atlas = "Disease",
    pos = {x = 0, y = 0},
    config = { bonus = 15,
        mult = 2,
        extra = {}
    },
    loc_vars = function(self,info_queue,card)
        return {vars = {card.ability.bonus,
        card.ability.mult
    }}
    end,
    calculate = function(self,card,context)
        
    end
}

this is the enhancement

keen totem
tidal hemlock
slim ferry
#

Make sure those localization categories are all actually inside of misc

tidal hemlock
#

they are

slim ferry
#

Make sure misc isnt inside of something else (descriptions)

glass crown
red flower
#

the workaround should be easy give me a sec

tidal hemlock
#

plus i cant count brackets

slim ferry
#

im on mobile so i cant really look at it properly

tidal hemlock
#

ah

#

i think its outside because misc has 4 brackets before it instead of the 2 im seeing everywhere else

red flower
# keen totem it had 5 hiker triggers, meaning that +25 is exclusively Hiker
generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
    if specific_vars and specific_vars.nominal_chips and not self.replace_base_card then
        localize { type = 'other', key = 'card_chips', nodes = desc_nodes, vars = { specific_vars.nominal_chips } }
    end
    SMODS.Enhancement.super.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
    if specific_vars and specific_vars.bonus_chips then
        localize { type = 'other', key = 'card_extra_chips', nodes = desc_nodes, vars = { SMODS.signed(specific_vars.bonus_chips) } }
    end
    SMODS.localize_perma_bonuses(specific_vars, desc_nodes)
end

this in the enhancement should work

#

and you need to remove the chips from your description

keen totem
#

alr

keen totem
#

although, the +x extra chips shows up after my enhancement's description

#

not sure if theres a way to fix that or not

red flower
#

try putting the SMODS.Enhancement.super.generate_ui after the if

keen totem
#
generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
        if specific_vars and specific_vars.nominal_chips and not self.replace_base_card then
            localize { type = 'other', key = 'card_chips', nodes = desc_nodes, vars = { specific_vars.nominal_chips } }
        end
        if specific_vars and specific_vars.bonus_chips then
            localize { type = 'other', key = 'card_extra_chips', nodes = desc_nodes, vars = { SMODS.signed(specific_vars.bonus_chips) } }
        end
        SMODS.Enhancement.super.generate_ui(self, info_queue, card, desc_nodes, specific_vars, full_UI_table)
        SMODS.localize_perma_bonuses(specific_vars, desc_nodes)
    end

so this?

red flower
#

yes

keen totem
#

still shows up after

#

its fine tho

#

also im realizing that i have to do this for +mult too once i add a perma +mult effect

red flower
#

that doesnt have any code for it in smods

#

so it might just work directly

keen totem
#

right, cause this only needs a workaround because smods created the issue to begin with

#

and smods doesnt do that for perma +mult

hard kayak
#

For the life of me I can't figure out why this isn't working

local gfcfbs = G.FUNCS.check_for_buy_space
G.FUNCS.check_for_buy_space = function(card)
    if
        (card.ability and card.ability.spaceless == 'yes')
    then
        return true
    end
    return gfcfbs(card)
end

It either, does nothing, makes every card selectable, or crashes the game

red flower
keen totem
#

N' do you think that it'll be possible to get the +extra chips to show up before the description?

#

cause if its possible I do want to try to get it working, but i wouldn't be surprised if its not possible

red flower
#

i mean everything is possible

#

with the magic of computers

red flower
#

is card.ability.spaceless == 'yes'

hard kayak
#

it should be

red flower
#

have you added a print to see

hard kayak
#

where would I add the print

red flower
#

before the if

#

print(card.ability.spaceless)

hard kayak
#

nil

#

It's printing nil

red flower
#

well then its not yes

#

also if you want it to take no space there's an smods feature for that

hard kayak
#

there is?

red flower
#

config = { extra_slots_used = -1 }

hard kayak
#

Doesn't that create a tooltip though

#

or an info queue

red flower
#

yes

hard kayak
#

I would prefer not having that, is there a way to hide that?

red flower
#

i dont think so

hard kayak
#

blegh

#

how would I pass the condition exactly?

red flower
#

how are you setting card.ability.spaceless

hard kayak
#

In the same place where you give the key, cost and calculate within SMODS.Joker

red flower
#

config = { spaceless = 'yes' }

primal robin
#

why yes as a string tho

red flower
#

or card.config.center.spaceless == 'yes' in the if

hard kayak
#

fucking

#

Cryptid I swear I am going to strangle you to death for being impossible to understand

primal robin
#

Cryptid is one of the worst sources for code

red flower
#

yeah

primal robin
#

Find something better, anything

red flower
#

everyone using cryptid is one of the reasons i made vremade

primal robin
#

Btw is Ruby working on Cryptid 2 or no one knows?

hard kayak
#

Ruby is

#

It's just very slow

primal robin
#

I see

hard kayak
#

okay so I can now buy from the shop

#

Now... I also need booster packs too

#
local csc = G.FUNCS.can_select_card
G.FUNCS.can_select_card = function(card)
    if
        (card.config.center.spaceless == 'yes')
    then
        return true
    end
    return csc(card)
end```
This doesn't work because the game crashes for 'center' being a nil value, but including card.config.center, makes it so it doesn't work
red flower
#

can_select_card doesnt return a boolean, it changes the button

#

this is my thing for that

#

basically you need
e.config.colour = G.C.GREEN
e.config.button = 'use_card'

red flower
#

yeah

hard kayak
#
local csc = G.FUNCS.can_select_card
G.FUNCS.can_select_card = function(card)
    if
        (card.config.center and card.config.center.spaceless == 'yes')
    then
        e.config.colour = G.C.GREEN
        e.config.button = 'use_card' 
    end
    return csc(card)
end```
So it's like this now, but it still doesn't work
#

oh wait

#

does it have to be function(e)

red flower
#

yes

#

or well, replace e for card but its not a card

primal robin
#

card is e.config.ref_table

hard kayak
#

So replace card with e.config.ref_table?

primal robin
#
G.FUNCS.can_select_card = function(e)
    local card = e.config.ref_table
    -- your code with no changes
end
#

afetr that you must be fine

red flower
#

sleepy do you know how to translate this to balatro shaders

primal robin
#

I have no idea how shaders work at all vro

red flower
#

😭

#

i actually did just kinda learn today

primal robin
#

that's the field I suck

red flower
#

but now im trying to port this yugioh one to the game

hard kayak
primal robin
#

ask cass or someone else who can do this

hard kayak
#

but only the correct card gets the green select

#

Oh wait

#

Does it need the else

primal robin
#

Kinda crazy that SMODS doesnt provide api for can_select

red flower
hard kayak
#
G.FUNCS.can_select_card = function(e)
    local card = e.config.ref_table
    local csc = G.FUNCS.can_select_card
        G.FUNCS.can_select_card = function(e)
    if
        (card.config.center.spaceless == 'yes')
    then
        e.config.colour = G.C.GREEN
        e.config.button = 'use_card' 
    end
    return csc(e)
    end
end
red flower
#

the return seems nested

hard kayak
#

move it down one end?

red flower
#

why is there another can_select_card inside

hard kayak
#

oh I didn't notice that

red flower
#
local csc = G.FUNCS.can_select_card
G.FUNCS.can_select_card = function(e)
    local card = e.config.ref_table
    if
        (card.config.center.spaceless == 'yes')
    then
        e.config.colour = G.C.GREEN
        e.config.button = 'use_card' 
        return
    end
    return csc(e)
end
hard kayak
#

oh my god it finally works

#

thank you so much