#💻・modding-dev
1 messages · Page 226 of 1
Flirty transfem joker that makes comments about every other woman joker you add to your slots, as well as a few miscellanous gags
Yep yep??
um, my jonkler doesnt work and crashes the game X3
WHOOPS. Show me your crash log
i am trying to make a joker that just adds 5 chips whenever any other joker triggers

Yoooo, anyone's got a quick setup guide for mods ?
Well, the error points to a function called get_compressed(), which is a loading function
hmm
It's used almost entirely for loading save data values for your profile
Did you accidentally corrupt your profile or something?
Can you show the full code?
oh wait lmao you're working on cardsauce
guh?
oh im not on the project, this is my own mod c:
i just enjoy it
Nono I just saw you posted that you're working off it in the cardsauce server
OHHHHHHHH
yur
im learnding

I also used cardsauce as a basis b/c Gote/BarrierTrio is a friend of mine and we're working on this as a spin-off ish mod for a JoJo server we're both in
oh that's sick!!
okay what the hell are you supposed to do with desc_nodes in generate_ui
if you wanna see the joker i made earlier today gote pinned it in mod discussion LMAO
In generate_ui, if you add stuff to the desc_nodes table, it'll show up on the UI
generate_ui is an...... interesting function
I appened some random example node
it crashes and burns because at some point it tries to index variable node in set_parent_child
also my little spungus is the cause of the crash i played about 3 antes in on the same seed
Out of curiosity, add another set of braces around the outermost node
But my other suspicion is that you probably don't need to add the ROOT node
So instead start from the second outermost node
what the hell???
Any given UI tree has exactly one root, and desc_nodes is probably (I say this without having looked at the code) childed under something else that has a root
oh my god
I FIGURED IT OUT!!!!
👍
Yep
huh.
Tree structure, it'll append as many as you give it
and then resize them according to the config values on the parent (which in this case are probably specified somewhere for joker descriptions, but idk where)
I assumed an element of a desc_nodes would be, a singular node
Each node can contain an array of nodes, is the thing
hey whats the color for gray text and stuff
{C:inactive}{}
thanks
hey guys how would i make it so it actually shows the correct price when i initially enter the shop because for some reason it only updates after you reroll
calculate_reroll_cost(true)
I want to create a global function that constantly checks if there are remaining stickers in the deck at the end of a round, and if there are, clear them
I'm not sure if this is the way to do it, any insights?
In joker description, how can I have a dynamic variable ? Say i want to display a mult that changes
Im checking other mods, but i dont think im getting it
oh lord, good question
The easiest way to do this I think is using the generate_ui function
I have an example right here:
Unless you just mean displaying a variable by base, which is built into loc_vars
Well how do Runner, Yorick, Obelisk, etc. do it?
It gets a lot harder when you want to do conditional formatting
yes loc_vars ! ok now i think I get it
Okay good yeah sorry I just had flashbacks attempting to do a joker that switched between displaying xMult and +Mult
No you just pass in a variable in the return table for loc_vars
conditionals I'll figure out a lazy way around it
for example #1# in your joker's description would be written out as the first variable in your loc_vars
quick question
what's the best way to get the score of a hand that's currently being played
the what
Use loc_vars and config
Take my joker for example:
key = "bladefury",
loc_txt = {
name = "Bladefury",
text = {
"Charge with 5 {C:green}Strand{} cards.",
"When charged, playing a {C:attention}Pair{}",
"or a {C:attention}High Card{} will",
"slice them into equivalent pairs,",
"cloning them but with halved ranks.",
"{C:inactive}(Currently: {C:attention}#1#{C:inactive})"
}
},```
config = {
extra = {
charge = 0,
}
},
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.charge .. "/5 Charging" } }
end,
`#1#` will point to a changeable variable in your description. The number in the hash symbol will determine the position of the value you're putting in it (in this case 1 points to the first value defined in `config`, which `charge`)
`loc_vars` will output return the values defined at `#1#`'s position
And basically you can modify the value anywhere in your code by doing `card.ability.extra.[the value in your config]`, this is mine: `card.ability.extra.charge = math.min(5, card.ability.extra.charge + 1)`
the score of a hand being played
like after score is processed
how many chips it scored
i think it's something like G.GAME.current_round.something
actually have you tried looking around in the source code
like i think you'll have to multiply them
found it
G.GAME.current_round.current_hand.chip_total
huh
i can't get context.after to work
is it deprecated or something??
does anyone know why it doesn't do anything
Thank you for the tip !
GAHH these are nodes with n = G.UIT.R containing two text nodes why are they going into columns
this is about right, but i still need to figure out how to restrict it
hey how do i make a joker grant money again
im returning money = card.ability.extra.money but nothing's happening
huh??????
I think it's dollars
ease_dollars(card.ability.extra.money)
or if you want it to happen at the end of the round, you'd write a calc_dollar_bonus() thing
You could do that too I guess, but returning dollars = x should work as well
yeah i do want it to happen at the end of the round but thats only if you dont have anything else to calculate right
i think it works for calculating other things as well
why are these getting rounded up?
it should just multiplying the price of everything by the current ante but its adding 1 for some reason
set_cost() does some math.max shenanigans, so it's probably related to that
pixel art is difficult 😭
WHY CANT I GET YOU IN ROWS
Am I dumb what's wrong here
desc_nodes[#desc_nodes + 1] = {
{
n = G.UIT.R,
config = { align = "tm", 0.1, emboss = 0.1, colour = G.C.L_BLACK, r = 0.1 },
nodes = {
{
n = G.UIT.R,
config = { align = "cm", padding = 0 },
--stylua: ignore
nodes = {
{ n = G.UIT.T, config = { text = "Placeholder #2", scale = 0.35, colour = G.C.UI.TEXT_LIGHT }, },
{ n = G.UIT.T, config = { text = "Placehodler #2 Electric Boogaloo", scale = 0.35, colour = G.C.UI.TEXT_LIGHT }, },
},
},
},
},
}
actually maybe R is for row by row
i don't know if it's just naming being funny but try C
do you all know how i'd check for how many of a certain edition my deck has?
https://github.com/Aikoyori/Balatro-Aikoyoris-Shenanigans/blob/main/modules/ui.lua this is what i did with mine
I'll try more UI shenanigans later ig
Is it possible to pass multiple colors into a message return?
i would wrap text in a row or something
this is the card ive been working on (art is placeholder)
Some other effects the game expect a table of colors, and I want to know if it's possible to do a gradient or something or if I'd have to code that myself
what do you guys think?
cool
also why is he bald 😭
mfw this is a joker that i could actually code and not worry about anything else
holy glass cards!
😭😭😭😭😭😭😭😭😭😭😭😭
Does anyone know why Misprint’s mult range is 0-23?
Like, why 23? I looked up the wiki and it didn’t say why, either.
that is what they decided to make the rarity as
personally i am just doing word play on these numbers
bump
OK
ok so there is progress but i've yet to know on how to restrict it to those ranks
In the function that adds mult, check the played hand in a for loop and add the cards to a list if they match one of ace, 2 3 etc
and you check after that loop if the list size == 5
or well, >= straight_size
(since it can be 4)
since its « and » in your joker, forcing a hand size of 5 isnt that bad as well
so this is what i have
so in the context.before code block
you do something like
cards = {}
for card in played_hand
if card.rank is ace or 2 or 3 or 4 or 5 and card not in cards then add card to cards
end
if cards.size == 5 then xmult = xmult + xmult_gain ```
this is not real code just pseudocode to show the idea
AH
try card.center
the person who had this idea said that shortcut nor four fingers should be allowed to be used to make the joker work, so it's list_size == 5
yep thats fine
i wrote my pseudocode assuming hand size of 5
why does everyone and their mother changing hand selection size
and why is there no library just for it yet
😭😭😭😭😭😭😭😭😭
????
home depot™️ done got demolished by discord bruv
ok i thought embed was gone
gone
😭
come on man, not the chair too
not the vacuum cleaner 😭
this is so me rn...
someone please help, i've been wrestling with this for far too long with the steamodded documentation open the whole time and i just don't understand why red text do that and not what i want it to
i can't see code
😭
mobile
in root node:
{
n = G.UIT.C,
config = { align = 'cm', id = 'cir_config_toggles' },
nodes = {
{
n = G.UIT.R,
config = { align = 'tm' },
nodes = {
-- Contains 3 nodes
{
-- Changes apply on restart text
n = G.UIT.T,
config = {
text = "Changes Apply On Restart",
scale = 0.4,
colour = G.C.RED,
align = 'tm'
}
},
{
-- First options column
n = G.UIT.C,
config = { align = 'tm' },
nodes = {
{
n = G.UIT.R,
config = { align = 'tr', padding = 0.05 },
nodes = {
create_toggle({
label = "Enable Title Screen Logo",
w = 1.5,
text_scale = 0.7,
ref_table = CirnoMod.config,
ref_value = 'titleLogo',
callback = CirnoMod.callback_titleLogoToggle
})
}
},
[...the rest of the nodes]```
ok so
you'll want to wrap the options in another node
the 2 columns
and then set the one just inside root to C
this should be applying x_chips on new calc but is only applying the x_mult what did i do wrong?
if config.newcalccompat ~= false then
Cubic = SMODS.Enhancement({
object_type = "Enhancement",
key = "Cubic",
loc_txt = {
name = "Cubic",
text = {
"{X:chips,C:white}X#1#{} Chips {X:mult,C:white}X#2#{} Mult",
"Idea: BoiRowan",
},
},
atlas = "Jokers",
pos = { x = 1, y = 17 },
config = { extra = { x_chips = 3, x_mult = 0.6 } },
weight = 0,
loc_vars = function(self, info_queue, card)
return {
vars = {
card.ability.extra.x_chips,
card.ability.extra.x_mult
}
}
end,
calculate = function(self, card, context)
if context.main_scoring and context.cardarea == G.play then
return {
x_chips = card.ability.extra.x_chips,
x_mult = card.ability.extra.x_mult
}
end
end
})
end
check your card ability
i did something wrong 
n = G.UIT.ROOT,
config = {
r = 0.1,
minh = 6,
minw= 6,
align = 'cm',
colour = G.C.CLEAR
},
nodes = {
{
n = G.UIT.C,
config = { align = 'cm', id = 'cir_config_toggles' },
nodes = {
{
n = G.UIT.R,
config = { align = 'tm' },
nodes = {
{
-- Changes apply on restart text
n = G.UIT.T,
config = {
text = "Changes Apply On Restart",
scale = 0.4,
colour = G.C.RED,
align = 'tm'
}
},
{
-- Options columns wrapper
n = G.UIT.C,
config = { align = 'tm' },
nodes = {
{
-- First options column
n = G.UIT.C,
config = { align = 'tm' },
nodes = {
[...the rest of the nodes]
can u change this to C
no change
huh
it isn't making a difference
what about it?
can you take a screenshot of the code please thank you
my phone isn't liking it very much when it sees code
are you on the correct version of steamodded
is this the correct version?
nope
thats old
current release is beta 0305c, try updating and see if that fixes
you're on an old version that doesn't have xchips
well that explains why xchips wasn't working
like that's almost as old as the latest old calc
🥴
ui is pain
yes 
cirno
i could send you my ui thing if you want
i would be grateful if you did, thank you 

cirno :3
this may be correct
????
wtf 😭
「あたしヴァンパイア まずはこっちおいで」
8th Album「MANNEQUIN」Listen & Download: https://nex-tone.link/A00094938
2024年11月27日発売
9th Album「TRANSFORM」特設サイト: https://nbcuni-music.com/deco27
8th Album「MANNEQUIN」特設サイト: https://nbcuni-music.com/deco27/mq/
Music: DECO*27
Arrangement: Rockwell
Movie by OTOIRO
Director: ぬヴェントス
Illustration: 八三
Art Director: DMYM
Twitter:...
I'm so reskinning this
SMODS.current_mod.config_tab = function()
local scale = 5/6
return {n=G.UIT.ROOT, config = {align = "cl", minh = G.ROOM.T.h0.25, padding = 0.0, r = 0.1, colour = G.C.GREY}, nodes = {
{n = G.UIT.R, config = { padding = 0.05 }, nodes = {
{n = G.UIT.C, config = { minw = G.ROOM.T.w0.25, padding = 0.05 }, nodes = {
create_toggle{ label = "Toggle SFX", info = {"Enable Sound Effects"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "sfx" },
create_toggle{ label = "Toggle Crac SFX", info = {"Enable Sound Effects for Crac Joker"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "cracsfx" },
create_toggle{ label = "Toggle LeftHandedDeath", info = {"Enable Left Handed Death"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "deathcompat" },
create_toggle{ label = "Cryptid Compatibility", info = {"Enable if Cryptid Mod is Installed"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "cryptidcompat" },
create_toggle{ label = "Ortalab Compatibility", info = {"Enable if Ortalab Mod is Installed"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "ortalabcompat" },
create_toggle{ label = "Old Calc Compatibility", info = {"Enable if using Steamodded Old Calc"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "oldcalccompat" },
create_toggle{ label = "New Calc Compatibility", info = {"Enable if using Steamodded New Calc"}, active_colour = Fortlatro.badge_colour, ref_table = Fortlatro.config, ref_value = "newcalccompat" }
}}
}}
}}
end
Fortlatro = SMODS.current_mod
Fortlatro_config = Fortlatro.config
Fortlatro.enabled = copy_table(Fortlatro_config)
local config = SMODS.current_mod.config
her base speed is at 125 so she can actually self-retrigger without help from other jokers
had to send that multiple times but there discord finally let me send it
maybe dm wasn't open for them
no i was trying to send it here
probably discord formatting since discord was being a pain
the coding is light but the discord is dark
dark mode for notepad++
yin yang type shi 😭
Yeah, the asterisks were translated to markdown and everything between them was italicized
That's why you always enclose code with ```
i think the text he's sending was approaching 2000 characters if you add ```
it happens
oh well, at least i got the trampoline
so thats why discord wouldn't let me send it
it's been like this ever since i started using Discord
it seems fine
newlines and whitespace are included in the count, so it's actually more than that
how do I grab the name of the current poker hand
i could look for throwback's code but this seems a bit easy
Also this probably happened, causing the error
yup it was entirely my fault for running old ahh smods
god fuckin damn it :(
i doubt most people are doing this but it works lol
I mean, I think old calc is gonna be completely obsolete pretty soon, if it isn't already
i feel like old calc is mostly used only because of jen almanac
yeah well jen can't read so
i mean im on old calc but if i actually updated stuff like i should i could probably be on new calc lol
You'd save a lot of hassle by just jumping ship and supporting only new calc
is there a way to pull the price you just paid after buying something from the shop? looking to make a joker that deals with a % chance to refund after purchase.
out here running versions of stuff from 2024 because i never updated anything past when i modded balatro 💀
thats a lot of mods
Do you download the zip or clone the repos
is there a way to make a deck apply Splash without having Splash 💀
the zip
yes hello

you can patch it
the splash man
pretty easily
If it was the latter, I have a script that updates everything all at once lol
check my mod's lovely.toml
i have the exact unbeatable patch
you just need to check what deck the player is on there
Can anyone help me with a concise way to phrase something?
"Gives X1 Mult for each hand size below 9
(Currently X2 Mult)"
Primary concern is that we can't specify "cards in hand" because you can have cards not matching your current hand size (such as by using Cryptid, multiple DNAs, or hand size reductions while you still have max cards in your hand). But "each hand size below 9" sounds off
if only balatro modding was like lethal modding then i could just press the handy dandy update all button lol
what app is that? I used R2modman in the past for lethal
this is the said patch right?
eh, it targets splash fusion jokers
yeah
you just remove the for loop and change the if condition
to if you have x deck selected
oh yeah and remove break
it would work if people were uploading stuff to thunderstore but balatro modding seems to be mostly a github thing
how do I specify x deck 💀
yea, attempted that too but haven't found the correct solution
look at cardsleeves
the sleeves check if you have x deck selected for stack effects
anyway play fortlatro very cool and very badly coded fortnite x balatro
Is it possible to implement rescoring
Like after scoring all cards, all cards will be scored one more time, including Joker interactions, etc
nice
I got it thanks 
what do you expect
i mean i have a seal that can make the played hand not take a hand and another seal that can return to your hand among other things thats like rescoring sort of?
Okay, need quantum enhancement help:
if context.check_enhancement and context.cardarea == G.jokers then
if SMODS.has_enhancement(context.other_card, 'm_lucky') then
return {
['m_glass'] = true,
}
elseif SMODS.has_enhancement(context.other_card, 'm_glass') then
return {
['m_lucky'] = true,
}
end
end
end```
This code is crashing the game, I assume from infinite loop, because it's re-proccing the check_enhancement context when the new enhancement is returned? Why? Shouldn't it only do it once, since it's expecting the return table to add the new enhancements?
maybe add and not too?
is this the correct way to allow Splash clones without Showman
I'm confused because the API did not provide a structure example
i want to make cards that will give from x1.02 to x1.1 mult when they score. 
Still crashes, argh
sadge
What do quantum enchantments do?

allowing cards to have more than one enhancement
I have a deck that glassify all cards before they score
and it doesn't use quantum enhancement oof
-# i think
oh, so that's what quantum enhancement is
basically, what they are doing is making lucky cards count as glass cards, and vice versa
I'm so dumb
mfw i break the lucky card
but the thing is; i dont even know a single mod which uses quantum enhancements 😭
I guess I just have to only consider the main enhancement? I guess???
so if i were to add quantum enhancements, i wouldnt even have any reference to look at
which kinda sucks
I'm thinking about what lucky card will do in my mod...
Maybe 5 chips for each $2 and 15 chips for each 2 probability 
I guess SMODS just doesn't expect you to be able to chain multiple quantum enhancement effects (I.E. a quantum enhancement makes a card considered lucky, and this joker then makes it also be considered glass because of the quantum enhancement)
Because it calls the check_enhancements context when you use get_enhancements, which is how you add the quantum ones in the first place
Do you know how to end the run under any condition?
oh, theres a function to force a loss
i remember seeing it, though i cant recall what its called
how feasible is this 4th suggestion? i think it would be pretty cool if i actually figured out how to do it imagine having 2 editions on a card lol
maybe check debug plus
havent seen someone adding 2 editions onto 1 card before
neither have i which is why i question if its possible lol
nothing is impossible, but maybe it involves some patching and hooks which can potentially make your mod incompatible with other mods ❤️
Maybe with quantum enchantments it will be possible to make a system of card levels?
For example, when you put a bonus card twice on one card, and it gives 100 chips
i don't know
Still struggling with this
increases base chips of played cards
I don't usually look at the titles.
maybe "hand size value"?
Having it be an equation also sounds odd to me
It permanently gives +5 chips for each played card
i have 2 jokers that do hiker flavored chips
-# you didnt have to reply that
I'm talking about something completely different fyi
how do people actually understand the like editions stuff tho the code to make one of those look like anything makes no sense to me lol
Shaders 😔
I've done some shader stuff but mostly by copying other code, I am not a graphics programmer
best i got was asking chat gpt to help me with that one time and it created the color blue
it sort of helped, but unfortunately didn't 
BlueStone Card
Better looking elsewhere. There's lots of examples of shader code online made by actual people
I typically search for GLSL stuff since Love2D uses GLSL, just with some aliases for things
i refuse to rely on AIs to help me with coding honestly
eh it depends really sometimes the ais help
and other times they give the worst code ever
progress, but now the box desperately wants to be really wide and wants to put everything to the left despite no left alignments.
rip
without the maxw in the root holding it back, it just does this
like, this scale is correct but it shouldn't be trying to make the ui so wide? i don't understand why it wants to be however wide it's trying to be
but when i clamp the size with max, it scales the text weirdly


I'm skipping lunch because of this shit
who else but chat gpt could create such random fails
first person balatro when fr (in the first one moving my mouse around would move the cards)
never used take_ownership in my life 💔
sorry
this is a lot of splash stuff you're doing
do you have a permit?
its the splash cops
my next deck retriggers all played cards for each copy of Splash
and it's a themed deck, not direct copy from your mod
i don't genuinely mind it at all
but i would watch for incompatibilities between my mod and yours
THE SANDWICH WORKS!!
alright so
next time you record balatro
please enable streamer mode on discord
lol
i just use the snipping tool 
very cool
it can
Oh my god it can
can take_ownership cause conflicts if two or more mods use it on a single object?
now I want to make a balatro mod that replaces the Xmult sound with a Discord ping
it's useful so i dont make video clips every time
How would I go about grouping cards together into a category? I'm trying to make a custom collection of ranks that would be categorized into their own group, like Face Cards.
make it a joker
I would assume yes, but only if two mods take_ownership and replace the same areas of a joker
I do take ownership of Splash, and I replace add_to_deck, remove_from_deck and calculate
it shouldn't have any conflicts with what you're doing
💀
I want to do that too
it's very hard to verify
just as a native feature of my mod
you can't use DebugPlus to spawn Splash and reroll shop to test
because the game seed doesn't care about external additions
you could use brainstorm
use that reroll mod yeah
to auto-reroll until it finds splash?
oh, and uh
use something to decrease the reroll cost to 0 too
debugplus eval ease_dollars(100000000)
-# quickest option would be to download cryptid and use that one exotic joker
i guess that could work
imagine your luck sucks so bad its not enough though 😭
Ig Crustulum should help in debugging
ouch, game crashed
I don't have time to debug the crash dammit
starving rn
i'll figure it out for you so i can put it in my mod as a base feature
Is it possible to make a category/group of cards ala face cards? I know how to make custom ranks, but I want to group them into a group

maybe I'm doing something wrong
calling it from SMODS.Joker:take_ownership(Splash) instead of SMODS.Back doesn't sound right, does it?
gah, there's no example for this

okay well
i tried your method with my working take_ownership
tried the reroll method for debugging it and balatro hard crashed before brainstorm found splash
then i had a better idea
just spawn a bunch of riff raff and let them make every common joker
eventually, the only joker they make should be Splash if this is working, since it will never fall back to jimbo since splash is always available
(spoiler: it didn't work)
did you roll all spawn jokers to negative to allow room for new ones
i gave myself 300 joker slots with debugplus
i didn't run out of space, it just started spawning only jimbos
so it hit the fallback, meaning it spawned every joker it could
so yeah i'm not sure
how would I go about making an enhancement that doesn't allow itself to change to any other enhancement?
the main problem still persists
how do we work with this info
I hate my life so much
I could've just asked AI to explain the API
and here's the code
Tbf, it is in the docs for Jokers
I really want to make a joker that gives a xmult equal to the current round, but where if you don't win on the first played hand you play, the round ends 
I have reached 50 of 90 completed jokers for my mod!!
nice :D
guess I have to learn the basics of Lua 
at first I only intended to work on localization
i didnt know you were working on a content mod too, actually
only knew you through #1250676786040148042
:3
all thanks to a youtuber who managed to spread my Vietnamese mod to those who aren't good at English
i think one of my friends is using that mod too
still on this is anyone has any potential insight
Yoooo congrats
The harder part of making the Jokers for me is honestly the art
hook Card:set_ability and prevent it from being called if the current/previous center is your enhancement
(Note: it will also mess with quantum enhancements)
I see, thanks
i'll have to look into hooks a bit more, i've mostly been doing patches
only hook I currently have is for a castle-like card that references almost directly from the jokers documentation
patches would work as well of course, they're the more powerful tool
you can just return early
cat rank
ah, yeah I assumed so, just wasn't sure if a hook would be safer or something like that
good afternoon everyone
I wish there was a way to use brainstorm and search for exclusively triboulet or chicot instead of perkeo, but it looks like I just dont entirely understand how immolate works considering that my brainstorm edits didnt do anything (at least they didnt crash the game)
And i obviously manually added toggles for both chicot and trib into ui.lua, as well as at the top of brainstorm.lua
when can we have sleeve sleeves...
@tall wharf
yeah
Making it permanent at least makes it better than the old version
I wouldn’t play with it but I think the design is better and more interesting
sricker
hi, how do i get the round number?
Good evening everyone
good afternoon, modpack man
Currently making a joker and this error popped up. Any ideas? First image is the error, second error is the Joker I am working on
are you checking if target is not nil
Doing print(target) and these information came up. Don't really see anything that relates to the target playing card
I don't know if the position of the copying card section is in the wrong spot or the 'if'/'for' statements are all not correct so its pulling wrong information
cards are actually huge tables of tons of data, this is normal
A huge table, which breaks my brain on how to get this code to work. At the moment, I want it to duplicate a random scoring card upon playing the first hand that has at least 2 scoring clubs. Currently breaks and gives the above error (And a whole bunch of others for something reason) upon playing 5 club cards at first hand play
Joker that gives x0.5 mult at the end of the round, but destroys 5 random cards 
I have an idea for an edition.
Double Edition.
Doubles the effect of a joker/card/consumable like a blueprint, but takes up one more slot

For example u can have Blueprint Joker with Double Edition, it will work how a two Blueprint Jokers but also it will take two Joker Slots 
Or if this edition is on the card, you can use only 3 normal cards and a one Double Edition card in the hand and this card will work how with a red seal
the uhh target part, why are you using pseudorandom_element on just one card?
im pretty sure this breaks things, since pseudorandom_element chooses a random value from a table
and in this case, it chooses something from the card like its position, center or smt smt
you can just do
local target = pseudorandom_element(context.scoring_hand, pseudoseed('lycanroc_copy')
i think
which will choose a random card from the scoring hand
(bump)
you might want to expand your question a bit! What do you mean with ''the round number' ?
like, the number on the bottom-left that says "Round"
like, the first Blind you play is Round 1
etc.
Thanks. Kinda just copied and pasted the code from DNA mostly so got a little confused.
oooh, yeah, that makes sense, haha, i was confused by round numbers also meaning something else 😛
Probably accessing the table it’s in
I think it's literally G.GAME.round, no?
will try ^^
Idk
modulo is % in Lua, right? just checking
I think some values are saved directly where they are displayed
Yes
God, I still seem to be unable to remove cards from the deck in context.after, it's impressive how difficult this seems to be
Remove how?
perfecto, that worked - thanks!!
why do you need to remove them in context.after?
what's wrong with context.destroy_card?
[the ability i made: +$7 on odd rounds, +$1 on even rounds]
if they're in the deck you can just call remove on them
Because they're not being destroyed, haha
are you on latest steamodded
They're being moved to a banishment-esque cardarea until the end of the blind
🤨
You might need the optional deck context
Also
context.destroy_card actually only proceeds to destroy the card after all the calculations are done
so why does emplacing it not work?
You should set card.getting_sliced manually
oh
so you can just set the card to be destroyed in joker_main, before or wtv and it should work :D
I can't figure out why. It has something to do with the way events are ordered
That's how I handle destroy functions, yes!
But I'm not destroying cards, haha
What are you trying to do?
I have alien jokers that can abuct any card object for the rest of the blind. So I'm trying to have them abduct playing cards under specific circumstances
this is what i did to destroy cards
(addToDestroy is actually just adding the card to card.ability["card_to_destroy"])
What’s “abduct”
Which works if I don't mind the visual jank, but I'm trying to fix the visual jank currently
Coding-wise
It's a separate cardarea that's outside the deck/playing cards, in which cards are stored and accessed for the rest of the ante
and in the context.destroy_card part, i did this which works :3
I think you should be able to just draw the cards to that cardarea at the time the Joker abducts them
Which might require an Event to time it properly
You'd think so, but the event timing is very tricky to get working
Ok so there's a G.GAME.blind.boss but is there a context for small and big blinds?
Also I suggest looking into Card:can_calculate
What timing do you want?
You can test if the Blind is a boss or not
Blind.showdown
IIRC
I need a effect to trigger only when small blind is selected
no
madness' effect is not what I want
I’ll repeat what I said
G.GAME.blind.showdown == true
You can manually check what the Blind is
good table, everyone
Well, before the cards get moved to the deck, but after they're destroyed. I've currently got it structured as a function that sets a Before event, triggerign right before the draw_play_to_discard is called
You won’t want to look at that variable
But at the Blind name or key
G.GAME.blind.boss.showdown == true
To verify that it’s the Small Blind
And I can't figure out why the emplace and remove doesn't properly work there
is this real chat
??? wierd naming but Ig that'll work
sorry that confused me
I don’t remember how thunk names them, but you either check the key or the name. I recommend the key but thunk does everything by name
so for small blind I use G.GAME.blind.showdown == true
what's for big blind?
Does it need to be this timing?
No
It's the only way to avoid cards being abducted crashing destroy funcs, and removing from deck is my fall back option but would need a whole different set of event chaining for any visuals to make sense
The Showdown Boss Blinds are the final bosses
It’s not the only way
That's probably true
Although I can’t remember if I integrated that into Card:can_calculate, you can see if “yes” then hook or patch into it
That’s what the function is for
Take a look at the closed PR
showdown ones are the ante 8 bosses
I guess I could make it so the destroy functionality checks for potentially being marked to be abducted. But honestly, it also makes a lot more sense gameplay flow wise to abduct after destroy effects
As I said
I'm once again confused, why I need to check if it's a final boss? I need to check if it's a small blind
You don’t
That was the first thing I said because it’s the first thing I predicted
Because checking for specific Blinds is the same as checking for any other specific object
Just look at the key
-# or the name, in theory
-# (don’t do name)
So there’s nothing Blind-specific about checking for Small Blinds
Actually
I think it should only try to abduct cards that won’t be destroyed
Which Card:can_calculate should help you with
As it’ll ignore cards set to be destroyed*
That's fully dependent on the joker effect, but that's probably true.
I'll look into that regardless, because that's a good failsafe
The idea is that
If a card is destroyed it can’t be selected
But the actual destroy is only shown later
To the user
I'm sure my current code will also start bugging out once I have sufficiently complex abduction jokers interacting with each other, so I should generally start considering fail safes
But you can imagine that it’s already been destroyed for the purpose of other effects
I’ll keep telling you to use Card:can_calculate because this is the exact situation it was made for
:P
Yeah, I'll add it for sure, haha, it's just that it's only part of my woes, timing-wise, haha. I'll test if running the code before the destroy timing (without checks) works first, and then I'll get to implementing can_calculate, haha
You shouldn’t need to implement much
I assume it'd be a single call with some context for it to check yeah
Actually it doesn’t have a context but maybe it should
It has at most one Boolean argument
For the timing, you’ll probably want to patch it so abduction is handled at the right time
I'm currently trying to find out where that moment would be, yeah
Something that I am wondering about is whether cards can be in multiple cardareas at once, even? Or if that's just a reference being broken, if the game seems to indicate that?
I don’t think they can be, but I think the card could be in one CardArea but think it’s in another
I'm suspecting that the cardarea thinks the card is still in there, somehow
That could be part of it too
How are you moving cards?
Are you using CardArea:draw_card_from (or to, I can’t remember)
an area:remove_card and an area:emplace. draw_card_from doesn't update the playing_cards list, but I guess i already do that manually. It didn't work in an earlier test, but that may have been a timing issue still, so I should try it again
I think you’re doing it the wrong way
You should use CardArea:draw_card_from then manually remove them from the list
I couldn't find the key I'm sorry😭
I may have been led astray by this working as intended if I didn't mind the card disappearing visually during the scoring, haha
Look where blind data is defined
You might find it looking for e.g. bl_goad
I imagine it should be bl_small
it was
but it doesnt work
the draw_card functions all take generic cards, rather than a specific selection, right?
🤔
What do you mean?
How did you try to access it?
oh yeah, i cant help but notice this after a while of using your multi text box thingy, sometimes a line can be really close to the border of the box
my understanding is that I can do Kino.abduction:draw_card_from(abductedcard.area), but I can't specificy which card needs to be moved
You can
Maybe not that function
Why localize(card.ability.extra.rank, 'ranks') gives ERROR?
as a context?
it's also worth noting that those functions internally do exactly what I'm doing, in calling a :remove_card() and then an :emplace()
localize is getting wrong arguments I guess
What do you mean?
I’m not going to write G.GAM…
You know how to access the instance of Blind you need
So I just need to name the parameter of the class
if my joker is retriggered, then shouldnt this also be retriggered for all played spade cards?
nevermind, its not even retriggered at all this time
weird
before updating smods it at least worked for the first played card
chat is there a way to listen for a tarot card usage
and like what kind
i know like there's a vanil joker that gain mult when any tarot used
There’s a context for using consumeables
but like i want to make a Joker that scales whenever Wheel fails, but suffers big penalty if Wheel hits
You can test if a Tarot was used
welp, seems like i gotta do a workaround for this one
Or if a specific Tarot even
save how many times my joker is supposed to be retriggered into a var, then return that in the context to repeat playing cards
Idk about seeing if Wheel succeeded or failed though
like Gain +3 Mult if Wheel of Fortune fails, halves it if Wheel of Fortune hits
That might need more power
Joker where whenever Wheel fails, you lose $2 and immediately spawns another Wheel
the true gamba joker
Hmm, it seems the destroying card functionality also makes explicitly clear that a card is being destroyed to the function that discards cards after playing, because its timing is that whacky. The function is entirely related to the way that the event timing works, as cards that are destroyed are also still retrievable in G.play by the game. So the solution is to add a check to those functions, seemingly. Which I suspect will create some compatibility issues with other mod's patches, but alas
Maybe you can use can_calculate and write a SMODS PR
I think it'd probably be a good addition to SMODS, but God I don't trust my code to be used by other people that fundamentally, haha
I think the relevant part is the check if the card can be moved, which ought to use can_calculate IMO
And at least it’s good to have feedback for
What would someone use can_calculate for
Since it’s not a vanilla method
But it’s something that helps mod be compatible
help chat different question
how do you check what enhancement a card have when playing/discarding
Going to massively refactor this code because I'm sure my trying to solve something I don't fully understand has made it a lot more bulky than it needs to be, but it's finally working properly! Look at that, 1 card abducted, so only 51 in the deck!
and related question, how do you check how many card was discarded
SMODS.has_enhancement(whatever_the_card_variable_is, "m_MODKEY_KEYOFENHANCEMENT")
you can check the .discard or the .pre_discard context, depending on what you wanna do!
See the wiki
How can I get the number of Negative cards the player currently owns (full deck + consumables + jokers)?
SMODS.Enhancements
Iterate and count
for these kind of things, the calculate functions page is generally really handy. If you know what specific thing you want to interact with, ctrl-fing a keyword (like discard) is a good way to go about it
https://github.com/Steamodded/smods/wiki/calculate_functions
Oh, it was about the enhancement check, yeah for that check the page about the specific object type is handiest!
Also I say to look at the wiki because I know the info is there but I don’t remember it
So I’m not gonna give potentially wrong info when I know where to find it
@zealous glen was the can_calculate function you added only recently pushed?
oh wait, i'm checking an old commit of smods for some reason that I can't explain, haha
Yes
Hey everyone! I'm new to modding balatro (as in making a mod, not actually modding the game), and I'm having a bit of trouble figuring out how to code the cards that I want to create. would anyone be willing to help me out? (I've only really coded in java, not lua)
Have you checked out the wiki
obligatory cat image
oh, I did not know that existed, Thanks!
how would i make it so that duplicates of Jokers can appear in shop? I wanna make a voucher that functions similarly to showman but idk how to make that work
voucher spawns a negative eternal showman
patch the code so that the part that checks for showman also checks for your voucher
yoooo
So happy with that effect, honestly, just wish I was good enough with shaders to get the visuals to be real juicy, haha
i could do that but i also don't want my voucher to allow duplicates of like planet cards and such
just jokers
then all you'll have to is nest another if statement in that checks for jokers!
i see 👀
i say that, i just checked, each card type checks for showman separately
it's not even an additional check
just a patch that replaces the joker check
common_events
i see
after a lot of tuning, i think i got it
goal of code :
-
count how many cards are being discarded
-
if it's a wild card, add 1 to a counter
-
if they're not a Wild card, set the string
suitFoundto the suit of the non-Wild -
if exactly 2 cards are discarded, and exactly one of them is a Wild, set the bool to true
crash log from code :
am i stupid
you're using context.other_card, but there is no other_card in pre_discard
Your code in this case wouldn't be able to tell you which card you're trying to compare things to. in this case, if v is the card you're currently checking, what are you trying to compare it with? Which card is other_card supposed to be?
i just copied some code and stiched them together
honestly forgot im in an loop with i and v
would i be able to add an edition to jokers in the shop if there is already a copy of that joker owned?
no clue! I haven't checked the code for card creation too thoroughly, sorry, haha
incremental combination joker
if you have two copies of the same jokers with the same edition next to each other, they combine into one and upgrades their edition
two holo merges into one poly kinda beat
imagine
Besides storing the entire card object, I assume objects have a unique ID, right? Does anyone know the way to get that ID?
how does the calculate function for vouchers work? is that what is used for stuff like observatory?
okay i've changed other_card to simply v and now it doesnt crash on any discard
it does crash when discarding a wild card though, which i kinda need to not happen
what line causes the crash?
context.v
context is a table that is passed along by the code when calculate is called. So, there is never a context.v
In this case, your v is already defined as well, you're v is the card currently looping from the G.hand.highlighted
if things are connected by a . they're basically contained within the other
okay
the checks works
it is correct triggering when 2 cards are discarded and 1 of them is wild
that was the easy part im just stupid
now comes the hard part
how do i convert the suit of held cards in hand
a la Sigil or the suit Tarots
SMODS has a change_base function
oo
if the base game has an effect that's super similar to what you wanna do, you're lucky, SMODS probably has made a way to make that easy for ya!
Watch "retrigger_joker fix with retriggering Playing Cards (w/o patches or hooks)" on Streamable.
every 100 speed retriggers the Joker once, and you can see that it now works with retriggering playing cards too
surprisingly enough, no hooks and patches were needed for this
and it seems to work pretty smoothly
Would it be possible to create a mod to play 2 random cards every 10 seconds if there is not hand played in that time?
Like can I mod the game so the game makes an an action?
yes, definitely
Nice! What object makes the actions? Is that G? I can’t figure out how to automate an action 😕
i think you would register an event
drained joker looks cool asf, but i still think i'm not doing what i need to do correctly. This is what I coded for my lovely patch, v_pm_replicahaver is my voucher
payload = '''
elseif not (G.GAME.used_jokers[v.key] and not (next(find_joker("Showman")) or G.GAME.used_vouchers.v_pm_replicahaver)) and (v.unlocked ~= false or v.rarity == 4) then
'''
you can also look at the boss blind that discards two random cards
Ooh ur right thank you, that is definitely what I’m looking for
G is the entire game. I'm not code savvy enough to immediately explain how you'd do this, but I think what Luma's saying is the way to go, yeah. You'd register an event that's a timer that ticks down to 0 while in a blind
ok it's not converting the card swhat am i doing wrong
what's going wrong?
G.hand is a CardArea
Ya Im going to explore all the actions the game can automate, I feel like “bullet” (like chess) Balatro would be a fun time
the cards in G.hand are in G.hand.cards
ah ok
That'd definitely make for a fun mod!
so much to learn
joker only shows his face when the game fails to find a suitable joker to generate, I have a copy of almost every joker in my mod, and I turned off the generation of vanilla Jokers. I also redeemed the voucher that allows me to find copies of Jokers, meaning that the voucher isn't doing anything, because otherwise, the game would've just generated a copy of whatever joker like showman
Nice! I’ve just started modding like a week ago so I’m getting caught up on code base but looking forward to some fun ones!
yippe the card ganges
now i need the cool animation
where in the wiki do i read about card animations
I haven't given enough time to understand exactly where and when showman does it's thing, but I suspect you're patching only a singular instance of it, while it's impacting more than that 🤔
which card animation? idk if the wiki has anything on that, but i know a few of them
the usual suit change animation
would work fine
since i am changing suit
you know when it flips over and then flips back
I don't think that's a precoded animation. But that behaviour'll be in the tarot code
card:flip() will flip it once, so just have an event manager flip once then having it flip again after
in game
How do I make my Joker shake under certain conditions like Loyalty Card does when it's active?
hmm maybe i need to check the dump first
they each rank 9 chips for the cats 9 lives
juice_card_until i think
you can find more about it in sixth sense’s code i think
yeah, you create an eval function that checks your intended behaviour, and then pass that to juice_card_until
So, how should the eval be made?
I'd check your lovely dump and just search for an example of juice_card_until
but
the suit conversion joker works
it changes the suit of the cards in hand
unfortunately, somehow, enhancements other than wild also stopped working
i have a mult card with seltzer and it is not adding any mult
??????????????
is this my mod fucking with the game or the game fucking with me
show code :3
...hm
it's given in multiple contexts, as scoring_name
probably something with change_base if i had to guess, i never used it though so i cant confirm
so that would be context.scoring_name right
its used for iterating on tables
its only affecting the cards that got their suits converted, right?
add a sticker
🤔
also i just ran into Hook and i have now found out that hook discarding CAN trigger the suit change
since it can hit 2 cards, 1 wild and one non wild
blind really said "
" 😭
thats cool tho, really reminds me of blindexpander
and i am keeping that edge case in on the basis that it would be funny as fuck if it happen to someone
correct me if im wrong, but doesnt context.discard run for each discarded card?
BC2.3 development starts today
yeah i meant to set the bool back to false after it triggesrs once but forgor
non-boss blinds with abilities????
hello, im trying to make a check (preferably in context.after?) for if the hand just played did not result in defeating the blind, e.g. the blind is still ongoing, but my code here
if not to_number(G.GAME.chips) >= to_number(G.GAME.blind.chips) then
gives me the error
attempt to compare number with boolean
it might be a talisman thing but im not 100% sure, anyone know whats up with this
you need a bracket
you should probably surround the comparison in parentheses
right now it is parsing as not to_number which is applying not to a number
aah i see
which makes the left side a boolean
yeah it works now tyty
oh also, how does retrigger_joker work? (sorry for pinging 😭)
this doesnt seem to be retriggered
off topic but modding balatro is my first experience with lua and I really don't see the value of having maps and arrays be represented by the same type because it's slightly annoying
or sometimes, when i switch up the order of the contexts, it only retriggers for only the first card
Is there some benefit to this I'm missing
what's a map
i love when i assumed card wasnt a table :3
basically tables but not an array
Tables do everything
lua isnt a strongly typed language (even less than javascript) so you can do whatever you want to your tables, objets etc
well yeah but I don't see the point of arrays explicitly be tables with integer keys
I'd really prefer a different syntax for them
do you have the optional feature set? gosh a lot of calc stuff is poorl/not documented
square brackets?
yeah, i do
square brackets do work afaik
t = {"a", "b"}
letter = t[0]
``` pretty sure ive seen this
actually hang on its not quite right
it still passes even when my score is higher than the blind requirement
which its not supposed to
well no the complaint is that you're making a table with { 1 = "a", 2 = "b" } which pretends to be a table but I'd slightly prefer if this was an entirely separate array type
imo i really dont see the issue with that
it doesn't really matter because yeah you can make it work like an array
lua isnt strongly typed so it makes sense to have 1 type do everything
c-like arrays dont exist in lua, everything is a key-value pair in some way
is there a function for just drawing cards
I mean my complaint was "would it be a big deal for lua to have an array type" and you're just telling me that "lua doesn't have an array type"
not specific cards i just want it to draw more
you can probably find it in the serpent's code i think
the boss blind that draws 3 cards
hmm maybe
there's some functions from drawing from cardareas in misc_functions.lua I think
hand_space = math.min(#G.deck.cards, 3)
you know what, i kinda dont like how for tables with indexes that arent number in order like:
table = {
["hello"] = "hi",
["good morning'] = ":3",
}```
theres no way to go from hello -> good morning consistently without the need of other stuff, since ipairs dont work
just use pairs instead of ipairs
try ctrl+fing for "draw_from" in that file? I don't have access to the source code right now but I'm sure there were some like that
yes but thats random
it is??
it is
pairs still run through the entire table, but the index it chooses is completely random
cool
@manic rune Continuing the conversation from #⚙・modding-general : the proposed modification doesn't work because extra is considered to be nil - for the record, the actual debuffing / rebuffing does work despite the previous version of the code referring to a potentially nil value. If I didn't include the nil check, that wouldn't have worked. That said, referencing it the way that you proposed certainly looks cleaner
that's not really lua specific map traversal is usually undeterministic due to how they work under the hood
uh, use card.ability["debuffed_card"] instead of card.ability.extra["debuffed_card"]
...its also the reason why my loc_var looks like this


