#💻・modding-dev
1 messages · Page 486 of 1
What does your printing code look like?
if I remove lusty joker it also goes "post_trigger" => "other_joker", shouldn't that also be reversed?
The functionality of the joker is currently removed, it really just outputs when it gets triggered;
SMODS.Joker {
key = "jokebra",
name = "SEMBY_jokebra",
loc_txt = {
name = "Jokebra",
text = {
"Gives {C:attention}twice{} the amount of {C:chips}Chips{} that",
"the {C:attention}Joker{} to the left gives as {C:mult}Mult{}",
"{C:inactive,s:0.8}Inspired by Buffoonery!{}"
}
},
atlas = "SEMBY_jokers",
pos = { x = 6, y = 1 },
blueprint_compat = true,
rarity = 2,
cost = 6,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
print("individual")
end
if context.other_joker then
print("other_joker")
end
if context.post_trigger and context.cardarea == G.jokers then
print("post_trigger")
end
end
}
So the post trigger is from the lusty joker effects which you aren’t printing
You’re just printing when your joker sees these contexts
yes, I am
i expecteded the individual to go before the post_trigger
i expect other_joker before post_trigger too?
yet in all cases post_trigger comes first
No, the order goes lusty individual, this post trigger, this individual, etc
You don’t have any way of printing the lusty contexts here
yeah works for me fine, it gets the lusty post trigger and then the joker's individual trigger
If my joker is on the left side and lusty is on the right it also works as I would expect it to
Yes, because you’re not printing everything
You’re only printing the contexts that yourjoker sees
the joker gets individual first in that case
So you can switch out the post trigger for effectively a lusty trigger
They are definitely after other triggers though, so just do what you need to do! 😂
Like this?
ohh a lovelypatch
gotcha
question is how do i make a patch for it since i don't really know where to get started on patches
imma try to find any documentation to see how
Whats the difference between math.random and pseudorandom?
pseudorandom accounts for the run seed
Ah, so its set on a seed?
yeah it makes the seed from the run seed + the seed you gave it
Oh ok thanks
https://github.com/Steamodded/smods/blob/main/lovely/sticker.toml steamodded does patch the sticker stuff, so if i wanted to change the rate at which stickers get added, the decimal values in the if statements for each sticker type?
yes, you would change those
ok gotcha
Is there a way to be able to pick a number between 2 and 5 while decimals are also included?
sorry if this is a dumb question, but if i wanna lower the sticker addition rate, do i increase the decimal value since the if statement checks if the poll for each sticker type is greater than a specific value
yes
Does this not include 1?
I still am confused by pseudorandom cause people use it in different ways
yeah like i said, im bad at math lol
pseudorandom("seed")*3 + 2 there
Oh ok thanks
I changed the statements of the payload for each patch assuming those are what will patch the original line of code in pattern, if i wanna make this patch work when purchasing a voucher, what should i do?
i would make those numbers into globals and modify the globals in apply
So im guessing the “seed” represents the run seed?
no, it's an individual seed for the effect
Oh
inside of the lovely patch toml file?
the games uses the run seed + individual seed so multiple effects can have separate randomization
Ohhhh i think im starting to understand
i would replace those numbers with G.GAME.modprefix_eternal_rate or original_number or something
Ohhh makes sense
G.P_BLINDS.bl_btct_GlitchBlind.mult = pseudorandom(“seed”)*3 + 2
end
Will that work? Cause im just tryna make the blind mult random between 2 and 5
no idea haha
nah the number part is correct
Where are you putting the line?
Oh ok thats good thanks
Did eternal stickers first hope this is right
I would do (G.GAME.sizimod_eternal_rate or 0.7) so you don't have to initialize it
ohhhhhhh wait it just clicked what is going on, making a variable that can be changed within the main lua
i think i get it
Are there any mods that implement custom cardareas that display cards in a window of sorts, I wanna reference them
I'm making a custom edition where discarding cards would go into it instead of the deck
like the vanilla consumables? or more like the vanilla deck view?
Looked through the chat history for an example
Like this
This but on an edition on a playing card
i have this to display a pokerhand on a tooltip https://github.com/nh6574/JoyousSpring/blob/c0a24f9ba7e75f51d8ec09f22f12329c7a837cca/src/others/PokerHands.lua#L64
for your case you would store those in a cardarea and then make another cardarea when displaying where you would copy the cards over (because cardareas destroy all cards when destroyed so you dont want to show the original)
Hmm gotcha
i also have the banishing mechanic that does that but for any kind of card
but it displays it in a separate menu
Well, there seems to be one thing I still don't understand...
Jokers in Order: Lusty Joker, "My Joker". I play a single Hearts-Card.
If "My Joker" has "post_trigger" which outputs the Mult-Variable; if context.post_trigger and context.cardarea == G.jokers then print(mult) end
Shouldn't it print "4" now? (High Card Base 1 + Lusty Joker Mult 3)
what does it do
Well, I print before which is 1, then it prints 1 again for/after lusty and then 4 for/after itself
from what I understand from the code, the trigger and the post trigger are evaluated after the post_trigger context so the mult won't update until after post_trigger
but maybe I'm wrong
Well, that would explain it 
That sounds correct
But you should have access to the return table from the initial trigger
Oh the "other_ret"?
That might be a good idea 
is perma_xmult a thing
yes
perma_x_mult
i hate you n i was just pasting it
I hate that underscore
Should've read the docs👀
if you read the docs first you dont get to look at aures cat while someone yells at you
So i had an idea for a mod... is there a way to/support for creating completley custom objects?
yes, you would extend SMODS.Center
(probably, never done it myself)
i cant beleive original ideas dont exist in the balatro modding community.............
no such thing as original
just do it anyway because your implementation is just as cool ♥
game said something about vars not being right, isnt this good already
Extend SMODS.Center like N' said, and don't put your custom objects under SMODS, but under your own mod
here are a bunch of examples: https://github.com/search?q=SMODS.Center%3Aextend&type=code
literally the same thing and it worked
fuck
how did it not screenshot it
what the fuck
do Centers already come with calculate and loc_vars?
can i see what tldf is
you're missing the vars for the #1# then
but i already have it in loc_vars
set = "Other", key = "tldf", vars = { 121321 }
also please use your modprefix on this
yes
sure
if i make a "manually" entry it will break it for example
bru
so its vars = 1?
what does that mean
vars = { 1 }
oh
put 2.5 instead of 1 then
...
put me out of my misery
pretty please
ITS AN OFFER
you're not going to make it tonight
either way
thanks
-# uh.
anyways
should be good now
this is the wrong screenshot
again
you're the first one methink
no one really used headless balatro
ive seen other people say they would do that but never seen it done
both
balatest is probably the closest to the second
https://discord.com/channels/1116389027176787968/1367354388540297246
rust
i was looking for that haha
someone also made a discord bot but they got kicked out of the modding channels lol
why tho
hell if i know
the mods discussed it and said that it was either porting, which is not allowed, or not modding the game so it doesn't belong in modding
lame
either way
how do you grab a pool again
wdym grab a pool
like, if the player has this joker thats in this pool
for example
Food
i already have the pool set
you want to see if a joker is in a pool?
yes
(joker.config.center.pools or {}).objecttypekey
here's the description
"Every Food Jokers held has 1 in 4 chance to disable boss blind's ability"
ill figure out the ability
i just need to figure out the pool thing
if (joker.config.center.pools or {}).food then
sweet
thanks
case sensitive?
yes
well crap i finished extending the objects and it technically works but now im stuck because i didnt think about how i'd implement it
I at the very least want them to show up here in the collections page but I have no idea how to do that
how do i get the current upcoming boss blind
im close....i just need to stop it from adding a second time for some reason
UI magic
i want to make a new kind of card that isnt necissarily a consumable since its only purpose would be to be a crafting ingrident, it would even have its own area/storage?
Should i just make a new consumable or extend off Center again?
if you don't need the functionality of a consumable then extend center
bump
Why do my enhancement do not show the card like the card has the value but its not show
G.GAME.round_resets.blind_choices.Boss
i think
All the flags you marked as false can be skipped, they're disabled by default
As for youe issue, maybe SMODS is checking that replace_base_card is nil and isn't considering that it's false, just a guess
Wait no
It's gotta be the overrides_base_rank one right? Never worked with that one
I thought of that but the docs don't say anything about it removing the sprite
The docs....
I was using that cause of that
Try removing it and see if it brings back the rank sprite
If it doesn't then it's probably this
Your false return from in pool should handle that anyway
ok here's my crappy mockup
not sure how viable this is
it was that lol
looks viable, just a bit hard because it's UI
if you dont mind not following cleanroom design, i would look into how yggdrasil does some of these things
How do I create a new global card area like the hand, jokers, and consumables? I need somewhere to store ingredient cards that the player gets
here's an example from my mod
field area is a visible area
extra deck is a toggleable one
https://github.com/nh6574/JoyousSpring/blob/c0a24f9ba7e75f51d8ec09f22f12329c7a837cca/src/extra_deck.lua#L266
you basically want to store it in G so it saves
how do you hook into mod badges
how do i know if a joker is debuffed?
joker.debuff
how would i check if a joker is in a specific objecttype
what's the objective
gradient badges like cryptid
oh uh crap how do i make a new pool
is it just G.P_CENTER_POOLS['Ingredients'] = {}?
is there a way to modify another joker's config using context.other_joker?
do SMODS.Mods.modid.badge_colour = your_gradient when the game starts
what do you want to modify
i'd like to add a new value in another joker's config
so on top of everything?
i think it needs to be in a hook but im not sure
i see
a specific joker? or any joker? does it need to be saved in between reloads?
any joker, for the run only
that's a bit hard because not every value on a card is saved by default
right
how would i access a joker's config values with other_joker though
that could be the very least
context.other_joker.ability
kind doesn't seem to be mandatory, no
It's joeover
It's useful for other mods to reference should they want to spawn your Booster Packs and such.
idk why discord removed bookmark thing, i wanted to bookmark this
ghhhh
That's... a big problem
is this the thing that I wanted to do too?
i just send it to a private chat with myself
yes!
i dont thinkt thats possible on discodr
i wasnt on my pc at the time
it's not possible to do what i already do??
boss, can you try it and see if it works without hooks, im in my bed
rn
how tho..
make a group and add no one
and what's the difference
will try
So for SMODS each booster pack is individual
well i have this either way
much appreciated
I dont promise it will work tho
ah well, N said it was supposed to be in a hook but they dont know that
trying isn't going to hurt anybody either way
idk how to do hooks...
you can try without it first
I dont think it will work without (it doesnt rn)
oh
@red flower which function do you usually hook for something that has to be loaded from the get go/beginning
Game:main_menu?
maybe ill hook into that
it might be bcs im stupid
your global might be different
Is kind ever actually used for anything?
current mod as in id?
no, that part leave it as is
okok
just change gradient for your gradient
For vanilla booster packs...?
To determine is it a spectral, arcana... you know
that would be color_change yes?
If kind is optional, how can I determine is booster pack a code pack, for example? I need manually check for every key which matches code boosters?
i mean if the modder is good they would include the kind
if not then you shouldn't bother and just put it in an "other" category imo

I mean does kind ever actually get used by vanilla code? I’m only browsing on my mobile copy but I don’t see it being used anywhere
Disappointment
It just always adds every pack to the pool its polling
Oh well
I need somehow group boosters by their logic
I see they have group_name thing
So I'm using it as fallback
I'll use it too then
it tries to work, but it doesnt... its now a color that is not the Hex values I put
where did you write the line
the SMODS.current_mod.badge_colour = color_change is on top of the file in the main file and the gradient is below it
the gradient should be above?
yes
i can finally give my playerbase a seizure
Hi (do I count as a friend at least?)
How easy is it to edit the displayed values in the score? (Round Score, Chips, Mult, and then the score of the currently played hand)
Had an idea for a mod but I can't find much documentation on changing/editing these values
why does this crash my game
sure why not
Should be G.jokers.cards
G.GAME.chips is the player score, G.GAME.blind.chips is the blind requirement
in editing it youll also want to do G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
i think anyway for the second part
so changing could be like
G.GAME.blind.chips = G.GAME.blind.chips * [value]
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
You're literally my goat thank you so much
My idea was to add the Cookie Clicker style scaling to the score, so for example instead of showing as "1.160e68" it'll show as "160 Vigintillion"
Which in my opinion is more interesting
okay so imagine 1
thats massive
and then imagine it 160 vigintillion times
for that i would maybe override the number_format function
N bestie i got a query for u
shoot
playing cards are set default right
yes or enhanced
would i need to bother noting enhanced for preventing an edition from being applied if i have default? or should i include both
you should, a playing card can be either one of those
gotcha okay, thank you
good afternoon modding dev
Sorry very new to Balatro modding, how would I do this? ^_^;
I assumed it was part of the Balatro decomp but I can't find it
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
Not the place I thought I'd be finding my LUA documentation but it works LOL
Tysm 🩷
Okay I just fixed a bug in my balatro bot that has been plaguing me for WEEKS. Turns out, the game does not make a purchase (update the shop state) and update the gold counter in the same frame. They are subsequent actions in the game loop.
Just had to share this somewhere
went to bed instead of trying to fix this yesterday as you know, but clicking the button gives this crash
oh my god wait cant you call a draw function in soul_pos
i feel like i saw something about that or maybe im misremembering
you can actually call a draw function in soul pos

i learned it from victin
dude it's 2 AM for me 🥀
where can i look

go my child
that was incredibly specific thank you
because its RIGHT THERE
ok i don't recommend putting a print statement into the mod_probability context
where can i find the calculate function for a specific joker (ingame)
card.lua
ingame
i want to find the function itself ingame via the key/center so i can mess with it, not just where it is in the files
ideally, setting an old variable to the current calculate function and then setting its calculate function to the calculate function of another joker
G.P_CENTERS.j_modprefix_key.calculate
oh its only for modded that makes more sense
i was trying that but only on vanilla jokers
vanilla dont have it unless theyre take ownership of of
no wonder i didnt get what you meant
solution: ban all vanilla content and use vanilla remade

true
@zealous glen why didnt i ping you smh
I saw the image but I don’t know what it means
trying to change the atlas of only the floating sprite of the joker
not the position on the atlas, just which atlas it uses
I think it’s easier to change the position on the atlas
Just because it’s been done
so assuming i have the sprite added to the atlas, how would i change the floating sprite's position instead
was directed to your red hand earlier, which is why i asked you in the first place
but im new to this sort of thing, so i dont fully get it 😭
is there a way of getting the base_numerator and base_denominator in the context.pseudorandom_result?
uhhhhhhhhhhhhhhhhhh
what went wrong...
i dont think so? i think you always get the modified one
but i havent looked at the code in 100% detail
unrelated but i just realized your pfp is jovial merryment
What are you trying to do
so i want this toggle button i have on the card to switch the sprite of the joker between my modded one and the basegame's, for that visual information of the actual effect of the button yk
Well, if it’s just for a single Joker, it’s not too much work
Although I can see why you’d want to use the vanilla atlas
yeah cause it's
there already lmfao
I have another solution though
im listening
Add another sprite layer
is that still within the soul_pos or no
hi vic
hi dilly
hi toma
hi vic
hi dilly
h..hi toma?
lmfao
lmao
Take a look at Paranoia
that's yours too right
Hi toma
Hi toma
oh no
That video where nothing happened was very funny
lmfao
The shaders were cool
it was very funny
i like the one on p[laying card, but the problem is you cant tell wtf the card is
so i need to see if its poss to have the same shader display diff on playing cards than joker
hmm yes... 2 and 3 quarters of diamondclubs...
cause on joker i think it looks dope
Is the number right
looks to be from my calculations
It looked like 235% instead of 135%
100% of oneself is 100%
meaning 100% of 15 would be another 15
soul_pos = nil this about to go crazy
which equals 30
Did it say + or X the bonus
Because adding 135% on top of 100% makes 235%
adds the bonus
meaning adding 100% would be the other 15
adding 50% would add 7.5 mult
equalling 22.5
bump 
I feel like multiplying the bonus is more Balatro-y
well this aint balatro its dilatro :b
Don’t you mean :d
bilatro
I thought it was :dilatro not :balatro
i could consume you in one sitting

but yea overall im satisfied with the edition, for player feedback instead of stating the % ill probably have it say the actual number so they dont ahve to look at mult
was about to walk my dog and saw lightning flash in my peripheral......
tell the lightning to go away
yea sorry that was me
had to have been the garbage, i jsut showered
likely story bub....
im looking into cross mod compatibility with a joker from celeste card collection that works via lovely patches (climbing gear) can anyone link some useful resources for learning patching and stuff? the issue is they both affect discarding and mine does it the loudest 🤭
might not be the biggest issue in the world but its the kind of thing where if i saw the other joker id take it because it sounds like in theory itd be a fun combo
ack i also gotta do all the probability stuff today
it made me explode into 7 pieces so be warned
can confirm as the eighth piece
Do you mean ^q^
I also agree with stating the actual number
I think it was a red herring for me not to jump to that suggestion
it was a plan i had eventually, but im mostly just glad it works before anything
so thats my happiness rn, any little things are easy work
My suggestion is to read other patches
How did you make it work anyways
ice was a great deal of help there
his powerchange got me on the right track
but then i had to make my own set of changes and shit
so i am very grateful for his help
is there anywhere i would find an easily parsable example of this? like any mods you know of that do it particularly well
SMODS?
i mean anything that would work for this
i can just look in the smods files and see if i find something, i was also proabbly gonna dig through vanilla remade at some point
vanillaremade doesnt have patches, if thats what you mean
-# You said the trigger word
that is what i meant i do not really know what im doing here 🙏
They consider me not deserving of love
NOOOO
And they’re in l-l-lesbians with you N’
not true at all i value all the members of the balatro discord EQUALLY
is there a way to make a suit give base mult instead of base chips?
i cant post the madoka gif
But some members are more equal than others
Describe it to me
Amazing emoji name
if not i'll go do some snooping around the source code but if someone's done anything similar (any kind of base value manip for cards) it would save me some hassle
not normally, you would need to hook into the get chip and mult functions
these?
this is unrelated but i have a function which resets a rank at the end of round and im trying to make it so it only does it once, what needs to be changed to make this one specifically only reset then?
yes
like specifically when the run starts
check if run_start is true
I’m not sure what you’re asking but take a look at Castle in the example mods or remade
bump 
@zealous glen
am i understanding this or do i actually need to do something with those strings for them to work
I mean, the sprites need to be created somewhere
Wait this is set_sprites
That’s the right place
what's the underlayer thing
It’s the name for a layer I put under the base layer
ohh... wait but dont i want this above the base layer
It doesn’t matter as long as the default Joker sprite is the one you want on the bottom
Because you can manually draw extra soul sprite layers on top in whichever order
I can't find a list of all the context flags, did someone compile one somewhere or could at least tell me where it is in the source code?
updated atlas btw
You can find them in the wiki but also calculate_joker IIRC
I have a very simple mod I'm working on, how would I go about allowing my mod to be "reloaded" while the game is running, after modifying one of the files? I don't want to have to restart Balatro every time I make a tiny change.
Is there a way to check how much money was earned overall in a run?
There is one more thing though
uh huh
There’s some file called UI or something in my mod, maybe
Try searching for underlayer
It’s a small file
im in the file
That file exists to avoid SMODS double-drawing sprites in new layers
Because SMODS automatically draw children
does a /lib/ui file get auto loaded or no
No
I don’t think it needs to be separate
I just wanted to keep them together
when you do gradient, whats the diffrence between 'trig' and 'linear'? (bcs I cant see one)
What do you mean
see image
is that what id put in there 😭
You’re writing to a table of table keys to ignore
So you put the same key there
Idk how SMODS uses it but any truthy value inside should work
Keep getting crashes and I don't know why
Trying to figure out Yahimod code from the effects that appear on the screen
can i not use the joker's variable as a conditional or is it because it's above the locvars
Where exactly
mightve messed up your filepath from what it looks like
The file path might not start where you think it does. Also SMODS has its own wrapper for loading files
IIRC I used them for an unreleased Joker
Try seeing how I did it for Heartbreak in the dev version
right
we ran out of budgets for carpet so winter youll
have to walk on these instead
🚗🚗🚗🚗
Trig uses a cosine function to ease through the colors, linear just progresses them linearly at the same rate
Something something enemy Stand user so she must only step on red
The implementation looks like this
self[i] = start_colour[i] + partial_timer*(end_colour[i]-start_colour[i])
elseif self.interpolation == 'trig' then
self[i] = start_colour[i] + 0.5*(1-math.cos(partial_timer*math.pi))*(end_colour[i]-start_colour[i])
end```
Is that the main branch or the dev branch
Visually, trig is more varied
dev
The name of the file might be different, see if you can find it by searching “heartbreak”
erm
Sometimes when I make an experimental Joker it gets a descriptive key, like the first two here
i see
victin did you not push it
Maybe I didn’t let me check
What exactly does SMODS.load_file do that'd make me prefer it over using require?
Ugh
I need help TvT
Most times I've tried to use require the game has straight up not loaded so that might have smth to do with it
who needs a game to load anyway
back in my day we would play outside
drink from a water hose
climb uphill both ways
this explains a lot
At first this part was crashing but I think someone told me to do G.effectmanager = {} so I did

uh oh
VIC 😭
By the way, have you drawn Edition shaders on extra sprites
Not shaders
Edition shaders specifically
Extra sprites?
Like soul sprites
Yeah in a few cases
does VSC have a feature where if you rewrite a method signature it can find all the usages for you and rewrite them, like PyCharm or IntelliJ does?
I have this one draw function I had to implement because the extra sprite is an animated film scroll
-- manually draw editions here
if not card.config.center.discovered and (G.OVERLAY_MENU or G.STAGE == G.STAGES.MAIN_MENU) then
return
end
if not (card.children.thnks_underlay and card.children.thnks_overlay) then
return
end
if card.edition and not card.delay_edition then
for k, v in pairs(G.P_CENTER_POOLS.Edition) do
if card.edition[v.key:sub(3)] and v.shader then
if type(v.draw) == 'function' then
card.children.thnks_underlay:draw(card, layer)
else
-- because foil is transparent unlike the other edition shaders
if v.key:sub(3) == 'foil' then
card.children.thnks_underlay:draw_shader('dissolve')
end
card.children.thnks_underlay:draw_shader(v.shader, nil, card.ARGS.send_to_shader)
end
end
end
else
card.children.thnks_underlay:draw_shader('dissolve')
end
card.children.thnks_overlay:draw_shader('dissolve')
end```
Press F2
Does this account for custom Edition draw methods?
Yeah, it calls a draw method if the edition has one in the middle there
@lament agate did it somehow i think
nvm he dod spent money
However it should probably implement the should_draw_base_shader thing because it just manually draws the base shader for foil instead
(I didn't know that was a thing when I wrote this and haven't gone back to it)
I see I had an implementation similar to yours, but mine didn't work so I commented it out
i dont know that most things are a thing 🙃
vic hates me
see its right there
all in the pudding
Could i possibly use ease_dollars except idk how to use it or what it does
im not a coder either
I haven't tested it with a ton of modded editions so it might not work perfectly
Aw
what about if I want to add arguments
It's just for renaming the signature, you'll have to do that manually
danm
You'll have to hook ease_dollars and add to a global value (i.e. G.GAME.dollars_this_run) every time the mod is positive
Ok thanks
I was empathizing
But how do i use ease_dollars?
unfortunately this wouldnt fit my narrative ive conjured up in my mind
still crashes trying to index ability 💔
unfortunately I reject your reality and substitute my own
It's basically
function ease_dollars(mod, instant)
local ret = ref_ease_dollars(mod, instant)
if mod > 0 then
G.GAME.dollars_this_run = G.GAME.dollars_this_run + mod
end
end```
Oh, probably don't do it in set_sprites
thats it, im turning to dust out of spite
However you'll also probably want to declare G.GAME.dollars_this_run initially in an implementation of SMODS.reset_game_globals() so you don't have to check for nil each time. You can find that on the SMODS docs.
oh okay
removing the local thing in there then testing
IIRC set_sprites is called before set_ability? Or maybe inside?
Ok thanks
by the way when I mentioned ^q^ earlier that was a reference
does anyone know how to upload to the Balatro Moddiing Manager
im not much of a referencer due to my dum dum ness so u gotta explain
it worked
...ill fix the y value though
It's a song
smh id have never guessed that reference if you gave me 37 guesses and an eclair
I can give you the link to the song and the warnings
ignoring the fact that i cant read an atlas for my life why isnt it lining up with the card...
oh my god is it only going where i stop dragging the card
oh wait
That's what UI was supposed to fix
Maybe you didn't do it correctly then
oh no
trying to set up a card that messes with probabilities with the new smods tech, i had it working fine before but im struggling to get the new stuff working, can anyone see what went wrong?
-# also did you see Heartbreak in-game
-# no, should i
you can't nest contexts like that
ah is that all it is
i have it loaded
i think
but are the keys inside correct
ok wait what would be the correct way to format this then? removing the context definitely does not work i just get a crash
hey! im trying to test learning modding and in order to see vanilla jokers I extracted the files but idk which .lua file does have the code for jokers, anyone knows? thx
Are y'all unironically using the balatro font in vscode?😭
they look to be...?
no you missed that era
theyre located in card.lua
waiut
wait is that right
might be game.lua
You should go to VanillaRemade and look at the code online there, it's more similar to what you'll actually end up writing assuming you use SMODS
that also
and it's organized better than the source code too
vanillaremade is sooo nice
time for me to do this now that im late
i though that but i think i missed it... thx
These are different from the keys you used above
These
oh i checked "ModdedVanilla" but its missing most of them so idk about most events, will check that one out, thank you!
what where how huh
perfect, thanks!!!
compare with
this is a really good resource if you want to look at how cards work
i... forgot to remove the tostring...
what if i want to see how you work
Giving me ^q^ vibes
yup just checked and its what i was looking for, thanks so much!
bumping this rq because i cannot for the life of me figure this out
so i took off the tostring and it just showed no soul sprite
so i took off the string part and left them without quotes and now i get the ability crash
NOW im gonna put the tostring back but add it to the ui thing too...unless that wont work
I can't seem to find a context flag for when blind is selected or start of round, any help?
setting_blind
that was fast, thanks a lot
I think you were never drawing the sprite correctly
is there a collection of specifically food jokers anywhere in game or do I need to make a list of them myself
But since you didn’t disable the automatic draw correctly
me neither 😭
You didn’t notice it
No and yes
sending how it is right now
wdym?
is this about cryptid or something else
No, there isn't. Yes, you need to make it yourself
Cryptid has one tho
how would i spawn any joker from a specific mod?
You asked two questions with an “or” so I tried to answer in the clearest way possible
Which for most people I reckon would be answering each question individually
oh I understood that as a list existing in a superposition
Instead of interpreting it as a logical “or”
create an objecttype for that mod or save all the keys to an array and use pseudorandom_element
By the way, you shouldn’t handle the toggle in set_sprites
to spawn a card do I need its name or a backend key because I can't find the keys for the jokers
Is it low or high
it's low key high key
Nice to see you
can I just get from a generous individual a line of code that spawns idk showman
:)
j_ring_master
SMODS.add_card { key = "j_ring_master" }
ok thanks
does anyone know why this line of code isnt triggering? it's supposed to give increased probability for one hand after playing a single ace and it DOES but it never goes back down
because you're returning in the previous condition
? If you mean the variable, it gets handled in the button’s function
I mean the sprite
The sprite should always be created
but if it’s always created, how do I stop it from showing up?
are you sure it's not SMODS.add_card(key="j_ring_master") idk much lua but it seems weird to call a function without normal parentheses
Getting the following message whenever I mouse-over the config icon in the Mods list for my mod: INFO - [G] Could not find key for center: { refresh_movement= "true", }
alright thanks
I have never made a mod with configuration ability before.
You’re defining the draw function
Just don’t draw it
calculate = function(self,card,context)
local foodJokers = {"j_cavendish", "j_gros_michel", "j_selzer", "j_popcorn", "j_ice_cream", "j_turtle_bean", "j_ramen", "j_egg", "j_diet_cola"}
if context.setting_blind then
SMODS.add_card {key = foodJokers[math.random(#foodJokers)]}
end
end
so would that do what I think it'd do?
so change soul_pos from nil to a toggle check?
Oh wait, that's happening whenever I mouseover any mod config.
Kinda
Ok im listening
I don’t as gonna stop there
is there a context for upgrading any hand
also how would I kill this specific joker
you could use the context for using a consumable and check if it was a planet
Wait, this is a Cryptid issue, moving the conversation there.
Yes but it's not recommended to do it that way as math.random doesn't take into account the run seed. pseudorandom("seed", min, max) is recommended
for an array table there's a better function pseudorandom_element(table, "seed")
oh that doesn't work for burnt and stuff nevermind

SMODS.destroy_cards(card)
Sacrificial Dagger
Intent: Swap all enhancements, seals and additions of two selected playing cards.
Outcome: None, literally nothing
then it wouldnt activate with jokers doing it and the other ability of the card is making burnt jokers
See how my Jokers define custom draw functions
For the soul sprite
you're incredibly helpful btw I'm grateful
And just add a check somewhere
idk barely anything about the modding api and am just making a goofy idea a friend thought of
(grandma, when blind is selected make a food joker and 1/2 chance to become mr bones)
got it
I’ll do that when I get back to my computer
Heating up some mac
idk why it doesn't work, i need to read it a bit more but card.enhancement and card.seals don't exist
it's card.config.center.key and card.seal
my mac
Destroying Apple products I see
to transform you can use card:set_ability("j_key")
i dont rememebr what mr bones' key was
yeah im a hypocrite
yea well im a hippo crip
Even then, I asked it to print the outputs as a table and it gave nothing again.
ok yeah the reason it doesn't work is because G.hand.highlighted[1] and [2] are single cards, not tables of cards
They have to be single cardsss?
you're trying to iterate over a single card
sorry i had to disappear immediately after sending this apparently but wdym by this?
if true then
return -- returns from the function
end
if true then -- it will never reach this
-- stuff
end
huh ok i wouldve assumed it wouldnt matter since the only thing connecting them is the calculate function
I just killed her and added mr bones, is the standard way to use that?
depends on the effect you want to achieve
they are meant to be two different functions, one turns it on and one turns it off
im also running into an issue with the remove_from_deck function but im dealing with that ❇️ after ❇️
well, calculate is a single function
true
removing the returns just makes these not do anything, what would the process be instead?
what's the goal? also you don't need to divide the probability to turn it off
oh wait what
in fact, it just halves the probability if you do that
ok LMAO so what would the new method be to disable it after the hands left counter reaches 0
just don't return the multiplication
oh wow ok
the new context multiplies the values every time it is called so you just turn it off by not modifying them
Alright, I know the bottom half is wrong. What do I set it to?
you're setting the stuff of card not card1 or card2
You are so right
I've been coding for like 7 hourss oh my god
It still crashes TwT
is the crash something along the lines of "trying to index string"
got it working!! tyty
Oh
get_enhancements returns a table like this { m_bonus = true }
you don't want get_enhancements because you dont want quantum stuff shenanigans
Alright
you can still use get_enhancements just use next on it
card1.config.center should work
yeah just do what N says
That... Almost worked.
The seal didn't transfer. And the car became the consumable.
Originally like this (ignore the numbers)
you probably wrote card.config.center which would be the consumable
for the seal it should be without the .key
YES! Thank y'all so much!! 
sup gang
new joker im making
js trying to get it to give you $3 at the end of a blind, during the cash-out part, plus it should play a custom song in the shop? how to do this?
first part is with calc_dollar_bonus
k
second is with smods.sound which idk anything about
i know one bit about it
lol
so id have to do that whole sprite_data thing?
im trying to make so you get a tarot card for the specific hand you discard so im looking on burnt joker but i dont know the check for the type of hand you discard
is it G.FUNCS.get_poker_hand_info(G.hand.highlighted)???
yes
ah i see
Can someone please explain to me what G_E_MANAGER is and why I would ever wanna use it?
And how to use it, I guess.
this doesnt work, i assume?
loc_vars = function(self, info_queue, card)
return { vars = { calc_dollar_bonus } }
end,
calculate = function(self, card, context)
if context.end_of_round and context.game_over == false and context.main_eval and not context.blueprint then
calc_dollar_bonus```
you use it to time actions like messages
https://github.com/Steamodded/smods/wiki/Guide-‐-Event-Manager
calc_dollar_bonus is another function like calculate
pls see the docs
mb
where the hell is the code for blue seal
i dont want to look through 900 mentions of blueprint
Card:get_end_of_round_effects in card.lua
also i recommend vanillaremade if you just want the implementation
repo if that helps: https://github.com/DogeisCut/CuriousCrafting
damn you beat me to it i was gonna add something like that
welp time to make your mod a requirement
getiing a bug here
key = 'spambot',
loc_txt = {
name = '{C:purple}Spam{}{C:money}bot{}',
text = {
'Earn {C:money}3 Kromer{} at the end of a blind'
}
},
atlas = 'spambot',
pos = {x = 0, y = 0},
rarity = 2,
cost = 6,
config = config = { extra = { dollar = 3 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars } }
end,
calc_dollar_bonus = function(self, card)
return card.ability.extra.dollars
end
}
not sure why
yeah
...
config = config = { extra = { dollar = 3 } },
ANHBNEBFEIFJIADB
how did i do that
¯_(ツ)_/¯
while ur here
👀
do you know how to replace shop music?
key = "music_spamton",
path = "music_spamton.ogg",
pitch = 1,
volume = 0.7,
select_music_track = function()
if jokerExists("j_silly_spambot") and string.len(G.GAME.blind.name) > 0 then
return true end
end,
})```
this is what i have, i assume i just need to replace the ```G.GAME.blind.name``` with something else
Is it possible to have a cardarea of cardareas
No
Ah ok. Should I not be looking at heartbreak for what you mean then?
no, why?
well maybe you can
Was thinking about making a card type where you can drag it onto a Joker to give it certain attributes
à la how it looks in Solitaire
Except you'd still be able to rearrange the jokers like normal
you can have a cardarea as a child of the joker
you just need an if check 😭
O
that's something I want to do but I've never figured out how to make it look nice
i still don't understand how z ordering works in this game
I really wanna continue modding but my feeble brain can't take much more of Balatro's UI
OH 😭
Where
And all my projects are either UI dependent or art dependent or both
I really heavily debated reprogramming it from the ground up in Unity with a custom rendering engine but I'm pretty sure that's not allowed for like five different reasons
yeah
anybody know how to replace shop music
with a joker
Is it worthwhile to search through the thousands of lines of UI code and do the UI from scratch
inside the draw function as I said
SMODS.Sound({
vol = music_volume,
pitch = music_pitch,
key = "[key]",
path = "[filename].ogg",
select_music_track = function()
return ([your conditions] and G.shop and not G.shop.REMOVED and 11) or false
end,
})
thank you!
ur good
yeah that’s what i woulda did
the uh your conditions: im just trying to make it so the new shop theme only plays when you have a specific joker
close
rats
is there a way to get a decks base joker slot limit? like how painted/black deck has 4/6 joker slots by default
next(SMODS.find_card("j_modprefix_key"))
"close"
so what is it?
what i just sent
oh is it find_card? mb
you need the next too
G.GAME.starting_params.joker_slots
it might not exist for decks that dont replace it
sorry I wasn’t home hi
ok so
I set soul pos to a table
in the table I put the draw function
in the draw function I check if the toggle is true
and then if it is true… do I do a card.children remove thing?
thanks!
or 5 should hopefully be good enough for that scenario
key = 'spambot',
loc_txt = {
name = '{C:purple}Spam{}{C:money}bot{}',
text = {
'Earn {C:money}3 Kromer{} at the end of a blind'
}
},
atlas = 'spambot',
pos = {x = 0, y = 0},
rarity = 2,
cost = 6,
config = { extra = { dollar = 3 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.dollars } }
end,
calc_dollar_bonus = function(self, card)
return card.ability.extra.dollars
end
}
this doesnt give me 3 bonus dollars like its supposed to, did i do something wrongggg
yes, you named it dollar but you're using dollars
no
You just draw or not draw
oKAY
so i set soul_pos to a table
if the toggle is true then draw
if it’s not then dont draw
do i put the set sprites code in the draw function?
No
trying to set a config value to (G.GAME and G.GAME.starting_params.joker_slots) makes it equal to nil for some reason
i put G.GAME and before it because otherwise it crashed on startup because G.GAME didnt exist yet i assume
yeah none of that exists at the time you make a config
How do I get the amount of hands remaining?
G.GAME.current_round.hands_left
So, I tried using Better Tags with Cryptid (namely, my mission to generate the greatest Cat Tag the world has ever seen), but that mod seemed to break Cat Tags entirely. I did manage to fix it.
ooh ill try setting it in set_ability instead
How do I get the current score and required score?
yeah that did it sweet
G.GAME.chips and G.GAME.blind.chips respectively
is there any G.STATE for boss blinds?
G.GAME.blind.boss?
why am i crashing
my code:
https://github.com/DogeisCut/CuriousCrafting
I don't think so? It may be something i done wrong
[SMODS P5Music "P5Music.lua"]:50: attempt to index field 'BLIND' (a nil value)
lua is case sensitive
also it's not a state
oh
if G.GAME.blind.boss is true then you're currently in a boss blind
OKAY
bump
How can i implement that? Sorry if i ask dumb question but i hardly even believe that my own code is working and im new to modding 😭
that looks fine, you might need to add G.GAME.blind and in front of it so it doesn't crash in the main menu
granted idk much about sounds
like that?
yeah
check your injections, based off the crash
can i see the code for the tag
quick question about pseudorandom, it returns a value between 0 and 1, correct?
if you want it to
with only the seed, yes
SMODS.Tag{
atlas = 'Tags',
pos = {x = 0, y = 0},
key = 'foodtag',
apply = function(self, tag, context)
if context.type == "new_blind_choice" then
tag:yep('+', G.C.PURPLE,function()
local card = Card(G.play.T.x + G.play.T.w/2 - G.CARD_W*1.27/2,
G.play.T.y + G.play.T.h/2-G.CARD_H*1.27/2, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS['p_para_foodpack'], {bypass_discovery_center = true, bypass_discovery_ui = true})
card.cost = 0
card.from_tag = true
G.FUNCS.use_card({config = {ref_table = card}})
card:start_materialize()
return true
end)
tag.triggered = true
return true
end
end,
loc_vars = function(self, info_queue, card)
info_queue[#info_queue+1] = G.P_CENTERS.p_para_foodpack
end,
in_pool = function(self, args)
return false
end
}
hmmm no idea
The game stopped crashing when trying to access the menu, but it stills plays the music from G.GAME and G.GAME.round_resets.ante
for my understanding it should work, but it doesn't
what is it doing now? i don't understand
It is still playing music that is played with G.GAME and G.GAME.round_resets.ante, and still doesn't play the music with G.GAME.blind.boss on boss blinds
oh, i think you need to give it a higher (?) priority
but like i said i don't know much about sounds
try adding and 1 or false at the end
It is working now! So for my understaing the "and X or false" is for priority?
yes
well A and X or false means, if A is a truthy value, the entire line will evaluate to X, otherwise to false
I'm surprised your music plays with a priority of 0 tho
well somehow it works
if it works it works
are you able to make joker's atlas asset a gif
no
True programming mantra
i am NOT touching that code if it works 😭 i just know the game will magically crash on startup when i change that for no reason
how do i make this code instead of shop be for regular blinds
vol = 1,
pitch = 1,
key = "music_spamton1",
path = "music_spamton1.ogg",
select_music_track = function()
return (next(SMODS.find_card("j_silly_spambot")) and G.shop and not G.shop.REMOVED and 11) or false
end,
})```
@pure salmon i know you know how to do this probably
how to do for regular blinds
and
a seperate one for boss blinds
ok i think
i got it
maybe
or if not im close
im trying to patch Card:load and Card:set_sprites to make a joker have certain dimensions (like half joker) but for some reason its not doing anything? i copied the way its done for half/photo/square and replaced the name with my jokers key but it doesnt work idk why
heres what im patching in respectively (before the part for half joker but the whole code is pretty long)
if self.config.center.name == 'j_osquo_ext_backgroundcheck' then
self.T.h = H*scale/1.5*scale
self.T.w = W*scale
end
if _center.name == 'j_osquo_ext_backgroundcheck' and (_center.discovered or self.bypass_discovery_center) then
self.children.center.scale.y = self.children.center.scale.y/1.5
end
its only 1.5 for testing ill change it to a more normal value once its actually working
you don't really need to do this as display_size and pixel_size exists
omg thank you
every time i try to do something like this it just turns out theres already a thing for that lol
i should just read the docs more
this is also done in vanillaremade :3 :3
stuck on a problem ^^;
code:
local game_start_run_ref = Game.start_run
function Game:start_run(args)
game_start_run_ref(self, args)
local existing_ranks = {}
for i, j in pairs(G.playing_cards) do
local is_valid = true
for _, rank in ipairs(existing_ranks) do
if j:get_id() == rank then is_valid = false end
end
if is_valid then existing_ranks[#existing_ranks + 1] = j:get_id() end
end
G.GAME.phanta_initial_ranks = existing_ranks
end```
this is causing a crash for someone
namely: if j:get_id() == rank then is_valid = false end
as it says it's indexing a boolean value
ideas? ;u;
Have you tried printing j?
what do you mean
you mean it works for you but not someone else or
yep
Also have you tried putting it in an event?

