#đ»ă»modding-dev
1 messages · Page 152 of 1
whether the effect is being copied
?
to disable effects like scaling on them
ok
you can look at red card
Yes, i'm aware
I'm saying you could use parts of that code to give the mult to a different card by making it not target itself
probably
how sure are you about this
I'm not, I'm simply making an educated guess that if you target a different card it'll add the mult
Or it'll crash and let you know that a function doesn't work
I see no reason why it shouldn't, considering you can apply enhancements to jokers through code
how can i disable certain consumables from spawning in a booster pack?
depends whether you're the one who's implementing the booster pack
yeah its a booster pack in my mod
okay make your create_card function not return those certain consumables
so how would i do that do i need to list out every consumable i want in there or can i directly tell it not to spawn some?
create_card = function(self, card)
return create_card("LTMConsumableType", G.pack_cards, nil, nil, true, true, nil, "fn_LTMConsumableType")
theres like 20 consumables in this category 2 of which will either not function or will crash the game if you attempt to use them in a pack
What's the context check for hearts cards?
context.scoring_card:is_suit("Hearts")
Thanks
local disabled = {
c_myprefix_mycons = true,
c_myprefix_mycons2 = true
}
local i = 0
local card
repeat
i = i + 1 --so we break out if we run into an infinite loop where we're only generating disabled cards
card = THAT REALLY LONG CREATE_CARD THAT IM NOT TYPING OUT
until not disabled[card.config.center.key] or i > 100 or card:remove() --last bit just cleans up the card
return card
fyi this is not the best way to do it
but this is A way
well alot of my terrible mod is coded in probably the worst ways lol
the downside is that it'll generate those consumeables if you already have every other consumeable
or if you get like really really unlucky
0.05^100 levels of not lucky
well with like 20 different consumables they shouldn't have EVERY consumable right?
surely
if they do remember it's their fault
Currently this Joker works as coded, but how can I change it to give scored cards +1 Mult
I tried setting other_card.ability.mult but that doesn't do anything
help why are they doing that (ok figured it out, i should be doing skip_materialize for booster cards i suppose?)
whats wrong here?
context.other_card can be nil
there is no other_card when you exit shop, joker_main, etc etc
can't tell if this card i made is too annoying or very good
i was testing with all of the other consumables (the consumables did spawn after like 3 goes of that) but how did jimbo spawn lmao
(but yeah thanks as long as they dont have every consumable we chilling lol)
Oh, so it's like a playable death
very neat actually
Only part of it, it doesn't copy enhancements, edition, seal... But that might be useful if the enhanced card has the wrong base
Figured it wouldn't be as strong as DNA if it's uncommon
still decent for deck fixing
Oh, I have not thought deeply about the rarity level
means you can buy standard packs for enhanced cards
Right, any enhanced card becomes interesting...
if you set a default on your ConsumableType it won't do that
it'll generate a specific card instead
the working is a little confusing for my weak little brain
mainly the storing part
if it's copying the right onto the left then shouldn't that be switched to fit with death? left -> right
otherwise very cool idea
me like
That's what it does
Right card values into Left card
it's just worded differently
Here's a potentially weird one. I'm trying to retrigger jokers (or more ideally, any card) that contributes Xmult to scoring. I currently have it set to trigger with context.retrigger_joker_check which kinda works, but has the side effect of retriggering on events that do not contribute to the score (i.e. banana extinction checks). Is there any way I can directly check what a card is contributing?
context.other_ret
Oh shit that exists?
clearly aure is lying to you
you gotta think about who writes the wiki
this conspiracy is like an onion, it's aure all the way down
Shit you're right
my onions become tomatoes halfway through
I definitely don't feel like I'm doing something right with this
I think the joker return would be in context.other_ret.jokers
retrigger check context isn't on the wiki 
It's not, someone in here told me about it lol
chat,
hey guys this might be a dumb question but where would i find all the contexts
ctrl+shift+f "SMODS.calculate_context"
uhhh what
how can i create a texture pack with smods?
sorry that I keep posting it- hold on lemme try again
got it, I forgot it's three
most of them are in https://github.com/Steamodded/smods/wiki/calculate_functions
ty
Hey gang, (sorry that I posted this three times now) but I think I screwed up on the logic here, does anyone know how to fix it?
key = 'j_sniffles',
loc_txt = {
name = 'Sniffles',
text = {
'Sniffles gains {C:chips}+#1#{} Chips',
'At the end of each round',
'{C:inactive}(Currently {C:chips}+#2#{C:inactive} Chips)',
},
},
atlas = 'Jokers',
rarity = 3,
cost = 3,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
pos = {x = 1, y = 0},
config = { extra = { bonus = 21, chips_gain = 21 } },
loc_vars = function(self,info_queue,card)
return { vars = { card.ability.extra.bonus, card.ability.extra.chips_gain }}
end,
calculate = function(self, card, context)
if context.end_of_round and context.individual then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
return {
chips = card.ability.extra.chips
}
end
end
}```
@frosty dock so for disabling boss blinds do u use add_to_deck or calculation
For the function of disabling blinds?
calculation, add_to_deck only happens once when you get the joker
Trying make a card similar to luchador but instead of selling just needs to be in joker slot
Ok
That makes more sense
So... chicot?
Well I have shit luck and barely get good joker cards

I think I've only ever gotten blueprint once
damn
that's usually a run winner yea, it's So Good
Believe it's how I got the 100,000,000 achievement

Might have to move pot of greed out of the deck and into the tarot area
Crashes the game if u check the deck status
While it's in ur deck
@frosty dock sorry for the ping but i need to ask since you told me to unnest my events
is there a way to make card: effects not block eachother? it seems like theyre the only thing that doesnt work when events are placed one above the other instead of being nested
like, the events work and are called in the correct order at the correct time, but specifically anything that starts with card: doesnt work until the very last event is called
unlike other things I don't know the event manager inside out so I can't tell you off the top of my head
where in the world is this calculate function written
on your SMODS.Edition object
but what about vanilla editions
bettercalc means i can finally have stamps that calculate
thats fine, thank you for all the help youve given me thus far!
I'll have a closer look when I get the chance
Ok here's the primo spaghetti I'm tryna get working. Rn it only gets jokers but no playing cards or effects. I genuinely don't know if I'm looking for the right things in the ret table lmao
is there any way i can access a card's description for a joker's abilities?
What are you trying to do?
Retrigger all Xmult effects
Playing cards donât use other_ret iirc
I wish that was documented lol
im new to lua coming from C#, trying to access the word count of joker descriptions for a joker idea a friend of mine had
I wish people could read docs lol
i feel stupid for asking, but where are the docs located?
I asked this question earlier but didn't receive an answer. Is there a way to permanently apply mult to a playing card the way Hiker gives chips?
in my defense it really looks like it would in common_events
No it doesnât
eval_card doesnât really have anything to do with contexts
It just gathers all the effects from whatever itâs been asked to do
Either way, youâll need a separate check for repeating the playing cards
I figured
found em
guys, how i can make a texture pack for all jokers with steammodded?
so is there no way to do this
perma_bonus is strictly chips. If you wanna do this with mult, it is possible, but you'd have to create an entirely new variable within the card object initialization and then apply that variable to card calculation to do so
how?
lovely patches
#1331462654732144721 message hee hee hoo hoo AMM has perma mult/xmult/hmult/hxmult
anyway off i go back to watch shadows on cave walls
My mod also does this perma mult tee hee
I know that @tepid crow is building it into smods
but I'm unsure on where he is in the process
no
I'll see if I can make it gain +mult when the card is scored, then give the +mult before any joker triggers
which is essentially the same thing but without the need for lovely
lovely only helps with making the ui code a bit cleaner
If/when it gets implented I'll update it
now give it the banana sticker from cryptid
unfortunately someone wrote conflicts = ['Talisman'] in my mod and now it works correctly when i play it
dang
âSomeoneâ 
Wait G.vouchers.cards is a thing???
it is now
This is cool
Oh shiiiiit imma have to look into voucher calc for my Dark Room card
Now I don't have to use some random until to count vouchers
vouchers are almost real cards now
Does anyone happen to know if voucher calc somehow connects base vouchers and their upgrades?
Like some sort of .upgraded variable or smthn
i believe you can access that from card.config.center
Ah shit seems like FlowerPot uses my util
what i should put in mod code so these textures will replace original ones?
I donât think vanilla voucher code holds smthn like that? At least I donât think so off the top of my head
no like
I canât check cuz bed lol
since you have an instance of the voucher card
you can access its center, and that info should be there
like uhhhh card.config.center.requires[1] should do it
just make sure requires exists first
Ah ok
then compare the key
Thatâll be way better than how Iâm currently checking lmao
technically it's not much better than just checking in G.P_CENTERS[tier2voucher].requires[1] == tier1voucher
I may or may not have some horrendous hardcoding that checks for specific names rn 
being able to just arbitrarily access G.P_CENTERS[thing] is something people take for granted
Yeah I should really do that more often
also i love when i implement something and it works first try (actual, real)
Pure crack
fake
no ur fake
fuck..
It wasnât first try but I got this rolling now too. Ideally it retriggers all Xmult effects but Iâm happy with it just doing jokers for the time being
chat rate my terrible legendary art
This dude is content with being blind
i think he has plenty of eyes, actually.
Oh I thought that was a blindfold đ
big honeycomb
haha, yeah a bit lol
Also if I were to make a criticism, there is very little contrast between the soul and the card, maybe make the card a bit brighter in color?
hm
also me when im a mod dev and i can be completely insufferable and nobody can stop me
Interesting retrigger condition
Especially interesting having it retrigger itself
this feels like an easy x64 but i guess it's legendary so it's w/e if it says "you win"
anyone know if you can hide the stake stickers in the collection screen somehow
it depends on how many vouchers you can afford, but yeah if you have solid econ it's pretty cracked.
probably gonna lower the scaling factor lol
I have a similar joker and made the boost x0.5 per voucher, x1 might scale very fast
Dumb question if I change the pixel size in the smod.atlas for a sprite shit
Could I technically make a wider joker card?
Think so yea
Or is there like a legit limit
Usually people use set_ability for that
just do it and see what happens
Was gonna make a card in the Yu-Gi-Oh card mod if I get an idea a defense position card lol
I'mma try it see what happens
Itâll try and rescale it
Ok I give up, I have No Idea how to make this joker gain +21 Chips at the end of the round and also actually score some chips
I tried for like. 4 hours now
Remove the last return below
Try replacing chips in return by chip_mod
iiiiit still didn't add to the chip plus it didn't score anything
Testing it on my side to see what's wrong, will let you know what's up
got it
can I dm you actually?
looks like it works here
are you on a recent enough version of steamodded to have bettercalc?
Yea works on my side too
if not it might be that context.end_of_round may not be getting the cardarea
ohhhhhhh
yeah hold on lemme see
....actually do you know where the latest version is?
https://github.com/Steamodded/smods always available right here
aight let's see if this works
Ok the messege bit works!
but it doesn't score the +21 Chips
like it adds up, it has the graphic that says it adds up by +21 chips
but it doesn't actually score the +21 chips
it'll only score them the 2nd time round
Iiii don't think it scores them at all
show code
key = 'j_sniffles',
loc_txt = {
name = 'Sniffles',
text = {
'Sniffles gains {C:chips}+#1#{} Chips',
'at the end of each round.',
'{C:inactive}(Currently {C:chips}+#2#{C:inactive} Chips)',
},
},
atlas = 'Jokers',
rarity = 3,
cost = 3,
unlocked = true,
discovered = true,
blueprint_compat = true,
eternal_compat = true,
perishable_compat = true,
pos = {x = 1, y = 0},
config = { extra = { chips = 0, chips_gain = 21 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.chips_gain, card.ability.extra.chips } }
end,
calculate = function(self, card, context)
if context.end_of_round and context.cardarea == G.jokers then
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chips_gain
end
if context.joker_main then
local chips_to_add = card.ability.extra.chips
return {
chips_mod = chips_to_add,
message = " + " .. chips_to_add .. " Chips",
colour = G.C.CHIPS
}
end
end,
}```
the final return just needs to be lua return { chips = card.ability.extra.chips }
Message isn't mandatory anymore?
no
Neat
it'll do it for you
aight let's see
It works!
thank you so much y'all for being patient with me, I'm new to modding and coding ^^;
Yea you'll get better the more you code
what variable do i need to change to make the shops have 1 more voucher / booster?
thanks
actually wait
under which file is this?
that one is under Card
all the vouchers seem to be there
thank you very much
thats not for vouchers and boosters
yeah was about to say,t hat's only for the cards
boosters and vouchers requires patching the functions that creates them yourself
oh okay thanks
how do you guys test vouchers, i mean how do you cheat them in without having to play until you find it?
debugplus mod
thank you
Alternatively you could just set the spawn chance to like 999
And it'll take priority over all others most the time
Oops
this is how you score Infinity in omeganum
screw scoring chips, we scoring tables now 
(âŻÂ°âĄÂ°)âŻïž” â»ââ»
did they change how loc_vars's key thing works
also this is literally referencing nothing
show code?
where can i find the documentation or game code for all the G. variables
In the source code, inside the game.lua file
thanks
loc_vars = function(self, info_queue, center)
return {
vars = {},
key = 'hook_pure'
}
end,```
probably just bad code
wait
nvm its just bad code sorry lol
if i made a voucher how do i determine its v_ name
i see people use v_[voucher name] often in code when refering to a voucher but i never see the voucher named anything v
it's v_modprefix_voucherkey
and modprefix is the one i chose in the json file right?
Yes
is there a way to check the game code after injecting so i can verify that i did it correctly?
or can i just open the file?
Can SMODS.Enhancements not send a message?
SMODS.Enhancement {
key = "fire",
loc_txt = {
name = "Fire",
text = {
"Gives {C:mult}+#1#{} mult",
"Increases by {C:gold}#2#{} every time",
"this card is played"
},
},
config = {mult = 4, increase = 1},
loc_vars = function(self, info_queue, card)
return {vars = {card.ability.mult + 1, card.ability.increase}}
end,
calculate = function(self, card, context)
if context.cardarea == G.play then
card.ability.mult = card.ability.mult + 1
return {
message = "Upgrade!",
colour = G.C.GOLD
}
end
end
}
It properly increases, but it doesn't say "Upgrade!"
Daily reminder for everyone on mac who wants to try the Balatro Mod Manager (plz guys I need funding for publishing this on macOS):
https://discord.com/channels/1116389027176787968/1332136408923639910
`[[patches]]
[patches.pattern]
target = 'button_callbacks.lua'
pattern = 'asdawdsawd'
position ='after'
match_indent = true
payload = '''
sendDebugMessage("Vani", "MyDebugLogger")
if G.GAME.used_vouchers["v_janm_rerollboosters"] then
sendDebugMessage("Nutra", "MyDebugLogger")
for i = #G.shop_booster.cards,1, -1 do
local c = G.shop_booster:remove_card(G.shop_booster.cards[i])
c:remove()
c = nil
end
for i = 1, G.GAME.shop.booster_max do
G.GAME.current_round.used_packs[i] = get_pack('shop_pack').key
local card = Card(G.shop_booster.T.x + G.shop_booster.T.w/2,
G.shop_booster.T.y, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS[G.GAME.current_round.used_packs[i]], {bypass_discovery_center = true, bypass_discovery_ui = true})
create_shop_card_ui(card, 'Booster', G.shop_booster)
card.ability.booster_pos = i
card:start_materialize()
G.shop_booster:emplace(card)
end
end
'''`
haven't heard u talk about windows release at all, what's the word about that
when i use this in lovely injector it doesnt get recognizeed
the pattern is obviously asdwadsaw so it wont get found
probably because "asdawdaswd" doesn't exist in that file
yes
but the console doesnt show that the pattern wasnt found
i wrote that just to check if maybe my original patter was wrong
usually when the pattern doesnt exist it says so in console
the target file is also wrong
is it a functions/
oh my god
I am currently renewing my room and am very busy. But the current problem about windows (and linux) is that lovely is being used more different, so I have to adjust the codebase for those. Also the paths work more differently than macOS. But other than that, there should not be many issues implementing windows functionality, so dw I am working on it right now as we chat
thanks
Does anyone know how I can call this event after the hand has finished, but before all the cards go back to the deck (similar to glass cards)
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.5,
func = function()
if pseudorandom("kaboomers_fire_destroy", 1, 8) == 1 then
card:start_dissolve(nil, true)
end
return true
end
}))
okay take my money 
What in the world-
the card destroying stage
context.cardarea = G.jokers and context.remove_playing_cards
Its not in a joker, its for an enhancement
I've been noticing the lack of some context items for that, with that being one of them
im aware
you can just check for this context
just change the area
Through all stages of the card playing, it is nil
then you're checking for it wrong
Basically the exact same code
or you're not using better calc smods
I am using old-calc
that might be why
why would you use old calc
I don't even remember to be honest
the whole point of better calc was to unify calculation so every item gets the same contexts
Wouldn't that require a seperate version of steamodded, or has it been merged with main
its been in main for 3 weeks now
Alright
Even after updating, it's still saying the context item is nil
These are the only boolean values that a simple loop through could find
have you destroyed any playing cards?
Is that a seperate method
remove_playing_cards only happens if cards are being removed
wouldn't this be an enhancement?
actually destroying a card would be context.destroy_card, but I'm not sure either of these are sent to playing cards
you can do it in discard too
glass cards are kinda hardcoded rn, we could at least expand that into a destroy_self check
you can destroy yourself
Whats the method to destroy a card, and when does it get called
ortalab's sand cards do
games haunted
if context.destroying_card then
return {
remove = true
}
end
then maybe I'm confused, I didn't actually try unhardcoding the glass card check
with a boss blind how does one access the array of played cards?
G.hand.cards is not it
Attempting this just never destroys anything
G.hand.highlighted?
nevermind I just got extremely unlucky on a 1 in 2
If it's during scoring, they've been removed from G.hand
it's G.play.cards at that point
was the one hour of making this worth it
ahhhh
hell yes
note that the bar at the top of the planet card is supposed to highlight which planet it is
in my case i've switched solar systems
isnt that an astroid belt thats between the small planets and the big ones?
am i blind đ
psyche is an asteroid
well yea!
just highlight one asteroid tho
not all of em
new planets or texture pack?
Opinions on this Joker?
Why would anyone take that? Is it meant to be a super late-game joker?
It's that bad? hmm
how would i set this badge with planet? on it to something like... asteroid
or really how would i set any badge to anything custom
woah i foun localisation that does something
maybe i could use this
this is as close as i'll get to asteroid đ
Its price is low, 4 dollars
It lets you repeat the starting hand or if its not a good hand you can sell the joker
That use case relies so heavily on luck that I can only see it being used when you already have a thinned out deck and an extra joker slot for some reason
should I lower its price more?
How.....do I make a joker apply a holographic edition to a card?
yeah I tried doing that
it just destroys it after doing that
like the card is destroyed?
you can use set_card_type_badge to replace the badge with any kind of badge
like its not there anymore in the deck
yeah
if i set that localize value to anything else it doesnt work
localization strings aren't set in stone, you can add your own
or just put a string instead of a localize call, it's just not localizable in that case
Looks a bit wonky đ
how would i get them to not go blank like that until they were stoned?
clever concept!!!
add the mult highlighting around the "+4", als the reason its nil is most likely nothing returned in loc_vars
Got to do some clever tricks with card attributes
mhm?
actually where do you look for the code for how it works? I assume it's the cards.lua file?
woohoo
so just copy that?
and im just making sure, this is copied where i had my set_ability set up in the first place, right?
I donât know where you had it before
i meant this line
ok
that or game.lua
i just ctrl+f for card names
and its usually there
wait what's zodiac for
Thatâs just where Iâve done a similar effect
I've got an idea for a buff, what if cards that get blocked twice gain a random enhancement? That would be 2 effects then I guess
Yeah not to hot on that idea
I mean at the moment this joker effectively reads âyour deck has 8 cardsâ
How could I buff it?
I donât see a situation you would ever want this card unless youâve already fixed your deck massively
Ok I'm kinda lost now
What are you trying to do?
Trying to make scored pair cards turn holographic
That sounds fair enough, if I let discard I feel it would be too strong, would only a rework make it viable?
if context.before and context.scoring_name == âPairâ then
for _, card in pairs(context.poker_hands[âPairâ][1]) do
card:set_edition(âe_holoâ)
end
end
It would need an upside
if i'm trying to debuff a specific rank with a boss blind how should i go about that?
tried SMODS.set_debuff(card) in recalc_debuff but this doesnt work for some reason
ohhhh it's card:set_edition
thank you thank you
https://github.com/Bazinga9000/MathBlinds/blob/main/blinds/witness.lua something like this maybe?
Might need an event too
ok it didn't work
yelled at me for Blind object bl_TWT_man has debuff_card function, recalc_debuff is preferred but recalc_debuff wont work no matter how much i try
thank you!
SMODS.set_debuff needs more arguments
Also can't you just return something in recalc_debuff?
Mmm maybe I can make them trigger twice
theres no documentation
i have no idea what is supposed to happen in here
i have just understood how it works
it would be very nice if like any of this was documented though
unrelated, is there a way to check if a card has been flipped?
card.facing == 'back' I think
Complaining about a function not having documentation when youâve been shown it does is certainly a choice
there's literally nothing more to it
this is the documentation
it doesnt really explain anything else, like what returning the bool does
sure you can figure it out with some poking but thats not the point of documentation?
its to explain that for you
what should it do other than indicating whether to debuff the card or not
anyway
If I need to write "Return true to debuff the card, return false to not debuff it" for you to understand that's a 98% issue
I wonder if there's a use for calculate-ifying blind functions đ€
pft mobile
I was considering that too
gonna be real whenever I need documentation for something I want to do I just look at the Cryptid mod source code
much easier than poking around smod source and figuring out what you're supposed to use
i usually do its just wacky sometimes
gotta be real i dont know about half the smods functions lol
that and Try and find things in the game source but its also wacky
This Joker gains +1 Mult when triggered```
How does this effect sound? If you can win the blind you might leave with around +10 mult
source code or die
"blocks"?
ngl I look at my own docs sometimes
This
I think lock is a better word than block
as in they're locked into the hand
or a better word idk if you told me a card is blocked I wouldn't have the faintest clue what it's doing
nvm it works now
softlock = true on a consumable flags it as not appearing until its poker hand has been discovered? or am i misreading
ah i probably have to do stuff with in_pool
not sure how to check if a poker hand's been discovered per run tho
if you put it in the config of a planet card then yes
tried it but wasnt working :(
did you do
config = { softlock = true }
-# i think thats how the thing goes
ohhh it goes in config
i just had it as a regular property
me when i fail to read the balatro source
@wintry solar i tried putting in the code you showed me and it didnt work
You need the bits outside the event too
Dumb question you think jinzo should block all blinds or just boss blinds?
I feel like all blinds fits the theme
now its not doing anything, and when i set instances of 'card' to 'context.other_card' it crashes
Well it definitely needs to be context.other_card, whatâs the crash?
...maybe i just remove the juice_up, bc thats where it crashes
one sec
even after removing that it crashes on the first mention of contextothercard
which is weird cus my if statement is set up right
oh yeah right before it crashed it also got rid of the rank like it previously did
Whatâs the main context check?
ok
this code closes my game without a crash message when i select a card, does anyone see the issue? is this loop just using too much memory or something?
if not card.debuff then
local other_joker = nil
for i = 1, #G.jokers.cards do
if G.jokers.cards[i] == card then other_joker = G.jokers.cards[i-1] end
end
if other_joker and other_joker ~= card then
--Get list of 7s
local sevens = {}
for k = 1, #G.hand.cards do
if G.hand.cards[k]:get_id() == 7 then table.insert(sevens, G.hand.cards[i]) end
end
end
end
end```
You need to check for a context
well its supposed to be a blueprint-like card, and blueprint doesnt check context since its supposed to trigger under whatever context the copied card does
is this just too much to run under that condition
at least check not context.no_blueprint then
there's an infinite loop with checking extra enhancements here
so context.check_enhancements and other potential future contexts need to be ignored
ahhhh ok, i figured there was a loop somewhere, didnt know no_blueprint was a context, thank you!
how should i go about changing a joker's sprite during runtime? is changing the pos value enough?
wow that is some beautiful code preview in game.lua
oh yeah the source code for the game has some... interesting parts to it
yep
i remember when i first delved into it and saw card.lua's way of setting up the ranks
beautiful stuff
anyways real quick
where is set_edition defined in vanilla code?
card.lua
its overridden by smods though
im trying to make a joker whose sprite changes for every card played to show that it's copying the joker on the left/right, switching back and forth
improvements
thats now very strong
its once per ante
does it gain per card or per action?
per action
oh okay then
how would i do this
thats fine
I'd probably hook it
can i have some help with this'
local se = Card.set_edition
function Card:set_edition(...)
-- do something before
se(self, ...)
-- do something after
end
note I don't remember the arguments and cba to look them up and I don't think it returns anything
it's edition, sileent, immediate iirc
so put that in my joker?
no outside the joker
I know it's probably possible but how would I like. make a Joker Upgrade whenever you """upgrade""" an Ace to a 2
my best guess is look for a strength card use on an ace
but if you want it to account for modded ways of upgrading cards you may need to patch in a new context
I see I see
oh one last thing, where can i find set_edition in the smods code?
so i know what to look for
pretty sure it's in overrides.lua
If context.using_consumeable took into account any modified card it would have saved you from the hassle đ
recently starting my balatro mod, whats the function to make a joker create a tarot card? i cant for the life of me figure it out
as well as wrapping my head around what exactly does "1 in 4 chance" type of functions
i cant rlly find either
im also working on it with a friend who did a bit of it but neither of us have gotten it to work
first suggestion is to look in source code for creating tarots
1 in 4 chance is G.game.probabilities/4 im pretty sure
whenever i look at the thing i cant figure out which thing denotes each number
like
odds is the larger number
but idk what determines the smaller one
trust me i have been
vagabond maybe?
or cartomancer?
i cant find it bc i dont 100% understand all of what im looking at quite yet
the numerator is G.GAME.probabilities.normal
which is 1 normally
but can be changed by dice
card.lua
and this should work, right?
whats the denominator
thats odds ?
se(self, edition, immediate, silent)
other than that, yes
ok thanks
mhm
you can also have something like a 2/5 chance, you'd just display the numerator as 2*G.GAME.probabilities.normal
in which game file is the code to add vouchers to the shop?
I'd either pass the edition or make sure it exists too, you can call set edition with no value to remove editions
so like if edition ~= nil then [context i added]?
or just if edition then ...
true
^
do we have a way to calculate how many times a card should be retriggered
like say i have a card in hand, and i want a joker to do something based on the amount of times that card in hand would be retriggered
i know SMODS.calculate_repetitions exists but i cant seem to make that work in a joker's calculate function without crashing the game
alright since im not getting an answer in normal chat (its moving too fast)
can aura replace an edition, or does it just do it if its editionless
aura cant be used on a card that already has an edition
i dont think any edition application effects in vanilla can override existing editions
like ectoplasm cant be used if all the jokers you have are already editioned
yeah
unfortunate cus i have this joker
and if you could you could keep stacking it
which would be funny
you cna always add your own edition generation
yeah i can
theres a joker i have that gives all stone cards foil
which is funny with this one in tow
you'll have to be careful btw, this'll trigger whenever a pack is opened with an edition too
or whenever you open your deck view
or the collection
in fact it might just crash when you open your collection on the main menu
mhm
ill look into it
does context exist in the main menu
cus if it doesnt i can check for context ~= nil
I hooked up code to trigger a calculation with a custom context whenever a Joker gets destroyed but I'm not 100% sure how to trigger the Joker animation and messages
Is it just calling card_eval_status_text?
guys in which file is the code for the vouchers getting spawned in shop i cant seem to find it
yeah it actually crashes bc i got a joker thats always negative and i checked it in the main menu
specifically the hook does
let me guess, jokers is nil or something like that?
just reasking bc i havent gotten an answer but what does key_append and forced_key do
is there a function to Count how many cards you have in your full deck like how cloud 9 does it?
is there a way to change the sprite of a joker when it gets triggered
Looking at Cryptid's Jimball joker implementation for reference it just seems to update the pos in the atlas
why is my context.end_of_round triggering 7 times đ
so that might work? I also wanted to have a joker change sprites
and context.main_eval
average bug report
Oops!
thanksksssss
All Sixes
me when i oopsed and then my game went wrong with something
can't really do the same with soulpos tho it seemsç
đ€ do I build in a delay option to set edition similar to delay sprites in set ability
the pos needs to updated on the sprite either way, not the center itself
wait no i got it working
so card.children.center for the main sprite or card.children.floating_sprite for the soul
is it possible to add repetitions during the repetition step without using return? in case i need to do it multiple times in the same function?
you can put multiple effects in one return table
for multiple retriggers, just put repetitions as how many
i.e. count the sevens first, then return
i guess so, just doesnt work with how i was hoping to do it visually
ok im back, what does this mean?
yah
I think you just need to check if the card is in G.playing_cards before calling the context
... how?
dont worry about mod #5 it literally does nothing
how'd i check for that?
the way it works currently has it juice up each 7 as its counted and to factor in retriggers on them
itll just be a lot less exciting if i have to just count them and do the counted retriggers all at once
i mean ill do it if thats what has to be done
whats wrong with that video?
i'm pretty sure that's still possible
you'd just have to do some stuff with func returns
am i doing something wrong with the atlas?
Stack Traceback
===============
(1) Lua local 'handler' at file 'main.lua:612'
Local variables:
msg = string: "engine/sprite.lua:36: attempt to index field 'atlas' (a nil value)"
(*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
(*temporary) = string: "Oops! The game crashed\
"
SMODS.Atlas({key = "showdown_banana", path = "Jokers/banana.png", px = 35, py = 43, atlas_table = "ANIMATION_ATLAS", frames = 8})
create_joker({ -- banana
name = 'banana',
atlas = "showdown_banana",
pos = { x = 0, y = 0 },
rarity = 'Uncommon', --cost = 4,
blueprint = true, perishable = true, eternal = true,
unlocked = false,
check_for_unlock = function(self, args)
if args.type == 'extinct' and args.name == 'Cavendish' then unlock_card(self) end
end,
calculate = function(self, card, context)
--
end
})
jokers pull their atlas from ASSET_ATLAS, not ANIMATION_ATLAS
i want to make an animated joker with its own atlas and the wiki says to put ANIMATION_ATLAS for that
yeah it doesn't work for that
maybe it's worth adding an api feature to smods that allows making any centers animated
thats one of the things on my endless list to figure out
Not a lot of animated modded Jokers out there... even I only have just the 1.
?
Does anyone know the difference between the 1x and 2x files
the ones in 2x are twice as large, export the 1x files at 2x size and put them in there
(its used for the pixel smoothing option)
Are the 1x files needed
Ah
So basically if I don't have pixel smoothing It will use the 1x?
Ah I see now
Ty
Im trying to make a texture pack for Vanilla + Cryptid, I've confirmed that the code works but I'm having an issue that its trying to grab the new sprites from Cryptid itself instead of my mod
Is there a way for it to go back to my mod's assets to get the correct sprite?
function SMODS.INIT.RazzJokers()
sendDebugMessage("Razz's Jokers Texture Pack: Now Loading!")
local RazzJokers = SMODS.findModByID("RazzJokers")
--- Vanilla Jokers
local sprite_jkr = SMODS.Sprite:new('Joker', RazzJokers.path, 'rz_jokers.png', 71, 95, 'asset_atli'):register();
--- Cryptid Jokers
if (SMODS.Mods["Cryptid"]).can_load then
sendDebugMessage("Razz's Jokers Texture Pack: Cryptid Discovered!")
SMODS.Atlas:take_ownership("cry_atlasepic", {
key = "atlasepic",
path = "rz_atlasepic.png",
px = 71,
py = 95,
}
):register()
end
Ive tried just adding my custom texture to the cryptid assets folder and it worked, Im just not sure how to go back to the correct directory (new to coding, searched around a lot but couldnt find anything like this)
how would i check for this?
see if the table contains the card that you're changing th eedition of
You may have to do some weird directory pathing for this with '../' to move up directories. It's the first I've seen someone try to do this too
well thats not right
I tried this at some point since thats what made sense to me but it kinda just tacks ../ to the directory, its weird :P
if (SMODS.Mods["Cryptid"]).can_load then
sendDebugMessage("Razz's Jokers Texture Pack: Cryptid Discovered!")
SMODS.Atlas:take_ownership("cry_atlasepic", {
key = "atlasepic",
path = "../rz_atlasepic.png",
px = 71,
py = 95,
}
):register()
end
Turning on debug mode in the files on my laptop but forgot how
Isnât it something in conf.lua or am I in the wrong place?
great for deck thinning lol
0.9.8 format spotted
Please Santa
Anyway uh
that doesn't quite seem like expected behavior, it should use the path of the mod taking ownership and not the original
why in the files? Just install DebugPkus
DebugPlus*
-# I am devolving into wilson

Nvm Iâm tweaking
everything's tweaking
alright what did i do wrong
what's Cardedition
good question
G.playing_cards may not exist the same way G.jokers or G.hand may not
can i just check if G.playing_cards or something
This is what I've been feeling also, im not really sure another way to go about it :V
also, just checking for in general knowledge
if you do an if statement on a variable, and it doesnt equal nil or false, it equals true alongside whatever value it actually is?
yeah that seems like a "wait for me to fix it"
like if i check for 'if variable' and variable = 'some string value' itll return true for the if statement?
any value is "truthy" except for nil and false
yes, that includes zero, empty strings and empty tables
truthy and falsy is such a weird but helpful concept imo
got it
indeed, at least if it's not implemented like JS

I have to learn JS in a few weeks wdym by this đ
JS is like a rock in my shoe, I can't seem to get rid of it while it annoys the hell out of me
just saw you can do stuff like this, will it actually do anything ooooor?
javascript is simple the outcome is whatever a toddler would predict it to be

shoutout cat
kibitty
Speaking of, I wanna make a voucher set that does observatory but for suit tarots
ooo cool
interesting
i like it
wait wait wait holy shit
love wins
we need a joker that gives mult corresponding to the estimated value of your computer
surely nobody will have a problem with grabbing all your hardware info and proceeding to make several https requests including that hardware info
Suuuuuuuuurely
you could do cpu temp
Making balatro pay to win, dont want to lose? Buy more storage!
so true
Im about to go out but I'll make an issue on the github later if it would help
long term storage
no need, it's on my radar
0.1 mult per free gigabyte of ram would be nothing đ
Hello! I am new to balatro modding and I was just wondering where in the files the actual look of an edition is applied, i.e. when a joker becomes foil, what is the function that makes the card look foil, I am hoping to use this function separately from actually applying an edition.
what if it's XMult and starts at 0
assets/shaders
thank ya
maybe..
Gain +0.25x mult per used gigabyte of storage
this joker gains 0.25x mult whenever a garbage collection cycle occurs
Make a text document for that extra mult rq
i wonder what would happen if you made all the G.I tables weak
how badly would that fuck shit up
does that even do anything
im not too sure how the specifics of garbage collection in lua work
Ctrl+A, Ctrl+C, right arrow, Ctrl+V, repeat
okay from my research it seems like the answer is nothing because anything global is a strong reference no matter what
nevermind im actually Wrong
it seems like for whatever reason, func doesnt run if the return table contains repetitions?
Did anyone ever make a guide for migrating from oldcalc to bettercalc? I just updated and there's so many new bugs that I have no idea how to fix
rewrite any calculate functions that weren't written like a joker calculate function
đČ
I dont think repetition checks handle anything other than repetitions from memory
well shit
What does that MEAN
calculate functions did not all behave the same way before
now they do
they all act the way joker calculate functions always have
they actually work better now
so the migration guide is to make all your calculate functions act like joker calculate functions
because they all return to the same place (except repetitions lul)
well at the very least this implementation does add the repetitions, even if it doesnt do any juice up effects or anything on the 7s
this code i referenced baseball card gets this error, what could be wrong?
joker_main doesnt have other_joker
oh
what should the context be then
I mean it gets the same error if joker_main is removed so idk what it is
if context.other_joker then
what is the purpose of blueprint setting context.blueprint_card = context.blueprint_card or self instead of just doing context.blueprint_card = self
thanks
can anyone please explain to me how i can make a voucher add an additional voucher to every shop
ive been struggling like hell
ortalab has one of those, maybe you can check how theirs works
i think they only have one for boosters but ill recheck thanks!
oh my god you are right
lifesaver
lol the voucher one is tier 2 of the booster one too
it's so cool waht you can do with this game
what does kraken do?
wait did you make ortalab?
this is sick, love it
I am the main dev for it yeah
this game is like clay and we can create anything from it
wow great job on it absolute 10/10 mod, thats how i got inspired to make my own
2 text boxes is almost as exciting as whatever the hell that particle light show is
wait is Kraken just Universe with downside
(based universe is op)
what is universe
oh man
well thats all the impetus i need to nerf universe lul
(it needs it tbqh /gen)
hellow fellow people
That double desc looks sick
What's the function to destroy a card?
this doesn't matter anymore & everyone has moved on but i may be incredibly stupid
i know riiiiiightttttt
idk how i didnt notice this line at the top of my file the entire time
six suits's back đ
Is there anyone familiar with crashes that might be able to help me?
i probably can but I'm not capable of telepathy, so please do share the crash with us
i think there were actually alt sprites somewhere i could add
Kisses and hugs if anybody knowsđ
Whatever sixth sense uses
To destroy when played
uhhhh if you mean the stuff i did, that was my jank center override code that doesnt work anymore
I already have the context and id checks
idr who made them, I just remember seeing alt colors for my suits somewhere
hm i don't like the camelCase params in here
@wintry solar can i get a review on this sometime? I've gone over most of it but i wanna be sure I'm not missing anything important. ty
aure how cursed is it to run SMODS.calculate_context from a joker calculate function
uh that looks quite cursed, esp with joker_main not using calculate_context the first time
based
anyone have an idea of how i might change what the cost displayed on the Reroll Boss button is? i've already changed the functionality i just cant find where to change the visual
phuck it's so hardcoded
that's functions/UI_definitions.lua
ah thank you!
I'll take a look tomorrow when I've figured out how deck skins work đ€Ł
they're a bit jank haha
Does anyone have a color palette for Spectral cards handy?
Theyâll fit right in then!
indeed
one thing I'm not entirely sure about (and haven't tested) is different palettes within the same suit
palettes are saved per suit, so switching from one skin that has a palette to another skin that doesn't have that same palette should make it reset to default and stay that way even when switching back to the first skin
i'm not sure if this is wanted
or if palette settings should also be saved per skin?
I'm assuming this doesn't fix "nil"?
đ
yeah i didn't mess up the fix, looks all good
you sure đ
(somehow the contrast one is fixed though? đ€)
oh I see, you always reset G.COLLABS.colour_palettes[self.key] = {}
tis on my branch? can't repro
i'm doing those exact steps and it doesn't happen on my end..
what commit are you on
đ€š
hold on let me make sure it's not a different mod or anything
oh, fun
you actually need to have one of the custom artworks enabled
(not default)
you have that?
anyway I'm on 20c6df1e873f4759fe0d9ecc9a7206b2a220ab58
oh mkay got it
didn't have the custom artwork?
yeah
Hey does anyone know if you can change the already made joker's names like changing the cermonal dagger to (insert name here)
you should be able to overwrite the localization name
do you know how to do localization?
Like get into the archive files?
I guess that's how you can read balatro's localization?
no I meant how to do modded localization
https://github.com/Steamodded/smods/wiki/Localization has a pretty decent explanation
Ok so find what matches in the archive?
you have to find the matching key? but you shouldn't even need to go into balatro's localization
one sec I'll give an example
Ok
ok should be fixed
if you have this localization/en-us.lua file with:
return {
descriptions = {
Joker = {
-- make sure you get the right joker key - they can be found in game.lua:368
j_ceremonial = {
name = "Name!",
-- in case you want to change description:
-- text = {"line1", "line2"},
}
},
}
}
yes found it
(this obviously will only work for when you have the game's language set to english)
ohhh i see thank you
-# does it though
does it not??
but the ability's still work right?
interesting đ€
yeah i just thought that might happen
hmm
defaults being weak caused other issues
yeah the ability should still work fine
ok
maybe en-us can be a weak default if a different language is selected and keep default as a strong default
Seems like it works! Though I'm not sure the second G.COLLABS.options[self.suit] = at long link is needed
pretty sure it is because I'm resetting G.COLLABS.options to empty
Thanks It Works
Yeah in pre_inject_class right? But you already set G.COLLABS.options[self.suit] earlier in inject:
G.COLLABS.options[self.suit] = G.COLLABS.options[self.suit] or {def}
...
G.COLLABS.options[self.suit] = G.COLLABS.options[self.suit] or {}
oh right I forgot about that
anybody know why this is crashing?
brand new to lua
assume i messed up the syntax somehow
can you just copy-paste lines 45-54 in a codeblock in chat here? đ€
i am slowly discovering new things about this
so as it turns out what is happening is not that card: effects collide with eachother when multiple events are in one function, but rather the existence of more than one event in the same function seems to mess with card: effects even if theres only card: effects in the only one event
god i hope that makes sense... i dunno how to word it better
i am so bad at events
so am i!
I might have to nerf Letter Blocks
I see in the rules: "and no discussion of debugging the source code"... I have a question that might fall under that. Anyone know what that entails?
I don't think anybody actually knows
how do i stop this
thunk will wake up one day and decide lovely patches are now illegal
like jimbo dialogue or what
yea
you need a localization key
I ended up fixing it, thank you tho!
nice job đ
card:say_stuff(5,nil,{
monologue = {"start1"},
pitch = math.random(2,4)*0.2
})```
you shouldn't need that second part in say_stuff
I am learning to program to create a neural network that can play Balatro. I would like to read the memory of the game to accomplish this rather than use visual inputs... Any idea on how that can be accomplished?
but the rest seems fine
do you possess a supercomputer by chance
Lol, no, but it's not that deep
i doubt any neural network can handle the amount of input that's necessary to make a balatro ai work
Maybe. I'm only learning, but I suspect it can
what programming language are you using for this neural network? python I assume?
Yes
alright
Which is why visual inputs would be easiest, but I'm not doing that
this event is doing its thing and i dont know how to stop it

