#đ»ă»modding-dev
1 messages · Page 540 of 1
what is the Global variable for the cash you have
G.GAME.dollars
k thx
Is that 000000 black I see?
is there a round function in steamodded ?
looks like it
<@&1133519078540185692>
SMODS.Atlas({
key = "Lingo2Glyphs",
path = "Lingo2Glyphs.png",
px = 96,
py = 96,
atlas_table = "ASSET_ATLAS"
}):register()
MaxBoiSM.Gears = Sprite(0, 0, 1, 1,
G.ASSET_ATLAS['maxboism_Lingo2Glyphs'], { x = 0, y = 0 })
i feel like i am losing it why is this crashing with an attempt to index field atlas (a nil value)
SMODS.Atlas({
key = "CustomEnhancements",
path = "CustomEnhancements.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
}):register()
Sprite(self.T.x, self.T.y, self.T.w, self.T.h,
G.ASSET_ATLAS['maxboism_CustomEnhancements'], { x = 0, y = 0 })
when this works
wait
ah
thats slightly annoying
nvm problem solved ignore me
is there a way to increase the chance of negatives showing up in the shop
i might know where to look for this but thought id ask
or wait better question
nvm i realized it prolly doesnt
but yeah is there a way to adjust the negative chance then
or would i have to do functions with card.ability.extra.odds to rig X chance
I crash because of that line it saying cant compare a table to a number
you have talisman rn
talisman turns some global variables into tables (aka bignums)
yeah
you want to use if to_big(G.GAME.dollars) > to_big(0) then
and have to_big = to_big or function(x) return x end at the top of ur file, just in case theres no talisman installed
like in the util file ?
anywhere in your mod
ok ok
just to be sure its like that right
mhm
Balatro may cry
Bless me
Hello, I would like to know if anyone can help me figure out how to make the joker only create jokers that are from the âGreenâ pool.
code should be outside the return statement
set = "modprefix_Green" as well
also donât use polls , use a table and pseudorandom_element
and assign it as a key
<@&1133519078540185692>
yeet
I see that specific bot hit lots of servers I'm in lol
local green ={âjokerkey1â,âjokerkey2â}
etc
you might yse it as a global and not a local table
theres this for creating pools
https://github.com/nh6574/VanillaRemade/wiki#how-do-i-create-a-poolset
Tables do the same thing lol
would say tables are also simpler ngl
how would I go about saving a custom value between runs of a game? should I add it to the Game object or is there a function that supports this and I'm just not understanding the documentation? (it's a counter for how many times a specific consumable has been used to trigger an effect upon the nth use)
set the value by hooking Game:start_run and then setting it in there
he want to save counter for how many time specific consumable been used
this run ?
God, I don't understand anything.
Thereâs a joker that gains mult based on tarot cards used
yea, per run. I currently do have it as a global variable, but I noticed it kept resetting to 0 in between tests for a different feature
Welp, this bit of research is not exciting :/ but at least I just need to do this once
local ref = Game.start_run
function Game.start_run(...)
local ret = ref(...)
G.GAME.your_var = G.GAME.your_var or 0
return ret
end
oh, if you want it to save for all runs
then save it to G.PROFILES[G.SETTINGS.profile]
not all runs, just the one that is saved
Nice clutch psps
if so then what i said above
Been on the art grind for some time so here's a spectral
Owwww
youre so awesome
đ
damn ive been thumbs upped
hi dilly
hello
Here's the other arts I've been working on recently
i like the pack ripped open ig..if it even matters....imo...personally..
that one is still wip until I can figure out how to effectively draw the shrink wrap peeling back đ
well its still cool..
i feel like a god for pulling this off (timing still needs work but it's functional)
<@&1133519078540185692>
đ«
phisher ban speedrun goddamn
On mobile to
i look away for ONE second
Slow
rip, I completely broke a run I was using for testing but it had natural canio and perkeo on the booster packs but I forgot to save the seed
average testing luck:
how would i check if the score caught fire at the end of a round?
"score caught fire" = "single hand's score >= blind requirement", so it's just a check for
if hand_chips * mult > G.GAME.blind.chips in context.final_scoring_step
(hand_chips and mult are the chips and mult values from that played hand at the time of calculation; in final_scoring_step it should be the final score for that hand. G.GAME.blind.chips is the blind requirement)
if you're on latest smods commit, don't use hand_chips*mult
what do i use then đ
if you're on latest release (0711a), it's fine
actually ill just see if it works
i would still like to know what to use on latest commit for reference
alr then
it would be SMODS.Scoring_Parameters["chips"].current * SMODS.Scoring_Parameters["mult"].current
awesome, thanks
How do i change a games function? Im tryna change the price of retcon but idk how to do that.
Hey, anyone has any idea how to update the current config_tab of my mod? I want to do a pagination but having trouble with it
oh and btw
on latest commit, SMODS.last_hand_oneshot already does the job for you
it's true if hand one-shots blind
would this work for checking if a playing card has the custom seal and then giving the mult?
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
if SMODS.has_seal(context.other_card, 'inf_bitten') then
return {
e_mult = card.ability.extra.bitten
}
end
end
end,
hey, i want to know if smods handle by default the difference of dark and light suits?
mods includeed
no, SMODS.has_seal doesn't exist
Do you know what it is then?
just do if context.other_card.seal == "modprefix_key" then iirc
note that it's modprefix_key, not modprefix_key_seal
Im tryna make a random number between 0.5 and 6 but it just keeps giving 5.5+
pseudorandom("Glitch") * 0.5 + 5.5
it should be the other way around: pseudorandom("Glitch") * 5.5 + 0.5
Ahh ok thanks, ive never tried using that pseudorandom, ill try tmrw thanks
randomfloat(start, end) = start + pseudorandom("seed") * (end - start)
is this different than mult * hand_chips?
I believe mult * hand_chips is no longer used
that's not my question
then what is
do they give the same result or not

Plasma effect is not in a usable state because of this
That's not my question!
Do both equations give the same result
it doesn't matter i can gather that no
that everything that uses hand_chips * mult wouldn't work anymore? that's really bad imo
also i dont like having to do smods.scoring_para................ whatever to get the score
also good morning dilly
i havent messed around with this yet i would have to see
I haven't downloaded it yet even
Figured id just wait for release which I think is this weekend
It shouldnât be different when I fix it later
amazing
Thereâs also SMODS.last_hand_oneshot which is a Boolean flag, and you can use SMODS.calculate_round_score() to get the score respecting different calculations (though Iâm not sure when this resets off the top of my head)
saving this to update my wiki
hi haya
do things that modify mult and hand_chips directly still work (or after the fix)
It just ignores plasma right now, and I think probably swap effects too
While using my mod the longer the run the worst the performance. I think it could be a memory loss. Is this a Balatro thing or should I review my code?
If they use mod_chips/mod_mult it will when itâs fixed
if your mod has ui then its likely its not properly disposed of
It has yeah
mhm
So I have to review the ui then
Jokers with multiple ability texts don't seem to display them properly when they have info_queues?
ah, okie
I donât know if itâs in main yet but i remember bepis committed the change
Itâs been a while itâs probably added
Are there problems ?
Chip-Mult Operator API is not in a usable state
My english is lacking i just woke up lol
download this specific commit instead
In which file exactly
many
here?
Probably
(X) to doubt
(O) to skip dialogue
([ ]) to truth
the thing about the multiple info queues should be fixed too but i think that's after the chip mult operator thing
N does most of the work
this was all eremel
it's before
I already sent the link to the exact commit before chip mult operator
Take the fake credit
Itâs mixed within it
it's in the same commit iirc
im not talking about that one
But please please stop directing inexperienced devs to the dev branch for the love of god
Just say âitâll be in the next smods release, donât worry about itâ
đ

That is the entire point of having releases
Is there a way to activate a joker when debuffed?
Remove the debuff
I still want it to be debuffed but I want to have other effect
I've tried that
but doesn't work đ
calculate = function(self, card, context)
apply_element("Forest", "ina_onforest", G.C.PALE_GREEN)
if context.debuff then
restore_types_for_area()
end
end,```
this is all my function
what do you want to do
I have a type system and this joker set all the jokers to Forest type
I want to reset the type when debuffed
use remove_from_deck
remove_from_deck applies when debuffed??
yes
oh

Whatâs reading
I've read so many things doing this mod that my head is gonna explode
Cpu overload
balatro modding book when
Iâm helping seu pai make better scaling detection with a lua praser
oh man that makes sense

wha
well ya, that'd make it work, but the problem is that i'm on the version it requires
shown in the screenshot
Rigged
i think you dont need the -steamodded part
ah okie
đĄ please stop using dev builds as dependencies why am I suddenly having to say this all the time again
i have this ObjectType for a booster, though when i open the booster pack i get 3 jimbo's
key = "Passive Items",
default = "j_bali_breakfast",
cards = {
["j_bali_sadonion"] = true,
["j_bali_innereye"] = true,
["j_bali_spoonbender"] = true,
["j_bali_cricketshead"] = true,
["j_bali_myreflection"] = true,
["j_bali_numberone"] = true,
["j_bali_bloodmartyr"] = true,
["j_bali_brotherbob"] = true,
["j_bali_skatole"] = true,
["j_bali_haloflies"] = true,
["j_bali_magicmush"] = true,
["j_bali_thevirus"] = true,
["j_bali_roidrage"] = true,
["j_bali_heart"] = true,
["j_bali_rawliver"] = true,
["j_bali_skelekey"] = true,
["j_bali_dollar"] = true,
["j_bali_boom"] = true,
["j_bali_trans"] = true,
["j_bali_compass"] = true,
["j_bali_lunch"] = true,
["j_bali_dinner"] = true,
["j_bali_dessert"] = true,
["j_bali_breakfast"] = true,
["j_bali_rottenmeat"] = true,
["j_bali_spoon"] = true,
}
})```
whats wrong
it's kinda necessary if ur mod uses a feature only the dev build has lmao
how do I know if a card is eternal?
no, the point of releases is that you depend on those. If you want a feature thats on the dev build, that's fine, use it on your own system, but absolutely do not force other people to download potentially unstable versions
not forcing anyone to do anything, mods are optional lmao
you are missing the point entirely
SMODS.is_eternal(card)
no I'm not I just don't care rn cuz I'm tired
how do i make tag appear only after ante 2
Is there an easy way to check if the played hand is a royal flush? It defaults to Straight Flush with context.scoring_name
context.evaluate_poker_hand and context.display_name == "Royal Flush" then save that
thank you
this works, but it also triggers when you select it on your hand without playing :/
yeah i dont think it has a parameter for that, i would store the truth value somewhere and do the effect in context.before
checking the display name woudl language lock it though I think
i checked, the value is before it gets localized
hello! how do i make so theres more than the two "rarity" and "modname" thingy on the jokers ?
(ping me pls)
set_badges
set_badges = function(self, card, badges)
badges[#badges+1] = create_badge('text', G.C.RED, G.C.BLACK, 0.8 )
end,
It's put there just like the calculate function
And can also go into consumables etc
yeah aight thanks
hey i really need help to make a joker, i want to make that gives mult for every dark suit played but destroy every light suit, but my code cant recognize more that one suit at the time and i dont know how to destroy cards so pls someone help me
what do you mean by cant recognize more than 1 suit at a time
mod
use or in your if statements
and use context.destroy_card/context.destroying_card/SMODS.destroy_cards depending on what you are doing
this code is able to create an Orbital Tag, however, when it spawns, its poker hand is listed as [poker hand], and yeping it crashes the game
how can i fix this?
C:dark_edition
You'd need to do extra tag work to set a correct value for those.
-# I just went the lazy route and change the tag manually if it is Orbital.
ah kay ^^;
is it possible to save found seeds from "Immolate seed finder" to a txt file
can i use freopen? for c++
Lua
change it to add_tag(Tag(tag_var),nil,'Small') iirc
You can export variables to a txt file with lua
giving that a go
how
wrong modding channel whoops
local seed = âthe seed"
local file = io.open("seeds.txt", "w")
file:write(seed)
file:close()```
that didn't work
Shinku jumpscare
Add a ân\â to go back inline
ân \â without space
Why didnât it show lol
I hate this app đ
N\ but the N is lowercase
hi
\n
ya it's that
Gotta do double \
\n
im not coding for balatro mod, im coding for seed finder
the n is short for newline
this thing
I have yet to figure out/understand what \r does
Edit the file to export the seed
Unrelated to modding and more so coding
carriage return i think?
so
Tldr
Find the variable the seed is stored in
\n is for new lines, \r returns to the start of the line
ok then?
Do this
having both would make a new line, with the cursor at the start
I do it as
local tag = Tag(selected_tag)
if tag.name == "Orbital Tag" then
local _poker_hands = {}
for k, v in pairs(G.GAME.hands) do
if v.visible then
_poker_hands[#_poker_hands + 1] = k
end
end
tag.ability.orbital_hand = pseudorandom_element(_poker_hands, "seed")
end
tag:set_ability()
add_tag(tag)
you don't really need both though
This will save the seed to a file
\n suffices
Hi all. Brand new here but hoping someone might be able/willing to help me troubleshoot something.
I've been using Mod Manager for the last few months, I've always launched the game through BMM without Steam being open.
Well, I've been grinding away at C++ the last couple weeks and was down to my final joker as of last night.
Unfortunately, I launched Balatro today while steam was open, and my save file seems to have reverted back to the last time I had launched through Steam, losing about 50 gold stickers in the process.
I tried quitting steam and BMM and relaunching without steam being open, as well as restarted my MacBook, and no luck.
Am I just screwed here? Or is there any way I could recover that previous save file?
Forgive me if this is the wrong channel for this type of thing. Took my best guess.
Sorry guys. Wrong channel.
Youâre giga cooked bro
your save file got overridden
ok so like this?
Damn. What I feared.
Is inst the seed variable ?
yeah
oh sorry I mistyped that, add_tag(Tag(tag_var,false,'Small')) should work
Sadly
I feel like I had launched through Steam before w/o this happening, so I had some small hope. Thanks for letting me know.
lemme try
worked, thanks!
how can I set up a custom context to behave like context.fix_probability? I'm trying to refactor the context I set up to modify dice rolls, and I'd like to be able to return a new dice_value calculation key instead of passing the whole die object into the context and having the context users modify it directly
How to change the chance of a joker appearing without changing its rarity?
you cant without redesigning the pool system
-# yet
can I hook the pool system?
to change things in it
đ„ș i'm gonna go back to banging my head on the smods source but if anyone knows what to do it'd be greatly appreciated
i assume i need to add to the calculation keys table, but i'm pretty sure there's at least one more step i need to do, and hooking calculate_individual_effect doesn't seem to be working
hello, currently making sprites for playing cards for a custom deck, in this custom deck, there is 4times the same card lets say, should i also put 4 times the sprite ? (please ping me)
https://www.youtube.com/watch?v=Zp-4U5TlbxY
is this tutorial appropriate to allow multiple jokers or is it only code for one
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
i havent watched it but you can justa add more jokers by adding more SMODS.Joker to the same file so it should be good
okay, nice
no proper calculations yet
the rarity should be fullhous_rotted. "modprefix" is a stand in for the prefix that you assigned to your mod, which appears to be "fullhous" according to the error
Ah that makes sense
okay the text isn't formatted correctly but i can fix that
Okay i load into the game but whenever i go to the collection, it crashes and gives this error
does anyone know if its possible to "play" a card that is held in hand (preferably using lovely)
show the code for the atlas you defined for your custom jokers
i think paperback has a legendary card that does something with this
yes it's nichola, it scores face cards that are held in hand as if they were played (they still count as being held in hand, and won't be discarded after the hand is over)
no, the SMODS.Atlas
you do have one, right?
paperback uses SMODS.score_card
but i need to recreate some this since i am using lovely
is there any particular reason you're not using steamodded? it's the central API for pretty much all balatro modding
sorry if this is a simple mistake but how may i fix this
i want the '$5' and '$50' to appear yellow
there's no "yellow" color, use "money"
https://github.com/Steamodded/smods/wiki/Text-Styling#named-colours-dictionary-gargsloc_colours
use C:money
ohhhh lmao
thanks
had no idea
C Money sounds like a rapper who had one hit in the early-to-mid 2000s
Should I use functions or LOVELY editing to modify the UI?
depends
if you can hook cleanly, you probably should
if you can patch safely, you probably should
does anybody know the game's values for money and probability
woah its aure hi aure
50 dollars and 1 in 4 (?)
G.GAME.dollars?
hiya
i havent seen you in ages i hope youve been well
i've been well, just haven't had much time for modding stuff
yeah
aha, thank you
got exams coming up so there's that
totally fair, no obligation to either
I hope your exams go well!
thanks. and probability?
đ here's the scores from last year's class for the exam I'm having Tuesday (score out of 55, 20 needed to pass)
good luck to me hehe
ty
good luck
any idea how to fix this? i just updated lovely and smod but now i can't launch the game
sorry for constantly asking questions but how do i program probability into a joker
like a 1 in whatever for something to happen
just trying to get the basics from the professionals
from 1 to 10 how hard to code a joker that would it be to give +chips on a certain day ?
is this any different from vanilla probability
no judging and by the seeing or your question i won"t tell you why (althought you might know one day or another ?)
the explanation of how probability works is in the release notes for 0711a because it got completely overhauled
f#k
os.date("%A") == "Tuesday" will be true if the current day is tuesday i think. fill in whatever day of the week you wanted
thank you
os.date("%B") == "February" and os.date("%d") == "14"
note that it should be a string with the number in it
wait ima build smth up and get back to y'all
i'm so stumped rn pls help
i'm so sorry for being annoying but does anybody know how to properly integrate chance into a joker
i've read through the smods 0711a notes
thanks
return chips instead of mult, but yes everything else looks good
yh i saw that rn i copied from vanilla remade the base joker x) i'm not wriing allat
only if your system language is English
and this works for all language, like if my pc is in french it will work ?
aw fuck right
f#ck
cuz im french and i have my mod in french and english
so i put the french for august
and that should work
maybe don't rely on system locale
yh
os.date("*t") should get you a date table if I'm not mistaken
but how am i supposed to make it universal ?
oh actually just do os.date("%m"), that'll give you a number for the month
it return number
so e.g. for february os.date("%m") == "2"
so i put
for august there
yea that'll be true on august 14th
nice
made let's see if it works
why isn't there i have my atlas correct (it should be my actual discord pfp as a joker)
Change joker key maybe
so it works but i don't see why cuz i always put the same key as the atlas key in the joker key -_-
Keys should be unique please
x) why please ? it works and helps me with ctrl+f
but yeah from now on ill differentiate keys
so i tested my date based joker on todays date and this happenned when i summoned it
so encase that entire if statement inside
if context.joker_main then
-- do stuff here
end
or add an and
You basically calling a nil value because thereâs no chips
that should be correct, yes
ah formatting
wait
so yeah like i shwoed cuz now t works just fine
isnt this also missing a context check
oh
Second if is outside the first if statement
lmao
doens't seem problematic, i tested with todays date and the date it should be and it triggers only when it's todays date
and the %m needs the 0 before any month that has only one number like august
to make it clearer x)
Should make a time related mechanic
so now i have another joker but no idea of what effect to give it
Baguette đ„
no it's a sad heart
i might wanna test whanging texture every boos blind or smth like that, i have this image to go along
I smell Tangents
"x2025 mult with your currently eating a baguette"
can't bother too much
glory to franceđ«đ·
lemme rectify it,
"x575 mult if you are actually eatng a baguette with wine"
(575 bcz france exists since 1450 and is 575 y/o)
or x1450 to not bother changing it every year
frogor this masterpiece
ima switch to #âă»modding-general now :)
to not bother anymore
WHERE?????????
in that line
"main.lua.txt" hmmm
loc_vars = local ?
loc_vars = local ... ,
doesn't make sense
the fuckin message is still there
i'm just looking at smods right now
smods probability, 0711a
i recommend looking at vanillaremade
it has examples for that
look at like cavendish or something
fuck my life
any help, anybody?
no idea what this symbol could be
nevermind
grahhhh
dice now have a total of 3 accessible contexts: context.dice_mod, context.dice_add_rerolls, and context.dice_post_roll.
context.dice_mod is triggered every time a die rolls, and passes the die object itself in context.dice_other_die, as well as context.dice_roll_value for the current value from the roll. returning dice_value in this context changes the die's rolled value, which updates context.dice_roll_value (like numerator updates in probability-editing contexts) so that duplicates of dice_mod jokers can stack.
context.dice_add_rerolls is triggered once during the die use process, and can be used to make a die roll multiple times. it passes context.dice_other_die and context.dice_roll_value again. returning a number as dice_rerolls in this context rerolls the die that many times. by default it will pick the highest number rolled, but you can also pass a function as dice_reroll_determiner to make an alternate condition (e.g. you could write a function that takes an average of all the rolls). the function should get a single argument, which is the table of all the rolled values (including the original one that it had before this particular card did its rerolls)
context.dice_post_roll is triggered after the whole rolling and rerolling process is done. it just passes context.dice_roll_value, being the absolute final roll value for the die
this has allowed me to un-hardcode my vouchers and make it so that other cards are "reaching into" a die's ability table as little as possible
any documention on how to change the position of the stake sticker
dunno exactly but just a heads up, you'll probably want to move the eternal/perishable sticker location too (it's the same height in the left corner)
and maybe even the rental sticker
yeah i figured too
my first guess is something with either the set_sprites or draw functions in the joker
really quick
does G.GAME only exist during a run?
yes
? no
(source: debugplus eval G.GAME on the main menu)
is there a resource i can use for making custom decks ? (with custom playing cards)
idk for me it crashes when i try to do stuff with G.GAME outside a run
also stuff in G.GAME is saved to the run so like
why would it exist outside
maybe the contents are different, and i think it rebuilds G.GAME in initialize_game_object and/or start_run
check the page for SMODS.DeckSkin
it 100% exists outside the game because i never nil check G.GAME
does this applies to creating a deck inspired from a way different playing card game ? (different suit system from poker/hand types and so on ?)
no, thats only for making alternate textures for the existing cards like the face card skins that exist in vanilla
if you wanted to make an entirely different set of playing cards you would need to look into SMODS.Rank and SMODS.Suit
aight
and SMODS.PokerHand for hands
um my game keeps crashing when trying to cash out after the first bind
Im trying to make my deck card score randomly, like the one in TogaStuff. idk why it doesn't work
Does anyone have any experience editing number_format?
i technically do but its more likely that you will get an answer if you post what the problem is
-> https://dontasktoask.com/
for removing/banning a tag from game how can i do it?
Made a mod to replace the larger numbers with the names of the numbers like so. If I leave the text as one line it expands the whole side bar and looks silly. If I do it across multiple lines it doesn't expand the Round Score box. Was wondering if there's an easy way to do this since there's plenty of unused space above the round score
that's part of the problem i was mentioning because messing with number_format and messing with UI are entirely different lol
alright lol, my bad
at the minute my code only touches number_format, so I thought it was relevant
you would need to patch this
guys where do I need to define that
is there some way if could do some kind of blueprint-showman-esque type joker effect where, with doubles appearing enabled, increase chances of joiker to the right spawning?
there's no way to control individual joker weight yet
How can I get cards held in hand to score like those selected?
is there a context before context.open_booster for when you buy the booster? context.open_booster doesn't trigger until its already opened so trying to add more choices then just adds it to the next booster pack
General question cuz I'm just brainstorming ideas right now, would it be fairly simple to have a custom back for a specific edition, say you had a custom steel back on your steel card so you could see it was a steel card when it was drawn face down
You mean the played cards?
Yes
i think they want cards held in hand to score
Yes
that sounds interesting actually idk if thats doable
local oldsmodsscorecard = SMODS.score_card
function SMODS.score_card(card, context)
if not G.scorehand and conditions and context.cardarea == G.hand then
G.scorehand = true
context.cardarea = G.play
SMODS.score_card(card, context)
context.cardarea = G.hand
G.scorehand = nil
end
return oldsmodsscorecard(card, context)
end
Thanks, something!
hi smt
Hello.
how have you been my friend
i hope well
some folks have returned... (i'll work on the art later on) i will still credit you dilly for the additional concept
going to readd memory card
and it has come to bargain
What's with the /?
saved hands or discards / limit
I see. I am more used to a (Max x hands stored) type format.
i see
Is there a way to get what consumable a player has used?
I'd like to get if that consumable is a planet, and upgraded the poker hand's level by 2 instead of 1 (as a joker effect)
read the documentation! :)
https://github.com/Steamodded/smods/wiki/Calculate-Functions#contexts
aka if context.using_consumeable is true in your calculate function, then context.consumeable is the consumable in question
and no, consumeable isn't a typo
I'm an artist andy
Cool, I had seen that but didn't really understand it, ty for explaining
Im tires
I dont know if this is the right place to ask this, but i have a quick question. Im trying to put my own music into the game by manually replacing the .ogg files. When i first did this, the music was slowed and pitched down. ive been trying to get it to the correct pitch and speed but i cant find it. Does anybody know the pitch and speed i need to set the music to so it sounds normal?
butthole surfers đŻ
i might be stupid but does anyone know why my patch isnt being applied
this pattern exists and its the only instance of it
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
pattern = '''
other_drawn = not G.GAME.facing_blind and SMODS.drawn_cards
'''
position = "after"
payload = '''
, forced_draw = forced and SMODS.drawn_cards
'''
match_indent = true
i have another patch right above it which does work and it targets the exact same file
the pattern has to match the whole line exactly, so you need the }) at the end (which also means it's probably not going to behave exactly as you expect)
oh thats evil but good to know
ill probably make it patch the first line instead i guess
you might be able to insert it between that last parameter and the }) with a regex but I'd rather just figure it out with a different pattern tbh
ya i could probably just do it on after with the first line of the calculate_context and be fine
I hate this
I really don't understand how to make my stake appear before specific stake AND make that specific stake apply my stake
i was bored
No way
Did you recreate it for yourself or you made the art for my mod or something
Because either way that is awesome
i made the art for u to use if youd want to
i didnt actually recreate the function i just faked the description for the ingame visual
ill dm u the sprite then
Message me how you want to be credited and an optional social media profile for linking on the read me
I hate Cryptid's code
Is there a way to count cards drawn?
From first draw and the next play/discard draws?
how to get every joker rarity?
SMODS.Rarities maybe
should have all, including ones from other enabled mods i think
if context.before and next(context.poker_hands["Flush"]) and not context.blueprint then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
play_sound('busterb_makudonarudo')
card:juice_up(0.3, 0.5)
update_hand_text({ sound = 'button', volume = 0.7, pitch = 0.9, delay = 0 },
{ level = 'x' .. to_big(card.ability.extra.multiplier) })
for poker_hand_key, hand in pairs(G.GAME.hands) do
local current_level = hand.level or 1
local levels_to_add = math.max(0, math.floor(current_level * (to_big(card.ability.extra.multiplier) - 1)))
if levels_to_add > to_big(0) then
level_up_hand(card, poker_hand_key, true, levels_to_add)
end
end
update_hand_text({ sound = 'button', volume = 0.7, pitch = 1.1, delay = 0 },
{ mult = 0, chips = 0, handname = '', level = '' })
return true
end
}))
return {
message = localize('k_level_up_ex'),
colour = G.C.MULT,
card = card
}
end```
it works
but the animation is kinda buns
How would I forcefully add a card to the scoring hand (no matter the scoring hand's current size) without changing the type of the scoring hand? (in context.before, preferably)
Check every loaded joker's rarity
Definitely not a good way, but at least it's something
Does this continually stack if you beat multiple blinds with 1 hand or something?
Ah, got it
How can you count how many cards have been drawn?
hook draw_card() and make it add a count to a global character
IM SORRY
wait i want to see all the "SMODS.Joker{...}"
ok
@harsh warren can you send it :^?
the code?
SMODS.Joker{ --Freddy
key = "freddy",
config = {extra = { mult = 5,}},
pos = { x = 0, y = 0},
rarity = 1,
cost = 3,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
unlocked = true,
discovered = true,
effect=nil,
soul_pos=nil,
atlas = 'freddy',
calculate = function(self, card, context)
if context.joker_main then
mult = card.ability.extra.mult
{
cardarea = G.jokers,
full_hand = G.play.cards,
scoring_hand = scoring_hand,
scoring_name = text,
poker_hands = poker_hands,
joker_main = true,
}
end
end
}
first of all is not like it is "wrong"
but normally the "congif" is left next to the function
so you dont have to scroll 1827 lines
soul_pos is the Atlas for legendary, you dont need it
-# any joker can have that, but you get it
yep that i know
any stats that is changed in a function, have to be in the return
I'm currently trying to create a config tab with a toggle button, but I'm running into issues. It honestly could be a simple lua error, since I'm new to the language.
Here is the error message I'm getting:
engine/ui.lua242: attempt to index local 'node' [a nil value]
-- main.lua
HW = {}
HW.CONFIG = {}
HW.CONFIG.ui = function ()
local ui_nodes = {
custom_text_container("ml_tags_options_message", {
colour = G.C.UI.TEXT_LIGHT,
scale = 0.80,
shadow = true,
}),
{
n = G.UIT.R,
config = {
align = "cm",
padding = 0.1,
},
nodes = {
create_toggle({
label = "Enable Hello World",
ref_table = HW.config,
}),
}
}
}
return {
n = G.UIT.ROOT,
config = {
align = "cm",
padding = 0.05,
colour = G.C.CLEAR,
},
nodes = ui_nodes,
}
end
HW.config = SMODS.current_mod.config
SMODS.current_mod.config_tab = function ()
HW.CONFIG.ui
end
if "condition/s" then
"things that does not touch the game"
return{
mult = card.ability.extra.mult
}
end
smth like this
return {
chips = card.ability.extra.chips
}
yea like that
tbf idk why you have all of that
the {........}
youre just making a joker that doesnt need them
ok
maybe and for more advanced jokers if necessary
the return goes after the if
if skdisjs then
return {
}
end
im crashing out bro
Can i see the code
change Joker to Atlas you mean?
And your path should have the file extension at the end (.png)
No
oh shi you are right
Change key = âfreddyâ to anything else
Keys should be unique across your mod
and this?
Thereâs a mod called banner
That does that
If youâre trying to test your joker
okay thx so much
Thereâs a mod called debugplus that lets you spawn jokers and a lot more
ok
Hold tab for more information
Good luck >-<
@harsh warren Banner lets you to disable all things to appeard
but yea, if you just want to try the joker use debugplus
hover the joker in collection and press Ctrl+3
sorry i didnt read you
too sleepy to read and think
wsit what you do with the atlas?
you need to add the extension path too, like .png, .jpg, etc etc at path.
uhhh
-# wait i realized kate already helped you lmao
Keys only need to be unique across objects in your mod, not the whole thing
Yes what you said is wrong
Guys am i speaking another language đ
You can absolutely have an atlas and a joker with the same value in the key field
It does
Who am i to argue with john smods
hello, im seeking help for creating a custom modded deck(custom cards/hands/and so on), pls ping me or hit me up in dms
what eremel said is true you can have the same key in diffrent objects but two SMODS.joker canât have the same key (as an example )

maybe Im blind and cant find the documentation for it, but where do you define your mods icon?
in main.lua
SMODS.Atlas {key = 'modicon',path = "icon.png",px = 32,py = 32}
in your assets X1 AND X2 place the icon.png (your mod icon)
ok, thanks. Did not know that you have to define it in an atlas
Where do I find how to make buttons and such for cards? I would guess in the wiki but I don't find said thing there
Oh boy
Itâs under ui
But
Good luck
ui is scary
Yes
Why...?
Shit is so hard not even ai can help
Well, ai is sometimes not that good at all at coding
yeah most ai sucks at coding
Ui isnât hard
Just look at how people do it and youâll understand it
good reference is always
joyous spring

Do you have a link for that?
Thank you :)
anyone know why this scales but doesn't actually apply any xMult during scoring?
do i need to do a permanent upgrade like hiker?
Your top block wonât happen
oh ok
Just put the xmult = in the bottom one
ah yeah that works thanks
i was originally planning something like this which obviously isnt working but i'm a bit confused on how to do it
i don't know how to go about applying something like that to every card in the deck that uses that enhancement at once
hiya! i'd like to write a shader that cuts a pixelated hole from a card
shaders are beyond me right now though, so i need help -3-
i have this:
#if defined(VERTEX) || __VERSION__ > 100 || defined(GL_FRAGMENT_PRECISION_HIGH)
#define MY_HIGHP_OR_MEDIUMP highp
#else
#define MY_HIGHP_OR_MEDIUMP mediump
#endif
extern MY_HIGHP_OR_MEDIUMP vec2 drilled;
extern MY_HIGHP_OR_MEDIUMP number dissolve;
extern MY_HIGHP_OR_MEDIUMP number time;
extern MY_HIGHP_OR_MEDIUMP vec4 texture_details;
extern MY_HIGHP_OR_MEDIUMP vec2 image_details;
extern bool shadow;
extern MY_HIGHP_OR_MEDIUMP vec4 burn_colour_1;
extern MY_HIGHP_OR_MEDIUMP vec4 burn_colour_2;
vec4 dissolve_mask(vec4 tex, vec2 texture_coords, vec2 uv)
{
if (dissolve < 0.001) {
return vec4(shadow ? vec3(0.,0.,0.) : tex.xyz, shadow ? tex.a*0.3: tex.a);
}
float adjusted_dissolve = (dissolve*dissolve*(3.-2.*dissolve))*1.02 - 0.01; //Adjusting 0.0-1.0 to fall to -0.1 - 1.1 scale so the mask does not pause at extreme values
float t = time * 10.0 + 2003.;
vec2 floored_uv = (floor((uv*texture_details.ba)))/max(texture_details.b, texture_details.a);
vec2 uv_scaled_centered = (floored_uv - 0.5) * 2.3 * max(texture_details.b, texture_details.a);
vec2 field_part1 = uv_scaled_centered + 50.*vec2(sin(-t / 143.6340), cos(-t / 99.4324));
vec2 field_part2 = uv_scaled_centered + 50.*vec2(cos( t / 53.1532), cos( t / 61.4532));
vec2 field_part3 = uv_scaled_centered + 50.*vec2(sin(-t / 87.53218), sin(-t / 49.0000));
float field = (1.+ (
cos(length(field_part1) / 19.483) + sin(length(field_part2) / 33.155) * cos(field_part2.y / 15.73) +
cos(length(field_part3) / 27.193) * sin(field_part3.x / 21.92) ))/2.;
vec2 borders = vec2(0.2, 0.8);
float res = (.5 + .5* cos( (adjusted_dissolve) / 82.612 + ( field + -.5 ) *3.14))
- (floored_uv.x > borders.y ? (floored_uv.x - borders.y)*(5. + 5.*dissolve) : 0.)*(dissolve)
- (floored_uv.y > borders.y ? (floored_uv.y - borders.y)*(5. + 5.*dissolve) : 0.)*(dissolve)
- (floored_uv.x < borders.x ? (borders.x - floored_uv.x)*(5. + 5.*dissolve) : 0.)*(dissolve)
- (floored_uv.y < borders.x ? (borders.x - floored_uv.y)*(5. + 5.*dissolve) : 0.)*(dissolve);
if (tex.a > 0.01 && burn_colour_1.a > 0.01 && !shadow && res < adjusted_dissolve + 0.8*(0.5-abs(adjusted_dissolve-0.5)) && res > adjusted_dissolve) {
if (!shadow && res < adjusted_dissolve + 0.5*(0.5-abs(adjusted_dissolve-0.5)) && res > adjusted_dissolve) {
tex.rgba = burn_colour_1.rgba;
} else if (burn_colour_2.a > 0.01) {
tex.rgba = burn_colour_2.rgba;
}
}
return vec4(shadow ? vec3(0.,0.,0.) : tex.xyz, res > adjusted_dissolve ? (shadow ? tex.a*0.3: tex.a) : .0);
}
vec4 effect( vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords )
{
vec4 tex = Texel( texture, texture_coords);
vec2 uv = (((texture_coords)*(image_details)) - texture_details.xy*texture_details.ba)/texture_details.ba;
tex.a *= 0.35;
return dissolve_mask(tex * colour, texture_coords, uv);
}
extern MY_HIGHP_OR_MEDIUMP vec2 mouse_screen_pos;
extern MY_HIGHP_OR_MEDIUMP float hovering;
extern MY_HIGHP_OR_MEDIUMP float screen_scale;
#ifdef VERTEX
vec4 position( mat4 transform_projection, vec4 vertex_position )
{
if (hovering <= 0.){
return transform_projection * vertex_position;
}
float mid_dist = length(vertex_position.xy - 0.5*love_ScreenSize.xy)/length(love_ScreenSize.xy);
vec2 mouse_offset = (vertex_position.xy - mouse_screen_pos.xy)/screen_scale;
float scale = 0.2*(-0.03 - 0.3*max(0., 0.3-mid_dist))
*hovering*(length(mouse_offset)*length(mouse_offset))/(2. -mid_dist);
return transform_projection * vertex_position + vec4(0,0,0,scale);
}
#endif```
where do i start đ
can i ask why that is? i wanted to try this idea of it only scaling during boss blinds but i don't see how i would do it without 2 seperate blocks and the 2nd block isn't happening in this code right now
Put them the other way round
yeah that fixes the scaling during the boss blind but then the actual scoring doesnt happen at all anymore
nevermind
hold on a sec
ah ok
they score but not during boss blinds
i think i can just add the scoring to the boss blind block as well
Oh you need the Xmult still in both
yeah gotcha
Your boss blind return is super funky too
card = card doesnât do anything, and why are you using an extra table?
i'll be honest i dont know
i think i saw something else similar use it and thought it was required
i dont really know what it does, i have that in quite a few jokers though
oh wait yeah nevermind idk why i have that there lmao
i know what it's for now
another question about this actually
is there a way i can limit how high this can go
for balancing purposes i think it probably makes sense to cap it at 1.5x mult
huh.
hello, im having a real hard time making a modded deck, can someone help me out ?
im trying to make a joker that draws an additional card whenever you play or discard. i tried using the SMODS.draw_cards(handspace) function but im not really getting anywhere
here's the current joker code btw
key = 'amoeba',
loc_txt = {
name = 'Amoeba',
text = {
"After play or discard,",
"draw {C:attention}#1#{} additional card"
},
},
config = {extra = {additional_cards = 1}},
rarity = 1,
atlas = 'CosmicTomfoolery',
pos = {x=0,y=0},
cost = 3,
blueprint_compat = true,
loc_vars = function(self, info_queue, card)
return {
vars = {card.ability.extra.additional_cards}
}
end,
calculate = function(self, card, context)
if context.drawing_cards and (G.GAME.current_round.hands_played ~= 0 or G.GAME.current_round.discards_used ~= 0) then
return {
SMODS.draw_cards(hand_space)
}
end
end
}```
Is this a created card?
No, I am messing with :set_base for letting this affect copied and created cards.
Is there a context that triggers when buying items from the shop?
Which smods version are you on? Iâve been noticing similar strange effects but havenât investigated the cause yet
...this is not SMODS at fault, just my function being a bit after the sprites are set. đ
if next(card) and not manual_sprites then
self:set_sprites(nil, card)
end
Actually curious if card is still needed there if self.config.card = card was done earlier...
bump
sure
this is the smods docs https://github.com/Steamodded/Wiki/blob/20c8d1282a933eef622386012e2a14e02a3d36a6/SMODS.Center/SMODS.Back.md#L4 and this is an example https://github.com/Steamodded/examples/blob/master/Mods/AbsoluteDeck.lua
in a shader, how can i get a random number between 0 and 1?
(i don't need noise, this is for positioning)
so basicly its a deck with custom cards and custom hands
(would use basic set of mahjong tiles so 4 x 9 Man, Pin, Sou then 4 winds, 3 dragons)
i don't know how to put exacly those cards in there, like listing them inside the deck yk
i know random(uv) gives a float between 0 and 1
will give it a go :D
doesn't seem like it
if (hole_pos.x < 0) {
hole_pos.x = random(uv);
}
if (hole_pos.y < 0) {
hole_pos.y = random(uv / 2);
}```
okie
lol
idk what are you talking about man
the guy on the poker table will love when i tell him this
mb, theres like specific amount of each custom cards and i was asking if there were a way to like, list them in the deck code itself
yes you can , are they enhancements /editions ?
prob
no, you can view them as custom suits tho
alright, this didn't crash, but it's also doing nothing to the card ;u;
it's rendering fine if i change the opacity to 1??
just, opaque
no idea how to change the texture's opacity
howd i list them ?
im a little busy , try asking is modding chat pleasee
gotcha
what does it look like if you set the alpha to 0?
the circle is absent
do you stop the base shader being drawn?
ah, no -3- i haven't looked at that
then that'll be why it looks like nothing is happening đ€Ł
you're adding a transparent circle on top of an image
right ;u;
thats, an incredibly old version đ
the new versions got a much better look lol
:D
no idea what to do about the shadow though
it's still rendering the base shader, but disable_shadow removes it entirely
i installed it like a week ago lmao
idk is it not meant to
you need to make a custom shadow shader that matches it
it should be between Extra Effects [Stacked] and Press [LShift + X] to view effects
no clue why its up there
i dont think ive ever encountered that bug before
maybe try updating stacked ;P
can a retrigger joker retrigger another retrigger joker?
yeah it shows there too i just hid the extra effect
that's sad
no it's not
I mean Blueprint and Brainstorm kinda do that so
got it to work!! is there a way to make it spawn only on Jokers? :D
(and, conversely, i'd like Waxed to stop appearing on Jokers)
i have a question, for a custom suit i need to register an atlas for each png/texture including hc and lc ?
lc sheet, hc sheet, suit icon
Hi chat, does anyone happen to know how to allow numbers and other symbols into this thing?
and those 3 needs registered atlas i suppose ?
<@&1133519078540185692>
ans what do i put in the colour part ?
hex("[hex code of your colour here]")
oh ok
i'm trying to make it so boosters that are debuffed cant be opened and vouchers that are debuffed cant be redeemed
ive tried patching into button_callbacks but i dont understand the e object that's getting passed
i tried tracing it backward but the UI system is really complicated with several layers of stuff getting passed around
-# e is the node that is executing the function. From there you can get e.config.ref_table, etc...
e is the node.
{n = G.UIT.R, config = { minw = 1}}
print(e.config.minw)
> 1
there is a context to tell if X joker was sold?
use this context then check the sold card's key
Yeah, that.
okay im back on track tysm
all that in the key goes in the key or in the context?
if context.selling_card and context.card.config.center.key == "joker_key" then end
wth is wrong ? i hecked and the name it wrote on both are correct
ok thanks man : )
and my icon is is the asset folder
where is the file?
For atlases it must be in /assets/1x and /assets/2x
yh its what i did
1 and 2 times the size respectively.
i know i already registered atlases correctly
Then idk
so it works for some reason now but do i need e loc_txt ? it's not suppoed to be "ERROR" (althought it fits the gimmick) (yh my suit is not original)
and why does it take the place of diamonds ?
It is encouraged to have a localization file.
The error generated by the game is just a way for it to not crash. You should replace these messages with your own, even if they should read 'error'.
diamonds are on the next page, no?
yh :)
x)*
i didn't see
but ignoring the need of localization, how do i give my suit a correct name ?
thanks
What do you mean by a correct name?
like the name not beng the "ERROR" the game gives
how would i reference the number of levels for most played, least played, and most recently played hand
Hi there fellow devs and modders
I'd like to get into modding and since i've been playing balatro a lot lately, i thought this would be great to start ! (Embedded dev that never touched game dev)
I have a pretty good idea of what i'd like to do but i don't know if it's possible.
So here it comes : Is it possible to add or edit UI and menus ? (i'm don't know what lua scripting allows or not)
If so, do you guys have basic ressources to share ? I'm guessing a lot can be found around the Love2D docs ?
(wasn't sure this belonged here or in #âă»modding-general, feel free to tell me if i should post there instead đ)
there's some basic document on ui definitions on the smods wiki
You could do a for loop for the first two but I have no idea how to do the most recently played hand
nvm i got it like a few minutes after i posted lol
just store last played hand when it s played
o7
Thanks 
To edit the existing UI you'd probably have to use patches
i'm not sure what it means yet, but i'll remember this thanks ! 
In general the VanillaRemade is a good point of reference for modding (it recreates almost all vanilla things with smods) and it has a really helpful wiki explaining a lot
Ho okay đź Thanks for the doc !
i'm guessing it would be easier to add a button that opens another menu rather than editing an existing menu then ?
I'm not sure about adding buttons but I feel like it would still need patching, just because the ui is defined in the source code,
Hello. A little somethin' like this is maybe what you want?
or any variation in whatever menu idk
Yeah exactly !
Almost none i'm affraid
oh
Then I'd suggest you first learn the basics of lua.
What are variables, conditionals, loops.
Tables, functions, etc.
The lua manual is a good starting point, maybe.
Well i'm already a dev so i'm guessing it won't be that hard ?
unless LUA has really specific usages ?

<@&1133519078540185692> kill
This is for balatro modding.
Which involves lua.
Since balatro is made on lua.
ty <3
no i meant, the discord link that just appeared, i thought it was a LUA discord ahah
timing was perfect
they are getting aggressive
Thanks !
If you have any questions, maybe ask them in DMs to not clutter this chat.
or not, I don't know if that's allowed here.
I don't know the rules by heart.
pretty much if its mod creation assistance this would be the place to be
General lua questions. I don't know if that fits here.
How do i check which Suit a Flush is using? All the ways i can think of would get messed up by Four Fingers or Wild cards
You just have to count the suits and find the most populous
store card.base.suit as a variable and check which is the most predominant card suit
gotta make the description of my joker change depending on if oops all 6s is there
i'll do that now
Im trying to make a new hand in my mod, but for some reason it is disabling full house and flush house. This is my evaluate code, is something wrong???
if true then return {} end
if #get_flush(hand) >= 1 then return {} end
if #get_straight(hand) >= 1 then return {} end
local valid = {}
local count1 = 0
local count2 = 0
local count3 = 0
for i = 1, #hand do
local card = hand[i]
local num = card:get_id()
if card.label ~= "Base Card" then
if num == 2 then
count1 = count1 + 1
table.insert(valid, card)
elseif num == 4 then
count2 = count2 + 1
table.insert(valid, card)
elseif num == 7 then
count3 = count3 + 1
table.insert(valid, card)
end
end
end
--if hand[1].base.id == 10 then
-- print("WOOOOOOOOW")
--end
if #valid > 0 and count1 == 1 and count2 == 1 and count3 == 1 then
return {valid}
else
return {}
end
end```
can someone explain to me why this isn't allowed
you are trying to concatenate strings with a global variable that doesnt exist
that confuses me. numerator clearly exists
unless the game hasn't loaded it when it boots up
thats not
how you do loc_vars
you would have to use loc_vars to have your description update for oops
you need to get the numerator (and denominator) in your joker's loc_vars function, and return them as variables. check the 0711a release notes again for a code snippet about how to do exactly that
oh my bad
wait a second
they are
they were already like that
?
unless i'm missing something
oh yeah
you just need to then put #1# and #2# in the text in place of the original values to get them in the description
you would instead just have
well
you dont need to concatenate
you can just put #1# and #2# directly in the text
thank you very much for your guidance
i know i am very bad at lua programming, so sorry for constantly asking modding-dev for help
@manic rune It's easy to set up, it's mostly that it involves patching, and a continuous learning about additional things to patch, haha. But it shouldn't be too hard to set up. Copying the Seals implementation just means I'm dealing with a lot of vanilla jank due to it not being intended to be expandable, haha
Gonna try and figure out if I can rewrite some stuff on the Smods' end to help with making a new card layer easier as a whole, honestly, because a lot of the stuff is just pretty unintuitive.
i am trying to improve though
i've been using vanillaremade for guidance
as advised by N'
(thank you n')
vanillaremade localization files can also be used as reference btw
it has all the text for the vanilla jokers
mhm ic
VanillaRemade is a great tool. Something I tend to do when I don't know how to do something that is present in vanilla code is by just adding a comment every few lines trying to explain what's happening. A lot becomes a lot cleaner once you start to realize what stuff references what other stuff, and why it does so
\
thank you
is this right for triggering a card when it is destroyed?
do you think i should transition into using official balatro code after learning vanillaremade?
