#đ»ă»modding-dev
1 messages · Page 233 of 1
sometimes people see something SMODS did and people think thunk did it
*looks at Negative playing cards*
do you know by any chance what kind i would put if i wanted it to be the same kind as a celestial pack?
or.,., the planets one
i think thats what its called
i'm not sure actually
let me check
yeah it's just "Celestial"
make sure to put it in quotation marks so it counts as a string
i'm making a nonconspicuous pack with nothing in it that just makes a shitty skeleton run gif past the screen and give you an acheavement that says "WHAT THE FUCK?? DID YOU SEE THAT??"
so much for hooking
local scie = SMODS.calculate_individual_effect -- save a reference to the original function
function SMODS.calculate_individual_effect(effect, scored_card, key, amount, from_edition)
if key == 'my_key' and amount then
-- do something. refer to the original function for what to do here
return true -- the effect was calculated, so we return early
end
return scie(effect, scored_card, key, amount, from_edition) -- run the base function as normal
end
you'll also need to insert any keys you add into SMODS.calculation_keys
probably easiest to do by patching as to get an order that makes sense
you'd be looking to target some line within this
uhhh okay ive never done lovely patching before really so let me make sure im getting this right
the pattern is the original code im searching for and payload is the new code, position = after puts the new code right after the old code
yers
its not going to patch the "old" code tho
unless you do position="at"
im thinking i just add a new if key == 'something' thing inside of SMODS.calculate_individual_effect
you can lovely patch that as well, but it doesn't have patch target comments
so it may break in the future if something changes in smods. that part is perfectly reasonable to do with a hook, so that's the safer bet
im not sure what that means?
what am i trying to patch here
Just wanted to say that this is cool as hell
you're trying to patch a line into this (in smods src/utils.lua)
SMODS.calculate_individual_effect is fine to do with hooks
the target buffer name for that is target = '=[SMODS _ "src/utils.lua"]'
so i add a new key into the SMODS.calculation_keys{} table?
but that wouldnt have any effect on its own would it
you need both
you need to add a key to SMODS.calculation_keys, and you need to hook SMODS.calculate_individual_effect
or patch it, but like i said that's too fragile
time to create suit jokers.
whats the difference and how do i hook instead of patch
^
a hook basically just inserts code before or after a function as well as its parameters and return values
patches add or change code anywhere
so a hook is made by defining an already existing function it looks like?
does it go in my lua file or the lovely.toml?
alright
so i add that hook in my mod's code and then make a patch to add the key
yep
looking at six suit's suit jokers
so suit should just equal a suit i made
How can I make custom consumables appear in shop, like how spectral cards do when a certain trigger is true?
does this look about right for the key patch? im pretty sure this would put 'my_key' right after SMODS.calculation_keys = { which is what i want
[[patches.pattern]]
target = "src/utils.lua"
match_indent = true
pattern = '''
SMODS.calculation_keys = {
'''
position = "after"
payload = '''
'my_key',
'''```
yes, if you want it to happen before any other effects returned in the same table
i dont think it should matter much when in the table it is
i think im starting to understand how this works
it does, it defines the order in which effects are applied if there's multiple
e.g. if my joker applies xmult and flat mult, the flat mult happens first because it's earlier in the table
depending on the effects, that does or doesn't make a difference
aah yes thats what i was thinking
good to know but that shouldnt matter for what im adding here
yeah it's just visuals then
does this work
needs to be a string
mine just grabs it directly from the saved definition of the suit
just one more thing, does the local scie's name matter? i see its used to call the rest of the normal function
if i wanted to add more hooks theoretically would i just have to make more local variables with different names
you can name it anything you want
thought so, just wanted to be sure, thanks lad
acronyms of function names are common practice, but it can be anything really
ideally you shouldn't reuse variable names in the same scope, that's all
I like to copy the name verbatim and add an underscore at the front
surely thats not against luas convention of using underscore prefixed variables for system/internal variables
there isn't really a convention for that lmao
(thats specifically for globals it doesnt apply here)
_ in locals often just means it's unused
if it breaks it breaks
hang on im looking at it now and now im not sure ive got the right thing
what does SMODS.calculate_individual_effect actually do like what is it
this is what the LSP says
yeah i saw that but what does that mean
because at first here i was trying to just make a custom key parameter for localize but now i think ive done something else
i dont think youre supposed to have the [s and ]s?
also of course make sure your loc_txt is setup right
actually hang on how do i handle the localize inside the new calculate_individual_effect since that seems to use 'a_mult' or something like that which isnt what i want
and where do i tell it what sound to play
there's also these jokers tied to mechanics i have yet to impliment
the suit rarity system (the main 5 puyo colors + nuisance puyo are common, the other 3 are rare)
and two custom hands (puyo chain and puyo rainbow)
im trying to make a boosterpack with nothing in it i dont understand what im missing :c
it loads the game fine but it tries to index a nil value when i try to discover it
Why the fuck do you want to make an empty boosterpack
does anyone know how to make cycles in UI? this is all i have đ
SMODS.current_mod.config_tab = function()
return {n = G.UIT.ROOT, config = {
r = 0.2, minw = 12, minh = 9, align = "tm", padding = 0.1, colour = G.C.BLACK
}, nodes = {
{n = G.UIT.C, config = {minw=6, minh=9, colour = G.C.MONEY, padding = 0.15, r = 0.1}, nodes = {
-- how tf do you add cycles :(
}}
}}
end
Maybe add card and make them do nothing or give 0 selection limit
wdym? c:
Blank
i made the limit 0 but idk what the other thing is
Zero out of zero
I think itâs how many you can choose out of how many idk man iâm dumb asf
I never codded a boosterpack
i already have that that way
i think its something else
Damn got it already?
Disgrace. Humiliation.
thats what im aiming for yes
Make selecting a card add it and then remove it
Then it does nothing that was
Way*
i have what im going for i just need it to not crash-
Divine Intervention
Ohhhhhhhhhh
Good luck man
đđWHAT THE FUCK
Altars of Apostasy
Good luck bro ?
took you 3 somgs
Favorite track btw

Foolish.
Man i forgor the names
-# dude my pronouns are they/she it's not that hard-
Into fire is one of my fav
Good luck my lady
without sounding like a discord mod
My lady is cute right?
lets just do âsisâ
well if u continue like that
Nah we besties fr
uhh dont worry heâs never seen a woman in his life before this is a new experience for an ultrakill player
Real i have 2k hours
And p ranked p-2
Thats like virgin with extra step
i genuinely just dissociated for the past few minutes ngl
have castorice
Why is w spelled double u when itâs double v
87 is divisable by 29
No shot

How do you call SMODS.current_mod.set_debuff(card)?
nmumbers
You see that
20*3=60
9*3=27
Alright bro youâre frying my brain
No like genuinely why is this a thing and how did nobody noticed it before ?
Am i a genius? Is english fake ?
ARE WE REAL CHAT ?
I hope teto âs real
I'm struggling with the most effective way to translate sprites relative to a parent. The built in offsets in the draw_shader function are kind of... bizarre? And seemingly don't account for local rotation. The only time this is used in the base game is for the soul layers, all of which are exactly the same dimensions and have the same pivot point (in the direct center of the card)
So for example if you use the horizontal or vertical offsets, and an object like a sticker is moved from the origin, it's still going to rotate according to the top left of the card, even though the rotation should technically be inverted when something is across the horizontal or vertical axis
hm
(problem I'm trying to solve is how to successfully move a sticker without changing the assets used, for the sake of vanilla compatibility)
Also yes hello! đ«”
oh um im having a problem that you can problibly help with bcos your are smart

i zoned out
Yes? Maybe I can help?
im making a booster pack, and the game opens okay, but when i go to discover it i get a crash with attempt to index a nil value
and i donut understnad
here is my bad code, im just trying anything to get it to work x-x
You should also show the crash log!!
i thought maybe it HAS to have particles or somethin so i stealed some for later changeses
crasj lawg
I can armchair diagnose based on the line number
Okay so off the top of my head, card should never be nil when calling loc vars
So you don't need to nil check for it
okie c:
I have so many ideas, so little time
do i need a create cardd argument at all? im trying to create an empty booster pack
same crash TwT
Okay, so my second idea:
It's probably because of how loc_txt is formatted
For most objects, you're required to have a name property and a text property
ohhh
So my guess (without being at my computer) is that you need to wrap the text in a table, call it text, and add name = 'Something'
yeah the loc text scared me i dont understand it
what are tables? that's ssomething i shouldd know
A table is the core data structure in Lua. Anytime you create something in braces {}, you're making a table
So your loc_txt should be
name = 'Skeletal Pack',
text = {
'amogus',
'sussy'
}
}```
the name should actually be Celestial pack and the text is just filler c:
but that helps a lot!!
Isn't there already a Celestial Pack?
the whole point is im making a booster pack with no cards that just gives you an achievement and makes a shitty 3d skeleton run across the screen
Oh that's silly silly
cringe circus is not going to be a very serious mod LMAO
Silly :3 silly even
me when someone says my mod isn't helpful, useful, or is wildly unbalanced
if you would consult the blahaj joker
My mod isn't necessarily meant to be balanced either
mine is actually striving to maintain some balance, but we get silly when we wanna
I'm just adding whatever I want
@chrome widget IT WORKED YOU ARE THE BEST
đ
Need
I will dual wield my two blahaj
wait have you seen it?
yesh
I mean, this is the same mod that adds Women to the game as a suit
That's fair, I also added women specifically so one of my jokers could flirt with them
I LOVE BLAHAJ
isn't it the best joker
I added Women specifically so I could make a bunch of Trans Jokers
:3
Now I'm adding Yume Nikki Effects as Cards
I have three genders: women, trans women, and miscellanous
And then I'll add Runes
I'm not sure what else after that tbh
But we'll get there when we get there
Here are all the cards for the Woman Suit btw
ESTROGEN!!!!!!!!!!!!
Funny cause I don't even take oral estradiol anymore, but still, based
Okay now make a man suit
im still trying to get on it tbh..,,
With literally nothing but negative effects
Lmao. That's mean though
Yes
If you're in the U.S., planned parenthood!!
:(
Giving hrt advice in the Balatro modding channel is funny
Like I'm fully aware that I'm ragging on myself here but men suck.
as much as I appreciate it, it's a lot more complicated then most cases
Women are simple betterâąïž

What if I added this into the game
Cat Rank
I might in the future tbh. Depends if I can find a good use for it
I am female suit
Yeah but I don't like being mean :(
can i remove my mod's tag from an object?
Alright. I'm going to work on a couple Dream Cards for this booster.
Dream Cards add Effects, a new type of modifier, to your cards.
(Effects aren't made right now, but I'm looking at other mods to see how it's done)
Yep! On the object's definition, put no_mod_badges = true
life saver
Do I make my mod's tag orange and green, like a Carrot, or do I keep it as periwinkle, my favorite color
My mods name is Carrot Field
i set mine as my fav color combo red and gold
Orange and Green!
Mine is just a light pink because Cardsauce used the color for Stand/JoJo related content
ok now i just have to do the hard part..,,
winter
how do i code a skeleton to run across the screen when you open this pack

Depends, what assets do you have?
skeleton gif c:
After that compose and use music in it
it's just gonna be silent, i think it'll be really funny that way
People, what program do I use to program in Lua?
Notepad
use fnaf jumpscare sound
bad to the bone riff
LMAO i actually have a joker in my mod right now that uses it
i use jetbrains intellij idea
REAL X3
oh my GOD that's so good
Okay so the simplest option: ("simple" in quotes)
Creating a UI object node that's large enough to cover the screen, feeding in the gif
Using an AnimatedSprite as the object
wait, this notepad?
yur
i mean you can
notepad++ is a lil more professional
vscode and especially jetbrains is overkill for lua
what is the naming scheme for modded jokers (trying to make my joker create a copy of itself in this line, just cant figure out what itd be named) ''local new_card = create_card('Joker', G.jokers, nil,nil,nil,nil,'j_joker')''
would this be incorperated into the pack i just made?
ok ok
generally it's 'j_[mod prefix]_[supplied joker name]'
thanks
VSCode is definitely not overkill, what do you mean?
i guess yea
j_[prefix]_tag
VSCode is kinda amazing
Intellisense really is very helpful, I'd recommend it
But i mean a baby can write in Lua if i told him the basic concepts and gave him documentation
mfw im baby
nop, youâre not a he
no but i mean thats how much exp i have writing in lua
i genuinely started 4 days ago
meow
meowmeowmeow
should i eep
yur
yes
oh did you see my ask btw
why isnt obs recording balatro properly wtf
So like yeah, can it be applied to the current pack, yes. It's probably too intensive to like armchair it over discord messages though, sadge
ohhhh okie c:
for now ill code the acheavo then
got it working
womem.,,,
gay
i like c:
ok so how would i make an achievement check for if i've opened a specific pack
i can assume context stuff but i just wanna make sure
Far as I'm aware, you just call the function unlock_achievement([key])
oh literally just the key?
Oh wait that's vanilla
Anyone know of any mods that add cards to a (played) hand after it has been "played" but before it has been scored?
I'm able to get the card to be added but the game doesn't score it or properly discard it (which prevents you from playing subsequent hands).
this is what i have so far, everything besides reffering to the pack itself
Through smods, your achievement defintion should have an unlock_condition(self, args) function, and then you can call check_for_unlock() with a specific argument
i need it to check for that specific pack
Well, what I would do is add a create_card(self, card, i) method to your skeletal pack, and then have it call check_for_unlock({ type = '[something]' })
Packs typically call create_card to create contents
hmmmmmmmm okie
Alternatively, you can hook Card:open()
hook?
well im gonna need something in the pack eventually (the skelington) so i might as well do this no?
So, hooking is something you to do overwrite/change vanilla code. The vanilla function for opening booster packs is Card:open().
oohhhhhh..,,,
in a boss blind, this would debuff multiple ranks, right?
What's your mod prefix?
I believe you need to specify one
(this is @ Kawaii, sorry)
(multiple convo threads)
ah okay
random question: does anyone know how to erase the white background in paint (I made the sprites in paint)
step 1 would probably be don't use paint ngl
for doing spritework i would highly reccomend aseprite
I use a copy of photoshop
i mean not a mod but DNA no?
I've heard good things about aseprite. Paint.net also works for the minimal amount of sprites editing I do
lots of qol since its specifically for spritework and pixel art
okay the odd version of this is debuffing aces but not 3/5/7/9, so it seems like this doesn't work
oh me?? my prefix is cringe c:
So I'd just do something like this:
function Card:open()
if self.config.center.key == 'p_cringe_skeletal_pack' then
check_for_unlock({type = 'skeleton'})
end
return ref_card_open(self)
end```
You need to put this in a file for SMODS to load in main
pretty sure that code doesn't do what you think it does
can you specify?
Actually you could probably just put that code in main
i'm following smods.blind docs which have this parameter
Check out https://onecompiler.com/lua/43bn6ura3
And then you just check for args.type == 'skeleton' in your achievement's unlock condition and return true
i like to organize and keep stuff seprate tbh
That's fair, so do I
Make sure to return ref_card_open(self)! Otherwise you're discarding the original's return value and always returning nil
okay yeah I realized as soon as it didn't work that it was just creating different entries in one table
Oop! You're right
wait i'm stupid it probably just has to be a table under value = ?
edit: nope, doesn't like tables
im a little lost sorry X3
That said, I don't think the original function returns anything but nil
I'm eepy but I want to program my Effect Cards :(
is there some sort of a lua standardlib (for table operations) that's popular for Balatro modding / included as dev utils in something like steamodded? i wrote my first mod in pure lua first as .patch files then moved it to lovely, and now im looking to replace the table utilities i implemented by something more standard
True, but that doesn't mean it'll always be that way, or that someone else hasn't also hooked the function and is returning their own data through it
I need to design them first
god these bracket things are annoying .3.
:(
why sad whujh
guys is this proper formatting
comma where
it's a custom color value, i'm asking about the size addition
are you not!
me when i constantly work on my mod
me when i hjave to be responsalbe and sleeeeeeeeep
:((((((((
hey guys, never really done lovely patches before so forgive me if ive missed something obvious here but this code is giving me the lovely crash invalid type: map, expected a string at [[patches.pattern]], how do i fix it? it looks right to me
[[patches]]
[[patches.pattern]]
target = "src/utils.lua"
match_indent = true
pattern = '''
SMODS.calculation_keys = {
'''
position = "after"
payload = '''
'test',
'''```
you're patching steamodded right
[[patches]]
[patches.pattern]
target = '''=[SMODS _ "src/utils.lua"]'''
pattern = ''' card_eval_status_text(card, 'debuff')'''
position = "after"
payload = '''
SMODS.score_card(card, context)
'''
match_indent = true
oooh does it need some extra specificity
still giving me the same error
strange
on [[patches.pattern]]
aaah crud
that line
Unrelated to gamedev but light has been frozen
Saw that on my way to bed so thatâs interesting
Anyone know how do view balatros source code? Or atleast the jokers?
:3
extract game with 7zip
...How?
how can I change the price of items in the shop with a joker ability? I'm trying to find examples but I can't
G.shop_jokers and G.shop_booster are card areas that contain all the cards in the shop except for the voucher, I forget what to do to change the prices directly but I know you can set card.ability.couponed to make said card free in the shop
so, G.shop_jokers[1].ability.couponed = true would set the first item in the jokers section of the shop to free, afaik
Is their a way to access their price? I want to make everything half off
you definitely can but i've never done it before
I think you can actually set G.GAME.discount_percent to change that?
is it possible to have a multiline joker name?
color gone đ
though currently this is my solution
i did just slightly change it so imma test that
ok i am once again making process
oh god it works
ok!!!!
How do you create a specific joker?
how do I specify a joker with that?
change j_joker to something else
i think
SMODS.create_card{key = "j_perkeo", set = "Joker"}
How can I calculate an edition without a card having it?
s has to be lowercase
I tried something like this and it just doesn't trigger (the print works)
oh maybe im wrong on that, colors look fine
is it possible to debuff consumables? this boss blind code doesn't do anything
figured it out i think
hey how does the get_flush function work?
im hoping to make a pokerhandpart thats a flush but six cards long
(or five with fingers)
dont tell me im going to have to mod this shit to take length
@red flower issue is talisman
can i ask what on earth you did to make that fuller house work
i have only been able to make it return either full house or 4oak and its been maddening
evaluate = function(parts,hand)
if #parts._4 < 1 or #parts._3 < 1 or #parts._2 < 2 then return {} end
return {SMODS.merge_lists(parts._4,parts._2)}
end
hey chat, this may be an odd one here
ive got this hook into calculate_individual_effect and im trying to make it so that it increments the score gradually like it would with chips or mult but at the moment its just giving me this weird effect (see image) where the score all gets added instantly and it increments inside the hand name instead
is there a way to get this to work more properly?
function SMODS.calculate_individual_effect(effect, scored_card, key, amount, from_edition)
if key == 'osquo_ext_rscore' and amount then
G.GAME.chips = G.GAME.chips + amount
update_hand_text({delay = 0}, {chip_total = G.GAME.chips})
if not effect.remove_default_message then
if from_edition then
--currently not a thing so no need
else
card_eval_status_text(scored_card or effect.card or effect.focus, 'osquo_ext_rscore', amount, percent)
end
end
return true -- the effect was calculated, so we return early
end
return _calculate_individual_effect(effect, scored_card, key, amount, from_edition) -- run the base function as normal
end```
hmm it appears i forgot how to do the code link thing
this is probably a stupid question, but how do i check for if a certain joker is in the current set of jokers?
i was having a different problem than the block
o
ooo
dumb question what's the difference between putting stuff into G.GAME and G.GAME.current_round
but yeah this
uhh
thank you very much ive been losing my marbles on it, i had tried just merging 2 and 4 and it kept not doing what i wanted
anyone know why the console would be crashing before balatro opens
like unless there's something special that goes on with current_round I don't know why I should just shove my run-wide variables into G.GAME because I'm the one manually updating them in things like reset_game_globals anyway
i feel ya
the game was working like 20 minutes ago, then I coded a consumable, and now it refuses to open
peak?
does anyone know how to define a six card long flush?
actually you know what
@frosty dock is it intentional that get_flush doesnt have a length input unlike how get_straight and get_X_same do?
cus i saw that smods modifies the vanilla get_straight to take the length of the straight, but not get_flush
specifically, min_length is what im refering to
get_flush is not modified to have that as well
instead of a flush it's a saturate
okay wait recalc_debuff just doesn't interact with the consumables slots at all
ok so idk if it's like this since i haven't seen it go off yet
i actually did this myself, but i probably did it in a needlessly extra way, im sure youll find a better way but i did it like this
evaluate = function(parts, hand)
if #hand < 6 then
return {}
end -- Ensure at least 6 cards are present
local first_card = hand[1]
local target_rank = first_card:get_id()
local suit = nil
-- Determine the suit using is_suit()
if first_card:is_suit('Hearts') then suit = "Hearts" end
if first_card:is_suit('Spades') then suit = "Spades" end
if first_card:is_suit('Clubs') then suit = "Clubs" end
if first_card:is_suit('Diamonds') then suit = "Diamonds" end
local matching_cards = {}
local same_suit = true
for _, card in ipairs(hand) do
-- Check if card matches both rank and suit
if card:get_id() == target_rank and card:is_suit(suit) then
table.insert(matching_cards, card)
else
same_suit = false -- If any card differs, it's not a valid hand
break
end
end
if same_suit and #matching_cards == 6 then
return { matching_cards }
end
return {} -- Not a valid Flush Six
end
}
mhm
tbh imma just wait for a response from johnsmods before i work on this
not a problem at all!
fixed
u should add somethin called alphabet soup
â
youre a fantastic entity
what does voucher two do?
Hiya question, any way to disable achievements whilst my mod is being used?
achievement disabled by default
generally a good idea to play modded stuff on a separate profile
One of my friends complained they were getting achievements, where do I guarantee this?
go to mods and then go to config
Oh it's not even a mod thing, thanks
It's a Steamodded Thingâą
is there a way to remove edition from a card
I took a look at Card:set_edition() I'm confused đ
is modded on ios (this is a stupid question butâŠ)
card:set_edition({})?
there are only options to set to something other than no edition
If you set it to nil it removes it so card:set_edition(nil)
fuck.
evil aikoyori mods be like
How do you use quantum enhancements?
it would be really funny to make the virtues only appear when ortalab is being used
where's the code that determines if a glass card breaks or not?
ive looked but cant seem to find it
evil aikoyori's shenanigans be like disabling this boss blind instantly wins the run
i feel like having specific jokers appear when specific mods are being used is funny
i had a revelation last night that ortalab is balatro in reverse literally
then again iâm probably not keeping the virtues
i do have the siivagunner arg balatro mod though
so everythingâs good
i think i know how to impliment the suit rarity system
the rare suits like chu, teal, and sun can only be obtained through spectral cards
while common types can be obtained through tarot cards
i just need to figure out how to exclude specific suits from the deck
like, the suits will still exist, but they won't be in the deck by default
ough
Okay so. I finally figured out what Effects would do. They'd be Run Modifiers that go in their own section, like Betmma's abilities/spells. You can only have one at a time, and they drastically change gameplay.
I'm really happy, cuz I've been struggling with coming up with a reasonable use for Effects for the past day, but didn't want to scrap another feature, like I did the Cat Rank
is that possible to do? excluding specific suits from appearing in the deck by default
Almost definitely. Inks and Colors does it
I just deleted the other cards lol
from EVERY deck
not just a specific one
Oh yeah that's also possible. Don't know how, though. You'd want to look at the SMODS guide
Fuck. Am I really going to work in an Area System into Balatro...? Yes, yes I am.
in_pool(self, args)
i want them to appear rarely in standard packs and also from specific spectral cards
which means that i have to exclude them from the main decks
is there a context for on joker creation?
There isn't a specific one, I had to make one myself
There's one for buying cards, but it doesn't account for Judgement/Wraith/Rif-Raff or Ankh/Invisible Joker
Similarly there's not a specific vanilla one for joker destroyed (via Hex/Ankh, Dagger/Madness), only card sold, so I also had to make one for that too
If you want, here's the patches I use for them
Contexts are context.joker_created with the new card passed into context.card, and context.joker_destroyed with the destroyed card passed into context.removed
huh.
okay, so how is fortune teller retroactive
once i get that setup everything will fall in place
Fortune teller is retroactive because the game has a tracker for used tarot count that it accesses, afaik
Same for Throwback and blind skips
ah. i'm trying to make a joker that's basically throwback/fortune teller, but neptunes
Unfortunately you'll have to make a more specific tracker for that. I made one for a card that scales specifically with deck fixing consumables, but the tracker itself just records every consumable and number of times used in a table, so it could be used for whatever. Want it?
The only thing the game naturally records types of consumable usage for is the global profile tracker which isn't useful
would i not be able to just get the level of straight flush, though
No
oh right, there's instances where it can decrease
Plus Orbit Tags and Space Joker, just in vanilla
eh. i can just patch misc_functions to make it increment a neptune counter then
how would i be able to determine that it's neptune starting from card.config.center? card.config.center.key == 'c_neptune'?
Yeah
great, thanks
can blinds hold values like the config tables? I need to track literally just a counter but it doesn't seem possible
the blind decreases hand size based on how many hands you've played, and I need to reverse that once you defeat/disable the blind
it'd be so useful if blinds were integrated with the calculate/context system, this is really hard to work with, it looks like I have to patch just to make a blind activate on discard
chat what about this one
in my completely unbiased opinion this is what we call fire
i want to get creative with the game
is this a teaser
oh that's a clever mechanic
it was not a teaser
guys i wonder what the cardâs gonna do
youâll paint your face with tears that wonât feel the same
now heart reinforceâs up to end this game
you better give up and throw your mp5 away
there are lots of things this card can do
make it do nothing
â€ïž
hibana
how do I force a blind loss? i've got a boss blind that can reduce hands remaining without you playing a hand, but it doesn't kill you when that happens
Hey ummm Ive decided I am confused enough to actually ask the discord chat. The game is giving me an error for a section of code I have commented out (and subsequently saved) so what how do I fix this (Im trying to figure out editions so Im just testing how to make one, hence using glitched here) I am baffled by this how is this what what is happening why is it trying to run commented code
i think maybe its context.before not working with my other shit
I believe each line is supposed to be commented out, also that calculate function isn't going to work. Try
if context.main_scoring and context.cardarea == G.play then SMODS.calculate_effect({chip_mod = card.ability.extra.chips, message = localize{type='variable',key='a_chips',vars={card.ability.extra.chips}}},card) end
instead (with chips = number in the config)
That didnt seem to fix it
(also thx on the calculate function :) )
Ok I actually tried deleting the code line and it still has the error what the heck
there is a uncommented } right there
ohhhhhhhhhhhhhhh
wait no but I deleted the whole block and it still throws the same error
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Ok Im stupid I figured it out
I changed the mod folder name and so visual studio stopped saving to the correct file
Completely unrelated issue to the actual code
This reminds me of 'Every day I'm sufferin'
Also I added the chips code to the edition but its not working so Imma go figure that out almost got it working
yay
Black goker
tetoris
okay even copying the code straight from the "lose game" debug button doesn't work, and just breaks hand size calculations for some reason
Oh fascinating
I didnât even know it was possible to mess with the drawing order
did i steal this off someone
mabe you should also give it -1 hand size
but maybe thats too weak
it's a rare
yea ig
Whar
Unprompted đ
Yuge
So fucking true
we ball
Ballin
unbalanced? probably
as funny as this is, this seems a LITTLE MEAN if it happens before the cards score
I am very unlucky, moment I post question I find the answers while searching
Also wiki is outdated, joker_main isnt in edition, its pre_joker and post_joker its just not noted to what I found that joker_main doesnt work on editions
@sullen fern
and it does allat đ
what if you wanted to test your joker
but localthunk said
How do I detect if a Joker is moved around in the tray?
4-5
You can make a patch in the Card:move(dt) function
Also how are you choosing what to draw @tall wharf ?
wdym
Actually maybe it doesnât matter in your case if you draw all Aces before you can draw non-Aces
Well it does matter a little bit
Because players can sell it mid-round
Do you draw the Aces from the top to bottom?
it affects on shuffle
Ah ok
Well
Not ok 
Oh but it does stack all Aces at the top
So selling wonât change the shuffle
yeah
hmmm
you can reap the effect at that moment
If one wants to draw an X card, the way to preserve uniform shuffling is to draw a random one from the deck, not the topmost
But most people donât realize that I think
sorry i should have clarified it a bit better, i mean like when a joker changes position in the tray (i.e. moved to the left of another joker, etc)
yea, that should work i used the same thing to make this
I've hooked the set_rank function that cards have, which snaps a card to its spot
i just hook into shuffle because i think that's the best
i might as well shuffle once more when you sell the card
I had different types of such effects. Some draw an extra, specific set of cards. Some change the shuffling, but it doesnât stack them completely
So either way I had to care about it, and reshuffling every time is too much
i checked, there isn't a set_rank function/method?
hi
CardArea:set_ranks(), it's on the card area not on the card
actually what does set ranks do
it snaps the position of cards in the card area
cryptic ahh name tbh
took me some time to find it, that's for sure
any recommendations on where to start if someone wants to create their own balatro mod (mainly custom jokers)
ah
reconsider
and if that doesnt work for you start here https://github.com/Steamodded/smods/wiki/Your-First-Mod
alright
i'll keep this in mind, but what is the "dt" parameter for?
it seems to only activate whenever a new item is added/removed, not everytime an item is moved
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
-----------------------------------------------------...
dt is time in seconds between two frames
ah
I linked to your message
I couldnât find the thread
oh :3
yeah, i saw that
but i think i added a few more stuff to my thread that they will probably need
hi all, i'm thinking of trying to code a neural network to play Balatro, any recommendations on how I can get the game's state? ie. cards in hand, in deck, current jokers, possible hands to play etc.
I'm not sure how the modding system in the game works or if I can access these kinds of stuff, any help is appreciated :D
G.STATES
but thats likely not what you are looking for
G.play, G.hand, and G.jokers mean the playing hand, cards in hand, and jokers in your joker area respectively
the source code is fully accessible! I'm not sure what approach you wanna take when it comes to a modding framework, whether you just want to read the gamestate of a vanilla game, or if you want it to interface with a mod that passes that info, because Steamodded does give you some different options when it comes to accessing info
There was a mod for replays, I think that would help
i was thinking of coding my neural network in Python and interfacing w the mod api somehow to get the variables that way, the other way round (eg. playing the game via Python) would be nice too
may I know the mod's name? :D
Idk but it was @mellow sableâs I think
I've written theses about neural nets but I secretly understand jackshit about them, so I can't say too much, but that'd definitely be very possible. The game makes the current game state super accessible, and lua can call python functions incredibly easily, as far as I understand it. SMODS wiki will be a good help, and luckily all the code is open source. The main thing you'll wanna be able to check are which cards are in the card areas, after all, and that's not too difficult
i'm even more clueless about neural nets too HAHAHH i'm just trying to learn and thought making it play my favorite game would be cool :p
It'll really depend on what info you wanna pass through to the nn, but the difficult part of your plan is making a nn, not making it interface with balatro, so that's definitely a good sign!
Is there some method already set up for converting a card id (that you get from card:get_id) to a playing card prefix (like K_H)? i'm about to make my own utility function for it but it feels like there should be an array or an existing method for that.
or shouldn't i be using create_playing_card()?
...why the fuck is this not "number" đ
are you asking for solutions or criticizing code
im threatening myself
i will quite literally throw myself off a bridge rn :3
its been inside the function to inflict status effects on playing cards
for the past few weeks
đ
i just recently noticed it
you aint rizzing me up
i didnt want to do that
i have a girlfriend so
oh, good for you

omg hi
this led to uhhh debuffs being able to stack infinitely
:3
haii :3
OMG no way me tooooooo
Quite a nice informative guide, I'll be studying this alongside Lua so get a feel of the mod dev experience before I work on my first actual mod
:3 you can also check #1349064230825103441, i made sure to gather everything a beginner will need in there
card.lua in balatro source code
but thats a very vague question, there is also the one file with all the jokers' keys
spritesheet?
yeah
I've been checking out the code for NeatoJokers mod because its mostly a joker mod (with hatsune joku sounds), really like the organisation
I see
bruh
turns out the game already keeps track of specifically every single consumable use ever.
i was just able to do G.GAME.consumeable_usage['c_neptune'].count
useful info in case anyone else needs it
is there any documentation on how the game seeds work? like how do shops, card drawing, rerolls work etc
pseudorandom stuff
it works like math.random(), but remains the same if you replay the seed
the game just passes a seed to math.random basically
wait it's in the game code right
yeah look for pseudorandom in functions/misc_functions
what's a key, like for example key = "fours" in one of the example mods. Is it like something that you can use to reference?
it's basically the ID of the object that you're making
you have to use that id to reference it in other places
aight got it
Ankh
Probably with one of MathIsFunâs tools
@mellow sable also made the replay mod I think
đ
is this a bit too simple
wait so i can just set up a socket server in lua and make it listen for my python right
it's just normal lua?
I'm not sure I can help you with that, I've never had to make them interact, I just know it's not too difficult! I'm sorry!
npnpnp thanks
this joker turns 4s into an enhancement in my mod. currently it does nothing. is it context.before not being the right one or smth like that
wait i can copy midas mask
i may be stupid
you're iterating over G.play.cards with v as the variable but in the body you have context.other_card
a lesbian one :3
have you two done crime yet
instead of v:is_face what do i put
does config = { extra = { chips = -100 } } work? can the extra chip accept negative numbers? because it works with mult = -100
if v:get_id() == 4 then if you are to modify only 4s.
i dont know
you should remove that check
yeah i just did
Help: since im new to modding, i'm trying to make a joker that will act as a plasma deck when it triggers but the chips part is not working (or the whole thing is broken) đ
what a weird case
why would you not use full copy-paste
you're returning chip_mod and mult_mod, both of which are additive
Idk if thereâs a SMODS recommended way to do it, but you can check out the Joker Syzygy in my mod for how I did it
Old video
it will result into null reference if I full copy paste the code from the deck, because of args part
@vast fractal you can find the code in the GitHub linked here https://discord.com/channels/1116389027176787968/1343670935122870342
maybe I should add a balanced return value
i forgor threads exists đ
But when would it balanced
I mean
when whatver card returns it triggers?
just replace args with context
How do you get it in the game? Well first save it with a one px margin on the left and right side, and put that in \assets\1x. Then you load it in your mod by adding an Asset line like this
Wow, this python resize script is awesome. Somehow when I try to do it by hand in Paint Dot net the image looks terrible
I think Balance should always apply last
Wym terrible? do you forget to turn of smoothing or what?
True, but itâs easier to make it happen at calculation time than at the last possible second
Just create an event
And it works at the time the card triggers
No need to handle it automatically
But making it execute at the timing of Plasma Deck is harder
you just need to use the final_scoring_step context
being able to do return { balance = true } is much more beneficial to implement rather than locking it down
Woot, this is looking pretty nice!
it's a riskier glass, I am really happy with how the shader turned out too
Ah is that new?
Maybe I can update Syzygy then 
no
I meant new as in added by new calc
Because I had had to patch into Plasma Deckâs condition
For Syzygy
oh then probably yeah
So, I'm working on making new challenges. How can I make it so flushes don't score during my challenge?
i think 2 in 5 is better probably
maybe
Is there a way to change the weights of Jokers of different rarities in the shop?
Look at how debuffs work
omg it finally worked, thank you
no response from smods yet, so imma use this
just for ref, it is both suit and rank in this so youll just have to make it suit if you want only suit, this was to make it like the flush 5 in basegame
mhm
thanks for tellin
im also moving it to a poker hand part, so i can use it for six card flushes, and flush varients of all the other six card hands
message did not return in eval
am I wrong somewhere
sick, works out then
You could try using a card_eval func instead
hmmm id like to note for your sake that this isnt affected by four fingers
that could be intentional but personally i want fingers to also reduce six card flushes to only require five, so im modifying that on my end
Ah yea i hadn't yet looked at vanilla stuff interacting yet
That makes sense
oh and also thinking about it it would also get a little fucky with wild cards
if ya want ill send you the solution i come up with once im done
ah bummer
this is a deck effect, I couldn't pass in the deck itself for the first parameter
I actually haven't considered wild cards, I know the game still debuffs even wilds in specific blinds so I assume it still counts it as some form of a suit
unless I'm doing it wrong
But absolutely send once you've messed with it if you don't mind
Hihi. How do I go about organizing my jokers and other features into organized files?
like this?
Yeah
add these to your main.lua file
create a modules folder
and put the files you want in that folder
(and make sure to name the files correctly in both main.lua and the modules folder)
in any case do you think the effect is a bit busted
still doing localization stuff
how do you use the localize function again? there's only one example and it doesn't explain much đ
does this keep drawing until all of those cards are in your hand?
like if you had seven aces, does it draw all seven aces and then one other card (assuming a hand size of 8)
i think i got it to work, lemme test a little and then ill post it
erm
<@&1133519078540185692>
get this guy
no
thanks mods
me being like an artillary spotter for the mods
so how does it work
does it draw one card?
yep it works
func = function(hand)
if SMODS.find_card('j_four_fingers') and #hand < 5 and #hand < 6 then
return {}
end -- Ensure at least 6 cards are present
local suit1 = 0
local suit2 = 0
local suit3 = 0
local suit4 = 0
for i,v in ipairs(hand) do
if v:is_suit('Hearts') then suit1 = suit1+1 end
if v:is_suit('Spades') then suit2 = suit2+1 end
if v:is_suit('Clubs') then suit3 = suit3+1 end
if v:is_suit('Diamonds') then suit4 = suit4+1 end
end
local flood = {}
if SMODS.find_card('j_four_fingers') and suit1 >= 5 or suit1 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Hearts') and v
end
end
if SMODS.find_card('j_four_fingers') and suit2 >= 5 or suit2 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Spades') and v
end
end
if SMODS.find_card('j_four_fingers') and suit3 >= 5 or suit3 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Clubs') and v
end
end
if SMODS.find_card('j_four_fingers') and suit4 >= 5 or suit4 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Diamonds') and v
end
end
return flood
end
works with four fingers and wild cards just fine
how does that work? Im curious
(this is currently set up to be a pokerhandpart, but its a pretty easy change to make it work for a pokerhand)
Awesome, thanks
I'm on my way into the city but once I'm back I'll grab it
for that first if statement
do you really need #hand < 5 and #hand < 6, since anything less than 5 is less than 6 anyway?
I'm assuming that it's supposed to be #hand < 5 or #hand < 6 (for the lua ternary thing)
four fingers exists
though
ig i dont need that
can just check < 5
what I'm saying is that it should be if SMODS.find_card('j_four_fingers') and #hand < 5 or #hand < 6 then
Hi hi!!! Gonna work on my first lovely patch today to hopefully make custom modifiers work
that didnt work
i tried that first
oh wait
did you try if (SMODS.find_card('j_four_fingers') and #hand < 5) or #hand < 6 then
it does
Once I get that done, I'm gonna try and add an Area System to Balatro.
But once I get those two things done, the core features of my mod will be done and I can work on adding whatever fits my mind
now i need to figure out how to exclude specific suits from all decks
oh find_card returns a table
I'm pretty sure it's supposed to be next(SMODS.find_card('j_four_fingers'))
oh
like how find_mod works
I think this will be the hardest part of my mod, but I think it will be worth it
SMODS.PokerHandPart {
key = "flood",
func = function(hand)
if #hand < 5 then
return {}
end -- Ensure at least 5 (for four fingers) cards are present
local suit1 = 0
local suit2 = 0
local suit3 = 0
local suit4 = 0
for i,v in ipairs(hand) do
if v:is_suit('Hearts') then suit1 = suit1+1 end
if v:is_suit('Spades') then suit2 = suit2+1 end
if v:is_suit('Clubs') then suit3 = suit3+1 end
if v:is_suit('Diamonds') then suit4 = suit4+1 end
end
local flood = {}
if (next(SMODS.find_card('j_four_fingers')) and suit1 >= 5) or suit1 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Hearts') and v
end
end
if (next(SMODS.find_card('j_four_fingers')) and suit2 >= 5) or suit2 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Spades') and v
end
end
if (next(SMODS.find_card('j_four_fingers')) and suit3 >= 5) or suit3 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Clubs') and v
end
end
if (next(SMODS.find_card('j_four_fingers')) and suit4 >= 5) or suit4 >= 6 then
for i,v in ipairs(hand) do
flood[#flood+1] = v:is_suit('Diamonds') and v
end
end
return flood
end
}
SMODS.PokerHand
{
key = 'flood',
chips = 35,
mult = 5,
visible = false,
l_chips = 20,
l_mult = 2,
example =
{
{'S_2', true},
{'S_6', true},
{'S_9', true},
{'S_J', true},
{'S_K', true},
{'S_A', true},
},
evaluate = function(parts,hand)
return parts.sixf_flood
end
}
okay yeah that's what I was saying
so all of the cards you have of that type are drawn first
ok heres the fixed version
hello and goodbye
actually are there any mods that are completely able to be localized I can look at for reference?
the docs are lackin lmao
how do I see print logs in my mod?
am I even doing it correctly? i made a directory and moved it to Mods/ basically but I don't see any change unless I did a silly
that should be right
if you don't have DebugPlus installed, you should install it; it shows you the logs ingame
both my mods have localization files and one of them has translations if that helps
uh nothing shows up in game
other than that, I don't know if it's the same on mac, but you can look at the other window that spawns to see them
what a goat
oh yeah I forgot that my mod is jokerdisplay compatible
okay something's def wrong the "mods" menu doesn't show up
hmm
i'm running the love thing directly
is your smods folder nested
huh
interesting
I'm not too familiar with mac tbh, but I'm assuming you followed the instructions
it's probably better to ask someone else tbh
hi
hello
@fickle stag I'm sorry for going off topic but why are you in Thailand đ
internship :D
ah





