#đ»ă»modding-dev
1 messages · Page 395 of 1
how do you add a gradient to rarity?
where do I find saved in the source code?
SMODS.Gradient
How would I go about destroying all the cards in the scored hand
if context.destroy_card and context.cardarea == G.play then
return {remove = true}
end
i tried just doing this but I didn't quite realize that was just all of the cards
thanks
How can I add keys to the current run's "save"? I want to store some data that is saved per-run
What are the different types of 'sets' create_card can use?
Like that
But the others, like I want it to act like a standard pack, some base, and some enhanced
"Joker", "Tarot", "Planet", "Spectral", "Consumeables", "Booster", "Voucher", "Tarot_Planet"?
'Base' Makes them all base, Enhanced makes them all enhanced
I want a mix, like the standard packs
'Tarot_Planet' is a set type apparently
made the color, now how do i assign it to the rarity?
Put the SMODS.Gradient in a variable and use that.
anyone know why this spectral is crashing upon use? must be something small cause this is pretty identical to how other mods implement this
Log?
It wasnt working for a modded seal im making but its still now not working even tho seal is just 'Red'
no idea why _seal is Green when thats nowhere in the code for the Spectral
What line is that in the lovely dump?
how do you mean?
In Mods/lovely/dump/card.lua what is line 569?
The seal you're inputting doesn't exist.
I think i know what it is one sec
I was testing without recreating the card so it had the old seal info let me check recreating the card
yup
thanks for the help!
for a modded seal, would the {seal = } be modprefix_sealkey ?
modprefix_sealkey
perfectg
it's crashing

Code?
Did you forget to return true?
Try using mult and hand_chips instead of G.GAME.current_round.current_hand.chips
My mistake I meant hand_chips for chips.
You mean loc_vars?
note: i only started modding balatro today ;)
how can i make a custom joker that halves the current mult? i tried this but the game crashed
Use card not self
thanks
good schmorning chat
just in those two places?
Everywhere mostly.
unconditionally?
No? Mostly everywhere you would use card not self?
I just don't know what "mostly" means here
self refers to the center object, in layman's terms, the card's base definition
card refers to the instance of that center in a card in the game
gotcha
note: card is not a center
old code used to mistakely refer to them as centers originally
The base joker I built this off of didn't use card at all which makes this confusing
Because it seems to break things when I start to use card
so keep an eye out for those
oki
Depending on how I do things I get one of these errors 
Can you show the entire code?
Find the text styling page on the SMODS wiki
But the short version is that anything between the 2 sets of {} gets changed
You specify what you want it to look like in the first set
And C: just means colour, and there's a list of colours you can put after
Can you show where lines 491 and 492 are as well
depending on how I replace self with card it breaks things
in the way of the two errors
If I change the calculate function to have the parameters like what I see in the vanilla remade mod then the second happens
and otherwise it's the first
if self.debuff then return nil end
if context.joker_main then
You didn't put card into the calculate function
If I change the calculate function to have the parameters like what I see in the vanilla remade mod then the second error happens
sorry i shouldve been less vague
they do this
It doesn't change that it's how you're supposed to use the calculate function
I'm not sure where the error is coming from
But you need to put card in there
then i get this
i got it from the examplejimbos mod
i did yea
Because I don't see SMODS.joker at the start
that's what i mean
You should use VanillaRemade
just start again using one of the modern examples like the smods examples repo or vanillaremade
you can copy the contents of calculate into the new one
Everyone makes mistakes the first time
Honestly I've been going at this for like a full 8 hours now I'm probably just gonna try this tomorrow
Good luck
When you restart, I'd recommend reading the documentation, looking at VanillaRemade and other examples, and there's also a Balatro Modding Starter Pack post in this server that has very helpful guidance
noted
Thanks :3
Look at the wiki and examples from smth like vanilla remade
alright!
The short version is that it's a list of variables you want to use in places like the description
So #1# would be the first variable
can card sprites be gifs
Have you managed to check this yet?
They can be animated but they cannot be GIFs.
unfortunate
really wanted to add that one gif of a horse nodding as a card
i haven't
I've been away from my PC like half the day because weather was unbearable inside my room without AC
Iâm 99% sure itâs just a visual issue and the limit doesnât actually persist
and i wake up super late in the day
I can test soon when kiddo is sleeping
also i saw that the limit is in the button
right
i think it being under the button might look better
Eh maybe but not worth the effort I think
With some work you can still add it but not as a gif specifically
how would i implement it?
do i have to upload every single frame or something
Do you think adding cards on the end helps with up to?
the problem with adding cards at the end is that it might get too long
I'd guess so? Try finding a mod with an animated texture
yeah righto
Thatâs true
Iâll see what Up to looks like
i think this makes more sense
i think if it's more than hand size it should show like Up to hand size
what do y'all think about these consumable ideas?
- pet cards, which adds one-time bonuses and would unlock a second buff for a specific eligible cookie
- item cards, which would give an extra buff/debuff to specific cookies, or cookies of certain elements
some things give you more cards than hand size
even in vanilla
I wouldnât want to cap the number
and instead of hand size it counts number of cards present in hand
I think itâs important to know if itâs higher and you can afford to lower it
maybe some general info should be in run info window
in case certain parts of the run isn't present but is important
but i digress
i think Up to works fine
Iâm still not convinced it doesnât need cards
which is fair
Intuitively when I read âplay hand up to 6â I think it means I have six hands to play
Maybe it could just be âX cardsâ
I think the clarification that it's the hand limit should be there
also yeah it's a visual bug
(new run)
yeah max X cards works for me
any way to spawn a card wherever i want?
SMODS.add_card({area = whereyouwant})
is there a way to smoothly "replace" a card
instead of just destroying it and spawning another one in
as in anywhere on the screen
card:set_ability(G.P_CENTERS["class_modprefix_key"])?
If you don't emplace it, it can go anywhere, but it can also be moved anywhere.
ill try that đ
here, this one's from my mod
also where are sound files stored?
The vanilla sounds?
nah i wanna add custom ones
mod/assets/sounds
i believe @daring fern wrote it
thanks!
ok, but i wanna spawn it offscreen
There will be problems if you try to turn a joker into a consumable or the other way round.
Make a custom card area.
as expected
in this instance i am using a joker so would class be "joker"
j_
any good way to do that?
oh alright
I'm not sure try looking at a mod that makes hidden card areas.
Is it possible to create a card with an individual sprite? Like a text on it
wdym?
ah right.
Like create a playing card, but it has text as a texture. Since it can be infinite it has to create the sprite via code
Well I think I go an idea I guess nevermind maybe
i guess it would be?
Should be possible just gotta know how lol
well shucks what do i do here
Create the file 
Isn't recource/sounds/ and mods/TestCard/assets/sounds different places?
Maybe it doesn't look for it in the mods dictionary
SMODS makes the game think it's looking there but its not I think.
ah i see what i need to do
Gotta maybe manually tell from where it uses that sound
progress
it is a ogg
reexport it or smth
Yes.
yeah righto
argh i hate to ask a lotta questions all at once but i would go about adding a custom ui message, that text that appears underneath a joker
I did that at one point
Do you mean just a message?
Or a fully custom thing?
yes
Anyways, how do I make it so when a custom boosterpack is opened, it has a mix of base and enhanced cards?
'Base' makes it all base
and 'Enhanced' is all enhanced
Just wondering if there is a mix
dunno what its called but that little message that would appear under, say, the ice cream joker telling you hhow many chips it added
you have to do a pseudorandom between those two with a weight probably
That is a message
but instead of like "mult" or "chips" it would be a string
yeah righto
SMODS.calculate_effect({message = "string"}, card)
bloody champion
cheers lad
How would I go about doing that in create_card?
As far as I know, it just does all the cards at once
oh yeah
replace self for card
I just have this rn create_card = function(self, card) return create_card("Base", G.pack_cards, nil, nil, true, true, nil, "buf")
would something like this work for changing the image of a card?
i believe self actually refers to the thing you define
we should change the standard to calculate(_, card, context) lol
idk what I am supposed to be seeing
ah
whats the key for the main menu balatro logo for the atlas
Where do I change this? (Won't let me screen snip for some reason)
man i hate that theres a delay with calculate effect
wdym
i want to replace the colors of the balatro logo in the main menu but idk the atlas of it
SMODS.calculate_effect usually goes before everything?
i know this is farfetched but does take_ownership create any kind of lovely log or dump?
How do I fix it saying error?
Which page is that on?
SMODS.Booster
"balatro"
thanks
there isnt a delay, it just depends on where you put it
make sure youre doing it under the right context
Weird
I use play sound then right after I use calculate effect to make a message and there is a massive delay between the two
Is it in an event?
Yes
Code?
Iâm on mobile rn unfortunately but itâs the event that runs when all jokers and stuff have been played
context.destroy_card?
You need to return remove = true and you need to check if context.destroy_card == card
am i doing this right?
i'm trying to retrieve the key of the last joker in the custom cardarea
and put it into info_queue
I think so.
What line is that in the dump?
oh, wait, the cards might not be 'Joker' set in that cardarea
wait, no
i specify 'Joker' set when creating them
use G.P_CENTERS[card1.config.center_key] as your infoqueue
yes, but that has info_queue of the joker that get put there
i dont really want that
what are you trying to put in the info queue then?
key of the joker in a custom card area
the key in text form?
then do what I said before
they're looking to avoid creating the info_queues of that center within the info_queue
how do i give myself vouchers with debug plus?
need to test a bunch of consumables quickly and want to give myself crystal ball a ton
be in shop, hover over the voucher and press 3
yes, that works but that creates info_queues i dont want
then you'd have to create your own info tooltips to avoid that
i think you can just get away with a custom generate_ui function for info_queue here
Are those things on the left called âinfo_queuesâ?
yea
cause that's how you add them
Can you tell me who can draw Jokers to order?
anyone here know what a lua is?
Programming language
a potion
evil substance forged in the depths of hell
where's the dictionary?
where's the confectionary?
where's the purgatory?
where's the observatory?
right image
I captioned that image with âthis is mf doomâ
who is that mf and why is there such dread around them
not really đ
doesn't work like the other ones
rapper known for lots of rhyming and wordplay
Leave me alone!
passed away in 2020, lots of memes about his musical style
this explains the dread
ok another question, how do i pass multiple blueprint_effect?
Are you trying to make a joker that copies other jokers that aren't present?
nest extra tables together
yea
oh, so return it as a table?
nonono
return a single table, with an extra table, and in that extra table, have another extra table
hence 'nesting extra tables'
Funny
where i put the rets, right?
no?
I have a function for that.
ret1.extra = ret2
ret1.extra.extra = ret3
return ret3```
that's the basic structure
Would SMODS.calculate_effect also work here?
yes
Alright thought so
though if you use calc effect on all 3 you should add return nil, true afterwards
Cos I switched to using that over nested tables cos it got messy
Noted
But if one of the jokers is using an extra table itself that would overwrite it?
yes
it would
it's so the calc system knows that the joker has triggered
SMODS.blueprint_effect
Cmon guys
It just works
Err wait, I'm reading my own code wrong
Yea something has the best solution
yeah
this is why my extra table nesting code has a check if it already has an extra table
ok, am i missing something?
if so nest into the extra table of that extra table
you'll need to make sure that the rets actually exist
so 'if ret1 then' and 'if ret1.extra then'?
it's probably easier to just do SMODS.calculate_effect(ret1, card)
a smods util function to do this would be cool
ok, i removed next and it sorta work, but it crashed with one of the jokers so now i'm testing different jokers for crashes
does a legendary joker that turns scoring cards into stone cards and gives them a mult bonus too op?
with legendaries you can do whatever the hell you want really
so is that op enough?
We live in a world where chicot is a legendary and photochad is common
Legendaries can be anything as long as they aren't chicot
You should probably remove the jokers that aren't being copied before the game starts lagging.
nono it works fine, just context.individual isnt working visually
No, I meant if you sell too many common jokers the game will start to lag?
already did that
every 4th joker gets removed
cause i only need 3
ok, just gotta fix this now
does anyone know how to outright replace a boss blind with another one in the pool?
SMODS.take_ownership?
i dunno how that works, but that should be it
that doesnt seem right
Try looking at how cryptid does it.
im not changing existing boss blinds
more just pushing the vanilla ones away and slotting mine in their place
okie dok
i like this
ok, i fixed 1 part, the text actually appears on the card, but the joker still triggers before the card
how do i see current ante
G.GAME.round_resets.ante?
i think?
if thats current ante then thats rightg
i have a problem, my joker doesnt debuff, can someone check it rq?:
G.GAME.round_resets.blind_choices.Boss = get_new_boss()
Bunco also does this in the form of a booster pack, if that helps
already implemented, but thanks!
Have some code that I simply ripped off a tutorial just to see if I can get something into the game, however it doesn't appear in the collection. Any help would be very nice
Keys can't have spaces.
hiya! my Zodiac Packs have a bug, where you can take Zodiac cards from them, even if you don't have any free consumable slots
but, i can't see how i'd fix that. is there something i can add that would fix this bug?
Why are you using card.config.center.config.choose?
i dont know if there's an easier way to do it but you can do a hook like this
https://github.com/nh6574/JoyousSpring/blob/1f60413b8a13267634fa8e9945dfa37358f40c04/src/extra_deck.lua#L172
how would i get rid of this odd particle effect around the cards in my ritual pack?
iirc, i adapted code from Cryptid, which isn't usually a good idea, but it mostly works
i don't remember exactly what i did when writing the code
grand, thank you :D
found the error but got no idea what it does
bump pls
isn't there already an undertale mod for balatro?
okay, progress update â i tried this, but selecting Zodiacs from packs now crashes
lemme grab the log
yes, but this is Undertale Yellow mod
- why not have 2?
tried that but it didnt change the balatro title sprite
Because select_card doesn't exist.
idk if i wrote it wrong or smth
I think it's still use_card
lemme try that
use_card is just the general name of the function that handles that button
ahh gotcha :D
I think you need to do raw_key = true
yay, perfect! thank you :D
mm, one more bug, but it's a visual bug
when selecting a Zodiac from a Mega Zodiac Pack, the bottom UI moves down, as it does when using a consumable, and immediately comes back up
Bump
that doesn't happen with Standard Packs, so is there a fix for that?
the only thing i want to change is the card in the middle to match the green and purple
idk how to tho
is it possible to add images in descriptions?
I've seen people do it before.
i kinda want to try adding small icons or something
how can i count how many cards ive discarded over the round?
do you want to change the texture of ace of spades to that ingame?
like not in the menu
yes, you need to use main_end and a Sprite object
you could use the discard cardarea and get it's length
Trajectory moment
When blind is selected, destroy a random consumable in your possesion and add it's sell value to xmult
yeah, this is exactly what you need
#G.discard.cards should work
do editions support calculate functions
Yes.
should
almost everything supports calculate functions
oh i want to see if i can make mods have a global calculate
i need to see what victin wanted
calculate = function (self,card,context)
if context.joker_main then
if CHAR.FUNC.negative_event_proc(G.GAME.Risk or 0) == false then
local victim = card
if not victim then
return
end -- Safety check
victim.getting_sliced = true
G.GAME.joker_buffer = G.GAME.joker_buffer - 1
-- Store reference in local variable for closure
local dissolve_target = victim
G.E_MANAGER:add_event(Event({
trigger = "immediate",
blockable = false,
func = function()
if dissolve_target and dissolve_target.start_dissolve then
dissolve_target:start_dissolve()
end
G.GAME.joker_buffer = 0
return true
end,
}))
else
return {
xmult = self.config.extra.granted_mult
}
end
end
end
okay
I think mod objects themselves and stakes are the only ones missing now
so why does this not work
shouldn't be difficult to implement those
its not getting to the xmult part
also card.ability does not work for some reason
yeah i think the problem with mod objects is probably the timing
it's hard to specify like with areas
can u post a screenshot pls
of what
it's hard to read on phone
ty
I think it would just follow decks and blinds, right?
I mean that's the easiest solution
yeah i guess or just add a custom card next to it
idk how to do it tho
can i see negative_event_proc
quite a few mods already do this, like garbshit for example
so you could see what that mod does
does it have to give xmult when risk < 0
risk is never under 0
it's impossible, as the mechanic to alter risk always checks to see if its under 0 or over 1
hmm alright
let me change it to get it to show the problem
and ill give the crash log
ohhh
is it still context.joker_main
oh hold on
what's the edition on?
im just seeing what cryptid is doing
if context.pre_joker or (context.main_scoring and context.cardarea == G.play) then
use this
actually, use post_joker
that'll be correct for xmult
do you guys know if I can use context.context just anywhere?
trying to spawn tags the same way anaglyph deck does and the context doesn't seem to get triggered
You can only use context in calculate.
calculate = function(self, card, context)
if context.context == "eval" and G.GAME.last_blind and G.GAME.last_blind.boss then
G.E_MANAGER:add_event(Event({
func = function()
add_tag(Tag("tag_double"))
play_sound("generic1", 0.9 + math.random() * 0.1, 0.8)
play_sound("holo1", 1.2 + math.random() * 0.1, 0.4)
return true
end
}))
end
end
here's the calculate for this joker
yeah that's for decks only afaik
mannnn
use context.end_of_round and not context.game_over and context.main_eval and G.GAME.blind.boss
I tried something similar earlier, it seems like the end_of_round context has some unintended behavior when used in this way because the effect procs multiple times. I get given about 15 tags lol
trying this version now
this worked, thank you
end_of_round happens with individual and with repetition too, that's why you use main_eval
+4 Mult for every Joker to the left of this one (Currently +0 Mult)
i want a Joker with this effect. i know how it'd work in calculate but the displayed Mult wouldn't update when you move the Joker around
Help I want the joker to add a X0.8 mult (it removes mult) but instead it adds 0.8 to the mult.
Just xmult = card.ability.extra.Xmult .
did you use loc_vars in your code
fuck this one line of code in particular
bitch would win in the world championship hide and seek game
yes, but it wouldn't matter, would it? if i'm only evaluating a new mult value in joker_main then it won't update until that code is run. i was asking of there was a context or something for when a joker is moved around
You would use update
feels like a waste to have that code run every frame when it does nothing in 99.9% of them
There are other ways?
trying to find in the code how they did it but cant find it at all
the description does not update until you recreate the ui by rehovering in the joker
Is there a way where I can force a joker to always be on the very right joker slot?
Yes.
Is there a documentation on the github where I can look into?
Do the updating in loc vars too
You are very correct that it would be a waste in update
is there a way to hide a joker ? im tryin gto make a special card just for the title but its not a real joker so i want to hide it
no_collection = true I think.
You mean from the collection?
yeah and in game
in calculate ?
please?
In the joker initialisation
Also need to set the in pool function to return false
How could I create a deck that only has for example 5 cards?
wdym?
You remove 47 of them in apply.
Ah, okie
There is documentation. Look in the wiki tab
Or are you talking about your specific use case?
about mine yeah
can someone provide the documentation on how to implement patches?
hi again. how do i count a card as discarded whne its played?
How would a card be counted as discarded?
What are causes of the game hard crashing when reaching the main menu?
btw wdym?
from line 114 in garbpack.lua for garbshit
you can hook the Game.main_menu function to add a card to the title area (G.title_top:emplace(your_card))
sorry from missing context: i wanna make a joker that counts played cards as discarded
and played too
im just seeing this
card:start_dissolve()
You would probably call this: in context.individual
â
I had the game crash when it finished loading idk if that's the same
quick question, how do you check if a card is a consumable?
if card.ability.consumeable I think.
is it possible to disable the effect of a deck? like disabling the Anaglyph Deck or Plasma Deck's effects?
shit i forgot to update đ
im using an older version because i had the download page open to get the new one but forgot to actually do it
thanks ^^
Sounds like a hook with a condition check.
what is effects exactly?
It's what it returns.
this is a kind of patch right?
So an empty table.
No.
Hook.
so i just put it there without defining?
mm, didn't work
like just put the "effects" without making any local effects = 'effect'
if context.selling_card and card.ability.consumeable then
card.ability.extra.current_hands = card.ability.extra.current_hands + card.ability.extra.added_hands
return { message = localize("k_upgrade_ex"), colour = G.C.FILTER }
end```
ah wait no ignore
dfkjgnkdjfng
It should be context.card
aware
bump
if context.individual and context.cardarea == G.play then
SMODS.calculate_context({discard = true, other_card = context.other_card, full_hand = context.full_hand})
end
yea i have it like this rn but it wont work
What jokers are you trying it with?
Any clue as to why this ownership would crash when using the fool? crash log says that last_tarot_planet is being set to a table instead of a string but im not modifiying tarot_planet
hi can anyone tell me why my card dosent count as discarded?
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play then
SMODS.calculate_context({discard = true, other_card = context.other_card, full_hand = context.full_hand})
end
end,
Could I also make it move to the mostright position before scoring?
What are you trying to do?
Does anybody know how I can make a joker retrigger itself? And then also allow that retrigger to retrigger it again? I'm trying to make like a weird missprint where it can trigger X amount of times
You'd probably want a nested table of extra = { ... } where the depth of said table is rolled for by the Joker, then return said table.
You can have a joker retrigger itself as long as it is not retriggering joker retriggers.
if you want to have it return multiple effects (like multiple xmults), you can use SMODS.calculate_effect in a loop instead
if its a simple effect
So when you retrigger the calculate can't repeat the retriggering effect?
Yes.
its what i used for my xmult joker that triggers a varying number of times
instead of nested tables or retriggering the entire joker
Yes, but usually you want xmult to go after everything else.
My ideas was just a joker with +Mult that has a 1/2 chance to retrigger. so it could either trigger once or if ur very lucky trigger 5 times
Cus in my head the retrigger would allow it to roll the 1/2 chance again for another trigger and so on
im trying to count scored cards as also discarded
G.hand.config.card_limit?
thanks
how do people get the mod name on a joker cycling to show stuff like Idea: X, Code: Y, Art: Z, instead of always being the name of the mod?
how can i check for all jokers of a certain objecttype
oh wait
i think i might know this one
this was someone elses idea and i want to credit them without taking up space in the description
cryptid and polterworx do this (only mods ive actually played enough to notice it on)
idk if its custom coded or an SMODS thing
?
i cant see any of that
if theres one thing ive learned while modding balatro
uh
idk
yea see
idk what any of that code means
or how to alter it to the credits i need
You just change it so where ever it says cry_credits you change it to something else.
damn I missed it didnât I
Gotcha
I tired to make it but it didn't work out
i kinda wanna go back to vanilla balatro
is there any way i can do that?
Uninstall your mods.
My way would be:
Make a new folder in the same level as your mods folder (name it Mod Shelf or whatever)
Move your mods there.
so basically
just move the mods into a folder that the steamodded won't accesss
Yep.
I do that for Balatro MP matches.
Or you could look at the second pinned message in https://discord.com/channels/1116389027176787968/1209506360987877408
nah dw it's worked
just
wanted to ask around to make sure i don't do anything rash
tryna go for a completionist++ file
I'm trying to make a Joker where it adds +50 chips per Gold seal on deck, but it doesn't work, does anyone know the solution
context.other_card doesn't exist, you should be using playing_card
I tried that
but I don't know how the game identify seals
Also it's G.P_SEALS.Gold
let me check
is there a cardarea that only refers to hards held in hand? G.hand seems to include played cards
can't really find a cardarea list to see all the options
It is G.hand.cards
how do i get other .lua files besides my main to run?
SMODS.load_file("path/from/root")()?
assert(SMODS.load_file(path))() iirc. my mod uses a recursive file-loading script from basil_squared and i find it really helpful. ask her about it maybe
telling me its an invalid escape sequence
the () goes outside the assert
fixed. sorry for spreading misinformation online it will happen again
SMODS.load_file("C:\Users\user\AppData\Roaming\Balatro\Mods\CGNik\overrides.lua") is an "invalid escape sequence"
Root mod folder as in your mod folder.
ah
also no \
Yes.
also something
i copied the cryptid thing for the mod badges
it isnt working
obv i need to change some stuff
but i dont know what i have to change
Hi. I have a question. How do i put smods into vsc? I have the sumneko lua Extension, but Whenever i input smods, it underlines it.
i would also like to know this lol
read this and the next couple of messages #đ»ă»modding-dev message
Please note, I'm using the outdated YT video on how to create a joker. Found on the balatro modding guide
maybe i linked to the one below lol but around there
i have the full smods folder and the lua dump in my workspace but still no dice
yeah it says that there, apparently putting them in the workspace doesn't work
whats with X: tags and not being able to use spaces
it didn't work
No, I meant for the info_queue
seals aren't an enhancement
it didn't work can you be more specific?
You need to do if playing_card.seal == "Gold"
where
like where do I put it
Instead of has_enhancement
Your loc_vars if statement should be if G.playing_cards then, as it is it'd crash in collection
like this?
oops this is a vanilla remade typo
oh yeah
ill fix it in a bit
I using vanilla remade as a base
i know that's my coding style :3
not that i see
it seen like stone joker works fine on vanilla remade
yeah G.playing_card is also a thing but that means the description may sometimes display wrong values
is there a way for a joker to check what the base mult is for a played hand type before scoring gets added
yes, it should be somewhere inside G.GAME.hands[context.scoring_name]
More or less the same as the stone card
With the the () part being from the vannila description
I can't acess it right now
hi I've recently been dabbling in modding balatro but I'm having a hard time understanding context.individual and context.repitition_only
context.repetition_only does basically nothing and context.individual is when playing cards are scoring.
so if individual is set, other_card is the playing card being scored yh?
Yes.
is individual also set during retriggers?
thank you
I'd assume yes
Yes, but it's not used for retriggers.
Thats context.repetition
ohh, I see, repitition is only set if the card is being retriggered yh?
No, it's like context.individual but used for retriggers and not doing things on playing cards.
It's still true if no retriggers are called.
Hello
Is it possible to alter shop card spawning behaviour of a specific class of cards?
i'm sorry can you rephrase that?
oh now I don't understand, its set initially? is it for giving joker effects to cards (like blood stone and onyx agate) and individual is for stuff like hiker?
No, individual is for both of those, repetition is for things like mime and hack.
question is there a way to make SMODS.add_card silent?
Right. I'm tinkering with the Steammodded framework (basically why I bought Balatro)
To specify, I'd like to enhance the behaviour of Telescope so that the first Planet card generated in the shop's main rack corresponds to that of your most played hand.
Yes, then.
oh, thanks for the clarification
ok, i personally dont know how to do that, but First Round Joker mod does something similar. you can go see how that works.
i think they mean something like making rares spawn more or less often and similar effects
You mean the vanilla behaviour of deterministically generating one Joker booster pack on the first shop?
the mod replaces the first card in the shop with a joker of your choice
Oh, right, sorry.
You should probably hook create_card_for_shop
Thanks for the name of the routine.
I imagine I can override it directly without using a take_ownership helper, correct?
No, you need to hook it not overwrite it.
is has_enhancement well implemented here?
Yes
made my stickers and seals
oh i like them!
Those are very cute!
It's not your enhancement checks that breaks, you need to be a bit more specific in defining your context!
for anyone not aware with cookie run, kingdom specifically has an element system
There are plenty of times where context.cardarea will be G.play, but context.other_card will be empty
wait what?
so the i have to add the context that is during scoring?
cause it calculates directly after the cards are placed in g.play?
Yes. Calculate is called by any calculate effect, which means it's called when a card is obtained, selected, drawn, discarded, when the shop is rerolled, when another card triggers, etc.
You need to narrow down the contexts. There's documentation for it on the smods' wiki!
Great stuff! wish I could make art like this, my Jokers need some work lol
im assuming they come ordered from first to last in the scoring calc right?
I think so, but I'm not entirely sure. The main thing to remember, though, is that each context documented is a separate call to the function
So you can have multiple contexts and they can be ordered in any way in your own code
the scoring ones are ordered yes
you just need motivation to do that. you can redo the art anytime
i struggle more on coding rather than drawing
yup I focused on getting them implemented first, just finished them all actually. couldn't get my original ideas to work for some of them because they weren't feasible for my level of modding capabilities right now, but I can change the mod later if I need
somehow the crash got fixed but now this part doesnt work
it just skips the if entirely
is this a joker?
yes
drawing all the cards would take too much time for me, so i might start making placeholders first to test my mod ideas. just making one new tarot made me jump around like hell
ok then you want context.individual
Does anyone know if there's a way to detect when a tab (created using create_tabs) is changed? I see that it has an opt_callback parameter but it doesn't seem to actually be calling the function
made this placeholder art for my jokers so I could test them. I got a bit carried away making some of them pretty though, I'm particularly fond of the Abandoned Deck design
how do I add custom text under the rarity? I wanna add art credit under the rarity as done in this screenshot
look at set_badges
https://github.com/Steamodded/smods/wiki/SMODS.Joker
wait you cant update loc_vars in the calculate function?
no? what are you trying to do
Wait nevermind, I looked into the source and despite having the parameter the code to actually use it doesn't exist, so I'll just add it myself with a patch
oh shit it works!
thanks!
and can i stop a card held in hand from doing an effect?
like steel cards giving x1.5 mult
Hm. how would one go about making a new card area?
Debuff it?
depends for what purpose
but i dont wanna permanently debuff them
Temporarily debuff it?
I kinda want cards with an active ability. I don't think I can add a 'use' button to jokers so my next idea is to have a consumable to go with the card. These consumbles would go in the new card area
kinda like consumables 2 but I don't want it to be targeted by certain things
you can add a use button to jokers i have like 6 different ones in my mod
oh shit really
yeah
Check how I do Zodiacs in the dev version of my mod
you need to hook either the sell_an_use_buttons function or card: highlight
i would tell you to check out mine but the 6 different types of buttons make that a bit convoluted lol
ah
i would also tell you to check out mine but the function that does it is pure spaghetti code
i would also tell you to check out mine but I don't actually have any buttons
I would tell you to check N's
at this point im in a recursive cycle of checking
its probably better to check theirs than mine, my code for it is kinda unreadable because i havent cleaned it up yet
mine is here https://github.com/nh6574/JoyousSpring/blob/1f60413b8a13267634fa8e9945dfa37358f40c04/src/general_ui.lua#L307
N you got any idea of how to do this?
probably give me a sec
have you tried putting the bottom R node outside the top R node?
what im intending to do is sort of have the column node then r nodes within it for each row, with multiple rows of inputs, i could put the text node and palette_create_text_input into a row node of their own for the same effect?
the problem with that is that R inside R does nothing
what you can do is put those in a C and change the bottom R to a C
testing now
iirc you can nest same type nodes if you need to play with colours, it's just not particularly useful
yeah
works near perfectly, the paste button is ever so slightly up from it but honestly this is so much better than anything ive managed
acc that might be the box element
yeah it was the box element, looks perfect now, thank you so much
where do i look? I found the zodiacs but im not sure whats making it work
it seems like SMODS.current_mod.reset_game_globals(run_start) just isnt being called at all for some reason, wtf
There's a lovely file
okay i like this a lot but the idea of codin g it makes me want to cry đ alas
this is so frustrating i have no clue why it bricked
it worked fine before
did SMODS.current_mod.reset_game_globals(run_start) get updated??
not as far as i know
is run start for. the start of runs or for rounds
runs
run_start means that it runs at the start of the run as well as each round
...which it does neither of those
i have prints set up to tell me when it triggers, and it never triggers
hm. i have it in for one of my jokers and it only does run starts
let me see what i did
testing ancient joker in vanilla remade and it works fine in latest smods
OKay ya you were right đ
im referencing castle in modded vanilla and it seems fine
like i see no issues
what were you doing last before it broke?
you're not overwriting it somewhere else or something?
the only other SMODS.current_mod.reset_game_globals(run_start) i have is this
well
oh
try deleting that
you mean this?
no, not that, though that also needs fixing to use poll_edition
oh just poll_edition not using it then?
this bit yeah
I don't think get_current_pool supports editions at all though iirc
it doesn't yeah that's why I asked
anyone know if the balatro font is monospaced or not
wait why is create_card_for_shop in UI_definitions
thats dumb
because it creates the UI stuff for it
The actual font itself is a monospace font called m6x11 https://managore.itch.io/m6x11
It's a monospace font
so it is
hell yeah
I'm unsure if Balatro preserves the monospace in kerning
Of course it isn't
minesweeper in a joker will look a lot more eye.good. then
ah
that's a separate function đ
But you can see
well that is a shame if it isn't because minesweeper is usually aligned
again, you can check
and you can always learn the forbidden dark arts
balatro ui...
and just shove a ui object into main_end of the joker description
minesweeper balatro sounds like a job for aiko
It's how I do my evil UI crimes
let them do it if they want to, aiko doesn't own the concept of sillyness
thats not what i said lol
let them eat cake or whatever
you are not marie antoinette
but yeah you can likely use Balatro's evil UI system to draw a minesweeper grid
You can see right there in the preview that it's not monospaced. The width of the ls and is is totally different from the ns and ms
I'm pretty sure that when I use it in writing it's actually monospaced
Not in Balatro
But outside of it
im a silly girl do you think im going to NOT put minesweeper in balatro
Because I've used the Daniel Linssen fonts in the past
The char widths are different in the font file, it would only appear monospaced if whatever program you were using forced it to be
i will play it
Minesweeper balatro :o
is this just a static image or is it a dynamically changing piece of ui?
Got this line of code working yesterday. It's not perfect, but it works with vanilla Planets and the ones in Cryptid that keep a hand_type value in their config table. Hooray.
Figuring out v.config.center.config took a long while, using many print() statements. 
Is this scrollbar working one?
How would I get Jimbo to show up when I lose a run under a specific circumstance (I can check for the circumstance already) even if I've already won the run and I'm in Endless?
I don't want him to be there if the condition isn't meant
Patch here:
hey, how can i make my owns C:tarot, or C:money, etc?
You add to LOC_COLOURS I think.
is there a set for consumables as a whole?
Yes.
just so i can make a random consumable of any type
SMODS.add_card({set = "Consumeables"})
also how do i check if a card is a consumable
if card.ability.consumeable I think.
Check how Baseball Card does it
card.config.center.rarity
if context.selling_card then
local points = 0
if context.card.ability.consumeable then
points = 5
elseif card.ability.set == "Joker" then
if card.config.center.rarity == 1 then
points = 10
elseif card.config.center.rarity == 2 then
points = 15
elseif card.config.center.rarity == 3 then
points = 25
elseif card.config.center.rarity == 4 then
points = 100
end
end
if its a joker, its always rarity 2 for some reason
Your checking card not context.card
meow
SMODS.add_card({set = "Consumeables",soulable = true})
puts the cards into my joker slots
which makes
no sense
you need to specify the area
Default values are determined based on set.
Are you able to change the visible name of a joker based on a returned variable?
Like can you do â#1# applesâ and that updates to 3 apples, 4 apples, etc?
i believe the base "Consumables" set doesn't account for that
i think it should
@red flower Really sorry if I'm bothering you, but are you able to help me out with my joker?
theres consumables that go on different areas though
depends
like mine
in the base game?
and also, thats the reason why area exists
to change the default
but the default should still be where they usually go
i can put a joker in my consumables, but that doesnt mean they should go there by default
@daring fern with modded placement
consumeables do automatically go to the consumeable area???
like using area =
not for me ig
you're using set wrong
how so?
Consumeables isn't a set
someone said it was
I've been working on that joker from yesterday so it works properly with hologram, and I think I've gotten somewhere. The only issue I have now is that it only ever increments hologram up by one, instead of once for every card added to deck.
calculate = function(self, card, context)
if context.before then
local new_cards = {}
for i = 1, 2 do
for k, v in ipairs(context.scoring_hand) do
if v.seal or v.edition or next(SMODS.get_enhancements(v)) then
G.E_MANAGER:add_event(Event({
func = function()
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local copy_card = copy_card(v, nil, nil, G.playing_card)
copy_card:add_to_deck()
G.deck.config.card_limit = G.deck.config.card_limit + 1
table.insert(G.playing_cards, copy_card)
G.hand:emplace(copy_card)
copy_card.states.visible = nil
copy_card:start_materialize()
new_cards[#new_cards + 1] = copy_card
return true
end
}))
end
end
end
SMODS.calculate_context({ playing_card_added = true, cards = { new_cards } })
return {
message = localize('k_copied_ex'),
colour = G.C.CHIPS
}
end
if context.destroy_card and context.cardarea == G.play and
(context.destroy_card.seal or context.destroy_card.edition or next(SMODS.get_enhancements(context.destroy_card))) then
return {
remove = true
}
end
end
this fella right here
It worked for me.
consumeables is generally more of a Pool

