#💻・modding-dev
1 messages · Page 484 of 1
if context.individual and context.cardarea == G.play then
card.ability.extra.stockpile = card.ability.extra.stockpile * 2
local total_xmult = card.ability.extra.stockpile * card.ability.extra.xmult
if context.other_card == context.scoring_hand[#context.scoring_hand] then
card:juice_up(0.5, 0.5)
play_sound('holo1', 1, 0.5)
return {
xmult = total_xmult
alr so how does the create card function work? docs doesnt help much
i recommend looking at vanillaremade :3
but you should be able to return { set = "set key", area = G.pack_cards }
what?...
idk how to be more clear than that haha
ill go look at vremade
who made JoyousSpring again
N
who
nice Guy Thomas
what's his username
N
NOW THAT I GOT YOUR ATTENTION WITHOUT PINGING
for that im not helping u
does your mod mess with the background vortex?
ok so whats the set, area, skip_materialize, soulable, and key_append?
DUDE YOU SAID NO PINGING
How does one add a joker to the bar up top.
So like how booster packs do not like mod one in just to clarufy.
yes
in which lua, i wanna see
i also mess witht he background vortex smiley face
but i do mine in a not great way
you're my plan B
general_ui, towards the bottom i think
thanks doc
it has a comment that i stole it from cryptid
stealing from cryptid is like pirating a triple a company app
so to create a custom set, i would do an objecttype?
yes
wdym
wait
would ObjectTypes need an altas?
SMODS.ObjectType({
key = "Food",
default = "j_reserved_parking",
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
-- insert base game food jokers
self:inject_card(G.P_CENTERS.j_gros_michel)
self:inject_card(G.P_CENTERS.j_egg)
self:inject_card(G.P_CENTERS.j_ice_cream)
self:inject_card(G.P_CENTERS.j_cavendish)
self:inject_card(G.P_CENTERS.j_turtle_bean)
self:inject_card(G.P_CENTERS.j_diet_cola)
self:inject_card(G.P_CENTERS.j_popcorn)
self:inject_card(G.P_CENTERS.j_ramen)
self:inject_card(G.P_CENTERS.j_selzer)
end,
})
-# Reserved Parking as food, lol-
alr thanks
Is there already a way to make it so that you can see during scripting which syntax works and which one does not?
who would skip pavement as a dessert
yes, the lua extension
Where do I find it
if using vs code, look up lua in the extensions and install the one by sumneko
if not using vscode, then do
What function do I use to add a joker? I tris SMODS.create_card(){} but it doesn't seem to have a value to specify a card.
SMODS.Joker
oh nvm
any joker or a specific one
im dumb
specific
SMODS.add_card{ key = "j_modprefix_key" }
is adding key_append optional for a booster?
yes
ight bet
Just to clarify; is it function(){key=..} or funtion{key=..}
so if my set in the booster was "sillyjoker", would the area be G.sillyjoker?
function{key=...} or function({key=...})
no, pack_cards always
bump
key = 'sillyboosternormal',
loc_txt = {
name = 'Silly Booster',
config = { extra = 2, choose = 1 },
text = {
'Choose 1 of up to 3 Silly Joker cards!'
}
},
atlas = 'sillybooster1',
pos = {x = 0, y = 0},
weight = 1,
cost = 3
loc_vars = function(self, info_queue, card)
local cfg = (card and card.ability) or self.config
return {
vars = { cfg.choose, cfg.extra },
key = self.key:sub(1, -3), }
end,
ease_background_colour = function(self)
ease_background_colour_blind(G.STATES.BUFFOON_PACK)
end,
create_card = function(self, card, i)
return { set = "sillyjoker", area = G.pack_cards, skip_materialize = true, soulable = true, }
end,
}```
line 95 is "SMODS.Booster{"
SMODS.Gradients.modprefix_key
hmm no that probably wont work
save the gradient to a local and use it
line 108 is "loc_vars"
missing a comma after cost
also config goes outside loc_txt
key = 'sillyboosternormal',
config = { extra = 2, choose = 1 },
loc_txt = {
name = 'Silly Booster',
text = {
'Choose 1 of up to 3 Silly Joker cards!'
}
},
atlas = 'sillybooster1',
pos = {x = 0, y = 0},
weight = 1,
cost = 3,
loc_vars = function(self, info_queue, card)
local cfg = (card and card.ability) or self.config
return {
vars = { cfg.choose, cfg.extra },
key = self.key:sub(1, -3), }
end,
ease_background_colour = function(self)
ease_background_colour_blind(G.STATES.BUFFOON_PACK)
end,
create_card = function(self, card, i)
return { set = "sillyjoker", area = G.pack_cards, skip_materialize = true, soulable = false }
end,
}
fixed but still got error
?
the obvious
but
what???
and
SMODS tangent "imrocksolidrnouuugh.lua"]:2309: attempt to compare number with string
Additional Context:
oh
uhh no idea
is there a command i could do in debug to make all non visible hands visible
vro what 😭 🙏
key = 'sillyboosternormal',
path = 'sugarseed.png',
px = 71,
py = 95
}
SMODS.Booster{
key = "sillyboosternormal",
weight = 1,
cost = 4,
pos = { x = 0, y = 8 },
config = { extra = 2, choose = 1 },
loc_vars = function(self, info_queue, card)
local cfg = (card and card.ability) or self.config
return {
vars = { cfg.choose, cfg.extra },
key = self.key:sub(1, -3),
}
end,
ease_background_colour = function(self)
ease_background_colour_blind(G.STATES.BUFFOON_PACK)
end,
create_card = function(self, card, i)
return { set = "sillyjoker", area = G.pack_cards, skip_materialize = true, soulable = false }
end,
}
-- ObjectTypes
SMODS.ObjectType({
key = 'sillyjoker',
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
self:inject_card(G.P_CENTERS.j_silly_sugarapple1)
end,
})
yeah anything that doesn't return a value says nil
awsum thanks bestie westie
how would that work?
damn why do i got 3 pages of hands so far
local variable_name = SMODS.Gradient{.........
i think it might be complaining about line 122 self:inject_card(G.P_CENTERS.j_silly_sugarapple1)
is that the correct key
i might have figured it out
hold on
well it wasnt the right key and i fixed it but it still gives me this
it's complaining about a b_zodiac
what in the world is a b_zodiac
dunno
vro im so confuzzled...
Are you trying to create a card somewhere?
well its a booster pack
It does this when it ends up with UNAVAILABLE as the key
what
key = 'sillyboosternormal',
weight = 1,
cost = 4,
pos = { x = 0, y = 8 },
config = { extra = 2, choose = 1 },
loc_vars = function(self, info_queue, card)
local cfg = (card and card.ability) or self.config
return {
vars = { cfg.choose, cfg.extra },
key = self.key:sub(1, -3),
}
end,
ease_background_colour = function(self)
ease_background_colour_blind(G.STATES.BUFFOON_PACK)
end,
create_card = function(self, card, i)
return { set = "sillyjoker", area = G.pack_cards, skip_materialize = true, soulable = false }
end,
}
Where are creating that set?
SMODS.ObjectType{
key = 'sillyjoker',
cards = {},
inject = function(self)
SMODS.ObjectType.inject(self)
self:inject_card(G.P_CENTERS.j_silly_sugarapple)
end,
}
I think your object type isn’t actually getting any cards in it then
do i have to put it in cards = {},
Maybe? I haven’t had any experience using object types
maybe refer to the steamodded guide? or did you do that already
can I put the variable into .json somehow?
i mean for the virable to read in .json
how do you make this synergize with pareidolia? (and maximized if possible)
-- Check for 4 Aces or 4 Face cards
if context.before then
local ace_count = 0
local face_count = 0
for _, playing_card in ipairs(context.scoring_hand) do
local card_id = playing_card:get_id()
if card_id == 14 then
ace_count = ace_count + 1
elseif card_id == 11 or card_id == 12 or card_id == 13 then
face_count = face_count + 1
end
end
if ace_count >= 4 or face_count >= 4 then
card.ability.extra.xmult = card.ability.extra.xmult + card.ability.extra.xmult_mod
return {
message = "Boost!",
colour = G.C.MULT,
card = card
}
end
end
Question for clarification (code nabbed from VanillaRemade)
In this example, loc_vars is the name of the function, correct? Or is that pointing elsewhere?
oh sorry i thought this was for an object
for a mod badge its a bit more complicated
You would use card:is_face()
how much is "a bit"?
idk i would have to look into it, probably just replacing the color in the mod object
instead of doing elseif card_id == 11 or card_id == 12 or card_id == 13 then do
elseif playing_card:is_face() then
yes loc_vars is the field that stores the function you're defining there
No, it would be elseif playing_card:is_face() then
I can't find the context for a card being discarded. I want the card to be destroyed when discarding it while it has this enhancement
context.discard
right
oh wait right im stupid
But how would that be used. Does it rern a boolean?
Yes.
So I should use it in update()?
check trading card?
yes
Yeah does make sence i suppose
Morning, moddingdev!
can a button's click detection behavior be reversed?
As in while the Object is unclicked the button is visible, but isn't visible while the object IS clicked.
sorry to bother but what the mod object would be?
depends on how you add the button
you would need to reverse the logic in Card:highlight
SMODS.Mods.modid
modid as in my mod id yes?
yes
key = "poisoned",
atlas = 'custom_enhancements',
pos = {
x = 0,
y = 0
},
config = {
extra = {
mult = 1,
mult_mod = 1
}
},
loc_txt = {
['name'] = "Poisoned",
['text'] = {
"This card gains +#2# {C:red}Mult{}",
"when scored"
}
},
loc_vars = { vars = { card.ability.extra.mult, card.ability.extra.mult_mod } }
end,
calculate = function(self, card, context)
if context.individual and context.cardarea == G.play and not context.other_card.debuff then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
return {
message = localize('k_upgrade_ex'),
colour = G.C.MULT
end
end
end
end,
}```
would this work?
No.
owh
it's currently hooked into the UIDEF for the use and sell buttons, like the SHED one i did before
it's ui generation is in the hook instead of a separate UIDEF like the SHED button
(of course, if this isnt a good idea ill put the event in its own UIDEF function instead)
can you help me fix it?
context.main_scoring instead of context.individual and remove and not context.other_card.debuff
oh ok
yeah you would need to patch or hook card:highlight
thats all?
No.
owh
Am i doing this right? Trying to get the customsound to load
alright, shouldnt be harder than placing the damn thing so ill see if i can't get it
You need your mod prefix.
how did u sleep buddy pal
btw, a crash log states that i should already close the SMODS.Enhancement{ by the end, at loc_vars
woke up half an hour late but my bedding has never felt that soft so
Yes, loc_vars should be a function.
where do i place the prefix in this?
oh my god did i forget that
you did look comfortable
On play_sound
so i heard
man
you could just knock
nah no need to get up
ah ty
im not crazy for thinking i should have this UNDER the uidef hook right
since the button should exist first?
the order for hooks doesn't matter
yeah hooks don't need order because they're already defined
unless you specifically need two hooks of the same function to run in a specific order
You can.
then whats going wrong
SMODS.Enhancement {
key = "poisoned",
atlas = 'custom_enhancements',
pos = {
x = 0,
y = 0
},```
Does an atlas with the key custom_enhancements exist?
tried smth but it didnt work 😔
How do I add an enhancement to a random card in the deck/hand?
you could use pseudorandom_element to choose a random card from the deck or from the hand
well i made progress, Now i just need to get this to play randomly
for the hand, you could do G.hand.cards to access the cards in hand, but I forget how to get the cards from the deck
i think id have to shoot myself if thats what i heard entering a blind
much better
so is it pseudorandom_element or G.hand.cards?
don't worry, i'm going to try to make it play the sound only once, not oh the goose is stacking
pseudorandom_element(G.hand.cards)
pseudorandom_element selects a random element from a table, and G.hand.cards is a table
i think it sounds great
does not need fixing
also is it supposed to softlock lol
no, not really i'm trying to fix that as well
had no clue a single goose could lock my game
reminded me of my windy clip
that goose's throat is doomed
is that an F1 car?
ok but how do I apply the enhancement in the first place?
@zealous glen
trying to make a joker that has a 50/50 chance to give yuor either X2 mult or -5 mult, how would i do this?
you really did ping him at modding dev
god damnit
im not finished
soul_pos = {
x = 3,
y = 1,
draw = function(card, scale_mod, rotate_mod)
local anim_timer = ((G.TIMERS.REAL/4) % 1)
local growth_phase = anim_timer < 0.9
local scale_ease = growth_phase and
(anim_timer < 0.5 and 2*(anim_timer/0.9)^2 or 1 - 2*(1 - (anim_timer/0.9))^2) or 0
local min_scale = 0.2
local max_scale = 1.5
local current_scale = min_scale + (max_scale - min_scale) * scale_ease
local rotation = current_scale * 0.15 * math.sin(anim_timer * 2 * math.pi)
local y_offset = -0.2 * current_scale
card.children.vic_floating_sprite:draw_shader('dissolve', 0, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.vic_floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.floating_sprite:draw_shader('dissolve', 0, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
end
},
vic my goat
so the card children
Dilly the dog hello
i already set all of the things
what poppin vic
Not much and you
What’s troubling you
trying to get this fuck ass edition to work how i want to but hooking and making it happen is straight up not happening
What’s the Edition
ghhhhh
Describe it to me via interpretative dance
Or take a screenshot
Or just use words
attempt to index vic_floating_sprite
Card:set_edition({"e_key", true}) should work
where "key" is the edition's key
Did you transplant the code that adds the child
basically once the edition applies its meant to give a secondary bonus different each time it scores
i had asked something before how to do it and he gave me a suggestion but i shrimply cannot figure it out which was hooking smods.calculate_context and checking post trigger for values it has
the idea is the edition will let the card score once, then it scored 'again' with a value up to 150% bonus
ie, if its cavendish it will score once for x3, and then a second time it will score again anywhere from x1 to x4.5 immediately after
That excerpt you posted just draws an existing child
it lets you score up to 150% of its value
so the complete thing would be
local _card = pseudorandom_element(G.hand.cards)
_card:set_edition("e_key", true
try that
how do you add the child
I don’t think you need to add a third child then
Just refer to the existing soul sprite
but it isn't an edition it is an enhancement
and hows that
Card.children.…
it would be _card:set_ability then
so this apparently counts every single card in the deck.
if context.end_of_round then
card.ability.extra.stockpile_return = card.ability.extra.stockpile_return + card.ability.extra.stockpile_add
return {
message = "+" .. card.ability.extra.stockpile_return .. "Stockpile!",
colour = G.C.DARK_EDITION,
card = card
only that?
Well, the sprite is Card.children.floating_sprite, so you only need to manipulate that sprite
Not the Card.children.vic_…
card.children.vic_floating_sprite:draw_shader('dissolve', 0, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.vic_floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.floating_sprite:draw_shader('dissolve', 0, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
so i just
get rid of vics?
aight
soul_pos = {
x = 3,
y = 1,
draw = function(card, scale_mod, rotate_mod)
local anim_timer = ((G.TIMERS.REAL/4) % 1)
local growth_phase = anim_timer < 0.9
local scale_ease = growth_phase and
(anim_timer < 0.5 and 2*(anim_timer/0.9)^2 or 1 - 2*(1 - (anim_timer/0.9))^2) or 0
local min_scale = 0.2
local max_scale = 1.5
local current_scale = min_scale + (max_scale - min_scale) * scale_ease
local rotation = current_scale * 0.15 * math.sin(anim_timer * 2 * math.pi)
local y_offset = -0.2 * current_scale
card.children.floating_sprite:draw_shader('dissolve', 0, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
end
},
asking once again, maybe this time there is someone that knows, can I somehow link SMODS.Gradient to (mod)badge_colour?
@zealous glen should be good now?
i dont think you can
trying to make a joker that has a 50/50 chance to give you either X2 mult or -5 mult, how would i do this?
I had redesigned an effect to avoid this kind of behavior before. If you could use retriggers, you could maybe figure out a way to handle this, or maybe make the Edition behave like Blueprint but change the output
Idk but you might be able to hook or patch something to make it work
Look for how Balatro handles random numbers
i previously had a variant that just increased all of the values up to that margin in add to deck, but that didnt quite garner the effect i wanted
so its just been a lil bit of a frustrating experience
so here i am looking for other people to do it for me lmfao
if context.joker_main then -- or whatever context you want
if pseudorandom_probability(card, "seed", 1, card.ability.extra.odds) then
return {
x_mult = card.ability.extra.x_mult
}
else
return {
mult = card.ability.extra.mult
}
end
end
something like that should work
lemme see
as long as you are on the probability branch of SMODS
Maybe try patching the calculation process to make it work
As I said, I gave up on a similar effect
It’s have retriggered a card with X% efficiency
so filling in the blanks here, the Xmult and extra mult would be in the config?
Like Critical Hits
we fight for our lives, i dmed winter cause shes very smart on that stuff to see if she would be willing
odds too
what would the odds be? 2?
actually hang on, do you want it to be a 50/50 regardless of probability Jokers or no?
my next plan is to figure out how to properly add a health bar to one joker but alas that also proves difficult for me
sorry for the ping but are patches useful in this case?
.
well its supposed to be one or the other
Ima add a en-us.lua so i can have some more control for my custom content
ok, the code I gave you would always pick the xmult if you have oops all 6's
if you want to do random always, you should hardcode the random chance
pseudorandom("seed") < 1 / 2 or something like that
in the place of pseudorandom_probability
Yes
Ask @manic rune and maybe @hushed field
i was lookin at ccreate progress bar as well as corobos alloy mod
bepis unfortunately does not remember how create progress bar works so i need to dive in and figure it out eventually
im sorry but this is how i feel with ui rn
:3
lmfao
yea i wanted to adapt it to a joker, but dear god i despise ui
key = 'EVIL',
loc_txt = {
name = '{C:hearts}EVIL{} Joker',
text = {
'{X:mult,C:white}X#1#{} Mult or {C:mult}-5{} Mult'
}
},
atlas = 'sugar',
pos = {x = 0, y = 0},
rarity = 2,
cost = 4,
config = { extra = { odds = 2, mult = -5, x_mult = 2 } },
if context.joker_main then
if pseudorandom("seed") < 1 / 2(card, "seed", 1, card.ability.extra.odds) then
return {
x_mult = card.ability.extra.x_mult
}
else
return {
mult = card.ability.extra.mult
}
end
end
}```
I feel that
ok bro
did someone eat your calculate 😭
lmao
get rid of the (card, "seed") stuff lol
did it not, show you a red line there though?
its probobly "ui"
what the heck is wrong with ui
oh what the hell is that 2(card, "seed", 1, card.ability.extra.odds)
i fixed it chill
dont ask me, idk anything abt moding balatro
lmfao
don't question him
my crash report doesnt like line 68, which is if context.joker_main then
mb
GOOD LORD IM AN IDIOT
its all good man
bro what 😭
line 80?
key = 'EVIL',
loc_txt = {
name = '{C:hearts}EVIL{} Joker',
text = {
'{X:mult,C:white}X#1#{} Mult or {C:mult}-5{} Mult'
}
},
atlas = 'sugar',
pos = {x = 0, y = 0},
rarity = 2,
cost = 4,
config = { extra = { odds = 2, mult = -5, x_mult = 2 } },
calculate = function(self, card, context)
if context.joker_main then
if pseudorandom("seed") < 1 / 2 then
return {
x_mult = card.ability.extra.x_mult
}
else
return {
mult = card.ability.extra.mult
}
end
end
}
line 80 is the last one bro 😭
you need to end calculate too
just a question, what IDE do you use
ide?
like what software do you code in
i need you to use some vscode with the lua extension
there's other people here that use notepad, but yeah I'd recommend you use to VSC so that it can catch that kind of stuff for you
ight mb
ill get there
key = 'EVIL',
loc_txt = {
name = '{C:hearts}EVIL{} Joker',
text = {
'{X:mult,C:white}X#1#{} Mult or {C:mult}-5{} Mult'
}
},
atlas = 'sugar',
pos = {x = 0, y = 0},
rarity = 2,
cost = 4,
config = { extra = { odds = 2, mult = -5, x_mult = 2 } },
calculate = function(self, card, context)
if context.joker_main then
if pseudorandom("seed") < 1 / 2 then
return {
x_mult = card.ability.extra.x_mult
}
else
return {
mult = card.ability.extra.mult
}
end
end
end
}```
is this good
should be 👍 although I would recommend playing a high card with this, would it result in negative mult?
since high card normally starts with 1
probably
funny
is it buggin
in game says "Xnil Mult or -5 Mult"
how do i change the textures of the playing cards(or all the textures actually) in smods
you're missing a loc_vars function and some of your colors are wrong I think
nah the colors are right
SMODS.DeckSkin and Malverk
yea ik but how do i do it, i dont understand the explanations on github
well in that case you're just missing loc_vars
think i got it now
key = 'EVIL',
loc_txt = {
name = '{C:hearts}EVIL{} Joker',
text = {
'{X:mult,C:white}X#1#{} Mult or {C:mult}-5{} Mult'
}
},
atlas = 'sugar',
pos = {x = 0, y = 0},
rarity = 2,
cost = 4,
config = { extra = { odds = 2, mult = -5, x_mult = 2 } },
loc_vars = function(self,info_queue,center)
return {vars = {center.ability.extra.x_mult}}
end,
calculate = function(self, card, context)
if context.joker_main then
if pseudorandom("seed") < 1 / 2 then
return {
x_mult = card.ability.extra.x_mult
message = 'X' .. card.ability.extra.x_mult,
colour = G.C.MULT
}
else
return {
mult = card.ability.extra.mult
message = .. card.ability.extra.mult,
colour = G.C.MULT
}
end
end
end
}```
i added message
plus the loc_vars
what object do i do for the playing cards in malverk
No, you use SMODS.DeckSkin for playing cards.
the message should appear automatically if all you want it to say is +mult or Xmult
oh mb
try it without first
ok well
like also for 3 of hearts for example like ALL the playing cards or jact the faces?
Yes, you can change all playing cards.
how?
alr thank you it works
now i spend an hour making a sprite!
probably more like 5 min
i saw the wikipage but i already said i dont understand it otherwise i wouldnt be asking
also how do i change the texture for liker the jokers tags enchancement/decks booster packs
here's an example mod that changes most
https://github.com/xssgm/Touhou-Balatro-texture-pack/tree/main
thx
@scarlet imp i think it might be a bit unbalanced guys...
wait is it based on the yahimod evil edition?
I think its fine, you just got pretty unlucky
99% of gamblers quit before their big win, you know
i play yahimod? and watch yahiamice?
still i think its pretty bad for early game
real
I love gambling...
just bc Perkeo is bad early game doesn't mean Perkeo is bad though
it'll have its use I bet
real]
holy I forgot the main thing abt my joker
how do I check if the joker slots are full?
a bit like riff-raff
i literally only have yahimod, debugplus, mymod, and a couple of custom customize deck mod options
you should totally download @scarlet imp 's mod
peak gaming
jk it's WIP and probably will be for like a year bc of how much I wanna add
#G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit
Iirc
2 qutestions,
1st is the # a part of the code
2nd is the "lirc" a part of the code (idk american slang)
yes
no
is ues
Iirc means if I remember correctly
What
The '#' is code yes
Fuckin discord formatting man
Hate it
If I have a config array item for a deck, how do I set a variable to a numerical value based off the number of items in that array?
startingjokers = {'j_name', 'j_name'}
soul_pos = {
x = 3,
y = 1,
set_sprites = function(self, card, front)
if self.discovered or card.bypass_discovery_center then
card.children.floating_sprite = Sprite(card.T.x, card.T.y, card.T.w, card.T.h,
G.ASSET_ATLAS[card.config.center.atlas], {
x = 3,
y = 1
})
card.children.floating_sprite.role.draw_major = card
card.children.floating_sprite.states.hover.can = false
card.children.floating_sprite.states.click.can = false
end
end,
draw = function(card, scale_mod, rotate_mod)
if not (card.hovered and card.states.hover) or not card.children.floating_sprite then
if card.children.floating_sprite then
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
0.2, 0, nil, 0, nil, 0.6)
end
return
end
local anim_timer = ((G.TIMERS.REAL/2) % 1)
local growth_phase = anim_timer < 0.9
local scale_ease = growth_phase and
(anim_timer < 0.5 and 2*(anim_timer/0.9)^2 or 1 - 2*(1 - (anim_timer/0.9))^2) or
0
local min_scale = 0.1
local max_scale = 1.5
local current_scale = min_scale + (max_scale - min_scale) * scale_ease
local rotation = current_scale * 0.15 * math.sin(anim_timer * 2 * math.pi)
local y_offset = -0.2 * current_scale
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
current_scale, rotation, nil, y_offset, nil, 0.6)
end
},
@zealous glen
put # in front of a table to see how many items are in it
I should add it somewhere here yes?
SMODS.add_card({key = "j_mr_bones"})
end
What’s the issue
If it's a configuration item and this is in an event, do I need the self.config. prefix?
Try taking the if out
I'm not sure I understand
is this in the Joker's calculate or something?
if self.discovered or card.bypass_discovery_center then
card.children.floating_sprite = Sprite(card.T.x, card.T.y, card.T.w, card.T.h,
G.ASSET_ATLAS[card.config.center.atlas], {
x = 3,
y = 1
})
card.children.floating_sprite.role.draw_major = card
card.children.floating_sprite.states.hover.can = false
card.children.floating_sprite.states.click.can = false
end
this?
Where did this come from
random question how do you make a card overwrite chip value and give specified amount on an enhancement like the stone card?
the first one?
I think SMODS has an option to ignore the base rank completely that handles that
None of that was in the code you sent
set_sprites ifs
oh wha
yee but how do you make it give chips after rank is removed?
I'm trying to start a deck with two jokers. I'm trying to write a function that will check an array in the deck's config to see what to add. So I want to step through the number of items in that configuration item to make the adds. This is what I've got so far:
Hey! Im trying to make a joker that triggers if no other joker has activated that hand. Any context or G.Game for this?
Oh right. But I’m not talking about set_sprites
ah oke
I’m talking about the code that moves it
if not (card.hovered and card.states.hover) or not card.children.floating_sprite then
if card.children.floating_sprite then
card.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, card.children.center,
0.2, 0, nil, 0, nil, 0.6)
end
return
end
comments out this?
The first if at least
whole lotta red
try it with the self.config prefix, my gut says that it owuld need that
but I've also never made a deck before
I mean that’s on you
You didn’t comment out the end 😭
well it works now, but animated non hover
this should work as a .json script to make it show up in the mods list right?
(its my first time coding anything so I'm really bad at it)
I'm trying to get the info from the en-us.lua to tag joker as a way to cut down on code in my joker files.
Here's an example from the VanillaRemade joker
Try adding a different code block for the check and printing to the screen to test it
will do, thanks
:>
I think you either add a calculate function or give it inherent bonus chips
shouldn't this work?
Does it not?
nope
Is the file name the same as the folder it’s in?
huh
(I'm stupid I don't know what you mean)
For example, if your mod’s folder is called “your_mod”, you should have the json named “your_mod.json”
That shouldn’t make a difference
let me try it anyway
-# it won’t make a difference at all it doesn’t matter what thet file is called
anyone know how when using context.before, i get my joker's effect to proc after the cards are raised instead of before (e.g. vampire)
didn't do anything
when vampire (left) does it, it runs its effect after the cards are raised, and also juices the cards and displays a message all at the same time
when mine (right) does it, the suits change as soon as the hand is played, with the message and juice happening after the cards are raised like with vampire
-# I was looking at the metadata docs and that’s the possibility I came up with 😭
like it just doesn't appear here
no clue!
Idk if it’s a huge deal but dependencies is misspelled
And conflicts should be plural
Again idk if that’s what’s doing it but def worth fixing
nope didn't work
You are saving your files right
?
ctrl + s while the file is opened
😭
thank you so much
Tbf you did say you’re new to this whole thing
lol
Anyways, getting your mod to load in my eyes officially makes you a dev, so welcome to the hobby
spamming it until they filed a cease and desist letter
you guys' editors don't save the file every other second?
I think I had to enable vscode to auto-save when window was unfocussed
I hate autosaves, that's just a me thing I think though
Nah I do too
I want FULL CONTROL
I just didnt know such a thing existed
Full control of what though? I don't want my editor's file and the file that's being read to be desynced
that's why you save
if you're looking for a logical explanation I don't have one
just a pet peeve ig
I personally don’t want things getting saved that I don’t want saved. It’s a weird mental thing but that’s how I roll
Yeah I'm making the pc do it for me instead of me having to press it manually
interesting
that's a good way of saying it I think
whenever I try to load in balatro with the joker I made this pops up
code?
is there an easy way to get the final round score?
where is Jokers.png located?
why is that?
Is there a context.card.cost for vouchers
how would I get this value?
is there a context before context.before but after context.press_play?
i want to destroy the leftmost played card between those two
G.GAME.chips
thank you NH'
modify_hand i think
and a couple of other blind ones
You don’t need the Steamodded header anymore since you’re using .json metadata
oh
You have much to learn (and we’ll help!!)
senpai Astra?

I've kept mine in my mod to show me how far I've come 🙂
You know what would really tell you how far you’ve come?
Not having it anymore 
Bet
why
because i can 😎
What the fuck 😭
please uninstall this game immediately
I’m revoking your IDE priviledges
you have'nt seen nothing yet... that's just the beginning
oh no...
Uh oh
is there a way I can find out what booster pack I'm in if all I have to work with is G.STATE
oh no
Guys 🥺
I will have nightmares today
Jesus christ I haven’t seen this in YEARS
actually i wasted an entire yesterday trying to understand how to do this and today figured it out in like 20 mins lol
replacing files or code?
uh i think it's just a simple hook, doesn't work in the run tho unfortunately, will have to look in to this but it's a start ig 

yeah i want it to be a joker ability
😭
You people scare me sometimes
god forbid people have fun 🫠
It’s not like we’re telling you to stop
I want to see the final resoult
i'll post it if i can get it to work, no promises though
im kinda of a noobie
same here, and I didnt see you askng questions here so ur better than me
i just searched for whatever i wanted to do, it worked kinda well, dont wanna be that just spams wit the most basic ahh questions w/o doing any research first
that guy*
is there documentation for states added to G.STATES by SMODS?
...
iirc you’re looking for SMODS.OPENED_BOOSTER
yeah I have that but I just want to do a bit more research
bc if possible I would like to know what kind of pack I'm in, like a Tarot pack specifically for example
Yeah that global should be the pack object
Hey every. Does anyone happen to know where the code to make the title screen do stuff is? I am looking to add a 'thing' to the title screen, similar to how Cryptid or Multiplayer does it.
.kind should have the kind
No, just SMODS.BOOSTER_OPENED.blablabla
thanks guys
<@&1133519078540185692>
thanks mods
game:main_menu
ah
SMODS.Atlas({
key = "CustomJokers",
path = "CustomJokers.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
}):register()```\
apparently something is wrong with this
why
SMODS.Atlas{
key = "CustomJokers",
path = "CustomJokers.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
}
Maybe? That's how most people register their atlases.
trying to make a joker that destroys itself when bought
this should be pretty easy right?
just use add_to_deck right
yeah and then use SMODS.load_file("filepath") in your main file
that's how I load all my files lol
huh ok well that was easier than i thought
ok let us see maboi
where do i put SMODS.load_file("filepath")
nvm im dumb
main.lua or whatever your main file is called
you can use context.card_added and make sure you're also in the shop
so like if G.shop_jokers and context.card_added maybe
context.buying_card
use add_to_deck
yeah
Im gonna start removing random contexts
Good luck fellas
it don workie
start with context.forcetrigger
wait
turn it into a mp44444
or .mov
one moment
Mp4 more like mp snore
is this atlas in a separate file or is it in your main file
sorry I should have asked that first
the atlas is in main.lua
oh btw there's context.buying_self
I cant buy myself
then just make sure the atlas is before anything that needs it
sorry I though it was in a separate file
if context.buying_card then
{
cardarea = G.jokers,
buying_card = true
card = self
}
``` heres what i have so far im too stupid to figure out where the ```add_to_deck``` would go and how many indents in
i have this rn
SMODS.Atlas({
key = "CustomJokers",
path = "CustomJokers.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
}):register()
SMODS.load_file("C:\Program Files (x86)\Steam\steamapps\common\Balatro\Balatro.exe\resources\textures\1x\custom_enhancers")```
at the start of the file
add_to_deck is a separate function, if you want to trigger only when bought then use context.buying_self
if you want it to trigger when obtained by any means use add_to_deck = function(...)
isnt assert better to do?
Anyone know the context.card.cost but for vouchers
i don't think you need to register the atlas or load the images
Im not familiar with the :register
Is that something we do?
you don't need to load the asset file manually and also load file is relative to the folder
alr here it is
so i can remove the file and the atlas part?
if i use add_to_deck would it automatically count as itself
no the atlas part is fine, maybe remove the :register
check if the file is correct
this is cinema
you can spawn Jokers manually by navigating to it in the collection and pressing 3
you can give urself the joker by clicking "3" on it
I need that
I KNOW GUYS
damm you were faster
and more words too
just wanted to showhow it would look in a run
SMODS.Atlas({
key = "CustomJokers",
path = "CustomJokers.png",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
SMODS.Enhancement {
key = "poisoned",
atlas = 'custom_enhancers.png',```
i use a different atlas right after this
is that a problem mayhaps
so it should look like this?
if add_to_deck = function(self, card, from_debuff)
this isn't even it's final form yet btw
If you haven’t defined it absolutely
the atlas field takes a key not a path
so remove that?
no
gulp
bro which joker?
NVM
i link the line 😭
mb
Lowkey need it
Wanted a joker that changes the background
I KNOW RIGHT
SMODS.Atlas({
key = "CustomJokers",
px = 71,
py = 95,
atlas_table = "ASSET_ATLAS"
)}```
help
this incorrect?
It's not that hard to do tho btw
ok so now it should be context.destroy_card == card for the function?
just kinda funky
you're missing the path
kay.....
I also need to know context.card.cost for vouchers but ig that can wait
you said it didnt take a path
how do you paste code in discord
the function doesn't have a context
you can just do SMODS.destroy_cards(card)
Context.card.cost isn't working for vouchers or boosters so
Yes
i meant the enhancement that had the .png
oh
ight
in context.buying_card?
if card.ability.extra.slycooper_remaining == 0 and context.buying_card and context.card.cost > 0 then
card.ability.extra.slycooper_remaining = 1
context.card.cost = 0
return { message = "SNATCH!", colour = G.C.RED }
end
forgot im still hooking ui at the end of the day no wonder i want this world to burn
I did this but vouchers and boosters don't come free
key = "poisoned",
atlas = 'custom_enhancers',
pos = {
x = 0,
y = 0
},
config = {
extra = {
mult = 1,
mult_mod = 1
}
},
loc_txt = {
['name'] = "Poisoned",
['text'] = {
"This card gains +#2# {C:red}Mult{}",
"when scored"
}
},```\
yeah buying card doesn't work with boosters (or vouchers im pretty sure)
😔
for boosters there's open_booster
crashlog says atlas is a nil value
for vouchers idk
Yeah that's the problem I have
do you have an atlas
do i have to make another atlas?
yes
:(
- does changing
buytotogglehere create a new thing or will that break something - card highlight uses the ui box thing, do i move the one i have hooked into
use_and_sell buttonsto theCard.highlighthook and that's the UIBox, or is it something else?
I'm so dumb
so on add i used
G.SPLASH_BACK:remove()
G.SPLASH_BACK = nil
G.SPLASH_BACK = Sprite(0, 0, 23, 13, G.ASSET_ATLAS["nanu_smartbg"], {x = 0, y = 0})
G.SPLASH_BACK:set_alignment({
major = G.ROOM_ATTACH,
type = 'cm',
offset = {x=0,y=0}
})
and on remove
G.SPLASH_BACK:remove()
G.SPLASH_BACK = nil
G.SPLASH_BACK = Sprite(-30, -6, G.ROOM.T.w+60, G.ROOM.T.h+12, G.ASSET_ATLAS["ui_1"], {x = 2, y = 0})
G.SPLASH_BACK:set_alignment({
major = G.play,
type = 'cm',
bond = 'Strong',
offset = {x=0,y=0}
})
G.SPLASH_BACK:define_draw_steps({{
shader = 'background',
send = {
{name = 'time', ref_table = G.TIMERS, ref_value = 'REAL_SHADER'},
{name = 'spin_time', ref_table = G.TIMERS, ref_value = 'BACKGROUND'},
{name = 'colour_1', ref_table = G.C.BACKGROUND, ref_value = 'C'},
{name = 'colour_2', ref_table = G.C.BACKGROUND, ref_value = 'L'},
{name = 'colour_3', ref_table = G.C.BACKGROUND, ref_value = 'D'},
{name = 'contrast', ref_table = G.C.BACKGROUND, ref_value = 'contrast'},
{name = 'spin_amount', ref_table = G.ARGS.spin, ref_value = 'amount'}
}}})
which is just copypaste from vanilla code
don't know if this remove nil code is necessary but whatevs
And if anyone's wondering:
Yes, that's how you add / change a custom image background
or that's how i did anyway mb there's a smarter way to do this but who knows 🫠
I should put buying_booster and buying_voucher
Thank you gang
I'll figure out this gibberish later
it's pretty ez actually
finally it works
if i want to add a custom sound, where would i put it in my folders
Balatro.exe/resources/sounds i think
although if you wanna do that to the start menu u'll prob have to hook
within my mod's folder
So I'm just trying to understand how jokers work before I even begin trying to code my own.
can someone possibly explain what the code in the red and blue boxes do and how they actually work?
oh then i dont know
i put it in balatro.exe using 7zip
Ah
Where do I put it
it does yeah
mod folder/assets/sounds
make sure you have smods.sound
well if you wanna do what i did, in your joker def, otherwise you'll probably have to figure that out in your know, for the main menu u can again prob just hook
*on your own
uhhhhhh i maybe will upload it in the future, although i kinda dont want share my github soooooo......
mayhbe maybe
what, you got some scary things on there
why does this permadebuff cards
images with more context
It's okay
ehhh just some personal stuff i dont want everyone to see
are you scary?
could just make an alt github for purposes otherwise if you dont want people to see your own thing
unless the mod youre making is private it would have to have its source linked per the rules
maybe i'll make another github acc or gitlab acc actually since i dont have one rn
yea
yea i know
it debuffs cards until you undebuff them manually
It's okay mate
depending on who is asked determines that answer
the average person will say no cause theres no reason to be
the mod's not even remotely finished anyway so....
alr whats wrong with my code...
SMODS.Joker{
key = 'shyt',
loc_txt = {
name = 'Fine Shyt',
text = {
'*random screaming noise*'
}
},
atlas = 'shyt',
pos = {x = 0, y = 0},
rarity = 1,
cost = 0,
add_to_deck = function(self, card, from_debuff)
SMODS.destroy_cards(card)
sound= "silly_scream",
end
}
crash report said something on line 118
bottom line
so I have nothing to fear?
sound= line is wrong
lmfao no
i dont threaten people much on the internet
done
im just a chill guy
I see
So if this ends the game in game over...
G.STATE = G.STATES.GAME_OVER
G.STATE_COMPLETE = false
...how does one trigger a Game Won?
you should never fear any buffoon on the internet my friend, most of it is all talk and no action
key = 'shyt',
path = 'evil.png',
px = 71,
py = 95
}
SMODS.Sound({key = "scream", path = "scream.ogg",})
SMODS.Joker{
key = 'shyt',
loc_txt = {
name = 'Fine Shyt',
text = {
'*random screaming noise*'
}
},
atlas = 'shyt',
pos = {x = 0, y = 0},
rarity = 1,
cost = 0,
add_to_deck = function(self, card, from_debuff)
SMODS.destroy_cards(card)
sound = 'silly_scream',
end
}
idk
sorry to keep asking ab this but is this in G.booster_pack somewhere?
no i meant that entire line is wrong
false asf he swindled me out of my flat screen
?
you need to use the play_sound function
check the docs
shhh, you must not out this iformation
me fr
wdym
like what kind of booster pack the player currently has open
I can use G.STATES.SMODS_BOOSTER_OPENED to see there there is a booster open, but not what kind it is
you use what eremel said and check (what he said).config.center.kind
N i just ate some cobra bites
some what
im sorry for you
lmfao
key = 'shyt',
path = 'evil.png',
px = 71,
py = 95
}
SMODS.Sound({key = "scream", path = "scream.ogg",})
SMODS.Joker{
key = 'shyt',
loc_txt = {
name = 'Fine Shyt',
text = {
'*random screaming noise*'
}
},
atlas = 'shyt',
pos = {x = 0, y = 0},
rarity = 1,
cost = 0,
add_to_deck = function(self, card, from_debuff)
SMODS.destroy_cards(card)
play_sound('silly_scream', 1, 1),
end
}
that sounds good tho
dont be sad, get glad
what editor are you using
pls use vscode with the lua extension
on my hands and knees begging for vscode
I will second this, it made my life infinitely easier as compared to notepad++.
im not that mean but im always thinking about making it a personal rule to not reply to syntax errors haha
bumpination
what if you do it and see what happens
i dont know what it IS 😭
how do i make a joker add an enhancement to a scored card?
im looking at some tarots and confused
midas mask?
oh yeah
lol
i was looking for a joker that did something similiar 😭
couldnt find it
thank
unfortunately that was not free, you now owe N 1 silver coin
as his manager i get a single bronze coin as well

If we owed a penny to N' for every time he helped us he would probably be a millionaire
then i currently owe n 14 cents
gulp
return {
vars = { (G.GAME and G.GAME.probabilities.normal or 1), card.ability.extra.odds, info_queue[#info_queue + 1] = G.P_CENTERS.poisoned } }
end,```
what is they talkin aboot
this doesnt look too good
oh i made an error
but what do I know
oh ok
i recommend looking at vanilalremade for how loc_vars is set up
peaknilla repeaked
that is fine, the problem is where it is
exact same error
wait do you mean the one in vars or the one in function
again, it's easier if you check an example

evil joker?
how long it took me to make them

what does evil joker do
so pretty good or just kinda annoying
yea
but why not x50 mult or deletes your save
peak
who fancies a new smods release?
me
how different is it from latest dev
is it going to add calc dollar bonus to decks
it won't be any different to latest dev that's the point of releases
oh right
see thats my silly little point
we here in dev already got whats there :b
Me
what is G.P_CENTERS? i dont know where to look for it in steamodded huide (if its even there)
(i say this as i finally updated to latest dev today after not for like a month)
yes but with a release you can add it as a dependency and not make people angry
Correct
G.P_CENTERS is like the area where you find all the centers in
huh i should actually change the dependency at some point
i'm simplifying but a center is like the origin of an object
every time an object is made it is created from the center?
where do i search?
like you can check if card.config.center == G.P_CENTERS.m_lucky to check for lucky card enhancement
there's other ways to do that
how would i make a new center
well figure it out cause this is OOP
wha-
hear me out, SUPER EVIL Joker
oop?
object oriented programming
super evil joker deletes random files in the balatro directory
nah itll crash ur game
is an object just like for example a new joker? or something seperate
Just Jimbo
slowly removes other Jokers from the game overtime
yeah
that would be EXTREMELY EVIL Joker
Oops! All Jimbo!
oh but i have that and treid that
well then get good
you spelled tried wrong
im just curious, is there any way to make jimbo appear and say text yu set in a jokers function?
anyway how do I remove an enhancement
or do u not know
check vampire
does an enhancement count as an object?
yeah
not a clue, i think people were doing something with jimbo quips before and i think someone had before made their own thing with a ton of text.. but i dont remember who it was off the top of my head
can you send the entire file
n how do i clear enhancements 🙏
card:set_ability(G.P_CENTERS.c_base)?
in dm's?
here is fine
ok

