#💻・modding-dev
1 messages · Page 311 of 1
eval G.jokers.cards[jokerpos].debuff = true
Test your code by playing Balatro after saving in a section to check for errors.
but
but how do i get the current game speed. i want to change an event delay to make timing consistent across game speeds
i put this in each's calculate?
No, you put it in the console.
I think the timing of Events is adjusted automatically
As long as you don’t change the Timer they use
Is "retrigger discarded card" a thing or am I imagining things up?
how do i type in the console? ive really been aping with debug mode, like moving it wth a stick from 20 inches away
Press /
thank you !
if a joker still is active even though debuffed, is there a context i can add to double check it IS debuffed?
this should be handled by the debuff itself. What parts of the joker are still active?
its for a previous joker that only triggers when it detects that player has earned a certain amount of dollars within a blind
it still is triggered and does the dollar counting despite being debuffed
hmm, interesting. I assume it paysout with the payout function (I forgot what it's called), right?
Might be a gap in the code, because base balatro doesn't allow for a joker to be debuffed outside of a blind, I don't think
well my dollar checking is a bit primitive, i can paste the code here
just check for card.debuff
so if not context.card.debuff?
context is for information that a context gives you. so it depends on what you want to check and where
when I say card I refer to a generic card, the exact location of which depends on what you're trying to do
but how do i force a card's effect to deactivate when debuffed?
If it's not deactivating then just check for not card.debuff
If that doesn't work I'm going to need more info because I haven't been reading the convo
can you show the code? I'm curious to see why it doesn't debuff.
if context.setting_blind then
card.ability.extra.moneytrack = (G.GAME.dollars + (G.GAME.dollar_buffer or 0))
card.ability.extra.moneyearned = 0
card.ability.extra.spe = 0
end
if G.GAME.blind.in_blind and card.ability.extra.moneytrack ~= (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) then
if card.ability.extra.moneytrack < (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) then
card.ability.extra.moneyearned = card.ability.extra.moneyearned +
((G.GAME.dollars + (G.GAME.dollar_buffer or 0)) -
card.ability.extra.moneytrack)
card.ability.extra.moneytrack = (G.GAME.dollars + (G.GAME.dollar_buffer or 0))
end
if card.ability.extra.moneytrack > (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) then
card.ability.extra.moneytrack = (G.GAME.dollars + (G.GAME.dollar_buffer or 0))
end
if card.ability.extra.moneyearned >= card.ability.extra.moneycap then
card.ability.extra.spe = card.ability.extra.spe or 0
card.ability.extra.spe = card.ability.extra.spe + 1
if card.ability.extra.spe == 1 then
local eval = function(card)
return (card.ability.extra.moneyearned >= card.ability.extra.moneycap)
end
juice_card_until(card, eval, true)
return {
message = 'PD',
colour = G.C.MONEY,
card = card
}
end
end
end
if context.end_of_round and context.game_over == false and context.main_eval then
card.ability.extra.moneyearned = 0
end```
all of that shouldn't work on debuff
it does work on debuff
i have the return message, the jiggle
but
the effect after of xmult doesnt apply
if context.joker_main then
if card.ability.extra.moneyearned >= card.ability.extra.moneycap then
return {
xmult = card.ability.extra.xmult
}
end
end```
this comes rigth after the brick
it's weird asf
hmm there's probably some contexts like other_joker that run on debuff or something, doing things in calculate outside of a context is wacky
i don't think i have things outside of context here?
just add a not card.debuff to your ifs
alright
what should i do if i want to update an achievement description during runtime 
i see some but im on mobile so i might be misreading
ive doubled check, i have nothing outside
theres definitely things outside context
did i paste it wrong?
if G.GAME.blind.in_blind and card.ability.extra.moneytrack ~= (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) then this line for example
almost everything is outside of context in that code, no?
should i add a context ?
yes you don't want thjis to run every single time a calculate is called
what does the effect do?
i disagree i think they want this to be a constantly updating function, no?
Does smods have a native 'money earned' context?
it's meant to detect the amount of dollars earned within a blind
then it should be in an update function, not a calculate
You can also use if card:can_calculate()
i agree with that
If it's about earning money, I'd potentially set up a custom context call that's hooked onto ease_dollars 🤔 unless that's not consistently used in the vanilla code?
giving u reddit gold
how do you set up a custom context?
i dont think ive seen it in calculate function doc
or im a bad reader
function ease_dollars(mod, x)
base_ease_dollars(mod, x)
for i = 1, #G.jokers.cards do
local effects = G.jokers.cards[i]:calculate_joker({kino_ease_dollars = mod})
end
end``` I've got this in my code, though that's an old implementation from before I knew SMODS.calculate_context() exists, which should save you the step of iterating over all the jokers
Giving you an Eldlich
are u calling eldlich reddit thats mean
It’s the first gold Reddit card I could think of, I didn’t mean to call it Yu-Gi-Oh!
also, kino_ease_dollars isn't defined anywhere. It's just the arbitrary name I chose for this context, using my mod prefix to ensure it doesn't have any conflicts with other mods.
so i'd put it outside of the smods.joker part?
Why not use the function that runs all calculation
let me rewrite it to be a proper context, because that'd need to happen anyway, so there's an actual example of SMODS.calculate_context() to show off
because this is just a snippet of old code that I wrote before I knew about that function's existence, haha. But after sending it to show that you can just pass anything as an argument to a calculate function, I realized the janky implementation is probably more confusing than helpful, haha
thank you very much for taking the time to explain, yall are very cool
Function that runs every frame, and its not just unity, its like.. any game loop has an update function
the name of the context here is arbitrary, but the best thing you can do is to make sure it's unique. The mod that's being returned is the change in money. This'll be send to every card in every enabled card area, as far as I understand
Rise.
so here the context would become context.kino_ease_dollars?
do base cards not have an empty calculate function to hook into? The other option is a dummy voucher
Invisible Joker
yes! If for example, I received $20 from a Hermit, and I'd have a 'print(context.kino_easy_dollars)' in a calculate function, it'd print 20 in the console.
incredible
and i put it outside of the smods.jokers, without anything surrounding it?
each mod should have its own calculate function tbh
I talked about it with aure recently
yes, it's its own hook
I think there should be something like a GameRule object
what do you mean?
That users can create a CardArea to add to
just a global calculate you can use to do effects without cards
i hook calculate_context to do that but i want a cleaner way
From our discussion, I think a per-mod calculate function isn’t as useful
Because you can’t control the timing
And you can’t split it into chunks
ooooh. Yeah, I'd agree
So an object made for that purpose inheriting from Card would be better
i agree with the timing I don't understand this part
Don’t have a giant tower of if-else-ifs
eh i can live with that
It makes handling the return a bit harder
Because you need to collect different parts together manually
Instead of the pipeline handling it for you
makes sense
Do you create objects that inherit from card
no
i think the only objects ive created that inherit from something is the uiboxes in jokerdisplay
also, does it lower if played loses gold? (aside from set_money, more like from the boss that takes 1dollar away from you each card played)
yes! (i currently only use it for jokers that do something on money loss)
is there a way to not take money loss into account? like only positive ease_dollars?
like if ease_dollars >= 0
As in what? Once the game is fully loaded?
you can do that before the calculate, this way, or you can check on the joker itself
i am the bearer of my own misery
before the calculate?
as an if statement around the SMODS.calculate_context, I mean
i still don't understand, can you screenshot that message again
oh so it'd work, nice
I was in this exact problem. I was in a vc and as soon as I explained it, people just started making "I'm just using slang" jokes
thank you n
That makes sense, but I can't think of anything I would add that wouldn't be attached to cards or a deck
I use it for my mods banishing mechanic
Things that debuff themselves
biomes, weather condition, day night mechanics
every vanilla balatro mod wants to add a day and night cycle
it's all the rage rn
blind skills
Day for 3 blinds, night for 2. Every 10 rerols in the shop progresses time by 1 blind
local t = func(), func returns nil, t crashes
what is t used for
read the code and find out
my current notes for day night cycles is based on blinds played, with weather being determined by rerolls and hands played, depending on the biome, of course
You'd have to tell us. If you have mods, the line number changes from base smods
Plus different versions also changes it
it's probably from my own mod
i love patching into smods, it's very funny seeing people on mac have the weirdest things happen to them
it crashes every time i open a booster pack from my own mod
aw thanks :3
decided to go a tad bit unserious for this one, since sushang and guinaifen r goofy
Still doesn't mean anything. The error originates from from an smods file
Angry brids
i should add a notice to multiplier that it doesn't work on macos then
same with the reroll butan
Takanashi Kiara!
fuckgn chickn
I wish I was better at debugging, because following these stack traces can be quite a struggle
Wheres your error
this usually means an smods function got a nil value and therefore the stack trace ends there
solved it, just took me fucking too long to figure out. forgot to pass a config in my UIBox declaration. Was more so venting 😛
Still seeing what that value is, is useful. I've never seen an smods function that has its argument set to T.
looks like a crash in SMODS.create_card
happens multiple times, it's used locally as a shorthand for table
t is a shorthand for tabl- yeah
N already found their error in the thread
t is shorthand for this fucking function that i hate
I mentioned the birdss before
The non negative one looks like the chick who drops an egg
I mean the defining of the function.
chat does anyone want to write all the wiki pages for all 329 jokers in my mod
i feel like your jokers are so archetype bound that individual pages might not be necessary, haha
i feel like i wanna make a wiki page for my mod but i don't think it has enough content to warrant one yet
I got a Google sheet lol
how do you know it's coming from the wiki
262 views from google dot com
there we go
oh stars, give this bepis a blessing
draw the right half of it or just the top right corner
oh, sick, is that a git addon you've set up? this isn't base functionality, right?
it is
like, AT LEAST the chinese fan gave me a clear view on where to begin, the fan itself then the details
this looks straight out of art hell
one funny thing to add to this is to make everything booster packs
voucher booster packs
insights > traffic
oh damn
yeah basically all Kino's traffic is from the wiki, haha
oh right i need to add an re-extraction mechanic to my boosters
please don't completely override generate_ui i am patching smods to add the butan 🙏
the what
butan
butan
böton
butan
is there a trick to draw these easily
most of my mods traffic is apparantly from an empty wiki page that i didnt even make wtf lol
or do i have to manually draw them??
Booster pack booster pack.

perfect.
alternate between a lighter and a darker white ig
Fuck it I’ll make that
i actually need to add a booster pack booster pack to my mod eventually
also yes a voucher pack has already been made by betmma
not the same thing but i did this:
Real :3
ui code !!!!!
gacha ,,,,,
If we both make booster pack booster packs what are the chances you can get my booster pack booster pack in your booster pack booster pack?

you should definitely add ghost rare and such N'
also this
does absolutely nothing but look cool + rare
0 my mod is xenophobic
1984
i should probably look into seeing if card areas can easily have columns like the collection menu has
i hate shaders

pretty sure the collection is just multiple card areas layered
if even you hate shaders then im genuinely cooked 🥀
since you cant move cards up and down
💔 i have to do it manually 🥀
but i think its possible cause aikoyori was making solitaire in balatro
i just dont think its natively supported
i have 17 views from... a russian steam guide with an unofficial translation? neat
i should really expand my mods wiki page but im lazy
im trying to make the stupid 9 blues 1 gold joke with a booster pack
pyoncord swag
where do yall check that
i havent checked my insights for a while
github page > insights > traffic
im almost done with my joker list. just need to finish the biggest page https://balatromods.miraheze.org/wiki/JoyousSpring/Jokers
DEEPSEEK????????????????????????
lmao
?????
theres no fucking way someone asked like "where do i download balatro lobotomy mod" on deepseek
cooler google
browser
oh ic
do the numbers from the mod manager's downloads get added in these too?
no
they should appear in clones
but why would you??
we just dont know
...damn.
also, seems like a few days ago basically everyone's mod got forked by the same user
i dont believe people actually do that 😭
which. is interesting
my mod didnt get a fork lol
is it? all they've done is fork and run the image optimizer thing
https://github.com/pumpncode/bamopa has submodules pointing to all of their forks
-# likely because its unfinished ❤️
fork..,,
spoon ,,,,,
...interesting?
it seems like just another all in one modpack
give me allthemods or give me death
will this reach 3000 jokers
kino and pokermon are there
they disabled pokermon
no joyous tho
lmao
joyous ,,,,
I've been busy with my mod that i never got the chance to properly give joyous a shot
i think it's in the most stable state yet rn
im guessing they dont want mods that completely overwhelm other mods?
i have 2 names that i know about yu gi oh and it's fucking related to the women on the cards and nothing more
💔
i love women
dark magician girl
I feel like both Kino and Pokermon are pretty good at overwhelming other mods, but who knows, haha
silent magician
Hmm, Glue for Modpacks also has the wiki as its main traffic source, but I don't think it's on there at all
nonexistent wiki page
silent magician is more beautiful than dark magician girl, change my mind
lobcorp might become another "overwhelm other mods" mod </3
also what the fuck i looked at the abnos list and i'm actually halfway done
congrats
Hmm, either drawstep or my use of dynatext is a major assault on fps
ahhhhh
joyousspring adds a bunch of new mechanics, thats probably the main reason
extra deck, graveyard and such
Well, no need for dynatext then
if a mod has an option to turn off all vanilla jokers it's kinda a red flag
and their jokers dont really go well with jokers from other mods/vanilla jokers, or maybe thats just what im seeing
(for overwhelming mods)
true
my "turn off all vanilla jokers" is locked behind a challenge (all of my jokers are anti synergetic with each other)
lcorp's jokers are still useful with vanilla jokers, so i think its why its still included in huge modpacks
hell - they dont even go well with each other most of the time 🥀
how do you even beat that challenge without getting punishing bird early 😭
mosb wins on the spot
I'm fine with people adding Kino to modpacks, but honestly, I think it's a better experience to either play it without other content mods, or to just play those mods without Kino, because I add way too much garbage, haha
yeahhh same
adding cryptid just kinda negates all the bullshit i put in my mod
(semicolon being able to skip noon ordeals is cool and intended though)
has anyone beat ahab fair and square yet, myst
hmm
(unseeded, only lcorp as a content mod)
mine is now turned on by default 👍
(mostly because of the custom rarity system i implemented)
i should've added joyousspring to my android mod list before i decided to head off for vaca
damnit
holy shit
holy shit localthunk in limbus company
localthunk in limbus ,,,,,
||i did :3||
AHEM
anyways, what were we talking about again
we should add limbus company in balatro
now, why does flipping cards act strangely? Can I just modify the flip on the enhancement? 🤔
imagine don quixote boss fight in balatro though
(i have never played any project moon game)
you should (unless you value your sanity
we should add hello charlotte to balatro
my sanity is already strained playing blue archive i don't wanna go completely insane
man, i miss void
if u dont want to go insane, definitely try out lcorp first :3
-# the game, not the mod
my scrumptious lack of money:
i should play it someday
definitely
question, how do you reset discard count after having sold a joker that adds discard? I made the mistake of putting it on selling_self...
add_to_deck and remove_from_deck!
👆 react this man
inside the smods joker?
yes
in calculate?
nop
thanksss
My brain gives me ideas while I can’t even code mediocre jokers, it’s truly a curse
-# note to self, maybe add joker called ‘mediocre joker’
my brain doesnt give me any ideas
I have lots of them, some good, some bad, all high quality shitposts
I just think ha I like that meme, and then I go what if it was a very intricate ability in poker

Thus I am now coding hit joker golden sigma
oh what, bocchi discord server exists???
theres probably a discord server for anything
true
I get my girlfailure emotes from there

amazing.
you eat girlfailures?? 😭
scary
is that why theres barely any girlfailure left in society
me i am failgirl
Literally 1984
do loc vars work in the name of a joker?
oh
lol
do they work in tooltips tho
idk, i mean when is the name of my joker realistically gonna appear in a tooltip
my suspicion is that this might cause crashes when they're tooltipped
if they get abducted by an alien abduction joker in Kino starting from next update, they'll try and show the joker name
a tooltip or any point where name_text is used, like a modded blueprint-like or something
i have this problem with using colors in the names
so i had to hook localize to fix it
anyone know how id do a joker like this
"if the card to the left would trigger at end of round, trigger it when this card is scored"
easiest way is to send a :calculate_joker to every joke that contains the same context parameters as end_of_round, but I do think you might get some really strange effects from this that aren't intended
I'm trying to add a boss blind but when i get it on a reroll i get an crash saying attempt to compare number with boolean ill send full crashlog if needed
yea thats what i was worried about
additionally id like to run calc_bonus for the end of money round
crash log please!
this will have to do with your in_pool func for the blind, I suspect
idk why it's true and not 8
i don't have one it's {min = 2, max = 10}
there is a way to do that, i think. But I think the issue is really gonna be that a lot of stuff that's checked on end of round is also for clean up, and not mechanically visible to the player
true
can you show the blind code?
would there be a way to check what the calc returns?
i just want it to show up in game first before actually doing anything with it it's just this for now
SMODS.Blind {
key = 'sillytestbkind',
loc_txt = {
name = 'The silly :3'
},
vars = {},
dollars = 5,
mult = 2,
debuff = {},
boss = {min = 2, max = 10},
boss_colour = HEX('FFFFFF')
}
that way i could check what it does for that
there would be, but not built in, I think
also im now realizing that maybe a different context would be better
the problem is that plenty of clean up behaviour doesn't interact with return at all
maybe have the card to the left additionally score before cards are scored
which would have more use and most likely would cause less issues
cuz i cannot think of any card that would benefit from the og
how do i make a joker destroy a random played stone card?
make an array of each stone card and use pseudorandom element to get one
then just :start_dissolve() it
well... how do i do that
Dont do that
how doth one loc_text challenge names
never call a dissolve on a playing card while in a blind
like yknow i thought this would work
it should
oh it needs to be a string
well dropping the curly braces quite expectly changes nothing
is the key correct
concerning
not much to see really
weird
🤔
yeah maybe the loc file is in the wrong place or has the wrong name?
i mean
isnt it en-us
yea thats what i did
honestly i dont even need a loc file i just use it incase someone wants to translate my mod for some reason
i wish we could split localization files
hooray
i might do my own implementation to do that
or be evil and switch to loc_txt
How would i get the most played poker hand
check obelisks code
how do i do this mf's when i hit them with "check the source code"
local tempuse = 0
local hand = nil
for k, v in pairs(G.GAME.hands) do
if v.played > tempuse and v.visible then
tempuse = v.played
hand = k
end
end
if i had to guess how it does it tho it probably either goes through every hand and sees which one is most played that way or theres a specific attribute
i didnt know you could just get how many times a hand was played thanks
Rise.
hooking or patching would be what id do
Is this effect strong enough for a Legendary-like?
what is foob
Fool the tarot card, except I don't want to put it that way.
why
It's because your only doing the first card highlighted.
because.. your only applying it to one...
Why is flip and set_ability outside your func?
well
i believe the flip just flips the card and doesnt do anything else
so it remains flipped
That was not how I was taught to use the E_MANAGER.
Is there gonna be another TIL moment for me?
they shouldn't be outside your func
i made it myself
Each line of code you want to run in an Event, you need to put them inside the func.
oh wait that's right people make mistakes I forgot about that
also, is this a tarot that gives an enhancement? You shouldn't need to write your own use code for that
wdym it's not important your code doesn't work because it's wrong lmao
for x=1,#G.hand.highlighted do
local scard = G.hand.highlighted[x]
-- put change code here
end
literally no need to write code for a tarot that gives a custom enhancement, unless you dislike the standard animation
wait do tarots just have an option to do that
yes
lmao
i should see if i can make my pendulum cards use that
🥀
Now this is what I call a "TIL moment".
also is that tarot card a real one
from minor arcana
no
for what reason
consistancy :)
creativity :)
The Minor Arcana, sometimes known as the Lesser Arcana, are the suit cards in a cartomantic tarot deck.
Ordinary tarot cards first appeared in northern Italy in the 1440s and were designed for tarot card games. They typically have four suits each of 10 unillustrated pip cards numbered one (ace) to ten, along with 4 court cards (face cards). Taro...
look at all these
so many to do
I mean Cryptid added android card and (some what-about-ism BS)
exactly
ahem
in my defense
But I did have an idea about making use of minor arcana since watching Agatha All Along.
Oh wait.
*flees the scene*
That, ladies'n'gents'n'others, is why you always keep some room for a potential TIL moment.
how does glop work internally
step 1: decompile balatro
step 2: borrow balatros shaders
i need to make one that brightens the card
elaborate
Was about to link the smods wiki page but you're not wrong.
what does brightens mean
make a card brighter
make every pixel 50% original color and 50% white
Like this bright?
so moreso faded
so just the average between its original color and white
yes
That is a little bit different than the technical term of brightness... but oh well, close enough approximation is close enough.
this thing
oversaturation shader code
https://github.com/SpectralPack/Cryptid/blob/main/assets/shaders/oversat.fs
just make sure you
A: replace any "oversat" references with what you name the file
B: there isnt a b
thats all thats absolutely neccesary tho
or else crash :(
oh nevermind theres the b
quick dumb question, whats the issue between card_eval_status_text and blueprint? why the msg pops under the original joker only
Technically brightness and saturation is different values.
it.. shouldnt?
You put context.blueprint_card or card instead of card
https://github.com/SpectralPack/Cryptid/blob/baca976aed2140b353475e33f4ebcf7efd4699d4/items/misc_joker.lua#L6552
heres how cryptid does it btw
for old bp
just incase that doesnt work
hihi, question
i'm putting a shader on my Legendary Jokers, but they all seem to render the same as the first one
hard to describe
like, they all shimmer the same way when i hover over the first one, and don't shimmer at all when hovering over the others
code for the first one
i do not remember how to do it
holdon
draw = function (self, card, layer)
if (layer == 'shadow' or layer == 'both') then
card.ARGS.send_to_shader = card.ARGS.send_to_shader or {}
card.ARGS.send_to_shader[1] = math.min(card.VT.r*3, 1) + G.TIMERS.REAL/(28) + (card.juice and card.juice.r*20 or 0) + card.tilt_var.amt
card.ARGS.send_to_shader[2] = G.TIMERS.REAL
card.ARGS.send_to_shader[3] = { key = "new_texture", value = G.ASSET_ATLAS["sgla_bmmask"]}
for k, v in pairs(card.children) do
v.VT.scale = card.VT.scale
end
end
card.children.center:draw_shader('sgla_blackmirror', nil, card.ARGS.send_to_shader)
end,
heres how mine works
it isnt for a soul but it does apply a shader
ignore the third attribute thats unused
icicic
lemme decode what this does ^^ hold on
okay no i don't understand this ^^
this is why i haven't learned shaders yet :)))))) uhm
how does this work?
shaders are paiiiiiiiiin
okay so i tried something
not sure how to fix this though :>
ah wait no lemme try something else
They always are 😭
steven universe??
nope, Layton vs Ace Attorney
the spells in the Grand Grimoire
okay no my attempted fix didn't work -w-
i undid my code, what am i missing? i'm guessing some of the code from the third line needs to be put into the fifth line
like so
I haven't a clue. Shaders are so foreign to me 😭
I know I know, so helpful 
spinworth
i'm so close chat?????
removing the 0.1 caused it to align more (you're seeing the result), but it's not quite there :<
...the fact you got shaders working is insane on its own, honestly 😭
fair 😭
i love that game
do the first two draw_shader calls do anything?
i'd like my soul to have the voucher shader (i.e., be shiny :>)
what's "not quite there"?
the shiny shader was too low
SMODS.Sticker wiki page doesn't have config={} or config={extra={}} entry.
Does that mean I can't modify its config?
my SMODS.Gradient doesn't work. what am i doing wrong?
hey yall, i have this custom boss blind defined where i have min = 4 to make it so it only appears ante 4 after, but when i reroll boss in earlier antes
it still shows up
I haven't played around with it enough, but it may be broken atm
the SMODS.Blind feature?
Specifically the ante limits
so do i have something incorrect in my code? since it was appearing on ante 1
I'm not sure, honestly. I forgot about it until know, but just setting it definitely doesn't limit a blind from showing up too early.
hmmm, I'll t ake a look
thank you
and bump with the additional context that i am talking about a modded achievement
it definitely works
Does this look like a vampire bite mark to you all?
hmm, very strange. I don't know what would be causing it then. I know it's not working in Kino either, and I saw someone trying to solve the same problem a few days back as well
in_pool overrides this
idk why
ah, that'll be it
yeah if you use in_pool you need to do the ante check yourself
what does boss blind realc_debuff do because i can't get it to do literally anything
ah gotcha
is there any way i can make a joker do something at the start of a shop?
context.starting_shop
5️⃣
thank you brave source code reader
how can i tell if the upcoming blind is a small blind during the shop?
or mods considered i guess i should check if the previous blind was a boss blind
and bump
i wish i could help but i know nothing about UI
config = { extra = { edition = {polychrome = true}, destroyed = 0, flag = false } },
calculate = function(self, card, context)
if context.before and context.scoring_hand then
context.scoring_hand[1]:set_edition(card.ability.extra.edition)
return {
message = 'Awakened!',
message_card = context.scoring_hand[1]
}
end
if context.after then
if context.scoring_hand[1] then
if pseudorandom('vasher') < G.GAME.probabilities.normal/2 then
card.ability.extra.destroyed = card.ability.extra.destroyed + 1
card.ability.extra.flag = true
else
card.ability.extra.flag = false
return {
message = localize('k_safe_ex'),
message_card = context.scoring_hand[1]
}
end
end
end
if context.destroy_card and card.ability.extra.flag then
G.E_MANAGER:add_event(Event({
func = function()
context.scoring_hand[1]:start_dissolve({G.C.BLACK, G.C.RED, G.C.RED}, true, 5)
card.ability.extra.flag = false
return true
end,
blocking = true
}))
return {
message = 'Destroyed!',
remove = true
}
end
end
im trying to destroy a playing card here based on a flag, even though the flag is being converted to true, the card isnt being destroyed
any idea why that could be the case?
what happens if you comment out the event
let me try
okay i changed up the method a little bit
calculate = function(self, card, context)
if context.before and context.scoring_hand then
context.scoring_hand[1]:set_edition(card.ability.extra.edition)
return {
message = 'Awakened!',
message_card = context.scoring_hand[1]
}
end
if context.after then
if context.scoring_hand[1] then
if pseudorandom('vasher') < G.GAME.probabilities.normal/2 then
card.ability.extra.destroyed = card.ability.extra.destroyed + 1
card.ability.extra.flag = true
return {
message = 'Destroyed!',
message_card = context.scoring_hand[1]
}
else
card.ability.extra.flag = false
return {
message = localize('k_safe_ex'),
message_card = context.scoring_hand[1]
}
end
end
end
if context.destroy_card and card.ability.extra.flag then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
context.scoring_hand[1]:start_dissolve()
return true end }))
end
end
this fixed it
maybe the delay helps
no don't do that
never use start_dissolve manually inside scoring calc contexts
the reason it doesnt work is that your timing is wrong, context.after happens after context.destroy_card
what did i do wrong? it is supposed to create a card with one of the enhancements in that list
i think it would look better a little bigger
how make kosher, please advise
bump
and also what should i do if i want to update a modded achievement's description during runtime 
I need much more context than a random screenshot my friend
i don't really know what you need to know other than that i'm basically calling ``start_dissolve()` from a calc
this is the card, this is what it does
you're destroying the joker right?
yes
@daring fern well i'm putting the gradient into a variable and referring to the variable and it's not working 
oh i'm not calling my second colour correctly. why was that not throwing an error???
i got nothingf
variable = my gradient
somehow a gradient has given me more trouble than anything else today
giving up on modding forever . terribly embarrassing
how could i return a different hand when another is played/chosen? specifically, i want this card to count two pairs played with exactly 4 cards as a 4oak, but this lovely patch isn't seeming to do anything (after the else is the default two pair function in evaluate_poker_hand())
destroying jokers is fine
ok, i fixed my issue with gradient, i was calling my second colour wrong
how are you trying to refer to your gradient
its working now and im unsure why but im not complaining; i think i genuinely spelt something wrong
bump, what should i do if i want to update a modded achievement's description during runtime 
ohh
what would be a context that happens before context destroy?
but after the scoring
final_scoring_step?
okay i switched it to final scoring step
it works
how would i go about passing info to the next run? i have my joker that loops time by saving and loading the run but the issue with that is that it means the joker doesnt get loaded, so i need to find a way to carry the joker over to the "next run" (which is actually the save state from earlier in the run)
You would have to put something on the profile then accessing it from a hook of start_run
how do you save stuff in hte profile?
or maybe i can just hook start_run to directly take an argument to create a new copy of the joker
bump
Save something in G.PROFILES[G.SETTINGS.profile].storedvar changing storedvar to the name you want
You need prefixes
It would be m_fus_ruby
okok! ty! anything else?
You should use create_playing_card
hi, i got a bit silly and made a joker that changes every probability to always hit, unfortunately it seems after too many uses the lucky cards just crash the game, anything i can do about this?
Remove everything except the pseudorandom_elements and put create_playing_card({front = front, center = cavy}, G.deck)
I think
like this?
You need to remove the G.playing_card thing
Oh wait I see
The lucky cards went all the way up to nil somehow
crash
calculate = function(self, card, context)
if context.setting_blind and not card.getting_sliced then
G.E_MANAGER:add_event(Event({
func = function()
local front = pseudorandom_element(G.P_CARDS, pseudoseed('cave'))
local cavy = pseudorandom_element({'m_fus_sapph', 'm_fus_cob', 'm_fus_ruby', 'm_fus_cinna', 'm_fus_red'}, pseudoseed('cavy'))
create_playing_card({front = front, center = cavy}, G.deck)
return true
end}))
card_eval_status_text(context.blueprint_card or cavy, 'extra', nil, nil, nil, {message = localize('cavy'), colour = G.C.SECONDARY_SET.Enhanced})
G.E_MANAGER:add_event(Event({
func = function()
G.deck.config.card_limit = G.deck.config.card_limit + 1
return true
end}))
draw_card(G.play,G.deck, 90,'up', nil)
playing_card_joker_effects({true})
end
end}```
the full joker code
Try replacing cavy with G.P_CENTERS[cavy]
In the function
in the local or in the create card?
The create_playing_card
I’m not sure then try looking at familiar, incantation and grim
I'm pretty sure its the card_eval_status_text line
im not sure what it does, i just copied the marble joker code and started messing with it
i'm trying to count all two pairs, in groups of four cards, as 4oaks. this function correctly shows the text for 4oaks when two pairs (in exactly 4 cards) are highlighted, but when actually played the game goes back to giving the base two pair score. is there anything i'm missing?
should i just take it off or?
yes
now it isnt crashing but the cards get added without the enhancement
the current code
you guys know how the game displays the name of the poker hand you have selected but not yet played on the side bar?
how do i get that
what for
like if i wanted to display that poker name in a joker description
but it needs to update everytime a user selects a poker hand
not necessarily playing it
so im using update() to check every frame
You only need to know the selected hand when the user hovers over the Joker
true
so it's 1 frame every so often instead of literally every frame
(the description isn't updated every frame so you only need it in the frame the description is created)
yup that makes sense
let me dig through the code for the variable name
you can check Clownfish https://github.com/VictinZero/balatro-victins-collection/blob/dev/content/jokers/clownfish.lua
tl;dr: just calculate the current selected hand yourself
gotcha
okay
local handname, _ = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
this is it yeah
ITS WORKING! i just dont have the animation for the card showing up in the middle of the screen and then going to the deck, its just automatically added
depending on what you want to do, you can check The Rock Blind from my mod
where can i check it?
This is simple but in principle it could break some things since it's unexpected behaviour
A more robust way would be to copy the G.play CardArea to create one to use for animations like this, I think
But so far I haven't run into any issues so
it displays an animation for the card being created
tyty!
This is very old code
the animation and logic to add the card to the deck comes later
oooh, is it in the link you sent?
all there
wait no it worked once and now it just creates the card without the enhancement again
btw ty!
wait no looks like it creates either a card with a random enhancement or a card with no enhancements at all
is there a way to loop through unscored cards?
calculate = function(self, card, context)
if context.individual and context.cardarea == 'unscored' then
local unscored_cards = {}
if pseudorandom('marsh') < G.GAME.probabilities.normal/card.ability.extra.odds then
for i = 1, #context.scoring_hand do
table.insert(unscored_cards, context.scoring_hand[i])
end
steel_card = pseudorandom_element(unscored_cards, pseudoseed('marsh1'))
steel_card:set_ability(G.P_CENTERS.m_steel, nil, true)
return {
message = 'Steeled!',
message_card = steel_card
}
end
end
end```
i need to change
```lua
for i = 1, #context.scoring_hand do
table.insert(unscored_cards, context.scoring_hand[i])
``` to cycle through unscored cards
this is an undocumented feature unfortunately
bump, how do i change a played hand into another when conditions are met?
i do something similar here
where i convert all hands into their flush variants
the original coder is credited in that link
i dont think there is, you need to check manually using full_hand and scoring_hand
but i dont understand why you do it in individual, what's the effect?
ah thats what i suspected, i think me doing it in individual is wrong now that i am changing the ability
original ability -> each unscored card has 1 in 4 chance to become steel
new ability -> 1 in 4 chance to convert an unscored card into steel (at random)
peak, thanks!
yeah for the first one you want that context but for the second you probably want before or after
okay let me try implementing it
is there a "not in" check in lua?
like python has
afaik no
yes
awesome i can use that then
calculate = function(self, card, context)
if context.after and context.cardarea == 'unscored' then
local scored_lookup = {}
for _, c in ipairs(context.scoring_hand) do
scored_lookup[c] = true
end
local unscored_cards = {}
for _, c in ipairs(G.play.cards) do
if not scored_lookup[c] then
table.insert(unscored_cards, c)
end
end
if pseudorandom('marsh') < G.GAME.probabilities.normal / card.ability.extra.odds then
local steel_card = pseudorandom_element(unscored_cards, pseudoseed('marsh1'))
steel_card:set_ability(G.P_CENTERS.m_steel, nil, true)
return {
message = 'Steeled!',
message_card = steel_card
}
end
end
end
this should work right
nvm it does not
this made it work! only problem is the visuals, the joker combined with my previous function... sorta works but not fully lol
(the hand text on the side)
might be best to just not bother with the first function
Monokuma 👀
wait
it makes two pair count as 4oaK??
wild
Oh true you’re right
What are you doing in your function?
assuming you play no more than 4 cards
Since my function is going to be changing the UI, you can just pass the new hand to that function
Instead of doing it in two places
it's supposed to fully change hands but instead only did the text, i left it in to test
Although I suppose you want a visual indicator before they play the hand
shouldn't it have been disabled by The Psychic though?
i disabled that boss out of laziness lol
Can you do the visual indicator on your joker instead @lucid owl
Something like active!
why does this work on Mr Bones but not here?
i mean, the indicator would likely be the hand itself being changed
as in, the hand text
I'm making a joker that gives held stone cards xMult (similarly to baron) but for some reason it's triggering when the round ends. What can I do to prevent this?
what do you mean by this?
So basically, the name of the poker hand that you’re playing is being changed twice once when you select the hand, but you haven’t played just yet and the second time will be when you actually play the poker hand
In between those two times the game also calculates the poker hand so the game will initially calculate it as a two pair because that is what it is
Makes sense?
yeah, i get that
So instead of changing the poker hand two times the first time when you actually select the hand but don’t play it and you’ve changed it in the UI. You can just put it on your joker text I suppose?
Instead of the UI
that'd be easiest, yeah
Yup
if context.cardarea == G.hand and context.other_card and not context.repetition and not context.repetition_only and not context.end_of_round
i would do context.individual as well just in case
Talisman
You'll need to do #💻・modding-dev message
how would i refer to this in a line? fusion_Ore?
how do i make my custom consumable work when a joker is selected?
can_use set to the function that returns #G.jokers.highlighted == 1
ty
is there anywhere where different internal values like those are listed? i haven't found anything about stuff like that on the smods documentation
i mean values like G.jokers.highlighted, not can_use
Oh
i already knew about can_use
Not really, you just look at balatro source
#G.hand.cards
Simplest way is to destroy the old one and spawn the new one
Maybe you can call set_ability on it with the new ones key
Not sure what happens there
set_ability?
Yes that's what I said
how do i use that?
Card:set_ability(key)
Hey guys? my sticker isn’t loading into the game, are there things i can check that would tell me why?
send code where you define it
why isn't it letting me use the consumable?
oh it’s my atlas pos maybe
tho it would crash probably idk
just asking this in advance, is there anyway to check if theres a specific joker in your hand?
bump
next(find_joker(<key>))
if its truthy then its in your jokers
so in an if statement, would it be like
if context.joker_main and next(find_joker(KEY)) then
-- code here lmao
end
i realized i wrote the formatting wrong, but i was just asking if next(find_joker(KEY)) is a boolean or not
cause if you do it in the calculate function of a joker you dont have to check that, it runs calculate on existing jokers
#find_joker(<Key>) > 0 also works
basically, theres 2 jokers, one that affects mult, and one that affects chips
when seperate, they're decent, but if you have both of them, they get "buffed"
oh ok then thats valid
I've noticed that on another mod I play that acts in highlighted okers (Familar's fortune cards) its touchy and I have to select and deselect a couple times
How do you know it's not working
#G.hand.cards >= 3
ty
ye it can be so confusing
What does this refer to?
leave me alone breeze 💔
thank you!! im still relatively new to balatro modding (i only have 6 custom jokers made 😭)
thats fair, same, only made 6 jokers, i made plenty of boss blinds tho and chess consumables
i only made 24 jokers
i love this goober still 😭
how many times does it roll
until fail
is is incompatible with oops by design or because you dont know how?
it doesn't say so :p
by design as uh
softlock
i once got
thats kinda... busted
+11 levels with him in 1 turn (1 in 2048)
maybe like 1 / 4
im implementing some nerfs
the main downside is the cost
though even when i play with him i still only find myself getting to ante 10 (which is what i normally average)
so
i guess its balanced??
its buffed spaceman
can i use one atlas for the base sprite and another for the soul sprite on a joker?
or is that impossible
i think it should be the same atlas
i have no idea what that means so maybe 🔥🔥🔥🔥
theres no way to specify 2
it can't when the base sprite on the joker I'm making is animated and the soul sprite isn't
im thinking of buffing his cost from 10 to 25, and making him blueprint incompatible
thats like legendary rarity cost territory
also, is there anyway to implement custom hand types into the game? ive wondered this for a while, but never really found out if you could
smods.pokerhand
oh okay peak
OKAY PEAK
ive always had an idea for a joker that lets you play 6 cards instead of 5, but i never knew if that would be possible
take a look at this
i did that, but for discards instead
why does this not give a message
Like it works perfectly fine other than that it just doesn't give a message
Surprised this isn't already a thing
you forgot to surround k_upgrade_ex with localize
localize('k_upgrade_ex')
I don't think that's it because it would still trigger it would just say "k_upgrade_ex"
Iirc you can set a soul_atlas
Check the docs
yeah that wasn't it
oh!!
thats actually really helpful!
would you mind sending me the code for it so i can reference it?
Your returning in the event
oh youre returning in the event, not out of a calculate function
how do i get the highlighted joker's ability/key?
what do you mean by ability?
just its key
The card area might have a highlighted key
idk why i said ability lol


