#💻・modding-dev
1 messages · Page 544 of 1
xchips is base smods
it is??
yuh
wouldnt have been able to make homelatro without talisman if it wasnt
then idk why i use talisman
dam
wait, is it impossible to do emult in vanilla code? Haven't gotten to it in my project, but I have at least one joker I want to square mult
Yes
emult is ^mult
Oh… I didn’t know talisman added Emult.
I just.. coded it myself for my mod, it’s not glowy like cryptid but-
yes you can
but it is still recommended to use talisman for these type of mods
I guess it's good to know - one less problem for me to code
Couldn't you just return xmult = mult or smth?
the emult joker of mine I tried to do for a while in vanilla before I realized that talisman just gave an ability for it
how would i make it so cards created with this sticker also properly give their effect
@brittle tide If Talisman is required for your mod, I'd recommend setting it's priority lower than Talisman just to ensure Talisman is loaded first. Idk if it's guaranteed to load first with the way Steammodded works, but might help safeguard some issues down the line
i think it needs to be in the apply function
sorry to intervene
But wasn't it that the higher the number, the lower the priority?
Iirc it's lower number gets loaded first, but let me double check real quick
oh ty
and this doesn't work?
not when a card is created (like with DNA) that has it
ohh hmm
lemme grab a vid rq
it makes sense because the area is probably not the hand when it's created
maybe if you add an event it might work
where would i add the event
--pseudocode because im on phone and its 1 am
add_event{
func = function()
if card.area == G.hand and ....... then
SMODS.change_play_limit(...)
...
end
return true
end
}
actually im a bit curious if part of the issue is me not allowing the changing of the limits if the card already has the sticker when apply is run
but lets see if the add_event works
oh god i forgot to return true
Question: I'm adding a card to a scoring hand without altering the hand type, and I want it to also score that hand. However, I can't seem to make it score no matter what I mess with. Is there a way to do this without making a new enhancement/edition/sticker/hook?
You mean like DNA but into hand played?
Not exactly, currently it's:
Hand played
Card added
Original hand scores, card doesn't
I want the card to score, as well
When are you adding it?
So it's not added to the same area as the scoring cards?
Hold on a sec
Example of what happens and the code
-# (I already fixed the bug shown here, this is just the only video of it I have on hand)
Wait I may be stupid this doesn't show the issue
If that ace was a two it wouldn't have scored, but I would want it to score still
This isn't working properly, i wanna retrigger cards with an edition but idk if i'm checking it correctly
would i use other_card?
now the sticker doesnt even work when its applied the initial time
Can context.repetition and context.individual be true at the same time?
I think that this would require you to have something in context.individual and checking that this card is the same as the card in the position you are emplacing the new card in to return it's value as a_chips
if context.modify_scoring_hand and context.other_card == G.play.cards[1] then
return {add_to_hand = true}
end
```?
it works apparently
found the fix thankfully
it works more now, but it still doesn't score
Why did you change the context for emplacing the card?
i wasn't at my computer when i said what context it was in, i took a guess between before and press_play
before works for how i want the card to be added, but it means the card doesnt score. press_play makes it score but changes the hand type sometimes
Is there a way to add a non-legendary joker to The Soul?
you can reprogram it with SMODS.Consumable:take_ownership and creating a new use function with some probability to select from either a legendary or some other joker
Oh, so a pain either way. Because i would preferable just have my joker be Legendary, but the game forces a set unlock condition on all legendary jokers.
And i guess dealing with a single function is way simpler than creating a patch.
couldn't you just have the set unlock condition return true so that it's always unlocked?
I could but who wants a ^1 joker?
how would i have a card modify specifically wheel of fortune's probability?
I think with the new SMODS.probability thing you can do that without patches
im not sure how, but you'd need to look at the documentation for the function on SMODS
you can flag the added card, then check for the flag in context.modify_scoring_hand
(sorry i just woke up)
Go to sleep
:3 nah
I'm trying to make a joker get unlocked when you win a run with a specific joker, but I can't seem to figure it out. this is what my dumb little brain thought might work but it doesn't
check_for_unlock = function(self, args)
if args.type == 'win_custom' and G.jokers then
if G.jokers == 'modprefix_joker' then
return true
end
end
return false
end
I wonder if it would be better to check if the wanted joker has a stake sticker?
I'm not sure how to select an arbitrary joker regardless of run or not, but it seems to have a sticker_run that could be useful.
But that way the unlock condition wouldn't be dependent on winning a run to unlock, and would unlock if the relevant joker already had a win
I'll try that
G.jokers == <joker key> doesnt work because G.jokers is the entire cardarea
Use SMODS.find_card instead to check for the joker
yippee! it works! thank you!
upon further inspection, it doesn't work. I'll have to try and tinker with it
I think you would have to do if next(SMODS.find_card("<key>")) maybe
Hi chat. Question: When does SMODS save your mod settings, and is there a way to make SMODS save your settings?
*i did some notepad testing on the settings.jkr file and it seems to be quite inconsistent on when it saves.
1 mostly when you quit the mods menu
2 idk
3 why notepad instead of VS?
Because I got VSC occupied with actual debugging.
okay I got it to work. I made a typo in the key...
if context.modify_probability and context.identifier == "wheel_of_fortune" then
return { numerator = context.numerator * 2 }
end
Multiply the numerator by 2
There could be some typos because I wrote this on mobile
Knowing that, is there a way to open the settings menu via G.FUNCS.overlay_menu
Like, the mod's settings menu, or any page I add with extra tabs.
uh... @manic rune idk, you are the UI guy 
Psps
G.FUNCS.overlay_menu({definition = SMODS.current_mod.config_tab()})?
run SMODS.save_mod_config(SMODS.current_mod)
definition = 'openModUI_modprefix'
dies
There aren't like, any soundpacks yet so uh...
We'll pretend search doesn't exist.
a search function is nice to have though
help, shit is not working or something idk
??
It ain't saving
that doesnt do anything since you arent even saving into the config of the mod
i do not know how to use that
I just copied and pasted what you sent
and hoped for the best
create a config.lua file
We already have one
We
I am not the only one working in Tonsmith.
then you should be changing SMODS.current_mod.config["whatever"]
How does one make is so Seals and Enhancements can naturally show up on non-playing cards and Editions can naturally show up on non-jokers and non-playing cards?
the last 2 weeks i search for something like that and find nothing, you were the last person i will ask
maybe hook to create_card?
current_mod only has a value during initial loading
mm might want to change the timing of that code, then
assuming you have something like Tonsmith = SMODS.current_mod somewhere, you can just do SMODS.save_mod_config(Tonsmith) whenever you need it to save
not in update
i wonder who would even do that in update lmao
I may need a bit more explanation to understand how that'll fix it...
- change your
context.beforeback tocontext.press_playlmao context.modify_scoring_handwill run through all the cards inG.play.cardswithcontext.other_cardpreresenting each one, so adding a flag like
if context.press_play then
local chosen_card = ...
chosen_card.always_score = true
end
if context.modify_scoring_hand and context.other_card.always_score then
return{
add_to_hand = true
}
end
will make it so the context checks what card is added, and will also make it scored
Will this also make it so that if I play a 5, and an ace gets added to the scoring hand, both will score?
-# I'd check it instead of asking but I'm not at my computer and won't be for awhile so I thought I might as well ask instead of waiting to get back to my computer
what would be a way to make a deck have the ability to only force my jokers into the pool because I wanna make it so no normal jokers spawn
you can add all other jokers to G.GAME.banned_keys
would that just be added their keys to a large ban list?
yes
bro you removed my function that added searching
💔
i dont think so, no
you are adding cards before the poker hand evaluation, so A will be initially scoring first
im gonna be honest ive never done a deck
i just tried and realized i have no clue where to start😭
decks have an apply function, in that function iterate through G.P_CENTER_POOLS.Joker and check for not v.original_mod or v.original_mod.id ~= "your mod id". If that's true then you add v.key to the banned_keys table
And there'd be no way at all to do the thing I am looking to do?
what do you need to patch?
uhh adding a card into the scoring hand without changing the poker hand
and making it so the card can still score afterwards
you can maybe use the evaluate_poker_hand context instead
i added it last update :3
So much has been added to SMODS, I'm excited for the next release version
why does this code modify TNSMI.reference
Because TNSMI.packs is just a reference for TNSMI.reference, so when you change something in it, it changes it for TNSMI.reference
what??
You can prevent it by using copy_table
yeah but if i modify b after the b = a line, shouldnt a == b return false instead of true
huh ok
tables are all different objects
ok copy table just closes the game for some reason
does TNSMI.reference have cards in it
yeah actually
try SMODS.shallow_copy
Then you would use SMODS.shallow_copy
alright
Question for anyone familiar with the Operator API (latest SMODS dev), is it possible to make "independent values" that aren't affected by hand level ups nor reset every round/hand/etc.?
How do I destroy a random Joker and replace it with a specific Joker?
use pseudorandom_element to pick a random joker, run card:start_dissolve(), and use SMODS.add_card to create the joker you want
Okay, gonna try that. Thank you :3
What am i doing wrong?
local replaceJoker = pseudorandom_element(G.jokers.cards, "replaceJoker")
card:start_dissolve(replaceJoker)
SMODS.add_card("j_cstorm_washed_card")
end```
...why not SMODS.destroy_cards(replaceJoker)?
Okay, how do I fix that?
whats the difference 🤔
i actually thought about using that too but start_dissolve also gives the animation so idk (i havent used SMODS.destroy_cards that much)
destroy cards calls start dissolve but also does thing like getting sliced and the like
- change the line with
SMODS.destroy_cards(replaceJoker) SMODS.add_card{key = "j_cstorm_washed_card"}
mmmmmmmm
icic
and respects shattering
Handles shattering too.
Should I use that instead then?
and in general it's just good to use smods utils so you get any support in the future
true
btw what's the idea here? I don't think you want apply
I want the tag to destroy a random joker and replace it with one
I've just returned from bureaucracy trippings... and I do have just one instance of :remove() being used instead of SMODS.destroy_cards for start of run with a deck.
ah i didnt notice it was a tag because it's missing the context
Why is my tag not disappearing after it's activated?
you need to call tag:yep iirc
gotta love the function name there
yep 👍
Do I need to put a function into it?
idk
It doesn't crash without, so I guess not?
Seems to be crashing every time the Yellow Enhancement is triggered. Anyone know what's going on?
talisman..
Okay, how do I make it, so the tag is only able to spawn if G.jokers.cards isn't empty?
tags have in_pool but you could also sell all jokers before skipping
i would make it nope or not trigger if its empty
Okay
Anyone know how to make a joker not appear in the shop?
only the shop or not spawn in any way naturally
Not spawn naturally
pls help me, I'm tired of this crash.
Ty
it's talisman, it doesn't like that you're returning a bignum
idk if its fixed in other versions
So lemme guess, I need to add:
if G.GAME.dollars <= to_big(5) then
-- code
end```
in the calculate function?
no in this case the problem is the return
i think you need to use lenient_bignum
but idk how that works
This crashes my game...
local replaceJoker = pseudorandom_element(G.jokers.cards, "replaceJoker")
SMODS.destroy_cards(replaceJoker)
SMODS.add_card{key = "j_cstorm_washed_card"}
tag:yep("Washed", G.C.BLUE)
tag.triggered = true
else
tag:yep("NOPE", G.C.PURPLE)
tag.triggered = true
end```
what's the crash
also G.jokers.cards is never nil
and also there's tag:nope haha
Oh xD
do #G.jokers.cards > 0
It works now, thank you. What does the # do before G.jokers.cards though?
length of the table
Good to know
is there a way to use vanilla atlases
where
i'm making a mod that turns every vanilla joker into a deck
so i want the decks to use the vanilla joker art
I think if you add prefix_config = { atlas = false } and then use atlas = "Joker" it will work but I haven't tested
aha
i forgot about prefix_config
... which calculate contexts get passed to a deck? i am unsurprised to learn that joker_main is not one of them (it's not a joker after all :v)
i think it's most of them, but decks use main_scoring instead of joker_main iirc
currently making this what values in extra do y'all use for your scaling jokers currently checking for
extra.mult_add or extra.multadd or extra.mult_mod or extra.multmod or extra.xmult_add or extra.Xmult_add or extra.Xmult_mod or extra.x_mult_add or extra.x_mult_mod or extra.xmult_mod or extra.x_chips_add or extra.xchips_add or extra.x_chips_mod or extra.xchips_mod or extra.scaling
well if anyone else want their value added let me know i think that should cover most of them hopefully
You could also just use the calc_scaling stuff thats currently in smods beta, that seems like it would be much easier here
yeah, that's probably the way to go
...should probably also utilize it myself. 😅
So somehow this has just stopped applying the eternal sticker for some odd reason.
theres calc_scaling? how do i use that?
i'm sure it'll be documented when the next release happens
(which should be soon iirc)
i know "just wait" isn't a great answer but i'm not familiar with it either so if someone else wants to explain it pls go ahead
well my next release is probably also soon so im either going with what i currently have or fixing that later lol
---@param card Card|table
---@param args? table|{ref_table: table, ref_value: string, scalar_value: string, scalar_table: table?, operation: string?}
---@return table? results
--- Tells Jokers that this card is scaling allowing for scaling detection
--- Can return scaling_value and scalar_value in results to change the scaling cards values
--- Args must contain `ref_table`, `ref_value`, and `scalar_value`. It may optionally contain `scalar_table`, used in place of `ref_table` for the `scalar_value`, and `operation` to designate the scaling operation, which defaults to `"+"`
function SMODS.scale_card(card, args) end
so what exactly would i do here to use that?
calculate = function(self, card, context)
if (context.retrigger_joker_check
and not context.retrigger_joker
and context.other_card ~= self
and context.other_card.ability
and context.other_card.ability.extra) then
local extra = context.other_card.ability.extra
-- Only retrigger if Joker has one of these scaling fields
if extra.mult_add or extra.multadd or extra.multgain or extra.mult_gain or extra.mult_mod or extra.multmod or extra.xmult_add or extra.Xmult_add or extra.Xmult_mod or extra.x_mult_add or extra.x_gain or extra.x_mult_mod or extra.xmult_mod or extra.x_chips_add or extra.xchips_add or extra.x_chips_mod or extra.xchips_mod or extra.scaling then
if pseudorandom('Subscribe') < G.GAME.probabilities.normal/card.ability.extra.odds then
return {
message = localize('k_again_ex'),
colour = G.C.Mult,
repetitions = 1,
card = card,
}
end
end
end
end,
the reason i didnt propose it is because affecting scaling and detecting scaling jokers is very different
same when people try to detect probability jokers
speaking of which you should be using the new probability functions lol
theres new ones?
https://github.com/Steamodded/smods/releases/tag/1.0.0-beta-0711a check the first header
damn thats how i've done like every probability thing in my mod
i mean that was the old way yeah
I've been there too, ... xD
it's a tedious change but definitely worthwhile
will the old way still work as intended or do i need to go through every probability based thing ever?
it will only work with oops or anything using the old system of modifying the global
it wont support mods using the new contexts
What would I need to add, so that this gets only executed once?
It currently triggers it's effects for every playing-card in the deck :')
if context.end_of_round and context.cardarea == G.deck then
-- Some Code here
return { message = localize('k_reset') }
end
context.end_of_round and not context.repetition and not context.individual and context.cardarea == G.deck i think?
is context.main_eval on decks in smods release? hmm
We will see, but also thank you for the answer 
if it's not in the latest release then do what Eric said
you might need to drop the context.cardarea
did they change context.cardarea too?
no
I can atleast confirm that this does not work in 1.0.0-beta-0711a...
But this did!
-# Ope sorry for the ping
its fine
well it will work in a couple of days so i wont change it :3
Very fair

I was already planning a week of Bugfixing, guess I'll wait for the next release then 
if you don't put an atlas argument
it will just use the vanilla sheet
yeah but i don't want the vanilla deck sheet
i still have the option to use old ahh 2024 code in my config despite not making anything new support it lol
it uses the vanilla joker sheet by default
really? weird
are there any mods out there that people even still play on old smods or has everyone finally updated past that?
i dont think anyone has used oldcalc since cryptid updated like 8 months ago
yeah i dont either but i still have that option there in my config if somebody was for some reason lol
Im going to dev on old calc
use pre-lovely smods
Would you support my endeavors
I'm trying to make a malverk texture pack but i keep getting this error
can anyone help
no
id support it via the config but i dont know if its even that useful i've added plenty of stuff since i moved to new calc who knows how much of that even fuctions there
Why do you hate me
i never support old stuff because i dont have the time to maintain multiple systems
Im of mind nothing 'should' be old
I just tend to be lazy
I usually dont change things until its broken
A rare exception was the probability changes which I changed same day
this i only went to new calc because it was basically forced
cause new calc broke like almost everything i was doing and everyone was using it lol
Friendship with dilly is over
The new calc transition is vastly blown out of proportion, it wasn’t even that bad. I think people just think it was bad because cryptid/pwx just didn’t switch over for literally months
i think if you're using a 0.X version of anything you should expect shit to change in a way that requires you to change things on your end. even if it's 0.9.8
What the freak
A guy just cant be quirky anymore
supporting a codebase that is 9 months outdated and counting is trying too hard to be quirky
Its called being retro :///
man just wants to be so retro
so retro (adds spy cryptid to my mod)
so retro
so retro
retro is like windows 3.1
Vintage then?
'cause this would be.
i have various old mods from 2024 saved what else would i name the folder lol
wouldnt that just be vintage
95, 98, ME / NT4, 2000, XP are retro then.
its weird because apparently the actual meaning of retro is not what ive used it as
cause apparently retro is new items just appearing old
where vintage is old and specific to the era
vintage is like dos
you trying to run balatro on windows 1.01?
...that's a bit too broad - FreeDOS still exists.
actually retro is like windows 7 now im just referencing that sanae meme
nes clones still exist
That'd be retro then.
imagine if old windows came with balatro instead of solitare
retro is when corporations pander to your specific childhood experiences /j
the xbox 360 is 20 years old
Now, FreeDOS on an a 8086...
i should get that DOS game pack for my mister
2020 was 50 years ago
balatro is celebrating its 75th anniversary tomorrow
The ps5 is 500 years old
oh crap

I moved SKHDecks to that without redoing the test
How would I change the sprite of something like jimball from cryptid does? Do I use update to switch the sprite to the next so it's animated?
yes
And then with a loop that increases x and y when needed?
How?
how can i debuff two suits in a blind?
update has a dt argument for time or use G.real_dt or G.TIMERS.REAL if you dont care about the game speed
Okay, thanks :)
are balatro's translations considered proprietary like balatro's code?
im working on a project where im using a slightly patched translation set (hard to explain why) and im unsure if its okay to publically check them in to github
i was trying to do a joker that retriggers enhanced cards but it is not working, can someone explain to me how to make it work?
instead of has_enhancement do next(SMODS.get_enhancements(context.other_card))
has_enhancement is for checking for a specific one
thanks it is working now
hello there, what is happening ? am i missing something ?
you posted everything except the actual definition of the consumable lol
yes
my guess is that the consumable type is either wrong or non existent
did you define a ConsumableType?
how do i make a texture pack with steam modded
is that a matter of skill issue ? the new consumable thingy works but now i dont know if the error is sm to do with localization or anything else
yeah its missing the localization
goes in dictionary ?
it goes in a couple of places i dont remember
just ctrl+f vremade_tarot on vanillaremade's loc file
hello, I'd like to know if there's a way to make a SMODS joker always be eternal?
card:set_eternal(true) in set_ability
how do i make my sm mod replace the already existing art of a joker
check code from the animating vanilla joker mod, it might help
this is not the actual name tho, i forgot
Use Malverk
yeah that worked, thanks :)
is there not just a thing like for decks where they use smods.init.DecColors
You mean DeckSkins?
yeah but with jokers instead
Yes its called Malverk
does it use code or is it another thing
So I have tried making this bit of code that is meant to increment the xmult of a joker when a class of jokers is triggered. I currently have it to check the joker's key with a table of valid keys. This code worked when I used context.other_joker, but I when I switched it to context.post_trigger, my reference to the joker no longer worked and using context.other_card didn't help either. I've tried having a key_append value in context.other_ret, but that doesn't seem to work either. Any ideas on how else I can evaluate which joker just triggered?
Context.other_card should still work in post_trigger
Oh, I see
Other_card
Can you show your code?
local potion = false
for _, k in ipairs(POTIONS) do
if context.other_ret.key_append and context.other_ret.key_append == k then -- this is my latest attempt, I previously used context.other_card.config.center_key
potion = true
break
end
end
if potion then
print('success 2')
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.mult_mod
return {
message = localize {
type = 'variable',
key = 'a_xmult',
vars = {card.ability.extra.mult_mod}
}
}
end
end```
What values does POTIONS contain, exactly?
a list of key values for specific jokers
im trying to do this lua function SMODS.INIT.DecColors() local dec_mod = SMODS.findModByID("newcards") local sprite card = SMODS.Sprite:new("cards_1", dec_mod.path, "newcards.png",71,95,"asset_atli") sprite_card:register() end with jokers instead of the deck
How do I use G.TIMERS.REAL in the update function to change the sprite?
This is jank ass code from more than a year ago
so does your thing use code to replace the jokers or is a seperate add on to balatro that manages texture packs
I'm having a bit of trouble.. I know that you can make a deck start with certain jokers but how exactly do I handle custom jokers (SMODS.Joker)?
j_[mod prefix]_[joker key] is the template for the key of any joker in the game. vanilla jokers are just j_[joker key]. the mod prefix is whatever the author defined in the mod's metadata. of course make sure that the mod actually exists on the player's side if you're adding a joker from another mod
Both
yeah the joker is packed with the deck, that helps a lot thank you!
so can i use it in a normal mod file so i can do the joker art replacement and do other things in the mod
Yes
ok does it require the add on part
Yes
ok thank you
bump
isn't that what they already do? when/how do you want it to trigger?
I'd imagine the best approach would be to have it be a repetition effect through context.end_of_round and context.repetition and context.individual and using ease_dollars([var]) or whatever method the mime uses to retrigger effects after checking that the card's enhancement is gold
alr thx
bump2
Due to, ahem, recent events we've got a new rule for https://discord.com/channels/1116389027176787968/1209506360987877408 and https://discord.com/channels/1116389027176787968/1233186615086813277:
Discussions regarding the use of AI and AI tools is now strictly prohibited in these channels.
Given that nearly every mention of AI here tends to result in conflict, argument, and the inevitable mods ping, we've determined this is not a place the discussions surrounding this technology.
Furthermore, there is a zero tolerance policy for the discussion of training AI models or tools on Balatro, or Balatro mods. I'm not kidding, this is going to be ban on sight. Discussion of this, allusion to discussions of this, cute winks and nods to discussion of this will result in an immediate ban.
These items have lead to just an unnecessary amount of strife and drama amongst a substantial swath of the community, and so for everyone's sake those discussions are now over.
This rule does not expresss an opinion on the validity, utility, or usefulness of these technologies and is simply for the purpose of maintaining the smallest modicum of civility.
can anyone tell why im getting this error lua AltTexture({ key = 'rrjokers', set = 'Joker', path = 'joker.png', loc_txt = { name = 'rrjokers', } }) TexturePack({ key = 'rrjokers', textures = {'rrjokers'}, loc_txt = { name = 'riffraff', text = {'A mod that replaces the joker textures with ones the size of the joker icons on the riff raff joker.'} } })
bump3
why do you keep saying bump
bump
me when im driving
i'd help you but i don't use it while animating the sprite
I'm bumping my message so that I don't need to rewrite my message again and again
oh ok
What do you use for that?
update = function(self, card, dt)
local FPS = 6
local total_frames = 40
if card.ability.extra.delay == 60 / FPS then
card.ability.extra.x_pos = (card.ability.extra.x_pos + 1) % total_frames
card.children.center:set_sprite_pos({x = card.ability.extra.x_pos, y = 0})
card.ability.extra.delay = 0
else
card.ability.extra.delay = card.ability.extra.delay + 1
end
end,
back then i didn't know G.TIMERS.REAL existed
so im not sure if a solution with that is better or not
great
ok
N told me that I could use G.TIMERS.REAL for that but I can't find anything about animating with it
what is G.TIMERS.REAL for?
like If game speed is higher the update speed runs faster????
I have some things coded which use timers so I wanted to know
No, it ignores the game speed
consider that the update function is run once per frame, but that frequency tends to vary because the game runs at different framerates between systems and can even fluctuate mid-game
then consider that debugplus lets you use eval in the console to get the value of any variable in the game. like, for example, G.TIMERS.REAL. that way you can figure out exactly how that timer works and how to use it to track a consistent speed in your update function. like, for example, 1/60th of a second
Okay, what?
If I wanted to track the actual time passed then I just do dt/G.TIMERS.REAL?
you can use G.real_dt
So It's like dt/G.real_dt
no just G.real_dt
how would I do something whenever 10 seconds passes though for example
i'm trying to guide you to find the solution yourself. partly so that you can pick up on programming skills that are useful for balatro modding in general, and partly because i myself don't know what exactly G.TIMERS.REAL measures off the top of my head, and i have laundry to do so i don't want to boot up balatro and check at this moment
keep a sum of G.real_dt until it reaches 10
or save the starting time of G.TIMERS.REAL and check until the starting time + 10 is true
is there any way to have additional text for an object in only the infobox? i have an enhancement that adds additional chips when applied and it appears fine in the collection and on applied cards as in the 1st image but the infobox referencing it just has the first part
bump
so I would just do like
local outside_variable=0
local last_time = G.real_dt
update = function(self,dt)
outside_variable=outside_variable+(G.real_dt-last_time)
last_time=G.real_dt
if outside_variable >=10 then ...
end
Do I need to use SMODS.DrawStep for it?
no it can be in draw or update
Okay
like outside_variable=outside_variable+G.real_dt
i use drawstep because i share the sprite with multiple cards
yeah and when it reaches 10 you reset
thanks
I was adding with the dt from the update function before
so some stuff in my mod that uses timers are probably incorrect
in loc_vars return { key = card.fake_card and "m_modprefix_key_alt" or nil } and then have a localization entry with key m_modprefix_key_alt
can anyone tell why im getting this error lua AltTexture({ key = 'joker', set = 'Joker', path = 'Jokers.png', loc_txt = { name = 'jokers', } }) TexturePack({ key = 'joker', textures = {'jokers'}, loc_txt = { name = 'riffraff', text = {'A mod that replaces the joker textures with ones the size of the joker icons on the riff raff joker.'} } })
im useing malverk
you need your mod prefix when you add textures to the texturepack
so i.e. the AltTexture just has key = 'rrjokers', but when you're defining the TexturePack it needs to be textures = { 'modprefix_rrjokers' }
the modprefix is the prefix you decided on when you made the metadata for this mod
where in the code do i put that
when you're defining the TexturePack
thanks
is there a way to make it automatically applied
is there a way to remove the mod badge from a joker i made
set_badges
does anyone know of an online tool i can resize the balatro textures to 2x without anti aliasing
Idk of a online tool but u can use krita + nearest neighbor
If you use aseprite you can export > export as and then increase the size to 200% in the export menu
I FIGURED IT OUT
I FIGURED IT OUTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TOLD YALL IT WAS POSSIBLE
"3 blocked messages"
If you know, congrats. If you don't, you can probably figure it out.
I figured out a way to fix attempt to compare table with number
3 ignored messages for me
And this time It's with a ast parser
1 blocked message
--NEW MESSAGES--
2 blocked messages for me
Because discord
amazing
How do I increase the chances of Jokers from a specific mod appearing?
(Using SMODS.Voucher for this)
There's not really an easy way to change chances for specific cards yet
You only ignored him?
ok we don't need to keep talking about this
Thanks
But there IS a way, no?
yeah, reimplement the entire pool system. I have done it, I don't recommend it
just wait until smods adds a solution
Nevermind...
I'm working on a joker that's exclusive to a single deck, how can I make it unable to appear in the normal joker pool (packs, shops, etc.)
If they're jokers from your mod you can also give them a custom rarity
use in_pool function
ty
more specifically, just make the function always return false (you can still manually create the joker regardless of in_pool)
yeah the deck naturally starts with said joker so my main concern was it appearing outside of it. Thank you both 👍
how would i remove the mod badge from a spectral card i made entirely?
set_badges function
why does the game round up my xmult from 1.987 to 1.99 and can I change that?
what mods are u using
Im testing it with my own mod
The game by default will only allow up to two decimals on most numbers.
Trust me, I tried math.pi and it only spit out 3.14
is it somehow changeable?
I mean, in theory everything is changeable./
But I would not recommend you get into that.
i think the game actually uses the whole number
you would probably need to make them into strings to display it properly
marquee or no marquee
i hate marquee
i mean hey you can disable it for mod badges
How do I change the colors of my message from my joker? message = "Something"
you can use the colors listed in the Text Styling page on the wiki (the value, so e.g. "G.C.RED")
Or anything under G.C
what did I do wrong that only one message from that 2 is shown?
I'm stupid, I wrote colors instead of colours
a table can only have one field of the same name, in this case try having one be named xmult_message and the other chips_message
i think you need to remove remove_default_message if using these
so it kinda worked, but the xmult doesnt have a message now, its just the blank square
can i see the code
xmult_message = "X1.987",
-- remove_default_message = true,
xmult = card.ability.extra.fred,
chips_message = "+1987",
chips = card.ability.extra.chips
}```
oh yeah i forgot it takes a table
xmult_message = { message = "X1.987", colour = G.C.MULT }
it's also chip_message sorry
all good, it works now Thank u :D
and also, is there a way to implement a video before the joker starts scoring? like the video plays and goes away on its own after it finished
everything is possible with the magic of computers
but i couldn't tell you how to do it haha
https://www.love2d.org/wiki/Video:play maybe take a look at this
Is there a UI config for individual padding directions? I have padding = 0.05 but I want the left padding to be 0
i don't think so unfortunately
hmm. I might be able to embed this G.UIT.C inside another G.UIT.C where the outer one has full padding but the inner one doesn't
this is a goofy question to ask but is there any way, like on the screen, you can position a created card/joker on the screen
say if i wanted it to show up at the top of the screen and glide into the joker slots or smth like that lmao
ive been thinking about doing smth with love.draw but im not sure if that would be the Method
yes, there's a way to do this
you can put any card wherever you want on screen
if you put it on a random place and then area:emplace it in the correct area it will go fly there on its own
unless you mean something else
config.offset.x and config.offset.y, inside a UIBox with config.major = G.ROOM_ATTACH (I think)
this assumes you don't have a CardArea you're trying to leverage
if you have a CardArea, then use that (and I can't help here; my knowledge really only extends to how tags are drawn)
hmmm
-# i have very little experience with ui so i may have to look into that more 😭
smth like that could work, though my question would then be how to set up where it spawns to be where i'd want it before area:emplace does its work
would it be smth id add to like SMODS.add_card or should i use a different function
use local added_card = SMODS.create_card(...) because add_card emplaces it automatically
then I think you can do added_card.T.x = number and the same for y to put it somewhere on the screen and inside an event with a delay do G.jokers:emplace(added_card) (or whatever area it should be in)
if you want the card to just come from out the screen the easiest way is to use add_card and first place it in G.discard which is what vanilla does
what does this mean? can i trigger a deck on normal contexts like a joker
yes
ah ok, yeah i think i figured smth out with it
ty lol
is there a limit to deafult_weight on a rarity?
i put 100 for it to be extremely common, and i never saw it rerolling 30 times.
I tried to add a video but the game crashes everytime and says theres something wrong with the love.graphics.draw and I dont really know whats wrong with it. can somebody help?
Did you put it in the joker pool?
yes
Code?
SMODS.Rarity {
key = 'commoner',
loc_txt = {
name = 'Extremely Common',
},
badge_colour = G.C.UI.TEXT_INACTIVE,
default_weight = 10
}```
SMODS.Atlas {
key = 'debit',
path = 'momcard.png',
px = 71,
py = 95
}
SMODS.Joker {
key = 'debit',
loc_txt = {
name = "Debit Card",
text = {
'Go up to {C:red}-$0{} in debt'
}
},
atlas = 'debit',
pos = { x = 0, y = 0 },
rarity = 'silly_commoner',
cost = 1,
unlocked = true,
discovered = true,
pools = { ['SillyPool'] = true, ['AllSillyPool'] = true, },
}```
You didn't put it in the joker pool.
what joker pool 😭
You need pools = {Joker = true} in the rarity.
i havent had to do that with my other rarities
but they are both 0 and 0.01
i guess
anyway
so just like
key = 'commoner',
loc_txt = {
name = 'Extremely Common',
},
badge_colour = G.C.UI.TEXT_INACTIVE,
default_weight = 100,
pools = {Joker = true}
}```
Yes.
ight thanks
bump
You're overwriting 2 very important love functions.
so I need to do what..?
havent actually read what youre doing but you can hook functions instead of overwriting them
How can i fix this spriting problem on base tags as cards?
It works fine on modded tags but not base for some reason
local ref_to_original = love.something // store reference to the original function
function love.something(arg)
ref_to_original(arg) // the original function is left intact and runs as expected
do_what_you_want() // stuff you're tacking on top of it
end
Hey
, im new to modding and coding in general and i don't know what the tutorial video use for coding 😅
so wait what u mean with ref_to_original?
quick fun fact I dont really know what hooking is
No, you need to return the original function.
In LUA, it is a very important concept to understand that everything is a variable and all variables may be edited in runtime. This includes functions. With modding other peoples' LUA files, like Klei's basegame code, you may find yourself wanting to run your code before or after the original fun...
if you care what the orig function returned yeah sure
you dont really need to care about the specific editor they use
people will get into religious wars about them all it matters is that it can edit text
my real recommendation is to go in raw with plain old notepad, not having syntax highlighting builds character /j
thx ! and void too !
aside from that do you even have Freddy defined the error message is complaining that it's nil
N++ my beloved
i'm running with neovide for now (essentially just a GUI wrapper around neovim) but yea, i think if i weren't indoctrinated into vim as a preteen i'd be a big fan of N++
i also use it to write json for minecraft datapacks lol
fellow vim fan...
wait what u mean?
I'd rather send https://github.com/nh6574/VanillaRemade/wiki#whats-a-hook
it scratches my brain
I should really make a tutorial on how to mod explaining also the code and guiding people
return { remove = true }
end```
this should remove the card right? (when placed in the calculate function of an enhancement)
Hi! I'm on mac but I've tested and this bug also happened on pc. Whenever I go into the stakes menu, the game crashes. I asked on the paperback server but they told me the bug comes from bunco. Is there a way to fix it?
(we did not say the bug comes from bunco for sure, and in fact during testing the game still crashed with bunco turned off)
alright sorry for bothering you
if i may ask, what does modify internal value do?
like does it increases all values of a joker like increasing its mult or osmething
-# i am not smart enough to understand what i'd need to do in that context...
me neither
it would be easier if you coud call the evaluate hand function inside it haha
I'm now messing with SMODS.score_card, but it either crashes or does nothing (as per usual)
can you give me the code you have now so i can test
SMODS.Back {
key = "necromancy",
loc_txt = {
name = "Necromancy Deck",
text = {
"Immutable 1/4 chance to Ressurect",
"a previously destroyed card"
}
},
pos = { x = 0, y = 0 },
--[[ config = {
extra = {
destroyed_cards = {},
selected_card = nil
}
}, ]]
calculate = function(self, card, context)
if context.before then
local CArd = G.hand.cards[1]
G.play:emplace(CArd)
G.hand:remove_card(CArd)
SMODS.score_card(CArd, context)
return {add_to_hand = true}
end
if context.modify_scoring_hand and context.other_card == G.play.cards[1] then
return {add_to_hand = true}
end
end
}
-# it being a deck just makes this harder, doesn't it
also the description is what's planned, but that's the easy part n rn im just trying to get the add to hand and score part to work
could you elaborate or provide an example of this? i'm not sure how to use sort_id and it's only ever referenced once in the SMODS github
SMODS.score_card calculates the deck.
oohh
Any help and reason as to why this doesn't work?? Trying to add a Poker Hand and I just do not understand how it works because I keep getting this error...
You're telling SMODS to not add your mod prefix.
even if i do tell it to, i still get the same error ._.
i have poker hands that do this same thing and they work just fine
(and also, i don't think it should affect SMODS not being able to find it, since prefix_config is an optional parameter...)
just to show
"btti" is the mod prefix 🥲
...ok so. quite the embarrassing mistake. i was trying to check the Run Info on a saved run that didn't have that hand prior...
in context.modify_scoring_hand you want to change the context.scoring_hand directly im p sure 🤔
not the prettiest but it does what you want
your code seems to uh re-evaluate the poker hand too?
yes
i dont think its necessary since thats already done 🤔
when
Anybody happen to know of any mods that have a text-entry config option?
in G.FUNCS.evaluate_play, it runs the evaluate poker hand function with the hand that includes the new card already
since context.press_play adds to G.play before that
i thought the problem was that they didnt want to include the new card
only count it for scoring
oh yeah
my code reevaluates the poker hand without that card
mm i kinda just patched a context after the evaluate poker hand function to add to the scoring hand without counting it lol
maybe adding it directly to the scoring hand in context before also works
yeah the animation is above there
calculate = function(self, card, context)
if context.before then
local CArd
for _, pcard in ipairs(G.hand.cards) do
if not pcard.highlighted then
CArd = pcard
break
end
end
if CArd then
G.play:emplace(CArd)
G.hand:remove_card(CArd)
table.insert(context.scoring_hand, CArd)
end
end
end
the animation of my other method was also kinda wrong
what if i call highlight_card
that works for the highlight yay
highlight_card(CArd, (#context.scoring_hand+1-0.999)/5,'up') should work?
the problem is that the text is still below but that was true of my other method
:3 wat text
That looks interesting
maybe its because of how cards are added to scoring hand is kinda different?
not sure
What's it supposed to do?
adds another card to the scoring hand without changing the poker hand
Oh fire
like splash?
so even if you select 5 you can get 6
mhm
i have an effect that does that too, but it doesnt have the message at the bottom so thats weird
How can i fix this spriting problem on base tags as cards? It works fine on modded tags but not base for some reason
-# what am i even looking at-
seems like a position issue idk
it works well enough for my needs, ill start working on the easier part of it, ty both sm!
It only seems to happen for vanilla tags and it's off by a pixel or two per x/y index
the <100% potency one has it so the added card has to be a part of the scoring hand for it to count too
the >=100% potency one has the added cards always scored
mmm
maybe you could check if its a vanilla atlas specifically and change the position idk :p
cant help but notice that the shadow is wrong too actually
lol
it might actually be the draw_card part :p
but what im kinda confused about is my code shouldnt touch the draw_card but it works normally
weird
imagine its somehow more convoluted on newer versions 😭
well enough is not good for me
calculate = function(self, back, context)
if context.press_play then
back.in_scoring = true
end
if context.evaluate_poker_hand and back.in_scoring and not back.necromanced then
local CArd = G.hand.cards[1]
if CArd then
back.necromanced = true
CArd.necromanced = true
G.hand:remove_card(CArd)
G.play:emplace(CArd)
table.insert(context.scoring_hand, CArd)
end
end
if context.modify_scoring_hand and context.in_scoring and context.other_card.necromanced then
context.other_card.necromanced = nil
return { add_to_hand = true }
end
if context.after then
back.in_scoring = nil
back.necromanced = nil
end
end
evaluate_poker_hand should have an in_scoring value
🤔 what does the in_scoring part do
evaluate_poker_hand is called every time you select a card
it's also called twice when playing a hand
one for debuff the other for actual scoring
oh lol
anyone know how i could make an effect trigger when adding/removing a seal
such as giving +1 hand size when the seal is added and -1 when it's removed
i'm asking because on the docs seals don't have add_to_deck, remove_from_deck, or apply as methods
oh CArd = G.hand.cards[1] is probably wrong here iforgot
Hook Card:set_seal()
but you want to change it anyway so it doesnt matter
i dont know why it's 1 in 1
what smtcom said, and something to check whenever the card is destroyed too i think?
why dont seals have things like apply, remove now that i think about it
🤔
is this a pr worthy opportunity chat
yea i'm just making a list of cards destroyed that run and picking randomly from it for the card- wait i just realized why the random part wasnt working
idk if it works when the seal is removed but i would wait a couple of days for the next smods version that is adding a card_limit config to seals
what would adding card_limit entail
oh well thats a somethingcom thing then
i feel like that shouldve been clarified in the question tho haha
fair
i think this should be all?
should i just scrap this idea or smth? First that part was hard and now the grabbing a random card that was destroyed this run part is fucking up. Ill still use this code for smth else, probably a joker
1/4th chance to "resurrect" a random card that was destroyed this run
-# (resurrecting being creating that destroyed card and doing the scoring thing on it)
You would have to hook Card:remove() and save important properties of the card to a G.GAME variable.
the difficult part would be modded modifiers though ngl
how/where would i put this in order to use it? i'm running on empty so head's foggy atm
checking for enhancements, editions and seals is easy enough, but you cant really account for modded modifications unless you add them on your end
oh uh i kinda planned this to be a smods pr, but just put it anywhere lol
that should theroetically add apply(self, card), and remove(self, card) to SMODS.Seal
I'm too dumb for that x3
you can just do self:remove
wait no i misread lol
its 1 am i should sleep
Tomorrow I'll add what somethingcom suggested and do some more messing around then call it there because I am not asking for more help with this
(I already feel bad asking this much help)
go to sleep N'
i was wordleing
the word was hard
not actually the word hard because thats 4 letters
wordle was a bit of a doozy today
Ooooooooohhhhhhh I had an idea, what if instead of recreating a card exactly, it took a random thing from the destroyed ranks, suits, enhancements, editions, and seals and then created a card with all of them
doesn't seem to work unless i implemented it wrong
delta?
i 1:1 recreated the code into my hooks.lua file, which i know is properly loaded, and wrote the seal out as so
oh wait
fuck
i'm tired
doesnt seem like its an issue with the hooks lol
i wrote h_size not hand_size
lmao
for my purposes this works because you can only ever manually apply these seals
but for inclusion in smods yeah
oh i see
yeah that should be fine, but if the card with the seal appears in shop or booster packs rn then the effect will still apply lol
whats the code that adds the playing cards at the start of run? i figured it out
Dont get me wrong but like...
Isnt this just what applying negative to a card does??
got permission to port someone's card skins to SMOD DeckSkin, and it's.... not showing up??? the files are there, but the cards are designless???
does anyone know what i did wrong
i want all the card skins to be usable in one big mod
Check the size
Make sure the correct pixels are in the correct places
X1 is 71 to smth while X2 is 142
Good morning
Does anyone know how can i display cards in config page / other page
oh i was pixel off hold on
It’s probably not a pixel size issue if it was you would’ve gotten the same result just one pixel off
Yes but it won’t display a white canvas
Shrug
How’s the teto mod doing btw
not much progress has been made mainly just seu pai working on talisman 2.0 and me figuring out ui and shader stuff
okay all the card sizes are the same it's still busted
I can give you a template
Don't yiu need to make all the suits in one image
Not really
You can work around it
for the card images or the lua script?
Both
because the card layout i used worked on a single card suit mod
but this is adding
3 x 
1 x 
2 x 
3 x 
- all their high contrast versions
This one adds x3 of all suits and their high contrast
oh that'd work
It also has only face cards
You can change the assets and stuff
Credits to aikoyori
Good luck
how do i apply a shader to a deck?
Back ?
ya
cheers :3

can i classify this as DevQoL?
No it’s not even out lol
oh that explain the lack of description
V0.1
How can I make another booster pack slot appear in the shop within a custom deck? I know it's possible but I have no clue how to implement it
Oh 😭
Balatro modder reads (challenge)
It’s a global table i think you need to increment the size by 1 but i forgot
God forbid you read as a modder
how do i do animated jokers
crossmod with Aura, mainly
you could implement your own system, like what Phanta does, but it's better to just use Aura
-# unless you need something more complicated
so basically make aura a dependency
maybe not a dependency
just a frame by frame animation
you could make them non-animated if it's not installed
ah yeah that's definitely doable with Aura
SMODS.change_booster_limit(1) seemed to work :)
They literally stated it step by step
Copy the inside and tweak it
local other_dt = 0
function Game:update(dt)
local g = oldgameupdate(self, dt)
if G.P_CENTERS.j_modprefix_key then
other_dt = other_dt + dt
if other_dt > 0.2 then
other_dt = other_dt - 0.2
local center = G.P_CENTERS.j_modprefix_key
if center.pos.x == 5 and center.pos.y == 3 then --Last frame of animation
center.pos.x = 0
center.pos.y = 0
elseif center.pos.x < 5 then --If it isnt the right most image
center.pos.x = center.pos.x + 1
elseif center.pos.y < 3 then --If it isnt the bottom most image
center.pos.x = 0
center.pos.y = center.pos.y + 1
end
for i, v in ipairs(G.I.CARD) do
v.children.center:set_sprite_pos(center.pos)
end
end
end
return g
end
At this point you should ask a dev to make your mod, you're getting every answer spoonfed to you without trying to learn anything
No but like you havent seen their past messages
and you haven't seen mine :)
That wasnt directed to you?
i uh.. figured it out before seeing that message.
aware
also honestly, valid criticism
sorry for being a little bit dumb and way too reliant on others
it's fine by me, don't worry
i'm assuming you're just starting modding balatro
-# if not, sorry for the assumption 😭
this is my very first mod, and im committing the crime of being too ambitious
still
i should've taken the initiative to learn
but instead i fumbled with jokerforge and code editing like a fucking dumbass
How would one draw a joker on a card, but it's the size of a seal, and in the position of a seal?
bahhh you're fine ^^;
Everything on everything tomorrow⁉️
seal jokers when
honestly, yeah. im gonna do that
4 months ago.
the game crashes when trying to display Retired Deck — something about indexing a nil value, in sprite.lua
what did i do wrong this time :3
oh sick!!!!
@long sun sdm was right
im not cut out for this
i cant even get a joker to animate

Try harder
Lumi took a look at the code and gave up
my advice is, if something crashes, the crash log is very important
looking through how aura does it
so far i still hate people who put all their code in one single .lua file
I think you better follow bepis’s instructions
This should work now: #💻・modding-dev message
(bump though 😭)
Is this for a deck?
yup
SMODS.Decks???
wait i
Can you send the crash log
Wait, it should be SMODS.Back. I think.
-# the deck with that removed
Yes
SMODS.DrawStep is for like animations or something like that
Oh thank God I was right...
Sorry i’m on phone
allg!
Is the shader key e_phanta_drilled_consistent?
engine/sprite.lua:106: attempt to index a nil value
OH WHOOPS YEAH dkjfngkjdfngjkfd
sobbbbbb
it's not an edition
lemme try it without the e_ ^u^
sobsobsob

???? it's now saying it doesn't exist
the game really doesn't want me to do this particular thing :333
Try removing the mod prefix.
i figured out how to use bepis,,,
how do i make a pool that lists like, all food jokers ?
Just make a table with all the keys
doesn't SMODS have a feature for Food Jokers now?
Yes but what about custom ones
CODE IS HARD
hey dude, stop self-depricating yourself 😭

Remove the 'e_' from your draw shader call
Are you loading the shader file before the drawstep ?
done that already
Are you sure theres no typo
i'm assuming the key is correct, as i get a special error if it's phanta_drilled or phanta_drilled_consistent


