#💻・modding-dev

1 messages · Page 451 of 1

hidden sable
normal crest
#

not unpack

#

what is the goal here, in the code you sent you can just put all your code inside one if instead of making two separate ones

hidden sable
normal crest
#

what is textwall

#

how did you define it

hidden sable
river apex
normal crest
hidden sable
#

dont use 2 checks of the same thing in a context

wintry solar
#

I wonder how many times srock will say that tonight

hidden sable
#

i keep making the same mistake 😭

river apex
hidden sable
#

good thing i can just wrap this in a module when im done so i cant make it a mistake

azure valley
#

Dumb question, where are editions for played cards evaluated in SMOD?

hidden sable
#

why does it appear here

brittle tide
#

is there a way to double the cash you earn at the end of a round?

hidden sable
#

how do i change the default color

ivory coral
#

how come my custom context here doesnt work? ive got this hook for destroying a joker and -1 and 0 print but 1 doesnt and i dont know why

local _card_remove = Card.remove
function Card.remove(self)
    print('-1')
    if self.added_to_deck and self.ability.set == 'Joker' and not G.CONTROLLER.locks.selling_card then
        print('0')
        SMODS.calculate_context({
            osquo_ext = {
                destroy_joker = true,
                destroyed_joker = self
            }
        })
    end
    return _card_remove(self)
end
    calculate = function(self,card,context)
        if context.osquo_ext then
            print('1')
            if context.osquo_ext.destroy_joker then
                print('2')
                if context.osquo_ext.destroyed_joker == card then
                    print('3')
hidden sable
#

i know its weird but is it possible to move a joker over to the consumable hand

hidden sable
#

.................

#

.....................................

#

.........................................................................

#

how

#

mr poly bridge i hope you encounter the_plant

daring fern
hidden sable
#

how can i get the current selected joker

daring fern
valid leaf
#

How do I change a joker effect and description if another specific joker is held?

normal crest
#

you can check if a specific joker is held by doing if next(SMODS.find_card('j_prefix_key'))

hidden sable
#

it worked

normal crest
hidden sable
#

is it possible to change the moved jokers negative to a consumable negative

daring fern
hidden sable
hidden sable
#

also ill have to patch for situations like this

#

i think the blueprint patch is the easiest rn

#

just check if hes in jokers or consumables

#

and do his behavior in that area instead

daring fern
hidden sable
#

in that for loop?

daring fern
hard mica
#

does anyone know how i can fix this? i added a event thingy but now it doesnt show at all after the round ends

hidden sable
#

whats the position in patching to replace

#

is it at or replace

red flower
#

at

hidden sable
#

whats this mean again

normal crest
#

it will put your payload at the same indentation as the target line

azure valley
#

it will make your dump easier to read when you're debugging

#

ok, I have been up and down the SMOD source and Balatro's source, and I can't find where editions of the cards are used in calculating the card's effect. Can someone signpost me? I need to hook into it

drowsy heath
#

So what would I do if I wanted a card to have a 50/50 chance to do 2 things

#

1 makes ×mult go up and 1 makes ×mult go down

#

Its hurting my brain

azure valley
#

use pseudorandom_element, it's a vanilla balatro function

#

you'll want to provide a seed for reproducibility

drowsy heath
#

How do I use that

#

Which joker uses it so I can check the code

#

I can just base it off that

azure valley
#

There should also be bananas in there that use it

drowsy heath
#

Okok thank you

ivory coral
#

is there a way to get a localized name for an object (poker hand in my current case) from a mod
ive tried using localize{} but that doesnt seem to work for mods that define their loc_txt in the poker hand directly, is there a way to get it from there?

normal crest
#

the stuff in loc_txt is put into the localization table tho

#

so you should be able to get it with localize

#

for a hand it should be localize('key', 'poker_hands')

drowsy heath
#

Wait so how do I get that to produce the thing I want tho

ivory coral
drowsy heath
#

That is just picking a random consumable I want it to pick either option 1 or 2 of actions on thr joker either positive × or negative ×

normal crest
#

cus that's not how you do it

ivory coral
#

oh

normal crest
dire marlin
#

can someone tell me how to make calculate context for this one?

ivory coral
#

i thought theyd be the same

normal crest
normal crest
drowsy heath
ivory coral
normal crest
#

not {}, use ()

ivory coral
#

oooh

#

mb

azure valley
hidden sable
ivory coral
drowsy heath
#

How do I give define action 1 and 3 tho

#

1 and 2*

normal crest
#
if pseudorandom("stuff", 1, 2) == 1 then
  -- stuff for 1
else
  -- stuff for 2
end
daring fern
#

Why do the enhancements trigger multiple times?

hidden sable
#

like a card from a tarot pack or spectral pack

#

or just any card in shop

daring fern
daring fern
drowsy heath
#

On 'then' and 'else'

normal crest
#

then you put it in the wrong place

#

send a screenshot of it

drowsy heath
#

I dont have discord on the device but ill take a photo

#

Idk i did the same thing he said

normal crest
#

yes you did put it in the wrong place, you removed the function entirely

drowsy heath
#

Wait what

normal crest
#
calculate = function(self, card, context)
  -- stuff here
end
umbral zodiac
#

if i make an atlas larger than 71x95 and use it for a consumable does it get downscaled to normal size or is it just large

dire marlin
drowsy heath
#

Oh yeah forgot to add that

daring fern
umbral zodiac
#

those sound contradictory

#

will it be larger than a 71x95 card or not

hidden sable
#

wrong reply

#

mb

hidden sable
daring fern
hidden sable
#

you will have to downscale manually

umbral zodiac
#

oh good

#

i dont want to downscale them i want them to be larger than normal cards intentionally

hidden sable
#

like wee joker

hidden sable
#

look at how wee joker does it

umbral zodiac
#

well the sprites are already larger than 71x95

normal crest
ivory coral
umbral zodiac
drowsy heath
#

Now the function is red

azure valley
ivory coral
normal crest
rapid stag
#

how do i get to a consumable's name via G.P_CENTERS.c_<my consumable key>?

normal crest
#

once you've done that I recommend ctrl + shift + i to let vscode format your code

normal crest
drowsy heath
#

Nevermind fixed it

mild fractal
#

how would i check for an unscored card?

hidden sable
formal parrot
hidden sable
#

i might be a lil stupid chat

formal parrot
#

What do you want to do exactly

azure valley
daring fern
formal parrot
#

You get a cookie 🍪

mild fractal
#

i was going crazy trying to find anything similar in vanilla lmao

drowsy heath
#

Okay well it crashes when it wants to be used

azure valley
#

Can someone explain to me what an 'individual' context is supposed to me?

hidden sable
daring fern
azure valley
#

ok, so this is stuff that comes from the cards themselves

#

like chips, edition effects, red seal?

#

gold seal?

daring fern
azure valley
#

ok, then what is being referenced here?

#

nothing used by vanilla? just hooks for mods?

hidden sable
daring fern
hidden sable
#

its close enough

#

you could still check for it

formal parrot
#

Doesn’t context.individual references to every card and joker individually but you’ll need to limit it by cardarea =G.play so its only played cards ?

daring fern
drowsy heath
#

I need help with this someone tell me what's wrong here

formal parrot
#

So no jokers

dire marlin
formal parrot
#

Does that include full deck ?

drowsy heath
#

Causes crashs coz extra isn't defined

daring fern
azure valley
dire marlin
#

should i use xchips_mod?

daring fern
azure valley
#

so individual is a context that is used by other cards looking at the card that is being scored?

drowsy heath
hidden sable
drowsy heath
#

IDK IM LOST

#

Someone told me to do this

azure valley
#

why is it commented out?

hidden sable
#

dont define your configs in an if

drowsy heath
#

Idk

hidden sable
#

that wont work

drowsy heath
#

Why not

hidden sable
#

when do you want the card to randomize its mult

drowsy heath
#

When its triggered

daring fern
hidden sable
azure valley
daring fern
drowsy heath
azure valley
#

you need to put the if statement into calculate

dire marlin
azure valley
#

Actually I just checked Xchips_mod should also work

daring fern
azure valley
#
    if (key == 'x_chips' or key == 'xchips' or key == 'Xchip_mod') and amount ~= 1 then
#

oh

#

Xchip_mod

drowsy heath
#

My head hurts

hidden sable
#

just some of the things ive noticed

dire marlin
hidden sable
#

here try this

#

above return but your pseudorandom stuff

faint yacht
#

#G.jokers.cards >=

hidden sable
#

change the config to a variable

#

set it to either -50 or 50

#

based on the random

azure valley
hidden sable
#

then return xmult = that variable

formal parrot
drowsy heath
#

I made some changes anyway and after moving it i got no errors just hoping no crash

hidden sable
drowsy heath
#

Yeah extra still is nil

hidden sable
#

copy and pase your code here

#

ill show you what i mean

drowsy heath
#

Let me get discord on my laptop then

#

Won't take long

hidden sable
#

k

daring fern
drowsy heath
#

Also I did change 1 or 3 things I I feel I made it worse

hidden sable
#

that part is usually useless

drowsy heath
#

How do I make it send as code and not as text

dire marlin
hidden sable
#

the key to the left of the 1 key

dire marlin
drowsy heath
#
SMODS.Joker{
    key = "joker6",
    loc_vars = {
        name = 'gambling fever',
        text = {
            'by the power of the gods',
            'you have 50/50 chance to gain',
            '{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
        }
    },
    atlas = "joker",
    pos = {
        x = 4,
        y = 0,
    },
    rarity = 4,
    cost = 20,
    blueprint_compat = true,
    calculate = function (self, card, context)
        if context.joker_main then
            Calculate = pseudorandom("12345",1,2) if 1 then
    config = {extra = { Xmult = 50 } }
    else
    config = {extra = { Xmult = -50 } } 
    end
    end
            
            return {
                card.ability.extra.Xmult,
           
            }
    end
    ```
hidden sable
#

oh wait

daring fern
hidden sable
#

its the joker_cards error

#

they told you to fix that already lol

dire marlin
drowsy heath
#

its gunna be painful everything thats wrong with mine

normal crest
vague crest
#

if i wanted to have a calculation that does probability independently from oops all sixes, how would i go about that

#

specifically like, 1 in 2 chance to do this and else it does something else kinda thing

dire marlin
daring fern
dire marlin
normal crest
#

Oh I typed joker instead of jokers

vague crest
#

ohhh its that simple awesome

normal crest
#

my bad

daring fern
dire marlin
#

oh yeah my bad

#

it worked

#

thank you so much

dire marlin
drowsy heath
#

is it rlly that bad that its taking this long to get all the problems

daring fern
red flower
#

do u like my high card chat

drowsy heath
#

ewwwww how u do that

normal crest
#

High cards

red flower
#

im making a new smods pr :3

hidden sable
#

@drowsy heath ```
SMODS.Joker{
key = "joker6",
loc_vars = {
name = 'gambling fever',
text = {
'by the power of the gods',
'you have 50/50 chance to gain',
'{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
}
},
atlas = "joker",
pos = {
x = 4,
y = 0,
},
rarity = 4,
cost = 20,
blueprint_compat = true,
calculate = function (self, card, context)
local mult = nil
if context.joker_main then
if pseudorandom("gamble_odds") < (1 / 2) then
mult = 50
else
mult = -50
end
return {
xmult = mult

        }
    end
end

}```

#

that should work

drowsy heath
#

thank you sm

hidden sable
#

i hope at least

drowsy heath
#

ima run it now and see

hidden sable
#

study it and figure out what you did wrong so you can learn too

dire marlin
daring fern
# daring fern

The only thing I have here is a mod with a joker that returns all enhancements and a patch to use my function instead of card:set_ability

drowsy heath
#

yeah that worked i js dk why the text wont show up

hidden sable
#

nope stuff like this?

daring fern
drowsy heath
#
            'by the power of the gods',
            'you have 50/50 chance to gain',
            '{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
        } ```
hidden sable
#

oh wait to you mean the

#

bottom aprt

#

where it tells you what you can or cant get

drowsy heath
#

yeah

dire marlin
hidden sable
#

right here add a line that defines your config as
config = { extra = { highmult = 50, lowmult = -50 } }

daring fern
drowsy heath
#

still blank

hidden sable
#

and below that line add a loc_var that shows text like so

  return { vars = { card.ability.extra.highmult, card.ability.extra.lowmult } }
end,```
#

also make sure you add a comma after the config line

drowsy heath
#

well its still blank.....

hidden sable
#

show code

#

lemme make sure you pasted everything in right

drowsy heath
#
    key = "joker6",
    loc_vars = {
        name = 'gambling fever',
        text = {
            'by the power of the gods',
            'you have 50/50 chance to gain',
            '{X:mult,c:white}X#1#{}mult or {X:mult,c:white}X#2#{}mult'
        }
    },
    config = { extra = { highmult = 50, lowmult = -50 } },
    loc_vars = function(self, info_queue, card)
  return { vars = { card.ability.extra.highmult, card.ability.extra.lowmult } }
end, ```
hidden sable
#

uhhh

#

did you make sure to save and reload?

floral spindle
#

is there something like SMODS.has_enhancement for editions on jokers

floral spindle
#

what is it

drowsy heath
#

im getting a yellow error in the software

hidden sable
hidden sable
drowsy heath
#

duplicate index

daring fern
hidden sable
#

whats parts is it highlighting specifically

drowsy heath
#

the loc_vars for your added code and my loc_vars for the text

hidden sable
#

OH

#

I SEE IT

#

the loc_vars with the text needs to be loc_txt

#

not loc_vars

#

missed that

drowsy heath
#

ima run it then

hidden sable
#

this SHOULD work

#

on my MAMA

umbral zodiac
#

ok does anyone know why display size and pixel size are just doing nothing
ive tried this with multiple different numbers and its made no change

drowsy heath
#

welp that went downhill

hidden sable
# drowsy heath

welp my mamas dead, lets see what is line 18- wait thats not your mod

drowsy heath
#

huh

hidden sable
#

it broke so

#

no more mama 😭

drowsy heath
#

oh but i mean abt line 18

hidden sable
#

at the top

#

it says line 182

#

but

#

thats not ur mod

#

thats smods

#

so

#

something messed up internally

drowsy heath
#

oh fgs

umbral zodiac
hidden sable
#

send your whole code again ima do another scan

#

just in case we are doing something wrong

drowsy heath
#

i highlighted it and it said "trailing space"

#

is that the problem

hidden sable
#

where is it highlighted

#

line 154?

drowsy heath
#

when i hilighted the whole thing to copy it

#

no specific place shows it

hidden sable
#

what is on line 154

umbral zodiac
drowsy heath
#

loc_txt

mossy minnow
#

yippee

hidden sable
drowsy heath
#

loc_txt = function

hidden sable
#

no do loc_txt = {

#

not function

#

whyd bro switch to a function lol

drowsy heath
#

i didnt it was that when u had loc_vars

floral spindle
#

if G.jokers.cards[i].edition and card.edition.key == "e_negative" then joker_count = joker_count + 1

#

this code no work

hidden sable
#

THIS needs to be loc_txt not the other one

#

wrong one

drowsy heath
#

oh

hidden sable
#

sorry for the confusion

#

make sure loc_vars is a function and loc_txt is a table {

daring fern
drowsy heath
#

it all works now

floral spindle
# daring fern Show full code.

if context.joker_main then local joker_count = 0 for i = 1, #G.jokers.cards do if G.jokers.cards[i].edition and card.edition.key == "e_negative" then joker_count = joker_count + 1 end end return { xmult = card.ability.xmult * joker_count } end

hidden sable
#

nice

hidden sable
floral spindle
drowsy heath
#

how do i add small text to it so i can credit you for the code

daring fern
hidden sable
#

wrap it in ```

hidden sable
long sun
daring fern
long sun
#

around here:

drowsy heath
#

i gotta its mostly your script i cant say its mine

hidden sable
long sun
#

with reference to:

daring fern
long sun
#

mm, unfortunate

#

Card Sleeves is able to do that, i'm assuming because it's using the vanilla decks

hidden sable
#

id rather be credited for something really big like this config ui lol, your small joker thing is fine to ahve as your own, since after all it was YOUR idea

long sun
#

so i'll change that, cheers

drowsy heath
#

ig but if you help again ill make a card based on your help "coders kindness" "+15 chips for every krada card you have "

hidden sable
ivory coral
#

ive made a patch to allow certain cards to ignore getting_sliced (allowing a joker to have an effect when it itself is destroyed)
problem now is that it triggers that effect when its destroyed by any means, including with debugplus and even when attempting to exit to the main menu (the latter of which causing a crash since the effect is to create a duplicate of itself)
is there a check i can do to prevent that while still letting it bypass getting_sliced

drowsy heath
#

it not a bad idea tbf

hidden sable
#

only had 2 headaches

tiny hemlock
#

guys i need help wiith one joker lol

    key = 'BONOISEMOD_music_onsight',
    path = 'onsight.ogg',
    volume = 0.7,
    pitch = 1.0,

    select_music_track = function(self)

        if not G or not G.jokers or not G.jokers.cards then return 0 end

        for _, joker in ipairs(G.jokers.cards) do
            if joker.ability and joker.ability.name == 'onsight' and joker.area == G.jokers then
                print("[BONOISEMOD] ON SIGHT en ranura activa - música activada")
                return 100
            end
        end

        return 0
    end
}:register()```
ivory coral
tiny hemlock
tepid crow
#

(though technically localization files are lua code and you could do some janky self-referencing stuff)

drowsy heath
#

okay so just an idea but a joker that works as a bank where you store your money in it and gain better interest than you would from a round ending

long sun
#

hmm, this doesn't seem to be working properly

median veldt
#

i have no idea where to ask about this LMFAO so I'll ask it here
I'm trying to port balatro to wiiu and it's freezing on LOADING: localization
what do y;all think could be the issue lmao

long sun
#

the "yay!" is being printed

daring fern
long sun
#

ah gotcha ^^;

drowsy heath
#

plus nice defence for wrath

hushed field
median veldt
#

I mean technically I'm not exactly modding the game
...wait yes I am nevermind

#

alright then I shall figure it out myself

red flower
#

even then it's against the rules to talk about porting too

drowsy heath
#

so erm the bank joker idea gud or nah

long sun
#

mm, why's this happening? same code as before but with the issue before fixed

hidden sable
#

i could prolly think about this myself but im overstimulated rn and need some nudges, i wanna make this consumable able to "steal" items from shops or packs and put them in the players inventory (jokers, consumables, or deck)

daring fern
hidden sable
#

the deck as an inventory

#

like a playing card pops up in shop or pack

#

steal that and put in deck

long sun
#

oh i know what i did, nvm ^^;

hidden sable
#

also i want stealing an item from a pack to not trigger the pack to close as the player hasnt taken or used a card for themselves, but i think this behavior can be made by simply not checking for it

daring fern
# hidden sable steal that and put in deck

G.shop_jokers.highlighted[1] or G.shop_vouchers.highlighted[1] or G.shop_booster.highlighted[1] and you would do the thing I showed you before along with card:add_to_deck()

#

Along with the areas you already have.

daring fern
hidden sable
#

what exactly does emplace do

#

is it like an add to area?

#

for consumables and jokers

hidden sable
#

so remove_card is removing it from that category/area and emplace is putting it in that area

hidden sable
#

so i would remove_card from G.shop?

#

or wait no

drowsy heath
#

for the life of me i cant find any help on how to add custom decks to my mod

hidden sable
#

its all different stuff

#

so it would be

#

actually wait shop_jokers

#

cant consumables show there too

#

ill have to account for that wont i

daring fern
hidden sable
daring fern
#

You would do card.area:remove_card(card)

hidden sable
#

its referred as SMODS.Back

formal quest
#

What color is this text?

sleek cliff
#

day old bump?

hidden sable
#

attention

drowsy heath
#

or is that not possible

manic rune
#

what do you mean by this 🤔

daring fern
drowsy heath
#

and i just input the key of the joker i wish to use yeah ?

errant fulcrum
#

So guys I have this code

for i, v in ipairs(vanilla_jokers) do
    SMODS.Joker:take_ownership(v, {in_pool = function(self,args) return false end}, true)
end```
The only jokers left are my modded jokers but the base joker still shows up. Is there a way to remedy this?
sleek cliff
manic rune
#

which, should ignore whether its in pool or not

manic rune
errant fulcrum
sleek cliff
drowsy heath
#

my deck still wont show up

hidden sable
drowsy heath
#

oh wait nvm i feel stupid now

manic rune
drowsy heath
#

its 2am for me i cant blame myself

manic rune
#

so you want to patch somewhere

floral spindle
#

what resolution are the blind tokens?

sleek cliff
daring fern
hidden sable
#

my balala looks a lil funny

ivory coral
manic rune
drowsy heath
#

i feel dumb where do i put the atlas in the deck code and what not

manic rune
drowsy heath
#

also i should note i only started learning lua like 24 hours ag o

#

i can do basic jokers like x mult and + mult and art and all that

hidden sable
drowsy heath
#

just couple bits i get lost

hidden sable
#

how can i check if selection is a joker palying card or consumable

ivory coral
# daring fern What is the goal?

im trying to make a joker that duplicates itself when its destroyed
problem: cards are often given getting_sliced when getting destroyed which stops them from calculating
i can bypass that but that causes problem 2: the game crashes whenever i try to exit the run since the game physically cannot remove the joker because it keeps duplicating

daring fern
manic rune
#

the fact that its selection.playing_card and not selection.ability.playing_card.....

daring fern
ivory coral
sleek cliff
#

If I want to select a joker, should I go SMODS.Joker:get_joker? or something like that?

hidden sable
#

how do i check if the player is in the shop

floral spindle
#

is there an easier way to make boss blind tokens

#

I don't want to recreate the shine effect manually

hidden sable
#

there is a template overlay i know

#

lemme go grab it

daring fern
iron burrow
#

I see references of "back" all over the source code and in this community. Could someone help me understand what objects "back" and "center" are?

red flower
hidden sable
hidden sable
hidden sable
formal parrot
#

End_of_round ?

hidden sable
#

like G.blind.in_blind but for shop

sleek cliff
formal parrot
hidden sable
formal parrot
#

No

hidden sable
#

fake?

formal parrot
#

Yes

hidden sable
#

so its rela

red flower
formal parrot
faint yacht
daring fern
sleek cliff
red flower
#

i don't understand what you mean

hidden sable
#

guys whats the optimal play here

formal parrot
iron burrow
sleek cliff
red flower
#

that's like a very specific function just for editions i wouldnt use that as basis for anything

sleek cliff
#

ah

formal parrot
#

😭😭

#

The pfp😭

hidden sable
#

guys should i buy or sell my owned joker

formal parrot
chrome widget
#

Yeah buy it again

red flower
hidden sable
#

ok i bought it

formal parrot
#

Owww

#

What are you even trying to do

umbral zodiac
#

is there a list of centers for editions and enhancements

sleek cliff
umbral zodiac
#

i cant find it because im Silly in the brain

drowsy heath
#

okay i tried everything and i cant get my custom deck to work

drowsy heath
#

idk what im doingggg wronggggggg

formal parrot
drowsy heath
#

i did and it didnt help

#

i also checked the example thing

#

that didnt help either

sleek cliff
#

ok, would this be the correct code to do all that?

merry raven
#

Is there a way to add this marker to a button

umbral zodiac
hidden sable
#

this funny little error made me think of an even better effect for my card

formal parrot
#

Oh no

red flower
formal parrot
#

When bugs turn into features

red flower
#

indentation makes it a bit hard to read but it looks ok to me

sleek cliff
#

cool

red flower
#

wait no

sleek cliff
#

oh

red flower
#

the card you're destroying is the consumable

#

you probably want to destroy a joker or something

sleek cliff
#

is it the card.T.r part?

red flower
#

you're also juicing up the card after it's destroyer

umbral zodiac
red flower
umbral zodiac
#

how do you add a card to the deck properly; simply emplacing it isnt making it shown in the deckview, nor is it increasing the amount of cards in deck

sleek cliff
daring fern
red flower
red flower
umbral zodiac
daring fern
red flower
#

that's a bit more complicated

umbral zodiac
sleek cliff
red flower
#

and then do a pseudorandom_element on that

#

and also do that in can_use

sleek cliff
#

oki

drowsy heath
#

how does one make an xchips card work

#

i have no idea tried to base it on xmult but ofc that doesnt work

daring fern
merry raven
drowsy heath
merry raven
#

Straight up looking like those paint chips at paint shops

sleek cliff
drowsy heath
daring fern
drowsy heath
#

Okay so its still not triggering it

daring fern
drowsy heath
#
    key = "joker7",
    loc_txt = {
        name = 'puntoo',
        text = {
            'i dont know what this',
            'even is but have {X:chips,c:white}X#1# {} chips'
        }
    },
    atlas = "joker",
    pos = {
        x = 5,
        y = 0,
    },
    rarity = 3,
    cost = 10,
    blueprint_compat = true,
    config = { extra = { Xchips = 5 } },
    loc_vars = function (self, info_queue, card)
        return {vars = { card.ability.extra.Xchips}}
    end,
    calculate = function (self, card, context)
        if context.joker_main then
            return{
                Xchips = 5
            }
            
        end
        
    end
}```
#

idk what ive done but this is what i ended up with

drowsy heath
#

oh

#

for all of them

#

?

rapid stag
#

just from your calculate

hidden sable
#

my new idea for the card is use the card to bring a shop item into consumables where you can "save" the card to buy it later, dunno if this is possible

drowsy heath
#

Still no trigger

rapid stag
#

what did you change

drowsy heath
#

The Xchips in calculate to X_chips

rapid stag
#

case sensitive

drowsy heath
#

Thank you it works now

rapid stag
#

it only takes strictly xchips or x_chips
nothing else

#

there's Xchip_mod but that does without message

drowsy heath
#

But the rest of them dont matter? They are Xchips and the card works

rapid stag
#

it looks specifically for any of those three strings

drowsy heath
#

Ahhh

#

Fair enough then

daring fern
rapid stag
#

i've seen a mod do something like that

unkempt thicket
#

That sounds fairly possible

merry raven
#

You can practically make anything, it's just the matter of how hard it is

#

Saw some guy put a playable Super Mario Bros game into a Joker sometime ago

hidden sable
sleek cliff
#

yeah, wait until you see Yahi mod

#

yahi and cryptid

#

crazy things

merry raven
#

Cryptid made a Joker where it gives bonuses based on the number of members on their discord server didn't they

unkempt thicket
#

I don't think they update that

merry raven
#

Ogh I thought it was a live count

unkempt thicket
#

I made multi-rank cards (joker-effect wise) a bit ago

sleek cliff
#

idk, but yahi made a joker based on the game resolution, lower the res, the more xmult

crisp coral
#

it's supposed to be live (i don't think it's properly maintained) and manually updated as fallback

cerulean rose
crisp coral
sleek cliff
#

yeagh,

sleek cliff
unkempt thicket
#

How many jokers does cryptid add?

sleek cliff
unkempt thicket
#

The wiki says 203, aij just hit 200

drowsy heath
#

ratmilk since its your code i used on gambling joker could you help me figure out how to reuse it to have 3 different outcomes 1 being xmult 1 being xchips and 1 being dollars

viral ember
#

Is there an easy way to get all of my modded jokers?

trying to make a booster pack with all of them

viral ember
#

how?

sleek cliff
daring fern
# viral ember how?
local jokers = {}
for k, v in pairs(G.P_CENTERS) do
    if v.set == "Joker" and v.mod and v.mod.id == "yourmodid" then
        table.insert(jokers, v.key)
    end
end
viral ember
#

oh sick

#

thanks

#

🙏

unkempt thicket
#

Is there a way to not load a lovely file based on a conditional?

drowsy heath
#

well can someone help i have some code that grants either 25x or -25x mult and i want to reuse it to give 10x mult or 10x chips or 10 dollars

#

is that like posible

hidden sable
drowsy heath
#

RATMILK HEP

#

heelp

#

idrk how to use ur code for my other gambling joker

daring fern
drowsy heath
#

since that one is conditional to only xmult idk how to change it to all 3

daring fern
iron burrow
#

Does G.jokers.config.card_limit store the player's current number of joker slots? And does it consider negatives? I'm trying to get # of slots available but unsure where this is represented

red flower
sleek cliff
#

I'll probably wait until you're able to and work on another card

#

cause my stank brain isn't a prolific coder

drowsy heath
#

in game the chips and mult is coming as nil

#

and idk how to fix it when i dont know how exactly the code works

#

hello ?

iron burrow
# daring fern Yes.

So the state G.GAME.max_jokers threw me off. That's the current number of jokers the player has? Seems like a strange naming convention

red flower
#

#G.jokers.cards

#

that's the number of jokers

drowsy heath
#

okay erm so why is the values on my joker saying nil but still working

red flower
#

your loc_vars is wrong?

drowsy heath
#

oh i dont have that i only have loc_txt thats why

umbral zodiac
#

is there a function i can hook that runs whenever a consumable is used

drowsy heath
#

i have been sat here so confused

#

mb

umbral zodiac
red flower
umbral zodiac
#

you need to start actually saying what the answer is when someone asks a yes/no question thats obviously implying theyre asking for the answer to it as well

umbral zodiac
hidden sable
#

calculate-context

umbral zodiac
#

i'm not adding it inside of a joker or consumable

hidden sable
#

no like the hook

umbral zodiac
#

its a permanent effect thats applied by a consumable and then the consumable is gone

red flower
#

you can hook calculate_context and use the using consumable context yes

hidden sable
#

that's a function you can hook to

umbral zodiac
#

ohh

#

true

hidden sable
red flower
#

oh that's what i wanted to work on today but i forgot
a calculate function for mods

umbral zodiac
hidden sable
umbral zodiac
#

it is a little annoying when i ask for something but i phrase it slightly differently than is 100% clear so all i get is a "Yes."

hidden sable
umbral zodiac
hidden sable
#

i would prefer the much more considerate term,

drowsy heath
#
    key = "joker8",
    loc_txt = {
        name = 'clueless',
        text = {
            'i dont know if you should get',
            '{X:mult,c:white}X#1# {10} mult',
            '{Xchips,c:white}X#1# {10} chips',
            'or +10 dollars'
        }
    },
    config = { extra = { xmult = 10, xchips = 10, } },
    loc_vars = function (self, info_queue, card)
  return { vars = { card.ability.extra.xmult, card.ability.extra.x_chips } }
end,
    atlas = "joker",
    pos = {
        x = 7 ,
        y = 0
    },
    cost = 20,
    blueprint_compat = true,
    rarity = 4,
    calculate = function (self, card, context)
        local chance = pseudorandom("94738", 1, 3)
        if context.joker_main then
if chance == 1 then
    return {xmult = 10 }
elseif chance == 2 then
    return {x_chips = 10 }
else
    return {dollars = 10 }
end
end
end
}``` can someone explain why this is causing my game to crash when i hover over th joker
hidden sable
formal quest
#

Can someone link the art resources thread? Discord sucks at searching for threads.

drowsy heath
#

but whats wrong with it

hidden sable
#

send the error

red flower
#

you dont have x_chips in extra

drowsy heath
tardy raven
#

this has likely been asked at least a 100 times by now but is it easy to get into balatro modding if you don't have much experience with Lua or with Love2d?

drowsy heath
#

ive been doing it for 24 hours from scratch

#

so yes

red flower
tardy raven
#

ive coded before in a different engine but using a different language (c)

#

and it was very basic shit

#

so im not totally raw meat coding-wise but it's definitely a lot to take in at once

red flower
#

lua is easy if you know another language, but it has its quirks

hidden sable
tardy raven
#

atm im in the process of understanding Love2d but it is definitely very daunting

drowsy heath
#

thats the loc_vars

#

wait no

#

its the return

tardy raven
#

so definitely a larger scale than im used to

red flower
#

you mostly dont need to know love2d for balatro modding

hidden sable
#

found it

drowsy heath
#

i changed that i noticed it too

#

still same error

hidden sable
tardy raven
drowsy heath
#

still the same

red flower
hidden sable
tardy raven
#

define low level if you could

hidden sable
#

gotta say, i fucking hate how thunk did his ui, we should kill him

hidden sable
drowsy heath
#

would be fun

hidden sable
tardy raven
#

i mean tbf its not like we're implementing the most insane shit ever I think really the largest deviation we had in mind was like. two rarities and a card that tracks IRL inactivity

drowsy heath
#

why its just a bit of art

red flower
#

mostly very specific graphics stuff or controller stuff that's not handled by balatro's own graphics and controller system

hidden sable
drowsy heath
#

yeah thats fair

tardy raven
#

ok that makes sense

#

atm im pretty much almost fully versed in basic Lua so

#

it's just a matter of understanding how Steammodded works

red flower
#

yeah

drowsy heath
#

well anyway ratmilk erm its still 226 causing me problems why is that

#

i trust your brain

tardy raven
#

ill prolly be taking a visit or two to this chat on occasion since like I said im practically raw meat

red flower
#

im always happy to help when im around

hidden sable
tardy raven
drowsy heath
#

yeah

tardy raven
#

im gonna try to understand steammodded

hidden sable
red flower
hidden sable
#

someone really needs to give smods docs a redo

tardy raven
#

i think i'm running in the right direction but if something goes wrong then i'll be here

hidden sable
red flower
drowsy heath
red flower
#

i dont want people to tutorialize the docs

hidden sable
#

which is REALLY annoying for some things

hidden sable
#

uhh theres return values hidden in message subtexts

red flower
#

the context page is incomplete yeah

hidden sable
#

also my suggestion is there should be a page called like idk "your first mod" and it is a short tutorial on how to set up a project, import atlases, sounds, and at least 1 of every type of preprogrammed moddable objects (jokers, consumable, decks, etc)

#

and goes into detail on what everything does

#

and how it works

#

like when i first started out

#

i thought config was a fancy way of storing data

#

so i used local variable

#

until i found out config SAVES the values PER CARD

red flower
#

i agree but i dont think that's should be "giving the docs a redo"

#

that just means we need more tutorials

#

but tutorials are not the goal of documentation

hidden sable
#

which is something that might not be appearant to new modders

hidden sable
red flower
#

i agree, i dont think it's the fault of the docs which is what i was arguing

drowsy heath
#

coming from a clueless individual

hidden sable
hidden sable
red flower
#

there is one

drowsy heath
#

oh damn

red flower
#

drago made it let me find it

drowsy heath
#

will it help me with my problem

hidden sable
faint yacht
hidden sable
#

send screenshot of code (discords indenting sucks)

drowsy heath
#

i tried everything

red flower
hidden sable
#

also worst part about me starting out clueless, my mod uses no spritesheets, no localiztion, and no multifiles, because im too deep in the mod to swap it all out

drowsy heath
#

oh mine is just 1 .lua file with all my jokers in it and atm i have no art

drowsy heath
hidden sable
drowsy heath
#

idk

#

wait

#

oh

hidden sable
#

that is how loc_vars works

drowsy heath
#

okay so i made it 2 and it didnt help

#

still crashes

hidden sable
hidden sable
drowsy heath
#

what on eath is that

#

thats painful to look at

modern kindle
#

mine was once just a single lua file as well, i encourage you to aplit it up sooner rather than alter lmfao

hidden sable
modern kindle
#

i also encourage you to make a localization file

hidden sable
hidden sable
drowsy heath
modern kindle
#

i didnt start splitting mine until i had like 50 jokers, several consumables, and etc
and it was a menace

drowsy heath
#

my head hurt looking at that but give it when im more awake ill understand it and fix all my mod files

#

but rn i want to make everything i have work, i have a joker that crashes my game when my cursor is on it and i have a deck that just wont work at all

modern kindle
#

its not so bad dont worry lmao
its just moving all of your loc_txts basically to one file where others can make translations if necessary later on instead of your descs being within your jokers

hidden sable
#

also please practice code formatting

modern kindle
#

if youre in vscode you can auto format it

#

and make sure you have the lua extension

drowsy heath
#

how do i format the code i use visual studio

#
    key = "joker8",
    loc_txt = {
        name = 'clueless',
        text = {
            'i dont know if you should get',
            '{X:mult,c:white}X#1# {} mult',
            '{Xchips,c:white}X#2# {} chips',
            'or +10 dollars'
        }
    },
    config = { extra = { xmult = 10, xchips = 10, } },
    loc_vars = function (self, info_queue, card)
  return { vars = { card.ability.extra.xmult, card.ability.extra.xchips } }
end,
    atlas = "joker",
    pos = {
        x = 7 ,
        y = 0
    },
    cost = 20,
    blueprint_compat = true,
    rarity = 4,
    calculate = function (self, card, context)
        local chance = pseudorandom("94738", 1, 3)
        if context.joker_main then
if chance == 1 then
    return {xmult = 10 }
elseif chance == 2 then
    return {x_chips = 10 }
else
    return {dollars = 10 }
end
end
end
} ```
#

anyway thats the joker code i dk why it wont work tho i dont get it

hidden sable
modern kindle
hidden sable
modern kindle
#

i recommend vscode personally yea

hidden sable
#

ive always seen vscode as confusing

#

too many buttons

modern kindle
#

notepad++ was my first editor in my gmod days

#

then i went to sublime

drowsy heath
#

shift alt f worked

modern kindle
#

then i settled on vscode

hidden sable
drowsy heath
hidden sable
#

WHAT DOES ANY OF THIS MEAN IM SCARED

drowsy heath
modern kindle
#

those are just release notes dont worry about em lmao

hidden sable
#

how do i open my project

modern kindle
#

but for your mod you can just make a workspace and add your mod into it and all that

drowsy heath
#

226 extra a nil value

hidden sable
drowsy heath
#

but that has nothing to do with extra 😭

#

i dont get ittttttttt

hidden sable
drowsy heath
#

yeah

#

i think

#

hold on

hidden sable
#

pro tipif you dont know: while in crash screen, press r to reload, while ingame, press alt f5 to reload

drowsy heath
#

217 nil

drowsy heath
sour garden
#

okay out of curiosity is there a variable for counting the amount of cards in your hand? my method works for now, but it doesn't account for stuff that puts you over the hand limit like DNA

drowsy heath
#

Go to file and open folder, then use your balatro mods folder in %appdatq%

#

Thats what i did

hidden sable
#

ok i think i did it?

drowsy heath
#

Yeah thats ur files

hidden sable
#

any way to move these menus around?

drowsy heath
#

Oh I got no clue

hidden sable
#

these placement make me uncomfortable

drowsy heath
#

Ik its rlly annoying but it grows on you when u get too annoyed to find out how to change it

modern kindle
#

honestly i like it as is, everything in one place and readily accessible

drowsy heath
#

Yeah took me a while to get used to it

#

But I'm happy with the ui now

hidden sable
daring fern
drowsy heath
#

OH THAT WORKS

#

THIS IS SO MUcH BETTER

hidden sable
#

OH GOD

#

😭

drowsy heath
#

oh dayum

hidden sable
#

whats the auto format key?

drowsy heath
#

shift alt f

#

nah its alt f4 trust

floral spindle
#
    key = "BordBorn",
    path = "borblinds.png",
    px = 34,
    py = 34
}

SMODS.Blind {
    key = "Physik",
        loc_txt = {
        name = 'The Physician',
        text = {
            "Can't play more than 4 cards"
        }
    },
    atlas = "BordBorn",
    dollars = 5,
    mult = 2,
    debuff = {h_size_le = 4},
    pos = { x = 0, y = 1 },
    boss = { min = 2 },
    boss_colour = HEX("813cef")
}```
#

this crashes the game when I try to view my blind

hidden sable
drowsy heath
hidden sable
drowsy heath
#

if ur code worked then its fine

hidden sable
#

true but

daring fern
hidden sable
#

the whole right side is yellow

drowsy heath
#

guys my toe has dislocated erm im in pain

hidden sable
drowsy heath
#

i dont want to smash it back in its gunna hurt

daring fern
drowsy heath
#

I DIDNT DO IT ON PUPOSE

#

i was stretching

hidden sable
#

uhhh wheres file

drowsy heath
#

ok its all gud now im ok

hidden sable
#

MORE YELLOW

daring fern
floral spindle
daring fern
hidden sable
daring fern
modern kindle
#

ill be real i leave my shit yellow cause it does not impact me very much lmfao
but adding them to your workspace is a good idea

floral spindle
hidden sable
#

everythings gone

daring fern
hidden sable
daring fern
#

With File > Open Folder

hidden sable
#

yeah i did that

#

everythings gone

#

SIDEBAR GOT DISABLED IDK WHY

modern kindle
#

i just checked and adding it like that does in fact clear your workspace if you already established one

in the workspace youd want to select all 3 folders in the workspace instead of just your mod

hidden sable
#

i have a yellow here

drowsy heath
#

I THINK I FIXED IT

#

no

#

im going to either cry or give up and just make the text just say it normally

hidden sable
#

its useful

drowsy heath
#

but whyyyy

#

the card still works without it

#

so just vwoomp it out of exsistance

floral spindle
drowsy heath
#

see card works now

#

and triggers correctly

daring fern
hidden sable
hidden sable
#

lets set up localization together

drowsy heath
#

i mean im fine with how it is and its legendary sooooo rarely gunna be used

hidden sable
#

im setting this up rn

drowsy heath
hidden sable
#

we gonna find out

#

i think how it is is just

modern kindle
#

then you guys should make everything talisman compatible and then make it cryptid compatible and then make it everything else compatible

#

smiley face

hidden sable
#

put the key in

#

and assign it loc_txt

drowsy heath
#

so just make a file for all the different types of things

#

what about a folder and each thing has its own file to keep things organised

#

so jokers have a lua file each in a joker folder

modern kindle
#

some people do one file per joker, others just throw in a joker.lua in a jokers folder
just a preference thing

#

personally im just jokers.lua in a modules folder

hidden sable
#

hey guys look at my atlases

drowsy heath
#

per lua is better for management though and i only have like 9 rn

#

WHY SO MANY IN ONE PLACE

#

I DONT UNDERSTAND

hidden sable
#

i dont use spritesheets 😭

modern kindle
hidden sable
drowsy heath
#

i mean like being able to configurate a specific joker without having to search through a big code file

modern kindle
#

my joker file is 5k lines long, i aint scrollin that lmfao

drowsy heath
#

i just find its name

hidden sable
#

do you set up colors in localization?

#

i just do it like this

daring fern
hidden sable
#

how do you set up colors

#

like im doing?

daring fern
floral spindle
#

why cant I apply an atlas to my blind

daring fern
drowsy heath
#

okay so they all have their own file what else do i need to do

hidden sable
#

mr poly bridge will tell us how

#

i think its SMODS.load_file(path)

daring fern
hidden sable
daring fern
faint yacht
#

To execute as function.

daring fern
hidden sable
#

can i get like copilot or something to do this lol

drowsy heath
hidden sable
#

main.lua is the only file running, in main.lua we gotta tell smods to laod the other files

daring fern
drowsy heath
#

ohhhh

#

and we do that how....

faint yacht
#

If you don't want to repeat SMODS.load_file(path) over and over, you could do a loop instead.

for _, file in ipairs{'file1.lua', 'file2.lua', 'other/file1.lua'} do
  SMODS.load_file(file)
end
hidden sable
#

this ai is ass

drowsy heath
#

hehehe

#

whats that top line for

hidden sable
#

color for my ui

drowsy heath
#

oh fair enough

faint yacht
#

Missing the .lua extensions, but that would technically be correct.

drowsy heath
#

why the code/ before it

faint yacht
#

Probably assumes the files are stored in the code subfolder.

drowsy heath
#

so like this

faint yacht
#

...if you have a code folder with all of those, then yeah.

drowsy heath
#

wait i feel dumb nvm ill fix it

#

whats after that them

#

then*

hidden sable
#

oh hell yeah they have this feature

#

multiselect

#

hold and and select to make anaother cursor

drowsy heath
#

whats after that tho somet about atlas isnt it

hidden sable
#

i define my atlases in a file

#

now we need to do localization

#

@daring fern mr poly bridge how does one localize