#💻・modding-dev
1 messages · Page 276 of 1
0 is a number
yeah try updating
tunnel vision
talisman 💔
talisman compat 💔
Uh what context would this be paired with
I should update all my mods but constantly updating them is a chore
luajit2 ❤️
never tried that but it sounds cool ❤️
anyone know how to handle booster pack particles
any context with a playing card as other_card (or being scored directly), basically. Otherwise you can use SMODS.in_scoring(playing_card, context.scoring_hand)
....
they didnt fix it
i downloaded the latest version already
it seems to be only occurring when you are using omeganum settings
:3
😔
qwedfqqd
praise fucking talisman
oh nevermind, bignum breaks too
ftfy
the reason why it didnt crash was because i had Disable Scoring Animations on
if i have it off then it will crash
thats certainly something
😔
losing my fukclking mindh
most normal take
if i want to watch my es get es without effort i'll go hit up a calculator
coldest take in the west
cryptid's popularity would beg to differ tbh
lmfao
now youll get people asking where to download talismans disable scoring animations
😭 unfulfillable dependency
i still want a way to have "optional dependencies" just to document to users of my mod what integrations exist
how do i i check how many cards are in a hand
#G.hand.cards
The code in my Balatro Mod sucks and I need to reoptimize it
help
well it would be a single played card
whatchu doin
#context.scoring_hand
thats a table
you need to
G.hand.highlighted[1] or smt
depends on what your looking for
saddness
i
faelfmael
well actually i need to check the whole thing to make sure its one card
#context.scoring_hand
^
so this would act like dna
im taking a rest early today
ive been scratching my head so much im gonna go bald by 18
💔
for DNA, it would be #G.play.cards
or #context.full_hand because why not use context vars
true...
remember mods might add things to scored hand beyond G.play
then i can use getn to get the length right
how does that work lol
...why are there slots that say they are filled but aren't?
ghost cards!
i love ghost cards they are very fun
You've probably destroyed cards without removing them from the playing_cards var. If you destroy during a blind, there's a context that'll make sure that won't happen
ok so how would i make my cards do those cute little things like spinning and such
copy what they do in the vanilla code
Are you not using the default set up for tarot enhancements?
no
Ok yeah that makes sense......... Found the ghost object of this game................
literally just setting mod_conv in config.tarot removes the need for extra code
:flip() :flip()
hey peter
i can literally jump off a bridge and do a flip at the same time rn
hey paul
do u like movies
is there a context for number of hands played
Hello balatro moding developers
oh, how nice it is to not have a million folders
rn im using G.GAME.current_round.hands_played
hi rega
oh hi mark
thats what you use
cool
letterboxd says maybe
this year he says
working on a better-calc tutorial vid tmr
I have like, esentially no prior modding experience other than replacing sprites in folders to make them look like things
there has been less days in this year
i deleted my letterboxd because of the embarrassing low amount of movies i watch
u dont need the ","
But I wanted to learn how to make some jokers and stuff for a friend to play with
its not a table
a
important to note that I can watch movies during my job, so I tend to watch 2 a day quite often, haha
:3
that's cheating
Thank you! I will look at these and if I have learned more or can't figure something out I will return
mhm, feel free to ask anything ur confused about!

removed the commas
u cant just ask about every syntax error
you have to attach the :flip to the card object you want to flip 😭
that resolution is even worse than me running Minecraft ngl 😭
just saying :flip() doesn't really mean anything
the threads are very funny
im done
well why the freak not
Trying to give xmult for every queen held in hand, nothing happens and I'm not sure what I'm doing wrong
Because that would apply the xmult to scored queens and not the queens held in hand
final_scoring_step doesn't have other_card
call my shit to_medium
if anything, you could just use joker_main and count the number of queens then
How do u even write this on ther 💔💔
and then multiply that by the XMult you want to give
context.individual also happens for held in hand cards
that's also true
yeah it worked, thanks
SMODS.Joker{
key = 'PNA',
calculate = function (self,card,context)
if context.individual and context.cardarea == G.play then
if #context.full_hand == 1 and G.GAME.current_round.hands_played == 0 then
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local _card = copy_card(context.full_hand[1], nil, nil, G.playing_card)
_card:set_edition('e_negative', true)
_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, _card)
G.hand:emplace(_card)
_card.states.visible = nil
G.E_MANAGER:add_event(Event({
func = function()
_card:start_materialize()
return true
end
}))
return {
message = localize('k_copied_ex'),
colour = G.C.CHIPS,
card = self,
playing_cards_created = {true}
}
end
end
end
}
why tf is it trying to call that
don't return card = self, return card = card
stealing from the sorce code go crazy
you don't ever wanna return self in the calculate function, basically
good to know
You don’t need to return card = card either
It’ll auto apply the message to the relevant card in that context step, if you want to change it you use message_card = cardObject
actor pack is proving a bit more cumbersome than I'd hoped. damn.
what does localize actually do
how would i calculate this (i am actually a little stuck on loc vars but i think the only one i definitely need is the Xmult one)
basically how would you make a calculate function for this?
Yeah
for challenges, what's card_key supposed to be?
(in reference to yes_ranks and no_ranks specifically)
well, will this activate on cards played (i assume so)
?
like when u play a hand with enhanced cards
yes
nevermind, I figured it out
maybe I should use my break from my mod to PR the docs
Well, in that case, what you want to do is loop over context.scoring_hand in calculate function, then for each card in context.scoring_hand (its a table of the scoring cards in the played hand), you can check if it has an enhancement (one easy way to do this is next(SMODS.get_enhancements(currentCardInTheLoop)) ~= nil, the next() is there because that technically returns a table), and check the card rank with card:get_id() and make sure its even. If all of those checks pass, you can put return { xmult = card.ability.extra.xmult } (ofc im assuming what ur config variable is called)
When you want a specific card do something during scoring you almost always want to use context.individual
yes
You told them to loop thru scoring_hand
oh i completely misremembered what context.individual was lmao
yea no you dont have to loop through scoring hand
you can just check context.individual
oh god why can't the examplejokersmod have an even steven example
because its the same as walkie talkie?
oh
i may be a little stupid
also you can look at vanilla code
i think i get it now...
well chat, i finally got around to doing a localization file (mostly)
so this would work to detect even ranked cards?
yes
and where would i put the enhancement check
you can put it in the same if condition
and SMODS.has_enhancement(context.other_card, 'm_key')
hi, is there a toggle, or something i can add to my Joker, which makes it shatter when destroyed?
i dont think so
hook function SMODS.shatters(card)
i saw that but it doesnt seem to get called anywhere a joker would be destroyed
is 'm_key' interchangeable or does it have to be 'm_key'
maybe i could patch start_dissolve?
it's m_ + the key of the enhancement
it's injected via lovely, you won't find it much in SMODS's source code
oh
i know how to browse the code, I'm saying that's only called when playing cards should be destroyed, it won't do anything for jokers
okay idea
oh right i'm stupid
hook start_dissolve, check the card it's being called on, if it's one of the Jokers i wanna shatter, call shatter instead
yeah that sounds like what i would do
Is there a readme / guide / starter files for creating a mod for balatro?
thx
the first line should be local ref = Card.start_dissolve
what file is the challenge localization text rendered, does anyone know?
(oh, and i also missed an end)
your key is probably something like "j_BFDI_bottle"
grand
(BFDI being whatever the prefix is set as in your manifest .json)
omg ghost
UI_definitions G.UIDEF.challenge_list_page / G.UIDEF.challenge_description
hello
i should probably do that for Glass Cannon tbh
hai :D
today was crazy for me
crazy?
what a hero
n do you still hate ui
i will try math deck now
depends
I'll work on the math deck + letter sleeve
ive never used the sleevs mod
it becomes a math deck pro
instead of measly simple arithmetic
you get variables
n a few functions
updated
i guess
math deck doesn't work with letter sleeve yet but the base math deck should be usable
there was an earthquake around 11 hours ago
asking this btw so I can support using a table for my custom rule value
it works functionally, it just looks like this 😭
i also use a table for a challenge and I just decided to just hard write it lol
I'm making a patch 
what's the equivalent to console.log in LOVE?
or use one of the logging functions if you're also using smods
LOVE just uses lua, so you can check out the docs for that
Never actually used the debugging tools for LUA, just console.log 💀
That might just be a tabletop sim function now that I think about it
i didn't think of an effect for this one.... fucjk......
heartbreaking: Lua API attempts to emulate JavaScript
on my way to define custom behaviour for my joker when a specific challenge is active
oh that's not hard
I figured
5/10 done :3
I literally just need a contidional inside the joker to see if the challenge is active
doesnt seem difficult
the hardest part is finding where the current challenge name is stored lmao
oh
I bet 2 bananas on G.GAME.challenge
wtf
that's the challenge table i believe
z = 9
I'd count that as being right, I keep my 2 bananas
got a little error at 431: attempt to perform arithmetic on field 'odds_m' (a nil value)"
I'm not sure if i set my probabilities right
good news! G.GAME.challenge holds exactly the string that is the challenge id lmao
I spent... HOURS debugging this function and it turns out I just forgot to clean the temp pool 😢
it happens
💔
i mean i guess its efficient
I feel you
I remember when I had the Curse of Jimbo
blueprint
did i just do the thing where you type what youre thinking
and think what you wanna type
actually speaking of blueprint can you hide the compat label is that a thing
i just discovered that Kino sometimes overwrites other mods config files. Anyone familiar with that issue and what may cause it??
bro is assimilating
in vanilla, whats the lowest hand amont you can start with for a blind excluding the needle
since that sets it to 1
it's 1
if you have zero hands you would just lose
i feel like i might have an end inserted somewhere that isnt supposed to
same thing with hand size
well yea, i just mean in normal play is it possible to get enough shit to make you actually only have 1 hand to play outside of a blind
oh
or whatever the lowest is
im assuming that both dont use the same global variable to store it right
Are you using SMODS.current_mod outside of the loading stage
gotcha awesome, thanks
Oh, yeah. I thought I wasn't, but yeah, I'm not actually using the right variable. I bet that'll be it
how would i make a joker that reacts to other jokers getting destroyed?
would i use hooks?
You can do SMODS.Mods.yourid.config or store a reference to it in a global variable during loading
Unfortunately yeah, SMODS doesn't have a context for that yet
nah im implementing blind phases due to blind expander, and a friend was moaning about how you shouldnt be prevented from facing a boss because you didnt have enough hands (which i fundamentally disagree with due to the needle)
so i neeeded to know what the lowest poss was
how would i add a hook to a method? is that even real?
yeah, I thought I was doing that, but I think I got distracted while setting it up every time, haha. It's not pushed to teh release branch, and my dev branch sets a mod-specific version of it and then never uses it again, haha
Hooks are real!
You'll find examples somewhere in this discord... i cba to type one in phone
I see
Didn’t victin add that context recently?
No idea
so what would the order of things to do be? like...
We need some "new SMODS feature" announcements
how would i add context using a hook
i have no clue how context even works, to be frank
is it a global variable or something
Cus we can't all keep track of every commit lol
How do you make a toggle button and the describe where it gets put?
Like this?
we need.... the docs 
that reminds me that I need to PR them later
gotta keep up to date 🗣️
To call a context manually use SMODS.calculate_context
And you pass it a table with the info in the context
That's for adding your own contexts
so i would hook SMODS.calculate_context into Card:start_dissolve?
Uhh, there might be jokers that shatter instead of dissolve
I think glass joker? But idk
I hooked Card.remove instead
i don't quite get how i would hook something in a method...
like, card.remove does not exist yet, does it? and if it does, do i have to hook every instance of card.remove?
im stupid
local card_remove_ref = Card.remove
function Card:remove()
if self.ability.set == "Joker" then
SMODS.calculate_context({ joker_removed = self })
end
card_remove_ref(self)
end
do seals work on Jokers too or just playing cards?
thanks, but where do i put it?
just at the top of my mod lua?
yeah
If you apply them I don’t see why they wouldn’t work
keep in mind this will count sold jokers too
yeah i'll work out the logic
I have the full hook for this gimme a sec
and maybe jokers in the collection and stuff so it might need more checks
yooo hype
you also have to check if self.added_to_deck otherwise opening and closing your collections will trigger your joker 20 times
okay cause I was going to make a new mechanic using stickers but i was having trouble finding a way to make sure that there can only be one of them, so if seals work then itll be easier to make a Joker only have one of my new mechanic
-- Context for Joker destruction
local _card_remove = Card.remove
function Card.remove(self)
if self.added_to_deck and self.ability.set == "Joker" and not G.CONTROLLER.locks.selling_card then
SMODS.calculate_context({
blueatro_destroying_joker = true,
blueatro_destroyed_joker = self,
})
end
return _card_remove(self)
end
tysm! i'll look into this and finally learn how these work...
This will happen even in collections
thats what i said
Oops
🙂
Discord was lagging, that was the last message for me
and self.area == G.jokers
hello n
hii
hi
what do you think about my math deck
😭
kinda too easy, letter was more fun
aikoyori still out here inventing new ways to play balatro
i guess i might have to make it more difficult
mixing math and letter cards so you can make 1E308
Pixel deck when
Create an image out kf pixel cards within 1% accuracy or die
actually yeah
i have a few problems with this thing idk why
all my hands by the end were X * 10 ^ n
i should fix that
Instant e 👍
is this the base game version of smods' calculate? or is there also a calculate_joker that i couldnt find documentation on
I think it would get a lot more interesting if you didnt have "0" cards by default
thats it afaik
hi toma
hi aiko
i am so cooked
Havenr actually tried it yet this is an educated guess
oh i got chicot in my run too
would i run a consistent effect under Update or something? cause uhhh lua doesnt like me just doing it raw
depends on what the effect is
is this for like a passive effect like pareidolia
i LOVE GDSCrIPT
gdscript is cool
its for a copy effect
there's a utility for doing blueprint effects in calculate
oh so like blueprint/brainstorm? you might wanna check in like the lovely dump of either card.lua or common_events.lua because i think there you can find it?
but ive never used it : )
thats where i got the screenshots
im in card.lua rn
me because instead of using it I just retrigger jokers lmao
try SMODS.blueprint_effect
btw where is the rarity stored in a joker card?
card.config.center.rarity
arabic letters make me scared for some reason
tyty!
can someone help me diagnose why my joker isn't showing up in the collection?
the mod is being loaded, here's my SMODS.Joker call
SMODS.Atlas{
key = 'j_chikenjokey',
path = 'j_chickenjokey.png',
px = 71,
py = 95,
}
SMODS.Joker{
key = 'j_chikenjokey',
loc_txt = {
name = 'Chiken Jokey',
text = {
'If the first hand played is a pair',
'destroy the played cards and gain',
'{X:mult,C:white}#1#X{} Mult',
'Currently at {X:mult,C:white}#2#X{}',
}
},
atlas = 'j_chikenjokey',
...
for some reason i was thinking you meant arabic numerals and i was like “you mean the numbers we use in english?”
done
i didn't know i would make it rare joker so i didn't make it that but it could've been called cannibalism
truly a missed opportunity...
r.i.p
jim
"bo"
EREMELLLLLLL!! FINISH REVAMPING THE DOCUMENTATION AND MY LIFE IS YOURS
(do you know any examples i can look at)
me when editions recently got a calculate function and there wasn’t anything in the documentation about it
no idea
the booster packs i made aren't appearing naturally in the shop even when i set the weight to like 20
:(
im assuming your atlas is just the chicken jokey sprite right?
@red flower is this better
much better
chicken jockey 🗣️
yes exactly
y this mofo not appearing regardless of whatever weight value i set
I am working on it slowly
how does the prefixing work exactly? i think that's where my issue lies. im getting an error saying failed to collect file data for Atlas CHK_j_chikenjokey. my prefix in my json file is set to 'CHK'
the key should be j_CHK_chikenjokey methinks
but also that shouldnt be the atlas name
what does juice_up do?

the lil shake
what should the atlas name be? i had it as Jokers.png originally
shimmy shimmy
should it be like CHK_Jokers.png?
that's the file name of the image
yeah
just need to figure out how it works hmmm
i can be whatever as long as you have the correct name in the atlas definition
does prefixing affect this?
not the file name
yes they do?
what
aint it just whatgever key you give it
ok but fix the blinds though
modprefix_key
yeah its automatic for your own objects
no
so i should manually prefix in my main.lua for the joker like atlas = 'CHK_j_chikenjokey
nah no need
no
okay hm idk what im missing here
i have that SMODS.Joker call in main.lua as of right now
and my folder structure looks like this
i mean the image thats throwing the error
just to make sure we're on the same page, this is the structure of an atlas definition
├── assets
│ ├── 1x
│ │ └── j_chikenjokey.png
│ └── 2x
│ └── j_chikenjokey.png
├── Chiken_Jokey.json
├── jokers
│ └── chikenjokey.lua
└── main.lua
ignore the jokers folder, i moved the chikenjokey.lua content into main.lua for debuggin reasons
no i dont prefix the atlas key with CHK, should i be doing that?
no need
inside your joker definition and in the atlas definition you dont need to be prefixing with the mod prefix
is this correct for juice_up?
just for clarity here's what i have, im not manually prefixing
SMODS.Atlas{
key = 'j_chikenjokey',
path = 'j_chickenjokey.png',
px = 71,
py = 95,
}
SMODS.Joker{
key = 'j_chikenjokey',
loc_txt = {
name = 'Chiken Jokey',
text = {
'If the first hand played is a pair',
'destroy the played cards and gain',
'{X:mult,C:white}#1#X{} Mult',
'Currently at {X:mult,C:white}#2#X{}',
}
},
atlas = 'j_chikenjokey',
...
wait i have a prefix right there am i stupid
it ignores it
yeah i imagined as much
what's the rest of the file
also your key should just be chikenjokey in your joker definition
...
rarity = 3,
cost = 10,
config = {
extra = {
Xmult = 1.0,
Xmult_scaling = 0.25,
active = false,
}
},
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
pos = {x = 0, y = 0},
loc_vars = function(self, info_queue, center)
return {
vars = {
center.ability.extra.Xmult_scaling,
center.ability.extra.Xmult,
}
}
end,
check_for_unlock = function(self, args)
unlock_card(self)
end,
calculate = function(self, card, context)
if context.before and next(context.poker_hands['Pair']) and #context.poker_hands == 1 then
sendTraceMessage("[context.before] A pair has been played!", "ChikenJokeyTraceLogger")
card.ability.extra.active = true
card.ability.extra.Xmult = card.ability.extra.Xmult + 0.25
elseif card.ability.extra.active and
context.destroy_card and
context.cardarea == G.play
then
sendTraceMessage("[context.destroy_card] Destroying the cards", "ChikenJokeyTraceLogger")
card.ability.extra.active = false
end
end
otherwise the full key would be j_j_chikenjokey
what's the difference between the name and key of a joker
great info im going to try removing the j_
display name vs. what the code reads internally
hi alrexx
Joker vs. j_joker
ah
herllo
the key is what SMODS uses to make sure it has the correct joker, name is what you see
thanks
That’s not true
😨
well
still not seeing my issue :'(
name in a SMODS joker definition doesnt work really
but name in a loc file/definition is what you see
name is some like vanilla thing i think actually
name as in card.ability.name is in vanilla the name of the joker, but in a smods joker object you can set it, or it’s auto populated with the key. It’s recommended that you check the key of a joker to find what you’re looking for to stop mod conflicts
does it crash
everything works for me without the atlas
keys are really important because if you have multiple mods that have the same joker name SMODS can still know which joker is which
alright, thanks
wtf really how
yeah its crashing
post log
-# halp
THAT WAS IT LOL
bro spelt properly unintentionally
fml
uhh is the file loading?
yea it appears in my collection
maybe you are unlucky
i set the weight to 20 and it still didn't show up
nuuu
if this shit dont work im done
you can also always just debugplus it
okay there it is
well now that i can actually work with this
i just wanted to make sure it does show up in the shop
how could i add a tag based on the currently hovered over tag in the collection with a keybind? trying to add more stuff to the debug menu and this isn't working for some reason (sorry for the picture instead of a screenshot, my laptop doesn't have Internet at the moment)
can someone direct me to how i check for a hand being the first hand played?
pressing 3 already works
on a tag?
yeah
just tried it without my mod, it definitely does not
are you using debugplus?
yes
i am not
well that would probably violate its license since my code is under the unlicense and debugplus is not
if i help you i would just use that code so it would be the same
dusk 2 and dusk 3: the graveyard pack
which is why I'm trying to do it myself
but my implementation won't work
which is why I'm asking for help
the cycle
how does one add custom text to challenge descriptions
God that was delayed
localization file in the first image?
yes
my favorite 🙃
they grow up so fast 😢
the dusk lookalikes are gone forever..
If I want to make a card visually disappear with a dissolve effect, and then move it to another card area, is the trick to just copy the start_dissolve implementation and remove literally just the event that containst the remove call?
thats what i would do
The shovel
3 probability checks, based off those scratch cards
oh yeah oops
random idea: special “attacks” as playing cards that are activated on discarding the cards
oh wait i can cook with this, imagine action commands from paper mario but using the playing cards
am i on something or onto something
ooh
i like the design of it
cause it could be a double edged sword
sometimes you dont want your enhanced cards all the time and sometimes you do
top here meaning next drawn right
yeah
it also ends up affecting the cards dealt for the tarot packs
so thats another tradeoff
I had a similar design
but it was one of each
ooh
i had an idea for a joker or consumable or whatever that helps you get x of a kinds by moving cards of the same rank as ones your holding further up the deck
are they loud
there are no base game challenges that disable skipping, right?
Hello, everyone!
I started playing around with mods about 2 days ago by modifying the Ace in the Hole deck mod I found here. Basically the same, but with a config menu
However, this mod was originally made last year so it's not up to date with how it should (?) be done
I'm going to re-write it like god intended, but I would like to keep this "original" (and wildly unbalanced) version archived somewhere. Should I start a new thread on modding? Or should I send the .lua file to the original mod's thread?
should probably make a new thread (with permission from original modder, if possible)
also idea to throw out there: using SMODS.calculate_effect() to merge joker together using a sticker
(imagine stuff like Canio and Pareidolia together)
i know cryptid has like double sided jokers but having two effects in one joker always active would be hype
is there any documentation on what the weights are for different rarity of jokers? and can we make a new rarity that is a part of the same pool as an existing rarity? (just for visual purposes, creating a new rarity)
i think in SMODS.create_card(t) under Utility Functions it has a section describing how vanilla rarities are polled
thank you, i will take a look
check the wiki not the code idk if that was clear 😅
oh cool, some common jokers are more common than the others?
thought its all a part of the same pool, pretty cool
anybody got an idea?
what is it supposed to be
the rarity is legendary
and the character is from a game called it's not me, it's my basement
yeah just give me some context on character so i can think of something
in the game they basically feed a "monster" (may or may not be their imagination) so that the monster doesn't get upset and eat them
no, that's the probability value for each rarity
when using add_card, what 'set' would playing cards be in?
doesn't work with playing cards i don't think
ah okay
the range implies that the common jokers that are closer to the lower bound of uncommon probability are less common than the ones that are not, correct?
if i'm not mistaken playing cards are either 'Base' or 'Enhanced'
jokers don't have individual weights, what that says is that instead of doing pseudorandom() < probability it does yournumber < probability
mynumber < probability of what?
oh theres create_playing_card() nvm
local poll = yournumber or pseudorandom()
if poll < 0.7 then
rarity = common
elseif poll < 0.95 then
rarity = uncommon
else
rarity = rare
end
ohhh i see okay so it doesnt matter if "yournumber" here is 0.1 or 0.2, it will still be a part of the same group as everything under 0.7
yes
awesome thats perfect, thank you!
mild mannered and responsible hmm
idk something to do with steel cards? just giving that sort of vibe
so this code i currently have should have this joker do its flip animation event after another joker triggers, but the problem is that the animation triggers twice. how can i fix that?
better crop that makes sense oops
Do you have anything else before that context.other_joker check
for some reason, this set up for a new rarity is causing the following error
is there something else that i have to implement?
within the calculate function, no. this is the entire calculate function
okay one second
Then there must be multiple contexts in which context.other_joker exists
i didnt hit paste pretend i did
that worked but now it shows this
steel cards give x2 mult when held in hand instead of x1.5?
Oh well, you have two flips there
yeah it is legendary so it doesnt matter if it is broken
well yes
it needs to do a full rotation
The way you setup the localization must be wrong, but idk whay the right wqy is
okay, i will look into it, thank you
Oh, then yeah it's what I said, context.other_joker must exist in multiple contexts
well how can i narrow the trigger down to only when another joker triggers its effect
you need to add more conditions to filter the context you want
I'm not sure what contexts are available for that
If they're not in the wiki you'll have to experiment
Try logging the context
elab?
Use post_trigger
It should run after every joker trigger
btw how do you get that font, are you using vs code?
one sec
so if context.other_joker and context.post_trigger
?
anything wrong with this?
Just post trigger should be enough
G.hand.highlighted is a list of cards
install game font from decompiled game and add to your vscode through settings
oop
ill see
could’ve sworn i tried it but maybe not
Hi chat!! I'm bad at coding, but why doesn't this code allow you to build full house
local get_X_same_test = get_X_same
function get_X_same(num, hand)
return get_X_same_test(num, hand)
end
it didn’t do it
gonna try with the and thing for the hell of it
is this right
oh wow where’s that
that's a screenshot from my mod
It’s in the wip docs
does this look right? im trying to check if a scored card is a bonus card then create a random consumable but im not sure if im getting everything right so far
Remove the outer joker_main check and the return statement
context.other_card.ability.name == 'Bonus Card'? (from Golden Ticket )
why is the text white when i defined it as black in SMODS.Rarity
idk why
dangit i forgot to install debug+
SMODS.has_enhancement(context.other_card, 'm_bonus')
is there another way to define color of text?
is the discard cardarea like for cards youve previously discarded this round or is it just your previously discarded hand
is that all of the vars i need for it's effect or do i need more vars
i dont think theres a way to define text colour
not that i see at least
I'm trying to draw a high detail joker, but the stickers are tiny. Is there a way to scale them up?
so always just white?
is this how you delay code?
everything looks right to me
Any cards you have discarded/played in the round
use an event, and trigger = 'after'
i see
delay = seconds
oh i see
thanks
yeah
i see, ty
like do i need a var for it to detect steel cards or am i asking stupid questions
nah
same error
wait why are you returning that
why is this considered a nil value? should it say G.jokers instead?
i was referencing the example mods
i think so
i dont think you're suppoused to return them
return the print part and get rid of joker_main
so like this?
like this?
trigger = "after",
delay = 5,
func = function()
print("Hello, world!")
return true
end
}))```
trigger should be first i believe
if SMODS.has_enhancement...
return{
print("beans :3")
}
it works
nice
print is just there as like a placeholder
now to actually make it do something
uhhh
what are you trying to do
apply enhancement to playing card
i know the code to do so isnt there but
yeah
its a tarot card
oh
you can play arround with it and add flip
how does one make a joker create a random consumable
SMODS.add_card({set = pseudorandom_element(SMODS.ConsumableTypes, pseudoseed("any seed"))})
calculate = function(self, card, context)
if context.before
and context.cardarea == G.jokers
and not context.blueprint
and not context.retrigger_joker
then
card.ability.extra.xmult = 1
elseif context.other_joker and context.other_joker.ability.set == "Joker"
and not context.other_joker.debuff
and context.other_joker.config.center.rarity == 'csmr_preserver'
and not context.retrigger_joker
and not context.retrigger_joker_check
and not context.blueprint
and context.other_joker ~= card
then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_gain
G.E_MANAGER:add_event(Event({
func = function()
context.other_joker:juice_up(0.3, 0.4)
return true
end,
}))
return {
message = localize({
type = "variable",
key = "csmr_xmult_gain",
vars = { card.ability.extra.xmult_gain },
}),
colour = G.C.MULT,
}
elseif context.joker_main then
return {
message = localize({
type = "variable",
key = "a_xmult",
vars = { card.ability.extra.xmult },
}),
colour = G.C.MULT,
Xmult_mod = card.ability.extra.xmult,
}
end
end
I made a function to check if other jokers have the rarity "Preserver" and if they exist in the joker area then i want to give the current joker x1 mult. Right now based on the placement of the current joker, it does not count rest of the jokers in its xmult calculation. How would I fix it?
you can also limit it to {"Tarot","Planet","Spectral"} instead of SMODS.ConsumableTypes
if its SMODS.ConsumeableTypes does that let it spawn any consumable, even ones that are modded in?
yeah i think so, i might be mistaken tho
oh yeah i am almost mistaken
local sets = {}
for k, v in pairs(SMODS.ConsumableTypes) do
table.insert(sets , k)
end
SMODS.add_card({set = pseudorandom_element(sets , pseudoseed("any seed"))})
alr, ill try this!
where did i fuck up (this is in loc_vars btw)
#G.jokers.cards
would it be better to put it in the calculate function or at the start of the script
like the sets and for k v
in calculate because other mods can load after yours
alright
same crash
it shouldnt be
Would SMODS.ObjectType allow me to like group things together so I can easily disable them later
or like i forget what Cryptid uses but something like wht they do
this is when i hover over the card if that helps
is it the same crash log
it works :D
oh it's in the collection?
yes
you need to have a check if G.jokers doesnt exists
is there any builtin thing for drawing a dynamic text object that has an updater callback function? i see there's a DynaText class in the game but can't find an example that has it auto-update, so if it does id appreciate anyone pointing me at an example of this use case
how would i do that
would it be like if G.jokers = false or something
if G.jokers then
oh i was close
i wanna display restart required: yes in a settings tab depending on some boolean, feels very simple but 🤷🤷
dynatext can have a ref_table and ref_value and that should update automatically but idk if it does
i know UIT.T does
is this for like your config tab in your mod?
im using UIT.T and keeping a ref to the node but i guess passing it to create_tab clones it so my ref gets stale / doesn't affect the actual object being rendered
I'll try DynaText with ref_table, thanks
yes
someone's contributing the settings page & i wanna make that smol addition
(never tried writing UI before because the game's ui code scares me)
it should update yeah
basically what N said, I admittedly am not the best at balatro UI (i struggled for a while with my own config tab)
everyone asks me for UI stuff so I guess I know things
no more card for you
bump
can you elaborate on the effect? i dont completely get it
is there any way to make a card return to the player's hand after being played? other than just destroying it and remaking it which ideally i dont want to do
i think i messed up rendering that card copying compatibility ui thing
so i have a few jokers that have a rarity type called "Preservers" (same as uncommon, think of baseball bat that gives 1.5x mult to each uncommon card), i want this joker to gain 1x mult for each of those jokers the player owns.
The current implementation does that but its positional, i.e., if the joker is placed in the first position and there are 4 "Preservers" after it, it would just give 1x mult instead of 4x.
cause it's not showing up
theres probably multiple ways to do this but my first thought was to just have it so that it returns the discard to the deck and then the deck to the hand? cause theres functions that allow you to do that
Couldn't you use the update function to check how many jokers there are and set it to + 1 that?
does it need to gain every hand?
you never need to use update
it just recalculates incase player sells another Preserver joker
you can just loop through G.jokers.cards in joker_main and then multiply xmult_gain by the amount
if you need the message then do it in before
so it would be if context.joker_main and context.before
for k,v in ipairs(G.jokers.cards) do
xyz
?
context.joker_main and context.before don't happen at the same time
just one of those
context.before is used for stuff like hand upgrading jokers like Spare Trousers and Runner and the card modifying jokers like Vampire and Midas Mask
if they need to have an animation of the joker "upgrading" like they have now then i think it's the right context
should it not be in loc_vars is that the issue
cause then where should it go instead
no thats correct
generate_ui mayb- oh
are you returning the main_end?
in that case yeah it doesnt show the thingy
oh my god
theres no way i did the same mistake twice
how exactly does the context.remove_playing_cards context work? is it run once for each card or is there a table i can read from to see info about the cards destroyed
context.removed is a list of cards
thank you
which context would be correct for running a function on a card in a scored hand just before its sent to the discard?
let me try
yeah i do
still didnt show up, do i add like a # setup in the localization file?
can u show me the whole loc_vars
return {vars = {.....}, main_end = main_end}
hey all, if i wanted to ask a quick question about a difficulty im having with textures, would i ask that here or in another channel? 🤔
Does anyone know off the top of their heads where the actual position of cards within a cardarea's array is set during/after a drag? I want to make a soft separation in my consumable area between types of items so that you can't mix the two types (for ease of organization basically)
this is the right channel but idk anything about that personally
ahh fair
i just slapped my texture image into the game files but for some reason specifically scholar maintained its texture lol
you could try using malverk for it
ill look into that
but if anyone knows why this might be happening id love the advice
(and if anyone knows please ping me)
FOUND IT
There are two scholars in the asset
bit of a dumb question but is it more accurate to do pseudorandom('seed') < probability or pseudorandom('seed') <= probability?
OH RIGHT OUTSIDE OF VARS YEAH
my understanding is that pseudorandom creates numbers with enough digits that those are functionaly identical
👍
oh also how do i make my custom suit not show up in decks unless i specifically want it to show up in a custom one?
the wiki page for suits does mention something like it with in_pool but im still not really sure how to use that
now i'm stuck at calculate...
what (i assume vim) theme is this
i like bright text themes, my fave is moonfly
how do i start in modding?
download lovely, download steamodded, look through the steamodded docs
tyy
np
youll end up asking a lot of questions here still but such is the nature of modding
yeah im sure i will ask a bunch of stuff, specially since its my first time in lua language
#1349064230825103441 has some good resources as well
tyty!
Hmm I'm getting a crash here
table.sort(self.cards, function (a, b)
if a.ability.set == 'Stand' and b.ability.set ~= 'Stand' then
return true
end
return a.T.x + a.T.w/2 < b.T.x + b.T.w/2
end)
end```
I tried to add this hook to the CardArea:align_cards() function to make it so my Stand cards are always soft-grouped on the left side of the consumable area, but for some reason, it says this sorting is invalid if and only if I have more consumables than available slots due to using debug tools. Anyone got a clue?
Do jokers trigger their remove_from_deck function when blueprint is moved off of them? If not, how could I make something trigger when the blueprint is moved off?
Okay nvm I just had to put a specific inverse check and return false apparently
what exactly is a key?
An internal identifier for an object, usually accompanied by a prefix if it's from a mod
So there's the Space Joker, but internally it's called j_space
in a programming sense, a "key" is the identifier of a value in a key-value pair. The entirely of lua is structured as tables with keys and their paired values
key = 0
}```
So the key for this value of 0 is 'key', or `table.key`
there is the
SMODS.Class {
key = 'key',
other_param = 0,
loc_txt = {
-- ...
},
part, the "key" should be what? like the name or something?
anything
Just whatever you want to identify it as
The key should be a simplified version of the name that you can reference back to later, all one word and without capitalization
oh okok, like a variable in python right?
yeah like the variable name
oh okok, ty
the class is just if its a joker, tarot, spectral etc right?
Tarot and Spectral would fall under the Consumable class
But yeah
Remember to reference the documentation, all of the classes are shown on the right sidebar
https://github.com/Steamodded/smods/wiki
You can also access the source code of Balatro by literally just extracting the balatro.exe file with 7zip
working on a diamonds skin :3
ooh okok, tyy!
So you can search around and see how LocalThunk did some stuff himself
in a suit's in_pool function, is there a way of telling if it's a vanilla deck or not?
Looks good, would probably be a bit hard to read at a glance though
I would honestly just check to see if it's Spades, Hearts, Clubs, or Diamonds, but there's probably a way to do it legitimately
what do you mean? i'm trying to stop my custom suit spawning in vanilla decks
do you mean take ownership of every vanilla deck or smht
any clue how to check the current deck type then?
I'm not really sure what you actually want to do, so
check if its a vanilla deck so i can return false in in_pool to stop it spawning in vanilla decks
i want my suit to only spawn in specific decks
What would be a function to call in context.discard to trigger cards with gold_seals when they're discarded?
figured it out, i'm checking if a table of the decks i want it to spawn in contains G.GAME.selected_back.name
can't wait to get the first version of my mod out, i wanna try modding Scoundrel into balatro after
ok ive seen most of how to do the mods, but where do i actually make the mod (like, the code part)
wait does vscode have compatibility with lua?
didnt know bout that
lua extension
is this right
no, the last "trigger=after" shouldnt be there
also please don't spaghetti code and put stuff in different lines
ok
how do i use a custom suit's text colour in a loc txt?
this?
Decided to actually post my mod in #1209506514763522108, first time I've actually like, publicized a mod I've made
Integrated the effect with calculation. It seems to handle card destruction well enough; I wonder if it needs more safeguards, but it seems functional for now.
I wonder how to handle pop-up messages.
how does mod compatibility work? cause i have looked over some mods files and neither cryptid or sleeves mod have the custom sleeves assets but it shows up ingame for some reason?
Anyways, the Red King
@tepid crow
are you looking for the cryptid sleeve assets?
you can find them here https://github.com/MathIsFun0/Cryptid/blob/main/assets/2x/atlasSleeves.png
in short, CardSleeves defines the API to use, and Cryptid provides the effects/assets
Thanks for tagging me on a question actually relevant to my mod and not someone else's 😭
how would i make it so that the steel card multiplier changes from x1.5 to x2...
You could take ownership of it.
yeah how would i do that
i'm a bit new to modding but i'm just trying to do the best ideas i can without caring about how much lua experience i have
oooh, i wasnt seeing it in the files, tyty!
Try this ```lua
SMODS.Enhancement:take_ownership('m_steel',
{
update = function(self, card, dt)
if #SMODS.find_card('jokerkey') > 0 then
card.ability.h_x_mult = 2
else
card.ability.h_x_mult = 1.5
end
end
},
true
)
I haven't tested it though.
how would i add a little info window about an enhancement?
info_queue[#info_queue+1] = G.P_CENTERS.key
Replacing key with the key of the object.
where would i put this
so do i need a calculate function or
You shouldn't.
do i neeed to add lovely to the "dependencies" part?
what about the config or loc_vars
No, because you can't run mods without lovely.
Oops next time I’ll remember to tag you when Paperback is mentioned
no trailing comma here ], for proper JSON
i am thinking i probably don't need those but I'm Not So Sure
You should be able to keep those.
oh okay
is there any good way to include a raw plaintext "#" in localisation text
okok, so just that or anything else?
Everything else seems fine at first glance
okok! tyy
In loc_vars
ok
not pretty but you can return "#" in loc_vars
makes sense
?
i always do TWO things wrong
No, it should be outside of the return statement.
ok ok
what do you want smods.
Also you need to put G.P_CENTERS.m_prefix_redbulls
WHAT?!?!??!? WHAT IS WRONG?!??!?!!?
JUST TELL ME!!!!!!!!!!
