#💻・modding-dev
1 messages · Page 296 of 1
save game everytime anything happens
Every frame
good idea, let medo that
Save the game while saving the game
Save game state in file instead of RAM
wouldnt it be funny if someone made Mult!
Putting save_run() within hooked draw_card ain't working either.
factorial mults
what could possibly go wrong
-# why did my fan already start running wild, i didnt even boot up balatro
They’re your biggest fan
it's scared
would you happen to have an example of this in vscode?
Thats a bummer
programming
huh
the game still runs with save_run being run everyframe
somewhat stable too, i will add
the inevitable memory leak
💀 Just trying to make the specific enhanced cards always get drawn after the initial draw and stay between exits and re-entering of a run.
Does anyone have a cheatsheet for what each colour listed in globals.lua is used for? I'm changing some of them but I can't notice anything different 😭
whats da {X:mult} equivalent of this
i tried exiting while using a consumable, guess its soft-locked now
Nah, you just have to defeat the hex card now
The Hex
The Hex
Polychrome cards are
debuffed
that actually sounds like a good boss blind idea
nvm, i used . instead of , so thats why it was grey.
that is just an indirect nerf to the wheel
why would u nerf the wheel...?
Everything is a indirect nerf to the wheel
Even the wheel
actually thats true
That's why I have a joker to give 5 bucks for each failed wheel
i love you for that dilly
:D
how do i change how a soul sprite moves? i imagine its something to do with draw steps but i do not understand draw steps at all
im confused
why does polychrome account for negative's weight too
but not foil or holo
Because it does
Although they line looks different to how I remember writing it originally
how do you get the level of played hand as a variable
G.GAME.hands[context.scoring_name].level ?
Hooking G.FUNCS.draw_from_deck_to_hand does work for the cards drawn and what not... but I end up with ghost cards that become actual cards when the run is saved and re-entered...
i got this really horrible idea of just making it trigger every sold joker if it is cryptid rigged
now figuring out how exactly to do that
i could probably use retrigger_joker_check to do it but im not sure
how would i change how a specific card's soul sprite moves?
actually no probably not
SMODS.DrawStep
the joker currently rerolls what joker its gonna pick every time the joker could ever be calculated which is uh
yeah
i need to figure out if the joker could actually calculate something and get something out of it
Is it only for one joker?
mhmhm
is this the wrong syntax for changing emp to true? my game keeps crashing on use at this line...
draw = function(self, card, layer)
card.children.center:draw_shader('shadername', nil, nil, nil, card.children.center)
end
``` Try putting this in the joker.
Try this ```lua
draw = function(self, card, layer)
card.children.center:draw_shader('negative_shine',nil, card.ARGS.send_to_shader)
end
i learn something new everyday
Hey guys, do any of ya'll know how to set the discards to 0? I tried using the basic config of discards = -3, but on higher difficulties, that leaves the deck with -1 discard, which is not intended
Try ease_discard(-G.GAME.current_round.discards_left)
you can't see it, but it worked :D thanks!!
Is there somewhere I can see how each joker is coded outside of card.lua? Getting lost with all the layers lol ^^'
where do I put it??
Sorry if I'm bothering, I'm pretty new in this whole modding thingy
Where did you put discards = -3?
inside of config
Is this a deck?
config = {
discards = -3,
hands = 1 -- Gain 1 extra hand
},
yep
Put it in apply
dead ass kill me
why is applying styling through variables not somewhat easy and intuitive
it's a little bit funky, but it works anyway, so thanks!
how do i make it so it shows how much was added rather than what the actual base is
or should i just leave it be since its not that big of a deal
this is the result without ''
not the problem actually, it just wont work :p
my bad ^^'
Try returning a key to a localization entry.
is there a better way to control the position of a card's soul sprite other than patching the soul sprite drawstep?
im gonna be fr i have NO idea how to do that
Do you have a localization file?
yeah
You would put each text you want it to say as a different entry in descriptions.
would that allow for styling font colours and the coloured highlight thingies?
Yes.
hi sorry to bother again :D
where would that even go in my localization file tho?
is there an easier way to apply a shader to a card's soul?
i tried card.children.floating_sprite:draw_shader('voucher', nil, card.ARGS.send_to_shader, nil, card.children.center, 2*scale_mod, 2*rotate_mod)
but it needs calculations for scale_mod and rotate_mod
In descriptions > joker
wait would that still allow for having a cycling desription, apologies i havent played around with localization much ...
Yes, you would just return key (the name of the entry) in loc_vars
hey, it's me again. I tried to use apply = function() G.E_MANAGER:add_event(Event({ func = function() -- Immediately set discards to 0 ease_discard(-G.GAME.current_round.discards_left) return true end }))
But it sets itself back to 3 when the round starts, am I doing something wrong?
yes you also need to set G.GAME.round_resets.discards to 0
I should probably put my names and descriptions in localization to save future me some hairs
so smth like
return {
descriptions = {
joker = {key = 'set.prefix.key',
text1 = {desc1},
text2 = {desc2} }
}}
? or am i way off...
it's one text per key, you need more than one key if you want to change between them
hm so for your joker 'token' you would just have another entry called something like j_joy_token2?
yes
ah and for calling it in your joker file would it just be --
loc_txt = {name = 'name', text = j_prefix_key ?
no, you wouldnt use loc_txt
the default text would the the one under your joker key and for the alternative texts you need to return key in loc_vars
(bump)
so, I'm trying this, and it's not really working rn, I tried putting it both in and out of the apply code, but it isn't happening, what proceeds?
Where are you putting this?
in draw
no idea, thats how i do it
(bumping cus i'm still confused by code lol)
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.round_resets.discards = 0
ease_discard(-G.GAME.current_round.discards_left)
return true
end
}))
}```
I'm doing it something like this, I also tried setting it out of the apply, but it didn't work either
I think most of them are under calculate_joker but you can mostly ctrl+f search for their names
I recommend also checking out the example mods if you havent
gotcha, thank you. I'll see if i can figure it all out ^^'
i think that should work but ive never made a deck sorry
so youd call this in your loc_vars? would i have to replace #1# with card.ability.extra.Xmult for example
ohhh, don't worry, neither have I lol
You still have to define name again.
also you can cheat a bit and use #2# for chips and return {xmult, chips} in loc_vars
so like this? is this code alr..
yes
keep in mind that if you want the rest of the text you need to copy it to each description
I think there’s a PR to the wiki
so then my loc_vars would look like
if phase == 'Xmult' then
return {j_jjok_inoxmult}
(plus the rest of the description), but if this is correct, where would i return my Xmult value to be called in #1#?
No, you would put key = 'j_jjok_inoxmult'
You can use V
Instead of C
But you need to return vars.colours
Which you access via an integer index
this is appearing under the soul, is there a way of making it appear on top? or is there an easier way?
im so confused 😭 heres the code on my joker and from the loc file, what i dont understand is where to call my loc file and where to return my vars for #1# for example
It needs to be a string.
If I want to have xmult when a playing card is scored how would I do that again
You would return {vars = {mult and chips and things}} along side the key
so with this and vars = {blah blah values} would i even need a loc_txt in my jokers main code?
you don't need loc_txt if you already have a localization set for your joker
You don't use loc_txt when you have localization and you need to put key outside of vars
ah okay ty that was what i was abt to ask
geniunely how would i go doing this? only thing i could think of is overriding juice_up and using calculate_context over returning a joker's calculate_joker
ofc that's assuming that the joker is juiced up in the calculation
can you reexplain what you want to do?
my joker just has no name or desc now -_-, can you spot any error in my code?
this must be like wheres waldo for you guys huh
key should be a string, not a table.
joker is a joker that uses calculate functions from random jokers in invisible card area
okay i changed that, but in theory could a loc file use tables to minimize the amount of keys?
I love how my first ever joker was literally just turn every card into glass but slightly worse to some random ass bullshit in the span of 2 other jokers
i feel like it would be easier to patch message_card = joker somewhere in the calculation pipeline
currently as it acts right now the joker will always reroll what joker from that card area it would mimic every time a calculation could be called which is fine but
the main idea is to not do that and only reroll when the card actually triggers by itself
🤔
hmm
(bump)
You don’t need this
Topmost layer is drawn last
Change the order you draw layers
Idk what you’re doing or what you want to recommend a more specific solution
ah, i'm trying to give my card's soul the voucher shader
What is the code
_ _
I saw that I’m asking for more
not sure that will help
no
How to read a playing card's edition?
Is there something like SMODS.has_enhancement but for editions?
I think you’re putting the draw function in the wrong place
where should i put it?
Put it inside soul_pos
card.edition
there's also get_edition i think but it gets you card.edition
Is it v.edition == 'e_foil' or v.edition == "Foil"?
getting this error now:
not sure why it should go in soul_pos, it was drawing stuff when it was where it was
how do yall draw text
just, not correctly
Pray for a miracle
Would v.edition be nil if the card is uneditioned?
yes
kecil yack
lclil pacv
are you all sending me a code from mars
mm but what font though? or do you mean i draw bigger text first
arial at 6px 
Can someone help me am making a joker and am getting this issue please anyone I will expand the issue
What thing r u using for the sprites
If its asperite i aint got a single clue how that works
from the looks of it it seems to be aseprite
Find a font online
Write your text
Trace use as reference
Iont think low res px by px font exists out ther so id rather just draw them pixel by pixel
I didn’t mention low res pixel fonts
And they do exist
But I wasn’t talking about them
low res pixel fonts exist and they are coming for you
sculk leaking
making a reskin mod, calling it bubblatro
It handles how the soul sprite should be drawn
right, but it caused an error that i wasn't getting earlier
Am making this joker but it's not working as it should be I want it to fix it I tired my best so how can I make the joker add up multiplier per how many red seal cards it has applied on like 4 red sealed card x 0.5 mult would give me told of 2mults that's how I want it to be like the steel joker
Show your code.
usage example
ahh i see
Here or on dms?
Here.
@daring fern
oooooooooh definitely getting closer!! will play around with this, thanks :D
When do you want your joker to give mult?
tracing is learning!!! RAHHHHHHHHHHHHH >:3
imagine not handdrawing your text
esp with text thats just using a font
me tracing over a printer png i found on the internet (i am a bad person)
imagine
Scoring hand is always greater than 0 and you should be checking for context.joker_main
this fucking booster sprite sucks ass
i really like it don't talk about my friend's art that way :(
Sorry what? Am still a beginner a bit @daring fern
huh?
i like your art and you should be proud tldr :3
im not proud at all this sucks 😭
lies and slander.
you wanna see something that sucks?
You don't need to check for context.scoring_hand and you should replace not context.individual with context.joker_main
i love how i traced over it so badly it's not even a printer anymore
my spritework is bad on purpose tho, its supposed to be cringe asf :3
i fucking love the grey text that flavoring is peak
angela really handdrew that and said "this will work" 🥀
no that's ayin clearly
i cant imagine ayin's handwriting looking like that honestly
I didn't that and now the seals are not being applied by the joker @daring fern
Its like my mod because my mod is a shitpost
You need to put the seals thing in a different if for context.before
mine is too!!
mine is literally called cleo's cringe circus, and my self insert joker is a 2010 scenecore clown girl, the whole point is for someone to have second hand embarrassment and find random shitposts in my mod LMAO
i REALLY need an artist 🗣️
i like that a lot :((((((((
PEOPLES ARE IS SO COOL WHY SAY BAD
actually, the text should be higher, hold on
It's context.joker_main
Lmao I just love making absurd unbalanced mods
Because its funny
And the number go up
the joys of seeing a number go up
Also why are you returning nil?
hi bepis
real
number do go up
im also cruel and i have number DONT go up jokers
The awful absurdity of 30 negative perkeos
bcos funny
I meant to write return{}
whatever (prints 2 balatrillion soul cards)
Only perkeo
hi aiko
redone some enhancements
Hi, I'm trying to make a custom joker mod and for some reason my balatro isn't reading my main .lua file? Please help! 😭
make sure you have show file extensions on. Those saved as .txt files
hi, weird bug with my shader code — i applied it to all of my legendaries, and when hovering over and rotating Ignaize, all of the others do the same
It should work I think.
YES NOW ITS WORKING ALL THANKS TO YOUUUU!, btw what was my mistake?
it's like, all of the souls have the same shine direction as Ignaize
Exactly
You weren't checking for a context so it triggered on everything.
Thanks again for helping me I am trying to fix this for about 7hours now
( @zealous glen sorry to bother again ^^ Ignaize controls the shines of all of the other legendaries )
(no idea why, hoping you know)
_ _
is there a way to use add_card() to spawn from a pool?
SMODS.add_card{
set = "whatever here"
}```
iirc
isnt set for spectral, tarot, joker, etc. not pools?
it works with ObjectType
ah
I don't see why it would
so it would be smth like
SMODS.add_card{set = 'poolname'}?
ye
okayy ty
np
I'm trying to create a joker with 6 possible random effects, but it's not working, does anyone know what am I doing wrong?
` apply = function()
SMODS.UTILS.HOOKS.set("calculate_hand_values", "RalseiBuff", function(orig, ...)
local res = orig(...)
local roll = pseudorandom(1, 6)
if roll == 1 then
G.GAME.current_hand.base_mult = G.GAME.current_hand.base_mult + 25
G.E_MANAGER:add_event(EventText({text = "+25 Mult", colour = G.C.MAGENTA, scale = 0.8}))
elseif roll == 2 then
G.GAME.current_hand.mult = G.GAME.current_hand.mult * 5
G.E_MANAGER:add_event(EventText({text = "x5 Mult", colour = G.C.MAGENTA, scale = 0.8}))
elseif roll == 3 then
G.GAME.current_hand.chip_bonus = (G.GAME.current_hand.chip_bonus or 0) + 50
G.E_MANAGER:add_event(EventText({text = "+50 Chips", colour = G.C.MAGENTA, scale = 0.8}))
elseif roll == 4 then
G.GAME.dollars = G.GAME.dollars + 5
G.E_MANAGER:add_event(EventText({text = "+$5", colour = G.C.MAGENTA, scale = 0.8}))
elseif roll == 5 then
G.E_MANAGER:add_event(EventText({text = "Nothing happened...", colour = G.C.RED, scale = 0.8}))
elseif roll == 6 then
G.E_MANAGER:add_event(EventText({text = "Nothing happened...", colour = G.C.RED, scale = 0.8}))
end
return res
end)
end`
hows these for packs (would replace joker packs)
zamn, good sprites
Joker's don't have the apply function.
is there anyway to make the gamble variable like a range? so i dont have to write == 1 .. .. .. ==35
thx
is there no switch in lua
local stuff = {
{odds = {1,2,3}, randmoney = pseudorandom('unluck',-10,-1)},
{odds = {4,5,6}, randmoney = pseudorandom('fine',1,10)},
{odds = {7,8}, randmoney = pseudorandom('good',11,20)},
{odds = {9}, randmoney = pseudorandom('great',30,50)},
{odds = {10}, randmoney = pseudorandom('awful',-50,-11)},
}
local gamble = pseudorandom('bank',1,10)
for _,v in ipairs(stuff) do
for _,odd in ipairs(v["odds"]) do
if odd == gamble then
return{
dollars = v[randmoney]
}
end
end
end
i would probably do smt like this :p
probably not the most efficient method, but you only need to edit stuff now
so, something like this?
That should work.
What is context.scoring_hand.mult?
how would I add like a little text box below a card? I want to have a little display (that's not JokerDisplay) where I can put a dynamically updating value, and I'd like it to move with the card if possible
take reference from jokerdisplay's code
well process was faster but damb
made the jumbo pack
annnd it did nothing
jesus
it didnt work 😭
I don't really know why, but this is what actually ended up working lol
just added local to gamble
soon this will be the 3rd tile done for my mario party deck
thats odd, it should work
but also
if u use this much numbers, my approach is probably not what you want
hol on
i want things to be out of 100 for those real rare chances
wait doesnt work
yeah
would it be better for a legendary to retrigger the 6th joker a couple of times (it also gives you a joker slot so you can always have a 6th joker) or to duplicate it
could i use a card's draw function to create text?
or maybe i could like just have a little text in the middle of the screen that updates
local stuff = {
{odds = {min = 1, max = 49}, randmoney = pseudorandom('unluck',-10,-1)},
{odds = {min = 50, max = 80}, randmoney = pseudorandom('fine',1,10)},
{odds = {min = 81, max = 98}, randmoney = pseudorandom('good',11,20)},
{odds = {min = 99, max = 99}, randmoney = pseudorandom('great',30,50)},
{odds = {min = 100, max = 100}, randmoney = pseudorandom('awful',-50,-11)},
}
local gamble = pseudorandom('bank',1,100)
for _,v in pairs(stuff) do
if gamble >= v["odds"]["min"] and gamble <= ["odds"]["max"] then
return{
dollars = v[randmoney]
}
end
end
i would probably do smt like this :p
scary red
hey there, can anyone help me out with an error that i'm running into?
go ahead and post it! 😄
ah crap, its v["odds"]["max"]
sorry im writing it on discord using phone rn
so i cant really keep track of what im doing
thats crazy like thats a talent
🥀
msg = string: "[SMODS BALATRO2 \"main.lua\"]:639: attempt to index field 'extra' (a number value)"
config = { extra = {card1_valid = false, card2_valid = false} },
...
calculate = function(self,card,context)
-- Checks played cards if they're the right ingredients
if context.individual then
if context.cardarea == G.play then
-- If the suit matches
if context.other_card:is_suit(G.GAME.current_round.recipe_card.suit) then
-- If any of the two ranks match
if context.other_card:get_id() == G.GAME.current_round.idol_card.rank1 then
card.ability.extra.card1_valid = true
elseif context.other_card:get_id() == G.GAME.current_round.idol_card.rank2 then
card.ability.extra.card2_valid = true
end
end
end
end
if context.cardarea == G.jokers and context.after == true then
-- If hand has valid recipe, generate a tag
if card.ability.extra.card1_valid == true and card.ability.extra.card2_valid == true then
G.E_MANAGER:add_event(Event({
func = (function()
add_tag(Tag('tag_handy'))
play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
return true
end)
}))
end
end
end,
typing anything on phone is a talent 😭
i got 180 wpm on pc so its not that bad 😭
for some reason extra is getting turned into a number value
yeah but i miss every key and completely rely on auto correct on phone
fair, i sometimes do the same when im lazy :p
you're not entering the extra of the card you think you're entering, haha
and theres also the "scroll your finger across the keyboard" technique
Okay so its still not giving the money
oh?
odd
Oh wait, never mind, I'm dyslexic I think
am i being stupid rn
I assume the crash happens at the if card.ability.extra.card1_valid == true line?
r u cooking
It does Print the number
yeah. Just from those snippets, I can't spot what would be wrong. It reads to me like you're setting up something wrong somewhere else, because I don't see how the extra of a joker should be changed
blank
yeah thats whats troubling me.. uh, what should i send to make it easier to figure out?
maybe i should make local variables isntead of using extra
i guess so
Could you send the entire joker?
Is there an in-game per-run table that tracks how many times the player uses a specific consumeable, or do I have to implement such feature (either with hooks or patches) myself?
there should be one
considering theres that uhh thingy that shows how many cards you used the most in vanilla balatro
this one
I'd avoid using context.individual for this, by the way. I don't see why this would overwrite the config with a number, but also, you can avoid this entire crash by not storing that information on the card.
wait, can u try printing v instead
i was using a for loop to check the entire hand before, but i thought maybe using context.individual would solve my issue and it'd make it easier to account for debuffed cards
im going to try using local variables instead of booleans in extra, ill report back
it's definitely preferred to iterate over the context.scoring_hand cards, rather than using context.individual for these purposes
that's what ill do, thank you for your help :)
mmm so v["odds"]["min"] should obviously be 1 in this case...
wait, doesn't that mean the if statement already worked
okay, it didnt crash when i played a hand
its just the return part that doesn't work now, i guess
I don't know if it'll solve this specific issue, though, because what you're dealing with isn't caused by any of the code in that snipped, I don't think.
can u just try ease_dollars(v["randmoney"]), and remove the return block?
the descriptions r so bad its good 😭
it did the thing but now no message lol
i wonder how that could be.. with the changes i made (making the validation flags locals instead of in extra), it doesnt crash anymore but it doesnt give me a tag
yeah, it's expected
god tier shiposting
-# im being lazy
hm
so its better than it just crashing lol
Some print debugging should be able to quickly tell you which checks aren't being passed
i mihgt need to make talisman a dependency
SMODS.calculate_effect({dollars = v["randmoney"]}, card) this time
just write some print("hello?") in you code and see which prints pop up 😛
is dollars = ... how something gives money, ice
ok
just to be sure
i think so, yeah
it is
im gonna crash out if it was dollar, money or smt the entire time 🥀
its weird how returning that doesn't work in that case
it has to work because the Held in hand part works perfectly
Can anyone help me with making malverk texture packs?
Not sure how to do it myself but I have some made cards
The Bank Space, whenplayed, you gamble, when held you get $6
all space cards all go away after used or general discard
chat did i cook
the coloring is too bright for balatro
yeah but im gonna retexture everything
and for the non existant letters in the font i eyeballed it
nicee
u have simplified all the random things that ill be doing
terribly sorry for pulling you through all that mess 💔
Nah in the end this is a MASSIVE help
the board generator is going to be using this, Other tile cards too
aw, but also, do keep in mind that oops all 6s currently doesn't affect the odds, since thats what i assumed from your old code
:p
Oh i dont want oops to affect odds
ic, it should be what you want then
#1358813451425677425 is where im keeping the sprites i make if anyone wants to see what else ive made
if its a chance thing thats one outcome, or like outcomes im fine overlapping, then i would do the oops probablitity stuff, but all of these are alternative outcomes, either a, b or c
and now i dont think its possible to do odds stuff for the board generator anyway
well wait hmm
okay well, tried putting a custum variable for the centers
that didnt work very well
anyone know how i can make randtile in the G.P_CENTERS.randtile become one of the random things on the odds?
what it did was just make a random card and that was it, the Enhancement of the Tile Cards werent added
im not even sure how to do this but ill ask here, how do i create a card from a specific pool? this code doesnt work and crashes my game on use
legendary joker bg wahoo
aw that looks pretty cool!
I just did over the actual legendary jokers textures and tone shifted them...
im redrawing almost everything from scratch for a visual mod
for some reason trying to go to github.com/Steamodded/smods/wiki/calculate_functions redirects back to github.com/Steamodded/smods/wiki/ . is anyone else having this problem? 
whoops
sorry for embed
fetched some code, this should work
local card = SMODS.create_card{set = "Planet", area = G.consumeables}
card:add_to_deck()
G.consumeables:emplace(card)
G.GAME.consumeable_buffer = 0```
I checked and this is correct try this one. https://github.com/Steamodded/Wiki/blob/master/Calculate Functions.md
Thank you 🙏
hey guys, does anybody know of some kind of testing framework for steamodded?
I'm imagining not but I'd feel awfully silly if I did a whole bunch of redundant work
is it already possible to select both a joker and a consumable in vanilla or is that just a modded thing? if it is a modded thing, how would i be able to change it so that I can do that in my mod?
I think you just click on one and then the other? Am I misunderstanding something?
(tested it just now)
okay i just didn't know ty
okay nice, np
can a joker have 2 rarities?
hello guys, can someone help me with this issue im having? this is the code for my boss blind:
SMODS.Blind{
key = "candle",
boss = {showdown = false, min = 1, max = 10},
loc_txt = {
name = "Candle",
text = {
"First card in each scoring hand",
"is destroyed",
}
},
atlas = "Blinds",
pos = {y = 0},
discovered = true,
dollars = 5,
mult = 2,
boss_colour = HEX("b91408"),
press_play = function(self)
if not G.GAME.blind.disabled and G.play and G.play.cards then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.5,
func = function()
local _, _, _, scoring_hand = G.FUNCS.get_poker_hand_info(G.play.cards)
if scoring_hand and #scoring_hand > 0 and #G.play.cards > 1 then
local first_card = scoring_hand[1]
local destroyed_card = nil
for i = 1, #G.play.cards do
if G.play.cards[i] == first_card then
destroyed_card = G.play.cards[i]
break
end
end
play_sound('tarot1')
G.deck:remove_card(destroyed_card)
destroyed_card:start_dissolve(nil, 1)
end
end
return true
end
}))
return {
remove = true
}
end
end
}
as the description says, i want this boss to destroy the first card of every scored hand. the problem is, when i destroy a face card, canio doesn't get triggered and doesn't get +1 xmult. how can i make it so everytime this boss destroys a card, the destroying event actually triggers jokers that benefit for it
No.
quantum rarity support when
is it possible to loop through all the SMODS.Seals? i wanna automatically create tarot cards that apply those seals
(but first i have to loop through each and print their keys to see if its even possible)
G.P_SEALS?
i tried it before and it only did the vanilla ones (im trying to loop thru my modded ones)
maybe ill try it again after all the seals are loaded in
It worked for me.
what the sigma am i doing wrong, crashes on mult_mod = ...
Try returning mult instead.
center.ability.extra.mult?
why not just card?
That's the correct way to do it.
mm
I think you have card and self backwards.
omg someone told me of a way to get vscode to auto fill function params by adding smods file to workspace but i cant get it to work
that worked tho tysm
I think I may have broken balatro
I added support for card sleeves and made one of the sleeves give an Oops All 6s when it's the same sleeve as the deck but
I did a few runs with the mod on for fun and I had that deck and sleeve combo and I opened a buffoon pack in like Ante 2 or 3 and I got a duplicate of the Oops All 6s ???
without a showman ???
how do I change the suit of a card? I'm trying to change suits of scored cards to a specific suit but I can't make it work
iirc cards have a method called change_suit or something direct like that
search cards.lua or whatever it's called
@daring fern
sorry for disturbing you again, am making another joker which does this
If first hand contains one card, gain 2 copy of that card . Gain 5$ every time a card has been copied, here is the code
''''
SMODS.Atlas {
key = "weiss",
path = "weiss.png",
px = 142,
py = 190
}
SMODS.Joker {
key = 'weiss',
loc_txt = {
name = 'Weiss',
text = {
"If scoring hand has {C:attention}1 card{}, copy it {C:attention}twice{}.",
"Gain {C:money}$5{} for each copy made."
}
},
rarity = 2,
cost = 8,
config = {
copied_this_round = false
},
atlas = 'weiss',
pos = { x = 0, y = 1 },
calculate = function(self, card, context)
if context and context.before and not self.config.copied_this_round then
if #context.scoring_hand == 1 then
local to_copy = context.scoring_hand[1]
local copy1 = Card(to_copy.ability, G.hand)
local copy2 = Card(to_copy.ability, G.hand)
table.insert(context.scoring_hand, copy1)
table.insert(context.scoring_hand, copy2)
G.GAME.dollars = G.GAME.dollars + 10
self.config.copied_this_round = true
end
end
if context and context.after then
self.config.copied_this_round = false
end
return {}
end
}
''''
The code is basically not working
(use backticks(`) to make a code block)
Here is the code
Replace self.config with card.ability
Am still getting the crash tho
Oops! The game crashed:
card.lua:260: attempt to index local 'center' (a nil value)
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0312b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
@daring fern
looks like redacted
Yes I made it and named it like that 😅
how did you loop through G.P_SEALS btw
''''
SMODS.Atlas {
key = "weiss",
path = "weiss.png",
px = 142,
py = 190
}
SMODS.Joker {
key = 'weiss',
loc_txt = {
name = 'Weiss',
text = {
"If scoring hand has {C:attention}1 card{}, copy it {C:attention}twice{}.",
"Gain {C:money}$5{} for each copy made."
}
},
rarity = 2,
cost = 8,
atlas = 'weiss',
pos = { x = 0, y = 1 },
calculate = function(self, card, context)
if context and context.before and not card.ability.copied_this_round then
if #context.scoring_hand == 1 then
local to_copy = context.scoring_hand[1]
local copy1 = Card(to_copy.ability, G.hand)
local copy2 = Card(to_copy.ability, G.hand)
table.insert(context.scoring_hand, copy1)
table.insert(context.scoring_hand, copy2)
G.GAME.dollars = G.GAME.dollars + 10
card.ability.copied_this_round = true
end
end
if context and context.after then
card.ability.copied_this_round = false
end
return {}
end
}
''''
Error
Can anyone help?
Try this?
if context.cardarea == G.play and context.other_card and
(context.other_card:get_id() == 14 or context.other_card:get_id() == 7) and
not context.repetition then
@glass scaffold
Fixed the crashes.
U got it working?
Yep, we're back online.
how do i get the name of a localization entry based off of its key? i'm trying to get the name of a seal using loc_vars
Greattt!
hey everyone! how do yall go about testing your modded jokers in game? is there an easy way to spawn them
DebugPlus is the one, i don't have the link but you can find it on github
ok so im tryna make a music replacement mod, how would i go about it if the music is sped up in the game files?
I think I have it installed, but idk how to add jokers to my hand
DebugPlus.
If you make live edits to your code, you can use Alt + F5 to reload the game quickly.
why is this code not working? it doesnt crash or anything it just doesnt work, if somebody can tell me what im doing wrong here it would be appreciated
if context.cardarea == G.play and context.repetition and not context.repetition_only then
if context.other_card:is_suit("Diamonds") and
pseudorandom('grindstone') < G.GAME.probabilities.normal/card.ability.extra.odds then
return {
message = 'Again!',
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
end```
Go to your Collection, find your desired joker, and click 3 while in a run.
huuuuge thank you
wait alt+f5 is a real thing now?
how do i get the localized name of a seal? i really don't want to have to use
G.localization.descriptions.Other[self.config.generated.."_seal"].name
Yep
yea apparently added awhile ago
i havent removed my bind regardless so ive noticed no difference
mine is just normal f5
same 😭
we're such twins
twinning so hard rn
how does one do that
my lappytoppy doesn't like alt and fn and f5 being pressed at the same time
holy shit instant restart on alt+f5 is really nice though, glad aure added that
do we yet have the extra lovely window closed when we restart
i havent updated in a short while
oh since 0321c, neat
i just made my first joker, holy cow
this is the code I use
SMODS.Keybind{
key_pressed = 'f5',
action = function(self)
SMODS.save_all_config()
SMODS.restart_game()
end,
}
actually hold on aure's addition is pretty nice
we are so in love
can't take my eyes off you
also yeah we do still have the double lovely window
tragic
not the end of the world but sometimes when im printing shit i cant tell which window is my current
yeah I think it's just a bit of a pain to fix
likely so yea, i believe it was something ont he lovely side not smods as well
how can I force a specific joker to spawn? something like riff raff but it spawns a specific joker instead
@glass scaffold sorry for disturbing check dm 🙏
is take_ownership the right function to use here? I'm trying to change the quip dialogue
No crashes, but won't add the cards to the hand. Instead, it adds a blank card and a Joker to the Joker slot.
Anyone got a fix?
what if i ate them
teto...
haiiiii!!!
:D
anyone know the context, for jokers to only show up in store if you have the specific enhancment like Glass Joker only showing if you have a Glass card?
i mean i ugess
dfjhnbgjkdfngkjfdngjk i love your art!!!
i've wanted to make a balatro mod for a while
what am i getting myself into and is this a good idea
anyone know what I would put in for a joker to get +2 mult at the end of round?
how does one actually begin making a mod?
like is there like a baseline I should be working off of or is there like specific files I should be working off of or something? (this is my first time doing something like this so I have no idea where to go or how to start on this)
like which context?
@muted narwhal I am in the same boat and I'm slowly getting it
if you need any resources feel free to DM
heres the starter info
https://discord.com/channels/1116389027176787968/1349064230825103441
I basically just want to create a scaling joker that gains 2 mult at round end but its really just a +2 mult joker atm
if context.end_of_round and context.main_eval and context.gameover == false then
card.ability.extra.mult = card ability.extra.mult +2
end
wii sports music plays
the first thing i did was look through multiple wii osts and look for suitable replacements
this will be the main theme
for a second i thought you meant just adds +2 mult to the total score at the end of the round and i was like "why would you need that" XD
goated theme honestly, the exercise version should be the boss blind theme lmao
i'll think about it lol
(the one where the male trainer is the main one teaching)
i gtg now so i'll brainstorm on other replacements after
bumping my question
does it not patch or does it not work
because i think that's one of the functions smods might override
idk but when i boot the game up nothing happens
doesnt matter if the payload is spam or actual code
during blinds too
check the lovely dumps
if smods overrides it then it will do nothing if you patch the main game
where are the dumps
lovely/dump in your mod folder
amazing! thank you
search for stay_flipped in smods/overrides.lua too
yep i just checked steammodded does override that function
you will need to target that file then
there's a context.stay_flipped now too if that works instead of your patch
hi, I'd like to try making a mod to add a couple jokers, but I'm not sure where to start. Are there any resources for beginners or advice you could give me? Thanks in advance
You can check the SMODS documentation
My DMs are always available if you need assistance in your time
thank very much, looking to it
Nicest modding community ive seen
our brains only know one thing
make funni number larger
how can I force a specific joker to spawn? something like riff raff but it spawns a specific joker instead, I want to spawn a predetermined joker form the collection
I need to know 2 things:
1: context for a Joker to check when a blind has started
2: how to set current score to the blind's requirements.
-# and maybe how to set a Joker to a custom rarity.
when a blind is started wouldn't that be context.setting_blind?
Good question. I do not know.
I searched the post history, but I can't find anything for it. I'm trying to get xchips, but it does not appear to be working
Try x_chips
x_chips and remove the other keys
how do I make this update function only occur when the joker is in your deck? When I pull up the card in collection it debuffs everything without it being in the deck
no card, message or colour
Like this?
no
Hey, this is probably something obvious I'm missing, but any reason why my values are showing up as nil in the joker description?
return {
x_chips = card.ability.extra.x_chips
}
You're missing the loc_vars part to show.
Ahh, so I do, thanks
you can check not card.area.config.collection
ahhhh, much appreiated!
I'm flying by the seat of my pants right now so I'm still missing things like that
This worked, thank you
i guess it doesn't matter if a card is just sitting in the shop, but it's the safer option either way
Is there an place to find all these modifiers in an easy-to-read format?
I've seen online tutorials, but they don't explain everything
You are a lifesaver 🙏
hey, you think you know how these can be done? #💻・modding-dev message
what do you guys think
nice art
thanks
Great needs a little bit more details 💗
I'm trying to figure out if a card being sold is an uncommon joker using the context, anyone know where I could find how to do that?
hi! really weird bug
code
hold on, lemme grab the ability first
what it should do:
- hand is played
- before scoring, it checks to see what ranks are there
- it marks the new ranks it needs, and sends status texts
but instead of getting the ranks, it gets their positions in the played hand
...for some reason
so instead of a hand like 56789 marking those ranks, it marks 2345
(1 isn't a rank, Ace is 14)
here's the upper half of the code
it's driving me mad 😭 ideas?
context.setting_blind(when you press the select button) orcontext.first_hand_drawn(when cards are first drawn to hand)
part 1 of the wii mod is done: the music
BASED SELECTIONS
card.config.center.rarity == 2
yes it is just music taken straight from mostly wii fit plus and the wii shop theme
though i think the Tarot music should be the weird zodiac app that the wii had
- should be something like
G.GAME.chips = G.GAME.blind.chips+/- some UI updating that i don't remember
that's a thing??
AKA: Today and Tomorrow Channel
oh
i loved messing around with that as a kid :3
i will infact do that now lol
it made no sense but it was really funny to fling the miis around :D
sweet.
-# now uhh... how do custom rarities work?
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips) for the UI
which song in particular on that
just the main theme?
any one you want!
i don't remember them
it'll be a nostalgia trip when you show it in the mod :D
how do you set the joker to a custom rarity?
is there a way to access the base chips of cards left in deck ?
theres only like 3 full songs in the entire soundtrack lmfaoo
correction: 2 with one of them being a layer you put on the 2nd one
don't return it
oop! Sudoku works now :D
Well, I guess that worked. I think...
i've got a crash at the beginning of creating a joker (following this youtube tutorial, https://www.youtube.com/watch?v=Zp-4U5TlbxY&t=7s at 4:50sec)
STEAMODDED 1.0.0
A tutorial on how to make a modded Joker.
https://github.com/art-muncher/Example-Mod -- EXAMPLE MOD
https://github.com/Steamopollys/Steamodded -- STEAMODDED
https://github.com/WilsontheWolf/DebugPlus -- DEBUGPLUS
-----------------------------------------------------...
Accompanying code here:
i don't exactly know what caused this, i tried checking my files names and such but it looks like it's in order, i'm not sure what i missed here
What does your SMODS.Atlas and SMODS.Joker's key and atlas show?
I'm not sure i understand the question
arcana pack song has been changed
Hey, where can I read how to use the "create_card" function?
I want to create a random rare joker, but I want to actually know what the function can do for future reference
dont use the vanilla one https://github.com/Steamodded/smods/wiki/Utility
Thanks!
they mean this and this
if you don't have a spritesheet in assets/ then delete the atlas
there is a png in both 1x and 2x
i strictly followed the video up to this point
what's the filename
can i see a screenshot of your mod's folder
how can i check if a card is debuffed?
card.debuff
thank you!
can i debuff a joker with debugplus?
if you can, I don't know how. I don't think you can.
why is this code not working? its supposed to have a 1 in 2 chance of retriggering diamond suit cards but it doesnt retrigger
calculate = function(self, card, context)
if context.repetition and context.cardarea == G.play and not context.repetition_only then
if context.other_card:is_suit("Diamonds") and
pseudorandom('grindstone') < G.GAME.probabilities.normal/card.ability.extra.odds then
return {
message = localize('k_again_ex'),
repetitions = card.ability.extra.repetitions,
card = context.other_card
}
end
end
end```
i dont think you can directly but you can do eval SMODS.debuff_card(card, true, "source")
is the key in there just a seed or can I specify what I want to create?
you can specify an object's key yes
SMODS.add_card{key = "j_modprefix_jokerkey"} for example
alright, thanks
I want to make sure you know about this https://love2d.org/wiki/love.mouse.newCursor
you are amazing
one more question, where can I find the keys for vanilla jokers?
or can I not use vanilla jokers in this function
you can
alrighty
you can get the key of any card with DebugPlus by hovering over it and running eval dp.hovered.config.center.key
one thing though
my skill in coding is my amount of functioning braincells: barely any
Question, what's the easiest way to spawn a modded joker for testing purposes?
debugplus
hiya, quick question! how do i check the level of Straight?
So uhhh how do badge colors work?
ah nevermind, found it :D
This doesn't work btw
you need quotes around the hex code
thanks trance, very cool
that worked.
i can already see the amount of wii energy in my Balatro
sdngfkjdfngjkfdn!!
idfk whether to making a thing in #1209506514763522108 coz idk how much progress i'll make with this
please do!
might as well lol
make it, this is peak
done
spritework go brrr
wii cards is real!!!!
I got the effect of my joker working surprisingly quickly, but now I want to add a few messages to pop up under certain conditions, where can I read how to do this?
"measuring..
measuring..
measuring..
done!"
-wii balance board
https://discordapp.com/channels/1116389027176787968/1358926223400501408
under the joker?
Yeah
does anyone know the end of ante context?
talisman turns hand levels into a table
ah
i dont really know how to fix that in this case
to_big(G.GAME.hands["Straight"].level) * to_big(card.ability.extra.mult_per_strength)
It's very simple, but I'm proud to have gotten it working so quickly, thanks a lot for the help!
i dont see a comparison
hm im not sure how viable that would be in any given run tbh
We're getting somewhere, but this still isn't insta-winning the blinds. Anyone know how to make it work?
generate a random rare by selling off jokers? easy Baron runs.
end_round() i think
random rare tho, no guarantee of baron
Turkey dinner in snows mods does this
plus it means you need to have at least 2 free joker slots to get anything out of it (card to sell and recyclomancer)
Nope, not doing it.
whats the code
i think setting_blind is too early to win the round tho, you might need an event that checks G.STATE == G.STATES.SELECTING_HAND
same error
anyone know how to check if a hand one shots a blind?
call when first hand drawn
context.individual and context.setting_blind is not going to trigger
instead of select blind
Ok, so just delete those checks?
use this check instead if context.first_hand_drawn then
hey i wonder what is the line to call the orange color used for the acrobat or the dusk joker?
You can create another floating sprite
How.
first_hand_drawn might also be too early
So uhhh we're getting somewhere...
G.STATES.HAND_PLAYED
Maybe with context.after
Jen's Almanac has Gaming Chair that does the function, fwiw.
i just made my own custom context :3
Fair
yeah it's what i was just saying
This is what i do to add another layer, i recommend checking card_draw in smods
Change context.first_hand_drawn to context.after?
is there any easy way to get a joker to print a varibale every time it changes other than adding it manually
(bump)
If to_big doesn't exist you may have to add the function, or use Talisman
oh i have Talisman
this works
if context.setting_blind and context.main_eval then
G.E_MANAGER:add_event(Event({
blocking = false,
func = function()
if G.STATE == G.STATES.SELECTING_HAND then
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
return true
end
end
}))
end
it's the same error though
heya im wondering where can i find the base game joker descriptions?
im searching all the colors in there
it doesnt seem to be neither in main.lua nor card.lua
and none of the others i checked
it's in localization/en_us.lua
thank you !
the colors are here btw
yeah...
no, with the event
this might be a stupid question but is there a way to unpixellate the background shader
So exactly like this?
yes, you can add the pseudorandom check before the event tho
this end should go outside the event
So like this?
no thats the exact same thing
wait I added an extra end above it. that should work.
Yeah, so I thought. same error.
can you copy the code here
my base tarot card pack reskins
if context.setting_blind and context.main_eval then
if pseudorandom('random seed') < G.GAME.probabilities.normal / card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
blocking = false,
func = function()
if G.STATE == G.STATES.SELECTING_HAND then
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
return true
end
end
end
}))
end
}
like this
each function and if should have an end
calculate = function(self, card, context)
if context.setting_blind and context.main_eval then
if pseudorandom('random seed') < G.GAME.probabilities.normal / card.ability.extra.odds then
G.E_MANAGER:add_event(Event({
blocking = false,
func = function()
if G.STATE == G.STATES.SELECTING_HAND then
G.GAME.chips = G.GAME.blind.chips
G.STATE = G.STATES.HAND_PLAYED
G.STATE_COMPLETE = true
end_round()
return true
end
end
}))
end
end
end
fixed it!! needed :to_number() after the calculations
Finally works without breaking.
Thank GOD
I'm currently trying to program a joker that selects a random joker during a boss blind and makes it negative and eternal! But when I get into a boss blind it just crashes and does this?
update = function(self, card, dt)
if G.STAGE == G.STAGES.RUN then
card.ability.extra.deck_chips = 0
for k, v in pairs(G.deck.cards) do
card.ability.extra.deck_chips = card.ability.extra.deck_chips + math.floor(v.base.nominal / card.ability.extra.part)
end
end
end,
calculate = function(self, card, context)
if context.before and context.cardarea == G.play then
card.base.nominal = card.ability.extra.deck_chips
end
end
}
cannot figure out for the life of me why this could cause base get_id function to not work
what's the effect supposed to do
the enhancement is trying to add a 16th of the value of all the base chips of the remaining cards in your deck to the current card
so i use update to change the value of deck_chips
and context.before in calculation to set the nominal value of the chip
the reason why i do it in update is i have the current chips it gives in the description
as such
is that in loc vars
yes
then do it there too
wdym?
do the update part in loc_vars and in calculate
so it doesnt run every frame, just when it needs to
wait is loc_vars called everytime a user hovers over the card
yes
oh wow
i thought it was just loaded once
okay that helps
would that fix the original issue with get_id()
rip
it's probably because you're modifying the nominal but I've never worked with enhancements so idk the best way to do that
okay instead of changing nominal ill just add it to chips, let me see if that makes a difference
although my other enhancement changes nominal and that seemed to have worked
SMODS.Joker {
key = "old_joker",
config = {
extra = {
chip_bonus = 35,
mult_bonus = 6,
ante_count = 0,
chip_gain = 0,
mult_gain = 0,
}
},
loc_txt = {
name = "Old Joker",
text = {
"When you {C:attention}Ante up,{} gain",
"{C:blue}+#1#{} Chips and {C:mult}+#2#{} Mult",
'{s:0.85,C:inactive}(Currently +#5# Chips and +#4# Mult){}{}'
}
},
rarity = 1,
pos = { x = 19, y = 0 },
atlas = 'joker_atlas',
cost = 4,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
set_ability = function(self, card, initial)
if card.config.center.key == "old_joker" then
card:set_eternal(true)
end
end,
hey im still kind of struggling with something stupid
im unsure how to make a joker always spawn as eternal
im pretty sure this does NOT work since thru debug ive rolled into it without an eternal sticker
you don't need to check the key I don't think, and even then the key should be "j_modprefix_old_joker"
i was told about that but i like tried j_nevernamed_old_joker and it didnt work
ill remove the key check and just have it do card:set_eternal(true)
ty
nvm the problem happens even before it gets to calculate
so its not that
its the second i highlight the card what that enhancement
nevermind wait a second, its not even my card thats breaking the game
i tried picking a random card
and my game still crashed
sned full crash
...cursed.
2
2
Still trying to make the cards get always drawn to hand... and I forgot about booster packs, so it gets drawn even if the given pack has draw_hand set to false.
fresh deck, i click on any card, gives me that error
new run
no enhancements
something might be checking if a hand is valid on a not real hand
is it possible to change the position of the card on the main menu?
is it one of the mods i have or
hmm yeah
i removed my mod
and it still crashed
is it the new smod version maybe...
i was on 0315b and upgraded to 0407a
i just deleted the old smod folder and cloned the main branch
should i download the zip file from release instead
opinions
are these wider than the base game versions?
i think this was just before blind calc, so some mod might be incompatible with it
they are my custom enhancements
but i dont know
ahh well rip
i need to iteratively find which mod is not compatible
same issue with the latest release as well as of 2 weeks ago 😭
no way around it
time to manually disable and enable mods one by one
yeah i dont think its an smods issue
yeah
Anybody know how to make an enhancement that changes how many chips a card gives instead of adding bonus chips? I'm trying to make an enhancement that makes a card give zero chips, but keep it's rank and suit
okay
got it
the issue is with divvy's preview
I'm still not sure why this happened? It might be because of the code for selecting a random Joker but yea
that looks like pseudorandom_element is crashing because you're giving it a nil but you should confirm that
my solution was a lot more hacky, but i just make it so that it subtracts the base chips from the card, by having the bonus chips be the base chips * -1
thanks

