#đ»ă»modding-dev
1 messages · Page 47 of 1
I am not, it was just an educated guess
I saw it was getting that UIE by ID for pasting seeds, so I thought it might be relevant
I could be wrong though
i mean youve def got a better idea than me
ill look through the source code and hope i find smth
ah
i think you may be right
but theres more ids used in the text input
like prompt and position
so ill change those too and see what happens
i think im just gonna patch the create_text_input to take its own id prefix or smth
and append that to each id
because every letter node has an id
looks alright to me
Hmm
Maybe there's something in the code that prevents you from modifying the base mid-run
it wont' show on the preview correctly until you actually start the blind if you do it mid-ante
It doesn't show when I start the blind either
get_blind_amount is definitely being called on set_blind
not so sure what's up with that, how are you changing the function?
As in the lovely patch?
Well I did add another line
have you checked the lovely dump?
open Mods/lovely/dump/functions/misc_functions.lua and search for the function you're modifying
you'll see it as it's actually being run
then you can debug from there
possible the change isn't taking effect due to setting ante_multiplier to 1 somewhere unintended?
So the lovely patch did work correctly
Idea
Maybe as I'm selecting blind, ante multiplier gets set to 1 again
yeah that's what I mean
check what places these ante_multiplier = 1 patches are hitting
Okay so actually I just changed ante_multiplier to 0.5 manually and it still does nothing
wdym manually?
Like I changed G.GAME.ante_multiplier = 1.0 to G.GAME.ante_multiplier = 0.5 in the files
I'm gonna see how betmma does it
wait so you're setting it to 0.5 at the start of get_blind_amount or no?
Yes
can you screencap and send the dump of that function?
This?
Cryptid, Talisman, and twewy
ALso debugplus
Okay so good news
It works fine when
cryptid does also change get_blind_amount
I removed all the mods
so that's probably why
Cryptid incompatibility :(
i think for what you're trying to accomplish, a hook would be cleaner than lovely patches
local gba = get_blind_amount
function get_blind_amount(ante)
return gba(ante)*G.GAME.ante_multiplier
end
That's it?
you're just trying to multiply the return value by some number
Man I made that way too complicated
and even for that, I think G.GAME.starting_params.ante_scaling already takes that role?
In my defense tho I did not know how to hook
See now could I do that but only for one ante
Because all of what I'm doing is to make it so one ante is smaller
Lemme try something first tho
Do I just put this anywhere or does it have to be in the same file as get_blind_amount
In your local mod file
Ty
I have a Joker that increases the Blind amount at the start of a Blind
Both because I didnât want to figure out how to update the UI, but also because it reduces the motivation to sell it mid-round
idk why I expected this to work
lmao there's no card here
good one
you might wanna iterate G.jokers.cards
I'm just trying random stuff
Like it works for all antes but I just want it to work for only one ante
having an issue where my configs aren't getting loaded back in on a restart of the game, have I missed something obvious?
that may or may not be my fault, let me check
I'm using local mod = SMODS.current_mod and then referencing mod.config
fixed
đ
Hey guys is there a thing like context.changing_ante or something
more tabs
i cant figure out the multiple text input boxes for the life of me
if anyone happens to look at it at any point and figure smth out please tell me
What's the path to the lua shared library for the mac release of Balatro?
wdym, like the game directory where the app file is?
or the save folder
yeah, in relation to the balatro executable or whatever
(I don't have experience with mac systems)
wait so do you want to know where the executable is or where something inside that executable is?
I'm looking for the path to the interpreter
The thing that corresponds to what lua51.dll is in the windows release
I'm not sure I can help then, I don't have a mac system or even executable at hand
for the case of keybind config, you can have buttons that open sub menu with input field to change keybind for that action
thats such a good idea
It's workaround but it should be easier than figuring out the correct way of doing it, especially if you don't plan on adding something more complex
this was my idea of a solution lmao
not aligned yet ofc
but yours is so much better
thank you
any info on how wildcarding works in lovely patch patterns? I want to patch every line that starts w a given substring
I believe it will patch all lines that match your pattern
right, but the readme has a wildcardish example: pattern = "(?<indent>[\t ]*)if (?<cond>_context.type == 'eval' then)" and Im not quite sure how to make sense of it
that's regex
oh
https://regexr.com might be interesting if you're unfamiliar with regex?
i know regex, but the engines i've used it in don't really look quite like this...
like <indent>
or question mark being used by itself
(?<name>) is a regex named capture group
oh, that is new to me. TIL
I guess i got tripped up. the readme mentioned that pattern could use * and ? as non-regex wildacrds i think
that's patches.pattern vs patches.regex I believe
this made me want a daily bounty board mod now
are there any workarounds for cards with context.destroying_card trigger making other cards with that context not trigger
for example, Sixth Sense and Nameless Fetus [If the first hand of round has only 1 card, destroy it, ...]. if i play a singular 6, Sixth Sense would proc first and mark the 6 as destroyed, so Nameless Fetus cannot proc its effect
Maybe try using a context.before somehow?
destroying cards in any context other than context.destroying_card creates a ghost card
and if i modify the code itself then multiple copies of Sixth Sense would work which is non-vanilla behavior
Something like, add a check in context.before, then trigger destruction in context.destroying_card if possible, and then activate the ability if the check passed? Does feel like it'd be a very makeshift work-around, though.
oh hm
so you want 2 destroyers to proc if theyre diff jokers, but only proc one if they're the same?
i want to retain all vanilla behaviors
as long as vanilla cards aren't touched i'm fine with it
so i'll try the context.before thing
How do i change the number of initial hands a deck gives?
Or make a deck start with +1 hand
Does SMODS.Seal not have update field?
run every tick? like Jokers?
oh I missed that form jokers
was a bit confused when wanted to use it but it had no output of any kind
I guess not, seals aren't really centers in terms of the game
still would be handy
# Card:update()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'if G.STAGE == G.STAGES.RUN then'
position = 'before'
match_indent = true
payload = '''
local obj = G.P_SEALS[self.seal] or {}
if obj.update and type(obj.update) == 'function' then
obj:update(self, dt)
end'''
throw this in a .toml for now
I'll set it patched into SMODS with some other seal logic later on
cleaner additions tab anyone?
Neat
right side looks a bit empty on this one, but I don't think I'll auto-balance
Is this part of the recent config addition or something different?
yeah it's part of it
i just refined it to remove empty tabs instead of greying them out
Couldnt it be done automatically on SMODS object creation?
wdym
If I call say "SMODS.Joker" it adds it to the thing in the pic above
you mean like saving separate object lists for each mod?
Instead of manually inputting it in a config file
Oh you said that so I thought
Thats very cool then
also hides the consumables box and full columns when they'd be empty
there's still red deck bug which I have to look into, I'll still push up what I have
Oooo nice
Is there a planned solution to the main collection with custom consumables types?
i don't need to request again right......
request what, the booster dupe bug?
removing consumable types from collection
yay
thoughts on localizing mod names / descriptions?
I finally figured out why I can't get require("string.buffer") to work: It's because Balatro uses luajit 2.0 and not 2.1
doesn't quite seem right how everything else is localizable now but mod names and descriptions aren't
Localthunk pls
oh damn
I mean it's a plus imo
I surely can't cut support for the current header components for backcompat reasons
but there's also 3 different ways to do other loc text, so whatever
it could also act as a way to allow actual text formatting
me patiently waiting for "Balatro'UI for dummies - A modder's guide" to drop from someone
it's in progress
Can I formally ask Localthunk to bump the underlying luajit to 2.1
tho Idk what version was used before that might've caused performance issues
actually nvm
says that it was 2.0.5
yea Idk why it's not 2.1
ÂŻ_(ă)_/ÂŻ
Joker tooltips arenât too hard
Iâm getting some idea of how other tooltips can work
Luajit does rolling releases, so today's 2.1 might have solved the problems of the 2.1 tried in 1.0.1e
Do we know what kind of conditions contributed to that problem?
would anyone know how to get the box on the right to be drawn on top?
its hidden under the other joker atm
the tooltip would need to be drawn after the other joker
I think that's how it works? I remember someone mentioning that
people just add tooltips below the main one
to fix that
right
it looks like i can change the draw layer manually after creating the ui box
so im gonna try that
no idea what i have to change it to but ill trial and error
Mad science idea: Lug in a later version of LuaJIT and then load some modules in from it
Will this bork anything horribly?
surely not
based as hell
adding pages to this was more annoying than I thought, given I don't really know much about object nodes
the way balatro does rendering priorities is G.I.[whatever], so try moving it up through the tables in G.I until it renders on top
you can find the priority it renders stuff in Game:draw()
top to bottom its G.I.POPUP, G.I.ALERT, G.I.UIBOX, G.I.CARD, G.I.CARDAREA, G.I.UIBOX (again for some reason idk), G.I.MOVEABLE, G.I.NODE
maybe your uibox isnt being drawn in the 2nd uibox render so thats probably why its being put under cards?
idk
yea you just table.insert(table, pos, value)
Hmm... What if lovely_injector also exported a lua module allowing lua code to do its own patch applications
Huh
basically it groups objects into the G.I tables and thats how it chooses what to render over what
i.e G.I.CARD is rendered over G.I.CARDAREA
if you look in Game:draw() it makes more sense
Okay, I think I have something I want to put down now because I don't want to forget it:
Keep around a (compiled) regex for determining if the ends of a span are word boundaries. If they are, apply whitespace padding to the ends of the patch if needed so it doesn't unintentionally merge into existing tokens
Trying to make a joker that swaps mult and chips not sure how to go about this though
Find where chips and mult are stored in G.GAME, store one value, let's say mult, current mult = current chips, then current chips = stored mult.
in Lua you can just
a, b = b, a
Or that. Neat.
Thereâs also a swap return that does it for you iirc
local save_ref = Card.save
function Card:save()
local ref_return = save_ref(self)
ref_return.st_counter = self.st_counter
return ref_return
end
local load_ref = Card.load
function Card:load(cardTable, other_card)
self.st_counter = cardTable.st_counter
load_ref(self, cardTable, other_card)
end
adding this to my code gives me the error at the top
i have no idea what the problem is
does replacing the hooks with function Card.functionname(self, args) work?
fixed my problem
basically part of the save table is text_drawable
which is a userdata value
but i think its only made when you create ui for smth
so i basically removed the ui to save it, then created ui for it again when its loaded
maybe a stupid question but
context.before is the context of before playing a hand and context.after is after, right
or do i need different contexts for that
before is when Space Joker levels up your hand, after is when Ice Cream loses 5 Chips
okay so i need the context for "after a hand is played and scored" I think
context.after_hand?
...is there just a big list of contexts anywhere
excellent
this look good?
how would you check if a card does not have a modification (enhancement, edition, and seal)?
Enhancement is something like if context.other_card.ability.effect == base
Edition i think do something like if not context.other_card.edition
Dunno about seal though
Oh dang it, not again
I mean the deck idea is good but good grief
this works, ty
hmm
hmm
Is it me or the banana badge looks too bright on a debuffed cards compared to other ones
yea they didn't get hit with the debuff shader
The modded stickers are being rendered after the debuff shader
I have a dilema right now. I have a Joker that can be activated once per ante with an extra variable thats true/false when it can be activated and is blueprint compatible, thing is I dont know. Thing is I dont know how to prevent the blueprint card from activating the joker when its inactive since the extra variable doesn't exist in the blueprint card
blueprint runs calculate on the card being copied, so it'll use the same value
though setting it to false after use might prevent blueprint from activating the ability
Yea but "card.ability.extra.x" doesnt exist on blueprint
yeah but it's not being accessed on blueprint either
blueprint is in context.blueprint_card
Its trying to, I get an error saying "ability" doesnt exists
blueprint surely has ability
are you sure you're not using the center instead of the card?
This is what I have so far roughly:
if context.ending_shop
if card.ability.extra.do_stuff then
--- do stuff
if not context.blueprint then
card.ability.extra.do_stuff = false
end
end
if context.end_of_round and boss and not context.blueprint then
card.ability.extra.do_stuff = true
end
end
in the calculate function (self,card,context) of SMODS.Joker
Oh wth I have no idea how but I fixed it uhm
@frosty dock is it possible for this to still display the base consumables and then have a modded consumables option at the bottom?
sure it's possible, but seems a bit arbitrary?
I just need to get used to the big orange button đ
meanwhile I'm not so sure about the Other button
i love the big orange button it looks cute
lobcorp configs?
feat. reused houserules code
consistency with the mod ui height now
đ
Thereâs a lot more mods that hijack consumables to get their added objects so it basically just leaves D6 Jokers as the one mod using the button rn.
Iâm adding a stickers tab to it so D6 Sides wonât be lonely.
contracts might use that
imm trying to add multiple use buttons to a consumable
how can i make them all do sommething diferent
just like sending a value into the use function
im sorry you can put text input on a card??????
in a UI box
i need a method of choosing a rank from 1-ace for a card
and i dont think making 14 use buttons is a good idea
so figuring out those text inputs could be a good idea
oh god every time i forget how unreadable the ui code is it comes back to haunt me
you could do it with two buttons: [<] [>]
or with one that does +1
i can definitely figure this out... definitely
also what the hell are even nodes lol
Please note that my guide in there is far from complete
No one will be spared from UI
UI code isn't too bad as long as you don't use auto format on it
then it looks like shit
from this to this
đ€ź
what
that looks better
also i am ANGRY
it refuses to give me a text box
which one looks better?
Maybe you could show a pop-up menu when pressing the use button?
right one
Can the right be generated automatically on Sublime?
ig...
but like, how do you even make one
how do you initialize ui elements from within use_consumable
You could use text inputs
thats what ive been trying
Or selecting from hand
the text inputs just refuse to work
ugh no the right one is awful for tracking the nesting of nodes
I think reworking mechanics for UI reasons can be interesting
what's your code alex?
I think itâs easier
You can tell by the number of tabs
And sublime allows you to close specific nodes
Also the UI in Cryptid is already pretty weird
Well, Lua tables
Like controller doesnât work half the time
But you know what I mean
this is the current state of the function im operating in
this is only for using it from packs
using it when its in slots is a whole nother ballpark
the second part of it is for code cards in general
they all work
Anyways, @wintry solar , do you know if the right formatting could be automated?
It would be so helpful
im trying to add just a simple text input above the card
I have an adapted print function to see UI nodes that almost does that
I have a VSCode extension that'll format it that way, yeah
Yâall autoformat UI nodes?
I think it's this one https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
Alex, can I see where you try to add the text input?
It doesnât seem to support Lua
Unless I missed it
I don't remember if it does or not
@fallen tendon try printing the UI elements
im thinking of just hooking in a new popup menu into the use function
i genuinely think it might be easier to just make a new ui box lol
what happens when you remove all those empty rows too?
It has a format function but I canât seem to get it to work
no clue
Nothing changes
Oh I think there was a syntax error, thatâs why it didnât do anything
Did it work now, Victin?
yay it crashed meaning its finally doing something
im getting thhis message
use = function(self, card, area, copier)
self.HUD = UIBox{
definition = create_UIBox_variable(),
config = {align=('cc'), offset = {x=0,y=0},major = G.ROOM_ATTACH}
}
end
}
function create_UIBox_variable()
G.E_MANAGER:add_event(Event({
blockable = false,
func = function()
G.REFRESH_ALERTS = true
return true
end
}))
local t = create_UIBox_generic_options({contents = {
UIBox_button({button = 'Done', label = {Done}, minw = 5, focus_args = {snap_to = true}})
}})
end
seems that the issue is that something is missing a parent
Yeah my formatter makes some code worse
Yes
Or you have one table too many
Is the return wrapped in curly braces?
I don't think you have a return at all
I think create_UIBox_variable needs to have return t
Like this block always gets screwed up https://github.com/WilsontheWolf/DebugPlus/blob/master/core.lua#L329
oh god what did i do
I just format my code by hand (:
I mean my IDE is smart enough to do indenying 90â of the time so it's not a big deal
yeah
Like cavefoxes
I mostly use it when moving code around or particularly nasty code
c/o?
YESSSSSSS
NOW I JUST NEED IT TO BE AN ACTUAL POPUP AND NOW WHATEVER THE HELL THIS IS
What?
What do you need 220 frames for
i just have vsync off and i have a pretty good laptop
is your button the entire screen?
Iâm just curious what does it even mean
Thatâs what I found too
what a bizarrely niche symbol to put on a keyboard
@fallen tendon you could try throwing a text_input in there now
I mean it is in the sort of niche page of keys.
or get the butttons to display
oooh im sorta getting there
That makes sense, at least; itâs âper milleâ or something like that
Try looking at fusion or evolving Jokers
Betmma had activatable objects too
No im making an actual popup
managed to get it to exist
it just needs to be not there
try putting instance_type = "POPUP" in your config
note: I haven't tested how this works properly
just that?
Arachne I was talking about the order that different elements are drawn yesterday
its in a slightly better spot
but the popup thing did not work
oh that was because i accidentally put instacne
so, how do i define a function to be executed by a button
oh ok
code pls
and how do you want it to look?
i want it to be either in a column or a row
just a positioning where the text field isnt outside of the window
wrap each in a {n=G.UIT.C, nodes = {*INSERT HERE*}}
also weird thing, the button doesnt appear until you click the text box
they are
I just need to convert my changes into a lovely patch though and then at least you can ahve more than one
oh also how do you close a window
put 'exit_overlay_menu' as the function of a button somewhere
or press escape
or call G.FUNCS.exit_overlay_menu() somewhere
great
I built my own button
hhhhh so now when i press the apply button the card switches rank, but it doesnt exit the menu
G.FUNCS.variable_apply = function()
if G.ENTERED_RANK == "1" or G.ENTERED_RANK == "2" or G.ENTERED_RANK == "3" or G.ENTERED_RANK == "4" or G.ENTERED_RANK == "5" or G.ENTERED_RANK == "6" or G.ENTERED_RANK == "7" or G.ENTERED_RANK == "8" or G.ENTERED_RANK == "9" or G.ENTERED_RANK == "10" or G.ENTERED_RANK == "J" or G.ENTERED_RANK == "Q" or G.ENTERED_RANK == "K" or G.ENTERED_RANK == "A" then
G.FUNCS.exit_overlay_menu()
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
play_sound('tarot1')
return true end }))
for i=1, #G.hand.highlighted do
local percent = 1.15 - (i-0.999)/(#G.hand.highlighted-0.998)*0.3
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('card1', percent);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
end
delay(0.2)
for i=1, #G.hand.highlighted do
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
local card = G.hand.highlighted[i]
local suit_prefix = string.sub(card.base.suit, 1, 1)..'_'
local rank_suffix = G.ENTERED_RANK
if rank_suffix == 10 then rank_suffix = 'T'
end
card:set_base(G.P_CARDS[suit_prefix..rank_suffix])
return true end }))
end
for i=1, #G.hand.highlighted do
local percent = 0.85 + (i-0.999)/(#G.hand.highlighted-0.998)*0.3
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.15,func = function() G.hand.highlighted[i]:flip();play_sound('tarot2', percent, 0.6);G.hand.highlighted[i]:juice_up(0.3, 0.3);return true end }))
end
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); return true end }))
delay(0.5)
end
end
call G.FUNCS.exit_overlay_menu() at the end
ok
can i still do it in the if statement?
cuz i dont want to completely waste the consumable if you type in an invalid string
yeah it just won't exit if you do that
maybe add an alert or something that it's invalid
ok
actually what if i put in a premature return
the function is still at the top scope
actually uhhhh changing it still did nothing
or not, i didnt save it lol
ok it still doesnt work
fun
is this your entire code?
this is the code for that row
what's your entire code for the config tab?
what button are you pressing in your clip?
everything there is on a keyboard
literally just shift + J
it uses the rank suffixes
what happens if you remove max_length
so it goes 2-9, T, J, Q, K, A
đ
nothing, it uses a whitelist
alex pls
same thing
I was talking to Cerlo đ
oh ok
đ€Ł
I know how to type a J
it's cool though
how did you end up making it close?
oh
you just remove the node?
fun
and if it was an overlay it still doesnt work because the game is frozen
maybe it's something wrong for ref_table and ref_value
this dynamic text scaling is pretty neat
the problem is if I click "Backspace" the text continues to shrink
can you pass the code for the red input button?
I'm trying to inject into misc_functions.lua, but it doesn't work 90% of the time, what am I doing wrong???
needs full line
does SMODS hit this before you do?
it works
but just when I do one text input
when I do two, the first isn't loaded
yeah multiple text inputs on vanilla create_text_input doesn't work
aure would you prefer overriding them or injecting to fix it?
please, teach me the Way
you can inject if it doesn't turn the function into a theseus ship ig
it's fine to override if that's cleaner
yeah that should be alright to inject
what if you just used an option cycle
?
these things
because you can input any number
this got merged, huge 
https://github.com/Steamopollys/Steamodded/pull/202
I might add a config option for the lowered precision
that's fine
I mostly added it for money
because I cba changing the scale_number function
thats normal yeah
because in font 0 == o
so thunk just decided to auto convert it (mostly for seeds I think)
didnt know about shift+0 tho
huh that's weird
yeah, I think past e100 you dont rly care if it's 4e200 or 4.003e200
I'll have to agree
I wonder how that works on AZERTY keyboards where the only way to type 0 is shift+0
okay, let me see what other lovely patches I have that should be making their way into SMODS
I need to work on some to make some contributions still v_v
work on any of the open issues is appreciated
I was thinking of new features :<
ofc that's also welcome
Like bonus mult for cards and bonus chips and mult for jokers
Among other things
I wanted to add a new object to allow easily adding new calculable CardAreas but the Object type confuses me
object type?
I have a patch that allows turning the floating question mark off for undiscovered sprites, throw it in atlas.toml?
sure
could make it a setting on UndiscoveredSprites whether the question mark should be there or not
Actully what if a slider
Then you can input any number from 1-100
And if you have 100 retriggers then what are you doing with your life
or just wait for the PR and use inputs!
time prediction?
just checking it still works
The type that is extended for SMODS types like Jokers, PokerHands, etc
ah
the PR is there đ
How should I extend it?
the same way Steamodded object types do, branching off whatever works best (probably GameObject or Center most of the time)
looks good, I'll merge
man I wish git had a better way to collaborate on the wiki
it's possible to set it up as a separate repo apparently
I mean, yeah, but how?
too much red on that page tbh
I can gauge how to define required keywords from the existing GameObjects
I think
But Iâm not sure I understand how one would go about defining a new extension of GameObject correctly
you can look at how other gameobjects are specified đ€
well, it depends I guess
because there's inject and all that
you pretty much have required keywords, default values, obj_table (holds objects indexed by key), obj_buffer (holds object keys in order) and whatever functions need to be extended
and dont forget inject function that is used to handle all new gameobjects
- Zero becomes
o - When I click
Enterit becomes drunk
decided to look at cryptid for starting out with balatro mod dev and it turns out that was the exact wrong move lmao, didn't realize steamodded had a function for adding jokers so I set mine up like cryptid's and then couldn't figure out how to inject them
cryptid does the same, but because it does it in batches, it's not the best entry example, yeah
in case you didn't see this yet
can you give me your code again?
ah, thank you
cryptid is probably a bit too complicated for a "starting look" lol
also doesn't help that I've never used lua before
yeah cryptid's wrapper isn't the easiest to wrap your head around for what's actually happening
you need to give your text_inputs an id now
I never used lua before either 
id = blabla
wasn't the hardest thing to learn with so much source code examples
same here
yeah it seems pretty intuitive to start with
I've used lua once before, in a minecraft mod that had robots >:)
ok the drunkness is solved
the 0 to o?
Some things were defined outside of the type extension which seems counterintuitive to me
what things?
Like the list of PokerHands
I think every GameObject has a list of all its instances actually
Which makes me think the type GameObject should do it instead of it being user-made
yeah SMODS.PokerHands and similar tables are just shortcuts for convenience
SMODS.PokerHand.obj_table is identical
so yeah it kinda does that
We should probably clean up the lovely patches for style purposes.
inject shouldn't have side effects that stack when reapplied, but prototypes are generally kinda inconsistent rn and we might do something about it
that as well
The main object I want to add is a helper object to extend calculation
Such that users could register a type and a CardArea to have SMODS automatically iterate over instances in the CardArea and call calculate
I think better_calc has stuff relating to that but I havenât looked at the code too much.
Speaking of CardArea, something to ease handling of it would be nice.
I donât think we need API for it as CardArea already has the functions and properties youâd want, but thereâs loads of hardcoded parts that need to be messed with to make custom ones.
And said hardcoding fixes could screw with other mods that also try to fix it for their CardArea.
I have a problem with getting the value of the config settings
it says that current_mod is a nil value
?
the code is now using current_mod.config.MaxRedSeals and it is still nil
I tried config.MaxRedSeals but it is still nil
you should save a local reference to config at top scope in your mod
oh, they're not in your main file
is that the reason?
local values in a file that's loaded in?
ok now it doesn't crash
still, when I change the value in the config menu, it doesn't update the variable
does it work when you don't seperate the files?
as long as you change the value in <mod>.config, steamodded will save to file when exiting the mods menu
(not to config.lua though, that stays unchanged and acts as a default)
I think if you put everything in one file it'll be fine
nope
I tried merging the main file and config_tab.lua
let's see what you have now then
just put the tonumber(config.RedSealsPerCard) wherever you need it in your code
now it crashes if I open the config page
well then you changed something you shouldn't have done
found the problem
if I remove these lines, the config page crashes
if I keep them, the game has problems
i'm trying a solution
but I've given you the solution?
your solution doesn't work
when I access config, it crashes
sending you the file and the crash report
- start a run
- modify the values in the config page (it needs a number with "0")
- apply a Deja Vu
line 109 is this one if card.ability.SRSreps > tonumber(config.MaxRedSeals) and tonumber(config.MaxRedSeals) >= 0 then
Don't think it'd be it, but what happens if you delete the .jkr that has the configs saved and try again?
from where?
Where your profiles are located in appdata, there's a new folder besides 1, 2, 3, and Mods called config.
What are the values in the config file?
No not that one
as per the last time I updated those
The one someone just mentioned
return {
["SRS_MaxRedSeals"] = 15,
["disable_collapse"] = false,
["RedSealsPerCard"] = "5",
["MaxRedSeals"] = "6",
["RedSealsForCard"] = 10,
["hide_empty"] = false,
["hide_by_default"] = false,
["default_rows"] = {
["SRS_RedSealsForCard"] = 1,
["SRS_MaxRedSeals"] = -1,
["modifiers"] = true,
},
["enabled"] = true,
["SRS_RedSealsForCard"] = 10,
["small_rows"] = {
["reminder"] = false,
["extra"] = false,
["modifiers"] = true,
},
["reload"] = false,
}```
wait a sec
no I got nothing
Try deleting it
I'll delete this and retry
I donât think thatâs the problem but this config is all wrong anyway
Can you delete the bit where it checks itâs above 0?
Every other number works?
yeah
Nice lucky guess, I suppose.
How are you typing zero?
Shift + Zero
Oh
just use string.gsub and replace the O with 0
looks same in font
seeds
what's funny is neither of them can appear in natural seeds
so instead of tonumber(config.RedSealsPerCard) i do tonumber(string.gsub(config.RedSealsPerCard),"O",0)?
but in seeded runs it matters
these brackets are off
but yeah
actually no
these can also be numbers
what
just do the number parsing on the input
That is the input
like I said, your brackets are wrong
card.ability.SRSreps = tonumber(string.gsub(config.RedSealsPerCard,"O","0"))
I read that
oh i see
card.ability.SRSreps = tonumber((string.gsub(config.RedSealsPerCard,"O","0")))
Iâd throw an :upper on there too
the extra parentheses should cast it to one return value
I love how the solution to my problems is always some magic that I could have never thought of
the solution is: just add some more parentheses lol
yeah that's stupid
I didn't know about that behavior before reading it in lua docs somewhat randomly
Why does the extended_corpus contain 0 and ) if it changes them before it ever reaches that point anyway
Maybe there needs to be a number_input instead, this workaround is quite unintuitive
I donât think many people will link their zeros being converted to Os
In fact it could just be an argument on the text input to skip over that exchange
I totally think it so too
I was having a stroke for this
are you escaping them
i think Archipelago fixed the text input to input the player slot and whatnot
(Archipelago as in, the mod BalatroAP)
\{ should do
I know, but from some quick testing, I don't need to escape it in js, python or perl
oh wow, it's rust specific actually
and php, js, python, go, C# dont care
neat
Does it have multiple on the same screen?
Yeah I see it now
It does what I was planning for 0 slightly differently but it is functionally the same
wow is it? doesn't regex always have {n} for n repetitions?
Haha, I might've exaggerated that because of my annoyance with my regex testing.
Most languages seem to consider the { (and }) as normal text when it's not valid/not matching?
I tested my regex using both using python and js, and both compiled and matched without issue
Seems like at least java and rust don't do that, and error out when not valid and not escaped
oh no
I wanted them to be aligned vertically
but the gold text and the black row are aligned horizontally
You need to put the text inside its own row
I tried and it ended very badly
maybe the text is too long
no that isn't the problem
What did you change it to?
Hold G and press A and see which node is stretching the display
what the hell
Hi, is there a good "getting started" for modding Balatro?
something like https://github.com/Steamopollys/Steamodded/wiki/01.-Getting-started or are you looking for something else?
also, nice to see bojack
Seems like a decent doc, @tepid crow thank you!
how does #num# in the loc_txt of the modded jokers actually work? I can tell it's referencing the config array by index, but I can't tell why it works through an extra layer of array or why it isn't working for me
it just says +ERROR in the specified boxes ingame for me
scary UI box
how do you check if you have a certain joker?
i use next(find_joker()) but there's definitely something more elegant
i think steamodded added something better i just forgot what that was
SMODS.find_card
I'm finally working on some debug commands
Here's the one's I got planned rn
if anyone things of some other good ones, let me know
i can add it to a list to see
not sure how difficult it would be
actually, I do want you to be able to bind to keys and having a spawn blueprint key would be handy
if you do rank then maybe also do suit
free rerolls can be achieved with infinite money so I dont think that's necessary
spawn tag
probably is a good command
because I dont think debug mod has hotkey for that
set probability
set hand size?
generate & open pack
christ i fucking hate this sound manager thread thing
I'm going insane - can't find the cause why balatro just can't find the card:juice_up function now
it is literally right here (screenshot from the dumps)
maybe because the object is not a card
yeah it could be, but I have nothing that calls or modifies this
well you can add a debug function that can dump you what's in the card
I mean
shouldn't that already be displayed in stacktrace
I dont know
you can go up in stack trace and probably see where this card_eval_status_text call is from
might also be helpful
found the issue! all good
i'm trying to make a new sound manager that runs parallel with the ingame/cryptid sound manager but i have no idea how to debug it
it... probably works? because when i load the sounds as smods objects then both the normal music and my music play at once
this sucks so much
i wonder if a sound manager rewrite is plausible... it's impossible to get a list of sounds via smods tho
im going insane
huh
hey aure can you rewrite the sound manager đ„°
uh what do you need out of it exactly?
playing background music, because Cryptid completely overrides it
this is offcentered and đ
ugh
I patched the hotkey in
What did you do?
load an invalid file with nfs
I mean the crawh handler doesn't seem to have crashed
Or does it crasg right after that?
eh it doesn't matter anymore
might as well do that for packs then? đ€
You could theoretically allow what Cryptid does with music sync to be possible while also supporting unsynced music like Jimball
what's the overridden sound manager actually needed for?
I use it for synced, easing music like with the Program Packs
You can also spawn packs and vouchers in (in the shop only)
SMODS Music library always starts from the beginning of the track and doesnât fade in
hm i should be able to add that
Would be good to allow for both
Well any kind of crash handler crash should be fixed cause then there's no crash handler at all
Yeah then I can remove all the sound_manager.lua jankiness
can you point me to the relevant code for syncing in cryptid?
literally just sound_manager.lua
Which is the vanilla sound manager but slightly modified to load from Cryptidâs files
It also automatically pitches down which theoretically you shouldnât need to do except for the vanilla music
oh yeah the default smods music stuff doesn't pitch down the music when game over'd
this, too
I'd add a bit of a spacer between the check boxes and the button personally
that one is especially annoying because my stuff are bosses
alright I think the current sound API just bypasses too much of the sound manager, I need to integrate it better
đ„
here's a lot of spacers
Maybe make it red so its very glanceable?
oh good shout
Whatâs disabled?
Also I donât particularly like the floating, dark âdisabledâ text
the entire object
I prefer the text being visible. Iâd do the disabling with a shader and sprite (like Undiscovered, Debuffed, etc.) and maybe a badge
As an user, Iâd like to know what the items do before enabling them
If I enable then change my mind Iâd have to go back to the config
oh in theory now that we have configs i can move my abnormality unlocks to that
saving configs on demand is SMODS:save_mod_config(SMODS.current_mod) right
is there a tutorial on balatro modding? I'm a beginner coder that loves making joker ideas so to see them in the game would be wonderful
also it will help me in my comp sci career
#1264841732730916974 can give you a headstart
wherever you've saved SMODS.current_mod locally
thank you
I will begin beginner coding hell some day
#âă»modding-general message
some base game jokers redone in steamodded
and of course, extract the game executable for the source code and look at other people's codes
am i doing something wrong uhh
oh hm. is it actually SMODS.save_mod_config instead of SMODS:save_mod_config
yeah it's a dot
also where do you save SMODS.current_mod originally
this better?
Still a bit WIP, but, I also have this mod which has vanilla jokers made in SMODS, and is commented to hopefully explain most things to beginners.
ok thank you
I will credit you if i ever make the mod
Absolutely no need, it's meant to go into the Steamodded example mods eventually.
oh seals have so much missing functionality D:
it's in VERY early development since I came up with the idea today and we're making ideas for jokers
i have 2 mod ideas which i could mash into one
one is a mod where it makes a bunch of jokers based on the blinds in the game (including 5 new legendaries from a new the soul like spectral card that are based on the final boss blinds)
and another is a mod that adds an upgrade spectral card, which makes upgraded versions of all the jokers (best idea but most work)
that along with a bunch of other unique jokers
I'm thinking i name upgraded chicot "cheat code" for the funny
https://discord.com/channels/1116389027176787968/1239704177584771080
The first one has been done before, save for the final boss blinds
Second one sounds cool too
combination it is then
some funny ideas I've come up with
the legendary boss joker for cerulean bell is called ring for service, and it activates diamond cards again and makes a bell noise when it does. Its upgraded version is a meme soundboard that plays random meme sound effects on every repeat it does on a diamond card
the hack actually has 2 upgrades, hack'd the system, where he got famous off plagiarism and didn't get caught, and laughing stock, where the card art is just the hack reading a callout post about him on his computer
I guess, but I still don't like it. I don't have the time to think of something to suggest right now.
@wintry solar I'm trying out VSCode for Lua. How can I make the globals defined by the game, and thus not my mod, not show up as errors to the Lua extension? (Besides manually marking each of them)
I believe if you add the folder of the game code to your workspace it'll automatically find them
Can I do it without adding the folder to my mod's folder?
what sort of things are being called as errors?
huh
add the balatro source or lovely dump into the workspace
did you add ALL of the source?
it doesnt do that for me so shrug
I had already done so
tried a restart?
for love you might need the love2d support extension
I don't have a love extension
any ideas on how to disable used consumables moving to the middle of the screen?
problems with this
I'm not skilled enough in coding, but i want coding experience
I'm not skilled enough in art for making over 150 new joker designs, but i like making art so that's ok if i can at the very least find a mentor to clean up my art
BIG PROBLEM: I have next to no dedication to a single thing for more than a week at most, especially if it bores me
Solution
I become the ideas maker (along with my friend in the server), overall manager, and a helper in all the different things we need, and hope a people like my ideas enough to work with my incompetent ass
or i just learn a bunch of time saving loopholes for all this stuff
i do know keep on use keeps them in their area
but its probably now what you are looking for
that being said, I want to post the google doc with the ideas somewhere. where do i do it?
oh wait modding forum
I'm a dumbass
I figured it out đ
what the
doin'
lmao?
I wonder if the reason AnimatedSprite doesn't work for Cards by default is because of thunk's spagetthi code
It wouldnât surprise me
@mellow sable do you have any comments, since you reimplemented animation for Jimball and Aura?
that is just treating SMODS as the mod object
tbh I just didnât try using it
And because doing it manually works Iâve kinda rolled with it (literally)
I know it has issues I just havenât tried to know what the issues are
For Aura it wouldnât make sense because it needs a lot of customizability. And then Jimball is Jimball
eh I think it doesnt work for cards by default because he didnt need to use it for cards
Obviously thatâs the philosophical reason, but whatâs the physical reason
thunk spaghetti
Yes but whatâs the spaghetti
all of it
everyone writes shit code so 
But whatâs the shape of the spaghetti
Write code like your future self lives in your walls and has a machete
at least death will be quick 
moment