#💻・modding-dev
1 messages · Page 52 of 1
at the end all it does is that it just loads the file content as a string into a function
if you want a thread, make one
im not saying that - i meant the internals of how smod loads file is unknown so asking a question to confirm behaviour is not out of the question and doesn't mean someone doesn't know how to code 😉
is there a way to check if a function was called with a specific wording like if self == context.other_card then (the example won't work because there is not a value for context.other_card in :get_id()) but can you somehow get the string version of the wording and not the actual data it holds?
yeah that's fine
not like it would be possible to look at the code for it
wdym by wording?
like the string "context.other_card"
the string of what :get_id() is getting the id of, just doing tostring() turns the data into a string but I want to get the words itself as a string
check this out https://stackoverflow.com/questions/73129150/how-to-convert-a-function-to-string-in-lua
might be possible with the debug lib but really hacky, there should be another way
like you might want to pass an additional argument to get_id
Kid named SMODS.load_file
would that require manual replacements of where the function is used?
You should probably explain why you're trying to do this, there might be a better way
I am returning the id as a true statement when a certain joker is in hand, I am trying to make sure that when calculating poker hands it returns its base value. as when calculating poker hands, it uses hand[i]:get_id() while joker code uses context.other_card:get_id() (I am doing this because I want the joker to return 4 different ids when the player has the joker, and this code should make all cards count as any card which I can fine-tune from there)
why dont you just move the code of the function to your joker?
I'm not sure how I would change the id of each card inside of my joker
well your joker is called get_id right?
no?
oh
Do you know where the function for animation of a card scoring (the shake specifically) is located? Or at least which file has all the gameplay sequence in it?
superficially, Card:juice_up() at card.lua:4779. You'll see it calls Moveable:juice_up(), to be found at engine/moveable.lua:249
Wow, what a name though, thanks!
what if you do
add_to_deck = function
function Card:get_id()
...
end
end,
remove from deck = function
function Card:get_id()
return get_id_ref()
end
end
?
the joker I am trying to make would work like Pareidolia but for certain number cards, this would only change said cards when they are added when I want jokers to consider them all 4 selected values at all times
these can't be told apart, you might want to patch get_id to have an extra argument and apply that in poker hand eval
Does this function only activates the playing card or any card on the screen? Thus, if I count every call of this function, will it count jokers and consumables too?
Or I guess there are no separate shake calls for different card types, the cards themselves call for it
it is used for all cards
what if every card was juiced up...
you can juice ui elements too ^^
I figured, though now I need to find how to track the function without intruding it
debug.sethook doesn't feel right
what are you trying to do?
this will be the peakest of mods
peaker than #1240989654371663912
Count how many times a card got triggered in one hand played
a specific card or all cards?
I mean a total of all the cards in a hand
Like, I sure can track when the hand is being played, in theory it should be "when card scores and hand is being played add +1"
So it would count for e.g. both even steven and odd todd?
I know that I can do it inside of the animation function, but I want to avoid modifying such fundamental functions at all costs
I think that's probably the cleanest place to do it
you can check that it's a playing card that is being juiced and increment your counter
then reset it when a new hand is played
Shame, but I understand
otherwise I think it would require a lot of injecting in evaluate_play and custom effects don't even need to be brought back into that stack
I see, thank you!
Yeah if I recall correctly most jokers do a hardcoded check on the ID?
Sucks yeah. Might have to lovely patch into it like aure suggested.
What to use to save global variables inbetween runs? G.GAME.blablabla saves in the run, I need something that saves in the profile
ig you can use G.SETTINGS and call G:save_settings()
Settings saves across profiles iirc
you could maybe use config and save them by profile
there's also still the "per-profile mods" suggestion, but with having to restart to change applied mods it doesn't seem too useful and should just use --mod-dir right?
per-profile config might be something we want to allow
that seems a bit convoluted
where do profiles save their unlocked state?
G.PROFILES[G.SETTINGS.profile].whatever_you_need_to_save might work?
will try, ty!
Option in config api to save to the profile folder instead of the conifg folder
It just save all config to the profile folder?
If the user toggles something
Alright. I need to figure out how to remove cards from a pack list and add them to a different one
where are all the playing cards in your deck stored?
Do you mean the deck or all that exist?
Again it depends if they mean the deck or all playing cards that exist
It would be G.deck.cards as with all CardAreas anyways
Cf. Blue Joker
For the other, I think it’s just G.playing_cards since it’s not a CardArea
Cf. Stone Joker
i mean the current deck
That doesn’t help still :<
Like the one you draw from?
At the moment you run the code?
The full deck or the deck? ^^’
In any case I’ve already explained both
Just look for the Joker closest to what you want
Blue or Stone
full deck
maybe it's easier if I explain my Joker idea
So Stone
Just look at Stone
I already explained above but I don’t have the code to double check so you can do it yourself
The first card you draw each round has the highest rank in your deck
so i thought in context.first_hand_drawn to make a table of all ranks in your deck and then switching hand cards with the ones in the deck with high ranks
Oh I have something that draws a 3, and another that changes the deck order
That’s too late
Because the hand has already been drawn
Unless you want it to be an extra card
Like I did with my 3
If not, you can change the deck order
i don't know how the game handles the whole "drawing to hand" thing
This hooks into the shuffle function to put a card of each Enhancement on top of the deck. Keep in mind it has no condition, so it'll always apply as is.
local shuffle_ref = CardArea.shuffle
function CardArea:shuffle(_seed)
shuffle_ref(self, _seed)
if false then
local idx = #self.cards
local seen = {}
for j = #self.cards, 1, -1 do
local card_j = self.cards[j]
if card_j.ability.set == 'Enhanced' and not seen[card_j.ability.name] and j ~= idx then
seen[card_j.ability.name] = true
self.cards[idx], self.cards[j] = self.cards[j], self.cards[idx]
idx = idx - 1
end
end
self:set_ranks()
end
end
well, actually I put an if false then so it never runs
If you want an extra card, you can do this
calculate = function(self, card, context)
if context.first_hand_drawn and #G.deck.cards > 0 then
for i = 1, #G.deck.cards do
local _card = G.deck.cards[i]
sendDebugMessage("Sightseeing… "..tostring(_card:get_id()))
if _card:get_id() == 3 then
card_eval_status_text(context.blueprint_card or card, 'extra', nil, nil, nil, {message = 'tour guide', colour = G.C.PURPLE})
G.E_MANAGER:add_event(Event({
trigger = 'before',
func = function()
if _card and not _card.removed and _card.area == G.deck then
draw_card(G.deck, G.hand, nil,'up', true, _card)
end
return true
end
}))
break
end
end
end
end
This draws a 3, as mentioned
does this work without any hooking?
without lovely.toml?
I suppose you could change the hook into an injection
Lovely is used for injections
ok i'm reformuling
does this code work without making any lovely injections or modifying base game code?
As is, it doesn't use any injections
ok
I don't know if that algorithm is a random uniform conditioned shuffle
I just programmed something that worked
I suspect it's not uniform but I haven't done the math
If anyone wants to I'm curious
The remaining cards could probably be shuffled again to make it uniform tho
ok i got it to work
this just makes you draw an extra card if you have a 3 remaining in your deck
That's what I said
I'd want to make it so that in your first 8 cards, there is an Ace
That's the previous one
or a King if you don't have aces
I sent you both so you could choose whichever fit your idea best
And I explained what each did
ok thanks
i'm sorry, it's just that after making 9 jokers my vision is blurry
I'm going to eat a pizza in 5 minutes
woohoo
fully stereotypical
I think I convinced myself it’s not uniform
Imagine a deck with two blue cards
After a shuffle, the distribution of the first blue card is decreasing, and the distribution of the second blue card is increasing
If I move the first blue card to the top, then the distribution of blue cards in the remainder is the distribution of the second card, which isn’t uniform
If you selected either the first or the second to be moved to the top, then I think it becomes uniform again
But I wonder if there’s a more efficient way of doing it. I mean, you could do a conditioned shuffle from the start
@brisk pond maybe implement this new version instead
I'll see that after the pizza
What do you think @mellow sable
maybe taking the card you want and putting it in first place, and then shuffling the remainder of the deck?
What are you trying to program?
Works but I don’t think it’s efficient; also you’d need to specifically shuffle a part of a CardArea
this joker
There’s an effect similar to this planned for Cryptid but I didn’t code it yet
but i want a scalable solution
I sent the code above but
that works for "the first two cards" etc..
I’d imagine you have to hook the draw function to check highest rank using rank api
And pick a random one if tied
I think the remaining of the deck isn’t uniformly random
You could always reshuffle it again
So I sketched a proof showing my algorithm doesn’t quite keep the deck uniform
And I thought of an improvement
My algorithm just moves the first card to the top of the deck with a swap
Or draws the card directly to your hand
The solution is to go over the entire deck then choose one of the options randomly
Yeah I think that’s the best idea
Which should make the result uniform
But not be as computationally demanding
You can check my code above
Well, the original one
@mellow sable
Below is the code that just draws it to your hand
Oh you’re hooking shuffle, interesting
I don’t rly have time to peruse the code but it might be better to hook the function that draws a card
what if i wanted to do that without hooking an existing function?
what would you do?
You can use SMODS.find_card or whatever it was called, or a custom global variable, to keep track of how many instances there are.
Also, to make it linear in deck size, keep track of the [number of instances] highest ranked cards seem as you iterate over the deck. (Although I don’t think it’s linear in instance size; it’s probably the product of both)
What makes you think that’s better?
Inject probably
The next option is to just overwrite the base behavior, but why do that when you can hook
Not rly sure, this was just my first thought on where to hook
what you think about this thought?
if context.first_hand_drawn then
- get hand[1]
- create a table D with all cards in the whole deck ordered by rank
- swap hand[1] and D[1]
But how do you know which call of the function you’re in?
I think it would look weird, since you’d see it happen
Also
As I said
that is not a problem
adding a message from the Joker and you see its ability happening with your eyes
im trying to not modify any game funcs
Also, your solution doesn’t account for drawing the higher rank cards and then replacing it with a lower rank
The first card is the highest ranked by default
if you build the table with cards remaining in deck + hand cards then problem solved
to understand how Balatro code works:
there is this G.deck which is a table that contains all you playing cards, hand + deck.
is this true?
G.deck.cards[1]?
hooking and checking for your joker isn't really modifying game funcs
Cerlo on their way to not use Steamodded to avoid modifying base game functions
To be fair, DebugPlus does very minimal modifying of base game functions
The dev branch does a bit more
lol
Cerlo on their way to play vanilla Balatro to avoid modifying base game functions
Cerlo on his way to disinstall Balatro to avoid modifying PC's code
Cerlo on their way to not update Balatro to avoid modifying base game functions
(Ultra orthodox Balatro traditionalist)
I'll just play on the first ever version of Balatro
Stupid question
How does one mod balatro?
michaelsoft defender says that lovely is a virus
You either trust michael or you trust the program you’re trying to download
Lovely does change the game’s code, which is used to mod the game, but is also how other virii can work
well it's going ok rn but I don't know what it means by the assets header in the steamodded install. i see the assets folder, but that doesn't have what i'm looking for
Do I need to specify a folder when injecting into a file in a directory? Thus, to inject into functions\state_events.lua do I need to write
target = "state_events.lua"
or
target = "functions\state_events.lua"?
Yes
Use a forward slash
Cause that's the way any sane os works
Cause everything else uses \ as an escape character
So it gets annoying
Alright
my moronic ass can not seem to find out how to put the Steamodded-1.x.x folder into the mods folder
Does the mods folder exist
yes, however i can not find a file explorer option to move the folder into the mods folder I have created in %AppData%/Balatro
the folder is empty
it will not let me
actually, I think it's just the search results won't come up with it
weird
I'm pretty sure there's a code for negative chips
it's just this
for context.individual
card_eval_status_text(card,'chips') does not add the functionality for negative chips
There’s a specific message type for minus chips iirc
And if it doesn't exists you can make your own too
yeah but you can't return it in context.individual
wouldn't that scramble the timing?
I don't see how adding a custom text would scramble the timing, unless you understood something else
you have to put your joker after the one to its left and before the one to its right
but the game doesn't make it easy to do that
if you just display the message, then the joker acts before all the others
if you call card_eval_status_text does it not add it into the event queue?
i don't think because the game doesn't just read a joker and execute it. it reads it, adds its execution to a table and then executes all values in that table
i don't know if you can effectively solve this problem
I don’t understand your issue
The game works by doing that
Adding a custom text can’t scramble the timing
Otherwise the game wouldn’t work
of course this totally makes sense
changing chosen from vert to vert makes it non vert 😭
ah yes
I think it's because function is run and then chosen is set to true somewhere afterwards
but why it works for challenges I have no idea
uhh maybe somehow because challenges menu is an overlay
😭
UI go brrr
Is challenges recalculated somewhere?
challenges dont have choice=true
but Idk how it works because when I do that the triangles never render
except for the initial one
and then clicking on the tab overrides it
actually nvm
only clicking off does that
hm
how does that make any sense
I'm looking at some code that's throwing an error... and somehow I'm getting a string when I'm trying to require a module?
fixed by 2 lovely patches but man did I want to die trying to make it work without patches
how hard would it be to make a copy of the red deck and just make the joker slots be maxed at 99
Why the f am I getting duplicated lovely patch sections in my git rebase/merge flows
@mellow sable Thinking about it, when multiple effects are trying to draw cards, they don't know about each other, which can be an issue if the draw is inside of an event. I'm not sure what's the best way to deal with it.
Either setting a variable on the card to say it's supposed to be drawn, or rewriting/copy-paste-editing draw_card to make it instantaneous and not create an event
I wonder if the latter is generic enough, since you can do the search inside of an event, and thus in theory proc while Jokers are resolving and not outside of the event queue
I quickly set up the former before going to sleep which works locally, but might not work with other mods
What version of Lua does Balatro use?
LuaJIT, based on 5.1
I was also thinking about how to stack multiple deck reordering effects in an intuitive way, and I found one that uses a function introduced in 5.3, table.move
There's a solution with table.insert but I don't quite understand it
To be fair I don't know if I understand the one with table.move either
oh wait it just removes the element then adds it again
I wonder if that would mess up the deck by manipulating the card table directly 🤔
In this piece of code in state_events.lua
--If chips added, do chip add event and add the chips to the total
if effects[ii].chips then
if effects[ii].card then juice_card(effects[ii].card) end
hand_chips = mod_chips(hand_chips + effects[ii].chips)
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(scoring_hand[i], 'chips', effects[ii].chips, percent)
end```
when does the `if effects[ii].card then juice_card(effects[ii].card) end` trigger? It doesn't seem to be when a card juice_up animation is played even though it refers to it and everything else in the function is being triggered
it jiggles a card if the card exists, no?
If a card has chips, yes, it should, but a debug message was never sent when the card played. Moreover, it should've triggered a whole chain of events with debug messages but none had been sent
And also, if I uncondition the string it crashes since it doesn't know from where to pull .card piece
Oh yeah I see what you mean
seems like juice_card isn't used as often at the code seems to imply
But it uses this exact animation for almost everything, and there're no other places I've found where the scoring card specifically calls for it
assuming you are interested in jokers, :calculate_joker needs to return both a valid type (chips, mult, etc) and itself as card
And most jokers that you would expect to don't
One of the jokers that does is Lucky Cat for example
Actually, I need jokers AND the cards in the played hand
oh wait, were you the person that was asking about juice_up before?
Yes
I think you want Card:juice_up instead of juice_card?
Oh, there's a huge chain of things it triggers across 4 files, including Card:juice_up
I'm away from pc so I can't recite
are you talking about juice_card?
But there's a spaghetti being called by juice_card
because all juice_card does is call Card:juice_up:
function juice_card(card)
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function() card:juice_up(0.7);return true end)
}))
end
And Card:juice_up calls movable:juice_up
Actually what I did is I copied and inserted this whole chain of events as spice_up and so on with every single function having a debug message (including an initial if), and none were sent while visually everything is alright
wow the spelling of "juice" is starting to look weird
Card:juice_up seems to work fine for me (5 juices for the cards, 2 for the jokers)
lots of background noise though, mostly when hovering over stuff, so you'll have to filter for that
Yea, that's why I need this exact procedure to be called
There's a whole block dedicated to specific card triggers
you're using juice_card instead of Card:juice_card to avoid the "background noise"?
Correct
you're avoiding more than just the background noise
Yes. You'll have to filter for that somehow
juice_card isn't called for scoring in hand for example
Well, you see, if I count the triggers of the chips function it works like a clock, but it counts before the hand has even been played
I want it to count each time an animation is played, for gradual growth
Aesthetically pleasing
so what, it works fine, the timing is just off?
That's why I'm trying to track each time an animation starts
It counts a slightly wrong thing
That's why I have recreated the whole juice_up chain of events so I can track each use of this exact animation procedure
right
Which I will call only in specific cases like chip and mult card triggers
And it won't be called by hovering and stuff
all seems good, so I'm confused about what the issue is?
It doesn't use the aforementioned if
Just ignores it
And idk from where else it calls for this animation if not from there
what do those ifs etc look like?
you're asking who else calls Card:juice_up if not juice_card?
right, slight issue with that, there's more than 1 or 2 instances of that happening:
Can anyone point to some examples of SMODS.load_file or NFS.load? I've tried both for organizing my mod into multiple joker files. But clearly I'm doing something wrong
But when a card scores with its chips, only this procedure of play juice animation-count chips-add them to counter triggers
cryptid definitely has file loading?
so... we're trying to find out which line is responsible for :juice_up on card score specifically?
Yup, since it sure isn't the dedicated string for that in its code
agreed
also why are you calling it a string lol
I keep thinking of a string literal "string"
Just started the reading the docs for SMODS.Sound and have been trying to figure out how SMODS.Sound:create_replace_sound() works.
possibly lines 894 and 914 in card_eval_status_text found at functions/common_events.lua?
Can't read them rn, I'll test them when I can
sure thing - you could also filter one of the calls of :juice_card and raise an error to get the full callstack
Also we can go the opposite way and try safely unconditioning the line so it actually triggers
As right now it crashes, as I said
sorry, I'm completely unfamiliar with steamodded's sound, but maybe someone else knows 😬
(you can look at the source code if you want though)
what would be the point of that? 🤔
So it actually triggers the recreated chain of events and counts it
sure, but isn't the error that card doesn't exist?
...yes, which is suspicious
like I said, card only exists if it gets returned
So, as I understand, effects[ii].card just doesn't exist at all, and this is why the if never goes through
well yeah
like I said (implied?) earlier, juice_card probably isn't what you want if you're looking for the played card triggers
Alright
Well, I guess the next best guess is another instance of effects[ii].chips as it triggers with it at least
how do you make something give xchips
I just used a Wheel of Fortune and this happened
The game literally went 
It's impossible to make a mod's header part update with variables right?
No, but you can probably mess with the variables that get parsed out in steamodded, although it's probsbky not supported
What do you want to do?
I tried putting my mod in the mods folder and when i launched the game it came back with this error, any way to fix this
Its a syntax error I believe
I checked the } and they seem to be in the correct places
What's on and around line 33
it's a closing parentheses to complete local joker = SMODS.Joker:new(
Can you send the code here?
the whole code? i'm just trying to get the sprite working now
--- STEAMODDED HEADER
--- MOD_NAME: Phantom Theif
--- MOD_ID: JOKERP5!
--- MOD_AUTHOR: [GalaCad]
--- MOD_DESCRIPTION: Adds Joker from Persona 5 as a Joker
--- BADGE_COLOUR: #ff0000
--- DISPLAY_NAME: P5 Joker
--- PRIORITY: -100
---MOD CODE---
local localization = { -- Localization is a separate variable so it won't look cluttered when registering
name = "Polydactyly",
text = {
"Destorys Heart cards",
" and add {C:attention}X1 Mult to each played Hand",
}
}
local joker = SMODS.Joker:new(
"Phantom Theif", -- name
"p5", -- slug
{extra = 0}, -- config
{x = 0, y = 0}, -- spritePos
localization, -- loc_txt. The table we declared just now is passed through this
2, -- rarity, 2 is Uncommon
5, -- cost
true, -- unlocked
true, -- discovered
true, -- blueprint_compat
true, -- eternal_compat
"", -- effect
"P5 Joker Mod", -- atlas. The Joker will take its sprites from the atlas called "Balatro Joker Persona 5"
-- We do not declare a soul_pos because we do not need one
)
joker:register()
local sprite = SMODS.Sprite:new("P5 Joker Mod",SMODS.findModByID("P5 Joker Mod").path, p5card.png, 71, 95, type)
sprite:register()
Is this for 0.9.8 or 1.0.0+?
0.9.8
Try replacing the [ at line 18 with {
and ] with } at line 33
That may be causing that crash.
at line 18 it's "Phantom Theif", -- name and at line 33 it's joker:register()
Also, maybe change joker:register to j_p5:register()
this one didn't work it's giving me the same error
I don't remember how to work with 0.9.8, maybe the wiki will have something we're missing.
where ia the wiki?
or is it easier to update to 1.0.0?
https://github.com/Steamopollys/Steamodded/wiki
And 1.0.0 has a lot more documentation and is being updated. Don't update unless you can migrate all your mods to 1.0.0.
ok thank you, also i'm only working on this 1 mod now
If you want a code editor, go with VSCode and get Lua for it
This is 1.0.0 code
is there a tutorial for making mods in 1.0.0?
The 1.0.0 code is in the numbered pages on the Wiki
oh ok, i was following that for my code
so i just need to download 1.0.0 and it should Theoretically work
Your original code was using the 0.9.8. I have an example of 1.0.0 Joker skeleton
is the Joker skeleton the photo you posted
Not that photo, but it should be this:
Again, use the wiki for better results
ok thank you, if I have anymore question would it be ok to ask later?
I may not know much, but I'll do my best to help at any time.
Anyone know how to change the keywords on the side
localisation\en-us, ctrl-f the keywords and change to whatever you want
There are some specific configs for colored text and such, but it is quite obvious
That's what I did
It didn't show up anywhere
And you need to load it with a specific code that I can't provide rn
You can find it in any other text-changing mod and copy it from there, it is uniform
I'll take a look around then
@rain imp have you looked in card_eval_status_text? I’m pretty sure every card calls that when scored and is juiced in there. I think the one you were looking at is for extra juice ups that are needed for certain jokers
card.T.y = self.T.y + (self.T.h/2 - card.T.h/2) - (#self.cards - k)*deck_height
how does this happen
you might need #1267576138687840438 then 
huh it doesn't actually make a difference though
oh there must be another function acting on these
there's no other reason it would have these huge gaps
isn't there hard set T
I remember something like that when working on cartomancer
I remember @edgy reef having issues getting the dice faces to align correctly. I think it worked after they put them into objects. Idk
How does the deck do it?
I'm using a CardArea at the moment
So you’re using Cards to represent the Chips?
yeah
I figured configuring them like a deck would let them stack up quite nicely
but I'm getting this weird problem with the last few chips
Try copy-pasting the deck and see what it looks like?
for entering the blind/shop area where abouts does that often occur?
what
👀
Nice
perspective is a bit off but it looks cool
I can’t tell if the spacing is correct for all of them. But this is really cool
they're all equally spaced
How did you create the fake cards?
it's the same card as the deck just with the sprite changed
So you create playing cards but change their Sprites to chips?
yeah
or rather, the back of them
although I suppose now I have this cardarea working I can stop it having type = 'deck'
Can you drag/click/hover a specific chips to see what it is?
just the top one at the moment
I'm not sure if having it on all of them is a good idea, it would be difficult to get the one you're looking for when there's too many chips
Nice, now how does it look with 32 stakes
Also gold stake isn’t shiny
adjusted the perspective a bit
I think the issue is we can see the top and side of the chips
hmmm
I think this scale and spacing works better?
32 chips for reference
any thoughts?
The chips are very thin
I am fairly limited of how I can manipulate the images
Move them closer because they are so thin
Aka this
More
MORE!
I preferred the original or the second one
Make the chips thicker
imo the best would be this but they are 1px thicker
Also, back to this, I can't find where the actual function is located. It is also called from card.lua, but I can't find it anywhere else
functions/common_events.lua
bruh
ctrl + shift + F
I checked it but forgot to cycle the search
I had a stroke reading this
I think there's still a couple pixels on the top bit it looks good
yay
How would these look if they're grouped together rather than cycling through the stakes?
Can I do joker.edition to get the edition of joker to check if it is negative?
they just cycle as a proof of concept for when there's more stakes
for example, here are the cryptid stakes
That looks sick
How do you make a joker with XChips?
Maybe check this out, or look how Cryptid does it #1257660889520144446 message
I still think the chips could be thicker
well if you can find a way to manipulate these into thicker chips please let me know and I'll try it in game
Can’t you scale them vertically?
I guess the relative size of the side to the top will still be the same
So I guess not without editing the sprites
Or using a shader idk
How hard is it to make a mod where theyre is a joker for every single card rank that states: Every scored card also counts as X rank
ex: you play a flush 5 of 4s but they also get scored as aces
oh XD
thats not exactly what i mean tho :p
im using the themed joker mod & have a build that retriggers lucky 7s a bunch
but I'd like to have a joker that lets say makes those 7s also aces
yk?\
kinda like sock and buskin
where everything is a face
oh so more like this? https://discord.com/channels/1116389027176787968/1219505109613023252
i should ask, does anyone have a nice resource of the game's color palettes?
so Im playing a 5 of a kind with 7s
i'm working on a very stupid resprite mod
but I have retriggers for aces I want to use
but my entire deck is 7s
so like a joker that makes all cards considered aces also
oh so 7s count as aces?
any card but yea
"scored cards also trigger played aces effects"
except replace aces with all 13 ranks
and a diff joker for each
it might not be possible to have a card as multiple ranks, i'm still trying to make one though
(some of the ones i've done so far)
Question: Anyone having problem with trying to have a suit appear in only certain decks?
i wanna cover every card in the game but for now i've only done the tarot cards due to all using the same palette
I wonder if you could do a legendary where every joker which says X card rank is triggered no matter the played cards ranks
the basil one is super fucking cute holy shit
Amazing art!
hop on bloons
(i do not ship sunflower i just thought a hop on bloons reference would be funny so i turned it into a frame of that gif)
also ignore how much shit is going on I have 16 mods installed
the x-card mod finds the best rank and replaces it. it's possible to have cards with Mutiple suits, but I think ranks can only be changed instead of multiple
intresting
Hello all! Has there been any work done on a true balatro randomizer? I'm a long time mod/game dev toying with the idea of randomizer development/archipelago support, but I'd hate to duplicate effort
wait nvm found the palettes
i'm now unstoppable
I wonder if you could do a variant of stone card that would count, like a joker that upon pickup gives a tag or enhancement that makes it universal and not even a rank so it would count? like making the jokers with I.e: Retrigger played lucky 7s also pickup on the enhancement
now i can continue to do dumb shit like this but for all cards
although with that youd probably need to make a custom code for every mod you want to be compat with
no bankrupt wedge 😔
Hi, is there any resource to get into balatro modding or should i just look at the game's code (if it is easily accesible) and go from there to make my own jokers and stuff ?
Get Steamodded
alright, gonna take a look at that, ty !
imo those need to be like twice as thick
Couldn't you try just stacking them on top of each other?
Like you did with all the different stakes but do it with the same stake instead
(Total height of stake selection/number of unique stakes)/height of each stake = number of each one
Cool
Not quite sure I understand what you’re saying here? The tower is supposed to represent all the stakes that will be applied to your run
is there a way to make seals stack?
like if you have a card gain purple it doesnt overwrite red
https://discord.com/channels/1116389027176787968/1264020405400633354 might have some code you'd be interested in?
I don't know how to make any mods yet XD
just wondering if it may be possible I do use that mod but it doesnt seem to work? it only shows 1 red seal being applied
I think the red seal count isnt shown in the sprites?
odd :p
Though if you have any questions about that mod specifically you should probably ask there, I've only heard of it in passing and I've never played with it
I am curious about how to mod tho, is there any tips for getting started?
Okay I gotta ask, how do I add onto a function without having to replace the entire thing?
https://github.com/Steamopollys/Steamodded/wiki/01.-Getting-started
is a decent start - there are some minor example mods in the github too
thank you! ❤️
You can either override the function or do a lovely injection
idk how to do either
like sdmath said, you can either
-completely rewrite the function
-do a lovely injection
-hook (or wrap as I like to call it) the function
Example of an override from D6Jokers, basically you save the function, and call it in your new function
Lovely injection is fetching a specific pattern in the original source code and placing it before, at or after said pattern to add your code
Yea?
No Faces is the original
I'd want something like
position as after, the pattern as the no faces command and then the payload as my no suits thing
correct?
Gotcha
For your thing it would be "game.lua"
I'm gonna have to do one for each suit to make it easy on me
is it messy code? Yeah. Does it matter? no
What are you trying to do out of curiosity?
you can put multiple lines in your payload
I'm recreating the Dungeons and Degenerate Gamblers decks
Yea don't make a lovely patch for each line lol
Yeah I'm gonna make one onl;y
I mean copying the if statement
the DNDG decks only use one suit each and then one will be something I do a long ways down the line
Do you want only one specific suit or one random suit?
They have to be specific for this
Why not make (_s == "Hearts" or _s == "Clubs" or.. ? Unless I misunderstood
Oooohhhh
mhm
That's ambitious
the last one is a variant of the Nothing suit where jack, queen, king, and ace are their glitch card
Yeah, and the full game comes out in less than a week
I should really try DNDG
another cool mod would be a tarot to add eternal to a joker
DNDG actually is getting mod support too
I tried the demo but I didn’t get it
Me when I make my Egg eternal 😎
Someone's making balatro in DNDG
Balatro was much easier to get
feels more like a spectral tbf
That's funny
Even if I didn’t know Poker rules
idc for balance XD
isnt the way you're doing it just going to remove all the suits?
Balatro is a harder game than DNDG. DNDG is literally just "Play Blackjack"
I know blackjack rules but I have no idea what the strategy is supposed to be like for DNDG
Aren't DNDG cards more cryptic than Balatro tho?
Guess it just came easier to me then, idk
Idk never tried it just asking
What do you mean?
Ive seen few videos of early gamas
Are their effects more complex
You merely adopted the gambling. I was born in it, molded by it.
I thought they were simple
At least the ones I saw
Well here's the one balatro mod, but the newest version explains a lot more stuff
But I still didn’t get what my strategy was supposed to be like
Ok imma just shut up about DNDG I know nothing about it
It has explanations now in effects so it's not as difficult
Btw love how you genuinely called me "sdmath" lmfao
I've finally became one of em
Example here
I have just called you math
Math, math, and math
Careful, you may accidentally call them meth
The three mathsqueteer
What do you mean accidentally?
Oh you can link VSC and Discord 🤔
Not sure how it works, but VSC has taken more "priority" compared to my other programs
Like rn I have VSC and Balatro open
Oh yeah I have more Space Jokers by the way
Including some whose art and concept were by Gaziter
So is this good?
What’s this
Send em to Dimserene so he can add them to the space jokers sheet
Or ask for sheet perm idk
@limpid flint
Did you put it in a lovely.tomlfile?
it's going to, yeah
It doesn't work if it's in a lua one
I also have Baby’s Building a Tower to Space, but I’m not sure it’s a Space Joker
Looks good to me imo
ok.
no
And I want to add Zodiac effects, which right now are Jokers but might become Consumables
you need to use ' not "
Uh
So either single or triple quotes
you have to use ''' on multiline strings
Patch that's gonna work like abandoned deck. Instead of removing certain faces, it removes suits
the example patch has """
Doesn’t Steamodded support that?
I know Bunco does it
idk
Exposed 😔
" only works on single line strings but not always
You might not need a patch
I think it breaks when there are quotes inside the payload that way
I just use ''' for everything now
Or some specific characters
Like _
Unrelated but I remember… either Julia or Python discussing how to parse strings with content like \\\\\
And all the issues that came with trying to do so
Sounds more like Julia? I dont recall python having anything like that unless it was minor or a long time ago
I’m like 99% sure it’s Julia but if I say anything incorrect a skeleton will jump out of the ground and eat me
Ah, the good old man-eating skeleton in the ground
But will the skeleton be able to parse with the ground?
I've tried figuring out without a patch. idk how to do it
yea special characters needs a \ behind them iirc
I'd say check other mods' lovely patches
so == is \=\=?
I'm not that well versed in lovely that much 😅
I don't understand any of it in the .tomls i'm referencing
yes
pattern before you added any escape characters
then just copy result from below
wait
why do you need regex
can you show what line are you trying to replace in the source code
you can use pattern patches for most use cases
if its a single line
if self.GAME.starting_params.no_faces and (_r == 'K' or _r == 'Q' or _r == 'J') then keep = false end
I'm trying to add another if statement underneath it
I noticed on screenshot above you dont have patches.pattern specified as well
you dont need to escape any characters if you're just using pattern patch
pattern patch = matches 1 line
do the '''
# Suit Remover
[[patches]]
[patches.pattern]
target = 'game.lua'
pattern 'if self.GAME.starting_params.no_faces and (_r == 'K' or _r == 'Q' or _r == 'J') then keep = false end'
position = 'after'
payload = '''
if self.GAME.starting_params.no_hearts and (_s == 'Hearts') then keep = false end
if self.GAME.starting_params.no_spades and (_s == 'Spades') then keep = false end
if self.GAME.starting_params.no_clubs and (_s == 'Clubs') then keep = false end
if self.GAME.starting_params.no_diamonds and (_s == 'Diamonds') then keep = false end
'''
match_indent = true```
you don't need to escape characters unless you're doing a regex patch
my guy. it's already '''
oh you're talking there
also you miss an =
Oh that must've gotten removed accidentally
also thought you mean by payload with '''
okay now what?
oh you need the header, hold on
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
put this at the top
ok
thanks
and...
game loads
if it works, i should have 52 cards in my deck and 0 hearts
oh
I can figure it out somehow
.
I DID ALL THAT FOR NOTHING!??
Why? Why doesn't this work?
function Back:apply_to_run(self)
Fem for female, I already did fem jokers : (Here is a few as examples)
Try this-
Oh
SMODS.Atlas({key = "Tarot", path = "custom_consumables.png", px = 71, py = 95, atlas_table = "ASSET_ATLAS"})
My mod uses bigger textures, can I replace the 71/95 by 142/190 ?
sure
I know what Fem means btw
Pretty neat
how does your code look tho
Thank you !
if you go to mods/lovely/dump/back.lua
to line 202
what's there
it's probably apply_to_run but just in case
function Back:apply_to_run()
local obj = self.effect.center
if obj.apply and type(obj.apply) == 'function' then
obj:apply()
end
seems weird that it would say self is nil
Now it crashes again but says :
[SMODS _ "core/game_object.lua"]:315: Failed to collect file data for Atlas femc_Tarot
huh?
I put the code you send me right, right ?
ok
Cute
Try to see how Bunco does it
Huh
it's a vertex shader
unlike fragment shader, it changes the shape of the card
so you can go "out" of normal card boundaries
well, I'm saying shape
not really to any shape cuz plane is just 2 triangles
so there's not much you can do (I think)
but you can do some funky transformations for sure
isn't bunco outdated though?
jimbo is scared 😰
No?
Jimbo has Parkinson’s v_v
Second effect is just wow... 
[SMODS _ "core/game_object.lua"]:315: Failed to collect file data for Atlas femc_Tarot
So does anyone knows why this error shows up ?
It’s on GitHub
Nevermind I found the error I confused a _ with a - 😛
@night pagoda
huh?
idk why you thought to ping them
I need more context
Bunco removes the new suits from decks
Uhhh, need to think about it
Not really
it just has in_pool value that prevents decks from adding the cards
See? I said it was a Steamodded feature
But I still want to think about this
Adding in_pool to vanilla suits doesn't sound very stable
Replacing*
Okay but you're trying to solve something i'm not trying to do
I'm just trying to figure out why the code isn't loading it
Have you looked at the dump
like 3 times
I'm looking at the code and it seems that there's actually base game functionality for removing suits from the start of the run for the challenge decks; perhaps it could be incorporated here?
what am I supposed to look for?
look for wahtever is causing your error
wahluigi
No? Because I didn't do a lovely patch for local Back_apply_to_run_ref = Back.apply_to_run
I think the challenge thing is the current method they're going with, Checkered deck's is this, under apply_to_run()
if self.name == 'Checkered Deck' then
G.E_MANAGER:add_event(Event({
func = function()
for k, v in pairs(G.playing_cards) do
if v.base.suit == 'Clubs' then
v:change_suit('Spades')
end
if v.base.suit == 'Diamonds' then
v:change_suit('Hearts')
end
end
return true
end
}))
end
So, maybe try replacing the starting_params things with something like this.
Oh so you’re not doing a patch anymore? What are you doing then?
what's on the line of your error?
hang on, lemme mess with something
Should I just send the code?
Eh, lemme try something
sure
do i need to make a second .toml?
no
can you send your file?
what did I do wrong?
ok
SMODS.Back{
name = "DNDG Test Deck",
key = "DNDGTest",
pos = {x = 6, y = 0},
atlas = 'DnDG_Decks',
loc_txt = {
name ="DNDG Test Deck",
text={
"Test Deck",
},
},
apply = function(self)
G.GAME.starting_params.no_hearts = true
end
}```
then use this instead
then in your toml, change the suit names to just the first letters
then if you need to do others, just add to the apply function
gotcha
Idk what's going on but sometimes with selected back, it crashes
but i reload with no changes and it's fine
Not what i meant by a deck of nothing
whats the crash message?
try viewed_back instead
Try putting the G.GAME.selected_back.effect.center.name == 'DNDG Test Deck' in the suit in parentheses?
change name to key
I tried and it didn't work
probably because you didnt change the string to the actual deck key?
hang on
okay i must be seriously screwing up balatro because now i'm getting cloud errors
when are you getting this crash?
nil check selected_back?
few seconds after loading the game
G.GAME.selected_back and (G.GAME.selected_back....your code) or false
return (G.GAME.selected_back and G.GAME.selected_back.effect.center.key == 'whatever your key is')
I don't know why in_pool is being called in the menu though
Maybe because it creates cards
For the splash animation and the main menu
oh good shout
me when selected_back_key
me when Myst adds dancing isaac to L Corp
that;s a deck of nothing alright
Can't wait to use "Death" to turn my into a
Why don’t you use to your into a
So yeah, what's the problem?
The problem is
I don't think selected_back_key is actually a key funnily enough
can you throw a sendDebugMessage(G.GAME.selected_back_key) in that function?
oh right it's the name 💀


but it's the same as what gets sent to Back() which takes a center
two questions.
1 - should the tower of chips display tooltips on every chip, or just the top one?
2 - how is best to lay out the selection. I was thinking 3 rows of 6?
I think if it’s all of them, it should move the pile up and down to focus on a specific one, and it probably needs some careful UI to make it feel good to hover over
yeah the hitboxes are nowhere near at the moment 🙃
If the multiline deck name is automatic that’s awesome
@wintry solar you can help me in dm?
why are the stakes look so squashed?
god that caused me such a pain because I overlooked the auto scale in one place
sure
but yes, Math, they are automatic
Awesome
I don’t think they need to be, necessarily, since I expect you to need to cheat them to make it feel good
Most people didn’t like the original look
I wasn’t one of those people but
What was wrong before?
I don't like how this looks at all because it looks like someone just stretched the entire thing in photoshop
I didn’t see an issue
this was how they started
this looks much better???
Welp. Next thing i gotta do is figure out how to make packs, how to remove cards from packs and keep cards from strength and such cards
@night pagoda can help me?
of course, what do you want?
why remove cards from packs? Can’t you make your own packs?
he wants help modding a pirated copy of the game
make mods non steam balatro
They’re playing cards i’m making
I don’t want them appearing in standard packs tho
Ah I see
I don't think there will be any differences in how to help tho
Maybe there’s an in_pool feature
To add to your playing cards
pirated games usually do not change their behavior unless it's like an Electronic Arts game or something
you'd want to patch create_card
sure
Big thanks
