#💻・modding-dev

1 messages · Page 360 of 1

toxic flicker
#

shoulds std_enhance also be

#

ok

burnt cairn
#

i have no idea what it does but when someone else made the glass cards not shattering function for me they included it so im assuming its necessary

#

ill try without it i guess

brisk rose
#

nah if it works there then it must work here and i'm assuming things

toxic flicker
#

ts still doesnt work

faint yacht
#

next(SMODS.find_card('j_mod_key')) would check if you currently have a specific Joker.

burnt cairn
#

yeah no difference nom

faint yacht
#

forgot to remove own reply, oops.

#

-# tl;dr context for the nil score requirement is me trying to optimize DriveSpace.

brisk rose
daring fern
burnt cairn
#

yeah i just dont understand why adding these four lines stops the code from working even if i have the joker

burnt cairn
#

its not crashing its just undoing the xmult change

daring fern
faint yacht
burnt cairn
#

??

toxic flicker
#

i love u bro

#

kisses

#

ima give u a smooch bro

#

u cant run

hallow relic
#

what does create_card() do? i cannot seem to find it in the steammodded documentation

faint yacht
#

SMODS.create_card, you mean here.

GitHub

A Balatro Modding Framework. Contribute to Steamodded/smods development by creating an account on GitHub.

burnt cairn
toxic flicker
#

OK SIDE NOTE I JUST HIT 3 20$ ON THE LUCKY CARD IN A ROW

#

WTFFFF

daring fern
burnt cairn
#

still dont understand how config isnt in calculate

#

its definitely between the start of the function and the end

brisk rose
#

that's whre it really ends up

#

I mean a constructor, for an object that smods injects into the game in a different format

faint yacht
#

Some objects may not have either a config or calculate field.

burnt cairn
#

i have no idea what that means but ill take your word for it

faint yacht
burnt cairn
daring fern
burnt cairn
#

ah

cyan lagoon
#

how do i make the added enhancement take effect?

#

right now the enhancements dont work in the hand they were added

subtle hawk
#
                carded = G.hand.cards[i]
                G.hand.config.highlighted_limit = #G.hand.cards
                G.hand:add_to_highlighted(carded, true)```
I have this piece of code, it works just as intented where I already use it. I wanted to reuse it for highlighting Spades specifically, tried doing `G.hand.cards[i]:is_suit("Spades")` but that results in a crash with `attempt to call method is_suit (a nil value)`
How do I highlight spades then?
burnt cairn
daring fern
fading geyser
#

Hi, I'm trying to do a couple of things in my mod and just can't figure them out. The first is a context for a joker being destroyed, e.g. giving money when this joker is destroyed. Does anyone know what this context would be?

#

The second thing is how to create a joker with a mod key, e.g. create a joker that starts with j_cry or something. Can anyone help me? Thanks!

daring fern
fading geyser
#

yes

#

such as cryptid or my own mod

daring fern
faint yacht
daring fern
fading geyser
fading geyser
daring fern
faint yacht
#

-# Or that.

fading geyser
fading geyser
daring fern
fading geyser
#

yeah that's pretty much exactly what I was gonna do

red flower
#

anyway there's no context for a joker being destroyed

fading geyser
#

any possible work around?

red flower
#

i don't remember which mods add one but I'm pretty sure there are some
the problem is that is not easy to distinguish destroy/sell/remove outside of gameplay

zealous glen
fading geyser
#

Thanks for pointing me in the right direction guys. I'll check out those mods. Have a great rest of your day!

toxic flicker
#

yall how do i delete a card

#

like trading card

fading geyser
#

you can look at the source code

toxic flicker
#

ya but its a lil funny

#

like

#

its different

zealous glen
toxic flicker
#

cuz it only works by deleting the whole hand of 1

toxic flicker
zealous glen
toxic flicker
red flower
#

what do you want to destroy exactly? a discarded card?

zealous glen
#

just CTRL+F "destroy"

toxic flicker
#

ohhh

#

omg

#

😭

#

there it is

brisk rose
#

biting the bullet

zealous glen
brisk rose
zealous glen
#

I posted her 5 billion times yesterday

brisk rose
hollow night
#

Hi, im trying to make basicaly the Wheel of Fortune, but i dont really understand at all lua/balatro source code, so, how it would be to trigger the joker if Wheel of Fortune applies an edition or not?

#

i mean basically that when the wheel of fortune does not trigger you get mult

brisk rose
#

uses the trademarked dark purple and seagreen Coonie color scheme, lol. I guess KastorCode needs sued :P

#

but I appreciatte the availability

zealous glen
brisk rose
#

one moment

#

cryptid has one too

zealous glen
brisk rose
#

but cryptid has weird code

brisk rose
hallow relic
#

whats the internal name for the soul?

hollow night
#

thanks i will look it up!

brisk rose
zealous glen
next elk
#
SMODS.Enhancement {
    key = "infected",
    loc_txt = {
        name = 'Infected'
    },
    atlas = 'enhancement',
    pos = { x = 0, y = 0 },

    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            for _, scored_hand in ipairs(context.scoring_hand) do
                if scored_card() then
                    scored_card:set_ability('m_infected', nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up()
                            return true
                        end
                    }))
                end
            end
        end
    end

}

does anybody know how can i changer this to work like an enhacement? (currently its based on midas mask)

brisk rose
brisk rose
#

so yeah advanced stuff

unborn bay
#

manual calculate joker ,,,,,

hushed field
red flower
wintry solar
#

That’s certainly one way of tracking wheel fails

brisk rose
next elk
hushed field
#

Somehow the loc_vars remains 0, even if the calculate function does properly gather its info. Does the generate_ui for seals use a fake card?

hushed field
#

Can you link the thread or git again, N? I forgot to save it last time

next elk
brisk rose
next elk
cyan lagoon
#

question how do i make return {message} do a different sound?

brisk rose
red flower
hushed field
# next elk yes

you may have misread what that code does and what you wrote in your own

red flower
next elk
hushed field
next elk
#

wiki doesnt explain much when it comes to enhancements (or im too dumb and ignore sth obvious)

hushed field
#

the () is also a function indicator

#

but you're not wanting to access a function

brisk rose
next elk
#

oh shit you are right

#

i must have misread

hushed field
brisk rose
#

but i might be wrong

next elk
#
SMODS.Enhancement {
    key = "infected",
    loc_txt = {
        name = 'Infected'
    },
    atlas = 'enhancement',
    pos = { x = 0, y = 0 },

    calculate = function(self, card, context)
        if context.main_scoring and context.cardarea == G.play then
            for _, scored_card in ipairs(context.scoring_hand) do
                if scored_card then
                    scored_card:set_ability('m_infected', nil, true)
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            scored_card:juice_up()
                            return true
                        end
                    }))
                end
            end
        end
    end

}

is this better?

daring fern
next elk
hushed field
#

I'd test it out, and see what the crash log tells you. If there's no crash log, however, it works! But yeah, you'd need to add your mod prefix

willow plinth
#

what is the easiest way to get the "Mods" directory dynamically? will it always be SMODS.current_mod.path and one folder up or no?

hushed field
#

this is the set up for one of Kino's enhancements, and you can see that the set up of a simple one doesn't much differ from a joker's. But the best thing to do is generally to set up a template, and check the docs on the smods github wiki and see if you're properly asking for the same parameters. I think without the 'effect' there, it will work, but it could cause strange interactions. I'm not actually entirely sure, though

next elk
#

how do i do prefix btw

#

do i do this outside the functions or

hushed field
#

they don't?

#

is that old stuff?

wintry solar
#

No

hushed field
#

oh man

wintry solar
#

Not for 5 months

hushed field
#

ah, okay, so that's a remnant of me starting Kino as a project on a very old version of smods accidentally

next elk
brisk rose
#

why does fusion jokers have.. after the commas in the extra tables?

next elk
#

i forgot about the json

brisk rose
#

lol

#

first time using vscode

maiden phoenix
#

There's a config to automatically remove those

#

In VSCode you go to File > Preferences > Settings and type "Trim Trailing Whitespace"

maiden phoenix
willow plinth
red flower
#

what do you want to do?

#

also i think the current_mod.path thing should work

willow plinth
red flower
#

In your mod's folder or another?

brisk rose
willow plinth
red flower
#

yes

brisk rose
#

lol

#

afaik

willow plinth
#

okay but SMODS.load_file is relative the mod directory

#

not the current lua file, right?

red flower
#

correct

willow plinth
#

that is, in fact, glorpshit

primal robin
#

glorp

willow plinth
#

but alright lua, i'll jump through hoops again to make you happy you fucking piece of shit language

#

anyway, thanks for the help

crisp coral
#

what did lua do to you

red flower
#

I think lua has what you want normally, the problem is lovely

willow plinth
#

literally every other serious language supports getting the path of the current file ur in, not just the cwd or the folder the "starting" file is in

brisk rose
#

whoops meant to remove that

willow plinth
brisk rose
#

but it still might be helpful

#

also... that thing I sent you to debug literally already does the thing you want?

#

how did they get it to work?

willow plinth
#

anyway, i'll stop rambling and just accept it (for now)

crisp coral
#

you can fetch the current path with lovely

#

iirc

brisk rose
#

nvm

#

they didn't put it in a subfolder

willow plinth
brisk rose
#

i forgor

willow plinth
#

yeah

primal robin
brisk rose
toxic flicker
#

so how exactly does context.destroy card work

#

ts is not destroying shit

daring fern
toxic flicker
daring fern
toxic flicker
#

cuz i want to remove only one card

#

oh

#

so

#

remove means to remove all the marked cardS?

daring fern
willow plinth
toxic flicker
toxic flicker
brisk rose
manic rune
#

how do i deal with this

brisk rose
crisp coral
zealous glen
manic rune
#

i want to change the text and color

#

but idk where

crisp coral
#

make a new SMODS.Rarity?

toxic flicker
manic rune
#

is it somewhere here

#

oh, thats rarity??

#

damn im dumb

#

thanks

crisp coral
#

yes thats the rarity badge

zealous glen
toxic flicker
zealous glen
red flower
toxic flicker
zealous glen
willow plinth
brisk rose
primal robin
zealous glen
brisk rose
#

and then just run the function

red flower
zealous glen
zealous glen
wintry solar
#

I dont think getting sliced does anything on playing cards?

zealous glen
unborn bay
#

the relativity only really matters in languages like c# and such because scripts/code on those are mostly self contained

red flower
#

I'm asking because if smods handles it it doesn't matter if they do it manually

unborn bay
#

unlike in lua where basically everything gets added to the damn global table

zealous glen
primal robin
#

Lua is like old JS with var ehehe

willow plinth
# brisk rose i mean... put things in functions if you want locals?

bruh okay, let's say i have joker1 that imports it's loc_vars from a subfolder because they are so big
let's say i wanna do the same for joker2

now if i call both of these separated loc_vars the same name, one gets overridden, meaning i can't just dump them into global

red flower
brisk rose
zealous glen
#

But SMODS does

red flower
#

does it?

willow plinth
#

i've accepted it and i'll just use "absolute" paths with SMODS.load_file

zealous glen
# red flower does it?

It did when I PR’d Card.can_calculate. I know there were timing changes to when Card.can_calculate is called, but I don’t remember that method itself being changed

wintry solar
#

I am 99% sure that it doesn’t use it for playing cards

crisp coral
brisk rose
red flower
#

i am getting sliced rn

manic rune
#

print(N.ability.getting_sliced)

red flower
#

i dont have ability

manic rune
#

:3

#

everyone does

#

else how do you remember things

red flower
#

who are you

manic rune
#

im sorry

chilly hull
#

any reason it shows up as error?

zealous glen
zealous glen
#

Since it was restructured

unborn bay
#

wait people localize their poker hand names in joker descriptions

red flower
red flower
zealous glen
#

Example from the original PR

chilly hull
#

it works now ty, what does the poker_hands do here?

zealous glen
#

As you can see, this is (trying) to run Card.can_calculate on non-Joker cards

red flower
zealous glen
#

Although I’m not sure this specific logic was correct

chilly hull
#

i see thank you

zealous glen
#

If you want it to take effect immediately

manic rune
#

...is this not how i use a custom rarity?

#

my other mod uses this so idfk why i cant get it working now :3

cyan lagoon
red flower
#

is this an if condition?

manic rune
#

perhaps

cyan lagoon
#

yes

manic rune
#

true

zealous glen
#

Here’s Glass cards being tested for card.getting_sliced

zealous glen
cyan lagoon
#

aight

red flower
#

i mean my point was that vanilla cards don't use it so it doesn't make much sense to recommend it to someone

#

it could be handled by { remove = true } maybe?

zealous glen
#

And anything like Quantum Ranks will be the same

#

I do agree it’s not ideal

#

But there’s not always a better solution

zealous glen
red flower
#

But this makes it so it behaves differently from vanilla in a way that people might not want, so I wouldn't recommend it unless someone needs it

OR patch the vanilla cards that destroy to do it

zealous glen
#

It should only behave differently in the way it interacts with other modded content

#

Since vanilla doesn’t use it

red flower
#

If someone is making a joker that destroys you can't assume they want the card to stop calculating too

#

And if a mod needs the card to stop calculating when destroyed then it has a problem with vanilla

manic rune
#

what the

zealous glen
manic rune
zealous glen
#

If the card is just going to be destroyed at some further point in time, then marking it as being destroyed isn’t necessarily what you want to do

manic rune
#

do i need to do some extra stuff to actually get rarity working??

red flower
zealous glen
#

But with the destroy_card context, those are simultaneous

#

There’s not anything that would care

#

So it doesn’t impact anything except some niche mod interaction, maybe

#

I’m just teaching other people to do it since it’s not vanilla

wintry solar
#

If I understand how this works correctly, it needs to be auto added to anything being removed in destroy_card so that context.after doesn’t crash

red flower
wintry solar
#

There’s no need for it to have to be applied manually to olaying cards

#

It should just be handled internally

zealous glen
#

It does need to be handled manually in other timings

zealous glen
#

I think aure changed the logic

wintry solar
#

I wouldn’t recommend anyone trying to destroy playing cards in other timings

zealous glen
#

I think cards in the standard calculation pipeline are only tested at the start

manic rune
#

wait

zealous glen
#

I think that change was made to simplify debuff manipulation

manic rune
#

is this a class, not rarity?

zealous glen
#

So context.after might not care either way

wintry solar
manic rune
#

:3

#

damn

zealous glen
#

Because by then it’s already too late

zealous glen
wintry solar
#

Yes, I thought it was a property unique to joker type cards

zealous glen
#

So in vanilla yes

#

As I had said

manic rune
#

HMM

#

how do i change the badge's text in localization file

zealous glen
#

And thunk manually checks if Jokers are getting sliced to avoid calculating them

hard needle
zealous glen
#

I just automated the entire verification process except marking cards as getting sliced

#

Because that’s not a verification step

#

Also as I said I’m pretty sure it has since been fixed and/or reworked to some degree

wintry solar
#

Yes, that’s why I thought it wasn’t for playing cards, as playing card destruction is handled automatically, if getting slice is supposed to be used, it should automatically be added

manic rune
#

i am confused

hard needle
#
for _, held_card in ipairs(G.hand.cards) do
                if held_card:is_suit(card.ability.extra) then
                    G.E_MANAGER:add_event(Event({
                        func = function()
                            held_card:start_dissolve()
                            
                            return true
                        end
                    }))
                    G.E_MANAGER:add_event(Event({
                        trigger='after',
                        delay=0.7,
                        func = function()
                            held_card:remove()
                            card.removed = true
                            return true
                        end
                    }))
                end
            end

i don't think this is properly removing the cards from G.playing_cards, anyone know why (the context is context.selling_self)

manic rune
#

i have no clue how to even change this badge, hm

hard needle
#

oh sh wait

#

wait nevermind :sosb

zealous glen
#

See Consumable Types in the wiki

manic rune
#

oh wait

#

wait wait

#

do i use SMODS.ObjectType?

lavish lake
next elk
#

ok, trying to do mods to balatro made me realize that lua is totslly not ny thing and i should stick with rust

manic rune
#

i want to go commit -naneinf 🥀
-# idk how to get this going, theres very little documented about this

next elk
spring lantern
#

any of yall know how to fix this white outline issue when using pixel smoothing

manic rune
#

that seems to be a bug a lot of mods experience

spring lantern
#

soon as i posted that i remember someone mentioned it possibly being an issue with missing color info

#

so if i just have a bg layer with a flat color and give it 0% transparency it apparently fixes it but i might be misremembering

unborn bay
#

yeah exactly that

#

or don't export with aseprite

spring lantern
#

i'm exporting with photoshop lul

wintry solar
#

It’s to do with how you scale iirc

spring lantern
#

hm

#

i usually just go into image size and double it when exporting the x2 variant and then undo

manic rune
#

can you use loc_txt for SMODS.ObjectType, or is that only for ConsumableType?

wintry solar
#

It should have loc txt

#

What’s the issue? The badge?

manic rune
#

you guessed it :3

wintry solar
#

label = text

manic rune
#

i

#

its not name??

wintry solar
#

Not for the badge

spring lantern
wintry solar
#

Or maybe it is

#

I don’t remember 🤣

manic rune
wintry solar
#

My consumable types seem to use name yeah

#

I know it’s label on things like seals

manic rune
#

mmm i see

#

also, just to be sure - my loc_txt should look something like this, right?

#

because its crashing rn :3

wintry solar
#

Try putting label on the object itself

manic rune
#

wait

#

wrong place, hold on

#

do i put that in here, or in localization?

wintry solar
manic rune
#

thanks, that should help a lot considering im just blindly doing things and praying that it works now

wintry solar
#

Flowwey also wrote the object types iirc so it’s probably the best place to look

next timber
#

how do i check for if a specific hand type is discarded?

manic rune
#

-# thats not very useful if i have to be honest 🥀

faint yacht
spring lantern
#

okay so it's exporting wrong? this is meant to be 852 pixels

#

how the fuck does this happen

#

the x2 dimensions should be 852x1330 and that's what i'm inputting here

#

(i have no clue why my photoshop is in spanish

#

okay so the dimensions are fine now but that didn't fix it lmao

upper juniper
#

doing custom textures on paint rn

bold sleet
#

Hello. I have come here (again) to ask (again) for help on making a custom UI appear when pressing a certain key. Can anyone help me with this? I have read the SMODS page about UI structure and I still haven't been able to figure out how to work it out.

upper juniper
#

appart for making textures i have 0 clue

#

my codding is rusty

bold sleet
hard needle
#

how do you check if the player is in a blind

crisp coral
#

G.GAME.blind.in_blind

bold sleet
#

You press a certain key, then buttons appear as some kind of overlay, that's the idea.

zealous glen
#

Buttons where

bold sleet
#

..on screen? I don't know where else they would appear.

next elk
#

how difficult would it be to recode steamodded to rust

manic rune
#

good luck

bold sleet
#

You press a key, then a menu, like idk, the collection, settings, etc appears.

next elk
zealous glen
bold sleet
#

On menus.

#

Not attatched to anything.

zealous glen
bold sleet
#

...maybe also that later.

bold sleet
#

I got the keybind part down.

#

Menu function is what I don't know how to.

zealous glen
#

There are examples in the game

bold sleet
#

-# that doesn't help me

next elk
#

okay nah but rly lua is so not my thing

upper juniper
#

ms paint my beloved

next elk
#

maybe even 2

bold sleet
#

so help maybe?

brisk rose
#

lol

next elk
brisk rose
#

cause the game runs on uncompiled lua code

cyan lagoon
brisk rose
#

it's compiled at runtime

next elk
#

2.5 dollars is what i can do

cyan lagoon
#

first round joker mod

#

maybe the code there can help

bold sleet
#

Already did that.

brisk rose
cyan lagoon
bold sleet
#

Already have done jokers, enhancements, consumeables

#

I am not that new to this.

#

I just don't know how to make a menu appear when pressing a given key.

brisk rose
#

it's the runtime injector we use

cyan lagoon
brisk rose
#

and is written in rust

red flower
next elk
#

aughhh

red flower
bold sleet
#

Just a menu UI whatever that appears upon pressing a certain key.

red flower
#

i have one in my mod

bold sleet
#

I got the keybind ready, not so much the function that makes the menu do appear.

daring fern
#

Why is the changing sprite slightly delayed and is there a way to make it not delayed?:

brisk rose
brisk rose
daring fern
#

In a joker's calculate function.

cyan lagoon
#

how do i create jokers with stickers?

brisk rose
#

you'd have to put it in update an live with it running every frame

#

if you wanted instant

gaunt thistle
#

transpile Lua to rust, job done

daring fern
daring fern
brisk rose
#

I imagine if something is valid for literally every context, it's always valid, but there ae probably outliers i'm missing

cyan lagoon
daring fern
cyan lagoon
#

that's exactly how i did it

runic pecan
#

Would you say "Card with highest rank in scoring hand" or "Highest ranked card in scoring hand"?

cyan lagoon
carmine roost
runic pecan
carmine roost
daring fern
# cyan lagoon

What if you did ```lua
local card = SMODS.add_card({set = "Joker"})
card.ability["modprefix_key"] = true

cyan lagoon
#

gimme a sec

#

there we go

#

thanks

#

but it show an eternal sticker and ERROR where the sticker name should be

#

why does this cause a crash?

unborn bay
#

did you mean card.children.center

#

lmai

cyan lagoon
#

alright it works now but play the 'remove' sound like a billion times

runic pecan
#

May I get some naming suggestions?

brisk rose
# cyan lagoon

imaginine naming yourself after thunk's shtty way of finding objects

#

also, there's a new full release of the smods beta

#

unrelated to the crash

cyan lagoon
#

good to know

next timber
#

is it possible to check what the hand type of a discarded hand is? like what would have been showing as the hand type just before they pressed discard

cyan lagoon
#

you may or may not need a 'discard cardarea' optional feature

cyan lagoon
#

aight, i tried

next timber
#

oh yeah i forgot about burnt

#

yeah

brisk rose
# next timber oh yeah i forgot about burnt
    key = "burnt",
    unlocked = false,
    blueprint_compat = true,
    rarity = 3,
    cost = 8,
    pos = { x = 3, y = 7 },
    calculate = function(self, card, context)
        if context.pre_discard and G.GAME.current_round.discards_used <= 0 and not context.hook then
            local text, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
            return {
                level_up = true,
                level_up_hand = text -- TODO: this crashes, seems to be an SMODS bug?
            }
        end
    end,
    locked_loc_vars = function(self, info_queue, card)
        return { vars = { 50, G.PROFILES[G.SETTINGS.profile].career_stats.c_cards_sold } }
    end,
    check_for_unlock = function(self, args) -- equivalent to `unlock_condition = { type = 'c_cards_sold', extra = 50 }`
        if args.type == 'career_stat' and args.statname == 'c_cards_sold' then
            return G.PROFILES[G.SETTINGS.profile].career_stats[args.statname] >= 50
        end
        return false
    end```
#

Here's burnt from vanilliaremade

#

Though I guess it crashes, lol

red flower
#

^ it doesnt anymore i just removed the comment

brisk rose
#

Oh yeah I read looking at that commit

#

You sent before

#

Forgot to go to main

brisk rose
# next timber oh yeah i forgot about burnt
    key = "burnt",
    unlocked = false,
    blueprint_compat = true,
    rarity = 3,
    cost = 8,
    pos = { x = 3, y = 7 },
    calculate = function(self, card, context)
        if context.pre_discard and G.GAME.current_round.discards_used <= 0 and not context.hook then
            local text, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
            return {
                level_up = true,
                level_up_hand = text
            }
        end
    end,
    locked_loc_vars = function(self, info_queue, card)
        return { vars = { 50, G.PROFILES[G.SETTINGS.profile].career_stats.c_cards_sold } }
    end,
    check_for_unlock = function(self, args) -- equivalent to `unlock_condition = { type = 'c_cards_sold', extra = 50 }`
        if args.type == 'career_stat' and args.statname == 'c_cards_sold' then
            return G.PROFILES[G.SETTINGS.profile].career_stats[args.statname] >= 50
        end
        return false
    end
}``` 
Here's the current one
#

Idk if any changes were made but just in case

runic pecan
#

Is this substitution correct?

red flower
#

it will be called for objects other than jokers but it seems to makes sense so yeah

brisk rose
runic pecan
runic pecan
brisk rose
brisk rose
#

but i may be mistaken

runic pecan
brisk rose
#

I'm not even sure you need a hook?

#

Well you might, just to get the shop items

#

before they load

runic pecan
brisk rose
#

oh i seeeee

#

it's not a displayed price

#

it's a gamble thing

runic pecan
#

Yup, emphasis on the word "Gamble" in the joker's name "Medical Fee Gamble".

brisk rose
#

well.... can't you just put the if context.buying_vouucher check in your joker's calculate?

#

or the update?

#

I'm pretty sure there is a context for buying an item from the shop even if it isn't called that

#

but maybe not

runic pecan
brisk rose
runic pecan
red flower
#

buying_card doesnt count vouchers?

brisk rose
pearl jacinth
#

how do i get the current played poker hand

runic pecan
red flower
#

makes sense

red flower
pearl jacinth
#

yes

red flower
#

context.scoring_name

runic pecan
brisk rose
#

but I'd try to do something stupid like making a context based on detecting if it's ran, lol. pretty sure only vouchers are reedeemed, but also like... also pretty sure that's the same thing

#

I just dislike any unessacary use of hooks and patches because I'm traumatised from running 70 mods at once

#

and seeing dozens of patches fail whenever I load my game

#

maybe hundreds

next timber
#

is it possible to have a joker make a hand go entirely unscored? like no score from hand type, no joker triggers, enhancements, absolutely nada

brisk rose
#

but then there's the crashes when they don't

brisk rose
#

or use the "this hand won't score" code bosses use somehow

#

but it'd be more fun to see it count and then... nope

#

you should even use the Nope! loalization

next timber
#

lol

#

but nah that wouldnt fit quite right cause it is actually charging up the joker with the non-scoring hand

red flower
#

i think i saw some mod do it

#

you can just try remove_from_hand and see

wintry solar
#

You can make every card not score yeah

wintry solar
#

But that would still have joker effects and the hand type scoring

hard flume
#

How do I destroy cards outside of calculate? I'm trying to get a card to destroy itself in a hook I'm doing, so it doesn't appear in two areas at once

brisk rose
next elk
#

damn, i finally figured out what i can do with rust in balatro

next elk
brisk rose
brisk rose
next elk
wintry solar
#

Oh yeah you could modify the final score easily enough

brisk rose
#

or os that only there if a blind uses it?

red flower
brisk rose
brisk rose
buoyant merlin
#

Bumpppppp

hard flume
#

oops didnt mean all caps

hushed field
hard flume
#

huh, waitr. it isnt an issue with my mod

buoyant merlin
native zinc
#

why .

frigid blaze
#

Can you tell me where to see the full list of functions such as add_to_deck, calculate and so on?

native zinc
cyan lagoon
native zinc
#

they said add_to_deck and calculate

cyan lagoon
#

there's some usefull stuff too

frigid blaze
native zinc
#

smods docs incomplete

native zinc
#

they're in here though

frigid blaze
#

Okay, but what are the other options in a case like this

native zinc
#

??

#

they're in the API methods

brisk rose
#

you put functions in them

native zinc
#

they're not exactly callable

brisk rose
#

no, but they're called as functions when they're meant to be, because they're functions, just not reusable ones

#

but i'm being pednatic ig

tall wharf
#

this is correct right

#

because apparently it is crashing with some other mods i just wanna make sure it's not my fault

limber blaze
#

that seems correct

quartz ravine
#

TFW your kids are playing games on your Steam account so you can't test your balatro mod

faint yacht
#

🐴 ...did you try launching it directly and not via Steam?

long sun
#

hiya! this Joker doesn't do anything, and am debugging that

quartz ravine
long sun
#

it looks like it's an issue with next(get_lowest(context.scoring_hand)) == context.other_card:get_id() (i removed :get_id, since it was complaining that i was calling that on a number value)

#

it's meant to retrigger the lowest card, if the played hand is a Junk

#

the Junk detection works, at least ^^"

quartz ravine
#

I wonder if there is an iconic Ghost Card from YuGioh I could integrate into my mod. I have a Ghost Rare edition, a nod to Yugioh that mtues the palette of the card and tries to make it look shiney like those cards

But there's nothing in my joker set to reward this edition. I really like jokers who synergize with card enhancements

quartz ravine
long sun
#

oh, i only wanna retrigger the lowest card, that's the bit that isn't working

#

otherwise, with Splash, every card would be retriggered 3 times ;)

rare obsidian
#

does any1 know how to write shaders?

quartz ravine
#

Hi again Seth

rare obsidian
#

hi fox

faint yacht
long sun
#

oop, nvm, i got it to work ^^

#

if context.repetition and context.scoring_name == "phanta_junk" and get_lowest(context.scoring_hand)[1][1]:get_id() == context.other_card:get_id() and context.cardarea == G.play then

#

turns out, next() wasn't correct here

#

iirc it returns the key, not the value

#

oh it returns both

#

right

#

well, what works, works :)

flat sorrel
#

it's negligible but you should put trivial conditions like the cardarea check before more complex conditions like the check starting with get_lowest, so it can fail faster

wooden nexus
#

Was trying to port the marble joker effect to calculate

long sun
#

i'm pretty sure i've written this incorrectly, what should it be?
context.other_card.ability.config.h_x_mult

#

i'm trying to get a value from a Ghost Card's config

cyan lagoon
#

question how do i pass a variable into G.P.CENTERS?

wooden nexus
shut crater
wooden nexus
#

oh thanks

#

I forgot i needed to change that when porting from Source to SMODS

#

Should the context be "if context.setting_blind and not card.getting_sliced then"

#

or is that fine for self?

red flower
#

checking for* card.getting_sliced is not needed in calculate

shut crater
#

You should (basically) never use self in calculate

shut crater
long sun
#

okay, putting Will-o'-the-wisp aside for now, this Joker doesn't do anything either

#

it should retrigger all unscored cards

#

but, it's not

red flower
#

and other jokers dont try to calculate on it

long sun
#

can you see why? my SMODS is on the latest version

red flower
long sun
#

i think this was working before, though

#

unsure

wooden nexus
#

I mean it currently works

red flower
#

just if context.setting_blind then

#

smods checks for it automatically

wooden nexus
#

ok

#

Well now i can easily recreate marble joker if i wanted to

split saddle
#

how does Wraith set your money to zero?

wooden nexus
#

search for the code with notepad++, that's how i do it

split saddle
#

i mean, in the context of smods code of course

#

i think the right question would be, how to set money to zero using smods

shut crater
#

I don't think there's a different function for smods

#

I think it's just ease_dollars

#

But also I've never done a money effect so I could be totally wrong

split saddle
#

ok then. how do you use ease_dollars?

split saddle
shut crater
tall wharf
split saddle
shut crater
#

Good thing I offered two suggestions :)

#

Is this a joker you're trying to implement?

split saddle
#

yeah

smoky seal
#

What's the best way of messing with mods without affecting my normal save file?

#

I am developing a mod but don't really wanna accidentally ruin progression

split saddle
#

i'm making custom jokers from reddit as practice

#

one could say tracing for practice xdd

shut crater
split saddle
#

funnily enough i'm already on those pages

shut crater
#

So you could try something like

  dollars = -G.GAME.dollars
}```
#

Idk if that would work

red flower
#

it should

shut crater
#

But could be worth a shot

gusty iron
#

i know ive probably missed more, so if theres anything that increases your hands/discards, please tell me :)

analog spoke
#

how would I make this effect? (ignore awful loc, lmaoo hehe)

split saddle
#

it was crashing because of a typo i had earlier, but now it works

#

thanks guys :D

gusty iron
shut crater
shut crater
gusty iron
#

anything else i need to restrict?

shut crater
gusty iron
#

you could also look at the diet cola joker

#

found it

#
G.E_MANAGER:add_event(Event({
                    func = (function()
                        add_tag(Tag('tag_double'))
                        play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
                        play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
                       return true
                   end)
red flower
#

it's like add_tag(Tag(key))

#

yeah

analog spoke
#

I've been looking around, and I think I've got the main part down, all I'm missing is the chance and the destruction parts

gusty iron
#

OH BOY I LOVE SUFFERAGE!

analog spoke
analog spoke
#

thank you, I'll look into this

shut crater
gusty iron
#

i think this challenge might be possible

shut crater
#

(suffrage joke)

gusty iron
#

i literally could not beat ante 1 what the hell 😭

shut crater
shut crater
#

I feel like this challenge is made or lost in the first ante depending on your shop luck

shut crater
#

My professional opinion as someone who has not played the challenge

analog spoke
#

there's so many red lines you'd think there was a fire 😭

split saddle
#

using dollars = ... gives a text prompt, is there any way to disable it?
is there a table with all the G.C colors?
whyyyy do you have to spell colour?!?!?!

analog spoke
shut crater
analog spoke
#

ahh okey

shut crater
#

If you want the tag thing to happen first you can do that part first just don't do it in a return

gusty iron
#

made a voucher template, if anything looks wrong, please do tell.

split saddle
shut crater
#

You'd probably have to do it without the return statement then

gusty iron
#

how would i make it so that things from booster packs get added to your consumable slot, and not immediately used?

shut crater
#

Could be fun though

dull sage
#

I'm at my wits end here. I'm needing to apply seals to cards to test them, and I have this function to assign the seal to all cards in my hand (triggered by another function via a keypress). But I'm always getting the "attempt to index a nil value" error when triggering the function. What am I doing wrong?

shut crater
#

You can apply seals to cards using DebugPlus

#

If you're only doing this for testing purposes

#

There's also a good chance that everything about your function works perfectly fine and you're just passing in an invalid seal key

spring socket
#

where do i pull the current round from?

smoky seal
#

Can I get some UI help? I wanna add some text above the deck overview area. How's best to do this. I assume I can reference the parent in the node but can't find how to do it. I'm trying to reference the game dump to see how it's done natively but I can't seem to make sense of it

dull sage
split saddle
#

how does create_playing_card() work? what are its parameters?

#

a link to a ref page would help

worthy stirrup
#

how do i make it so a consumable cant spawn in a shop until a voucher is redeemed?

worthy stirrup
#

should the in_pool in the consumable or the voucher?

dull sage
#

Well I've found out how to set the seal of my card but keybinds aren't working

shut crater
#

Consumable, and then the voucher sets some global variable to true

worthy stirrup
#

okay, got it

shut crater
worthy stirrup
#

or does it do that by it self

dull sage
#

Ah I figured it out, my keybind function was stealing all the keybind listeners. Now I've got it working

shut crater
worthy stirrup
#

got it

shut crater
#

That'll also ensure it gets saved to the run

worthy stirrup
#

but now, i domt know how to store it in game lol

shut crater
#

Literally G.GAME.variablename = true

worthy stirrup
#

oh

#

i didnt think it would be that simple

shut crater
#

Yeah lol

#

Also I think best practice is to include your mod prefix in the variable name when doing this

worthy stirrup
#

good idea

shut crater
#

But not technically required

analog spoke
#

how do you do the loc for chance? I'm looking at the gros michel loc and made something but it has a few Nil values for some reason, even tho I think I matched what gros michel was doing

#

only just realized I coded the effect wrong lmao

worthy stirrup
#

Does anyone know why this still allows for the objects of power to spawn in the shop?

maiden phoenix
#
  1. I doubt G.GAME.OOPspawn will work if you init it here
  2. in_pool takes a boolean as a return value, not a table
#

(also you can just do return G.GAME and G.GAME.OOPSpawn)

worthy stirrup
#

wait, where should i init OOPspawn

maiden phoenix
#

You're already doing it in your voucher I just saw, it's fine there

worthy stirrup
#

oh

#

weird effect, im now only getting Jimbo in the shop

maiden phoenix
#

Tho tbh it wouldn't be needed, you can just check if your voucher was redeemed using G.GAME.used_vouchers.v_modprefix_voucherkey

#

No need for an extra G.GAME var 👍

worthy stirrup
#

oh, that sounds handy

split saddle
#

what do i put into poll_seal(options = ) so that it only gives gold seals?

red flower
#

you don't, poll is for when you want a random one

#

just use "Gold"

maiden phoenix
#

check the func set_seal

split saddle
#

set_seal('gold')?

maiden phoenix
#

*Gold

#

It's case-sensitive

split saddle
maiden phoenix
#

Also you need the card at the beginning

worthy stirrup
#

i accidently coded "Oops! All Jimbo!"

maiden phoenix
#

Card:set_seal('Gold')

split saddle
maiden phoenix
#

Yea but it's better to specify so you don't just do set_seal 😅

split saddle
#

what about enhancements? what is the function to use?

worthy stirrup
#

should i be doing this?

  in_pool = function(self, card)
    if G.GAME.used_vouchers.v_CTRL_Hotline then
      return true
    end
  end
}
split saddle
#

also is there a page with the reference for all available functions?

faint yacht
maiden phoenix
maiden phoenix
#

Should have most of them

red flower
#

if you use vscode you can see all the functions

#

on the side

worthy stirrup
#

okay, ive got the cards to not spawn, but they are just now spawning jimbos, should i just lower spawn rate and forget about it or can i the jimbo overpopulation

split saddle
#

alright

maiden phoenix
worthy stirrup
#

im not running into any issues

#

ill try it tho

analog spoke
#

is there a way to do a "message" without using a return? I know that "return" kinda stops things in their tracks

maiden phoenix
#

Check the func card_eval_status_text

red flower
#

SMODS.calculate_effect({message = "message"}, card)

keen tiger
#

what could be causing smods to just not find any mods despite them being in the same Mods folder as smods?

#

smods runs and then just cant find anything

maiden phoenix
keen tiger
#

okay for some reason puting the mods inside smods for some reason will cause it to be detected?? huh?

next timber
#

im confused, this is only printing the 1 joker that has the ability.extra.exploded_trigger set to true, but every joker with a context.after is triggering? (the code here stops a hand from scoring if you have the exploded joker and play high card, then does its own stuff)

runic pecan
#

I need naming suggestions for a voucher.

#

Wait, nvm

analog spoke
#

my destruction effect isn't working tho, lol, something isn't working right, I assume cause, once again, I grabbed a return effect and tried to turn it into an effect without return

#

I grabbed this from gros michel at some point lol

keen tiger
#

<@&1133519078540185692> @snow summit is a gift card scammer

keen tiger
#

i have no idea whats going wrong, smods is just being busted

#

how can i force smods to read a mod at a particular location?

#

oh wait its because im using a symlink so i dont have to duplicate my mod twice over desolation

shut crater
#

so it not existing and it being false are essentially the same

shut crater
# worthy stirrup

also you're returning true or false inside a table, but I think you're supposed to not do that

analog spoke
#

I know I'm probably just missing something incredibly obvious here, but that tends to be my major flaw lmao, even if I DO know how something is supposed to be done, my brain just skims past things sometimes lol

shut crater
#

you're using self

#

never use self

analog spoke
#

didn't know about this, lol, grabbed this event straight from gros michel, as I wasn't sure how to make a destruction effect work

analog spoke
shut crater
#

o

#

apologies for not using my eyes

analog spoke
red flower
#

oh oops

analog spoke
#

line 962

shut crater
#

yeah I see it, it probably has something to do with the fact that this is in an event and yours is not

#

but also probably just doing card:remove() is sufficient

red flower
#

not it's because im dumb

shut crater
#

rip

red flower
#

i needed to test how much of that event was necessary anyway

hybrid shadow
#

bump

shut crater
#

once upon a time I went down to rabbithole of cardareas and I think card:remove removes the card from the cardarea as well

shell timber
shell timber
#

you have rarity X. all X jokers give X2 mult or something?

hybrid shadow
shell timber
#

i don't think there's a way to have something run based on a joker's rarity? maybe you could have a separate hook that checks at the end of round and does that all manually

split cairn
#

how can i make a consumable change a playing card's suit?

quartz ravine
#

Hi folks, anyone have experience with DrawSteps? @daring fern gave me a sample but I really am struggling

I have a deck called goldDeck which is selectable as b_Fox_goldDeck, I'm trying to apply the Foil shader to it.


    SMODS.DrawStep({
        key = "editiondecks",
        order = 5,
        func = function(self)
            if self.area and self.area.config and self.area.config.type == "deck" then
                -- following here is a horrendous mod compatability line
                local currentBack = not self.params.galdur_selector
                        and ((Galdur and Galdur.config.use and type(self.params.galdur_back) == "table" and self.params.galdur_back) or 
                            type(self.params.viewed_back) == "table" and self.params.viewed_back 
                            or (self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back))
                    or Back(G.P_CENTERS["b_Fox_goldDeck"])
                if currentBack.effect.center.key == 'b_modprefix_key' then
                    self.children.back:draw_shader(
                        'foil',
                        nil,
                        self.ARGS.send_to_shader,
                        true
                    )
                end
            end
        end
    })
shut crater
hybrid shadow
shell timber
#

yeah

hybrid shadow
quartz ravine
shut crater
#

You could just put

local destroy_rarity_check = function(card, context)
  do the stuff
end

anywhere in your main mod file

hybrid shadow
#

ah, ok

urban wasp
shut crater
#

(I assume you will need both card and context for your function to do what it needs to do, which is why I put them as parameters)

hybrid shadow
split cairn
quartz ravine
upper juniper
#

chat, i think i got a good one gor yall. where are used the 1x an 2x textures, bc i dont think i really need to make both

red flower
shut crater
peak void
red flower
#

else x1

peak void
#

yeah all cards may or may not need to use them

red flower
peak void
#

there is definitely a better way to do that

#

but thats how balatro works so you have to deal with it

upper juniper
#

ok, so for example rn im editing the hd textures dirrectly, and there is a 1x and 2x. i did some retexturiing and did both, but i fr dont want to do twice all the jonkers

red flower
#

just resize them

peak void
#

you kinda just have to

red flower
#

2x is literally double 1x

peak void
#

its really easy just make the image youre editing 200% bigger

#

and save it there

upper juniper
#

yh but the size change looks messy

#

a lot

shut crater
#

Shouldn't if you're using exact values

#

What image editing program are you using

peak void
#

turn off anti aliasing

hybrid shadow
#

also if its pixel art then resizing to 2x on Nearest Neighbor should work perfectly fine

upper juniper
#

for example i did a "lets go gambling" wheel, and i did a size down it was ass) so i had to redo it (im using paint Yes_Smile )

peak void
#

youre using paint?

upper juniper
#

yh

peak void
#

ms paint resizing works perfectly fine

hybrid shadow
#

wait are you starting with the 2x

upper juniper
#

yeh but sometimes if my changes are too thin it fucks up

fair frost
#

Hello! I checked out the Balatro modding start guide, it was incredibly helpful
Sorry if this info is obvious, but since modding works by injection, is there a way to see changes you make to code without having to restart the whole app? Or do I have to reload the mod for any source code changes to show up?

peak void
#

oh wow no it does not

hybrid shadow
peak void
#

it doesnt matter

upper juniper
#

ah ok

#

thx chat

peak void
#

if you start with 1x, it still does anti aliasing

hybrid shadow
#

again resizing using Nearest Neigbor with pixel art shouldnt do that

red flower
peak void
#

ms paint doesnt use nearest neighbor unfortunately

upper juniper
#

so my question still stands, do i only do 1x for when playing ?

peak void
#

theres free art software you can use. i recommend firealpaca

peak void
shut crater
peak void
upper juniper
#

😠

fair frost
shut crater
# upper juniper 😠

balatro modding has existed for a very long time, if there was a way around it, someone probably would've figured it out by now

hybrid shadow
#

i use krita for all my pixel art lol therearevarious

peak void
#

debugplus is also pretty critical for any testing

peak void
#

im sure i could write some custom code for aseprite to save it in 1x and then again in 2x at 200% scale

shut crater
#

true, I saw that someone wrote a script for it. But it takes me about 7 seconds to do in aseprite so it wasn't worth the effort for me

peak void
#

but yeah the time it takes for a human to tab into two folders is so small that its basically a nothing process

#

use a different program and itll make it way easier @upper juniper

upper juniper
peak void
#

i mean thatd work

upper juniper
peak void
#

but it would like. make some textures look different dependent on the context

upper juniper
#

o wow big typo mb

peak void
upper juniper
#

😦 ig ill have to test them separately

analog spoke
#

I have a more complex effect idea here and I'm not sure how I'd go about doing all of it, lol, hehe

peak void
#

i have a question, im sure its been asked here before but i cant seem to find it. how do i add the little tab for cards like lucky cat and marble joker have?

upper juniper
#

ik what ill do : do a card full red in 1x and make it blue in 2x

peak void
#

or more ideally where in the vanilla code is this done? is it in cards cause i dont see it there

red flower
#

it's in generate_ui

peak void
#

oh ok

#

thank you

brazen tusk
smoky seal
#

If I use play_sound, I want to be able to cancel it at some point with a fade out transition, is that possible

hybrid shadow
# shut crater info_queue

can info_queue be used for general descriptions (like if i wanted to have a description for a certain rarity of cards)

hybrid shadow
#

thanks

primal robin
#

Oh no...

brazen tusk
#

amazing

primal robin
#

Looks like a good texturepack for Malverk

errant karma
#

just curious, but is it possible to make the buttons and most ui elements round instead of having pixellated corners?

shut crater
zealous glen
red flower
brazen tusk
errant karma
red flower
#

everything is possible with the magic of computers

brazen tusk
#

i mean if definitely possible yeah

zealous glen
errant karma
#

just asking because i am working on a wii-themed texture pack and thought round buttons would look better with the custom font i chose lol

zealous glen
red flower
#

for 5 dollars

quartz ravine
#

Yes, I've done it!

zealous glen
dull sage
#

Bro why does Lua not have a built in split function

red flower
#

damn

dull sage
#

-100 social credit

peak void
quartz ravine
#

I have finally been able to apply a shader to the Deck.Back object!!!

brazen tusk
red flower