#💻・modding-dev

1 messages · Page 172 of 1

normal crest
#

@vague pendant

vague pendant
#

ahhh

normal crest
#

I've no idea if it's possible, but maybe you're interested in G.FUNCS.draw_from_deck_to_hand which is in functions/state_events.lua

vague pendant
#

still hitting the 'center is nil' error

normal crest
#

is JTC_clue a consumable

vague pendant
#

yeah

normal crest
#

try removing everything else except key

vague pendant
vague pendant
normal crest
#

can you send the full crash log

vague pendant
normal crest
#

are you using steamodded headers

vague pendant
#

no. those have been depreciated afaik.

normal crest
#

yeah they have been

vague pendant
#

ah, I see what you were asking

normal crest
#

can you send your json metadata

#

or really just the prefix, make sure it's JTC

#

with no additional spaces or anything

frigid flame
#

what if you made it increment by 1 so that when it duplicated it ended up being 2 like intended

manic rune
#

you forgot context.repetitions

#

or smt

nova finch
chrome prawn
#

so now I'm trying to make a joker shake like invisible joker or DNA when they have their ability ready
however the game keeps giving this error even though I'm pretty sure that I have the correct code for it

ionic verge
#

there isnt like a library mod that adds additional contexts/whatnot for modders to use is there?

#

and if smods counts as that, besides smods

hardy viper
#

anything like that would be integrated into smods

#

we dont have a good dependency system

ionic verge
#

mhm

#

well in that case what code would i need to copy from cryptid to add more booster pack slots

fallen vigil
#

how do i substitute a custom enhancement

normal crest
chrome prawn
ionic verge
ionic verge
#

without really knowing the situation i give that a 75% chance of working

#

likely higher

chrome prawn
fallen vigil
normal crest
#

i'm pretty sure i used it like one time ever

normal crest
fallen vigil
#

the slug/key

#

in place of m_bonus

ionic verge
normal crest
ionic verge
#

for checking if the indexed joker isnt itself

normal crest
#

you should compare to card instead

ionic verge
#

well thats weird

#

because the joker works as intended

#

like it wont add its sell value to the variable or anything

#

so it clearly returns false at some point

fallen vigil
#

now how do i get the amount of remaining hands as a number

normal crest
#

to my knowledge that comparison should always be true

ionic verge
#

alright lemme test that rq

normal crest
fallen vigil
normal crest
#

i think so

ionic verge
#

thanks for the bug fix!

normal crest
#

lol no worries

ionic verge
#

yep it works now

spark remnant
#

what would the context statement for played 7s be? I currently have if context.individual and (context.other_card:get_id() == 7) then but this activates for 7s in hand as well

manic rune
normal crest
spark remnant
chrome widget
#

Out of curiosity, can you use the GLSL texelFetch function in Love2D shaders, or at least in the version used by Balatro? I can't find very many resources on Love2D's support for certain OpenGL features even though I believe recent updates allow support for OpenGL 3?

#

This is the definition for it, and since Image (which is what "texture" is here) is Love2D's alias for sampler2D, I should just be able to pass these in? But I get a "no matching overloaded function found"

chrome widget
#

Context is that I want to try implementing a simple bloom shader but I have no fucking clue what I'm doing so the most I can do is try to translate some other shaders written for regular GLSL to figure it out 😔

crystal perch
#

anyone got any idea how i would detect if another joker's ability triggers (except for self)

#

to create an ability something like this

icy cobalt
#

You could mimic the blueprints behaviour but instead of returning the calculated jokers return you just return 4 mult for each valid return

void pecan
#

Idk what to put as his art

#

Need ideas

#

and name ideas

orchid thunder
void pecan
#

dw its gonna be rare

orchid thunder
#

RNJesus

void pecan
orchid thunder
bold tapir
#

hmm chat thoughts on these jonkler concepts? i can explain the thought process behind some of these if needed

#

for a theoretical mod focused around chance

#

another one that couldnt fit in the screenshot is coin flip - gains either [+chips] or [-chips] after each hand. cannot go below 0

random sleet
stiff locust
quasi comet
#

I'm trying to make a joker with a rocket effect but using the code directly from rocket makes it trigger 3 times at the beginning of the boss blind rather than at the end, any idea why?

stiff locust
quasi comet
bold tapir
#

and i assume the same for consolation prize?

proven stump
# quasi comet

I think you need to check for the right context as well?

stiff locust
#

yeah you do

#

change if G.GAME.blind_boss then to

#

if context.blind_boss and context.end_of_round and context.main_eval then

quasi comet
#

ohh

stiff locust
#

the context.main_eval is a bettercalc exclusive thing, that just makes end of round not trigger 8 times for no reason

quasi comet
#

makes sense

stiff locust
#

also if you want it to return mult which it seems to want to do

quasi comet
#

the mult was actually just a temp thing cause i was trying to figure out the timing

stiff locust
#

oh alright

quasi comet
#

thank you!

stiff locust
bold tapir
#

ah

stiff locust
#

consolation prize could be tuned to work only on lucky cards and only appear if lucky cards are in the deck

bold tapir
#

maybe i could rework it into like. unlucky cat? and yea like that

stiff locust
#

yeah that'd still require you taking ownership of the lucky enhancement

#

not a huge issue really

bold tapir
#

hmm

stiff locust
#

taking ownership means to like

#

re-register a vanilla card as a modded card

#

you can use that to change the joker's effects, and it adds your mod badge to the card

#

mods usually do this to fix bugs, like Incantation's patch for Perkeo that makes it not copy entire stacks of consumables

#

but sometimes it is a functionality thing

bold tapir
#

ah okay

quasi comet
stiff locust
#

not sure what the smods.calculate_effect is for?

#

what is that supposed to do

quasi comet
#

its just to show 'upgrade' when it actually upgrade

#

pretty much

stiff locust
#

if you want it to send an update message, either use a return message or card_eval_status_text

#

rocket has this code

#
return {
                        message = localize('k_upgrade_ex'),
                        colour = G.C.MONEY
                    }
#

change the color to MULT for mult

#

just throw that in below the mult increase

#

that will make it work

quasi comet
#

doesnt actually change anything, i haven't changed the code much aside from the context and the calc_effect to the return message

#

still doesn't upgrade after the end of the boss blind

plain apex
#

on old calc this properly retriggers the scored cards and jokers on new calc it only retriggers the scored cards how do i convert this to newcalc?

if config.oldcalccompat ~= false then
  SMODS.Joker{
    key = 'Emily',
    loc_txt = {
        name = 'Emily',
        text = {
            "Retrigger EVERYTHING {C:attention}#1#{} Times"
        }
    },
    atlas = "Jokers",
    pos = { x = 4, y = 0 },
    config = {
        extra = {
            repetitions = 1, -- Number of times to retrigger for scoring cards and Jokers
        },
    },
    rarity = 4,
    order = 32,
    cost = 14,
    no_pool_flag = 'clam',
    blueprint_compat = true,
    loc_vars = function(self, info_queue, center)
        return {
            vars = { "" .. self.config.extra.repetitions }
        }
    end,

    calculate = function(self, card, context)
        -- Check for retriggering (excluding consumables)
        if (context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self) or
           context.jokers or (context.repetition and context.cardarea == G.play) then

            -- Loop through the configured repetitions
            for i = 1, self.config.extra.repetitions do
                G.GAME.pool_flags.clam = true  -- Ensure 'clam' flag is set

                -- Return a message for each repetition
                return {
                    message = "CLAM!",  -- Custom message
                    colour = G.C.RED,    -- Set the color to red for emphasis
                    repetitions = self.config.extra.repetitions, -- How many times to retrigger
                    card = card,         -- Attach the card context
                }
            end
        end
    end,
}
end
urban veldt
#

New to modding, how doable is a Joker that makes rares and legendaries appear in shops more frequently?

coral cobalt
#

so im working on making a giga mod pack for me and my friends but it involves a lot of extra stuff, i mostly just need to know how i could increase all the shop slots by 1 just so you can get a chance at whats going on

quasi comet
stiff locust
#

rarities use a weight value that influences how often they spawn in shop

#

you'd have to modify that like oops all 6s does probability doubles

#

increase it on add_to_deck and reduce it on remove_from_deck

#

I have no idea how you'd actually change the rarity weight

#

but I'm sure there is a way

marble flint
#

Can I use Lovely to patch another mod (in this case, I'd like to patch Steamodded)? If so, how?

marble flint
#

thank you!

runic pecan
#

How do I define a global variable that can be accessed in every file of my mod?
A little like G but less powerful.

plush cove
#

Inside the dependency files, I have functions formatted like this that can be accessed from any file after they're loaded

#

I know from experience: do not do this if you want your functions accessible globally

#

for some reason function [name]() doesn't load globally, whereas name = function() usually does

marble flint
#

I just define an object called Bakery_API in the global scope and shove stuff in that (Bakery is my mod id)

plush cove
marble flint
#

same :)

#

although my file-loading model is a bit different

plush cove
marble flint
#

it's only going to be what, 1 millisecond different once on startup? it doesn't matter much

maiden phoenix
#

Bread era balatro modding

marble flint
#

🥯

edgy reef
#

Unless something else is amiss

stiff locust
plush cove
maiden phoenix
bitter gazelle
#

why is findModByID suddenly returning nil? i swear it was working earlier

#

okay i literally just fixed that and now SMODS.Sprite isnt working either??? dude it was working yesterday why doesnt it work now

frosty dock
bitter gazelle
#

oh yeah good point

#

nvm

stiff locust
frosty dock
#

tru dat

south folio
#

how do I add hand size like juggler does?

wintry solar
quasi comet
#

its ok, ive already solved the issue

#

its what i was originally using also but it wasnt working either; i found another work around that works

wintry solar
#

What is this workaround

quasi comet
#

g.game.last_blind.boss worked for what i needed

#

well. G.GAME.last_blind.boss

crisp coral
#

last_blind is a vanilla variable?

quasi comet
#

its used in tags typically

#

iirc

south folio
#

Followup question, how do I check for enhancements in the Full Deck?

runic pecan
#

Is it calc_dollar_bonus or calculate_dollar_bonus?

maiden phoenix
#

calc one

hot cove
#

I wanna try and get into making custom jokers, do we have any guides on that?

plush cove
vocal verge
maiden phoenix
hot cove
#

Much appreciated thank u will look at everything

hushed field
#

Might try and do better backgrounds for them at some point, but finished the art for the custom tarot cards 😄

spring lantern
#

not on my pc rn but would still appreciate some help with this issue i had yesterday - joker's basically good to go after balancing except for this one issue :(

violet void
#

try adding

Xmult_mod = card.ability.extra.xmult,

to the return

wintry solar
#

your logic is wrong, add some line breaks in a hpefully you wil lsee

bitter gazelle
#

how do i half base chips and mult?

tepid crow
bitter gazelle
tepid crow
#

do you know how to look at the balatro source code?

bitter gazelle
#

yeah but like how do i put this into a deck

#

sorry if im confusing you

tepid crow
#

if you're lucky you can use the deck's calculate function to do the same thing as the flint

dire palm
#

I'm trying to do something but I need to know... How does copy_card work exactly?

hushed field
dire palm
#

Let's say I selected a card v in a loop and want to copy that specific card to deck.

hushed field
# dire palm Let's say I selected a card v in a loop and want to copy that specific card to d...

i haven't messed around with copy card too much yet, but as far as I understand it right, it works something like this:
Let's say you played a hand with Hearts 2, Spades 10.

your joker iterates through your hand and copies every 10.

you use ipairs, then get_rank(10), and then just pass the card object to copy_card()

local _copy_of_desired_card = copy_card(v, nil, nil, G.playing_card)
_copy_of_desired_card :add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, _copy_of_desired_card)```

There's probably easier ways, I'm sure, but I think that should copy the chosen card and add it to the deck. If you want it to be drawn, I think G.hand:emplace(_copy_of_desired_card) should be added? But I'm not sure, I haven't messed around with that much yet.
dire palm
#

Alright. That's basically what I assumed but I wanted confirmation.
I'll try and see if this works.

#

Thanks for the help.

hushed field
#

It might very well be wrong, haha, I'm not super proficient with the codebase yet. But a great way to learn is to just mess around with it and see what changes.

violet void
#

I guess I should destroy the joker otherwise you can spam the same hand (but what are the chances of this happening)

merry raven
#

Ohh shit that's super neat

#

How did you make the cards go up

crystal perch
#

trying to make this joker ability work and i've tried a bunch of methods and so far none have worked (either crashed the game or did nothing)
i'm new to balatro modding so some help would be greatly appreciated

#

here is my latest attempt

#

i know there's probably some really obvious thing i'm missing and i've been reading the docs but i just don't rly know how to format all of this

hushed field
dire palm
#

How do I return a message without exiting my loop?

surreal kernel
#

Hello! New to modding here, wanted to ask how to add SMODS to my mod so I don't get this?

frosty dock
#

my modding workspace contains my entire mods folder

violet void
surreal kernel
#

(I'm 100% doing it wrong)

merry raven
violet void
merry raven
#

Oooo cheers

crystal perch
maiden phoenix
#

You can unzip the game exe and check the files yourself if you want (forgot which exactly, I think card.lua?)

crystal perch
#

i found it, low key forgot baseball card was a vanilla joker 💀

#

ok so using context.other_joker just makes it trigger the +4 if you simply have another joker, but i specifically want it to trigger after another joker's ability triggers

#

i know context.post_trigger is a thing but it doesn't seem to work no matter how i try

dire palm
#

How do I return a message without exiting my for loop?

violet void
#

card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize('ph_boss_disabled'), colour = G.C.RED})

probably

worthy stirrup
#

So, im making a balatro joker, it has a large size for the joker, the sticker is small, like to the point it can barely be seen, how do i make the stickers bigger for it

crystal perch
#

uh

#

someone ban the bot 💀

#

thank you

sullen fern
#

how DO i enable debug mode?

#

there’s no conf.lua to be found

#

nvm!

#

i foudn it

long sun
#

trying to create a wild card, but i think my center is wrong, what should it be?
local _card = create_playing_card({front = pseudorandom_element(G.P_CARDS, pseudoseed('pencilra')), center = G.P_CENTERS.m_wild}, G.hand, nil, nil, {G.C.SECONDARY_SET.Enhanced})

#

oop nevermind, it does indeed work!

surreal kernel
violet void
#

whats the correct way to patch smods?

dreamy thunder
#

would this be unstable? im trying to make the mod not require talisman but still work with it

#

it works but im not sure

sullen fern
#

how do i setup mod metadata as well as set up the main lua file

#

i also wanna learn how to make lua files in different folders

hushed field
# sullen fern i also wanna learn how to make lua files in different folders

It's luckily not that difficult! Your main lua file just needs to be the same name as your mod. If you want lua files in different folders, you have to read those in with a function like SMODS.load_file. There's different ways to load in objects. Paperback has each joker as a separate lua file, and Cryptid has a lua file per class. I'd look into how those mods read in their files, depending on which method you'd prefer working with

sullen fern
#

so i’ll have a lua file for each joker class (eg. nonlegendary.lua, legendary.lua, tokipona.lua, doilus.lua, etc.)

hardy viper
# violet void whats the correct way to patch smods?

launch lovely with --dump-all as a command line argument, look in lovely/dump for the smods lua file you want to patch, then find the associated text file (which has the same name as the Lua file) and copy it's contents into the target field

edgy mountain
#

hi, i copied this code from a paperback joker
it is supposed to debuff all hearts
but currently, it is debuffing hearts even when the joker isnt present and Through different runs

violet void
hardy viper
#

my bad

prisma loom
#

@violet void is this the method for importing vouchers?

violet void
#

It can be if everything is correct

violet void
prisma loom
#

but it crashes :(

violet void
#

it shouldnt if you are doing the same as the seals

#

and that doesnt seem to be a folder

lyric blade
#

I want to make a card negative with set_edition, is it card:set_edition('negative') or what does come into the brackets?

#

If possible

prisma loom
normal crest
#

'e_negative'

lyric blade
#

Ah, thanks

prisma loom
#

iirc game auto created vouchers.lua outside that folder when I launched the game

#

it didnt work as well

violet void
#

just do the same for the seals but with vouchers

last sentinel
#

Would evaluate_poker_hand(hand).top give you the name of the hand that a set of cards would be played as?

prisma loom
normal crest
#

add a / after voucherssss in load_file

sullen fern
#

can i use hex codes for ConsumableType

normal crest
#

yes

sullen fern
#

alright

normal crest
#

can either be HEX('FFFFFF') or just 'FFFFFF'

prisma loom
#

or extension

glad osprey
#

hi yes i still require assistance

#

pretty please

normal crest
sullen fern
#

how do atlases work

#

like i know how to make them

#

its SMODS.Atlas

hardy viper
# glad osprey hi yes i still require assistance

SMODS.debuff_card(card, true) will debuff a card (second argument becomes false to undebuff it)

context.selling_self in calculate allows you to do something when the joker is sold (so undebuffing a card)

and i do not know how you can see if a card has a sticker, check madness code which checks for eternal stickers

glad osprey
#

is there a way to check if any card is sold, instead of itself

#

cuz just selling any joker works

hardy viper
sullen fern
glad osprey
sullen fern
#

ahhh ty

glad osprey
#

yea thats how it is

glad osprey
hardy viper
glad osprey
#

so x=1 and y = 0 of a 75x91 atlas would be 75,0

hardy viper
glad osprey
#

main issue was i just couldnt find the disable function lol

hardy viper
#

ah gotcha

sullen fern
#

now, i think it’s time i learn how to make my own joker

hardy viper
#

SMODS.Joker{key="",calculate=function()end,loc_txt={name="",text={""}}}

#

shrimple..

dire palm
#

So, I have this code featuring a card_eval_status_text inside a for loop. The problem I'm encountering is that the messages appear only once the game gets out of the loop. Any idea how I can make it so they appear instantly instead?

glad osprey
sullen fern
glad osprey
hardy viper
hardy viper
#

context.card will be the card that's being bought

glad osprey
#

oh ok

#

so context.card = c1 then????

hardy viper
#

they will be consecutive since card_eval_status_text adds events as well

hardy viper
glad osprey
#

im not sure thats just what the guide says

#

"The card being bought also calculates itself with context { buying_card = true, card = c1 }."

hardy viper
#

ah i see

#

c1 is the same thing as the "card" argument that gets passed to the function

#

so if you want to do that when the card itself gets bought you'd check context.card == card

#

but be aware that only triggers when the joker is bought from the shop, not obtained from something like a buffoon pack or judgement

glad osprey
#

oh true

past forge
#

Hello there

hardy viper
#

you can use one of the several functions on a center that is called when a joker is created (set_ability, add_to_deck, etc)

minor magnet
#

how would i implement a joker similar to maximized from cryptid?

hardy viper
hardy viper
past forge
#

do you guys ave some guides to start in balatro modding? I dont have a lot of experience in Lua, but im fairly good at programming

hardy viper
#

is that the one that makes all face cards kings and all numbers ones

minor magnet
#

im struggling to implement a similar joker

minor magnet
#

this is that mine needs to do

edgy mountain
#

this also doesnt work

hardy viper
edgy mountain
hardy viper
#

so in this case if the old get_id returns 12, make it return 13

#

1-10 are the numbers, 11-13 for faces in order, 14 for ace

minor magnet
#

mhm

glad osprey
hardy viper
glad osprey
#

o

hardy viper
#

it's documented there

sullen fern
#

this is what i have for my joker so far (most code is copied from the example jokers mod)

#

mainly from joker2

#

will i have to change anything

#

i know i will have to add things (like the whole "x1.5 mult for each negative" thing)

graceful magnet
maiden river
#

does add_card/create_card work with modded rarities?

graceful magnet
sullen fern
graceful magnet
#

I want to make something that gains XMult when a retrigger occurs, how do I go about checking for a retrigger? I presume context.repetition is a whole step so I'm worried just using that will cause it to just rapidly upgrade.

maiden river
hushed field
# sullen fern now how do i use said function

quite a broad question! I'd just play around with it a bit and see if it works or not. I don't really know the ins and outs of the way SMODS reads jokers or such, so I can't help beyond that, really

sullen fern
#

this is what my main lua file looks like right now

ionic verge
#

does anyone know how crypid allows more booster pack slots to be added to the shop?

last sentinel
#

anyone familiar with the evaluate_poker_hand function? I have a list of 5 card objects that i'd like to get the poker hand name of. Seems like evaluate_poker_hand should be my guy but i cant seem to get the actual played hand name

minor magnet
#

am i hooking correctly? i am new to lua so i get tangled up in the basics

ionic verge
maiden river
royal ridge
hardy viper
#

you also need an end for that if statement

minor magnet
#

ohhh

prisma loom
#

@wintry solar is there a way to modify this patch so it allows ANY pack to have extra choice?

hardy viper
#

you also declare it wrong, needs to be function Card:get_id() not Card:get_id = function()

#

the colon syntax doesn't support that form of function declaration

ionic verge
royal ridge
royal ridge
#

like bro 😭

hardy viper
minor magnet
#

mhm fixed

prisma loom
minor magnet
#

all good now?

royal ridge
frosty dock
#

other than that, looks good

graceful magnet
#

uh, I'm pretty sure I'm not missing that }

violet void
prisma loom
ionic verge
graceful magnet
frosty dock
minor magnet
graceful magnet
#

oooh

violet void
frosty dock
minor magnet
#

thank you very much

frosty dock
hardy viper
royal ridge
hardy viper
royal ridge
#

seems smarter if it does work

violet void
sullen fern
#

there it is.

#

it's actually in the game

#

all it does rn is give 1.5 xmult

graceful magnet
hushed field
#

starting to get somewhere now

faint yacht
#

next(context.poker_hands["Flush"]) is correct for checking if currently selected cards contain a Flush, ye?

prisma loom
#

So this checks the type of booster pack but what types of boosters are in vanilla? what can I insert instead of 'ggg'?

graceful magnet
frosty dock
#

-# I take it isn't

graceful magnet
sullen fern
#

how do i give a joker a modded rarity

frosty dock
past forge
#

Hello guys, i want to start in the balatro modding, but i dont really have experience in Lua. Do you have some useful tutorials or documentation for this?

frosty dock
frosty dock
past forge
#

thanks :D

graceful magnet
frosty dock
#

what are you trying to achieve exactly?

graceful magnet
frosty dock
#

you'd have to add your own context, steamodded doesn't support that out of the box

graceful magnet
#

ech, mk

sullen fern
#

all of these cards currently use the same code

#

but two of them have custom rarities

#

but they appear as ERROR

#

so i probably need to add a localization thing

wintry solar
sullen fern
wintry solar
#

Also shop rerolling

#

I’ll get round to it at some point

minor magnet
sullen fern
#

there's more where that came from

#

i just need to figure out how to actually add the names for rarities

cerulean rose
#

also i've been adding some apis in #1338044836087070740 if someone wants to port them over to SMODS #selfpromo

wintry solar
#

What are dyna blinds and why is it needed

#

Can’t you just edit the blind score and call the ui to update?

nocturne garnet
#

dynamic blinds??

#

what for??

cerulean rose
#

yeah

nocturne garnet
#

but like what for

cerulean rose
#

custom sizes that can change during blind select

#

parchment glove from strange pencil uses it to give an accurate preview of the current size when it's upcoming

red quarry
#

Halo, so i tried to make a joker that increase Xmult if round ended by certain poker hands (two pair). so far the Xmult upgrade after each blind defeated is working, but i cant figure out how to make it only upgrade when two pair is used to defeat the blind

cerulean rose
#

also will be adding more soon

wintry solar
#

I still don’t understand what it does

pulsar horizon
wintry solar
#

Is it just a function to change the blind scores?

cerulean rose
cerulean rose
wintry solar
#

Oh rather than just a multiplicative value?

cerulean rose
#

yeah

wintry solar
#

I see

cerulean rose
#

The Point does that with it for its ^1.5 base

wintry solar
#

And what are all the functions you’ve created for?

cerulean rose
#

i has a wiki

past forge
#

what id "dump_loc": false in the metadata exactly for

sullen fern
#

it works!

normal crest
#

I believe

#

I don't remember exactly what it is

wintry solar
#

Yeah I saw the wiki I’m just not sure when the other functions would be used from reading, the score function on blinds is cool though

cerulean rose
#

StrangeLib.dynablind.get_blind_score is essentially a wrapper for Blind:score that also works for vanilla blinds (cus their centers won't include it)

#

StrangeLib.dynablind.find_blind is mostly performance‐oriented (to only update your specific blind with a custom context

wintry solar
#

Why wouldn’t you just use G.GAME .blind.chips (from memory might be different)?

cerulean rose
#

doesn't exist for upcoming blinds

wintry solar
#

Oh okay that seems pretty niche but sure

cerulean rose
#

fair

#

another use case for StrangeLib.dynablind.get_blind_score is to hook for other scoring modifiers

#

Strange Pencil's Squared Roots adds an exponential base modifier

hardy viper
#

@wintry solar why's this cardarea isn't it normally just area

sullen fern
glad osprey
#

could someone test my mod i cant open balatro rn (steam family share)

cerulean rose
#

StrangeLib.dynablind.get_blind_score is always up to date (is used by StrangeLib.dynablind.update_blind_scores)

sullen fern
#

okay i need to actually get to coding amalgamate now

hardy viper
wintry solar
glad osprey
#

also i couldnt do that to my sister

hardy viper
glad osprey
#

no

glad osprey
#

my sister married him

wintry solar
#

cardarea isn’t a particularly useful part of most context tables

hardy viper
#

gotcha

manic rune
#

i shall start posting one cat gif here everyday for no particular valid reasons whatsoever

hardy viper
#

chomp

graceful magnet
#

wrote the bottom one with the top one as my reference, have I done this right?

manic rune
#

not a car but very cute

gaunt thistle
#

me eating your false car

hardy viper
gaunt thistle
manic rune
#

NOOOOOOOOOOOOOOOOOOOOOO 😿

gaunt thistle
#

that value just tells lovely if you want it to go before, after, or replace the pattern match entirely

gaunt thistle
#

my car will destroy your car

hardy viper
graceful magnet
gaunt thistle
hardy viper
#

thanks

manic rune
#

very nice

#

i want a cat so badly but my mom is allergic to them 😭

hardy viper
#

not being able to own a cat is the worst fate

manic rune
#

top 1 reason i want to go to college is just to have my own personal space to have a car

#

😭

sullen fern
#

the gang

gaunt thistle
manic rune
#

a fate worse than death

#

is a fate without carrs

sullen fern
hardy viper
#

black cats are goated

manic rune
#

fr

sullen fern
#

all of them just give x1.5 mult

manic rune
#

cant understand the hate for black carrs smh

gaunt thistle
past forge
#

Is there any joker template to start doing the assets?

graceful magnet
#

okay so this should be valid?

red quarry
gaunt thistle
hardy viper
#

OH wait that was yours

manic rune
hardy viper
#

i lowkey thought that was like a stock photo

manic rune
#

😭

#

naww why does everyone have carrs

wintry solar
gaunt thistle
manic rune
cerulean rose
manic rune
#

he just needs that watermark and its literally impossible to distinguish lol

hardy viper
wintry solar
sullen fern
#

okay, amalgamate coding time

hardy viper
graceful magnet
sullen fern
#

how do i have a joker count every negative card

gaunt thistle
#

just some old film shots

manic rune
gaunt thistle
#

that's like the one non-blurry one I have

manic rune
sullen fern
gaunt thistle
#

film

#

other car

sullen fern
#

before i ask stuff like this

graceful magnet
sullen fern
#

this is currently the code for amalgamate

red quarry
manic rune
hardy viper
#

it would be even better if you put the cat in the photo

manic rune
#

😭

hardy viper
#

++

graceful magnet
hardy viper
#

install it.

sullen fern
hardy viper
manic rune
manic rune
# sullen fern so

for starters, you should use visual studio code for better coding experience, or just basically anything that supports coding

past forge
#

Okay probably dumb question but I dont know whats happening

manic rune
#

using notepad is tuff work though damn

cerulean rose
wintry solar
graceful magnet
sullen fern
#

i switched to notepad++

cerulean rose
manic rune
wintry solar
#

No you don’t

manic rune
#

the mod actually reads those headings so im curious if you need it

#

oh ok

normal crest
#

it's outdated

wintry solar
#

You should use a json file instead

manic rune
#

mhm, got it

cerulean rose
#

jason

manic rune
sullen fern
#

jasoon!!!!

manic rune
#

its

#

main.lua.txt

#

💀

past forge
sullen fern
past forge
#

i mean

#

it shouldnt

hardy viper
#

np++ is good enough usually

manic rune
#

i dont know your language, but the "Type" should be smt like this

wintry solar
#

Light mode n++ is certainly a choice though

past forge
manic rune
#

else im pretty sure its .txt file lol

normal crest
#

it does say source file... and gets cut off

#

and that's spanish

graceful magnet
sullen fern
#

oooh i like this scheme

past forge
manic rune
#

ah i see

glad osprey
#

how do i make a sticker actually show up

nocturne garnet
glad osprey
#

in the shop

wintry solar
#

Like what’s the joker

cerulean rose
#

Joᒐ

sullen fern
normal crest
#

is context.poker_hands not available at end of round

graceful magnet
wintry solar
#

No

manic rune
#

theres context.when_repeat?

graceful magnet
#

no

#

patched in

manic rune
#

ah ok

graceful magnet
#

presumably

wintry solar
#

You’d need to use some post_trigger logic

sullen fern
#

i belive all of the coding goes here

graceful magnet
manic rune
cerulean rose
#

only on bettercalc

manic rune
#

which i presume everyone should be using rn, but yeah

hardy viper
#

old calc is obsolete

past forge
#

lmao problem solved, i dont know why de .json didnt get saved

cerulean rose
#

cry_icon still not updated

manic rune
#

it doesnt automatically save

past forge
#

its vs code, but i dont automatically save for other developing reasons

sullen fern
cerulean rose
sullen fern
#

the joker code i copied (example jokers) still used oldcalc stuff

past forge
#

okay, I know there is a mod for debugging with which i can spawn the cards that i want but i cannot find it now 😅 what was the name of it?

manic rune
past forge
#

thanks

#

and sorry if I ask a lot of dumb questions

manic rune
#

nah its fine

past forge
#

Balatro community 🔛 🔝

cerulean rose
manic rune
#

asking for help is never dumb since it helps a lot

sullen fern
#

now how do i make the xmult go again for every negative joker

manic rune
past forge
# cerulean rose

I mean reading the joker explains the joker so i think thats why i dont win

sullen fern
#

what i have currently

manic rune
cerulean rose
#

WALUIGI TIME

manic rune
#

and inside the code itself, put some checking stuff in there for editions

sullen fern
#

me when i have to go into the balatro source code

manic rune
#

you will have to do that more than you think ❤️

manic rune
#

i just realized the gif flashes black

#

ruined my day

#

💔

sullen fern
#

its a reference

graceful magnet
#

what a terrible way to do this but desperate times etc etc egg

sullen fern
#

where IS the baseball card code anyway

normal crest
#

at least you recognize how horrible that is

graceful magnet
#

where can I check Cryptid

cerulean rose
sullen fern
cerulean rose
#

search name

sullen fern
#

where even IS the baseball card code anyway

graceful magnet
sullen fern
#

in the source code

#

what file is it

#

in

graceful magnet
sullen fern
#

ah

graceful magnet
#

like all Jokers

cerulean rose
sullen fern
#

this is NOT it

#

is it???

cerulean rose
#

keep searching

sullen fern
cerulean rose
#

yes

sullen fern
#

so what do i do now

#

do i do a little theivery

normal crest
#

I wonder why the self ~= context.other_joker is there if the rarity check already excludes baseball

sullen fern
#

like that one lois grifin gif

graceful magnet
cerulean rose
#

which one

normal crest
glad osprey
#

yes

sullen fern
#

steal it all.....

glad osprey
# glad osprey yes

it just doesnt show up visually bcus im currently overwriting the code that shows it

normal crest
#

you don't need to use that function

normal crest
#

you should do if next(SMODS.find_card(bla blah))

wintry solar
#

What sort of repetitions are you looking for? Playing card repetitions?

graceful magnet
sullen fern
wintry solar
#
if context.cardarea == G.play and context.individual and not context.blueprint then
  if card.ability.extra.last_card and context.other_card = card.ability.extra.last_card then
    card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.XmultGain
    return {
      message = localize(‘k_upgrade_ex’),
      message_card = card
    }
  else
    card.ability.extra.last_card = context.other_card
  end
end```
#

I think this works but it’s typed on mobile so might be scuffed

graceful magnet
#

ooo

#

kk

sullen fern
#

i honestly don't understand what i'm meant to copy from

#

in the code for baseball card

past forge
#

Okay, if I change the 1x on the assets folder how do I see the change ingame? It just keeps showing the previous art

graceful magnet
past forge
#

okay

glad osprey
graceful magnet
sullen fern
#

do i just copy it into calculate = function(self, card, context)

graceful magnet
wintry solar
old bane
#

i wonder if it's possible to make it so that glass cards never shatter with a specific joker in hand 🤔

sullen fern
graceful magnet
cerulean rose
graceful magnet
old bane
wintry solar
graceful magnet
#

there is not a last_card var whoops

wintry solar
#

You don’t need one

#

Just replace the commas

graceful magnet
#

OH

#

the quotation marks

cerulean rose
#

'

sullen fern
#

what do i copy the code i just copied from baseball card into

graceful magnet
past forge
#

ive done it, no functionality yet, but mi first joker introduced to the game

#

:D

turbid maple
sullen fern
#

it already has it

wintry solar
#

The same as baseball but for negatives?

sullen fern
#

ye

turbid maple
#

... also are you hoping to just copy and paste code you dont really understand and get things to work or do you have some vague idea of lua at the very least

wintry solar
#
if context.other_joker and context.other_joker.edition and context.other_joker.edition.key == “e_negative” then
  return {
    — put return stuff here
  }
end
#

Oh wait hold on

#

There

spring lantern
spring lantern
cerulean rose
spring lantern
#

let me just post this for context again

wintry solar
#

Put whatever you need in the return table

#

That’s it

#

That’s the entire code for your calculate function

sullen fern
#

alright

spring lantern
sullen fern
#

do i keep the comma in the return table or no

normal crest
#

you can simplify the last check to and context.other_joker.edition.negative

wintry solar
wintry solar
spring lantern
wintry solar
#

You don’t have an upgrade message

spring lantern
#

do i not?

#

this is meant to be that

wintry solar
#

Oh you’re not using the actual upgrade message

#

Smods version?

sullen fern
#

it works!!!!

vocal verge
#

HemiSalute should be this

spring lantern
wintry solar
#

There we go

spring lantern
#

am i out of date

normal crest
#

that's like, 2 months old or smt

cerulean rose
#

very

spring lantern
#

unlucky

cerulean rose
#

latest is 1410a

spring lantern
#

lemme juyst grab the newest ver

normal crest
#

and btw, if that's an upgrade message you should remove the Xmult_mod

#

that'd add mult to the score

cerulean rose
#

i reccomend using git

spring lantern
#

right lol

wintry solar
#

Especially considering you’re in the shop

spring lantern
normal crest
#

Yeah all my mods are just git clones

wintry solar
#

I’m pretty sure it’ll just crash

spring lantern
#

i forget wh yi added Xmult_mod i think someone suggested it

normal crest
#

and then I just made a script to git pull on all of them

glad osprey
#

how do i do smth when a joker is added to your joker slots

cerulean rose
sullen fern
#

i found a joker i made that doesn't have a unique effect

#

basically a placeholder for an actual effect

normal crest
#

please read the wiki

wintry solar
#

Taking advice from here is great but there are some people who give very bad advice

spring lantern
#

fair

glad osprey
spring lantern
#

was just trying anything and everything to fix it LOL

normal crest
#

that's true

glad osprey
#

so srockw, please read the wiki

normal crest
#

at least it covers one of the cases you're looking for

#

if you want to cover all cases at once maybe try hooking into CardArea:emplace and check that the card being added is a joker

glad osprey
#

ok how does one hook tho

#

also would that contain a reference to the card being added

normal crest
#

yeah it will

glad osprey
#

ok cool

normal crest
#

it's passed as an argument to the function

normal crest
#

that'd be adding code to the end of the function

#

if you want to add code before, call the reference after your code

sullen fern
#

the next joker i want to impliment is dream and friends

chrome prawn
#

I attempted to add a tooltip for an edition to a joker but now the game is telling me that edition is a nil value for some reason

vocal verge
normal crest
#

that says playing cards, so I'd assume it doesn't include jokers

vocal verge
#

well it has G.jokers

#

so idk man

glad osprey
vocal verge
#

L game /s

normal crest
#

that means that cards in your jokers area are triggered by that context

wintry solar
#

G.jokers is also actually the cardarea that’s sent to consumeables too

glad osprey
#

what

#

the hell

wintry solar
#

Not that checking the cardarea is a particularly common thing you need

normal crest
sullen fern
#

first of all, the description.

wintry solar
#

Mostly useful in context.individual

wintry solar
sullen fern
#

so, this card needs to create four spectral cards with the negative edition when a total of $100 has been spent

normal crest
vocal verge
#

Track money spent
add it to a variable starting from 0
when it hits > 100, take away 100 from the variable and create the cards
go scrooge go

sullen fern
glad osprey
normal crest
#

it's on cardarea.lua in the base game

normal crest
sullen fern
#

balanced maybe

glad osprey
sullen fern
glad osprey
#

oh wait

#

maybe it does

sullen fern
#

the var should be easy

past forge
#

Im reading the API docs for steammodded, i dont know if I just passed on that but what is G.play referencing here?

vocal verge
#

Played hand

#

I assume

past forge
#

Okayy thanks

chrome prawn
glad osprey
#

@normal crest like this??????

normal crest
chrome prawn
sullen fern
normal crest
#

put it at the top level of your file

#

otherwise that looks fine

#

actually you probably can't assign with :

spring lantern
#

who would've thought, updating my 2 month old smods fixed my issue engieDance

sullen fern
turbid maple
glad osprey
normal crest
#

yeah replace both with . and make sure to include 'self' as the first argument of your function

wintry solar
#

Just the first is necessary

spring lantern
wintry solar
#

You can leave the second one

sullen fern
glad osprey
turbid maple
spring lantern
#

why is it adding one extra dollar when i reroll

#

do i just do - 1

#

lmaop

turbid maple
#

See the examples, see how Jokers are structured

normal crest
#

oops

#

replied to wrong message

normal crest
glad osprey
#

lol

sullen fern
#

in this case

#

or would it? because i'm supossed to be tracking spent money

wintry solar
glad osprey
#

one more thing, how do i check if the card added has a sticker

#

i presume smth like card.sticker

turbid maple
#

variable names are whatever you want

#

its up to you

normal crest
#

depends on the sticker

turbid maple
#

youre creating it youre the one tracking it

sullen fern
turbid maple
#

yes

glad osprey
turbid maple
#

and it'd be referenced in the calculate function as card.ability.extra.spentmoney

sullen fern
#

so now we need to check if the amout of money spent is greater than or equal to 100

spring lantern
turbid maple
#

now that I think about it what the hell's in card.ability I never bothered to gake a look

normal crest
wintry solar
sullen fern
turbid maple
#

yes

#

you need to manually update spentmoney yourself whenever money is used though

sullen fern
#

so how do we track the spentmoney var

turbid maple
#

how it works is that when the game handles an event, the game calls each joker's calculate function with information about the event

#

so you'd need to find events that correspond to money being spent

then have the calculate function updare the variable when said events occur

#

please read this

sullen fern
#

i saw context.buying_card but that's not it

glad osprey
turbid maple
#

well as far as I'm aware the base game only offers that

normal crest
#

if self.ability.eternal and you can replace eternal with pinned, perishable, rental

turbid maple
#

i havent tried to do this before and I dont have access to the source code right now

spring lantern
normal crest
#

i don't know if every game function that spends money calls that tho

#

presumably it would

wintry solar
#

I'd have to take a look at the reroll code

turbid maple
#

I was about to offer a suggestion then I realized nothing triggers off buying a voucher so to really keep track of all money spent you'd need to do some digging intk the source code

glad osprey
turbid maple
#

I donr have access to it at this moment so I'm afraid I cant help rn

glad osprey
#

just from looking at my save file lol

spring lantern
#

i'll just leave it as this although i'm pretty sure this would also not work with certain modded jokers and such

sullen fern
#

i'm just gonna worry about making scrooge later

spring lantern
#

will figure out a non-spaghetti solution later

sullen fern
#

trying to keep track of spent money seems out of my league for now

glad osprey
#

whoopsies

turbid maple
#

actually theres probably a cryptid joker that does something like this

#

gimme a sec

normal crest
#

that's already taken into account by the :

glad osprey
#

yea no works now thanks lol

normal crest
#

you can make your own context that you can use in any calculate function btw

#

you could call SMODS.calculate_context { adding_joker = true, joker = card } for example, and then in your calculate use if context.adding_joker then blah blah

#

as an example

rose dragon
#

how can I get the amount of joker slots left?

normal crest
#

you can get the total amount of joker slots by doing G.jokers.config.card_limit, and the amount of slots used by #G.jokers.cards

rose dragon
turbid maple
#

Okay Cryptid tracks money spent by patching ease_dollars

normal crest
#

negative cards add 1 to the limit

#

so even if you had 100 negative jokers, the limit would be 105 and the amount of jokers 100

glad osprey
#

credit card still works when debuffed lol

#

anyways the sticker works now ty srock

cursive glade
#

is there a context for when a joker has spawned in? Like if I wanted a joker to have an effect as soon as it's in the jokers area instead of waiting for it to run the next calculate cycle? or would a calculate need to be added in that part of the cycle via a lovely patch?

glad osprey
#

i literally just solved that lmao

cursive glade
#

hah good timing lol

glad osprey
#

yea you would need to patch into CardArea:emplace

maiden phoenix
glad osprey
#

oh yea that works if the function is in the joker itself

cursive glade
glad osprey
#

if not,

local emplace_ref = CardArea.emplace
function CardArea:emplace(card, location, stay_flipped)
            local ret = emplace_ref(self, card, location, stay_flipped)

        return ret
    end
#

is what worked for me

cursive glade
#

as a lovely patch? what would I use to detect that?

normal crest
#

just saying that will trigger for every card area, if you want jokers specifically you're missing a check for that

cursive glade
spring lantern
#

okay so apparently this doesn't account for buying vouchers 😭

violet void
#

what if the joker appears through Judgement?

glad osprey
#

does this look banana

spring lantern
cursive glade
void pecan
#

for a banana

normal crest
spring lantern
#

i am terrified of hooks unfortunately

#

like

graceful magnet
#

okay so I've definitely misused pseudorandom_element here, it said it takes from a table of values, I was assuming I'd be able to accomplish this with an array but it appears not. What should be adjusted?