#💻・modding-dev
1 messages · Page 299 of 1
incredible lol
it was added awhile ago
I'm attempting to make a voucher that bumps up the "X selected cards" number on applicable tarots and spectrals by 1, but I have no clue how to write a concise description for that mechanic, any ideas?
it's really simple but there's no existing terminology around that so I'm a little stuck on it
increments is just another word for increasing
i mean you just may as well use words that exist in the english language
I was planning on that, yeah
Where is the code for it injected? I'm not seeing it in blind.lua
does anybody know how to change the title screen ace suit im desperate over here loll
update for when you'll be back (if you're interested ofc, you dont /have/ to do this), the increment works just well, the only thing that doesn't work is the reset of the mult if the condition isn't met, but at least it doesn't crash anymore!!!
how can you declare a global variable as 0 (or any integer value) without setting it in a config and resetting the variable everytime you get the joker?
https://github.com/Steamodded/smods/pull/548
heres the commit
that works, thank ya
there should be more added after as well
how could i manipulate the blinds that show up on a deck? i'd like to make one where every boss blind is a finisher (don't ask lol)
current code?
calculate = function(self, card, context)
if context.joker_main then
return {
xmult = card.ability.extra.Xmult
}
end
if context.end_of_round and context.main_eval and not context.blueprint then
if G.GAME.current_round.hands_played == 1 then
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.increase
return{
message = localize('k_upgrade_ex'),
colour = G.C.RED
}
elseif G.GAME.current_round.hands_played > 1 then
card.ability.extra.Xmult = 1
return{
message = localize('k_reset'),
colour = G.C.RED
}
end
end
end
this should fix the reset issue
i changed what you were checking in your else if
Just a LITTLE buggy
you want to look at the Castle example mod joker
oh ty but no worries i got it working!
bump
i just set the variable to 0 if its nil
guys please how do i make the title card an ace of hearts
me when I accidentally play the king of poverty
idk
your welcome
(i will research when I get home)
doesn't reset still
😭
check multi-player mods code tho it should have smth like that
the irs when you dont pay your taxes
i had tried replacing the elseif by just an else but didnt changed much
the irs when you do pay your taxes:
idk what to do then
it's fine, i'll figure it out later, now i'll sleep x)
thank you a lot for all your help !!
Could probably do a Lovely patch? (based on Talisman's .toml)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = false"
position = "before"
payload = "SMODS.change_base(replace_card, 'Hearts')"
match_indent = true
overwrite = false
how could i make every single boss blind be a finisher regardless of ante?
for a deck, i should clarify
whats the variable to check for joker free spaces
There we go!
that's a fucked up boss blind man
balatro microtransactions are real
this is truly late stage capitalism
LMAO
We have micro, now where macro
???????????why?????
which lua extension do yall use for vscode
Official one?
which one is that 😭
Hey I am new to coding, how would I go about making a joker similar to riff-raff?
thx
look at the riff raff code

you might need to redo the loc vars
the loc vars?? why the loc vars
shit i meant config
ohh
lua language server
yeah that makes more sense
that did not seem to fix the issue
ok it . only seems to happen when i have my custom joker
thats really weird
how can i check if the player has a certain number of one joker (e.g. check for exactly 5 holograms)
whats the atlas key for mod icons i forgot
loop through G.jokers.cards and check if the ability.name is the name of the card you want, and increment a count
thanks
"modicon"
how do you constantly update a cards mult based on other actions? for example i have a joker that scales Xmult based on how many jimbo jokers have been sold during the run if that makes sense
I would take a look at how Fortune Teller works
The values in my Joker's desc say nil (xnil, +nil, etc), and idk why.
not working for some reason
did you define loc_vars and use #varnum# in your localization files?
whats #varnum#?
text = {
"#2#"
}
would display the second returned variable in loc_vars for example
j_modprefix_mugiwara
sorry if i'm misunderstanding something, i'm new to modding, but there's functions for exponential, tetrational, and pentational mult (Emult_mod, EEmult_mod, EEEmult_mod), what do you do if you want to go past pentation?
ah
assuming the joker's key is mugiwara
it is
text = {
'Gives one of four effects',
'when each hand is played:',
'{C:chips}+#1#{} Chips',
'{C:mult}+#1#{} Mult',
'{X:mult,C:white}X#1#{} Mult',
'{C:money}+$#1#{}'
}
...
loc_vars = function(self,info_queue,center)
return { --#1# is replaced with card.ability.extra.Xmult
center.ability.extra.chips,
center.ability.extra.mult,
center.ability.extra.Xmult,
center.ability.extra.money,
center.ability.extra.odds1,
center.ability.extra.odds2,
center.ability.extra.odds3,
center.ability.extra.odds4,
G.GAME and G.GAME.probabilities.normal or 1
}
end,
make a pr to talisman ig
that's correct yes
but you need to put the returned vars into another vars = {} table
so there's no way to use any arbitrary operator?
What happens if a card is debuffed after first scoring, but before retriggers?
i don't think so
like this
You mean something like
loc_vars = function(self,info_queue,center)
return { vars = { --#1# is replaced with card.ability.extra.Xmult
center.ability.extra.chips,
center.ability.extra.mult,
center.ability.extra.Xmult,
center.ability.extra.money,
center.ability.extra.odds1,
center.ability.extra.odds2,
center.ability.extra.odds3,
center.ability.extra.odds4,
G.GAME and G.GAME.probabilities.normal or 1 }
}
?
correct, that should work now
will give it a go
It lists all the values as 40, when I only want the chips to be 40
should be +40 chips, +4 mult, x4 mult, and +$4
bump. 
that worked, thanks :D
are you changing the "#num#" for each returned localization variable?
saturday
what does this error message mean?
field ability no exist
show line 156 in awesomealbert rq
Config is cooked
if pseudorandom('fours') == G.GAME.probabilities.normal/self.ability.extra.odds2 then
if self.ability and pseudorandom('fours') == G.GAME.probabilities.normal/self.ability.extra.odds2 then
so I just needed to add self.ability to the if statement?
yeah, it'll check if self.ability exists first now
now who could need this many vouchers
doesn't crash anymore, so that's good 👍
also, if you're gonna be using self instead of card, use self.config.extra instead
so would it be in an event? im ngl im still confused asf
otherwise, use card.ability.extra
so there's a global G.GAME.consumeable_usage_total.tarotthat tracks it across the run
you would need to create a similar global variable to track the jokers sold over the run, I think
i have Joker_sold that ticks up whenever a jimbo is sold, but im not sure when to update my loc_vars ...
do you want it to track over the entire course of the run, even if you don't have the joker?
yeahh
then yeah, you'll need to declare something like aG.GAME.jimbos_sold kind of variable, and then hook or patch the function responsible for selling jokers to increment it if the card being sold is a jimbo joker
and then reference G.GAME.jimbos_sold in your loc_vars
so i shouldnt return center.ability.extra.Xmult in my loc_vars and i should return my formula for calculating the Xmult instead {1 + {0.5 * Joker_sold}} and then update Xmult in my calculate in context.Joker_main?
okay my joker works tysm @minor furnace
how do i add a custom colour for messages
can someone help/give a concrete way on how to change the ace on the title screen coz man i am going insane over heree
all i need is for it to be an ace of hearts and not spades
probably not correct but shhhhh
how could i manipulate blinds for a deck? i'd like to make sure every boss is a showdown boss but can't seem to figure out how
getting an error
...what's your Lovely version?
probably outdated, let me go do that rq
where would I put that?
are there singular events for when a joker is obtained or removed, or do I have to list each scenario?
bump
i dont think it's the lovely version but i could be wrong, just replaced mine with the latest version, same error
it might be a mod i've got probably causing it
leme try something
Woul u date placeholder chan
ok so it is infact a mod i've got on but i dont even know where to start with my 40+ mods
I wanna see this negative lol
how do i make a blueprint have a message rather than the og card
are you using card_eval_status_text for that
think you don't need to specify message_card in this situation anyway
ah lmao
looks like what i did works
how do i force lose
replace
if pseudorandom('fours') == G.GAME.probabilities.normal/self.ability.extra.odds2 then
with
if pseudorandom('fours') == G.GAME.probabilities.normal/self.config.extra.odds2 then
(sorry for the delayed response my Internet is shit)
should I change the loc_vars table as well to self.config.extra?
HEX("RRGGBB")
only if you're using self.ability instead of card.ability there too
so then I change
loc_vars = function(self,info_queue,center)
return { vars = { --#1# is replaced with card.ability.extra.Xmult
center.ability.extra.chips,
center.ability.extra.mult,
center.ability.extra.Xmult,
center.ability.extra.money,
center.ability.extra.odds,
G.GAME and G.GAME.probabilities.normal or 1 }
}
end,
into
loc_vars = function(self,info_queue,center)
return { vars = { --#1# is replaced with card.ability.extra.Xmult
self.config.extra.chips,
self.config.extra.mult,
self.config.extra.Xmult,
self.config.extra.money,
self.config.extra.odds,
G.GAME and G.GAME.probabilities.normal or 1 }
}
end,
?
correct
well, no actually, you already had it correct in the original loc_vars since you were originally using center.ability
i was saying if you were already trying to use self.ability
So for
if self.ability and pseudorandom('fours') < G.GAME.probabilities.normal/self.config.extra.odds then
I can just replace self.ability and self.config with center.ability and center.config?
no you need to either use center.ability or self.config, one or the other
so
if center.ability and pseudorandom('fours') < G.GAME.probabilities.normal/self.config.extra.odds then
?
sorry if Im being dumb idk lua coding much
you're using both
#💻・modding-dev message
you're good
either
if center.ability and pseudorandom('fours') < G.GAME.probabilities.normal/center.ability.extra.odds then
or
if self.config and pseudorandom('fours') < G.GAME.probabilities.normal/self.config.extra.odds then
if I use center.ability, then I won't need to change my loc_vars from what I had before, right?
loc_vars = function(self,info_queue,center)
return { vars = { --#1# is replaced with card.ability.extra.Xmult
center.ability.extra.chips,
center.ability.extra.mult,
center.ability.extra.Xmult,
center.ability.extra.money,
center.ability.extra.odds,
G.GAME and G.GAME.probabilities.normal or 1 }
}
end,
correct, they'll change as the data of the joker changes
hey gang how would I do something to cards that are played but not scored?
if center.ability and pseudorandom('fours') < G.GAME.probabilities.normal/center.ability.extra.odds then
try using self.config then
is ease_dollars not the correct call to have an enhancement grant money when scored?
how do i check if the player has less than or equail to a certain ammount
basicly what is the code for vagabond
is it possible to make a joker change sprites
should just be dollars = <value> in the return
Can't you go in cards.lua and check
isnt this how you get end-of-round payout like golden joker? ease_dollars should be correct for giving money in the middle of the round
i can but it is to complicated for my dumb brain to understand
(i have looked)
im assuming its just G.GAME.dollars <= self.ability.extra
yeah you can just check G.GAME.dollars against the wanted value for that
nah end of round payments is just whatever value is returned by calc_dollar_bonus
so like g.game.dollars <= 4
i've used ease_dollars a few times with no issue so it's also valid afaik
though I assume returning dollars = gives the proper message popup
yeah i think that works too
theres a bunch of different functionally identical things like that
hey guys, pretty new to this stuff, does anyone know if i want to create multiple jokers in my mod can i put 2 .png's in the assets folder or if i should put both assets into one .png file
chat i got this one
How do i make this look like its "perfumed"
so basicly the 1x and 2x is where u want the images and basicly the image that is a joker is i think called a atlas (see image 1), you usualy should keep all the sprites in the same atlas but you can have multiple atlas's (see image 2) but you have to in the code for the joker specify what atlas you want to use see image 3
i want it to replace all "self.cards" with "(self.cards or {})"
i have all in 1 image
so its not a problem to do both?
thats cool
use
pos = {x = ? , y = ?}, to select what one you want
so top left one would be 0,0 and the bottem left would be 0,1
but i would recomend doing all joker sprites in the same atlas
but its up to you
oh wait, its not 0,0 and 0,95?
lol
ill probably do that
afaik jokers always take their sprites from an atlas so its just more convenient to put them all in one atlas
cuz jokers are 71x95
so in the atlas you set your x and y which should be 71 and 95 if i remember
but the 0,1 and stuff is to select where that 71x95 rectangle selects
hey yall
tf am i doing wrong
oh
yeah
that makes complete sense
mb
so basicly its just selecting a box if that makes sence
What's the code for the thing you were using/testing when it crashed
yeah yeah i completely forgot that u set x and y before
?
if u need anymore help im here sometimes
but i will prob be useless
and im currently in class
sure! ill probably need it
o7 my grades
its def an issue with the localization
idk why tho
so was i as of 1 week ago
https://github.com/Steamodded/smods/wiki/Calculate-Functions @slate bison this is usefull
how do i turn a card into glass?
and also if u need to "copy code" go to a mod and look in the code and it should help roughly
Hmm, not as familiar with localization stuff, afraid I can't really give much advice on that
like i find a modded joker simillar to what i want and i "yoink" part of the code
oh yeah i was watching a video, cuz i learn better with them, and i basically have like a joker working
ahh yes that one
'v' is a reference to the card being turned to glass in this case
fair but their are not many/ any videos so its alot of reading
yeah honestly been doing that a lot too lol
yeah ik
thats why i came here
usually learn on my own
my dms are always open so yeah
thank u!!
will ask u if im lost with anything
suree
Hey im working on a mod rn for one of my friends and im trying to add chips to a joker based off the club cards drawn
i personaly would no longer be friends with that person
im having some issues understanding lots of the contexts and shit and havent really fucked with lua
good luck buddy
Im probably never making an edition
if u dont know what you are doing with lua i would not start there
Shaders look.. horrifying to deal with..
i mean you could maybe u could do chips = to the amount of club cards in hand
that would be way easyer
well yea
well ok from what ive read we can see what cards were drawing and then based on the cards were drawing add chips to that card
does that not work?
send me link
i want to see it for future use
pls lemme see
yea 1s
in instances theres something called draw hash
im assuming its related to cards ur going to draw in the future
why isn't my joker doing anything? i've even set the probability to 1 in 1 in case i was just getting unlucky
nvmd
i see it now
v.other_card:set_ability instead of v:set_ability
bc it got left over from before i made the code more like midas mask
it's still doing nothing???
Did you remember to save
Hey just quick question here. I just wanted to know what the context. variable would be for detecting a glass card in the hand
I didnt know seals were that big
yeah
other changes, like me changing the description text, carried over just fine
now i'm trying literally copy-pasting the midas mask code and it's still not working
try looking at the glass joker code
huh apparently it isn't saving
context.main_scoring and context.cardarea == G.hand
i looked closer and no it didn't
I wanna make a joker that randomly triggers one of four effects. Would I use the same code as I would usually use for a probability joker?
now i'm confused,,
yep the code's saved
but it still isn't working
Is it just straight up not doing anything at all?
How is your calculate function being defined?
here's the full calculate function. there were parts i weren't including before as they work fine
i literally copy-pasted all the glass card logic from midas mask why isn't it working 😭
oh i see it
G.play
midas mask is in G.jokers
if this works now i'll explode
i did it anyway

i need to figure out how to patch card_eval_status_text outside of returned values by smod
Finally my two boss blinds are feeling a little less lonely
Yipeeee :3
hey im having issues with my joker registering when i boot up balatro
this is what i got
is there something im missing lmfao
I never knew SMODS.INIT existed until today.
Ah.
so then what should i do instead
what works lmfao
trying to foollow a couple tutorials and i cant find anything that actually works
if your smods is a recent version than this won't do anything, i suggest you check out https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua
alright thanks so much 🙏
for a first time lua project this is way out of my depth but its interesting lmfao
bump
I would assume so
calculate = function(self, card, context)
if context.joker_main then
if self.config and pseudorandom('fours') < G.GAME.probabilities.normal/self.config.extra.odds then
return {
card = card,
Xmult_mod = card.ability.extra.Xmult,
message = 'X' .. card.ability.extra.Xmult,
colour = G.C.MULT
}
end
if self.config and pseudorandom('fours') > G.GAME.probabilities.normal/self.config.extra.odds then
return {
card = card,
chips_mod = card.ability.extra.chips,
message = '+' .. card.ability.extra.chips,
colour = G.C.CHIPS
}
end
end
end,
I tried my best but i still cant seem to get it showing
I know how to do it when it's a 1/2 with two different options, but idk how I'd do it for a 1/4 with four difefrent options
While I don't know what to do for a fourth option, could a third option be equal? Sorry if this is wrong, I am very new to modding.
Doesn't this randomly trigger A and randomly trigger B (so could also be both or none)?
edit: me stupida
Outside of atlas and the SMODS.joker what should i add so it actually registers 😭
i downloaded the latest versions of SMODS
so idk why it isnt working
When the odds are set as four, yeah
nig
I don't think it's really relevant what the odds are set to? As in, couldn't all 4 scenarios still happen when the odds are 1/2 or 1/8? 🤔
You mean that it could trigger both the xmult and +chips at once?
Yeah, your logic is a bit messed up. Instead of rolling a single dice and checking the result, you're rolling a dice every time you're checking the result (and thus rolling multiple dice)
Do you mean that each time I have "if self.config and pseudorandom('fours') > G.GAME.probabilities.normal/self.config.extra.odds then
" it rolls the dice separately?
pseudorandom(...) gives a different random decimal between 0 and 1 every time you call it, e.g. 0.46588486367842
then you compare it to G.GAME.probabilities.normal/self.config.extra.odds where
G.GAME.probabilities.normalwhich usually is1, but can be changed by e.g. oops all 6s which doubles itself.config.extra.oddsis the odds on your card, whatever you pick
So then
if self.config and pseudorandom('fours') > G.GAME.probabilities.normal/self.config.extra.odds then
checks if the number is greater than 0.5, and then does the thing if it is?
if your card's odds are 2, then yeah it checks if the random decimal is greater than 0.5
So then, if the odds are 4, it checks if its greater or less than 2, right?
range is from 0 to 1
ok got it
I use < personally
I don't think it matters?
< or ≤
I don't see the difference in symbol count /s
(also tabs > spaces)
Coming up next in #💻・modding-dev :
Why my mod saying "Unexpected symbol "≤" in myjerker.lua"
when is someone adding a preprocessor to smods so that when mods get loaded we can fix obvious stuff like this
Does anyone know where is the API for all the text formatting in the game on steammodded? I wanna create the text effect of spectral cards but idk where what is the formatting for it
I don't think you can use that symbol in Lua.
I think you use >= or =< or something like that.
I can't tell if you're joking or not
...yeah, we'll say I am. I guess.
how do i get the number of empty jokie slots?
check out https://github.com/Breezebuilder/Steamodded-Wiki/blob/dev/Text-Styling.md use the link breeze (the author) posted
nice thanks
Actually check out https://github.com/Breezebuilder/Steamodded-Wiki/wiki/Text-Styling
erm
Slightly more friendly UI while I wait for the PR to be accepted
what's the difference 🤔
maybe check out the vanilla code for stencil?
oh damn u are doing the whole guide think
thats actually cool
One is just the raw .md file which is rendered in by GitHub's .md renderer, the other is the full Wiki page rendered by the (very slightly but meaningfully different) wiki renderer
yeah, ill do that thanks
It makes a difference for the inline svgs
And my brain
For some reason as-yet unstudied by modern science
Also if anyone has access to Safari, let me know if all the SVGS and animations look right
I've seen a couple of devs try this (cryptid+talisman, almanac+jenlib, strange pencil+strangelib), and honestly? Doesn't really seem worth it to me
the upside for you is that someone else could use the helper functions etc from your library? the downside is that it becomes harder to install for new modding users?
but then whoever is interested in wanting to use your helper functions also has to consider the up/downsides of that
if it's for your own mods I think it's a compromise between having to maintain either 2 copies and easier installation for users vs only 1 copy but harder installation for users
i stole said card display code it s very cool
is there a way to get a table of every joker in the game?
is it something with G.P_CENTER_POOLS?
I answered my own question
"P_CENTERS" is everything
right but I just want jokers, so I'd have to use G.P_CENTER_POOLS["Joker"]
and then...do something with that
You check if the key starts with j_
are you looking for a joker or are you doing a random selection?
random selection
string.find(k, "j_")
put that in a table
and pick a val with psuedo random and your have your random key
for k, v in pairs(G.P_CENTERS) do
if (string.find(k, "j_") and v.rarity ~= 4 then
table.insert(jokers, k)
end
end
is that preferable to using P_CENTER_POOLS to look at only Jokers, grabbing a key, and then going to P_Centers with that key?
I'm very much still new to this and trying to understand the codebase
i think if i remeber correctly CENTER_POOLS is everything that can be picked in that run so far and CENTERS is actually everything
in that case I think I should definitely be using CENTER_POOLS
to prevent dupe jokers
the goal is for a joker to create another random joker
then showman is a thing so make sure to check for that
Quick help if anyone knows this off the top of their heads, I'm trying to add an extra node to the definition for the shop UI right here to show a new cardarea, but I can't seem to figure out where to append it/change the tree so that it appears correctly and doesn't shunt the entire menu to the left
aren't jokers always in the Joker pool
as in they will always be there
get_current_pool seems like a solution?
chat
still thinking about this roach bs
actually what if card destroyed
idk how i would do that
I'll rethink
I can get my lucky cards to activate for this joker idea is when a two pair is in scoring hand makes all cards lucky enhancement
its making the joker trigger cards dont turn lucky
Instead of c:set_edition do c:set_ability('m_lucky')
anybody knows is where i get the API information for context.other_card?
idk if context.other_card:is_queen() is a thing
You would do if context.other_card:get_id() == 12 for checking if a card is a queen
ohhhhh got it thanks
It's in the source code.
Do you have 7-zip?
yes
Do you know where the game files are located?
yes yes
@daring fern do I need to specify a "Full house" for tat chocloate joker u just saw?
or does two pair register it
You would have to check for next(context.poker_hands['Two Pair']) instead of checking the scoring name if you want to check if it contains two pair.
Right click on the game exe
oh yeah thats cool
what are the maximum dimensions of an atlas
is there a easy way to find what i want in the source code of the game?
card.lua is where most jokers code is.
nice thanks
that will help a lot
There is no max size to an atlas I don't think.
this is not true. it seems to not like something i tried with a 76480x128 (2x) pixel atlas
oh huh, i forgot to change the joker's name
not me using 710 x 950 for mine.
loading this image takes about 670MB of RAM, hope that helps!
weird given that the final image is only 196kb
anyway, i reworked it to 8000x320 (1x, 2x is 16000x640) and it works now, so
nope, the filesize doesn't matter, it's the size of the file in pixels
okay I am extremely confused,
why does the upper one crash when I go to it on the new run menu, but the lower one doesn't??
oh wait
okay i'm blind, it's the #1# not being able to target anything because there's no loc vars
Oh my god 😭
ooh this is interesting
the next and previous pages of the collection are preloaded/ not unloaded, so any animated jokers will still play when on the page next to it
If given a chance, Bad Apple will appear in anything one way or another
there's already a mod that adds the entirety of bad apple as a joker
not sure how it does its one
If it has a screen, Bad Apple shall be seen.
if i could figure out of the change the text dynamically every frame then I could do it in ASCII
in a joker description? would have to be via a main_end
anyway, time to very quickly do my new idea where it appears in inverted colours if the sock and buskin is negative
Oh goodness
is there a function that can check for wild cards? Like is_face() but for wild cards?
Hi, is it correct to put a if within a if but after its return?
I'm trying to debug a mod (that I did not create), that is supposed to replace edition textures (foil, holo, poly, neg) with ones of its own. However, out of all the injects the mod's doing, none of them actually end up targeting anything (which I could deduce from the code). All the editions in the game just look like the base edition.
I have no prior experience in Balatro modding, but I do know how to mod Minecraft, and lovely's injection system seems way easier. Do you know a conventional way to reskin editions / a mod that implements edition reskins that I can use as a reference?
you sure?
is_suit already checks for wild cards.
I'm sure if you go through SMODS' github, they have some example mods, one of them being an ExampleEdition.
Try that out.
errr what is this mean to be
well the calculation below
pixel dimensions
total pixels
i made a graphic with more pixels that works 
ah no, image dimensions are rounded to the next multiple of 2
so your old image is loaded as 131072*128
center does not store edition, but card does with card.edition
a reminder that:
center refers to a card's metadata, like its name, starting values, and rarity
card refers to card
ah. so before i add the sprite node, can i do self.edition to get the card edition or will that break things
self.edition is a table
self.edition.key is a easy way the check
the answer was no
gotta pass it into the function first
and a quick tprint shows that self didn't even contain edition regardless of the card's edition, anyway
I still don't know how to debug this, please help.
fig. 1 : crash message;
fig. 2 : game.lua code in question;
fig. 3&4 : the code of joker that causes said crash.
how do you show the blueprint compatibility text? is it set by default on false?
There.
ah sorry i wasnt asking,,, im a newbie asking for help too x)
And those two picture is my attempt to answer your question. No worries.
center does in fact store edition.
ah ok ok thank you!
my immediate interpretation is that - it saves all of the things in config as part of that joker to retain to load on loading a saved game - but it doesn't like when it runs into the function.
you might have to figure out a different way of doing what you're trying to do that has the function elsewhere and not as part of config
probably a really stupid mistake im doing, but can someone help me in why is this not working? it keeps saying its something in line 84 or smth but i changed it around a lot and it still not changing
a mod or smods itself may be causing this
I now actually have time to work on my mod
does anyone know of a joker that modifies the behavior of existing consumables? I've already figured out how to use take_ownership on its own, not so much as to make it with a joker
does that mean its my code?
Line numbers would help
oh shi sorry wait
behold. if the bad apple is negative, the bad apple is negative.
Your weird indentation is doing you no favours here. Looks like you're using VSCode, try installing the Lua extension and running auto-formatting first
I think you just need to remove that comma on line 81 but your indentation and line break convention (or lack of) makes your code very difficult to follow
i mean im kinda copy pasting from source code so yeah maybe thats why
is there a way i can have a joker run something after each hand is scored visually? i want to have a card that changes one of its vars after every hand but if i do it in calculate the description changes immediately, meaning the var as used in scoring the current hand looks different from the var as it appears in the joker's description
I think you would have to look at the cards currently selected and put whatever calculation you want in the loc_vars function
Just highlight your whole joker, right click the selection and click "Format Selection"
sorry if this question is answered somewhere else but i have a deck skin i made that i wanted to upload to the balatro mod manager, where would i go to do that ?
or just wherever most mods are uploaded im not even sure if mod manager is the most popular place for mods lol
I think you'd have a better chance for an answer in their thread, personally I've never done it 😅 https://discord.com/channels/1116389027176787968/1339375696254074942
are u saying this assuming i have the lua extension on? cuz i dont have it and im not seeing anything like format selection :(
because im stuck trying to make the extension work
You can get the lua extension trough vsc
on the extensions tab?
yes
when i search "lua" these are the ones that ppear
im sorry im really stupid at this stuff
Do you have any lua extension in "installed" ?
so now im trying to find it? idk
Also which os are you on?
im on windows
the ones i installed are there in the picture
i didnt find any other :(
oop
sadge
Try this one and disable the old BabeLua one
And NPL too
do i just click in install on the website?
Yea that should work
ok im done it does nothing when i click on it 😭
oh its not detection vs code on my pc i thingk?
Odd
Can you give me your VSCode version? Go to vsc code on the "Help" tab > About
no wait i got it
idk why
i uninstalled the whole thing and installed again
i have the lua thing now
thank u 🙏
Np 👍
Is using VScode worth it? For now i've done all my stuff on notepad++
probably not needed if u are a pro
im trying to get a joker give 1 random negative spectral card everytime a queen is scored, but it keeps crashing when i play anything other than a queen on my hand
does anyone know what the problem is?
same
this is the error that i keep getting
im fresh outta ideas for jokers n stuff
should i make a modding post conceptualization to steal other peoples cool ideas
context.other_card only exists in a few specific contexts, try adding and context.individual to the G.play check line
also the focus = self might cause issue too
It is also get_id()
yeah i changed that after sorry
but its still this error
that was it! damn that is going to my notebook
i didnt know that
makes a lot of sense
Press Ctrl+Alt+F Shift+Alt+F to auto-format. Should make your code a lot more readable
its not working :(
Whoops, it's Shift+Alt+F
rq is pseudorandom inclusive
like if i do pseudorandom(seed, 1, 3) will i get numbers 1-3 or 1-2
is it possible to create a random tag?
i guess not with the create card since it isnt a card type, so i'm not rly sure where to look into
tried to understand riff raff and diet cola but they seem built rly different
im trying this as a base but im not sure to understand it
ty
any good?
in terms of understanding the mechanic? sure.
in terms of balance? i like it.
and it loop around to aces so it viable in other build also
That is one ugly looking title card
hey guys, can someone please help me with this issue?
is increasing the ante as simple as like
ante = card.abilty....ante?
No, its ease_ante(number)
ty!
okay so how do i make an effect that removes all the jokers you have (except enternals)
and a second effect that removes your whole hand
i can do individual card (which is itself), but idk how to remove the whole hand
what function is run when you play a hand?
Are you familiar with for loops?
Not with Lua
ive probably used a couple in my mod alr but idrk what they do people are just helpin me
G.FUNCS.play_cards_from_highlighted()
ty
for k, v in (G.jokers.cards) do
if not v.ability.eternal then
v:start_dissolve()
end
end
Yup
and then the same thing but like G.hand.cards?
No.
augh
if context.destroy_card and context.cardarea == G.hand then
return {remove = true}
end
this one card is gonna ruin everything and its great
just like how Bowser spaces in mario party screw with you big time
didnt see that you got a star, it was copied from my star joker lmao
that crashed me lmao
and i dont think the hand one worked either
Is this in calculate?
yeah, because its apart of my 8 outcomes
Did it hard crash?
What line is number 397?
I forgot to put pairs again.
for k, v in pairs(G.jokers.cards) do
if not v.ability.eternal then
v:start_dissolve()
end
end
the joker destroy is amazing yes, now its just the hand
context.destroy_card doesn't happen during context.final_scoring_step
can i destroy a card without using start_dissolve?
No thats going to create ghost cards.
This won't proc canio though
You have to also return a table of the destroyed cards after the loop
for some reason i cant seem to find the code for start_dissolve function anywhere
what
wtf happened to my keyboard
Oh yeah that's the bigger issue lol
then what should i do because i really dont want my enhancement effect to move out of end of scoring
Do you have case sensitivity or match whole word or regex turned on?
Its located at line 2130 in card.lua
i dont think so
thanks :3
weird how card.lua didnt pop up
-# oh yeah lovely dump doesnt have card.lua
What scuffed version of smods are you using that doesn’t dump card.lua
latest one
havent updated for a few weeks
You could use some variables to mark if the effect proced and cards should be destroyed in another context i guess.
context.destroy_card is at the end of scoring.
surely 0324b shouldnt exclude card.lua from lovely dump
uhh if shouldn't
well i havent gotten a ghost card, its doing my hand not played cards which is what i wanted
Have you tried going to the next round and seeing if they are there?
card:start_dissolve() actually doesnt need to be in events, though its usually recommended to do so
i think its only under certain circumstances that they start to create ghost cards
its if its destroying your Played Cards it ghostifys them
i had to deal with many ghosts since i have my board cards destroy themselves after use and they dont do that no more
In defense, the stable release version of Steamodded hasn't changed in over 2 weeks
is this fun to play against
you need to move your card around for it to not be destroyed, basically
doesn't sound balatroesque that much
For some people, possibly. This would be a dealbreaker for me tho
What if you press the sort buttons?
Well if it works... to make it canio compatible you just have to create a local table before the loop, insert every destroyed card in the table with the loop, and then return: remove_playing_cards = true,
removed = your table
i think it works too
tbh idek if i want it to be canio compadible, makes the effect too positive for landing on a bowser space
asriel is supposed to be really strong, so i wanted to give them some skills which are more unique to represent that :p
as a humble flush build main this is horrible for me
they are no longer locked to stuff like "When hand is played", "When discard is used", etc
the timer counts down regardless of whatever is going on
yes, that also includes during scoring, so you arent just sitting around to wait now
fair enough
sounds like the ideal condition to create ghost cards
but what about the case where you can't really do that
like the talisman calculating screen
cry about it
didnt seem to create one in my case, i tested
(i don't think update runs there)
"im finally done" fucking wrong
i need to account for cases when extra is already defined in a calculated result table
...i mean, that means you can easily one shot each of asriel's phases with broken jokers, so i think thats pretty fair
....actually
what jokers do use the extra table value anyway
idk exactly if i actually need to account for that edge case
whats the context for after a hand is done because im wanting the card destroy effects to happen after everything
context.after?
cause rn they get destroyed and still score and stuff, and im fine with the scoring but id really like it if they visually dissapear after
i tried that and it, didnt work for some reason
Holy fuck is that dozer grace
erm actually its rarities 🤓
please send help
yes
wait a more curious question, is there anyway for there to be a way to Block your enhanced cards from being able to to change?
like i dont want my Blue Space to turn into a goldcard or be deathed or smth
guess you could add a check for that and you can prevent a change in enhancement manually
in what context are we talking about here
like in general
or is the enhancement being set manually
@manic rune did you see the new fish wording
local my_pos = nil
calculate = function(self, card, context)
for i = 1, #G.jokers.cards do,
if G.jokers.cards[i] == self then my_pos = i; break end,
end,
if my_pos and G.jokers.cards[my_pos+1] and not self.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced then
local sliced_card = G.jokers.cards[my_pos+1]
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({func = function()
G.GAME.joker_buffer = 0
G.jokers.cards[my_pos-1]:set_ability(G.P_CENTERS.e_negative, nil, true)
self:juice_up(0.8, 0.8)
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
play_sound('slice1', 0.96+math.random()*0.08)
return true end }))
end,
}
crashing and idk why
how can i check for open joker slots (i have cards that make jokers and they ignore the limit lol)
why does your ends have trailing commas
you don't need them and the game doesn't like them either
last end?
gotcha. so just move it down a line?
yeah
G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer)
like stick that in an if statement?
Check if its greater than 0.
Issue now is unexpected error on line 116
calculate = function(self, card, context)
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == self then my_pos = i; break end
end
if my_pos and G.jokers.cards[my_pos+1] and not self.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced then
local sliced_card = G.jokers.cards[my_pos+1]
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({func = function()
G.GAME.joker_buffer = 0
G.jokers.cards[my_pos-1]:set_ability(G.P_CENTERS.e_negative, nil, true)
self:juice_up(0.8, 0.8)
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
play_sound('slice1', 0.96+math.random()*0.08)
return true end }))
end
}
the } at the end is line 116
missing a couple ends there
Could you ellaborate where (I am new to this)
you're missing an end for the if statement check
blue = needs an end red = ends
they're imbalanced
would the blue be where the end needs to be or what part needs an end?
im pretty sure theres an end for the for loop and the statement within that for loop lmao
yes inline end statements exist
pgone
theres dotted lines cus im on vcs, should each line have an end basically?
no
only control flow statements need ends (if, for, while, repeat, function)
you need one for the if statement
Your formatting and indentation is wild. Try installing the Lua extension and running the auto-formatter with Shift+Alt+F
tried installing the lua extension, is not working and I do not have the knowledge to get it to work
vscode -> extension icon in side bar -> search -> lua -> install
it's that shrimple
Which IDE are you using.
Any of these three are good, though the top is recommended
grave mistake right here
you're using Visual Studio
not Visual Studio Code
two different programs
i fucking hate how microshaft named it like that its so confusing
like naming it atom 2 would probably be better
Why does the created card have that infinite purple particle effect?
vsc = visual studio community
vsc = visual studio code

vsc that one geometery dasher level
Thank yall, I just downloaded what was needed for uni lmao. Bumping this too cus Idk wtf is happening
NVM, fixed it
Just need to figure out how to get my code to work
Good schmorning chat
schmornin'
i unlocked all before i knew about the debug mod to test out my jokers, but now my main profile is locked out of achievements, is there a way to undo it?
how do i like make my deck start me with 1 extra hand slot and 1 extra joker slot?
which one is the save file?
profile.jkr
thank you!!
Hand size, you mean?
I think you can just remove the materialize line and it'll not have the particles
yeah
Put hand_size = 1, joker_slot = 1 in the config.
does anyone know if negative mult is at all possible with smods?
it technically is from a numerical standpoint, i have a card that give -5x mult on specific conditions
it doesnt really show up on the display (ie it doesnt say x chips x -number mult) but the chip score you have will be neg
issue again, sorry for being a pain ^^'
calculate = function(self, card, context)
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == self then my_pos = i; break end
end
if context.setting_blind and not self.getting_sliced then
if my_pos and G.jokers.cards[my_pos+1] and not self.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced then
local sliced_card = G.jokers.cards[my_pos+1]
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({func = function()
G.GAME.joker_buffer = 0
G.jokers.cards[my_pos-1]:set_ability(G.P_CENTERS.e_negative, nil, true)
self:juice_up(0.8, 0.8)
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
play_sound('slice1', 0.96+math.random()*0.08)
return true end }))
end
end
end
it is meant to be destroying the joker on the left (like ceremonial dagger) then giving negative to the right but nothing is happening
on blind select
there are 2, in file 1 and file 2, is there a difference?
Which profile number is your main profile?
Is it possible that SMODS.blueprint_effect returns nil?
Is it possible to change the message when returning dollars?
Would this be an issue in my code that needs to solve, or do I just need to slap an or {} at the end of it?
Just message = in the returned braket.
This shows $3 and Gold!!!
is there a way to make a card not retrigger
You mean unable to be retriggered?
My Board cards are all card that can be Played or Held, and if i have a seltzer they can be retriggered, A couple of them, i dont want retriggered because they summon a strong joker
Is it possible to have my Joker give Xmult when it's debuffed? I thought that would do the trick but it just does nothing.
Try putting if not context.repetition
You would have to hook calculate_joker
Never hooked anything before. How do I do it?
local foo_ref = foo
function foo()
foo_ref()
end
local oldcalcjoker = Card.calculate_joker
function Card:calculate_joker(context)
if self.debuff and self.config.center.key == 'j_prefix_key' then
--- do things
end
return oldcalcjoker(self, context)
end
Do I put this inside my Joker or before?
You put it outside of everything.
Me after opening the Lua docs
Has anyone tried to load a native lib in a balatro mod?
bump
I think my current socket-based system is way too complex and hosting an ipc interface would be easier, but that needs a native lib to hook into
Did a cursory glance w/a search and asked claude and it seems possible
I think SMODS might do it
i didnt end up using it but i did try out some libraries once, i just copied the way smods does it
does anyone know the key for hanged man off the top of their head before i start diggin
im assuming its c_hanged_man but im not certain, i suppose just testing it will verify that
it sure was
At least it wasn’t misspelt
Dully the Dollster
It’s not loading properly here
its just a horse shakin his head no
(sorry if i am annoying, this thing is just on my nerves lol)
Don’t use self
What should I use instead
card
so replace all self with card and it should work or is there more?
NVM, works but now it kills the one on the right then gives me this error
loc_vars = function(self, info_queue, card)
info_queue[#info_queue + 1] = G.P_CENTERS.e_negative
end,
calculate = function(self, card, context)
local my_pos = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then my_pos = i; break end
end
if context.setting_blind and not card.getting_sliced then
if my_pos and G.jokers.cards[my_pos+1] and not card.getting_sliced and not G.jokers.cards[my_pos+1].ability.eternal and not G.jokers.cards[my_pos+1].getting_sliced then
local sliced_card = G.jokers.cards[my_pos+1]
sliced_card.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
G.E_MANAGER:add_event(Event({func = function()
G.GAME.joker_buffer = 0
G.jokers.cards[my_pos-1]:set_ability(G.P_CENTERS.e_negative, nil, true)
card:juice_up(0.8, 0.8)
sliced_card:start_dissolve({HEX("57ecab")}, nil, 1.6)
play_sound('slice1', 0.96+math.random()*0.08)
return true end }))
end
end
end
}
urm negatives, i want jokers thatll send your mult into the negatives but give a huge xmult boost smth like -x8 mult then tarots that can send it back to positive
How to set a minimum value for joker name font size?
Heighten.
With SMODS.has_enhancement(context.other_card, 'm_steel') being true, how do I access this Steel card's held-in-hand Xmult?
I originally thought it'd be context.other_card.ability.config.h_x_mult but the game crashed and said config is nil.
config is located at the card not the card.ability
So context.other_card.config.h_x_mult instead?
I think so.
So not context.other_card.config.h_x_mult, then.
Add dollar_message = “blablabla” to the return
What if it's context.other_card.config.center.h_x_mult?
I'm gonna try that.
Nope. Not that, either.
last bump before i give my brain a rest lmao
is it possible to lock buying a certain booster pack until a condition is met?
like make it impossible to purchase (it can still show up tho) until you do something
Find the code that handles can_use for consumeables, and then write your own can_purchase implementation.
bump
I don't manage to make things work. I think the if self.debuff then return nil end of the base game might be overwriting anything I try. 🤔
Show your code.
Currently, I have this.
What happens?
Maybe local effect = oldcalcjoker(self, context) and then if ... then --- do things?
Litterally nothing.
No, then it would return nil if its debuffed.
It has to go last.
When the joker is debuffed?
I'm doing tests by going against Crimson Heart.
yayyyyyyyyyyyy
It worked?
Put some print statements in there.
It doesn't go in joker_main, visibly.
So, should I just replace the joker_main context to eval_card?
I'm making a joker that gives one of these effects. how do I code multiple possibilities and then randomize which one is picked? (equal odds of course)
I imagine I need to make a separate list of variables then use psuedorandom. but if someone knows of a mod/joker in a mod that does something similar I would accept that too.
I do have the smods wiki open trying to gather as much information as possible before asking but I figure something simple like this could be explained quicker
yeah, just a pseudorandom and then some if-statements should take care of that
You'll need pseudorandom_element
Sorry for the random ping, turns out there is a library that does the native hooking that I need, but it needs LuaJIT2. How would that work w/smods?
I'm not fully sure what Balatro's lua runtime is
Or what it supports (this lua library is some native lib bindings)
Ok so Balatro does use LuaJIT2, so maybe it will werk
bump
Nvm, solved it.
So, since nothing I've tried so far is working, anyone got any idea how I can have my Joker give Xmult when it's debuffed?
@glass scaffold how are you
context.other_card.ability.h_x_mult
Debuffing disables every ability on a Joker, so I don't even know if you can....
Needed a small help again 😭
i know you can have an effect at the moment it becomes debuffed but i don't think you can have it specifically have an effect while it's debuffed
unless you do some lovely shenanigans
Whats the best way for having a joker not show up in shop? I want them to be in theory an upgraded version of a previous joker so its upgraded versions wouldnt be showing up in shop
Try looking at how gros michel/cavendish does it
ok bet
Also my Xmult isnt really working on my ghost pepper joker its crashing everytime saying round _reserve isnt working does this look right?
What on earth is round_reserve
Idk
nvm i figured it out
I saw some post about how to make Balatro use LuaJIT2
its annoying and fiddly but you can put a .dll into the common folder like lovely
Yeah it was something like that
Is there a way to obtain the sprite of last acquired(or bought) joker? I have this to get the name of the joker but I cant seem to get the sprite, I tried something using G.ASSET_ATLAS["Joker"] but failed miserably
local original_buy_from_shop = G.FUNCS.buy_from_shop
G.FUNCS.buy_from_shop = function(e)
original_buy_from_shop(e)
local c1 = e.config.ref_table
if c1 and c1.ability and c1.ability.set == 'Joker' then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function()
last_joker_name = c1.ability.name or "Unknown Joker"
return true
end
}))
end
end
What do you want it for?
I would like a sprite copy of the joker to display elsewhere for my vision impairment making it hard to look at the top of the screen
this crashes with attempt to index field 'other_card' (a nil value). how do I properly reference and change the played cards? I thought this was correct
that worked, thank you
nvm, now it crashed attempting to call method juice_up which is nil
and it's not the juice_up I have in my code since I removed it and it still crashes
I think you can just create a copy of the card
@frosty dock has also made an accessibility support mod IIRC
Remove card = self
thank you again, it works now
I already tried but couldn't get it to work really but I will try again. Thanks for taking the time to reply
You can repurpose the vanilla copy_card to copy the exact card, I believe
Can a joker use the tag_add context to detect if a tag was added?
why not red
Hook the function and call a unique context from it, if anything.
your a is uppercase 😭
yep
is that Saturday Tasogare
yes
maybe the real Allison was the money we lost along the way
Ahhh I see, thank you!
Based
my seal is appearing as xnil mult instead of 1.5mult does anyone know why?
ok so i found a way to move the card to the left but it does this to the multiplayer cards and cryptid cards:
how do i fix this?
Change #4# to #1#
Thanks
how can i replicate wild card but for ranks
anyone knwo why the Xmult isnt working here?
You have to patch/take ownership of every joker that uses a specific rank
welp. Imma just make it imitate an ace and call it even
I know this has probably been asked a million times, but I can't seem to find an answer myself
Where can I find all the base game Joker functions in order to reference them for creating modded Jokers?
card.lua
Excuse me i was wondering how i would make a seal increase the amount of $ the card gives by 1 when scored and then destroy the card at 10$
Hey ik this is prolly a dumb question but im working on a joker that works similar to wee joker how would i display the current amount of chips held in the text box
in loc_vars:
return {
vars = {
self.config.extra.chips
}
}
in your localization text, use #1# wherever you want to have the chips indicator
awesome i appreciate it 🙏
when does loc_vars run? just so i know (late reply because i was asleep for the night lol)
also sorry i meant a joker that changes one of its own vars at the visual end of scoring a hand, not a regular playing card
other question, how can i multiply the finalized score of a hand
(e.g. if i score 20 chips after jokers finish scoring, i multiply the final score by 2 and now that hand instead earned 40 chips)
also another thing how do i create a script to just spawn that joker in when i start a run
i think you'll have to check for context of final scoring step
hold on i might be stupid
maybe context.after
I'm not sure anymore
got a crash and the offending line is the context.scoring_hand[context.other_card] <= card.ability.extra.cardCount, trouble is I'm not sure which is returning nil
Are you trying to count how many cards are in the scoring hand?
how do i display a shader for an enhancement instead of for an edition
or are shaders locked to editions
sort of, I'm trying to check if the currently scoring card is in a hand position that's below the established cardCount
...I think you'd want to iterate over the context.scoring_hand to find what specific card is currently being evaluated first, then check? #context.scoring_hand would give you the total amount of scored cards.
got this error when attempting to use my spectral card to apply a seal
actually, better question, can i have something in a joker run at the beginning of each hand
so i need to track how many colas are sold in a run
but im not sure how i should do it
I'd say take over cola and make it iterate a global game variable that you define yourself
thats what i was thinking
context.before to affect a given value of the card.
Odd question: Is there a way to make so balatro re-evaluates the hand type played?
i mean when the cards are initially drawn at the beginning of each hand
context.before is at the beginning of scoring
i.e. you have a card that when played, changes suit and or rank, and you want balatro to update the hand played accordingly.
not early enough, it seems.
yaya
this is not detecting at all
mod prefix?
that's the azzy
hmmm