#💻・modding-dev
1 messages · Page 140 of 1
silly goose
thanks!! :D
shall we get it done now and then I'll document them all?
oh wait i thought you were talking about something else
silly me, it's 1am and I'm tired
I did add context.main_eval
I'm not sure there's any others that need to be added
cool cool, I'll take a look through and add any that might be missed
(i just copy pasted the code from DNA
)
oh wait
i just didnt materialize it
holy indentation
they call me god they way i make space
also can someone explain to me why like half of the parentheses in the vanilla code are backwards
like on the other end of that Event
whats up with that
Ough you have much to learn about coding
Everything within those parenthesis are defining what happens in the Event
hey real quick
i need to do something more than this to actually set up the ID right?
He meant at the end of function
The empty ones
i cant seem to find what im looking for using the search, but how does one add a joker to the jokers table, like programatically add lets say perkeo to the joker roster?
in your mods json file you set the prefix
I thought they were asking about the ones that close the E_MANAGER
hey dont worry my head is made of steel and the wall aint got nothing against me
Pls use json instead of a header
https://github.com/Steamodded/smods/wiki/Mod-Metadata
anyone know about this?
cryptid does it with one of its decks
im not too sure how but thats probably a place to look
do you know which one?
if not im just gonna restart the game with Talisman installed
equlibrium deck
tahnks
modName.json would work
[SOLVED]: #💻・modding-dev message
Hello, I am creating a small mod and I want to update the multiplicator of a card with the number of stone cards in the full deck x2
Here is my code:
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
local new_mult = 0
for _, v in pairs(G.playing_cards) do
if v.ability.name == "Stone Card" then
new_mult = new_mult + 1
end
end
self.ability.extra.curr_mult = self.ability.extra.curr_mult*new_mult
end
end
However, it doesn't work. I used the Sandshrew card from pokermon as an example
check stone joker from vanilla
Also if there are some docs about different contexts I'm interested
I can't find the code for the vanilla jokers
extract balatro.exe as a zip
heyo! final thing,
this code works, but it only copies the first card
even if i have multiple cards with fecundity, all of them trigger, but they all copy the first one
dont mind the rats
yes, i saw the card.lua but i cant find the calculate functions, if there are any
RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS
ctrl-f the joker name
RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS RATS
🐀
anyway yeah idk why it does that lol
i just yoinked the code from DNA so thats probably it
but idk what the actual problem is in the script
oh wait
im dumb
just a second lemme try something
i apologize if this is a stupid question, but i installed DebugPlus, how would i use it to spawn my custom joker i made into a round?
hover over it in the collection and press 3!
all the keybinds are in a text file in the mod
oh awesoem tysm!
mhm!
is it possible to define a new function for a custom joker
im pretty sure, yes
something like this
i saw cryptid doing something like that when i was peruzing
you can do that
or just hold tab
OH WOW
yeah thats useful
im pretty sure it has something to do with this, it being the first card in the full hand, but i tried a bunch of ways of removing this and nothin works
hello, i've just finished making my first joker. it works perfectly, but... did i need THAT many checks in the if statement for it to work? i know end_of_round is one of the trickiest contexts, but if someone knows a better way, please give me some feedback
Thanks @cerulean rose , it works now !
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
self.ability.extra.curr_mult = 0
for _, v in pairs(G.playing_cards) do
if v.config.center == G.P_CENTERS.m_stone then -- strange thing with m_stone
self.ability.extra.curr_mult = self.ability.extra.curr_mult + 1
end
end
self.ability.extra.curr_mult = self.ability.extra.mult*self.ability.extra.curr_mult
end
end
Here is the updated code if anyone has the same problem
seems very similar to golden joker
I think you only need the end_of_round one.
Go look up “Joker Calculation” in Steammod document if you want to learn more.
its slightly different because its before the calculation so interest goes up
^
How would I go about making a visual mod for the game?
Crashes the game if its only that one
and yes i did check out the that guide while making this
The crash was caused by the repetition context
rolo helped me to fix the joker, it pretty much requires many of those checks or else it crashes the game or gives a lot of money by retriggering itself
we wanted to know if there's some suggestions for optimization
the problem:
i am trying to tell the description what my joker (mimic joker, copies a random joker each round) what joker it is copying this round, and i have no idea how to do that
does anyone have any input on that?
Thank you
Does anyone know the simplest way to make it so specific Jokers can't be in shop if you have another in the list
kinda like michelle and cavendish?
I mean I guess
ill be honest, no idea
the opposite tho
oh yeah good point
I have 10 Jokers that override the background music, and I don't want you to be able to have multiple of them, as only one can do the effect at a time
i have looked around and could not figure out how to get all the available vouchers, is there someone that can help me with that?
i've looked around in the game couldnt and couldnt figure it out
they're in SMODS.Centers alongside other center-type objects
you'd have to figure out which in that list are vouchers
whats in Centers, what define center type objects?
use the in_pool method
https://github.com/Steamodded/smods/wiki/SMODS.Center#api-methods
I keep being directed here, this is like the 10th time today no joke and I've said every time that I have no clue what I'm looking at
I see the in pool
I'm aware I need to use that
How
you specify a function that returns whether the joker is allowed to spawn
it's defined in the same place as calculate
can i bump this?
i really would appreciate some help with this as im completely out of ideas
card.ability.extra.selectedJoker
if it's pointing at a Card object, it would be card.ability.extra.selectedJoker.config.center
so inside calculate
or like before
before
so thatll give the name of the selected joker?
no, that'll give the center of the joker
you should be able to add a tooltip with the center digitaldetective just gave you
if you want the name inline, maybe check HOOK://
Is a x2 folder needed?
ok i'm not gonna lie I'm just getting more confused staring at this webpage
Yet again
yes
its used for pixel smoothing
...
in_pool = function(self, args)
// put code here
end,
calculate = function(self, card, context)
...
Ah, if I turn off pixel smoothing, it uses x1?
yes
Thank you
I understand I have to use the in pool function.
How do I use it.
What code goes there?!
Nothing is on the page for that
ok but how do I specify that I want it to spawn when the other Jokers aren't there
This is just a static do or don't spawn
no, it's a function
use SMODS.find_card to check if you have a certain card
here's an example from a custom blind i made
in_pool = function(self)
if G.GAME.round_resets.ante < 3 then
return false
end
for k, v in ipairs(G.jokers.cards) do
if not v.ability.pinned then
return true
end
end
return false
end,
this makes the blind only spawn if you have a joker without pinned and are on at least ante 3
but dont i want the name of it so i can put that in local_vars?
(sorry if im not sayin anything useful im so tired of working on this guy)
check how cryptid's HOOK:// gets the name of a joker
ok
so would it look something like what I put in the first Joker here?
heard, sorry, very new to this
it would be
in_pool = function(self, args)
return not SMODS.find_card("j_MUSC_inrainbows")
end,
so is that telling the pool to no longer have those cards if this function is ran?
that would make inrainbows impossible to grab if I have davidbyrne ?
no, the function is evaluated when the joker pool is determined
so that means that davidbyrne can't appear if you have inrainbows
yes
🦈
I have 10 Jokers that this must be compatible with
Do I just do this for 9 on all 10
Or is there a global function
there isnt a global function by default
but you could define a function in your file
it's localizing the joker key
so that it will display the joker's name in the selected language
i dont see anything starting with v_ there's only packs and celestial
for k, v in pairs(SMODS.Centers) do
sendMessageToConsole("Info", nil, k)
--if starts_with(SMODS.Centers[k], "v_") then
-- sendMessageToConsole("Info", nil, string.format("voucher : [%s]", dump(SMODS.Centers[k])))
--end
end```
am i doing something wrong?
in_pool = function(self, args)
return not SMODS.find_card("j_MUSC_inrainbows") and not SMODS.find_card("j_MUSC_nwa")
end,
which only has the modded stuff
Is this what it would look like to make it do it for 2
try G.P_CENTER_POOLS.Voucher instead
ok brb
wait actually you should add , true to the call if debuffed jokers should count
see the docs for SMODS.find_card
https://github.com/Steamodded/smods/wiki/Utility
returns a bunch of indexes
then try the value not the key?
it says , count_debuffed instead of true
But I got you
count_debuffed is the parameter name
hey! im back :3 can anyone help with this?
isn't that the pool of vouchers that can spawn currently
so it wouldn't include all vouchers
https://github.com/Steamodded/smods/wiki/calculate_functions bettercalc calculation guide is roughly done
no value, its so weird
replace context.full_hand[1] with card
wtf
print value.key
that was it!
thank you very much
now to make it a 1 in 4 and the sigil is completely done!
what'd you do 👀
I mean the value is a table so if he's trying to manipulate it as a string it wont like that
yeah but it should've crashed if he tried to concat it with a string
unless he just misspelled the value variable in the code
im at a wall here, i have this joker that crashes with this
the intent is that whenever a king or jack is discarded, 32 chips are added to a pool. then when a queen is scored, that queen is upgraded by however large the pool is (similar to hiker)
however it crashes whenever a king or jack is discarded with this error
and im not quite sure why
i forgot to put [%s] in my string in the string.format("voucher : [%s]", dump(v))
poking in the game source for these functions didnt help unfortunately
Ah. This is why I hate having to format my prints
just let me print(var)
yup using the proper syntax for string.format does help
or let me do like f"voucher {var}" you know
a fellow pythonista in my lua modding-dev, I love it
I don't understand why you're formatting it anyway
do you have the full error?
yea give me a second
not sure what the issue is, but i feel like 32 should be stored in the card config
also when would it be nil?
ooh wait this is an old version of the code
hold up
that was when i improperly referenced variables
this is up to date
what for?
its a hardcoded value either way
also card = self is usually wrong in steamodded code, but I'm not sure that's the cause of the crash
heyo rq can someone code review me here
for i = #G.playing_cards, 1, -1 do
local card = G.playing_cards[i]
if SMODS.has_enhancement(G.playing_cards[i], "m_pencil_diseased") then
G.playing_cards[i].ability.remaining = G.playing_cards[i].ability.remaining - 1
if G.playing_cards[i].ability.remaining <= 0 then
G.playing_cards[i]:remove()
end
end
end
this is in a lovely patch btw
its crashing when a card is discarded so i doubt it
make it changeable by cryptid glitched or oversaturated
cause i cant just print a table, and i hate that
but why do you want to print the full table? it's almost all entirely useless for what you're trying to do
Local variables:
self = table: 0x09273540 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x09a63d60 (more...)}
dt = number: 0.00353747
(13) Lua field 'update' at file 'main.lua:996'
Local variables:
dt = number: 0.00353747
(14) Lua function '?' at file 'main.lua:935' (best guess)
(15) global C function 'xpcall'
(16) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 906 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])```
and also this as well (sry for wall)
it's probably unhappy that the message is a number rather than a stirng
ah yeah that's probably it
guess i gotta go figure out how to force lua variable to be string or something.
tostring should work
and vice versa?
or use localize with a +chips message
Digital my man
I think the code worked too well
They don't seem to be appearing in shop at all now
how'd i go abt doing this?
im very new to lua and balatro modding in general i have no idea how i got any of my other jokers working
I used DebugPlus to give myself $4000 and and I didn't see any of them through the rerolls
Like I couldn't even get the first one
Which is weird because previously they were showing up frequently
localize({ type = "variable", key = "a_chips", vars = { card.ability.extra.pool } })
oooooh
thank you!!
how would i put this in a description though? or does this produce a string
oh i thought you meant for the message
no im pretty sure the issue is
"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chips)"
no, don't think so
oh wait im stupid
i understand what u mean
maybe i should go to bed Anyway thank you!!
if it's crashing when trying to display a message then
yea i got it
@cerulean rose
ok, so now that i get the voucher list, how do i add all of them to the current shop?
why? 🤔
cause im trying to unlock everything so testing things is easier
can you send the in_pool function again
what's wrong with https://discord.com/channels/1116389027176787968/1228149931257237664 ?
i didnt know it existed
here's just the first joker
not sure why that's not working
try adding a print for each SMODS.find_card call
where do I add this print
a true XY problem case
that is a crazy way of setting a pool of joekrs to be unique
thank you thank you
oh what would you reccomend?
i have NO CLUE what's happening
in_pool = function(self)
if G.GAME.MUSC_present then return false end
end,
add_to_deck = function(self)
G.GAME.MUSC_present = true
end,
remove_from_deck = function(self)
G.GAME.MUSC_present = false
end
something like this
You're not supposed to have multiple through showman of this bad boy tho
actually how does showman interact with in_pool?
well if he appears you shouldn't take him
not how this works
what
My jokers don't interact with each other, if you take an additional it doesn't do anything
in_pool overrides showman iirc
right but having multiple would break the add/remove deck method
That's why I said you shouldn't take one through showman
Why would you have multiple
but you wouldn't be able to have multiple
we're talking about what happens if you do
Don't
you said you shouldn't take one through showman, implying that it's possible
you should never rely on the player's good will
especially for something so technical
Like this?
wait does returning nil from in_pool act as true!?
cus i'd think you would just do
in_pool = function(self)
return not G.GAME.MUSC_present
end,
local value = context.other_card:get_id()
print("card scored")
print(value)
if value == 12 then
print("queen?")
print(card.ability.extra.pool)
context.other_card.ability.perma_bonus =
context.other_card.ability.perma_bonus + card.ability.extra.pool
return {
message = localize('k_upgrade_ex'),
colour = G.C.CHIPS,
card = card
}
end```
next question - this section is not working properly, ive verified through the console that its properly detecting queens but the upgrade bit never shows and the card isn't upgraded
any more ideas... i feel bad for asking
returning nil treats it as true yes
or rather, it treats it as not being there and goes off base logic
oh that makes sense
the perma_bonus section was gotten from balatro's card.lua and looking for hiker-related code
Ok so I don't know what's going on
They were appearing in shop before
Now none of them appear
hmm i need to figure out why this card is resetting every hand
Same as the last code
It's almost what I want
But they don't have a first one appear
I rerolled 100+ times
They work when I spawn them in through DebugPlus
But they just aren't appearing in shop
They were before this in_pool stuff
ok wait
it seems to be
that the pool variable is getting reset
and i have no idea why
seems like in_pool isn't working rn
Odd
no
?
Reset to nil?
ok why the flip is mine
no to 0
each hand my pool variable gets reset to 0
before scoring happens
and i have no idea why
actually this isn't true
check 2XPWACI4 with strange pencil
normally calendar spawns in the first shop
but if you add
in_pool = function(self)
end,
to calendar's code it doesn't appear
so try this
Will try
i am silly
i set it manually
misread how joker scoring works .
ok part of it is now working
i've patched in a few blind callbacks of my own, but they don't activate matador. is there a standard way to trigger it in those cases?
i could probably loop over all the jokers every time and trigger it manually but that doesn't seem ideal
G.GAME.blind.triggered = true
that's what i thought, but that doesn't seem to have worked
works fine for me

i think i'd need to call calculate joker with the debuff context
hm, no, matador checks the triggered variable directly
Im new to the modded balatro comunity and have been trying to get my game working but it eventually crashes and i dont know what to do to fix it
can someone help me?
try adding a print to see if that line even executes
send crash log
the line does execute, i put it right before the actual action
what i think might be happening is that the blind does get triggered, but matador isn't calculated yet and the moment you play a hand again since there's nothing to debuff it returns to normal, and matador doesn't trigger
do you want me to dm it to you strange
since i'm not triggering the blind around the time a calculate_joker happens
no send it here
known issue with cryptid on the newest steammodded
ok how do i fix it
use this instead
https://github.com/Steamodded/smods/releases/tag/old-calc
do you set the variable after matador would trigger?
Thank you so much Detective that worked
please call me detective
oh sorry
maybe in one of the cases i'm dealing with, but i also set it right before the discard calculation and in one of the blind's press_play, and neither worked
i'm not sure if i'm missing something
should work on press_play i'd think
but setting it on discard wouldn't work since matador doesn't trigger in that context
and it gets cleared when a hand is played
oh well
ok so I tried this one
They appear in shop again
Good
They appear in shop while owning the other Jokers though
Bad
I did notice an error as I was going through though that might have caused it, so I'm going to try one more thing and see if that fixes it
Nope they just don't appear in shop at all now
Ok
here's what it looks like right now
They spawn, they play the music, all that works
But they keep appearing in shop
put back the other two functions
hello balatro modding chat
i am brand new to modding this game. as in like
45 minutes ago new
so please excuse me if i come back here frequently with dumb or obvious questions
dw
im similar i somehow managed to slap together a joker or two and now im deciding to add a new hand
would this not work?
context???
just tried to auto-roll for a modded joker from a mod I don't even have enabled, no wonder it couldn't find a seed 🤦♂️
just calling G.P_CENTERS with the center key like that
hello! does anybody know how to make a joker delete a single random card of a specific rank?
i want to set a cards sprite by using another cards center key but it isnt really working
nevermind it works
https://github.com/Steamodded/smods/commit/90681d942e141c2e9dc032924424de8d76512ea9
how would i distinguish a real card from a tooltip like this?
i have an enhancement description which makes no sense without an actual card existing, so i have a special collection description
That was the one that caused nothing to happen at all
None to appear ever
check to make sure parameters exist?
or you can check for fake_card
no, it was the previous implementation of info_queue that did that
I'm confused
I tried this and it didn't work
(thats me btw)
(if i read the fucking commit i would've realized that)
I see the difference in the two now
I didn't know what info_queue meant
I see how the two versions are different besides the add_to_deck and remove_from_deck now though
Adding the add and remove back in
many such cases. unfortunately
@vagrant cedar
ok now i feel slightly justified in being confused lmao
i fixed it though
it works now
I appreciate the help @cerulean rose @wintry solar
hey how do I get these guys to not trigger every frame
how exactly do i go about testing my mod?
really i just want to do a simple asset replacement mod. im not super interested in poking around in the code for now
ive been cautious to backup any files i want to change before i do irreparable damage to my game that cannot be undone
thanks
im creating a custom hand and it does properly detect
however, the cards dont score
here's the code i have
im probably missing something cause the documentation on poker hands is VERY sparse but
does anyone know where the code that sets the cards into G.play might be
hey guys quick question, trying to add/change some of jimbo's quotes, currently using the localization files but they aren't loading in, does steamodded use a different path for it or am missing something?
is there a way to have a joker not appear in the collection?
whats inside
of?
localization
Is "Stone cards give +81,800 chips" too straightforward for a Legendary-like joker?
no
just the language files, currently editing en_us
hm, not sure
Wrap the whole SMODS.Joker in a if statement.
make sure your new entries are in the right sub‐table
just insanely op
just replaced lq=1 with the quote i wanted but it didn't get replaced in-game
huh?
the lose quotes, that's how they're named in the lua file
can you send the file?
ya don't return things you aren't changing that's very bad
i see, i'm pretty new to this so i just thought editing the files would do the trick
but do i need to do something in order for the game to read it?
the one on the steamodded folder yeah
generally for localization changes you make a steamodded mod as usual and place an en_us.lua (and/or other languages you want to support) in the same folder as your mod
and then you can just return whatever fields you're changing and omit the rest
yeah, just like minecraft resource packs
okay, that makes more sense, is there a guide i can look up for how to make a mod in the first place? kinda just the first time i tinker with stuff like this
awesome, thanks!
is this cursed
yes
yes because it won't work
I mean
oh yeah that too
It did
nvm my bad
also you should either check the number of cards to choose
("a" == "b" or "c") -> true
or make a table for mega booster packs like cryptid's meme pack pool
("a" == "b" or "a" == "c") -> false
how does this work, exactly?
every jokers calculate function is called with the context you see there, for every card in hand
if any of them return then the card is destroyed
actually
that might be left to the joker
this doesn't work either
local allowed_names = {
mega_blahblah = true,
mega_blag2 = true,
...
}
if allowed_names[SMODS.OPENED_BOOSTER.config.center.key] then
--blah blah
end
Damn was that obvious and I'm just silly
i wouldn't call it obvious dw
I'm curious tho why doesn't this work?
can't say for sure without knowing what that variable does/where it's set
how is this code used, if you dont mind me asking? im trying to get my joker's effect to destroy cards working and nothing seems to work
if [context.destroying_card is a card you want to destroy] then
return true
end
end```
this except without the misspelling destroying part
you should probably make this modifiable by other mods somehow (so that modded mega booster packs can also work properly)
colon three
you can also just string.find(key, "mega")
thats also not great cus it enforces making keys for your objects a specific way
Yk mod compat is completely broken with my mod anyway so I'm not gonna worry about it
aight
Change to _mega_ in case anyone want to name their comsumeables "Omega card"
Speaking of which is there a way to disable mods on a specific condition or do I have to like ask ppl "hey could you disable all other mods pls"
me adding a timegate_normal_1 pack
you're thinking of the conflicts key!
ah, im afraid i dont quite understand the if [context.destroying_card is a card you want to destroy], could you elaborate a bit?
just don't search string the key
pretty sure that doesn't work for the one I posted 👀
i was not referring to what you posted
return whether you want the card to be destroyed
fair enough
regardless if you aren't putting mega in the key of a mega pack that's on you
?
context.destroying_card casts through each played card, and you or your joker has to decide whether each card has to stay or go.
I disagree, string find is the better approach
you aren't seeing mega in the key of a pack that isn't a mega
not unless the mod prefix happens to be mega
you could fix that with more pattern but meh
I mean the _mega_ riv suggested seemed pretty idiot-proof
".-_.-_[^o]mega" would work
as for this you cant guarantee the mega is surrounded by underscores (e.g blah_pack_mega or blah-mega-pack
Exept when someone decides to not do _1 & _2 and just _mega
actually already found one, p_bunc_virtual_mega
if we really want to go into it we can search the name and description as well as the key
surely it's not too complicated
and here's one with the opposite problem mega_d6_jokers_pack
this reigns supreme 
But I think the real condition should be [if you can choose 2 card from this pack or other amount].
...i still cant get the destroying effect to work
not if you have a joker that artificially increases number of choices
which is a lot of mods nowadays
oh wait
you can check center

that's equivalent to this regex .*?_.*?_[^o]mega right?
heres another one, p_pencil_index_mega
in this context all this does is make it more expensive
you can guarantee there's gonna be two underscores in the key before a mega can appear
no I just suck at lua patterns so I need to convert it to regex in my mind to understand it
does generic regex not have -
that's the *?
is * not "match 0 or more of the previous character, as many as possible"
I searched the channel and found that you've asked how to "delete a single random card of a specific rank".
Do you want to delete them when they're played, scored, or held in hand?
yeah and the ? makes it lazy
- in a lua pattern will match 0 or more of the previous character, as few as possible
also known as a lazy 0 or more
not sure what you mean by making it lazy
yes
that feels like unnecessary complexity but i guess that's what regex is all about
scored
https://www.lua.org/pil/20.2.html
does this not cover everything
Can we see the part of code that you said not being working?
I'm trying to add a new type of consumable called Zodiac cards. Currently I'm just trying to see if I can get them to show up in the collection in-game. However whenever I try to access the collection I get this error:
How could I fix it?
I apologize if my code is bad, it's my first time modding
did you put the sprites in both 1x and 2x?
yes
in ui.lua:
which probably means it needs alpha value
Seems to cover everything (if you also include 20.3). A shame that it's not documentation for the most recent version of Lua
Thunk sure doesn't >:D
regardless, if you want 5.4 documentation for patterns, it's at https://www.lua.org/manual/5.4/manual.html#6.4.1
i think it's the same but w/e
You need to drag if context.destroying_card out of if context.individual and context.cardarea == G.play ... statement
oh
this activates regardless of if I bought something or not
context.individual and context.destroying_card are mutually exclusive
more context needed
understood, thank you
I mean these are the only two functions that are part of it. I'm trying to make it so it gives 2 hands and discards if you leave the shop without buying anything
and i can't verify things are where they should be in terms of scope if i can't see where they are in relation to each other
right but it sucks that this better version isn't even on my first page of google
we must have different googles then 
I just googled "lua patterns" in a private tab?
makes me wonder why their url isn't /manual/latest/manual.html
Its just this
you're not storing cards_bought anywhere
(also you're resetting the value every time you call the function regardless)
I suggest you put cards_bought in config.extra and reset it every round.
can just reset it in context.ending_shop yeah
Alright I'll make a few changes and see if that works
I can also make the local boss_hands... stuff into the config
Okay this works !
thank you! this worked
now i just need to figure out how to make it destroy only one random king rather than every single scored king
599 lines of code in lua and 11 lovely patches
Most advanced thing I've ever managed to program
in context.selling_card can I see what card was sold?
When if context.scoring_hand, make a list of the scoring kings, randomly choose one, and then store it in config.extra.
And then if context.destroying_card and context.destroying_card == card.ability.extra.[that card] then return true end
Exactly...?
Doesn't need an "in", it IS the card that's being sold.
love this
You’ll want to select your card, probably in a prior scoring step like joker_main and then just check that card matches in destroying card
This is incorrect, selling_card is a Boolean
yes or no
context.card
Do you have a message in your localization called k_drinkme?
That could be the case
I wonder if you could circumvent that with card_eval_status_text
What smods version ?
1.0.0-alpha-1304a
That’s why the message won’t work
?
Old calc is very restrictive in what you can return from a calculate function, you should be developing on better calc
ahh
Is there a way to use {X:} to display a custom colour that isn't a suit colour or CHips or Mult?
If so, how
Add your colour to the loc_colour table
How do I do that
I’m going to bookmark this ^_^ thank you!
What's the best way to find a card function in the vanilla game
To implement into a custom card
Just curious
So not playing needle in a Heystack
Ctrl+F
or ask it on this channel
I guess what's the most common phrase used in a function
Just look through functions
globals.lua and functions/misc_functions.lua
Only loc_colour in misc_functions, the others in global aren’t used for description text
ive heard about quantum enhancements but what exactly are those
Quantum enhancements makes cards function as if they had enhancements without actually having the enhancement, you could say 6s count as gold cards for example
so, I downloaded the newest smods and...
looks like it should be fine if I knew where card.lua was?
found it.
@wintry solar
There’s nothing missing there
the line originally was G.jokers.replace(card) return nil, true return nil, true
and it goes back to that whenever I try to run the game
Screenshot mods folder pls
How did you download smods?
from github
Using git or direct download?
Delete it and try downloading again
You didn’t clean up the old version you had properly so there were some duplicate patches
Since my code is unorganized as hell is it possible to have jokers and consumables in the code or do I have to make a separate Lua
Short answer: YES.
Alright
Just gonna duck tape and glue this mod because I can't figure out custom booster pack lol
Guess my next question would be what's the best way to make a card you can add to ur deck
Similar to rock card but the card can actually do something
like an enhancement? or something more special
Nutshell
Pot of greed in the deck
Instead of being like a number card it's like a consumable that stays in ur deck every round
cryptid made consumeable playing cards, but they destroy themself when used so i imagine for what you want you'd have to either disable destroying them or make a copy secretly
if you want an easy way to do it, i dont think there is one
Sound like purple seal but draws playing cards instead of creating a tarot card
I wonder if it is possible to combine the function of playing a hand
But it doesn't count towards the number hands u play
I wonder if I can find the function in the vanilla game
Can I use vanilla game functions or are we restricted to what smod allows
you can use anything the base game uses
I'll just try duck taping and gluing some code together from the vanilla game
Hey as long as it works
you can even override base game functions, although im not sure thats ideal
Isn't there a blind that draw 3 cards no matter how many are played or discarded?
Look into its code.
Probably
I've played the game a little bit and beaten it a few times but haven't seen everything yet
What's the key value for a booster card?
I know there's tarot, celestial, and Derek for some reason as joker
Found it.
That'll def help
Just look for the function it calls and copy paste it and modify it
functions/state_events.lua
So guessing I have to make a smod.booster
And make the key for the card key = booster?
how do i make it so a joker cant be found in the shop
What line?
define an in_pool function, i think
how would i do that, then
I havent done it for a joker but I did
return false
end,```
cool
im not entirely sure if that works but worth a shot
functions/common_events.lua
the draw_card function
Ty
Also what's the key to add a card in to the boosters
For extra cards in ur deck
function Card:open() in card.lua
the for i = 1, _size do part
Or just look up SMODS.Booster section in SMODS.Center document.
Late reply but thanks, is that in the base game?
Yeah I was about to post that
The smod.booster
Is what I should use correct
Unless I wanna get fancy with it
ok I'll try it, thanks
Also ty for the help sorry coming off as annoying constantly asking for help but I'm more a visual learner and over the years visual guides kinda died out on how to mod games lmao
Actually went back reread the custom booster packs part of the wiki and it got easier to understand the more I fiddle with this
And then for example G.ARGS.LOC_COLOURS['pink'] = G.C.PINK
it just crashes
What about G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS
same error
Value it's trying to call in LOC_Colours in ur mod doesn't exist
Basically saying it can't find whatever it's looking for
You'll have to go to that line it says in the error message in the .lua file
And see if there's a typo in ur code or something
Can u copy paste the code
with ```
People probably be able to help u of they can see it
Possibly the fiction it's calling for has a typo
SMODS.Atlas {
key = "Zodiacs",
path = "Zodiacs.png",
px = 71,
py = 95
}
SMODS.ConsumableType{
key = "Zodiac",
primary_colour = HEX("123098"),
secondary_colour = HEX("5448AD"),
collection_rows = {4, 4},
shop_rate = 1,
loc_txt = {
collection = "Zodiac Cards",
name = "Zodiac",
undiscovered = { -- description for undiscovered cards in the collection
name = 'Unknown Sign',
text = { 'Find me! Find me nowww' },
},
},
can_stack = false,
can_divide = false,
}
G.C.ZPLUS = HEX("5448AD")
G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS
SMODS.Consumable {
key = 'Aries',
set = 'Zodiac',
loc_txt= {
name = 'Aries',
text = { "+1 {X:Plus,C:white} Zodiac Level{} to all played 2s", }
},
atlas = 'Zodiacs',
pos = { x = 0, y = 0 },
unlocked = true,
discovered = true,
}
Here's the entire code of the main lua lol
Which one was on line 28
G.ARGS.LOC_COLOURS.Plus = G.C.ZPLUS
@frosty dock Does current smods allow mod maker add their custom loc_colour?
(I feel like there should be a SMODS method)
"1.0.0~ALPHA-1220a-STEAMODDED" is my version
Maybe HEX isn't a value in the Loc_colours?
Because that's basically what the error is saying
It's saying it basically doesn't exist
Usually what a nil is
No no no, it says LOC_COLOUR was a nil value when the code is processing it
Dumb idea but is it maybe the spelling of colour
Because how some people spell is color
I'm pretty sure smods uses colour
Even the Balatro source uses "colour"
Call loc_colour(‘red’) first
Or just loc_colour() if you don't want to specify
it does need an argument i think
Yeah, this way G.ARGS.COLOURS initiates before indexing
It has default return value _default or G.C.UI.TEXT_DARK
That actually worked
yeah but it tries to index G.ARGS.LOC_COLOURS with its argument
thanks
wooooo more zodiac cards
how do i use this bettercalc target 🤔
Ask it nicely

Pretty sure if u search up xmult should give u some ideas how to add it
Or I'm probably reading it wrong
i think it means i can use a lovely patch to add another cardarea
but the message itself is from a lovely patch so how does it work
I dunno if lovely has a wiki
Maybe probably look there if it does
I'm still trying figure out smod
ok ik
version = "1.0.0"
dump_lua = true
priority = 1```
changing my lovely file's priority to be lower than smod's
smods's lovely priority has been changed to -10 for a while (since the start of january), so even keeping it to 0 would work iirc
bettercalc is 0
Better calc is zero because loads of them whiffed at -10 and we haven’t fixed it yet
but why not -9 
anyone do you tried to animate card or have a singular card have a multiple variants?
that target is another scoring card area, but how do i add another joker-like area that calculates on scoring cards? (into G.jokers.cards + G.consumables.cards)
bettercalc seems much different from a week ago
apparently needs to inject on for k = 1, #G.jokers.cards + #G.consumeables.cards do 
no it's a smod file
🤪
works here
Wait hold up u can use lovely to dump functions of the game?

I don’t think that’s where you want that
yeah lovely is to modify functions
where should i then
In score card and calculate context
This will run in every single evaluation otherwise
Like each check of a joker for an individual card will also run it through all of your spells
Where as I think what you want is each scoring card to go through your spells once
i think ideal place is here
hmm my piece of code is inside main_scoring
I know it's to modify I just didn't know u could dump functions while playing the game
If that file directory means what I think it does
file dump is during the booting screen
i think
Oh that might alright then actually, still think it should be in score card though either after or before the joker loop
score_card is in a smod file, can i inject into that
i suppose lovely patch only works on files in vanilla game
I dunno but being able to dump game functions in real time would be a cool feature for modding
it's supposed to work but lovely 0.6.0 still crashes trying to dump it
-# 0.7.0 soon-ish maybe possibly??
that'll be cool
messing other mods' files
how do i do this? (apologies for not seeing it earlier)
what does 142073 mean
How many lines does other card have lol
I wanna say it's line 142073 row 262 lol
But not sure lmao
usually it's file path: line number
for some reason a buffer has the name 142073?
classic

ive seen this problem before but im not sure how to fix it. i have playing cards destroying other playing cards and the game is fumbling & drawing already destroyed cards. how do i properly destroy cards in a played cards calculate function
can a consumable be used as a holdable boosterpack?
you could probably have it spawn a booster pack like how tags do, but be careful on when you allow it to be used
what do you mean by that?
are you using :start_dissolve or :shatter (for glass cards)? afaik those functions destroy cards "correctly"
i believe there's issues with entering another booster pack while already inside one, and using one during a blind might have.... weird effects
so its best just to make it give a tag?
yes, but im not able to use them in the right context because playing cards remove themselves in context.destroying_card rather than other cards
You could probably do Create a Tarot / etc. pack?
Might steal that idea actually, hmm
Nah nvm ^^
that seems to be the general consensus from what i've seen of that kind of effect, yeah
Are there contexts to check if a blind is completed/won and also to check what ante the player is at
Trying to make a one-per-ante effect for a Joker
Any clue what this issue is? and is this the place to ask?
I tried removing "jimbo's pack" already, still crashes when I accept payment
after beating a blind
I'm assuming its obvious, but sense I am new I just don't see it
context.end_of_round = true is a check to see if a Blind has been defeated right?
again thanks for letting me use ur code for this lol
hi! i have this condition that should trigger when Midas Mask, Runner, etc. trigger — however, it triggers after the hand is played (not before), and also triggers twice. why?? :>
if context.cardarea == G.jokers and G.GAME.current_round.hands_left == 0 and not (context.blueprint_card or self).getting_sliced and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
it's a deck
oh
SMODS.Booster
{
key = 'yugioh',
loc_txt {
name = 'Yugioh Pack',
group_name = 'yugioh',
text = { 'A collection of yugioh cards' }
},
}```
hoping this is correct
trying to make custom booster pack again now that I have 6 so far
is there any documentation on how to make tarot and spectral cards?
never mind, I found SMODS.Central
(though I think having an ExamplesConsumables.lua would rock BUT i get this is free labor)
key = "yugioh",
path = "yugioh.png",
px = 71,
py = 95
})
SMODS.Booster({
loc_txt {
name = 'Yugioh Pack',
group_name = 'yugioh',
text = { 'A collection of yugioh cards' }
},
atlas = 'yugioh',
pos = { x = 0, y = 0 },
config = { extra = 5, choose = 1 },
weight = 1,
cost = 4,
group_key = 'Yugioh Booster',
draw_hand = true,
unlocked = true,
discovered = true,
})```
Have I done this right?
fundamentally looks good, did you try it in game yet?
you can spawn boosterpacks in the shop with DebugPlus jsyk
I haven't figured out how to actually add the cards to it
not even sure it'll show up in-game
hmm, this joker feels a little bland — what's missing? :P
you need a create_card function for that
ooh wait lemme try something
more color 🤔
ok
no one noticed I forgor the = after loc_text
so error says i'm missing a key
i'm assuming key is booster?
i def like this better
the key is of your choosing, it just needs to be unique within your mod
okay, i've settled on this :D
daniel j. d'arby joker?
that will be copyright infrigment, it should be sight-joker
smh
there's a YUGIOH CARD MOD RIGHT ABOVE YOU
Why are you worried about copyright infringement in a balatro mod
it's not like you're monetizing it
Anyways
My dumbass struggling to figure out how to use create_card
once I can figure this out I should be set to just go crazy on this mod
I just wanna do it in the simpliest way possible
D'arby Joker:
Jacks and Queens give +10 mult when scored. Gives x2 mult instead if the hand is two pair:
(References his hand of Jacks and Queens)
no, d'arby joker shows next 3 cards from deck
since the ability is to "see" a card's "front" when touched
How does that have to do with D'arby?
you need to make an ObjectType, then you just do
create_card = function(self)
return { set = 'key of your ObjectType here', area = G.pack_cards }
end
The only thing you can MAYBE say this is referencing is the fact he has sleight of hand to memorize the ENITRE DECK
i'm giving this the boilerplate ability type in my pack, which is creating consumables:
(Uncommon): When Blind is selected, creates a Planet card or a copy of Strength (Must have room)
correct
But a casual Jojo fan would not even know that
because they see everything on Youtube
and what do they see on Youtube? Engrish and the two pair
but here the thing
X4 Mult next hand
if the first drawn card
contains your hand's rank
```how to "predict" the rank of card?
what's context for before drawing the card?
guessing g.pack_cards needs to be my list of cards?
no, the list of your cards is handled by the ObjectType
what's context for before drawing the card? (after playing the hand, not discard)
oh do I put my list of cards in the SMODS.ObjectType?
you put the object type into your jokers' pools. e.g. if your ObjectType's key is yugioh, you put
pools = { yugioh = true },
into the definition of each yugioh card
and in create_card you do set = 'yugioh'
is it possible to force the game to play a certain hand type without any cards?
ok so for example in the pot of greed card in the SMOD.Joker I made for it i'd put pool = inside of it?
what's context for before drawing the card? (after playing the hand, not discard)
this is completely random but i just realized it is possible to put a #variable# in the name field of a joker 
bro i saw your message, i can't respond to everything at the same time
I don't think such a context exists, you'd have to make your own
there's only first_hand_drawn (which is after drawing the first hand of the blind)
@frosty dock lovely gave me a crash with attempt to call set_card_area with a nil value?
omg perkeo 2
what's set_card_area?
Oops! The game crashed:
cardarea.lua:57: attempt to call method 'set_card_area' (a nil value)
where is it being called and can I at least have the full crash?
I don't even have that mentioned in my .lua?
post the full crash log
just show me your code
just a warning it's very shit
i'm not very organzied
i'm literally a duck tape and glue type of guy
all that I care about is if it works lmao
oh you just put it in the file lmao
I did lol
it's supposed to be in the fucking booster
lmfao
create_card is a vanilla thing
and you don't have an ObjectType yet
i love naming things the exact same as other things without clarification
just adding ```lua
SMODS.ObjectType { key = 'TCG_Yugioh' }
should do
I added a hand_drawn context yesterday that runs every time a hand is drawn afaik (I didn’t test it lol)
Is there a context that detects the start of a new blind?

