#💻・modding-dev

1 messages · Page 633 of 1

wicked leaf
#

ngl it sounds like you havent played at all

dapper sun
#

yea

wraith jolt
#

Nah two years ago was last time play vanilla, I only play mods now. Banner to block of all regular jokers

dapper sun
#

even playing modded you should know this

#

this is literally basic balatro knowledge

#

😭

hybrid iris
#

bit cruel but yeah this is just like. baseline how it works

#

multiple editions isnt a thing at all i dont believe

#

okay cruel was the wrong wording

dapper sun
#

and the "negative polychrome" here is just how negative looks 😭

hybrid iris
#

but like. yeah editions enhancements and seals you should know this just by playing modded

toxic cave
#

well neither of these work, maybe its the context? in these i did if context.setting_blind is thre a context timing better than that for changing the deck's order

dapper sun
#

i've not rly modified the deck order before so idk, my only experience messing the deck was a joker that let you see the top 3 cards

#

that was ages ago and i've since removed the joker

#

also i'm out rn shrug

covert estuary
#

DEAR GOD THIS DOCUMENTATION'S GOT HANDS lol

guess I'll take my time to see how I can make this work.

wraith jolt
dapper sun
#

???

wraith jolt
#

I was referring to the fact that I swore I play mod where had negative polychrome cards but then have no evidence

#

So like damn did dream this

#

Or maybe old enough my memory fading

#

With that out the way could be possible to program double editions like double seal mod

subtle hawk
#

Question question

#

Does anyone know how to darken everything behind the ui without using create_UIBox_generic_options

solid salmon
#

is there are way to make sure that certain jokers cant appear as long as an objectType exists

dapper sun
#

how would i go about adding a sprite to a uibox?

dapper sun
subtle hawk
dapper sun
#

fair shrug

#

looking at the code for create_UIBox_generic_options and i don't see an easy way to do it :p

subtle hawk
dapper sun
#

functions/UI_definitions.lua

dapper sun
#

how would i make the game just skip the shop entirely

cyan nymph
dapper sun
#

why would a boss blind skip the shop

cyan nymph
#

I have no idea

subtle hawk
#

Anti-capitalistic blind

gilded blaze
cyan nymph
dapper sun
#

ty

#

i'll look at the mod's source

cyan nymph
#

That's an evil as fuck boss blind

dapper sun
#

not rly

#

you can just go to the next blind's shop

gilded blaze
#

just patch G.FUNCS.cash_out

#

replace G.STATE = G.STATES.SHOP with G.STATE = G.STATES.BLIND_SELECT

dapper sun
#

ty

cyan nymph
toxic cave
dapper sun
#

?

#

he was talking to me

gilded blaze
#

lmao

toxic cave
#

ik but every time i hear the word something indescripable writhes in my brain telling me to use it in every line i possibly can from the stockholm syndrome curse harmony patching has placed on me

dapper sun
#

patching is usually avoided when necessary, in favor of hooks

#

-# it's necessary here though

toxic cave
#

must... harmony.... patch...

humble pawn
dapper sun
#

i've already done the one line patch

#
# Skip Shop on Café Frequent Challenge
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''G.STATE = G.STATES.SHOP'''
position = "after"
payload = '''if (G.GAME.modifiers.elle_no_shop) then G.STATE = G.STATES.BLIND_SELECT end'''
match_indent = true```
#

this hopefully isn't intrusive at all

gilded blaze
#

yea, that's less intrusive

#
# Jubjub bird effect
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''G.STATE = G.STATES.SHOP'''
position = "at"
payload = '''
if G.GAME.jjb_cash_out and (next(Sagatro.find_active_card("j_sgt_jubjub_bird")) or Sagatro.vorpal_jubjub()) then
  G.FUNCS.cash_out_into_boss_blind()
else
  G.STATE = G.STATES.SHOP
end
'''
match_indent = true

just look at this crap of mine

stiff locust
#

chat how do i make an effect with an irl timer

#

im specifically wanting a thing where if you dont complete every condition within x time it resets

dapper sun
#

update(self, card, dt)

#

dt is deltatime ofc

#

you could use this to increment a variable to track time

gilded blaze
#

well, the thing is

#

update is affected by game speed

dapper sun
#

ah true

#

you can then just divide the dt by the game speed then

gilded blaze
dapper sun
#

ah

harsh belfry
#

love.update hook ig

dapper sun
#

or do smtn with love.timer idk

#

that isn't affected by game speed

dapper sun
stiff locust
#

what i exclusively play on nopeus 256 with ff everything enabled

#

wont that fuck it up

dapper sun
stiff locust
harsh belfry
#

already got ruled out lmao

harsh belfry
#

because that way you aren’t calling anything to get the dt

gilded blaze
#

hooking either love.update or Game.update is fine

#

since love.update calls Game.update anyway

stiff locust
#

i dont know how any of these things work

sour garden
#

is there a context for when money is spent? looking to make a joker where it creates a tarot card after X amount of money is spent

stiff locust
#

context.money_altered iirc

#

there is one its something like that

#

and inside that context you check context.amount for the amount of money

sour garden
#

found it in smods, thank you!

gilded blaze
#

you can see there are more specific contexts bound to context.money_altered, allowing more precise control of which type you want to trigger your effect

dapper sun
#

anyone know how to make undiscovered cards created with SMODS.create_card() display normally

lilac trail
#

I'm new to modding, and frankly-I find the introduction wiki a little lacking. How do I create a joker card, for all intents and purposes?

dapper sun
#

it's

#

definitely not lacking at all

slim ferry
#

Consider vanillaremade

#

As regerence material

#

I do t have link bevause mobile but someone can send it

gilded blaze
dapper sun
#

ty

#

i've been informed that i don't have to

#

i can just add bypass_discovery_center = true

#

docs don't mention it tho for some reason

crisp coral
#

do the docs ever mention anything /s

hardy viper
#

docs aren't real

stiff locust
#

love.timer is super easy and its not affected by game speed

harsh belfry
#

you just get the dt through the function args

stiff locust
#

does that really matter

harsh belfry
#

a little ig

#

this is every update

stiff locust
#

i think im just gonna do love.timer

#

if problems arise i will switch to something else

#

but for what I need it for this should work

pale holly
#

Is there a way to make a joker sprite go sideways ?

humble pawn
pale holly
#

having it sideways in game like this for exemple

candid acorn
#

is there any easy way to add a function for when you open a pack or do i have to make a patch/hook

#

???

dapper sun
#

wdym

#

a specific existing pack or any pack

#

or your own modded pack

candid acorn
#

specific

#

like when tarots have the use function

dapper sun
#

yeaaahhh that'll be a hook

candid acorn
#

okay time to learn hooks

#

yepe

dapper sun
humble pawn
candid acorn
#

so i think i just hook the open_booster function and see if the booster being opened is the specific one and do some silly thingies when that happens we'll se

dapper sun
versed swan
# candid acorn okay time to learn hooks
local reference_function = other_function
function other_function(args, ...)
  -- code that runs before other_function
  reference_function(args, ...)
  -- code that runs after other_function
end

local reference_function_2 = Card.other_func
function Card:other_func(args, ...)
  -- code that runs before Card.other_func
  reference_function_2(self, args, ...) -- self IMPORTANT
  -- code that runs after Card.other_func
end
humble pawn
#

¯_(ツ)_/¯

candid acorn
dapper sun
#

okii

candid acorn
#

bc theres one function for redeeming opening using etc

#

:)

#

i hope i dont do something pointless that already exists but i thought it didint like yesterday

#

just have to figure out the stupid pack keys bc it always shows its invalid for some reason

covert estuary
#

I got it, thanks!

lilac trail
#

my apologies

dapper sun
#

it's okay

covert estuary
lilac trail
#

perfect, thx

slim ferry
#

moddedvanilla is quite outdated

#

and only has a small set of jokers

lilac trail
#

perhaps, but maybe it's best for learning. I am just dipping my toes in to modding, so I doubt i'll pivot atm

#

wait...

umbral lichen
#

anyone know how to add a custom booster pack that only pulls from a pool of modded jokers? trying to code in a pack for a mod and it isnt appearing in game

lilac trail
#

nvm, I'm dumb haha

candid acorn
#

alr made a simple patch if this works im gonna be suprised

#

ok i forgot the second = in an if that doesnt count

#

ok i forgot to end an if somehow ||i promise im not that stupid|| that doesnt count

lone girder
#

Does anyone know the command for the better debug menu mod that allows you to spawn in stuff?

dapper sun
#

?

#

do you mean debugplus?

#

you just hover over the card you want and press 3

lone girder
daring fern
lone girder
#

Oh

#

Also it seems to be bugging out the ui that has all the informations of the card whenever you hover over them

#

not sure if thats the mod's issue or a conflict with the my mod pack

#

nvm

toxic cave
wintry solar
toxic cave
dapper sun
#

where in the code

toxic cave
#

there i guess?

#

this discards then draws

#

but i would prefer if it somehow rearranged the deck so it doesnt have to discard

wintry solar
#

you need to do it earlier than first_hand_drawn then

toxic cave
wintry solar
#

it will immediately shuffle the deck after that

dense fulcrum
wintry solar
#

you could use context.drawing_cards and have an internal flag that you reset at the start of each blind so you only do it the first time

daring fern
dense fulcrum
wintry solar
#

yeah

toxic cave
#

even then it doesnt work

#

btw th Rigged message still pops up

wintry solar
#

this puts the card at the bottom of the deck

#

iirc

toxic cave
#

fuck gotta do it the other way around then

#

still doesnt work

wintry solar
#

if this just to move one card to the top of the deck or does it do multiple cards?

toxic cave
wintry solar
#

oh your rigged tracking looks wrong

#

let me rewrite it for you, hold on

#
for _, _c in ipairs(cards) do
  _c.rigged = true
end

for i = #G.deck.cards, 1, -1 do
  local _c = G.deck.cards[i]
  if _c.rigged then
    _c.rigged = false
    table.remove(G.deck.cards, i)
    table.insert(G.deck.cards, _c)
  end
end
return {
  message = 'Rigged!'
}
#

try that

toxic cave
wintry solar
#

oh that context is misplaced rip

#

this will work soon

toxic cave
frosty rampart
#

it's an issue on SMODS's side and will be fixed in a later update

toxic cave
#

so my current code should work when that happens alright then amma just save this and revert to my old discard then draw and when the fix drops amma release the deck rigging one

ripe thicket
#

Tryna make a joker that does this, but I haven't been able to figure out how to count the number spectral cards in the consumable area

daring fern
wintry solar
toxic cave
wintry solar
#

you can use it for testing, should be a new release by the end of the week 🤞

toxic cave
#

neat didnt know it would be that fast

#

dev branch but uh which one would that be

wintry solar
#

main

toxic cave
#

oh wait, it was JUST now

#

4 mins ago

#

sure wonder who is the genius behind that fix

toxic cave
kindred zephyr
#

how do i change the description of a card based on context?

daring fern
kindred zephyr
#

i don't understand, could you clarify?

#

actually let me clarify myself

#

i have this joker in my mod

SMODS.Joker {
    key = 'spinner',
    loc_txt = {
        name = 'Spinner',
        text = {
            "Retrigger all {V:1}#1#{} cards,",
            "suit changes every round"
        }
    },
    config = {repetitions = 1},
    loc_vars = function(self, info_queue, card)
        return {vars = {
            localize((G.GAME.current_round.spinner_card or {suit = 'Spades'}).suit, 'suits_singular'),
            card.ability.repetitions,
            colours = { G.C.SUITS[(G.GAME.current_round.spinner_card or {suit = 'Spades'}).suit] }
        }}
    end,
    blueprint_compat = true,
    perishable_compat = false,
    eternal_compat = true,
    rarity = 2,
    atlas = 'jokers1',
    pos = { x = 0, y = 1 },
    cost = 5,
    calculate = function(self, card, context)
        if context.cardarea == G.play and context.repetition and not context.repetition_only then
            if not context.other_card.debuff and context.other_card:is_suit((G.GAME.current_round.spinner_card or {suit = 'Spades'}).suit) then
                return {
                    message = 'Again!',
                    repetitions = card.ability.repetitions,
                    card = context.other_card
                }
            end
        end
    end
}
#

if card.ability.repetitions ~= 1, i want to change the card's description to

{
    "Retrigger all {V:1}#1#{} cards",
    "{C:attention}#2# additional times{},"
    "suit changes every round"
}
#

do you know how could i do that? @daring fern

normal crest
#

afaik you need to use localization files for that

loud summit
#

how do you change the name of a joker?

#

dynamically i mean

#

or like have two seperate localization files for a joker and swap between them manually

brittle matrix
#

In setting up VScode, is hover text supposed to be what is seen when mousing over a variable?

gilded blaze
#

did you mean this

brittle matrix
#

Yes

brittle matrix
# gilded blaze did you mean this

I have written a basic function with comments, and this style of text has not appeared. This text also has not appeared with built in Lua functions either. Would this have to do with formatting?

vague crest
#

running into an expected but nonetheless bizarre issue where this joker DOES work as intended, and wild cards count as glass cards, but when a wild card breaks it doesnt properly "shatter" for glass joker. how would i go about fixing that? sounds a bit involved

wheat jewel
#

I keep getting a crash when i try to change a card into a random face card

daring fern
daring fern
#

Also it would be SMODS.change_base(G.hand.highlighted[i], nil, _rank)

vague crest
#

functionality is pretty much identical to alloy from extra credit

#

it does properly debuff cards though which is nice

daring fern
vague crest
#

it does give true

#

however it doesnt make the shatter noise either, just removes itself like a normal card

#

oh it doesnt work with el dorado from plantain either

daring fern
vague crest
#

yup just took a look and it works with most others

#

including my wild card related jokers which is huge

gilded blaze
wheat jewel
#

idk why the booster pack asset isn't working

versed swan
#

can you also send an image of your atlas?

#

also shouldnt it be py = 95?

daring fern
wheat jewel
#

thing is

#

it was working before

#

now it isn't

#

waiittt

#

might be cuz i have x set to 1

#

not 0

#

lol

#

i was referencing vanilla remade's code and forgot that it would reference assets on a spritesheet atlus through changing x and y coords

versed swan
sturdy compass
wheat jewel
#

How do i make playign cards appear in a booster pack?

#

wait is it draw_hand = true?

#

LMAO

#

but how can i change the background color to red?

daring fern
wheat jewel
#

but what about setting it to a specific hex color number?

wheat jewel
wheat jewel
#

this caused an error

wheat jewel
#

got this error

daring fern
wheat jewel
loud summit
#

ok how do you run some code when a joker is added to a pool

vale zinc
#

How do I get the variable value of a Joker's sell value, when it's being sold?

vale zinc
loud summit
#
    inject_card = function(self, card)
        print("INJECTING RUNNINGGG\n\n\n\n\nn\n\n\n\n\n\n\n\n\n\n\n\n\n")
        SMODS.ObjectType.inject_card(self, card)
        print("post inject")```
daring fern
loud summit
#

ive also tried inject and inject_class

loud summit
#

add a badge to every joker in the pool

daring fern
loud summit
#

oh

vague crest
#

i have a card that randomizes the ranks of discarded cards, but it sometimes picks the same rank as the card, thus doing nothing. does anyone know what i should be adding to this?

#

cant quite wrap my head around the logic

daring fern
vague crest
#

seems to work perfectly, tysm!!

loud summit
#

how would you dynamically add a line to a jokers description

#

in like a seperate box

#

like what ortalab does

pastel kernel
#

Tryna use mod.calculate for this

#

Select UNIK joker, sell Awakening, destroys UNIK joker, spawn stronger UNIK joker I made.

#

How do you check for highlighted joker and then selling a specific consumable?

wind steppe
#

vanillaremade campfire

pastel kernel
wind steppe
#

context.card is the card being sold

daring fern
# pastel kernel Tryna use mod.calculate for this
if context.selling_card and context.card.config.center.key == 'j_modprefix_key' and G.jokers.highlighted[1] and G.jokers.highlighted[1].config.center.key == 'j_modprefix_key' then
    G.jokers.highlighted[1]:set_ability('j_modprefix_key')
end
pastel kernel
#

Oh so that’s how you write it

#

That’s a lot of dots

gilded blaze
loud summit
#

it just has multiple tables in its loc vars

#

but like what i want to do is dynamically add it to another card

wind steppe
#

why arent things registered with my sticker extension being added to G.shared_stickers?

pastel kernel
#

how do you check for if played hand contains a scoring 7?

loud summit
#

loop across context.scorring_cards

loud citrus
#

why did this happen? it should be an uncommon now :(

daring fern
loud citrus
daring fern
loud citrus
pastel kernel
loud summit
#

fun

daring fern
loud citrus
#

oh, new territory for me, i'm going to look at the documentation :)
thank you so much!

daring fern
loud citrus
#

where would i learn about this then lol, or a mod i can take reference from

covert estuary
#

Well fuck you too, it is closed on line 95 you piece of shit

daring fern
covert estuary
#
        if context.setting_blind  then
            local card_front = pseudorandom_element(G.P_CARDS, pseudoseed('add_card_hand'))
            local base_card = create_playing_card({
                front = card_front,
                center = pseudorandom_element({G.P_CENTERS.m_gold, G.P_CENTERS.m_steel, G.P_CENTERS.m_glass, G.P_CENTERS.m_wild, G.P_CENTERS.m_mult, G.P_CENTERS.m_lucky, G.P_CENTERS.m_stone}, pseudoseed('add_card_hand_enhancement'))
            }, G.discard, true, false, nil, true)
            
            
            
            G.E_MANAGER:add_event(Event({
                func = function()
                    base_card:start_materialize()
                    G.play:emplace(base_card)
                    return true
                end
            }))
            return {
                func = function()
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            G.deck.config.card_limit = G.deck.config.card_limit + 1
                            return true
                        end
                    }))
                    draw_card(G.play, G.deck, 90, 'up')
                    SMODS.calculate_context({ playing_card_added = true, cards = { base_card } })
                end,
                message = "Added Card!"
            }
            local card_front = pseudorandom_element(G.P_CARDS, pseudoseed('add_card_hand'))
            local base_card = create_playing_card({
                front = card_front,
                center = pseudorandom_element({G.P_CENTERS.m_gold, G.P_CENTERS.m_steel, G.P_CENTERS.m_glass, G.P_CENTERS.m_wild, G.P_CENTERS.m_mult, G.P_CENTERS.m_lucky, G.P_CENTERS.m_stone}, pseudoseed('add_card_hand_enhancement'))
            }, G.discard, true, false, nil, true)
            
            
            
            G.E_MANAGER:add_event(Event({
                func = function()
                    base_card:start_materialize()
                    G.play:emplace(base_card)
                    return true
                end
            }))
            return {
                func = function()
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            G.deck.config.card_limit = G.deck.config.card_limit + 1
                            return true
                        end
                    }))
                    draw_card(G.play, G.deck, 90, 'up')
                    SMODS.calculate_context({ playing_card_added = true, cards = { base_card } })
                end,
                message = "Added Card!"
            }
        end
        if context.other_joker  then
            if context.other_joker.config.center.key == "j_cultpack_taph" then
                return {
                    Xmult = 2,
                    message = "YURI!!!"
                }
            end
        end
    end
}```
#

ofc discord fucky wucky

daring fern
covert estuary
#

ah.

loud citrus
daring fern
loud citrus
#

oh cool! thank you so much for helping me out :)

loud summit
#
            local g = variref(self, info_queue, card)

            local lines = {}
            for _, t in pairs(localize{ type = "variable", key = "[spoilers]", vars = {1} }) do
                lines[#lines + 1] = {
                    n = G.UIT.T,
                    config = { text = t, colour = G.C.UI.TEXT_INACTIVE, scale = 0.2 }
                }
            end

            g.main_end = {
                n = G.UIT.C,
                config = {juice = true, align = "cm", padding = 0.02},
                nodes = lines
            }

            return g``` hovering over this crashes, it only started doing this when i returned this new column node instead of setting main_end to lines directly
#

this is in a loc_vars hook

#

its complaining about indexing local node (a number value)

vague crest
#

this is like a turbo stupid question i think but, is there a quick way to check if a number is prime? i had a joker idea involving retriggering all scored cards if your money is a prime number but the logistics of actually calculating that sounds kinda stupid

cyan dust
#

for small numbers you can just check if anything less than (or equal to) square root of number divides that number

#

for larger numbers there's no easy solution

#

you can keep a table of prime numbers but it consume large amount of memory

daring fern
vague crest
#

Oh interesting ok

daring fern
#

cyan dust
#

you didn't even skip even numbers

daring fern
stiff locust
#

chat how do I check when a consumable is used

daring fern
stiff locust
#

is thee a context in there that has the consumable info in it

#

i do need the type of consumable used too

daring fern
stiff locust
#

great thanks

safe saddle
#

E

#

I just can't understand lua 😭

kindred zephyr
# kindred zephyr if `card.ability.repetitions ~= 1`, i want to change the card's description to `...

i've been doing some research and now i have these

loc_txt = {
    name = 'Spinner',
    text = {
        single = {
            "Retrigger all {V:1}#1#{} cards,",
            "suit changes every round"
        },
        multi = {
            "Retrigger all {V:1}#1#{} cards",
            "{C:attention}#2# additional times{},",
            "suit changes every round"
        }
    }
},
loc_vars = function(self, info_queue, card)
    local suit = 'Spades'
    if G.GAME and G.GAME.current_round and G.GAME.current_round.spinner_card then
        suit = G.GAME.current_round.spinner_card.suit or suit
    end

    local reps = (card and card.ability and card.ability.repetitions) or 1

    return {
        key = (reps ~= 1) and 'multi' or 'single',
        vars = {
            localize(suit, 'suits_singular'),
            reps,
            colours = { G.C.SUITS[suit] or G.C.SUITS.Spades }
        }
    }
end,

however the name and description of the joker just don't appear at all. how do i fix that?

queen crescent
#

i dont wanna look at cryptid code so uh

how do you debuff a specific rarity and only that rarity

static abyss
#

Hi guys, I've just started creating my first mod and I'm adding some jokers. What's the easiest way to make them show up in game so I can test them? I had a look in the wiki and see G, assuming its related but still figuring out exactly what I need

hushed field
#

If you declare a joker, you only need to make sure the file is loaded. You won't need to touch G at all!

static abyss
#

Thanks!

stiff locust
#

is there a way to make jokers transparent

#

ik i could just animate the sprite

#

but if there was a function to increase transparency

#

it would save me some trouble

lilac trail
#

Can you use transparent sprites? I'm not sure, maybe that'll work?

quartz ravine
#

Hey folks, I fell off the face of the planet for a few months. Came back to see that something is different between steammodded 1016c and the last version I had, 0509c

Anyone off the dome have an idea of why my mod won’t appear / load anymore on the newer version?

quartz ravine
loud summit
#
            local g = variref(self, info_queue, card)

            local lines = {}
            for _, t in pairs(localize{ type = "variable", key = "[spoilers]", vars = {1} }) do
                lines[#lines + 1] = {
                    n = G.UIT.T,
                    config = { text = t, colour = G.C.UI.TEXT_INACTIVE, scale = 0.2 }
                }
            end

            g.main_end = {
                n = G.UIT.C,
                config = {juice = true, align = "cm", padding = 0.02},
                nodes = lines
            }

            return g``` hovering over this crashes, it only started doing this when i returned this new column node instead of setting main_end to lines directly
normal crest
loud summit
#

oh

#

oops

final jewel
#
        if card.config.center.discovered or card.bypass_discovery_center then
            card.children.center:draw_shader('voucher', nil, card.ARGS.send_to_shader)
        end
    end```
how do I load an extra sprite in that
near bay
#

how do i make a card change its rank to a random rank, suit to a random suit, enhancement to a random enhancement and edition to a random edition?

loud summit
#

hiii

#

ok how does the AUT argument in the localize function work

#

and also nodes

daring fern
# near bay how do i make a card change its rank to a random rank, suit to a random suit, en...
local rank = pseudorandom_element(SMODS.Ranks, 'seed')
local suit = pseudorandom_element(SMODS.Suits, 'seed')
local enhancement = SMODS.poll_enhancement({guaranteed = true})
local edition = SMODS.poll_edition({guaranteed = true})
--local seal = SMODS.poll_seal({guaranteed = true})
assert(SMODS.change_base(card, suit.key, rank.key))
card:set_ability(enhancement)
card:set_edition(edition)
--card:set_seal(seal)
daring fern
final jewel
#

yeah

#

like I already set the atls ans pos, I add the shaders and now I want to add a oter sprite on top

hushed stump
#

guys, isn't there an easy way to test mods, instead of relying to get the cards on a run? i saw a video of someone double clicking a mod element (a joker to be specific) and then it was added to his run

daring fern
near bay
loud summit
#

hhow do you align text nodes vertically in a column node

near bay
daring fern
ashen parrot
#

is there a context action that triggers when the shop is rerolled?

near bay
ashen parrot
#

ty :)

near bay
#

np

final jewel
hushed stump
daring fern
final jewel
#

oooooooooooooooh, thx man

normal crest
loud summit
#

oh

glass scaffold
#

What's the key for The Hanged Man Tarot?

daring fern
glass scaffold
wicked heron
#

does anyone know how to get a playing card to retrigger without returning? Most methods I see have calculate = function () return {repetitions = 2}

#

I want to play a sound for each retrigger

daring fern
wicked heron
#

I'm looking to randomise the pitch each retrigger - is there a way to do that via the return?

vale zinc
#

This Blind still gives the "Boss Disabled!" message on every scoring Diamond card, but it's only supposed to do that for the first such card. What do I do?

calculate = function(self, blind, context)
    if not G.GAME.blind.disabled then
        if context.individual and (context.cardarea == G.play) and context.other_card:is_suit(self.config.extra.suit) then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                blockable = true,
                blocking = false,
                func = function()
                    blind:disable()
                    return true
                end
            }))
            card_eval_status_text(context.other_card, 'extra', nil, nil, nil, {
                message = localize('ph_boss_disabled'),
                colour = G.GAME.blind.config.blind.boss_colour
            })
        end
    end
end,
ripe thicket
#

Is it possible to add an extra layer to jokers either above/below soul_pos but not directly on the base layer of the joker?

daring fern
frosty rampart
glass scaffold
#

What is causing this to crash? The SMODS.add_cards are fine because they're formatted like that earlier on.

#

And the IDs are correct as I grabbed them from another mod.

wind steppe
#

you sure yahimod's prefix is "yahimod"?

glass scaffold
#

I mean... yeah?

wind steppe
#

could be wrong but id expect it to be shorter

#

oh wow it is just like that huh

glass scaffold
#

It was the wrong one.

wind steppe
#

check the other ones too while youre at it

glass scaffold
#

The others I double checked

#

At least I hope

wind steppe
#

Talismoment

#

thats yahimods fault

glass scaffold
#

To do a math.random() for a chance?

wind steppe
#

no

glass scaffold
#

This is what the deck's using for a chance

wind steppe
#

yahimod is incompatible with talisman

glass scaffold
wind steppe
#

You're fine

#

Talisman doesn't change what you need to do

#

this is yahimod and only yahimod's fault

glass scaffold
#

So I can't even generate a random number between 0 and 1 cause of Yahi's mod?

wind steppe
#

No?

#

the number is fine

#

a yahimod joker is incompatible with talisman

#

(twitch sub)

glass scaffold
wind steppe
#

you can patch it if you want i guess

#

i dont remember how to patch other mods though

glass scaffold
#

I'll just exclude it.

faint yacht
vocal helm
#

is there a way to convert a card's rank as an id into a key for the sake of localization? as in, what's the process of turning 11 as an integer into Jack as a key string

vale zinc
# vale zinc This Blind still gives the "Boss Disabled!" message on every scoring Diamond car...

Now it doesn't give the pilfered Hand back when a Diamond card scores. What do I do?

calculate = function(self, blind, context)
    if not G.GAME.blind.disabled then
        if context.individual and (context.cardarea == G.play) and context.other_card:is_suit(self.config.extra.suit) then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                blockable = true,
                blocking = false,
                func = function()
                    blind:disable()
                    return true
                end
            }))
            card_eval_status_text(context.other_card, 'extra', nil, nil, nil, {
                message = localize('ph_boss_disabled'),
                colour = G.GAME.blind.config.blind.boss_colour
            })
            blind.disabled = true
        end
    end
end,
disable = function(self)
    if not G.GAME.blind.disabled then
        ease_hands_played(self.config.extra.mod_hands)
    end
end,
toxic cave
#

im noticing a tiny issue with my mod

#

that thing in the top left is supposed to be the eternal sticker

#

why is it so small?

daring fern
vocal helm
#

thanks!

daring fern
vale zinc
vague crest
#

how would i check if a card is being enhanced? for example via midas mask or a tarot card

daring fern
vale zinc
# daring fern Code?
calculate = function(self, blind, context)
    if not G.GAME.blind.disabled then
        if context.individual and (context.cardarea == G.play) and context.other_card:is_suit(self.config.extra.suit) then
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                blockable = true,
                blocking = false,
                func = function()
                    blind:disable()
                    --card:juice_up()
                    return true
                end
            }))
            card_eval_status_text(context.other_card, 'extra', nil, nil, nil, {
                message = localize('ph_boss_disabled'),
                colour = G.GAME.blind.config.blind.boss_colour
            })
            blind.disabled = true
        end
    end
end,
disable = function(self)
    ease_hands_played(self.config.extra.mod_hands)
end,
daring fern
toxic cave
#

its 345x465

slim ferry
#

seems to be the case

#

though i dont think that should happen if thats set as the actual atlas dimensions

#

its probably that the sprite is much larger but is displayed at about one fifth of its actual size, which causes the eternal sticker to also get scaled down

loud summit
#

hey how do you spawn a joker from a specific pool

slim ferry
#

set = "<pool key>"

loud summit
#

with or without mod key

vale zinc
#

To go further, here's an excerpt from Wraith:

SMODS.add_card({ set = 'Joker', rarity = 'Rare' })
loud summit
#

no like a custom pool type

daring fern
vague crest
vague crest
#

oh LOL ok

thick wren
#

hi i wanna make this joker self-destruct before scoring if the current blind is the water, but this only makes it self-destruct after scoring, any timing help

faint yacht
#

return { func = function() SMODS.destroy_cards(card, nil, nil, true) end }?

thick wren
#

well it doesn't score anymore but it still happens after the scoring animation which is strange

vocal helm
#

Is there built-in functionality to have it so that rerolls also reroll vouchers and booster packs, or will I have to code that in myself?

daring fern
vague crest
#

that stuff i think cryptid? does where things in the shop are face down, is that difficult to do?

daring fern
vocal helm
#

Okay, just checking!
In that case, I'm aware it's possible to change the number of booster packs/vouchers that can show up initially in shop with SMODS.change_booster_limit and SMODS.change_voucher_limit, but is there a number I can access for these?

#

just getting the booster limit or voucher limit

daring fern
vocal helm
#

thanks!

ripe thicket
#

how would I exponentiation into my mod? I just want a simple ^2 or ^3 but I don't know how I'd do it

daring fern
vague crest
#

trying to set up a deck and it keeps crashing the second i try to go to the decks menu, it's giving me this error but that doesnt make much sense to me since it does have an extra field?

#

does anyone know any other decks that use probabilities within them? for cross referencing purposes

frosty rampart
#

you have this: { extra = {...} } when it should just be extra = {...}

#

in the config line, remove the blue brackets

vague crest
#

oh youre wise af good eye

#

ok next question 🔥 i didnt expect this to crash but i guess maybe theres some sort of extra steps needed to make something work from within a deck? it crashes at the context line because it cant index context

normal crest
#

you want calculate

vague crest
#

ohhhh omg right

thick wren
river grail
#

Is there a better way to get a single table item, where there's only 1 item in it, and it's formatted as:
{ Hearts = true } ?

Currently I'm just making a new table and inserting its name as the value instead. It's purposefully set up as the name, so that locating suits during processing is a lot cheaper.
Here's the code so far, where suitTable is an aforementioned 1 item table:

    if suitAmount == 1 then
        local single = {}
        for key, _ in pairs(suitTable) do
            table.insert(single, key)
        end
        return single[1]
    end```
daring fern
river grail
#

oh sick! thanks!

gaunt folio
#

this is probably very wrong but im trying to make a card that upon buying makes itself eternal, its a contract of sorts. How can this be fixed? It does nothing currently and is likely very wrong

frosty rampart
#

add_to_deck should be outside calculate

#

it's a separate function that the joker owns

gaunt folio
#

ah

wild escarp
#

Anyone know why this sticker just applies to all jokers? I have this should apply function, and I have rate set to 0.03, so I'd like it to apply to only 3% of all jokers.

should_apply = function(self, card)
    if next(SMODS.find_card("j_willatro_monitoring")) and card.ability.set == "Joker" and not card.eternal then
        return true
    end
end
frosty rampart
#

the rate is ignored if you have a custom should_apply function

#

you'll need to incorporate it into the should_apply (add and pseudorandom("seed") < 0.03 to the conditions in the if statement)

gaunt folio
#

okay it adds eternal but can still be sold. is there not smods support for it yet?

dapper sun
#

stickers only do stuff on jokers i think

#

if you want a consumable type that can't be sold then you may as well add custom handling for that

gaunt folio
#

fair enough

#

figured out a workaround to just remove selling

daring fern
gaunt folio
#

eh this does its intended purpose

#

ok nvm

#

caused some unintended consequences, but ill see if your method works too

wild escarp
#

How would I reset the hands and discards to what they were at the start of the blind? Would I have to store the hands and discards values at the start for retrieval later, or is that already stored somewhere?

daring fern
gaunt folio
#

figured out hooking, but how do i make it hook for a specific consumable type? this does not work

gaunt folio
#

aight

#

aight thanks

wild escarp
#

Now, how could I prevent death without finishing the round?

dapper sun
#

how do i tell if a joker can be retriggered? would it be blueprint_compatible?

dapper sun
#

a

#

okii

#

if i wanna do logic before a context.retrigger_joker_check, where would i put it?

#

wait hold on i got it lol

#

i'm dumb

#

i forgor variables exist lmao

#

how do i put a # in a card's name?

#

\# gives a crash

#

invalid escape sequence

#

hold on i found a modded joker that does it

#

..

#

they had to use a loctxt entry lmao

#
calculate = function(self, card, context)
    if context.before then
        card.ability.extra.target = pseudorandom_element(G.jokers.cards, "elle_41", {in_pool = function(v, args) return v ~= card end})
    end
    if context.retrigger_joker_check and card.ability.extra.target and context.other_card ~= card.ability.extra.target then
        return {
            message = "Again!",
            repetitions = 1,
            card = card
        }
    end
end```anyone know why this isn't retriggering?
#

wait

#

did i add the optional feature

#

ye i did

#

oh i'm fuckin dumb

#

this is what i get for recycling old code

#

~=

#

changing the ~= to == didn't fix it

#

wait

#

i was testing it with a joker that just didn't trigger i think

#

ok it did work

#

i'm dumb

frosty rampart
#

hrm
i was gonna say you shouldn't be storing a card in another card but it's all happening within a single hand so the issues probably won't pop up
(it can cause save/load problems)

dapper sun
#

also i've just added card.ability.extra.target = nil before the return

frosty rampart
#

was about to suggest it lmao

wild escarp
#

Is there even a way to do the prevent death mechanic without ending the round? I'd like to reset hands and discards if chips scored are at least 50% of required chips at the end of the round.

frosty rampart
#

non-zero chance you can just call ease_hands_played(number) and ease_discards(number) and it'll work out fine? you'll definitely have to do more work if you also want to reshuffle the discard pile and the player's hand back into the deck

faint yacht
glass scaffold
#

Would context.other_card:set_ability(G.P_CENTERS.m_PREFIX_ENHANCEMENTKEY, nil, true) work to apply a custom enhancement?

faint yacht
#

...as long as context.other_card is valid, yeah.

timid zinc
#

I'm making something that works with the Partner API but the unlock screen has the loc vars listed as nil

safe saddle
#

Where do I find mod samples

glass scaffold
safe saddle
#

I don't really know where to start other than using joker forge

glass scaffold
#

Here are some good spots to get something going

frosty rampart
#

^ vanillaremade is fantastic
it reimplements basically all vanilla content in SMODS for reference purposes, and the wiki has a bunch of good resources too

glass scaffold
#

And there's always digging through other mods' code to figure out how they do things

safe saddle
daring fern
#

final jewel
#

how do I prevent this so it create a mars and the mars it the 8% on first card and at the end mars reapear cause it wasnt in the pack

daring fern
plucky berry
#
        if card.area and card.area == G.consumeables then
            local other_consumeable = nil
            for i = 1, #G.consumeables.cards do
                if G.consumeables.cards[i] == card then other_consumeable = G.consumeables.cards[i + 1] end
            end
        end
        local compatible = other_consumeable and other_consumeable ~= card and other_consumeable.config.center.blueprint_compat
        return { vars = { card.ability.extra.slots, main_end = {
                {
                    n = G.UIT.C,
                    config = { align = "bm", minh = 0.4 },
                    nodes = {
                        {
                            n = G.UIT.C,
                            config = { ref_table = card, align = "m", colour = compatible and G.C.GREEN or G.C.RED, r = 0.05, padding = 0.06 },
                            nodes = {
                                { n = G.UIT.T, config = { text = ' ' .. localize('k_' .. (compatible and 'compatible' or 'incompatible')) .. ' ', colour = G.C.UI.TEXT_LIGHT, scale = 0.32 * 0.8 } },
                            }
                        }
                    }
                }
            } } }
    end,```

can you guys help me figure out why the compatible/incompatible ui bubble isn't showing up in my consumable?
golden field
#

question: how do i make a joker upgrade a hand by several levels

daring fern
golden field
#

so something like this

    calculate = function(self, card, context)
    if context.before then
        SMODS.smart_level_up_hand(card, 'modprefix_key', nil, 3)
    end  
#

(?)

daring fern
golden field
#

ah

golden field
#

so

    calculate = function(self, card, context)
    if context.before then
        return {
            level_up = 3,
            message = localize('k_level_up_ex')
        }
    end    
golden field
golden field
daring fern
golden field
#

update: fixed

golden field
modest sedge
#

Is there a way I can move the text (with the diamond in the background, e.g. "Nope!") to any location I want?

#

I'm making a Joker that gives Mult for each time the Joker on the left triggers
I want it to say "+2 Mult" under the triggered Joker, and not the Joker I'm making

rugged crown
#

If i wanted a consumable to be able to adjust any joker associated with money in some way how could I?

dapper sun
#

how so?

mystic river
modest sedge
candid acorn
#

how can i remove a voucher from the shop?

#

I mean the shop area

#

When i remove it from the round vouchers it wont appear in the next shop but it remains in the current one

#

so i need to also remove it from the current voucher area but idk how

final jewel
wild escarp
#

How could I set the sell value of all owned jokers to 0?

dapper sun
#
local sc_ref = Card.set_cost
function Card:set_cost()
    local sc = sc_ref(self)
    
    if (condition) then
        self.sell_cost = 0
        self.sell_cost_label = self.facing == 'back' and '?' or self.sell_cost
    end
    
    return sc
end```
wild escarp
#

Is there a way I could do this from within a joker?

normal crest
#

Yeah, do something to set the condition to true and call every joker's set_cost function

wild escarp
#

Hmm, I've got something like this for my calculate:

calculate = function(self, card, context)
    if context.after and G.GAME.chips / G.GAME.blind.chips >= to_big(0.5) and G.GAME.current_round.hands_left <= 0 then
        G.GAME.willatro_saved = true
        for i = 1, #G.jokers.cards do
            G.jokers.cards[i]:set_cost()
        end
    end
end

and this for my hooked set_cost:

local oldsetcost = Card.set_cost
function Card:set_cost()
    if G.GAME.willatro_saved == true then
        self.cost = 0
        self.sell_cost_label = self.facing == 'back' and '?' or self.sell_cost
    else
        return oldsetcost(self)
    end
end

But it doesn't work, anyone know why? I know for sure the calculate condition is being met, so G.GAME.willatro_saved should be getting set to true. Other than that, idk.

paper lava
#

any way to make a boss blind's description change depending on whether its being viewed from collection or in a run?
much like the ox's
Playing a (most played hand) sets money to 0. (in collection)
Playing a High Card sets money to 0. (in run)

#

i tried looking at vanilla remade, but im not entirely sure how it writes the rest of the description

normal crest
#

Also you might want to make the condition be a value that each joker has in its ability table, cus right now after your ioker triggers, all cards will have a sell cost of 0 when their cost updates

wild escarp
#

What do you mean?

normal crest
# wild escarp What do you mean?

For example, inside the loop do
G.jokers.cards[i].ability.modprefix_some_name = true
And in the set cost hook do
if self.ability.modprefix_some_name

normal crest
hushed stump
#

it's so complete yet so incomplete

#

or idk how to navigate through it

#

for example

#

I know that SMODS.is_eternal is to check if a joker is eternal

#

however

#

I don't find a function that is called SMODS.is_negative or smth similar

hushed stump
#

also why can't i just do smth like
G.jokers.cards[index]:is_eternal()
instead of SMODS.is_eternal

#

isn't this object oriented programming?

daring fern
hushed stump
#

why are they separated

slim ferry
#

usually it is best practice to put functions for a mod inside of a seperate table, which is probably why they did that

#

you could argue that SMODS is a different case but you can talk to the steamodded devs for that

long sun
#

is there a context for a Joker being destroyed? (not sold)

daring fern
long sun
#

this is for the Joker being destroyed only, right?

daring fern
long sun
#

ah

#

how do i check if it's my own Joker being destroyed?

daring fern
long sun
#

👍

#

thanks!

dapper sun
#

how do i get if i'm in a challenge run

white hull
#

how would i get the rank and suit of a stone card y’all?

white hull
dapper sun
#

ty

daring fern
white hull
#

thankers

subtle hawk
#

Is there a way to align the label of UIBox_button

#

Like it's aligned to cm be default I think

hot drift
#

my probability description works normally in the collection but not ingame, why is this?

hot drift
#

on it

daring fern
# hot drift

You should be using SMODS.get_probability_vars not G.GAME.probabilities.normal

hot drift
#

I tried that beforehand with the same result

daring fern
hot drift
#

combined both returns into a single line and now I'm having the opposite problem (works ingame but not in collection)

strong plume
#

Hi, is there a way to discard cards in deck? The function G.FUNCS.discard_cards_from_highlighted is only for cards in hand, and I want a boss blinds that discards half the cards in your deck when you enter the blind

hot drift
daring fern
# hot drift

You're not returning anything if the card is not in G.jokers.

hot drift
#

thank you for your help

sour garden
#

can you call G.GAME.joker_usage to get the amount of obtained jokers like how you can call G.GAME.consumeable_usage?

daring fern
split mantle
#

how exactly does the atlas function work for SMODS? ik it sets a key and a path but i have no idea what the px and the py are (i'm assuming they're coordinates but the numbers seem really arbitary, is it like the size each sprite is?)

sour garden
feral tree
#

how can i change the rate of booster packs during a game?

sour garden
#

trying to count jokers, but not sure what i'm doing wrong here

vale zinc
#

@daring fern, I'm patching draw_card(G.play,G.discard, it*100/play_count,'down', false, v) from functions/state_events.lua, and I want to tell if a card in the played hand was or wasn't part of the scoring hand. Could you help me?

The Hill
Extra large blind, scored cards return to deck
daring fern
vale zinc
# daring fern No, hook `G.FUNCS.draw_from_play_to_discard`

That's where I'm taking it from. And I'm sorry, but I meant "patch" but typed "hook".

G.FUNCS.draw_from_play_to_discard = function(e)
    local play_count = #G.play.cards
    local it = 1
    for k, v in ipairs(G.play.cards) do
        if (not v.shattered) and (not v.destroyed) then 
            draw_card(G.play,G.discard, it*100/play_count,'down', false, v)
            it = it + 1
        end
    end
end
#

@daring fern?

feral cradle
#

hey its my first time making a mod in balatro and everything works as intented except for the X multi message that instead says ERROR

mystic river
#

code?

feral cradle
#

in a min

river grail
#

something annoying about lua:
despite the key names being exactly the same, the order still counts, meaning that these two are completely different tables

daring fern
river grail
#

i guess i'll have to start sorting these types of tables in order to properly compare them

feral cradle
#

uhh

#

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

SMODS.Joker {
key = 'housejoker',
loc_txt = {
name = 'Dr. Full House',
text = {
'This Joker gains {X:mult,C:white}X#2#{} Mult for each',
'scoring {C:attention}Full House{} played',
'{C:inactive}(Currently {X:mult,C:white}X#1#{C:inactive} Mult)'
}
},
config = { extra = { Xmult = 1, Xmult_gain = 0.25 } },
rarity = 3,
atlas = 'Jokers',
pos = {x = 0, y = 0},
unlocked = true,
cost = 8,
loc_vars = function(self,info_queue, card)
return { vars = {card.ability.extra.Xmult, card.ability.extra.Xmult_gain} }
end,
calculate = function(self,card,context)
if context.joker_main then
return {
Xmult_mod = card.ability.extra.Xmult,
message = localize { type = 'variable', key = 'a_Xmult', vars = { card.ability.extra.Xmult } }
}
end
-- Displays the Upgraded! message when Full House is played.
if context.before and next(context.poker_hands['Full House']) and not context.blueprint then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
return {
message = 'Upgraded!',
colour = G.C.MULT,
card = card
}
end
if context.joker_main then
return {
card = self,
Xmult_mod = card.ability.extra.Xmult,
message = 'X' .. card.ability.extra.Xmult,
colour = G.C.RED
}
end
end
}

#

idk how to send code as in code and not this

#

i will delete this message if needed

vale zinc
#

Instead of message = 'Upgraded!', try message = localize('k_upgrade_ex').

#

And you can enclose lua code in backticks thus. Try it for any code you share in messages.

feral cradle
#

still displays the error

#

the upgrade part works but the x mult says error idk if there should be anything else in the code for that to work as intended

vale zinc
#

Instead of Xmult_mod, you need only return xmult. Apart from colour, delete the other return statements. The messages handle themselves.

vale zinc
#

Also, it pleases me to see another modder squeezing in a pop-culture reference for a modded Balatro item.

feral cradle
#

doesnt work

#

still same message

vale zinc
#

What's your return statement look like now?

feral cradle
#
 -- Displays the Upgraded! message when Full House is played.
        if context.before and next(context.poker_hands['Full House']) and not context.blueprint then
            card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
            return {
                message = localize('k_upgrade_ex'),
                colour = G.C.MULT,
                card = card
            }
        end
        if context.joker_main then
            return {
                Xmult_mod = card.ability.extra.Xmult,
                message = 'X' .. card.ability.extra.Xmult,
                colour = G.C.RED
            }
        end
feral cradle
daring fern
feral cradle
#

im still getting the same error message

feral cradle
#

ok no need found a fix

paper gulch
#

how do i do a crossmod joker?

loud citrus
#

Challenger deep mod was the example here

daring fern
#

Or you could just do dependencies = 'modid' in the joker.

#

Or dependencies = {'modid1', 'modid2'} if it requires multiple mods.

daring fern
paper gulch
daring fern
paper gulch
daring fern
paper gulch
#

@daring fern

normal crest
#

above it

loud summit
#

how do you check if a card is always scoring

daring fern
wild escarp
#

Anyone know why add_tag(Tag("tag_orbital")) doesn't choose a poker hand to upgrade, and how I can fix it?

granite jay
#

Anyone know how to add more quotes for Jimbo to say on game over?

#

And have him say certain things if you die under certain conditions?

faint yacht
loud summit
#

when is context.destroy_card called

daring fern
loud summit
#

oh

wraith jolt
#

Ok, I need ask a question but going to be careful this time cause I don't know if my memory playing trick on me. But vaguely remember a mod, where you could give editions like steel, stone, bonus and lucky to your Joker or did I dreamed this

wraith jolt
loud summit
#

hi im having some difficulty crossmodding with finity

#

im assigning my blind to the global table but checking in debug plus its not there

#

it cant be a file not being loaded issue bc the joker thats defined in the same file is loading

loud summit
#
  1 FinisherBossBlindStringMap = FinisherBossBlindStringMap or {}
  2 FinisherBossBlindStringMap["bl_nflame_jpenguin"] = {"j_nflame_jpenguin", "Jade Penguin"}```
loud summit
#

99

#

any ideas?

loud summit
#

help

modest sedge
#

context.other_card.lucky_trigger = true doesn't trigger Lucky Cat for some reason. What do I change it to?

modest sedge
#

sorry, I hit the 2000 character limit
Here's the relevant parts of the code:
(I'm still very new to Lua so I learned via seeing how other modders do it)

daring fern
modest sedge
#

yeah

#

well, it's supposed to be the Joker to the left

round lion
#

this gives me a plan

daring fern
# modest sedge well, it's supposed to be the Joker to the left
if context.post_trigger then
    local passed
    for k, v in pairs(G.jokers.cards) do
        if v == card then
            passed = G.jokers.cards[k-1] == context.other_card
        end
    end
    if passed then
        return {func = function()
            local old_ability, old_center, old_center_key = copy_table(context.other_card.ability), context.other_card.config.center, context.other_card.config.center_key
            context.other_card:set_ability(G.P_CENTERS['m_lucky'], nil, 'quantum')
            SMODS.score_card(context.other_card, {cardarea = G.play})
            context.other_card.ability, context.other_card.config.center, context.other_card.config.center_key = old_ability, old_center, old_center_key
        end}
    end
end
```?
modest sedge
#

I'll try that and see what happens

#

yeah now it doesn't do anything
I'll try to find something that helps it work

modest sedge
#

YEAH IT WORKS
Thank you so much!!!

#

I can't believe that much code can replace what I had
I really need to learn more lua

hushed stump
#

Guys, I just need to say it

#

C++ is easier than Lua

#

That's it, I said it

storm kraken
#

staring at the smods documentation for an hour and still having no idea how to add ui to the game

dapper sun
#

what kinda ui do you want

storm kraken
#

like the area where consumeables are stored, but for a new consumeable type

dapper sun
#

ah, a cardarea

#

idk how to add to the vanilla ui, but

#

if you look at the vanilla code, look for CardArea

#

i'd help more but i'm not at my pc rn

cyan nymph
#

How would I get started on my making my own joker texture pack, like actively replacing all of the current joker designs?

dapper sun
#

malverk

cyan nymph
#

I thought you said smth in Norwegian and then looked up and saw it was a mod...

#

Thanks though

dapper sun
#

yw

#

malverk's the goto mod for reskins

storm kraken
#

theres also take ownership 🥰

dapper sun
#

true

#

but malverk's better if all you wanna do is replace joker art

storm kraken
#

probably

#

ive got one piece of code chat im gaming

cyan nymph
dapper sun
#

i've never actually used it so

#

does the github repo have a wiki page at the top

cyan nymph
#

do i gotta make my own file and link every joker to each retexture?

dapper sun
#

yea

#

i'd assume so

cyan nymph
#

aight

dapper sun
#

...it'd be even more tedious without malverk btw

cyan nymph
#

ye I know, well off to make the art

summer gorge
#
        info_queue[#info_queue + 1] = G.P_CENTERS.m_steel

        local steel_tally = 0
        if G.playing_cards then
            for _, playing_card in ipairs(G.playing_cards) do
                if SMODS.has_enhancement(playing_card, 'm_steel') then steel_tally = steel_tally + 1 end
            end
        end
        return { vars = { card.ability.extra.xmult, 1 + card.ability.extra.xmult * steel_tally } }
    end,```

Hey guys. I'm making a Joker similar to the Steel Joker so I was looking at it for reference, and it all makes sense to me except:         *info_queue[[#1116390750314307698](/guild/1116389027176787968/channel/1116390750314307698/)_queue + 1] = G.P_CENTERS.m_steel*

What does that do? Is it important?
#

It seems to check for the steel enhancement in... something.

storm kraken
#

gives the name and description of whatever's put in the info queue

summer gorge
#

Still gotta familiarize myself with a lot of this stuff

storm kraken
#

but uhh

#

does anyone know how to add onto the functions in the games code

#

with the mods code

#

and without anything inside the function

hushed field
#

that's what lovely patches are for

storm kraken
dapper sun
#

if you only need to add something to the start/end of a function though, a hook should work fine

storm kraken
#

my two braincells hard at work rn

gusty compass
#

what would i use to check if a joker was added to the joker area through any way, like hologram but for jokers?

gusty compass
#

context.card_area supposedly triggers when a joker is added?

#

cus i am trying to convert jokers that are bought or added into another type

bold sleet
#

?

#
if context.card_added and context.cardarea == G.jokers then
  -- do shit
end
#

Should only trigger when a card is added to G.jokers.

#

(any card, though normally only jokers would go there)

gusty compass
#

Kk

elder rune
#

how to check when you spend money on stuff

toxic cave
#

how does one skip a blind? im tryna find out how to always skip the big blind every ante

summer gorge
#

I'm making a custom challenge and deck just to test my jokers with, but the game crashes when I try to add them. I think it has to do with the fact that my jokers are in a separate folder but I'm trying to call them from the main.lua? The jokers themselves do work. Do I need more than just the key if the jokers aren't in the same lua file?

gilded blaze
elder rune
#

yeah ik got the answer in another server

gilded blaze
#

oof

gilded blaze
#

as in "big blind select button doesn't work, getting a tag is the only option" or "hide big blind"

toxic cave
gilded blaze
#

hiding is easy tho, vanilla already supports that iirc

toxic cave
#

wait what

#

how does one do that

gilded blaze
#

set corresponding blind state to "Hide"

#

I recommend doing that before leaving the shop

toxic cave
gilded blaze
#

is it a joker effect?

toxic cave
#

challenge deck

toxic cave
#

skip behavior is odd

#

figured it out too

#

lemme delete my messages its flooding

summer gorge
#

I'm still stuck on adding mod jokers to a custom deck and challenge. 😮 It crashes, so it must not recognize the ID somehow.

summer gorge
toxic cave
#

so j_mwj_chrysta

summer gorge
#

Would that do it? 😮

harsh belfry
#

i don’t think there’s a single instance where j_ is assumed haha

toxic cave
#

wait is that j in mwj part of the prefix or is the prefix just mw and you added j_ after it

summer gorge
#

That was it. Holy crap. How did I overlook that?

#

I have my own prefix (mwj for magicwritings jokers) and thought it replaced the other one.

toxic cave
#

How do you add localization to a challenge deck?

#

i can set the name but not the rules stuff

storm kraken
#

awesome

tired kestrel
#

is that ourple guy?

toxic cave
#

how does it work

tranquil cypress
dapper sun
storm kraken
toxic cave
dapper sun
#

i'm gonna add an ourple guy joker to my mod now

flat cypress
#

is it possible to split a legendary joker so the the main sprite is on one atlas and the soul layer is on a different atlas? I feel like it should be possible but my brain is being especially smooth today

mystic river
#

that's not currently a thing smods supports
it's definitely possible (the vanilla soul does this) it's just not implemented

flat cypress
#

ah, okay. I thought it might be one of those things where you could do it with some fancy variable work in a separate lua file like sometimes happens with animated jokers

rare torrent
#

why is this not working? ```calculate = function(self, card, context)
if context.shop then
if G.shop_jokers then
for _, card in pairs(G.shop_jokers.cards) do
if not card.ability.extra.activated then
card.ability.couponed = true
card:set_cost()
card.ability.extra.activated = true
end
end
end
end

    if context.end_of_round and context.game_over == false and context.main_eval and context.beat_boss then
        card.ability.extra.activated = false
    end
end``` im trying to make a joker that gives a free joker in the shop each ante but it's doing nothing
daring fern
rare torrent
#

i figured, but i couldn't find any context that worked

storm kraken
#

cant you just look for shop jokers by themselves?

rare torrent
storm kraken
#

ya

rare torrent
#

it still did nothing

storm kraken
#

wait

#

the for loop uses card for a singular joker in g.shop blah blah but your card ability check also uses card?

#

could it be that

rare torrent
#

right i did see that aswell, also it did something this time hold on

daring fern
rare torrent
daring fern
storm kraken
rare torrent
#

oh ok

rare torrent
#

ok it's working now thank you's

storm kraken
#

i hope you carry this knowledge with you on your coding journey

rare torrent
#

i will

#

also another quick question, what's the sound name that plays when a tag is triggered?

storm kraken
#

you can look around the vanilla code ig?

rare torrent
#

yeah im doing that rn

tired kestrel
#

hold on

storm kraken
#

i was telling you what was in the screenshot

#

but ok

tired kestrel
#

Oh.

#

My bad.

#

I didn't know

#

I have not heard about "little men that form part of a choir"

#

I'll hae to look

#

sorry for the confusion

storm kraken
#

song was made in a server im in and no you wont find it anywhere

vale zinc
#

I want to patch draw_card(G.play,G.discard, it*100/play_count,'down', false, v) from function/state_events.lua, 'cause I want to tell if a card in the played hand was or wasn't in the scoring hand -- for a new Boss Blind. Could you help me?

G.FUNCS.draw_from_play_to_discard = function(e)
    local play_count = #G.play.cards
    local it = 1
    for k, v in ipairs(G.play.cards) do
        if (not v.shattered) and (not v.destroyed) then 
            draw_card(G.play,G.discard, it*100/play_count,'down', false, v)
            it = it + 1
        end
    end
end
The Hill
Extra large blind, scored cards are shuffled back into deck

Additionally, playing a Pair with two non-scoring cards and quickly running eval #SMODS.get_card_areas('playing_cards')[1].cards returned 4, which means that it doesn't distinguish scoring cards from non-scoring cards.

gusty compass
#

Am I able to save data to a joker outside card.ability or is that not an option since it gets nullified when you load the save?

storm kraken
#

then just place the cards back in deck

#

or am i stupid

vale zinc
storm kraken
#

are you sure youd like to patch that

storm kraken
vale zinc
vale zinc
storm kraken
#

oh

#

i feel like itd be much better if you didnt patch but ok

storm kraken
vale zinc
#

What I ask is, how in functions/state_events.lua does it determine which cards are or aren't in the scoring hand? If I play a Three of a Kind and two other junk cards, how does it know to include the three and exclude the others?

storm kraken
#

i didnt know state events did that

vale zinc
#

That's where hand calculation is governed.

daring fern
vale zinc
vale zinc
daring fern
slim ferry
daring fern
slim ferry
#

works now, but the cards it creates arent being made eternal

daring fern
junior tapir
#

how was it possible to redefine functionality of an already existing joker?

storm kraken
#

take ownership 🥹

slim ferry
#

okay so apparently i was misinformed in thinking that eternal consumables worked by default, does anyone know how i can make them work? i tried looking at both cryptid and entropy for their patches that do this, but i could only find the patches for eternal playing cards there

tired kestrel
slim ferry
#

no, it is SMODS.whatever:take_ownership()

near bay
#

how do i make it so when a card with an enhancement score, every card (doesnt matter the enhancement for them) gets the same enhancement as the card?

ashen parrot
#

am I missing something here? the game seems to exit when the card tries destroying itself (not a crash, seems to be a "clean" exit)

final jewel
#
    key = 'triceratops',
    atlas = 'Jokers',
    fg_data = {
        is_alternate = false,
        alternate_key = 'j_giga_triceratops_alt'
    },
    pos = {x = 4, y = 5},
    cost = 5,
    rarity = 2,
    blueprint_compat = true,
    eternal_compat = true,
    config = { extra = {
        odds = 1,
        chances = 8,
        interac = {
            ptera_chance = 6
        }
    }},
    loc_vars = function(self, info_queue, card)
        local chances = next(SMODS.find_card("j_giga_pteranodon" or "j_giga_pteranodon_alt")) and card.ability.extra.interac.ptera_chance or card.ability.extra.chances
        local numerator, denominator = SMODS.get_probability_vars(card, card.ability.extra.odds, chances, 'prob')
        info_queue[#info_queue+1] = G.P_CENTERS.m_mult
        return { vars = { numerator, denominator } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play then
            local theChances = next(SMODS.find_card("j_giga_pteranodon" or "j_giga_pteranodon_alt")) and card.ability.extra.interac.ptera_chance or card.ability.extra.chances
            if SMODS.has_enhancement(context.other_card, 'm_mult') then
                if SMODS.pseudorandom_probability(card, pseudoseed('giga_triceratops'), card.ability.extra.odds, theChances, 'tcrtp_prob1') then
                    print("ok")
                    return {
                        level_up = true,
                        message = localize('k_level_up_ex')
                    }
                end
            end
        end
    end
}```
why it never level up the hand
dapper sun
#

i think you need to give a count

slim ferry
#

It can be true as well

dapper sun
#

nvmd

slim ferry
#

That works as 1 level

dapper sun
#

okii

#

print out theChances after setting it

#

i dunno what you're trying to do but you're definitely doing the probabilities wrong

dapper sun
#

how do i make a joker act eternal without the sticker

slim ferry
#

Hook SMODS.is_eternal

versed swan
#

how does main_start and main_end work for multi-box descriptions?

dapper sun
#

it always gets put on the first box

versed swan
#

and there isnt a way to put that stuff in any of the other boxes?

dapper sun
#

not that i know of

versed swan
#

damn, i see

#

thank you

loud summit
#

how would you force a joker to appear debuffed but it still calculates

sick panther
#

im new to modding, does anyone know whats the best way to handle a simple true/false switch to a joker

#

i have essentially a blueprint clone and a boolean on the extra vars, and i want it to only check when it triggers to turn that boolean to false

loud summit
#

actually how would you make a joker able to buff and debuff itself?

loud citrus
#

Is there any mod that allows for purchasing 1 voucher out of some like 2

loud citrus
loud summit
#

wait how would you make a card debuff itself then undebuff at end of ante then

#

if the end_of_round context is nil

sick panther
#

Why instead of debuffing you dont just, make it not do the thing?

#

why involve debuffing

dapper sun
#

anyone know why this doesn't work

-- Hide the cost
local sc_ref = Card.set_cost
function Card:set_cost()
    local sc = sc_ref(self)
    
    if (self.config.center_key == "j_elle_cassie2") then self.sell_cost_label = '?' end
    
    return sc
end```
loud summit
#

im pretty sure set_cost updates the cost label?

#

wait why are you overwriting Card instead of just putting set_cost in the jokers set_cost

normal crest
#

the label is updated every frame iirc

loud summit
#

so put it in the jokers update func?

normal crest
#

that function runs before it's updated so you'll have to hook update and put it at the end

loud summit
#

hook update?

#

like the joker's update func?

normal crest
#

are you and slimestuff working in the same mod

normal crest
loud summit
daring fern
#

sick panther
#

does anyone know how to deal with edge cases where you want to tell if a SMODS.blueprint_effect trigger happened but there is no return value to it?

#

you cant check for everytime it is called because it triggers on pretty much everything

#

edge cases in question are things like perkeo and abstract joker

daring fern
sick panther
#

yes i know

#

but i want to have a joker that essentially acts as a blueprint but only activates once per ante

#

and the code i have works fine for everything except perkeo and abstract joker, and probably other edge cases i havent seen

sick panther
#
calculate = function(self, card, context)
        if context.post_trigger then
          card.ability.extra.active = false
        end
        local other_joker = nil
        for i = 1, #G.jokers.cards do
            if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i + 1] end
        end
        local ret
        if card.ability.extra.active then
          ret = SMODS.blueprint_effect(card, other_joker, context)
        end
        if ret and card.ability.extra.active then
          ret.colour = G.C.GREY
          card.ability.extra.active = false
          return ret
        end
        if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
            if context.beat_boss and card.ability.extra.active == false then
                card.ability.extra.active = true
                return {
                    message = localize('k_reset'),
                    colour = G.C.GREY
                }
            end
        end
    end,
}
#

where card.ability.extra.active is a boolean

#

ignore the post trigger thing at the beginning of the block it doenst work

#

it is mostly copied from the vanillaremade source

daring fern
sick panther
#

how so?

shy seal
#

gosh diddly damn dang darn, my frigign mod crashed

daring fern
# sick panther how so?
calculate = function(self, card, context)
    if card.ability.extra.active then
        local other_joker = nil
        for k, v in pairs(G.jokers.cards) do
            if v == card then
                other_joker = G.jokers.cards[k+1]
            end
        end
        G.modprefix_no_calculating_effects = true
        local ret = SMODS.blueprint_effect(card, other_joker, context)
        G.modprefix_no_calculating_effects = false
        if ret or G.modprefix_failed_at_calculating_effects then
            card.ability.extra.active = false
            if ret then ret.colour = G.C.GREY return ret else
            return SMODS.blueprint_effect(card, other_joker, context) end
        end
    end
    if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
        if context.beat_boss and card.ability.extra.active == false then
            card.ability.extra.active = true
            return {
                message = localize("k_reset"),
                colour = G.C.GREY
            }
        end
    end
end
local oldcardevalstatustext = card_eval_status_text
function card_eval_status_text(card, eval_type, amt, percent, dir, extra)
    if G.modprefix_no_calculating_effects then
        G.modprefix_failed_at_calculating_effects = true
        return nil
    end
    return oldcardevalstatustext(card, eval_type, amt, percent, dir, extra)
end

local oldsmodscalcindeff = SMODS.calculate_individual_effect
SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, from_edition)
    if G.modprefix_no_calculating_effects and effect and next(effect) then
        G.modprefix_failed_at_calculating_effects = true
        return nil
    end
    return oldsmodscalcindeff(effect, scored_card, key, amount, from_edition)
end
```?
sick panther
#

oh jeez hold on

#

oh wow it works man thanks a lot

#

hmm actually when i buy a joker it goes inactive

#

perhaps it is better to try to hook SMODS.blueprint_effect?

#

anyways i had no idea you could just override function like that ill try just forcing a return for every blueprinted copy

subtle merlin
#

how would I be able to get the set_blind effects of vanilla blinds?

sick panther
#

anyone know where the vanilla joker keys are stored in the source code?

#

or the wiki

shrewd cobalt
#

Which part of the gold card's code actually determines how much money it gives? Changing h_dollars in center.config doesnt seem to change anything

frosty rampart
#

changing center.config won't do anything to the actual card, you have to change context.other_card.ability.h_dollars

shrewd cobalt
granite jay
#

Anyone know how create_option_cycle works for the config tab?

#

Or the parameters?

#
create_toggle({
    align = "tl",
    label = "Epic Jokers",
    ref_table = dandysworld.config_file,
    ref_value = "epic",
    callback = function(_set_toggle)
        dandysworld.config_file.epic = _set_toggle
        NFS.write(dandysworld.config_path, STR_PACK(dandysworld.config_file))
    end
}),
create_option_cycle({
    align = "tl",
    label = "Epic Jokers",
    ref_table = dandysworld.config_file,
    ref_value = "epic",
}),
golden field
#

question: how do i make a joker make a specific consumable with a negative edition

daring fern
golden field
daring fern
golden field
#

aight thanks

golden field
#

i only want 2 to appear