#💻・modding-dev
1 messages · Page 46 of 1
ok I just need your code
thank you so much for being so understanding 😭 i've had such a hassle trying to figure this out
all of it?
well I'd like to be able to test it
can you put it on github someplace?
sure thing
👍
sorry, one more question, am i missing some code that makes the joker shake when activated? i just noticed mine isnt doing it 😭
You need to call juice_up
would that go in the calculate function or just the joker table?
not needed here, referencing vanilla code can help (replace self by card)
wait that's not the best example
add card = card, to your return table
thats what that does?
Curious does the debug 2 keybind work to discover these?
just realised i got no idea if you are talking to me, but if you are added, nothing changed that i can see
oh wait, whoops
it works now, ty
I believe so, yeah
for reference if anyone ever has related issues, this happened because create_text_input returns a column
Is DUMP_LOCALIZATION supposed to give me all modded content or just the mod I put the header in?
I'm trying to cross-compile lovely-injector, it seems to work but then I get wine: Call from 00006FFFFFFA2DC8 to unimplemented function version.dll.GetFileVersionInfoSizeW, aborting and the game crashes
cool cool
Close enough for a website?
yeah
not bad
all right, so where's the code that counts the number of a rank or suit in a deck?
you can search where text Stones: is used
first find localization key for that text
How would I check if a card is locked? card.ability.unlocked == false?
you probably don't have a Card if it's a locked one
unless it's in the collection or something
if you do have a Card, it'd be not card.config.center.unlocked, but more likely you'd just have a center to put in the place of card.config.center
card.config.center.unlocked seems to have hit it. I'm using an update function to switch between sprites, and was having some issues where it was defaulting to {0,y} on the joker sheet when unlocked.
If you're curious, the code is this, and without the unlock check, it was defaulting to Troubadour, or {x=0,y=2} on the joker atlas. Probably overwriting the default undiscovered/locked sprite of {x = 8/9, y = 9}. This seems to have solved it.
update = function(self, card, card_table, other_card)
local suitpos = {y=2}
if card.config.center.unlocked == false then
suitpos = {x = 8, y = 9}
elseif card.ability.extra.cur_suit == "Spades" then
suitpos.x = 0
elseif card.ability.extra.cur_suit == "Hearts" then
suitpos.x = 1
elseif card.ability.extra.cur_suit == "Clubs" then
suitpos.x = 2
elseif card.ability.extra.cur_suit == "Diamonds" then
suitpos.x = 3
end
card.children.center:set_sprite_pos(suitpos)
end,
two new balloons 👀
DebugPlus jumpscare
bloons tower defense
yes
I need to do some testing, but I plan on also injecting some variables into the scope
That's a new one
all right
Do they count as seals, or can they be put ontop of cards with seals?
They are seals
that's cool
how do you install lovely?? I have been trying to get it to work so i can play the new cryptid mod but somehow it wont work can someone pelaqse help?
This is really cool. I want to make a Joker that synergizes with them, because I had seen a painting of a red balloon dog and the idea of making a Joker inspired by it stuck with me.
I have some suggestions about VFX and mechanics but I imagine you’d have already thought of them
What’s this song
hopes and dreams
i thought it was save the world
one of those two
actually wait it is hopes and dreams
Where from
The name makes me think of Undertale
But the composition makes me think of anime really
it is undertale
Just found a silly interaction with Steamodded (or lovely?) reload feature
By the way, I’ve had this idea of Jokers in the shop or packs coming with a free card, but I’m not sure what would be a good way to implement it, both in terms of coding and UI
reload is broken af
hopefully we can get love.event.quit('restart') working with lovely again, that would be much cleaner
I think displaying the card would be best, but I’m not sure how to do so effectively
It does remind me of my idea of making HyperCards, which is an extension of a Card type that’s a Card + (0 or 1 HyperCard)
Coke if it added the coke back in
Coke comeback
Right, I turned the balatro background into a Svelte component with props:
Default values are the Balatro main bg colors
this reminds me of like the free bubblegum you’d get if you opened a vintage card pack
like what fo76 does
wait till you seen this
god that image
I'm not sure why but this lovely patch doesn't work at all, does it have something to do with the function or it's a really dumb mistake I can't see? Even doing a function overwrite doesn't work
Nope it doesn't
try putting debug at the start of the function
Like just "debug" ? Above amount = amount or 1?
you probably want it outside of that if anyway
send debug msg
Oh so that's the dumb mistake...
I don't think that's the problem, but any level_up_hand that is instant won't hit your code
The debug message doesn't show up when it's below the function
maybe it could be a consumable that gives you a temporary buff idk
what other mods do you run?
DebugPlus, SDM_0's Stuff, FasterPlanet and MoreSpeeds
fasterplanet probably overrides the function
The delay is set to 0
All of that for this
Why even put a delay in the first place?
I would have thought that faster planets would just patch all the calls to be instant speed instead
I've been starting to encounter periodic stuttering, so I tried using lovely patching to increase the amount of budget that the GC gets
This unfortunately only worsened the problem
you could always hook for your calculate call and throw it at the start or end
My mod have higher priority than this one so it gets overrided
No it won't
?
Well I tried with hooks and it doesn't work
Is there a forum post for Faster Planet? Discord search bar is dumb
this is why overriding functions bad
so true jestie
Nvm it's a nexus mod yuk
🗿
I'm trying to tune the nuGC method (in functions/misc_functions.lua) to try to reduce stuttering
Please check out my new channel! https://www.youtube.com/c/EluTranBugFables Make sure to check out the official soundtrack at: https://materia.to/undertaleID Determination!
(Doesn't have the cleanest transition between Hopes And Dreams to Save The World. Sorry about that! ^_^;) .
.
.
Feel free to send me a ko-fi if you enjoy my content, I app...
Making Jokers talk
How's the timing? Keep in mind it's affected by the speed setting. This is at 1x speed
I think somewhere between 16 to 20 seconds is right. I made it a bit longer to see it since I have to load it from the Collection screen, but if you generate this with Soul it might take a moment until you start reading
urple alloon
It was up for 9 seconds past when I finished reading it
I think maybe just have it ignorebthr speed setting and then get a good balence
working on gum
its that shade of pink because i dont have a color for it yet
im working on the wrapper
Is that related to your previous message to me?
The Purple Balloon seems strong, but it depends how you get them
yeah, the idea was just persisting in my head so i just started drawing stuff once i got home from work
I'm debating with the idea of whether you should get the effect of the balloon before it floats away or not
Make the ballons just broken and add them to cryptid 
Let's just add everything to Cryptid
No
Lobotomy Corp? More like Cryptic Corp
Victin's Collection? More like MathIsFun's Collection
I should make a modpack that has everything in it and call it cryptid
I just need to add mechanics that make Cryptid less fun 
1 in 5 chance that when starting a new run, freeze the game for 5 hours. If user closes early, corrupt settings to crahs the game and uninstall the mod
Just add more M jokers
(I literally have them off because they plague the shop)
Problem, the users of cryptid are deranged
Actually someone should make a mod that just removes all the standard jokers, tarots, planets, etc.
What are M Jokers?
M
they're currently in the shop at $6 for two purple balloons
I LOVE BALATRO
Only plays the "Jokerless" challenge without buying anything
It should also remove ranks and suits
should only give you one card. hand size is one card
Honestly I'm xuroirs what would happen if I patched SMODS to not init any built in stuff
Sneak peek
Homestuck moment
If it doesn't work doing a local function x() then it probably works using local x x = function()
I love functions that make functions
you can also have the local function outside of the global function and still call it inside (upvalues are fun)
Yeah that's how varibels work
That's why I have like 20 locla variables at the top of DebugPlus code
Some plans: consumables, blinds, decks etc, build a texture atlas, resizing
While I'd also love to add a fully working editor with autocomplete/intellisense, I think it's too much work initially
local x = x
Both should work but I originally had local tmp = function() which doesn't
@zealous glen
Beautiful ;_;
Now it only needs to bundle them together after being caught, but you may or may not want to do that
How do I access a localization dictionary?
I want to know how many entries there are in one of the arrays during runtime
I wanted them to be seperate if they're caught
they also have no sell price when caught
Actually I think I can do it with localize
finished gum . gootbye
gummy
chewy!
what do the different
G.UIT.R
G.UIT.T
G.UIT.C
``` mean
i assume its what kind they are
isnt it like
like column and row
ah
true
Huh, I didn’t realise that table had a padding item
ah cool
thank you
whereabouts is this in the code?
i checked ui and ui defs and couldnt find it
looks like globals.lua
I just ctrl + shift + f to search in all files
I just realized jellymod is MIT licensed.
Someone could update and release it
Or maybe even PR it back
i didnt not know you can do that
wait
i didnt know
i meant to say
it's very useful
misprint but for chips 👀
Now make a preview
You mean that?
Oh my discord Is being broken
oof
Since I did the sensible thing and turned everything into components, I can reuse a lot of stuff so it saves a bunch of time
Actuslly I saw something cool the other day which you could maybe use for that
Oh? What's that?
you should also add a toggle for the code display to display localization text instead
as in, only this
the screenshot shows the whole code to add a joker
i'm suggesting a version formatted for localization files
Ohh, you want to copy only the loc_txt part?
en-us.lua etc
That's a good idea
Could implement part of the steamodded api and then you could run existing lua code to parse jokers.
I'd probably just parse using regex
Fair enoifh
Since running a whole VM just to get some values is a bit overkill
it's not C:xmult btw
I'll finish adding the joker editor and then upload to GitHub, then I'll set up some goals for future features
{X:red,C:white} X#1# {}
Ah damn it
I could swear C:xmult works as well though?
no idea
noppers
Ah okay, my regex needs expanding then
if it worked then it would've been the exact same as {C:mult}
oh, this looks cool
absolutely does
One more letter is V, which takes the variable colours if stored in loc_vars. Edge case, but it's used in things like Castle and Ancient which change the colors when the suit changes as well. Haven't done much testing, but I've only had success with {V:1}, and no other numbers.
I see\
{
n = G.UIT.R,
config = {
align = "cm",
padding = 0.1,
r = 0.1,
colour = G.C.CLEAR,
},
nodes = {
{
n = G.UIT.T,
config = {
align = "cm",
padding = 0.1,
r = 0.1,
scale = text_scale*1,
ref_table = {'text'},
ref_value = 1,
colour = G.C.WHITE,
},
},
create_text_input({
prompt_text = "A",
extended_corpus = true,
max_length = 1,
text_scale = 0.4,
w = 1,
h = 1,
ref_table = {'A'},
ref_value = 1,
}),
}
},
does anyone know why the text box wont appear?
apparently you cant have 2 in a row?
idk
but its fixed now
How does text sizing work? How many px is one unit?
In the meantime, have CSS text size:
Pretty sure {s:} is multiplicative, so {s:1.5} would be 1.5 * base size, and {s:0.8} would be 0.8 * base size.
cool
Works for me
Next step: What formatting options are there? I have these from the game files:
const formatMap: Record<string, string> = {
MULT: '#fe5f55',
CHIPS: '#009dff',
MONEY: '#f3b958',
XMULT: '#fe5f55',
FILTER: '#ff9a00',
BLUE: '#009dff',
GREEN: '#4BC292',
PURPLE: '#8867a5',
RED: '#fe5f55',
ORANGE: '#fda200',
GOLD: '#eac058',
YELLOW: '#ffff00',
CLEAR: '#00000000',
WHITE: '#ffffff',
BLACK: '#374244',
L_BLACK: '#4f6367',
GREY: '#5f7377',
CHANCE: '#4BC292',
JOKER_GREY: '#bfc7d5',
VOUCHER: '#cb724c',
BOOSTER: '#646eb7',
EDITION: '#ffffff',
DARK_EDITION: '#000000',
ETERNAL: '#c75985',
PERISHABLE: '#4f5da1',
RENTAL: '#b18f43',
ATTENTION: '#ff9a00',
}
but it doesn't include "attention" or "inactive", I have to look for inactive myself (I think attention was orange)
There's a custom function that loads the colors from that into text formatting stuff, give me a second to find which file it's in.
Thank you
loc_colour
Yeah, in misc_functions.lua.
However
The game can accept a hex code directly
I'm not sure if loc_colour recognizes that
But I think that's a good option to have
Also keep in mind some colors are updated in real time; that's what makes DARK_EDITION change in Spectrals
I see
idk where inactive is tho
Also the game uses these same colors elsewhere, but sometimes it darkens, lightens, or mixes them
It's somewhere else in the color dictionary
can i block certain characters from a text input?
it seems i can enable extended smth or not
which is spaces and punction i think
nvm i can write a quick function to do it
Jagganoth, now with semi random dialogue
Featuring Stheno
(also a bug with the Hook)
I should say the replay code I adapted from High Card mod
any way i can call a function when a back button is pressed?
G.FUNCS.overlay_menu({
definition = create_UIBox_generic_options({
back_func = "options",
contents = {tabs},
back_colour = G.C.SECONDARY_SET.Spectral,
})
})
can i just chuck smth in here?
Jagganoth
After you play a hand, play it again
If you can’t, DESTROY IT
Can’t you make it a button that does something else, then also goes back?
You should also be able to hook the function it already calls
is anyone currently developing a joker maker tool? like it spits code based on certain conditions?
i think it would be really cool to have , not all people can code but everyone loves custom jokers
Not that I know of
oh yeah i forgot about hooks
think im gonna make my own save settings function then hook that to the options button
sounds like a good idea
There's only this #💻・modding-dev message
tho I don't think it will generate code for calculate function
ty
Solomon joins in the fun, but I'm not adding quips to him ATM
bro got the unique tooltip
Solomon David
Carry over unused Hands and lose all Discards
That's not the tooltip
It's just his title
im referring to the black-on-white box
Also not a tooltip ;P
here's the definition for SMODS mod menu, for reference
you just do whatever and call exit_overlay_menu after, then set that as the back func
ah i see
cool
local options_ref = G.FUNC.options
G.FUNCS.options = function(e)
Blueprint.FUNCS.saveSettings()
options_ref(e)
end
ive got this in my code
is this good enough
or is it better the other way?
i guess this way its called whenever i enter options
so less ideal
i only want it when youre leaving options
or leaving the other settings
patching all of exit_overlay_menu directly seems like a bad idea
for just options, you can put a back_func on the corresponding UIBox
sorry i meant the settings for my mod
not any settings tab
or others
so ill just chuck a new back_func on the back button for my mod settings then
just replace the settings back_func with some other function that calls G.FUNCS.settings when done
is it not supposed to go back to the settings menu?
nah the option menu
ive got a button on the options menu for the mod settings
its not a tab in the game settings
also if the screenshot you took was from my code having settings there was a mistake
i meant to have options but confused them
oh wait
does exit_overlay_menu just get rid of it
ah i see
mb
yeah
idk why i thought it did smth different
yeah ill just call options from inside that then
thank you
all good
this is super useful cos now i can but a back func on the keybinds menu to check theyre valid before exiting that menu
btw, speaking of settings, is there a mod settings api planned
kinda annoying that every mod just puts their settings wherever
it is for sure planned
actually there's this
seems like it's complete? ig I should get to reviewing it for API design
It’s ready for review right now.
ive been coding for the past hour straight
went to test it
all of it
and somehow it only had 3 errors
back to this problem
i cant put 2 text inputs in one place it seems
huh
no clue why
apparently you can do G.UIT.I for a text input too
but i tried searching the source code
and its never used
so idek what args i need
or if it would work
Notice anything different?
lots of hands remaining damn
nope that's normal
Everything here is "normal", but it's something I don't think people would have seen in vanilla
oh that if the money goes above a certain num it shows the num
Yes!
i knew 😎
isn't that vanilla?
yea
That's what I said
also the final boss was Crimson Heart and the Joker that was debuffed last was the one that gave me the extra hands, so I lost all of them
rip
i could have an option cycle for the keybind and then a single text box 💀
One thing I noticed, the mod config path header seems redundant. Can't we just require the config file be named config.lua and be in the same directory as the main file?
why would you have to specify your own directory name? users could change it arbitrarily
Solomon is quite strong, even with the downside
Specifying the path is required as the SMODS.Mods isn’t assembled yet, and SMODS.current_mod is nil so there is no way of knowing:
1: what mod is currently being checked for a config file, and
2: where that mod file’s directory is.
that's a timing issue
forcing mods to have a specific directory isn't a solution to that
and that's all it's doing
something isn't right with alerts
!
seems like its working perfectly fine 🙂 👍
bahaha
also seems like it's wrongly alerting if the main collection would have alerts
Cryptid!
I thought I fixed that through turning alerts off
😭
I REALLY didn’t want to have to also rewrite or make a whole new version of alerts to show properly with additions.
Mostly because other mods might have custom objects that use it as well for their objects alerts.
I guess I’ll get to that and SURELY this can make it turn off properly
turning them off is good enough for me
https://github.com/GauntletGames-2086/Steamodded/pull/2 gonna put my review changes on here
Nice
I’ll see what I can do with the discover bugs
They should not exist now in the Additions tab (hopefully).
looks good 👍
okay i wanna
make a mod that adds a joker
where do I start
probably reading through the steamodded wiki
it has a bunch of useful stuff about making a lot of different things
jokers
consumables
consumable types
use the numbered pages for 1.0
where do i find that
i can send a link to it 1 sec
are you using steamodded?
cool
then pages 1-8 should be useful
also looking through the game code yourself can be good to understand how different things work
you can make a copy of the balatro.exe and unzip it to do that
i've done that before but i could not make sense of a lot of things
is there a recommended program to edit lua in
most of the source code still makes no sense to me lol
takes a lot of trial and error for my stuff to work
i think theres some on the steamodded github page
if not then in the modding thread thing under this channel theres a bunch of mods you can try out
https://github.com/nekojoe/VanillaExpansion heres one you can look through lol
cant promise it works still
but it might be helpful
its very basic
its beautiful
there appears to be an issue when trying to use text boxes, at least i have it, i cant have 2 displayed at the same, also if i have 2 on seperate tabs, if one is set to all caps only, the only one gets set to all caps as well
is there a way i can actually seperate them?
Wanting to mess around with this, was looking around for what kind of config format it wanted - if it wants it to return a table or just be a list of variables or whatever - I noticed that loader.lua registers it as mod.config, and the UI in core.lua tries to call mod.settings - Might be completely mistaken, since, I still haven't had luck after changing it myself, but, mentioning it just in case it was missed.
maybe these need better names
mod.settings is meant to be the UI definition function for the mod settings tab
maybe settings_tab and credits_tab for the UI functions?
Maybe. I see where I was mistaken, still haven't found where the new mod config area actually is yet though, so let me look a little more.
That would be better yea
Also: loc text for the tab is “Config” yet the name of UI module is “settings”
Probably should’ve fixed that to be more consistent.
that's my fault (:
gotcha, config_tab then?
Yup
Although, that implies you’re returning the tab, when the only thing the function does is return the UIBox for the tab.
config_tab_function?
no other mod functions have function in their name
the function for additional tabs is extra_mod_ui_tabs rn, also not very pretty
any better suggestions?
the_other_tabs_in_the_ui_that_contains_settings_of_your_mod
just extra_tabs maybe?
That should work.
how many tabs is the limit?
I do remember hearing about it crashing if it meets a limit iirc.
Yeah I feel like it was either 6 or 7
9 then?
I'm sure someone had the settings menu crashing
works but it's going off the screen
it might be specific to the settings menu? idk
thinking about that first tab, would it be better to be called Info and have the mod name above the authors?
I like the fact it's always visible within that menu
though it's not great with long names, admittedly
btw I did also add config saving, I hope this doesn't mess with existing config systems too much
it just triggers when you exit the mods menu
Might’ve been 10 that crashed?
10 also works
well, it works in that it doesn't crash
but you can't operate it because it goes off the screen
Yeah because I remember I had issues with the main settings menu and the modpack until I put everything in one tab
maybe it's related to something not shared by the mods menu
heya guys, what's the best way to add objects to the current run savefile?
oh no, my balloons are popping!
or an existing mod's code that that I can take a look at
Store them in G.GAME is what I do
Wait, G.GAME persists across restarts too?
Well that's a totally intended positive side effect that I totally knew about
@frosty dock what does the primary colour of a consumable type affect? I can't figure out how it's used
It’s saved in the savefile
You would need to inject into like settings.jkr somehow to persist across restarts across an entire profile or game
alright I'll take a look thanks
I think it's mostly just when referred to by cards, like Séance or 8 Ball should give Spectral or Tarot a special color, but there may be more uses I'm unaware of.
hmmmmmmm
im very tempted to be the change i want to see in the world and write a steamodded wrapper to heavily aid the autismo mind of mine and potentially many others
might become redundant though
i just really like easier scoring's idea
Ah yeah, that worked! Had to do it after Game:start_run though, since that seems to reset the entire G.GAME table.
Idk. Is that color used for the text color or is it the secondary color too?
Hey all! new to modding but have been a web dev for years. I want to start collecting detailed data from my runs. Every hand played, every discard, etc... What would be the best approach to read that data from balatro when it executes?
probably record it in a video
hook all the functions that play and discard and stuff
I like that idea of having a hook on those functions. Is there a lua version of aspect programming or joinpoints of that kind?
Saving myself time here. If I used https://github.com/balamod/balamodmod to try and replace function calls with function calls that capture the arguments ans save them to a local .json that would be a solid approach. Don't want to start down the wrong alley if someone sees something obviously wrong.
Steamodded is the de facto standard for mods right now, I wouldn't use Balamod
you can basically redefine a function to call its old version and then do something you want
with hooking functions, there's no standard; the way it's done is just to redefine it in terms of its old value
you can try saving to json if you'd like; serialization to a lua file which can be loaded directly may be easier
it all depends on what you want to do with it, of course
Thanks for the help guys! Thanks I like the json. I am a front end developer mostly and the game is just itching to have charts and interactive tables of balatro runs
ah, if those are charts/tables outside the game, json yeah
Do you have a good example repo for this kind of mod? Particularly the hooks in lua. Otherwise I am just going to run through https://github.com/jie65535/awesome-balatro?tab=readme-ov-file#mod-loaders till I find something similarish.
just going through that is a good idea, yeah
you can take a look at "The World Ends With Jimbo"
yeah that's just the first mod I have open in my editor
what's the desided path to put config in?
oh I just looked at the code
it's in <mod dir>/config.lua
honestly, as a lovely first mod, this is kinda annoying
as I can't get my mod dir as a lovely mod
but also I suspect that some other issues may pop up
like mod devs distributing their mod with a config, overwritng the user's config every time they update
it might be a good idea to make a config folder in the main save directory and put mod config's there
Is the "string.buffer" module available or not?
By the way, I got the impression this was too strong from testing it, even if it’s a legendary Joker
Originally I wanted to make it have a different condition or drawback, but I couldn’t find one I liked
What do you think?
i think it would be balanced if you could code it to where the joker stole the bonus hands at the end of the round, so then you don't get the interest on them
this would make it especially terrible for green joker
looking into how to mod the game, in part to get better at lua and in part because i really like challenges and designing them could be fun, i think :>
I recommend just contributing to Steamodded instead
ugh yeah I've thought about this, there needs to be a cleaner way for default config to be distributed
steamodded handles saving/loading the file and also gives you access to your mod dir, so this isn't the worst issue in the world. Though I am concerned for config files being overwritten, especially for the folks that don't use git
Could the file be created by Steamodded with default info provided by the mod dev if it doesn't exist in the mod directory?
rn it's created by steamodded when config is saved and it's non-empty
I think having a separate config directory is a good idea, optionally a config file local to the mod dir could be loaded as a default
I had heard the suggestion to make the Hands not grant money, but I don’t know if I like it
is https://github.com/Steamopollys/Steamodded/wiki/Create-a-Deck still relevant? it's supposedly for 0.98 and i'm on the 1.00 beta thingy, i'm wondering if it's like a drastic enough rewrite to just not even bother with the page or not. sorry if i say something... kinda dumb, i'm new to this!
don't bother with the unnumbered pages
fair, just figured i'd give you an idea while i recode X Card logic for the umpteenth time
It makes the effect worse, but the more hands you have the easier it is to keep going. I think a good way to nerf it would be to make it more difficult to scale, or to keep the difficulty of saving hands constant
well, it completely screws over green joker and makes other decks solely reliant on interest for money
pairs well with economy jokers, obviously
so yeah, it's the kind of thing where you go "okay my build is locked in, i'm taking this to squirrel up hands for double digit antes"
My original idea was to require specific Poker Hands or ranks to be played. Maybe a suit. But that only becomes easier with more Hands
personally, i did something like that with, uh... lemme grab it
Recently I thought it could make you fight an extra boss before the boss
Since that costs extra hands
And that matches the Showdown Boss that’s related to this Joker
Hey modders, I am so back
Feel free to ping me to pin stuff in your modding threads
or if you want me to look at something
if you do so while telling an extremely unfunny joke and/or break the rules you are entitled to win a sticker*
~ 
-# *: Perishable is a sticker that causes you to gain that trait. Perishable Discord accounts will be sold after 5 seconds.
Welcome back egg
these values are actually never used
They're in loc_colour though
yeah, but not these exact values
Huh
they always get overwritten by the values from either SO_1 or SO_2 depending on the high contrast setting
low-contrast hearts and diamonds colors are still almost the same though
Ah
I see
So I have these so far:
const formatMap: Record<string, string> = {
RED: '#fe5f55',
MULT: '#fe5f55',
BLUE: '#009dff',
CHIPS: '#009dff',
GREEN: '#4BC292',
MONEY: '#f3b958',
GOLD: '#eac058',
ATTENTION: '#ff9a00',
PURPLE: '#8867a5',
WHITE: '#ffffff',
INACTIVE: '#88888899',
SPADES: '#403995',
HEARTS: '#f03464',
CLUBS: '#235955',
DIAMONDS: '#f06b3f',
TAROT: '#a782d1',
PLANET: '#13afce',
SPECTRAL: '#4584fa',
EDITION: '#ffffff',
DARK_EDITION: '#000000',
LEGENDARY: '#b26cbb',
ENHANCED: '#8389DDFF',
}
I'll add a colourblind setting at some later point
EDITION and DARK_EDITION are actually gradients
Wait how does that work? They're listed as {1,1,1,1} and {0,0,0,1} respectively
I did point that out to you earlier :P
Sorry, I've slept since then
anything strange here?
does this loc_txt look right?
that is somehow valid syntax, but no
the text lines need to be inside a table
wrap these 4 lines in {} and you should be good
:< okie thank youuu
sorry if you see a lot of me, i joke famously that i'm a "0.10x developer" but i try too hard for my own good LOL
0.1x is still better than 0x
so this?
i'm looking at the example LabyrinthDeck mod for it
I think what you actually want is this
text = {
"{C:red}Common Jokers{} are debuffed",
"Start game with",
"{C:gold,T:v_liquidation}Liquidation{} and",
"{C:green,T:v_money_tree}Money Tree{} Vouchers",
}
oh I see, you aren't aware how these work
ah
#n# for any integer n refers to a variable passed from loc_vars in nth position
+#1# gets self.config.discards, which is 5, to replace the #1#
does T show a preview of the voucher when hovered over, i imagine?
if you look at the localization for other decks, you'll see this is the formatting they use to make it possible to show a tooltip when hovered over
np
yeah there's a way to fix it, it's adding pages
eh, pages are probably not needed until we have like 500 of them anyway
I took care of it in the laziest way possible, is all
tbf it already looks pretty bad with 70 blinds
sort of
This is still a lot better than what I have at home
improved config loader is up, it now grabs defaults from <mod dir>/config.lua and uses Mods/config/<mod id>.lua as the main config file
additions tab colors are also fixed
So self.TIMERS.REAL is the amount of time since the game started or?
Since it's updated with delta time each frame
i'm like 70% sure the "G.jokers.cards:set_debuff" thing is how i'd need to debuff a given joker, but how would i do that whenever you're playing a specific deck? (from blind.lua, about line 595)
in this case, this one
that i'm working on-
The game has a function that’s called to apply deck effects. You could inject it (or create a hook) at some specific moment with a custom context
Although I don’t know how appropriately the effect works as a deck effect
hm
As in, most Jokers you see in the shop will be completely useless, so you’re just rerolling until you hit anything
i'm trying to design a deck which is based off snowballing with money
i wasn't entirely sure what other thematic debuff it could've had
any suggestions are welcome :>
Something that spends or makes it harder to generate money is what immediately comes to mind, but that might be too linear
the entire thought is around the idea that you'd be hoarding all the wealth, a la billionaires
You’re not really hoarding just rerolling a bunch
yeah fair enough
And the lack of choice seems a bit uninteresting
Maybe if the Jokers came with the sticker that debuffs them after 5 rounds
that's a good idea
thank you :>
I think it could be every Joker
that's the current plan
could you please add a simple example mod that is using it? (if you have time) Like how config needs to look, how to access config
also is there a way to specify type of setting (toggle/input/slider)?
Preview variables are also in now
right so, if you want to make a booster pack, is there just an SMODS.BoosterPack(whatever) for that
or .Pack or w/e
yeah it's SMODS.Booster
guys what you think about this? #1264020405400633354 message
If Bala, then only Tro! 🔥
Multiple choice window when
does someone know which variable in function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end) is the card?
^
Unfortunately I can't find it in the docs, unless I'm blind
not everything is in the docs
The thing is, I don't need SMODS, so I will have to support config myself, but I also want to be able to use the config. However, I want to support the SMODS api as well, as it would provide a more consistant experience
although in that case, I probably will want an api to write and read the config myself
how do you check if a card is a playing card?
so how are you meant to know how to use the function, steal code from a different mod that's already done it??
card.playing_card
(this doesn't work on the ace on the title screen, but will probably not affect you)
now <mod dir>/config.lua is supported to be read from as a default, but the main config file that steamodded writes to is at Mods/config/<mod id>.lua
Not sure 🤷
Here's the implementation of it https://github.com/Steamopollys/Steamodded/blob/34d5dc724f2fe97ab95eb25b0f79aaf9cb4febaa/core/game_object.lua#L1152
You can search for different mods that have already used it using https://github.com/search?q=SMODS.Booster&type=code (don't look at the ones using :new)
Fair enough. Can I bypass SMODS logic and provide methods to read and write data myself?
Oh I don't need this but I was thinking, per profile mod config
that's not currently supported
yeah maybe, though I think as with #92 it's more flexible to just use different mod folders for mod setups
I mean that won't work with lovely mods but also I sometimes test with different profiles and keep mods
And some mods you just want on all profiles
tbf it doesn't really work with steamodded mods either
lua_reload is broken and the next best thing we have is a hard reload
I mean we just need to bribe meth to fix lovelt on the reload thing and then we can reload
yeah but that's still technically restarting the game
Yes but it isn't that bad and fairly east
well I sure don't have a better solution that actually works
I just think that it doesn't compare well enough to restarting with a different mod dir that it's worth caring about concerning different setups rn
fair enough
oh also I'm not sure, but if we save config in .jkr file steam might cloud save it
ok I found the thing
looks like any .jkr file at in the top level or one folder deep will be saved
well rn it's saved 2 folders deep
just slap it in Config/<modId>.jkr
I'm not sure how I feel about going outside the mods dir
I did look at like the 2 games I mod and they put stuff in not the mod's folder
well the save dir always exists so it's fine ig
I would perfer that only mods go in mods and not mods go in not mods
well mod config is clearly mods
yeah but config is clealy config
to be fair 90% of users aren't goujng to touch it
alright I'll make that change just to support cloud save
You could pull a celeste and just fill the saves folder
oh also minecraft mods stick mod config in the config folder
never thought I'd be using SMODS colon lmao
maybe a current_mod:save_mod_config would make more sense?
it's meant to be used like SMODS.save_mod_config(mod)
it's just that for steamodded config, the mod object is SMODS
ig i can allow per-mod bypass functions though
added this alongside moving mod config to config/<id>.jkr
Okay, I isolated my investigation to just one lovely patch file of my own writing, for some reason require("string.buffer") does not work at all
f...rick
you need to register an atlas with SMODS.Atlas, you can't just put a file name
?
yeah
you can remove prefix_config though, you only need that for overriding vanilla sprites
shouldnt you start with both reroll vouchers to be a true capitalist?
or would that be too strong?
Frustratingly, by all rights require("string.buffer") should be Right There (balatro runs on Love2d 11.5, and uses luajit, so it should be available)
I've tried to find a luajit compile option that would disable string.buffer, without success, so I'm stumped
There's an example of the new config stuff in this commit if people are interested, https://github.com/nh6574/JokerDisplay/pull/38/commits/64c92213bca021bf3dceeb127dbd18271b40057b
Might have a chance to do some docs for it tomorrow, but outside of the basic structure which is fairly simple, it's just UI wizardry that people will just need to learn (:
What's this?
Basically a tool to make creating jokers etc easier
Nice
I assume right now it's for text and stuff before actual effects?
Yeah
Nice
yo guys does balatro have a memory leak in the new run/continue run menu?
I notice the fps noticeable decreasing just by opening/closing the menu multiple times
Memory leaks are characterized by unbounded amount of memory use
okay so i got a booster mostly working, but it just calls the booster pack ERROR during the pack itself - where do I actually set that
You’re missing the “group_key” arg.
Which is the key to the localized booster pack group text.
It would look something like this if you use a localization file.
the fps counter is half of what is was earlier, and I can literally make the MBs in task manager go up just by clicking the play button multiple times
Can also be set with SMODS.process_loc_text under G.localization.misc.dictionary.
The question is if it goes down when you wait
If it does, then that's just GC catching up to the allocations
...
pretty sure GC aint supposed to take more than a couple seconds
but sure, I'll check
this does not appear to work
i have group_key = 'mjp_booster_common', and
["misc"] = {
["dictionary"] = {
["mjp_booster_common"] = "Common Jonmkler Pack",
},
},
but it still shows up as ERROR
bleh whatever the packs are functional at least
that enough proof? also it runs at like 2 fps instead of the normal 500
(unmodded balatro, opening and closing the play menu a couple hundred times, waited about 10 min, it uses about 2.5x the memory it normally does)
I see
2024-07-21 13:17:07 :: #G.STAGE_OBJECTS, #G.MOVEABLES = 2317, 78245
2024-07-21 13:17:08 :: #G.STAGE_OBJECTS, #G.MOVEABLES = 3310, 113137
...
2024-07-21 13:17:22 :: #G.STAGE_OBJECTS, #G.MOVEABLES = 18655, 637339
2024-07-21 13:17:23 :: #G.STAGE_OBJECTS, #G.MOVEABLES = 19678, 672292
hmmmm 🤔
pretty sure those aren't supposed to be growing infinitely
whatever, not my problem
okay new problem, my booster packs don't actually natraully show up in the shop (ok i have found 1 common pack in like 30+ boosters), how fix
have i misunderstood how weight works and it should be a lot higher than 1
chance is (your booster pack's weight / total weight of all booster packs)
There are a bunch of packs that use 1 so it's not always going to appear if it's set to that.
in the normal game they range from 4-0.07
what's the normal buffoon pack set at, 2 or 1
it's in game.lua:665-696
haha yeah, I summed the variations together
since they're the same thing, just a different image
been reviving a little project, still can't figure out denominators exactly but I'm getting there.
I should be able to do most of them without denominators, and 4 of them are in-game working as intended
is there a moment in the game where card.ability == nil?
no
great
I have a bug: I got different card values when I hover my card in hand or in the deck viewer
https://discord.com/channels/1116389027176787968/1264020405400633354
the value in the deck viewer is always 1 more than it should be
#⚙・modding-general is turning into #🎙・server-chat so i'm hiding here
hm
ngl I thought thunk fixed that by caching the save file for current profile
And then modding-dev turn into modding-chat
lawsuits in balatro
lua things 😴
floating point moment
Pls no more collection buttons
too late
woo
kinda sad that lua doesnt have built in math.round
Damnit
config lawsuit
I don't think it's the savefile, I think it's the UI elements not getting reused/cleaned up so it keeps recreating new ones
I see
But don't quote me on that 😅
Is it 0 when there are no Red Seals?
the negative shader doesnt work properly until at least one card is made negative, idk why
What does this mean?
if you try to draw a sprite using the negative shader, it wont display correctly until at least one negative card is created
Can you show me your code and a screenshot of how it displays?
it's literally just draw_shader('negative')
this is before a negative card is created
and this is after
Try calling the dissolve shader first
even with dissolve shader it seems to do the same thing
How does it look with other shaders instead of negative?
dissolve, polychrome
this broken negative behavior can be recreated by cycling through editions of playing cards in deck view (with them rendering incorrectly until an actual negative card enters the game)
does it work if you send this as the third argument?
self.ARGS.send_to_shader = self.ARGS.send_to_shader or {}
self.ARGS.send_to_shader[1] = math.min(self.VT.r*3, 1) + G.TIMERS.REAL/(28) + (self.juice and self.juice.r*20 or 0) + self.tilt_var.amt
self.ARGS.send_to_shader[2] = G.TIMERS.REAL```
negative also has negative_shine shader btw
yes, but it's specifically about negative shader
it is nil
having troubles figuring out how to get that to work in my code unfortunately
i already have a workaround in mind, but yeah - negative behaves strangely
is there a part of the card table that tells in which cardarea the card is?
upd nvm im stupid and yeah it works
is that rly necessary tho? those are initialized on top of Card:draw
its not a card, so yeah
ah, right
i want to check if context.cardarea == G.hand but I don't have context, I only have self
isn't it just card.area?
🎉
now my mod works, but I'd like to add a config menu in the Mods category so that you can tweak some parts of the mod
Like, I click my mod in the mod menu and a Config button appears
Do you understand the ui of the game?
Then find someone to do it for you
lol
I've been looking at it myself, but would appreciate it if someone put some notes together on what things are often used, like the different options to align, and where in the world I'd find G.UIT to figure out what the different letters after that mean. Would probably be useful for several people, in the same way going through how all the contexts when calculate called was absolutely amazing.
This is on my list of things to do
Would be very much appreciated, your calculation guide is the first thing in my modding bookmarks.
i really need some help, i've been trying to fix this for the past few hours and i simply just can't.
this joker is supposed to give mult per scored club
the operation Emult (exponential mult) is obviously not vanilla, but even vanilla operations don't work
all checks are passing, the return value is just physically doing absolutely nothing, no matter what
i've tried running the mod on its own with only its dependencies and still nothing. i've tried calling this without any if statements and still nothing. i'm stumped.
Can you show the full function?
I’ll get started on it tonight hopefully
how do you find out whenever odds is triggered?
that is the full function.
i guess pseudorandom is always called, but that doesn't give you information on the chance roll itself
so I'd say you don't
Try card = context.other_card, maybe?
that crashes.
I mean the definition as well
this worked completely fine before, and now it just doesn't
if context.individual and context.cardarea == G.play then
if context.other_card:is_suit('Spades') then
return {
chips = card.ability.extra.chips,
card = context.other_card
}
end
end
```
This works fine in my mod, but it is different from `chip_mod`, don't know if your Emult will have something similar.
there is, it should be e_mult, let me try something then
Have you got a link to talisman handy I can take a look at?
i made changes to it to allow more exotic operations like exponential mult, you can take a look at it here: https://github.com/MathIsFun0/Talisman/blob/main/lovely.toml
I'm looking at the custom joker mod template that comes with steamodded and I've stared at this for ages and still just can't parse it
there's no comments explaining it and the github documentation doesn't help either 
Can you send the lovely dump of state_events.lua through DM?
i will in a moment, just doing another test
this is old
I've tried looking at how other more recent mods have done their code but to me at least they all look formatted differently
i have no idea what is happening right now
Weird. Maybe try checking for different contexts? What did you change the code to?
this
card = card does the same thing, the only thing it changes is that leshy does the juice-up instead of the playing card
Very odd. Tested mine just to make sure, but it doesn't do anything weird. What happens if you change e_mult to just mult?
i don't know, maybe i've fucked something up with talisman but either way holy shit this is getting a little crazy to debug 
SMODS.end_calculate_context is deprecated, use context.joker_main instead
Also yea I feel like this example's tool old?
yeah... i think i've done something wrong with talisman
i've changed it to just mult and now the text is appearing on the playing card
well, thanks very much
Few things to take a special note of, one is config, usually has something like config = {extra = {mult = 5}}. The extra is just because it sometimes doesn't load properly otherwise, I think.
loc_vars often gives things to your description - info_queue is the stuff on the side, like when a card is negative, but is somewhat finicky, better off looking in other places for a better example. Usually, you want to return something like {vars = {card.ability.extra.mult}}, and then, in your description, when you have #1#, it'll change to the 5 from config.
Other than that, calculate does all the work. Usually, it checks for contexts, to see what step of scoring the game is at. That SMODS.end_calculate_context(context) is basically just if context.joker_main then and does the stuff after. It has a return that tells the joker what to do, in this case, mult_mod grabs the mult from config, and has the joker apply it, and the colour and message give a small pop-up underneath the joker when it gets activated.
oh shit I should have spotted that, thing_mod doesn't work on individual
fuck, this is what happens when i'm used to cryptid's old pow_mult_mod variable 
well, either way we've found the cause now
One more thing, #1247703015222149120 message has a pretty good guide on contexts - It can be hard to figure out at first, but, read it over, and once it clicks, everything about contexts will make pretty complete sense.
i'll get to work on fixing everything, thanks very much, especially to @shell tangle
I mean, noted, but I can't even understand what a lot of the code even means
the github imo really doesn't lay out what's actually going on it's examples
like if I'm working on a blank project what does any of this even mean or refer to
Those are old docs hold on
I'd recommend looking at this for a more up-to-date example https://github.com/Steamopollys/Steamodded/blob/main/example_mods/Mods/JokerAPI_Example/JokerAPI.lua
yeah no worries
I don't wanna come off as rude I'm more annoyed at myself for not just getting it lol
I mean everyone starts somewhere
Just in case you assumed it was for the other conversation, this was directed at @spiral cypress to explain the basics behind it.
oh sorry thanks for pointing that out idk why I didn't see it first time
ok yeah I assumed for basic functions like just a flat mult + it was handled in config
Yeah. You can look around card.lua in the source code to find how vanilla does it, but rather than each individual joker having calculate, it calculates all at once, so every card that activates on context.joker_main will be under a single if context.joker_main, rather than every single vanilla joker having it in their code.
Whatever vanilla returns, like chips_mod or mult_mod will usually work in the calculate function as well.
Note that joker main isn’t in the source, it’s added by smods
The joker main stuff is just at the end of the tower after all the context checks
okay thank you both that's clearing some stuff up
so it seems loc_vars just isn't really relevant at least not for me right now
The joker will function without it, yeah, but it's how you put variables into your description to let people know how it works.
It’s better to use loc_vars for any values in your description, makes it easier to make changes
still confused about
if SMODS.end_calculate_context(context) then
return {
mult_mod = card.ability.mult,
colour = G.C.RED,
message = "AHAHAHAH"
}
end
end,```
the first three lines I just assume are y'know, "when turn ends do this"
4th line is mult, tho idk why it's both here and in config
and 5th and 6th with the message and color I've got no clue, it's sending a text string during scoring?
Colour is the background color of the message that'll show up when it's the end of turn
Basically the calculate just sends some values to a different function that actually calculates your score
The 4th line is telling the joker. your mult_mod is equal to card.ability.mult. The config itself sets card.ability.mult to a value, I think it's 4 in the example joker. And, yeah, the message is just replacing the +4 mult that'd appear.
So you need to give it all the relevant information;
1 - what you are changing
2 - a message to display
3 - a colour for the background of your message
ohhhhhhhhhhhhhhhhhhh
I assumed this was an automated string that was just factored into the core game's scoring UI
not a customizable string unique to the card
Some things don’t need a message and colour
It usually is, but can be overridden.
They automatically work out a message
Maybe I should make a few vanilla jokers into a modded format, give them comments and such, but I don't know if that'd be fine to have on the github because it might be considered sharing source code.
see, I would've figured that out had I seen the card in-game but obviously the game was crashing with my unfinished mod in there
and even if I did disable it I haven't enabled debug yet
Making a vanilla joker into the api wouldn’t be source code
^
honestly I think it just needs a few dev comments
since no other card has personalised scoring strings to my knowledge having AHAHA threw me off super hard
Honestly, a lot of the docs are great at telling you what you can do but not what it does or how to use it properly
Literally 99.9% of lovely patches are source code
You need to understand the games source code really to know how to use things
tbf I'm sure if I did a bunch of lua basic lessons or whatever it'd be easier but I have a habit of just picking a random moddable game and tryna get something on screen asap
What it do? 👀
It's the start of archived tarots
oooh
redoing archived for 1.0.0?
Yeah, slowly but surely
Alright, going to try converting some vanilla mods to SMODS with comments, and maybe show off some minor modifications that can be done with mods. I want to show off several examples of different things that happen, so how does this list of example jokers look so far?
Joker - Used to explain the basics
Runner - Shows how to scale things
Golden Joker - Shows how to add money at end of round
Merry Andy - Shows add_to_deck, remove_from_deck, and changing discards.
Sock and Buskin - Shows how to retrigger cards
Perkeo - Creating cards, and end of shop context, as well as soul_pos
Walkie Talkie - Shows off testing for individual cards
Gros Michel - Pool flag, maybe modified with a version that gives you a modified custom banana upon brealing, to show create_card with a modded prefix.
Cavendish - Pool flag, simple X mult.
cryptid mod already has nostalgic boss blinds btw, that could save you some work 
Yeah but I'm not gonna just copy/paste their code
I would maybe use scholar instead of Fibonacci so you can demonstrate multiple return values
Good call. I'll do Walkie Talkie to test for multiple values.
feel free to use it as a base
i mean you are going to have to change some things like sprites, names, and a few effects
Minimum ante too
I tweaked some of those a bit
OP
The idea is that it serves an an emergency button, where if you think you're going to lose you can sell a joker and get an extra burst. However, in the three games I played, two of them I won without using this ability once, and one I dumped all three non-Eternals and still lost during that round
Riff raff abuse
Didn't consider Riff Raff, yeah
Imagine this deck when infinite invisible chains were possiblr
Are the hand and discard permenant?
No, it's just for the current round
Yeah, I don't know.
I think I'll keep the effect as-is, maybe add a limit of max 3 uses per round. Even if I'm not the biggest fan of it, it looks like there's ways to make it work, so hopefully someone manages to have fun with this deck
Maybe make it so common jokers don't have this effect?
No riffraff abuse
This would actually be a pretty cool challenge
Like "start at 1 hand and 1 discard, selling a joker during a round gains +1 hand and +1 discard"
Also question about lovely
that might make the effect too situational
though i guess you could sell an econ/util joker 🤔
i'd keep as is tbh
If I place something after a target that appears multiple times, like for example
if ante <= 8 then return amounts[ante] end
appears 3 times and if I place something after it does it place it all 3 times?
anyone got any idea why the game doesnt like having 2 text inputs at once?
it appears to just be coded that way because it was more convenient
a text input UI element has config.id set to 'text_input' and it seems like there can't be two UI elements with the same ID
changing that ID probably breaks something, but it's worth trying
hmm
ill see what i can do then
its good to know the root of the problem at least
thanks
Yes it does
Good
local t = create_text_input(...)
t.nodes[1].config.id = 'text_input_2'
this would likely be where I'd start
thanks
no errors. but it doesnt show still
i might be able to my own id right
and just set it to that
Hey so is there anything beyond just me being bad at programming that stops the ante base from being changed mid-run
shouldn't the first patch be G.GAME.ante_multiplier instead of ante_multiplier?
huh, so ive got the 2 text inputs, and set ones id to text_input_1 and the other to text_input_2, the second one still shows but the first one doesnt
are you sure its dependent on id?
ah
ik why
its because another node deeper in has an id too
i think
nope nvm
drawing. on my puter