#💻・modding-dev
1 messages · Page 236 of 1
So fsr I have a consumeable that gives you a random playing card; but it doesn't trigger Hologram when the card is added to deck?
You need to do it manually
i forgot a pair of brackets OTL im tired...
Hey whats the variable to add more discards?
not variable but you can use the function ease_discards
something else i gotta do? its crashing lmao, theres a nil value somewhere
it's ease_discard, not ease_discards
hell yeah thank you!
L Victin
how to inject the code so that blind will be triggered before the final scoring step 😭
Idk what you’re trying to do but there’s a Blind expansion coming to SMODS
blind effect: played hand will be destroyed after scored
but ye, i will just wait for the Blind expansion
I have something similar in my mod, but I don’t think that helps you.
In any case, you could switch to the branch with the Blind changes and try using it
okay so, i guess one more thing is general discards, This thing is going at every single card, not general discard
so after discarding 10 cards it dies, but i prefer if it can die after 10 total discards kind of thing
context.discard is doing every discarded card augh
Take a look at the wiki to see what contexts there are
i have
context.pre_discard isn't individual, right?
that one triggers when i press the button i assume?
lemme try it
hell yeah perfect
are there any functions or variables for Granting and removing Stickers from jokers (like enternal, rental and perishable)
Check set_eternal like functions
SMODS provides apply functions I think
I always forget the names
That’s why I tell people to check the wiki
SMODS.Stickers['kino_goldleaf']:apply(_card, true)
except change kino_goldleaf to the proper key ofc
Does anyone know how to take my Joker out of the shop pool and the jimbo pack pool?
Also Card:add_sticker and Card:remove_sticker as of recently, which I'm not sure has found its way into the wiki yet
look for in_pool
in the wiki
Got it. Thanks
Yeah it’s just run once per discard phase
Except with the Hook I think
the return tables on SMODS.calculate_context() contain whatever a joker returns in it's return statement, right?
I've got the cards appearing only in the pool I want them to, now for getting them functional.
The hook isn’t part of the normal discard phase
But it calculates effects
How would I go about changing the background like it does during boss blinds and boosters?
Oki, oki. Got it.
hi hi what function's called when scoring a card? like the sound playing part
try looking in eval card but what are you doing 😭
play a sound
:p
modding in this game really just lets u do anything huh
im getting sidetracked
how was mai
If I wanted to make a card back that had an effect like 'Jokers with an "A" in their name are twice as likely to spawn', what's the best way to go about that?
this is a localizational nightmare tbh
it should be pretty easy to implement but it would lead to it working differently depending on the selected language
Haha, should've picked a different example. I'm just looking for ways to increase the spawn rate on jokers for arbitrary qualities, mostly
ah
i think the best way would be to hook the pool function, go through the pool it outputs and then insert extra copies of the jokers that fit your criteria at the end of the pool
to double their spawnrate
if you want to decrease the spawnrate instead you could do the same but instead of inserting extra copies at the end you'd add a chance to replace the jokers that fit the criteria with an 'UNAVAILABLE'
Man... shaders are hard
I'm trying to make a shaders that darken the colors to close to black, and add a subtle wave, but I've no idea how to do that
ah, I guess that does make sense. I might see if I can make a custom pool func in that case
shaders are not for the faint of heart
it's crazy
tho once you get the ball rolling it's pretty much your canvas made of code
i keep getting this crash, from all i know, its not because of any mods, its becaues of steammodded itself
smods or lovely
Hey guys, this is a funny issue.
I am trying to create a new edition with progressive growth, kind of like how the Hiker increases chip value for a played card.
Well, somehow in doing this I have made it so all cards of this edition share the same value. So when one increases, it affects this for all other cards of the edition.
It makes for some insane growth but was not what I meant!
@wintry solar , do you see my mistake?
key = "secretRare",
loc_txt = {
name = "Secret Rare",
label = "secretRare",
text = {
"Gains {X:chips,C:white}+ #1# chips{} when scored",
"Gains {X:chips,C:white}+ #2# chips{} chips for each other card played in hand",
"{C:inactive}Currently + #3#s{}",
}
},
discovered = true,
unlocked = true,
shader = 'secretRare',
config = {
chipGrowthRateSelf = 5,
chipGrowthRateOther = 2,
chips = 5
},
in_shop = true,
weight = 80,
extra_cost = 4,
-- disable_base_shader=true,
apply_to_float = true, --false,
loc_vars = function(self)
return { vars = {
self.config.chipGrowthRateSelf,
self.config.chipGrowthRateOther,
self.config.chips } }
end,
sound = {
sound = "Fox_ghostRare",
per = 1,
vol = 0.3,
},
calculate = function(self, card, context)
if context.post_joker or (context.main_scoring and context.cardarea == G.play) then
sendInfoMessage("we are counting this card", "secretRare")
self.config.chips = self.config.chips + 5
return {
chips = card.edition.chips,
colour = G.C.RED
}
end
end
})
Don’t use self
Use card
My friend finished our sprite for Metal Pipe Joker (ONCE AGAIN SOUND WARNING)
Isnt it beautiful
Differently from vanilla, self refers to the prototype not the card, in order to be consistent with the usage of self
Thank you @zealous glen !
i saw something earlier in here about being able to put custom UI in place of a joker description
and i'm wondering if it's possible to put images in joker descriptions 
i love this
Stick a rickroll in a joker description that would be honestly Funny, Annoying and Very Impressive

yeah sure you can override the description UI
how do I get the description of the joker's ability from G.jokers.cards[x]?
like the tooltip?
yeah
localize is the function to do that but figuring out all the stuff you need for it is a bit involved
you'd first have to call the joker's loc_vars function (it if exists) to get the variables that should be injected into the text
uhhhh where does the game do it?
actually I know you're trying to plug your AI into the game so if you just need the raw text the text is stored in some global table somewhere if you want to grab it directly but you'd have to manually deal with variables and formatting
oh yea
do you need the text as it is rendered in the game exactly
yeah
{C:chips}+#1#{} Chips <- how does this work?
bwehh
ah I see
damn there's gotta be a better way qwq
what are you trying to do with the descriptions?
uh i just want to fetch the description and send it to a python script, im trying to train an AI to play balatro
but now I think about it i have no idea if the description is gonna help
idk how to effectively say the effect of x joker especially w stuff like burnt
Isn't it better to send it the joker key and values? the ai doesn't need to understand the language
yeah
im getting the following error, but im not sure where in my code the error would be
i think im going insane :3
how do I access the chips of a playing card? i've gotten suit w .base.suit and .rank, but im not sure where to find chips
it also changes w stone / bonus so do I have to calculate it myself?
There’s a function for it
In vanilla
card:get_chip_bonus()
but if you want to include the chips from Foil too then you will have to do some more stuff
ahh okay, wait where are editions / seals for cards i just realised
fr
boo
I'm here to bother you all with questions on how I can start the process of creating my first joker.
All I want it to do, is be basic and give a 100x multiplier, and 100x chips.
Very simple in compared to all the other jokers
If anyone could help me understand the process it would be greatly appreciated
u could prolyl look at the example mods https://github.com/Steamodded/examples/tree/master/Mods/ExampleJokersMod
what coding launcher should I have
I have visual studio code which isn't that good but it works
it works
thats what i jse
i think everyone uses vsc
okay
is there even a dedicated lua IDE
check the video in my thread
its about making your first joker
im just tryna start with code as per the steps
then I watch video
just tryna get familiar
mhm, good idea
seems easy enough
guys this may be a stupid question but it's my first time modding and i was wondering if it's even possible to have stone cards displayed for an example hand in the run info menu. i've searched everywhere but i can't seem to find an answer
not as complicated as creating 3d objects in unity
im using steamodded api for creating a new hand
I think not but someone has requested this feature
Some mod has implemented it I think
oh i see, thanks!
you should be able to do this as a patch
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''
local card = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS[v[1]], G.P_CENTERS.c_base)
'''
position = "after"
payload = '''
if v.enhancement then
local ability = G.P_CENTERS[v.enhancement]
card:set_ability(ability)
end
'''
match_indent = true
times = 1
then as the example
{ "S_A", true, enhancement = "m_stone" },
{ "S_A", true, enhancement = "m_stone" },
{ "S_A", true, enhancement = "m_stone" },
{ "S_A", true, enhancement = "m_stone" },
{ "S_A", true, enhancement = "m_stone" },
},
this will work for all of the enhancements
is it bad for me to copy the code created by the devs and use that to create my joker?
or is that not allowed
thats like 90% of what people do
😢😢😢😢😢😢😢😢😢😢😢
my patch is dying
hey void
localthunk will not sue you for copying the code of Burnt Joker
how is ur patch dying snookums
i used to use arrY index 3 for my letter hand
im gonna start eating ur hands then what can u use huh
okay
I'd rather you use this patch #1347678934678114444 message btw, better mod compatibility
is there a way to make a patch apply conditionally?
i guess ill just freaking dive off a cliff then >:(
nice!!!!
Can someone help me with consumable ideas? I'm running dry of them.
proud of ya
Your patch works fine, it just has some edgecases etc that can easily be worked around 😬
yea, i know i was having issues with crashing with ym custom enhancements unless i added in specifically it
also because I don't want them to fight with steamodded updates if steamodded ever decides to change it
so yours works better
the thing is, i have no clue how to use patches, where do i put them?
within 24 hours, I have bough balatro, got modded, and no creating a mod
now
kinda wild
you should probably play the game first
oh
lol
How would you get a Joker to debuff a random played card, Would I need to make it an event or is there a set.ability() for it
SMODS has a specific debuff function
Cmon guys! I need ideas for my consumables! If this is going to continue the way it is right now, I'm gonna get nowhere!
Id put that in Calculate right?
is there any boilerplate code i can use to replace the Tarot card sheet with another one?
i downloaded a mod, but it didn't come with any scripts
yes! If you want an example, I have some jokers that debuff in Kino
Yes please, Im very much a visual learner
Where did I mess up here
atlas in Joker code
where is the syntax highlighting
Jokers.ping > Jokers.png
hai :D
is that
Are people going to care about everyone else but not me?
key = 'Joker2' > key = 'waffles'
ya! that's it ^^
alot of people here are making their own things, with their own ideas
so your best bet is just to ponder your own notions instead of aiming for people to supply them for you
oh you're missing some other things
nope my mod doesn't show
This one permanently debuffs cards:
https://github.com/icyethics/Kino/blob/main/items/Jokers/aliens.lua
This one debuffs cards until the end of the round:
https://github.com/icyethics/Kino/blob/main/items/Jokers/morbius.lua
ya you need to add some more info
lemme grab an example Joker
darn it, im sorry 😭I tried to get most of it
im watching a video
and they went straight to balatro after this
SMODS.Joker {
key = 'golfball',
loc_txt = {
name = 'Golf Ball',
text = {
"Played {C:attention}Steel{} cards",
"give {C:white,X:mult}X#1#{} Mult",
"when scored"
}
},
config = { extra = { is_contestant = true, given_xmult = 2 } },
rarity = 2,
atlas = 'BFDI',
pos = { x = 7, y = 1 },
cost = 7,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.given_xmult } }
end,
blueprint_compat = true,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and context.other_card.ability.name == 'Steel Card' then
return {
xmult = card.ability.extra.given_xmult,
card = card
}
end
end
}```
so idk
Im not creative and cant make any of my own ideas
||i totally didnt make 3 of the existing ideas||
Perfect ty, Im trying to make one that randomly debuffs a card before scoring so this v helpful
(you can ignore the is_contestant bit, a different Joker uses that)
lemme run through how all this works
config: holds all the variables your Joker is keeping track of [in extra]
very doable! lmk if you run into anything, but I reckon you'll be fine, haha. The wiki utility page also explains the debuff func a bit https://github.com/Steamodded/smods/wiki/Utility
rarity: 1 = common, 2 = uncommon, 3 = rare, 4 = legendary
my only consumables so far are for the custom hands ive made, so i get it
but people are gonna make their own ideas before they give them away so youll just have to think about what youd personally want to see as a consumable and simply go from there
otherwise maybe youll just have the few ones you have now, which isnt necessarily a bad thing
every mod doesnt need a billion of each item after all
Im only gonna make 50, that's small scale right?
atlas: set this to 'Jokers' (though, i don't know if you wanna change it to something else)
depends on the person i suppose, im at a little over 50 jokers and dont know how id make 50 consumables
If you're committing to making 50 of something, and you're not sure what to do after 10, maybe just do 10 😛
pos: the coordinates of your Joker's sprite in your atlas image
starts at (0, 0)
cost: how much does your Joker cost? sell price is set automatically to half, floored
loc_vars: fills in the #1#s and #2#s and etc. with values
the first loc_var will fill in #1#, the second fills in #2#, etc
make sure to add card.ability.extra. to the starts of the variables
okay im doing something wrongggg
blueprint_compat / eternal_compat / perishable_compat: is your Joker compatible with Blueprint, Eternal or Perishable?
calculate: the code for your Joker's ability
hope that helps ^^
okay so big issue, the video I'm watching :https://www.youtube.com/watch?v=Zp-4U5TlbxY&t=7s Is doing a tutorial but the issue is mine doesn't appear in the balatro collection, would this be a coding issue?
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
-----------------------------------------------------...
@manic rune made this which should help you generally https://discord.com/channels/1116389027176787968/1349064230825103441
Ik, he said get look over the code then watch and follow the video
he also says in there that some of the things int he video are outdated, so keep that in mind
ah, you need a JSON file
bruh 😦
but if your stuff isnt appearing in collection, its not registering as existing
?
so yea, a json is needed
lemme grab an example one
okay 1s
you should be able to check steammodded exmaples
and they have a json you can edit
change the info in here accordingly ^^
that works too
do i just put this into the code
at the top or bottom
separate file
k
youll have main.lua and main.json
what does json mean
short for [googling because i don't remember]
javascript object notation i think
ty
wait
"prefix": "bfdi",
"main_file": "BFDI.lua",
"badge_colour": "1C75C3",
"dependencies": [
"Steamodded (>=1.0.0~ALPHA-1225a)"
],
"version": "1.0.0"
}
I'm on this part
would I have to create another lua text file
for the bfdi.lua
no, it is just your main.lua
oh no, you need to change the info in the example i gave to fit your mod
^^
everything ghost gave you should be changed for your mod
ie main.lua instead of bfdi.lua
color doesn't matter ghost so i'm stealing your color
:>
okay i think i changed everything
nah claim it as yours anyway youre the only one to post it in the last 10 minutes...its urs..
😭
remember kids, if nobody else sees it nearby its yours
okay
didn't know dragons could use computers :}
theyre quite smart you know
also, ax my previous question about texture packs, i got it working :>>>
that atlas was definitely not right looking from what i saw
which is ur fave
I messed up somehow 1s
i like the eye and wheel
SMODS.Atlas{
key = 'Jokers',
path = 'Jokers.png',
px = 71,
py = 95
}
SMODS.Joker{
key = 'Waffles',
loc_text = {
name = 'Joker: Waffles',
text = {
'Beyond all the best pancakes, there are even better waffles.',
'create a {C:attention}Joker{}',
'{X:mult,C:white}X#1#{} Mult'
}
},
atlas = 'Jokers',
pos = {x = 0, y = 0}
config = {extra ={
Xmult = 1000000
}
},
loc_vars = function(self,info_queue,center)
return {vars = {center.ability.extraXmult}}
end
}
(textures provided by ReijiAL)
How exactly do I make it so boosters give cards of a certain type?
And where exactly do I put the code to get cards to appear in my custom card area?
numbers 4 and 7 are my goats from the pic
i like em
yaaaa Emperor and Chariot
what type or you wanting it to give? a subset of jokers, or a new a consumeable?
Subset of Jokers for now, but I also plan to add new consumables so both would be helpful
imagine a shader that made the glass shine all nice like...
at least, these make me think of stained glass
oooh yeahhhhhhh
i could give them the Spectral shader?
but i don't know how to code that
you need to create a pool of the subset you're intending, or if it's a specific one, you could do the logic in the create_card functionality of boosters
how would i add the Spectral shader to the Tarots?
Would object_type work as pool?
Okay, what's outdated here?
Nothing
so how did i mess up
You just miss a . in the loc vars return
you need to make an objecttype to make a pool, as far as I know, yeah
Do you have the manifest file?
i don't know much but here are my files
i have one created, but i dont know how to call it in the booster pack
the boosterpack will have a create_card. For example, on my Action pack, which only contains jokers with the action genre, the create_card is just this:
return create_card("Action", G.pack_cards, nil, nil, true, true, nil, nil)
end```
"Action" there is the key to the pool/objecttype
I do this to a custom consumable type in familiars main code, I can't get the code right now though.
What’s inside the json?
Also I think assets needs to be lower case
ok
the code for my Duplicate spades 1/3 times. It crashes on retriggers due to how i have it move one card eachtime its activated and i think thats the reason why it crashes since it goes beyond the played amount. is there some sort of thing for my +1 at the top to not be used when retriggers happen?
(its a slightly modified DNA pretty much)
Why not just use other card as the card you copy?
me?
?
No, does your mod show in the mod menu?
nope
(fixed the _ btw
Something wrong in the json or your mod is nested probably
what does nested mean
Yeah like that but I imagine you still need the other arguments
like it's inside two files when it shouldn't be
Yes, if you screenshot the file path with your mod folder it’d be easy to see
it... its perfect 😭
Oh those aren’t actually lua and json files
FUCK
They’re txt files
dude
i swear to god, i started this an hour or two ago
i download the pplication less than 8 hours ago
i feel so dumb
Tysm! Now I just need to figure out how to get them added to their own space instead of the general Joker space
how do i fix it
do you have extensions enabled?
Prob not
yeah it is
and then you can check "See file extensions"
you'll want to make a cardarea for that, and I think hook the create_card function to check for that type and move them to that specific card area
Also, sorry to pop in but anybody know how I can get my mod to change the sprites in the asset folder while the mod is active?
as in replacing them
oh okay
as in, something happens and then the joker changes its art?
Like a texture pack but only active if the mod is loaded in
What type of file does Lua need to be
I suprise myself with How stupid i am
You're not stupid :<
lots of computer stuff is pretty vague and obtuse if you haven't done it before nw
oh im not confident on texture packs, i couldve assisted if it was just a joker changing itself
my apologies
i def aint smart in computers
I think something's wrong because it's not loading in balatro.
Please help if you can, point out anything I can fix
the JSON file has to have all its items wrapped in curly brackets
{
"a" : "b",
"c" : "d",
}```
does it not have tha?
nope
okat
this is the reference
i added the brackets but the top is still red
you also forgot a closing " near the end
check the line with "version", you're missing- ya that :>
ty
ok
remove dependicies if you don't need any
yay time to test
HERTE WE GO
TEST TIME
its worrks
finally
IM SO HAPPY
IT WORKS
YAY
THANK YOU ALL
<3
Yippe!!! :3
the win button
YES
Hihi :)
Almost done with all the technical stuff of Worlds.
I'm trying to find the function that determines which tag is chosen for when you skip a blind, but I can't seem to find it
Just need to get it in it's card area, then get the actual functionality working
oh wait nvm the moment I post this I realize I can search the code for min_ante
Awww Waffles!!! What a cute little baby
I would give him my pizza crusts
I found somethign interesting, when using watch shader my card looks amazing and I love it. But it looks different when in the game for real. I am not sure how to see what's different here. @rough furnace , have you run into this
you know shaders 😭
what a goat
I can't figure them out for the life of me
I HIUS
I DID IT
I DID THE 1000X MULTI
THE MULTI WORKS
i do have an issue
somehow i always create a normal joker whenever I enter the blind with him
WAIT, I think I actually found out how to do it with the sprites, yippe!! :3
did you use any templates?
it's the context.setting_blind part
remove the blind function
youre creating him in create_card
i think it might be the local new_card = create_card('Joker'
yea
this
okay ty
Guhh, I need to read up on balamod now so I can figure out how injections work q~q
So how would I do the x1000 Mult with the chips in the code
would i copy most of it and just change the Xmult variables?
different function
let me send something rq
k
Do you all know how I would go about putting cards in my custom card area? I tried SMODS.add_cards but it didn't work
this part I think
okay i will try thank you
you have to hook the emplace function
lemme get mine as an example
Ty!!!
local emplace_ref = CardArea.emplace
function CardArea:emplace(card, location, stay_flipped)
if self == G.consumeables and card.ability.set == "Weapon" then
G.weapons:emplace(card, location, stay_flipped)
return
end
if self == G.consumeables and card.ability.set == "Debuff" then
G.debuffs:emplace(card, location, stay_flipped)
card.T.w = card.T.w * 0.5
card.T.h = card.T.h * 0.5
return
end
emplace_ref(self, card, location, stay_flipped)
end
ty! then what do i do?
that should be it, actually
it depends on what type of cards you're making (consumables, jokers, etc)
return { vars = { card.ability.extra.chips, (G.GAME.probabilities.normal or 1), card.ability.extra.odds } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
return {
chip_mod = card.ability.extra.chips,
message = localize { type = 'variable', key = 'a_chips', vars = { card.ability.extra.chips } },
colour = G.C.CHIPS
}
end
if context.cardarea == G.jokers and context.before and not context.blueprint then
local _count = 0
for i = 1, #G.play.cards do
if pseudorandom('Freddy') < G.GAME.probabilities.normal / card.ability.extra.odds then
_count = _count + 1
G.play.cards[i]:set_debuff(true)
return {
message = 'Debuffed',
colour = G.C.MULT,
card = context.other_card
}
end
end
end
end
}
@hushed field I got this but it keeps debuffing first card with oops all 6s, and only debuffs one card, I want it to have a chance to debuff each card but im having a hard time getting that to work
where do i put it in the code? do i put it in my card area?
you should put it in a file separate from everywhere else, ideally
like I have mine in a file called mechanics/weaponslot.lua and I load it with assert(SMODS.load_file("...")) in my mod's main.lua
it can only ever debuff one card, because the function stops the moment it hits the return statement! But you could just debuff in the individual context, no?
Where would I put the value for chip gain?
I swapped it to individual but it js stopped working
I'd assume it may be because you were running into your return statement!
okay but i dont see how it makes the card go in the custom area, then.
like
you don't understand how it works?
So if I just delete the return It should run for each card with Individual right?
wait no nvm. i get it now.
nice
Stick with before but change your return into SMODS.calculate_effect
eremel to the rescue
Delete all that crap in the return and just put chips = card.ability.extra.chips
lmao 1s
also you defined two calculate functions?
And that
nope
well you did
It just crashed 😭
back again
Sorry for not being able to help 😭 No idea how this works myself...
delete both of thos okay
nono
and just add the if context?
just delete one
okay 1s
good point
I'm just testing Chip and Mult in one card
mult worked
and now im testing chip and mult
all you have to do is add chips = to the stuff you're returning
. . .
so like
return {
chips = 10,
xmult = 10
}```
bruhhh
God I feel like such an idiot, I'm sorry waffles
Dude.
I started this 8 hours ago.
I have no background in tech, there are no stupid questions, only stupid answers.
Just read the page you were linked if you are interested in calculations
I did but the way they did was right, but hte issue is that the way raevyn showed me isn't on my prompt
Because would be reffering to under the Xmult?
Then you didn’t read the page you were linked
here's the part, for reference
i did read it, thats where i got the other script, I am just confused because I don't know where to properly merge the calculate and atlas function
That screenshot isn’t how you should do it and hasn’t been for over two months
Got it working!! Thanks Ice and Eremel v much
1s
what would i do if it's a joker?
just change the part that says G.consumeables to G.jokers
hmm okay. is card.ability.set where i put the category for it?
I want to make it where there is a chip addition anda base multi, how do I do that side by side? Would I just define the functions as
'{X:mult,C:white}X#1#{} Mult', '{X:Chips,C:white}X#1#{} Chips'
Sorry to ask, but anybody know if ingame injections are possible in SMODS like in balamod?
maybe? I don't know if jokers have different sets like consumables do
you don't need multiple quotation marks. The brackets just delineate colour, and the text that appears is delineated by the # markers.
not as far as I'm aware, and replacing the joker set definitely breaks their joker functionality
That's what Lovely patches are for
you simply must be joking

but it's not difficult to add a subcategory to a joker. I've got a bunch that just have 'is_vampire = true' or 'is_batman = true', as well as a 'genres = {}' list, and that all works pretty well. Just have the function you want to interact with your custom joker subset look for that variable
Oh, sorry. Thank you alot though!! <3
Don't jokers have compatibility with SMODS.ObjectType, though?
they do
john smods here to save the day
how do you center something like half joker? like im pretty sure it's not supposed to be up there
half joker for reference
check the x and y position and try changing it too 0.25 or 0.5
y would mess with the up and down alignment
I think you can use pixel_size for that
I would not do this
Yes, they do! But I don't think you can just replace the set = 'joker' thing they have going on 🤔
okay
Yeah, so. How would I go about checking what object type it belongs to then?
off to look at pixel_size documentation then
you could probably check something else
For the both if context functions, would i do end, or keep it at },?
like maybe you could add something in your effects table to denote those certain jokers
you need to combine it into one returned table
can you explain a bit more?
unless these shouldn't be using the same context, unlike they currently do
well tldr: i want a 1k chip multi and 1k multi to work on the same joker.
return {
chips = card.ability.extra.chips,
xmult = card.ability.extra.Xmult,
}
put that in one if block and get rid of the other
k
card.config.center.[YOUR_CUSTOM_MARKER] == true is what I do to check if jokers are of the batman, vampire or alien abduction subset
I want to destroy some cards
and I know the {remove = true} thing works in a few contexts, but does it work in all of them?
I've been haunted by ghost cards in the past
pun not intended
object types don't have a way to check if a card belongs to it in constant time. If that's all you need to do, markers on centers are perfectly reasonable
hello aure how is it going
object types are most useful when you need a way to generate a random card of a type
it only works in context.destroy_card
doesn't it work in discard too?
To make the chips a valid currency would i just copy or add to the atlas function?
right
but it doesn't automatically work in any context
Okay. Got it working, but now the card doesn't show up in the custom area for it
fair enough
so how do you remove cards outside of that?
As in, it's there but it's not visually there
Ideally you don't, as it causes ghost cards
😒
fair
at least if it's during scoring
is it possible make a seal trigger a function when the card is being destroyed? i want to make it create 2 copies of the card
Yes
How would I add chips as a valid recognized currency
it'll be added already but I don't know how to make it display on the card, on top of the mult
put chips in loc vars
as another return function? or just another vars function
I’d recommend going and looking at some well written mods, it seems like you have no idea at all what you’re doing
a function can only return once, so you never want to have multiple return functions that you want to all return their information
Just to get an idea of what the code is supposed to look like
OHHH 10000% but after I do this last thing im done
btw, Eremel, do I remember correctly that someone was working on additional boss blind features for SMODS? or did I hallucinate
Yeah aure is doing calculation stuff
ah, great. Guess I'll not start work on boss blind stuff then
I have custom small and big blinds code in the ortalab private build right now that might be suitable to merge across too
hooray
how should one shuffle cards only when a joker is moved
nvm i figured something out
actually
Call the shuffle function
That's so cool actually
i don't wanna shuffle every frame so i guess ill hook it to the card
You can probably look at the stuff that controls moving the card and detects mouse clicks
That sounds like the one
read "shuffle every frame" and had flashbacks to beta Thought
😭
moved generally, or moved to a specific position?
aaah okay
what are you cooking up? 👀
sorry but how would i go about doing it? ive just looked through the list of calculate function contexts and i dont think i can see one for a card being *destroyed
eyy
context.pre_discard and context.discard!
sorry i meant destroyed not discarded, just realised 😅
context.destroying_card if your aim is to mark a card for destruction. context.remove_playing_cards is you're wanting to do something whenever a card is destroyed
awesome, thx
is this the best way to check if another mod is loaded? was previously doing SMODS.Mods['Cryptid'] but that doesnt work correctly i think
yup!
alright cool
Heya, how can I check if a played hand is a club? I have been checking the forms but im struggling to find the way to checkkkk
if the deck has no valid cards to draw anymore, is context.hand_drawn still entered?
probably not
I mean, if you don't have any more cards to draw you either win the blind or lose the run at that point
anyone know why this code wouldn't be working? it used to work but it was broken by recent smods update. Should be adding +1 pack choice to tarot and planet packs.
if context.open_booster then
if G.GAME.pack_choices and (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.PLANET_PACK) then
G.GAME.pack_choices = G.GAME.pack_choices + 1
end
end
I can't really find anything relating to adding mult and chips functions together
(posting the image bc its wrong thats why)
my mod adds some negative modifiers, so discarding even if it doesn't draw you cards can definitely happen. I'm also just wanting to be sure with blinds like The Hook, and just general future proofing
https://github.com/Steamodded/examples/blob/master/Mods/ExampleJokersMod/ModdedVanilla.lua check line 310
well check around line 310 anyways
I see
k
well I think that context only triggers when there are cards actually being drawn
another logic rewrite
hmm, I guess I could change up my logic and not check the hand consistently, but instead check the cards drawn or discarded
no wait, that'd not allow for death
Oh yeah, I never said huh.
Lucky Number Slevin
Increase odds by 1 for each 7 you are holding in hand
i am wonderinf why this isnt returning a flush six, which i have defined presumably correctly (searching for a six long flush and six cards of the same rank)
any thoughts?
oh I see
and you want a context to check whether there are more sevens or not
makes sense
yes. I'd do it generally, but I'm not sure how I'd go about cleanly changing the odds when there are other odds-altering jokers in play
whats really weird is that every hand before this has worked just fine
I'm not too sure either
The odds system wasn't made to be messed with too much, haha. I might put this one on hold again
I'm at the part of my design doc where every joker is either a conceptual misfire or a programming challenge, so I'm just trying whatever, haha
I've given up on the Tenet joker too, at this point, too much of a nightmare to figure out how I'd do that intended effect
same 😭
it's mainly my lack of shader experience holding me back rn
i need a talented and clever person to make an extension that allows me to just make a shader in unity and port it to balatro with no changes to the code because shaders are wizardry to me
I'm trying to make a custom enhancement and I thought I could use replace_base_card since the documentation says it won't draw the base card sprite or give base chips, but it seems like it straight up prevents it from scoring at all even if the enchancement gives bonus or mult
does card:set_ability trigger the remove_from_deck context?
wdym wizardry
edition badge
aiko I think you are officially The Wizard
you don't count
no i am not

no
you do like
everything 😭
😭 no???
im having 2 problems, firstly the game crashes and then also, the values appear as NIL in the discription :> sorry if its a simple problem and im dumb
im trying to make a test enhancement but the atlas is not rendering my own texture pack
context.other_card({ suit = 'Clubs' }) isn't a function?
you misspelled atlas
How is context.check_enhancement supposed to work? This doesn't seem to do anything. ```lua
if context.check_enhancement then
local key = context.other_card.config.center.key
if key == "m_steel" or key == "m_gold" then
return {
m_steel = true,
m_gold = true
}
end
end
you got to it first
my god 😭
is there a place where can i check these functions? i just want to check if current hand is clubs
if not then, it wont trigger
other_card is table 😭
ah boloks
we are a little silly
?
are you using quantum enhancements?
idk what those are
I'm not entirely sure, but I think that context is limited to the optional quantum enhancement feature
what are you trying to do with that code?
I see
I wanna make it treat gold cards and steel cards the same, and give the bonus for both
I think I could ofc just give $3 when it's steel and X1.5 when it's gold but that seems a bit jank
and Jokers like the Steel Joker wouldn't work on gold cards in that instance
Firgured out the currency issue but its not display properly
The mult is display while the chips is not.
you forgot a } after {C:chips
TY
In this case you could definitely do SMODS.has_enhancement(TARGET, ENHANCEMENT) in context.individual for and return on the joker. If you have more effect Ideas that are like that, and are comfortable in reading code, maybe check the optional quantum enhancement feature, though, because that does that in a bunch of different moments
I'd put those chips on the same line as the mult
I'm not sure what you mean by that, could you elaborate?
I can read code as I've been programming for 5 years, but I'm not that familiar with Balatro modding yet
I think I might need to do patches or something like that for this feature, as a lot of Balatro code seems to just check stuff directly
Your code will work fine if you enable the quantum enhancements optional feature
I'll check that out then
Hellor so Ive looked through the documentation on SMODS.DrawStep and searched the channel and still havent found how to draw a texture with SMODS.DrawStep? Im trying to draw a texture on a card when it has an edition instead of a shader, and was thinking I can use SMODS.DrawStep somehow to do that.
how do I enable this feature?
oh wait sorry that was ur message
I didn't read
is there a context for a hand leveling up?
how do i have an effect trigger on discard?
context.discard if it needs to execute when a card is discarded, context.pre_discard if just when a discard is used
just in case it got lost in the abyss of discord message requests, i shot you a dm @hushed field regarding your 7s
I have so many ideas
https://github.com/Steamodded/smods/blob/main/lsp_def/utils.lua I think it would be in here?
is it not cardareas?
It could be
it is
I will update this then
context.using_consumable and checking that a planet is being used would technically work, but it wouldn't apply for The Arm and Space Joker, for example
I don’t think I added a level up context yet
thank you!
just tested and for some reason, my calculate function isnt working?
the card transformation is supposed to trigger after i discard a card
calculate = function(self, card, context)
if context.pre_discard and to_big(card.ability.extra.discard_size) > to_big(1) and to_big(card.ability.extra.hand_size) > to_big(1) then
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"])
play_sound("card1")
card:juice_up(0.3, 0.3)
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
end
end
}
LET'S GO

priorities are now respected
how do you feel
feel smart actually
heck yeah
is it easy to create a custom poker hand
hm...
though this is for spectrum five
which is an extention of spectrum
ooo wow
is there a fast way to reboot to game with debugger because i cant be bothered to open and close the game to test stuff out
Ⓜ️
thank you
Might need to hold it for a second
gonna try it again with context.discard
yes yes it worked
Might there be a fashion by which I can add a "joker" but just the atlas and atlas position part, so I can reference it in the func(card) part of DrawStep?
trying to use this to draw a texture using an edition, I might be stupid but oh well
Hey, how can I make context.destroy_card trigger on held in hand cards? I'm trying to write a Seal with retriggers that may destroy on use, including when it is held in hand, but using destroy_card only seems to work when card is played
have you tried full_hand
context.destroy_card and context.cardarea == G.hand
what are some mods with a good range of content that i can look through the code of to see how things are done? trying to see how to make a tarot card add a seal
oh yeah the seal example has one lol
but for general use with other functions, are there any good mods for learning from the code of?
i don’t know any off the top of my head
i know looking at base game is good for some things
despite the
coding
toma
mb, i was using destroying_card
thought so
that negative looks super cursed
ikr
calculate = function(self, card, context)
if context.pre_discard and context.cardarea == G.play then
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:set_ability(G.P_CENTERS["j_hpfx_ijiraq"])
play_sound("card1")
card:juice_up(0.3, 0.3)
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.15,
func = function()
card:flip()
return true
end,
}))
end
end
}
updated with the discard stuff, still doesnt work
anyone have any ideas
(the Event Manager sequence is for the transformation)
does it work though 😈
fuck...
Need help from someone with a little more SMODS knowledge. I added this context eval in G.FUNCS.evaluate_roundin order to trigger vouchers at the end of a round, similar to how anaglyph adds a Double Tag at end of round
sendDebugMessage('calling for vouchers')
local eval, post = eval_card(G.vouchers.cards[i], {cardarea = G.vouchers, end_of_round = true})
SMODS.trigger_effects({eval, post}, G.vouchers.cards[i])
end```
Similarly, I've added this little hook for eval_card to call a calculate_voucher function, which is just basically the same as most of the other calculate functions (I.E. looks for a calculate function on the object and returns if it has one)
```local ref_eval_card = eval_card
function eval_card(card, context)
local ret, post_trig = ref_eval_card(card, context)
if card.ability.set == 'Voucher' then
local voucher = card:calculate_voucher(context)
if voucher then
ret.voucher = voucher
end
end
return ret, post_trig
end```
And it all works, except... for some reason the code to add the tag is called twice?
of course, i only have to do the main puyo chain and puyo rainbow hands
because i can just call them in parts
yes
Oh I see now how it could be annoying

But a four of a kind aces right off the bat seems kinda good
it just gives priority to certain cards when shuffling
yeah but how
oh btw it also works in this screen
so close to straight flush 💔
Easy, just make a joker that can only draw straight flushes then you'll get it :)
hec
is that an eiditon
if only i have any idea for modded edition
that doesnt get a "that's just cryptid x bro"
Everything is cryptid
Just do it anyway
of course, if i want all these to actually work, i'm gonna have to do the parts
i wanna make a joker idea real
but that would involves doing fucky things with every hand detection
and that is like way outside my modding grade
well we all start somewhere ig
what are we thinking
i want to go bigger than where i am but also i am kinda hinged on not going too big
with like the entire premise of my mod
oh the end button
is tht from this mod or some other one
NotJustYet
thanks
also yeah that's nice
is it just always those four specific traits
or does it choose a random 4 out of a bigger pool
mm
I'm not sure why my card is vanishing tbh
straight rainbow is an oxymoron
Wher eis my card area?
got home and that ping had me excited
curse you
but also yay it works
okay chat im gonna ask
wdym excited
hypothetically
been tryingg to get an answer on this discard trigger
if i want to implement a Wild Rank card, what would be the best angle
like do i hook the vanilla hand code
I got distracted,
now comes the part where i actually have to impliment the hands
or do i just add dupe hands that account for a Wild Rank and make it so they dont show up on the hand listing
holy ui
SMODS.PokerHandPart
card area defaults to being a deck btw
have you tried
this should be easy, right?
adding the card to the card area
'the card'? Do you mean a card?
This is giving me a headache, I genuinely don't know why this code is running twice 😭
what is running twice
a card
Trying to make a voucher give a negative tag at the end of the round. For some reason it calls the calculate function with this specific context twice... for reasons completely beyond me
I can do that in my tab definition function right?
context.end_of_round and context.main_eval
As in, add main_eval to the context when it's sent, or just check for it?
This is the setup I have right now
oh i did not see that
you don't need to do that
steamodded already calculates vouchers
Which part is not needed?
the part where you add a context
Hm
you can just use what steamodded provides
i know that it accounts for wild cards
Well, I don't know how I missed that it says it supports a calculate function in the docs, I was looking through something and thought it wasn't a default behavior
which is probably what both of my hands should do too
Does anyone know why my card is disappearing when it's added to my custom card area
Yeah
i could reasonably just take this and modify it to my liking
what's your context check looking like
i think you're meant to put the calculate function in the voucher code
if context.cardarea == G.vouchers and context.end_of_round then
that's... not what i said
Then can you clarify?
.
right now this is just using the spectrum code
i need to account for the puyo suits
it's 3am
it’s actually 4 pm
aure have you taken the driving exam yet or I'm misremembering
puyo chain needs to account for the same puyo suit and puyo rainbow needs to account for five different puyo suits
You send that when I was still under the impression that I needed to add the context myself, and I never sent main_eval with my own context. You need to clarify if and how you want me to use something rather than just expect me to interpet it. Do the voucher contexts not send in the voucher area in context.cardarea?
no i did. i failed smh, will get to try again in 2 weeks
nah, but i wasn't having a great day
Hm. Still not receiving any response on this calculate function, regardless of any checks. Weird
sometimes features are missing on old steamodded version
Might be because I just loaded the game at end of round
I know in my area it's a max of 3x a year
I think SMODS.calculate_context always sends G.jokers for those areas, not sure why though
Yep, there it is. Cool
Strange. If it doesn't break anything I don't exactly mind
For my part, when I sent that I was not aware that you were trying to add your own context
That's fair. Now I just have to figure out timing. No idea if this is the exact same timing as anaglyph would have
Ideally? It adds after the anaglyph double
how am i meant to account for all 12 different puyo suits
that happens as you enter the cash out screen, so end of round effects happen earlier
because the two puyo related hands need to work with all of them at once
no matter the rarity
are they supposed to do anything special that other suits don't?
there's currently no context that does this, but i could see it being added
So am I actually going to have to manually add the context again?
no i just want to have unique puyo related hands
which now that i'm thinking about it
why AM i making unique hands specifically for the puyo suits?
wait so does it need to consist of only the puyo suits?
yeah
do your puyo cards pop if you play the same suits together
there is a joker that will do that
you'd want to add a condition to this line then
Okay yep, it works. I think the double issue before was simply me adding the calculate_voucher function for lack of being able to find an equvalent in code
But the actual eval_card() I sent was fine, I just changed it to cash_out
like if (SMODS.Suits[v].mod or {}).id == 'your_mod_id' then suits[v] = 0 end or checking for some flag you add on the suit objects
"if you play 4 of the same puyo cards destroy them and add 2 random puyo playing cards to your deck"
i would specifically add two nuisance puyo suit cards
i mean you're not playing against anyone
it's the thought that counts
but yeah
i think 2 of random coloured puyo and 2 garbage suit
idk how useful that will be but
yeah
i would probably want to exclude rare suits from being chosen
i mean sure yeah
rare suits being chu, teal, sun, iron, big, and bomb
the suit jokers for them give +3 more mult for those suits than the common ones
anyone know where in the base game code the chips for a playing card are added to the score? I'm trying to find where to hook
My bios is corrupt 🤣
what did balatro do to your bios
idk, probably not balatro
Chain
if you draw 4 cards with the same coloured puyo suit discard all of those 5 cards then add 2 garbage suit to your deck and draw it to hand. number increases by 2 the more sets of 4 cars you draw
idk what I'm cooking
where would i put that
oops i never replied to this. technically yes, though the theoretical exam is only valid for a year
What do you exactly mean by this?
in place of the line i put a red box around
Chain
When 4 or more cards of a Puyo suit are played, destroy them and add two random Common Puyo suit cards, and two Nuisance Puyo suit cards to your deck.
do they call the garbage nuisance
i've heard either garbage puyo or nuisance puyo be used
i call it garbage
i call them nuisance puyos beacuse of the nuisance queue
actually i think i should move this to puyo rainbow's code since that is for five different puyo types and not five of the same type
I'm still trying to figure out why my card has the invisible gene
obviously replace your_mod_id with your mod id 😭
wdym by puyo having balatro
so this should work as intended
-# (Bump)
you need to use the room thing I don't know what it says but like
so if i do this
if you said it to that it will just show up some way you don't expect
HELLO
Room thing?
does anyone know what might be causing this code to turn my cards invisible?
When i place the card? Or like in the card area?
Carfi_Worlds isn't a valid Cardarea type if you haven't added it
I regularly get these two errors when I reload games while doing mod troubleshooting, but they don't seem to cause anything bad to happen?
when you create the card area
is there a way i can check when a booster pack is finished and not skipped?
these are vanilla logs
they don't do jack shit
Oh. I don't know what card area types are. I thought it meant like. Sets or object types
it doesn't work?
feel free to look in the game's source code
Good to know
