#đ»ă»modding-dev
1 messages · Page 545 of 1
any way to make sure a custom joker spawns with no edition? I know no_edition is a thing but again I don't know if just slotting that in there would cut it. I've only seen people use that with SMODS.create_card
You can set edition to nothing
ya that was it!! but now, i need a way of removing the base draw step
Wdym
so what's happening here is
what
the deck is being drawn with the diffuse shader
and then drawn with the drilled_consistent shader
please provide me some context for this specific sentence.
but i'd like only the latter to be drawn
Yeah i have no idea
LOL
Bepis btw can lovely patches help me change a base game shader to a different one ?
Itâs pretty difficult
I wonât recommend since it doesnât translate very well
Itâs 70% the same thing tho
hlsl?
What i would recommend is going through random shaders you like and seeing how they make the effect
Thatâs how i learnt
Thatâs easy
thats easy
I have something like this if you want to copy it
oh
i'll try
Basically just draws a line
what language is this written in?
And increase the values a little for more bright since i have it slightly yellow
the shaders i mean
F# and glsl
Itâs pretty neat yeah
oh its like C#
in the fact that it's made by micron soft
which shader are u talkign about here
Sword params is the one iâm talking about
alrighty
You can download and see them for yourself
Mhm ?
Btw if you need references or code with explaining and comments look in smods /examples / edition example /assets/shaders theres one called ionized that has comments explaining the basics
In the github
is there any code docs on how to implement these as an edition
Smods/examples/edition example

In the GitHub
ty
Thatâs literally what i said here lmao
Hey sleepy howâs jtem doing

the drilled shader is also not being rendered
I love drawstep
s
children
đ
actually i think it's both
Schizophrenia
hmmm looking at my code self is fine, but the card argument is wrongly named i think
s, youre "new" in this chat right, or who are you
Iâm new Somewhat
Iâve been in the server for a while but i only made one mod and itâs unfinished
if that doesn't work try changing card to self
this doesn't work either. the trues were for no tilt, so i assumed they were unneeded
for the ARGS? or
Change the arguments to card, layer
ok i woke up a bit more
card there is actually layer so change all instances of card for self
also self.edition is a table
Hm?
ah gotcha
I want to see more your drawings
Oh iâm not really a good artist in pixel art nor digital since i only use a mouse i just do some sketches lol
Iâll show you later tho iâm on my phone currently
ok
only shadow drawn 
drawstep just has two arguments card, layer
Thatâs a tiny ace
this may just be an issue with the shader though
it may be rendering the base card on top of the Ace front
This happened to me once
Accidentally rendered the card with the shader on top of the card
Lol
â

I love coding in my note app
SMODS.DrawStep({
key = âdrilledcarddrawâ,
order = 21,
func = function(self, card, layer)
if card.edition and card.edition.key == âe_phanta_drilledâ then
if card.phanta_drilled_consistent then
card.children.center:draw_shader(
âphanta_drilled_consistentâ,
nil,
card.ARGS.send_to_shader
)
else
card.children.center:draw_shader(
âphanta_drilledâ,
nil,
card.ARGS.send_to_shader
)
end
end
end
})```
I just added ARGS to parameter
trying

it's back to not rendering at all ;u;
Is this how people in notepad code ? This is hell
Rip 
okay, i now know what's happening, but not how to fix it
the shader is being drawn exclusively
nothing else is being drawn over the top of it
what needs to be drawn over it?
well, actually, it needs to be drawn on top
the center and the front need to be drawn
and all the other stuff
then set your order to be lower
how low?
center is drawn at -10
ah
you can find them all in carddraw.lua
-11 it is then
- still not working
- i need to fix card extras disappearing too
-# this is drawn using front
smtcom asking the real questions here
the "in the position of a seal" part would need you to manually work with positions though, since seal textures are drawn on card-size canvas lol
but i assume you can kinda copy the code of how balatro applies the texture of stickers/seals on cards, except change that with the joker's texture?
lemme check
mm, i think i see the problem, but i don't know how to overcome it
it's disabling the base shader, and also not drawing it
Yes, but how do I change the size and position?
mm one sec, lemme experiment smt
closer
mm, this is too difficult to implement
i'm gonna omit Drilled from the new update until there's a solution
hm
i suspect i need to do something more clever with the shader, but the base card needs to be disabled for there to be a hole
otherwise, it draws over it
what is drilled supposed to do?
it's meant to be a hole through the card
+1 consumable slot, unless it's on a playing card, in that case, +1 discard when scored
you'll need to set every layer to draw the hole then
so instead of stuff using the dissolve shader it'd need to use your shader with a hole in it
mm, i see
probably easier to do with a draw_shader hook rather than a draw step
what the hell is G.shared_seals for :3
what does card.ARGS.send_to_shader contain?
It's where all the seal sprites are.
mm
i tried changing a lot of stuff in there, but nothing seemed to affect the seal's rendering itself though
my idea was that you can similarly have a table like that and change the scale in there, but it doesnt seem to change anything
thats just the config table lmao
You mean the center?
oh, yeah
wait, what about G.P_SEALS?
i mean, the uhhh something thats placed in a card so that the game knows to render it
is that a thing?
idk
mm nvm
it has VT, scale and allat idk what to call it
the sprite object?
it's G.shared_seals haha
wtf............
(bump)
all seals use the same sprite
it's drawn here
https://github.com/Steamodded/smods/blob/9ed9ae184c61353ae70e9e88fa3d62a6b78ce5a3/src/card_draw.lua#L266
yeah im checking that rn
would changing stuff in G.shared_seals.Redalso change how all red seals are rendered, or do i have to do some more stuff
Yes, it would.
i kinda changed a lot of number values in the seal too
and i havent seen anything changing so far
try :set_sprite_pos
yeah all the positioning and stuff is done by the shader i think
im not good at the graphics part
(bump)
its harder to just, make the seal rendering bigger than i thought lol
maybe i have to patch into here so that it uses another variable to change the scale?
draw_shader has a scale argument i think
weird, this makes no reference of any table values
mmmm probably ms (maybe the s stands for scale idfk)
yeah
i think custom shaders just don't use those defaults
right icic
i dont think it was scale
well it certainly works lol
funny
@daring fern sorry for taking too long to answer your question, but you want to change those in the function to change the size and position :p
"increase seal's value and size by X2"
how can i check if the card that the shader is being applied on, in draw_shader, meets certain conditions?
No, that's this problem again: #đ»ă»modding-dev message
umm i have no clue what the problem means 3:
and i gotta go out to eat for my bday party rn, sorry.....
oh! happy late birthday ^^;
thanks ghost :3
np bepis :3
enjoy
there's gotta be a better wayyyyy
I know this might be a nitpick, i would put it all on one line so you dont have to deal with the changing of rows
right, sorry to bother, i'm really struggling with this
i need to be able to tell if a card needs to be rendered with the hole or not, but draw_shader only deals with sprites
and i tried a hack solution for that, but to no avail
halp đ
oh that is a very good point
I've been reading up on the way Love2D handles graphics for other shader related issues, and I think I did see that the engine allows for sprite masking đ€
But I might very well be misremembering
huge if true
Oh yeah, Love2D allows you to mask using Stencils, but I'm not sure how that properly translates to how Balatro handles shaders
I think there might be an issue with a stencil being a very fundamental objecttype so I don't know how easily you can use it to start messing with Balatro cards
I think you'd have to change cards into being individual stencils
afaik, the entire screen is one stencil
interesting
i switched back to doing it the regular way, what i was doing before, and noticed another issue â if a card has a draw, and is drawing another shader, it does it on top of the hole
it seems that this can only be fixed by hooking draw_shader
i'm honestly inclined to scrap this edition
it's causing too many issues đ
ya i'll maybe bring it back later
hopefully by then, there'll be better SMODS support for shaders like this ;u;
/nm
[/not mad]
no because it's applying it to a joker yet it gives +1 handsize not +1 joker slot
it's basically merging juggler into an existing joker
Im pretty sure that you should disable base card shaders if your shader modifies the shape of the card
The SMODS.Edition docs say so at least
What if you change the draw order to 21-29?
i've tried that
currently trying to make a specific joker play a song, however, apparently i cant bc talisman ? (ping plz)
so normally if card.ability.extra.goldFred = false it should do the else thing, but in game it does nothing (the 3 in pseudorandom was to test if it works, I deleted that 3 now and added all numbers to pseudorandom, but now only goldfred gets acticated and the rest isnt at all) I found out that goldFred is somehow always true, but idk how to fix that
how do i get my joker to display on the title screen
Look at cryptid
which file does that
Your pseudorandom is not in any set context. Therefore, this joker will roll for goldFred at EVERY available opportunity, including once for every card in your full deck.
Likely, the easiest solution will just be to include it in your existing end_of_round context.
Dunno usually I just look around at the hooks or at the lovely patches
also how do i get my deck to change ranks
Thereâs an example in the smods wiki for random ranks
so I fixed it now, the pseudorandom only does it now when play gets pressed, and the chips didnt got granted because I forgot the chips =... before the card.ability.extra.chips 
If thatâs what you want
He did a very big oopsie but it's fixed now
i wanted it to be Oops All Aces
key = "oopsallaces",
pos = { x = 0, y = 0 },
atlas = 'decks',
loc_txt = {
name = "Oops All Aces!",
text = {
"Every card in the deck is",
"an Ace."
}
},
config = {},
apply = function(self, back)
G.E_MANAGER:add_event(Event({
func = function()
for _, v in pairs(G.playing_cards) do
-- Only change the rank, keep the suit
if v.base.rank ~= 'Ace' then
v:change_rank('Ace')
end
end
return true
end
}))
end
}```
here's how i coded it
it didnt work
where did it go wrong
all im getting is "attempt to call method 'change_rank' (a nil value)"
Itâs change_base
Not rank
Steamodded example mods. Contribute to Steamodded/examples development by creating an account on GitHub.
Because it doesnât exist

Try Ace or 14
How would I go about using g.localization to change the name of planets? Not the individual ones, the overarching type.
Ace worked.
Check the Undertale mod it changes name and sprite of spectrals
this changes the name of planets to characters https://github.com/xssgm/Touhou-Balatro-texture-pack/blob/afa169c31207443f2e14ccb94bbc96ca258055ad/localization/default.lua#L4
Did you had that on standby
touhou texture pack mentioned
no it took me 2 minutes to find
That was pretty fast
well i already knew about it
Iâm not looking for just sprites and names, Iâm looking for the actual type. So Astronomer would say âAll ânew nameâ cards and Celestial Packs in the shop are free.â
I canât recompile balatro right?
yeah people do texture swaps all the time, i think it's just rezipping it
idk why you would need to tho
Ok it might be what Iâm looking for thanks
I think i spent a week trying to replace the background shader
I put my deck sprites in 1x and they work fine for me but my friend is trying the mod out and the game is trying to read 2x. Does anyone know why?
pixel smoothing option on
they need to either turn that off or you need to include the 2x texture which you should
^ upscale your sprites to exactly 2x the resolution (WITHOUT ANY INTERPOLATION) and put it in the 2x folder with the same exact filename as the one in the 1x folder
alrighty, thank you !
i have 2 questions
hi s :3
Well vanilla remade got your back
oh yeah on the blueprint stuff
how's my deck art?
it won't have joker retriggers though
Blueprint and brainstorm donât copy the ability they just make the copied joker calculate twice
^ blueprint and brainstorm will automatically run the whole calculate function of the joker they're copying, you have to explicitly add checks for not context.blueprint if there's code you don't want to be copied (e.g. the joker scaling)
well that tracks yeah
and ik about the not context.blueprint stuff
but also how do I retrigger jokers
you use context.retrigger_joker_check
Context
and return repetitions = num
Return repetition =
is this like context.indvidual where it goes through every joker
p sure its context.other_card for checking each joker
if context.retrigger_joker_check then
and then
if context.other_card == condition then
return { repetitions = 1 }
am i getting that right
I also need to actually enable this as an smods option in my mod don't I
Yes
i had to enable deck calculate so i'd assume joker retrigger is also like that
guys how do i get a joker, that applies random editions to a card, to basically not apply one specific edition
(the edition is from a mod)
(not my mod)
poll_edition has an argument where you enter a table
the table should include keys of editions you want it to choose from
if you include a number with each edition key, you can set their weight, otherwise they use their base weights
Check for mod existing first
bump ^
oh god wait if i'm making a blueprint
How are you doing it exactly
(Vanilla remade) ctrl+c ctrl +v
the problem is that this joker copies 2 jokers
so I either need two dynatexts or some other way to display it
go ahead
I am aware that a blueprint that hits both adjacent jokers is not very creative
this joker is also going to retrigger those jokers
mostly because I want to see what happens if I do both
No Iâm saying you can reference the code
like this đ
From nxkoo
Just search up blueprint
what are you trying to do here
Probably play a song when joker is obtained
yeah
Which you can do with just replace
you know you can just do this right
Try Nâs method
just do
select_music_track = function()
return next(SMODS.find_card("j_modprefix_key")) and math.huge or false
end,
also if it's music it has to have "music" in the key
(as per SMODS.Sound documentation, select_music_track is expected to return a number, and the song that returned the highest number "wins" on that frame and gets to be played)
remember that if you do select music track
your song key must include music
or it will crash
trying to make a joker that copies the joker to its left, and debuffs the joker to its right
the code and the joker work but it lags the hell out of the game and prevents any actual gameplay from happening
The lion doesnât stress himself with the code he just copies it
it's because it looks for music to set a value in the sound manager
Because youâre calculating every frame
no?
why are you returning this
how
it was written when i was very tired
searching up blueprint gives me every instance of blueprint_compat and not context.blueprint
untire yourself
-- blueprint
im going to cry
okay it doesn't lag the game out but the game still isn't progressing
like you choose a blind and no cards get drawn
also there's a double copy example in the wiki
no one told me that
also what
also use this https://github.com/nh6574/VanillaRemade
well no one knows because nobody read my wiki
I search your wiki sometimes and half the time i find the answer and half the time i dont
i did (partially fake)
Your honor i havenât modded in a week
update the game seems to run worse and worse as time passes
I absolutely despise all things UI code
not getting flooded with debugs but it's unplayable
just copy the code from blueprint
the nxkoo example has the ui for it
Marie itâs simple stop stressing out
i am a surgeon
config = { extra = {dollar = -25}},
calculate = function(self, blind, context)
if context.before
and (context.scoring_name == "Flush"
or context.scoring_name == "Straight"
or context.scoring_name == "Three of a Kind"
or context.scoring_name == "Two Pair"
or context.scoring_name == "Pair"
or context.scoring_name == "High Card") then
dollars_mod = blind.ability.extra.dollar
return {
dollars = blind.ability.extra.dollar
}
end
end, ```
trying to make a boss blind that make you lose 25 dollars when playing any hand lower than a full house but all it does i crash, any help ?

oh my buddha
you can put this all in 1 code block yk
i tried too but i failed oops
put three of these symbols ` before and after your message
not one line at a time, the whole thing
type lua after the first set
and it will highlight in lua colors
the first set
not the second
got it, thanks
whats the crash
blinds dont have ability
i'm gonna screenshot the crash just gotta reboot my game
just press ctrl+c at the crash screen
LMFAO
Mrbeast
mrbreast

Money đ°
mrbeast real
still need help making this not lag tf out of the game
calculate = function(self, card, context)
if not context.check_enhancement then
local other_joker = nil
local debuff_joker = nil
local prev_chosen = {}
for i = 1, #G.jokers.cards do -- Undebuff previously chosen Jokers which aren't currently chosen
if G.jokers.cards[i].ability.two_faced_chosen and G.jokers.cards[i] ~= debuff_joker then
if not G.jokers.cards[i].debuffed_by_blind then
G.jokers.cards[i]:set_debuff(false)
end
end
end
for i = 1, #G.jokers.cards do -- Mark Joker to copy and debuff, choose debuffed Joker
if G.jokers.cards[i] == card then
if G.jokers.cards[i - 1] ~= nil then -- Ensure copy Joker exists
other_joker = G.jokers.cards[i - 1]
end
if G.jokers.cards[i + 1] ~= nil then -- Ensure debuff Joker exists
debuff_joker = G.jokers.cards[i + 1]
debuff_joker.ability.two_faced_chosen = true
end
end
end
if debuff_joker ~= nil and not (debuff_joker.debuff and debuff_joker.debuffed_by_blind) then -- Debuff chosen Joker if not aready debuffed
if debuff_joker.ability.two_faced_chosen then
debuff_joker:set_debuff(true)
end
end
local ret = SMODS.blueprint_effect(card, other_joker, context) -- Copy
if ret then
ret.colour = G.C.BLACK
end
return ret
end
end
can you copy the code her
oh
i just knew
lmao
unrelated but you can just have \ before each ` to show it lol
```
like this
```
i realised i forgot to replace the 'card' by blind in the ability but since apparently blinds doesn't have abbilities i suppose it doesn't work
yeah
Really just trying to do like the Ox but for a specific set of hands, and also with losing money, not a set one
its also on here btw :3 nudge nudge
nice
This is more than mayhem
we appear to have discovered yet another Number to make Go Up
What have you done lmao
idk what makes events here tho
maybe because it's constantly checking which jokers have been chosen?
that doesnt add an event
on my way to make a joker whose sole purpose is to recursively spawn 1,000,000 events which do nothing
đ€·ââïž
You might be onto something
set_debuff maybe?
sooo how should i make the boss blind work then ?
-# bumping it
i dont see it
oh
do what i told you?
Oh i already had the crash log
Yes
Alright thanks i'll try that out !
how do I change the full deck skin? (replacing the standart skin)
i'm just gonna start commenting stuff out to see what makes a difference
You mean the king / queen / jack or the back of the deck
i think set_debuff is contantly calling this because youre constantly debuffing and undebuffing a card
commenting out debuff_joker:set_debuff(true) stops it from lagging
the full front so like instead of hearts there is my design
always something
either way you never set debuff_joker
Youâll need to make a deckskin
Like this https://github.com/Steamodded/examples/tree/master/Mods/DeckSkinTemplate
use SMODS.DeckSkin
yeah i set it here?
yeah after that loop
oh i see so it never ends
no it does end
thanks :D
your logic for checking which cards are debuffed or not is wrong
so how would i fix that logic
idk that's 20 dollars
âčïž
i would start from the beginning on that one but keep in mind local variables don't stay between calculate calls
chat i broke the display code
i think i know what broke but also damn
this shit fragile
Can i see
ill give you 40 to finish my mod N AI
your mod is going to be finished
i will destroy it
finally, peace
anyway i should actually work instead of balatroing
i think it's just because of his localization
do not work, watch anime
i wish
Okay, I'm gonna be honest. This is not my code but I just can't figure out why I get this error, please help TwT
this is at the bottom of his description
it's certainly trying to do things
i'm not allowed to show more
their colors seem to work properly
the light on the right will go green if the right joker can be blueprinted
but i'm pretty sure it is supposed to have text in it
judging from the effect thing this is joyousspring code
Erm... Yes xD
-# I'm giving credits
Would anyone have a clue as to why my own mod isn't showing up in game despite being in the mod folder?
do you have a G.C.CSTORM.EFFECT
Do you have a metadata file
G.C.JOY.EFFECT is the color for effect monsters in my mod
Oh... Oops
That wouldn't happen to be the main.json file I see in other mods, would it?
That explains, thank you
The online resources just recursively say "check the discord"
Theres a page for how to set one up on the smods wiki
the loc vars code alone would be okay to show but it's too big to fit in a message which sucks
have you seen this https://github.com/nh6574/VanillaRemade/wiki#4-basic-mod
I have
Now that I changed it, it works so yeah (I'm stupid once again xD)
where does it send you to the discord
The link above it (and pretty much every page in the "wiki")
message.txt
something is wrong with it and it's not displaying any words
link above what
click on the specific link N just sent you, it directs you to a specific part of the wiki
Oh that's convenient, I didn't find wherever that was tucked away in Vanilla Remade
It's hard to actually improve the ""wiki"" if we're not told what the problems are
it's on (drumroll please) the wiki in VRemade
which is linked both in the "wiki" tab along the top bar and in the README.md on the front of the main page of the repo
It'd be nice if this (https://github.com/Steamodded/smods/wiki/Your-First-Mod) page had a link to that guide because it doesn't really show up in search results
Like, directly at the top
i dont really want smods to endorse my guide tbh
-# bump
idk if config.center.name is a thing
or a default thing at least i know some people add name
probably not a default thing and that's annoying
why, you shouldnt use that anyway because its not localized
is it G.P_CENTERS.e_holo or G.P_CENTERS.e_holographic 
holo
localize{ type = "name_text", set = "Joker", key = key} is what you want
links to gifs specifically are blocked because some people think i'm just gonna post gifs from my computer directly like I have them all saved
graagh i hate this place
calculate = function(self, card, context)
if not context.check_enhancement then
local other_joker = nil
local debuff_joker = nil
for i = 1, #G.jokers.cards do -- Mark Joker to copy and debuff, choose debuffed Joker
if G.jokers.cards[i] == card then
if G.jokers.cards[i - 1] ~= nil then -- Ensure copy Joker exists
other_joker = G.jokers.cards[i - 1]
end
if G.jokers.cards[i + 1] ~= nil then -- Ensure debuff Joker exists
debuff_joker = G.jokers.cards[i + 1]
debuff_joker.ability.two_faced_chosen = true
end
end
end
if debuff_joker ~= nil and not (debuff_joker.debuff and debuff_joker.debuffed_by_blind) then -- Debuff chosen Joker if not aready debuffed
if debuff_joker.ability.two_faced_chosen then
debuff_joker:set_debuff(true)
end
end
for i = 1, #G.jokers.cards do -- Undebuff previously chosen Jokers which aren't currently chosen
if G.jokers.cards[i].ability.two_faced_chosen and G.jokers.cards[i] ~= debuff_joker then
if not G.jokers.cards[i].debuffed_by_blind then
G.jokers.cards[i].ability.two_faced_chosen = false
G.jokers.cards[i]:set_debuff(false)
end
end
end
local ret = SMODS.blueprint_effect(card, other_joker, context) -- Copy
if ret then
ret.colour = G.C.BLACK
end
return ret
end
end
update on my part: it works now and doesn't lag the game out but it only updates the debuff when another event triggers (like selecting a card)
this is honestly a tradeoff i'm willing to take though i'd ideally want it to always happen
yeah that makes sense because context doesnt run every frame
replacing this with that makes vscode shout at me
may i see
i don't know how this code works
wait how am I supposed to give it the name
also key should be right_joker.config.center_key
and you dont need string.sub for this
nothing is showing up still
i don't understand any of this
why do they even get the joker names
if they're never used
why does the node have text when the text is going to be Compatible or Incompatible anyway
i didn't change any part of this code and it's just not working for me when it apparently worked for the other guy but what if it was never designed to display text
but why would they have it use internal text values if they'd never be used
idk it's nxkoo
they do this shit for money
their code surely isn't broken
i just don't get what it's doing differently for me
these should be T instead of R
all of them?
How do I make it, so that a Joker doesn't get shown in 'Your Collection' and 'Additions'?
hidden = true
the two that have text in them
right
how do i check if a card has a specific seal?
if card:get_seal() == "modprefix_sealkey" then
thanks yous
Still there
do it again
no_collection = true
oh
i have got to do that to jevil
anyway it works now but they truncated the damn
where did my message go
what
i attached a cool picture to it
oh right
bruh
Works, thank you
he keeps showing up
while i am testing
I can't say anything here anymore
the text appear now but the string_sub confuses me
i know what it does but why do it like that
even ste looks awful
it works fine on longer names anyway
thank you Suspiciously Anvil-Shaped Green Joker
man where did my cartoon anvil go
now i gotta do another thing
is there a way I can find which achievements the player has unlocked
I still dont know what Im doing wrong.. I did it like the site (https://www.love2d.org/wiki/love.graphics.draw) said and the game still crashes ( I first tried it with a Video because I want to play a video but I thought I try it with a Pic first but both dont work)
Freddy = love.graphics.newImage("frame20.png")
end
function love.draw()
love.graphics.draw(Freddy, 0, 0)
end```
How would I check what type of card the player bought in the shop?
card.ability.set == "Joker" / "Tarot" / "Planet" / "Spectral"
if card.ability.set is nil, I think that means it's a playing card(?)
And what context would be good? Because there is none for during the shop iirc
Would I use card.ability.set == "Joker" / "Tarot" / "Planet" / "Spectral" in context.card or in context.buying_card?
if context.buying_card then
if context.card.ability.set == "Joker" then
---do stuff
end
end
Okay, thank you :3
Anyone have an idea why my jokers are low res? Each card is 71x95 and defined as such in the atlas
enable pixel art smoothing and the game will use the 2x versions of your sprites
(you did make 2x upscaled versions right)
yeah! and it is on...
That's weird, maybe something is fucked up with the 2x version then? 
bump
A lot of editing software just always apply aa for no reason
you need to make sure the interpolation is none when you do the upscaling
or just use aseprite/libresprite
Yeah I'm just not gonna worry about it rn, just wanted to make sure I was doing it right
please don't override love functions
You might be able to tell but these are temp assets :P
I want to basically make so 7s count as wild card, is it possible?
SMODS.Joker {
key = "toy_bonnie",
blueprint_compat = true,
rarity = 2,
cost = 5,
atlas = 'Joker',
pos = { x = 3, y = 5 },
}
local Wild_7 = playing_card:get_id() == 7
function Card:is_suit(suit, bypass_debuff, flush_calc)
local ret = Wild_7(self, id, bypass_debuff, flush_calc)
if ret and next(SMODS.find_card("j_fnaf_toy_bonnie")) then
return SMODS.smeared_check(self, suit)
end
return ret
end
I remembered that a mod did something kinda similar
you're kinda close, but you don't have the hook quite right
https://github.com/nh6574/VanillaRemade/wiki#whats-a-hook
i have a seal which is applied to jokers and i would like its xmult effect to happen after the joker's effect
usually i'd do this with context.post_joker but i believe that's only for editions
calculate = function(self, card, context)
if context.joker_main then
local sealed_jokers = 0
for i = 1, #G.jokers.cards do
if G.jokers.cards[i]:get_seal() ~= nil then
sealed_jokers = sealed_jokers + 1
end
end
return { xmult = (card.ability.seal.extra.Xmult_gain * sealed_jokers) + card.ability.seal.extra.Xmult_base }
end
end
btw this gains xmult for each joker with a seal
currently with context.joker_main the xmult happens before the joker's score, which means it multiplies before adding base mult
does context.post_joker not work?
It should work, I donât recall is being locked to editions
Where can I find all the default messages for message = localize('k_upgrade_ex')?
the game's localization files in en-us.lua
balatro's localization file, yeah
yeah i just tried again and it did not work
Might be worthwhile using context.other_joker? Like baseball card, but for joker seals
Can you show the code?
well i don't want it to work like baseball card i'd like it to use the other jokers to influence it's xmult gain but not its scoring
SMODS.Seal{
key = 'green_seal',
atlas = 'JokerSeals',
pos = { x = 2, y = 0 },
loc_txt = {
name = 'Green Joker Seal', --name of card
label = 'Green Joker Seal',
text = { --text of card
'{X:mult,C:white}X#1#{} Mult for each',
'{C:attention}Joker Seal',
'{C:inactive}(Currently{} {X:mult,C:white}X#2#{}{C:inactive})'
}
},
config = { extra = { Xmult_gain = 0.15, Xmult_base = 1 } },
badge_colour = G.C.GREEN,
calculate = function(self, card, context)
if context.post_joker then
local sealed_jokers = 0
for i = 1, #G.jokers.cards do
if G.jokers.cards[i]:get_seal() ~= nil then
sealed_jokers = sealed_jokers + 1
end
end
return { xmult = (card.ability.seal.extra.Xmult_gain * sealed_jokers) + card.ability.seal.extra.Xmult_base }
end
end,
loc_vars = function(self, info_queue, card)
local sealed_jokers = 0
local Xmult_current = 0
if G.jokers ~= nil then
for i = 1, #G.jokers.cards do
if G.jokers.cards[i]:get_seal() ~= nil then
sealed_jokers = sealed_jokers + 1
end
end
else
sealed_jokers = 1
end
Xmult_current = (card.ability.seal.extra.Xmult_gain * sealed_jokers) + card.ability.seal.extra.Xmult_base
return { vars = { self.config.extra.Xmult_gain, Xmult_current } }
end
}
this is the full code
Oh it is unique
Huh
Then thereâs no supported way to do what youâre trying to do
context.post_joker is defined in the base game right
No
You could do a lovely patch somewhere around local eval = eval_card(_card, {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, edition = true, post_joker = true}) in functions/state_events.lua
yeah i was thinking to do that
Could also put in a pull request to smods and get the context updated to be more universal
i've just never had to code a new context so i'm reading over the smods code to figure out how
or edited an existing one
You can check how Extra Credit did it with initial_scoring_step before it was implemented
You can also use post trigger I guess
also tried post_trigger and it didn't work
I'm not sure I've seen other context additions
isn't post trigger a feature you have to enable?
yeah i have
i have extra credit so i'll pop the hood and look at what they did for this
Well, i think they updated to use smods 711a, but they might still be using their code for it.
i have an old extra cred version thankfully
It was from Clown Car, i think was the name
+44(?) mult, -3 dollars before cards score
# New context to modify mult/chips before hands are played - used for Clown Car
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
match_indent = true
pattern = '''if modded then update_hand_text({sound = 'chips2', modded = modded}, {chips = hand_chips, mult = mult}) end'''
position = 'after'
payload = '''
for i=1, #G.jokers.cards do
eval_card(G.jokers.cards[i], {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, before_but_not_as_much = true})
end
I love context.before_but_not_as_much
i mean, this is how smods does post joker, this is the only reference in state events ```lua
-- calculate edition multipliers
local eval = eval_card(_card, {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, edition = true, post_joker = true})
if eval.edition then effects[#effects+1] = eval end
yeah i'm looking at that now
I mean if youâre trying to patch that directly just remove the edition clause
wouldn't that mess with other things?
so change if eval.edition then effects[#effects+1] = eval end to effects[#effects+1] = eval or somethin
or just remove that line entirely
i'll try it couldn't hurt
yea you do need to add something to the effects table
does anyone know why my denominator is getting reduced to 1?
Okay, here's the second image as dark
by the gods are you using np++ lmao?
Also, can I see the localization?
I have a feeling you might have two #1#s
awesome it works
[[patches]] # CHAK
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''
if eval.edition then effects[#effects+1] = eval end'''
match_indent = true
position = "at"
payload = '''
if next(eval) then effects[#effects+1] = eval end'''
nice!
yes i am
and also yeah that's the issue, i originally wanted to keep the probabilities the same no matter what so i made it 1 in #1# for some reason i might be stupid
now i gotta see if this broke anything else đ
yeah, that's my worry, lol
well polychrome works and i'm pretty sure that's the only thing base game which uses it so we're gucci
How do I show a variable in a message? Because message = card.ability.extra.tarotsBought doesn't seem to work
message = tostring(card.ability.extra.tarotsBought)
although really you should be localizing it :3c
a number?
Yeah, just remembered that
what is it in your language
má»t
bepis
how do you say that
bepis is number 1
aw
uhhhhh
i have multiple #1s
idk how to even describe it lmao
i have bepis and n and eremel and smt and toma and meth and
cant believe winter is not number 1
i see...
Smooth as hell lmao
im flattered
are we entering the metatable meta
because N has questioned me im buying him 2 games in 9 days
nooooo
wait u learnt metatables already??
no this is from smods
you shouldve just said yes and blew bepis' mind
i kinda understand what they do but idk where i would use them
this is the card limit thingy for editions, stickers pr right
yeah
I think in the right situations they're insane tech
and using metatables make u look really cool too imo
very closely followed behind by lua patterns :p
anyways i think i kinda understand now, it uh redefines the behaviours of a table basically if im understanding it correctly
so i can have t1 + t2 doing different things
oh hey
yeah it's like operator overloading and setters but written in a weird way
local card_id = playing_card:get_id() == 7
function Card:is_suit(suit, bypass_debuff, flush_calc)
local ret = card_id(self, bypass_debuff, flush_calc)
if ret and next(SMODS.find_card("j_fnaf_toy_bonnie")) then
return any_suit == true
end
return ret
end```
still no luck
thats not how you hook lol
yea you still aren't hooking properly
local is_suit_ref = Card.is_suit
function Card.is_suit(...)
local ret = is_suit_ref(...)
if next(SMODS.find_card("j_fnaf_toy_bonnie")) then
return true
end
return ret
end
OH so i was doing the opposite
the (...) is where the card id goes, isn't?
7s work like wild cards
ic
local is_suit_ref = Card.is_suit
function Card:is_suit(...)
local ret = is_suit_ref(self,...)
if self:get_id() == 7 and next(SMODS.find_card("j_fnaf_toy_bonnie")) then
return true
end
return ret
end
Why does {C:attention, s:0.8s} only change the size and not the color?
The s was a typo OwO
I'm making a deck that increases shop prices. However whenever I reroll in the shop and go to the menu then load back into the run said cards (whether it is jokers, tarots or planets) will go back to their original values. Is there a way to make them persist?
How are you manipulating their price?
I'm using card_cost and reapplying it exclusively to jokers, tarots and planets whenever a reroll is triggered because otherwise the rerolled cards would have their normal price
I imagine the second part is also why they are the only ones having their price set back to normal
Just hook set_cost, if you wanna limit it to specific card types
Before playing first hand, each non-face card gives dollars equals to half its rank. Why its not working
if context.disard and not context.blueprint then
if G.GAME.current_round.hands_played == 0 and G.GAME.current_round.discards_used == 0 then
if not context.other_card:is_face() then
return {
dollars = context.other_card:get_id() / 2,
card = context.other_card
}
end
end
end
that makes a lot more sense actually, and it seems to be working so I just have to patch out a few more things. Thank you :)
would this work to play a video?
what the hell is SMODS.Hook
I was just trying to understand hooking with a video playing then
hooking is not an smods feature, it's a lua feature
https://github.com/nh6574/VanillaRemade/wiki#whats-a-hook
I read that and I havent really understood it muchđ„Č
what part is troubling you?
Just the hooking itself so idrk what its exactly doing everybody just said I need the love video feature in a hook
its just kinda hard to understand when I started modding like 3-4 days ago
I think If I had an example code that I can test in game I would maybe read out of it what it does or how it works
I would try to copy another mod that has done it instead, not to be rude but I don't think you have the knowledge to attempt it yourself yet
I think Yahimod and Tangents do it
this is the example code
if I copy that code and try it is it working in game?
yes
How do I check for a certain tarot key when in context.using_consumeable?
okay I will try my best to understand it and thank u
i would recommend adding a print(G.GAME.vremade_joker_added_counter) after the addition to be able to see it
context.consumeable.config.center_key
Thanks
Yooo, is there a way for me to give myself a card at the start of the game? maybe with a deck or something? Ive made a custom joker but I actually need to test it
you can spawn jokers with debug plus
dont use a set in the title screen
or at least not the joker set
also cryptid does this hook wrong
it should be like that
I dont need that in a calculate = right? so just in the file
correct
so if i want to do a randomised joker i have to make like a string array or something
Speaking of Hooks, one if them that I was using broke everything
it looks like the only two kinds of jokers will need to have some sort of soul pos scaling too
yeah or patch this
newcard.T.w = newcard.T.w * 1.1 * 1.2
newcard.T.h = newcard.T.h * 1.1 * 1.2
is the T or the w/h to grab the soul pos
and the suffix will be .T.w or .w?
T is the transform, w is width
Ive downloaded debug plus, but I cannot find a command to give myself a joker, do I just have to refresh the shop until I get one?
3 on the collection
will i have to check if it's hologram or the legendaries before making the floating sprite transform to avoid a crash?
press tab to see the shortcuts
Oh my god
Somebody make the hologram sprite bounce like the DVD logo
right now
dunno, you probably need to check if it has a floating_sprite
is there some way to do that for lua like check if it has that kind of children something like floating_sprite isn't nil?
if newcard.children.floating_sprite then
thanks đ ill add that when i get back from therapy since it's in about fifteen minutes
i know you can't see the whole line of code, but why is this displaying red not active, instead of green active, whenever i'm able to use it?
i'm certain that the function is returning the correct value
is the main_end not being kept up-to-date?
main_end is remade every time you hover it
<@&1133519078540185692>
i'm so confused đ
W catan
what does running eval is_boss_active() give you
true
you can see that the card may be used, so it must be returning the correct value there too
oh
how to do something whenever a joker gets destroyed
how do i check if the triggered context returned chips, mult, or xmult via post_trigger
other_ret should be a copy of the return table
required code context
do i call it with like context.other_ret?
Yeah im pretty sure
@crystal perch
oh you need to call other_context in tandem with other_ret
no i do it there because i check for it to affect specific suits
i'll just send the code
local return_whitelist = {
chips = true,
mult = true,
xmult = true
}
SMODS.Joker{ -- +Mult per other Joker triggered
key = 'copy_cat', --joker key
loc_txt = { -- local text
name = 'Copy Cat',
text = {
'{C:mult}+4{} Mult per other {C:attention}Joker{}',
'ability scored'
}
},
atlas = 'Jokers', --atlas' key
pos = {x = 1, y = 1},
rarity = 1, --rarity: 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Legendary
--soul_pos = { x = 0, y = 0 },
cost = 5, --cost
unlocked = true, --where it is unlocked or not: if true,
discovered = true, --whether or not it starts discovered
blueprint_compat = true, --can it be blueprinted/brainstormed/other
eternal_compat = true, --can it be eternal
perishable_compat = true, --can it be perishable
config = {
extra = {
mult = 4 --configurable value
}
},
calculate = function(self, card, context)
if context.post_trigger and not context.blueprint then
for i, _ in pairs(return_whitelist) do
if context.other_ret[i] then
return {
card = card,
mult_mod = card.ability.extra.mult,
message = '+' .. card.ability.extra.mult .. ' Mult',
colour = G.C.MULT
}
end
end
end
end
}
this is the effect
similar to mine but i just want it to be if another joker scores at all it gives +4 mult
i'll try that out thank you
anyone know how i can get profile completion percentages
like how much you've discovered/got sticker on/unlocked
i figured it out
Probably context.before?
context.initial_scoring_step if you want it to count in score, context.before otherwise
(context.before comes before the score is re-set to the base poker hand's value, so that e.g. space joker can level up the hand and have it count for scoring in that same hand)
ty
is there a context.before that comes after the score is re-set to base hand value
yes, context.initial_scoring_step
Hey is there a reason why this isnt working?
remove_from_deck = function(self, card, from_debuff)
-- Tests if context.joker_main == true.
-- joker_main is a SMODS specific thing, and is where the effects of jokers that just give +stuff in the joker area area triggered, like Joker giving +Mult, Cavendish giving XMult, and Bull giving +Chips.
print("joker removed from deck")
if from_debuff == true then
return
end
print("not debuffed")
return {
mult_mod = card.ability.extra.mult,
message = localize { type = 'variable', key = 'a_mult', vars = { card.ability.extra.mult } }
}
end
"joker removed from deck" and "not debuffed" print, but no mult is added or message appears, ive tried without using return also.
this is in a joker
(also you might be able to tell, but I dont have any lua experience)
return values are only for calculate functions
Ive tried without using return, but it doesnt do anything either
you can't do that in remove_from_deck
remove from deck happens when the card is removed
is this an effect you want to have happen when the card is removed?
have you tried using SMODS.calculate_effect instead of a return
Basically, my card stores mult each round, and when it is sold, it is supposed to add the mult to the scoring, ive tried using context.selling_card but it didnt work either
no?
how do I use that?
SMODS.calculate_effect({message struct}, card)
Ah alright, do you think there is a workaround or is this card just fundamentally not going to work>
in a couple of days, there'd be a workaround
it wouldn't be clean, but it would function as you like
how do you mean?
there are new features coming to smods that would make this possible in a jank way
How can i make this not trigger the repetition warning? if context.individual and context.cardarea == G.hand and not context.end_of_round then if context.other_card.edition ~= nil then local text,disp_text,poker_hands,scoring_hand= G.FUNCS.get_poker_hand_info(G.play.cards) SMODS.score_card(context.other_card, {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, post_joker = true, edition = true, pre_joker = true}) end end
is there a way I can see if the current profile used the unlock all button
wait i think i found it
is it profile.progress.all_unlocked or profile.all_unlocked
it's the second one
How would I get the cards scored in the winning hand of a blind?
context.after, context.full_hand or context.scoring_hand and G.GAME.chips > G.GAME.blind.chips?
Could I animate the card turning into another card before it returns to deck?
I have this Joker that applies enhancements to cards before they're drawn off, so yes.
Oh sweet! Thanks Ali!
going to probably have to like scale it
but it seems to work
okay i don't think it is working or something
i think you need to mess with the shader then
If Iâll be honest that seems to be too much for me so Iâll just not include the legendaries and holograph sorry balalas
what are you trying to do
Right now the soul pos cards like hologram, soul, and the legendaries arenât scaled correctly for the main menu
Tried scaling by the floating sprite but it doesnât seem to work
could you not use SMODS.drawstep to redraw their soul_pos sprites manually at the right scale and offset
if it can animate a soul_pos surely it can do that
What context would be good to use for destroying a consumable after the hand scored? And how do I prevent all consumables of the same type to be destroyed when I want to destroy only the one that has been used?
What's the specific effect you wanna implement?
context.after
what do i access to get the current ante
also does context.end_of_round evaluate before or after the ante increase
When I use context.after, then they get destroyed too early
how are you destroying them?
I'm trying to make it so that my consumable stays in the slot when used, then give the chips when the hand is scored and then destroy itself
check theautumncircus's fire potion code
With card.getting_sliced = true card:start_dissolve({ HEX("f252a8") }, nil, 1.6)
Or confections in Kino, which function almost exactly like that
don't do that
try SMODS.destroy_cards(card)
Has anyone done a blueprint enhancement yet?
What's the difference?
-# The juice up of swap = true in return also occurs before the card scoring animations kick in, lmao.
That literally fixed every problem I mentioned before, thank you :D
huh
return {
swap = true,
message = localize('toga_pagefileuse'),
colour = G.C.PURPLE,
sound = not silent and togabalatro.config.SFXWhenTriggered and "toga_mmeclap",
pitch = not silent and togabalatro.config.SFXWhenTriggered and togabalatro.randompitch(),
message_card = context.other_card
}
Or... like usual, I may be missin' something.
đ
j_rickie_mirror = {
name = 'Mirror Joker',
text = {
"Swaps the {C:chips}chips{} and",
"{C:red}mult{} of your hand."
}
},
},```
```SMODS.Joker {
key = 'mirror',
rarity = 3,
atlas = 'mirrored_joker',
pos = { x = 0, y = 0 },
cost = 7,```
all of a sudden the localized text for my joker quit loading
Fixed!!!
idk this is new terrority
@stiff locust something like this?
I don't get how the code exactly works but yeah something like that
is there a way to like a key for the floating sprite?
Okay, how do I change the background/text color of my badge (on the card info) and button (in the collection) of my consumable type?
https://github.com/Steamodded/smods/wiki/Mod-Metadata for mod badge
But I mean on my consumable type, not my mod. Just like I said
the consumabletype documentation is buried in the SMODS.ObjectType page
https://github.com/Steamodded/smods/wiki/SMODS.ObjectType
https://github.com/nh6574/VanillaRemade/wiki#how-do-i-create-a-poolset maybe look at this
this one
this is probably nh has some knowledge in which i can wait for
i dont
thats okay
It says primary_colour and secondary_colour but they don't change the color...
is there a way to have the joker i added to be behind the ace
secondary_colour is the only one that actually does anything significant, and it's the badge background color
primary_colour is assigned to some G.C color definition but i don't think it's used anywhere else? secondary_colour gets an entry in G.C too and everywhere else just uses that one
if you're on the latest commit of smods, there's also a text_colour parameter that i PR'd :3
maybe have the ace actually be a random rank and suit too, maybe...
Why is it called secondary, when it does the primary thing TwT
dunno lmao
i tried to address that by outright replacing primary_colour with text_colour in my initial PR (and secondary_colour got moved to bg_colour), but for very understandable backwards compatibility reasons it doesn't do that anymore
Anyways, it works now. Thank you so much >W<
what context do i check if i want to do something when another joker is destroyed? 
do i just do context.remove_playing_cards with cardarea == G.jokers?
i figured what i could do is remove the ace and spawn in another card and have the first one a playing card
there's emplace but not sure if there's one to remove a card from G.title_top
does anyone know why my Balatro is crashing when i play cards and try to score i keep getting this error

