#💻・modding-dev
1 messages · Page 90 of 1
if not it should have like a new file that opened up which you can type the message in and click the little check in the upper right
oh ok ty
how can i tell what pack i am in
there's a state for each pack
don't the states only support the base game packs though?
I remember someone else asking that question before but I forget the answer
bumping this because i really want this deck to work and i have zero clue whats causing it to not
(also ive sinced changed the key from "Repetition" to "repetition"
let me guess, card.lua:2060 is
G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost - self.ability.extra
```?
no, its trigger = 'ease', but ive found that something might be wrong with how the game is trying to direct me to the correct erroring line of code because this is one of many times where something completely unrelated is what it directs me to
unless im supposed to be looking at something else to get card.lua:2060 besides the actual card.lua file
You are. The error is in the lovely modified file, not in the unzipped game files. You can find it at mods/lovely/dump/
ah okay that explains a lot
and you are correct, it is that exact line of code
you should almost always be referring that lovely dump when looking at an error on a specific line btw
since they shift around so much
hmm, cool guess on my part, doesn't help a lot
it's possible the function it's part of (Card:apply_to_run(center)) is getting called incorrectly somehow?
how big is the rest of your mod's code? 🤔
a couple of lines I see
its not particularly large no
well I'm stupid
I don't see the issue lol
SMODS.Back{
name = "Repetition Deck",
key = "repetition",
config = {vouchers = {"v_reroll_surplus"} },
}
did it not cause a crash for you?
how interesting
wait, something's just wrong with the reroll surplus voucher 🤔
wait, so does the voucher itself just cause the crash if you pick it up?
no, giving the reroll voucher through the SMODS.Back config breaks for some reason
(I'm assuming)
ah icic ok less concerning but still concerning
there's no way nobody else has run into this??
id be really surprised if nobody else had run into it
I'm so confused lmao
oh hey, someone did run into this #⚙・modding-general message
well the easy work-around is a custom apply but
still, weird 🤔
got it
and you'll probably need to wrap it in a delayed event otherwise it might crash the same way
is it possible that you could point me to some kind of example? i tend to work best with examples, im not exactly a coder by nature, im kinda fumbling my way through creating all these decks to be honest
uuhhh
here's some documentation https://gist.github.com/WilsontheWolf/87475e6ac25857d8a7c73d3cf81f972a
@mellow sable quick question, you got any clue why this happens?
what's the crash?
thank you :3
other idea is that it modifies a variable that the game sets later...
like the table with starting reroll cost
oh that would probably be it
it's the only voucher with self in it's redeem
when it probably should be using center_table lol
cheers
tried adding this event below, the game still crashes when giving me the reroll surplus
trigger = "after",
delay = 5,
func = function()
Card.apply_to_run(nil, G.P_CENTERS["v_reroll_surplus"])
return true
end
}))```
yeah I found the underlying issue with math
and the event thing doesn't help with it
I'll bring it up in the steamodded thread regardless but I'll see if I can get you a quick fix right now
okay, thank you
I mean, best case scenario Thunk fixes this himself next update but that doesn't seem very likely...
yeahhhh
hopefully either of these 2 methods work:
-- option A: lua code where we take ownership of the vouchers and fix their redeem function
local redeem_func = function(self)
G.E_MANAGER:add_event(Event({func = function()
G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost - self.config.extra
G.GAME.current_round.reroll_cost = math.max(0, G.GAME.current_round.reroll_cost - self.config.extra)
return true
end
}))
end
SMODS.Voucher:take_ownership("v_reroll_surplus", {
redeem = redeem_func
})
SMODS.Voucher:take_ownership("v_reroll_glut", {
redeem = redeem_func
})
# option B: lovely patch
# the next 2 patches are to fix the reroll voucher redeem function when only the center but no card object exists
# Card:apply_to_run
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = """G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost - self.ability.extra"""
position = 'at'
match_indent = true
payload = """G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost - center_table.extra"""
# Card:apply_to_run
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = """G.GAME.current_round.reroll_cost = math.max(0, G.GAME.current_round.reroll_cost - self.ability.extra)"""
position = 'at'
match_indent = true
payload = """G.GAME.current_round.reroll_cost = math.max(0, G.GAME.current_round.reroll_cost - center_table.extra)"""
used the lovely patches, they work perfectly as far as i can tell, thank you so much!
cheers, something similar should be merged in steamodded somewhat soon
🤔 Can a card modify current blind size for each time it is scored?
pretty sure Jen's Almanac has a joker that does something along those lines i could send you the code (since the version it's on is deprecated)
Do, I am quite curious.
what if instead of posting mods on github we post a voice message on discord where we just speak the code aloud for 5 minutes and leave it to the user to transcribe it
is there a good way to make something happen for all consumables of a custom type
(i'm trying to make a variant of fortune teller that counts a consumable type i've made)
check what vanilla does
trying to make it so scoring anything except 4s 7s kings and aces gives 8 mult and i'm at a :.|:; , can't figure out what's wrong here
You forgot to transcribe the whitespace (spaces and tabs) btw
you're at a WHAT
LOSS
true...
Great reference
idk if it even matters here
i think here you want to have check as a config that resets at the end of each hand
i don't think any of the whitespace-necessary edgecases arise
only for the header
where I didn't specify the spaces
this is why we use new metadata format 
follow up question, how would one... do that
also with this, context.using_consumable doesn't seem to work for displaying stuff
A real programmer would describe the file structure too
real..
the jade gemstone upgrades the card's rank by 1 before scoring
since the 3s went to 4s and they are all the same suit the hand type changed
Well it says "when scored" which is a big difference
oh
i forgot to update the description
was before scoring then when scored and back to before scoring
Ah alright
does it still turn aces into 2's?
Interesting either way
if you scored it 14 times it would change absolutely nothing 
that is very interesting
is there any way to remove the gemstones outside of like replacing them with another one?
not atm but i can add a tarot that does so
yea that could be a cool way to gain more of one rank
play cards with that gemstone in em til they're at the desired rank, and take the gemstones out with that tarot
seems very interesting
actually
You might want to look at steamodded's implementation of strength if you want to support modded ranks btw
i can change the tarot that gives an empty gem slot to be able to override the gemstone
oh you're so true actually
ah lemme go take a look at steamodded then
Though it's very complicated, I wouldn't blame you if you didn't use it (I know I avoided it lol)
@tepid crow could it be this? i looked through the repo for steamodded and found this when it takes control of strength
Yup. Using SMODS.Ranks
(though really that whole function should be separated out so anyone can use it)

yeah uh
i found out why the return true is important at the end of a event function
LMAO
anyways its fixed and should work with modded ranks
Looks like a roulette. 😂
roulette gem: randomly assigns a card with a random rank & suit
object_type = "Enhancement",
key = "demon",
atlas = "mtg_atlas",
pos = { x = 10, y = 1 },
config = { extra = {x_mult = 2}},
overrides_base_rank = true,
weight = 0,
loc_vars = function(self, info_queue, card)
return { vars = { self.config.extra.x_mult} }
end,
calculate = function(self, card, context, effect)
(some code that doesn't matter)
end
}``` So, I have an enhancement with a weight of 0, and yet it still shows up in packs?
i've been having an anyuresem for 20 years over this
why doesnt this wor
it applies stone to all played carsd
this a weird glitch that came up
for some reason, loc_txt stopped updating
,,,but only when it comes to jokers?
okay, what
i,, removed the jokers entirely in localization
nevermind
turns out i had two copies of the mod installed
balatro modding has gotten to the point where i pick up my phone, not hear the pick-up sound and go
'did i accidentally glitch out my audio? will have to fix that later'
honestly i've been thinking of doing this for my own mod, in addition to making a few other rank-related features like increase or decrease by specified value (would probably traverse them like a linked list), or even the elusive Card:is_rank.
I'm starting to wonder if I should separate this into its own Rank framework library (due to the hassle of mod installation for general folks this seems to not be the most favorable option though) or even making the pull request to the actual SMODS since there seems to be an actual demand for this
what did I do wrong here? the consumable type isn't showing up in game
a true wild card
Is the atlas key right?
Usually keys don’t have spaces
And they may or may not need a prefix
Maybe try with a prefix
what "isn't working"?
your undiscoveredsprite key should be exactly the same as your consumabletype too
Steamodded enforces mod and object prefixes
oh ok
I updated Steamodded after a long time and I got this error
The debug console doesn't even generate any output
This seems to be the error
I am struggling to update my mod of deck customizations cause when I try and call for the suit deck customizations it errors
None of my mods inject into misc_functions
So it's either an issue with Steamodded, DebugPlus, or Galdur
It doesn't seem like an issue with DebugPlus or Galdur so all that's left is Steamodded
oh yeah, prefixes
should the prefix be before the text in the key in SMODS.ConsumableType?
Actually this seems to work for me
Idk, what was the error message again
it's not an error, the uno card consumable type just doesn't exist in game
Try using the debug script to see what's happening
If it doesn't exist there's probably an error that prevents it from being created
debug script?
If you have Python and open Steamodded/debug in terminal you can run python tk_debug_window.py
oh
i'm dumb
yeah, I forgot the header, but now it appears as white, will fix this
Now the jokers have vanished, all I did was copy this header from main.lua to consumables.lua
If the header is the same, it probably failed to resolve the second copy
Because each header corresponds to a mod
Or maybe just by having both headers in the same folder it would stop looking after the first
so what do I do to make sure both the jokers and the consumables are in the mod?
don't give the additional file a header, just load it from the main file
i forget the command for this off the top of my head but
SMODS.load_file("pathto/script.lua")() ?
What I'm currently doing is having the type creation in the main file and the individual objects in separate files
that looks about right
and if it's wrong there are loads of other mods you can check
The important part is that it's a loop over the list of objects, and SMODS.load_file
I capture the error if there's one, otherwise I create the objects in SMODS.Consumable(data)
you just need to put the header in the first file and load the second file then
dont worry about this crazy loop that victin has
like this?
in inverted commas
oh yeah
do you mean quotes
btw does anyone have the sprite for undiscovered cards?
quotes and inverted commas are the same
^
I didn't know they were also called inverted commas
is there a way to have 2 editions on a joker at the same time
not yet
so if i wanted a negative broken (custom editoin) joker id have to create a new negative broken edition?
you could always make your own thing instead of using an edition
but thats so much work for one (1) rune
if you think making a new edition would be easier then go for it ig

im gonna just cchange the effect im dealing with that
am using the most recent version of steam modded for a small thing for myself and I can't figure out what is the problem for modding additional deck customizations, is there a new thing I have to call for cause it is saying that is what is crashing it
the error I get is that when it attempts to get the length of the field of for Diamonds (in this case the diamonds face card customization) and the code of the line that errors is G.COLLABS.options.Diamonds[#G.COLLABS.options.Diamonds + 1] = "mia_diamonds" in the pervious version of steammodded I used this worked but now it is breaking at this line
set_ability not working?
pretty sure G.STATE will only ever be one of the enums inside G.STATES
I've never heard of "G.STAGES"
i got the G.STATE == G.STAGES.RUN from the base game card.lua
with DeckSkinsLite, what causes the error on line 305 when my code looks fine
I'm trying to create a new hand type based on a flush's suit, but when selected, it causes a crash with the reason: "attempt to call method 'is_suit' (a nil value)"
what could I do to fix this?
parts._4 is a table, with tables of cards inside i believe
so _four[i] here is a table, not a card
fairly sure you didn't
there's G.STAGE which is different from G.STATE
Is there anygood wiki or posts/videos on where to begin making my own balatro mod? I have a couple ideas but dont know where to start 👀
there are example mods in steammodded which are pretty useful, and i remember someone was making videos on it? but i dont remember what it was called 😭
#1307744498360520805 is where they posted the first video
presumably future videos will go there as well
Why background color change for blinds use blockable events 
How do I make a consumable give 1 discard for the rest of the round on use?
check Codex Arcanum
it basically does the same thing
ease_discard(amt) iirc
card.lua line 4157 has something else to say
still no
read again
there's G.STAGE, not G.STATE in that line
G.STATE == G.STAGES.RUN happens to be the same as G.STATE == G.STATES.HAND_PLAYED because both of these are represented by 2 in their respective enums
must've type G.STATE and not G.STAGE
Tyvm !!
how does the take_ownership function work?
How would one go about adding additional funcitons to a joker?
name = "hel-smearflowerpot",
key = "smearflowerpot",
pos = { x = 1, y = 0 },
config = { extra = { Xmult = 5, num_black = 2, num_red = 2} },
rarity = "hel_gx",
cost = 10,
atlas = "hel_joker",
loc_vars = function(self, info_queue, center)
return { vars = { } }
end,
calculate = function(self, card, context)
(stuff that doesn't matter)
end,
can_use_gx = function(self)
if G.GAME.hel_gx_use > 0 then
return false
else
return true
end
end,
use_gx = function(self, area)
G.GAME.hel_gx_use = 1
end
}``` this is what I have, but I can't access the functions in-game
Those seem pretty independent, and would probably work better as individual functions rather than part of the joker.
If you want functions only part of this joker, you can call them by putting self: or self. in front, e.g. self:can_use_gx()
When trying to call the functions, I get this error Oops! The game crashed: [SMODS hellatro "items/utility.lua"]:47: attempt to call method 'gx' (a nil value)
name = "hel-smearflowerpot",
key = "smearflowerpot",
pools = {["Hell"] = true},
pos = { x = 1, y = 0 },
config = { extra = { Xmult = 5, num_black = 2, num_red = 2} },
rarity = "hel_gx",
cost = 10,
atlas = "hel_joker",
gx = function(self, card)
for i = 1, #G.hand.cards do
local _card = G.hand.cards[i]
buff_card(_card, 0, 0, "e_wild")
delay(0.1)
end
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
G.hand:unhighlight_all(); return true
end
}))
delay(0.5)
end
}```
I'm calling it like ```c1:gx(c1)```
are you trying to call the joker's function outside of the joker??
what are you actually trying to do?
i believe the problem is that you're referencing gx even though its a function within the center
its easy to see how someone can get it mixed up
try doing (the card).config.center:gx() instead of (the card):gx()
infact this reminds me
i only found this out recently
i could change something in my code rq
I'm trying to add consumable effects to jokers
I have the UI all set up, I'm just trying to figure out how to call the joker's function from the function that gets called by the UI
do this
take_ownership is a method available on all SMODS.GameObject classes (e.g. SMODS.Joker) for overwriting attributes and methods of an object. It takes minimun two parameters: the key of the object you want to overwrite, and a table containing all the attributes and methods to overwrite, just like how you define a new object. For example:
SMODS.Joker:take_ownership("joker", {
rarity = 4,
config = {mult = 400},
})
Turns the standard Joker into a legendary which gives 400 Mult;
SMODS.Consumable:take_ownership("magician", {
config = {mod_conv = 'm_lucky', max_highlighted = 5}
})
Changes Magician into being able to enhance up to 5 cards.
Do note you can also overwrite functions. take_ownership can take a third argument, but I don't know what it does.
third argument is silent, a boolean
it seems to indicate whether to add stuff like the mod badge from the mod that modified the object
I think having that boolean as true should probably not assign the mod = X property to the object too, right? it currently doesn't but I wonder if that's a change that should be made
not sure if i should ask this in modding chat or here but
how hard is it to replace textures/ text files?
I can walk you through using https://discord.com/channels/1116389027176787968/1300851004186820690
that would be great but
i probably shouldve asked when i was in a position to actually go try it lol
that's okay, I think it's fairly self explanatory, but if you do use it and need some help just drop me a message
alrighty, thank you
how would i go about giving every face card in a deck a certain enhancement?
Probably iterating over the deck, testing if it's a face card, then enhancing it
medusa moment
oh yeah i could just look at what medusa does huh
oh nevermind challenge decks work weirdly
I was just joking
Because Jokers that do that have been suggested
Usually turning Face cards to Stone or Gold
Hi, I'm trying to replace jimbo's sprite with this, anyone know where to change a jokers sprite in the files?
... nevermind I'm stupid
what do i put here to get it to actually target jacks instead of doing nothing? or alternatively, just getting it to target face cards in general?
in general you can try searching for the game's code to see how it does things
I believe cards have an :is_face() function
it does
there's also a :get_id() function which returns an integer
just looking at Hit the Road, it seems to be 11 for jacks
Would Aces be 14 or 1?
14
Is there a way to show card enhancements in hand examples?
Such as a stone or wild card?
one of my favorite effects so far
how do you mod balatro on the most recent version? all of the videos im finding are very unhelpful
should've played the queens and 4s smh
is the implied rule that the "negative" discards cost money btw?
yea pretty much-
spend money instead of discards if you have none left
should i reword it?
more of a #⚙・modding-general question but here's the guide https://github.com/Steamopollys/Steamodded/wiki/01.-Getting-started, make sure to get the alpha
(also money cant go into the negatives)
kk
might be more easily understood if you focus on the "if no discards left"?
ahhh good point
me when i make a mod that makes all packs have soul or black hole but then forget to add some of the specific code to make sure that i um get other cards as well and now there are no cards except for soul and black hole and they appear in the shop also all cards are negative and it's very funny
i'm not even going to change it
ok yeah i do actually have to fix that now that i'm thinking about it
lmfaooo
okay so like
yeah the first thing you want to try is the steamodded wiki for adding jokers
the thread is #1209564621644505158
probbaly in the pins?
nothign in the pins lol
lemme look around ill see what i can find
here sjdhjshd
im goated
yeaahh thats the one
unfortunately im out rn but like ill try to get to my computer as soon as i can
this is gonna be a useful page
mhm!
again this is more than enough help, you're being so nice to me 😭
dude ive spent so long studying game code i just want to make sure nobody else has the same hell sjdhsjhd
indeed
me rn im in such a good mood
alright let's see
i should start learning lua right

i have a good basis on code in general (ish)
ive gone through GDscript learning and did some C
lua seems fun and easy to learn, (he doesnt know)
yeahhh lua is honestly one of the easier languages to be honest
mhm!
{ }
scientists are calling it the most unneccesary mod ever made
if lazy mattman pivoted to balatro content:
hmmmmmmmmm
oh yueah
i have 0 clue how that even happened honestly
something in my code made it possible for cartomancer to make it
i added like a 25% chance for the soul to appear everywhere it shouldn't as well as the 100% chance in packs, so maybe i just got REALLY lucky lol
not that i'm aware of
i could fake it with wild though
Oh you're talking about SMODS.PokerHand wow okay that confused me. There doesn't seem to be any support for custom card parameters like edition or enhancement no, you'll have to do it yourself
you could also suggest it as a feature in steamodded if you want
There should be a mod that makes it so jokers can have multiple enhancements at once
I want a polychrome negative goddammit
the shaders won't play nice
I think foil is the only base game one that stacks okay
Also a mod that lets you make your own intentional eternals (i am saving this one for later)
I mean DebugPlus can force eternal if you're testing stuff, but I think cryptid has a spetral that makes an enternal
literally just Card:set_eternal right
why smods develoopers not rewrite entire game . laZy
Yes but it’s random iirc
It’s more of a sticker remover tool, with that one “downside”
how can i create a card with a guaranteed specific edition? setting its edition manually after creation causes weird effects if the card would have naturally rolled an edition
if you're using SMODS.create_card you can pass the editions key to the edition field
I also set no_edition which ensure it doesn't poll editions. Not sure if thats nessicary or not
also for creating stickered cards does it force a card that supports the sticker
from reading source, appears not
actually, trying to add eternal causes a crash
should just be card:set_eternal(true) iirc
show call
local card = SMODS.create_card({
no_edition = true,
edition = { negative = true },
stickers = { "eternal" },
area = G.consumeables,
key = pseudorandom_element(G.P_CENTER_POOLS.Consumeables, pseudoseed(seed or "grc")).key
})
i think there is, its just not implemented correctly
The function exists for custom stickers but due to seed RNG problems it's ignored for the vanilla recreations.
maybe both work?
is there something for peeps to look at if they want to try making their own mod
i will never miss an opportunity to self promo
thank you, I can't wait to try making this mod idea
what is it that you're trying to do, exactly?
add jokers mainly, not sure what else if anything
nice
how the hell do you play audio with smods lol
There's SMODS.sound iirc
There's a example mod in steammodded
yeah i know i'm trying to figure out how to actually. play registered sounds
i can check though
is there any way to just. play an audio file?
like a sfx
not a music file
bruh
nvm
i'm gonna have to pull out the actual code
sigh
ojh
i wonder if playsound works
huh
ok
.ogg is the audio extension Balatro uses.
i'm aware
it does not have anything for sfx
just music
💀
god why the fuck is lua written this way
i have a personal grudge against the devs
why do arrays start at 1
😭
It definitely does
i couldn't find it
SFX implementation for Cryptid looks to be just making the SMODS.Sound object and playing play_sound
Like that's it
can you link it to me
or i guess i can just find it, but it'd be easier to just see how they wrote it in
i got it
it's going to be unbelievably simple
i'm going to cry
hi sorry if im interrupting anything but im trying to use SMOD.Sound to replace the soundtrack with my own pre-synced tracks but the different music layers end up slightly offset from each other which is very noticeable during transitions (such as going to the shop or boss blind). is there something i should be doing for better syncing?
:3 (Cat Tag sound effect implementation).
i see it
😭
no yeah it's still broken for some reason?????
i keep getting "can't open file resources/sounds/<file>"
pleaes god i need funny matmann screams
dies
yea no i'm stumped here iunno
like this is what i've got rn
iunno wy this wouldn't work...?
i think it's looking for files in the actual game???
i don't know how to fix this
cries
Check steammodded source
can i see the command you used to play the sound
i pathed it 1:1 to ghow it was pathed for uh. what was the mod everyone was talking about up there?
play_sound("lazy", 1.26, 0.25) this is the code btw
ah thats the problem
?
you need the mod prefix
whuh
Yep
add this onto your mod header, I think there's default as well but I wasn't sure what was this
and then you can use it to prefix your sfx
play_sound("prefix_lazy", 1.26, 0.25)
like the cryptid screenshot above has cry_ prefix because their mod prefix is cry
god i hope this works
ITjklSDFKJsdjklhfsdf
thank.
this is the best thing ever
incredible
bumping this real quick
i think it's cause some of them are slowed down/sped up ingame
idk much about the sound side of modding
but i remember that convo
that the music speed changes ingame
no, no, they're right
the implemeted sound api has a very noticeable delay when looping songs
okay trying this again
i need an effect to count the amount of suits in a hand, but not to count the cards a second time if they get retriggered, is there an easy way to do this
iterate over the hand in a context that only triggers once
and which context would that be
you can use context.before
if context.before and context.cardarea == G.play then is a statement that works right
just if context.before then is fine
okay
local text,disp_text,poker_hands,scoring_hand,non_loc_disp_text = G.FUNCS.get_poker_hand_info(G.play.cards) will work in that context right
guess i'll find out
it crashed
yeah i'm not sure how to do this
i need it to be in context before but I need it to check for unscored cards
the method I use to check for unscored cards doesn't work in context before
this is that method, if the flag is false then the card was scored by the splash effect
it crashed on context.other_card, do I need to use another for loop to iterate through G.play.cards?
what are you trying to do?
scoredflag should be true if the card was scored
if it's scored by splash or unscored, scoredflag should be false
but then i need to check the suit of the card
that part is easy
what's the scoredflag for?
no like, what is the joker supposed to do
gives X1.5 multiplicitive mult for each instance of a clubs suit and non-clubs suit card in played hand
wildcards count as both and extra scored cards (cards scored by splash) count as double
so every card gives X1.5, wild cards give it twice and splashed cards give it twice?
the joker gives the xmult during joker_main
it's not the cards that give it
oh it just needs to count up?
yeah here it just needs to increment
i have all the logic for calculating the xmult working
it's just iterating through the cards
without counting retriggers a second time
can you send your code?
i just changed the context to context.before, it used to be context.individual and cardarea == g.play
i also didn't include the line registering the fusion as a fusion it is there in my code
clubinstances should probably be <= instead of ~= 0 to avoid a potential logic error with a negative number somehow
why do you have a math.min?
this just seems unnecessarily complicated for the effect unless I'm misunderstanding it
it's the easiest way to calculate it
with a total of clubs in the hand, say, 3
and a total of non clubs in the hand, say, 4
the amount of X1.5 should be 3
no matter what those two numbers are, math.min gets the right answer
that is NOT clear from your description
what
yes
for each instance of a club and a non-club it gives X1.5 multiplicitive mult
which means with 2 clubs and 2 non clubs it's X2.25, etc
I still don't think your description is clear but whatever
right, give me 5 mins and I'll type something up
how can I change it to be clearer
I think you need to make it explicit that it's pairs of clubs and non clubs
just avoid using the word pair
but I read instance as an individual card, so for each instance of a club and a non-club implies to me that it's just any card
maybe it's just the way I read it
i'll post about it in my mod thread and see what people think
should wild cards in splash count as 2 sets?
they count as a club and a non club
if they are extra scored cards then they also count as 2 sets
Is there a good tutorial or reference for creating booster packs? I'm having a hard time trying guess how it works
function card_is_splashed(card)
local _,_,_,scoring_hand,_ = G.FUNCS.get_poker_hand_info(G.play.cards)
for _, scored_card in ipairs(scoring_hand) do
if scored_card == card then
return false
end
end
return true
end
calculate = function(self, card, context)
if context.joker_main then
-- calculate the number of club/non-club pairs
local clubs_count = 0
local non_clubs_count = 0
for index, card in ipairs(context.full_hand) do
local reps = 1
-- check if card is being splashed
if card_is_splashed(card) then
reps = reps + 1
end
for i=1, reps do
if card.ability.center_key == 'm_wild' then
clubs_count = clubs_count + 1
non_clubs_count = non_clubs_count + 1
elseif card:is_suit('Clubs') then
clubs_count = clubs_count + 1
else
non_clubs_count = non_clubs_count + 1
end
end
end
-- calculate the number of pairs
local number_of_pairs = math.min(clubs_count, non_clubs_count)
-- set the xmult appropriately
return {
message = localize{type='variable',key='a_xmult',vars={card.ability.extra ^ number_of_pairs}},
Xmult_mod = card.ability.extra * number_of_pairs,
card = card,
}
end
end
that's what I was thinking
oh, lemme replace some variables IO hard coded too
there we go
that should work
thanks a e11
wait the message value is different to the xmult_mod value
which one's correct
i think i got it actually
thanks again
same question, i need to make some and i have no idea how 😭
Oh yeah, I only updated one to be multiplicative
I suggest searching github https://github.com/search?q=SMODS.Booster&type=code for examples if there is no documentation tbh
a simple example would be e.g. this one https://github.com/smg9000/Minecraft/blob/main/Minecraft.lua#L960
github search is pretty good, you should use it 🙃
i didnt know you could search multiple projects 😭
ctrl shift F my beloved
/ for github search :D
is there a gold text color already
yellow doesn't count
i don't think there is
so how do I make a text color
G.C.COLOURS.foo = HEX("F00BA4")
how do i make it change color like the dark_edition color
honestly just look at the jens loc_txt stuff
all sorts of text shenanigans in there
yeah ive been trying to figure out how cryptid does it but
cryptid's code scares me
you guys have so many lua files i don't know where to look
i thought it'd be in the misc one but it's not
i mean, it's deprecated, so
can still use it
jen is okay with that iirc just took it down because incompats
in the items subdirectory
well yeah i'm in there
you mean apart from G.C.GOLD????
idk
i want it to be a cool one
Hey Guys, i was learning about modding my game yesterday and windows said to me that the "version.dll" were potentially something not good.
at the same time, unfortunately, my pc went to be slow and to do shit, i don't think it was because of "version.dll" but i decided to be radical and delete the thing to be sure.
I bet you all had already heard about that a lot but there is something about "PUA:Win32/GameHack" that i should be "afraid" of ?
(Sry for my english tho)
go look at globals.lua:337, that's where all the colours are defined
this is a very common issue due to the nature of the version.dll file injecting itself into balatro
the source code is open source, you can check it yourself if you'd like, but we can assure you there is nothing malicious about the file
I want to make it less scary soon
then why'd you do the spooky update? /s
does updating past the spooky update remove the spy
i really like the spy (sometimes)
Scary on the outside, sweet on the inside
No, he’s here to stay
the one thing I despise abt the spy is just that
He’s also pretty bad at his job, he might need some improvements
it's not anything nefarious, windows flags it as a game hacking dll because that's what it is
I want it to only appear in shop, so that’s a bug
yeah he almost always shows up as a fusion or evolved joker and
i was about to report it as a bug that cryptid took ownership of a fusion joker and put it in a buffoon pack
until someone informed me that it was actually a spy
I like that he can throw you off, but I want to change the indicator for it
it's extremely obvious when he's a fusion or evolved cause
they don't show up in the shop
im a big fan of just deleting jokers I don't want
the indicators right now are
nil values
fusion or evolved
cryptid ownership tag
R key 🔥🔥🔥
My idea is to:
- make it only in shop
- make it only jokers that can appear in the shop
- make the buy price off by $1
tall sqoker

the buy price being off by $1 is a bit scary because of mass production making everything cost $1
and the other discount vouchers
im gonna have to do math before i buy every joker to figure out if it's the right price
and it's a harsh knowledge check on base joker prices and edition price increases
Any other ideas? I do want some guaranteed way of “knowing” a Joker is a Spy
if you're on a high enough stake, go against the Perishable and Eternal compatibility values in the joker
alternatively you can do meth before you buy every joker
have it juice up at random when its in the shop?
i forget if thats possible
rad
can you juice up the quit button
probably
i remember you can juice up the blind text
cool
so likely
someone make a mod that just constantly juices everything
get the guy who made the peak mod to do it
fair point
really slight discoloration or hue shift
but i'm colorblind :(
i just had the most nefarious idea for a mod ever
damn
every joker has the art, name and description of Splash
blindfolded balatro
that honestly sounds kinda fun
definitely not the thing you came up with but i wanted to share that idea
X0.5 blind size
all cards face-down
joker i mean
playing cards can be facedown too
sounds like you would need a massive upside for that
if all cards were face down you'd just lose blind one 
y e ah
that's true actually
i mean with the X0.5 blind size
blind one would be 150 chips
is that achievable in 3 hands?
surely you can luck into enough pairs
playing cards face down isnt fun but jokers could be
maybe X0.5 blind size and also you start on ante 0
if you discard/play left 4 cards on suit sorting you'll probably get a flush
maybe the upside is just +1 joker slot honestly
that'd make blind 1 100 chips, halved to 50, right?
ehh
+1 joker and +1 consumeable
50 chips is fucking free surely
problem is you're essentially playing random cards always
honestly, I would do something like
jokers can never be face up
+2 joker slots
all jokers are 50% off
it just isnt fun
yeahhh
balance isnt about how possible it is to play its more about whether or not its interesting and requires unique thought
50% off jokers would make them harder to identify in the shop
price is one of your only tells
you can't see the cost of face down cards anyways
really?
yes you can
not unless cryptid changes that
reverie had a thing that made all cards facedown and you could still see the costs
cryptid probably changes it
for this youd have to be otherwise that takes away a lot of the decision making you can do
i'm pretty sure you can just see the cost on the buy button on facedown cards in the shop
it's only the sell price that isn't shown
because it wasn't intended for shop use, only for boss blind use
Ye
regardless it's probably for the best, i don't think it'd be fun to look at the prices of cards to buy them (especially because the idea of the deck is to buy things first and just see what can they do)
You can’t see any modifiers though
its added strategy but not a requirement
me when i go into a shop and buy things without checking the prices (i'm broke and have 2 watermelons now):
they're 50% off for a reason 
four watermelons
75% off
all cards face down X2 blind and X3 cost
200% off
there are jokers with specific prices like iirc gold mask is $7 so if you see a $7 joker you have a good chance of knowing what it is
domain expansion
infinite watermelon
editions add to the prices
$3.5 🔥
rental makes them cost $1
face down jokers past black stake would be nearly impossible without just ignoring the thing and doing jokerless
because its like a fun concept
maybe a challenge run instead of a deck
fair enough
is it easy to make a config screen
btw does anyone know if theres a better implementation for music or would i have to reinvent the wheel
yes and no
it's easy if you copy someone else's structure
otherwise it takes a week
i need some homework to copy 🤔
will I need to change my code structure to use load and separate lua files
teacher gave me an F
i want the configs to just flip boolean statements with the stuff in them cause i dont know how to do the load stuff
"can we use a three dimensional frequency table to represent more complex data sets" core
is there any reason to do the load stuff other than "clean code" actually
not really
just the way god intended
and im gonna make massive comment separators so that i can see them when i scroll through it
(i was already doing that)
🤔
I might yoink that idea for the Cryptid refactor
I should probably split up my single file with 2100 lines ngl
Anyone know if there's a way to animate the floating thing on top of soul? By that I mean make it a repeating gif/animated png instead of a static image that just floats
it's ok, we wanted to be sure asking here, thx tho
main.lua:
print("hi")
loadfile("otherfile.lua")()
otherfile.lua:
print("world")
is functionally equivalent to
function other()
print("world")
end
print("hi")
other()
Yes, see how the mod Aura animates jokers. You’d just have to modify the soul_pos instead of the pos
Ok I'll take a look!
that reminds me I need to clean up the code for the sob fusion
surely there's a better way to do that holy fucking shit it's like 15% of my entire lua file
i feel like the yandere sim dev looking at this
is the yellow repeated code? 🤔
just use arrays 4Head
i don't know what the colors mean
i'm also colorblind
all i know is that I need to fix the infinite money bug it currently has
and there has to be a better way
warnings, probably for function overrides/undefined globals
yo marie wtf is the
local createjoker = math.min(1, G.jokers.config.card_limit - (#G.jokers.cards + G.GAME.joker_buffer))
G.GAME.joker_buffer = G.GAME.joker_buffer + createjoker
local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_splash")
card:add_to_deck()
G.jokers:emplace(card)
G.GAME.joker_buffer = 0
return {
card_eval_status_text(card, "extra", nil, nil, nil, {
message = "Splash!",
colour = G.C.FILTER,
}),
}
that you do 12 times
not having luals issue
why is that not factored out
/not having balatro src code in the project
how can you read that from
thats from github
oh right
i have one of those
i think it was math who literally said to find and replace j_obelisk with j_splash in the code for it
¯_(ツ)_/¯
thats what i did
anyway the issue is because i'm assuming it checks for if you sell obelisk to not create obelisk and i forgot to change the name check from obelisk to splash
yeah ok that's fixed
code's not clean, my code was never clean
I never would've made a function for checking if a card was splashed unless eremel pointed out that it was easier
Sob got cleaned up, look at the new Sob code
You don’t need to copy paste if statements 12 times now
i like when the game is laggy and the cards are all jumpy
is there a way to force that to happen all the time?
one of my other friends also wanted this mod
or would it be nightmare
i do want to know cause it'd be really fun
can we make balatro really bouncy
but i dont have time to get sidetracked graagh
i mean there's presumably some way to force lag by giving the game busywork to waste a whole bunch of processor cycles, even if i don't know what that'd be offhand
but the problem is how to do bouncy whil not lagging, at 60fps and how do you control bounciness
there's an easier solution
im not telling though 
joking of course i just don't know
im a novice but id say look for the balatro code that animates cards and see if there are any easily scalable numbers there
Set FPS to 10
but then again steammodded seems to always do things totally different from the base game
but what if you want fps to 60
m
so true
The dark_edition (and edition) is just set on each frame in Game:update
oh i see
is it a copy paste job or do i need to do other things to make a custom color work
also do i need a lovely patch or can i put it in my code
You probably need to change the math for your colour but otherwise copy paste. You just need a method to run your code every frame (a non-blocking/blockable event probably would work)
i don't know what that means
which part
You can just hook game update too iirc
yeah or probably a plethera of other methods
which one is the least intensive
intesive how?
brain intensive
¯_(ツ)_/¯
i guess the first thing is to find out why this happens, whick might be really hard
You already know how to hook functions right?
i probably know what it is but not what it's called
i love hoks
it's the process of storing a reference to a function then replacing that function, to run your code and call the original function
function Game:start_run(args)
startRef(self, args)
end```
like lua local example_ref = example function example(args) print("hi mom") example_ref(args) end
can do it on Game:update
if you make sure to run it with it's args and return it you shouldn't have an issue
what arguments does it use
self (implied when using :) and dt
what do you mean by retur it
so do i need to include self or not
what happens if i dont return anything
you die
:(
I think you can just do ```lua
local game_update_ref = Game.update
function Game.update(...)
-- My code
return game_update_ref(...)
end
the only argument is dt
if the function returns something and something else relies on that reutn value it doesn't get that value and bug
hold on is it game.update or game:update
both
what
game:update(dt) is shorthand for game.update(self, dt)
I did it with the . so that the self would be treated as an argument in the ...
does that change the outcome
not sure
haven't tested that
but I belive it does in the given code
try it and see
I might also be missremebering ... and it's not a thing in lua
whatever i put in here is going to execute every frame
okay it worked
now what do I put in this code area
i know what the code is for the timer changing stuff but
where does it define the colors that it changes to
or does it change relative to the base color
if so where is the base color
i think i have a hypothisis of what happens, the game sees the black, applies a "force" (blue line), because of the lower frame rate, the force is applied for too long, (red), and it overshoots, rinse and repeat
is this plausable?
The negative edition uses the timer and one value uses the other two
depends on what you want
well i want it to go through these colors (something like this anyway this is the example i had on hand)
i don't know which one i want for that
oh also for testing you can kinda mess with DebugPlus's internals and print out the colours #1228149931257237664 message
i use love.update since there's no bullshit selfing shenanigans 🔥
Not too familar with messing with colours but is this just the same colour with different lightness or how did you generate this?
i didn't generate this i found an image on the internet
this does seem to be the same color with different lightness
is that easy to do with these systems
uhhh if it was an HSL system it would be stupid simple
but for this you'll need a little math
You could save it as a hsl value and just convert it back every time rather than doing the appropriate rgb math
actually
I think if you just get an rgb value for what you want
then you can multiply each value by a number from 0-1 to change lightness
maybe
how do cards move
with their legs
obviously you should know this jared
probably just get their coordinates updated
is that how colors work
I only have basic colour knowledge ¯_(ツ)_/¯
yeah well i'm colorblind this is
so this is something with love2d?
entirely out of my field
essentially the game sets a value of where the card wants to be moved and the game will ease it's actual position towards that
engine/moveable.lua
how does it ease
iirc
ok omw
is this easy
Seems to be (This is halved from the old values)
what does this look like with the color code
like the hex one?
It saves the colours as rgb values in a table, so you can just modify each value in turn
well the colour is an object with 3 values that corrispond to R G and B
so you can just modify the numbers in there
If you’re iterating though, make sure you stop at 3, iirc they actually do have an alpha value as well
so that's what the
there's a lighten and darken function for this?
these values are right
idk
oh that's convenient
why was there a question mark then
lighten/darken(color, num [0-1])
I was confused at you not knowing 
how do i put this into the timer
I've litterally just touched colours like once to print them out
math idk
hmmm... yes of course (i am too dumb to understand)
have a base color, use a sine wave correlating to the current time, use that as how much it should be lightened
i just wanna say
from my perspective you guys have given me a 9 volt battery, a screwdriver, lego building instructions and a radiowave frequency and i have zero clue how any of this goes together because i'm kind of an idiot
That’s a bad analogy because none of those things do go together
well if i knew that they went together it would be a bad analogy because i'd be able to see how they go together
e.g. ```
color = HEX("FF3B55")
[in card.update]
local newcolor = darken(color, (math.sin(love.timer.getTime()*10)+1)/5)
add an offset for each letter in the character if you want them to be on a wave
but then it'll just darken forever won't it
But the new colour should be saved in the colours table
no sin waves go up and down over time
no the base color doesn't change
also yeah
although this might not quite work for the colour as the ref would change (?)
yeah
how do I do this
that sounds cool
assign each character a different color reference and offset the time by a certain amount for each color
but how do I do that
color = HEX("FF3B55")
local color1 = darken(color, (math.sin(love.timer.getTime()*10)+1)/5)
local color2 = darken(color, (math.sin((love.timer.getTime()+0.1)*10)+1)/5)
color2 is always 0.01 seconds ahead of color1
i would experiment on desmos with this
how does it know that color2 is the one for the second character
just normal text formatting
loc_txt = {
name = "bleh",
text = {"{C:color1}1{}{C:color2}2{}"}
}
actually wait
annoying
trying to make it so the values of a joker increase by 5% when triggered but having an issue where it upgrades when it doesn't trigger
lovely patches make me want to bash my head into a wall
engine/moveable.lua
man
checking the lovely dump makes the process a little easier imo
alongside the console when patches are being applied
name = "{C:goldcolor1}S{C:goldcolor2}p{C:goldcolor3}l{C:goldcolor5}i{C:goldcolor5}s{C:goldcolor1}h {C:goldcolor2}S{C:goldcolor3}p{C:goldcolor4}l{C:goldcolor5}a{C:goldcolor1}s{C:goldcolor2}h{C:goldcolor3}",
did I misunderstand this
or is this actually what i have to do
every single time i want to do this
err
