#💻・modding-dev

1 messages · Page 516 of 1

red flower
#
local modded_suits = {}
for key, value in pairs(SMODS.Suits) do
  if value.original_mod then
    table.insert(modded_suits, key)
  end
end
local random_suit = pseudorandom_element(modded_suits, "community")

this give you the key

#

it's an optional feature you have to enable

trail tide
red flower
#

god i hate that there are no docs for this

#

give me a sec

red flower
trail tide
rocky plaza
#

I just looked here and apparently perma bonuses support negative values so just set the perma_bonus such that the bonus cancels the base chip values i guess?

brave blade
rocky plaza
brave blade
rocky plaza
brave blade
rocky plaza
#

yeah i cant think of a better solution

cursive gazelle
#

my cursor is gone

#

rip

rocky plaza
cursive gazelle
#

no seriously my cursor don't show up ingame

#

help !

#

its obs

#

i knew it

rocky plaza
faint yacht
#

-# me when I change cursor type with a Joker

proven belfry
#

how do I make a specific consumable rarer in the shop (not impossible to find)

proven belfry
frosty rampart
slow nymph
#

hey so is this where we post errors?

proven belfry
proven belfry
slow nymph
#

this happens when i look at macarons

proven belfry
slow nymph
#

no

proven belfry
slow nymph
#

ahhhhhh

#

oops

#

my bad

frosty rampart
proven belfry
#

its fine

#

im ok with same rarity if thats the case

ocean sinew
frosty rampart
#

i have no clue tbh, i was just brainstorming when i said that

ocean sinew
#

oh 😔

#

my lib is almost done

#

implementing scaling modifiers caused a lot of problems which I had to fix

proven belfry
#

how would I make an overlay pulse on a random consumable like the soul? looked at vremade and it doesn't show how to customize the overlay image

red flower
#

look at hologram for how to do it and the soul for how the effect is coded

vernal path
#

This crashes, which seems weird, right? local playing_card = pseudorandom_element(G.playing_cards, 'ugly')

red flower
#

whats the crash

vernal path
#

it says it's expecting a table but recieving nil

red flower
#

pls send log

#

and code if possible

vernal path
#

oh, wait no it's crashing on local random_enhancement = pseudorandom_element(enhancement_pool, 'edit_card_enhancement')

proven belfry
#

also made a consumable hidden so that it cant be shown in shop (i want it to only be spawnable via another consumable which creates 2 of the hidden one's type) and it wont be created by the spawner consumable, is there a fix or do I just have to make it unhidden

vernal path
#
SMODS.Joker {
    key = "ugliest_joker",
    unlocked = true,
    discovered = false,
    atlas = "ModeJokers",
    rarity = 2,
    pools = {
        dank = true
    },
    config = { extra = {
        count = 2
    }},
    blueprint_compat = true,
    eternal_compat = true,
    perishable_compat = true,
    cost = 6,
    pos = { x = 8, y = 0 },
    loc_vars = function (self, info_queue, card)
        return { vars = {card.ability.extra.count}}
    end,
    calculate = function(self, card, context)
        if context.setting_blind then
            G.E_MANAGER:add_event(Event({
                    func = function()
                        for i = 1, (math.min(card.ability.extra.count, #G.playing_cards, 2)) do
                            local playing_card = pseudorandom_element(G.playing_cards, 'ugly')
                            local random_enhancement = pseudorandom_element(enhancement_pool, 'edit_card_enhancement')
                            playing_card:set_ability(random_enhancement)
                        end
                        return true
                    end
                }))
        end
    end
}```
#

line 289 is the local random_enhancement line

proven belfry
red flower
red flower
red flower
vernal path
#

right, im stupit, hang on

proven belfry
red flower
#

make one=

red flower
vernal path
#

oh?

red flower
vernal path
#

ah

proven belfry
red flower
#

in_pool

proven belfry
red flower
#

you wouldnt use G.shared_soul there because that's the soul sprite
but also I have literally no idea about graphics code so I can't help more on this sorry lol

proven belfry
#

would anyone here be so kind as to tell me what i would actually use

slim ferry
#

oh youre trying to do the soul sprite thing?

proven belfry
slim ferry
#

well the graphics code there is specifically if you want the unique animation that the floating sprite of the soul does

proven belfry
slim ferry
#

you can just remove the draw function if you want the normal floaty

#

like legendaries and stuff have

proven belfry
#

i want pulsing

slim ferry
#

okay well im not a graphics guy

#

so then idk

vernal path
#

@red flower My sticker code is crashing specifically when viewing in the collection trying to index jokers. Is there a good way to disable all the code if its just viewing in the collection?

SMODS.Sticker {
    key = "now_playing",
    atlas = "ModeJokers", pos = {x = 9, y = 4},
    should_apply = false,
    rate = 0,
    badge_colour = HEX '577379',
    apply = function (self, card, val)
        card.ability[self.key] = val
        if card.ability[self.key] then 
            G.jokers.config.card_limit = G.jokers.config.card_limit + 1
            card:set_cost()
        else
            G.jokers.config.card_limit = G.jokers.config.card_limit - 1
        end
    end
}```
proven belfry
charred widget
#

Hello again friends, I come with a request to help me make a slight overhaul of a joker i made

proven belfry
charred widget
proven belfry
#

whatre ya tryna do

charred widget
#

Right now, this joker creates a negative death card for each hand played

proven belfry
charred widget
proven belfry
charred widget
#

I'd like for it instead to check for a single card discarded, destroy said card, and then create the negative death card

proven belfry
slim ferry
#

yeah thats just trading card but with some tweaks

#

should be pretty simple

charred widget
#

exactly!

proven belfry
#

i made a joker that upgrades by x0.25 mult per discarded card

slim ferry
#

hit the road if it was good

proven belfry
brave blade
#

Is there a way to ban a card enhancement? I know I can ban its tarot card, but I also want to ensure it doesn't show up in packs, from incantation/familiar/grim, etc.

charred widget
#

whats that lol

slim ferry
#

vanillaremade

proven belfry
charred widget
#

oh right

proven belfry
#

holy bible for modding

vernal path
brave blade
# charred widget ?

Vanilla Remade is a mod that features all of the vanilla jokers, decks, consumables, etc. recreated as an SMODS mod

slim ferry
proven belfry
proven belfry
slim ferry
#

i never download it tbh i just open it in my browser when i need it

#

because then its also like

slim ferry
#

always up to date

brave blade
#

I have it downloaded and in my VSCode workspace because then I don't have to exit and I can also search through it much easier

frigid cargo
#
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.choose, card.ability.extra } }
    end,

    weight = 0.9,
    cost = 4,
    kind = "BTCTPack",
    
    create_card = function(self, card, i)
        ease_background_colour(HEX("ffffff"))
        return SMODS.create_card({
            set = "Batrocities",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = false,
        })
    end,
    select_card = 'jokers',

    in_pool = function() return true end
}

Why does it just crash my game?

slim ferry
#

because thats like not what a pack looks like at all

#

needs something like this

frigid cargo
#

then how does the other pack work

slim ferry
#

ease background colour is its own thing

#

everything else is fine though

#

i think

frigid cargo
#
    weight = 0.6,
    cost = 4,
    kind = "ShapePack",
    
    create_card = function(self, card, i)
        ease_background_colour(HEX("cc3b49"))
        return SMODS.create_card({
            set = "Shape",
            area = G.pack_cards,
            skip_materialize = true,
            soulable = false,
        })
    end,
    select_card = 'jokers',

    in_pool = function() return true end
}

then how does this pack work?

slim ferry
#

no clue

#

but also

#

please use vanillaremade for reference

frigid cargo
slim ferry
#

other mods are often going to have like

#

confusing shit

#

since ease_background_colour isnt a function that exists i assume they just made it themselves so its easier

frigid cargo
#

ah ok thanks

proven belfry
#

holy synergy

charred widget
charred widget
#

tysm!!

frigid cargo
brave blade
#

Is there a way to ban a card enhancement? I know I can ban its tarot card, but I also want to ensure it doesn't show up in packs, from incantation/familiar/grim, etc.

slim ferry
cursive gazelle
cursive gazelle
#

thought i show here if someone has a question on how i did stuff

slim ferry
proven belfry
brave blade
charred widget
proven belfry
slim ferry
#

fucking around and breaking shit is where you learn a lot of stuff

#

like what you can and cant do

proven belfry
slim ferry
#

ive seen it so many times

#

and if i cant figure it out i just ask here

brave blade
#

Yeah, at least give it a try, and if you get an error and can't figure it out then post here

slim ferry
#

which is also how i learned a lot of stuff

charred widget
slim ferry
#

yeah i know

#

crashes really arent that bad

brave blade
slim ferry
#

they happen a lot when you make mods

brave blade
#

You won't figure out how to prevent crashes if you don't crash the game a few times

slim ferry
#

and its how you find issues most of the time

#

also that yeah

proven belfry
#

when I made my first balatro mod I used chatgpt

#

make fun of me

brave blade
#

If you're doing something that messes with save data then you might want to backup your save, but other than that you should be fine

proven belfry
#

can i make it so that a consumable type only spawns if a certain joker is present

charred widget
#

hold up

#

game crashed

proven belfry
#

hmm

#

what does the crash say

charred widget
proven belfry
#

are you using vscode

#

vscode shows syntax errors

charred widget
#

yes

proven belfry
#

maybe a comma

charred widget
#

the syntax errors are red yeah?

slim ferry
#

yeah they are

charred widget
#

well i'm not seeing any

proven belfry
frigid elm
#

I have a smol question- is it possible to prevent money (or any number really) from being updated at all?

Like, losing money from the Ox, or gaining money from the end of a blind, none of that gets removed or added, and have the money be treated as effectively 0 since the money is frozen.

charred widget
#

yeah i'm looking at line 65 but nothing seems wrong

vernal path
#

you forgot an end stickmin

#
calculate = function(self, card, context)
        if context.cardarea == G.jokers and context.joker_main then
            local created_consumable = true
            G.E_MANAGER:add_event(Event({
                func = function()
                    if #context.full_hand == 1 and G.GAME.current_round.hands_played == 0 then
                        SMODS.add_card { set = 'Tarot', key = 'c_death', edition = 'e_negative', key_append = 'joker_forge_tarot' }
                    end
                    return {
                        remove = true
                    }
                end
            }))
            -- another counting loop
            local death_count = 0                                -- number of Death cards
            if G.consumeables then                               -- check if consumables exist
                for _, c in ipairs(G.consumeables.cards) do      -- check every consumable
                    if c.config.center.key == "c_death" then     -- if the key is c_death, then it is a Death card
                        death_count = death_count + 1            -- increment count by 1
                    end
                end
            end
            return {
                xmult = (1 + 0.2 * death_count),     -- again, 1 + 0.1 * death_count
                message = created_consumable and localize('k_plus_tarot') or nil
            }
        end
    end
}
#

fixed it

proven belfry
charred widget
#

oh cool

proven belfry
#

im dum

vernal path
#

(it was the end to the func function in the event)

charred widget
#

ok cool

vernal path
#

always format your code, and if it doesnt then that means you are missing a bracket or an end or something

charred widget
#

it works

#

thanks for your help

vernal path
#

in vs code just right click a selection and hit format selection, or format document

lament agate
#

can i not put if statement inside of return?

charred widget
#

nevermind it doesn't work

lament agate
charred widget
#

it just didn't crash

slim ferry
#

what is it not doing right

charred widget
#

it's now completely broken what

#

it doesn't destroy the one card discarded and it doesn't create a negative death

vernal path
#

i think the code to spawn the tarot is probably broken, it doesnt look like anything ive seen before

slim ferry
#

also get rid of G.GAME.current_round.hands_played == 0 thats like completely unrelated to what youre doing idk why he put that there

#

also yeah

#

that consumable creation code is

#

something else

#

doing context checks in the event???

#

what

#

also joker_main??

proven belfry
#

sorry @charred widget

slim ferry
#

sixth sense removes cards 😭

#

also its

#

discards

#

when discarding a single card

#

i think

proven belfry
foggy ginkgo
#

How do I detect the amount of a certain suit being destroyed

charred widget
#

yeah i did want it to destroy a single card discarded

long sun
#

if self.config and self.config.func and (((self.config.button_UIE or self.config.button) and self.config.func ~= 'set_button_pip') or self.config.insta_func) then G.FUNCS[self.config.func](self) end

for what reasons might this line be causing this crash?

charred widget
#

and not necessarily the first discard

slim ferry
charred widget
#

also i will be putting everyone helping me in a special thanks section in the mod

proven belfry
charred widget
charred widget
frigid elm
#

Hmmm

Idk if anyone knows this, but what should I look at if there's a place that all of Balatro points to for updating dollars?

Like ease_dollars() but, i dunno if modifying that function with a hook (if im using that term properly) is going to help with preventing money being updated

red flower
#

unless something it's updating G.GAME.dollars directly

foggy ginkgo
#

How do I detect #context.removed for suits

frigid cargo
brave blade
frigid elm
charred widget
red flower
brave blade
charred widget
brave blade
#

Oh, cool!

charred widget
brave blade
#

Which ones are you planning to implement?

brave blade
foggy ginkgo
red flower
#

you dont need card = card

frigid elm
#

I've now also kinda realized that even if I'm able to prevent the money from being updated, how the hell could I tell the game that I technically have zero dollars? Preventing money from being updated could be super OP so it has to be balanced out by not being able to buy stuff from the shop

foggy ginkgo
frigid elm
red flower
foggy ginkgo
#

How would that be done

frigid cargo
proven belfry
#

how can I make boosters act like showman is applied (specifically consumable cards already in the consumable slot can spawn)

slim ferry
# charred widget ok thanks you
calculate = function(self, card, context)
    if context.discard and #context.full_hand == 1 then
        if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
            G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
            G.E_MANAGER:add_event(Event({
                func = function()
                    SMODS.add_card({
                        key = "c_death",
                        key_append = "idk" --you can put like anything here, allows for finding the source of the card creation so make it something intuitive
                    })
                    G.GAME.consumeable_buffer = 0
                    return true
                end
            }))
            SMODS.calculate_effect({ message = localize("k_plus_tarot"), colour = G.C.purple }) --message can be anything, this is just the +1 tarot text
        end
        return {
            remove = true
        }
    end
end

this should work if i did it correctly

charred widget
#

alright cool

frigid elm
# frigid elm I've now also kinda realized that even if I'm able to prevent the money from bei...

I think the best approach for this; while it may be hacky as all hell, I could have it so that I could hook into a couple of functions, one for updating money, another to ensure that your actual money is set to 0, and one more for the money rendering thingyabob

So the Freezer Joker would store the current amount of money and silently sets your money to 0, and force the game to render the money as the Freezer's stored value rather than your actual money and once the Joker is destroyed in any way, the Joker silently gives it back to you

cursive gazelle
slim ferry
#

i may be stupid

#

hold on

#

okay idk tbh

#

when does the crash happen

frigid cargo
charred widget
slim ferry
slim ferry
#

idk where card would be nil

charred widget
#

we may need get this peer reviewed

slim ferry
#

mayhaps!

proven belfry
#

how do I permanently subtract the amount of joker slots by 1 and check if there is at least one joker slot open in a consumable

charred widget
#

@vernal path sorry to ping you out of the blue but me and Eris are having a hard time figuring out a crash

cursive gazelle
slim ferry
#

its

#

death

#

death is a vanilla card

slim ferry
#

as shrimple as that

vernal path
vernal path
#

just do control c

#

and paste it

charred widget
#

oh

slim ferry
#

lmao 😭

vernal path
#

and also the current full joker code

charred widget
slim ferry
#

this makes me realize that i forgot some stuff lmao

#

but after we solve the crash

vernal path
# charred widget

try commenting out line 68, by adding -- to the beginning of the line

#

its crashing there, which is strange and i think may be a symptom of something else but im not really in programming mode rn

charred widget
#

ok

#

oh that fixed it

vernal path
#

weird af

slim ferry
#

huh

#

what was line 68 again

vernal path
#

it was just the message

slim ferry
#

huhh

#

wierd

vernal path
#

oh wait what does calculate_effect() take in as arguments

#

does it take 3 arguments

slim ferry
#

i just did the exact same message as the vanillaremade cartomancer

charred widget
#

ok so its not crashing anymore but there are still two problems

slim ferry
#

yeah i

#

forgot to make it negative lmao

#

mb

rocky plaza
#

oh i think the middle arg is supposed to be the scoring card

slim ferry
#

and i forgot the xmult

rocky plaza
#

yeah 3 args

slim ferry
#

give me a moment

vernal path
charred widget
vernal path
#

just gotta pass in the tarot being created as the second arg

frigid cargo
#

i dont know how to do skip tags, this just crashed my game

    apply = function(self, tag, context)
        if context.type == 'new_blind_choice' then
            local lock = tag.ID
            G.CONTROLLER.locks[lock] = true
            tag:yep('+', G.C.SECONDARY_SET.Spectral, function()
                local booster = SMODS.create_card { key = 'p_btct_booster_SGeo_1', area = G.play }
                booster.T.x = G.play.T.x + G.play.T.w / 2 - G.CARD_W * 1.27 / 2
                booster.T.y = G.play.T.y + G.play.T.h / 2 - G.CARD_H * 1.27 / 2
                booster.T.w = G.CARD_W * 1.27
                booster.T.h = G.CARD_H * 1.27
                booster.cost = 0
                booster.from_tag = true
                G.FUNCS.use_card({ config = { ref_table = booster } })
                booster:start_materialize()
                G.CONTROLLER.locks[lock] = nil
                return true
            end)
            tag.triggered = true
            return true
        end
    end
}
slim ferry
# charred widget yeah exactly what i was about to mention
calculate = function(self, card, context)
    if context.discard and #context.full_hand == 1 then
        G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
        G.E_MANAGER:add_event(Event({
            func = function()
                SMODS.add_card({
                    key = "c_death",
                    edition = "e_negative"
                    key_append = "idk" --you can put like anything here, allows for finding the source of the card creation so make it something intuitive
                })
                return true
            end
        }))
--SMODS.calculate_effect({ message = localize("k_plus_tarot"), colour = G.C.purple }) --commented out because it killed everything
    end
    return {
        remove = true
    }
    if context.joker_main then
        local death_count = 0
        if G.consumeables then
            for _, c in ipairs(G.consumeables.cards) do
                if c.config.center.key == "c_death" then
                    death_count = death_count + 1
                end
            end
        end
    return {
        xmult = 1 + death_count * card.ability.extra.x_mult_inc
    }
end
charred widget
#

aight cool

slim ferry
#

also i would change the description to also use the xmult gain as a variable

#

because thats easier and also how vanilla jokers are phrased

#

and uh

#

you have 2 variables in the config that do nothing

proven belfry
#

is -1 joker slot for 2 random spectrals bad

#

if so what would be good

slim ferry
#

thats ASS

#

-1 joker slot is a HUGE price

#

the effect would have to be insane

#

idk what though

rocky plaza
#
calculate = function(self, card, context)
    if context.discard and #context.full_hand == 1 then
        G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1
        G.E_MANAGER:add_event(Event({
            func = function()
                SMODS.add_card({
                    key = "c_death",
                    edition = "e_negative"
                    key_append = "idk" --you can put like anything here, allows for finding the source of the card creation so make it something intuitive
                })
                return true
            end
        }))
--SMODS.calculate_effect({ message = localize("k_plus_tarot"), colour = G.C.purple }) --commented out because it killed everything
    end
    return {
        remove = true,
        message = localize("k_plus_tarot")
    }
    if context.joker_main then
        local death_count = 0
        if G.consumeables then
            for _, c in ipairs(G.consumeables.cards) do
                if c.config.center.key == "c_death" then
                    death_count = death_count + 1
                end
            end
        end
    return {
        xmult = 1 + death_count * card.ability.extra.x_mult_inc
    }
end

if u still want the message

proven belfry
rocky plaza
#

at least i think u can return message there

slim ferry
rocky plaza
#

oh neat didnt know that

slim ferry
#

the message crashed

#

aaand i forgot an end

#

i think

rapid stag
#

bump - if anyone has a very custom generate_ui() on their joker and is willing to let me take a peek, so i can get an idea as to how i can write my own,, please let me know.

i know that @hushed field has a few, but i haven't seen them here in a while

slim ferry
#

okay yeah

#

after the return for joker_main

charred widget
slim ferry
#

add an end

rocky plaza
slim ferry
#

because i forgot to end the context check

rocky plaza
worthy stirrup
#

How would I make my own kind of Consumable Set and give it its own tab

proven belfry
lament agate
#

can you put a toggle to enable and disable a file from loading in your mod?

worthy stirrup
#

thank you

proven belfry
#

look at ConsumableType

slim ferry
#

if you want to stop something from loading

lament agate
#

thats why

#

dont worry, its not for these

slim ferry
#

oh like a config?

proven belfry
lament agate
lament agate
slim ferry
#

if statement for each file 🔥

#

thats my best idea

charred widget
lament agate
#

fair

rocky plaza
slim ferry
rocky plaza
#

docs on config menus

rapid stag
# rocky plaza https://github.com/nh6574/JoyousSpring

joyousspring starts its generate ui function with SMODS.Center.generate_ui() which creates the normal joker tooltip, and then appends onto that/alters accordingly.

i'm talking about writing one entirely from scratch using UI code starting from the generate_ui() call in the joker without using SMODS.Center.generate_ui() like balatro goes kino's 2001 joker

proven belfry
#

can anyone figure out why the game is crashing when I select this card

slim ferry
#

i think its SMODS.add_card and not SMODS:add_card

charred widget
slim ferry
rocky plaza
charred widget
#

the bracket turns red

slim ferry
#

uhhhh..........,,,,,,,,,,,,,

#

show screenshot

rocky plaza
charred widget
slim ferry
#

you didnt close SMODS.Joker

#

😭

charred widget
#

bro thats what i was talking about

slim ferry
#

oh

charred widget
#

that was the bracket i put in to fix it

slim ferry
#

i thought you removed something

lament agate
#

do i need to load my config using config.lua?

slim ferry
#

i think

charred widget
#

btw i probably put an end in the wrong spot

slim ferry
#

yeah

#

i meant like

worthy stirrup
#

I forget, is it title that I need to fix this

slim ferry
#

after the return table gets closed

rocky plaza
slim ferry
#

just a second end before the last one

charred widget
#

alribght

slim ferry
#

but also this end was supposed to be after this return

#

messed that up

rocky plaza
proven belfry
#

why is this crashing the game

slim ferry
#

when does it crash

proven belfry
slim ferry
#

well

#

yeah

#

but when in the game

proven belfry
charred widget
#

Eris it crashed again

slim ferry
#

augh

charred widget
#

and its the same crash log the last two times

#

it's been saying stuff about line 62 and line 59

slim ferry
#

that is a big issue that i missed

slim ferry
#

yeah

charred widget
#

ok

slim ferry
#

OH

#

uh

#

yeah

#

nvm

#

nothing

charred widget
#

??

slim ferry
#

i was stupid

#

i thought too fast

charred widget
#

can't say the same myself

#

crashed again

slim ferry
#

same thing?

charred widget
#

yep

#

it's saying something about lines 28, 59, and 62

#

wait

#

hold on

#

whatever this means

slim ferry
#

can you screenshot the entire file

#

so i can see the lines

rocky plaza
worthy stirrup
#

How could I edit this so it shows a joker?

G.deck.cards[#G.deck.cards] and {n = G.UIT.O, config = {align = "cm", object = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS[G.deck.cards[#G.deck.cards].config.card_key], G.P_CENTERS['c_base'])}} or nil,
charred widget
slim ferry
slim ferry
# charred widget

the line 28 thing might be that it should be info_queue and not info

charred widget
#

"it" being?

slim ferry
#

info

#

in the function for the loc_vars

rocky plaza
slim ferry
#

huh

rocky plaza
#

param names dont matter i guess

#

only the order

charred widget
slim ferry
#

i mean apparently if what i hear now is correct that shouldnt be the issue

rocky plaza
slim ferry
#

but you should still do that probably yeah

rocky plaza
#

gonna change it tho

charred widget
#

alright changed all the instances of "info" into "info_queue" aaaaaaaaaaaaaaaaaaaaand it crashed again

#

same logs

rocky plaza
#

yeah i figured it didnt change much

#

is it still a syntax error?

charred widget
#

"expected [to close '{' at line 59] near 'key_append'

rocky plaza
#

oh yeah

#

ok send the lua file then

charred widget
slim ferry
#

i should probably be doing less of this since its past 1:30 for me lmao

#

bit tired

charred widget
#

yeah atp go to bed

rocky plaza
charred widget
#

yo cool

slim ferry
charred widget
#

DOESN'T CRASH

slim ferry
#

i knew i shouldnt be doing this so late

rocky plaza
charred widget
#

ladies and gentlemen we may be back

rocky plaza
proven belfry
violet oasis
#

How do I check if a specific joker has a stake sticker? I wanna use it as a joker unlock condition

charred widget
#

IT WORKS

#

LEZGOOOO

proven belfry
rocky plaza
charred widget
proven belfry
rocky plaza
proven belfry
#

rate the trade

rocky plaza
slim ferry
#

the vscode setup stuff is on the smods wiki

rocky plaza
#

oh

proven belfry
rocky plaza
#

well this has the lsp setup info as well

slim ferry
#

oh nvm i mixed up the wikis

slim ferry
proven belfry
slim ferry
#

i would say

#

needs more long-term benefit

proven belfry
rocky plaza
proven belfry
#

maybe a negative rare jonkler

final moss
#

is there a way to add another box to put cards in? like jokers, consumables, make another one

slim ferry
#

no it doesnt??

slim ferry
#

cryptid doesnt add any card areas

proven belfry
rocky plaza
#

its been done before i think but i dont know how to do it nor which mods do so

slim ferry
#

multiplayer does it

final moss
#

thanks everyone

slim ferry
#

thats all i can think of

final moss
#

also no cryptid doesn't do it i don't think

rocky plaza
proven belfry
rocky plaza
#

hammerspace does that

#

makes all playing cards a random consumable

proven belfry
slim ferry
#

huh

#

thats not cryptid then though

rocky plaza
slim ferry
#

probably just another mod since a lot of cryptid content creators feel the need to install 3 trillion other mods

brave blade
#

I know Maximus does it for sure with its Horoscope cards

final moss
#

no explanation or anything... i'll figure it out, though. thanks

red flower
#

i mean if you have questions about it feel free to ask

final moss
#

are you referring to other functions and variables in the files? because just copying and pasting doesn't work, it crashes

#

(obviously replaicng the name of your mod with my own)

#

i am making some progress.

proven belfry
#

my game keeps crashing when i play my mod w multiplayer

#

it doesnt like G.GAME.consumeables

#

any fix to this?

red flower
proven belfry
#

no fix?

red flower
#

G.GAME.consumeables is not a thing i dont think

proven belfry
#

specifically G.GAME.consumeables.cards

#

it worked before i installed multiplayer

red flower
#

dunno

#

G.consumeables.cards is a thing

proven belfry
#

hmmmm

#

but last i tried, the cards that checked it did nothing

#

is set = "Consumeables" valid

#

i have it on a joker that makes a random consumable at start of round

red flower
#

yes

hallow slate
#

How would I get a random tarot card key?

red flower
#

pseudorandom_element(G.P_CENTER_POOLS.Tarot, "seed").key

fallen tendon
#

diabolical joker fusion idea

hallow slate
#

Thx!

buoyant shard
#

I need to hook Card:flip() so a joker can gain mult every time a card flips but I don't know how to do that correctly

daring fern
buoyant shard
#

yeah imma just paste that in and credit you

#

thanks

frosty rampart
#

yea that's the best way to do it
although Card:flip() doesn't actually return anything, so you should be able to just call oldcardflip(self) without returning it

buoyant shard
#

Balatro crashes when I select a deck. Did I not update to the new version of steammodded or something?

daring fern
buoyant shard
#

would that happen to be the function you hooked for me earlier?

daring fern
pastel kernel
#

"or card.ability.extra.xmult" in case high card is played, works or nah?

 local total_xmult = (card.ability.extra.stockpile * card.ability.extra.xmult) or card.ability.extra.xmult
#

How do i make sure high card would score xmult?

```lua
-- Stockpile xmult for each played card
    if context.individual and context.cardarea == G.play then
        card.ability.extra.stockpile = card.ability.extra.stockpile * 2
        local total_xmult = (card.ability.extra.stockpile * card.ability.extra.xmult) or card.ability.extra.xmult
        if context.other_card == context.scoring_hand[#context.scoring_hand] then
            card:juice_up(0.5, 0.5)
            play_sound('holo1', 1, 0.5)
            return {
                xmult = total_xmult
            }
        end
        return {
            message = "Stockpiling X" .. total_xmult .. "!",
            colour = G.C.RED,
            card = card
        }
    end```
rare phoenix
#

How does SMODS.destroy_cards work? I'm trying to destroy a joker but the documentation is kinda unclear

red flower
#

what's unclear

rare phoenix
#

all it says is


    Destroys any type of cards given to the function appropriately, with respect to further calculations if called during the scoring loop.
    cards - Can be an individual Card object, or a table of Card objects.

#

im not sure where i would put the key of the card

red flower
#

well, you wouldn't
it takes a card object or a table of card objects, not keys

rare phoenix
#

how do i specify a card object then?

red flower
#

it would be easier if you tell me what you want to do and where

rare phoenix
#

im trying to make a consumable that destroys one specific joker and replaces it with another

#

so far all i have is for i = 1, #G.jokers.highlighted do G.E_MANAGER:add_event(Event({ trigger = 'after', delay = 0.1, func = function() if G.jokers.highlighted[i] == card then SMODS.destroy_cards({cards = "j_rwn_rylen"}) SMODS.add_card({ set = "Joker", key = "rowan"}) end return true end })) end

#

im certain im missing something just dont know what

red flower
#

well, first G.jokers.highlighted[i] will probably never be equal to card because card is the consumable

rare phoenix
#

oh

red flower
#

you want to check if G.jokers.highlighted[i].config.center.key == "j_rwn_rylen" and then do SMODS.destroy_cards(G.jokers.highlighted[i])

rare phoenix
#

oh cool

#

thanks

pastel kernel
#

How do you level up high card specifically?

#

Hello?

proven belfry
pastel kernel
frigid cargo
daring fern
pastel kernel
#

Context for specific played card

rare phoenix
#

so this might be a dumb question but i cant find anywhere that lists all of the conditions for the event manager

pastel kernel
#

does this work?

        -- if played hand is a high card, level up hand to 60, then set not_played to false, so that played hand does not get leveled up again
        if context.before and context.scoring_name == "High Card" and card.ability.extra.not_played and not context.blueprint then
            card.ability.extra.not_played = false
            return {
                level_up = 60,
                level_up_hand = 'High Card',
                message = localize('k_level_up_ex')
            }
        end
#

CURRENT PRIORITY: Making sure Spinel gives xmult on a high card.

Chosen solution: I MADE SPINEL UPGRADE HIGH CARD BY 60 LEVELS.

daring fern
pastel kernel
#

I was gonna make it so that it will only level up high card once

#

But i decided that it’ll always do it, so instead I’ll just set the level up to 6 instead of 60.

vernal path
#

What function would I have to hook in order to keep a played card in hand?

median veldt
#

bunp

code is also up there

median veldt
#

ty

vernal path
#

here's my current hook for my joker that is supposed to make 1 card always draw, but it doesn't work. Am I missing something with draw_card()'s normal implementation?

local drawn_cards = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
    local has_headliner_fix = false
    local headliner_fix = nil
    for _, j in pairs(G.jokers.cards) do
        if j.key == "headliner_fix" then
            headliner_fix = j
            has_headliner_fix = true
        end
    end
    if has_headliner_fix and headliner_fix and headliner_fix.ability.extra.pinned_card then
        card = headliner_fix.ability.extra.pinned_card
    end
    return drawn_cards(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
end```
daring fern
vernal path
#

damn

#

is there any way to make this happen? Or do I have to do some crazy work around.

vernal path
#

A joker pins one card to the hand so it will always draw, even after play or discard

#

this is the joker's calculate function, although if you cant store a card in another card its kinda a moot point. lua calculate = function(self, card, context) if context.individual and context.cardarea == G.play and not context.blueprint then if (#context.full_hand == 1 and G.GAME.current_round.hands_played == 0) then card.ability.extra.pinned_card = context.other_card end end if context.end_of_round then card.ability.extra.pinned_card = nil end end

daring fern
vernal path
daring fern
vernal path
#

i see

frigid cargo
#
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local btct_DEvil_dt = 0
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    DEvilobj.pos.x = 0
    DEvilobj.pos.y = 0
    if G.P_CENTERS.b_btct_DEvil and btct_DEvil_dt > 0.1 then
        if math.fmod(btct.ticks,12) == 0 then
            local DEvilobj = G.P_CENTERS.b_btct_DEvil
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
        end
    end
end

im not very sure how to animate can someone help me?

vernal path
#

okay, this is the current hook function, and i think its probably almost there although it crashes trying to call a table value, of which i assume from is supposed to be a function or something

local drawn_cards = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
    local headliner_fix = SMODS.find_card("j_mode_headliner_fix")[1]
    if headliner_fix and headliner_fix.ability.extra.pinned_card then
        print(headliner_fix.ability.extra.pinned_card)
        for _, c in G.I.CARD do
            if c.sort_id == headliner_fix.ability.extra.pinned_card then
                from = c
            end
        end
    end


    return drawn_cards(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
end``` I really wish there was some way to tell actually what type its expecting :/ in any case, am I supposed to replace `card` instead? And what type is it looking for?
daring fern
#

Also from is a card area, not a card.

manic rune
#

what function creates the description box of jokers (the one that runs generate_card_ui)?

vernal path
#

It works! Except it is flipped, which is probably the default behavior except that I'd rather it not be flipped.

#

there's a param called "stay_flipped", but ive tried setting that to false. maybe i should try true tho

vernal path
vernal path
chrome widget
#

Last deck for our mod yay

vernal path
#

ooh

manic rune
#

ic, thanks

hazy mountain
#

anyone know why its having a syntax error when i place end here, i was looking at code for paya for help to create an enchancement and im unsure why its not launching or booting properly

vernal path
vernal path
#

oh actually

#

i dont think you need an end

hazy mountain
hazy mountain
frigid cargo
vernal path
# hazy mountain oh woah

end is only used for code blocks that use keywords, like if or for or while. if it doesnt start with those then you dont need end

hazy mountain
vernal path
# daring fern Code?
local drawn_cards = draw_card
function draw_card(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
    local headliner_fix = SMODS.find_card("j_mode_headliner_fix")[1]
    if headliner_fix and headliner_fix.ability.extra.pinned_card then
        print(headliner_fix.ability.extra.pinned_card)
        for _, c in ipairs(G.I.CARD) do
            if c.sort_id == headliner_fix.ability.extra.pinned_card then
                card = c
            end
        end
    end
    return drawn_cards(from, to, percent, dir, sort, card, delay, mute, stay_flipped, vol, discarded_only)
end```
hazy mountain
vernal path
hazy mountain
#

i made one

#

thats what is strange

vernal path
#

like you need to define it

hazy mountain
#

im not sure what that means sorry

daring fern
vernal path
rare phoenix
#

what location do i use for a played hand

daring fern
daring fern
vernal path
rare phoenix
daring fern
hazy mountain
#

yeah

#

wait

#

do i

frigid cargo
hazy mountain
#

i have this

daring fern
vernal path
daring fern
# hazy mountain

Yes, do you have enhancement wigglytuff.png file in both the 1x and 2x folders?

daring fern
vernal path
#

uhhhhhhh

daring fern
#

It will just use the default one if it is not provided.

hazy mountain
vernal path
#

no, thats for in the object

rare phoenix
daring fern
rare phoenix
#

i need some way to single out the cards in the played hand, not make something happens when its played

hazy mountain
# daring fern What does the file structure look like?

--- STEAMODDED HEADER
--- MOD_NAME: Baileytro Mod Pack
--- MOD_ID: BaeModPack1
--- MOD_AUTHOR: [Mafubark]
--- MOD_DESCRIPTION: Mod pack that contains injoke jokers, and other things, such as new editions for jokers.
--- MOD_VERSION: 1.0.0

SMODS.Atlas{
key = 'Unegi Khard',
unlocked = true,
discovered = true,
path = 'Unegi Khard.png',
px = 71,
py = 95}

SMODS.Atlas { key = "Wigglytuff Tarot", path = "Tuff Tarot.png", px = 71, py = 95 }
-- Enhancement atlas
SMODS.Atlas { key = "Wigglytuff Card", path = "enchancement wigglytuff.png", px = 71, py = 95 }

SMODS.Joker{
key = 'Unegi Khard',
loc_txt = {
name = 'Unegi Khard',
text = {
"{C:chips}+#1#{} Chips and {C:money}-$#2#{} if",
"the sum of all scored cards",
"is exactly 14"

}
},

config = { extra = { money = 10, chips = 14, handsum = 0, current_dollars = 0 } },

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

atlas ='Unegi Khard',
pos = {x = 0, y = 0},
rarity = 1 ,
cost = 3 ,

calculate = function(self, card, context)

if context.before then
    local temp_handsum = 0
    for i=1, #context.scoring_hand do
        temp_handsum = temp_handsum + context.scoring_hand[i].base.nominal
    end
    card.ability.extra.handsum = temp_handsum
    card.ability.extra.current_dollars = dollars
    sendInfoMessage("Handsum: " .. card.ability.extra.handsum, "MyInfoLogger")

    if card.ability.extra.handsum == 14 then
        return {
            message = 'Unegi Kha!',
            colour = G.C.CHIPS
        }
    end
end

if context.joker_main and card.ability.extra.handsum == 14 then
    return {
        chip_mod = card.ability.extra.chips,
        message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } }
    }
end

if context.after and card.ability.extra.handsum == 14 then
    return {
        dollars = -card.ability.extra.money
    }
end

end
}

SMODS.Enhancement {
name = "Wigglytuff Card",
key = 'Wigglytuff Card',
pos = { x = 1, y = 0 },
replace_base_card = true,
no_rank = true,
no_suit = true,
config = {x_mult= 0.5, bonus = 25}

}

daring fern
hazy mountain
#

oh

rare phoenix
hazy mountain
daring fern
vernal path
# daring fern Then you should probably hook `CardArea:shuffle()`

doesn't shuffle() just yk, randomize the location of each card? How would that unflip the card here? shouldn't I hook one of the functions actually used in the function, like sort() or emplace()? Although i can't seem to find definitions for those functions, so that might be a little challenging

daring fern
hazy mountain
#

no

vernal path
# hazy mountain

yeah you really shouldn't have spaces in file names if they are supposed to be loaded by a program

hazy mountain
#

why is that

vernal path
#

screws with things

hazy mountain
#

i see

daring fern
#

Wait no, the problem is you put enchancement instead of enhancement

hazy mountain
#

oh my goodness

daring fern
hazy mountain
#

my error was a typo thats funny

#

ill fix the spaces as well

#

thanks all (i dont know coding at all and this is very difficult, but i wanna make balatro mods), and i dont really have a lot of folks in my life who know code so much appericated

graceful mortar
#

im having some issues with cryptid can yall help me out if its not any trouble

#

long story short the mod isnt saving my runs

frigid cargo
daring fern
frigid cargo
#

Oh ok thanks

rare phoenix
#

so uhhhh can someone help me with this

#

im trying to make played kings turn into queens

    if context.other_card:get_id() == 13 then
        return{
            assert(SMODS.change_base(card, nil, 'Queen'))
        }
    end    
end```
daring fern
rare phoenix
#

what are k and v in this context

daring fern
rare phoenix
#

awesome sauce thanks

vernal path
# daring fern No, I mean for putting the card at the top of the deck.

wait how is this supposed to work? What am i even doing here lmao

local shuffle = CardArea.shuffle
function CardArea.shuffle(self, _seed)
local headliner_fix = SMODS.find_card("j_mode_headliner_fix")[1]
    if headliner_fix and headliner_fix.ability.extra.pinned_card then
        for i, c in ipairs(self) do
            if c.sort_id == headliner_fix.ability.extra.pinned_card then
                local original_card = self[1]
                self[1] = c
                self[i] = original_card
            end
        end
    end
    CardArea:shuffle(_seed)
end```
daring fern
#

You would just replace checking if the seal is blue for checking if the cards sort_id matches the one you stored.

vernal path
#

This does not work, and I don't know why: lua local oldshuffle = CardArea.shuffle function CardArea:shuffle(_seed) local headliner_fix = SMODS.find_card("j_mode_headliner_fix")[1] local g = oldshuffle(self, _seed) if self == G.deck and headliner_fix and headliner_fix.ability.extra.pinned_card then local priorities = {} local otherones = {} for k, v in pairs(self.cards) do if v.sort_id == headliner_fix.ability.extra.pinned_card then table.insert(priorities, v) else table.insert(otherones, v) end end for _, card in ipairs(priorities) do table.insert(otherones, card) end self.cards = otherones self:set_ranks() end return g end
It's not seeing the pinned card despite the fact that the joker is definitely saving it

#

like, headliner_fix.ability.extra.pinned_card is returning nil and I dont know why

frigid cargo
daring fern
#

Also is the key correct?

frigid cargo
# frigid cargo still dont work
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    DEvilobj.pos.x = 0
    if G.P_CENTERS.b_btct_DEvil and btct_DEvil_dt > 0.1 then
        if math.fmod(btct.ticks,12) == 0 then
            local DEvilobj = G.P_CENTERS.b_btct_DEvil
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
        end
    end
end

this still doesnt work? is there any other code i need to do?

vernal path
#
SMODS.Joker { -- Headliner Fix
    key = "headliner_fix",
    unlocked = true,
    discovered = false,
    atlas = "ModeJokers",
    rarity = 3,
    pools = {
        dank = true
    },
    config = { extra = { pinned_card = nil}},
    blueprint_compat = false,
    eternal_compat = true,
    perishable_compat = true,
    cost = 8,
    pos = { x = 0, y = 0 },
    loc_vars = function (self, info_queue, card)
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and not context.blueprint then
            if (#context.full_hand == 1 and G.GAME.current_round.hands_played == 0) then
                card.ability.extra.pinned_card = context.other_card.sort_id
                print(card.ability.extra.pinned_card)
            end
        end
        if context.end_of_round then
            card.ability.extra.pinned_card = nil
        end
    end
}```
vernal path
daring fern
vernal path
#

Oh, well yeah thats why I said its a joker that pins it and posted the joker code in the first place.

manic rune
frigid cargo
manic rune
#

...no?

#

thats increasing the x position of the card's sprite

daring fern
manic rune
#

or G.real_dt if you dont want the animation to be affected by game speed

frigid cargo
frigid cargo
frigid cargo
manic rune
#

btct doesnt exist

frigid cargo
#

what should i set it to? a number? a string?

manic rune
#

a table with ticks in it

#

btct = {ticks = (number)}

frigid cargo
#

ah ok thanks

#
local btct = {ticks = (12)}
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    DEvilobj.pos.x = 0
    btct_DEvil_dt = btct_DEvil_dt + dt
    if G.P_CENTERS.b_btct_DEvil and btct_DEvil_dt > 0.1 then
        if math.fmod(btct.ticks,12) == 0 then
            local DEvilobj = G.P_CENTERS.b_btct_DEvil
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
        end
    end
end

like this?

#

Cause it dont work

manic rune
frigid cargo
#

Idk got it from a mod?

manic rune
#

you dont need it

#
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    btct_DEvil_dt = btct_DEvil_dt + dt
    if DEvilobj and btct_DEvil_dt > 0.1 then
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
    end
end
#

this is all you need

#

-# im lazy to fix the indentation on discord, so you do it yourself

thorn basin
#

small question: why does the edition name give me error even if I put a label?

manic rune
#

i mean edition

thorn basin
#

doesn't the doc say that you don't put the "e_" prefix?

#

at least for the label I mean

thorn basin
manic rune
#

hm

#

im sorry but i havent made an edition before, so i have no clue on this one 😭

#

i would probably suggest checking other mods that have added an edition and do what they did

thorn basin
#

I tried like aikoyori did but still gives me error

#

i'm gonna search more

manic rune
#

good luck, sorry for not being able to help

thorn basin
#

it's fine

#

thx btw

frigid cargo
manic rune
#

changes whenever i change into it?

#

oh yeah, you want to reduce btct_DEvil_dt by 0.1 too

#
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    btct_DEvil_dt = btct_DEvil_dt + dt
    if DEvilobj and btct_DEvil_dt > 0.1 then
            btct_DEvil_dt = btct_DEvil_dt - 0.1
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
    end
end
manic rune
#

might be becuse decks' sprites arent updated automatically then

#

shrug

frigid cargo
thorn basin
manic rune
#

are you sure they dont have any other code besides that

frigid cargo
thorn basin
frigid cargo
manic rune
#

yeah theres literally, other related code down there

#

scroll down

frigid cargo
manic rune
frigid cargo
#

would i just copy paste that and change names?

manic rune
#

yes

frigid cargo
#
local btct = {ticks = (1)}
local upd = Game.update
local btct_DEvil_dt = 0
function Game:update(dt)
    upd(self, dt)
    local DEvilobj = G.P_CENTERS.b_btct_DEvil
    btct_DEvil_dt = btct_DEvil_dt + dt
    if DEvilobj and btct_DEvil_dt > 0.1 then
            btct_DEvil_dt = btct_DEvil_dt - 0.1
            if DEvilobj.pos.x > 30 then 
                DEvilobj.pos.x = 0 
            else
                DEvilobj.pos.x = DEvilobj.pos.x + 1
            end
    end
end
for k, v in pairs(G.I.CARD) do
    if v.children.back and v.children.back.atlas.name == "btct_DEvil" then
        v.children.back:set_sprite_pos(G.P_CENTERS.b_btct_DEvil.pos or G.P_CENTERS["b_red"].pos)
    end
end

still doesnt work?

manic rune
#

whats your atlas name

#

the atlas that deck is using

frigid cargo
#

DEvil

#

oh

#

also what would be a good tick speed?

manic rune
#

shrug

#

change it accordingly until u think it looks smooth

frigid cargo
#

ah i see thanks but it still doesnt work SkullCry

#

might have to postpone animations for now, it works its just not updating constantly

manic rune
#

can you take a ss of the atlas

frigid cargo
manic rune
#

it should be "btct_DEvilAtlas" then

frigid cargo
#

oh i keep the btct

#

cause i just changed the atlas to make it different from the actual deck

#

still nope

hushed field
red flower
manic rune
#

seems like it should work if you change it properly

frigid cargo
manic rune
#

i know, which part of the code did you change it though

frigid cargo
#

It now says v.children.back.atlas.name == "btct_DEvilAtlas" then

daring fern
frigid cargo
plain ember
#

Guys, where i can find info about the contexts things?

daring fern
distant junco
#

Is it possible to check for specific jokers? Like if I wanted to specifically check if Ride the Bus was in hand

south pagoda
#

SMODS.find_card([key]) should return a table of all jokers owned with the given key

#

and you can do next(SMODS.find_card([key])) to check if there are any.

faint yacht
#

next(SMODS.find_card('j_ride_the_bus')), in this case.

manic rune
#

shouldnt table.clone make it so whatever i do to new_effect wont affect ExtraEffects?

south pagoda
manic rune
#

well crap

#

yeah thanks

faint yacht
#

Recursively call the function if the given value is a table... but also ensure that it doesn't end up in an infinite loop either.

south pagoda
#

It looks like the Balatro source code already has a copy_table() function, have you tried that?

#

It's recursive, so like Ali said it should work in your case

manic rune
#

smt like this, i assume?

faint yacht
#

I had my own recursive "go through" recursive function, but it is no longer present as of 1.8.x as the Joker that used it has been changed.

hardy viper
#

balatro modders making a fifteenth copy table function

manic rune
faint yacht
#

-# tbh, mine wasn't a "copy" table, just find numbers and increase them.

primal robin
#

I'm using table_merge for my copying purposes

cursive gazelle
hardy viper
# primal robin

not to be overly critical but wouldn't this be one off since argument 1 (target) is not in tables_to_merge

#

okay tbh that is overly critical my bad

primal robin
#

Actually, makes sense

cursive gazelle
#

can i replace the game's background shader with a custom one ?

cursive gazelle
#
    key        = 'back',
    order      = 0,
    func       = function(self)
        if self.area and self.area.config.type == 'deck' then
            self.children.back:draw(G.C.WHITE)
            return
        end

        local use_delta = false
        if self.config
           and self.config.edition
           and self.config.edition.key == 'delta'
        then
            use_delta = true
        elseif rawget(self, '_absolute_deck') then
            use_delta = true
        end

        if use_delta then

            self.children.back:draw_shader('aao_p_delta')
            if not sxeif.delta_overlay_sprite then
                sxeif.delta_overlay_sprite = Sprite(
                    0, 0,
                    G.CARD_W, G.CARD_H,
                    G.ASSET_ATLAS['aao_p_soul'],
                    { x = 0, y = 0 }
                )
            end

            sxeif.delta_overlay_sprite.role.draw_major = self
            sxeif.delta_overlay_sprite:draw_shader(
                'dissolve',
                nil, nil, nil,
                self.children.back
            )
        else
            self.children.back:draw_shader('dissolve')
        end
    end,
    conditions = {
        vortex = false,
        facing = 'back',
    },
}```
#

@hushed field this is how i draw shader and sprite on back

#

_absolute_deck is my variable to attach the buttons

hushed field
#

I see! Let me parse it all in a sec, after I finish a call for work, haha

cursive gazelle
#

aao_p is my mod prefix

#

sorry for 0 commments it's not a finishedd product and i'm working alone so

worthy stirrup
#

How could I edit this so it shows a joker?

G.deck.cards[#G.deck.cards] and {n = G.UIT.O, config = {align = "cm", object = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS[G.deck.cards[#G.deck.cards].config.card_key], G.P_CENTERS['c_base'])}} or nil,
maiden phoenix
#

Replace the Card in object

#

For example try G.P_CENTERS['j_joker']

#

instead of c_base

worthy stirrup
#

Oh wait, I thought I would need to replace everything, thank you

red flower
#

you would make the p_cards part nil as well iirc

#

unless you want the joker to also be a playing card lol

worthy stirrup
#

No, I don’t think it should be one lol

#

Thanks again

#

I just realized it should be a consumeable, whats the prefix for a consumable, unless I use its key if its a custom one like what im doing

red flower
#

c_

worthy stirrup
#

thank you, this applies to custom ones too correct?

#

Thank you again

thorn basin
worthy stirrup
#

one last question for now, how would I make this two description boxes?

    loc_txt = {
        ["name"] = "Pliers",
        ["text"] = {
            [1] = "You {C:mult}tear{} out a tooth. The {C:mult}pain{} dulls your {C:mult}focus{}. {X:chips,C:white}X0.5{} chips for the rest of this {C:mult}Ante.{}",
            [2] = "Summons the following Pulled Tooth:"
        }
    },
hushed field
cursive gazelle
#

can i apply stickers on playing cards ? or do i need to patch it btw

hushed field
#

Yes, they work out of the box, stickers are really just sprites

#

but the way stickers work is that they just draw a sprite using the drawstep

cursive gazelle
#

great that helps

hushed field
#

Why are you using back and front as keys, though? Is there a reason as far as editions go that make it necessary to overwrite the whole step?

cursive gazelle
hushed field
#

yeah, but again, I'm not sure why you'd actually go about it that way. If you add a new game object, you're back at having to mess with drawsteps again, anyway

cursive gazelle
#

lol ,i just want to escape it

hushed field
#

From what I understand, you can just set this up using a new key and a slightly higher order, I don't really see why you'd need a new gameobject, or dummy sticker.

cursive gazelle
hushed field
#

I think you're just making it more complex by using the specific 'back' and 'front' keys

#

yes, but I'm also not sure you'd need to use that

hushed field
#

nope

#

just don't use 'back' and ' front'

#

just make entirely new drawsteps

cursive gazelle
#

okay sure

hushed field
#

Just so I'm sure I'm understanding, you're just needing to make it so there's a png on the back of a card if it has a specific edition applied, right?

#

that's all you wanna do?

cursive gazelle
#

on the back and front

#

when it's facing front the front png gets drawn and when on the back the back one gets drawn instead

hushed field
#

same process, two separate drawsteps. Shouldn't be more difficult than just doing either

cursive gazelle
#

i see

hushed field
#

All that needs is a new drawstep for each side with a priority between 0 and 10. It should be as easy as just applying the png as a child object

cursive gazelle
#

btw do i need to do patches to mess with some joker variables ? , like increasing or decreasing

hushed field
#

ope

#

oh yeah

#

Well, depends

#

The way I do it, no, but my system can't interact with vanilla cards. Cryptid's does do some patching, iirc, but just minor stuff. The main issue is figuring out how you wanna deal with the design elements and storing the values.

cursive gazelle
#

thanks for the help ice i'll let you know how it went

cursive gazelle
hushed field
#

Basically none of that code is necessary in your case, as it's all just to make the sprite have a shadow and hover

cursive gazelle
#

i see

hushed field
cursive gazelle
#

oh that's how they do it

hushed field
#

It's the most freely compatible way to set that up. Will still mess up some modded jokers, but it works unless there's exception. The issue you get with it is that is that the value manipulation messes with the core way scaling jokers and timed jokers work

#

Cryptid's fine with changing that, but it's something to consider. Part of why I changed how my system approaches it, though the cost of that is that it can't deal with jokers from other mods

cursive gazelle
#

i see

#

i think i have an idea , i'll have to look at the code and judge tho

#

i'll get to fixing the drawstep

#

thanks again ice , your help is very appreciated

hushed field
#

I'd see if Ruby has insights in the value manipulation stuff. I think it's a decent system that Cryptid uses, but I'd hate to see that be the default that all mods use 😛

#

I loathe how it messes with timed jokers, probabilities and stacked values, haha

cursive gazelle
#

i have so many tabs open its insane lmao

red flower
modern kindle
#

Good schmorning chat

red flower
#

hi willy

hushed field
#

yo dillster

modern kindle
#

Hi N and ice

#

How are you guys

red flower
#

im doing well ty
hbu

modern kindle
#

Im just waking up but it feeling alright

#

Got myself paid so im chillin

#

Gonna spend like 150 to buy my gf a controller and elden ring cause she wants to do that together

red flower
#

let's goo

worthy stirrup
modern kindle
#

She's been struggling in nightreign but I figure maybe doing the base game together will help teach her how to freaking roll

#

I also might buy Detroit become human and until dawn myself
Both have been on my list for awhile

rapid stag
#

is card.ability.h_size used for anything? cirThink

red flower
#

juggler and merry andy

warm dragon
#

I am making a challenge mod where you can't level up hands, so I am trying to ban anything that can do that. But I seem to be unable to figure out how to ban blue seals

#

and also I can't figure out how to ban specific skip tags

slim ferry
#

skip tags should be pretty easy, a lot of vanilla challenges do that

#

you just add a banned_tags table to restrictions

warm dragon
red flower
#

I would hook SMODS.poll_seal

slim ferry
#

all the challenges that force certain enhancements in your deck just ban EVERYTHING that creates or changes enhancements so you would have to do some shenanigans i imagine

red flower
#

there's also a PR I made to smods to manipulate pools but that's not merged yet

warm dragon
red flower
#

you would change how the function works so it doesn't return blue seals

rapid stag
#

how can i make a joker retrigger other jokers cirThink i can only return { repetitions = 1 } from context.repetitions if i want repetitions to work, right?

is context.cardarea == G.jokers valid for context.repetitions?
oh, it must be, otherwise red seal joker implementations wouldn't work~

worthy stirrup
#

Can someone help me get my label working, i know there was a way to do it without a localization file

SMODS.ConsumableType({
    key="Flesh",
    primary_colour = G.C.RED,
    label = 'Painful',
    secondary_colour = G.C.RED,
    loc_text =      {
        label = 'Painful',
        collection = 'The horrors', -- label for the button to access the collection
        undiscovered = { -- description for undiscovered cards in the collection
        name = 'Unknown',
        text = { 'Sacrifices need to be made.' },
        },
    },
    collection_rows = { 6, 6 }
})
warm dragon
#

ok, before I try to figure out hooking is there a way I can paste the liste of restrictions I wrote to get a sanity check to see if I forgot a way a hand can be leveled up?

slim ferry
red flower
#

yeah in lua functions are first class objects or whatever nerds call it

worthy stirrup
#

oh

#

i may be stupid

slim ferry
#

wont hooking mess with other mods trying to hook the same function?

worthy stirrup
#

It still shows up as error, or is the name supposed to be outside of the loc_txt

warm dragon
red flower
red flower
#

me when people don't trust my advise

rapid stag
red flower
#

yes

worthy stirrup
worthy stirrup
#

oh yes, 1s

warm dragon
#

What is the best way to paste my restrictions table for a sanity check?

worthy stirrup
#

code im assuming

slim ferry
worthy stirrup
#

wait, 1s, i think i made a mistake

red flower
worthy stirrup
#
SMODS.ConsumableType({
    key="Sacrifices",
    primary_colour = G.C.RED,
    secondary_colour = G.C.RED,
    name = 'Sacrifices',
    loc_text =      {
        name = 'Sacrifices',
        collection = 'Sacrifices', -- label for the button to access the collection
        undiscovered = { -- description for undiscovered cards in the collection
        name = 'Unknown',
        text = { 'Sacrifices need to be made.' },
        },
    },
    collection_rows = { 6, 6 }
})
red flower
#

loc_txt

worthy stirrup
#

oh my god

#

no wonder why it wasnt working 😭

#

thank you

warm dragon
red flower
#

I think this won't ban pluto from the shop

#

due to the way pools work

warm dragon
slim ferry
#

because

#

if nothing in a pool can spawn

#

itll spawn the default card instead when it tries to spawn

#

which for planets is pluto

red flower
#

Basically the gane doesn't check all cards individually but in pools, so when it tries to spawn a Planet it will do that

warm dragon
#

is there a better way to ban all planets?

red flower
#

G.GAME.planet_rate = 0
i think let me check

#

yeah

warm dragon
#

ok, so I get rid of all the planet cards in my banned list and then where do I add G.Game.planet_rate=0 ?

red flower
warm dragon
#

ok, so I need to figure out hot to do a hook for planet cards and for blue seals. idk why I thought this would be an easy mod to start out with

slim ferry
#

planet cards doesnt need a hook i think

#

just do the same as jokerless

#

but with planets

old hull
#

I'm having trouble with "SMODS.is_eternal". Whenever I try to use it the game crashes, saying "is_eternal" is a nil value. Is there a global fix, or do I have to fix each instance individually?

red flower
#

sadly challenges are pretty hardcoded

#

so (right now) you need to do stuff in hooks

#

that's why i did that PR yesterday

rapid stag
#

oh right this must have been changed with context.probability changes cirDerp
what am i doing wrong here cirLost how do i change this call

warm dragon
sturdy compass
#

I’d be able to get rid of so many patches with this

old hull
red flower
#

yes

warm dragon
#

ok, i'm going to fiddle for a bit but I am sure I will be back with more questions. Thanks everyone for your help

red flower
#

jokerless is hardcoded, you would need to patch here (not necessarily in the same place it can be later)

old hull
slim ferry
#

what arguments does SMODS.poll_enhancement actually take?

red flower
#

the ones in the docs :3

slim ferry
#

where is it in the docs...

red flower
slim ferry
#

ah