#💻・modding-dev
1 messages · Page 67 of 1
yeah pretty sure it doesn't exist
@wintry solar how's the texture mod going
Haven’t done much work on it recently, it currently words for just jokers with the priority system we were discussing. I’ve been figuring out what I want the selection UI to look like, that’s my next step before extending it across other objects
texture mod?
I have commented it before but I think you can take inspiration from Minecraft's UI. Maybe Balatro-ify it by making it into a CardArea where you can organize Cards that represent the textures
Yeah that’s what I’m doing just workshopping some different layouts
wait does apply_to_run exist
yes
It exists for decks yes
wrong syntax
Actually, despite the confusing way of writing, I think the syntax might be correct
Even if it doesn't seem to make sense
no this is horrendously written
Holy shit..
I have never made a back before
I was just commenting on the syntax because I thought the number of ends didn't match, but on second look I think they are correct in number
but the semantics…
Imma look over some more code
one of those ends is to close apply_to_run
like Victin said, syntax seems correct, even if the code doesn't
^ yeah please get one
what do you recommend
Name: StyLua
Id: JohnnyMorganz.stylua
Description: A Lua code formatter
Version: 1.6.3
Publisher: JohnnyMorganz
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.stylua
and just paste this file into the root of project directory
the what
the base
yk like
<mod_directory>/<mod_files>
for example:
also make a folder called .vscode and place this file inside of it.
that way the formatter will run on save.
tab size of 2???
spaces
not sure if "editor.tabSize": 2, is even doing anything
bc it gets overwritten
I mean, consistently 2 spaces is better than inconsistent at least
I think that's controlled by VSCode yea
spaces >> tabs. space size 2, google formatting is best.
I go between 2-4 spaces per tabs depending on if it's filled with Thunk UI nonsense or not.
...
it's just more compact than 4
Thunk is fancy, sometimes he uses 4 and sometimes he uses 2
as long as it's space , doesnt really matter
I know 😭
..why exactly do i need a formattor?
so this #💻・modding-dev message formatting doesn't happen again
makes it easier to read code. Makes it easier to maintain code. makes it easier to debug code.
makes it easier to get help from people.
makes a LOT easier for other people to read your code
makes it easier to understand code.
like i downloaded it
ok
and add this into ur project
then do this, for on save formatting.
unless u want to manually run format it every time
where exactly?
the root directory
for example
the mod directory/ur mod name/
where ur code is basically
print debugging is for noobs. we crash the game on purpose in here
error():

I gotta add this to Cryptid at some point lmao
xD
Some of the code is formatted SO BADLY
The Misc.lua file is a mess
I'll likely not use for my project because I already ingrained good formatting practices.
and none of the mods are collabs so nobody has a reason to look under the hood.
🤫
The create_UIBox_options hook that literally has no tabs or spacing whatsoever:
my editor auto-formats tabs and stuff
though my indenting is all tabs which may be debatable
😭
give it a proper localization
what the hell
i can't read that
good news
it now comprends the fact that it's supposed to boost packs
bad news
it crashes
mod creator forgot what a line break was
huh
A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a sequence of characters, is used to signify the end of a line of text and the start of a new one.
I’m dead
Bro maybe u need to read up about like computers 😭 u didn’t know what the root directory was before 😭
pasting wikipedia articles with no explanation is my favorite flavor of passive aggressiveness
Common ai goku l
😭💀
yeah i don't know what I did but it works now i guese
I made a modified version of tprint because I got so fed up with it just not "printing" stuff that wasn't a table
so now I can always do sendDebugMessage("var = " .. tprint(var)) regardless of the type 😌
doesnt steamodded have something for that
does it??
swear i heard someone say it does
if type(table) ~= 'table' then
return "Not a table"
hmmm, not exactly what I need lmao
why would you run inspect_depth on something thats not a table though
sometimes I just need it to print
I could also use tostring but then I can't read table output
even then, you can just do like
tprint = function(thing)
if type(thing) == "table" then
print(inspect_depth(thing, 10))
else
print(type(thing)..", "tostring(thing))
end
i think jenlib has something similar that doesnt require a depth input and just doesnt repeat recurring tables
... Yes thats basically what my tprint is?
i thought you didnt know about steamoddeds inspectdepth...?
Oh. No, I didnt
it's basically just inspect_depth but with custom depth
here it is, if you care
local function tprint(tbl, max_indent, _indent)
if type(tbl) ~= "table" then return tostring(tbl) end
if not _indent then _indent = 0 end
if not max_indent then max_indent = 32 end
local toprint = string.rep(" ", _indent) .. "{\r\n"
_indent = _indent + 2
for k, v in pairs(tbl) do
toprint = toprint .. string.rep(" ", _indent)
if (type(k) == "number") then
toprint = toprint .. "[" .. k .. "] = "
elseif (type(k) == "string") then
toprint = toprint .. k .. "= "
end
if (type(v) == "string") then
if k == "content" then
toprint = toprint .. "...,\r\n"
else
toprint = toprint .. "\"" .. v .. "\",\r\n"
end
elseif (type(v) == "table") then
if _indent > max_indent then
toprint = toprint .. tostring(v) .. ",\r\n"
else
toprint = toprint .. tostring(v) .. tprint(v, max_indent, _indent + 1) .. ",\r\n"
end
else
toprint = toprint .. tostring(v) .. ",\r\n"
end
end
toprint = toprint .. string.rep(" ", _indent - 2) .. "}"
return toprint
end
also removes the "content" key for some reason
I think that just reprinted my entire mod's code again
There is definitely a better way of writing this 😭
i added a joker!!!
now its time to figure out how to do uh
literally everything else 😭
how does one test a joker they've made
without like going into a game and trying to find it
DebugPlus
Can spawn jokers from the collection by pressing 3 and has a bunch of other stuff for testing stuff
ah ty!!!!!
probably the most cursed bug I've encountered so far modding this game
😦
infinite ranks mod?
That’s easy
Just make a 1.2 card
a continuous ranks mod would be so cursed oh god 😭
all cards in between ace and 2
is there an easy way to reset the size of the sprites of a joker before doing more things with it, so you start with a clean slate?
because reapplying the size changes messes things up
can't you use dimensions from atlas
or what do you need exactly
I’m replacing the sprite of a joker completely, an arbitrary number of times
But it runs into the same bug that you see when spawning a resizing joker in debug mode
nice! and he talks xd
is there a way to look if the player finished a blind?
i cannot seem to be able to find it :(
For jokers?
nope no joker
Maybe check around the payout function
good idea
what the heck does this mean
lmk if you find anything better
lol
local function tprint(tbl, max_indent, _indent)
if type(tbl) ~= "table" then return tostring(tbl) end
_indent = _indent or 0
max_indent = max_indent or 32
local indent_str = string.rep(" ", _indent)
local toprint = indent_str .. "{\r\n"
_indent = _indent + 2
for k, v in pairs(tbl) do
local key_str = (type(k) == "number") and "[" .. k .. "] = " or k .. "= "
local value_str
if type(v) == "string" then
value_str = (k == "content") and "..., " or "\"" .. v .. "\", "
elseif type(v) == "table" then
value_str = (_indent > max_indent) and tostring(v) .. ", " or tprint(v, max_indent, _indent + 1) .. ", "
else
value_str = tostring(v) .. ", "
end
toprint = toprint .. string.rep(" ", _indent) .. key_str .. value_str .. "\r\n"
end
return toprint .. indent_str .. "}"
end
There's some good stuff in here.
- I like the
key_strandvalue_str, this is probably easier to parse mentally - I see you've gone for a lot of ternaries. The shorter ones are really nice (love the
_indent = _indent or 0stuff!), but some longer ones are becoming really hard to read imo - I like
local indent_str = string.rep(" ", _indent), it's just unfortunate that you have to usestring.rep(" ", _indent)later anyway, so I don't really see the point of it?
I've combined some elements and cleaned some parts up a bit. This is what I've ended up with:
local function tprint(tbl, max_indent, _indent)
if type(tbl) ~= "table" then return tostring(tbl) end
max_indent = max_indent or 32
_indent = _indent or 0
local toprint = string.rep(" ", _indent) .. "{\n"
_indent = _indent + 2
for k, v in pairs(tbl) do
local key_str, value_str
if type(k) == "number" then
key_str = "[" .. k .. "]"
else
key_str = tostring(k)
end
if type(v) == "string" then
if k == "content" then
value_str = "..."
else
value_str = '"' .. v .. '"'
end
elseif type(v) == "table" and _indent <= max_indent then
value_str = tostring(v) .. tprint(v, max_indent, _indent)
else
value_str = tostring(v)
end
toprint = toprint .. string.rep(" ", _indent) .. key_str .. " = " .. value_str .. ",\n"
end
return toprint .. string.rep(" ", _indent - 2) .. "}"
end
Looks good
I experimented with some other stuff, but ended up feeling like it didn’t make it more readable
There wasn’t as much to change as I thought there would be tbh
I thought there’d be a nice way to remove the if type == table etc, but it didn’t really end up being that nice
how would i be able to check if a boss was defeated?
Hey! I've been trying to make a localization mod with the italian community feedback based on the Better FR Localization mod, but that isn't compatible with Steamodded 1.0.0 Alpha anymore and I don't get how to load the custom it.lua through steamodded 
latest steamodded should load your localization file from localization/it.lua automatically so long as there's a mod file with a valid header
This worked automagically, thanks a bunch!
yall how do i make my own ability, like what cryptid does with its rigged sticker?
not sure how or where to set one up
look at what cryptid does with its rigged sticker and copy it
generally the solution to everything is to copy other peoples hard work take inspiration from those before you
sticker api is good for this, tbh
and Rigged is a good reference
im using stickers, just cant seem to get the sticker on a card using a consumable
rigged has been a good ref tho 🙏
sticker api is undocumented though right
i checked github there doesnt seem to be anything there in any of the related sections
i guess so, then
i often like going into the steamodded source code to see how it's defined, though
but docs are lagging behind a bit
ohh
is it ok to have my own atlas for the stickers? or should i just call the spritesheets sticker(s).png
nvm urs is called something else so imma guess not to use the same name
can someone tell me what's going on with this cause i've been trying to figure it out, the description just says +nil, i feel like i set the var wrong but i don't know how
card.ability.chips is set when calculating (which is when a hand scores), and when you hover on it it hasn't been calculated, so card.ability.chips is nil
this seemed to work!
okay, i haven't used steamodded at all since 0.9.8
how on earth does 1.0.0 actually work
lua objects
well i gathered that
Doing a little trolling
alright time to figure out why my lua mod wont even be registered by steamodded
Do you have the header
Sounds about right
S?
Yea, it's "MOD_AUTHOR" not "AUTHORS"
m author
is there a way to apply a specific edition to a joker using debugplus?
q
brilliant.
i still don't know who paul is
shoutouts to Paul
Who is paul?
Paul
also; a nerf to coupon catalogue(?)
well not really a nerf
it was just a really broken common
More Fluff update let's go
Pogging
there probably won't be any new content
apart from new colours for cryptid and familiar(?)
and maybe ortalab
finally useful
(i should make that say slots if if gives more than 1)
you might also be interested in making some MoreFluff Sleeves? 🙃
i was going to do that as well yeah
💙
the world if loc_txt was a function (nothing would be different)
oh god how on earth is hammerspace colour cards gonna work

tbf you can probably add separate loc strings for plural and singular
then in loc_txt use localize(key), while choosing key based on if it's plural/singular
oh right and potentially jokerdisplay support
there are no decks in morefluff right
there are four
then maybe card sleeves?
yeah im gonna do that
oh boy, what fun
probably quite strong with some of the cryptid / jens stuff actually
Bound to happen
coding separate strings for singular and plural does make the mod a bit annoying to localize because singular/plural rules differ from language to language
ayo even more fluff
Haha I literally just asked him #💻・modding-dev message 😅
i wish there was a mod that loosened the movement on cards, make everything jiggly just for the funny
based on the artifact you get when the game's FPS is horribly low
When Cardsleeves' card sleeves?
nah thats crazy
trying to load a .toml patch and this error shows up even if the payload is completely empty what do
this is the entire file
just out of curiosity what are u trying to do? :P
trying to make a boss blind that triggers an effect during the final scoring step and this was the best way that i found
if you find a better way please let me know
just use if args.context == 'final_scoring_step' then (add code you want to happen)?
yeah but it still needs to be in a function i think
i mean it balances the chips and mult? thats something a function does right?
and you can use "args.context == 'final_scoring_step' your self
maybe try to use it to print a number
yeah but that's a part of backs.lua and im not sure if its gonna work
i will experiment later
does it have to be at the end of scoring step or can it be at the start of next hand
Bruh imagine reading
reading comprehension failure
I mean I understand it, but I didn't read it
is custom ui hard to do at all? i mean, it's definitely a little complicated to figure out how to work the code to actually create it, but im more talking about the ease of being able to actually make stuff once you already know how to do it
like settings?
and after that we need cardsleeves'sleeves cardsleeves!
but i do too seems fun to add your own shop thingy or counter or sum 🤔
it needs to be at the final scoring step specifically
oh right, finally an antisynergy with double scale
every food joker ever:
well yeah
oh do you mean just that mod
it kinda reads like you lose money, not the joker
might just be me
yeah true
maybe change the text to "decreases by _"?
yeah i've changed it
a badge isnt appearing when i add a sticker to a playing card
but it appears if i add it to the info.queue of a consumable
how do badges appear on playing cards?


I love autism creature
true
so what mod are you developing
its in my name
oh good point
its more like an ipairs thing
ah
If you want to call one of your modded joker it usually goes as j_<mod_prefix>_<joker_key>
^
that might be the problem
i havent messed with events so idrk if theres a problem in there
Also you should prob rename that local var in your event since card already exists
true
so j_othe_mig_bac
ya
what in the heck
¯_(ツ)_/¯
What if you play with your mod and Steamodded alone?
you also seem to have 2 instances of DebugPlus loaded at once
Also this feels so wrong..
the name, the chance what?
I asssume 1/1
1/1 doesn't work?
what
elaborate
Super late reply, but I think once you understand the system, and I mean properly understand it, it’s fairly easy to make stuff
I have a partial write up of it somewhere in here if you can be bothered to find it
where's the documentation for modding jokers?
how do badges work on stickers?
i cant seem to get a badge on playing cards when i make their ability a sticker
like cryptid's rigged sticker
How do I check if a card is a certain value?
if you want like 2=2, 10=10, J=11, K=13, A=14 then card.base.id
No, I just wanted to check if a card is an ace
Now I just need to figure out how to double the mult.
Huh?
Did you just update to the latest lovely beta perchance?
Yeah?
I started having failed to collect file data for Atlas since I did aswell so that might be a bug
Fun
SMODS.Atlas({
key = "modicon",
path = "icon.png",
px = 32,
py = 32
})
local function apply_sprites()
--sendDebugMessage("Sprites Maca")
SMODS.Atlas { key = "Booster", path = { ['it'] = 'boosters.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "Tarot", path = { ['it'] = 'Tarots.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "Voucher", path = { ['it'] = 'Vouchers.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "icons", path = { ['it'] = 'icons.png', }, px = 66, py = 66, prefix_config = { key = false } }
SMODS.Atlas { key = "Joker", path = { ['it'] = 'Jokers.png', }, px = 71, py = 95, prefix_config = { key = false } }
SMODS.Atlas { key = "blind_chips", path = { ['it'] = "BlindChips.png", }, px = 34, py = 34, prefix_config = { key = false }, atlas_table = 'animation_atlas', frames = 21 }
SMODS.Atlas { key = "shop_sign", path = { ['it'] = "ShopSignAnimation.png", }, px = 113, py = 57, prefix_config = { key = false }, atlas_table = 'animation_atlas', frames = 4 }
end
apply_sprites()
sendDebugMessage("Maca_BIT: Balatro Ma Meglio - LOAD")
I'm using this code to change the textures for the italian locale which has been working fine, but it crashes with a concatenate local file_path (table) error whenever I try to change language. I guess it has to do with the SMODS.Atlas tables but idk what's wrong, any clues?
I want to start making mods for the game, where should I start?
Well, if you're on the latest beta for LOVELY, maybe hold off.
If not, check https://github.com/Steamopollys/Steamodded/wiki/05.-SMODS.Center
It has the basics for stuff. You can also rummage through the base game's code and maybe take stuff from there, but be warned, it's not easy.
Ok thanks I’m starting development on an ai using enforcement based learning and I thought Balatro would be a cool thing to test it on
ngl that indeed is cool
asking again
Having this crash when changing language
Looks like an NFS error to me
----------------------------------------------
------------MOD CODE -------------------------
G.F_NO_ACHIEVEMENTS = false
local MOD_ID = "Better_IT"
--local lang_path = SMODS.Mods[MOD_ID].path.."it.lua"
SMODS.Atlas({
key = "modicon",
path = "icon.png",
px = 32,
py = 32
})
local function apply_sprites()
sendDebugMessage("Sprites Maca Load Debug")
SMODS.Atlas({ key = "Booster", path = { ['it'] = 'boosters.png', }, px = 71, py = 95, prefix_config = { key = false } })
SMODS.Atlas({ key = "Tarot", path = { ['it'] = 'Tarots.png', }, px = 71, py = 95, prefix_config = { key = false } })
SMODS.Atlas({ key = "Voucher", path = { ['it'] = 'Vouchers.png', }, px = 71, py = 95, prefix_config = { key = false } })
SMODS.Atlas({ key = "icons", path = { ['it'] = 'icons.png', }, px = 66, py = 66, prefix_config = { key = false } })
SMODS.Atlas({ key = "Joker", path = { ['it'] = 'Jokers.png', }, px = 71, py = 95, prefix_config = { key = false } })
SMODS.Atlas({ key = "blind_chips", path = { ['it'] = "BlindChips.png", }, px = 34, py = 34, prefix_config = { key = false }, atlas_table = 'animation_atli', frames = 21 })
SMODS.Atlas({ key = "shop_sign", path = { ['it'] = "ShopSignAnimation.png", }, px = 113, py = 57, prefix_config = { key = false }, atlas_table = 'animation_atli', frames = 4 })
end
apply_sprites()
sendDebugMessage("Maca_BIT: Balatro Ma Meglio - CARICATA")
------------MOD CODE END----------------------
----------------------------------------------
how do i fix an ipair error
dude we have no clue what you mean
can you like at least say what the actual error is
chances are the issue is that you have no idea what you're doing 💀
You mean the crash error I encountered? That's kinda relieving haha
yeah
Looking forward to future updates then, thanks for letting me know 👌🏻
how this guy feels after repeatedly asking how to fix an ipairs error without giving any context whatsoever
Common AI Gen Goku L
I'll give it later
brother is biding his time
and im repeatedly asking how get a badge on a playing card when setting its ability to a sticker with a consumable 🙏 (like cryptid's rigged sticker)
that should be happening automatically unless you somehow copied no_badge from the vanilla objects
that's what im sayin
im just using the sticker objects so it should make a badge
I can make a badge on the consumable using the sticker's data so
¯\_(ツ)_/¯
reposting this here, jankman buff
Is the .31 a ref to something?
it's not a round number, jank
nice
can someone inform me how card_eval_status_text() works?
nope i have no clue but i could tell you if i spent 10 minutes looking at the code and so could you
brutal 😭
nah what the hell 😭
ok time to be actually helpful
this is how i figure stuff like this out
i use VSC with an extension for lua (google lua for vsc) (sumneko)
what i do is i right click on that function and click "find all implementations"
then a sidebar pops up like this image that ive attached
i can click on these and itll show me everywhere where that function is written
generally you want to look in two places
-
(this only applies to stuff found in the vanilla source code) the lovely dump of the source, this will show what the original function looks like after lovely patches (.toml files, replaces stuff in the code pre-compilation), this will be in Mods/lovely/dump/ (idk if these only generate when you crash). this shows you what the code looks like after these patches are applied. so what i see here is that this is the code that applies those "Again!" or "+4 mult" popups you see when a joker is scored
-
all the mod patches that arent applied through .toml files, which you can see here. for example, I can look at nopeus' patch here and see that it looks and sees if in your settings for Nopeus youve specified that for example you dont want to see the Again! popup when a card is retriggered, and if you have then it wont do anything.
if you have your code in vscode you can also use the search tab on the sidebar to seardch though all the files
might also be useful to see how its used
^
quick question, did you manage to fix this Failed to collect file data for Atlas ...?
i personally just do the same right click thing and hit "find all references" when i want to do that though
I wish
But nope
I usually just use grep from the cli to look for the right file
the context
and whats the error
is there an easy way to get the position of a card in the played hand
what if it's an ipair error
it just crashes instead of making the joker
without making a separate for loop that is
G.played_hand[i] I believe, I may be wrong
yeah i give up on you
I being wherever u want
bruh
that gets the card but i need the index from an element
let me pull up the error screen
i don't think there's a way from what I've looked up
might need a loop for that then
unfortunately
Code & error. Is there anything I can do on my side to fix this?
In your SMODS.Atlas, add raw_key = true
What's your version of lovely?
beta7
Try reverting to beta6
beta6 has the same issue
What is wrong with LOVELY to where it's crashing like this?
had someone else with that same error
lovely-beta7 also wasn't the cause
unfortunately, the solution there was to rip the entire atlas out of the mod, which isn't really a good one...
Whats the name of your file in assets/1x
Make sur the file's name is 1:1 with your atlas key
Fixed (Removed raw_key = true)
Now how do I check to see if a card is an Ace
Lil tutorial: when you ask yourself questions like "how can I do x", your first thought should be "Are there any vanilla jokers that does that". For your example you could check "Superposition" or "Scholar"
For anyone else wondering, it's context.other_card:get_id() == 14 according to the main game.
Careful of what needs to be put behind :get_id() == 14 depending of the context
hey, I was looking to skin a few cards, is there an easily usable template for that out there? im not really familiar with modding games
Now how tf do I make it double the mult every time it's triggered?
What's the joker effect you're trying to achieve?
Every Ace doubles the mult.
The Mult as in the mult in the left?
Yeah
There's a global var called "mult"
oh did I misunderstand 🤔
I assumed it was "if Ace is scored, x2 mult"
Yeah, whenever an ace is scored, double the mult on the left
Just say "x2 Mult" lol
I said "mult on the left" cuz I had a brainfart and didn't realise sooner somehow
have you defined self.ability.extra for this joker
no and I don't know where to do that
alright, but how would I make it double the mult?
Just set up your extra value as 2
which I did at line 34?
balatro font in vscode is both blessed and cursed somehow
you gotta set it up like this
i think?
Damn...
But yea doing that should be enough
ye
Oh right there are multiple context.individual
You'll have to be more specific in your context check
try adding "and not context.repetition" after context.individual
apologies for not using the code block format for i am on mobile
Also check for context.cardarea == G.play
yeah
Fixed, behaves perfectly.
hooray!
Pretty sure your arguments for create card are wrong
Anyone have a guide on how to color the text?
{C:color}your text here{}
you can find all the descriptions with colors in en-us.lua
What folder is it in?
localizations
Well, I took {X:mult,C:white} X#1# {} Mult, but now my joker shows Xnil
you gotta define a loc_vars
see https://github.com/Steamopollys/Steamodded/blob/main/example_mods/Mods/ExampleJokersMod/ModdedVanilla.lua for some in-depth examples
so if I just wanna have the x2 show, what would the loc_vars look like?
did you look at my link and not understand or are you just asking
just asked
go look at the link
I just won a game and this crash happened, after restarting the game and winning in the very same way it didn't replicate
yeah i remember getting that often too
I think it's a steamodded issue itself i'm not too sure
"My" mod DeFused https://ptb.discord.com/channels/1116389027176787968/1271500476457812120 Has an issue that the original Fusion Jokers also has where Collectable Chaos Card doesn't give its rerolls properly. I've not been able to fgure it out, and would appreciate any help. As far as I know, besides a newer issue that I think will be pretty easy to fix, it's the only functionality-impacting bug I've come across that's left
Is there any good documentation on creating custom enhancements? I'm wanting to try and replicate the effect of negative edition for playing cards with a custom enhancement, but I haven't found anything particularly helpful yet.
use find_card(key) instead of find_joker(name)
I should note that this is a 0.98 mod, in case that changes things
oh
Yeah, it's just a straight modifcation of the Joker Fusion codebase
does anyone know how to change base mult with a joker?
before cards are scored btw
wdym by "change base mult"
change mult before cards are scored
You could use some specific contexts or use the SMODS.eval_this function
context.before I think could work
god damn you talisman
hey people, I'm not very good at code but I am curious
been running into a bunch of issues, does anyone know if there's a joker that triggers on hand drawn like that or something. I'm trying to make mine give you additional draws but its been hard. tried playing with changing hand size but if there's a way to just make it draw additional cards on hand draw that'd be good
it'd probably be easiest to take two variables from two different things
take something that has an effect when played (ex. +mult when "x" card is played) and something that makes you draw cards (probably cryptid)
or if it works, idk if it will
DNA
mhm I got the scoring part down, it just looks for a wild card on scored hand and gives you your extra draws, its a hazzle to make it work with having to move the hand size around though
kinda, but like, on every draw, just not the initial one
what are you trying to do?
"if scored hand contains a wild card, draw 4 additional cards next draw"
not exactly the same but you could make it similar to dna but just draw 4 negative cards from your deck
problem is that DNA "draws" before normal hand draw
mhm, that's the issue I encountered , if you make it draw before your proper draw you will get no additional cards. I managed to make it work by changing hand size but if that's the case I still need to check after you draw your hand to lower your hand size(plus at end of bind)
patch whichever function draws cards and either make it subtract 4 from your hand size when it finishes if your joker saw a wild card played last hand, or just make the for loop run 4 extra times if it saw a wild card played last hand
looks like the game doesn't emit an event for any new hand
bummer!
but if you wanted to you could do a lovely patch in game.lua for Game:update_draw_to_hand
when would I trigger this action if I may ask?
I'll try that, thanks for the help
dunno, i haven't looked into anything like this and i can't right now, that's just a general idea of what i would try to do
actually you might want to instead hook G.FUNCS.draw_from_deck_to_hand in functions/state_events.lua to just increase the hand size
just to check, if you guys know, is there a way to fetch how many cards in hand and the player's current handsize? cuz if so there's a very simple way to do this
check CardArea file
that's the skeleton your hand uses
should be some sort of reference to a maximum in there
and how many cards in hand is just #G.hand.cards
aha, I got it! many thanks all you people
Yeah I was thinking you could chsnfe the card area size but it would be hard to undo reliably
I figured out a solution, if the joker triggers just make it check cards in hand, plus your current hand size (which was way simpler than I thought) and just make it draw the delta *plus the extra cards I need and boom!
you guys mentioned cryptid had a card that let you draw on extra right? (if its fine to peek into their code)
yeah that'll probably work
all the other ones that affect draws just change hand size iirc
alright, many many thanks, it worked like a charm
anyone know if Card:release is used at all?
ive hooked a print thing to it and it is not printing anything
it might inherit it from something else
based on a quick grep Node and UIElement have it
does nothing get patched to node?
damn]
i havent got the source code on my laptop im gonna have to grab that quickly
if you were gonna have a check for when a joker is moved tho what would you do??
i had something in the update thing for my joker but thats causing issues
Does moving count when a new joker is added to the area?
i guess yeah
Idk how does blueprint/brainstorm update their descriptions?
I mean are you able to just check anywhere you need that info when you check it
Or do you need to react to it?
sorry i didnt really explain what im doing
tryna debuff the joker to the left of my joker
There is maybe some kind of event in the card are you could hook
Otherwise you might be able to just get away with an event that check every frame
apparrently checking every frame is causing the game to freeze up
so ill keep looking for other things to hook to
Are you using an event?
Try spawning an event. Return false to have the event rerub next frame
I'm on my phone so I can't pull an example
no worries
thanks for your help
if im getting the event to rerun each frame should i just create it when the joker is bought
i take it its not a good idea to create a new event each frame
kind of a weird "event" if it's triggering every second
events just let you do that, and its every frame
ah sorry, was thinking about evaluation trigger events
probably something like thislua G.E_MANAGER:add_event( Event({ trigger = "immediate", func = function() if false then -- do check for if your joker no longer exists -- Probably remove all debufs return true end -- figure out which joker(s) to debuff and rmeove/add debuffs here return false end, }), "other" )
not sure which event queue would be best for it
side note I think the event queue is my favourite system in balatro
its such a well made and useful system
and makes things like the joker events so simple to follow
the base queue would probbaly make the most sense
maybe make it non-blockable
yeah
and the ability to rerun events
which makes it stupid simple to wait for something
also I was able to hack it to run my event every x seconds
oh that's pretty neat
you know is it possible to make it so whenever a joker/card triggers, it does a flip instead of just shaking normally?
yeah it should be possible
that would be funny to try one day
should be pretty easy to do. Just replace juice up with a flip animation.
i might try that when i get home that sounds like a fun mod to do as my first
what program do you use to open balatros source code?
7zip can extract it
yeah you can just open it with winrar too
I extracted it but It wont open
G.E_MANAGER son or G.update daughter
is there an easy way to update the text on a card
wdym?
like if you had a joker and wanted to change the text it displayed
like in the tooltip?
iirc you just use localization variables and set the text there
yup nice
can somone tell me why it shows twice and how to fix it
howd you open that menu
with debugplus, hold tab
:o that chip requirement
remove card eval status text?
i should post my cryptid stuff more often
Game just silent-crash. How can I get logs for debug?
in your Mods folder there should be lovely > logs and from there you can find the most recent dated one
thats odd
that should still crash normally
any chance you have a way to replicate that
wonder if the crash handler is doing something wrong
neat
and also
the card should be upside down to make an A
literally unplayable
oh right i should ask
are temporary playing cards a thing in steamodded? or do you still have to do it manually
hell yeah
no.
yeah it's fine the old way still works
doesn't love not really have a crash handler? afaik you only really get a luajit exit code when it just full crashes
Love does but we override it in steamodded (and thunk overrode it in baaltro itself). However, if the crash handler crashes then the game just closes so the game just closing on a crash might be a sign that something is going wrong in the crash handler
Though iirc there are crashes that it can't catch, like if something in c land crashes
uhm yeah lol i did not mean the inbuilt error handler
now where have i seen this before
2 ?! wow
Hello! Just joined the discord to look into working on and contributing shaders. I have fairly good knowledge of GLSL, but never worked with Love2D or anything to do with modded Balatro. I've found the links to the Love2D Beginner's Guide to Shaders and Steamodded example mod shaders. What I'm wondering is what, if any, dev environment people use to work on shaders? Like a standalone Love2D project that just quickly loads some example cards for you to preview the shaders, or a mod for the full game that does something similar. Or if there's any other tips people have to make editing shaders easier.
best way to do it I think would probably be gips to at least test it pre Love conversion and then just a mod ingame
@west lion sorry for ping
because it's a 2 step process from coding the actual GLSL proper to then porting it to LOVE2D
Ping is appreciated, thanks!
and you can easily I think test it with a custom edition, see if it looks good, if it crashes, so on and so forth
is there mod/shader access to the background? for when opening modded booster packs or special events
I believe certain mods have done custom colors before (cryptid) but not too sure on the shader side of things
There isn't such project, not that I know of, at least, GIPS doesn't use the exact syntax love2d does
I'm just using GIPS for shaders preview
I assume that in order for changes to the baground shader to be made, you'd either have to entirely replace it, or modify the original, which would mean effectively redistributing source code
and then a mod in game because as long as you register it correctly it pops up on the collection
background shader can be modified within the game
as it has a bunch of configurable parameters, such as colors and amount of swirl
it would be fun to entirely replace it though, just expose the same uniforms that the original does but do different things with them
that is possible too
that would also be possible so long as it's compatible with what the base game sends to it (or you also modify the parameters)
well
i think i know how
^
G.SPLASH_BACK:define_draw_steps({{
shader = 'splash',
send = {
{name = 'time', ref_table = G.TIMERS, ref_value = 'REAL_SHADER'},
{name = 'vort_speed', val = 1},
{name = 'colour_1', ref_table = G.C, ref_value = 'BLUE'},
{name = 'colour_2', ref_table = G.C, ref_value = 'DARK_EDITION'},
}}})```
for the main menu im p sure
that's the splash shader, not the background one
yeah, it looks like Love2D calls GLSL uniforms externs
G.SPLASH_BACK:define_draw_steps({{
shader = 'background',
send = {
{name = 'time', ref_table = G.TIMERS, ref_value = 'REAL_SHADER'},
{name = 'spin_time', ref_table = G.TIMERS, ref_value = 'BACKGROUND'},
{name = 'colour_1', ref_table = G.C.BACKGROUND, ref_value = 'C'},
{name = 'colour_2', ref_table = G.C.BACKGROUND, ref_value = 'L'},
{name = 'colour_3', ref_table = G.C.BACKGROUND, ref_value = 'D'},
{name = 'contrast', ref_table = G.C.BACKGROUND, ref_value = 'contrast'},
{name = 'spin_amount', ref_table = G.ARGS.spin, ref_value = 'amount'}
}}})```
yeah it says it in their beginners guide
someome remind me to look into this, I might be able to make something quick that would be helpful for debugging shaders in game
yay!
isn't there a debugplus button to reload atlases? does that not reload shaders
tbh havent tested, I thought shaders compile on startup only
i would think so too but it's worth a try
Having a weird issue where the game is crashing on retrigger due to inability to call juice up
the issue is that my joker shouldn't be juicing anything up? do i need something for the card to do when it retriggers or something?
yeah
its one that causes the cards to jiggle
wait i figured it out
swing and a miss i guess
I think it is just atlases
I just do the same thing as toggling the pixel scaling option
Hello guys, I am new to modding, is there a place where I can lookup all the G Variables
For example, I want for a joker to give #1# mult
And #1# will increase by #2# every played hand
But also I want to #1# and #2# reset on round end
#1# and #2# are just placeholders for your variables that you specify in a loc_vars function
having a look at the game's source code is great for figuring these things out
I mean, maybe there is G.Round ended or something
you can just extract the executable with 7-zip and there's all the code
also if you're not already familiar with programming, go learn about Lua and basic programming concepts. I can recommend this resource: https://www.lua.org/pil/contents.html
yeah they're different
there's an example mod that re-implements some vanilla jokers in steamodded, but there's plenty of other modded jokers to use as examples
I am familiar I think, it is only question about ingame functions and variables which I don't know
Yeah, already looked it up, created some basic Jokers for practice
alright
it's a lot to digest so feel free to ask questions about anything you might come across here
Thanks, I will try to learn what I can myself
also note that steamodded heavily modifies a lot of the game to a point where the modded version barely resembles the original function at all
is this the base code or the steammoded code
Game.lua
Balatro code
the devs are strong for dealing with this
for the ones that aren't fully overwritten, vanilla code is often patched in some way, you can also view the results of these patches in <Mods folder>/lovely/dump under the same file name that corresponds to the file in the game itself
even with steamodded alone this has most of the files you need, so I usually end up just using this since my work is often involved directly with it. You'll get a decent idea of how the game works without, but there's cases of implementations that just can't be kept around while incorporating mod support (like suits and ranks). In that case there's not much of a need to be familiar with the vanilla version
eh I've seen way worse, this is just data
watch out for Card:calculate_joker
"your work"?
I'm the top contributor of recent steamodded
not like it's specifically my project or anything, we have like 30 contributors
My mind snaps, it is so difficult to understand
I advise against it as a point of reference
The jist of it is this #1247703015222149120
Oh
Thanks
Also another question
Today I tried to merge Golden Joker with Runner, but it did not work no matter where did I put the code
Code of the added dollars
All of this
would you happen to have added the calculate function from runner, that's where all its functionality happens
you would also have to merge their config tables
to use card.ability.extra.money, you must first have a corresponding preset config value
Did it
Yeah, i've added it into config ={}
And vars =
mind showing your code for that?
I did it on my laptop, recreating code right now
whats the fuction i can call to add chips or mult
SMODS.eval_this?
i was thinking more like in joker calcuation
i have this
it works
but it does the text then adds the mult and chips at the same time
Had that problem too
How to add that delay,
Like with walkie-talkie
if context.cardarea == G.jokers and not context.before and not context.after cameo
me when i don't use context.joker_main
walkie-talkie and scholar are special in that they use an 'individual' context that works differently from the rest
Oh
to have this effect during the main joker phase, you need a manual status text
is it because they activate during hand scoring?
its like i want what runner does except for multiple values
best to use SMODS.eval_this for that
ok il try that
the functionality exists this way because thunk needed it, but only for this type of scoring
So suit-based jokers like gems works different from waktie-talkie and scholar?
they work the same
how do i use it
@frosty dock I think I did it like this (It did not work)
Sometimes I'm glad I don't do jokers, only blinds 
I thought Jokers are the simplest
something like this
SMODS.eval_this(card, {
mult_mod = card.ability.extra.mult,
message = localize({ type = 'variable', key = 'a_mult', vars = {card.ability.extra.mult} })
})
you can put multiple of mult_mod, chip_mod, Xmult_mod in the effects for applying at the same time, or call multiple times with different effects to run in sequence
adjust the message accordingly of course, as you would for return values
ok what about custom stuff added luke powmutl from talisman
it will work for the status text but doesn't automagically apply the effect iirc
thanks it works so far
Do I place
calc_dollar_bonus = function(self, card)
local bonus = card.ability.extra.money
if bonus > 0 then return bonus end
end
Out of Calculate of Runner?
why is this not destroying a random conumable but yet the first one
yeah it should be its own separate function
Thanks
because it's in the for loop?
@frosty dock Is there a way to hide color tags?
they don't on that screen, I think you can configure the color with steamodded's DollarRow API? haven't looked at it in a while
"DollarRow API"?
whatever
tahnsk that worked
even that doesn't support multicolor text I don't think, so patching would be required to make that work
I suggest to just disregard the color on cashout for now and revisit later
is it a_Xmult or a_xmult
Can I quickly restart the game somehow? Like reloading Atlas with DebugPlus
welp i need to gain people to help with the art in my mod so time to post my mod as a mod
Hello! This is a little strange use case, but I'm currently working on a some kind of texture mod that can also affect other modded stuff without messing with their assets directly (so all my assets remained inside my own mod repo), so I was wondering
- Is there a way to check if certain mod is loaded AND active? (0.9.8 seems to have their own way with
SMODS.Init.<MOD_ID>, but I don't think I can find the equivalent in 1.0.0) - Is it possible to take ownership of modded suits and jokers? I've tried this to Bunco's Fleurons and Halberd suits and it only gives me duplicated key errors and skipped. For joker one, the one I took the ownership off to change the atlas seems to be missing from the collection entirely.
- Is there a way to partially change loc_vars without duplicating the whole elements? For example, I would like to only change the name of the vanilla joker but kept the rest of the description in-tact. Currently I had to duplicate the description to my own files too (and recreate other tooltip pop ups), but I was wondering if there's any other option.
I have made sure to give the priority to my mod to ensure it's the last thing loaded
well for #1, SMODS.Mods[id].can_load should work
the conditions for that seem to be
- not duplicate id or key or anything
- not disabled via the ingame UI
Ah, thank you very much. That works!
is there an example of taking ownership of a joker?
#1286451229534322783 message
Can someone give me ideas for what my consumables can do
(ignore sprite, placeholder)
you should update debug plus I removed the long dt messages (for real this time)
i update my mods once every blue moon
next time will be when reverie is finished for 1.0.0
i be cooked
is it too overpowered
I noticed a very interesting behavior with the error logs. Sometimes it errors out and prints a partial error log, but if you hold ctrl+c it slowly finishes printing it to the screen
if anyone is getting the UTF-8 crash while using lovely beta7 PLEASE have them use this binary instead and screenshot the error message. #1225831216939536394 message
to anyone who makes mods here, how do you make the sprites yourself? what program do you use and do you make the sprites IN the atlas?
and @ me
Aseprite personally
If you wanna be cheap like me you can compile it from source code
how do you do that?
There should be instructions on the aseprite github page
Personally on Arch Linux you can compile it directly from terminal no problems
hm i dont see anything
I draw my sprites in krita and then paste it into the atlas with paint.net (where I also do the upscaling)
meant to say thank you for the invite to the balatro discord in the github issue ^^
and i dont think the issue i mentioned there is due to cryptid, since it worked with a fresh steammodded from the main repo and a brand new lovely install
this is only partially correct and will crash if the mod is not loaded to begin with (you can use dependencies to enforce that). Use (SMODS.Mods[id] or {}).can_load
how to i make my own descriptions and change the extra value of the jokers i took ownership? i learned how to implement my effects :)
For the extra value you can modify the config, for the desc maybe you can override the existing one by replacing its value?
what does [ expected near local mean (also what do square brackets do in lua)
table indexing
probably some patch failed
and there's an open bracket that isnt closed
like G['hand'] is same as G.hand
there are only two square brackets in my entire file
and they're for the mod authors section in the header
i'm pretty sure i closed every other bracket
yeah i closed all of them
i wish i knew what any of these words meant 😭
i was hoping i could just learn by doing but i havent even been able to boot up the game yet
installing LSP for lua helps with eliminating these syntax errors
if you have VSCode you can install extension
I use this one
oh they have an LSP? neat
😭
i could never imagine not using one 💀
oh cool
i have the one for rust i didn't know there was one for lua
how do i look at it
most programming languages have them, I feel like
when/where does the extension scream at me
oh no now every file has 9+ errors
whenever something's wrong
it will highlight syntax errors with red underline
nothing is changing i installed the extension
maybe you need to relaunch VSCode
^
i will do that
also consider reading into this: https://www.lua.org/pil/contents.html
there is no red underline
i can send the crash log
yeah that's what I meant
okay
fair warning i have zero fucking clue what i'm doing and probably made a very stupid mistake
alright can you screenshot Tsunami.lua around line 13
or just send code
doesn't matter too much
ohhhh
not just 1 line 😭
are you using 0.9.8?
no
then you don't need the init function
still not sure why syntax error happens though
is there no other code above this function?
removing it made everything die
it's all red and yellow now
i did
no
other than the steamodded header
it's all red
this is literally it
i'm just trying to make a joker that makes splash when the round ends
i just realised it's supposed to be when blind is selected
you missed a closing } for loc
oh
the rest of the code looks questionable but should work(?)
oh, right
instead of { ... } you need to use function () ... end
you really should try to learn lua syntax ^
also, it should be calculate
calculate?
and the function should have arguments (self, card, context)
all joker ability stuff is done in the calculate function
where does calculate go
replace the word "ability" with "calculate"
i don't know
i agree with stupxd, you should try learning lua before you start modding
i should do that but i'm gonna see how long i can get away with learning as i go



