#💻・modding-dev
1 messages · Page 283 of 1
you can patch that behaviour out yeah
surly
there's quite a few things you need to change if you want that to work properly
(i learned this from boss rush)
nothing i have off the top of my head though
what function is run when you win a boss blind?
welll i can check if the current boss blind is the one from my mod's
if it is, dont advance ante
:p
oh yeah
and also the Upcoming and Defeated text
that actually gets screwy believe it or not
oh and also finisher blinds
they win the game even when not in boss position
u mean showdown blinds?
I'm thinking of making a custom Pepsi one... worth the effort?
not sure if skips will show up
is it worth the effort making a "self-insert" joker that high quality lol
i will keep note of that, thanks
calculate = function(self, card, context)
local enhanced_cards = 0
if context.individual and context.cardarea == G.play and context.scoring_hand then
if context.other_card.config.center ~= G.P_CENTERS.c_base then
enhanced_cards = enhanced_cards + 1
end
end
if enhanced_cards >= card.ability.extra.cards then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
G.E_MANAGER:add_event(Event({
func = function()
message = 'Upgraded!'
card:juice_up()
return true
end,
}))
end
if context.joker_main and card.ability.extra.mult > 0 then
return {
mult = card.ability.extra.mult
}
end
end
why would this not work for upgrading the joker? I tried playing 3 enhanced cards and it just didnt get any mult
Try SMODS.get_enhancements(card) instead
That gets you a table of the enhancements the card has. If you put it in a next() wrapper it'll get you the functionality you want
huge
thank you
let me try

calculate = function(self, card, context)
if context.before then
local enhanced_cards = 0
for _,v in ipairs(context.scoring_hand) do
if v.config.center ~= G.P_CENTERS.c_base then
enhanced_cards = enhanced_cards + 1
end
end
if enhanced_cards >= card.ability.extra.cards then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.mult_mod
card:juice_up()
return {
message = 'Upgraded!'
}
end
end
if context.joker_main and card.ability.extra.mult > 0 then
return {
mult = card.ability.extra.mult
}
end
end
probably try this instead
its more reliable to handle all the enhancing stuff in context.before
legend
trying now
actually throwing
lol dw i fixed it
😭 im glad you found that
i saw it error and was like wait
theres the loop
does it work btw :3
ah icic
💔
it works! thank you so much :)
np :D
would i have to add "and not context blueprint" anywhere for the upgrading thing?
i dont think it should be an issue
true
im gonna jump off a building
average shaders coding experience
How could one put a seal on a consumable?
lovely patches probably and drawsteps
its not a shader
i made a function to handle the animated joker easily for me :3
but SMODS already provided that function now, sooo
they did?
mhm
heard its buggy though
🤷♂️
im gonna be honest
i dont know what the fuck im looking at
like, at all
:3
Tables upon tables upon tables... much like consistent HTML design back when Netscape 3.0 was relevant from what I heard?
im trying to make my own create_UIbox_blind_choice function to handle creating a boss blind in position of a small blind properly
but like
-# am i supposed to understand ALL of those????
all i have managed to figure out is that i dont want those
thats the Up The Ante ui gone
How?
What would be the best way to make it so a modded tag does not show up naturally
find where the tag is defined in the code, and then add
in_pool = function() return false end
replace the existing in_pool function if there is one
possibly dumb question, how would I make it so that there's a 50% chance for something to activate, but if it doesn't, it activates something else?
You do if pseudorandom('seed') < G.GAME.probabilities.normal / odds and then put the other thing in else. I think.
Never got an answer to a question I asked a while ago, is there a context for other cards being scored for enhancements? I wanna make a card gain X0.5 mult for every other scoring card
So every second card that scores will upgrade it by 0.5?
I mean cards that aren't the enhanced card
4 cards score, and then it gives X3 mult, because it's X1 + 0.5 + 0.5 + 0.5 + 0.5
Try this. ```lua
local addedxmult = 1
for k, v in pairs(context.scoring_hand) do
if not SMODS.has_enhancement(v, 'm_prefix_enhancement') then
addedxmult = addedxmult + 0.5
end
end
config = { extra = {Xmult = 1.25}} How would I add a second Xmult here?
What do you mean?
I mean I want 2 Xmult effects here but I don't know how to add the second Xmult to config
Call it Otherxmult or something.
So there isn't a context for it, got it
Such a challenge AND you have to score that many chips? You're insane!!!
The variables can be named whatever you want
Ohhhhh, I thought that was the name of the effect
I mean Balatro has some variable tied to effect, but using an extra table is 100 times better 😅
there we go, i can change both small and big blinds now
you are fucked
i just have to hook to end_round() so that it wont advance the ante when i beat the boss blind, and i should be good
YOU ARE FUCKEDDDDDD when I play on Jokerless
mmm
actually not sure what im supposed to do here without patching
gah
Replace them all by boss blinds trust
that's quite small
the thing is that currently, beating ANY boss blind rn, even when its supposed to be in the position of the Small blind
will advance ante by 1
thats not good
that makes sense
How could one make it so when I put an enhancement on a joker it doesn't replace the joker?
oh, enhancement
uhh. for normal cards, the enhancement replaces the base card, and the rank/suit is a separate transpareng png that's overlaid on top of it
so for starters you would need to make versions of each of the enhancements with transparency to be laid over the Jokers
I'm looking at card:set_ability() now and uh
that process seems like it would be super involved to implement
at a glance it seems like both enhancements and a joker's effect might both occupy the card's "ability" field and that they may be mutually exclusive with the current implementation
I could also be wrong though
you might be able to define a new custom field for an enhancement on a card whose set is joker and get creative that way?
alternatively, look at how cards have editions set and do something similar with enhancements
any way you slice it the implementation is going to be cursed lol
all of this goes beyond my current understanding of the game
GUESS WHAT
NO PATCHES :3
Balatro
Wouldnt have won that first blind without DebugPlus
i cant even imagine winning anything without a joker 💔
i'm trying to put a permanent UI that shows the boss blind directly above the jokers, but i'm not sure if i'm not doing something to make an AnimatedSprite work like it should. do i need to add any of this?
-------------------------------
-- IN UI_definitions.lua
function create_UIBox_blind_tracker()
return {n=G.UIT.ROOT, config={align = "cm", minw = 1, r = 0.1}, nodes={
{n=G.UIT.R, config={align = "cm",id='blind_tracker',minw=2, minh = 1.6, nodes={
}}
}}}
end
function update_blind_tracker()
local type = "Boss"
local blind_choice = {
config = G.P_BLINDS[G.GAME.round_resets.blind_choices[type]],
}
blind_choice.animation = AnimatedSprite(0,0, 1.4, 1.4, G.ANIMATION_ATLAS['blind_chips'], blind_choice.config.pos)
blind_choice.animation:define_draw_steps({
{shader = 'dissolve', shadow_height = 0.05},
{shader = 'dissolve'}
})
local tracker = G.HUD_blind_tracker:get_UIE_by_ID('blind_tracker')
local node = {n=G.UIT.O, config={object = blind_choice.animation}}
if tracker.nodes then
tracker.nodes[#tracker.nodes+1] = node
else
tracker.nodes = {node}
end
end
-------------------------------
-- IN game.lua Game:start_run()
self.HUD_blind_tracker = UIBox{
definition = create_UIBox_blind_tracker(),
config = {major = G.ROOM_ATTACH, align = 'cm', offset = {x=0,y=-5}}
}
update_blind_tracker()
How do I give myself a specific Joker?
i took the animation stuff from create_UIBox_blind_choice() in UI_definitions
card_ = create_card("Joker", G.jokers, nil, nil, nil, nil, 'j_prefix_key')
card_:add_to_deck()
G.jokers:emplace(card_)
How could one calculate a joker that isn't present?
what function rerolls the boss of the next ante when you beat it?
Which bits do I need to edit to create a modded Joker?
Change prefix to your mod prefix and key to the key of the joker.
now it's giving errors about 'center'
Show your code.
`SMODS.Keybind{
key = "jokercreate",
key_pressed = "j",
held_keys = {'lctrl'},
action = function(self)
card_ = create_card("Joker", G.jokers, nil, nil, nil, nil, 'j_SSSmods_blank_jok')
card_:add_to_deck()
G.jokers:emplace(card_)
end,
}`
@daring fern
Is SSSmods your prefix?
and blank_jok is your joker key?
yup
local card_ = ...
Oops! The game crashed: functions/common_events.lua:2295: attempt to index local 'center' (a nil value)
is the error message
When does this happen?
when I press Ctrl+J (the keybind)
Are you sure SSSmods is your prefix? because it works fine for me.
The one in the atlas?
nevermind
I figured it out
I'm dumb
Yooo
So I'm tryna figure out
where is add_joker? I'm trying to find it in context to see how it works
Joker enhancements:
huh.
Did you forget to emplace?
yeppers
i guess?
@agile thistle i managed to do this without patches lol
WHY ISN'T THIS WORKING!111
function KMOD.DRAW_THESE_FUCKING_CARDS(card, layer) -- WHY ISN'T THIS WORKING!11111
if card.ability.pin then
local sprite = KMOD.pins[card.ability.pin].sprite
sprite.role.draw_major = card
sprite.VT = card.VT
sprite:draw_shader('dissolve', 0, nil, nil,
card.children.center, 0.1, nil, nil, nil)
end
end
they shouldn't give money if they score in my opinion but you should boost the amount of money they give too though
SMODS.Joker {
key = 'PHarrier',
loc_txt = {
name = 'Pepsi, Where\'s My Jet?',
text = {
"When {C:attention}Blind{} is selected",
"creates a negative {C:Uncommon}Diet Cola{}"
}
},
rarity = 3,
atlas = 'PepsiHarrieratlas',
pos = { x = 0, y = 0 },
cost = 7,
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.Xmult, card.ability.extra.Xmult_gain } }
end,
calculate = function(self, card, context)
if context.setting_blind then
return {
add_joker("j_diet_cola", negative, true, false)
}
end
end
}
Am I able to remove the loc_vars, or is that a necessary component?
yea
but i would recommend adding a info box thing for diet cola
Truuue
wait how do I do that
I've used loc_vars before but not for an extra info box
info_queue[#info_queue + 1] = G.P_CENTERS.j_diet_cola
Try this instead
SMODS.add_card({key = 'j_diet_cola', edition = 'e_negative'})
In the localization folder
Thank you good sir
How would wild work on a joker?
triggers regardless of whether a condition or chance is met
If you use the function is_suit() to check the suit of your card and it's a wild card, it will always return true
I need an example of a description listing another joker. If i have the Diet Cola in my description, would i make it {C:green} for uncommon or...?
No, I was asking how the wild card enhancement would work if it was on a joker.
Oh
Imo if I were to do something like this, I'd make every Joker that requires a specific suit work on every suit, but that sounds tedious to achieve
And it would be useless on non-suit including jokers
which one shoul i work on next
steamhappy
TURN ON HIGH CONTRAST CARDS
IM LAZY 🗣️
THERE IS A CAR
Hey yall, getting a weird 'ghost' card appearing? I think it has something to do with the way my joker is destroying cards
Like my deck is drawing more cards thatn I have?
You need to use context.destroying_card I think.
Cheers I'll try that
hey guys i just started modding and im getting this error
is this a reasonable effect for a small blind
Oops! The game crashed:
Syntax error: card.lua:2243: <goto reverie_skip_create_card> jumps into the scope of local 'edi'
Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-0309b-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.7.1
Platform: Windows
Stack Traceback
(3) C function 'function: 0x2db5af10'
(4) global C function 'require'
(5) main chunk of file 'main.lua' at line 884
(6) global C function 'require'
(7) LÖVE function at file 'boot.lua:323' (best guess)
Local variables:
c = table: 0x2db5f038 {identity:false, version:11.5, accelerometerjoystick:true, modules:table: 0x2db5d8d0, gammacorrect:false, title:Balatro, externalstorage:false (more...)}
openedconsole = boolean: false
confok = boolean: true
conferr = nil
(8) global C function 'xpcall'
(9) LÖVE function at file 'boot.lua:362' (best guess)
Local variables:
result = boolean: true
(10) global C function 'xpcall'
(11) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
func = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
inerror = boolean: true
deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])
my mods
open the cryptid folder and make sure it's not nested
does this seem fair
If you're making a mod, this is the place. if it's just compatibility problems with mods you're just playing with, then #⚙・modding-general is what you need.
its good
oh sorry im new to this
destroying cards AND gaining $7 on top of that?
sure :3
no problem homie
I have the typing skills of a dyslexic penguin I swear...
Whereabouts?, tried it here and it just didnt destroy the card
hello guys, can someone help me with this issue im having with patches? i don't really know how to use them
You need to replace context.after with it
You need to put remove = true in the return.
Trying to balance these a little in terms of cost and rarity, but I don't think I've quite got it right.
Super-Cruising = $5
P.W.M.J? = $7
Stellar Collapse = $6
Singularity = $16
within the add event? or the return just further down
The last return.
okay, its destroying now, but it's destroying every card
i wont lie
the first joker is INSANELY good
after 1 hand, it goes straight up to X2.75??
😭
Yeah I need to tweak that as well
i think increasing by X0.25 or X0.5 instead is better
since one-shotting blinds is usually what we do anyways
tru...
You need to remove the event and you need to check if context.other_card is a card to be destroyed.
nop
you still check context.destroying_card
theres no context.other_card
but also, i think you should use context.destroy_card instead
its a context provided by smods (from what i have heard), and its better than context.destroying_card because it seems to affect cards in hand too
And what do you reckon about the prices/rarities?
since from my experience, context.destroying_card doesnt target as many fields as context.destroy_card
Okay well currently looks like this
stellar collapse should be rare
other than that, i think everything is fine
actually, nvm i still think rare is the right rarity, idk
mmm
Yeah it's a tough one. Need to balence out the rarity with how many high cards need to be played
use context.destroy_card instead
and you dont need the event
just returning remove = true will handle those animations for you
Shit really? sick!
Maybe if it's rare, you only need 10 high cards or something
but also, you need to make sure that context.destroy_card is in G.play.cards
else it will destroy everything
@humble girder I'm checking the details on the card upgrade system you added to smods. Am I right in seeing that you added a separate implementation of bonus chips that's separate from the way vanilla Hiker does it?
-# isnt it the same
🤔 no i'm pretty sure vanilla hiker does it the same way?
That's what the documentation says as of like 30 mins ago
Oh, yeah, you're right. I'm confusing the way editions add bonus chips with the way hiker does it
That also explains a bug in my code, haha
but also wtf was i smoking when i wrote this
editions dont work the same as bonus cards and hiker, unfortunately
Sorry, real quick. How do i put the context in G. play. Card?
context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus
you dont need a context for that
G.play.cards is retrievable everywhere
Meth. Quite possibly meth.
at least do context.other_card.ability.perma_bonus = context.other_card.ability.perma_bonus + 0 man
💔
I mean, it makes sense, because you wanna be able to remove editions, and not perma bonus of chips. But because they're called .bonus and .perma_bonus, I've seemingly used them both without realizing there were ever two
yep context.destroying_card is a vanilla context that we couldn't have expanded on. So destroy_card continues to only be set for played and scored cards. They're part of the same context calculation though
:3 no
editions don't even add bonus, or they shouldn't really
possible water break time lmao
editions should just be returning a calculation like a normal person
no, they just call it a bonus, but it's just chips from the edition
but you can add it onto a card, and it'll show as a bonus on the ui, even without the edition
that seems incorrect though
Actually, no. All of you. Water break time. Stay hydrated.
which is why I didn't notice I was using both systems interchangeably
i don't think vanilla editions show up as a bonus at all
Do someone have the link to the tutorial about UI stuff in modding?
thanks aure :p
they show up as an info queue only
How do i go about coding this. Im new to it sorry
i thought the best one is documented in smods already?
I think that's true for when the edition is on a card, but if the card has a .bonus in its ability, it automatically shows, I think
ah, wait
I'm changing it over in my own code now, but lm grab an old version of Kino to grab a screenshot
Oh I didn't know it was moved there, will look for it ty
whatever it is you're doing i just want to say: don't
return { chips = card.edition.chips } from calculate pls
No, haven't done that at all. just some old jokers and enhancements in my mod that still use 'card.ability.bonus' as the container for bonus chips rather than 'card.ability.perma_bonus'
enhancements should use card.ability.bonus
the thing you should consider, although set_ability is kinda trash is: card.ability.X is for enhancements, perma_X is for things not tied to enhancement
Oof yeah, i'm aware, just typing before the thought is fully formed, haha. But some enhancements check for bonus on cards, and that I'm changing over
in fact, if set_ability wasn't trash, card.ability.bonus would be reset every time you change the enhancement on a card
if context.destroy_card and next(context.poker_hands["Three of a Kind"]) then --Check if you are playing Three of a Kind
for _,c in ipairs(G.play.cards) do --Check all cards in your playing hand. If you want it to only be scoring hand - use context.scoring_hand instead
if c == context.destroy_card then --if context.destroy_card exists in there:
return {
message = "CRUNCH!",
remove = true --Destroys it.
}
end
end
end
(hint: it isn't)
i hope thats clear enough :p
(because vanilla code is bad)
i REALLY hope thunk doesnt hate modders because of how much we trashtalk his code lmfao
is not trash talking the source code basically one of the rules of the server? 😛
i had this joker which scales on how many chips a card gives, that includes editions and enhancements
unfortunately, i had to hard-code editions because its simply not possible to also account for modded editions that give chips too 💔
My confusion mainly came from .bonus functioning exactly like .perma_bonus, so I never really noticed there were two, haha, but luckily that's fixable
this guy speaks magic words
(so does .bonus if you have baliatro enabled cause i patched in the behaviour)
🧙♂️
i suspect at some point hiker was hitting .bonus rather than .perma_bonus
can i use baliatro as a library instead :3
and whatever custom logic exists in set_ability for handling .bonus is a remnant of that
I take it you're one of the heavy hitters in the mod community?
Cause as I am a noob, you're speaking greek rn
And I speak greek...
i don't have an iota of an idea if that's true
It is now
im still surprised i managed to add "boss" small blinds ngl
WITHOUT researching anyone's code this time
My dumb ass hovered my mouse over the joker to see its effect 😐
i will do it for u 😭
I should refactor a lot of the older stuff in Kino, honestly. A lot of the bugs I'm seeing come from me not understanding SMODS properly, so a lot of the implementations are just accidentally doing kind of what I wanted, instead of being well-written code
keep that in mind when you use baliatro for any sort of reference
the closer to the top of the file the code is
the less understanding i had of SMODS/balatro lol
that goes for a lot of mods
Haha, I'm luckily no longer just copying code, but just trying to see if I can find the logic, and then checking with other mods or documentation to see how it works
smae
partially because I'm past the point where the things I'm implementing have very direct analogues in other mods, honestly
Not smae
if you come across chef joker (it's not an upgraded one) that one might confusingly not interact with perma_bonus
that is intentional since it upgrades the enhancement, not the card
this works, but Only want it to destory one random card in scoring hand, this destroys the entire scoring hand
i should probably put something about that in the loc txt
ah, icic
Hence the pseudorandom element
my original implementation of the sci-fi card was that it'd not upgrade itself but would take every upgrade applied to the base card and apply it to itself, and changing that over to my current system's got a beautiful mess of code that does what I need it to do, but will act very strangily if it's to interact with other mods, haha
my bad, shouldve made that clear
Is it bad that I still can't fully figure out how to navigate GitHub?..
if context.before and next(context.poker_hands["Three of a Kind"]) then --We mark a random card.
local radCard = pseudorandom_element(G.play.cards,pseudoseed("your seed here"))
if radCard then radCard.ability.marked_by_your_joker_or_smt = true
end
if context.destroy_card and context.destroy_card.ability.marked_by_your_joker_or_smt then --This one checks if context.destroy_card has the mark.
return {
message = "CRUNCH!",
remove = true
}
end
no if you're just modding as a hobby, yes if you also have a dayjob as a developer, haha
this is how id do it
Closest I'll get to dev is Electrical Engineer... wait...
damn
Hahaha, does that randomly pick art??
git's probably worth reading up on the functionality of once you're working with multiple people on the same project. Until then, as a hobbyist, it's entirely fine to be baffled
Valid
I used to know how it worked in cmd, then nobody that worked in linguistics research knew how to use it so I stopped using it and now I'm just struggling to use the desktop app and hope that's good enough, haha
i use those ones the most, it enhances the cards while also adding the effects i like
oh i wish
i want to disguise it as a joker but with the wrong price so its identifiable
but that's so hard
making it randomly pick a rare joker shouldn't be too difficult, right?
probably not
not as hard as you think actually
... I should override the chips message that .bonus applies, because there's no reason for it to show
really ??
you can grab the joker spritesheet from balatro
oh no i mean like. description too
then in set_ability (aka when it appears in shop), change the joker's sprite pos randomly
oh, uh
i forgot how to do that, sorry
💔
you could do that in set_sprites, no? Also, if you write a custom generate_ui, you could make it grab the matching description
oh hmm
probably a way easier method as well
Thanks :)
Is there a global table of all the suits in the game? (Thus also covering modded suits)
Every suit including ones that arent in the deck?
yeah
it has been done
very cool!
i also threw in cavendish into the pool
gotta get the people on their toes "hang on i didn't buy michelle this run..."
If you want to make it so the in-shop text is even cheekier, you should set it up to use dynamic text, and just make it change over to the proper description for a few frames every few seconds 😛
r those odds fine? if it hits the 1/3 then it will summon a random "boss" small/big blind
1/3 happens more often than you'd think
mm got it
what would be the best chance to go with then?
they arent too hard, so maybeeee 1/4 is fine?
is something wrong with this..
idk im just usisng the SMODS doc n tryna work from ther
in that case, a lot of stuff is wrong here
first of all - discard == true is not something you can do
i think that was when i was tryna mark cards but i just settled with remove n just forgot to remove it
and secondly, you cant run those in return
don't use card.ability.extra. in the return
also those are ==
you want to define, one equal
im guessing the effect intended is discarding cards = destroying them or smt?
New to modding. How hard would it be to make a Joker that checks if you have one of a pool of specific Jokers, then adds mult and shows a unique message for each joker in its pool?
one sec, i think i can write something up
how does the game handle sorting the cards in the collection?
like say i have a legendary and a common in the mod i made would it automatically show the legendary last?
No, you would have to define them in that order.
there is no sorting, all manual
super doable!
i wonder how neato jokers does it cause im following how they did the jokers (separate files)
They defined them in that order.
I've also set up each joker as an individual file. My method is to have a list of all joker keys that the game reads in when loading jokers, and then load the jokers based on that order. I think Ortalab does it that way, and that's generally a good codebase to check, due to Eremel also working a lot on smods code
oh cool I'll check that then
if context.discard then
local moneyEarn = 7
if not SMODS.has_enhancement(context.other_card, "c_base") then
moneyEarn = 10
end
local cardToBeDestroyed = context.other_card
G.E_MANAGER:add_event(Event({
func = function()
ease_dollars(moneyEarn)
cardToBeDestroyed:start_dissolve()
return true
end
}))
end
here
oh wait, get_enhancements still works if the card is c_base, one sec
@reef belfry here, it should work properly now
just realized i could just do
local moneyEarn = (not SMODS.has_enhancement(context.other_card, "c_base") and 10) or 7
instead of
local moneyEarn = 7
if not SMODS.has_enhancement(context.other_card, "c_base") then
moneyEarn = 10
end
but im too used to doing it the lengthy way :p
bump
How could I check for context.post_trigger but only when scoring?
dunno, that seems hard unless you hard-code it into specific contexts
Could you do
If context.joker_main(or what ever it is) and context.post_trigger
You can check what context the post trigger is from
It’s context.other_context.whatever iirc
Woah
trying to test a card that can tell you where in your deck other specific cards in your deck are and i draw all the cards its supposed to find before i can actually draw it to find them
oh my god it hapepned again
How could I draw a seal on a consumable?
are you
are you doing seals on everything??
I'm just putting things that aren't supposed to be on things onto those things.
tha
thats confusing
but what you are working on is really nice, im looking forward to it :3
unfortunately i lack knowledge about this kinda stuff so i cant help, sorry
What I mean is I've got enhancements on jokers along with seals.
mmm
i dont think seals on jokers is a good name for your mod at that point, is it
stickers on cards when?
good morning
The eternal sticker was unexpected but I still had to code it in.
good morning random dud
intriguing!
good schmorning modding dev
good evening dilly
good evening bepis why are you cola
i was always conke, wdym
its based on the hit game honkai impact 3rd
im going to eat your mod
💔 no
too late already took a bite
spin
spin
spin
How do I fix this?
what do you guys think?
Are the 2nd and 3rd ones when scored?
yes
hiya! my Ghost cards don't quite work — when unscored, all Ghost cards gain X0.25 Mult, instead of just the one that didn't score
plus, the card_eval_status_text appears on the top-left
i know it's something to do with the use of self here, but what exactly did i do wrong?
Change everything from self to card
grand
congrats you've probably going to get me an infinite amount of times when playtesting in the future
i really wanted that drivers license
Change loc_vars to loc_vars = function(self,info_queue,center) and center.ability.h_x_mult
Change all instances of card.config to card.ability
Hey gang how do I make those "all x count as y" cards
For ranks?
I'm trying to make all face cards count as jacks queens and kings
You would have to redefine all jokers that use those ranks.
Both work I think.
Yes you would check if it's a face card and check if it has that enhancement.
Kewl ty
balatro how tf am i supposed to fix an error if you wont let me see it before just entirely closing yourself
You could check the lovely log.
theres. no error in the log?? it just crashes?
wtf
ok the error seems to be caused by me running my deep_copy function on G.deck.cards
As they said it won’t work with mods
You’ll have to modify all vanilla effects individually
Including Straight calculation
Which I think is replaced by SMODS
Maybe it’s running out of memory
I’m not sure what you’re doing but if a table contains (a reference to) itself maybe it’s an infinite loop
true
Does this happen because the game doesn't put the cards back because they would be destroyed?
you could just set the prob of every glass card with a sticker to 0
I don’t know what you coded
Hello dilly
I can see they have stickers on cards
I still don’t know what they coded
Yeah I imagine the cards are removed from the deck either during the vanilla calculation or SMODS’
So you’re in the wrong place
You want to stop cards from being destroyed at calculation level, not animation level
how would i destroy cards
During scoring?
yes
Use context.destroy_card and return remove = true
ok
How?
With a patch probably
what do we think about this
i thought that said ti-30
haha, maybe add a dev-mod only sticker to it 😛
is this correct
no
hmmm
you don't return contexts, and every thing you return nedes to be matched with a key for the game to know what to do with it. These keys are hardcoded
ease_ante(number)
The Jet Joker Mod is up and running. Many more additions to this set to come. Yaaay.
What do I patch?
Gotta get yourself a F/A 18 E/F super hornet in there 😎
Going straight into the README TODO list
Back when I was in the navy I was around them alot for my last year and they're some wicked cool jets
Dude I've always loved how they look
I have a friend who got some wicked shots of them and I was pretty jealous ngl
Yea they're great and definitely assisted in giving my ass some tinnitus lmfao
Fax, here in Brisbane they fly around for the RiverFire festival, it's not quiet that's for sure.
I wish you great luck with your mod :D
Hi guys, is there a way to play a sound effect when a certain hand is played? Right now, it plays the sound effect when I just select the appropriate cards, not only when it is played!
does anyone know where I should look for creating a new mechanic for the game, I know it'll be difficult but was wondering if there was a genral framework for custom elements that anyone know of
yee I've got a card that does that, lemme pull up the code
It didn't seem possible within a custom poker hand, that I could see. Thanks @pseudo cape
well that depends on the mechanic, you have joyous spring which has a graveyard, you have star rail which uses blind expander for all sorts of multi phase bosses (and gacha stuff and more), you have aiko who has all sorts of words you can make and a math deck and more
the way I did it was a bit janky, but I just called the sfx during the calculate function itself, where it would print any messages
it worked though, and I've not experienced any issues with it
Oh cool, I did not try adding a calculate function to the poker hand, good idea
Surely just add and context.before?
I want to add a mechanic revolving around elder furthark runes, they're old symbols that some people use for divination, and I feel like it fits in well with balatro's general vibe, each rune has a meaning behind it too, I've got all the assets done (was using them for something else too) and a general idea of what most should do but no clue where to start with code
Check out ortalab, it adds Zodiac signs. Probably a good idea to start there
Upper middle class hand
whats your example look like
-- calculate is where the scoring and effects of the joker are handled.
calculate = function(self, card, context)
-- context.joker_main takes place when the joker is meant to score.
if context.joker_main then
return {
-- adds the number contained in the mult variable to the score.
mult_mod = card.ability.extra.mult,
-- message is the text that appears when the joker scores.
-- localize is used to make sure the text works across multiple languages.
message = localize {
type = 'variable',
key = 'a_mult',
vars = {
card.ability.extra.mult
}
}
}
end
-- context.after takes place after the hand is scored.
-- context.blueprint applies if the joker is a blueprint copy.
if context.after and not context.blueprint then
-- adds the gain variable to the base mult number.
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.gain
return {
-- another message, just prints the text.
message = "Yippie!",
colour = G.C.MULT,
-- plays the sound effect yippie.ogg. the prefix is needed.
play_sound("Coo29_yippie"),
-- needed, can be changed to context.other_card to apply to another card.
card = card
}
end
end```
that's my calc function, the sound is at the end
thank you!
I don't get the joke
white
Also this should make it so that the sound only plays with the hand but before scoring starts.
Here is my example block btw
example = {
{ 'S_10', true},
{ 'H_10', true},
{ 'C_10', true},
{ 'H_10', true},
{ 'H_2', false}
},
is that the right layout for the card sigils?
I've never added a custom hand so I dunno
do S_T
so effectively if ... and not context.*hand_selected*
as ref for how it works for me
sorry it was ace of spades before so ignore the comment
i just made the change to show you
Ahh, thank you!
np!
{
{'S_T', true}
{'H_T', true}
{'C_T', true}
{'D_T', true}
{'S_2', false}
}
oop
someone got to it first
weird that ten is different. When comparing to card rank, it is '10' or 10, but over here it is done differently
for some reason ranks above 9 never work if i use their id, so i use their letters
S_A, S_K, etc
its so that the IDs can be a single character
How do I prevent a playing card from being destroyed?
Thanks folks
This was one of the last things I was working on before releasing. I am nearly done with an animal themed mod that adds 5 custom editions, 3 new enhancements, and 32 animal themed jokers
These are two easter egg jokers with special unlock conditions
Armour
great job :D
thanks 🙂
im slowly inching towards release myself at 55 or so jokers and some vouchers and such
How do yall get the border and joker words on your cards? atm my process for making the sprites is jank ASH
i know my friend is an aseprite user and she makes all of my art but unfortunately i dont have much byond that
but jokers in general arent very consistent in their borders
vanilla stuff has little consistency
might be a dumb question but where is the code for pareidolia
card.lua
I know this is a few days old, but I was having the same issue. Couldn't figure it out for the life of me, then eventually I noticed that I had typed my function as use = function (self, area, card) instead of use = function (self, card, area) once I corrected the syntax it worked perfectly.
Fair, but just having a semi consitant white border with the mirrored joker words would really pull a lot of my stuff together, especially if I wanna go for a vanilla+ style as I add more jokers.
i think it's like probably gonna be in is_face() at least, that's how passive effects normally work
could check common_events.lua
Case sensitive?
Line 964 of card.lua specifically.
Also, might be a noob question
found it
So you can just return {message=“whatever”} and it shows the message?
How do I change my code colours in VSC??
Install a theme extension.
Unsure. I was messing with Wheel of Fortune and took the code from there. I would imagine as long as you're using any of the messages specified in the localization file, then yeah.
Or specified your own localization.
so is this right
No, you would have to hook is_face()
hook?
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...
great
You could do something like this. lua local oldisface = Card.is_face function Card:is_face() if SMODS.has_enhancement(self, 'm_prefix_facecard') then return true end return oldisface(self) end replacing prefix with your mod prefix.
How could one do this without the card not returning to deck?
Also how could I tell cryptid to put seals on jokers for the seal decks?
This might sound a bit niche of a question but I want to add another slot, so the "Joker" is in it's own slot with its own amount allowed, and only those types of Jokers are allowed. Is there any mod that kind of does that?
I looked at cryptid and it has the same problem.
You mean a new card area?
Basically, yea. Think of it as another Joker/Consumable slot
Baladrone does that I think.
is there a template for coloured jokers with the thicker white border?
theres a joker at the bottom of the pins in #🎨・fan-art , you can js get rid of the inside
border is 2px wide
How would you go about creating a joker that change a card's suit/rank to another ?
I tried using other modded jokers as a reference but could not make it work
Can badge colour have gradient?
What about Star/Moon/Sun/World codes?
I tried doing this : if context.after and context.cardarea == G.play then for i = 1, #context.scoring_hand do local _card = context.scoring_hand[i] local suit_prefix = suit_data.card_key event({ _card:set_base(G.P_CARDS[suit_prefix..'Q']) }) end end
true
idk if it applied for joker but I will check it out
I use :change_suit in my mod's code, if this would help.
thx
Capped initial, with s.
Wait, I didn't see the rank part.
You'll need Strength code in that case.
I think :set_base(which is what you're already doing) might be better.
very cool!!
Bruh I actually really enjoy doing sound design
If anyone wants help with sound stuff, HMU
be careful with that because I might just send you 50 requests immediately, otherwise 😛
Woah lmao, I'd do it, but IDK how long it'd take
I got assignments to do lmao
it's 2am... I have class at 8:30... Maybe I need to be a little more organized disciplined
Not at all
hahaha, I haven't looked into sound stuff at all, so asking people for sound stuff would be a bit too pre-emptive 😛 I'll worry about sound once I get these alien abduction shaders going
How do check if a consumable is being used and it is the consumable the seal is on?
I had just reset my body clock too.... 9pm bedtime my beloved...
was like 5am for me yesterday
And then I'll get to ask you to do shaders for me bestie
do you know how to get it working in game?
Honestly it's pretty simple, but then again my methods are crude so...
I'll send my code as an example
SMODS.Sound {
key = 'LJet_SCruiseUpgrade',
path = 'SuperCruising.ogg',
}
...
-- RESET IF 'UPGRADE' NOT FULFILLED - MORE THAN ONE HAND PER BLIND IS USED
if G.GAME.current_round.hands_played == 1 and context.hand_drawn and card.ability.extra.Xmult ~= 1 then
card.ability.extra.Xmult = 1
return{
message = 'Subsonic...',
sound = 'LJet_SCruiseReset',
colour = G.C.ATTENTION,
}
end
??
my smods.sound is set up within my main lua as if im trying to import it into the mod rather than calling it within the joker
Yeah it'd need to be in the same file as where you want to call it
Also, if anyone knows how to cancel a sound being played, let me know. I have a Joker that spawns negative Diet Cola's and I want the negative sound not to play when they are created.
Are you using set_edition()?
set_editon() has a silent option.
Yup, like this ⬇️
Ahhhhhh rightio
Wait I'm not very intelligent
How do I do this for the Diet Cola
I've done it to the Joker that spawns them......
Theoretically, each diet cola that freshly added to your joker slot will always be the last/rightmost joker, i.e. G.jokers.cards[#G.jokers.cards].
So you just need to SMODS.add_card({key = 'j_diet_cola'}), and then immediately G.jokers.cards[#G.jokers.cards]:set_edition('e_negative', nil, true)
I haven't tested it with the Pepsi Jet (joker that creates the colas) anywhere other than on the right, but like you said they should all spawn at the right regardless... Little janky but it should work.
am I cooking
working with an enhancement — how can i check if the enhanced card was played?
like, played and scored or just played?
ah ya, played and scored
context.cardarea == G.play is how its done usually but idk if it translates to enhancements
not sure about that
where would i put SMODS.Sound:register_global() ? if i even need it
can't seem to get it to work still, thinks im looking for the sound in the default files
What are your sound keys?
i just realized we have the same badge color lol
lmao
hello! im new to modding
got this within my jokers calculate
btw yes u are cooking
This is a good concept
me when my heart
agreed
is there a place i can learn what each parameter means?
no way it's the real astra maximus

then this higher up
hi astra
the docs 🗣️
https://github.com/Steamodded/smods/wiki
https://github.com/Steamodded/smods/wiki/SMODS.Consumable, using other mods as a reference, and trial and error
lol
specifically consumable 😭
me watching the doctor slip two green dice into my ribcage while operating on my heart
sound key has to be *ModPrefix_SoundFileName*
Hey whatever gets ya through the operation
It was the page I was currently looking at lol
thanks!
"I don't get paid enough muhnee for this"
"Just slap a gold seal on it"
rae have you seen my cursed jokers with seals 
#⚙・modding-general message
And another one :
😭
oh dear god
maximus has gone off the rails
still gives me the same error 😩
oh wait i didnt change it in both place
im dumb
Relatable
You only need to change it in the return, not the object initialization
For example
hello
Oh this is nice
Are your files nested as:
└──Test
├── Test.lua
└── assets
└── sounds
├── e_mosaic.ogg
├── music_big.ogg
└── music_jimball.ogg```
Fuck it leet text time
box building characters woauh
I leet my text till I baltro
yep
Wait I didn't even notice til you said that wtf
the power of ctrl+c ctrl+v
I had no idea those were basic ASCII characters
does the SMODS.Sound have to be inside the SMODS.Joker or can it exist outside it?
It can exist independently
The code that destroys the cards
Wait your SMODS.Sound is nested in SMODS.Joker?
It does not need to be
this is how i have it
No yeah I wouldn't
oh you don't need to specify sounds/
Code block time?
the sound attribute in the return should be [modprefix]_chomp
as we know doing the same thing over and over again in coding sometimes happens to actually solve the problem
yeah my prefix is Test rn
ah ok
set key as Test_chomp in initialisation
No don't do that
or is that another redundency?
if you do that then you would have to return sound = Test_Test_chomp
I wish I could help but this is something I've never seen before and have no clue what's wrong. Very odd
gives the same crash either way
this game hates me </3
dont need atlas_ there im p sure
its just there for organizing purposes
I mean if you're specifying that as a key it should be fine
how can i retrigger jokers in specified positions?
probably if context.retrigger_joker_check and not context.retrigger_joker and context.other_card == G.jokers.cards[position]
This error means SMODS isn't looking in your assets -> sounds folder
Show your file structure
It's almost always a key/prefix/file structure issue
What file type are your sounds?
ogg
Hi! Does anyone know how to modify the order in which cards are drawn? I'm trying to implement this Joker. I don't believe there are any Jokers in the base game that change drawing orders
Goated Joker art
aiko has a joker that changes draw order i think
i have the github for aikos mod open, one sec
Art from here: https://www.reddit.com/r/balatro/comments/1jhspkl/comment/mja2ekz/ - I'm helping to implement this collection. Very close to being ready for playtesting
@simple gull
Contribute to Aikoyori/Balatro-Aikoyoris-Shenanigans development by creating an account on GitHub.
yo why is my voucher still locked?
did you add this?
no, base game
Wait... huh? Maybe try SMODS.Sound-ing in each Joker file.
Try this. ```lua
local oldshuffle = CardArea.shuffle
function CardArea:shuffle(_seed)
local g = oldshuffle(self, _seed)
if self == G.deck then
local prioritys = {}
local otherones = {}
for k, v in pairs(self.cards) do
if v.seal == "Blue" then
table.insert(prioritys, v)
else
table.insert(otherones, v)
end
end
for _, card in ipairs(prioritys) do
table.insert(otherones, card)
end
self.cards = otherones
self:set_ranks()
end
return g
end
You would have to check the joker is present though.
Interesting. So this wouldn't be in the Joker code itself.
I have no idea how to do shader stuff, but maybe try adding the mod prefix to the shader key when specifying it in the edition?
smods. WHAT?!?!?!? 😱 ❗❗❗⭕ 👆
Could be if you do an if statement surely?
oh dear
nada
Yes, I would need to add code here that detects the existence of the Joker. I'm just assuming that this is not in the Joker object at all
anyone got any idea what's happening?
Corrupted file is my best guess
oh phanta is the prefix 
I'm definitely wrong
I mean, it opens on the computer
and I JUST imported it
Hence why I'm wrong
I could try reimporting it I guess
lfskins, its right there in the log
Atlases don't use prefixes
words come up multiple times so i wasnt sure
^
is there a way to automatically check if an enhancement's always scores argument has triggered (on the enhancement itself)
as in file name?
I'll let you know how it goes. Thanks @daring fern !
mhmhm
i say automatically because yes I could manually check if the card was scored by that but that would be annoying
don't use "lfskins_" in the palette atlas key
hey im just kind of super confused
i make a card debuffed and then add a joker using debug plus and then the debuff just washes away
is that normal
same error
Key name should be ModPrefix_FileName
I put it there since other mods like bunco were putting it there
dont need the prefix in the key!
bunco is not a mod you should be basing your code off of lmao
I just changed it, same crash
Everyone keeps saying this but it works?
yeah no, that didn't work either
everything i do that works doesnt have it
i use prefixes on my keys outside of the main lua like in my localisation files but thats it
Sorry no you're right, atlas doesnt need it, sound does (at least in my code that works)
Have I got an old version of SMODS?
I updated it like 3 days ago
it shouldn't be an issue with that
Hmmm, weird. Here's how I have a deck skin set up for reference if it happens to help at all
Yeah IDK, I probably have something goofy going on with my SMODS.Sound and SMODS.Atlas... But they work so oh well
so true
I should clarify, I'm new to coding and modding. I've been doing it for like 2 days.
So hopefully that explains any of my ignorence
ive been at it barely a week so nw lol
i think most of us in here are just as confused as the next person and js trying to help where we can
I’ve been doing this for months and I’m confused lmao
doesn't get easier you just learn more
i mean, some things get easier
Ehhhh I’d say it gets easier
once you're comfortable, you need less documentation 😛
but still some documentation. I need to figure out how sliders work for this #1353866504743161886 config and they're just not showing up
-# doesn't get you all that far in the first place, no offense to the smods team they've done a great job making modding way more accessible and easy
Heya
well i say that like i didnt get a mod working
been looking around for a potential answer to something I've been hunting down over the past day or so
im such a hater sometimes smh
do feel like this was very likely asked in the past though so, apologies if it is an annoying question
Just ask! No need to pander
np homie
We gotcha here
^^
been trying to look for a means to either replicate or copy Shortcut's effect into my own Joker, i.e. allow straights to be made with a gap, I know steammodded's got get_straight but for the life of me I cannot fully understand how to utilize it, been using this mod as a means to study lua so, very new, wouldn't call myself the best programmer either
that didnt work
does the atlas in the palettes still have the prefix?
it doesnt have to do with the deckskin
it has to do with the atlas not being able to retrieve the file
the file is 100% called ashie.png right?
I'm trying to make a joker which scales based on the player's full deck composition, like Cloud 9, it works as intended rn but idk how to make the description text always show the correct value the way Cloud 9 or Bull/Bootstraps have it
yes
the file is not corrupted either
It relates to your config
remove the underscore from the key on the off chance it thinks its a prefix?
Where I have #2# is a dynamic number, corresponding to the second value listed in the config.extra
Same with #1#
i know that
So add a config for it
idk how to make the text always stay up to date with the number of a specific rank in the deck
nope
oh mb
I've literally MADE atlases like this before I dont know why this one isnt working
oh!!! you dont need a comma on that last line in your atlas
bloody commas
and at the bottom after pos
and all those brackets at the bottom*
same error
also yes I do need those brackets
wtf are you saying
i mean the commas after them
if its at the end of smth it doesnt need a comma after it
it CAN have them even if it doesnt need them
also the problem is in the ATLAS
as I have said
you keep saying to change things in the deckskin
because that comes up first but if the whole thing is crashing its sometimes a weird formatting error, for me at least
if this is the case then theres 0 reason i can think of as to why it isnt working
is your smods updated?
Here is how it's implemented for cloud 9
self.ability.nine_tally = 0
for k, v in pairs(G.playing_cards) do
if v:get_id() == 9 then self.ability.nine_tally = self.ability.nine_tally+1 end
end
end```
i have that in my calculate function already and the card scores properly
it's just the description text im trying to fix
do you have it set up in config?
still no luck with my edition :<
i tried renaming the shader to just waxed.fs but it didn't work
it's in assets/shaders
what i think i need to do is make it so my total_mult variable updates more often but im worried about causing the game to lag if i make it update TOO often
if you dont already you gotta have them set up as a variable and assign a value in config outside the calculate
Bruh yeah Cloud 9 desc is hopeless in helping here
the language files take from the values and variables assigned here
Mainly cause I can't find its config
so #1# would be the value card.ability.extra.mult has
config = { extra = { mult = 4, ace_tally = 0, total_mult = 0 } },
loc_vars = function(self, info_queue, card)
return { vars = { card.ability.extra.mult, card.ability.extra.total_mult } }
end,
this is what mine looks like rn, i dont have ace_tally in loc_vars because the text box never needs the raw ace tally
needs to be there in the same order if you want it working in the desc
js put card.ability.extra.ace_tally
should work then
Worked like a charm, @daring fern . Thanks!
