#💻・modding-dev
1 messages · Page 172 of 1
ahhh
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
still hitting the 'center is nil' error
is JTC_clue a consumable
yeah
try removing everything else except key
still nada
can you send the full crash log
are you using steamodded headers
no. those have been depreciated afaik.
yeah they have been
ah, I see what you were asking
can you send your json metadata
or really just the prefix, make sure it's JTC
with no additional spaces or anything
what if you made it increment by 1 so that when it duplicated it ended up being 2 like intended
thanks! i actually already fixed it
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
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
anything like that would be integrated into smods
we dont have a good dependency system
mhm
well in that case what code would i need to copy from cryptid to add more booster pack slots
how do i substitute a custom enhancement
you passed self instead of card
wdym
ok i wanna know, do you ever actually want to use self?
replace self with card in that juice card function
without really knowing the situation i give that a 75% chance of working
likely higher
anyone know?
ok it worked thanks
when i put in the ID of my enhancement i get this error
if you don't know, then nope
i'm pretty sure i used it like one time ever
what'd you put exactly
oh lookie ive actually used it once myself
you put m_prefix_key where prefix is your mod prefix and key is the key of the enhancement
for checking if the indexed joker isnt itself
thank you
that condition is always true
you should compare to card instead
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
now how do i get the amount of remaining hands as a number
if you have debugplus try putting a print(v ~= self) before that
to my knowledge that comparison should always be true
alright lemme test that rq
G.GAME.current_round.hands_left
thank you is it the same for discards?
i think so
ok yeah youre right
thanks for the bug fix!
lol no worries
yep it works now
any idea?
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
oof sorry, im in class rn so i cant respond quickly :(
check context.cardarea == G.play
context.card_area = G.play
ty
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"
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 😔
anyone got any idea how i would detect if another joker's ability triggers (except for self)
to create an ability something like this
You could mimic the blueprints behaviour but instead of returning the calculated jokers return you just return 4 mult for each valid return
Common????
RNJesus
goated
And art
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
context.post_trigger
the chance based condition one is impossible to fully implement
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?
probabilities in balatro are calculated by comparing G.GAME.probabilities.normal to an integer which is the odds, you can't hook that in any way without manually altering every joker using them, which does not support mods doing that
show code
ah
and i assume the same for consolation prize?
I think you need to check for the right context as well?
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
ohh
the context.main_eval is a bettercalc exclusive thing, that just makes end of round not trigger 8 times for no reason
makes sense
also if you want it to return mult which it seems to want to do
the mult was actually just a temp thing cause i was trying to figure out the timing
oh alright
well that oughta do it
thank you!
yeah
ah
consolation prize could be tuned to work only on lucky cards and only appear if lucky cards are in the deck
maybe i could rework it into like. unlucky cat? and yea like that
yeah that'd still require you taking ownership of the lucky enhancement
not a huge issue really
hmm
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
ah okay
hmm i've tried this but for some reason it doesn't trigger the card? the abilities stay the same afterward
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
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
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
New to modding, how doable is a Joker that makes rares and legendaries appear in shops more frequently?
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
Found a way to make it work!
why don't we have this yet??? anyway logistically, pretty easy
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
Can I use Lovely to patch another mod (in this case, I'd like to patch Steamodded)? If so, how?
thank you!
How do I define a global variable that can be accessed in every file of my mod?
A little like G but less powerful.
What I do is I have dependency files, and then I load them before I load anything else
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
I just define an object called Bakery_API in the global scope and shove stuff in that (Bakery is my mod id)
I like segmenting my files in a way so that my core.lua file is teeny tiny :)
i wonder if its more efficient than the way i do it or if its just a stylistic choice
it's only going to be what, 1 millisecond different once on startup? it doesn't matter much
Funny, I'm working on baked consumables
Bread era balatro modding
🥯
Uhh pretty sure if that was true there would be issues with loads of mods.
Unless something else is amiss
how do i water bread
what I meant to say is that the former does work, but every time I have to reload the function file along with the file that's using the functions
that's not an issue with name = function()
😭
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
why are you using Steamodded 0.9.8 APIs
wait what
oh yeah good point
nvm
ancient writing
tru dat
how do I add hand size like juggler does?
context.blind_boss isn’t a thing, you need to check G.GAME.blind.boss
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
What is this workaround
last_blind is a vanilla variable?
nvm I got it
Followup question, how do I check for enhancements in the Full Deck?
Is it calc_dollar_bonus or calculate_dollar_bonus?
calc one
I wanna try and get into making custom jokers, do we have any guides on that?
The Steamodded wiki has examples
Much appreciated thank u will look at everything
Might try and do better backgrounds for them at some point, but finished the art for the custom tarot cards 😄
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 :(
try adding
Xmult_mod = card.ability.extra.xmult,
to the return
your logic is wrong, add some line breaks in a hpefully you wil lsee
how do i half base chips and mult?
could take a look at what the flint does?
how
do you know how to look at the balatro source code?
if you're lucky you can use the deck's calculate function to do the same thing as the flint
I'm trying to do something but I need to know... How does copy_card work exactly?
probably easier to help you navigate that if you're a bit more specific! What part are you wondering about?
Let's say I selected a card v in a loop and want to copy that specific card to deck.
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.
Alright. That's basically what I assumed but I wanted confirmation.
I'll try and see if this works.
Thanks for the help.
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.
the kind thief
I guess I should destroy the joker otherwise you can spam the same hand (but what are the chances of this happening)
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
Looking at the source code for Baseball, context.other_joker is used, that should probably help!
How do I return a message without exiting my loop?
Hello! New to modding here, wanted to ask how to add SMODS to my mod so I don't get this?
the LSP doesn't know about smods if you don't have it in your workspace
my modding workspace contains my entire mods folder
I created a cardarea above the Joker's cardarea (offscreen)
Hmmm I click add folder to workspace and select SMODS? Doesn't seem to be it
(I'm 100% doing it wrong)
How do ya do that, haven't looked into creating custom card areas before
Its in hook.lua and CardArea.toml
Oooo cheers
could you send me the source code for baseball so i could have a look?
You can unzip the game exe and check the files yourself if you want (forgot which exactly, I think card.lua?)
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
How do I return a message without exiting my for loop?
card_eval_status_text(card, 'extra', nil, nil, nil, {message = localize('ph_boss_disabled'), colour = G.C.RED})
probably
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
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!
Hmm added smods to my workspace and still get this issue
whats the correct way to patch smods?
would this be unstable? im trying to make the mod not require talisman but still work with it
it works but im not sure
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
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
having each joker as a seperate lua seems untidy so i’m gonna go the cryptid route
so i’ll have a lua file for each joker class (eg. nonlegendary.lua, legendary.lua, tokipona.lua, doilus.lua, etc.)
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
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
bumping this
with launching lovely do you mean the .dll? I see no other lovely file
oh sorry i meant balatro
my bad
@violet void is this the method for importing vouchers?
It can be if everything is correct
it worked, thanks
this is my file directory
but it crashes :(
it shouldnt if you are doing the same as the seals
and that doesnt seem to be a folder
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
it should be vouchers folder with a vouchers.lua inside?
'e_negative'
Ah, thanks
iirc game auto created vouchers.lua outside that folder when I launched the game
it didnt work as well
if you need it that way
just do the same for the seals but with vouchers
Would evaluate_poker_hand(hand).top give you the name of the hand that a set of cards would be played as?
still crashes!
add a / after voucherssss in load_file
can i use hex codes for ConsumableType
yes
alright
can either be HEX('FFFFFF') or just 'FFFFFF'
Is there a program that looks for small errors like this?
or extension
dont know, it's a lack of understanding from your part, your previous code was looking for a file in objects folder called voucherssssvouchers.lua
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
is there a way to check if any card is sold, instead of itself
cuz just selling any joker works
apparently debuff_card is more complicated, read this
but how does making an object use a part of an atlas work
atlas = <atlas name>
pos = {x = <x>, y = <y>}
``` iirc
ahhh ty
yea thats how it is
x and y are ints that get multiplied by the px and py of the atlas btw
context.selling_card
this applies for any card, for only jokers also check whether context.area == G.jokers
so x=1 and y = 0 of a 75x91 atlas would be 75,0
coolio
fyi this info is on https://github.com/Steamodded/smods/wiki/calculate_functions
main issue was i just couldnt find the disable function lol
ah gotcha
now, i think it’s time i learn how to make my own joker
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?
hypothetically the stickers code would look smth like
if context.buying_card and card = c1 then
debuff card
end
if context.selling_card and context.area == G.jokers then
rebuff card
end
right?
can you format it like how you would see it in the code
card = c1?
it wasnt very clear
https://github.com/Steamodded/smods/wiki/SMODS.Joker
SMODS.Joker({
key = "key", --translates to j_modprefix_key later on
--other fields...
})
that table is the context that's provided when context.buying_card is true
context.card will be the card that's being bought
add the first event and then do card_eval_status_text immediately after (so take it out of the first event)
they will be consecutive since card_eval_status_text adds events as well
what is c1?
im not sure thats just what the guide says
"The card being bought also calculates itself with context { buying_card = true, card = c1 }."
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
oh true
Hello there
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)
how would i implement a joker similar to maximized from cryptid?
👋
what does that joker do
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
is that the one that makes all face cards kings and all numbers ones
yes
im struggling to implement a similar joker
That worked. Thank you.
this is that mine needs to do
this also doesnt work
hook Card:get_id() and make it return whatever number you want for the circumstance
supposed to debuff hearts while joker exists
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
mhm
would
if context.playing_card_added and context.cardarea == G.joker and context.cards == card then
work?
you wouldn't do it in a calculate no
o
https://github.com/Steamodded/smods/wiki/SMODS.Joker
use add_to_deck
it's documented there
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)
yeah I mean when you call extra.mult that's not a thing you have, you have Xmult
does add_card/create_card work with modded rarities?
so what do i do
change every instance of extra.mult to extra.Xmult
yeah
now how do i use said function
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.
sick
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
this is what my main lua file looks like right now
does anyone know how crypid allows more booster pack slots to be added to the shop?
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
jankily
am i hooking correctly? i am new to lua so i get tangled up in the basics
great
how do you use it? I tried putting the rarity's name but that crashed
i'll check real quick
you need to call the old function, so instead of local ret = Getid_old it'd be local ret = Getid_old(self)
you also need an end for that if statement
ohhh
it has something like this
@wintry solar is there a way to modify this patch so it allows ANY pack to have extra choice?
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
how much of a problem would that to be to copy paste
cus im making a deck that adds an extra booster slot
@smods please add booster slot api
better now?
i dont think it would work
like bro 😭
you don't call the initial reference, should be local Getid_old = Card.get_id
mhm fixed
what mod is this?
all good now?
cryptid
Getid_old(self) instead of Getid_old()
other than that, looks good
uh, I'm pretty sure I'm not missing that }
for some reason its hard coded when there is a card_limit 🙄
this is from ortalab (does it also work?)
mhm
forgot to give the line numbers
you can't just put an assignment to some card config value into a return table
okok, last question, do i place this inside the joker code or like outside with a check for the joker?
oooh
would be awesome if smods added it so everyone can stop patching that line
outside with a check for the joker
thank you very much
yeah that's stupid, I've wanted to patch this out but forgor
this will work but you need to also check whether you have the joker that allows this to happen exists
🤔
will be soon fr trust ong
seems smarter if it does work
could perchance add these 2 variables
as I thought, it actually doesn't activate on card retrigger, but basically anywhere else in play
starting to get somewhere now
next(context.poker_hands["Flush"]) is correct for checking if currently selected cards contain a Flush, ye?
So this checks the type of booster pack but what types of boosters are in vanilla? what can I insert instead of 'ggg'?
hmm
it's used in vanilla code
how do i give a joker a modded rarity
in said code, it is defined as a local variable prior to being used
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?
rarity = 'prefix_key' where prefix is the prefix of the mod that adds the rarity and key is the rarity's key
thanks :D
ahhh, okayyy...
so just using context.repetition causes it to activate on every initial card score and repetitions is assigned locally, what other manner would let me check for a card being retriggered?
what are you trying to achieve exactly?
gaining Xmult each time a retrigger effect occurs
you'd have to add your own context, steamodded doesn't support that out of the box
ech, mk
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
This is something I plan on doing along with voucher slots
how do i do that agian
toki pona mentioned
there's more where that came from
i just need to figure out how to actually add the names for rarities
also i've been adding some apis in #1338044836087070740 if someone wants to port them over to SMODS #selfpromo
What are dyna blinds and why is it needed
Can’t you just edit the blind score and call the ui to update?
what is dynablinds
dynamic blinds??
what for??
yeah
but like what for
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
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
also will be adding more soon
I still don’t understand what it does
check blue seal 
If you need an idea for a money joker, consider The Joker Of Wall Street or something lmao
Besides that those look really cool
Is it just a function to change the blind scores?
blinds can provide a score function that gives the required score for that blind
also works in the Upcoming state
Oh rather than just a multiplicative value?
yeah
I see
The Point does that with it for its ^1.5 base
And what are all the functions you’ve created for?
i has a wiki
what id "dump_loc": false in the metadata exactly for
You can check if #context.poker_hands["Two Pair"] > 0
I believe
I don't remember exactly what it is
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
currently have planned safe compare for Talisman and a quick booster creator
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
Why wouldn’t you just use G.GAME .blind.chips (from memory might be different)?
doesn't exist for upcoming blinds
Oh okay that seems pretty niche but sure
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
@wintry solar why's this cardarea isn't it normally just area
could someone test my mod i cant open balatro rn (steam family share)
StrangeLib.dynablind.get_blind_score is always up to date (is used by StrangeLib.dynablind.update_blind_scores)
okay i need to actually get to coding amalgamate now
beat up your brother shrimple 😇
It’s the place the area the card doing the calculating is
in law
also i couldnt do that to my sister
ohwas it sister i forgor
no
my sister married him
cardarea isn’t a particularly useful part of most context tables
gotcha
i shall start posting one cat gif here everyday for no particular valid reasons whatsoever
chomp
wrote the bottom one with the top one as my reference, have I done this right?
you need to include a
[[patches]]
[patches.pattern]
at the top of every patch
that's an invalid position field
that value just tells lovely if you want it to go before, after, or replace the pattern match entirely
ah okay, well I'd ideally like to put it in around here, which is what I've gathered is the scored card repetition area
awwwwwwwwwww cute
thanks
is that yours?
very nice
i want a cat so badly but my mom is allergic to them 😭
💔
not being able to own a cat is the worst fate
top 1 reason i want to go to college is just to have my own personal space to have a car
😭
the gang
fr
they don't have unique code yet
black cats are goated
fr
all of them just give x1.5 mult
cant understand the hate for black carrs smh
yeah she's a weirdo
Is there any joker template to start doing the assets?
okay so this should be valid?
still doesnt works sadly
OH wait that was yours
you could try using a mod from mod-example
i lowkey thought that was like a stock photo
Pretty sure this code is removed by smods
????????????
nah but thats lowkey justified
yeah, end of round doesn't have a poker hand property
he just needs that watermark and its literally impossible to distinguish lol
it just has like stock photo composition with the insane amount of focus
bump
that is NOT a cat!!!
There’s a last played hand field somewhere
okay, amalgamate coding time

Guess I'll... have to see
how do i have a joker count every negative card
go through G.jokers.cards then check their editions
that's like the one non-blurry one I have
nah but why r ur photos so cinematic 😭
oaky i actually need to learn how to actually code a joker
before i ask stuff like this
ah-
this is currently the code for amalgamate
i also check the blue seal, but i lack the knowledge to actually breakdown what the code actually does 😂
we all start somewhere dw lol, if you havent known the basics of LUA yet then i suggest checking the language tutorials first
this is awesome
it would be even better if you put the cat in the photo
++
oops forgot a quotation
install it.
so
😭
did you flash him 😭
for starters, you should use visual studio code for better coding experience, or just basically anything that supports coding
Okay probably dumb question but I dont know whats happening
using notepad is tuff work though damn
G.GAME.last_hand_played == ‘Two Pair’
It doesn't do anything 🫡
i switched to notepad++
unrelated to your error but the assets folder should be lowercase
wait so quick question, do you need this in your main.lua?
No you don’t
it's outdated
You should use a json file instead
mhm, got it
jason
nah but imagine
jasoon!!!!
its not lmao
who reacted with frowning
np++ is good enough usually
i dont know your language, but the "Type" should be smt like this
Light mode n++ is certainly a choice though
ok, no, its not
else im pretty sure its .txt file lol
so it probably is based on how nothing's happening, so now I'm lost on what I have to write to check for repetitions, since uh, what I assumed checked for repetitions gets removed 
oooh i like this scheme
It says "Archivo de origen Lua" so its the same but in spanish
ah i see
how do i make a sticker actually show up
insult to my eyes why is it lightmode 😭
in the shop
What are you trying to do?
Like what’s the joker
Joᒐ
i know how to i'm just tryna be funny
is context.poker_hands not available at end of round
Gain XMult when a retrigger effect happens
No
theres context.when_repeat?
ah ok
presumably
You’d need to use some post_trigger logic
i belive all of the coding goes here
oh?
you can just use x_mult = card.ability.extra.Xmult and remove the message part actually
only on bettercalc
which i presume everyone should be using rn, but yeah
old calc is obsolete
lmao problem solved, i dont know why de .json didnt get saved
notepad issues
still not updated
it doesnt automatically save
its vs code, but i dont automatically save for other developing reasons
i am using bettercalc
the joker code i copied (example jokers) still used oldcalc stuff
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?
im pretty sure it still works, just that its outdated i think
debug plus
nah its fine
Balatro community 🔛 🔝
asking for help is never dumb since it helps a lot
now how do i make the xmult go again for every negative joker
my jokers' description is literally that 😭
I mean reading the joker explains the joker so i think thats why i dont win
what i have currently
you could try checking baseball card code in balatro's source code
WALUIGI TIME
and inside the code itself, put some checking stuff in there for editions
me when i have to go into the balatro source code
you will have to do that more than you think ❤️
its a reference
what a terrible way to do this but desperate times etc etc 
where IS the baseball card code anyway
at least you recognize how horrible that is
use SMODS.find_card
also check cryptid candy cane 
where can I check Cryptid
i need to know how to find specific cards in the source code
search name
where even IS the baseball card code anyway
what file is it in
card.lua
ah
like all Jokers
keep searching
this?
yes
I wonder why the self ~= context.other_joker is there if the rarity check already excludes baseball
do i steal it all
like that one lois grifin gif
STILL not activating, I'm goign insane 
which one
does it even have the sticker
yes
steal it all.....
it just doesnt show up visually bcus im currently overwriting the code that shows it
This is so cursed
please put your message in the return
you don't need to use that function
other_card is never defined anyway
you should do if next(SMODS.find_card(bla blah))
What sort of repetitions are you looking for? Playing card repetitions?
yes, any retrigger on a card
but which specific parts should i steal
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
i honestly don't understand what i'm meant to copy from
in the code for baseball card
Okay, if I change the 1x on the assets folder how do I see the change ingame? It just keeps showing the previous art
everything inside of the "if this is Baseball Card" ifthen
Change the 2x too
okay
oop, formatting
so, this?
still not workign pls i need help
yes
do i just copy it into calculate = function(self, card, context)
(I need to remember to add the line numbers)
Oh I missed a double equals in the if
i wonder if it's possible to make it so that glass cards never shatter with a specific joker in hand 🤔
or do i copy it into if context.joker_main then
uh oh
joker in hand
use bettercalc xmult
oh oh hold on
my bad, joker in consumable slots
Oh it’s scuffed iOS inverted commas in the localise
there is not a last_card var whoops
'
what do i copy the code i just copied from baseball card into
Yep works now, time to test everything I can
the joker object you made needs to come with a calculate function
thats where all the effects are handled, so stuff it into there
it already has it
How do you want the joker to function?
The same as baseball but for negatives?
ye
... 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
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
tried this, didn't fix it :(
checked through the code a couple times and im still not sure where the error is
use xmult
let me just post this for context again
so what now
Put whatever you need in the return table
That’s it
That’s the entire code for your calculate function
where, the return table?
do i keep the comma in the return table or no
you can simplify the last check to and context.other_joker.edition.negative
What isn’t working again?
It doesn’t matter
the joker upgrades but the upgrade message doesn't happen
You don’t have an upgrade message
it works!!!!
should be this
version.lua says "1.0.0~ALPHA-1230c-STEAMODDED"
There we go
am i out of date
that's like, 2 months old or smt
very
unlucky
latest is 1410a
lemme juyst grab the newest ver
and btw, if that's an upgrade message you should remove the Xmult_mod
that'd add mult to the score
i reccomend using git
right lol
Especially considering you’re in the shop
actually yea i should hook up github to it
Yeah all my mods are just git clones
I’m pretty sure it’ll just crash
i forget wh yi added Xmult_mod i think someone suggested it
and then I just made a script to git pull on all of them
how do i do smth when a joker is added to your joker slots
someone def did, they wrong tho
i found a joker i made that doesn't have a unique effect
basically a placeholder for an actual effect
context.buying_card
please read the wiki
Taking advice from here is great but there are some people who give very bad advice
fair
that wouldnt work if the card was gotten from buffon pack / judgement tho i think
was just trying anything and everything to fix it LOL
that's true
so srockw, please read the wiki
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
ok how does one hook tho
also would that contain a reference to the card being added
yeah it will
ok cool
it's passed as an argument to the function
here's a random example i made
that'd be adding code to the end of the function
if you want to add code before, call the reference after your code
the next joker i want to impliment is dream and friends
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
wouldn't it just be something from here?
that says playing cards, so I'd assume it doesn't include jokers
that unfortunately only applies to playing cards
L game /s
that means that cards in your jokers area are triggered by that context
G.jokers is also actually the cardarea that’s sent to consumeables too
Not that checking the cardarea is a particularly common thing you need
is your mod prefix "moss" and your edition key "green"
first of all, the description.
Mostly useful in context.individual
This snippet of crash and code isn’t remotely helpful
so, this card needs to create four spectral cards with the negative edition when a total of $100 has been spent
why make it only one line
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
now it is two
what do i replace Card.draw with for the CardArea:emplace
it's on cardarea.lua in the base game
i feel like the 2nd line is way longer than the first
balanced maybe
this does not mean anything to me rn
i need to figure out how to do all of these
the var should be easy
yes
Im reading the API docs for steammodded, i dont know if I just passed on that but what is G.play referencing here?
Okayy thanks
well is this the line of code the crash points to but the game only crashes when I have the info_queue line
when I remove it the game works normally
@normal crest like this??????
don't put the hook inside the calculate
this line of code is attached to an edition btw
the info_queue is attached to another joker
if i knjew what the var should be
put it at the top level of your file
otherwise that looks fine
actually you probably can't assign with :
who would've thought, updating my 2 month old smods fixed my issue 
how do i track money spent and add it to said variable
joker specific vars go into the config field with something called extra in it i forget the specifics
so replace those with periods?
yeah replace both with . and make sure to include 'self' as the first argument of your function
Just the first is necessary
think something's wrong with the math tho
You can leave the second one
what should i name the variable
period or self
Look I really suggest taking a look at this https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua
See the examples, see how Jokers are structured
they mean you can leave the function as it is, just replace the first : with .
oops
replied to wrong message
this
lol
so it would be money
in this case
or would it? because i'm supossed to be tracking spent money
The rerolling cost is changed before your calculation
one more thing, how do i check if the card added has a sticker
i presume smth like card.sticker
depends on the sticker
youre creating it youre the one tracking it
yes
its a modded one, similar to the perishable/eternal stickers
and it'd be referenced in the calculate function as card.ability.extra.spentmoney
so now we need to check if the amout of money spent is greater than or equal to 100
of course it is 😭 guess the solution is slapping a -1 then
now that I think about it what the hell's in card.ability I never bothered to gake a look
i'm not sure how to check modded ones
might mess up with free rerolls though
and if that's true, then create four negative spectral cards and reset the spentmoney var
so how do we track the spentmoney var
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
i saw context.buying_card but that's not it
how do you normally check?
well as far as I'm aware the base game only offers that
if self.ability.eternal and you can replace eternal with pinned, perishable, rental
i havent tried to do this before and I dont have access to the source code right now
wait shit true is there a better way of doing it then?
maybe hook into ease_dollars?
i don't know if every game function that spends money calls that tho
presumably it would
I'd have to take a look at the reroll code
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
appears to be self.ability.<mod prefix>_<sticker key>
I donr have access to it at this moment so I'm afraid I cant help rn
just from looking at my save file lol
i'll just leave it as this although i'm pretty sure this would also not work with certain modded jokers and such
i'm just gonna worry about making scrooge later
will figure out a non-spaghetti solution later
trying to keep track of spent money seems out of my league for now
whoopsies
remove 'self' from the function parameters
that's already taken into account by the :
yea no works now thanks lol
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
how can I get the amount of joker slots left?
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
yeah but what about negative cards?
Okay Cryptid tracks money spent by patching ease_dollars
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
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?
i literally just solved that lmao
hah good timing lol
yea you would need to patch into CardArea:emplace
Look into add_to_deck function
oh yea that works if the function is in the joker itself
thanks. i'll look into it
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
as a lovely patch? what would I use to detect that?
just saying that will trigger for every card area, if you want jokers specifically you're missing a check for that
which kind of effect?
Something like "He comes with an entourage. Upon purchase, also adds X, Y, and Z Jokers. (must have room)"
okay so apparently this doesn't account for buying vouchers 😭
what if the joker appears through Judgement?
does this look banana
do i actually just gotta bite the bullet and hook into ease_dollars
No idea. I'd have to test that and decide how to deal with it.
add a brown dot at the top instead of it being all yellow
for a banana
that's probably way easier anyway tbh
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?
