#💻・modding-dev

1 messages · Page 591 of 1

gusty compass
#

Get the mods

old void
#

lmfao

queen crescent
#

hijacked account lol

#

anyways

#

other boss disabling joker i know is yahimods mucho texto (if boss blind has more than two lines of text, its disabled)

#

mass confusion

gusty compass
#

Man lua is a mess

#

Didn't think I would have to take ages to debug

queen crescent
frosty rampart
#

ok you've misunderstood
context.debuff_card runs once on every individual card, and in fact context.debuff_card is a reference to each card. it acts similar to context.individual, only in this case there's no context.other_card because context.debuff_card is already a reference to the card
you need to switch your checks to check if context.debuff_card.config.center_key == "joker key" then, and then return { debuff = true } if the check passes

queen crescent
#

ill still have j_gj_fireicerealjokerlol be destroyed

queen crescent
#

thats a whole new can of worms

queen crescent
slim ferry
#

you need to check context.debuff_card and all the other stuff

unkempt bronze
frosty rampart
# queen crescent welp

check that context.debuff_card exists before checking if context.debuff_card.config.center_key is anything

queen crescent
#

it didnt return anything, chicot disabled it before it could do anything

gusty compass
#

Balatro hates me lmao

queen crescent
unkempt bronze
queen crescent
#

game logic hates me

unkempt bronze
#

code hates all

gusty compass
#

I'm trying to get the second suit using max but SOMEHOW, max(-5000,11,12,13) = 11

queen crescent
queen crescent
unkempt bronze
gusty compass
#

You think?

frosty rampart
unkempt bronze
gusty compass
#

My shitty lua coding?

unkempt bronze
#

How you broke a max function even I can't figure!

gusty compass
#

No idea

#

Lua is witchcraft

unkempt bronze
#

and I'm arguably just as bad!

gusty compass
#

I prefer powershell ise

unkempt bronze
#

I'm the kinda person who'd get stuck making a psuedorandom function

unkempt bronze
queen crescent
gusty compass
#

Istg if balatro is gonna continue taking the piss with my max function, I'm gonna mod minecraft instead

#

Nvm it's written in java

#

🥀

unkempt bronze
unkempt bronze
#

"you can't disable me if I disable you first!"

gusty compass
#

W h y a m I g e t t I n g f u c k I n g d I a m o n d s

unkempt bronze
gusty compass
#

No

#

My second most suit is ♤ and I'm getting 🔹

unkempt bronze
#

Hang on, show us the code\

gusty compass
#

Yea

unkempt bronze
#

sometimes two idiots and a village of masters is better than one

gusty compass
#

Three idiots, including my computer

rocky plaza
#

idk what is going on

gusty compass
#

My code says otherwise

frosty rampart
#

show code

rocky plaza
#

did someone attempt to hook the math.max function 🥀
yeah i would like to see the code as well

gusty compass
#

FYI, it's an abomination

rocky plaza
#

im sure it'll be fine...

#

to debug...

gusty compass
#

It's a mess...

frosty rampart
#

if you don't post the code we can't help you

queen crescent
frosty rampart
#

just post it

rocky plaza
#

just show it so that we can try to help

gusty compass
#

Give me a sec

real crown
#

I have a Joker that eats playing cards and spits them out when the Joker is sold or destroyed, but I have a problem
I'm using GUID to know which of these Jokers ate what card if there are multiple of it
It's working perfectly normally, HOWEVER, when you quit the game, and load it, all the eaten cards are forgotten, I'm assuming because the GUID changed
What do you think the easiest way to solve this would be? (The remove_from_deck function for reference)

        if not (G.cs_stack and G.cs_stack.cards and #G.cs_stack.cards > 0) then
            return
        end
        local owner = card.GUID or tostring(card)

        local to_return = {}
        for _, c in ipairs(G.cs_stack.cards) do
            if c.cs_eaten_saved and c.stp_beast_owner == owner then
                table.insert(to_return, c)
            end
        end
        if #to_return == 0 then
            return
        end

        for _, c in ipairs(to_return) do
            c.cs_eaten_saved = nil
            c.stp_beast_owner = nil
            c.cs_eaten = nil
            if c.area == G.cs_stack then
                G.cs_stack:remove_card(c)
            end

            c:add_to_deck()
            G.deck.config.card_limit = G.deck.config.card_limit + 1
            table.insert(G.playing_cards, c)
            playing_card_joker_effects({c})
            if G.hand.cards[1] then
                c.states.visible = nil
                G.hand:emplace(c)
                G.E_MANAGER:add_event(Event({
                    func = function()
                        c:start_materialize();
                        return true
                    end
                }))
            else
                G.deck:emplace(c)
            end
        end

        SMODS.calculate_effect({
            message = 'Regurgitated',
            colour = G.C.PURPLE
        }, card)
    end```
gusty compass
#

Ima just send the .lua file, its the joker with the key szymii

unkempt bronze
#

@lean urchin you should look this joker over too!

rocky plaza
gusty compass
#

He will prob cringe lmao

rocky plaza
#

at least afaik

unkempt bronze
#

Eh, they thought my joker design was 'literally perfect'

gusty compass
real crown
unkempt bronze
gusty compass
#

uh

#

no

#

thats my entire mod

#

not one joker

unkempt bronze
#

Oh. I'm pretty sure you could've just done the joker by itself

gusty compass
#

discord wouldnt let me send such big msgs 😔

#

anyways salvage it somehow

rocky plaza
unkempt bronze
gusty compass
#

idk

#

the code is a tragic mess 🥀

unkempt bronze
#

I fix code in notepad! I'm either the last person to ask, or low on the list!

rocky plaza
#

alr i guess i can paste ts in my vscode

unkempt bronze
real crown
rocky plaza
#

@gusty compass the intent is to retrigger the most common suit, correct

gusty compass
#

Second most common suit

rocky plaza
#

oh

rocky plaza
#

🥀

unkempt bronze
#

much harder

rocky plaza
#

illiterate

unkempt bronze
gusty compass
#

well wouldnt that just look at the second suit in the table

unkempt bronze
#

Currently, just as good as yours!

rocky plaza
unkempt bronze
gusty compass
#

in full deck

rocky plaza
#

oh

#

how do you want to hande ties

gusty compass
#

no effect

unkempt bronze
analog spoke
#

what is the area for the shop's main selling area with SMODS.create_card()?
I can't recall using the fuction before, but if I wanted a joker to have the ability to add a specific card in the shop, I assume this'd be it, right?

unkempt bronze
#

is there a way to sort suits by number of cards

#

Uh... welp. Killed another channel.

red flower
red flower
unkempt bronze
red flower
#

table of what

#

cards in deck?

unkempt bronze
#

cards in deck separated by suits

red flower
#

no

#

if there was then I wouldn't have said that you need to code it yourself haha

unkempt bronze
#

Well then, a table for the cards in deck, a function to count the suits, and then another function to sort the sums

gusty compass
#

i hate lua

red flower
rocky plaza
unkempt bronze
#

lemme try this first..

rocky plaza
#

wait i just realized you can modify a table while looping thru it (to some extent) in lua

#

😭

unkempt bronze
#

...Tomato, what did you do.

rocky plaza
#

the good news is that my algorithm looks a lot simpler than that

unkempt bronze
#

(context: yet to try it, Balatro didn't open for other reasons)

gusty compass
#

??

#

wdym it didnt open

unkempt bronze
#

I clicked on it, it didn't open

gusty compass
#

you opened balatro and it didnt open?

#

are you sure you didnt single click the app?

unkempt bronze
#

Yeah, but it's unrelated to your joker

gusty compass
#

i didnt do anything 😭

unkempt bronze
gusty compass
#

line 172?

unkempt bronze
#

That's my cut of code. Your joker's right after.

gusty compass
#

hold on

unkempt bronze
#

missing } again

gusty compass
#

you are missing a } somewhere

#

since on my IDE it shows no errors

unkempt bronze
#

Yeah. It's not your fault

gusty compass
#

thats alright

#

for a sec i thought i ruined ur mod 🙏

unkempt bronze
#

Oh, it's fine.

#

I get the feeling

analog spoke
#

so, how would I accomplish this then?

unkempt bronze
#

Uh-oh. another one of "} by end, but not anywhere near end."

#

} by 172 is expected, but I put one there and now <eof> is expected there

gusty compass
#

also, uh

#

you dont mind if i can use that joker

#

for me own mod?

unkempt bronze
#

What, szymii?

gusty compass
#

idk

#

i can change the name tho

unkempt bronze
#

Ask the man, it's his joker

#

you can have the soup one, tho

gusty compass
#

kk

#

ill leave it to you then

unkempt bronze
#
SMODS.Joker {
    key = "pop_can",
    blueprint_compat = true,
    rarity = 2,
    cost = 7,
    pos = { x = 2, y = 1 },
    config = { extra = { dollars = 4 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollars } }
    end,
    calculate = function(self, card, context)
        if context.individual and context.cardarea == G.play and context.other_card == context.scoring_hand[1] and context.other_card:is_suit("Diamonds") then
            G.GAME.dollar_buffer = (G.GAME.dollar_buffer or 0) + card.ability.extra.dollars
            return {
                dollars = card.ability.extra.dollars,
                func = function() 
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            G.GAME.dollar_buffer = 0
                            return true
                        end
                    }))
                end
            }
        end
    end,```
here's the code for that, if you'd like
#

(I named it Pop Can, since Pop Art...)

gusty compass
#

you can keep it, its yours

unkempt bronze
#

kk

rocky plaza
#

this is what i came up with while u were tryna fix the issue lmao

unkempt bronze
#

That... might be simplier

gusty compass
#

yea at this point idrk

#

also

#

earlier i mentioned why does balatro crash when modded consumables have an edition

unkempt bronze
rocky plaza
#

np

gusty compass
#

gg

unkempt bronze
#

Making you a Joker!

rocky plaza
#

just credit me as ThunderEdge if you do

unkempt bronze
rocky plaza
gusty compass
#

no as far as i can tell

rocky plaza
gusty compass
#

yea idk what happens with my mod

#

since my spectral i made crashes once i click on it when it has negative

rocky plaza
gusty compass
#

i dont have any custom shaders yet

#

so no

rocky plaza
#

whats the crash message when that happens

gusty compass
#

pretty sure its this

wintry solar
#

Saturn issue

gusty compass
#

do i disable it?

rocky plaza
#

yeah

gusty compass
#

kk

#

i might make it a conflict where the mod wont load with saturn

rocky plaza
#

for some dumb reason mine crashes on titlescreen when cryptid is loaded

#

😭

wintry solar
unkempt bronze
#

Say, does anyone know how to ban every OG joker?

#

It's for a challenge idea I have, trust

red flower
analog spoke
#

mmmmh, true, thank you, yeah, that could help I think

unkempt bronze
#

Apparently Corrupted DNA is broken...

#

(it was the only joker I had at the moment)

#

I think it's because of the -1,0,1 table and the D,H,S,C table

analog spoke
#

ok, so, this sadly doesn't appear to work dbnfksndbfkjsd
any idea what I messed up?
no crash is happening, but the card doesn't appear in shop

#

btw, for further reference, before I commented out the "add_booster" part, it WAS doing that part

red flower
#

try doing add_card instead of create_card

#

and change context.area for G.shop_jokers

unkempt bronze
#

What about for me?

#

the tables seemingly are busted (a number's needed in that spot, to my figuring)

red flower
#

yes the first argument is the table and the second the seed

unkempt bronze
#

Oh. I had them backwards?

#

Also, seed's supposed to be a number

red flower
#

seed should be a string

unkempt bronze
#

oh.

red flower
#

it gets converted into a number internally

#

that's why the error is there because you didn't pass a valid string to convert or a valid pseudoseed

analog spoke
#

it's like the slots were filled with Nothing instead of Something lol

#

things moved, but no selection is happening lol

red flower
#

can i see the code

#

oh wait you're setting it to invisible lmao

#

remove the visible false line

analog spoke
#

here it is

analog spoke
red flower
#

because it does an animation where it sets it to visible later

analog spoke
#

ahhh i see

analog spoke
ivory citrus
#

Helo

#

anyone know how i can change the mod icon?

red flower
next timber
#

wrong chat

uncut badger
#

ive patched immolate to work on macos if any of you guys would want it I can share the source

#

ill put it on github if people would use it

#

i patched all the opencl over to metal

#

im trying to get it to work with brainstorm so all the macos users of the world can auto reroll

quick prairie
#

is "context.remove_playing_cards" able to detect destruction due to hanged man or any external card destruction effects that maybe don't return remove or something?

red flower
quick prairie
#

define appropriate context, you mean so long as it returns { remove = true}?

red flower
#

If they don't use { remove = true } or SMODS.destroy_cards, they need to call the remove_playing_cards context manually

obtuse wraith
unkempt bronze
#

Hm. My Corrupted DNA code does seem to change the value of cards, but not the suit. Also, it doubles cards twice.

granite jay
#
loc_vars = function(self, info_queue, card)          --defines variables to use in the UI. you can use #1# for example to show the chips variable
        vars = {card.ability.extra.chips, card.ability.extra.mult, card.ability.extra.x_mult, card.ability.extra.dollars}
        local action = G.GAME.current_round.ameliorates_octosquish
        local actionMSG = ''
        if action == 0 then
            return {
                actionMSG = '{C:inactive}Currently does nothing'
            }
        elseif action == 1 then
            return {
                actionMSG = '{C:inactive}Currently {C:chips}+#1# {C:inactive}Chips'
            }
        elseif action == 2 then
            return {
                actionMSG = '{C:inactive}Currently {C:mult}+#2# {C:inactive}Mult'
            }
        elseif action == 3 then
            return {
                actionMSG = '{C:inactive}Currently {X:mult, C:white}X#3# {C:inactive}Mult'
            }
        elseif action == 4 then
            return {
                actionMSG = '{C:inactive}Currently earns {C:money}$#4#'
            }
        end
        main_end = {
            n = G.UIT.T,
            text = actionMSG
        }
        return {vars = {card.ability.extra.chips, card.ability.extra.mult, card.ability.extra.x_mult, card.ability.extra.dollars}, main_end, key = self.key }
    end

Anyone able to make main_end show properly? RN It doesn't.

olive hamlet
#

Hey everyone, does anybody know how can i make a joker or spectral card to replace the background music, bc when i try it, it only overlaps, and also i cant stop it from playing

unkempt bronze
quick prairie
#

just making sure, but if i want to implement emult i need some sort of addon right?

unkempt bronze
#

How in the world am I getting repetitions? This is DNA, not Hanging Chad!

analog spoke
#

ok, so, random tarot worked, but trying to make it specifically call for a Fool card failed lol dnfksdn

#

😭 I'm tired and wanna go to beddddddd gah

unkempt bronze
#

Hey, railgun

analog spoke
#

hi

unkempt bronze
#

Mind if I ask for some help?

analog spoke
#

uhm, sure but idk if I can be much help lol sfdsf

unkempt bronze
#

Well, it shouldn't need much lol sfdsf

#

It's about a joker of mine. It's supposed to be like an altered version of DNA, which incorrectly copies the first card of a hand. The current issue is two-fold: it's running a repetition check when it shouldn't, and the cards aren't updating to their actual values.

#

Would you like code to fine-tune it?

analog spoke
#

hmmmm, interesting

#

I don't get what's happening in the code tbh lol, assuming this is the same one lol
I don't know why it'd be retriggering sadly :<
I'm not sure if this is my lack of knowledge, tiredness, or a combo of both lol sdnhfsdj
I could link to a page called VanillaRemade which should include the original DNA code if that'd help, but u may've already been in there idk dnfskjndks

unkempt bronze
#

Do you know anyone on who might know of a fix?

analog spoke
#

hmm, there's a couple people I know which may know how they'd fix something like this, but I am tired rn lol dfnskdf I can't think tbh sdnfkjsdn

if I were you, I'd recommend coming back to this tommorow perhaps? Assuming ur on around the same timezone as me, which could be quite false, it is quite late rn lol
if you are at the same timezone around-so, then it might do good to have a "fresh mind" so to speak, also, maybe more peo- sorry I'm so tired I can't even finish this thought I don't know what half this message even says 😭

unkempt bronze
#

shpuld probably give up for the night

daring fern
unkempt bronze
daring fern
unkempt bronze
#

ah.

#

so the if line should look like
if context.individual and context.scoring_hand[1] and not context.blueprint then

#

Uh. It didn't copy

unkempt bronze
#

Well, now the game just up and closes upon playing a single card.

unkempt bronze
#

Now, I still have to fix cards taking on the wrong skin.

wind steppe
#

chat how does stickers work in SMODS.create_card

jolly shadow
#

p sure its a table of keys

wind steppe
#

like {rental = true, perishable = true} or like {rental, eternal, perishable}

frosty rampart
#

well you want quotes around the keys, but yea the second one

granite jay
#

So V is the object color version of C where you use colors directly, is there a "V" version of X?

#

In localisation?

atomic edge
#

is there a mod that can reroll boosters/vouchers that isnt cryptid

#

i need one to check out the code

granite jay
#

Even when I set msg1b to mult

rocky plaza
#

How would one go about making a certain tag unable to be duplicated by double tags without patching double tags? Is it even possible to do this?

quick prairie
#

im not sure i understand fully, but could i use context.mod_probability and context.identifier to make a joker that only affects certain enhancements?

frosty rampart
frosty rampart
atomic edge
#

if i want to access a voucher i have to put v_modprefix_vouchername?

#

ty

rocky plaza
#

man

frosty rampart
#

yea unfortunately
i think so at least, i'm only looking at vanillaremade rn but i'll go dig into the actual vanilla code

#

ok yea VR is very accurate to the actual code

#

essentially all double tag does is call add_tag(insert tag here)

quick prairie
rocky plaza
#

huh i guess i could hook add_tag

#

wait no

#

cuz i'd need to check the source

frosty rampart
#

yea and add_tag doesn't get any info about the context or its source or whatever

daring fern
# rocky plaza man

No, you could hook Tag:apply_to_run and check if _context.type == 'tag_add' and _context.tag.key == 'tag_modprefix_key' and make it so that add_tag does nothing if the key is the tag you want to prevent from double tags.

frosty rampart
frosty rampart
#

to find out what a particular identifier is, do this in your joker's code

if context.mod_probability then
  print(context.identifier)
end

and then go in-game and make the probability roll you want to modify happen; if you have debugplus it'll pop up in the bottom left corner, if you don't it'll print in the black log window that pops up when you boot the game with mods

quick prairie
#

sweet

#

thanks

mystic river
granite jay
#

Nvm it works

#

thx

left vapor
#

can anyone explain how to add custom deck skins using steamodded? ive looked at the api documentation pages but it looks like a different language (i am not a programmer)

obtuse wraith
left vapor
#

i'm still not sure what i'm doing wrong but thanks for the help
i keep getting this error and im not sure what to do with it

#

ive never done any form of programming so im not sure what an atlas even is

jolly shadow
#

we cant help without seein the code

left vapor
#

what would be the best way to send that ._.

honest bridge
#

Yo how do yall make something happen when a certain joker is clicked on (such as that joker being destroyed)

wind steppe
#

youd have to make a lovely patch to call a context on click

#

or a hook

daring fern
red river
jolly shadow
#

wicked card

honest bridge
true jasper
daring fern
stoic void
#

what is wrong with this code?
Its not doing anything

solid mesa
#

and why you writte the text like that?

stoic void
#

idk

stoic void
solid mesa
#

you should

stoic void
#

k

true jasper
ashen drift
#

just the context.end of round should be sufficient tbh

#

really it should go in calc dollar bonus

stoic void
#

K

daring fern
ashen drift
#

huh really

#

i thought it just wasnt passed

daring fern
ashen drift
#

huh

wintry solar
#

The issue is that that’s not how you check a value is false in lua

#

Should be not context.game_over

stuck ore
#

What does context.game_over check?

#

Is it just what Mr. Bones uses to stop game over?

wintry solar
#

It is true when you have lost the blind

stuck ore
#

Ah gotcha

#

So I'm making a joker and I want them to increase in Xmult until they reach X5 and then stop and just retrigger the Xmult but every way I've tried to configure it it won't show multiple triggers of the joker for the different instances of X5 which is what I'd like. Also yes I know the coding is terrible, I'm self taught and frankensteining a lot of other code from mods I've played, sorry if it's unreadable. (Will gladly take suggestions for how to have better coding punctuation though).

real crown
#

How can I create a specific card from a rank, suit, edition, seal and enhancement?

daring fern
real crown
#

Thank you!

faint yacht
stuck ore
#

Oh I didn’t know that the messages when under the effects themselves thanks

real crown
#

SMODS.add_card is creating a card with random suit and rank for me, the edition/seal/enhancement are correct, it's just the rank and suit that's incorrect, despite the print writing the correct rank and suit in the console:

                set = "Base",
                rank = snap.id,
                suit = snap.suit,
                edition = snap.edition,
                seal = snap.seal,
                enhancement = snap.enhancement
})```
This is where I get the snap from:
```function _G.STP.pack_playing_card(c)
    print(c:get_id())
    print(c.base.suit)
    return {
        id = c:get_id(),
        suit = c.base.suit,
        enhancement = (c.config and c.config.center and c.config.center.key) or 'c_base',
        seal = c.seal or nil,
        edition = c.edition and copy_table(c.edition) or nil
    }
end```
daring fern
#

Also edition should be c.edition and c.edition.key or nil

real crown
#

It does the same when I try c.rank
The edition worked this way too. And the prints give the correct id and suit (e.g.: 12 for a Queen)

daring fern
#

Also you should still do c.edition and c.edition.key or nil for the edition.

real crown
#

Okay, changed the edition
But I don't get how ranks work, shouldn't Queen be id 12 and rank 12?

daring fern
#

It's located at card.base.value

real crown
#

Thank you so much, it's working now!
Somehow it also solved the suit issue

analog spoke
#

for some further info, back before I had commented out the booster, that part DID work

#

oh, and this time an actual crash is happening, not just a failure to take effect

faint yacht
#

c_fool?

lean urchin
distant junco
#

how do i make a global variable

ionic cobalt
daring fern
distant junco
#

is that literally it

daring fern
distant junco
#

god damn it

#

thanks

pastel kernel
#

+1 permanent joker slot whenever "j_modprefix_key" is added to your joker deck.

#

how do i write this?

#

i mean the context part

#

the whenever part

slim ferry
#

Hook Card:add_to_deck

#

since there isnt a universal context for obtaining jokers

pastel kernel
#
local card_add_to_deck_ref = Card.add_to_deck
        function Card:add_to_deck(from_debuff)
            local ret = card_add_to_deck_ref(self, from_debuff)
        end
            if next(SMODS.find_mod("j_star_astro")) and
             self.ability.set == "Joker" then
                return ret
             end
             if ret then
             G.jokers.config.card_limit = lenient_bignum(
             G.jokers.config.card_limit + math.min(card.ability.extra.jokerslot, card.ability.immutable.slotlimit))
        end```
I haven't tested it yet, just need someone to tell me if i'm doing something wrong.
slim ferry
#

use G.jokers:change_size(amount)

#

also card doesnt exist here

#

youre also using find_mod on a joker, and returning before the actual slot increase

pastel kernel
#

how about this?```lua
if next(SMODS.find_mod("j_star_astro")) then
G.jokers.change_size(math.min(card.ability.extra.jokerslot, card.ability.immutable.slotlimit))
end

slim ferry
#

this still has the latter three issues

#

and also do if self.config.center.key == "j_star_astro"

pastel kernel
#

this works with crossmod jokers?

slim ferry
#

wdym

daring fern
slim ferry
#

oh

pastel kernel
#

this is for my mod, i'm making busted buffoons astro give +1 permanent joker slot each time a starspace astro is obtained

slim ferry
#

yeah

#

but what is the question

pastel kernel
#

what question?

slim ferry
pastel kernel
#

you need me to be clearer?

daring fern
pastel kernel
#

G.jokers:change_size(( "-"

#

this is needed?

slim ferry
#

why is it in quotes

#

also yes that makes it actually stay under the slot limit

cunning valley
#

Yoyo! I'm trying to get a context for when you sell a tarot card, but I can't seem to get it to work correctly

My approach was to use

if context.selling_card and not context.blueprint and context.consumeable.ability.set == "Tarot" then```

but it seems to crash every time i try it. I'm guessing i'm doing something wrong
#

Any help would be greatly appreciated!

#

(i'll go get the log)

#

This is the crash report

daring fern
cunning valley
#

Oh! So, i remove the context.consumeable.ability.set == "Tarot" and replace it with something else?

daring fern
cunning valley
#

Ohhhhhh

#

I'm unsure on how it didn't work before but, allow me to see if this functions correctly now!

#

It works! Thank you so much!

#

If I may ask, how did you know it was context.card instead of consumeable? I've been struggling to find resources for the mods and been mostly using the smods wiki

cunning valley
#

Ah, makes sense

#

So it was looking for a card, but it was being given a consumeable, which caused the crash. Is that what I'm getting?

red flower
#

no, the problem is that the only valid fields in that context are selling_card, card and cardarea. any others are nil*

#

*with some small exceptions like blueprint

cunning valley
#

oOooooo

#

Okay this just opened my mind that makes a lot more sense

#

though finding contexts is still a bit difficult, thank you so much!

slim ferry
#

i love undocumented features

red flower
slim ferry
cunning valley
cunning valley
outer jungle
#

Can someone help me understand why this isn't working or if there is a better solution?
I try to increase the chips of the hand level of the hand being played
local hand_name = string.gsub(context.scoring_name, " ", "_") G.GAME.hands[hand_name].chips = G.GAME.hands[hand_name].chips + card.ability.extra.chips

red flower
#

the key has spaces

#

this should work if you change that but it will reset after level up, it requires some extra code

outer jungle
#

oh

red flower
#

dunno

outer jungle
#

alr

outer jungle
#

where can i see all the game variables available to me?

stone dagger
#

Hello, I'm new to Balatro modding and Im trying to create some simple jokers based of MTG cards (cause I dont know how to draw) and Im kinda going mental. I am trying to create a Joker that at end of round creates a planet card for a random hand played this round, and Im trying to use a table to record the hands played to then randomly select one. However the variable I am creating as a table is always nil when I try to access it. Does anyone know why or what I might have done wrong. I can send the code if it's easier

frosty dock
#

beyond that, you also need the variable to survive the game being reloaded, which leaves two choices

#

you can either create the table in card.ability, which will make it specific to that card, or somewhere in G.GAME, in which case it'll be shared between all instances

#

both approaches are mostly identical but will vary when obtaining your joker in the middle of a round

stone dagger
frosty dock
stone dagger
#

May I send the calculate code?

frosty dock
#

please do

stone dagger
#
calculate = function(self, card, context)

        if context.joker_main and not context.blueprint then
            if not card.ability.extra.hands_table then
                card.ability.extra.hands_table = {}
            end
            card.ability.extra.hands_table[#card.ability.extra.hands_table] = context.scoring_name
            print("Added Hand: " .. card.ability.extra.hands_table[#card.ability.extra.hands_table])
        end

        if context.end_of_round and context.cardarea == G.jokers then
            
            if G.consumeables.config.card_count < G.consumeables.config.card_limit then
                
                for k, v in pairs(card.ability.extra.hands_table) do
                    print(k, v)
                end

                local rnd = math.random(#card.ability.extra.hands_table)
                local rand_hand = card.ability.extra.hands_table[rnd]
                
                print("Rnd index = " .. rnd)

                --local planet = Get_hand_planet(rand_hand)

                return {
                    -- message = localize('Found ' .. planet.name),
                    message = "Created planet!",
                }

            end
            
        end
    end
#

the if not var then var = {} was already desperation

frosty dock
#

oh that one's silly

#

your issue lies in lua being 1-indexed

stone dagger
#

how so?

frosty dock
#

you use the length of the table as your index

#

for 0-indexed arrays, that would be the first free index

#

but with 1-indexed arrays it's merely the last element that already exists

#

or, in case of an empty table, you're assiging at index 0

#

which doesn't belong to the array part of the table

stone dagger
#

so I need to add +1?

frosty dock
#

yep

stone dagger
#

Ok Im gonna test it

frosty dock
#

on another note, this is bad and won't work as expected with game seeds

#

you should instead do local rand_hand = pseudorandom_element(card.ability.extra.hands_table, "some_seed_string_of_your_choosing")

stone dagger
#

can the seed be the game seed?

frosty dock
#

it should just be some unique string you choose

#

the game will factor in the game seed behind the scenes

stone dagger
#

ah ok, thanks :)

frosty dock
#

and don't forget to reset the table at the end

stone dagger
stone dagger
#

It's working :D Thank you!

analog spoke
# faint yacht `c_fool`?

thank you, this worked dbnfsdhbfj forgot I needed to have the prefix... I should really learn what prefixes are what so I have the info for future lol

lament agate
#

is there a documentation for gradient

daring fern
rotund sable
#

found this problem. am i stupid again?

#

neither x_chips, xchips and x_mult work

#

it's in an edition

ripe oak
#

I just updated Steammodded and now I get the following error whenever the debuff_card function is called:

#

attempt to index local flags (a nil value)

#

it says the error occurs here in steammodded:

#
local debuff_card = Blind.debuff_card
function Blind:debuff_card(card, from_blind)
    local flags = SMODS.calculate_context({ debuff_card = card, ignore_debuff = true })
    if flags.prevent_debuff then 
        if card.debuff then card:set_debuff(false) end
        return
    elseif flags.debuff then
        if not card.debuff then card:set_debuff(true) end
        return
    end
    debuff_card(self, card, from_blind)
end
#

idk what to do

#

it feels weird because it seems like steammodded crashes when referencing one of its own functions

daring fern
pale holly
#
PRegalia.config_tab = function()
    return {
    n = G.UIT.ROOT, 
    config = { align = "m", r = 0.1, minw = 7, minh = 5, padding = 0.1, colour = G.C.BLACK}, 
    nodes = { 
    { n = G.UIT.R, config = { align = "cl", padding = 0, minh = 0.1 }, nodes = {}},
    
    { n = G.UIT.R, config = {align = "cl", padding =0}, 
    nodes = { create_toggle { col = true, label = "", scale = 1, w = 0, shadow = true, ref_table = PRegalia_config, ref_value = "pip_menu" },
            }
                    },
       { n = G.UIT.C, config = { align = "c", padding = 0 },
                        nodes = {
                            { n = G.UIT.T, config = { text = "Custom Menu", scale = 0.45, colour = G.C.UI.TEXT_LIGHT } },
                        }
                    },
                }
             }
end 

So uh, tried doing the Config and while it works it's, well broken, not totally sure what i've done wrong so if i could have some help please '^^

rotund sable
rotund sable
willow scroll
rotund sable
#

but it was the config

willow scroll
#

Ah well idk

pale holly
# rotund sable i think you'd need to put them into the row node

So like this right ?

PRegalia.config_tab = function()
    return {
    n = G.UIT.ROOT, 
    config = { align = "m", r = 0.1, minw = 7, minh = 5, padding = 0.1, colour = G.C.BLACK}, 
    nodes = { 
    { n = G.UIT.R, config = { align = "cl", padding = 0, minh = 0.1 }, nodes = {
    { n = G.UIT.R, config = {align = "cl", padding =0}, 
    nodes = { create_toggle { col = true, label = "", scale = 1, w = 0, shadow = true, ref_table = PRegalia_config, ref_value = "pip_menu" },
            }
                    },
       { n = G.UIT.C, config = { align = "c", padding = 0 },
                        nodes = {
                            { n = G.UIT.T, config = { text = "Custom Menu", scale = 0.45, colour = G.C.UI.TEXT_LIGHT } },
                        }
                    },
                   }
                 },
                }
             }
end ```
pale holly
#

Thanks i will give it a try 👍

rotund sable
#

maybe change the node with the toggle to column

#

but other than that its ok

ripe oak
#

I think I'm just going to do the only reasonable thing and keep playing with an old version of steammodded and just copy-pasting functions from the current steammodded when needed

#

I'm a genius

pale holly
gilded goblet
#

does anyone know if its possible to change the text on tooltips dynamically?

i wanna change that 2 to a 1 but i dont wanna mess around with the center's config (card.config.center.config.planets = 1), because that'll just make it be 1 for all future cards

ashen drift
#

why does G.UIT.C fail

gilded goblet
rotund sable
#

oh balatro cards

#

i think you could take ownership of it

gilded goblet
#

eugh, okay

rotund sable
#

and override the loc_vars

daring fern
rotund sable
#

or that

#

was it card.ability for it?

gilded goblet
#

card.ability.consumeable.planets = 1 but that doesn't change the text :/

manic rune
gilded goblet
#

that's not rlly what i want

#

ill see what i can do

manic rune
ashen drift
#

this is multiline

manic rune
#

its supposed to be a table of nodes, not just one node lol

ashen drift
#

oh yeah thats mb

#

grand, thank you

tranquil cypress
#

is it possible to make it so a specific joker cant be duplicated by ankh/invisible joker/ anything else that creates a copy of a joker?

real crown
#

Someone using my mod is getting "A bad lovely patch has resulted in this crash."
They're trying to mod it on Steam Deck, does anyone know if there's a compatibility issue there? Other mods are working they say

#

They claim to be using latest lovely, latest Steammodded too

ashen drift
#

where are these texts rendered?

red flower
#

generate_card_ui makes it, or do you mean something else

willow scroll
slim ferry
#

how do you mute the dissolve sound effect in SMODS.destroy_cards?

willow scroll
red flower
#

no

manic rune
modern kindle
#

Hi besties

manic rune
#

hi dilly- what is that pfp

modern kindle
#

Its halloween

#

So i have my Halloween themed profile

manic rune
#

oh yeah true

modern kindle
#

Ill be back to normal in November until December hits then I must become Christmas dilly

manic rune
#

and in Card:shatter too

slim ferry
#

oh

#

so start_dissolve can do silent

#

but SMODS.destroy_cards cant despite using the exact same function with no changes

#

cool

manic rune
#

silent in question doesnt actually work for the sound in self.skip_destroy_animation specifically lmao

#

whoever added that probably forgot about it

ashen drift
manic rune
#

yeah SMODS.localize_box only takes a table of strings

#

you want to put the entire thing, like

{
  "idk",
  "stuff"
}

i think

ashen drift
#

oh ill just wrap it in a table then

manic rune
#

ohhhhh wait

#

its more than that lmao

#

my bad 😭

#

it takes a table of parsed strings

#

like, if you print something from G.localization.descriptions you will notice that it has a text_parsed table

ashen drift
#

alright

manic rune
ashen drift
manic rune
#

can u check if the text_parsed table exists

ashen drift
#

sure

manic rune
#

huh

#

weird

#

gimme a sec

#

oh i see

#

gotta iterate through the table too 😭

#

but yeah afterwards it should give u a table of nodes

ashen drift
#

ah okay

#

ill go figure again and see if anything fucks up

manic rune
#

its 12:37 am rn so i gotta go sleep, i hope u can figure it out, sorry 😭

ashen drift
#

its 1:37 am here

manic rune
#

dang

#

good luck 🥀

ashen drift
#

its ok because im on holiday

jolly shadow
#

another instance of not showing the full error and thus not getting full help

ashen drift
#

i guess the stack traceback could be useful

#

im gonna try using loc_parse_string

#

oh nvm i see where i fucked up

#

awesome

stoic void
#

Sorry i was gone for the day, is this what im meant to do?

tranquil gull
#

hey so i'm wanting to make a lovely only mod (language thing) and i put my stuff in ModName/resources but it's not loading? would i be right in assuming that SMODS is the thing that does that and not lovely

#

or am i just dumb andthat's not how that works

slim ferry
#

lovely only loads patches from either a lovely folder or a lovely.toml file

tranquil gull
#

no i mean

#

i'm trying to load an asset

slim ferry
#

uhhhhh

#

of what kind

tranquil gull
#

love.graphics.newFont oh wait god damn it i probably need to use nfs

slim ferry
#

i mean SMODS.Font exists

#

but youre not using smods so like

#

idfk

#

i dont know love

tranquil gull
long sun
#

how do you exclude a card from appearing in a pack?

tranquil gull
lavish elm
#

info_queue[#info_queue + 1] = G.P_CENTERS.e_negative
how to make this show the hand size description instead the joker slot description?

slim ferry
slim ferry
lavish elm
#

thx

slim ferry
#

im not entirely sure if that config works but it should

slim ferry
#

do keep in mind that that only works for excluding specific packs and not packs in general

#

though usually packs of the same kind use the same key_append

long sun
#

oh ya das fine

#

i just need to exclude a Joker from Buffoon Packs

#

is this alright? i won't be able to test if this works easily

#

its ability is X2 Mult, expensive and i don't want it to appear in packs, as that negates the expensive downside

slim ferry
#

this should work tyeah

long sun
#

sick :3

faint yacht
#

me when

in_pool = function() return false end
wintry solar
#

that looks pretty

faint yacht
#

-# Overlay layer mode go brr.

#

Same with such.

#

-# I need to re-do Iron and Tin cards... those look too similiar... and I've been hella working on JokerDisplay compat.

keen atlas
#

cofh

clear ocean
faint yacht
unkempt rover
#

Smods needs to add something that sees the most used consumable (in the run), because I wanted to make a telescope but for tarot but I can't

#

Does anyone know how to do something like this?

wind steppe
#

Lovely patch or hook whenever a tarot is used to add one to a counter in a table in G.GAME

#

Then when you find it use pairs to loop through that table and get the highest number

slim ferry
#
SMODS.current_mod.reset_game_globals = function(run_start)
  if run_start then G.GAME.tarot_usage = {} end
end

SMODS.current_mod.calculate = function(self, context)
  if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
    G.GAME.tarot_usage[context.consumeable.config.center.key] = (G.GAME.tarot_usage[context.consumeable.config.center.key] or 0) + 1
  end
end
#

shouldnt need any hooks i think

wind steppe
#

i forgot about modcalc

slim ferry
#

mod calc my beloved

faint yacht
#

the AllCalcy

ocean sinew
#

why this atlas not working

#
SMODS.Atlas{
    key="leaf_hc",
    px=923,
    py=95,
    path="hc_leaf_suit.png",

}
SMODS.Atlas{
    key="leaf_ui",
    px=18,
    py=17,
    path="Leaf Suit_icon.png",
}

SMODS.Suit{
    key="Leaf",
    card_key="Leaf",
    hc_atlas="leaf_hc",
    lc_atlas="leaf_hc",
    hc_ui_atlas="leaf_ui",
    lc_ui_atlas="leaf_ui",
    hc_colour=HEX("fbffd1"),
    lc_colour=HEX("fbffd1"),
    in_pool = function ()
        return false
    end,
    pos={y=1,x=0,},
    ui_pos={x=0,y=0,},
}
clear ocean
#

is there a list of allowed types since variable doesn't work but putting in keyword or misc just didnt appear with anything no crash no error nothing

clear ocean
#

variable returned with ERROR

keen atlas
#

try type text

wind steppe
#

post screenshot of k_gros_discard

#

in the loc

clear ocean
wind steppe
#

im on mobile

wind steppe
#

like {‘+#1# Discards’}

#

also should be in v_dictionary

clear ocean
#

okay... ill try

keen atlas
#

try type text

clear ocean
#

v_dictionary?

wind steppe
#

instead of dictionary

clear ocean
#

and do i need to change k_gros_discard to something to like gros_discard or v_gros_discard

wind steppe
#

no

clear ocean
#

its alive... and everything works

#

five editions... im stuffed

wheat tulip
strong jacinth
#

Yo

#

Is there a function that can add jokers on the go

faint yacht
wheat tulip
wheat tulip
slim ferry
clear ocean
#

I can send you the source and you can tell me if there is a better way but give me a moment

vale grove
#

hey yall, just a quick question,
how do you make a contextcheck for beating a blind in one hand

clear ocean
slim ferry
slim ferry
clear ocean
slim ferry
#

🤷

#

alr

slim ferry
#

np twin

real crown
#

Does anyone know why this error may occur? It's working for me perfectly, and it's someone else who's getting this error with the same lovely and Steammodded version:

vale grove
slim ferry
#

oh

#

add and context.main_eval

#

i forgot that

vale grove
#

nice btw have you played megabonk?

slim ferry
#

yeah

#

its pretty fun

vale grove
#

did you unlock calcium?

slim ferry
#

yeah

vale grove
#

thats who im making rn lmoa

slim ferry
#

cinema

vale grove
#

i love that guy so much

#

i just had to add him

real crown
#

@slim ferry do you not know why that LOC_COLOURS error I sent may happen for someone else with the same code and same Steammodded version? It seems so weird and I can't figure it out, they don't have any mod that has conflict either

slim ferry
#

what error

#

that you sent where

real crown
slim ferry
#

okay uh

real crown
slim ferry
#

just do loc_colour() at the top of your main file

#

also

#

why are you making that function

#

theres is already a HEX function that does the exact same

real crown
#

Really? Which one?

slim ferry
#

HEX(<colour code>)

real crown
#

Just HEX("")?

#

Ohhh, didn't know, thank you!

wind steppe
#

smh

real crown
vale grove
# slim ferry yeah

i was looking at yahimice's VIBE bosslind earlier to see how to up the gamespeed

#

is it possible for me to put it to 8x without any other mods or thingies

slim ferry
#

i think its possible

#

though i dont think the game likes it when you go into settings with that

#

and then change the speed

#

the game speed is just a number though

#

so it should work mostly fine

vale grove
#

what im trying to do

#

if youve ever played yahimice's mod

#

is put the gamespeed to 8x

#

and have it stay at 8

#

which he does in his vibe bossblind with 0,25x

#

although when reading this its hard to decipher where he puts the gamespeed to 0,25x

unkempt rover
#

@slim ferry how use it now?

SMODS.current_mod.reset_game_globals = function(run_start)
  if run_start then G.GAME.tarot_usage = {} end
end

SMODS.current_mod.calculate = function(self, context)
  if context.using_consumeable and context.consumeable.ability.set == "Tarot" then
    G.GAME.tarot_usage[context.consumeable.config.center.key] = (G.GAME.tarot_usage[context.consumeable.config.center.key] or 0) + 1
  end
end
slim ferry
#

it creates a table of tarot card keys with their usage count

#

so you can loop over it and get the one with the highest value

unkempt rover
slim ferry
#

loop over the table and get the one with the highest value

#

just like getting the most played hand or whatever

unkempt rover
#

Ok

clear ocean
#

is there a way to make sure that a joker card can only get a certain edition similar to how in vanilla balatro you cannot get a negative playing card

slim ferry
#

try looking at paperback

#

negative playing cards work differently, poll_edition specifcally has a parameter for no negatives thats used for playing cards

clear ocean
distant junco
#

is there a table of poker hands that can be looked up in game?

clear ocean
#

all i have to do is change e_paperback_dichrome to the editions i don't want playing cards to get (i think laminated and iridence is fine for playing cards, and gamma for playing cars maybe techincally works, but will be completely busted)

distant junco
#

sweet!!

clear ocean
#

like this?

slim ferry
#

that probably works

clear ocean
slim ferry
#

yeah

#

looks like it

clear ocean
#

laminated works out of the box but i guess i need to add some edition context for iridescent

#

i think i make a seperate context or do two contexts like (context.post_joker) or (X) and then

#

context.individual and context.cardarea == G.play

slim ferry
#

yes but should be context.main_scoring

#

since its for playing cards

clear ocean
clear ocean
#

sorry for the background video listening to emkay in the background

slim ferry
#

replace

clear ocean
umbral zodiac
#

anyone know how to add/remove a suit&rank from jokers so that it wont crash (for obvious reasons) when played as a playing card

clear ocean
distant junco
slim ferry
#

pretty sure

distant junco
#

it done a crash

slim ferry
#

oh

#

its G.GAME.hands

#

oops

distant junco
#

fair enough, thanks!

clear ocean
#

wait i think i know why hold on

analog spoke
#

hey, so, curious here, basic question, but what does ease_discard() do?

clear ocean
#

adds or removes discards with the proper animation

#

positive number for adding negative number for removing

prisma loom
#

Is it possible to force player keep playing hands even after blind's score was met?

clear ocean
#

im not sure why you would want to do that?

analog spoke
daring fern
prisma loom
#

Get extra value from scaling jokers

clear ocean
#

fair enough uh

#

probably a hook

prisma loom
prisma loom
#

holy shit its old

clear ocean
#

👀

prisma loom
#

wait

#

can I do it easier

#

and just every time score is met/overflows, joker sets current score to 'required score - 1'

#

hmmm

clear ocean
#

made some placeholders

distant junco
#

yo im trying to figure how to check the most played hand

#

and i aint getting anywhere

red flower
distant junco
#

wow ok of course that exact issue is there

distant junco
rancid bridge
#

i lowkey might be stupid... scratches head in confusion

#

ignore the pronouns

#

i'm trying to like. make it add x1 mult for each unique planet card used

atomic edge
#

is there a mod that adds a completely new shop you can acess?

clear ocean
mossy quest
clear ocean
sly fern
#

I know this may be a stupid beginner question, but do I need to list Smods as a dependency? The base I downloaded listed an outdated version as a dependency and I replaced it, yet I get an error when I boot it up even though Smods is in the mods file.

#

is there something I'm missing?

clear ocean
#

"Steamodded (>=VERSION)"

#

you can do "Steamodded (>=1.0.0~BETA-0827b)" since that's the latest version

sly fern
#

thank you so much

#

I'm a lil stupid

clear ocean
#

not the most original tag designs but what do you think?

#

i think these can work at least for alpha

granite jay
#

How do you get the target score for joker scoring?

frosty rampart
#

wdym

granite jay
frosty rampart
#

G.GAME.blind.chips iirc

winter flower
#

how do i make it so that you have to defeat another blind after defeating a blind

analog spoke
#

going to bed soon, but thought I'd ask a question for future me lol (awake me) -
how would one make an enhancement additionally count as a suit, a-la smeared joker?

basically, I'm imagining two different jokers rn, right?
their effects are like this

  • Mult cards count as Spades and give +[number] chips
  • Mult cards count as Hearts and give +[number] mult
    how would I do this? I'm looking at smeared's code rn but it's a little confusing to me tbh lol heh sdfsdfs
frosty rampart
frosty rampart
# analog spoke going to bed soon, but thought I'd ask a question for future me lol (awake me) -...

hook the card:is_suit() function, check the card's enhancement, and then if it's mult, check if the player has the relevant joker. so e.g. in your hook you'd have

if SMODS.has_enhancement(self, "mult") then
  if next(SMODS.find_card("j_modprefix_jokerkey1")) and suit == "Spades" then
    return true
  end
  if next(SMODS.find_card("j_modprefix_jokerkey2")) and suit == "Hearts" then
    return true
  end
end
granite jay
#

How do you make it so Jokers always trigger after scoring?

#

like after all jokers are triggered

frosty rampart
#

context.final_scoring_step instead of context.joker_main, but what's your goal?

granite jay
#

Was considering making a joker that triggers if Chips X Mult is under the target score, but thinking about it now maybe half the target score?

Actually I might make it an econ joker idk

#

Now that I think about it i'll revise the effect.

frosty rampart
#

ah i see

rancid bridge
#

i originally did literally just the loc_vars section here but with Xmult instead of dollars

#

and then i realized
"wait if the player hasn't used a singular planet card after picking this up wouldn't it be x0 mult"

frosty rampart
#

we call that a skill issue and leave it in :3

rancid bridge
#

but Nah Sorry i don't really want somebody's run to be fucked over because they somehow can't find planet cards and are stuck with a x0 mult joker

rancid bridge
#

eh screw it i'm going all in

analog spoke
frosty rampart
analog spoke
#

mmmm I see I see, not sure if I get it entirely, but might be able to frankenstein something together with this sfsdfsd lol

frosty rampart
#

yea the key is that lua treats functions as variables
so you save a copy of the function you're hooking, overwrite the function to do the custom behavior you want to do, and then once you've checked and it's not in any of your custom behavior you call the old copy of the function from before you overwrote it

analog spoke
#

mmm that's really cool actually!

#

(honestly, from the little I've learned from modding this game, lua seems insane lmao heheh)

frosty rampart
#

it's fun

#

now if only they'd implement full custom operator overloading so talisman doesn't have to be complicated as shit [grumble grumble]

analog spoke
frosty rampart
#
  1. first line of non-comment code needs to be local card_is_suit_ref = Card.is_suit
  2. second line of non-comment code needs to be function Card:is_suit(suit, bypass_debuff, flush_calc). then you need to pass those arguments after self when you call the ref function, not just (self, from_debuff)
#

(note the capital C in "Card" in the function definition, it's case sensitive)

analog spoke
#

ahh ok, thank you, I'll change this up rq, thanks!

red flower
#

also the enhancement would be m_mult

frosty rampart
#

oops right, that's my bad

analog spoke
#

ahh, thank you!
it works now! :3

sly fern
#

im trying to make it so that the card plays the sfx "guraohno"/add chips/send msg before scoring, then once the cards are scored play "a"/send msg/destroy themselves but the card plays both sfx at the start and dont destroy themselves

#

how do I give one card 2 different activations for 2 effects/ control the timing (e.g. leave the player on a msg for 3s)

#

i've tried and but it doesnt seem to work

jolly shadow
#

thats not how you use context.destroy card or play_sound

sly fern
#

ah

jolly shadow
#

if you return a table with the key "sound" set to a sound key, it'll play it

sly fern
#

tbh ive been trying sound/play sound and all that just hoping something works

jolly shadow
#

i.e. ```lua
return {
message = "goodbye",
sound = "guraohno",
chips = card.ability.extra.chips
}

#

and for the final scoring step one try

return {
  message = "a",
  sound = "a",
  func = function()
    SMODS.destroy_cards({card});
  end
}```
#

replace the sound values with your sound key

#

add ur mod's prefix before the sound keys

sly fern
#

Cinema

honest bridge
jolly shadow
#

Lmfao

#
local click_ref = Card.click
function Card:click()
  -- do your check here

  click_ref(self)
end```
honest bridge
jolly shadow
#

It's not supposed to be inside your joker

#

Nor are you even checking for the key

honest bridge
#

oh

#

where are they supposed to be then, game.lua?

honest bridge
jolly shadow
honest bridge
stuck ore
#

I'm trying to make a joker that does a DNA type effect but I'm coding this on a Steam deck so I can't access the games actual files and I've no idea how the joker is coded, how would I program literally a one to one of DNA as a baseline? Also sorry if this isn't specific enough I'm not quite sure how to ask about this

stuck ore
pale holly
#

Can someone help me understand ? I've literally set the code in my main.lua as

if JokerDisplay then
    SMODS.load_file("joker_def.lua")()
end

and this errors still happens

also the priority is set at 999

lavish elm
#

how to make an edition not appear for playing cards?

#

How to get the last used spectral card?

pale holly
true jasper
pale holly
#

I just changed it to apply it to it in my main.lua

if next(SMODS.find_mod("JokerDisplay")) then
    SMODS.load_file("joker_def.lua")()
end

that's why i'm confused

pale holly
#

Well apparently all i had to do was put the joker_def in the root folder with the main.lua for it to work
thanks for help !

daring fern
#

lavish elm
#

what is the size of a seal sprite?

daring fern
lavish elm
#

ok thx

last oracle
#

That’s false a seal can grow up to more than 1.7 meters

stuck ore
#

I have a question about the line "copy_card.states.visible = _" I want the joker to create a copy of a card and send them into the deck as opposed to the hand like many other jokers but this line of text either makes the cards invisible and intangible, or when I set the value to true they became face down. I was curious if there was a way I could establish these cards as being face up without the materilize event because that is only used to visualize adding them to the hand. Okay sorry a lot of words to explain this but I'm basically asking how do I make "copy_card.states.visible" equal to visible (EDIT: I figured out a solution, now worries about responding)

left sonnet
#

Hey folks, I'm very confused right now. I will send 2 snippets of code for an Atlas. The first is the one I was using, the second is the one on the SMods example jokers page, to which I have changed my variables to in the first snippet. The first snippet returns a "attempt to call field 'Atlas' (a nil value)", the second runs no problem, despite looking like the same code to me.

My Atlas
SMODS.Altas {
    key = "ModdedVanilla",
    path = "ModdedVanilla.png",
    px = 71,
    py = 95
}
Their Atlas
--Creates an atlas for cards to use
SMODS.Atlas {
    -- Key for code to find it with
    key = "ModdedVanilla",
    -- The name of the file, for the code to pull the atlas from
    path = "ModdedVanilla.png",
    -- Width of each sprite in 1x size
    px = 71,
    -- Height of each sprite in 1x size
    py = 95
}
shell timber
#

your code calls SMODS.Altas and not SMODS.Atlas

#

you have the t and l swapped

#

you should probably also change the key and file path

left sonnet
#

Thank you

left sonnet
stuck ore
#

While you can use ease_discard() or ease_money() to add either respective thing, how do you add hands?

red flower
#

ease_hands_played

#

iirc

stuck ore
#

ah

#

you do remember correctly, and thank you

faint yacht
#

@red flower
-# We doin' it.

stuck ore
#

Just to make sure I'm not being stupid, does "other_card:is_suit("Diamonds")" work for checking if a card is a diamond suit?

stuck ore
faint yacht
#

And not this?

stuck ore
#

Maybe the people saying modded balatro is unbalanced have some relevancy

faint yacht
#

You'd need to get that many unique enhancements first.

stuck ore
#

oooooooooh

#

Thats kinda neat

faint yacht
#

Of course, if you add enhancements from other mods, it can be pushed higher.

#

You'd have to actively seek out unique ones.

stuck ore
#

which in turn creates some fun replayability and interaction

#

I'd say 100% good design

faint yacht
#

For example, getting this enhancement requires you to get 3 Copper, 1 Silver and 1 Redstone cards drawn in order to alloy them.

#

...or get lucky with this.

keen atlas
#

alloy smelter

faint yacht
#

-# Correct.

keen atlas
#

thats enderio

faint yacht
#

It is, yeah.

stuck ore
#

calculate = function(self, card, context)
if not card.debuff then
if context.individual and context.cardarea == G.play then
local diamonds = 0
for _, other_card in ipairs(G.play.cards) do
if other_card:is_suit("Diamonds") then
diamonds = diamonds + 1
end
end
if context.joker_main and diamonds >= 2 then
ease_hands_played(1)
end
end
end

#

Sorry forgot you can't enter to indent on discord

#

I want this to check if there are two or more diamonds in the played hand and then give one hand if there is during scoring but instead it either gives nothing or it gives per card scored and I'm not sure which part to change

red flower
#

context.individual and context.joker_main don't happen at the same time, that's why it gives nothing

context.individual already loops through the played hands so that's why sometimes it gives multiple

you want to do that loop in context.joker_main

#

also not card.debuff does nothing because calculate doesn't run if the card is debuffed

faint yacht
#

@red flower Actually, whilst you're here, mind lending a hand about why the main value doesn't count the retriggers?

calc_function = function(card)
    local text, _, scoring_hand = JokerDisplay.evaluate_hand()
    local hand = JokerDisplay.current_hand
    local totalxmult, percard = 1, 1
    
    if text ~= "Unknown" then
        local usuits, usuitscount = {}, 0
        for _, ccard in pairs(hand) do
            if ccard and not usuits[ccard.base.suit] then usuits[ccard.base.suit] = true; usuitscount = usuitscount + 1 end
        end
        
        if usuitscount >= 2 then
            local suitbonus = usuitscount - 1
            local cumuxmult = 1+card.ability.extra.persuit*suitbonus
            percard = cumuxmult
            for _, scoring_card in pairs(scoring_hand) do
                local retriggers = JokerDisplay.calculate_card_triggers(scoring_card, scoring_hand)
                totalxmult = cumuxmult ^ retriggers
            end
        end
    end
    
    card.joker_display_values.x_mult = totalxmult
    card.joker_display_values.percardxm = percard
end
#

This counts fine tho.

red flower
stuck ore
red flower
#

basically just replace context.individual and context.cardarea == G.play for context.joker_main

wooden nexus
#

Hi, sorry, the one coding cards in lovely again.

For some reason my code is making the balance occur BEFORE the chips are scoring,

faint yacht
stuck ore
#

hm

#

so an odd thing occured where it doesn't give hands if the cards a debuffed

stuck ore
#

for _, other_card in ipairs(G.play.cards) do
if other_card:is_suit("Diamonds") then
diamonds = diamonds + 1
end

#

Again like a moron I forget you can't indent

#

Is there a way I can make this only check scored cards?

#

(I'm curious mostly because I can't think of how to resolve the issue where it doesn't work when the diamond cards are debuffed and I can just make this a feature if i just push it a little)

faint yacht
#

other_card:is_suit("Diamonds", true) as Card:is_suit(suit, bypass_debuff, flush_calc)

stuck ore
#

um sorry I'm foolish but how should I write that into the code?

slim ferry
#

instead of G.play.cards

faint yacht
stuck ore
#

Thanks a bunch everybody it is perfecto

left sonnet
#

Hello again folks, I'm trying to make my first Joker for a friend and I've ran into another issue. Did some digging in the server but it seems to be a pretty wide range of issues.

#

Written effect: If scoring hand contains 2 or more Aces (an upside down W), gain x0.23 Mult (Currently x1)
Additional effects: Plays FlightReacts saying LeBron and displaying "CHAT IS THIS REAL?" text

Issue: "attempt to perform arithmetic on field 'ace_count' (a nil value)" when scoring hand has an ace.

config = {extra = {Xmult = 1, Xmult_gain = 0.23, ace_count = 0}},
    loc_vars = function(self, info_queue, card)
        return { vars = {card.ability.extra.Xmult, card.ability.extra.Xmult_gain, card.ability.extra.ace_count}}
    end,

    calculate = function(self, card, context)
        if context.joker_main then
            return {
                print("Contexting"),
                message = localize { type = 'variable', key = 'a_xmult', vars = { card.ability.extra.Xmult } },
                Xmult_mod = card.ability.extra.Xmult
            }
        end

        
        if not card.debuff then
            if
                context.cardarea == G.play
                and context.individual
                and context.other_card:get_id() == 14
                and not context.blueprint
            then
                card.ability.extra.ace_count = card.ability.extra.ace_count + 1
                print("In play, individual card, Aces: " + card.ability.extra.ace_count)
            end
            if context.joker_main and card.ability.extra.ace_count >= 2 then
                print ("More than 2 aces, W")
                card.ability.extra.mult = card.ability.extra.Xmult + card.ability.extra.Xmult_gain
                return {
                    print("returning it"),
                    message = "CHAT IS THIS REAL?",
                    play_sound('LeBronScream'),
                    colour = G.C.MULT,
                    card = card
                }
            end
            if context.end_of_round then
                card.ability.extra.ace_count = 0
            end
        end
    end
#

My first thought was that config wasn't adding it to the extras in card.ability but to assume the Steamodded code is broken rather than mine is daft

lavish elm
#

next(context.poker_hands['Royal Flush'])
how to check for Royal Flush?

next timber
#

looking at the vanillaremade implementation of the tags, what do these things mean?

#

whats the locks thing, and what does the yep function do?

left sonnet
#

yep

next timber
#

ok nvm i found the docs for the yep function

#

still confused about the lock variables though

left sonnet
#

You just put it in an if

lavish elm
#

yeah but it crashes it says nil

left sonnet
#

That will very unlikely be the issue

slim ferry
#

no

#

royal flush isnt actually a hand

#

its just a different name for straight flush code-wise

left sonnet
#

Ah right, didn't notice that too

slim ferry
#

you need to check it differently

lavish elm
#

welp time to add the hand my self then

slim ferry
#

G.GAME.current_round.current_hand.handname == localize("Royal Flush", "poker_hands")

#

this works

#

cryptid does it like this

lavish elm
#

oh ok thx

slim ferry
#

only works if it is a royal flush but like

#

i cant think of a situation where a hand contains one but isnt a royal flush

pale holly
#
SMODS.Voucher {
    key = 'slide',
        loc_txt= {
        name = 'Slide',
        text = {
        "Gain {C:money}#1#${} per skip",
        "{s:0.8,C:inactive}(By itself, it feels incomplete.){}",
    }
},
    atlas = 'slider',
    pos = { x = 0, y = 0 },
    config = { extra = { dollar = 5 } },
     loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.dollar}  }
    end,
    
    redeem = function(self, card)
        check_for_unlock({ 'slide_redeemed' })
    end,
             calculate = function(self, card,context)
               if context.skip_blind and not context.blueprint then
                dollars = card.ability.extra.dollar
                end
             end
}

My voucher won't give me any money when skipping blind, not sure why

left sonnet
daring fern
pale holly
#

damit no wonder, thanks

slim ferry
#

also, you should use a local variable for that

left sonnet
slim ferry
#

oh

#

nevermind

#

hm

left sonnet
slim ferry
#

just do local ace_count = 0 at the start of the calculate

#

and then use that to count the aces

next timber
#

how do i make SMODS.add_card give a perishable joker? i tried stickers = {perishable = true} but that doesnt seem to add the sticker

tranquil cypress
#

You would do this inside the smods.add_card thing ( i think)

stickers = { "perishable" },
force_stickers = true
queen meadow
#

safe to assume that there's no check for when a seal is triggered right?

slim ferry
#

not without manually adding compat for every seal, no

stuck ore
#

So I'm having an issue with this joker that isn't triggering at all and I am very confused because out of curiousity I gutted it and replaced the code with a joker from the vanilla remade jokers and it still didn't trigger so I was curious if there was anything obviously wrong with the code

#

config = { extra = {mult = 10, chips = 30, money = 3, type = 'Three of a Kind' } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult, card.ability.extra.chips, card.ability.extra.money, localize(card.ability.extra.type, 'poker_hands') } }
end,
calculate = function(self, card, context)
if context.joker_main and next(context.poker_hands[card.ability.extra.type]) then
return {
mult = card.ability.extra.mult,
chips = card.ability.extra.chips,
money = card.ability.extra.money,
}
end
end,
}

slim ferry
#

please smods give me post_trigger for non-jokers and my life is yours