#💻・modding-dev

1 messages · Page 666 of 1

acoustic drum
#

Gets the next element of a table while iterating over it
It's mostly used to check if a table is empty or not (i.e. if next(...) returns something then there is at least 1 element, otherwise it's empty)

umbral spire
#

why not just do if table[1] then ?

acoustic drum
#

Because some tables might have string keys, like local t = {["Apples"] = 4}. There is 1 element in the table but its key isn't 1

#

Doing table[1] would return nil in this case

umbral spire
#

oh I see.

umbral spire
slim ferry
#

#table will be 0 if it has no numbered indexes

acoustic drum
#

#table isn't actually the amount of items in the table, it's just the biggest numeric index inside the table

acoustic drum
#

Yeah it's always explained as table size since it's almost always the case with array-like tables

slim ferry
#

More specifically it just returns some number n where t[n] ~= nil and t[n+1] == nil

acoustic drum
#

I thought it was like that for years

slim ferry
acoustic drum
#

Yeah

#

Like if you had a table local t = {[1000] = true} then #t would be 1000

umbral spire
#

mime does if context.repetition and context.cardarea == G.hand and (next(context.card_effects[1]) or #context.card_effects > 1) then (vanillaremade)

why do you do next(context.card_effects>>**[1]**<<) ?

#

what's the point of the [1]

acoustic drum
umbral spire
#

That makes sense

acoustic drum
#

With stuff like this it's usually weirdly programmed and instead of just making a list of all effects the game stores a list of tables, and every table is the list of all the effects of a single card (i.e. if you had 2 jokers that do 3 things each, the game would store 2 tables each containing the 3 effects)

#

Again, not 100% sure though

slim ferry
#

i think context.card_effects would contain the eval_card results?

slim ferry
acoustic drum
#

Could be

#

The wiki says
context.card_effects -- this is a table of effects that has been calculated during the end of round step

acoustic drum
#

Can you make a custom rarity poll for SMODS.create_card()?
Like, if I had a custom pool of jokers made with SMODS.ObjectType() and wanted to create a random joker out of that pool but with different probabilities so a Legendary could also spawn, how would I do that? The documentation makes it seem you can only choose the exact rarity or do nothing

reef bobcat
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.xmult, card.ability.extra.dollars } }
    end,
    calculate = function(self, card, context)
        if G.GAME.dollars => card.ability.extra.dollars then
            return {
                    xmult = card.ability.extra.xmult
                }
            end
        end,
    }```

this should give x3 mult if you have more than the specified dollars but the game crashes, says there's no ```=``` near ```then```
acoustic drum
red flower
reef bobcat
#

tho now it's multiplying each time i select a card

#

lmao

red flower
#

you need a context check

#

probably context.joker_main in this case

reef bobcat
#

yeah i figured ;-;

acoustic drum
acoustic drum
queen crescent
#

uhm

reef bobcat
#
        return { vars = { card.ability.extra.creates, card.ability.extra.dollars } }
    end,
    calculate = function(self, card, context)
        if context.setting_blind and G.GAME.dollars >= card.ability.extra.dollars then
            local jokers_to_create = math.min(card.ability.extra.creates,
                G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer))
            G.GAME.joker_buffer = G.GAME.joker_buffer + jokers_to_create
            G.E_MANAGER:add_event(Event({
                func = function()
                    for _ = 1, jokers_to_create do
                        SMODS.add_card {
                            set = 'Joker',
                            edition = 'e_negative',
                        }
                        G.GAME.joker_buffer = 0
                    end
                    return true
                end```

tried a few different things but idk how to get this to ignore joker slots
red flower
reef bobcat
#

yeah but dont worry i figured it out

bright ivy
#

Anyone have thoughts on this joker:

fading rivet
umbral spire
#

How do I create a Joker with a specific rarity?

cerulean rose
#

best way for a sticker to trigger an effect when its joker is added/removed?

elder rune
umbral spire
#

No. Spawn a random joker that's of specified rarity.

elder rune
#

Oh

#

I think smods does that somewhere idk

faint yacht
#

get_current_pool function, that's to be involved.

cerulean rose
#

riff raff

#

top-up tag

#

wraith

#

uncommon tag

#

rare tag

elder rune
#

So true tho

frosty dock
cerulean rose
#

the soul

umbral spire
umbral spire
cerulean rose
shell timber
#

string rarities are only used for modded rarities

umbral spire
cerulean rose
red flower
#

smods.add_card takes strings for vanilla rarities

umbral spire
cerulean rose
#

so that is not the vanilla one

red flower
#

pls stop misinforming

umbral spire
#

then it would be

#

vanillaremade_Common

red flower
shell timber
#

oh, sorry

round lion
#

they keep saying dawg takes down other gifs.

bright ivy
#

Is there a context to see if a joker card is destroyed?

round lion
#

context.joker_type_destroyed

#

and context.card.area == G.jokers

bright ivy
#

thanks

short mauve
#

how do i make a deck that has the same effect as green stake?

shell timber
#

increased scaling?

#

just increment the variable that green stake does when you buy it and decrement it when you lose it

short mauve
#

wait can i just do that

shell timber
#

oh i thought you meant joker

#

the idea still applies

short mauve
#

oh thanks

frosty dock
#

have y'all never bought playing card decks irl?

#

that's literally the way to obtain them

normal crest
#

no I haven't

median veldt
#

i just had the most shit idea for a joker

#

in essence it would do background rolls to add a random effect (from a list or stolen from an existing joker) to an internal list and another roll to decide if it'll switch the effect that it currently has, and one more roll to decide which effect from its own list to switch to

#

would be a pain to make but yk

#

what rarity would that even BE

hushed field
#

That's how the RNJoker in Cryptid works, I think, so you could use that for reference

median veldt
#

i suppose

#

cryptid's codebase is a little hard to parse though

#

okay I do NOT know how to make cardareas

#

line 298 is table.insert(card.ability.storage.cards, _card)

#

so i'm assuming it didn't init properly

#

copy the cards to a hidden cardarea

#

update, removed the code from the old version of the joker that didn't use cardareas and didnt work with modifiers

#

one sec

red flower
median veldt
#

ah

red flower
#

save it to G like i said before

median veldt
#

oh did you say that

#

i don't think i saw that

#

so like this

#

some of the parameters will be changed later i just need to test it out

red flower
#

yes

median veldt
#

one moment

hushed field
#

If there are two sandcastles, how do they interact?

#

would cards be returned regardless of which one I sell?

median veldt
red flower
#

did you restart the run to test

median veldt
red flower
#

or add a new copy

median veldt
hushed field
#

Ah, that's good, haha, because that's way easier to set up 😛

median veldt
#

it's like each sandcastle is a box and u put the cards in the box

#

so if u have two you'd end up with two copies of every card

red flower
hushed field
#

I would not use the word return in that case, but that's me being pendantic, haha

#

I'd use the word create.

median veldt
#

also why is it that if i restart the game it leaves behind a vestigial console log

hushed field
#

that's just what happens if you restart with a hotkey

red flower
#

lovely stuff, it gets fixed next update

median veldt
#

sweet

hushed field
#

I've got a system like this in Kino, which could work as reference, as I've had to deal with a bunch of strange issues related to how cards are saved and loaded that stem from doing something like this. But if it's not the cards being moved, but more so a copy being made, you might be better off looking into the code for the #1331462654732144721 graveyard, I think

median veldt
#

whoops

#

big cardarea

red flower
#

after you create the area you can do area.states.visible = false

#

and it should disable the collision too

umbral zodiac
median veldt
#

okay cool there they are

#

now i just gotta finish the code and then make the cardarea invisible

hushed field
#

make sure to test this kind of stuff with saving and loading runs, btw. Lots of potential for weird interactions

red flower
#

ah you also need to recreate the area on load i forgot about that

median veldt
#

oh yeah true

#

i dont know how to do that

hushed field
#

and save each card, and disable each card from being read as an existing playing card

#

otherwise the game will add them to your deck again on load

red flower
#

if it's just one area i would actually recommend setting up SMODS.current_mod.custom_card_areas instead of add_to_deck

red flower
#

im not sure if this is in the release lol

median veldt
#

Lets Find Out

red flower
#

but it should be out today or tomorrow anyway

red flower
median veldt
#

should be right

red flower
#

game instead of gamea but yes

median veldt
#

LFMAO

#

WHOOPS

acoustic drum
#

How do I create a custom info field for joker cards that i can read?
I've already added something like this:

evo_info = {
    key = 'lmd_ultra'
},

to one of my jokers inside the SMODS.Joker() table but when I try to check it with G.jokers.highlighted[1].evo_info it says the field evo_info is always nil. It might have to do with it not being a center but I'm not sure, it's my first time working with custom info.

faint yacht
#

Did you spawn a fresh copy?

red flower
#

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

acoustic drum
median veldt
#

i mean upon reload the deck skin died but that's not a problem considering that it'll be hidden

#

okay actually i should set it back to hand to make sure i can actually see the cards to ensure they're the right cards

#

funny that the z order of the cards in this area is irrelevant, you can shuffle them around but some will be shown above others
again, doesn't matter, but it's funny

#

hmm alright, new problem

#

haven't actually made the code for selling the joker yet but

#

how's it gonna know which cards belong to which sandcastle?

#

i guess I could in theory modify it slightly to where if you sell one, it sells all of them and just gives you the entirety of the cardarea

red flower
#

you can tag each card probably too

median veldt
median veldt
red flower
#

in both cases you would need to give each card a unique id

median veldt
#

can you even do that

#

i guess I could just
do a random number

#

in ability somewhere

red flower
#

which would be just doing G.GAME.modprefix_count = (G.GAME.modprefix_count or 0) +1

median veldt
#

Oh

red flower
#

sorry im a slow typer

median veldt
red flower
#

yes

median veldt
#

give me a minute

#

wait I don't see how that actually gives each card a unique id

red flower
#

i meant each joker

median veldt
#

yeah ik

#

ordo i not need the removal

red flower
#

so then you would tag the cards (or the cardareas if you go that route) with playing_card.ability.["from_sandcastle".. count] = true

hushed field
#

If you need to assign each card the source joker that destroyed it, I really recommend referencing the Abduction code from #1340334060597285025. Abduction is almost exactly this system, except it doesn't trigger destroy effects

median veldt
hushed field
#

I ran into a bunch of interesting issues while setting that up, so even if the systems are more separate, it might give you some insight. One of the issues I had with it was animation timing

median veldt
#

like that doesn't really tell me which specific one it comes from

red flower
#

joker.ability.extra.id = count in add_to_deck

median veldt
#

ah

#

figured actually

#

i was about to ask that

#

so, all in all, something like this

red flower
hushed field
#

also, you do not want to decrease the count in this case

median veldt
#

ok

#

yea fair

hushed field
#

as you'll be able to have multiple jokers with the same ID, and it'd give you a lot of issues with sell order

red flower
#

unless the player manages to get 1e308 of the joker nothing will happen

median veldt
#

trust

red flower
#

also card.ability[ without the .

median veldt
red flower
#

:3

hushed field
#

which I'm realizing now I should update in part, because I check for hardcoded qualities, rather than use can_calculate

median veldt
#

Whoops

#

forgot to put a dummy value in here

mighty yarrow
#

So I was trying to fix a huge lag spike and now my game just says this does anyone know how to fix this (I have tried a lot of potential fixes but none of them worked, I need the mod out by tomorrow)

red flower
#

what's the code for beautifulart

median veldt
#

uuuh i think i might want to see your joker code

red flower
#

i suspect the rarity is wrong

median veldt
#

mm yeah

mighty yarrow
#

SMODS.Joker{ --Beautiful Art
key = "beautifulart",
config = {
extra = {
odds = 1,
emult0 = 100
}
},
loc_txt = {
['name'] = 'Beautiful Art',
['text'] = {
[1] = 'WOW TIMMY THIS IS THE BEST',
[2] = 'ART IVE EVER SEEN'
},
['unlock'] = {
[1] = 'Unlocked by default.'
}
},
pos = {
x = 3,
y = 0
},
display_size = {
w = 71 * 1,
h = 95 * 1
},
cost = 50,
rarity = "balatrop_transending",
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
atlas = 'CustomJokers',
pools = { ["balatrop_balatrop_jokers"] = true },

loc_vars = function(self, info_queue, card)
    
    local new_numerator, new_denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'j_balatrop_beautifulart') 
    return {vars = {new_numerator, new_denominator}}
end,

calculate = function(self, card, context)
    if context.individual and context.cardarea == G.play  then
        if true then
            if SMODS.pseudorandom_probability(card, 'group_0_e2efa2bc', 1, card.ability.extra.odds, 'j_balatrop_beautifulart', false) then
                SMODS.calculate_effect({e_mult = 100}, card)
                card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, {message = "fridge", colour = G.C.DARK_EDITION})
                SMODS.calculate_effect({balance = true}, card)
            end
        end
    end
end

}

median veldt
#

may i see your code for balatrop_transending

#

ohwaitno

#

uh ok i don't know how custom pools work but that could also be defined wrong

red flower
#

yeah it's either of those

mighty yarrow
#

it was because i put a typo in transcending think

#

i just noticed

median veldt
#

lol

#

k is this. right

#

woops not _card but once i fix that yeah

red flower
#

card:add_to_deck()

median veldt
#

ah shit

red flower
#

also you need to emplace it somewhere

#

the hand or the deck

median veldt
#

saw that when looking at vremade, what's that

red flower
#

G.playing_cards puts it in the list of all the cards but not in an area
G.deck:emplace(card) would put it in the deck area

median veldt
red flower
#

i think thats correct

median veldt
#

lets test

#

whoops

#

didn't notice i wrote for...then instead of for...do

red flower
#

the lua extension shouts at me for that i do it often lol

median veldt
#

i dont use vscode anymore but this code editor doesnt have a lua extension yet lol

#

oh whoops

#

maybe i shouldn't have done _, card

#

they jus flipped over

#

they did get added to the deck though

hushed field
#

playing cards being visible isn't their default, iirc most areas would default to them being face down

median veldt
#

oh i actually like NEED to add something to my "increase joker values" card that doesn't affect the id LMAO

#

what the fuck?

median veldt
red flower
#

oh i forgot about something imporant again

median veldt
#

it happens

red flower
#

and i looked it up too lol

median veldt
#

what'd we miss

hushed field
median veldt
#

LMAO

red flower
#

area:remove_card(card)

hushed field
#

N wanted to say you can hold shift to run

red flower
median veldt
#

ah

#

why r u still here

umbral zodiac
#

what would be the best way to add/remove a variable amount of shop slots smoothly

median veldt
#

there was two cards and i sold the sandcastle and that one's still here

red flower
#

evil card

median veldt
umbral zodiac
#

nah this is like uhh

median veldt
#

it didnt even get added what the hell

red flower
#

im guessing if you remove cards while looping it doesnt reach it

umbral zodiac
#

i want it to change w/o requiring manually changing like the smods card area stuff

median veldt
umbral zodiac
median veldt
red flower
primal robin
#

setup update function which checks does amount of slots matches amount you need and if not, use smods function to adjust it?

umbral zodiac
#

like how you can just change extra_slots_used on a card and itll update accordingly

#

is there a way to do something similar for shop slots with a different variable

red flower
#

i dont think so

umbral zodiac
#

bleh

red flower
#

seems very hardcoded

umbral zodiac
#

im just gonna do the jank solution and delete the last card in the shop i guess

median veldt
#

Can I ask like

#

Why

primal robin
#

This card will reappear when you redeem overstock

median veldt
umbral zodiac
# median veldt Can I ask like

this is intended to be a temporary -1 shop slot effect but its based on a number that changes fairly often so if anything i'd prefer not to check every time it updates to see if the -1 shop slot effect should apply or not

primal robin
#

or rather new card will take it place so amount of slots will not change

red flower
median veldt
#

i wonder if change_shop_size(-1) would work

red flower
#

just do all the adding emplacing stuff in the bottom loop

median veldt
umbral zodiac
#

and then i'd also probably have to store if it already took away one or not

median veldt
umbral zodiac
median veldt
#

like this??

#

or like this

red flower
#

either

median veldt
#

holding back tears emoji

#

hold on

red flower
#

also make cards to remove a local

median veldt
#

ok cool it works properly

median veldt
#

well it is now

#

ok now to test tbhis

#

this should work right

#

No, It Doesnt

#

well i guess the area might be invisible but

primal robin
#

it does. it's in 0,0 pos with 0,0 size

red flower
#

the cards should be invisible too if the area is invisible

#

so thats weird

median veldt
#

just checked it is in fact invisible

#

and like i mean technically? even if the cards inside were invisible, wouldn't that animation of them getting moved into the area still be shown

median veldt
#

i would prefer if that did not happen

median veldt
#

here hold on

hushed field
red flower
#

possibly

median veldt
#

yeah,, the area is in fact invisible

#

oh shit yeah it might be the type

red flower
#

ah yeah the hand is also invisible in vanilla, no?

median veldt
#

oh yeah

#

actually i can check

red flower
#

well,

hushed field
#

checking the code for it, it seems to have some particularities, but it seems to me like setting the state to visible should just hide it, regardless, as that return is the first thing that code does. I wonder if it doesn't affect cards that get added after the state is changed?

median veldt
#

oh true

red flower
#

it definitely does apply to cards added after for me

hushed field
#

as in, for the joker area?

red flower
#

but it might be a type thing as well

#

yeah i always do the joker type

hushed field
#

Cause I suspect there might be something that syncs the visible state for cards with their area, but only in certain cases

red flower
#

anyway, the area type doesnt matter if its invisible

median veldt
#

I fear I accidentally fucked up and now I need to start the run over LMFAOOO

#

yeah anyway area type didnt do anything

#

do cards have the same states?

#

maybe I could just set their state to invisible when they're created

red flower
median veldt
#

oh that actually worked

rigid solar
#

I got sent this bug report but I have honestly no idea what's even happening there, any idea? Apparently it's tied to negative hand level but I don't see how exactly

#

the log only shows calls to draw functions which I havent touched in any way

frosty dock
#

oh hey a useless crash report

median veldt
#

yeah that literally does not mean anything

rigid solar
#

ok glad to see it's not useless to just me lol

median veldt
#

i mean clearly there's a bug in your code but that crash report doesnt mean anything

frosty dock
#

it appears this crash happens somewhat frequently when using cryptid with the wrong smods version

#

not sure rn what exactly that's about, but might be a similar case

#

would be good to know if it still happens with the latest dev version of smods

red flower
#

if you use a table when you return messages it will do this crash

#

because eremel added the ability to use ui elements in messages

rigid solar
#

there's no return in the use function of the consumable that allegedly caused the crash

#

and can_use is just return true

red flower
#

does it use attention_text or smods.calculate_effect

#

actually, whats the code lol

rigid solar
#

pick a random hand, 1 in 3 to decrease its level by 2 otherwise increase it

#

i have nothing besides whoever reported the bug's words to know that this is the thing that crashed
they could be wrong and the cause could be anything else, idk

red flower
#

hmm i dont see how this would do it

frosty dock
# red flower it is fixed

good to know, I've seen instances of the crash before that was a thing but I didn't know about / remember that change happening

rigid solar
#

i'll ignore it for now and told them to be more precise on what happened if they get it again

red flower
frosty dock
#

hm, could also be something going on within the level up UI logic

frosty dock
rigid solar
#

they said it's leveling down to -3 that did this, but i leveled multiple hands to -3 on my end and it didnt do anything

faint yacht
frosty dock
red flower
tidal hemlock
daring fern
rigid solar
frosty dock
#

mkay that shouldn't matter

rigid solar
#

assumed so too

thorn ingot
#

Do any of you know if it's possible to reference the perishable sticker in localization?

Something like "T:j_mail", but for perishable.

frosty dock
#

I don't think that's a thing yet

thorn ingot
#

damn, Life.

#

thanks

hardy vessel
#

I'm trying to make a sticker for playing cards that gives xmult of some kind, but no luck. (No message or anything)

 calculate = function(self, card, context)
        if context.individual then
            if context.cardarea == G.hand and not context.end_of_round then
                return {
                    xmult = 1.5,
                    message_card = context.other_card
                }
            end
        end
    end,```
red flower
hardy vessel
#

working, ty

sturdy compass
#

New smods release get crackin’ dev chat

rapid stag
#

now i have to migrate my draw to hand and main menu card stuff to this

#

...wait... how... would i? cirLost

#

uh, the menu card stuff, that is.

i have like a whole thing that cycles the card out with other stuff - i populate a pool of stuff to be picked from at random and then every 20 seconds or so, the card in the main menu is replaced with it

red flower
#

you can keep that code and just create the card in menu_cards probably

brave blade
#

Has anyone figured out how to ban enhancements/editions/seals yet?

daring fern
brave blade
#

Wait does that just work now?

#

I swear it didn't before

#

Yeah no it definitely doesn't work, they're still showing up from things like Incantation

red flower
#

incantation is just hardcoded to use all enhancements from what i see

#

it does call each individual in_pool but thats it

median veldt
red flower
chrome harness
#

What do I put in my main.lua file to be able to have/load other .lua files for less clutter?

red flower
#

theres code at the bottom of the question

chrome harness
#

Thanks never saw that page

wild bison
#

Hi, is there a way to edit the mult value of a boss blind in code? I am trying to make a boss blind that increases in value based on how many cards you have destroyed.

sturdy compass
#

Just developed a method to buffer Booster Pack openings and I feel so smart because of it

bright ivy
#
-- COPYCAT JOKER
SMODS.Joker {
    key = "test",

    in_pool = function(self, args)
        return true
    end,

    blueprint_compat = true,
    rarity = 3,
    cost = 9,

    loc_txt = {
        name = "Copycat",
        text = {
            "Imitates a random Joker.",
            "Changes after each hand.",
            "Currently imitating: {C:attention}#1#{}"
        }
    },

    atlas = "test_atlas",
    pos = { x = 0, y = 0 },

    set_ability = function(self, card, initial)
        card.ability.extra = card.ability.extra or {}
        card.ability.extra.copied_key = "j_joker" -- safe default
    end,

    loc_vars = function(self, info_queue, card)
        local key = card.ability.extra and card.ability.extra.copied_key
        local copied = key and G.P_CENTERS[key]
        local name = copied and copied.name or "Copycat Joker"

        return {
            vars = { name },
            name_vars = { name }
        }
    end,

    calculate = function(self, card, context)
        -- 🔁 Change when a blind is exited
        if context.end_of_round and not context.blueprint then
            local pool = {}

            for _, joker in ipairs(G.P_CENTER_POOLS.Joker) do
                -- ❌ Don't copy itself
                if joker.key ~= self.key then
                    pool[#pool + 1] = joker
                end
            end

            if #pool > 0 then
                local choice = pseudorandom_element(
                    pool,
                    pseudoseed("copycat_blind_change")
                )
                card.ability.extra.copied_key = choice.key
            end
        end
    end
}

How to find the text of the copied joker and add it as a tool tip on the side?

frosty dock
granite jay
#

Anyone how to make it so through boss blinds, certain cards cannot score any base chips?

granite jay
#

thx

hidden aspen
#

is there a way to get a list of all enabled mods, and then check list of jokers that belong to that mod?

#

i wanna make a compatible effect that spawns a joker from a different currently enabled mod

daring fern
# hidden aspen i wanna make a compatible effect that spawns a joker from a different currently ...
local mods = {}
for k, v in pairs(SMODS.Mods) do
    if not v.disabled and v.can_load then
        table.insert(mods, v)
    end
end
local mod = pseudorandom_element(mods, 'seed').id
local jokers = {}
for k, v in pairs(get_current_pool('Joker')) do
    if G.P_CENTERS[v] then
        if G.P_CENTERS[v].set == 'Joker' and G.P_CENTERS[v].original_mod and G.P_CENTERS[v].original_mod.id == mod then
            table.insert(jokers, G.P_CENTERS[v].key)
        end
    end
end
local key = pseudorandom_element(jokers, 'seed')
SMODS.add_card({key = key})
wintry solar
#

You absolutely don’t need to check the set of the centre

hardy vessel
#

Working on a playing card sticker that gives a dollar when held in hand during scoring, then removes itself. However, I don't want it to activate multiple times if it were to have something like a red seal or having mime in play. Is there some sort of check I can add to prevent the repetitions?


    calculate = function(self, card, context)
        local sticker = self.config
        if context.main_scoring then
            if context.cardarea == G.hand and not context.end_of_round then
                G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + sticker.dollars
                G.E_MANAGER:add_event(Event({
                    func = function()
                        card.ability[self.key] = false
                        return true
                    end
                }))
                return {
                    dollars = sticker.dollars,
                    func = function()
                        G.E_MANAGER:add_event(Event({
                            func = function()
                                G.GAME.dollar_buffer = 0
                                return true
                            end
                        }))
                    end
                }
            end
        end
        if context.after then
            G.E_MANAGER:add_event(Event({
                func = function()
                    if card.ability[self.key] then
                        card:juice_up()
                        card.ability[self.key] = false
                    end
                    return true
                end
            }))
        end
    end,
hidden aspen
#

wait is this actually because of Balatro Mod Manager?

hardy vessel
#

having this check should only allow something to work if the specified mod is currently active

hidden aspen
#

yes thank you, can_load is the right property

hardy vessel
#

i dont know the specifics, but it may help

primal robin
#

it is correct

hidden aspen
#

it doesnt seem to be documented on the wiki

hidden aspen
hidden aspen
#

what's get_current_pool('Joker') and why does it return 62 jokers? like i dont get the meaning of a "current pool", wouldnt that be every joker in the game?

frosty dock
#

which depends on what you've unlocked and what you currently own

hidden aspen
#

i see

slim ferry
#

does the inject function of an SMODS.ObjectType run after all centers have been injected already?

pastel kernel
#

there should be an easier way to do this

--Checks if you have a Grandiose Rarity Joker
add_to_deck = function(self, card, from_debuff)
        G.GAME.grandiose_check = true
    end,
    remove_from_deck = function(self, card, from_debuff)
        G.GAME.grandiose_check = false
    end,
mystic river
#

the check should be a function that iterates through G.jokers.cards (and any custom areas you care about) and looks at the card's rarity directly

#

cause this method will fail if the player acquires a second one

pastel kernel
#
function has_rarity(rarity)
    if G.jokers then
        for _, v in ipairs(G.jokers.cards) do
            if v:is_rarity(rarity) then
                return true
            end
        end
    end
end
if has_rarity("busterb_Grandiose") then
    G.GAME.grandiose_check = true
end
#

i just put this on top of grandjokers.lua where all the grandiose jokers are

#

idk what i'm doing

normal crest
#

Also I wouldn't recommend making it a global function

pastel kernel
#

I’m using a lovely patch that changes the background color if a joker of a specific rarity is present

#

Right now my current tasks look like this.

pastel kernel
#

ignore the special_colour

normal crest
#

Yeah so where you did G.GAME.grandiose_check == true you'd now replace with has_rarity("busterb_Grandiose")

pastel kernel
#

Ohh

normal crest
#

:p

pastel kernel
#

wdym attempting to call a global

#

so you only look for globals and not locals?

#

fuck you

mystic river
#

probably you typed local has_rarity in one file and then tried to call it in a different file
this is how scope works and lua does it that way on purpose

#

i would recommend putting any global functions in your mod's global table

pastel kernel
#

actually it's a function

mystic river
#

changes nothing

#

local function has_rarity is still local

pastel kernel
#

actually no, it's not a local

mystic river
#

then you may be attempting to call it before it is defined

pastel kernel
#

the entire snippet looks like this:

function has_rarity(rarity)
    if G.jokers then
        for _, v in ipairs(G.jokers.cards) do
            if v:is_rarity(rarity) then
                return true
            end
        end
    end
end```
mystic river
#

and where is that snippet?

pastel kernel
#

functionalities.lua

assert(SMODS.load_file("items/functionalities.lua"))()
assert(SMODS.load_file("items/gradients.lua"))()
assert(SMODS.load_file("items/rarities.lua"))()
assert(SMODS.load_file("items/pools.lua"))()
assert(SMODS.load_file("items/spectrals.lua"))()
assert(SMODS.load_file("items/infinity.lua"))()
assert(SMODS.load_file("items/packs.lua"))()
assert(SMODS.load_file("items/rarejoker.lua"))()
assert(SMODS.load_file("items/dreamyjokers.lua"))()
assert(SMODS.load_file("items/hyperjokers.lua"))()
assert(SMODS.load_file("items/deck.lua"))()
assert(SMODS.load_file("items/grandjokers.lua"))()
assert(SMODS.load_file("items/secret_jokers.lua"))()
assert(SMODS.load_file("items/edition.lua"))()
assert(SMODS.load_file("items/voucher.lua"))()
assert(SMODS.load_file("items/ace.lua"))()
mystic river
#

and is it called in any lovely patches?

pastel kernel
#

no?

keen atlas
#

did you try printing?

pastel kernel
#

printing what

fading rivet
mystic river
#

just to confirm that you're reaching that part of the code

keen atlas
#
print"added has_rarity"
function has_rarity(rarity)
  ...
pastel kernel
#

ok so it printed

mystic river
#

hmm
is anything erasing has rarity later? search for has_rarity =

pastel kernel
#

so it turns out putting them all in one functions file breaks, so i just separated them, no more crashes but no noticable change

mystic river
#

like
search your mod files

#

grep, to use the Linux term

#

if you're using vscode there's a search tab for this

pastel kernel
#

erasing has_rarity? that's possible?

mystic river
#

it's a variable
if anything runs has_rarity = nil later (and isn't referring to its own local variable) then poof. it's gone

pastel kernel
#

i'll just rename my variable

#

in case has_rarity is already being used

mystic river
#

that's a good idea as well

pastel kernel
#

i

#

i don't think i have one unless every mod has a custom one by default

mystic river
#

you don't, but it's very simple to make

#

BusBuf = {}

#

or whatever you feel like calling it

pastel kernel
#

ok now i wanna make BB.grand_check if that's a valid whatchamacallit

mystic river
#

yeah, you can store functions in tables like that

pastel kernel
#

what like this?

BB.has_rarity = {
function bb_has_rarity(rarity)
    if G.jokers then
        for _, v in ipairs(G.jokers.cards) do
            if v:is_rarity(rarity) then
                return true
            end
        end
    end
end
}
faint yacht
#

BB.has_rarity = function(rarity)

#

Or function BB.has_rarity(rarity).

pastel kernel
#
BB.has_rarity = function(rarity)
    if G.jokers then
        for _, v in ipairs(G.jokers.cards) do
            if v:is_rarity(rarity) then
                return true
            end
        end
    end
end
#

like this?

#

it's already 1am, i'll handle this later...

normal crest
#

that's fine, as long as you had BB = {} somewhere before that

hidden aspen
#

im using this

localize({ type = "name_text", key = event.ability.extra.joker_key, set = "Joker" }),

to fetch localization for a joker.
however when key is a vanilla joker it fails.
how do i correcttly fetch the joker's name?

daring fern
hidden aspen
#

okay i'll look through crash log again

wild patrol
#

how can I get this properly centered

#
    return {
        n = G.UIT.ROOT,
        config = {align = "cm", padding = 0.05, colour = G.C.BLACK},
        nodes = {
            { n = G.UIT.R, nodes = {
                { n = G.UIT.T, config = { align = "cm", text = "Status: ", scale = 0.4, colour = G.C.WHITE } },
                { n = G.UIT.T, config = { align = "cm", text = "Disconnected", scale = 0.4, colour = G.C.RED, id = "twitch_status" } },
            }},
            { n = G.UIT.R, nodes = { { n = G.UIT.T, config = { align = "cm", text = "Cooldown (s):", scale = 0.4, colour = G.C.WHITE } } } },
            { n = G.UIT.R, nodes = { create_text_input({
                max_length = 3, align = "cm", text = tostring(mod_obj.config.cooldown_sec), ref_table = mod_obj.config, ref_value = 'cooldown_sec',
            }) } },
            { n = G.UIT.R, nodes = {
                { n = G.UIT.C, config = { id = "connect_button", align = "cm", padding = 0.1, button = 'twitch_connect_trigger', colour = G.C.PURPLE, r = 0.1, minw = 2, minh = 0.6 },
                nodes = { { n = G.UIT.T, config = { align = "cm", text = "CONNECT", scale = 0.4, colour = G.C.WHITE, id = "connect_text" } } } }
            }},
        }
    }
end```
blazing helm
#

align = "cm" -> align = "tm" i think

wild patrol
#

didn't work ;/

blazing helm
#

then idfk i dont understand UI at all lmao

wild patrol
#

lol

rapid stag
hidden aspen
frosty dock
#

you're way behind

rapid stag
#

oh, there was a lovely update

frosty dock
#

two, actually

#

the one you have is from over a year ago

rapid stag
#

cirPrise wao

#

wait, so was the orphaned console issue solved

red flower
#

yes

rapid stag
#

yay

frosty dock
#

what did you update smods from, like 0827 or 1016?

rapid stag
#

1224a

#

the previous release cirDerp

frosty dock
#

wait we were still supporting 0.7.1? that's wild

#

I didn't think that was the case

rapid stag
#

i was about to say, that's pretty crazy that that happened

red flower
#

i think 0.8 was just the macos fix and no much more lol

frosty dock
#

which is before on module patches being optional

#

we just weren't making use of it before preflight

rapid stag
#

do i just need to specify a ref_table in the extension declaration?
something like ref_table = {}?

or is there more to this

scenic steeple
#

hey quick dumb question, why order no work no matter number?

frosty dock
#

they're organized in the order they're created in

scenic steeple
#

so either byebye smods or find a way to override smods ordering

frosty dock
scenic steeple
#

uhhhhhhhhhhhhhhhhhhhh personally I'd like the vouchers to be actually together instead of split

#

so like, how the vouchers are actually placed where tier1 on left & corresponding tier2 on right

frosty dock
#

then don't register them out of order? you have control over what order you register each voucher

scenic steeple
#

I have a feeling my reluctance to put them all in 1 file is now biting me in the ass

wild patrol
#

honestly one file would still have beena pain to edit

frosty dock
#

meh, you'd just have to make a list of the order to load the files in and then follow that

wild patrol
#

UI stuff just doesn't wanna work with me I can't get anything to center

frosty dock
wintry solar
scenic steeple
rapid stag
frosty dock
#

so this happens whenever you throw the object into an info_queue?

rapid stag
#

no, this was on game startup

frosty dock
#

ok one sec

#

you need to initialize G.localization.descriptions[self.set]

#

we should probably make that null safe on smods' end

hidden aspen
#

is there a way with SMODS to perform certain function AFTER all the other mods have loaded? i want to count total amount of custom jokers, but since my mod has a priority of -10000 i load in before other mods

wintry solar
rapid stag
#

one thing i've also noticed now is that pressing R on the crash screen or some other methods of restart such as opening mods menu and enabling/disabling a mod isn't actually restarting balatro and just leaving it closed

#

is this an issue on my end or

#

lemme check the restart shortcuts, actually
ok those work

frosty dock
#

or you can use an event

hidden aspen
#

yeah im gonna see if event works

frosty dock
hidden aspen
#

yesssss event works

hidden aspen
#

what's the proper way of moving a Card between CardAreas?

red flower
#

draw_card(area1, area2) should work?
if not then
area1:remove_card(card)
card:add_to_deck()
area2:emplace(card)

#

the add to deck is assuming youre trying to do the thing you were talking about in modding general

worthy stirrup
#

Are these ass, lol

hidden aspen
#

but draw_card also works

#

is there a downside?

#

i guess second one specifies which card we're taking, and the first one only takes 1

red flower
#

you can also specify the card with draw_card, its one of the arguments

hidden aspen
#

i see

red flower
#

im not sure if it calls add_to_deck tho

hidden aspen
worthy stirrup
#

is modding dev not serious talking about mods, i still dont know how the new sorting of channels works lol

red flower
#

it calls the card's add_to_deck :3

worthy stirrup
#

ah, i thought that was support, mb

hidden aspen
worthy stirrup
#

i see

red flower
#

i mean people talk about making mods here and it's part of what the channel is for

wild patrol
#

is there away to change the size of a create_text_input

#

still ugly but better than before

#

ty

worthy stirrup
#

i forgot fools gold wasnt even a thing lmao

#

thank you btw

median veldt
#

could that be done?

sturdy compass
#

That can be done fairly easily I think

blazing helm
#

anyway to swap the sprite of the joker on the startup animation?

sturdy compass
#

You can do that very easily with a patch

blazing helm
#

oh cool, how do patch :3 (ive never used them and the syntax scars me qwq)

sturdy compass
#

Patches are very simple, it’s basically telling lovely “Here’s this line of code, put this code nearby or replace it”

median veldt
#

i almost just explained a hook, whoops

sturdy compass
#

Lmao

blazing helm
sturdy compass
#

Here’s my patch for replacing the splash card

[manifest]
version = "1.0.0"
dump_lua = true
priority = 1

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_joker'])
'''
position = "after"
payload = '''
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_mxms_normal'],{bypass_discovery_center = true, bypass_discovery_ui = true})
'''
match_indent = true
times = 1```

Looking in the game dump will help you a lot in looking for stuff like this
#

In all honesty, looking through the dump code has elevated my ability to read and understand code a ton

blazing helm
sturdy compass
#

👌

quick scarab
#

Just this?

SMODS.Joker {
    key = 'endo_01',
    atlas = 'Joker',
    pos = { x = 7, y = 0 },
    rarity = 1,
    cost = 2,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,

    fnaf_type = "Animatronic", -- Type of Card
    fnaf_broken = false, -- Fixable or Not

    config = { extra = { chip_mod = 100 }, },
    loc_vars = function(self, info_queue, card)
        info_type(self, info_queue, center)
        return { vars = { card.ability.extra.chip_mod } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            return {
                chips = card.ability.extra.chip_mod
            }
        end
    end
}```
#

also I'm trying to make a function to give info_queue of the type of the card as well

dapper sun
#

yea

quick scarab
dapper sun
quick scarab
#

hold up let me check

dapper sun
daring fern
quick scarab
tidal hemlock
#

i might be missing some combos idk

#

not going to do quadritrib

rapid stag
sturdy compass
#

It does not

bright ivy
#
-- COPYCAT JOKER
SMODS.Joker {
    key = "test",

    in_pool = function(self, args)
        return true
    end,

    blueprint_compat = true,
    rarity = 3,
    cost = 9,

    loc_txt = {
        name = "Copycat",
        text = {
            "Imitates a random Joker.",
            "Changes after each hand.",
            "Currently imitating: {C:attention}#1#{}"
        }
    },

    atlas = "test_atlas",
    pos = { x = 0, y = 0 },

    set_ability = function(self, card, initial)
        card.ability.extra = card.ability.extra or {}
        card.ability.extra.copied_key = "j_joker" -- safe default
    end,

    loc_vars = function(self, info_queue, card)
        local key = card.ability.extra and card.ability.extra.copied_key
        local copied = key and G.P_CENTERS[key]
        local name = copied and copied.name or "Copycat Joker"

        return {
            vars = { name },
            name_vars = { name }
        }
    end,

    calculate = function(self, card, context)
        -- 🔁 Change when a blind is exited
        if context.end_of_round and not context.blueprint then
            local pool = {}

            for _, joker in ipairs(G.P_CENTER_POOLS.Joker) do
                -- ❌ Don't copy itself
                -- ✅ Only copy blueprint-compatible Jokers
                if joker.key ~= self.key
                and joker.blueprint_compat == true then
                    pool[#pool + 1] = joker
                end
            end

            if #pool > 0 then
                local choice = pseudorandom_element(
                    pool,
                    pseudoseed("copycat_blind_change")
                )
                card.ability.extra.copied_key = choice.key
            end
        end
    end
}

How can I add this as the 'other card' param needs a center of a card the user has.

local ret = SMODS.blueprint_effect(card, other_joker, context)
        if ret then
            ret.colour = G.C.BLUE
        end
        return ret
rapid stag
slim ferry
#

Fyi copying a card that doesnt exist is very difficult

rapid stag
#

this is a little janky, but what you might end up having to do is instead of going by key, store a reference to the target joker in a variable in G.GAME and then referencing that

bright ivy
rapid stag
#

oh god wait

#

you mean a random joker out of any joker, not just ones in hand

bright ivy
#

like as a card like throwback if copied gives Xnil

slim ferry
#

Also fyi

#

Blueprint compat is opt out now

#

So you should check if the blueprint compat value is true or nil

#

I think

bright ivy
#

ok

#

thanks

rapid stag
# bright ivy yea

i guess you could try instantiating a dummy version of the joker in a G.GAME var and try copying that, then? so long as it doesnt end up in a cardarea that gets calculated

bright ivy
#

They wernt calculated in the hand, but neither was the copycat joker 😢

rapid stag
#

like just

    myVar = card
 end```
junior tapir
#

Does anyone know how to insert logic at the point in time when chad says 'again'? I've tried to patch something in functions/state_events.lua under the for h = 1, eval.jokers.repetitions do section or the SMODS src/utils.lua under repeat in SMODS.insert_repetitions, but idk why the logic doesn't work in the first case or triggers a single time before even the first card scoring in the second case

rapid stag
#

reptition context is an optional context, do you have it enabled

junior tapir
#

wdym do I have it enabled, I precisely want for the joker Hanging Chad to make it work, haven't checked if that joker uses this precise context

slim ferry
rapid stag
#

oh cirDerp

junior tapir
#

jokers do use repetitions in some contexts

timid zinc
#

is there a way to tell if a discard is coming from the hook during pre_discard?

slim ferry
#

context.hook

daring fern
timid zinc
#

Thank you

wintry solar
rapid stag
fading rivet
#

any idea why this is this causes all cards in deck to be debuffed by suit debuffing blinds

brazen kite
#

is there a reason it shouldn't do that?

#

thats what happens to wild cards no

#

oh is it because it's only supposed to be flipped over cards

#

uhh i suspect it's because all cards in G.deck are face down before you draw them to your deck

#

but idk for sure

wintry solar
rapid stag
fading rivet
brazen kite
#

oh oops

#

misread

fading rivet
#

hence the context.cardarea ~= G.deck

brazen kite
#

not sure entirely since i cant like boot up the game and do any experiments

wintry solar
rapid stag
wintry solar
#

I think you can just materialize th card again

daring fern
fading rivet
#

omg

#

thank you idk how I didnt realize yhat

timid zinc
#

i can't see what i'm doing wrong here

daring fern
timid zinc
#

Oh

rapid stag
quick scarab
# quick scarab ok it worked, I just need to simplify so that it doesn't have 4 if states

Ok now my function that I have doesn't seem to work now despite working before, where it tries to locate if a card has as prefix

SMODS.Joker {
    key = 'catalog',
    atlas = 'Joker',
    pos = { x = 4, y = 3 },
    rarity = 2,
    cost = 4,
    unlocked = true,
    discovered = true,
    blueprint_compat = true,
    eternal_compat = true,

    fnaf_type = "Misc", -- Type of Card
    fnaf_broken = false, -- Fixable or Not

    config = { extra = { chip_mod = 100, chips = 0 }, },
    loc_vars = function(self, info_queue, card)
        info_type(self, info_queue, card)
        return { vars = { card.ability.extra.chip_mod, card.ability.extra.chips } }
    end,
    calculate = function(self, card, context)
        if context.joker_main then
            print(#Find_type("Animatronic", card))
            local Chips = card.ability.extra.chip_mod * #Find_type("Animatronic", card)
            return {
                chips = Chips
            }
        end
    end
}

function:

Find_type = function(type, card)
  local found = {}
  if G.jokers and G.jokers.cards then
    for k, v in pairs(G.jokers.cards) do
      if card.config.center.fnaf_type == type then
        table.insert(found, v)
      end
    end
  end
  return found
end
daring fern
quick scarab
#

I don't know why it was working before

ocean goblet
#

anyone know how to make a booster pack automatically either
a. pull up a hand of cards
or
b. have them be added to the consumable tray instead of immediately used?

rapid stag
fading rivet
#

I might be stupid how do I get the rank of a card

rapid stag
#

card.base.value

red flower
fading rivet
#

thx

pearl whale
#

Does anyone know the details of how jokers are selected to show up in the shop/booster packs? I know it rolls rarity first but it seems to also favor against jokers you have or jokers earlier in the roll. I want to make it disregard any duplicate checks and let a shop/booster be all the same joker if RNG rolls that way

frosty rampart
#

it's not just favored against jokers you have, it outright cannot roll jokers you already have. that said, the Showman joker explicitly makes it so you can roll jokers you already have, so i wouldn't recommend changing the system because that just makes showman useless

and i don't think the game does any weighting against jokers that have appeared recently in the shop at all, the pool is just big enough that it rarely rolls the same joker twice that quickly

red flower
#

I'm pretty sure it doesn't roll the same jokers you have in the shop if you open a booster iirc

frosty rampart
frosty rampart
pearl whale
#

As part of my mod right now, I banned all jokers except 4, one for each rarity, and still on a fresh run with no jokers sometimes it shows the default Jimbo joker after one of the approved jokers.

Let me try making the showman effect always on though, that might be exactly what I want

red flower
frosty rampart
#

gotcha

pearl whale
#

Making showman always return true was exactly what I wanted, ty!

violet chasm
#

How do I use preexisting variables in jokerforge?

timid zinc
#

is there a cardsleeves equivilant of back.effect.config that gets saved?

red flower
timid zinc
#

I see

#

I will have to figure out an alternative

red flower
#

G.GAME.sleeve_key = { stuff } is probably good enough

granite jay
#

Anyone know where to find SMODS.recalc_debuff so I can hook it to trigger another function?

fading rivet
# red flower

oh glad I didnt realize back was passed in a context when making adaptive deck and stored everything in G.game

red flower
#

what

fading rivet
# red flower what

when I made my adaptive deck I stored everything on G.game, which makes my card sleeve for it work without any modifications

red flower
#

ah ok

fading rivet
rapid stag
#

ah yes, astigmatism coding

rapid stag
#

oh, figured it out cirDerp one of my patches was overwriting an important call

rapid stag
frosty rampart
rapid stag
frosty rampart
#

it should, yea
if you're curious, under the hood, set_ability is used to set the "center" of a card object, and a bunch of stuff counts as a "center"- decks, booster packs, consumables, enhancements, jokers, and vouchers
playing cards additionally have a "front", which is where the rank and suit are relevant. touching the center won't do anything for that

wild patrol
#

what would be away to make it where if u can't use a tarot card from a pack you can send it to ur consumable slot?

daring fern
rapid stag
wild patrol
#

what's the gamestate when inside a tarot pack called

frosty rampart
#

there's not a specific state for types of packs, it's just G.STATE.SMODS_BOOSTER_OPENED inside any booster pack

wild patrol
#

Yeah was about to say I found it

daring fern
bright ivy
daring fern
rapid stag
frosty rampart
#

probably something of that nature?

rapid stag
#

and what about the other way around cirBox

daring fern
naive coral
#

does anyone know why this crash occurs when i try and use a joker to make a custom enhancement?

rapid stag
#

migrating is so much fun

ended up fixing both of these, but any cards with floating sprites end up with small floating sprites when materialised for the first time - then if they're materialised again later, their floating sprites are bigger but still a little too small, but actually centred

wild escarp
#

How would I give a card a random seal and enhancement?

frosty rampart
wild escarp
#

Thank you!

glass scaffold
#

So with this, it'll debuff the target cards, but if I sell ANYTHING, it undoes the debuff.

daring fern
hallow moat
#

Question: would anyone take a modding request for a relatively easy mod to make?

#

It would be cool to have a mod that has a little display of misprint that shows what the next drawn card is.

#

(Misprint tells you what the next drawn card will be in vanilla balatro.)

hallow moat
#

Oh sick! Didn't know that exists alr. Thanks!

glass scaffold
#

I can't get on PC because my wifi is dead for now.

daring fern
glass scaffold
tulip pecan
#

I have a large number of consumable sets in my mod (currently 4), and am thinking of adding more. This clutters the collection menu greatly, so I want to put all of the consumables inside one set to show in the collection. However, one of my sets requires that I change the shop_rate value to toggle availability in the shop for those cards. Am I able to use SMODS.ObjectType to "section off" all my consumables into different pools, and have a shop rate tied to each object type individually? And if not, what would be the best way to go about a fix for this?

glass scaffold
tulip pecan
#

which is the part im unsure about

short mauve
#

is there even a way to align the chips (and X) container with the mult one?

frosty dock
pastel kernel
#

how does this snippet work?```lua
select_music_track = function()
return (
#Cryptid.advanced_find_joker(nil, "busterb_Grandiose", nil, nil, true) ~= 0
) and 100.000
end,

hidden aspen
#

if advenced_find_joker size is not 0,then it returns 100000

#

if its 0,then it returns nil

frosty dock
#

other than that, that's technically what happens here

hidden aspen
#

oh why would they put a floating point there, wierd

frosty dock
#

how the function works is that each track returns a priority value

#

so the track that returns the highest value is chosen to be played at any given time

frosty dock
#

it's just numbers

hidden aspen
#

yeah but... wierd to specify 3 zeros after the floating point ?

frosty dock
#

the number of digits is to be consistent with what they're doing elsewhere, e.g., 100.002

hidden aspen
#

thats fair

verbal vigil
#

Does anyone know if there is a way to create a UI box in the main menu? I want to create one whenever the game loads.

red flower
#

what for

verbal vigil
#

I want to let the user know there is a new update of the mod out

red flower
#

that should work then
toga's stuff and stocking stuffer both have similar things you can look into

primal robin
#

I hate when mods do that

red flower
#

youre not going to like mine then :p

primal robin
#

this one os okay since it's one-time welcome message fir reasonably complex mod

#

Plus initial reading test

verbal vigil
red flower
#

i should do an iq test before the game starts

verbal vigil
#

One more thing, my UI is appearing behind the center card for some reason

red flower
#

not before

verbal vigil
#

I think I am?

red flower
#

can i see

verbal vigil
#
function Game:main_menu(change_context)
    local ret = game_main_menu_ref(self, change_context)

    update_checker.check_for_update(mod.SMODS_VERSION)

    return ret
end```
red flower
#

hmm then how's the ui defined? you might gave set it to a lower priority

#

this i mean

verbal vigil
thorn basin
#

what should I do to fix this?

slim ferry
#

!!!!!!!!!!!!
Please make sure your lovely is up to date (Minimum lovely v0.9.0)
!!!!!!!!!!!!

keen atlas
primal robin
#

see? people cant read

#

98% is fact

keen atlas
#

i thought it's 0%

#

or 100%

thorn basin
#

So I updated the lovely and... uuuh...

red flower
#

do you have an smods zip in your mods folder

thorn basin
red flower
#

it looks like smods is loaded as lovely-only for some reason

#

check if its not nested, you dont have a second one, etc

slim ferry
#

there most likely is a second one somewhere since smods shouldnt be listed under mods at all

thorn basin
red flower
#

yeah you had 2, make sure that's the updated one

thorn basin
#

so steamodded was the 2nd one?

#

Prolly it was the outdated one

red flower
#

yeah

thorn basin
#

aight, thanks N'!

#

also nice to see ya again!

red flower
gilded blaze
#

it seems like the duplicate label "continue" no longer appears for duped smods installation
it's the syntax error inside functions/misc_functions.lua now

tepid crow
wintry solar
#

I'm not sure if this new error is unique or not 🤔

gilded blaze
#

at least we're seeing that quite commonly
but yea, it doesn't seem to be unique enough

wintry solar
#

will see if I can get a proper message sorted out

wintry solar
#

sorted it out, I think I'll push a new release this evening to fix this crash identification and also the profile crash

jolly rain
#

Heya, tried using take_ownership with smod to increase Ride The Bus's mult increment to +2. Caused an error, error-log attached. Lemme know if I'm overthinking this or if I made an obvious mistake. Testing lua attached as well.

mystic river
#

does lua get mad if you declare a label and then never use it? could someone make a label that exists solely to detect duplicate installations?

keen atlas
#

unused label is fine

#

duplicate label is not

#

also you can't jump over locals

red flower
#

you can change the name of it and it should fix it

mystic river
#

so if i made a lovely patch that adds a label named ::this label exists for the sole purpose of detecting duplicate installs; if you're seeing this please sanitize your mods folder::, that would work as expected?
(plus or minus some string formatting, I'm not sure whether you can do it exactly like that)

red flower
#

but also keep in mind this will get rid of the SMODS.scale_card call since vanillaremade doesn't use it

keen atlas
#

you_can_probably_do_like_this

#

but if you make a new global var you can probably detect that

jolly rain
loud crescent
#

whats the easiest way that i can simulate button presses through code (new blind, skip blind, play, discard, reroll...)?

red flower
thorn basin
#

Long time ago I made a custom consumable that is supposed to "mix" 2 enhanced cards by deleting one and setting the other with another enhancement.
the problem is that I wanna specify which enhancements need to be "mixed" to set the card that isn't gonna be destroyed with a specific enhancemement.
For example: I select 2 cards with the chemical enhancement, one red and one blue and when I use the consumable it flips both, destroys the leftmost and sets the rightmost with another enhancement and then flips the card again.
also this crash shows up when I try to do that:

red flower
#

the right value should be a string

#

or get rid of .key

#

it seems like leftmost doesnt have a center tho

#

it's probably leftmost.config.center

loud crescent
# red flower call the function that button calls

they seem to be just stored as strings (e.g. e.config.button = 'play_cards_from_highlighted') but the actual functions often receive extra parameters (e.g. G.FUNCS.play_cards_from_highlighted = function(e)). how do i find out what should be passed (for e in this case)?

wintry solar
#

e is just the object that was pressed

red flower
#

e is the button node, but for most of them it can be an empty table usually

wintry solar
#

the only ones I can think of that actually use the information are the option selectors

loud crescent
#

thanks, ig i will just try passing {} to everything and see if that works

thorn basin
# red flower it's probably leftmost.config.center

thanks!
also I would like to know how can I make it so when I select playing cards, the "USE" button of said consumable can be used only if at least 2 playing cards specific enhancements are selected.

red flower
#

check for it in can_use

thorn basin
# red flower check for it in can_use

it's been a long time since I got used to the lua coding for balatro...
do you know which source or guide I can look up for the can_use function to make a condition for such?

red flower
#

it should be in the SMODS.Consumable wiki but you just need to return true if it can be used

thorn basin
red flower
#

card is the consumable here

#

you want to check G.hand.highlighted which is the table of highlighted cards in hand

thorn basin
#

oh, now appears this crash when I click on the consumable

red flower
#

don't use G.hand.highlighted in has_enhancement

#

it's a table of cards, you need to loop through it

#

and you probably want to check if there are 2 or more

thorn basin
#

yeah

thorn basin
red flower
#

yes

thorn basin
# red flower yes

tried like this but it still doesn't work (but it doesn't crash)
those comments are for checking if there are 2 selected

keen atlas
#

is_chemical might be nil?

thorn basin
#

it is

keen atlas
#

you might wanna do not is_chemical == not ...

thorn basin
umbral spire
#

what's the difference between Card.debuffed and Card.debuff?

keen atlas
red flower
#

why are you using is_chemical at all

keen atlas
#

🤷‍♂️

umbral spire
keen atlas
#

this run

keen atlas
#

Card.debuff is the current debuffed state, a boolean
afaik theres no Card.debuffed

umbral spire
#

How do you set the enhancement of a card?

red flower
umbral spire
#

I'm confused because Vampire (VanillaRemade) uses c_base (Card:set_ability("c_base")) but I thought the class prefix is m_?

#

What's the prefix?

umbral spire
mystic river
#

c_base is unenhanced playing cards

umbral spire
#

isn't c the consumable prefix?

keen atlas
mystic river
#

playing cards break several rules because thunk
they also have three names

umbral spire
#

in this case

red flower
#

it is c_base

keen atlas
#

theres no m_base

mystic river
#

m_base doesn't exist

umbral spire
#

oh

red flower
#

this is a 'because thunk said so' moment

mystic river
#

"it's not m because it's not modified" - thunk probably maybe idk

umbral spire
#

So it would be m_lucky but for base c_base?

mystic river
#

yes

umbral spire
#

Alright.

red flower
#

also im pretty sure this is answered in the wiki

#

just in another question

#

hmm i guess not

#

speaking of the wiki

#

how the hell do i sort it to be more searchable

thorn basin
red flower
red flower
#
local is_chemical = true
if #G.hand.highlighted == 2 then
  for _, playing_card in ipairs(G.hand.highlighted) do
    if not SMODS.has_enhancement(playing_card, "key") and ... then -- do the rest
      is_chemical = false
      break
    end
  end
  return is_chemical
end
#

im stupid

thorn basin
#

huh?

red flower
#

there

rapid stag
#

why isn't my hook working?

red flower
#

r is lowercase

rapid stag
#

cirDerp right

thorn basin
rapid stag
#

...wait, is load_profile not the function called when you switch profiles? cirLost

red flower
#

are there any common vanilla functions people want docs for

rapid stag
#

every function that runs on game start and every function that runs at every point of switching profiles cirBlech

#

but outside of niche use cases like mine, i guess... maybe shop functions

rapid stag
#

every function that gets called on shop start

#

and anything that can happen while in the shop

#

from what i've seen, a lot of people like to try either just messing with the shop or building some extra thing for it

red flower
#

im asking more for utility functions

rapid stag
#

ah

red flower
#

there are contexts for shop things now as well

frosty dock
#

it's the base center or something

#

idk

slim ferry
#

c is for card

#

clearly

frosty dock
#

what even is a card

slim ferry
#

you are an card

frosty dock
#

clearly an instance of Card

#

and c_base is not a Card

#

so the c can't possibly mean card

slim ferry
#

wdym c_base is not a Card

frosty dock
red flower
#

it stands for cstring

frosty dock
red flower
#

cdata_base

frosty dock
#

not an instance of the Card class

slim ferry
#

the c is short for c_base

#

c_base_base

#

it stands for consumable everywhere else though

frosty dock
#

is this a GNU = GNU's Not Unix situation

frosty dock
#

it stands for consumeable half the time

slim ferry
#

true...

red flower
rapid stag
#

is floating_sprite:remove() a thing?

red flower
#

yeah

rapid stag
red flower
#

whats the code

rapid stag
red flower
#

hmm no idea

mystic river
versed swan
#

How do you add a localization entry for deck skins?

#

(besides loc_txt)

viscid talon
#

How do I make a Joker unlock after discovering every other Joker in that mod

#

For example if I had a mod with 30 jokers and you need to have discovered all 30 of those jokers before unlocking that secret 31st joker

viscid talon
#

bump

#

😭

#

IM LOSING MY MIND

#

i got some help from n and got this code

#
        local all_unlocked = true
        for _, center in ipairs(G.P_CENTER_POOLS.minus_collectibles) do
            if center.key ~= self.key and center.mod and center.mod.id == "balatrominus" and not center.unlocked then
                all_unlocked = false
                break   
            end
        end
        return all_unlocked
    end
}
#

but it no worky

wanton jolt
#

says tg is nil

frosty rampart
#

card.ability isn't populated until after the load function is run i think

wanton jolt
viscid talon
#

who tf pinged me

wanton jolt
#

i did accidentally

viscid talon
#

boooo

granite jay
#

How do you override the description of a card for debuff-like effects?

viscid talon
#

boooooooooooooo

wanton jolt
#

well fuck you 🖕

viscid talon
#

wow how could you be so mean to eventlesstew

#

@granite jay im very sorry for feli's behaviour here

wanton jolt
#

deflect, deny

viscid talon
#

no

#

am truthful

#

i have never lied

wanton jolt
#

don't lie at this time

#

😛

viscid talon
#

OH COME ON 😭

#

IM NOT FASTING

#

NOT RN AT LEAST

#

ITS 10PM

wanton jolt
wanton jolt
#

what do you mean

granite jay
frosty rampart
#

i do the same thing for high roller

wanton jolt
granite jay
wanton jolt
#

its fine

wanton jolt
granite jay
#

You know how the debuffed cards have the “score no chips and all abilities are disabled” description rather than +5 chips? I wanna do that for a boss blind condition where cards score no chips

wanton jolt
#

so like you want to make something different from a debuff?

#

that works like one?