#💻・modding-dev
1 messages · Page 607 of 1
Not all of them do, only 8 do
That is the issue
Oh.
You are going through all of them and checking for it, but it's not there for at least one
so, I have to add that in for each one of 81 more?
yes, or you can do if (element.config.extra or {}).element_no == el_sum then for now instead
I've been meaning to put it on the cards anyway. Just wanted to test it first, but guess I can't have that luxury just yet
you can test it without putting it yet by using this
Did you change the name of the variable back
If so replace element with the name it currently is
You put Element instead of element I guess
for the key
okay here we go again, what is your code again
IT WORKS NOW!!!!
glad to hear
if (xiferp_Element.config.extra or {}).element_no == el_sum then
SMODS.add_card { key = xiferp_Element.key }
end
end```
All that to fuse two Beryllium cards into an Oxygen card...
least it proves 4+4=8
If I ever make a second row on my mod's element table, you will have a seat at it
i'll be an element on your mod's periodic table?
yeah, if you want
what type of mod u making?
A mix of everything, but the main part currently is with element-themed consumables
looks very cool
you know Aikoyori's Shenanigans?
yeah
This is Jimbo Joshua's Shenanigans, otherwise known as Balatro My Way
you do pixel art btw?
Eh, somewhat.
oh cool
I use pixel art websites to make card designs, if that's anything
I saw that character in your pfp and assumed you drew it
I did, and then did it as a joker.
With what? The lettering, dithering, or what? (this is my pfp as a Joker btw)
dam that looks very good
I usually have a hard time with stuff like drawing shoes or even caps
is the text a reference to anything
Idk how to get the feeling of depth in the art
TWOWer Books? yeah, TWOW
I just do circle tools and eyeball stuff until it's good
that's a cary huang thing right?
ten words of wisdom!
Yep! (Also, got 791st place in EWOW, its second season)
I see, your shading looks very good too
"yea glorb is a reference to sneep" 
I'd recommend finding the joker reference pallet and going from there/
my mod has a reference to a high score run i posted on reddit
joker reference pallet?
if you're aiming to make Balatro jokers, that is
Btw If you need any help w coding or coding questions u can dm me
I have some experience with coding
Trust me, I'll stump you on my next one.
Hello. Help, why the fuck is the patch not working?
bump because i still didn't solve the problem
please some help me solve this problem
this is patched by smods. when trying to patch something you should check the lovely dump instead of the base game files
can i see sounds.lua
here
do you have assets/sounds/new_sound.ogg
yes but the sound is empty
i removed the sounds folder and sound lua and the load sound lua function
and it worked
well maybe thats the issue
how can i force the shop to open
ah
depends on when
what's the G.GAME for the number of discards per round? its not in the wiki
what discards? the ones that the player currently has?
the number it will reset to after clearing a round
G.GAME.current_round.discards_left?
look at vanillaremade
search for drunkard
G.GAME.round_resets.discards
well you probably want to update steamodded since youre 2 releases behind
and also actually show your code
you should use card:add_sticker("perishable", true)
oh
thanks
im using an outdated version of smods to keep it compatible with balatro mp too
also how can i force it to not be a certain joker
local pool = get_current_pool("Joker", "Common")
local key
for k, v in ipairs(pool) do
if G.P_CENTERS[v].perishable_compat == false or v == "<some joker key>" then
pool[k] = "UNAVAILABLE"
end
end
local no_available = true
for _, v in ipairs(pool) do
if v ~= "UNAVAILABLE" then no_available = false end
end
if no_available then
key = "j_joker"
else
repeat
key = pseudorandom_element(pool, "seed")
until key ~= "UNAVAILABLE"
end
local card = SMODS.add_card{ key = key } ...
```bit of a workaround but this should work i think
Temporarily put it in G.GAME.banned_keys while creating the card.
alright thanks
It's _seal not _Seal
you'll probably want to look at how morefluff does this so you dont unban cards that were previously banned already
something like this?
this is the find function
it should be G.GAME.banned_keys[<object key>] = true
oh
now?
that should work
could this hint at there being another problem
no that just means its not discovered
if this is in my loc file, what should be the seal's key
out of the question but wouldnt making the card negative do the same thing
is that a thing
yes
i thought it worked with jokers
replace card.ability.extra.edition with "e_negative"
and _card with ur card of choice
thanks man
np
I still do want to keep it as a seal just to understand how it works and what I'm doing wrong
still haven't managed to display the infoqueue
ok figured it out
pseudorandom_element
G.P_CENTER_POOLS.poolkey
No.
this doesnt give me the jokers im trying to fetch
No, set = 'food'
code?
local blind = NFS.load(mod_path .. "blinds/" .. v .. ".lua")()
is NFS ur mod name?
no
what is NFS then
i don't know
this is my first mod idk how to do anything
is mod_path initialized
local mod_path = SMODS.current_mod.path
maybe do local mod_path = "".. SMODS.current_mod.path
or local mod_path = tostring(SMODS.current_mod.path)
No, it's SMODS.load_file
oh
yeah ur right
if you want to automate the process do this
replace items with ur directory where ur storing the lua files
except main
show code again
you don't need to put your mod path in SMODS.load_file
why are you calling the loaded file?
uh
also you dont need to load every blind individually
ok
And calling the loaded file is correct
you should just do a file that does it
You just need to remove the mod path from there
oh
im cheeks bro this is my first program
thanks
np
bump
OH MY GOD IT DIDNT CRASH
most mods use Food I'd imagine
The code you sent looks fine then, what's the issue?
because it didnt work
Also your inject function here is very redundant, you can remove it and it'd do the same
What's the entire joker code
the blind isn't in the blinds list
wdym
in my collection
ah
its still 30/30 blinds
you probably didnt load it properly
i'd assume the blind doesn't work either
so this is the structure
you can put all your blinds in one lua file
you dont have to make a folder that contains each one
really?
yes
i feel like each one'd be more organized
look at mine for example
but it would be more tedious to change each one
If you're planning on making a big mod I'd recommend having each in a different file
why
So you don't end up with a Jokers.lua file with 20000 lines
ctrl + f
wheres the key
You can search for files too
look again
ah
right
Try making the condition just if (x.config.center.pools or {}).food then
SMODS.Blind{put the stuff here}
wouldnt it do the same thing
case sensitive
ok
its SMODS.Blind not SMODS.blind
just removing the unnecessary stuff to see if it's somehow the issue
k
let me test it rq
and remove the local too
k
it doesnt crash but nothings there
as in the blinds
you can just do this
local yourblind = SMODS.Blind{
key = "cherry",
pos = {x = 0, y = 0}
dollars = 5,
mult = 2,
debuff = {["Pair"] = true}
boss_colour = HEX("8f0d0d"),
}
return yourblind
oh i dont need the paratheses?
didnt do anything
theyre not needed
and function(local variable = {}) is highly likely to be an error
maybe try not returning
and dont set a variable
just do SMODS.Blind{
and set its atlas
manually
spritesheet
ohh
also its an error to set the atlas AFTER initializing an object
copy this structure
main.lua or cherry.lua
cherry.lua
ok
but you should make it blinds.lua instead
so you dont have to create 1 file for each single blind
Make sure card.ability.extra.mult isn't somehow 0, and try typing eval G.P_CENTER_POOLS.food in debugplus console and see if there's even anything in the pool and you didn't make a mistake in loading it
seems good
the food pool is empty then
how come? i did it correctly
wait
do i have to switch the pool's cards to indexes
instead of values
nothing there
Oh right, yeah it has to be j_prefix_key = true
Forgot about that
ok
replace items with ur directory's name
works now, ty
tell me if it works
What is the error
their blind file is not loading
mods, crush his balls
<@&1133519078540185692>
you have a syntax error
errors?
you were missing 2 commas in that line
oh
after x=0 and at the end of y=0}
check that you're not missing commas anywhere else
how can i randomize suit and rank of all played cards before scoring?
this kind of works, but when deselecting(?) it randomizes before hand is played?
context.before
IT'S THERE
and because its just a context.cardarea check, its triggering whenever an event in the played cards happens
atlas isnt defined
?
should work now
have you used SMODS.Atlas?
context.other_card won't exist in context.before
"Cherry.png" is in your_mod/assets/1x/Cherry.png right?
if you have debugplus maybe reload atlases (with ctrl+m)? also is it discovered by default? discovered = true?
is the atlas "Cherry"?
put atlas = "Cherry" in your blind
yeah
if you want to add more blinds dont make an individual spritesheet for each one
and just separate them vertically
IT WORKS
now i need to see if the debuff works
you can force the blind if you have the cheat panel enabled
doesn't do anything?
i have debug plus or whatever its called
try holding tab
and see if anything appears
the menu is there
theres only boss reroll
blinds
do i hit spawn?
and press 3 on the blind you want
3
yes
try removing context.cardarea == G.play
and do a for loop for each card
in play
it crashed
show the error
you need to initialize a boss thing
is boss an initialization?
its a table
oh
yes
like this?
try doing that
boss = {min = 1},
yeah
it's not breaking but the pairs are working
it's supposed to debuff pairs
hold on
do hands = {(insert ur hands here)}
this results in a crash @wild berry
something like this
hands = {["Pair"}] = false}
lemme see
i uploaded the crash txt
remove the =1 near i
for loops inside tables dont need to have i already initialized
ah that fixed it
still isnt working
the function doesn't [work] tho
try to do test prints
me?
yes
wait i got it wrong shit, its supposed to be ["Pair"] = true
heres how vanillaremade it kinda does it
look at the debuff_hand
i think i got it now
do next(context.poker_hands["Pair"])
ok
yes
just with print(' ')?
print and then whatever symbol u want
maybe even a variable
ye the condition isnt passing
try removign context.other_card
how would i happen to add custom buttons to jokers that are in a shop, like for a freeze mechanic for instance?
if next(context.poker_hands["Pair"]) then
return {debuff = true}
end
like this
this is the calculate function you want to use
if not blind.disabled then
if context.debuff_hand then
if next(context.poker_hands["Pair"]) then
return {debuff = true}
end
end
end
paste it
code
if not blind.disabled then
if context.debuff_hand then
if next(context.poker_hands["Pair"]) then
return {debuff = true}
end
end
end
image prol
How do I make a joker always have an edition?. Something like cryptid does with some jokers
you didnt put it inside a calculate function
oh my code finally works, it was the context.other_card
im working on it
set_ability = function(self, card) card:set_edition('e_modprefix_key') end
Thanks y'all
add_to_deck = function(self, card, from_debuff)
if not card.edition then
card:set_edition(poll_edition(nil, true, true, true))
end
end,
incase you want a random edition
do this
SMODS.Blind {
key = "cherry",
dollars = 5,
mult = 2,
atlas = "Cherry",
pos = {x=0,y=0},
boss_colour = HEX("8f0d0d"),
loc_txt = {
name = "The Cherry",
text = {
"All pairs are debuffed"
}
},
debuff = {
hand = { ['Pair'] = true}
}
there is no need for calc function
oh
when there's a built-in hand debuff
No, set_ability = function(self, card) card:set_edition(poll_edition(nil, nil, nil, true)) end
whats even set ability??
with this ? @weary grail
yes
Pairs sounds about right
worth a shot
Ohh thanks, I would like Negative edition tho
nope
replace the 3rd argument with a false then
still broken
Tell me what I'm doing wrong, I've been pulling my hair out trying to apply an enhancement
wat is this for?
scored_card:set_ability(insert enhancement here, nil, true)
the enhancement must start be formatted like this
m_(mod prefix)_(key)
Ah thanks
also do 'modprefix_popper'
not scored_card but context.other_card
and for confetti
hi john vanillaremade
hi
runs whenever the card spawns
ohhhh
Oops! The game crashed:
[SMODS 2_Year_Mod "BirthdayJoker.lua"]:171: attempt to index global 'scored_card' (a nil value)
It's been returning this whenever I play a hand
For context, I'm trying to make a joker that applies this enhancement to the played hand
can i see your code @weary grail
because of what i said
How do you make a temproary consumable effect
why is debuff not at the same column as loc_txt or something, idk if that'll do anything tho
what does that mean
It doesn't matter, it always crashes on hand played
I tried both
wdym
like e.g something that increases discards by 1 for one round
Then send the crash with the code I suggested
well for discards specifically you can just do ease_discards and it will work for one round
press space twice on line 14,15 & 16, also do you get a crash ? or does it just do nothing?
im looking for hand size
just does nothing
for hand size you would need to use something like the global mod calculate to reset it at the end of the round
it still doesnt work
Oops! The game crashed:
[SMODS 2_Year_Mod "BirthdayJoker.lua"]:171: attempt to index field 'other_card' (a nil value)
@red flower
can i see the full code
idk dude
😔
before the event do local scored_card = context.other_card then use scored_card in the event
??
im having trouble with this joker, i want to debuff the lojer to his right, but here just debuff itself, what i do ?
you specified card as the one to be debuffed
debuff is a boolean
YES it works
source is a string
if you want it to work correctly, do SMODS.debuff_card(other_joker, true, "SomethingSomething")
yes?
remember to debuff it later by just replacing this function with a false
what you talkin abt
balatro modding
same
what is a string?
oh
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is often implemented as an array data structure of bytes (or words) that stores a sequence of ...
oh, im dumb af
to give mult ( specifically for a edition ) you just do return { mult = some_value } right?
is there not temp_handsize in the base game or am i hallucinating
Why isn't my joker working?
I think that the problem is the context but I'm not sure
calculate = function(self, card, context) if context.before and context.cardarea == G.play then return { play_sound('fm1_cool', 1, 1), message = 'Cool!', colour = G.C.GREEN, } end end
No, there is.
There is that one skip tag that does that
I don't remember the name
here's code from my consumable that gives +2 temp hand size
G.hand:change_size(card.ability.extra.h_size) G.GAME.round_resets.temp_handsize = (G.GAME.round_resets.temp_handsize or 0) + card.ability.extra.h_size
where card.ability.extra.h_size is whatever variable you want to increment it by until the end of the round
thx
bump
I tried it and for some reason it doesnt increase, but it decreases
is your value negative
its positive
but when it should increase it doesnt, and when it resets back it then decreases by the amount I set
??
how do you make a credits section for your mod
SMODS.current_mod.extra_tabs is a function thatll return the ui elements of extra mod page tabs
so learn ui and then make a funny credits page
when is this hand size being awarded
also, try and put it in an event
I'll try that later not on computer rn
What's the event to modify the starting deck (in making a new deck)
wdym "the event"
you have to create an event
because otherwise it happens before the default deck is set
I know but how do I actually change the cards
Is it the same as modifying them midgame
yes
just loop over G.deck.cards and use whatever functions you normally use for modifying cards
Ok cool
hello? game crashes on startup from this
im trying to make a tooltip that shows the credits of a joker
the problem is I have no fuckin clue how to make the tooltip ACTUALLY appear
I dont think you can do local card = smods.add_card
I think thats giving you the error
I am the big stupid I don't know how to loop G.deck.cards
how do you change this icon in the mods tab
create an atlas with the key modicon
It's a for loop right? I've just never done it before
yeah
for i, card in ipairs(G.deck.cards) do
either variable can be replaced with an underscore if you dont use them
how can i freeze the game for a certain amount of time
like completely freeze or just stop the player from making actions?
freeze the game
time.sleep
whats the px,py?
k thanks
32x32, same as a tag
ill try love.timer.sleep
You need to use loc_vars to put in the variables for the credits, also you would use info_queue
So I have 'for i, card in ipairs(G.deck.cards) do'
but it keeps telling me "Bad argument #1 to ipairs (expected table, got string)
what does the code look like
Idk why it's a txt file but now it does this
There shouldn't be anything wrong, all I did was put the for loop in the event
try to use just pairs instead
that wont change anything
pairs is identical to ipairs besides that its unordered and loops over non-integer indexes
I don't know what to do about this supposed bad argument
i mean i have this deck which does the exact same loop with different code so like
idk the issue
how can i debuff (for a blind) multiple ranks, suits or poker hands?
And I have another issue: I have two psuedorandom_element calls, and when I had one it worked but both break the game
use calculate instead of the automatic functionality (context.debuff_card for cards, context.debuff_hand for hands iirc)
i dont get it?
why does this error appear
what part do you not get
like how to actually write it out, as in, what exactly i do
well calculate for blinds functions the same as calculate for jokers
modprefix_key
and you return debuff=true to debuff
ohty
am i s'posed to loop through every card and debuff (or not)?
now i get this
no, context.debuff_card already does every card
you should check the pillar in vanillaremade since i think that uses a calculate
and for hand debuffing check the eye or the mouth since they also use a calculate
??
yes
.
context.debuff_card is also the actual card being checked to debuff
oh
so you can do whatever checks you want on context.debuff_card
I'm worried something got screwed up
?
I don't think it matters what I put in there, it'll just return a bad argument
yeah
SMODS.add_card({ pseudorandom_element({ 'c_xiferp_lanthanum', 'c_xiferp_cerium', 'c_xiferp_praseodymium', 'c_xiferp_neodymium', 'c_xiferp_promethium', 'c_xiferp_samarium', 'c_xiferp_europium', 'c_xiferp_gadolinium', 'c_xiferp_terbium', 'c_xiferp_dysprosium', 'c_xiferp_holmium', 'c_xiferp_erbium', 'c_xiferp_thulium', 'c_xiferp_ytterbium', 'c_xiferp_lutetium' }, 'Lanthanide_pull' )} )
Why isn't this working?
how can i make it to where if you play X or Y rank the hand isnt allowed, not debuffed
crash?
this
I think you need to do key = pseudorandom....
☝️ @unkempt bronze
if context.debuff_hand then
for _, c in ipairs(context.full_hand) do --i think this is the right context?
if c:get_id() == X or c:get_id() == Y then
return { debuff = true}
end
end
end
oh thanks
I changed it for a similarly coded card, and a different crash
Both pairs and ipairs return a "bad argument"
I have a different mod that doesn't even calls pairs and it still crashes
Right at the end of loading, after injection
can you send the code?
then its probably not with the deck yeah
since that would only crash if you start a run with the deck
I have no idea where to look to fix that
Think I found the issue, forgot c_ in front of consumables...
Works now
nice
Im gonna pop a question of my own
why doesn't this work?
if context.after and card.ability.extra.used then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
SMODS.destroy_cards(card,true)
return true
end
}))
return {
x_chips = card.ability.extra.xchips
}
end
it's a calculate inside a consumable
What is the full code?
is it possible to emplace cards used after scoring back into G.playing_cards
SMODS.Consumable {
key = "nylahs_intervention",
set = "spells",
loc_txt = {
name = 'Nylah\'s Intervention',
text = {
"Next hand gains {X:chips,C:white}X#1#{} Chips",
"increased by {X:chips,C:white}X#2#{} for each",
"scored card this round"
}
},
atlas = 'TherosBD_spells',
pos = {x = 9 , y = 0},
cost = 3,
config = { extra = { initial_xchips = 1.5, current_xchips = 1.5, xchips_increase = 0.1, used = false} },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.current_xchips, card.ability.extra.xchips_increase } }
end,
use = function(self, card, area, copier)
card.ability.extra.used = true
local eval = function() return card.ability.extra.used end
juice_card_until(card, eval, true)
end,
calculate = function (self, card, context)
if context.individual and context.cardarea == G.play then
card.ability.extra.current_xchips = card.ability.extra.current_xchips + card.ability.extra.xchips_increase
end
if context.after and card.ability.extra.used then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.2,
func = function()
SMODS.destroy_cards(card,true)
return true
end
}))
return {
x_chips = card.ability.extra.xchips
}
end
if context.end_of_round then
card.ability.extra.current_xchips = card.ability.extra.initial_xchips
end
end,
keep_on_use = function (self, card)
return true
end,
can_use = function (self, card)
if not card.ability.extra.used and G.hand and G.hand.cards then
return G.GAME.blind and G.GAME.blind.chips > 0
end
return false
end
}
sorry for the wall
What is the goal?
after scoring, cards used in the played hand can be drawn again
It's current_xchips not xchips
You mean cards in played hand are drawn to deck instead of discard?
yeah
Hook G.FUNCS.draw_from_play_to_discard
kty
what context would i use for detecting when a joker is destroyed
if context.joker_type_destroyed and context.card.ability.set == 'Joker'
Does anything look wrong with this? It's crashing on line 1719
Which line is that?
The last 'end' at the bottom there
After everything else
Both of my mods crash due to ipairs, I'm trying to see why
Is this in the lovely dump?
does :is_face() exist?
Yes.
returns a bool right?
Yes.
im tryna make it where you can only play face cards, why isn't this working?
^
I don’t know but with functions that return booleans you don’t need to compare those booleans to constants
true and true == true are the same thing
oh right
not true and true == false are the same thing
so?
It should be syntactically equivalent yes
I am trying to make a Joker that randomizes the suit and rank of played cards, this is the current script to find all ranks and suits.
you might need to modify this because its for a blind but i have sm similar:
SMODS.Blind {
name = "endermen",
key = "endermen",
atlas = "blindatlas",
discovered = true,
pos = { y = 2 },
dollars = 5,
mult = 2,
boss = { min = 3 },
boss_colour = HEX("e079fa"),
calculate = function(self, blind, context)
if not blind.disabled then
if context.setting_blind then
play_sound('bc_endermen3', 1, 0.5)
end
if context.before then
for i, c in ipairs(G.play.cards) do
local _card = G.play.cards[i]
local rank = pseudorandom_element(SMODS.Ranks, pseudoseed('endermen_ranks')).key -- get a random rank
local suit = pseudorandom_element(SMODS.Suits, pseudoseed('endermen_suits')).key -- get a random suit
SMODS.change_base(_card, suit, rank)
play_sound('bc_endermen', 1, 0.5)
end
end
end
end,
defeat = function(self)
if not G.GAME.blind.disabled then
play_sound('bc_endermen2', 1, 0.5) return true
end
end,
disable = function(self)
play_sound('bc_endermen2', 1, 0.5) return true
end
}
Yoinkety sploinkety
ehow can i make it where the hand isnt allowed if you play anything else then a face card or ace
if context.debuff_hand then
for k, v in pairs(context.full_hand) do
if not v:is_face() and v:get_id() ~= 14 then
return {debuff = true}
end
end
end
I'm watching this tutorial on how to create a joker. I got to this point , and have this code, when I run the game, I don't see the joker in my collection. Is this video outdated? Did I mess something up? My smods version is 1.0.0-beta-0711a
SMODS.Atlas{
key = 'Jokers', --atlas key
path = 'Jokers.png', --atlas' path in (yourMod)/assets/1x or (yourMod)/assets/2x
px = 71, --width of one card
py = 95 -- height of one card
}
SMODS.Joker{
key = 'joker2',
loc_txt = {
name = "Joker: The Sequel",
text = {
'When Blind is selected,',
'create a {C:attention}Joker{}',
'{X:mult,C:white}X#1#{} Mult'
}
}
}
Yes, it is outdated.
Is the mod loading?
no
I downloaded this zip, changed the folder to be the name of my mod, and changed the code inside main.lua to what I have above.
I'll try using this template instead
that is also very outdated
just use vanillaremade as a reference for things if you need it https://github.com/nh6574/VanillaRemade/blob/main/VanillaRemade.lua
and also this page on the smods wiki https://github.com/Steamodded/smods/wiki/Your-First-Mod
But that's where I got the templates from. Where it says "Steamodded has some Example Mods."
just ignore those because basically all of the example mods are very outdated
all the other resources should be fine though
is there a way to allow beta versions of smod?
yeah
https://github.com/nh6574/VanillaRemade/blob/a670b00a4276d5f7982f5980453726e3cc7c8e28/VanillaRemade.json#L12 look at how vanillaremade does it
Any tricks to buff the last played card of a hand?
the last scoring card is context.scoring_hand[#context.scoring_hand]
same can be done for context.full_hand
or any cardarea
Thank you (i had a similar bit, but with a 5 hard-coded(
Hang on, that also makes my Letter Seal a lot more dynamic
does any of this code destroy a card? i can't figure out why it's destroying itself
my best guess is the card.children.center.pinch.x = true
since thats also what the food destruction animation uses
No, but it would make the card invisible and unselectable.
SMODS.Consumable {
key = "neptunium",
set = "xiferp_Element",
atlas = "Golden_Brick_Road",
cost = 3,
pos = { x = 4, y = 6 },
unlocked = true,
discovered = true,
can_use = function(self, card)
if card.ability.extra.yes_is_no == false then
return true
end
end,
config = { extra = { element_no = 93, odds = 62, yes_is_no = false } },
loc_vars = function(self, info_queue, card)
local numerator, denominator = SMODS.get_probability_vars(card, 1, card.ability.extra.odds, 'c_xiferp_neptunium')
return { vars = { numerator, denominator } }
end,
use = function(self, card, area)
yes_is_no = true
end,
loc_txt = {
name = 'Neptunium',
text = {
'x5 mult per average card for the',
'hand after this is used',
'(1/62 chance to radioactively decay)',
},
},
calculate = function(self, card, context)
if card.ability.extra.yes_is_no == true then
if context.individual and context.cardarea == G.play then
if context.other_card:get_id() > 5 and context.other_card:get_id() < 10 then
G.GAME.xiferp_rowseven_xmult = (G.GAME.xiferp_rowseven_xmult or 0) + 5
SMODS.destroy_cards(card, nil, nil, true)
end
end
end
if SMODS.pseudorandom_probability(card, 'c_xiferp_neptunium', 1, card.ability.extra.odds) then
SMODS.destroy_cards(card, nil, nil, true)
SMODS.add_card({ key = 'c_xiferp_uranium' })
end
end
}```
What in this is closing the game upon mousing over?
You need a context check for the SMODS.pseudorandom_probability
fixed it I think, testing now
works
how do you make selectable cards inside boosters? like not to use immediately but to keep them in the slots when selected
Like the pull function from Cryptid's Code Packs?
yeah
Then I would start snooping around in the code for Code Packs
You might find something
i looked and didn't find anything that resembles that
i also looked in pokermon cause it has a voucher that does that
ive lost all knowledge in the sea of poor documentation, what do i use to set 3 free rerolls per shop in a deck
SMODS.change_free_rerolls(3) i think????
select = 'consumeables'
Quick question:
what's wrong with for i = 1, math.min(3, G.consumeables.config.card_limit - #G.consumeables.cards) do?
Put everything inside the event.
it didn't spawn 3 cards tho
Move the return true outside of the for loop.
Also 2-0 is less than 3
is it possible to do it only for one specific card in the pool?
yes but it's also suppose to ignore slots
Then change math.min(3, G.consumeables.config.card_limit - #G.consumeables.cards) to 3
Also replace random_set with 'Consumeables'
what?
why are the consumables in the joker slots
default area for that set is G.jokers for some reason
add area = G.consumeables to the add_card
also where do i need to put this??
This Joker crashes whenever the shop ends. It gives no crashlog, and I am very confused as to what the crash log is trying to say. What am I concatenating? I dont know.
For some reason, the message I pasted has the crashlog, but I dont see it on the crash menu. Odd
It's key not set also it needs to be a string.
Oh yeah, lol
Hiya! anyone know why this isn't working?
hook doesn't exist.
oh yeah you're right lol
how do i fix it then?
Move the hook outside of the joker.
is there any way to cause an effect to draw a card but only while the hand is actually out
(i.e. in blinds and some boosters)
Wait it's not already?
idk just in case
wdym just in case
thats not even stored in self for jokers plus name doesnt exist for jokers unless you specifically define a name field
This does not detect when Cryptid's Pizza Slice is sold. I dont really know why. Although it does work correctly otherwise
i can only assume that they're replicating how balatro is coded, because the game defines all the joker abilities in a huge name = list
if context.card
context.card.config.center.key == "j_cry_pizzaslice"
card is the joker itself
Thanks.

whats the problem, drawing or detecting a hand? and when exactly do you want to draw?
detecting, and i just want to draw when you sell the joker so no big there
you can probably just do if next(G.hand.cards) then
i'll test that out
help, what the fuck is going with my lovely patch?
wtf is cfg, why _c is being replaced, how do I prevent it from doing just that?
Do I lower it even more?
no the opposite
ok
that's lower than smods
Up it goes.
Hey guys Im trying to change the card at the main menu I only did the effect (negative) but i want to have Ace of hearts. Any help ?
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = true"
position = "after"
payload = """
if replace_card and replace_card.base then
replace_card.base.value = 'Ace'
replace_card.base.suit = 'Hearts'
replace_card:set_edition(G.P_CENTERS.e_negative and 'e_negative' or 'e_negative', true, true)
end
"""```
remaking all my changes (CUZ IM STUIPD), i just lost the message where someone helped me check for specific jokers sold can someone help me find it
SMODS.change_base(replace_card, 'Hearts', 'Ace')
key = "modicon",
path = "ModIcon.png",
px = 32,
py = 32
})
logo = "balal.png"
SMODS.Atlas ({
key = "balal",
path = logo,
px = 333,
py = 216,
prefix_config = { key = false }
})```
ignore the modicon for a sec, why isnt the logo showing up?
It's balatro not balal
oh
am i doing it wrong ?
pattern = "replace_card.states.visible = false"
position = "after"
payload = """
if replace_card and replace_card.base then
SMODS.change_base(replace_card, 'Hearts', 'Ace')
replace_card:set_edition(G.P_CENTERS.e_negative and 'e_negative' or 'e_negative', true, true)
end
"""```
hmmm
Your SMODS is nine months old.
why is my debuff not working?
oupsie! I update it but still crash
EDIT: nvm it works Thank you !
this works but the playing card is drawn face down and if you draw multiple they overlay on top of each other
code:
calculate = function(self, card, context)
if context.selling_self and card.area == G.jokers and next(G.hand.cards) then
for i = 1, card.ability.extra.draw do
local drawn_card = G.playing_cards[1]
G.hand:emplace(drawn_card)
G.E_MANAGER:add_event(Event({
func = function()
drawn_card:flip()
return true
end
}))
end
end
end
it's drawn face down even without drawn_card:flip() btw
use SMODS.draw_cards
here the problem is that 1. you're not using any of the draw functions that handle this, 2. you're not drawing from the deck, you're drawing from the full list of cards which is going to sometimes duplicate cards in hand
i wasn't aware of that func i see, i based this off of how dna adds a card to deck then immediately draws it
🤷♀️
@zealous glen you're vindicated
i also noticed this because if you pair it with my joker that makes you draw in order, you get a random card
see how the 2 of clubs is erroneously drawn
please can anyone help
shouldn't it be poker_hand or poker_hands?
at least try
why not instead do
calculate = function(self, blind, context)
if not blind.disabled then
if context.debuff_hand then
blind.triggered = false
if context.scoring_name == 'Pair' then
blind.triggered = true
return {
debuff = true
}
end
end
end
end
if i want to make an enhancement that makes the card monochrome, how would i do that
i don't know what a draw step is or how it works okay

Okay I guess that for some reason my Balatro just doesn't have anywhere where it actually increased the hand size so I just hooked new_round() and it works for now ig
your balatro very much should have that because it's built into the base game
Balatro at 3 am 😧
How could I modify the values of a joker through another joker?
Something like the Oil lamp from Cryptid. I tried looking at the code but didn't understand how to do it
holdon lemme find smth
Alright 
ik its a bunch but focus most on the modify_value function
Okay I'll try to do it
Thanks
omg it works!! ty!!!
🙏
How do you get whether you're selling a card or destroying it, or removing it? Trying to have it do smth only if you destroy it -- not if you sell/remove it
Is there a list of what you can do in stake modifiers
you can do pretty much anything but if you're asking about the specific modifiers used by vanilla here they are
https://github.com/nh6574/VanillaRemade/blob/main/src/stakes.lua
what type of card
thx
is there a variable that checks the number of hands played on a given round
i want to be a merciful soul and not force my player to sit through triple baka again
have you checked DNA
i should go do that
it's been a while ngl-
just
had a sudden hankering to mod, you know
Jokers
how would i prevent the player from making any form of input for a short period of time?
@red flower may you help?
Can stake modifiers affect stuff when a hand is played
Like, when I play a hand, x happens
context.joker_type_destroyed
please dont tag me unless it's relevant to me or we were in a conversation
Alright am sorry
yes, they have calculate since recently
That's amazing to know thanks
mmm
now i'm wondering if it's possible to "undebuff" cards
nvm
found a method
hold on
they literally just debuff themselves again
how do i keep them debuffed
What am I doing wrong here?
calculate doesn't go inside modifiers, and it's missing the arguments (self, context)
cuz like
in The Goad
spades will immediately debuff themselves after i've undebuffed them
and it's context.cardarea
Why are underscores inconsistent
CardArea is a type of object
Hm...
How do I fix my code?
It should duplicate the values on the joker to the right but it just crashes cuz of "extra"
ok found a way to retain the "undebuffable" status
i just don't know how to apply it to the card itself because it's not reliant on another joker
Is there anything wrong with THIS?
experimentation with UI shaders
This just straight up doesn't work, it doesn't even play the sound
put a flag on the card and have SMODS.current_mod.set_debuff() detect that flag and return "prevent_debuff"
just remove the modifiers function, it doesn't go in there either lol
also there's no card in a stake
why doesn't this take_ownership attempt work?
SMODS.Edition:take_ownership("negative", {
shader = false
})
i think it has to be "e_negative"?
i don't believe so since it's already using SMODS.Edition
and SMODS.Joker:take_ownership("invisible,..." works for invisible joker without a j_
yea
that is odd
note that if i put this in an update hook nothing happens
this version of pairs wouldn't obliterate a false i think so it isn't skipping over it in that sense
yeah I checked that too
It's not that it's skipping it as a falsy value
hold on let me check smth
we have 6 people tryna fix the same problem bro
modify key wouldn't be going off on accident because of the guard...
The reason why is, probably, because negative has a separate clause for this:
if (edition and edition.negative) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then
self.children.center:draw_shader('negative_shine', nil, self.ARGS.send_to_shader)
end
the shine doesn't draw the negative though
i know this because i've used that shader
So it's always drawing this regardless of the value, even though it might skip the base one
negative_shine isn't the same as negative in terms of the shader file
to be lazy
"have you ever heard of a lovely patch? Maybe you could just lovely patch it out"
otherwise it's possible it's somehow interfering with SMODS already taking ownership of it
oh fair actually
but it takes ownership after
a more bootleg version of this would be to declare SMODS.Shader on the vanilla negative shader key and point the path at the dissolve shader instead
🙏
But yeah do you have anything in your debug log about it failing to register the take ownership?
the order is this for loading the smods stuff
loader is after game object where the take ownership happens
weird
have you ever heard of a lovely patch? Maybe you could just lovely patch it out
what's the goal? remove the negative shader?
yea
they're hardcoded as far as i know like winter showed
there's one that applies the base negative as opposed to negative_shine
so lovely patching?
have you ever heard of a lovely patch? Maybe you could just lovely patch it out
you could take ownership of the drawstep but patching is probably easier
WHAT
oh yeah sorry I was right earlier, just looking at the wrong thing
i was right
omg all this time george was right
Because Negative is broken up into two sections, the base negative is hardcoded in 'front'
SMODS.DrawStep {
key = 'front',
order = 0,
func = function(self, layer)
--Draw the main part of the card
if (self.edition and self.edition.negative and (not self.delay_edition or self.delay_edition.negative)) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then
if self.children.front and (self.ability.delayed or not self:should_hide_front()) then
self.children.front:draw_shader('negative', nil, self.ARGS.send_to_shader)
end
elseif not self:should_draw_base_shader() then
-- Don't render base dissolve shader.
elseif not self.greyed then
if self.children.front and (self.ability.delayed or not self:should_hide_front()) then
self.children.front:draw_shader('dissolve')
end
end
local center = self.config.center
if center.set == 'Default' or center.set == 'Enhanced' and not center.replace_base_card then
if not center.no_suit then
local suit = SMODS.Suits[self.base.suit] or {}
if suit.draw and type(suit.draw) == 'function' then
suit:draw(self, layer)
end
end
if not center.no_rank then
local rank = SMODS.Ranks[self.base.value] or {}
if rank.draw and type(rank.draw) == 'function' then
rank:draw(self, layer)
end
end
end
end,
conditions = { vortex = false, facing = 'front', front_hidden = false },
}
so just
kill the drawstep
killing the draw step would stop all the other parts
this is why you listen to me all the time
yeah i figured after looking at it for a second
i may not know how to code but i know that maybe you could just lovely patch it out
streamer why aren't you taking the lovely patch it synergizes with the run
Is there any way to pack two variables into a single localize{} statement?
localize = {
k_lapsems_list_recursive = '#1#, #2#'
k_lapsems_list_and = '#1# and #2#'
}
LAPSEMS.recursive_list_maker = function(list_to_use, end_of_list)
if #list_to_use == 1 then
return list_to_use[1]
end
if #list_to_use == 2 then
return {
localize {
type = 'variable',
key = 'k_lapsems_list_' .. end_of_list,
vars = {
list_to_use[1],
list_to_use[2]
}
}
}
else
local removed_element = table.remove(list_to_use, 1)
return {
localize {
type = 'variable',
key = 'k_lapsems_list_recursive',
vars = {
removed_element,
LAPSEMS.recursive_list_maker(list_to_use, end_of_list)
}
}
}
end
end
eval LAPSEMS.recursive_list_maker({'milk', 'eggs', 'fabric softener'}, 'and')
--[[
Expected output:
milk, eggs and fabric softener
Actual output:
Table:
1: ERRROR
--]]
is this how loading a folder is usually done
yes, the way that you're doing it should work
check if your localization file is organized correctly
How would it be organized incorrectly?
I want to know something. In my mod there is new suits and a friend tell me that I should add the spectrum poker hand from Bunco and paperback, but idk if is free to use (code and sprites) or I should ask some kind of permission or smth
Someone could tell me?
they have to be in v_dictionary
in all cases of your function, you're returning a table that contains the localize call
so you've got a bunch of nested tables now
It only ever correctly processes the first element.
.
what's the idea btw
can't you localize ,, or and and separately
Desired output:
eval LAPSEMS.recursive_list_maker({'milk', 'eggs', 'fabric softener'}, 'and')
-- milk, eggs and fabric softener
I probably can. But I've been learning about recursion in school and wanted to give myself a challenge.
i feel like this is too complicated for simple concatenation
hi i'm wondering about this
yes
ic
also is it fine for me to look through some mods' source code to get a standard on how localization and stuff is done
yeah everyone does
i give you explicit permission to look at vanillaremade, jokerdisplay or joyousspring
How do I un-nest them?
remove the outermost set of {} in the return statement
i.e. instead of return { localize... } it should just be return localize...
That did the trick.
how would one go about making custom blind types, such as a "new boss blind"
no oxford comma...
check the blind section in smods' repo wiki
Oh, well.
do i js like put a false on the if statement? this is how i'm currently doing this 😬
this works
uhh no
oml
wait why are you patching like that
target = '=[SMODS _ "src/card_draw.lua"]'
should it be like that?
yeah
🙏
target = '=[SMODS _ "src/card_draw.lua"]' i mean
that one is for playing card fronts

