#💻・modding-dev
1 messages · Page 335 of 1
maybe you need to call that function that recalculates debuffs? idk
hm
bepis
hi dilly
hi bestie
How would one go about creating a new deck?
oh hell yea
SMODS.Front when
So.. how do i make a deck?
Nah i agree
It's actually not as bad as I thought
my blind text isn't showing up 😒
I have the keys right in the localization file and the object itself
it has a function and in_pool controls what cards are in deck
Blind = {
bl_fvb_the_jam = {
name = "The Jam",
text = { "All Weapons are debuffed"}
}
},
here's the code
indentation 💀
SMODS.Blind({
key = "the_jam",
atlas = "the_jam",
boss = { min = 2 },
boss_colour = HEX("E0569B"),
discovered = false,
recalc_debuff = function (self, card, from_blind)
if (card.area == G.weapons) and not G.GAME.blind.disabled then
return true
end
end,
})
also this
How would i for example create a deck that includes 26 random lucky cards
Not like the suit or number to be random
Just which cards are lucky
did you understand how the example works
Barely
here's one more like what you want but with glass
https://github.com/Steamodded/examples/blob/master/Mods/AbsoluteDeck.lua
you would need to add a pseudorandom("seed") < G.GAME.probabilities.normal / odds for it to be applied randomly
How could i make it always only apply to 26?
Have a bool that you flip in the loop and only have it do it if ts on one value
But I guess that's not random
Yeah
just have a counter
Maybe do a 50/50 chance and have a counter that stops at 26
or you can do pseudorandom_element 26 times
Just gotta make sure said pseudorandom_element doesn't choose the same card.
Which sounds like a repeat until loop.
yeah i would remove the card from the list each time
Alright, could anyone show kinda where i should put what?
Was more thinking of initializing a blank table, then have the pseudorandom_element occur in the repeat until loop which also contains an iteration over the current table to check if the chosen card is already added to the table... if not, add it. until is the # of the table equal to the desired amount of cards.
kinda hard to do without coding it for you haha
are custom cardareas not included in recalc_debuff?
recalc_debuff = function (self, card, from_blind)
if (card.area == G.weapons) and not G.GAME.blind.disabled then
print("hi")
return true
end
end,
this doesn't do anything
how much programming do you know?
oh
you should check out something that goes over the basics
you don't need a lot of knowledge about the whole language, but for modding balatro having a basic foundation is enough
Yeah i followed a tutorial on how to create a custom joker
something like this
local cards = {}
for i, card in ipairs(G.playing_cards) do -- this is to copy the table without modifying it
cards[#cards+1] = card
end
for i = 1, 26 do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
chosen:set_ability("m_lucky")
table.remove(cards, index)
end
But i cant find a tutorial for a custom deck sadly
I mean the basics of lua 
Where could i find that
uh
you could read the lua documentation
I'm sure there are videos on it too
I have a deck that leaves only the Aces out of the 52 cards available, if that is of help.
Did you figure this out? I'm not at my PC but I have challenges that set this up in Kino
I should've scrolled up just ever so slightly, haha
Real
But yeah, that's how I do it too
damn im just copying ice..
at least my swirl color works 
Oh, actually, you should pseudoshuffle(cards, pseudoseed('lucky')) the table before doing the for loop.
what does that do
That seems unnecessary
-# That's what I do for my SPB Spectral targeting random cards.
you could do that instead of the for loop and just change the first 26 cards
but its basically the same
i want to check if a specific tarot is being used. am i doing something wrong here syntactically?
c_wheel_of_fortune
where should i put this?
Are you coding in notepad?
yeah lol
thats insane
notepad goes hard trust
please use a code editor lol
which one
how do i make a custom center render like a tag
alright
still have no idea where i need to put it 😔
wait nvm
i think i got it
like this?
or do you have something else in mind
i think?
idk im trying to make a menu that shows every perk you currently have active
probably better your way but wouldnt +10% accuracy fit better wording wise
idk what thats for honestly haha
is there a cardarea or such for booster packs?
there's a long debate in the modding chat from a few days ago, but in short: it doesn't actually matter
G.pack_cards
G.pack_cards
perks should be rendered like tags, but i am extending them from centers
dammir
sweet
I'm too fast
ye, i dont think wording matters that much its just my personal preference
whatever u like works cause its ur mod
:)
thank you 😭
+5% accuracy -5% miss chance
peak
someone was writing a damn dissertation in the other chat
people take moddin too srs
the main reason I like the text like that is because I get to avoid Big Number Go Brr
i feel like for this you'll probably have to create a new hud element for it
so, would this do?
--- STEAMODDED HEADER
--- MOD_NAME: Extra Decks
--- MOD_ID: ExtraDecks
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Adds a multitude of new decks to the game
--- PREFIX: xmpl
----- MOD CODE-----
SMODS.Atlas{
key = 'Decks',
path = 'Decks.png',
px = 71,
py = 95
}
SMODS.Back{
name = "Lucky Deck",
key = "Decks",
pos = {x = 0, y = 0},
loc_txt = {
name = "Lucky Deck",
text ={
"Start run with",
"13 cards converted to Lucky cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
for i = 1, 26 do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
chosen:set_ability("m_lucky")
table.remove(cards, index)
end
return true
end
}))
end
}
----- MOD CODE END -----
youre missing the first part of what i posted
so this?
Can you tell me how to output card.ability.extra.emult in a message?
indentation 
oh god that indentation
like, a message in the console?
???
if so you could just print it with print
wdym??
No, in the game, when the tally
like this?
much cleaner, yeah
yes but now you're missing the return true
you need this part before the }))
Sounds like me
okay, so this?
I think such design conventions exist for a reason
youre still missing an end
we can do cross mod content when my skill tree mod is complete :3
Are you indenting manually
you should download this https://marketplace.visualstudio.com/items/?itemName=sumneko.lua
no, i just imported that into it
How to output Emult in messages when counting?
this gotta be it right?
--- STEAMODDED HEADER
--- MOD_NAME: Extra Decks
--- MOD_ID: ExtraDecks
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Adds a multitude of new decks to the game
--- PREFIX: xmpl
----- MOD CODE-----
SMODS.Atlas{
key = 'Decks',
path = 'JokersTest.png',
px = 71,
py = 95
}
SMODS.Back{
name = "Lucky Deck",
key = "Decks",
pos = {x = 0, y = 0},
loc_txt = {
name = "Lucky Deck",
text ={
"Start run with",
"13 cards converted to Lucky cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 26 do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
chosen:set_ability("m_lucky")
table.remove(cards, index)
end
return true
end
}))
end
}
----- MOD CODE END -----
I'm going to work on making an option to change the text
why r there two local cards = {}
So people can finally leave me alone 
am i tripping
Anyone here have knowledge about vertex shaders?
if it comes to shader, i doubt anyone except eremel and like, 5 other people know about it winter
😭
Great. I'm basically just trying to figure out the most effective way to determine which vertex of a quad I'm currently dealing with in a vertex shader
I don't know how to declare or identify that information unfortunately
How to output emult in the message when counting
i cant understand your question, can you uh, be more clear about it?
does it show up?
Sup!! im trying to make my first mod
im making a tarot card here but im not sure how to make a function for it like making it create random jokers on use
Is there mayhaps an IDE that can show these functions as i write the code??
also what would i need to write to make that exact function work lol i have no exeprience in lua-
( dont ask about the big atlas i am gonna fix that)
no, it just crashes when i start the game
no IDE is going to show you everything but some like vscode will show you what steamodded has documented
🫡 we all start somewhere
what's the crash
Key is wrong*
It doesn’t break just doesn’t work like you expect
i used to use notepad++ i recommend using vscode though
oh is it??
wouldnt that work?? cuz on the api github it says tarot is one to use, or maybe i misunderstood
oh helo
trying to make something create a copy of a consumable used from a pack, it isn't triggering though, I think I got the initial calculate check wrong
When scoring, if there is a Joker with X2 the message "x2" appears on the screen, how to do the same with emulsion only?
so you want to make a joker that gives ^mult?
context.area instead of cardarea
well thats a problem with the atlas not my code 😛
“Not equal”
indeed! but i assume it would be nicer to have some help starting
the github doesnt give me enough info, at least notsomething i understand lol
i figured, but idunno how to fix it
key is the key of the object
You specify a key
so here it would be paper
or the_paper or whatever
Sweet, now it's a different problem, probably to do with this
It can even be caino
how does your asset folder look
Or gluttenous
.config.center.key
Or
dat makes sense
.config.center_key
I did, but here's what I did
yep cool now it works
does this work mayhaps?
now I'm having trouble with the other one
which is also just not triggering
Missing a comma
put a comma after the set definition
done!!
Now i shall try to figure out how to make it give me 2 random jokers
where shall i start
Judgement
Although SMODS provides an easier to use utility function
reference
oh does it?? how so
SMODS.create_card and SMODS.add_card
I recommend the latter
also some of my code is yellow now??
oh so do i go with the use(self, card, area, copier)? im not sure how to formulate it
add the steamodded folder to your workspace
i want to remove .25 xmult per card played, which works, but cards score mess it up, when playing a flush it counts wayy too many cards (from X10 to X3.25)
also i wan he extinct message to appear when the card reaches <1 but instead the message appears above the cards (once for evey scoring card) got the code from g ros michel in the example jokers by steammodded
oh okay
2k??? how- its just 35 lines of code cebee lol
because theyre from steamodded
ah that makes sense
whats inside the assets folder
warnings are usually inconsequential and just mean "hey you could be doing this" or "hey this might not necessarily work the expected way but it won't crash"
no idea
what did you change
nothing
oh
no my problem is that it was back before and suddenly it changed to decks lol
i agree that back is confusing and bad
okay it runs now but it still doesnt show up
How to display emult on the screen when counting
I mean it was thunk’s choice
point proven
So true!
how do i make the deck show up :>
it should show up with the code you showed
also it does give multiple warnings in my code
instead of returning emult_mod just return emult and get rid of the message
why isnt it showing up though?
the key shouldn't be Back
Thanks, it's working)
okay well I couldn't figure out context.debuffed_hand so I tried doing it manually and okay well it's still not triggering
then what should it be?
Name lowercase no spaces.
it works now, but it crashes once i start a run with my deck
do i need to set pseudoseed to smth?
pseudoseed("whatever")
You misspelled pseudoseed
alright, now this
Show your full deck code
--- STEAMODDED HEADER
--- MOD_NAME: Extra Decks
--- MOD_ID: ExtraDecks
--- MOD_AUTHOR: [CebeeDrawz]
--- MOD_DESCRIPTION: Test Adds a multitude of new decks to the game
--- PREFIX: xmpl
----- MOD CODE-----
SMODS.Atlas{
key = 'Back',
path = 'JokersTest.png',
px = 71,
py = 95
}
SMODS.Back{
name = "Lucky Deck",
key = "luckydeck",
pos = {x = 0, y = 0},
loc_txt = {
name = "Lucky Deck",
text ={
"Start run with",
"13 cards converted to Lucky cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 26 do
local chosen, index = pseudorandom_element(cards, pseudoseed("seed"))
chosen:set_ability("m_lucky")
---@diagnostic disable-next-line: param-type-mismatch
table.remove(index, cards)
end
return true
end
}))
end
}
----- MOD CODE END -----
Why do you still have local cards = {} twice?
Why did you swap index and cards in table.remove?
Tell me how to make the values change as on the misprint joker, I have it changes only after some action
i didnt, i think the program did that for me somehow
i don't know how misprint works
still doesnt show the correct deck image tho
this only works on scored cards, how do i make it so it loses X0.25 mult for every played card? like ice cream
you'd do it in context.after or context.before (depending on if you want it to immediately impact scoring or not), and iterate over the cards in context.full_hand
context.full_hand exists, was about to say.
It’s because your going over every card for every card but your returning so it only happens once.
maybe you have copilot enabled or something
thank you i was looking for that
you need to use the main_end field in loc_vars with a dynatext object
or main_start
smth like this?
atlas = "Back" in your deck
yes
nvm it does nothing now
the key field in the atlas and the atlas field in the back need to be the same
guys maybe i'm blind, i searched this discord and the wiki, is there a way to left align joker info text?
which ones do i rename?
the key in atlas?
or the one in the lucky deck
or this one
it should still be SMODS.Back
context.full_hand and G.play?
No.
this is my second joker i have no idea what those things mean, theyre nott well documented
imo
SMODS.Back needs an atlas = "luckydeck"
like, the description?
like this?
now it crashes when i start a run again
yes...i want to have a numbered list in there which obviously looks ugly with the default center alignment
i see a lot of align=cm in the source code but i'm not really sure where the source code for the specific joker popup is
send crash
like it would probably enough to know where the text from loc_text get's processed and put into UI in the source
i'll look into main_end
doesnt crash if its Atlas instead of atlas tho
but still doesnt show the right image
desc_from_rows?
ahhh perfect, thanks for the pointer, i'll try to hook into that i guess
can you post the whole code again
SMODS.Atlas{
key = 'Back',
path = 'DeckBacks.png',
px = 71,
py = 95
}
SMODS.Back{
atlas = "luckydeck",
name = "Lucky Deck",
key = "luckydeck",
pos = {x = 0, y = 0},
loc_txt = {
name = "Lucky Deck",
text ={
"Start run with",
"13 cards converted",
"to {C:enhanced}Lucky {}cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 13 do
local chosen, index = pseudorandom_element(cards, pseudoseed("pseudoseed"))
chosen:set_ability("m_lucky")
---@diagnostic disable-next-line: param-type-mismatch
table.remove(cards, index)
end
return true
end
}))
end
}
----- MOD CODE END -----
the atlas should also say key = "luckydeck"
you are going back and forth with changes for no reason lol
^ the "atlas = ___" line in your deck back should be using the same string as the key of the atlas you want to use
what should be there then? im not finding anything to base my code on
no, full_hand is actually a table that contains all the cards in your full hand! So you'll wanna do
if context.before then
for _index, _playingcard in ipairs(context.full_hand) do
card.ability.extra.Xmult = card.ability.extra.Xmult - 0.25
end
end
what is ipairs?
integer pairs 😭
ipairs() returns index-value pairs and is mostly used for numeric tables.
pairs() returns key-value pairs and is mostly used for associative tables.
have some patience i havent totuched lua 😭
you use it to loop thru an int indexed array
everyone, ipairs
this is starting to get bloated
Dear god
ipairs is what you use to loop through tables that only contain values, while pairs is used if it's a key-value set up
oh, is it unique ability per mod
I’d ask for my mod but I’ve yet to add more mechanics
So what about Fish?
just say it

all boss blinds are the fish
No Fish is Five of a Flush
The cards that get passed on to the context.full_hand (or context.scoring_hand, or any context, for that matter) are always just a table of cards by index, so there's no keys, which means you wanna use ipairs
For Victin’s Collection, I’d wait for new mechanics
G.play, as you were checking there, is only ever passed along as a variable named area or cardarea. the context.cardarea variable will be the only one that ever contains whether a card is in G.play or in G.hand, etc. So you never need to compare another context with G.play
How about one for my mod? 👀
what are you thinking
Either something to do with joker slots or Bakery cards
still only activates once (also, how do you do the fancy coder text in discord?)
triple back ticks
three backtics on each side (`)
haya
move the return to after the for loop
hi aikoyori can you add my mod to your joker
i see thakns
what are you thinking
i need to look into the mod content
first
and see what i can adapt
Currently trying to make my first mod to modify a few existing jokers
I managed to change the jokers themselves with lovely injection, but I'm not sure what is the best way to setup mod description
Right now I use <modname>.lua, which is essentially just a steammodded header with nothing else. Seems kinda jank, but maybe thats a fine way to do it?
if you want each card to display a message, you need to use something else than return, as return will end the loop here. I'd say what the correct thing was, but my approach is outdated so I'd need to check, but I'm hoping someone else can tell us before I actually need to open google, haha
you'll need to do a bit more work if you want the message to accurately show how much mult it loses, but that'll make the functionality work properly at least
yeah im looking for it
I looked through it, but its a bit overwhelming right now. I'm asking for some... On hands solution
Different mods have different ways of doing it
i forget how ramen behaves exactly, but i made an xChips counterpart joker that loses value for played cards as well, and i just keep track of how much is lost in a separate variable and then return that variable at the end
oh wow source modder please tell me how to use hammer for source
i feel like the right answer to that sounds like 'dont'
i personally use card_eval_status_text to display messsages outside of the return, but I think the current adviced smods way is some form of a calculate call.
First you install hammer++ and never touch hammer itself 
Doesn't portal 2 have a level editor?
Actually, idk if hammer++ have Portal 2 support. I mostly just do stuff for TF2
yes but if you wanna do something more
something with spelling out a profanity does something
you'll have to resort to hammer
Oh
(and it stinks)
I'll need a list of profanities tho
'fuck' 'shit' 'bitch' all the common profanities ig
instantly loses the game ohhhhyeah
You'd probably want to put that return table into a SMODS.calculate_individual_effect() and pass the currently iterated card as the target... so, something like this, iirc.
local effects = {card = card, message = '-X0.25', colour = G.C.MULT}
SMODS.calculate_individual_effect(effects, context.full_hand[_index], 'message', effects.message, false)
-# I could also be completely wrong... but return-ing in that way would only target the first card.
ive made it work already!
yay
it just says -X1.25 when playing 5 cards
which is good enough for me
That works too.
Hi guys does anyone know what function gets called when you change the contrast options in the collabs tab?
also i just dont understand this
i can try to make it look like ramen if you'd explain it a lil bit
why do you need this
Optimally, the way you did it is better, all things considered.
it isnt true to the vanilla counterpart though
thoughts?
Hold on I’m gonna need a PhD to understand this
i thought the "currently" would help 😭
I’ll be back in A + B months
I think you might need to invest in some alternate ui options if these description blocks are common, haha
ahhhh i'm so cooked 
How are the A B and C picked or defined?
you should use the new multi box feature
where you have the big line breaks you should ahve a new box, but I think the bottom one should be at the top
it's the most important
<@&1133519078540185692>
I mean, I assume that all the complexity largely comes from referencing mechanics that aren't on the card, haha
<@&1133519078540185692> kill him
voucher that took way too much effort (T2 is just 2x more of them)
they start at 4, 6, 4 basically
<@&1133519078540185692>
pew pew
Vonnegutted
You should use a button that can be held to display more info
well it's kinda complicated, basically I'm creating a deck that changes the appearance of your cards the moment you start a run with it and reverts back to your previous selected skin once you exit the run, it works just fine but I also wanted to change the suits colors dynamically but changing directly G.C.SUITS seems to overwrite G.C.SO_1 too... that's why I wanted to call the function responsible for changing the suits colors directly, but I don't know where it is
I used ALT
how many mods add periods to their descriptions and how many mods don't
Ah, what changes them
I add sometimes to split phrases
When I don’t use an empty line
ah yeah i need to look into those anyway, is there a good smods wiki page for it?
its on the localization page
I don’t think multibox will help much
but to sum it up, you know how the current description is a table?
just make it a table of those tables
I think it’s better to have only part of the description there at a time
Especially the unlockable ones
that's it? that sounds easy
is that also how people add extra boxes for referenced cards, like i would need to do here with black hole?
I don’t think they should be visible until unlocked
Maybe you can hold ALT to preview them
No
You probably need new localization entries for those
That’s what I do at least
honestly this type of joker would be quite hard to follow and understand properly in a run
if the tooltip already exists, the extra tooltips are done via adding to the info_queue table in the loc_vars function
unless thats the intention
inconsistent but i usually do add periods
yeah ideally i wanted them invisible or greyed out but this was just a mockup, nothing about this joker is dynamic yet
that was my main fear, i feel like it's unsalvageable and i should rethink my whole approach with these
To be fair you don’t need anything special for partially hidden UI
You can just use main_end
That’s a good designer speaking
the joker itself? haha, idk how to explain it, but that's already telling a lot 
Casual/fan projects usually have people trying to force ideas at all costs
Good designers just can them
i use periods if there are multiple sentences, but i never use a period for the last (or only) sentence
i'm open to everything here, i just want those five platonic solids to interact with eachother somehow, while also not being an exodia type of thing
(also these are the cards from familiar, not a whole new consumable type)
I think Exodia is a measure of parasitism
Platonic solids wanting other Platonic solids is parasitism
yeah i also read somewhere that it's against the design idea of the game, which i get - it's like "forced synergy", idk, localthunk had a better word for it
i don't have any particular suggestions, but paperback does have a somewhat similar set of jokers that buff each other. there's a set of suit-based food jokers that are all some sort of food on a stick, and they leave behind their sticks as a separate joker when they expire. each stick gives xmult for every other stick joker you have
Emergent design
yeeees that's dope, i was so happy when i saw this in one of my runs
but in that case, it makes more sense
it's like a serendipity secondary use of an otherwise temporary joker
How do i check if the player discards a specific suit?
hmmm i think i'll just go with that dnd dice suggestion, and make each of these platonic solids retrigger something randomly, and then they might synergize/snowball naturally
in this context, what would self be
G
G?
G.
hm
use if context.discard in the joker's calculate function, and context.other_card will be the card discarded. you can run context.other_card:is_suit("[the name of the suit]") to check for the suit
for this you'd probably want to hook onto init game object
so save the return table of Game.init_game_object in a hook, then add whatever values you want in G.GAME to that table, then return that table
i figured i could just use G.domain.config.card_slots
thank youuu!!!
are xchips automatically part of smods or would i need to implement that myself?
Yes, no.
yep, as of beta 0323b at least
works the same as chips/mult/xmult, just return { xchips = ... } and smods will handle the rest
card:set_edition(‘e_prefix_key’)
e_foil, e_holo, e_polychrome
alright that makes sense
i'm having a hard time finding this on the documentation on the github
yo.
most vanilla functionality is not on the wiki, you need to look at the code
ah
for some reason i keep getting this crash, its supposed to add a random card out of one in the list to the deck
is there anyway to remove the edition/enhancement/sticker/whateverelseyoucanthave2ononecard limit?
Quantum enhancements exist but you would have to do everything else manually.
There is no sticker limit, technically
They're all separate entities, some just preclude each other explicitly
4 in 6 chance to retrigger a random scored card 4 times - what would the rarity of this be? too OP for common?
Yes, definitely too strong for common hahaha
isnt there some sort of hook i can edit?
No, because all seals are stored in 1 variable.
okay then i guess ill tackle that another time
id probably just have to make enhancements that are combinations of two
Somethingcom is the seal expert, so you might wanna drain some of their knowledge haha
okay what do you think about this
1 in 6 chance to retrigger a random scored card 4 times
1 in 4 chance to decrease the rank of a random scored card by 6 (min: 2)
still seems too strong somehow :((
how do insert the card back into the deck? it's successfully in the deck but its just... chilling there 💀
open a standard card pack and skip it.
Honestly, my take on balancing is to just play with the idea as you've got it and time the numbers later, haha
seems reasonable
no my joker added that steel card (didnt come from the pack), i need it to go back into my deck lol
Emplace it in G.deck, not G.play, as that'll be empty during the shop
Quick question
Got this bug
Any ideas on how to remedy it?
Code?
this is what started breaking it
how do i check how many times a hand has been played
check telescope voucher code
G.GAME.hands[handname].played
and how do i make a consumable only spawn after a condition is met? do i use in_pool(self, args)?
Yes.
okay so
for example:
in_pool(self, args)
return G.GAME.hands["juh"].played > 0
end
like that?
I think so.
okay
apologies sent wrong code
SMODS.Joker
{
key = "Joetube",
loc_txt =
{
name = "Joetube",
text =
{
"{C:chips}+300{} Chips",
"If scored hand has only {C:spades}Spades{}",
"and/or {C:clubs}Clubs{}"
}
},
rarity = 1,
cost = 5,
unlocked = true,
discovered = true,
atlas = "jokers",
pos =
{
x = 8,
y = 0,
},
config = {extra = {chips = 300}},
calculate = function(self, card, context)
if context.joker_main then
local heartsfound = 0
local diamondsfound = 0
for i = 1, #context.scoring_hand do
if context.scoring_hand[i].is_suit('Diamonds') then
diamondsfound = 1 + diamondsfound
end
if context.scoring_hand[i].is_suit('Hearts') then
heartsfound = 1 + heartsfound
end
end
if heartsfound == 0 and diamondsfound == 0 then
end
return
{
message = "I just LOVE Lucario",
colour = G.C.BLUE,
card = card,
chips = card.ability.extra.chips
}
end
end
}
its happens/crashes anytime i play a hand
i think you should emplace it to g.deck
suggested to me by a friend from school
what is the return value of take_ownership()? 🤔
is it the same as if you instantiated something of that class normally?
i.e. SMODS.Joker() and SMODS.Joker:take_ownership() return the same thing
can someone help me with thinking? i feel dumb
if there's a 1 in 12 (8.333%) chance of something happening, but an additional 1 in 20 (5%) chance of it happening twice, what is the combined chance?
or is there no real "combined chance"?
emplacing to deck still doesn't insert it back to the deck
i'm just following marble joker and it seems pretty similiar
@rose dragon look, it finally happened
Okay, I'm running into a frustrating event issue
I need an event to not execute until the blind select anim and the hand drawing anim is fully finished
context.first_hand_drawn?
I dont have context
Basically:
I'm manually calling G.FUNCS.select_blind in a standalone fn, not as part of an smods calculate fn @daring fern
So idk where context is
Why?
Long story but im working on a control/puppeteering api for balatro
So I'm doing this in response to a socket message
nvm got it working
i just check for the draw_to_hand state
and keep relaunching events until its not
or the selecting_hand state, yeah
like once selecting_hand is the state, every anim should be finished
how can i do something each time you draw cards? i looked into certificate code, but i want it to be always, and idk how to get the context without jokers/cards
can any1 help me make a mod? I need help with art, balance, ideas, and programming
so basically everything lol
why does this not localize properly?
what do you already have?
the mod is called Scribbled, it adds an enhancement type only accessible via custom cards, It weakens the card, but allows you to de-scribble it with other cards, It will have synergies for being scribbled, and the scribbling cards it a more common way to dupe cards
ok, figured out another way to do this
ok mate id reccomend searching up the resources for beginners in the threads
wait ill link them if i can find them
use dictionary instead of v_dictionary for no variable items
What random elements are possible to access the outcome of before they happen?
I'm thinking of a Joker that tells you the outcome of some random events before they happen. The main things I want to access are wheel of fortune, judgement, sigil/ouija, and the top card of the deck. Also good would be the contents of booster packs.
i recall a little while back that someone made a joker that predicts the content of booster packs - might be some insight there
#💻・modding-dev message
ok does not work
still need help
i wanna make this brown is there away to add colors besides one for G.C.()
good call forgot HEX(hexcode) is a thing im trying to avoid misc functions being in main
I have utility for mod so I could add In there somehow?
is there a way to
i have a define.lua so idk if thats what it is tech
would u consider colors utility or a definition in terms of where i put
how does one create a joker from base balatro?
which one?
obelisk
set it up where you have context checking hands
this joker i made checks for four of a kind
then you can make a loop where if hand is the same reset it
cause ik how to do it for my jokers
not sure what u mean
hard to give u an answer when i have 0 indication of how youve built mod, sorry
ah ok
like ik how to get the joker i've made, but not the ones from base balatro.
so its not making the card?
this is throwing an error
ad
ah
this might help you in how to build set up my guess is the way youve set up keys
try 'j_obelisk'
also it is spelled wrong in ur code too
that honestly might be ur error watch spelling errors
u have no e
holy fuck its brainstorm
yeah i'm matching pfps with my girlfriend
i dont even have to ask what hers is
also thank you for the help
just to confirm, it is Zany Joker, Right? /j
killing you...
lol
Chile's! I remember these!!
I just had a good idea. Add some config's to the mod so folks can enable or disable specific aspects of my mod. Seems like a nice to have
is that not what i'm using?
you're using the base game one, smods one is a bit simpler
SMODS.create_card{key = "j_obelisk"}
How do most folks do attribution? I would like to add credits to the jokers that folks here made, and would like some ideas 🙂
I thought about trying to get jokers made by certain folks to have their names in place of my mod name, but I am not sure how to do that
alright
Or, it would be cool to add a INFO_QUEUE message. I will see if I can do that
how do I fix this?
was this AI generated
yeah i would recommend sticking to AI just for general programming questions and stuff rather than to code the entire thing because that's very incoherent
AI does not know how to balatro mod lol
lol fr i leard a lesson
AI is fine for general common programming basic things but you reall have to have an idea of what you're doing, otherwise it will generate reasonable seeming garbage
I've had junior devs try to explain what a PR is doing and...it's been awkward when they can't explain things
how do I make the squigglies go away
What if you tell AI to make modded joker ideas?
you do you but I'm personally against using AI for the creative side of things, that's supposed to be the human part
We typically do info queue messages
Like so
Currently making big mistakes
what if instead of friends of jimbo it was enemies of jimbo? meet george bush
Some people add another custom badge or a tooltip
I wouldn't recommend replacing the mod badge
It'd defeat the purpose of the mod badge
...well, technically, you could edit the mod badge to include someone alongside the mod name, be it separated by - or mod name in brackets iirc.
how can I make a mod that modifies the existing values of cards/jokers? like making jimbo make +20 mult instead of +4
Off topic but this art is kickass
Does it next require something special when use with not
if context.cardarea == G.play and context.individual and context.scoring_hand and not next(context.poker_hands["High Card"]) then
That will always be false
:33< are red suits republicans and black suits democrats
whats the way again for having context scoring to look for any hand with a pair instead of this where it checks if it is a pair
this code only triggers if hand is pair i want it to be any hand containing pair
:33< have you checked how the pair/two pair jokers or spare trousers does it?
where are the jokers in the balatro code?
card.lua
thank you 🙂
its all george bush deck
there were two decks made
one for bush and one for kerry
:33< id recommend opening the extracted balatro folder in vs code so that you can ctrl-shift-f to search for a given phrase in all files
:33< i c
i have it lol just didnt know where jokers are usually reference modded jokers it defines same way so im assuming im good
or wait u gotta do all hands dont u
how do I find the object key of an existing card? for example is the object key for hanging chad "j_hanging_chad" or "Hanging Chad"?
how do i check for face cards?
(upgrade sequence not written, the if is just confusing me)
every time you type that I just get reminded of this 😭
?
you forgot a comma
thats not
oh
the question 😭
im really confused on how to make a custom booster pack,
can someone send me example code?
best I can do is pray for you 🙏
booster packs are strangely difficult to make
for card is face does it apply to all 5 cards, i need to check if any of the cards aren't face
no, you need to iterate through the list yourself
...it checks whatever card you give it
what is the condition called for number of cards played
You might need to count them yourself? Idk just guessing
not :is_face()
no i know that
oh wait
#G.play.cards
I thought you were asking how to check if a card was a numbered card
no i know how to do that part
the issue is iterating through play.cards
I had a thought, a deck customization that changes the face cards when they become wild card enhancement. Is there any way for that right now or no?
I'll do you one better, open the lovely/dump folder in your Mods folder and you'll get to see all the SMODS-patched code. Or better yet, open the whole dang Mods folder and it'll recognize all the SMODS and vanilla functions and link them with your code files
for x =1, #G.play.cards do
thank you
what does this even mean
uhh how do i type the loop specific check for a face card im tweaking
(specifically how do i check in general Card x)
G.play.cards[x]
the thought is maybe when a card get the wild card effect, there could be custom face card art if it is posible
there's no built in functionality for that but I'm sure it wouldn't be impossible to make it yourself
oh ok
Let me know if you’d like a few working examples of boosters to help you
I got them working eventually I just have no clue how so I wouldn't ever be able to do it again
I’d like to add a new ux call out tonahndle crediting folks who contributed joker art to my mod, does anyone have tips on adding new ux info queue items?
I was thinking something similar to the sticker callout
localization file
I like it. That’s exactly what I have in mind
how do i add a custom rarity to a joker
rarity = "<mod prefix>_<rarity key>"
Which mod is this? I’d love to see how you did it
this if isnt working
not:is_face() does not exist
This is from Cardsauce, but it's done like this:
```info_queue[#info_queue+1] = {key = "csau_artistcredit", set = "Other", vars = { G.csau_team.gote }}``
The localization string is this, under descriptions.Other
name = "Artist",
text = {
"{E:1}#1#{}"
},
},```
oh doy i need to not the checkj
And I'm just feeding in the artist as a variable from a table
not G.play.cards[x]:is_face()
do i return mult = 0
Just dont return anything
also set the cards mult to 0 when a card is found to be face
assuming it works like obelisk
no this is face cards increment
og tea
Wow, thank you! This is a super detailed sample you gave ❤️
numbers do not
set mult to 0 when a number card is found
not sure what's going wrong here to make the joker's description not show up (the jokers effect works perfectly)
think i messed something up in the text or loc vars
wdym the description doesn't show up
like
Just no description?
pure white, ill get a screenshot rq
turns out the joker_main having the check is a bad place for it
at least i think so
how else do you think we're able to play it
😭
So I have a question, if a mod's jokers don't have mod badges is it likely because they're suppressing it intentionally or just missing badge_color or smth?
I have some jokers without badges and I hate it
Idk why anyone would do that on ourpose
I mean in my mod load out, not made by me
are they vanilla jokers
Lmfao, no. I would know, I did play the game for a month or so unmodded
Yes, for probably at least 100 hr
I unlocked everything besides all the stakes for every deck
@chrome widget
Thank you so much! I felt like getting attribution squared away was the last thing I neded to ship this thing!
Nods nods!!
Ayyy, finna be a new mod for my pack
dear modpack creators
please tell people who's mod your adding to your modpack that you are adding that mod to your modpack
Cool, I hope you like it! 🦝
Before, this only mostly happened if a mod was really old and hacked the jokers in manually, but I don't have any like that anymore
or else i will steal your teeth
I mean... I admit I don't always but that's because I add literally every mod I play with. If I get complaints I deal with them respectably
SMODS.Joker:take_ownership('hanging_chad', -- object key (class prefix not required)
{ -- table of properties to change from the existing object
config = {extra = 5},
},
false -- silent | suppresses mod badge
)
why isnt this increasing the retrigger count of hanging chad?
Dear god! 5 retriggers!!!
I want to know when my mods get added so that i am aware that people enjoy them enough to share them 🙏
just a test
I don't think it automatically checks for that value maybe
how do i make a specific list of jokers show up in a booster pack?
gotchu fam
Very fair. I don't have tmd atm, but if it's just a mod that adds decks, I ought to
question: how would i go about updating a value on buying something (most importantly a voucher being redeemed)
currently trying to make a "current money given" thing\
this works for like jimbo though because I can change the mult it gives on that but doesnt work on hanging chad for some reason
doesnt reset either
Can you be more specific?
So I have a function to only get jokers I added in the mod. So this booster has only the jokers I created in my own mod
SMODS.Booster({
object_type = "Booster",
key = "FickleFoxCollection",
kind = "Jokers",
atlas = "FoxModBoosters",
pos = { x = 0, y = 0 },
config = { extra = 4, choose = 1 },
cost = 10,
order = 3,
weight = 0.96,
create_card = function(self, card)
local randomFoxJoker = getRandomFoxJoker()
print(randomFoxJoker)
local getCard = create_card("Joker", G.pack_cards, nil, nil, true, true, randomFoxJoker, "Fox")
sendInfoMessage("creating cards for this pack", self.key)
return getCard
end,
ease_background_colour = function(self)
ease_colour(G.C.DYN_UI.MAIN, G.C.BLUE)
ease_background_colour({ new_colour = G.C.SET.PURPLE, special_colour = G.C.BLACK, contrast = 2 })
end,
loc_vars = function(self, info_queue, card)
return { vars = { card.config.center.config.choose, card.ability.extra } }
end,
loc_txt = {
name = "Fickle Fox Booster",
text = {
"Choose {C:attention}#1#{} of",
"up to {C:attention}#2# Fickle Fox Jokers{}",
},
},
group_key = "FickleFoxBooster",
})
bump
If you want to do something similar, then you can use these two functions
function getResourceWithPrefix(s)
local results = {}
for k, v in pairs(G.P_CENTERS) do
if StartsWith(k, s) then
print(k)
table.insert(results ,k)
end
end
return results
end
function getRandomFoxJoker()
print("getting a random fox joker")
local allFoxJokers = getResourceWithPrefix("j_Fox")
print ("received list of " .. #allFoxJokers)
local randomJoker = allFoxJokers[math.random(#allFoxJokers)]
print ("random joker shall be ".. randomJoker)
return randomJoker
end
specifically, trying to make it so when you buy a voucher, the joker will do a calcuate function to update the amount of money you're getting out of it (so essentially what context do i check for in a calculate() function for a voucher buy)
So sorry if this is awkward, but can that be disabled? It's just kinda weird with so many mods if one singles itself out like that with its own joker packs
perhaps do a config for that, i'm pretty sure togas does that too
it is
If you want it to only have certain jokers, then you could do this, change the create_card to this. For this example, it would make a booster pack full of golden jokers, lol
local getCard = create_card("Joker", G.pack_cards, nil, nil, true, true, j_golden, "Fox")
sendInfoMessage("creating cards for this pack", self.key)
return getCard
it does technically add other things but those are deck-specific
midas pack:
That is on my menu! Adding Configs to turn off custom sound effects or disable things like the custom boosters
Bettma's has collector which lowers the blind requirement by 4% for each voucher redeemed
nvm, context.buying_card should do the trick. will look at that if things go less than well
Ayy, nice, modularity is king
this is how making ui feels
There seems to already be a G.game variable for vouchers_bought?
that wouldn't activate anything when a voucher is bought tho
It seemed like they just wanted something to change based on how many vouchers had been bought. I might have gotten a bit confused
from my understanding they wanted to calculate something when vouchers where bought
yeah i did NOT explain that well
i had the thing working right, i just needed to update the joker so I could update the amount of money shown on the joker
think ive got it now dw
You could write a lovely patch for common_events and patch in to line 1362
Just adding that onto to G.GAME as another var would be the easiest way. This is pretty much what I did to publish the ToDo list hand as a global variable
Oh I see... so yeah you just needed a context to force the update
Makes sense
oh, nevermind, sounds like you solved it!
making my one crash sacrifice to not adding a comma per change
i got this :(
StartsWith seems to either be their function or loaded from a lua library
SMODS.Joker:take_ownership('hanging_chad',
{
config = {extra = 5},
},
false
)
why isnt this causing hanging chad to retrigger more times? the text on the joker doesnt change too unlike for jimbo
it doesn't crash when hovering over it so that's good
the problem is i dont even know what it does qwq
I presume it's the same type of thing as this startswith function, but is obviously different because of the capitalization
https://gist.github.com/kgriffs/124aae3ac80eefe57199451b823c24ec
had a slight issue with a crash upon exiting the blind but it works absolutely perfectly now, gg
it's also really strong especially with decks that give you vouchers like zodiac deck
How can I edit values of a joker in an outside function? I'm trying to make a joker animate
animate how
like an animated atlas?
Look at #1249486500811378718 ?
If this
or just swap it from one sprite to another when a condition is met
I did, although I'm still confused
It calls for SMODS.Jokers although it's a nil value for some reason
oh my god those look amazing
@scarlet thorn
?
animated joker moment
oh yeah, I also wrote a startsWith, since lua doesn't have one. Sorry.
function StartsWith(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
I've got a working example of a Joker who swaps states. But not animating. LMK if you'd like to see
Sure! ^^ I'll likely use that later
This is what I was given
Oops! The game crashed:
[SMODS KRIS "Animation.lua"]:13: attempt to index field 'Jokers' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0323b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Steamodded Mods:
1: Weemy by Kris and co. [ID: KRIS, Version: 0.1.1]
2: Talisman by MathIsFun_, Mathguy24, jenwalter666, cg-223 [ID: Talisman, Version: 2.2.0~dev, Uses Lovely]
Break Infinity: omeganum
3: DebugPlus by WilsontheWolf [ID: DebugPlus, Version: 1.4.1, Uses Lovely]
Lovely Mods:
Stack Traceback
(3) Lua method 'update' at file 'Animation.lua:13' (from mod with id KRIS)
Local variables:
self = table: 0x096b9078 {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, F_ENGLISH_ONLY:false, F_VIDEO_SETTINGS:true, STAGE:1, F_MOBILE_UI:false, F_NO_SAVING:false (more...)}
dt = number: 0.00906116
(*temporary) = Lua function '(LÖVE Function)' (defined at line 144 of chunk [lovely debugplus.logger "debugplus/logger.lua"])
(*temporary) = nil
(*temporary) = number: 15
(*temporary) = string: "attempt to index field 'Jokers' (a nil value)"
(4) Lua upvalue 'oldupd' at file 'main.lua:999'
Local variables:
dt = number: 0.00906116
(5) Lua field 'update' at file 'main.lua:1846'
Local variables:
dt = number: 0.00906116
(6) Lua function '?' at file 'main.lua:938' (best guess)
(7) global C function 'xpcall'
(8) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '?' (defined at line 909 of chunk main.lua)
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
sorry for long message
Ignore a lot of this, it has some pretty inefficient code but it works
The section that deals with swapping states is here
if context.cardarea == G.jokers and context.before and context.scoring_name == card.ability.to_do_poker_hand then
sendInfoMessage("YU-GI_OH")
local cards = context.scoring_hand
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.15,
func = function()
card:flip(); play_sound('card1', percent);
card.config.center.pos.x = card.ability.activecoord
card:juice_up(0.3, 0.3); return true
end
}))
play_sound('Fox_yourMove', 1);
delay(0.3)
card.ability.active = true
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.15,
func = function()
card:flip(); play_sound('card1', percent);
card:juice_up(0.3, 0.3); return true
end
}))
delay(0.5)
end
In my case, I flip the card, then change its texture and flip it back.
Thanks! ^^
I store the two coords in the cards own config section so I am not dealing with setting coords in the body
Aura uses a very similar method as the one I use, but much more fleshed out then just changing the pos
so with stuff looks like it changed again for putting in custom deck customizations, how is it done now?
Y know I just realized it might be a bit strange that I use git itself exclusively through cli, but any actual github features like pull requests or releases, I just open my web browser though I'm almost sure you can do literally everything through either git or gh cli
is there a guild on how to do deck skins for deck customizations like the friend of jimbo?
How can I tell what position a joker is in the joker slots?
Iterate over G.jokers.cards until you find it then store the index.
Thanks! ^^
I was gonna say that was a hacky way to have to do it, but then I realized if the position was stored in the card, conflicts would very easily arise
No, it just checks for G.jokers.cards[1]
true, but it doesnt differ much from taking a position in G.jokers.cards
I meant base game hacky not mod hacky
But then I realized it's better than the alternative
they probably think that if the position gets switched around during scoring or something then it might cause conflicts and such, but it really wont
:p
I know that... I said the alternative of storing the position as a value on the card would actually be what would cause conflicts easily
I /was gonna/ say the way to do it was hacky until I reasoned the alternative is stupid
You're good :3
its 12pm fym youve just woke up
im literally brushing my teeth rn myst
I woke up at 4:40 pm today, lol
i love sleeping ❤️
I'm so committed to the bit as to actually be a nocturne
that can't be healthy, i thought waking up at 12 pm is bad enough already 😭
I mean... my circadian rhythm is my bitch ngl
why did i think that was a joker showcase vid
LMFAO
tried to add another deck to my mod and now it broke
----- BONUS DECK -----
SMODS.Back{
atlas = "bonusdeck",
name = "Bonus Deck",
key = "bonusdeck",
pos = {x = 0, y = 0},
loc_txt = {
name = "Bonus Deck",
text ={
"Start run with",
"{C:attention}13 {C:enhanced}Bonus {}cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 13 do
local chosen, index = pseudorandom_element(cards, pseudoseed("pseudoseed"))
chosen:set_ability("m_bonus")
---@diagnostic disable-next-line: param-type-mismatch
table.remove(cards, index)
end
return true
end
}))
end
}
----- LUCKY DECK -----
SMODS.Back{
atlas = "luckydeck",
name = "Lucky Deck",
key = "luckydeck",
pos = {x = 0, y = 0},
loc_txt = {
name = "Lucky Deck",
text ={
"Start run with",
"{C:attention}13 {C:enhanced}Lucky {}cards"
},
},
apply = function()
G.E_MANAGER:add_event(Event({
func = function()
local cards = {}
for i, card in ipairs(G.playing_cards) do
cards[#cards+1] = card
end
for i = 1, 13 do
local chosen, index = pseudorandom_element(cards, pseudoseed("pseudoseed"))
chosen:set_ability("m_lucky")
---@diagnostic disable-next-line: param-type-mismatch
table.remove(cards, index)
end
return true
end
}))
end
}
----- MOD CODE END -----
do i need to make a new atlas per deck?
did you create SMODS.Atlas for luckydeck and bonusdeck?
No but you need to give the same atlas if they use the same
oh alright
How does one get the chip value of the playing cards to right if it is being blueprinted by more than 1 blueprint?
so would it be better to create multiple?
And make sure the pos is correct
I think that's a personal preference thing
i will then, thanks
I like having multiple things on the sane atlas so I can just... look at them but probably more consistent to keep it seperate
:get_chip_bonus()
No, that only works if the card to the right is the original playing card.
🤔
u can try storing the card the blueprint is storing, then checks the stored card's chips?
I tried that, didn't work.
wha
HM
why doesn't it work though, thats weird
could it be because while the blueprint next to a playing card stores properly, the other blueprint stores the blueprint next to it instead of storing the playing card?
wow, already have 270 lines of code
anyway, how would i replace this to make it give foil cards instead of lucky cards
chosen:set_edition('e_foil')
and how do i make the deck look like a foil card
Yknow... it's it even accurate to call Balatro.exe a binary? It's more just a folder full of code that luajit jit-compiles
Just a 'shower thought'
oh god the sound when you start a run with foil deck
i just wanna apply the foil shader to the deck itself
You can turn it off if you want.
idunno if people will find the sound of 13 foil cards annoying
That's kinda skipping over love2d but that doesn't really change the calculus
Just change the inputs of set_edition to 'e_foil', true, true
I'm not sure but it's somewhere in here:
It's probably this though:
draw_shader
do i just add that to the code? or do i need smth else
this doesnt seem to crash it, but it also doesnt apply the shader
don't mind the negative, i just wanted to test that out
well, if anyone knows, please tell me
Foil should be the dark_edition colour.
Not your issue though.
in the description?
Yes.
i thought that was only for negatives
You need to put it into a draw function.
It's for all editions.
then whats edition for
oh
how do i do that?
Nevermind you have to put it in SMODS.DrawStep
and how do i do that 😔
okay, but how and where do i put it
sorry lol, i started learning lua like 2 days ago
Anywhere in your code but outside of everything.
everything?
Try putting it above where you define your deck.
between here?
Yes.
okay, well i still have no idea what to put there lol
Is it possible to prevent cards from being destroyed?
https://discord.com/channels/1116389027176787968/1367022926607683627
There's a chance I'm very impulsive
-# so does anyone know how i can apply the foil shader to one of my decks
