#💻・modding-dev
1 messages · Page 115 of 1
I think so too since I believe that's a 0.9.8 only thing
For context, I was hoping to just fix the one "file not found" error on this mod that Myst made ages ago, but it's clearly escalated past this
:(
ah
I just want my little guy.
does anyone know why delay only delays the card_eval and not the loop? it keeps removing the debuffs instantly
delay is just telling the code to breathe for that many seconds, right?
the delay is outside the loop, as well
its before the loop
bump
yes, there is c.debuff = false which should remove the debuffs from the cards
and I want that to be timed correctly instead it happens instantly after playing the hand
(im in context.before)
hmm
juice_up uses events with is all delay respects
look
so you'd want to put the card_eval_status_text into an event
ohh I see. makes sense
but the card_eval is already being delayed
you meant to say I should put the for in an event?
punched the entire hand into restoration lol
I made it rare and it happens every 8th played card 
lollol
it partially works, but the game doesnt register the cards being restored
well now it's in an event it happens after the score calc
even tho im in context.before?
yes
how would I fix that
do it not in an event
how would I fix this (cards being buffed instantly)
you might need to do some patch magic to keep the visual effects
I guess I'll keep it like this, kinda wanted the Joker and the cards to react at the same time tho
I saw a jester character on Twitter so I drew fanart and modded the character into the game
what context would i need if i wanted to make a joker do something, when a card is destroyed? is it context.remove_playing_cards or something?
Yes
theres also context.cards_destroyed if you count glass shattering
it's also context.remove_playing_cards
context.cards_destroyed register information about the destroyed cards
proud of this joker i made, thoughts? counterpart to Oops, all 8s
1/8 for wheel of fortune lol
all 8s
yet another thing i accidentally made a counterpart for from ortalab
helpful for banana and glass card ig
-# and the mult
hope my accidental iteration seems okay 😅
i might make it X2 ... very common to have builds that have very few things involving probability i feel (or builds that have glass and not much else)
no idea though
i feel like x2.5, maybe? it is a rare after all
make more inverted Jokers that don't want to proc
I just don't think it's a very interesting design space - it leads to descriptions being unnecessarily convoluted and also it scales much quicker than oa6s
novel idea for probability affecting joker: 1 in 4 becomes 3 in 4
how so
say you want an effect to happen 1 in 10, to encourage usage of oops all 1s you set it as 9 in 10 to not happen.
With oa6s, 1 in 10 becomes 2 in 10
With wa1s, 9 in 10 becomes 9 in 20
definitely convulted
How do I make a joker do this effect? (You get 2 Mult for every face card played, you lose 2 random cards from your hand after a hand is played)
does that mean that every probability becomes a little over 50%?
like cavendish would be 1001 in 2000 to get destroyed?
if cavendish was 1999/2000 to not destroy yeah
while it'd be really hard to program i think a more interesting probability-affecting joker would be to make listed-probability events occur at predictable intervals
i.e. wheel of fortune triggers on the 4th, 8th, etc. uses, gros michel is destroyed after exactly 6 rounds, etc etc
absolute pain in the arse to program and has zero compatability with modded items
yeah that is the problem
you wouldn't be able to make it compatible w/ other mods at all most likely
for a counter to work, pseudorandom would need to know exactly what the probability was beforehand
rather than just generate a random number between 0 and 1
could make it always return 1 every x times
...well maybe you could assume that the random seeds always use the same key as the jokers, have pseudorandom always search for a joker w/ the same key as the seed, and if one is found look for its odds variable in ability.extra
but that would literally never work
altho pseudorandom is used in a lot of places like deciding the joker rarity in the shop
yeah
so it would guarantee a rare in that case
also it only takes 1 mod to use <0.25 as success for the joker to fail
yeah too complicated
i.e. when pseudorandom gets the seed wheel_of_fortune, it
- looks for centers w/ keys containing the text
wheel_of_fortune, see that Wheel of Fortune'sextrais set to 4 - it stores the seed
wheel_of_fortunein some table and sets a counter associated w/ the seed to 0 - each subsequent time the
wheel_of_fortuneseed is used, the counter is increased by 1 and pseudorandom returns the counter divided by the odds
and it would do Not This when the seed doesn't match any centers
but yeah, this wouldn't work
for many reasons
this would probably be hard to program & make compatible w/ mods as well... can't just change G.GAME.probabilities.normal like oops does
the seed gets put through pseudoseed, so you'd need some way to reverse that to get the wheel_of_fortune seed at all
oh right!!
i mean there is an easy workaround which is just to make pseudoseed return two values and make pseudorandom take another argument
wait nvm the pseudorandom call doesn't get pseudoseeded there even though it can
i was looking at it selecting the card
however these are the same seed
i guess if it uses the same seed for selecting the card then the idea's doomed from the start lmao
next imma make a joker that creates a secondary copy of the joker to the left of it (basically way better blueprint despite the fact that blueprint is already op)
💀
in which context
are you talking to me
ok
itd prob be blind selected, joker_main could be a bit op
what do you think
i think it'd be a bit op no matter what the context was ...
certainly strong, could permanently -1 Joker slot as a side effect maybe
yea
something weird i've noticed while working on a joker, for some reason while using those contexts, the addition to chips is unsynced with the number on the joker description?
maybe thats due to the nature of the contexts
-# and/or im using it wrong
alright, so, i want to make a custom challenge
what's the best way to do it? i already know lua very well
which version is better?
guess what we have docs for that
i looked at that, that doesn't really explain much
or at least how to set up a skeleton for a Steamodded project
prob a separate page
helpful resource for actually defining the challenge proper, but this is my first time looking into modding this game, so i'm unfamiliar with how to set up a Steamodded project
are there docs for if you want to change the name of the suits?
its very easy actually
additionally my ideas do involve modifying vanilla game behaviour
-# to set it up
("Only Boss Blinds appear", "Hands do not regenerate after completing a Blind")
oh, that's nice and simple. neat
yea theres two different ways, header (i use it but its outdated so explodes) or just some json stuff or whatever
you'd probably have to look into patching the game's code with lovely for that, though I think both of these have been done before
2nd one, the less wording the better
i mean they also function differently
but i think i prefer the second one too because it's less rng and easier to understand
imma try to get creative (atleast more than i did with joker lottery) with this one's art
Doubled Joker!
-# do not mind the stripes being broken
boss rush? 👀
i love making jokers with inconsistent fonts
-# (very cool)
If you want to lean into Balatro's artstyle and palette more, don't use black that dark, the darkest "black" that localthunk uses is the dark outline around that joker
that black is lighter than the green lol
Okay odd question: I only want a specific rank/suit combination to spawn with a custom suit and custom rank.
Example: I want a Bishop of Stars to be able to spawn, but no other bishops and no other stars, any way I can do that?
yes! except i was going to call it "Full Skip"
"Only Boss Blinds appear / At the start of the game, and after completing a Blind, earn 2 random Tags"
i also want to make one named "Down in Ten"
10 hands, 4 discards / "Hands do not regenerate after completing a Blind"
(discards do regen as usual)
small reminder, for everyone who wants their mods listed on the Balatro Mod Manager:
https://github.com/skyline69/balatro-mod-index
What happened here? How do I fix it?
how do you want me to approach my PR haha
how do i remove a joker slot btw
Look at what I commented
mf you closed the PR
Does anyone happen to know where in the code the check for number of highlighted cards against a consumeable's limit happens?
do you want me to make a new one?
Shii. Can you just push a jpeg instead of a png
For the thumbnail yeah
alright I'll get a new PR
it's a bit of a mess ngl haha
can more than one category be selected?
Is there a min/max size for the .jpg?
Best I can get for Flower Pot was the tag in the post, which ig can be upsized
for meta.json? cuz I have the same question actually
I'd like to have both Content and Api
presumably in Card:can_use_consumeable
i suggested that earlier but i think it was missed
Does granting money work differently in Enhancements compared to Jokers?
calc_dollar_bonus = function(self, card)
local bonus = card.ability.extra.p_dollars
if bonus > 0 then return bonus end
end
This was from an example Joker so I modified it to p_dollars according to the wiki's config values, but I guess there's something missing
enhancements don't have a calc_dollar_bonus
What should I use instead?
whats the effect?
To put it simply it grants money when shattered
use ease_dollars where you're destroying it
add_joker or SMODS.create_card with the set being Joker
How do I specify the joker to create?
wouldn't that just pull a random one from the joker pool?
with add_joker its like
add_joker(--[[ joker name ]])
Does anyone have a list of al the contexts and functions for joker effects?
create_card does if not given a specific card to create
heres a docs for create_card
as for add_joker, it isnt in SMODS docs (cuz it comes from lovely)
ah yes
Alright
imma change mine to that too bc it emplaces and adds to deck itself anyways so
Do lovely patches not work on localization files?
no
Huh. That explains a few things
Since that's the case, I need to change the descriptions of some vanilla cards. How should I do that? Ideally I don't take over the cards so they don't appear as part of the mod
interesting scenario, why are you changing the description but don't want to take ownership?
you can create your own en-usand that should overwrite the base game stuff
take_ownership has a silent parameter
where it won't put your mod badge on it
That's probably my solution, thank you
Also to answer this, I'm not changing the base function of the cards, but I have some mechanics that modify how they work (for example, variable number of random discards on Familiar use based on a changing value)
is there some way to cheat in a joker i made? trying to follow the example mod for jokers but how do i get them in game, surely not play until rng. and the collection wont even show them as they arent discovered yet
Get this mod https://github.com/WilsontheWolf/DebugPlus
thanks
np
what are the commands tho?
thanks 🙂
hey how do i make a number in the text of a joker orange like they do with Juggler
{C:attention}
ok thx
when you want the text to go back to normal do {}
doubled joker and joker lottery work well together
like you can just create a random joker without losing any lol
would this work
you forgot the config in the last reference
ok
yes it is G.jokers.config.card_limit
ok thx!
i don't know if directly changing the value is the safest/recommended way?
if you run into issues, there's probably a better way to do it
wish there were documentation on making a custom collection area
have this but i don't have the actual ui popup since i got the base code from here #1279246553931976714 message
you should probably just copy the entire source for that from either ortalab or cardsleeves at that point
oop looks like ortalab doesn't have that source code publicly available
in this case
calculate = function(self, card, context)
local left_card
if context.joker_main then
for i = #G.jokers.cards, 1, -1 do
if G.jokers.cards[i] == card then
local left_index = i - 1
if left_index > 0 and G.jokers.cards[left_index] then
left_card = G.jokers.cards[left_index]
end
end
end
end
if left_card ~= nil then
print(left_card)
SMODS.add_card({
set = 'Joker',
area = G.jokers,
key = left_card.k
})
if G.jokers.config.card_limit > 1 then
if card.ability.extra.slot_removed == false then
G.jokers.config.card_limit = G.jokers.config.card_limit - 1
card.ability.extra.slot_removed = true
end
end
end
end
how would i get left_card's key
wouldn't left_card.key work on modded jokers?
though I don't think vanilla jokers have them
There’s generic collection stuff built into smods now
hm
then how would i get a key
bc add_card requires a key
maybe label would work
ill try it
forced_key?
oh right, SMODS.card_collection_UIBox
looking at cardsleeves and its confusing me lol
can you please help me understand whats going on here?
the code of my joker:
calculate = function(self, card, context)
local left_card
if context.joker_main then
for i = #G.jokers.cards, 1, -1 do
if G.jokers.cards[i] == card then
local left_index = i - 1
if left_index > 0 and G.jokers.cards[left_index] then
left_card = G.jokers.cards[left_index]
end
end
end
end
if left_card ~= nil then
print(left_card.label)
SMODS.add_card({
set = 'Joker',
area = G.jokers,
key = left_card.label
})
if G.jokers.config.card_limit > 1 then
if card.ability.extra.slot_removed == false then
G.jokers.config.card_limit = G.jokers.config.card_limit - 1
card.ability.extra.slot_removed = true
end
end
end
end
I'm having the same problem, I'm not sure what's going on
Whenever I try to create a card it throws that error
Yeah, looks like it throws the error when I try to use the key to one of the jokers in my mod
huh
shouldn't you just be writing key = left_card.key
fsr key just doesnt exist
or smth bc when i do it, it still spits out a random joker instead of the same one
maybe just try the vanilla method for creating a card
both are a thing
never heard of it until today
add_card emplaces the card and also applies add_to_deck
thats an option but add_card is basically the same thing but it auto emplaces and adds to deck
imma try add_joker and see if i have any luck
Yeah it's a lot haha. You might be able to use #💻・modding-dev message though?
No clue, I've never used it 😅
ui confuses me which is why i haven't touched it 😭
another call for the same crash
got this on boot after updating steamodded
updated lovely and crash is still here so i'm stuck
wait that's just an entire mod's code in there huh
I really don't understand anything about crash logs beyond the first 5 lines
that mod isnt compat with that version maybe?
V is a function standing for version, so the mod likely has one that Steamodded doesn’t like
oh my god it fucking works
what
I gotta read the rest of the crash log more often
gonna go report this in that mod's thread like a sane person
so wgat was the problem?
someone else already reported it
the problem is indeed that mod's version being a bitch yeah
ah ok
removed the mod and that solved it
it's not a mod i was particularly fond of anyway so not really a big loss
now I can finally test the lovely patch i wrote like 6 hours ago
are lovely patches made inside of lovely or are they injected into lovely or smth
how do you include those in mods?
idrk how all this stuff works lol
you make a file called lovely.toml and it goes in your mod folder
Apparently using card:shatter() can create ghost cards, any way to fix this? In my code I'm just calling that function straight to destroy my custom Enhancement card
this happens when you do it outside context.destroying_card
iirc
if context.cardarea == G.play and not context.repetition then
if math.random() < 0.25 then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
card_eval_status_text(card, 'extra', nil, nil, nil, {
message = "Shattered!",
sound = "fm_shatter",
colour = G.C.MONEY
})
ease_dollars(card.ability.extra.money, true)
card:shatter()
return true
end
}))
end
end
Hmmm I see
and then it's really easy
Do I just add context.destroying_card inside the if case?
and these patches do what? change game functions?
I have no idea I don't destroy cards yet
inject code into balatro
for an example
splash's effect is hard coded
the game checks if you have the splash joker and then executes the effect
you can't really replicate that in the calculate function of another joker without crashing (someone will now proceed to correct me on this) but you can lovely patch it
isnt that kinda what the mod itself does or am i missing smth
adding code to that area that checks for splash or other jokers
well, yes and no
mods add new self-contained code
a lovely patch lets you put code in really specific places that you really need it to be in
like in a function the game only runs one time
ah ok
so like if you wanted to add something to a game function
well no
in that case, you'd hook the function
basically you make the game run your version of the function, which contains an extra bit of code
and then run the actual function inside that so nothing breaks
but that only works on functions that are run a lot
im stumped
maybe its left_card.key?
that's what I said
yes
ok
i don't know if it'll be a table or not, tprint is a built-in balatro function that prints tables
lua doesn't like it when you print a table with just print(table)
one of them will give a coherent output which is good enough
trying to figure out how to hook up the ranks from a table to an if statement in the suits
ok i got it working
Now that i made these, time to use one as a test dummy to make the card spawn a tag when scored
that makes sense
maybe just config.key
🌊
is there a helper function that prints the contents of a table?
we were just talking about that (marie told me this) tprint
print(tprint(tablename))
awesome
same exact error
if only i knew how to decipher these
i understand it now
sorta
config (the one with center_key) seems to be a part of some other table
i just gotta figure out what it is
that table is the table that contains all the joker information
theres multiple different configs fsr
ok nvm its part of the main table
theres multiple different configs inside of the main table
maybe the error isnt about that
it might be about smth else
Hey gang I need a favor could you guys name a joker and I'll tell you what it could reroll into as part of the "jokers reroll into similar ones at the end of every ante" gimmick
And y'all can tell me if that makes sense
splash
Because I have a list of a bunch of different joker pools and I wanna make sure they work
splash
Pariolida
Four fingers
Oops all sixes
Smeared joker
Shortcut
Showman
Mr. Bones
Chicot
I don't see where Showman, Mr. Bones, or Chicot come in
espeically instead of Splash
also under what conditions would this rerolling be happening
they're not similar effect or build wise, they're just similar in that they're in the group of "utility jokers" that don't directly give mult or chips and contribute unique effects
which
fucking sucks when all of these are build-specific
in that case, where's Luchador? or is he in "on sell"
if you have one that already fits your build you wouldn't want any of the other options
End of every ante as a part of one of the possible b-side erratic effects
I feel like this needs me knowing about what erratic effects are and I have no idea what those are
some of them are positive and some of them are negative
it selects 3 of 7
and some of them are REALLY dumb no offense to survival
like this one is just an instant reset
no sane person plays through a run where you don't get to keep any joker for more than 1 ante
Okay COULD joker rerolls technically work if I tweaked with the pools and weights enough
got it figured out
oh?
no not really
new add-on to playing cards like the curses?
yeah been working on it for a while
scaling jokers are still entirely unusable and they're like 1/3rd of the joker pool
Holy shit that's what I was planning to do, creating a brand new card modifier
finally got around to making it not appear in the stickers area
Do you have the code for it? And how complex is the entire implementation?
calculate = function(self, card, context)
if context.individual then
add_tag(Tag('tag_uncommon'))
play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
end
end```
What is wrong here?
we're gonna ignore this lol
Btw i'm trying to put this on a playing card, is that gonna be a problem?
the github can be found pinned in the mod thread, its realtively simple since SMODS.Stickers is mainly used, which is why they appeared in the stickers section
Siiiick
I'm curious when you say this does that mean like
"This is a horrible idea why would you think this"
Or like
"This would just be awful to play"
this would be awful to play
as an idea on its own, it's not a bad idea, but I wouldn't put it in a deck like that
Yeah I'm concepting a custom modifier type, and one of the bigger problems I thought of is clashing with other modifier types if I were to use one of them as a foundation
it could go in its own deck and have a corresponding upside to sffset
and it'd be a fun little challenge deck
other mods can add gem slots easily and it would appear in the collection menu (at least i think)
but when getting or not getting the no-fun run effect is randomized it's really annoying and just makes you wanna pick a more consistent deck
that was my main issue when i was concepting this mod, luckily i discovered stickers didn't clash with anything, which is why the mod uses stickers
Oh man that's a Talisman dependency, must be quite complex
talisman depemdancy is only used for xchips
people pick up talisman dependencies for xchips and they're really simple
ooh I see
the actual mod doesn't even support going past the 1.7e308 limit because i'm stupid and don't know how
wish i didn't have to use talisman as a dependancy because of xchips but it makes my life easier
Yeah it is what it is ig
xchips gotta get put in base steamodded
and when they do they better make it work on playing cards
Looking through your source code, damn quite lengthy Lovely patches, still struggling to understand them but I'm getting there
People warned me about putting stickers on playing cards since it doesn't really appear on them in vanilla gameplay except for decks and Jokers
diamond was horrendous to work on because i had to add repetitions for stickers which hasn't been done before
Your invention will be deeply remembered
oh god
Dude your lovely patch for diamond is longer than your misc patch what the hell
idk if i should get repetition for stickers added to base steamodded
Would this idea work if the effects were balanced enough, because I really like it
I'm gonna work on it a bit
I'm trying to learn how to use the lovely injector and I'm confused about a few things, if anyone could clear them up for me i would appreciate it
- How much do i have to worry about "priority"? (for both lovely and json files)
- I assume I'm able to use the entire SMODS api with it?
- what's the purpose of the dump folder? Is that what the code looks like after the patches?
I can confirm 2 and 3 are correct. 1 I am not sure
ty
i took a look in the cryptid code and they only use priority 0 so i assume its not that important
guess what
i am the stupidest person alive (if you dont count babies and toddlers)
basically it is config.center_key
but fsr i was doing add_joker({joker = left_card.config.center_key}) instead of add_joker(left_card.config.center_key)
so uh doubled joker works now
and it does indeed remove one joker slot
Epic
i do want to make it so that it will only remove a joker slot as long as it exists in the area instead of just permanently
which is prob an easy thing to do
ok theres still smth i gotta fix
uh it still adds a copy even if theres no room so
easy fix tho
I am very confused right now. I'm injecting this patch into the use code for Familiar/Grim/Incantation but it's still producing the vanilla functionality. I even checked the dump and it looks good there
It's not even sending debug messages to console
Here's the dump too
Hey guys, struggling to get a custom sound to play, specifically with getting/storing the path to the file, I've seen it done in SMODS.Sound and outside so unsure on best practice, I've got the mod being stored, and tried
mod.path .. 'gunshot.ogg'
and image attatched, along side some tweaks
0.9.8 code....
Oh no have I done a cringe
yea, you can remove the entire line with the findModByID
each sound should be declared using a different SMODS.Sound
like
SMODS.Sound({
vol = 1,
pitch = 1,
key = "key_1",
path = "path_1"
})
SMODS.Sound({
vol = 1,
pitch = 1,
key = "key_2",
path = "path_2"
})
Sick, I'm now just getting this, where I'm assuming it's looking in the games files rather than the mods?
Where you're actually calling the play_sound function, the argument should include your mod prefix. For example, if your sound is named "example" and your mod prefix is "exmp", you should be calling play_sound('exmp_example')
Ahead of you a little bit, I did that and now I'm getting this
what's your code?
okay, and whats your updated sound declaration
Remove the sounds/ bit.
Still getting it 😅
Are those actually .ogg files, codec and all?
Aw bugger one was a fuckin' .wav for some reason, seems to be working now!!
Cheers guys, much appreciated. I'm on v little sleep and the last time I used Lua it was 2008 and I was trying to make a door in roblox
Happens.
As an aside, is there any way to show a negative amount in the dollar bonus? a minus figure shows as though you're gaining money, even though the cash out/results show removing
Even if I could just colour the text red or something
Cool or nah?
(Replaces all jokers for one of the these effects)
feels a bit rnjoker-y
not in a bad way, I'm all in favor of random stuff, even my pfp is an rng-based character
I just wonder if you'll be sticking with the fixed values, or if you'll add some scalers too
Is there a way to show a message on a joker outside of the calculate function? Like in calc_dollar_bonus as I'm destroying it or something?
fear me

What am I doing wrong?
How would you go about a joker retriggering the first played card? I made this method (likely poorly written) but it just crashes when its supposed to run cause it failed calling an event called "Juice Up"
card = card
thank you 🙏
Allow me to show off the spread of jokers I've made for this mod so far. Huge props to my artist, he's doing a great job
how would I make a joker that does something if a flush is a certain suit?
Detect if a Flush is made... then iterate through scored cards and count how many are of the desired suit. If they match the length of the scored hand (5... or 4 with Four Fingers), do stuff then.
a flush though would always be the same suit unless wild cards are used
so unless you want to exclude wild cards then you can just check the suit of the first non-wild card instead of the suit of every card
I'm looking for if the flush is all a certain suit (all diamonds, all hearts, all clubs, all spades) and if it's all that suit the joker will trigger
But what if it was a wild flush 
do you want it to consider wild cards as the original suit of the card though or treat them like any?
any
so then yeah you can just check if the hand is a flush and check the suit of the first non-wild card, or if its all wilds then just do whatever effect
k. thank you
I take it you’re making Jokers for each type of flush?
also, with four fingers is a flush 4 a thing?
I think it just classifies as a flush
that's what I'm planning but I'm just trying to figure out how to do it first
Tho that’d be a cool way of making four fingers relevant
Thought so. Best of luck! Doesn’t sound too tricky to implement
thanks!! this is my first time making a mod lol
(disclaimer: not an artist) what do yall think about this border design for jokers which upgrade other jokers?
maybe in the calculate function, context.scoring_name and check if it contains "Flush" and if so then check the scoring cards and check the suit of the first non-wild card and if it matches then return whatever values for the joker effect
oh that right one is awesome lol
aw ty
"(disclamer: not an artist)" proceeds to absolutely cook
i need to get better at card art
my final goal is to make the arrows hover (like hologram), so I'm waiting until i get that working before i make my final decision
i mean its kinda just green arrows lmao
you could make the green arrows be linear along the borders, and then for the animation they kinda glide upwards
i just thought of something funny, what if i made it so that the base joker for the reincarnation afterlife thing I'm doing is just the base joker with the reincarnated effect border around it?
maybe with like the soul effect with the face?
show me what you can cook
i cant rn since I'm at work and the sprites I'm using for my mod atm are just simple placeholder sprites
mkay
i would love to but atm dont know how
i can make a prototype
so for detecting the flush, would I do this?
yes that should work
oh i could do that yeah, but no clue for the code
that's weird
yea
coding that would be hard presumably
maybe i could just line the sides with arrows and have a shader that scrolls them vertically up?
and loops
show us the code
id say to do
if context.joker_main then
if string.find(context.scoring_hand, "Flush") then
return whatever
end
end
that way it counts any variation of flush
not just the regular flush
i think you can actually do if next(context.poker_hands["Flush"]) then
i believe context.poker_hands contains ALL hands your hand "contains"
I’m sensing a theme in this channel
or no not scoring_hand, scoring_name
ive not done much modding so idk entirely how things work and it doesnt help that I'm tired
so that detects the flush or just didnt crash?
it detects the flush now
twisteddragons' solution will detect all flush hands even if they dont have 'Flush' in the name for whatever reason
yeah I'd go with that honestly, cause doesnt that also have a table of the cards?
i mean all flush hands should have flush in the name regardless
or if it's not scoring as a flush for whatever reason, which is relevant since there's a poker hand api that can have new hands throw things out of whack
heres a concept anim
yes????? peak
yeahhhh i like that
its kinda trash and a bit too fast but
nah its good
WHY AM I GETTING GOLD jimbo MEDALS FOR THIS 💀
theres an odd bit in the loop on the top right
and yeah maybe make it a bit slower but i think its great
also thats jimbo's stamp from my mod
coming never™️
Simple and effective
ah ok cool!
nice stamp
ty
i have each of the following as well:

love the little sock and buskin
awesomee!!
the idea is for it to retrigger the joker it's on but i haven't cracked the code on that yet
mini blueprint lol
i understand there's some form of api for that in the works and im hoping that might be able to help me so ive just been doin other stuff lul
also i havent been balatromodding much lately so im out of all the loops
man i wish there was a wiki for this stuff
steamodded's github page has a wiki
fixed tthe spacing issue
ooh lemme make it slower though
that at like roughly 85% speed would be grand
also is there a way to make animated jokers now? i remember i was trying to figure it out but it's not simple
yea i changed to 85 ms and it looks good
no clue but if i have to ill try to make a shader that moves it
cool
those emojis should be in this server
they are peak
aahhhhhh theee french.... champagne
LOL
yes
if you want i can send you my code from when i was trying it, but its for smods 0.9.8 so...
oh btw
how do i make a function in a joker that is only triggered once the joker leaves G.jokers
like if it is sold or destroyed itll trigger a function
I've encountered that same situation, my solution was to hook into CardArea:remove_card and check that the area is the jokers one
?
how do i hook into CardArea:remove_card
bc i dont know much lua so hooking is new to me
oh i see
I wish I could write some example but I'm on phone
Hooking is basically adding your own code to a vanilla function
so smth like
local removecardOG = CardArea.remove_card
function CardArea:remove_card(card, ...)
if card.key == 'doubledJoker' --[[ thats the name of my joker ]] then
if card.ability.extra.slot_removed then
G.jokers.config.card_limit = G.jokers.config.card_limit + 1
end
end
return removecardOG(self, card, ...)
end
```?
Yeah that's pretty much it, all you need to change is card.key to card.config.center_key == 'j_prefix_keu' where prefix is your mod prefix and key is your joker key
whats a mod prefix, the mod_id?
If you're using headers the mod prefix is the first 4 characters of your mod id
But you can change the prefix
I'd recommend to make it the same as your mod id
by default yeah, but you can change it
so MOD_PREFIX
I think it's just PREFIX
ok
just make sure it's unique
miku
Hello miku
LETS GOOOOO MIKU CARDS
oo ee oo
oololo
i love this
peak art tho
thanks
yeah thats some sick art
im curious who the other two will beeeeee
im putting forward meiko and ritsu
not really limiting to exclusively vocaloid
just that some of them i literally have not heard of before
meiko is hearts in alice of human sacrifice-
i have heard of meiko but not ritsu
i wonder how difficult the design is gonna be for the card lmao
oh utauloid released after teto by the same... group? i forget
local removecardOG = CardArea.remove_card
function CardArea:remove_card(card, ...)
if card.config.center_key == 'j_HMOD_doubledJoker' then
if card.ability.extra.slot_removed then
G.jokers.config.card_limit = G.jokers.config.card_limit + 1
end
end
end
and then i got an error about card being nil with remove_card
first generation teto design
LOL
here is a second one (just draft)
it's fine those were just draft here is the real thing
what if all of them 
teto fervor
why limit yourself
maybe i move adachi rei to hearts so i have more spaces for yellow hair people
i'm just sayin stuff tho you aint gotta do what i yap
it's fine
thank you vocaloid wiki
i am pretty sure those two are always popular
ill go back to drawing shit now
Don't forget to call the original function
ok sorry for off topic but how the hell does merry andy even work???
every other joker that modifies hand size has a section in add_to_deck
but not merry andy?????
look at the example jokers mod (part of steamodded)
it has merry andy
i mean in the vanilla code
ah ok
Is merry andy a vanilla joker, I've never heard of it
seems so
+3 discards, -1 hand size
i did, it just has its definition
i fixed that, but its still giving the same error (this is as soon as i select a blind)
What does it have in config table
j_merry_andy= {order = 125, unlocked = false, discovered = false, blueprint_compat = false, perishable_compat = true, eternal_compat = true, rarity = 2, cost = 7, name = "Merry Andy", pos = {x=8,y=0}, set = "Joker", effect = "", cost_mult = 1.0, config = {d_size = 3, h_size = -1}, unlock_condition = {type = 'win', n_rounds = 12}},
You might have to check if self.cards and your condition
i cant find where that's actually used though is the issue
every other joker that modifies hand size is in that function
Yeah, does it work?
Also you have to pass self to removecardOG
oh ok
thats discardedonly
Yeah you have to put it in as well to pass it to the original function
so
Why are you doing this
I'm not sure what the triple dot notation is in lua
Just use remove_from_deck on your joker
They want an effect when any joker is sold or removed
yea basically
my joker removes one joker slot, but i want it to give it back once it is sold or removed
Wait it's only for your joker?
This is a very simple add_to_deck/remove_from_deck situation
98%
oh ok
At least you learned how hooks work!
Were you able to find it
that gives me an interesting idea though, what if wide joker that took up 2 slots
and negative adds 2
i gtg to bed lol
h_size*
? idrk what you mean
is it something you can do in the joker table?
i actually don't know where all the "simple" jokers are executed
like the pure +mult ones
Hi sorry, I'm super new to modding but I'd like to learn, specifically right now I'm wondering how I would go about making a custom enhancement. I stole the echo code from Cryptid mod's Misc.lua but most of the code for that isn't there and I can't seem to find it so I just thought it would be more efficient to ask here
so smth like checking if its been called? or calling it itself?
This is merry Andy
They’re functions you define that are called automatically when you add/remove the joker from your slots
oh weird
You should look at the steamodded wiki on github
Thanks, I'll take a look
I don't have the link at hand right now but you can probably find it by searching
Also that repository has examples
I’d recommend not doing any enhancement work for a few days
Oh yep found it thank you!
why the heck did localthunk not use this for stuntman and turtle bean and others??????
Their values are in the extra table
i mean i see that but...why?
Turtle bean changes every round, idk about stuntman
oh so
remove_from_deck = function(card --[[some other args]]) -- in joker table
-- insert the code i made earlier with some tweaks
end

comprehension is the first step towards madness
i will not sway you from your path if it is what you choose but know the risks you take
the changing of turtle bean is handled in calculate_joker
im in my ipad rn just getting in what imma do tomorrow to make this work
Yeah but values that change don't go in config, go in extra
So it has to be handled manually like that I guess
losing your mind is half the fun of programming
Trying to understand someone else's code is always pain
The best advice I can give is don’t try and understand why thunk did stuff
Especially because we don't always make the most reasonable and efficient stuff
stuntmans h_size is also in extra
tbh i dont even get the extra
ive just putting all my custom joker vars directly in config and it aint broke yet
Don’t do that
Put them all in extra
what is the significance of extra?
Everything in the extra table is copied (and saved) to your joker, only certain things not in extra are
Basically persistent data for the instance of your joker
Hi hi me again, how do I give a card an enhancement, and for future reference where can I find tarot card code in base game?
like, in the case of 2 of the same joker it wont mess things up?
i am so cooked
you are so cooking
If you have two of the same one, they have different extra values
Like how a vampire doesn't work retroactively
also _card:set_ability(enhancement)
Thank you!
is enhancement here a string?
i forget if "enhancement" is a string or something like m_stone
Also, jokers, consumables and others are considered "centers" so you'll find functions specific to them in the centers page in wiki
That's very helpful thank you
ok so the data in extra is per joker, and the data not in extra is for every instance of that joker???
Looking for this on my own so no worries if you don't but if anyone knows this it would be a big help
Should be G.P_CENTERS.m_gold for example, I don't remember the other two parameters of set ability tho
Thanks, so if it was custom i would do like G.P_CENTERS.cry_echo or something?
you can leave the other 2 blank and it should work
You need the m at the start for enhancements
Ohh I see, ok lemme check cryptid mod code
But if cryptids prefix is cry then that should work
You should look at card.lua in the set ability function I think
is adding stuff directly to .ability for cards an issue?
like for example for the cards from the previous run with the reincarnation afterlife voucher in my mod i add card.ability.reincarnated directly to each card that's carried over
i haven't noticed any issues so far but if there's any i probably should change it
Can you send a ss of the set ability function where it defines self.ability
uhh
i guess line 316???
does that even do anything?
i guess it would be {} if theres no ability
yes, you can see how it specifically copies some values to the ability table
If you were to add custom ones in the config table this would not take them into account
But extra copies the entire table
i've been adding custom ones and its been working so idk
called new_ability here
ah so it only applies to config and not manually adding to .ability?
if set ability is called to, for example, change an edition those values would be lost
that's my understanding of it
no?
when is set_ability actually called?
set ability keeps the old ability table if it exists and just replaces values it looks like
if .ability doesnt exist it makes it as an empty table
You can manually add stuff afterwards
uhhh, then I guess I also don't understand
...i think im getting it
Just initial creation only copies certain things
so me doing card.ability.reincarnated = true is fine?
I’d have to recheck the save/load code
it saves and loads properly
cause ive been able to exit runs and come back and the cards still have the border
doesn't the vanilla game only call set_ability on playing cards though?
Maybe check wheel of fortune code
So set ability is never called on jokers?
Except for initial creation of course
if thats true then shouldnt my jokers with custom vars not in extra not work at all?
It’s called whenever the joker is created
like i got this and i can call on it just fine
Show your calculation code
aight one sec
In what scenarios is a joker created
In shops?
ok yeah if it gains an edition it still functions normally
at least via the debugplus mod
It happens multiple times in playing cards
But for jokers only once
Unless you call it on them again yeah
i guess to keep track of stuff like hiker buffs maybe?
Changing enhancements
Hiker buff is perma_bonus I believe
yes ofc but whats with the saving of the h_mult and x_mult and all that
can playing cards even have those vars?
They should
they can, or should
you can just.. give them those values
If you have debug plus try looping through your hand with eval and log some ability value
Huh looks like smods copies the entire config table, has it always done that?
its not the same thing, but same principle
Enhancements
you can give playing cards extra values, and enhancements also give those cards those values
Idk man I'm like a week old in balatro modding
i mean the vars in ability not the function set_ability
i dont see it
its in common_events
Close
we got there
good enough for a programmer
yeah it looks like it does access all the vars in abilitys but again, only really for cards in G.play or G.hand, aka playing cards
Yeah eval card is for playing cards
not entirely
its got this part for jokers and planets/tarots
doesn't get any h_mult or anything though
Wouldn't that be just mult
no mult is for playing the card
hold like steel cards and queens with that one joker
the +13 mult per queen held one
i mean yes but its the same principle
theres nothing that gives a card h_mult so idk when this code would be executed
Go to Card:get_chip_h_mult
yea it just returns it's h_mult var
Boring
im trying to find where it would get changed
Base game doesn’t use h_mult iirc
iirc h_mult is just unused
Boring once again
yeah shoot the moon (the queen joker) doesnt modify it
we love unused code
h_x_mult is used for steel cards iirc
it's probably just implemented for completion's sake really, though the lack of h_chips is annoying
really easy to add anyway
It’ll be from an old effect that got changed most likely
Like copier for use consumable
fun fact burnt joker increases your hand size by 0
can i use has_enhancement like this? It doesn't seem to be working
calculate = function(self, card, context)
if context.repetition then
if context.cardarea == G.play then
if SMODS.has_enhancement(card, G.P_CENTERS.m_cry_echo) then
try next(SMODS.has_enhancement(card, G.P_CENTERS.m_cry_echo))maybe
Ill try both thank you
Ok this crashed it instantly, ill try it as a string
What does next do
Key is a string yeah
yeah it might be a string lol
The function returns a Boolean
not sure but if something aint working i add or remove next and it makes it work sometimes
oh thats tricky
Gives the next value of a table, in this case I guess the first one
So yeah, definitely not gonna work on a Boolean
globals.lua is only 515 lines long for me?
It's not working as a string
Steamodded adds stuff with latches
Patches
What's your code?
SMODS.Joker {
atlas = 'cards',
key = 'trainer',
pos = { x = 1, y = 1 },
rarity = 2,
config = { extra = { retriggers = 2 } },
loc_txt = {
['en-us'] = {
name = 'Trainer trainer',
text = {"This card retriggers",
"every {C:attention}trainer{} card",
"{C:attention}2{} times"
}
},
},
loc_vars = function(self, info_queue, center)
return { vars = { center.ability.extra.retriggers } }
end,
calculate = function(self, card, context)
if context.repetition then
if context.cardarea == G.play then
if SMODS.has_enhancement(card, 'm_est_trainer') then
return {
message = localize("k_again_ex"),
repetitions = card.ability.extra.retriggers,
card = card,
}
end
end
end
end,
}
That’s checking if the joker has the enhancement
Use context.other_card
THANK YOU
yw
That works, thanks!!
If I want to make the text of my card work with Cryptid's joker value scaling what should I put in {C:attention}2{} part? I notice that the localizations for Cryptid uses #2#, would that work?
The #s means it's a variable, the number in between means the index of what you return from loc_vars
So if you were to replace your 2 with #1# it means it takes the first value of whatever you returned from loc vars
alright im gonna eat a grilled cheese and pass out, hope you folks solve all ur bugs
Thank you, that makes sense
Yeah
Does it start counting from 0 or 1. I think 1 right?
Show your code where you try to use DV, line 573 of tag_preview.lua
Lua starts from 1
Thanks
I ate too many {C:attention}beans {}I might have to {X:mult,C:white}Shit {} myself
:3
That should be the exemple on the documentation

chat is this IA or Bocchi the Rock
omg mr smods
My honest reaction
aubrey of omori

chat should i make a deck skin mod
thats nice p, id def use
this is so good
however you forgot to underline 9
anyway uhm
ia's hair is lighter, I imagine this is boccher
uhm
in my experience, 6 and 9 is more common than 6 and 9
Adachi Rei and Kasane Teto respectively
real
tet,,,
Man ghost cards are a huge pain in my ass
if context.cardarea == G.play and not context.repetition then
if math.random() < 0.25 then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.5,
func = function()
ease_dollars(card.ability.extra.money, true)
card:shatter()
return true
end
}))
card_eval_status_text(card, 'extra', nil, nil, nil,
{
message = "Shattered!",
sound = "fm_shatter",
colour = G.C.MONEY
}
)
end
end
This is for an Enhancement so card destruction logic works differently compared to Jokers and Consumables, what am I missing? What can I do to prevent ghost cards from forming?
this is what my brain defaults to
they do in fact underline both
maybe that's just me
You have to look at how cards are normally destroyed and copy it or patch into it
-# or wait for better calc 2
Aw man I've been meaning to avoid patches
lol, lmao
PLEASE DO NOT JUST DRAW LETTERS
imagine if i was an artist this is 100% a joke
DRAW STICKMANS
i only even underlined the 9 because i just hadnt closed gimp yet
