#💻・modding-dev
1 messages · Page 635 of 1
mm
Hey y'all, So theres this meme going around, the 1/10000 chance for foxy to jumpscare you. Its a mod thats been made for Terraria, Stardew Valley, Silksong and many others and I was wondering if it would be possible to make a mod like that for Balatro, Thanks!
I KNEW IT EXISTED
if context.destroy_card == destroyable and not context.blueprint then
if context.cardarea == G.play then
return {
message = localize ('k_traitordestroy'),
remove = true
}
end
end```
hmm ok, currently trying to set up a joker that destroys a random played card, except sometimes it doesn't trigger or triggers more than once? not entirely sure what i'm missing here
this selects a new random card to destroy any time calculate happens
since context.destroy_card is done individually per card to destroy its just a chance of a random card happening to be the currently checked card
ohh
hi everyone, im trying to make a balatro mod for the first time, i only did a bit of coding in high school but im getting the basics i think
im trying to make a mod but it's not loading in the game
idk if i did the right steps
what i do for this is set a flag on the card to destroy in context.before usually
what tutorial/whatever are you following for this?
Ok so I got vanilla remade as an example
and i used
"id": "",
"name": "",
"display_name": "",
"author": [""],
"description": "",
"prefix": "",
"main_file": "",
"priority": 0,
"badge_colour": "",
"badge_text_colour": "",
"version": "",
"dependencies": [],
}```
for the mod data at the top
plus a youtube tutorial
i'll send the link
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
-----------------------------------------------------...
so it's mixing the stuff from these
i can send the lua file if you want to look
it's not much
i've only added one joker to test
if the mod isnt loading at all, its likely invalid metadata causing it not to load
what are the actual contents of the metadata file?
ok im just gonna send the whole thing
"id": "first_mod",
"name": "First Mod",
"display_name": "FM",
"author": ["Zee"],
"description": "My first balatro mod",
"prefix": "first",
"main_file": "main.lua",
"priority": -0,
"badge_colour": "5BCEFA",
"badge_text_colour": "F5A9B8",
"version": "1.0.0",
"dependencies": [Steamodded (>=1.*)
Lovely (>=0.6)],
}
SMODS.Atlas{
key = "WonderWoman",
path = "WonderWoman_Joker.png",
px = 71,
py = 95
}
SMODS.Joker{
key = "WonderWoman",
loc_txt = {
name = "Wonder Woman",
text = {
"+6 Mult"
},
},
atlas = "WonderWoman"
pos = { x = 0, y = 0 },
rarity = 1,
blueprint_compat = true,
cost = 2,
config = { extra = { mult = 6 }, },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end}```
idk if this is what u want im so sorry😭
the bit at the top is from a seperate file, right?
^ the metadata needs to be in a separate json file, and the rest of the code needs to be in a lua file
file name can be whatever
steamodded will automatically look through any json files for metadata
no the atlas should stay in the lua
should be in quotes
ohhhh
also fyi all steamodded versions are betas as of now, so youll have to change the version in the dependency
so like put the exact version?
doesnt need to be an exact version, its just that the way it is now only allows stable 1.0+ versions which dont exist
it would be Steamodded (>=1.0.0~BETA-1221a) for latest version, though it can be made an earlier one if you arent using the features of newer versions
i tried and it crashed
and gave the grey-blue error screen you normally get when a mod doesnt work
you should probably actually show the full error
sure ok
one prob solved, one added lol
here it is :c
did you delete the json code from the lua file after moving it to a separate file?
i did yes
ok show the full contents of that main.lua file now
its not working SMODS src/utils.lua: 1032 Attempt to index field config (a nil value)
wait so do you just put code here or what
no one knows
but its generally considered a coding help slash sharing chat
tell us about your problems and we might solve them or we might make them worse
I've got this Boss Blind that's meant to be a junior Amber Acorn, but after it swaps the Jokers, they act like they were in their original positions, and I even patched it directly at the beginning of G.FUNCS.play_cards_from_highlighted in functions/state_events.lua. What do I do to ensure that the Joker order is changed?
G.FUNCS.play_cards_from_highlighted = function(e)
-- This is utilized by The Seed.
if (G.GAME.blind.config.blind.key == 'bl_lapsems_seed') and not G.GAME.blind.disabled then
local table_of_valid_joker_indices = {}
for i = 1, #G.jokers.cards do
if not G.jokers.cards[i].pinned then
table_of_valid_joker_indices[#table_of_valid_joker_indices + 1] = i
end
end
if #table_of_valid_joker_indices >= G.GAME.blind.config.blind.config.extra.jokers_to_shuffle then
table_of_valid_joker_indices = LAPSEMS.extract_randomized_elements_from_table(table_of_valid_joker_indices, G.GAME.blind.config.blind.config.extra.jokers_to_shuffle)
G.jokers.cards[table_of_valid_joker_indices[1]], G.jokers.cards[table_of_valid_joker_indices[2]] = G.jokers.cards[table_of_valid_joker_indices[2]], G.jokers.cards[table_of_valid_joker_indices[1]]
G.GAME.blind.triggered = true
G.GAME.blind:wiggle()
end
end
--[[
...
--]]
end
@frosty rampart
is it possible to get rid of info_queues? i wanna get rid of the negative and eternal info_queue here
still could use help with this
just use table.remove right?
run that one by me again, Lua?
Hello, anyone?
hi are you able to use a card variable for a juice_card_until function or do uhave to use a global
What do you mean by "dynamically"?
Well, you can probably stuff that in context.press_play.
? no like the card is already in the selected hand
i just want it to be put into the hand
after its rank was changed
Just what're you trying to accomplish here?
change all cards to the same rank and make them score
and also change the hand type played
You can probably patch it right into the beginning of G.FUNCS.play_cards_from_highlighted() to make sure that the card-changing happens before they're submitted to the play-area, but as for changing the type of played hand, I'm as stumped as you are.
shoot
ok gues what vanillaremade revealed another undocumented function :D
context.modify_scoring_hand
cant wait for the wiki to be updated lol
Found it on this page, but it doesn't say how to use it.
ok it adds the cards but it doesnt actually change the hand type
how do i make it recalculate the hand afterwards
ok i give up im just going to make it a standard "select cards and use the item"
i think its context.modify_hand
no matter what i try to clear the table nothing works
on an unrelated note, how would i update the text of the blind score requirement during blind select?
How can I add custom settings into my mod?
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
wont work in blind select
youd have to do a bunch of hacky ui stuff
i actually made an api mod that has this as one of its features: https://discord.com/channels/1116389027176787968/1338044836087070740
Is there a documentation I can read? I just want to add a text and a toggle.
how do i create contexts anyway
it's a bit complex
if you're willing to learn UI, here
ok so i finally figured it out
it should be like this
{
"descriptions": {
"Mod": {
"BossDecks": {
"name": "Boss Decks",
"text": [
"Turns every boss blind into a deck.",
"Each deck applies the boss's effect throughout the entirety of your run, alongside a positive effect that works around (or sometimes with) the boss's effect.",
"Upscaled blind symbols {C:blue}by AstraLuna{}"
]
}
}
}
}
instead of like this
{
"descriptions": {
"Mod": {
"BossDecks": [
"Turns every boss blind into a deck.",
"Each deck applies the boss's effect throughout the entirety of your run, alongside a positive effect that works around (or sometimes with) the boss's effect.",
"Upscaled blind symbols {C:blue}by AstraLuna{}"
]
}
}
}
start at jokers
Here's a proper resource thread to getcha started #1349064230825103441 message
Feel free to ask any dev questions in this channel
Does anyone know if there is cardarea type that allows cards to be highlightable but also doesn't have card count displayed?
I'm pretty sure newest smods has a config option for count display now
yeah no_card_count is what it's called
astra hi astra check it out :3 #1366274061025415249
im looking at balatro's source code and i don't know where the joker effects are
neato
card.lua
i was thinking of just adding more jokers
and within card.lua?
look for card:calculate_joker
Though I would also recommend using VanillaRemade as a reference for vanilla card functionality as opposed to vanilla source code
vanillaremade?
It's much closer in structure to what you will be doing
Genuinely invaluable resource
the wiki in that repo is fantastic too
glad to hear it
the joker im tryna make rn steals your money basically whenever it can and adds the number of money you lost to flat mult
like when blind is selected you get robbed, when round ends, when leaving shop, etc
so you're essentially eternally broke
Definitely doable
yea
Honestly a decent first joker to get a feel for the api too
that would be context.setting_blind
:3 thx
👌
and how do i like apply it? just with an if statement?
correct
in your joker's calculate function you check for if context.setting_blind then
if context.setting_blind then {
G.GAME.dollars == 0
}
?
Close, in Lua you do not need should not use brackets for conditionals. Also I would do ease_dollars(-G.GAME.dollars) instead of G.GAME.dollars == 0
lua statements are if CONDITION then ... end instead of if CONDITION then {...}
we need a better way of doing =money because it is not very easy to do =money without having it break at 2 or more of the same joker doing it
I'm pretty sure there is a dollar buffer lol
is there
Just nobody uses it 😭
mfw nobody told me this when i was trying to figure out the exact same problem for valk 4 months ago
Yeah I see it in Matador's code
but also a dollar buffer is slightly more complex than the idea of just better support for =money
which would be nice to have
probably
Yeah that will do
I will once again highly recommend using VanillaRemade as a reference. If there's a vanilla joker that has some sort of functionality you're after, be it partially or wholly, you should look at it in VR
im using vanillaremade
at least its joker blueprint or whatever
`local current_money = G.GAME.dollars
-- Joker
SMODS.Joker {
key = "Nicole",
pos = { x = 0, y = 0 },
rarity = 2,
blueprint_compat = false,
cost = 1,
discovered = true,
config = { extra = { mult = 0 }, },
loc_txt = {
name = "Nicole",
text = {
"{C:red,s:1.1}+#1#{} Mult, Whenever Blind is selected, all money is lost and added to Mult",
},
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
if context.setting_blind then
extra = extra + G.GAME.dollars
ease_dollars(-G.GAME.dollars)
end,
end,
calculate = function(self, card, context)
if context.joker_main then
return {
mult = card.ability.extra.mult
}
end
end
}`
here's the code idk what im doing
You honestly don't need to make a local var for money, you can use the G.GAME value
extra does not index your joker's mult value, replace it with card.ability.extra.mult as you did for the return
Your setting_blind block should be inside of your calculate function like you have for the joker_main block
thx
Any idea as to why the game won't show the shop UI again once you claim a joker from the booster pack? Not a dev, just messing with a mod for compat reasons
Tarot, planet, and spectral are working fine
It returns to the shop but the UI is just... Not there
Quitting and loading fixes it
messing with a mod as in, your own mod? or some other mod you downloaded?
Other mod! I just noticed an odd bug from the Wallet mod and I kinda want to fix it on my end
are you messing with the other mod files directly or with patches?
FUCK YOU MEAN TABLE?!
LIKE WHAT HOW IS A SINGLE NUMBER A TABLE?!
Also that print funciton was to check if the local variable was a table, it was a number.
anyone know how to work around this?
i cant get my mod to appear as a mod option
how to fix
?
i have a json file and a lua
Which line is line 690?
Patches, it's definitely unrelated though (since it's mostly input related)
if to_big(hands_gained) > to_big(0)
thx
even tho i followed the vanillaremade wiki to my best ability
why in gods name is the xmult not triggering
Anyone know how to make a joker trigger on buying a consumable from shop specifically?
And not from any other means like tags?
if context.buying_card and context.card.ability.consumeable
context.buying_card doesn't even trigger when buying consumables
how to make a deck only spawn specific blinds
if i were to implement new music to the game that's made in 105 bpm do i have to speed it up to 150 in the files
No, you could do pitch = 1 in the SMODS.Sound
thank god 🙏
You're just unlucky
that is definetly not it 💔
Make it guaranteed then
i know when the xmult is chosen but its not proccing the xmult
since when a card is inert (gave nothing) thats when the xmult was supposed to trigger
i just became lazy and removed the xmult for it
How much is nxmult
1.25x but it dynamically changes
i cant expand further info on "dynamically changes"
How does it change
just know its still an integer that isnt less than 0
i cant expand further info on "dynamically changes"
Cause I'd guess that it lands on 1 which iirc does not show the animation as A*1 = A so why would it
so uh my jokers worked but when i hover on them, the game crashed without a crash message
like it closed on its own
trying to make it go through left to right at end of round and give the face cards their seals, sort of like how gold cards collect from left to right, etc. unfortunately, they all gain their seals at the exact same time and it leads to weird player feedback. is there a simple way to change this code to fix that?
do you guys like my art
Try changing delay for each of them
there is a delay there
is there a resource i can be pointed to, to learn how to make a custom joker rarity? i don't wan't jokers with the rarity appearing in the shop and that's it.
Everything in the event needs to be in a func
https://github.com/Steamodded/smods/wiki/SMODS.Rarity#api-documentation-smodsrarity
This but you give it a weight of 0
I can't use planet cards on this edition of SMODS apparently
OR is there a mod that's doing something it shouldn't be?
YES, thank you!
i have another question, how would i then apply my new rarity to a joker? i'm not sure how to identify it when picking a rarity.
rarity = "modprefix_raritykey"
i've been beat 😔
its ok i
(ty lily)
have no consolation for you
everyone is so nice though 🥹
also, picked the perfect color for the error to look scary lol
(error not intentional
)
orange slop
though i do need help again lol
This might be a smods bug, I’ll investigate today
Ignore that, I found the faulty mod.
Yeah, it’s specifically a mod causing this but I think the root of the crash might be my fault
k_modprefix_key = 'Rarity' in Localization > misc > labels and Localization > misc > dictionary
like this?
No, it would be k_cr_blind
YAY! thank you lots! i have something really cool cooking up :>
are there any ui makers in chat how many people have experienced pain
the config to my rebalance mod took me 4 hours (even though it was simple
), and i can confidently say documentation will be your best friend, though i don't remember where i found it.

found it :D
mhm ive seen that
stared at it for like 2 hours before i got to the problem of how i insert the ui
i see
What are you trying to do?
a new card area was simple but now i have the task of a whole menu like run info
I dont understand lovely, I know its importance, but Its just shat itself
Oh wait
no
I cant use my own mod
wtf do I do
error of pain and dispair ive had to deal with for 3 days straight
yes i know
i dont wanna look stupider so give me like 3 more days to figure this out 
teaser
i always thought the idea of jokerifying blinds was fun, but doing the opposite of a downside just replicated other existing jokers
Do you have a link to the mod that was crashing then I can test some fixes?
nvm, found it and fixed the root problem 👍
ok i give up pleaasseeee what went wrong here
Looks like something you clicked on doesn’t work
yep!
So show the code for whatever you clicked on
self embarassment go!
do you have a G.FUNCS.market?
huh
best guess is either the two strange dots or the use of self.
applied_stakes = { "stake_gold" },
above_stake = "stake_gold",
prefix_config = {
applied_stakes = { mod = false },
above_stake = { mod = false }
},
What's this?
upcoming ui
What's wrong with this?
so #awesome
it should be here instead (in your localization file)
misc = {
labels = {
deg_locked = "Locked"
},
}
thanks
😄
the serpent only exists under bline:disable in blind.lua
where is the game getting the blind ability from??? 😂
oh thank you! can you call it cloudzXIII if you don't mind?
yup
functions/state_events.lua
im in the hellish depths of ui code
I'm living in it
css 0.5 is really not helping me at all here
it's hell on earth
PLEAASE GO UNDER EACHOTEHR DUMB FUCKS PLEASE
ahahahaha
i did a thing where i added a third scoring box in the calculation and the fire now only goes on top of chips
yayyyy
at least it matematically works
😭
yippii
- hasnt even coded in the funcitonality yet
reasons
oh
how to make a joker disable the effects of another joker
take a look through bunco's jokers if you're looking for a joker applying disable to another joker
time to get bunco ig
does anyone know how to make the caino thing where it gives you an effect after you destroy a card

thanks!
np
Happens
literally me
do you know how to fix
Nah
where is this from btw
SMODS documentation
ohhh
yo chat can i get some ui-ers to answer this
how tf do i change the text of a text node with code 🥺
neato
dyna text
actually, hold on for a sec
🥹
{n = G.UIT.T, config = {ref_table = G.hand.config, ref_value = "cards", scale = 0.3, colour = G.C.WHITE}},
wow
well i guess i should be more specific
how do i get the name of a highlighted card and edit the text with THAT
That's a tad bit more complicated.
id figure as much
I do not know if that data is stored per card or in the center.
I have a challenge idea
but for it to work I need all the cards to have a sticker
how do I give cards in a challenge deck a sticker?
challenges have an apply function so you could loop through the cards in the deck there and give each one the sticker
how can I do that?
apply the sticker or loop through the deck
that doesnt change how stickers get applied
oh why are you doing that
if i remember correctly its SMODS.Stickers[your sticker key]:apply(the card, true)
for _,v in G.playing_cards do
SMODS.Stickers[sticker]:apply(v,true)
end
or something like that idk
oh and also how to get any of a joker's values from the fact that its highlighted
do v:add_sticker('key', true)
pleaseee joglaa i need thisss 
where would I do that?
You want to pull a card's name?
when you loop over the cards
v being a Card
like jogla said
yes, and also the description and sell price (and by extension any inof of the card) if thats possible
for _,v in ipairs(G.playing_cards) do
v:add_sticker('prefix_key',true)
end
I do not know from where to pull a card's name and description.
Price you can check one of FG's aux functions.
kk vv is brilliant naming scheme
Literally what I use.
why not just k2 v2 lol
k2 and v2 are as long as kk and vv
HOLAA
I have never been in the need of going more than 2 loops inwards, but idk
Hola.
idk what im doin
i found the juckport 1 trillion$
what's the context for when a joker is triggered?
or is there not one
thank you
nice
ty
Anyone here good at pixel art? I am not lol. I am trying to make an UNO reverse card, and was wondering if anyone could help me out?
ah. I see
fish..?
yes
is that fucking greed from blobtakes?
yes
Anyone good at sprite drawing btw?
how good is good....
It depends, usable and looks okay is what I want
why is that comic sans
why not
It's not even a monospace font.
it's really up to personal preference (or in this case, shits and giggles)
You have a terrible, terrible sense of humor, or you are a masochist.
i wouldve made it balatro font but idk if np++ supports custom fonts
In what situation would it be better to have a non-monospace font?
in really none
Then there is your answer.
Use a monospace font and learn how to indent your code.
i can read it so i can write it
optimal coding font
YESSSS
I have -3 spriting experience, sorry.
who up writing their code in same_mistake
okay, I can forgive comic sans, but this is a sin
rate the np++
Just use sendien.ttf at this point.
i coded some roblox code in that font its really funny
Notepad++ 1 sin
Comic Sans 50 sins
Cause I want to: 50 sins
Total Programmer sins: 101
just me?
i just use vscode idk if u can change the font ;-;
Yes, you can
VSCode is very customizable, so yees
oh
-# fuck i lost sendien.ttf
i should learn wingdings for this 🔥
guess what im doing now


getting this error after losing a run (after I had already won) with archipelago installed, i did change the scoring limit setting from vanilla after it crashed the first time to see if that would fix it and it still crashed.
is it hypothetically possible to use patches.module to load an object type?
how do i access an objectType like if i want to delete cards? the wiki just says ObjectType.delete_card but what am i supposed to replace ObjectType with?
its kinda confusing for me can anyone help
Anyone interested in helping my with my sprites?
how do i make a joker retrigger itself multiple times?
mod idea: yknow two pair? what about two 3ok for an overselect mod
fuller house
+3 card selection 😋 (i can add this)
🎉
yay
have it be called "Three Twice" or "Two Three" or something
Three Pa- oh wait
Double Triple?
Triple Trouble
I played a pi of clubs
Its a crash for my new ranks I added
being the 0.5, pi and 21
not that... this is utils.lua
i think something happened here
true
hmmm
Its fine for all my other ranks which is what confused me
0.5, 21 and pi give the crash
maybe it is to do with the way cards_played is initialized?
the only thing I think that is similar between them is that the shorthand is more than one digit
i'm trying to make a joker that get's a +10 multiplier every time you buy a voucher. I'm having an issue where it works with any card you buy instead of only being vouchers. I assume it's an issue with the context but i have no clue which one i should use instead
yeah the context is buying_card
if context.buying_card and context.card.ability.set == 'Voucher'
that worked ty!
for some odd reason this doesn't ever upgrade
if context.before and context.individual and context.cardarea == G.hand and (context.other_card:is_suit("Hearts") or context.other_card:is_suit("Diamonds")) then
card.ability.extra.mult = math.max(0, card.ability.extra.mult + card.ability.extra.mult_mod1)
return {
message = "Upgrade!",
colour = G.C.MULT,
card = context.other_card
}
end
Remove context.before
is there any way to get it to trigger on context.before? i want it so that the upgrade happens before the joker triggers
actually wait joker_main is after individual
Yes, you would iterate over G.hand.cards
i see i see
now, do you know how to fix my problem?
this
What happens when you print G.GAME.cards_played?
Hmm?
eval G.GAME.cards_played in the DebugPlus console.
K
How may I call Joker calculation a second time? I have this Boss Blind that swaps two Jokers but the Jokers still act like they were in their original spots.
look through the crash message to try to find any more specific errors
the error is already there though
attempt to call global 'lobc_deep_copy' a nil value
but...but my mod🥺
im not a dev nor do i make mods alot but you should probably look around the parts of the code where you use "lobc_deep_copy"
dont take my advice with confidence though i dont know alot about balatro modding
THE MOST MODDING KNOWLEDGE I HAVE IS UNZIPPING FILES BRO I DUNNO WHAT SPECIFIC PART OF THE CODE THAT IS 😭
are you using joker forge
nope
what the hell are you trying to make then
i dont think you get what im trying to do here
i installed a mod and it wont work 😭 some guy told me to ask here about the crash message
modding*
im not MAKING anything
this is the dev channel
it would be better to go to modding chat to ask about it
and its likely an error with the mod you installed then
god damn it
i legit thought u were making a fkin mod lol
Do u have any other mods installed
They could be conflicting with eachother
my bad dawg
cryptid and yahimod which are disabled
handy
Then shrug
This is the ranks.lua in case there is smth wrong with it I guess
well, they arent face cards
what would I make it be if it isnt a face card?
0?
nah
it dont work
ok, 21 dosent crash
why
wha
The crash is gone?
what did I do?
the crash is gone
completely
ive been trying to make a joker play audio on joker trigger for maybe the past hour and im not sure what im doing wrong, ive got it to play instantly but not on joker trigger, new to the modding thing so maybe it seems like an obvious thing that im not getting, this is the code for which doesnt play the sound on joker trigger (even though it should)
key = "ohnejimbo",
pos = { x = 0, y = 0 },
rarity = 3,
blueprint_compat = true,
cost = 8,
discovered = true,
atlas = "ohnejimbo",
config = { extra = { mult = 385 }, },
loc_txt = {
name = "ohnePixel",
text = {
"{C:red,s:1.1}+#1#{} Mult",
},
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
mult = card.ability.extra.mult,
sound = 'sj_ohnejimboscore'
}
end
end
}```
func = function()
G.E_MANAGER:add_event(Event({
func = function()
play_sound('sj_ohnejimboscore')
return true
end
}))
end
thank you! it works
you don't have the prefix_config "applied_stakes" set to false
oh
that could be the issue
if it isn't it was still going to be a problem lmao
also why is "above_stake" a table in the prefix config
I copied off of ortalab
well if it works lmao
god okay
T-T
cryptid does this: applied_stakes = { mod = false }
for the applied stakes
try that
okay
if i wanted to make a sticker that goes on consumables, can i just do sets = { Consumeables = true } or do i need to put in every single consumable set
actually, does stickers in a challenge even check sticker compat
Yes, you need to put every consumable set.
Did anyone else experience performance dips since the last SMODS release? Mainly when jokers generate in the shop
anyone know why these variable colours wouldn't be working? each of their entries just appear in the default black no matter what
it is V:1, V:2 etc to grab the colours isn't it
i haven't really used variable colours in ages
It's G.C.FILTER
what
i have never heard of this in my life
i want them to be attention colour if the stage threshold is reached
but inactive if it hasn't been reached
is it just that attention doesn't work in the
i guess
oh yeah that is it
so what's inactive then
G.C.UI.TEXT_INACTIVE
gotcha
you could use G.ARGS.LOC_COLOUR.inactive too
i see
Anyone know how to make a Joker that adds a random card from a consumable booster pack to your possession?
Like when you open a booster pack, the Joker should be able to take one of the consumables and add it to your collection if you have the room.
if context.open_booster then
G.E_MANAGER:add_event(Event({
func = function()
if G.pack_cards and G.pack_cards.cards[1] then
local consumeables = {}
for k, v in pairs(G.pack_cards.cards) do
if v.ability.consumeable then table.insert(consumeables, v) end
end
if next(consumeables) then
local consumeable = pseudorandom_element(consumeables, 'seed')
SMODS.add_card({key = consumeable.config.center.key})
end
end
return true
end
}))
end
Oh thx
how do i flip cards as apart of a joker? i want to flip the first hand drawn.
WHAT, THIS IS EXACTLY WHAT I'VE NEEDED, I CAN'T BELIEVE THIS IS REAL.
why is my joker not activating when i play a card played previously this ante
SMODS.Joker {
key = "samekh",
blueprint_compat = true,
rarity = 2,
cost = 6,
pos = { x = 3, y = 1 },
config = { extra = { mult = 1 } },
atlas = 'samekh',
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult } }
end,
calculate = function(self, card, context)
if context.individual
and context.main_eval
and context.cardarea == G.play
and context.other_card.played_this_ante == true then
context.other_card.ability.perma_bonus = (context.other_card.ability.perma_bonus or 0) + card.ability.extra.mult
return {
message = localize('k_upgrade_ex'),
message_card = context.other_card,
colour = HEX("7e6752")
}
end
end
}
Remove context.main_eval
how do i have info_queue exclusive text?
ah
It did specifically add a context for this but I don't know why it would cause a major perf drop
still doesnt work 💀
How do you retrigger consumables such as Planet cards?
Hook Card:use_consumeable and run the old function twice.
is there a way to check if all jokers are already flipped?
local passed = true
for k, v in pairs(G.jokers.cards) do
if v.facing ~= 'back' then passed = false end
end
if passed then
end
Nope, didn't work
Code?
calculate = function(self,card,context)
if context.using_consumeable then
if context.consumeable.set == 'Planet' then
return {
repetitions = 1
}
--context.consumeable:use_consumeable()
end
end
end,
There were two solutions i tried
how do icheck what deck is being played
You need to hook Card:use_consumeable
^
local use_consumeable_ref = Card.use_consumeable
function Card:use_consumeable(area, copier)
local effects = {use_consumeable_ref(area, copier)}
if copier.set == 'Planet' then
local rodgerlings = SMODS.find_card('j_dandy_rodger')
for _,v in pairs(rodgerlings) do
effects[#effects + 1] = {
message_card = v,
colour = G.C.FILTER,
message = localize('k_again_ex')
}
effects[#effects + 1] = use_consumeable_ref(area, copier)
end
end
local ref = SMODS.merge_effects(effects)
return ref
end```
Ok so I did the hook, but now the game crashes when I use a consumeable. Any way this could be fixed?
local olduseconsume = Card.use_consumeable
function Card:use_consumeable(area, copier)
local g = olduseconsume(self, area, copier)
if next(SMODS.find_card('j_dandy_rodger')) then
for k, v in pairs(SMODS.find_card('j_dandy_rodger')) do
SMODS.calculate_effect({message = localize('k_again_ex')}, self)
olduseconsume(self, area, copier)
end
end
return g
end
It works! Thx
Oh sorry, I wanted the joker to pull one of the cards from consumables to your area
As in you move him
I'll see what I can do actually
Anyone know how to move a card from one card area to another?
Like move smth from the Booster Pack area to your consumable Area?
I dont understand what is wrong
thanks srry late reply
line 28 you have a nil value
if you can, show line 28 and the surrounding context
your hand types are defaulting to something that isn't actually a hand, so upon initialization it tries to access the level of a hand that doesn't exist
this is why stuff in vanilla like to-do list still default to some value like high card, not an extra empty value
ooooooh
also, unrelated to the crash, but your add to deck function edits card.ability.hand_typeX and not card.ability.extra.hand_typeX
honnestly I am trying to create a planet that select to random planet and show them when the planet is created
just replace all instances of "giga_no_hand_select" with "High Card"
(and also fix the add to deck thing i mentioned)
yea that's fine
todo list i think just shows a random hand in the collection anyway
as long as the rest of the description makes it clear that it picks a random hand
does partner and finity use the same keys for win/lose quotes
if not how exactly are you supposed to specify partner quotes
is it possible to check if you have a specific achievement
you need a can_use function
yea but I wasnt using one before and it was working but now no
cause can_use is true by default
i don't actually think theres a default for that
but idk lmao
like can_use is not defined on the base SMODS.Consumable object
and theres an explicit check checking to see if a consumable has the can_use function at all
but why I was able to use it before
theres still code that runs after
if there isn't a can use function
normally it doesn't actually do anything
since its for the vanilla tarots
but mayhaps the stars aligned
yeah i dont really know why its kinda weird
You were right but yeah Im gonna investigate why it was working before
how do I make that it only select unlocked hand
local names = {}
for k, v in ipairs(G.handlist) do
if G.GAME.hands[v] and G.GAME.hands[v].visible then names[#names+1] = v end
end
local hand = pseudorandom_element(names, pseudoseed('thehistoryoftheentireworldiguess'))
thx
why doesn't this destroy itself
if context.skip_blind then
for i = 1, card.ability.extra.create do
add_tag(Tag("tag_juggle"))
card:juice_up(0.4, 0.4)
play_sound("tarot1")
return nil, true
end
G.E_MANAGER:add_event(Event({
func = function()
play_sound("tarot1")
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.3,
blockable = false,
func = function()
G.jokers:remove_card(card)
card:remove()
card = nil
return true
end
}))
return true
end
}))
return {
message = localize("k_eaten")
}
end
'cause of the return nil, true.
...also, just do SMODS.destroy_cards(card) in the event-
wait in one part
this is historically what i've used to destroy food jokers
okay also for some reason this is displaying ERROR instead of what i'd like it to
k_eaten_ex
As for the Food Joker destruction, SMODS.destroy_cards(card, nil, nil, true).
where exactly?
just replacing
G.jokers:remove_card(card)
card:remove()
card = nil
?
That's the inside event.
yes? so i assume that's it
Remove the inside event and have the remaining event just be SMODS.destroy_cards(card, nil, nil, true).
yeah so just
G.E_MANAGER:add_event(Event({
func = function()
play_sound("tarot1")
card.T.r = -0.2
card:juice_up(0.3, 0.4)
card.states.drag.is = true
card.children.center.pinch.x = true
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.3,
blockable = false,
func = function()
SMODS.destroy_cards(card, nil, nil, true)
return true
end
}))
return true
end
}))
G.E_MANAGER:add_event(Event({
func = function()
SMODS.destroy_cards(card, nil, nil, true)
return true
end
}))
even.
oh boy 😭
You know what that means
:grodetrue:
bump
turns out its a little harder than i thought
how do you get the base chips of a played pokerhand
G.GAME.hands[context.scoring_name].chips
im putting so much G slop in my mod
dang
i need to make this text automatically reload when selected fish is changed
tiem to learn dynatext!
why tf is it comic sans
because i like it
i'm trying to replicate The Club blind as a joker, why is the context.other_card not valid?
context.debuff_card is the card
that doesn't need to be in a patch
why're you creating a button callback inside a patch
still the same problem (the green text only updates when i leave and reopen this menu after clicking the buttons)
i wonder
is it something to do with the fact that its all in a create uibox function
thatd probably make sense
It shouldn't be, though.
these leads to that (which i now put in a regular lua file instead of a patch)
BALATRO FISHING?
maybe
ok there were like 3 different update functions and i finally found the one for dynatext
now
i need to find a conditional to add so the game doesnt shit itself
more G slop yay!!
ok it just doesnt wanna work
so fun
what if a try with regular text
highkey may have forgetting this was a dyna text thing
WAA
Is there some kind of convinient context that triggers with the joker being hovered over (just like when the joker description appears)?
So there's second fishing mod
First one was made by so talented guy, I missing him (
what happened?
No, just put it in loc_vars
it doesn't really work, I wanna do something of the sort card.children.center:set_sprite_pos({x = 1, y = 0})
That should work fine
it tells me field 'children' is a nil value
check for card.children first then
my code
how the fuck do i make the dynatext update in real time instead of only updating on closing and reopening the menu
ive tried alot of things and im probably stupid but holy shit
question: how do i make an sealed card be always drawn face down
you could do something like
if card.facing == 'front' then card:flip() end
ah
thanks
👍
Lonballo, got it.
this game is taunting me
you need to use ref_table and ref_value for your text instead of text
ok now i want it to flip back when scored and then flipped again when drawn again
how would i do that
With context checks.
ah right
i totally havent been told to do that atleast 10 times
trying to create photograph and chad on joker sell, not sure where ive gone wrong, game also crashes with "jokers/jokers.lua"]:459: attempt to call method 'give_joker' (a nil value)
key = "roffle",
pos = { x = 0, y = 0 },
rarity = 2,
blueprint_compat = false,
cost = 8,
discovered = true,
atlas = "roffle",
loc_txt = {
name = "Roffle",
text = {
"{C:dark_edition}Looks Inside{}",
}
},
calculate = function(self, card, context)
if context.selling_self then
context.cardarea = G.jokers
context.elling_card = true
card = card
return {
func = function()
G.E_MANAGER:add_event(Event({
func = function()
local keys = {'j_photograph', 'j_hanging_chad'}
G.GAME:give_joker('j_photograph', G.jokers)
G.GAME:give_joker('j_hanging_chad', G.jokers)
return true
end
}))
end
}
end
end
}```
it works now oh my fucking god
this should be selling in the first image
in the second image use create_card to make the card instead of give_joker whatever
ugh how do i make text a custom colour
like {C:something}
i cant find the documentation in the wiki but theres this awesome https://github.com/nh6574/VanillaRemade that remakes most the game with smods so you can have a look through there
{C:red} text {}
no but like any colour
not just red,mult,blue,chips,green,money,gold,attention,purple,white,inactive,spades,hearts,clubs,diamonds,tarot,planet,spectral,edition,dark_edition,legendary,enhanced
can i like make more of these
i believe you declare in globals?
if you want hex
not sure
no i mean i know those
but like text stuffs
imma try G.ARGS.LOC_COLOURS["colour"] = G.C.modprefix.colour
nvm im stupid asf and didn't see
what was right underneath
didn't realize this was here lol
got it to work, used these in accordance to the guide you sent
SMODS.add_card{ key = "j_photograph", edition = { negative = true } }```
negative was intentional
well i sure didn't think it was accidental
hello there, i was just looking at the contents of the balatro+ app on macOS and found the terminal which runs the game, can anyone tell me what it can be used to do or if its just something the software does. Like can it be used to edit the save file and stuff?
how do i use ref table on loc_txt.text please chattt i needdd thisss
i got it to work
no shit!
why does setting min and max h to the same value work BETTER THAN THE REGULAR H
I do not know.
But I urge you to use those instead of normal w and h.
on every UI element you have made, probably
I think it’s because they are dynamically sized containers so they don’t have a w and h property or something
I think UI definitions and actual UI objects work differenctly.
They don't have such a thing as 'nodes' inside them.
There is a function to find nodes by their id, though.
(provided you give them one)
here
You can plug that in to get a certain node, I think.
Worst case scenario you use e.children[n]...
Not certain if it works, but I have seen some commented code from local that does that.
it works 🥹
How does localization work? I've read the docs, and I thought what I was doing would work but I guess I was wrong?
Code?
give me uno moment
SMODS.Joker {
key = "j_no_u",
--[[ other irrelevant info here ]]
}
-- en-us.lua
return {
descriptions = {
Joker = {
j_no_u = {
name = "No U",
text = {
"Swaps Mult with Chips."
}
},
}
}
}```
mod prefix?
The key would be j_modprefix_j_no_u
your key shouldnt be like that
in the SMODS.Joker just put no_u
I see.
and then your key should be j_modprefix_no_u
okay, thanks
You mean you want a card to take up a fraction of a slot?
yuh
card.ability.extra_slots_used = 1-fraction
awesome!
oh neat
i could use that maybe
can't use my laptop until boxing day tho 
😔
btw if you're handling cards from in a ui popup menu, you may have to worry about used_jokers updating
i've had quite a bit of trouble with it in the past and it still has bugs sometimes
-# am hoping the id thing will help me fix it for real this time
I thought check you added do the trick
i thought so too
but there's still the occasional desync between cards and the table
encountered it in a run last night
?
look in top-right here
SMODS.find_card executes SMODS.get_card_areas, which depends on parametr selects card areas to check for existing a jonkler
ah
And by default it only checks G.jokers, G.consumeables, G.vouchers
Fortunately for you easy patch can be done
what about the shop cardareas?
Hey chat, question: what the fuck do these tables have inside them?
scoring_hand = table of scoring cards
scoring_name = hand name/key
poker_hands = table of hands contained in hand
No, poker_hands is a table of tables of hands contained in the hand.
uh...
Is there somewhere where I can look at how the table would look, or something?
why?
Game calculates all poker hands you hand contains and includes cards in this poker hands
Because I need that data.
current played poker hand is scoring_name
oko
and you can find the times a hand has been played in G.GAME somewhere i think
Just check obelisk idk
local chips = 0
for k, v in pairs(G.GAME.hands) do
if v.played == G.GAME.hands[context.scoring_name].played and v ~= G.GAME.hands[context.scoring_name] then chips = chips + 50 end
end
if chips > 0 then return {chips = chips} end
oh well
Thanks for the code.
Mind if I uh... yoink it?
<thanks for inspiration gif>
bump
hm..
since this is for a custom shop
and SMODS.find_card is for checking when a card is held
supernova
how you create card for shop?
out for xmas so gimme a sec to grab a repo link
hey y'all, where in the source code is the main scoring loop located?
functions/state_events.lua in G.FUNCS.evaluate_play iirc
thanks!
checked repo and SMODS.create_card followed by create_shop_card_ui
I do believe issue in loading
Because when card is loaded, it does not update used_jokers
Because it, well, loads
even with the hooks?
When card is loaded, it sets ability to nothing first, and then just set new values it needs without calling set_ability
And I see you using loading in your shop
i see
I'm not sure 100% but in theory issue somewhere here
i wanna try and write down everything abt thisso i can fix this on boxing day
Also possible that you opened a shop, it saves, you bought joker in normal shop, and your shop loaded with this one so you get duplicate
Depends on when loading is is happening
no i bought the card earlier from the custom shop and it appeared in the custom shop later in the run
i've been playing a lot of my challenge where i only have the custom shop
so it skips the vanilla shop
ty
i'd do it rn but family doesn't want me on my laptop bc they're old and just see it as anti-social


oki
im john fish market
I do believe Qualatro shouldnt be lovely mod, proably installed incorrectly
Also a bunch random mods in here
qualatro is installed like any other mod
is it lovely mod
in most cases if content mod listed like this something definitely wrong
No it isnt, so
find Qualatro in mods folder and show what it contains
ah i haven't seen the log since i'm on mobile
Qualatro doesnt work on latest steamodded iirc
commits says it should
worth trying tho
since newest steamodded was only a few days ago
oh latest qualatro release was 2 days ago
same log
did you check the clipboard
I mean the're not 100% same, but issue is same
