#đ»ă»modding-dev
1 messages · Page 48 of 1
oh no
recent steamodded changes broke cartomancer đ
how do I patch this now đ
You should use the SMODS.load_file
Idk if that will fix your thing but I did design that for this
I am modifying view_deck code
Oh wait is this core steamodded stuff?
I mean there still probably is patches for some stuff in main
Otherwise override the functionsâą
I dont like that idea but seems like there's no other choice
Idk what your oatch is changing, but overwriting the functions can be pretty non-destructive
Also potentially just making a PR to fix whatever
I'm changing like 50% of the function logic to hide duplicate cards
I didn't want an override because if I override steamodded function I'll have to update it every time steamodded makes changes there, even minor bugfixes
ugh
which is pain in the ass
nvm I just checked whole function and I only change like 15% 
You can patch into steamodded functions by writing a .toml with a priority of 1
what path would I use tho
Hereâs an example
that's not going to work
I'm patching a function in overrides.lua
Oh
yeah...
maybe overrides.lua could be reworked to override with a lovely patch
then someone wants to patch different smods file 
I can see this work if there was a patch to somehow put the module inside zip
if the source file is appended to main.lua maybe you can patch there
that's what I was doing before 
Yeah I modified lovely one time to print every file it got the opportunity to patch and it never printed any SMODS mods and since were loading internal stuff the same way, I assume it's the same case
Should seals have weights like other items? At the moment they're all given an equal weight and I'm not sure if that's desired
that's what it was doing before, but I moved to loading the files because it's clearer in error logs than some main.lua:3210
i do wonder if there's a way for lovely to patch loaded files at runtime though
I mean Enhancements donât
As long as thereâs a 0 weight I think thatâs good
Do Enhancements besides Stone have 0 weight?
Like modded ones?
They don't either
Enhancements and Seals as far as I can tell are all given equal weights
Stone has 0 weight sometimes
where?
wait are thread files like sound_manager lovely patchable?
or does it not work, like it doesn't for loc files
huh that builds the pool manually
either way, they should also have weights, right?
At least a weight of 0
they are
but not if cryptid overrides them :p
I love Cryptid as a player
I hate it as a modder
Cryptid doesn't even conflict with anything my mod does but I still disable it because it causes the game to take longer to load by quite a bit
i decided to make a sprite for a simple fusion of odd todd and even steven for my "simple fusions" mod...
and then i made another one because i like the first one enough to make it its own thing.
Matt O'Metician (left) and The NumBros. (right)
huh neat, first one reminds me of a joker i made for ortalab
Is it gonna work with the fusion mod or its something different?
I can't believe this shit actually fucking works XD
-Mom, I want to lovely patch overrides.lua
-No, we have lovely patches at home
Lovely patches at home:
What is that trying to apply patches to
ugh, thunk does his seal checks in a different order to how his tables are saved
time to find an elegant way to retain vanilla order
steamodded file
my mod feature with stackable cards wasn't working with latest steamodded
because all steamodded files are no longer appended to main.lua
WHAAAT
I still cant believe it works đč
Okay why does it need to reach into there like that
because it's either that or I override function that steamodded overrides and update it manually whenever steamodded updates it
Is a steamodded PR in order?
what for
Also just updated Saturn, some of the incompatibilities are gone
Hmm... what kind of "proper" API could let you do what you want?
why does get_current_pool set items that aren't in the pool to "UNAVAILABLE" rather than just not adding them to the pool
thunk your ways perplex me
I mean not for patching steamodded, but the functionality you want to patch it for
there isn't any
it's logic that makes 0 sense without my mod
maybe if view_deck was split up in 2 parts, then it wont be as much effort for me to update it
because seeds would be completely unpredictable otherwise
the whole RNG would change depending on the cards you have
ah true
instead it takes a separate reroll queue when it hits unavailable
anyways
how do I actually get SMODS.Sound into the sound manager thread
i guess i need to add a request type?
Probably
And make it figure out how to load it, and also whether to pitch shift it or not
yeah, it's part of my fusion mod, which i'm probably going to revamp and rename. "Simple Fusions" is a good name, i think.
the idea of it was just "hey these jokers have similar theming or seem closely related, why not make jokers that put both effects in one slot?"
But like what's difference with the currently existing "Fusion Jokers"?
guys I'm having a problem when I continue a save
...you mean the one i created? i just said, "Simple Fusions" is going to be what that mod is reborn as. a new name to distinguish it from other joker fusion mods that have sprung up.
looks like you're not storing the card it's copying properly
yeah, and it seems like it's just a visual bug.
Didn't Itay made Fusion Jokers?
it is
oh you probably need a set_sprites then
i just do
card.config.center.pos = {x = JokerNumber, y = 0}
card:set_sprites(card.config.center)
where JokerNumber is a number based on the joker to copy
https://discord.com/channels/1116389027176787968/1223117435356577824 this is mine. i think the one you're thinking of makes somewhat unique effects for the fusions
which is not a direction i wanted to take it
yeah so card.config isn't saved
how can i solve this?
set_sprites = function(self, card, front)
if card.ability then
card.ability.extra.sprite_pos.x = card.ability.extra.uses_left
card.children.center:set_sprite_pos(card.ability.extra.sprite_pos)
end
end,
this is how I get it to update
when it's reloaded
so instead of this, I do just
card.ability.extra.sprite_pos.x = JokerNumber
?
you'll also need to create the sprite_pos in your config.extra
and by modifying card.ability.extra.sprite_pos.x the game changes the sprite for me?
if you call card.children.center:set_sprite_pos(card.ability.extra.sprite_pos) yes
and I call it right after changing the variable?
I tried and the problem remains
anyway, yeah. itay made fusion jokers because they were inspired by fused jokers, my more rudimentary mod. i respect the way they took the concept, but i always wanted to keep it simple. it's not an excuse to create a new effect for me; it's just "hey, these jokers work well together; let's make a new card that's both effects in one!"
fun, it's not possible to send Objects through thread channels
got it, now it works
đ
Seal weights complete, will look at enhancement weights tomorrow
How are you supposed to put config variables in a joker's text? Currently I have this code initializing the joker:
local forest = SMODS.Joker:new("Forest", "forest", {extra = {chips = 0, chips_mod = 20, mult = 0, mult_mod = 5}}, {x = 0, y = 0}, {
name = 'Forest',
text = {
"Gains {C:chips}+#2#{} chips per",
"discard and {C:mult}+#4#{} mult",
"per hand played. (Currently {C:chips}+#1#{}",
"chips and {C:mult}+#3#{} mult.",
"Resets at end of round."}
}, 1, 5, true, false, false, true, "Scaling Chips Mult", "Biomes")
forest:register()
modeled off of the cryptid and six suits jokers, but ingame it just says +ERROR on the joker's text.
modeled off cryptid jokers but using steamodded 0.9.8?
you really shouldn't
I'm using steamodded 1.0.0, did I accidentally do something that only works on 0.9.8?
it'll "work" through the compat layer if it's set up like a 0.9.8 mod would be, but I can't recommend it
the numbered pages on the wiki are for steamodded 1.0, the others are from 0.9.8 and just aren't removed yet
for variables, you need a loc_vars function
Stupid mod idea
Michel's deck
Gros michel can not go extinct, can appear multiple times, and appears 2x more often
+1x multiplier for each banana in your joker slot
Cavendish has a 1 in 6 chance to be sold each round
All cards remaining in hand have a 1 in 6 chance to be destroyed each round
The card back looks like bananas :3
I think that would be more suited for #âă»modding-general and not here
TBH being able to make patches with logic could be cool for some stuff. Also just be weary, this could end up modifying another mods file, if they have the same name.
so apparently a number minus nil in lua makes a table???
I was trying to do a simple check if the played hand won the round and it threw a "tried to compare table and number" error
apparently the call I used to try and get the required chips was nil
That doesn't make sense
should give a
attempt to perform arithmetic on a nil value
error
nope, it's making a table that prints out as just nil
I've checked type on both arguments, type of result and printed the result
if you're sure, you can show it here but I'm pretty sure something is not happening the way you're expecting it to
I have a grand total of like 30 minutes of experience with lua so I'm def just missing something
okay yeah, figured out my stupidity
this is still weird tho
the type on second argument is table
(second argument here is G.GAME.blind.chips)
lemme check what the value is
That should be a number unless youâre developing this mod with Talisman, no?
ohhh does talisman mess with it?
I left talisman in while developing this so I could make sure I didn't mess with the modloader and no mod would work
yes, talisman turns it into a different type that represents a number (which can basically only be table in lua I believe?)
something something lua doesn't have "real classes"
It makes some game elements a class.
Which in Lua is a table
I call it âmetatable spaghettiâ
type saying "table" definitely isn't very intuitive, no
alright then, time to dig through talisman and figure out how to reference required chips
The only thing you should need to do is wrap the blind chips in tonumber()
I haven't looked into mod-compatibility with talisman yet, so I don't understand - wouldn't tobig() (I think it's called?) on the other operand be better?
like comparing an integer and a floating point right? convert the lower precision one to the higher precision one when comparing?
So I'm coming up with concepts for a really big balatro mod, and one of the things you can do is fuse specific cards together
I decided to make a new common card called roller coaster, which will gradually tick up in mult by 1... 2... 3... 4... 5... and then on the 6th or so hand it plays +1 +2 +3 +4 +5 in quick succession and then immediately destroys itself afterwards
Why did i do this? So i could let you fuse it with mr bones to reference mr bone's wild ride
I want to get off mr bones wild ride
Also combine swashbuckler and mr bones and you get rattler
It increases in power significantly for every wheel tarot card you use but if it fails he has a one in four chance of being destroyed
Careful my friend or he'll rattle and shake
youve described fusion jokers
you could make an addon pack for it though
Also...
If rattler is destroyed all your foils, polychromes, and all that other stuff is removed
but why
Btw, is there any way to influence "draw priority"?
The "View deck" is hidden behind my :draw, but I'd like it to be on top of the red sleeve as well.
I could probably lovely patch into the function so my draw gets called before the view deck and after the cards, but some kinda draw priority might be a cleaner solution?
Yes, but this is a very big mod idea
I haven't put the post in #1209506514763522108 because I'm still working on the ideas doc
The main gimmick is that every single joker has an upgraded version that takes a certain goal to get
Some are harder than others but have greater rewards
Fusion is just one of the ways you can upgrade the jokers
so you're thinking of evolved/fusion jokers?
you could make a mod that adds jokers for that so
...
I spent so long thinking up this concept
So... what you're saying is... my mod idea is already taken
yes
all isnt lost though, you could make jokers that only appear with fusion jokers installed
so its not a total loss
Yeah...
I thought of an entire new core mechanic for evolution, over probably 5 hours of nonstop google docs editing, and my idea isn't even remotely original
Great
being original is basically impossible
dont worry about that
worry about making a good mod
you could even be glad that someone already did it, it shows that theres intrest in this type of mod
Alright, I'll keep going
I mean, there's going to be over 150 new jokers added, which will be a ton of work and something i basically can't do, but the idea is there
Well... my mod will overcomplicate the game actually
Having to keep track of all this evolution and goals and trinkets... no real point in it
I'm going to make my scope a little smaller
I know there's already a blinds jokers mod (which I'd like to play) but I feel like I could have a different take on the concept
I just need to... you know... figure out how to code and make decent looking pixel art
It'll actually be pretty fun
Sorry for the text wall btw
Thank you for informing me, rougefort cookie from cookie run
Now i'm working on something I'll actually be able to manage
no problem gros michel from balatro
Ahem, now if you'll excuse me... âExtinct!â
Alright, got it by replacing View deck's draw with a dummy, then calling the actual function in my own code afterwards
tried drawing it twice on the same frame, but the game doesn't like that đ
does anyone know why create_card's center variable would be nil? it's getting declared as G.P_CENTERS.b_red, but when center gets referenced later in the function it's throwing an "attempted to index a nil value" error
I don't recall what b_red is
its the center for red deck, I think it's just meant to give center a default value
bc the local center variable is used in the forced_key conditional and filled with the center corresponding to the forced_key arg
but when it gets referenced in the forced_key conditional it throws the nil value error and I can see in the error message that the local center variable is nil
;
god i love ;
okay update on this, turns out its nil when cryptid jokers call it as well
dont know why my call is having problems with it but we'll find out
so I am the dumbest mf that has ever lived
the forced key I was passing was j-forest instead of j_forest
fuck
how do you dissolve a highlighted joker?
I've caught wind that Balatro uses MSAA
Also self reminder to check if Love2d releases contain a usable luajit 2.1 dll to try out
Just thought of that but I've already shut down my desktop for the day
hm
should unsynced music also restart the next track when it's switched out of? I'm not sure if modulating out of it causes issues
seems like it doesn't cause issues to not restart
yeah no it sounds much nicer having it start wherever, just because the start of balatro music is kinda meh
aight it's done
anyone else in lua multi line comment & strings hate club 
--[=[
yeah totally
also the fact that escape character is %
you can make lua multiline strings like [=======[]=======]
yea I figured
but like
why have 2 different multi line comments and strings
totally makes sense
technically it's arbitrarily many
practically same thing tho
oh I see the idea
so the closing has to match opening
if you have comment inside comment
that's like very niche tho
i have a very funny idea for a mod
but have no idea about how a second play-area/deck is possible
idea is basically making a secondary TCG deck
where i add cards from existing TCGs and just add some balatro functionality
you could draw the cards from packs only
and the deck is built off the packs
then its added to a second hand if theres another card at the start of a new round
say i make a black lotus card for the deck, it would basically have the text:
Sacrifice Black Lotus: Add +3 Hands for this round.
or a lightning bolt:
Lightning Bolt removes 2000 from the current blind.
simple little gimmicks like that
would changing it to remove 20% be better?
probably
i guess i could make the "mana cost" of these spells just be your hands (for the round)
these would work as oddities if they still existed
I mean you can add extra CardAreas
i mean the idea is there is gonna be a "discard" pile, it just cant really be interacted with except for by other cards
Thereâs already a discard pile
yeah i did see that, sorry i forgot to respond thanks haha
pot of greed => draw two diamonds
pot of wrat-
i know
Pot of Greed number 1e100e100
i figured i'd design the power nine first
the moxes were definitely the weirdest to figure out
+1 odds?
like in OA6s
+1 to listed probabilities?
basically yeah
should probably be x2 to avoid inconsistencies with selling oops
fair enough
the others look fine
probability api when
should i make pot of greed draw 3 instead?
i think it'd be funny
i mean mtg already has that lmao
no way Ancient Recall from isaac
Wild Card (Binding of Isaac)- Trigger an effect depending on the last Consumable used
so its like a fool but funny
Not sure how I feel about this idea:
Before last hand of round, draw a Royal Straight
correct teminology would be an Ace-High Straight
Idk if it's placebo or what, but my impression of game performance after substituting in LuaJIT 2.1 (specifically, the one Love2D releases with)
Is that it's better
also you shoukd add "if possible" in case the deck has no ace-high straights within it
No, everything only happens if possible
I see, but I like the sound of Royal Straight better
I'll think about it
I'm more worried about balance
I'm still not sure how to evaluate these consistency enabling effects
Honestly it almost feels too weak for a rare? It might actually be balanced as an uncommon
Without upgrading it, Royal Straights are valuable but not incredibly so, and consistency-wise there's no guarantee which suit you'll draw or which cards from that suit you'll get if you have multiple cards with the same rank and different upgrades
I like the idea, and I don't think it'll be too overporwered
also no guarantee to draw a royal straight if you discarded all of one component already
I mean I think it could be powerful, but you'd have to make a build around it
You still draw the rest
Do the missing cards get perminatly added?
What do you mean?
@rough furnace ?
I assume he meant something like, if you discard all of your kings, then draw a royal straight, does the replacement king permanently stay in your deck?
Is it missing other shaders it should draw? Idk what sprite_draw_shader does
what replacement Kings
Any idea of how I can inject in this part of the code? Can a regex patch help me?
Well you said it still draws the rest so what king is it going to draw?
"Rest" clearly doesn't include the missing link
Quick question about voucher localization, is this how you do it?
it's descriptions but looks good
ah
is there a proper way to replace an object's loc_txt?
anyone know what the SMODS function for adding languages into the game is?
The docs are incomplete
check parse_localization or something like that
near init_localization
check #1250676786040148042 i think
and for the font, do the temp write thing
huh
Is the mod id correct?
Oh wait, the description should use curly not square brackets AFAIK
--- STEAMODDED HEADER
--- MOD_NAME: MyMod
--- MOD_ID: MyMod
--- MOD_AUTHOR: [Your Name]
--- MOD_DESCRIPTION: A mod
--- VERSION: 1.0.0
--- PREFIX: mymod
----------------------------------------------
------------MOD CODE -------------------------
SMODS.Atlas{
key = 'temp',
path = 'v_placeholder.png',
px = 71,
py = 95
}
SMODS.Voucher{
key = 'my_new_voucher',
discovered = true,
atlas = 'temp',
cost = 1,
pos = {x = 0, y = 0},
config = { extra = {} },
requires = {},
redeem = function(self)
end
}
----------------------------------------------
------------MOD CODE END----------------------
I haven't seen any that do otherwise
It's square because it's in JSON
Got merged a couple days ago after I made the PR
It follows the same format as in Lua
Just that it isn't a table anymore
# After Draw Context
[[patches]]
[patches.regex]
target = "game.lua"
pattern = "first_hand_drawn = true}\)\n(.*)end\n(.*)end"
position = "after"
payload = '''
if not (G.GAME.current_round.hands_played == 0 and
G.GAME.current_round.discards_used == 0) then
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({vic_hand_drawn = true, vic_facing_blind = G.GAME.facing_blind})
end
end
'''
match_indent = true
Does anyone know why this patch fails? I think the error message mentions some issue escaping a character
try escaping the }
Hey I just came here to ask about a fun mod that doesnât break balatro but adds a lot of new stuff would anyone beable to lmk a good one if they do know one
Nope
Thank you so much and where do I find these
Youâre the goat I appreciate you
for some reason u have to use ' '
if you have escape character
in the pattern
or '''
That's what works on my end
Hey Iâm sorry for bothering but Iâm trying to download the world ends with Jimbo mod and I found it but I canât find where to download the file so I can add it to the mods file would anyone be able to assist
wow that's so weird
I just always use ''' now to avoid stuff like this
Whoops.
Removed some code from the Lapin Angelique deck rework that had somehow snuck in
Fixed the code that made it so Spectrums don't work with Flames Apart, Foes Aflame to properly work wit...
Thank you!
Goat
Okay I got the profiler set up, seems like Balatro spends quite a bit of time dealing with and sorting card areas
That worked! I now re-initialize the localization on loc_txt change, thanks :)
I mean, most of the things in this game are implemented via card areas, so that makes sense? đ€
usually lag comes from having a lot of cards in deck and or jokers
I think thatâs when most cards are created, which means Love2D is creating sprites
I think thatâs resource intensive
anyone know how i can remove the grey background??
im not even sure why its there
doesnt seem to be anywhere i can pass in a clear colour
ill send my code
args = args or {}
args._type = args._type or 'Joker'
args.col = args.col or 5
args.row = args.row or 2
local deck_tables = {}
S.card_display = {}
for i = 1, args.row do
S.card_display[i] = CardArea(
G.ROOM.T.x + 0.2*G.ROOM.T.w/2,G.ROOM.T.h,
5*G.CARD_W,
0.95*G.CARD_H,
{card_limit = args.col, type = 'title', highlight_limit = 0, collection = false})
table.insert(deck_tables,
{n=G.UIT.R, config={align = "cm", padding = 0.07, no_fill = true}, nodes={
{n=G.UIT.O, config={object = S.card_display[i]}}
}}
)
end
local card_options = {}
for i = 1, math.ceil(#G.P_CENTER_POOLS[args._type]/(args.col*#S.card_display)) do
table.insert(card_options, 'Page '..tostring(i)..'/'..tostring(math.ceil(#G.P_CENTER_POOLS[args._type]/(args.col*#S.card_display))))
end
for i = 1, args.col do
for j = 1, #S.card_display do
local center = G.P_CENTER_POOLS[args._type][i+(j-1)*args.col]
local card = Card(S.card_display[j].T.x + S.card_display[j].T.w/2, S.card_display[j].T.y, G.CARD_W, G.CARD_H, nil, center)
if args._type == 'Joker' then
card.sticker = get_joker_win_sticker(center)
end
S.card_display[j]:emplace(card)
end
end
local t = s_create_generic_options({ back_func = 'saturn_stats', nodes = {
{n=G.UIT.R, config={align = "cm", r = 0.1, colour = G.C.CLEAR, emboss = 0.05}, nodes=deck_tables},
-- {n=G.UIT.R, config={align = "cm"}, nodes={
-- create_option_cycle({options = joker_options, w = 4.5, cycle_shoulders = true, opt_callback = 'your_collection_joker_page', current_option = 1, colour = G.C.RED, no_pips = true, focus_args = {snap_to = true, nav = 'wide'}})
-- }}
}})
return t
end```
G.SETTINGS.paused = true
local args = {
_type = 'Joker',
col = 5,
row = 2,
}
local t = s_create_generic_options({
back_func = "saturn_stats",
title = 'Joker Stats',
nodes = {s_create_card_display(args)},
colour = G.C.CLEAR,
})
G.FUNCS.overlay_menu({
definition = t,
})
end```
sorry its quite a lot
for a start, does this also happen if create_UIBox_generic_options is used instead of that custom function there? I'd like to figure out if that function is at fault before trying to parse it
Hey, quick question what is the best way to grab the current deck? managed to get the custom deck setup and wanted to be able to pul it in and do logic
not able to determine if its under G.GAME G.deck or some other nested path
G.GAME.selected_back for the data associated with the current deck (check back.lua for how it's organized)
G.deck is the card area that holds the cards that are in your deck
ah i thought it was that due to the b_xxx when adding custom in but was not sure cheers đ
Okay I think I've narrowed down the incompatibility between Steamodded and Saturn a bit: It seems to start precisely when I click "apply" for the Saturn settings
đ đ so uh where can I find example for steamodded configs
https://discord.com/channels/1116389027176787968/1248249207526002698 has some, https://discord.com/channels/1116389027176787968/1264020405400633354 also has some, along with some discussion and Eremel's WIP guide, and I don't know of any others yet.
@languid mirage here's what I have so far in terms of guides to config and UI
@frosty dock i mightve figured smth out
this is what happens when i make the root node of the generic options clear
so maybe theres no bounding box or smth
if that makes sense
yeah
cool
thank you
also rq
can i make a node as wide as possible
like the back button node
can i make it fill the thing
but not push it any further than it needs to be
its not a button
its just a node
yeah
I'm not sure what focus args does tbh
odd, that background is supposed to be there, but it shouldn't be fully opaque
for steammodded; is there a way to tap into a specific G.FUNC and hook in? as of now just been manually running the modded build
but you could just set the width of the container
id like it to be dynamic if possible
so if the menu is smaller then the button is too
or the node acting as a button
isn't focus a controllers thing
that's what I thought
i think theyre actual ui buttons
but I haven't tested them with my controller and I cba
they do read like they'd be for controller support though
oh
local xyz_ref = G.FUNCS.xyz
function G.FUNCS.xyz(args)
-- do something before the function executes
local t = xyz_ref(args)
-- do something after the function executes, modify the return value if needed
return t
end
if you need more advanced patching, you can use lovely for that
i just saw nav wide and snap to
so maybe it would make them wide
ill have another look at the ingame buttons then
awesome stuff! cheers that is basically what I need... and one more question is G.FUNCS.cash_out the func that runs and updates the dollars balance?
what's this for btw, looks interesting
that one gets executed when you press the cash out button after beating a blind
the actual updating of money is done by ease_dollars, which does get called in there
is this directed at me??
yea
its for saturn
im helping w some of it
mainly ui at the moment
atm ive just made the collection display take an argument for rows and columns and type of card
we're gonna have a way to view stats of each card hopefully
i basically rewrote most of the ui stuff tho because game ui isnt the best looking
that screams for incompatibilities lmao
well i didnt rewrite them
theyre their own functions
but ive got the saturn menu to look like this
still tryna get the buttons at the bottom to be wide
working tabs and everything
anyway i can get the width of a parent node??
so i can set the node width to its parents width minus some
There are minimum width settings
ik but id like it to be dynamic
Maybe it doesnât support that feature because thunk doesnât use it
i was here with other questions so i thought id ask about a bit
ill resort to minw if i have to but for now im gonna see if i can figure anything else out
I mean
Depending on when the UI is generated
It could recover the appropriate value to pass to minw
So I think starting there is a good point
and one last question, for the chips/mult when select a hand where is that filled and used đ
that's a bold statement
what's wrong with UI lol
unless you mean the code
i just think its not exactly the highlight of the game
What do you mean exactly
i play balatro because its a great game, not because the ui is anything special
but what if
balatro and cool ui
The UI is very good
^
i mean more like menu ui
it's very minimalistic
Itâs very responsive and diegetic
in game its nice for sure
the chips and multiplier when selecting a hand to play e.g High Card has the base 5 chips and 1 mult trying to determine which func taps into that so i can inject the custom deck params
but the menus arent the best looking imo
again its down to preferences so
each to their own
yea that's subjective
idk sounds like re-inventing the wheel
but its kinda fun ot reinvent the wheel
all programming's about 
exactly
More specifically, do you want the base Chips and Mult of a Poker Hand or do you want the values as theyâre used when cards are scored?
personally I'd prefer sticking to the game's style, but that's just me
the value before they get scored as the current mod im working on effects all chips to be scored đ
and now im tryna make it in game
I won't stop you from messing around, at worst I'm concerned for incompat by making UI nonstandard
hence at worst
ah mb
As idealy id like to go:
UI displays: base + mod
Action: implements base + mod
Thatâs not too different from the base game. If anything I think thatâs not very good because it presents too much information thatâs not important. I donât need to see my statistics while looking at the Collection
@mellow sable
I think the statistics make more sense separately
its seperate from the collection tho
its a seperate menu where you can view so a bunch of different stats we wanna add
for people who want to see them
i get that not everyone is interested in all that
but for people that are
like me for example i love stats
I think you could look at where a Handâs current base Chips and Mult are stored, but Iâd maybe just modify it at the very start of evaluate_play
Because I think the alternative might lead to complications
it would be awesome to see all these different stats in one place
because we wanna add tracking for stats that the game doesnt track atm
like i put in a highscore counter so each joker shows the highest value you reach with it
like lucky cat most mult x233
agreed was not sure if modifying at beginning could cause it to go lost but ill checkout evaluate play cheers ^^
or smth
most rebate money $4030
or smth
like is that not cool?
sorry im kinda filling up the chat w shit
ill stop
You can keep going if you want
nah myst will tell me off
Iâll tell you on
lmao
By the way
i just think its cool to see more stats then the game already has, some other people would probably like that, im enjoying making mods, so why not combine the 2
Does anyone know how to move all of a Jokerâs tooltip up or down?
yeah
theres a function in card.lua
that aligns the popup
i think you might be able to hook smth to it and change the alignment
1 sec
Ideally it would be automatic
Because sometimes in the middle row of the Collection, tooltips go the wrong way and end up offscreen
im not sure about collection because idk how you determine which row the card is
but if you look at how the collection generates the card area you could probably figure it out
Judging by that line I think itâs literally by screen position
It is
I have a function that iterates over it
Although in hindsight maybe that function was superfluous
But anyways
you can do it based on pos yeah
I think more importantly
Iâd like to do it based on tooltip height
But Iâm not sure I can predict it
I've tried and got it working iirc, but I wasn't able to get it to do it dynamically
it would only adjust on the next time hovered
while the game starts, create one of everything then hover over it
Ah
Maybe you can destroy the tooltip then recreate it?
I think an easy solution is to add a new variable to cards and inject into that function to see if the variable is present to adjust where the tooltip shows up
Since itâs only an issue for specific cards at a specific screen position
got rid of the grey background
s_create_card_display was returning s_create_generic_options(nodes and stuff)
and then that was being pass into s_create_generic_options again
so i had a huge root node like 10x the screen
aha
its coming along nicely now tho
Your UI is awesome
thank you
this is the best custom ui ive ever seen ever
wow thank you random discord user ive never seen before ever
I'll kill you
Can you make the background change color like text?
Like DARK_EDITION?
yeah
How so? When I tried it just used the value of the time it was generated
But I didnât look further into it
(Thatâs because I wanted to do something like X:dark_edition)
Also Iâd add some more horizontal padding so that the Jokers arenât so close to the border
oh yeah mean like change colour like the badges and stuff
yeah ive still got loads to do
im not sure if you can make it alternate colours without redrawing the whole overlay
Heavily modded balatro is chugging quite a bit more than the unmodded game
you just set the colour to G.C.DARK_EDITION and I'm pretty sure it works
As I said I tried X:dark_edition but it would just use the color of the time the UI was generated
2GB LuaJIT memory limit be like
I've hooked up the GC method with logging to try and catch GC pauses, doesn't seem like the culprit (not directly, at least)
(There's a statement which causes a full collection if it reaches a moderate memory threshold, it's never been hit even when I get whole tenths of seconds of lag)
yeah ig the lag is more about card areas and whatnot
Iâll have to try that later, but Iâm thinking that wouldnât work either.
Also, technically X creates a column (?) UI element, and then adds the text inside. Text changing color is actually supported by default, since thatâs how dark_edition is used
Yeah đŠ
oh of course, I forget you're working inside the tooltips
I might have to strip out some of the wacky stuffs going on inside some of the mods just to not suffer horrid lag
some mods are probably just kind of unoptimized?
Yeah, though profiling shows it's more like "doing more of the same" than "doing all new things"
The hotspots look similar to what you'd expect in the base game, but their impact is excabetated by mods tossing in all their own things using them
perhaps there are some optimizations possible on base game code?
Though I did catch some stuff going on with the channel going to the sound manager thread, which might explain that thing that one person observed with repeatedly entering and exiting the new game menu
the channel? there's a thing about the thread itself where it keeps re-aquiring the sound objects
I'm not sure why tbh, it seems completely unnecessary
Sounds like a reasonable thing to tweak with a patch?
wasn't that me?
I do remember someone talking about opening and closing the new run on the main menu and the amount of objects shot up exponentially.
Something like that
I didn't really wanna touch it cause I wasn't sure if there's some good reason for it, but I might just try patching it out while I'm at it
this?
Yeah
Yeah feels like something isn't getting cleaned up correctly there when exiting the new run menu
on the other hand, who's out there opening that menu hundreds of times
maybe it's just trying to save on memory by releasing sounds that aren't currently playing
there's a tradeoff i guess
not sure what's better, but I'm not dealing with re-aquiring modded sound files
Caching time?
True, but if thereâs a cleanup issue it could crop up again some other way outside of the new run menu.
apparently love has a tendency to not like the location they're written in, so it literally involves writing a temp file
I'd rather keep the sound object in the thread's memory directly, no thanks
it's less expensive for vanilla sounds, so it might actually make sense to some degree
It might require updating the code to update the color of a column. Iâm not sure how itâs done for text
You mean as in Love2d will transcribe the file to a tempfile just because of where it's being read from?
this is done explicitly, I don't think there's a way to make love.audio.newSource work with nativefs
actually I'll have to check the docs on that
It says it can also work with a SoundData or Decoder object
yeah i can cut temp files then
I'm not sure how it actually does the text stuff in tooltips, but it definitely works on any nodes
thats a bit too much 
okay i tried changing from temp files but it's choking hard
Can you try X:dark_edition?
I canât right now
Text desc is just C:dark_edition, no?
work's for me
Video please? đ„ș
thoughts??
Why not hover?
wdym
wdym
Like it works in-game. You hover and it shows tooltips
Maybe clicking could highlight the Joker, and the Joker keeps tooltips on while highlighted
like how many runs used with it
đ€
You could show the stats just by hovering
how am i gonna fit a page of stats in a tooltip
No clicking needed
the point is its gonna be a load of stats
yeye
I don't think steamodded has ever touched this stuff
It doesnât
I donât remember seeing anything manipulate how the localize() or related functions to it.
there's a new change that manips localize a bit
for number formatting
but that's all
is there a way to trigger a rerender of the ui, or is it drawn per delta?
yeah, what are you planning to do? rerendering the full ui seems overkill for most things
SMODS.Booster:take_ownership("p_spectral_normal_1", {
config = { extra = 4, choose = 1 },
weight = 100
})
is this still the way to take ownership in smod 1.0.0?
yeah
cuz it kinda crashes when I open that booster pack
Oops! The game crashed:
card.lua:1879: attempt to index local 'card' (a nil value)
Additional Context:
Balatro Version: 1.0.1f-FULL
Modded Version: 1.0.0-ALPHA-0724b-STEAMODDED
Love2D Version: 11.5.0
Lovely Version: 0.5.0-beta6
Steamodded Mods:
1: Test by LarsWijn [ID: Test]
Stack Traceback
===============
(3) Lua field 'func' at file 'card.lua:1879'
Local variables:
_size = number: 4
(for index) = number: 1
(for limit) = number: 4
(for step) = number: 1
i = number: 1
card = nil
(*temporary) = nil
(*temporary) = table: 0x12dc1538 {alerted:true, weight:100, _saved_d_u:true, original_key:p_spectral_normal_1 (more...)}
(*temporary) = table: 0x12f47548 {opening:true, click_offset:table: 0x13822c10, children:table: 0x12b300d8 (more...)}
(*temporary) = nil
(*temporary) = number: 58
(*temporary) = table: 0x12b0cf20 {velocity:6.7665175720666, scale:0, size:0.27623548316571, facing:5.6853036745738 (more...)}
(*temporary) = boolean: false
(*temporary) = string: "fill"
(*temporary) = number: -0.0295931
(*temporary) = number: -0.0295931
(*temporary) = number: 0.0591863
(*temporary) = number: 0.0591863
(*temporary) = string: "attempt to index local 'card' (a nil value)"
...
someone please tell me theres a way to have the page number text get updated đ
No its physically impossible
are you fr
he is
whats a dynatext thing?
that sounds like it could do smth
please
after all my work
there must be a way
you should probably take a look at how the rest of the collection does it
hang on as second. Was that Zaino on Space Joker?
yeah lol
W
so create_card doesn't even seem to get called, even though it almost certainly should
I distinctly remember this bug happening when a Cryptid patch nulled a Steamodded patch for create_card
Also I donât think create_card had a default return, youâd need to define it manually.
Probably that if itâs not the former
maybe something breaks assuming it's a modded pack when it's just a modified vanilla pack
SMODS.Booster = SMODS.Center:extend {
...
create_card = function(self, card)
-- Example
-- return create_card("Joker", G.pack_cards, nil, nil, true, true, nil, 'buf')
end,
}
huh
that is not valid syntax
I did want to mess with that lovely patch anyways, Arcana packs gets priority over Steamodded packs which is a problem if you take ownership of one for the purpose of adding create_card.
(same goes for celestial, no?)
yeah that sounds bad
in any case, this is intended???
surely this is not intended
I didn't think it was, which is why I'm so confused lol
iirc the elseif order for create_card was Arcana -> Steamodded -> Celestial -> Spectral -> Standard
Something like that
^^
its Arcana -> Celestial -> Steamodded -> Spectral -> Standard on 724b but yeah
please tell me i can update the text
If you mean the function returning create_card then yes.
please it's 2am
Although I hate that
I will not try to understand UI code rn
i just removed this
okay nws
see if it works now
what do you think of the menu tho??
fair lol
looks clean
In hindsight idk why the return of the function was commented out but the function stayed.
I thought it returning a joker would be fine for default purposes at least.
Ah yeah, that should work yeah. Lemme test it
yeah ikr who would do that
Yup, works now đ
great
not sure what my thought process was on making that hash 0725b, it's literally the next day
whatever
this is definitely weird
yeah a bit
ugh didn't even see that
but you cant emboss buttons as far as i can tell
i shall go to sleep
goodnight
gn
thanks for the quick fix, gn :)
How do I check if a card is wild?
i think i might patch the press thing to take an argument to not scale it down like that
Card:is_suit does
self.ability.name == 'Wild Card' or self.config.center.any_suit
Are these âbuttonsâ separate nodes from the white outline/background
Would setting them to have an outline e not solve the problem somewhat?
Rather than having a background layer and a foreground layer?
i dont want them to be scaled at all when you press them
just go darker
so i think patching that is probably the way to go
i cant remember where it is in the source code tho lol
i might try the outline and see what it looks like tho
okay outline looks really good nvm
thank you for suggesting that
i didnt even know i could do that tbh
id just seen the emboss thing before
Emboss kind of adds a lower border, right?
im not even sure what it does lol
I know if you make the number big it looks like shit
im completely winging this whole ui thing
I need to test it some more
I mean the Collection does it somehow
it uses dynatext but i cant figure out how it updates it
theres an update function
How are you writing the text at the minute?
its an object node with a dynatext object
Uhhh I havenât looked at dynatext yet
config = {
object = DynaText({
string = {{ref_table = page_options, ref_value = (S.current_page + 1)}},
colours = { G.C.WHITE },
shadow = true,
scale = 0.4,
})
},```
ah
any way to do it with normal text?
I know you can give text nodes a ref_table and ref_value
Thatâs what this used
Might be a way to update the table when you press a button
oh yeah you can like rotate it and stuff
update the table
thats smart
i was trying to update the ref value
but table is a better idea
Yeah you can have your buttons just change the value in the table to be page x / y
Should update your text too
Think generally uses DynaText but I think he uses a ref_table once iirc
cool
ill update when ive tried it
no luck :(
i might be able to get the ui element by id then :update_text
im hoping
Can I see the code?
sure
args = e.config.ref_table or {}
args._type = args._type or 'Joker'
args.col = args.col or 5
args.row = args.row or 2
args.dir = args.dir or 1
local cards_per_page = args.col*args.row
local current_center = 0
for j = 1, args.row do
for i = #S.card_display[j].cards, 1, -1 do
local c = S.card_display[j]:remove_card(S.card_display[j].cards[i])
c:remove()
c = nil
end
end
S.current_page = S.current_page + args.dir
if S.current_page >= math.ceil(#G.P_CENTER_POOLS[args._type]/cards_per_page) then
S.current_page = 0
elseif S.current_page < 0 then
S.current_page = math.ceil(#G.P_CENTER_POOLS[args._type]/cards_per_page)
end
S.current_page_text = {(S.current_page+1)..' / '..tostring(math.ceil((#G.P_CENTER_POOLS[args._type]/(args.row*args.col))))}
for i = 1, args.col do
for j = 1, args.row do
current_center = current_center + 1
local center = G.P_CENTER_POOLS[args._type][current_center + (S.current_page*(cards_per_page))]
if not center then break end
local card = Card(S.card_display[j].T.x + S.card_display[j].T.w/args.row, S.card_display[j].T.y, G.CARD_W, G.CARD_H, G.P_CARDS.empty, center)
if args._type == 'Joker' then
card.sticker = get_joker_win_sticker(center)
end
S.card_display[j]:emplace(card)
end
end
end```
Try ref_table = S, ref_value = current_page_text
Oh you wrapped it as a table yeah
Try unwrapping
uh
think i did smth wrong lol
oops yeah i only unwrapped it in one place
now i got no clue
Huh
node.config.text = tostring(node.config.ref_table[node.config.ref_value])
if node.config.func and not recalculate then G.FUNCS[node.config.func](node) end
end
if not node.config.text then node.config.text = '[UI ERROR]' end```
This is the relevant code for the node
I do remember a few lines of code the game uses for object collection UIBox iirc
Damn Iâm late
đ
eremel please may i have your hand in marriage
Sorry itâs already taken
the wide button?
What back button problem?
i dont really mind how it looks at minw 5 so dont worry too much
Like, I look at the code and thereâs nothing that suggests it does that
And if I rip it out into a different root node it doesnât stretch
Yeah they look good
Are these all embossed?
yeah im gonna redo that now
I do like the emboss look
Itâs easy to tell what it does here if you look at your option selector
The part that irritates me is the the height of the Apply and Back buttons arenât the same.
no jankiness
One is a smidgen larger than the other
is it?
Itâs just that 3D effect it adds
You can probably still emboss with the outline right?
oh i accidentally had the padding at 0.06 for one of them
the others 0.05
good catch
damn
yeah how did you spot that lol
the button still moves
so maybe
ill try it
i looked at my code lol
I meant flowwey lol
eh, we're basically the same person
i looked at my screen so briefly that the pfps all blurred into one
Ohh, I think itâs the border making it look off, not the button itself.
Especially at the corners
See here
uh
not really
oh the image goes bigger
yeah i do
button with outline and emboss
maybe not
next on the to do list is to ruminate
then i have to turn each joker card into a button
thats gonna be fun
Should be able to find something to help in the source code, cards sort of function as buttons a lot of the time
yeah i think ill be able to do with a bit of time
I mean what more is a button than something that does something when you click it
Jokers do that all the time!
How does that work with the movement on click?
You could maybe have it as three layers, a white one at the back which is the button, then the green, then the text
I think the button would still function
the green wouldnt darken tho
Set hover=true on the green layer
ohh
Look at all this ui knowledge I now have
đ§ââïž
Iâve spent a while just reading through the ui code recently
So that other people donât have to
The hover on the green might break the button though
I am unsure
it just doesnt darken
ill try setting a nil button
that didnt do anything either
Huh
is it possible to add buttons inside an info_queue?
I got this voucher that lets you choose the Joker you want to copy, but Idk how to implement it
i don't think having a button inside info_queue would work anyway, since once you stop hovering on the card it's gone
maybe clicking the right and left button while hovering is better?
I don't know if I can add this feature
Maybe add buttons like Sell
what's with the profile pic?
got it
added more swag
i tried looking at that and I'm having a lot of trouble
Maybe look at a mod that adds buttons
Add Isaac dancing
how would one go about adding a new object type like editions, enhancements, and seals?
I only found Fusion Jokers and it is in 0.9.8
what about joker evolution?
Maybe @maiden phoenix can help?
Also try looking at Consumeables
They have an Use button
Betmma added a new type that can be activated
lol I didnât expect you to actually do it
i just need to steal jimball or aura code for the animation
I donât think you need to
You can create an animated sprite
The Blind Collection UI showcases how to display animated sprites inside UI elements
animatedsprites only work for one row, no?
i need to set it up for a whole spritesheet
Idk
Can you set it up as a long row?
absolutely fucking not
set it up as a tall row then rotate the file before exporting