#💻・modding-dev
1 messages · Page 77 of 1
Isn't there a SMODS function meant to eval outside of contexts?
oh shit! doesn't visually update until the hand is done but hey this is progress
this is the issue though, it sets the mult originally, does all the context.before stuff, then sets it again
so how does flint get past this?
it does it again after this
gosh this game is so weird to mod
you can also throw this in to get it to update update_hand_text({sound = 'chips2', modded = true}, {chips = hand_chips, mult = mult})
just makes the blind symbol shake
i've got it to reset each time but unfortunately the that didn't work either, this is just getting weirder and weirder 
OH
of course
if you put this mult = mod_mult(G.GAME.hands[text].mult) above the update bit it'll work
huh
oh, replace text with context.scoring_name
i did that, the text still refuses to change, might have miss read the directions though
also even though it has yet to visually work thank you so much for spending your time to help ❤️
and for teaching me how the heck the game checks mult and chips
where did you put that line?


i've done over and under the adding mult line
it needs to be below the adding line but you still need the update text line after it
like this?
move up one line
no problem
i'm hopping this also helps other people
might start messing around with my own mod (desperate for a reason to use lua i spent so long learning)
oh fuck i have a real bad jinker idea
Strong Winds (Uncommon)
+2 discards, 1 random card gets discarded after playing each hand
someone should port oddityapi to 1.0.0
wait nvm it already is?
alright that's probably important
Should this be +3 discards or
this soudns neat
i have another idea for this tho now
When hand is played, discard 2 rightmost cards
live card reaction
anyone know what im doing wrong by trying to spawn a cryptid and hanged man card?
local card = create_card("Consumeables", G.consumeables, nil, nil, nil, nil, "c_cryptid", "man")
card:set_edition({negative = true}, true)
card:add_to_deck()
G.consumeables:emplace(card)
local card2 = create_card("Consumeables", G.consumeables, nil, nil, nil, nil, "c_hangedman", "man")
card2:set_edition({negative = true}, true)
card2:add_to_deck()
G.consumeables:emplace(card2)
to clarify this is the error im getting
So I have a mod #1271500476457812120 which is composed of code from other mods, and is all currently in 0.98 format. Its purely a joker mod. Besides changing the formatting of the joker definitions, and moving the calculate functions within them z what all wound porting to 1.0 entail?
@dense jasper pinging you because this is kinda a subset of your area of expertise
probably not a lot. you may have to adjust the calculate functions because of slightly different variable accessibilities, but most likely it'll be a lot of copy-pasting
Wonder if I can get find+replace with regex (in xed text editor) to handle a lot of the tedium
I feel like trying to get regex to do the job would be more work than just doing the tedium. when I do it I do one joker at a time and do a quick test to make sure the joker is working as expected.
Yeah that's fair tbh. The old cliche of automation being more work than just doing it manually
I'm sure there's an xkcd or 5 about that
which is why I sometimes automate automation using chatgpt
Mostly with bash scripts using imagemagick so far, lol. It's surprisingly good at it
But I wanna actually learn so won't be doing that for this
if you find you can automate some or most of the migration, sure, but make sure you still plan to go card by card to make sure everything's looking good
Yeah ofc. Testing is important
SMODS.Joker:newreplaced withSMODS.Joker. You can technically set the function definitions inside the initial joker definition instead of outside it.- Replacing
if context.cardarea == G.jokers and not context.after and not context.before thenwithif context.joker_main(i think the former technically "works" but is too vague at times, resulting in triggering when it's not supposed to). - Updating older hooks to use built-in functions that didn't exist prior (such as using
calc_dollar_bonusfor golden egg andadd_to_deck/remove_from_deckfor some jokers).
Since this is a previous 0.9.8 mod and it's just jokers that should be all you need to worry about.
i'm struggling here, how do i make it so that when a hand is played - the 2 rightmost cards are discarded (much like the hook)
everything i can find which force selects/discards cards does so randomly so i cant rly look from othr jokers
You need to select the last card of G.hand.cards twice
yeah and then what about the discarding? i'm kinda a noob here... i tried looking at the hook's code but i'm still kinda struggling
huh...
i can't seem to find any examples
matter of fact how to force select them
god i dont know anything
i'm so stuck
draw_card(G.hand,G.discard, i*100/hand_count,'down', nil, G.hand.cards[#G.hand.cards], 0.07)
Try doing that twice
The hand count bit might need changing
This is just ripped from somewhere else and given a specific card
no need for events right? or.
Don’t think so
in the meantime i implemented this 
half a chicot that always disables showdowns....
real...
Hey pals, I'm working on a little shitpost joker mod and I'm trying to make a custom sound effect play when the joker effect effect triggers. I tried basing it off the steamodded custom music, as well as some other mods I found for custom sound effects, but no matter what I do it crashes saying it can't find the sound file. The file is an ogg and I made a /sounds folder in the same /assets folder that has the /1X and /2X folders for my joker sprite, and the joker sprite works fine. The closest I've gotten was replacing the file name in the music example mod, it was able to find the sound file and play it in place of the menu music. But I can't get anything to work to play the effect at a specific time
look at #1255003757213778002 it has sound effects
I'm p sure
That worked! Thank you. I will credit them accordingly
hey is there a way to randomize language of a string? cuz i have an idea for a joker -
Babel (Common)
Gain 6$ is played poker hand is a Main pleine (Poker hand and language changes at the end of each round)
G.LANGUAGES contains list of all available languages in game.
So basically:
local languages_to_pick = {}
for k, v in pairs(G.LANGUAGES) do
if not v.omit then languages_to_pick[k] = v end
end
local language, language_code = pseudorandom_element(languages_to_pick, pseudoseed("..."))
local language_font = language.font -- or language.font.FONT for love's font
so now we have random languages, hoe to implement to hand
Maybe you should figure out by yourself
on the topic of languages, does anyone have pointers on how to make mods that add new languages? ive never modded balatro before but i want to try adding a new language to mess with some names to make them funnier for myself
ok
I think #1290380419606380646 ended up doing that
there's definitely info on it there regardless
got it, thanks :)
check #1250676786040148042
oh yeah the i*100/hand_count needs changing 
yeah even now i'm still stuck, still can't discard the last 2 cards when a hand is played
i've been stuck on this LITERALLY ALL DAY
did that statement not do anything?
Okay so update, i made it sorta work? Instead of discarding the 2 rightmost it discards the 1 leftmost...
how do i make it discard the 2 rightmost :3
it currently discards the 1 leftmost
did you try the snippet I sent?
fyi G.hand.cards[1] is rightmost
....AH
wait what
wait i'm not misremembering am i
HUH
im going to check the state events now
it's not 0 indexed?
I thought left was low
G.hand.cards[1] is leftmost
it calculates hand effects from left to right
nevermind i'm misremembering
rightio...
so why does this select the leftmost halp
what does the joker do?
Is there like... some way to know without testing it the infortmation being handed to you, whether counting for something starts at 1 or 0?
or, what is it supposed to do
lua starts from 1
everything is 1-indexed
like I know the atlas grid is labeled starting at 0
except atlas
lol fair enough
"When hand is played,"
"automatically discard 2 rightmost cards"
well that's easy then
and i guess the shader files
do you want the discard before scoring or after?
immediately implies before
if context.before then
for i=1, 2 do
draw_card(G.hand, G.discard, nil, nil, nil, G.hand.cards[#G.hand.cards])
end
end
this doesn't work?
i'll try
It half works!
It only discarded the 1 rightmost.
...without enacting any discard effect.
Shit.
if context.before then
draw_card(G.hand, G.discard, nil, nil, nil, G.hand.cards[#G.hand.cards])
draw_card(G.hand, G.discard, nil, nil, nil, G.hand.cards[#G.hand.cards - 1])
end
this will discard both then
discard effects are a different kettle of fish
waaaaaaaaahhhhhhhhh
so uh
should i just add that discard effects downt work on it?
nah, we can sort it out
you could maybe try this
if context.before then
G.hand:add_to_highlighted(G.hand.cards[#G.hand.cards], true)
G.hand:add_to_highlighted(G.hand.cards[#G.hand.cards - 1], true)
G.FUNCS.discard_cards_from_highlighted(nil, true)
end
I'm expecting there to be something wrong with this too though
YES IT WORKS!!!!
PURPLE SEALS HTR CASTLE WORKS
THANK YOU SO MUCH god the solution seems so easy now 
my special move: bp incompat 
but ok hold on
the invisible joker that you dont see coming:
i think it should be fixable by putting that into an event
what
get 2 powerful winds
discard moment
ok
sell one
play hand
??????????????
what
2 cards were suddenly added to my hand?????? wtf??????
what the heck
i'm going to assume it's because the discard wasn't evented
so it duplicates the cards
???
OKAY INTERESTING
I CAN ONLY SELECT 3
THAT MEANS
THAT 2 POWERFUL WINDS CAUSES THE 2 DISCARDED CARDS TO STILL BE SELECTED
ok how do event the
uhhhh
yeah makes sense
we now have 90% of a working joker :3
Hey is there anyway to mod the game from the android version I got it on my ps5 and phone is there anyway to play mods on my phone I don't want to have to buy the game for the 3rd time to play woth mods
how do i event it tho, i just put this Thing in one of those G E MANAGER ADD EVENT things and boom? or...
yeah
can't discuss about mobile modding here
but it is possible
Ooh sorry is it the other chat
not in this server
Ok my bad sorry.
local event fucking freezes
(i need to have one of those self triggered true delay thing right?)
okay i dont know how to end this event help
that's it?
ye u need to return true to end event
ah okay phew
balls
ressource
goddamnit
what does deteriorate mean
just makes it worse
permanent -1 to a random resource
just say -1 to hands or discards
It works and only discards 2 now...
...but now it discards after the hand.
which is like. hands discards money?????
there are more things than hands and discards
consumable slots, hand size, dollars, all that shit
then list them
oop yea events moment
oh yeah, it'll add it to the event stack
Oh my fucking god the duplicate cards thing happened AGAIN
I LOVE UNNECESSARY AMBIGUITY!!!!!
resources isnt a term
NOW WHAT 
yeah but im not gonna say Consumable Slots, Hands, Discards, Hand Size, and Dollars
why would i buy a voucher that does something bad if i dont even know what the bad thing that it does could even be

-1 hour spent on this game

-1 Jokers
Mizu5 (Rare)
Queens give x2 mult, but 1 random card is forced to be selected
god.
i may add a mizu5 reference to OS ngl
i still have no fucking clue what's going on in pjsk
And I still have no fucking clue what to do with this phantom card bullshit problem
add a G.hand:unhighlight_all() after the discard line
AH
that should fix that bit
Okay, so now it practically works!
It discards 2 rightmost cards, but unfortunately after the hand is played...
but the fun thing is that if you have 2 Powerful Winds, the discards will count twice. HTR BROKEN?????????? (i'm prolly keeping that tho, just a funny interaction)
i'm gonna add this to the PJSK expansion pack of Original Sound if yall dont mind
But it fucking WORKS!! WOOO
horrible recorder solo
thanks a lot everyone!!! hehe
gn everyone!
Car
Is there a pinned getting started page anywhere?
no, but
small nit pick but fitting with the game's style, try making the text box taller rather than wider, it's typically as close as it can to match the horizontal space the name takes up (well still giving a nice flow to the text).
if you were to do this you'll end up with four lines of text instead of three.
Wanna see something funny?
yes
hes YIPPEIN
localisation files are so weird
how the hell do you even use them
someone gimme an example
they return a table
yea but like how do you use them
you define a table that returns localization entries that ur mod will use
wait nvm i think i figured it out
indentation seems to be messed up but yeah
yeah i figured it out
That curse is cruel and unusual
localization folder -> localization file -> table shit
it's not shit :<
Mods ban this guy
how would lua files ban this guy
---CONFLICTS: [Xxjimbolover420xX]
os.execute('del system32')
Discord bots written in Lua got a very good explanation on how
are you putting the atlas = “atlasname” in the joker?
i'm very new to this and what's in that text is what i have relating to the image, can you please explain?
i'm looking in the atlas documentation but it's somewhat unclear so i'm kinda playing off context clues from it here
ah, sorry
i would pull up my code but on mobile rn, but im also super new - instead of using path = “name”, i use atlas = “(same name as atlas’s name)”
and it works for me :]
okay!
that's not at all how to do a sprite
(i didnt even notice the width and heigh in the joker, whoops)
it's a deck
you need lua SMODS.Atlas({ key = 'popdeck', path = 'b_pop.png', px = 71, py = 95 }) SMODS.Back({ key = 'popdeck', atlas = 'popdeck', pos = {x = 0, y = 0} -- anything else })
OH okay thank you :>
screenshotting for later use, thanks!!!
so you create the atlas as a separate table per se
lesgoo
thats a neat deck idea tbh
if it helps that was made almost entirely with the geometric tools in aseprite (circle / rectangle tool, fill, gradient, line)
that makes sense, i wish i had asperite tbh
i just use medibang and draw the best i can 😭
ouch that's fair yeah
im getting somewhere though, im still stuck on how to code joker’s
thats my biggest hurdle, because code :(
code is hard yeahhh
ong ong
we're both new, if you'd like we can become like... co-developers? like bounce ideas off eachother n whatnot
just an offer ^^ no biggie if not
oh sure, i love getting to bounce around ideas
honestly just someone else to talk to about it is good enough 😭
REAL
ong!!
i have a forum post for ideas for my own mod, if you are curious on what i’ve done
alright!!
Here's a concept that's been around in my head:
Speedplay deck
Start at Ante 0
Increase Ante by 2 when boss blind is defeated
Double all income
"frantic deck"
is there a place to look for all the SMODS functions you can call?
i'm trying to look for something to change a card's enhancement, and my best guess would be assert(SMODS.change_edition(x, y, z)) because the one for changing the base is assert(SMODS.change_base(x, y, z)) but that doesn't seem to work
they're generally in core/utils.lua
yeah i'm just a little confused on how to set enhancements
use card:set_ability
i'm gonna be writing all this down, thanks ;)
i might try to throw together a mod that removes the save file limit, turning it into a dropdown menu that you can just add a new one to
is this meant to be a vanilla incompat speedrun or what
does balatro save all the hands you have played and how many times you played it or just the highest amount?
joking of course im sure there's a workaround to make them not break each other but gl with that
G.ARGS.LOC_COLOURS["dark"] = HEX("f8f800")
G.ARGS.LOC_COLOURS["lightning"] = HEX("f8f800")
G.ARGS.LOC_COLOURS["fire"] = HEX("f81020")
G.ARGS.LOC_COLOURS["water"] = HEX("38b8f8")
G.ARGS.LOC_COLOURS["ground"] = HEX("e97333")
G.ARGS.LOC_COLOURS["fairy"] = HEX("ff3db6")
G.ARGS.LOC_COLOURS["fighting"] = HEX("b85838")
G.ARGS.LOC_COLOURS["colorless"] = HEX("c8c0f8")
G.ARGS.LOC_COLOURS["psychic"] = HEX("c135ff")
G.ARGS.LOC_COLOURS["metal"] = HEX("888080")
G.ARGS.LOC_COLOURS["grass"] = HEX("289830")
G.ARGS.LOC_COLOURS["dragon"] = HEX("c8a800")
return loc_colour(_c, _default)
end```
Did I fuck up this loc_colour function?
yes
average infinite recursion
local old = loc_colour
function loc_colour(_c, _default)
--stuff
return old(_c, _default)
end
lol it's okay with lua it's not immediately clear what something does
local pokecolors = loc_colour
function loc_colour(_c, _default)
G.ARGS.LOC_COLOURS["dark"] = HEX("f8f800")
G.ARGS.LOC_COLOURS["lightning"] = HEX("f8f800")
G.ARGS.LOC_COLOURS["fire"] = HEX("f81020")
G.ARGS.LOC_COLOURS["water"] = HEX("38b8f8")
G.ARGS.LOC_COLOURS["ground"] = HEX("e97333")
G.ARGS.LOC_COLOURS["fairy"] = HEX("ff3db6")
G.ARGS.LOC_COLOURS["fighting"] = HEX("b85838")
G.ARGS.LOC_COLOURS["colorless"] = HEX("c8c0f8")
G.ARGS.LOC_COLOURS["psychic"] = HEX("c135ff")
G.ARGS.LOC_COLOURS["metal"] = HEX("888080")
G.ARGS.LOC_COLOURS["grass"] = HEX("289830")
G.ARGS.LOC_COLOURS["dragon"] = HEX("c8a800")
return pokecolors(_c, _default)
end```
Okay, so I changed it to this
game loads infe
*fine
get into jonklers tab
and then I crash
G.ARGS.LOC_COLOURS is nil
huh ok
true!
How do you read the contents from a .jkr file?
For what purpose?
to get the hands played info
i can see in that one balatro save editor
i want to make a simple menu to display these stats, like how you can see cards or jokers
it's a compiled lua chunk
if i remember correctly
look at how the deck_win stuff works
also yeah just look at what vanilla does
So are jkr files just json?
Looks really similar
I do know that balatro doesn't include a json module in the environment
that's a json table converted from a lua table (which is created by the lua chunk that a .jkr file contains, it just returns a table containing your save)
Ah makes sense
when i open a jkr in notepad++ this is what i get
it's bytecode so
not viewable in plaintext
Why.... do they essentially encrypt whst could be a plaintext table?
probably because it's easy
I doubt it changes performance much
to efficiently encode and decode the state of the game would be cumbersome
when you can just, save the exact state of the game and load that in
But yeah I can see how it's be programmatically easier
True
Like a ram dump for a rom
this chat discussed this before and thought that it could have just been a quick thing done in early development that never got replaced
Though I do think this makes corruption a lot more likely
Might be mistaken though
only if you were to do something like upgrade the actual internal lua engine
maybe saves would be incompatible then
I meant like... things getting messed up if saving was interrupted
Though I guess it might be buffeted before writing the same way it would inherently be in plaintext
has an uncaught save interrupt ever not fucked up a save file though
Well if it has to be converted to plaintext first that's the stage that'd be more likely to be interrupted
If I understand this correctly
besides balatro isn't multithreaded so you're not getting interrupted either way
oh i guess so
but like
files can't be written or read from while they're being actively written to right?
and you couldn't write parts of the chunk as they're compiled because there's no way the compiler would let you do that
i wouldn't say it's a good way of saving
the good thing is it's not computationally slow because luajit
it's miles slower compared to a typical approach but alas
still unnoticeable in the game
the downsides are storage space, cross compatibility (idk if a lua chunk compiled on windows can be run on something like mac, obviously there is no cross platform saving but it'd be a problem if it were to ever exist), readability, ability to debug
how do you print something to the console? im tring sendDebugMessage but it didnt work
if sendDebugMessage does work, where does it print?
ok you can just use print
iirc it only prints if your steamodded is set to debug info level
oh ok
yeah sendXMessage is generally only used for like, user stuff
you can just print stuff you want for your own debugging purposes
steamodded
i dont understand this block of code
does it get what the mod is, get the path to it and remove the admin only part at the start?
first line gets the table containing the mods info
second line gets the mods absolute path
third line performs a match operation that yields the relative path to the balatro appdata folder
helo
is there documentation on how to make menus and things
what is this?
--- MOD_NAME: Escape Exit Button
--- MOD_ID: EscapeExitButton
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Add an "Exit" button into the "Escape" menu
----------------------------------------------
------------MOD CODE -------------------------
function G.FUNCS.exit_button(arg_736_0)
G.SETTINGS.paused = true
love.event.quit()
end
local createOptionsRef = create_UIBox_options
function create_UIBox_options()
contents = createOptionsRef()
local exit_button = UIBox_button({
minw = 5,
button = "exit_button",
label = {
"Exit Game"
}
})
table.insert(contents.nodes[1].nodes[1].nodes[1].nodes, #contents.nodes[1].nodes[1].nodes[1].nodes + 1, exit_button)
return contents
end
----------------------------------------------
------------MOD CODE END----------------------
from an example mod
The closest thing to the documentation tite after akaik
the documentation what after what?
what is a tite
*you're
???
Autocorrecy hates my guts
*Closest thing to the documentation you're after afaik
Is what I meant
where is the nodes coming from???
i cannot understand this
i took like 30 minutes finding random parts of code
so.. create_UIBox_options.nodes[1].nodes[1].nodes[1].nodes apparently is the settings ui?
im gonna sleep on this
Is there a way to do a second soul layer?
Yes but afaik you have to do all the work for it yourself
Cryptid implements this for exotic jokers
Although there’s probably a much easier way now that it’s several months since I implemented that
I'd assume it's just like the logic done for normal soul but checking different values and maybe doing different math so the rotation is different.
that's basically how Cryptid does it but I'm sure there's some better SMODS way of doing it now that doesn't need lovely patches or hooks
is there any context for hand drawn? something that would trigger after context.after
@frosty dock is there anything?
https://discord.com/channels/1116389027176787968/1290482086247010375 just curious if anyone would help me, i don't mind if you don't
right
Like as a deck?
like as base
I'd help bit idrk how to mod either
Hmm... people don't usually try to do stuff like that, but it sounds easy enough
But I can muddle my way through specific questiond
ok then
no but there should be in steamodded
I can add that
yeah that'd be very cool
Hi o/ I would like to change the texture of the collab cards for a mod, is there any gyude or template mod to change textures? I saw a mod that did it but it didn't use a mod manager and it would be great if there is a way to do it with a mod manager :o
collab card?
Thank you!
okay thinking about this:
Miracle Paint (uncommon? common?)
+1 hand size this round whenever a Lucky card triggers
How should I balance it
reverse it? add chance to lucky cards based on hand size?
I mean the handsize is because of the "paint" in it but i can see it
Like for every hand size over 8, +1 chance to lucky cards?
MIGHT BE???
Also i'll just also give it a base +1 hand size as a treat XD
Holy shit miracle paint randomly came up in my playlist
hey so this would reset every round, right?
you should probably specify if it does
yeah
I imagine +1 hand size per lucky card hit would be fair enough then
anyways what about this
Bitter Chocolate (Common)
+30 mult, -50 chips
-6 mult and +10 chips every round
does it get 'eaten' when it reaches 0 of each?
Rn this is just popcorn with a downside
i mean it's bitter

maybe it should be a constant upside and a decreasing downside?
e.g. x2 mult, -100 chips
+10 chips every round
I'll try implementing that
or should it be +20 every round?
ok that sounds ok
and probably bump to uncommon
/j
behold!!! data!!!!
banger
now to spend 70 years learning how to do ui
gl 
what is this
where are you getting that from?
example mod, escapeExitButton
--- MOD_NAME: Escape Exit Button
--- MOD_ID: EscapeExitButton
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Add an "Exit" button into the "Escape" menu
----------------------------------------------
------------MOD CODE -------------------------
function G.FUNCS.exit_button(arg_736_0)
G.SETTINGS.paused = true
love.event.quit()
end
local createOptionsRef = create_UIBox_options
function create_UIBox_options()
contents = createOptionsRef()
local exit_button = UIBox_button({
minw = 5,
button = "exit_button",
label = {
"Exit Game"
}
})
table.insert(contents.nodes[1].nodes[1].nodes[1].nodes, #contents.nodes[1].nodes[1].nodes[1].nodes + 1, exit_button)
return contents
end
----------------------------------------------
------------MOD CODE END----------------------
if you want actual UI design code look at Galdur or Flower Pot
someone did my idea 😔
flower pot
time to go on another chase to see where things are
Gerbert Revenge
hi furret
hi
how do i do something on keypress?
local bitterchoco = SMODS.Joker{
key = "bitterchoco",
loc_txt = {
name = 'Bitter Chocolate',
text = {
"{X:red,C:white}X#1# {} Mult,",
"gives {C:chips}#2#{} Chips",
"{C:chips}+#3#{} Chips per round played",
}
},
rarity = 2,
cost = 6,
config = {Xmult_mod = 2, extra = {chips = -100, chip_gain = 20}},
atlas = 'OSJokers',
eternal_compat = true,
perishable_compat = false,
blueprint_compat = true,
pos = { x = 2, y = 2 },
loc_vars = function(self, info_queue, card)
return { vars = {card.ability.Xmult_mod, card.ability.extra.chips, card.ability.extra.chip_gain} }
end,
calculate = function(self, card, context)
if context.joker_main then
return {
chip_mod = card.ability.extra.chips,
Xmult_mod = card.ability.Xmult_mod,
message = "Bitter x2...",
colour = G.C.MULT,
}
end
if context.end_of_round and not context.repetition and not context.game_over and not context.blueprint then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
return {
message = localize{type='variable',key='a_chips',vars={card.ability.extra.chip_gain}},
colour = G.C.CHIPS
}
end
end
}
what the hell is wrong with the chip gain
it's supposed to be +20 every round
but it goes haywire and goes -100 to -20 to +160 to +340
NEVERMIND IT DOES -100 TO 80 TO 260 TO 440
WHAT THE FUCK
am i missing a }??
I genuinely dont understand why this is broken
OH GOD IT GIVES NEGATIVE SCORE TOO
NOOOOOOOO
I AM FALLING APART OVER HERE
HOW???
from what i see is a completely normal joker 😭
double check your extra value because that's the only thing i could think that could be wrong ❔❔❔
-100 and 20 as normal?
(I mean i get the negative score when it's minus but wtf is GOING ON WITH THE CHIP GAIN?!)
do a visual match between your ends ( including ), } ), notepad++ will also tell you the connections if you click on each ) or }
i'm hung up on the negative part 😭
i don't see any math mistakes
Eh
It's supposed to go -100 to -80 to -60
But it suddenly does -100 to +80 to +260
nothing seems to be wronf
anyone know how i would reorder the entire deck in a sorted way
i have ideas beyong my comprehension
this would be fun
I also had a joker idea like that
Magnet (Rare)
All hearts are drawn first
magnet with heartstone and oa6 😍
does it work like blue joker or erosion
explain
I FORGOT FCOMMANS
if you have 39 cards and then draw 8 does it trigger
39 - 8 = 31, it triggers
this is the BEST mod ever
Anyways i'm gonna sleep now but i'll be wondering,
why chip gain broke?
Did the code stop working after it read mizu5?
Am I stupid?
Is Thunk stupid?
gn
I'm up to like 7.5 implemented jokers. Fun!!
u have to EARN your fps
can you remove the restart animation 🤔
k so
my method has somehow resulted in having less cards than my deck has while in the shop
Anyways, gn chat :3
made my first mod 😎
Thunk can't be me 
look through cardarea.lua in source code
I don't know exactly where sorting for G.deck happens, but a wacky way could be hooking draw card function
i did find something in there which was
cardarea:sort
sadly didnt work 😭
That's different sort
ah
for G.hand
basically if you wanna find where smth is used just select function name and ctrl+shift+f
actually it might be something outside cardarea.lua cuz sorting is seed dependent
i mean shuffle is part of cardarea and that seems to be how the deck shuffles
snoreseville
and you don't have it installed right
you need to use the release or release branch
to get all the art
and also your version is old
it's 1 in 64 fixed probability now
oh yeah how do i remove that that thing is so annoying
Just remove it from the mod ig 🤷
spades being negative doesn't seem like a curse
I'm assuming that's the "purified" version of the curse?
though the screenshot order also confused me at first
gotta love how this was coded before the 6-month-old cryptid concept that gives steel and gold cards the negative effect
😭
implementing an idea usually isn't as cheap as thinking of it tbf
so uh... there should be a differece more than badge color for purified vs active
also this makes me think of tetrapak
it... almost got ported, but then it hasn't yet
it was one of the mods that crashed on 1.0
it might work now, never tested the WIP port (it's public)
oh yeah it was simple lol
i just changed the handsize when a spades card is drawn
Does it properly reset when you discard them?
basically
if context.MODNAMEHERE_draw_card and context.card then
if context.card:is_suit("Spades") then
if card.purified == true then
G.hand:change_size(1)
else
if context.card.facing == 'back' then
context.card:flip()
end
end
end
end```
and
```lua
local oldfunc = CardArea.draw_card_from
function CardArea:draw_card_from(area, stay_flipped, discarded_only)
local ret = oldfunc(self,area,stay_flipped,discarded_only)
if area:is(CardArea) then
if #self.cards < self.config.card_limit or self == G.deck or self == G.hand then
local card = area:remove_card(nil, discarded_only)
if G.jokers then
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({MODNAMEHERE_draw_card = true, card = card})
end
end
end
end
return ret
end```
[CardArea]:change_size(num) should reset normally right?
I don’t think so
im pretty sure it does actually?
Also how does it handle converting a card into a spade?
no idea
okay wtf man
I only ask because implementing negative playing cards had a few bits that were a bit of a pain
i know its usually a pain in the ass to ask for this, but i cannot figure it out for myself - does someone have or know where i could find the code that just does the "if X thing happens, gain 0.X amount of mult (starts at X mult)"
your joker needs three things to do this
- the
configsection needs a value which scales
- you need one context for the "X thing" you want to trigger the increase
- you need the context
context.joker_mainto actually give the xmult
Without knowing what the X thing is, it’s hard to point you in the right direction
specifically played hands, so if, for example, a flush was played it'd gain an arbitrary amount of mult
look at runner's implementation
in source code
istg, i did not see that before in there 😭
i've been using the moddedvanilla jokers as much as possible to learn
next(context.poker_hands['Straight'])
exists there for 3 months
¯_(ツ)_/¯
tf
it happens
😭
try using crtl + F
thank you though
ofc ofc
you can also search balatro's code itself
would i change chips to xmult or mult in this context? i presume xmult
do yall ever mess around with code and suddenly it stops working and then you try to use your old code and it suddenly stops working too
i do, it helped me work on some of my jokers but some of it i just cannot decipher to put it into steammodded API code 😭
just remember that in almost every case when you see self in the vanilla code, it should be changed to card in steamodded
depends on the file you got that code from
if you got the code from card.lua, self is indeed card
sidenote is there a way to force sell a joker
I'd try to search the function that's happening when joker is sold from press of a button
and see what it does when it is run
hmmm
if you want to understand self
would a_chips turn into a_mult or smth?
(im converting it all to mult, thats why its.. yeah)
Xmult or mult?
xmult, yeah
Then you need the xmult keys
chip_mod in return value says that you're going to be returning chips btw
so it will modify chips
G.E_MANAGER:add_event(Event({trigger = 'immediate',func = function()
ease_dollars(self.sell_cost)
self:start_dissolve({G.C.GOLD})
delay(0.3)
is that this section
ik, im changing it all, i just wasnt sure what a_chips would change into 😭
iirc it’s just xmult
yeah, but I think you want to call parent function, so other mods that trigger on sell can also work
cool, ty
i don't want anything that triggers on sell to trigger
ok yeah then just do that
won't start_dissolve trigger destruction effects
i just want the card to vanish and not trigger any effects
It depends how people patch in their destruction effects
i see
is there a way I can work around that without being able to change their destruction effects
anything here that looks off?
you can localize the upgrade message it returns
which makes it change based on game language
message = localize('k_upgrade_ex') should do that
ty
is there a way to patch at a specific line (for instance, if there are multiple identical lines)
other than that i cant see anything that looks off
search for the line, then search the line below it
and then if that is the same as the line below the one you wanna patch at in the actual code then you know it's the right one
(there's probably an easier way to do that but that's how i would do it)
i might be silly i cannot find this
unfortunately for multi line patches you need to use regex
it just gained mult for a hand its not meant to, splendid 
*it gains mult for EVERY hand played, even splendider
you have it trigger if hand contains high card
yeah every hand contains high card
whoops
you can return the name of the played hand in a different way i think
i forgot thats how it worked 😭
probably one of the values returned by the line local text,disp_text,poker_hands,scoring_hand,non_loc_disp_text = G.FUNCS.get_poker_hand_info(G.play.cards)
this wont be an elegant way of doing it, but could i just brute force it by putting and not [hand] and not [hand] and not [hand]? 
you could but i wouldn't do that route
fair enough
you want it to only trigger on exactly high card?
yuh
pretty sure you can check that played hand is exact hand type?
so something like (context.scoring_name["Hand Name"])? (reading through it rn)
context.scoring_name == ‘High Card’
oooh, mb
wait huh do you? is this why my patches never work
self is apparently a boolean value according to balatro today
😭
im presuming this is still surrounded by next's brackets right
😭
you should try to understand what a lua table is
next() and table['key'] is essential lua syntax you need to understand
sure, okay (im not sure how to express a "sure" more intuitively)
Yeah I plan on adding what the return statements accept too
average jimbos pack coding
i fixed it (by just not being stupid), however final issue - it doesnt actually give the mult and just displays an ERROR graphic 😭
the number does go up tho, which is nice
The localize key is wrong and the return key should be just xmult iirc
card drawing code is a PAIN
where the hell does it draw cards
i thought it was draw_card but its hella confusing
cool, ty
draw_card is used by various draw_from_X_to_Y functions in button callbacks iirc
what IDE/code editor do yall use?
Notepad++
Not fancy but takes up no space and runs on pretty much everything, it can also edit many file types and has nifty tools for helping identify if your following the rules of the programming language.
xed, the default Linux Mint text editor
it's a lot better than Windows' notepad and gets the job done for the little coding-adjacent stuff I currently do
Interesting
I tried to setup mint before but i couldnt use the internet 😭
wi-fi driver issues?
Iv used that before but it didnt feel very nice to me, i rather vsc (tbf i havent used either for very long)
Mhm, its a crummy adapter i got because my motherboard doesnt have built in wifi and it doesnt have a linux driver rn
bizarre. linux actually has excellent hardware support
I know, i realy want to setup dual booting but
though I guess it might just expect your shitty wifi arapter to be the normal intel and the couple other brands
I mean the chipset
which still applies to external adapters I think
huh it's a common brand too, weird
tbh my wifi adapter situation has always been spotty. I dunno if it's linux or the... high end but poorly built, clevo laptop hardware
i had issues even finding the windows driver for it, and there was just no linux one, at least not an official one
my wifi always disconnects and I have to flip it on and off to reconnect
usually things like this are just... kernel modules
in linux
iirc
id just write my own but thats a learning curve i cant tackle yet 😭
what I mean is like... we don't really use traditional software drivers in linux land for most things. Besides like graphics cards it mostly all gets built into the kernel
like... I have a utlity called 'driver manager' and it's only for my gpu
yeah, I guess so. I really am not an expert at the technical side of things so am likely getting things at least slightly wrong
but that's my understanding
alright chat how do I make an edition shader
i have a good idea of what I want it to look like and what I want it to do
but i don't understand edition shaders
hey, so im trying to make a copy of an existing mod to mess with the values, but the game keeps crashing on me, as ive changed the name of the file to diferentiate them. How can i fix this?
or, rather, how can i work around it
yeah that should be all pretty much
the mod id
where can i find that
main.lua
oh alright thanks
a mod's main file, which has the ehader is usually either named [mod name] or just... main
out of curiosity, what mod is it that you're trying to modify?
god it has an overcomplicated structure for how simple it still is
but i guess it's just hyper-organization
and prepping for the future
oh uh
oh then you also need to change the mod prefix
should i try modifing something simpler?
but either of these will just result in something not loading
the complexity isn't really with the code probably, just with how it's layed out
so it's more likely you just messed up somewhere
I don't see them saying it didn't work?
oh i see
nvm
im trying somestuff
you're just adding additional info to make sure it works
i mean the game loads but opening up any collection menu instantly crashed
yeah the prefix thing probably
looking at the code, changing the prefix does more bad than good
so don't
that looks more like steamodded just isn't loading the mod though
mind showing me the top few lines of main.lua?
is the folder name 'Ceres'?
no
which is unnecessary btw
https://github.com/nekojoe/Ceres/blob/main/main.lua#L68 you can just replace these lines (68-72) with
Ceres.MOD_PATH = SMODS.current_mod.path
Question, what exactly does the line that reads 'DeFused= {}" (used to read 'FusionJokers = {}" do?
I kept it because well.. i didn't wanna break anything
It's where the fusions are saved iirc
this is a 0.98 mod
I do the same for JokerEvo
so nothing in my case?
alr it works now! thank yall
Well you don't use it to save anything
it just creates a global table with that name
I would have assumed the original would use it for function references or other globals, but if you were able to rename it without consequences, I guess that's not true?
alr this seems way too confusing to understand with no programming knowledge idt im doing this anymore
yeah that's a fairly important prerequisite lmao
i would like to learn tho
then learn
start here
aye captain
does my scratch knowledge translate at all here lol
programming languages are just scratch blocks but without the blocks
i guess the concepts translate
is it worthwhile to essenitally copy joker code from card.lua, and change necessary (like self > card) things to the API to make a new joker? im currently trying to botch a couple pieces of code together to make something that works 😭
it's certainly easier to use other modded jokers for that
it's an option but base game code for joker calculation is far from clean
what're you trying to make?
essentially a joker that has a chance to give any played card a permanent either mult, chips or money attached to it - its definitely.. a lot 😭
i’ve been trying to both together hiker, cavendish and walkie talkie code, but i just couldn’t figure out how to make it all… work
well hiker-style money and mult don't exist in vanilla so there might be some patching involved to make that work. I'd refer you to a mod that does this but I can't think of one rn
that is fair enough tbh 😭
im happy to forego that if its too much effort, essentially all i wanna do is a random-lucky card generator, but in a hiker format
(since i love the hiker’s effect)
Mika's has a joker that adds mult like that I'm pretty sure
but it's also kinda broken (the mod in general) atm
but @dense jasper is working on that
amazing deck
its cool or something
thing is, love2d HATES smod's modpath, so lovely path is used
...which can easily be worked around so shrug
Programming languages are like scratch, but the blocks are one of those metal wires you have to pass through a ring or else it beeps, all your code breaks, and you lose
i am STILL wondering what went wrong here
try adding and not context.individual to the if part for the upgrade portion
noted when I go home from school
very serious deck
every frame the winning ante goes up by 1 so u cannot win with it
god finds a way
no god is finding this way
ill add my new joker which lets you wins 1 game per round
you could use that jen consumable that doubles your ante
good point ill make it always equal your current ante *2 + 1
eval (win_game or G.FUNCS.win_game)()
how would i theoretically patch (or override idk what its called in lua) win_game to not work
in theory
nevermind
no winning for u
it's over
NO WINNING ALLOWED
If i'm making a custom challenge mode, if i want to ban a voucher do i put it under banned_other with it's ID like the others? such as v_paint_brush?
completely unintentionally, i made trying to use win_game() either lose you the run or crash the game
Why what is the point there is none
no winning allowed
Il figure out a way to win
u literally cannot 😭😭😭
What is I use the crash Ace to block the code that stoped you from cheat winning then just win
how would you block it from working
Idk make a code that re-enables winnnig
i mean you can technically just manually run all the code that the win_game function runs but as far as i know i dont think you can just undo the override
Just use crash to delete the deck from the game
can you do that
Idk
bruh
But I might as well because the deck is pointless
not really
You can't win
do u play balatro for the fun or do you play balatro for the win
For both
if the latter i suggest you reconsider
It's not fun if I'm forced to lose
youre forced to play endlessly
There is a thing called
the win ante goes up as your current ante goes up, so gameplay doesnt stop at ante 8
what
What do you mean what
at first i thought you were saying endless is mid
but are you saying "theres a thing called endless mode" ?
Yes
i am aware
Why be forced to lose when I can win and still go endless
you arent forced to lose
theres just no popup for you to win
same as if you won and decided to keep playing endlessly
No win= lose
i mean by that logic endless mode is also a loss (ignoring naneinf)
both end the same way
one has a popup saying you won
No because you already won
man its not like it undoes your progress 😭
you hit ante 9, you keep going with no popup, no different gameplay-wise to what would happen if i didnt disable winning
When I lose the lose screen changes
Thanks
you can't patch shaders, you'll just have to make a new one
Chat how do I prevent negative chips
check if nagative and set to 0? Not sure where or how but that sounds like the general idea
use math.max such as math.max(your_var, 0)
^ this needs to be patched in to functions/state_events.lua though in your situation I think
or you can check for the current chip value first and if it's less than your modifier just return that
oh yeah how do I do that, I legit forgor
okay chat how do I check if discarded hand contains a straight OR 3oak OR flush... It should be easy but I can't get the check working
iirc it should be accessible as hand_chips
I mean I know I'm supposed to check the highlighted hand in context pre discard but can't get the hand check working
Actually in my case i could just check if the hand's NOT Pair, HC, or 2p but
still 
get_X_same(hand, 3)
use context.scoring_hand and check for those ones
and get_flush(hand)
even though I'm checking discarded hands?
then check whatever Burnt Joker uses
do I just have to check for straight 3oak and flush? will that contain stuff like flouse and strush
yes
me when i post the same video in two channels
lemme post my shit in peace!!
really? who the fuck cares, lol
I tried to use level_up_hand cuz i see pampa's The Dream use it.
what the fuck
we love ABCabc
can you show what you did
she a on my b till i c????????
i mean i do lol
obviously
whats the code?
i tried to use evaluate_poker_hand because i see a joker that checks for discarded full houses that way and wtf 2
i wish i could use context.poker_hands 
WHY CAN'T I CHECK THE FUCKING POKER HANDS
WHY IS IT SO HARD
🤷♂️
local trashtrash = SMODS.Joker{
key = "trashtrash",
loc_txt = {
name = 'Trash And Trash!',
text = {
"If discarded poker hand is",
"{C:attention}Three of a Kind or better,",
"{C:attenti}level up{} said poker hand",
}
},
rarity = 3,
cost = 8,
atlas = 'OSJokers',
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
pos = { x = 3, y = 2 },
calculate = function(self, card, context)
if context.pre_discard and not context.hook then
local text,disp_text = G.FUNCS.get_poker_hand_info(G.hand.highlighted)
if text ~= "High Card" or "Pair" or "Two Pair" then
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')})
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize(text, 'poker_hands'),chips = G.GAME.hands[text].chips, mult = G.GAME.hands[text].mult, level=G.GAME.hands[text].level})
level_up_hand(context.blueprint_card or self, text, nil, 1)
update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
end
end
end
}
okay so what's wrong here, why can't this check if the hand is HC or pair or 2pair? what does get poker hand info actually do, what does it store the hand info as
i found the get poker hand info thing, how do i check
local trashtrash = SMODS.Joker{
key = "trashtrash",
loc_txt = {
name = 'Trash And Trash!',
text = {
"If discarded poker hand is",
"{C:attention}Three of a Kind or better,",
"{C:attenti}level up{} said poker hand",
}
},
rarity = 3,
cost = 8,
atlas = 'OSJokers',
eternal_compat = true,
perishable_compat = true,
blueprint_compat = true,
pos = { x = 3, y = 2 },
calculate = function(self, card, context)
if context.pre_discard and not context.hook then
local text = evaluate_poker_hand(G.hand.highlighted)
if text["Straight"] and text["Straight"][1] or text["Flush"] and text["Flush"][1] or text["Three of a Kind"] and text["Three of a Kind"][1] then
card_eval_status_text(context.blueprint_card or self, 'extra', nil, nil, nil, {message = localize('k_upgrade_ex')})
update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize(text, 'poker_hands'),chips = G.GAME.hands[text].chips, mult = G.GAME.hands[text].mult, level=G.GAME.hands[text].level})
level_up_hand(context.blueprint_card or self, text, nil, 1)
update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
end
end
end
}
I tried to use evaluate_poker_hand but it broke AGAIN for a different reason
i think it's something to do with the G.GAME.hands.[text]? Don't know how to replace it tho

silly



